query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
listlengths
3
101
negative_scores
listlengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Get Codec instance or NULL.
public function getCodec();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getVideoCodec()\n {\n if (array_key_exists(\"videoCodec\", $this->_propDict)) {\n if (is_a($this->_propDict[\"videoCodec\"], \"\\Microsoft\\Graph\\CallRecords\\Model\\VideoCodec\") || is_null($this->_propDict[\"videoCodec\"])) {\n return $this->_propDict[\"videoCodec\"];\n } else {\n $this->_propDict[\"videoCodec\"] = new VideoCodec($this->_propDict[\"videoCodec\"]);\n return $this->_propDict[\"videoCodec\"];\n }\n }\n return null;\n }", "public function getVideoCodec() {}", "public function getAudioCodec()\n {\n if (array_key_exists(\"audioCodec\", $this->_propDict)) {\n if (is_a($this->_propDict[\"audioCodec\"], \"\\Microsoft\\Graph\\CallRecords\\Model\\AudioCodec\") || is_null($this->_propDict[\"audioCodec\"])) {\n return $this->_propDict[\"audioCodec\"];\n } else {\n $this->_propDict[\"audioCodec\"] = new AudioCodec($this->_propDict[\"audioCodec\"]);\n return $this->_propDict[\"audioCodec\"];\n }\n }\n return null;\n }", "public static function get ($instance=false) {\n\t\t$cname = self::_resolve_class_name($instance);\n\t\tif (!empty(self::$_codecs[$cname])) return self::$_codecs[$cname];\n\t\t\n\t\t$obj = new $cname;\n\t\tself::$_codecs[$cname] = $obj;\n\t\treturn $obj;\n\t}", "public function getEncoder()\n {\n if ($encoder = $this->getCodecMatcher()->getEncoder()) {\n return $encoder;\n }\n\n $this->getCodecMatcher()->setEncoder($encoder = $this->encoder());\n\n return $encoder;\n }", "public function getAudioCodec() {}", "public function getVideoCodec()\n\t{\n\t\treturn $this->videoCodec;\n\t}", "public function uniDecoder()\n {\n if ($this->uniDecoder === null) {\n if (self::$defaultUniDecoder === null) {\n self::$defaultUniDecoder = new UniDecoder();\n }\n\n $this->uniDecoder = self::$defaultUniDecoder;\n }\n\n return $this->uniDecoder;\n }", "public function getVideoCodecType()\n {\n return $this->videoCodecType;\n }", "public function get_codec($id = null)\n {\n try {\n $codec = Codecs::findOrFail($id);\n $title = 'Change Codec';\n $new = false;\n } catch (ModelNotFoundException $e) {\n $codec = new Codecs();\n $title = 'New Codec';\n $new = true;\n }\n\n return View::make('backend.codecs.codec', ['url' => $this->url, 'codec' => $codec, 'title' => $title, 'new' => $new]);\n }", "public static function static_getDecoder($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function getCharset(): ?TagInterface;", "public static function init() {\n static $instance = false;\n\n if ( ! $instance ) {\n $instance = new WPUF_QR_Code();\n }\n\n return $instance;\n }", "public function copy(): static\n {\n $this->isCustomCodec = false;\n\n return $this;\n }", "public function setCodec(Codec $codec);", "public function getEncoder();", "public function getEncoder();", "protected function getEncoder()\n\t{\n\t\treturn $this->encoder;\n\t}", "public static function getInstance(): CharacterEncodingInterface;", "public function getTranscoder()\n {\n return $this->transcoder;\n }", "public function getEncoder()\n {\n return $this->encoder;\n }", "public static function static_getEncoder($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function getEncoder()\n {\n return $this;\n }", "public function getEncoding()\n {\n $content = $this->getHeaderLine('content-type');\n if (!$content) {\n return null;\n }\n preg_match('/charset\\s?=\\s?[\\'\"]?([a-z0-9-_]+)[\\'\"]?/i', $content, $matches);\n if (empty($matches[1])) {\n return null;\n }\n\n return $matches[1];\n }", "public function getDecoder($format);", "public function getAudioCodecType()\n {\n return $this->audioCodecType;\n }", "public function getInstance(): ?object\n {\n return $this->instance;\n }", "function getCharset(): ?string;", "public static function getInstance(): ?self\n {\n static $instance = null;\n if ($instance == null) {\n Tools::atkdebug('Creating UI color states');\n $instance = new static();\n $instance->initColorPalette();\n }\n\n return $instance;\n }", "public function getCharset(): ?string;", "protected static function _getBackend()\n {\n if (!isset(self::$_backend)) {\n if (extension_loaded('intl')) {\n /* Only available in PHP > 5.4.0 */\n self::$_backend = defined('INTL_IDNA_VARIANT_UTS46')\n ? 'INTL_UTS46'\n : 'INTL';\n } else {\n self::$_backend = new Horde_Idna_Punycode();\n }\n }\n\n return self::$_backend;\n }", "public function getEncoder($format);", "public function setVideoCodec($val)\n {\n $this->_propDict[\"videoCodec\"] = $val;\n return $this;\n }", "public function decoder($decoder = null)\n\t{\n\t\treturn $this->getSet(\"decoder\", $decoder);\n\t}", "public function getCompressionAlgorithm()\n {\n if (isset($this->raw->compression)) {\n if (is_string($this->raw->compression)) {\n if (false === defined('Phar::' . $this->raw->compression)) {\n throw new InvalidArgumentException(\n sprintf(\n 'The compression algorithm \"%s\" is not supported.',\n $this->raw->compression\n )\n );\n }\n\n $value = constant('Phar::' . $this->raw->compression);\n\n // Phar::NONE is not valid for compressFiles()\n if (Phar::NONE === $value) {\n return null;\n }\n\n return $value;\n }\n\n return $this->raw->compression;\n }\n\n return null;\n }", "function getCountry()\n {\n global $warn;\n\n if ($this->country)\n return $this->country;\n else\n if (array_key_exists('cc', $this->extras))\n {\n $cc = $this->extras['cc'];\n $country = new Country(array('cc' => $cc));\n if ($country->isExisting())\n {\n $this->country = $country; // save\n return $this->country;\n }\n else\n {\n unset($this->extras['cc']);\n }\n }\n return null;\n }", "public function chosen() : ?Connection\n {\n if ($this->helperSet->has($this->helperName)) {\n $connectionHelper = $this->helperSet->get($this->helperName);\n\n if ($connectionHelper instanceof ConnectionHelper) {\n return $connectionHelper->getConnection();\n }\n }\n\n return null;\n }", "protected function newConverterInstance()\n {\n if($this->__converter instanceof IBaseConverter)\n {\n return $this->__converter->newInstance();\n }\n return null;\n }", "public static function getInstance() {\n\t\tstatic $instance = null;\n\t\tif ( ! $instance ) {\n\t\t\t$instance = new self();\n\t\t}\n\n\t\treturn $instance;\n\t}", "public function getCharset(): ?string\n\t{\n\t\treturn $this->charset;\n\t}", "public function getContentCharset()\n {\n $mediaTypeParams = $this->getMediaTypeParams();\n if (isset($mediaTypeParams['charset'])) {\n return $mediaTypeParams['charset'];\n }\n\n return null;\n }", "public function getCodeLibelle(): ?string {\n return $this->codeLibelle;\n }", "public function getCode(): ?string\n {\n return $this->code;\n }", "public function getCode(): ?string\n {\n return $this->code;\n }", "public function getContainer() : ?ContainerInterface\n {\n return $this->referenceResolver->getContainer();\n }", "public function getContentType() : ?ContentType\n {\n $key = $this->getContentTypeId();\n\n if (empty($key)) {\n return null;\n }\n\n return ContentType::Store()->getById($key);\n }", "static public function getInstance()\n\t{\n\t\tif (self::$_instance == null)\n\t\t\tself::$_instance = new Ivc_Cache;\n\t\treturn (self::$_instance);\n\t}", "public static function init() {\n\t\tstatic $instance = null;\n\n\t\tif ( is_null( $instance ) ) {\n\t\t\t$instance = new self();\n\t\t}\n\n\t\treturn $instance;\n\t}", "public function container() : ?Container;", "protected function _getCasAdapter()\n {\n static $adapter = NULL;\n \n if (!$adapter) {\n if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {\n $serviceUrl = 'https://';\n } else {\n $serviceUrl = 'http://';\n }\n $path = Zend_Controller_Front::getInstance()->getRouter()->assemble(array(\n 'module' => $this->getRequest()->getModuleName(),\n 'controller' => $this->getRequest()->getControllerName(),\n 'action' => 'cas'\n ));\n $serviceUrl .= $_SERVER['SERVER_NAME'] . $path;\n $adapter = new Unl_Cas($serviceUrl, 'https://login.unl.edu/cas');\n }\n \n return $adapter;\n }", "public static function static_getMimeDecoder($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }", "public function getTemplateCompiler(): ?TemplateCompiler\n {\n return new FacebookTemplateCompiler;\n }", "public function getStatus(): ?FHIRCode\n\t{\n\t\treturn $this->status;\n\t}", "public static function getInstance()\n {\n if (!is_object(self::$_instance)) //or if( is_null(self::$_instance) ) or if( self::$_instance == null )\n self::$_instance = new Currency();\n return self::$_instance;\n }", "public function getInstance() {\n\t\tif ( $this->getClass() == null ) return;\n\t\treturn $this->app->getIocContainer()->getInstance($this->getClass());\n\t\t// $callable = array($this->getClass(), \"getInstance\");\n\t\t// if ( ($instance = call_user_func($callable)) === false ) {\n\t\t// \tthrow new Exception\\Plugin\\PluginClassLoaderException(\"Failed call to \\\"\". $this->getClass() .\"::getInstance()\\\"\");\n\t\t// }\n\t\t// return $instance;\n\t}", "public function getConstrainedType(): ?FHIRCode\n\t{\n\t\treturn $this->constrainedType;\n\t}", "public function provider()\n {\n if (!$this->object->getValue()) {\n return null;\n }\n\n /* @var \\Anomaly\\VideoFieldType\\Matcher\\Contract\\MatcherInterface $matcher */\n $matcher = dispatch_now(new GetMatcher($this->object->getValue()));\n\n return $matcher->getProvider();\n }", "public static function instance()\n {\n global $container;\n return $container->getByType(self::class);\n }", "public function getCompiler(): SQL\\Compiler\n {\n if ($this->compiler === null) {\n switch ($this->getDriver()) {\n case 'mysql':\n $this->compiler = new SQL\\Compiler\\MySQL();\n break;\n case 'dblib':\n case 'mssql':\n case 'sqlsrv':\n case 'sybase':\n $this->compiler = new SQL\\Compiler\\SQLServer();\n break;\n case 'oci':\n case 'oracle':\n $this->compiler = new SQL\\Compiler\\Oracle();\n break;\n case 'firebird':\n $this->compiler = new SQL\\Compiler\\Firebird();\n break;\n case 'db2':\n case 'ibm':\n case 'odbc':\n $this->compiler = new SQL\\Compiler\\DB2();\n break;\n case 'nuodb':\n $this->compiler = new SQL\\Compiler\\NuoDB();\n break;\n default:\n $this->compiler = new SQL\\Compiler();\n }\n\n $this->compiler->setOptions($this->compilerOptions);\n }\n\n return $this->compiler;\n }", "public static function get()\n\t{\n\t\tif(null == self::$_instance)\n\t\t{\n\t\t\treturn new self();\n\t\t}\n\n\t\treturn self::$_instance;\n\t}", "private function getChannelByCode(string $code) : ?Channel\n {\n return $this->channelRepository->findOneBy(['code' => $code]);\n }", "public function getCodeRef8(): ?string {\n return $this->codeRef8;\n }", "public static function getVersion(): ?string\n\t{\n\t\tself::detect();\n\t\treturn self::$version;\n\t}", "public function getComposer() {\n if (!$this->composer) {\n $this->composer = Factory::create($this->io(), NULL, TRUE);\n }\n return $this->composer;\n }", "protected static function getDecoder($source, Closure $callback = null): AbstractDecoder\n {\n $classname = self::getDecoderClassname();\n\n if (!class_exists($classname)) {\n throw new DecoderException(\"Decoder for '\" . get_called_class() . \"' not found.\");\n }\n\n return new $classname($source, $callback);\n }", "public function getTypeCode(): ?string\n {\n return $this->typeCode;\n }", "public function getTypeCode(): ?string\n {\n return $this->typeCode;\n }", "public static function video() {\n return new Media_Video();\n }", "public function getFallbackCatalogue(): ?self;", "public function getDriver(): ?string\n {\n \\Logger::getLogger(\\get_class($this))\n ->info(\\sprintf(\n __METHOD__ . \" get '%s'\",\n $this->driver === null\n ? \"null\"\n : $this->driver\n ));\n return $this->driver;\n }", "public static function getInstance()\n {\n static $instance = null;\n\n if (null === $instance) {\n $instance = new static();\n }\n\n return $instance;\n }", "public function getCodeShare()\n {\n return isset($this->CodeShare) ? $this->CodeShare : null;\n }", "static public function getIO($filename)\n {\n $parts = pathinfo($filename);\n $ext = $parts['extension'];\n\n if ('jpeg' == $ext)\n $ext = 'jpg';\n \n $className = __NAMESPACE__.'\\\\IO\\\\'.ucfirst($ext).'IO';\n if (class_exists($className))\n {\n return new $className();\n }\n\n return null;\n }", "public static function getInstance() {\r\n static $instance = null;\r\n if (null === $instance) {\r\n $instance = new static();\r\n }\r\n\r\n return $instance;\r\n }", "public function getCategoryCode(): ?string\n {\n return isset($this->CategoryCode) ? $this->CategoryCode : null;\n }", "static public function getInstance() {\n\t\treturn GeneralUtility::makeInstance('Fab\\Media\\ObjectFactory');\n\t}", "public static function get_instance() {\n\t\tif ( static::$instance == null ) {\n\t\t\tstatic::$instance = new VideoMetabox();\n\t\t}\n\t\treturn static::$instance;\n\t}", "public static function get_instance() {\n \t\tstatic $instance = null;\n \t\tif (is_null($instance)) {\n \t\t\t$instance = new self();\n \t\t}\n \t\treturn $instance;\n \t}", "public static function getInstance()\n {\n return self::$instance ?? self::getNewInstance();\n }", "public function getParser() {\n $parser = $this->parser;\n if (is_null($this->parser)) {\n $parser = new HypermediaParser();\n }\n\n return $parser;\n }", "public static function get_instance() {\n\t\t\t// Store the instance locally to avoid private static replication\n\t\t\tstatic $instance = null;\n\n\t\t\tif ( null === $instance ) {\n\t\t\t\t$instance = new self();\n\t\t\t\tself::_setup_plugin();\n\t\t\t}\n\n\t\t\treturn $instance;\n\t\t}", "public function getCode(): ?string;", "final public static function getInstance()\n {\n if (!static::$instance instanceof self) {\n static::$instance = new static();\n }\n\n return static::$instance->driver;\n }", "public static function get_instance() {\r\n\t\tstatic $instance = null;\r\n\t\tif( $instance === null ) {\r\n\t\t\t$instance = new self;\r\n\t\t}\r\n\t\treturn $instance;\r\n\t}", "public function getValidator(): ?ValidatorInterface\n {\n return new CompoundValidator(\n new CzechIbanValidator($this->accountNumber, $this->bankCode),\n new GenericIbanValidator($this)\n );\n }", "public function getReceivedFrameController()\n {\n $this->receivedFrameController = new ReceivedFrameFileController();\n\n if (defined(\"RECEIVED_FRAME_CONTROLLER\") && !empty(RECEIVED_FRAME_CONTROLLER)) {\n $ReceivedFrameControllerString = RECEIVED_FRAME_CONTROLLER;\n $ReceivedFrameController = new $ReceivedFrameControllerString();\n if ($ReceivedFrameController instanceof ReceivedFrameControllerInterface) {\n $this->receivedFrameController = $ReceivedFrameController;\n } else {\n throw new Exception('Invalid ReceivedFrameController from StompConfig. ReceivedFrameController has to implement ReceivedFrameControllerInterface');\n }\n }\n return $this->receivedFrameController;\n }", "public static function getInstance()\n {\n if (null === self::$instance) {\n self::initInstance();\n }\n\n return self::$instance;\n }", "public function get_last_carrier_code() {\n\t\treturn empty( $this->carrier_codes ) ? null : $this->carrier_codes[0];\n\t}", "public static function getInstance()\n\t{\n\t\tstatic $instance = null;\n\t\tif (null === $instance) {\n\t\t\t$instance = new static();\n\t\t}\n\t\treturn $instance;\n\t}", "public static function getInstance()\n {\n return isset(static::$apps[static::$id]) ? static::$apps[static::$id] : null;\n }", "public static function getCurrencyOrDefault()\n {\n return self::getCurrency() ? self::getCurrency() : \\Bitrix\\Currency\\CurrencyManager::getBaseCurrency();\n }", "public function detect(SplFileObject $file): ?AudioType\n {\n $ckID = (string)$file->fread(4);\n\n // ckID is always 'FORM' for AIFF. If this is not the case, return null and do not check further.\n if ($ckID != 'FORM') {\n return null;\n }\n\n // Ignore the chunk size\n $file->fread(4);\n\n $formType = (string)$file->fread(4);\n\n return $formType === 'AIFF' || $formType === 'AIFC' ? new AudioType(\n AudioFormat::AIFF,\n AudioMimeType::AUDIO_AIFF\n ) : null;\n }", "public static function get_instance() {\n\t\tif ( static::$instance == null ) {\n\t\t\tstatic::$instance = new GlanceVideo();\n\t\t}\n\t\treturn static::$instance;\n\t}", "public function getPlatform()\n {\n return $this->database ? $this->database->getPlatform() : null;\n }", "function getEncodingTag(): ?array\n {\n return $this->getEncodingInfo()['tag'];\n }", "public function getBackend() {\n\t\t$data = unserialize($this->Data);\n\t\tif(isset($data['EnvironmentType']) && class_exists($data['EnvironmentType'])) {\n\t\t\t$env = Injector::inst()->get($data['EnvironmentType']);\n\t\t\tif($env instanceof EnvironmentCreateBackend) {\n\t\t\t\treturn $env;\n\t\t\t} else {\n\t\t\t\tthrow new Exception(\"Invalid backend: \" . $data['EnvironmentType']);\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public function getCodeManif(): ?string {\n return $this->codeManif;\n }", "function connection()\n\t{\n\t\tif (isset($this->conn_name)) {\n\t\t\treturn Db::getConnection($this->conn_name);\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public static function getInstance(): self\n {\n static $instance = null;\n if (!$instance) {\n $instance = new self();\n }\n return $instance;\n }" ]
[ "0.6792413", "0.63471115", "0.6214836", "0.6111885", "0.6068491", "0.5783533", "0.57605416", "0.5751641", "0.547314", "0.53918964", "0.5339931", "0.5297244", "0.52340627", "0.5165036", "0.515167", "0.508529", "0.508529", "0.5052967", "0.5052542", "0.50293267", "0.5026986", "0.5015486", "0.50013334", "0.49977562", "0.4965562", "0.49640173", "0.49612132", "0.49356714", "0.4929363", "0.49163222", "0.49117136", "0.4880867", "0.48625186", "0.48609987", "0.48607752", "0.48516783", "0.48447835", "0.4819824", "0.47949356", "0.47609645", "0.47575566", "0.4752831", "0.4736641", "0.4736641", "0.47271195", "0.4718586", "0.4712983", "0.4711701", "0.47059977", "0.46993056", "0.46983272", "0.4691294", "0.46904793", "0.4666111", "0.46582922", "0.46530658", "0.46385196", "0.46322316", "0.46318278", "0.46266875", "0.461932", "0.4615116", "0.46138528", "0.46108162", "0.46107846", "0.46103704", "0.46103704", "0.45974964", "0.4595724", "0.459416", "0.4590046", "0.45885634", "0.4584532", "0.45816436", "0.45807186", "0.45801008", "0.4577954", "0.45745096", "0.45720753", "0.45656046", "0.4555672", "0.45524213", "0.45504758", "0.45432192", "0.45356813", "0.45322457", "0.45299834", "0.45294023", "0.45156178", "0.4512832", "0.4512793", "0.45108762", "0.45063", "0.4503986", "0.44989613", "0.44958764", "0.44937187", "0.4493488", "0.44912338" ]
0.70024264
1
Set a new Codec instance.
public function setCodec(Codec $codec);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setVideoCodec($val)\n {\n $this->_propDict[\"videoCodec\"] = $val;\n return $this;\n }", "public function setAudioCodec($val)\n {\n $this->_propDict[\"audioCodec\"] = $val;\n return $this;\n }", "public function copy(): static\n {\n $this->isCustomCodec = false;\n\n return $this;\n }", "public function getCodec();", "public function getCodec();", "public function setVideoCodec(Codec $codec)\n\t{\n\t\tif ($this->getAvailableVideoCodecs() && ! in_array($codec, $this->getAvailableVideoCodecs(), false))\n\t\t{\n\t\t\tthrow new \\InvalidArgumentException(sprintf('Wrong video codec value for \"%s\", available values are %s',\n\t\t\t\t$codec, implode(', ', $this->getAvailableVideoCodecs())));\n\t\t}\n\t\t\n\t\t$this->videoCodec = $codec;\n\t\t\n\t\treturn $this;\n\t}", "public function setDecoder( $decoder){\r\n $this->decoder=$decoder;\r\n }", "public function setEncoder(Swift_Mime_ContentEncoder $encoder)\n {\n if ($encoder !== $this->encoder) {\n $this->clearCache();\n }\n\n $this->encoder = $encoder;\n $this->setEncoding($encoder->getName());\n $this->notifyEncoderChanged($encoder);\n\n return $this;\n }", "public function type(CodecConfigType $type)\n {\n $this->type = $type;\n\n return $this;\n }", "public function getVideoCodec() {}", "public function __construct ($version, $encoding) {}", "function setCharset($value)\n {\n $this->setAttribute(\"charset\", $value);\n return $this;\n }", "public function setEncodingFilter(InterfaceEncodingFilter $value)\n {\n $this->encodingFilter = $value;\n\n // initialize the encoder.\n $this->encodingFilter->init($this);\n return $this;\n }", "public function addEncoder($pattern, Diggin_Http_Response_Charset_Encoder_EncoderInterface $encoder)\n {\n $this->_encoderSet[$pattern] = $encoder;\n\n return $this;\n }", "public function setEncoding(Encode $encode)\n {\n $this->encode = $encode;\n }", "public function encoder($encoder = null)\n\t{\n\t\treturn $this->getSet(\"encoder\", $encoder);\n\t}", "public function encoding(?string $encoding): self\n {\n $new = clone $this;\n $new->encoding = $encoding;\n\n return $new;\n }", "public function setCode(array $code = []): object\n\t{\n\t\tif ([] !== $this->code) {\n\t\t\t$this->_trackValuesRemoved(count($this->code));\n\t\t\t$this->code = [];\n\t\t}\n\t\tif ([] === $code) {\n\t\t\treturn $this;\n\t\t}\n\t\tforeach ($code as $v) {\n\t\t\tif ($v instanceof FHIRCoding) {\n\t\t\t\t$this->addCode($v);\n\t\t\t} else {\n\t\t\t\t$this->addCode(new FHIRCoding($v));\n\t\t\t}\n\t\t}\n\t\treturn $this;\n\t}", "public function setEncoding($spec)\n {\n $this->_encoding = $spec;\n return $this;\n }", "public function getEncoder()\n {\n if ($encoder = $this->getCodecMatcher()->getEncoder()) {\n return $encoder;\n }\n\n $this->getCodecMatcher()->setEncoder($encoder = $this->encoder());\n\n return $encoder;\n }", "function __construct($enc)\n {\n $regExp = '/^(.*)(?:&|^)JsHttpRequest=(?:(\\d+)-)?([^&]+)((?:&|$).*)$/s';\n if (preg_match($regExp, @$_SERVER['QUERY_STRING'], $m)) {\n $this->ID = $m[2];\n $this->LOADER = strtolower($m[3]);\n } else {\n $this->ID = 0;\n $this->LOADER = 'unknown';\n }\n if (function_exists('mb_convert_encoding')) {\n $this->_unicodeConvMethod = 'mb';\n } else if (function_exists('iconv')) {\n $this->_unicodeConvMethod = 'iconv';\n } else {\n $this->_unicodeConvMethod = null;\n }\n $this->setEncoding($enc);\n }", "public function setEncoding(string $encoding): self\n {\n $this->options->ENCODING = $encoding;\n\n return $this;\n }", "public function new_codec(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'name' => 'required|unique:codecs',\n 'ffmpeg_codec' => 'required',\n 'media_type' => 'required',\n 'extension' => 'required'\n ]);\n\n if ($validator->fails()) {\n return back()\n ->withInput()\n ->withErrors($validator);\n }\n\n\n $codec = new Codecs();\n $codec->name = $request->name;\n $codec->ffmpeg_codec = $request->ffmpeg_codec;\n $codec->media_type = $request->media_type;\n $codec->extension = $request->extension;\n $codec->convert = $request->convert;\n //$codec->active = true;\n $codec->save();\n\n return redirect('/admin/codecs')->withInput()->withErrors('codec ' . $codec->name . ' is created', 'success');\n }", "public static function fromEncoder(Encoder $encoder): self\n {\n return new self($encoder->getMimeType(), $encoder->encode());\n }", "public function get_codec($id = null)\n {\n try {\n $codec = Codecs::findOrFail($id);\n $title = 'Change Codec';\n $new = false;\n } catch (ModelNotFoundException $e) {\n $codec = new Codecs();\n $title = 'New Codec';\n $new = true;\n }\n\n return View::make('backend.codecs.codec', ['url' => $this->url, 'codec' => $codec, 'title' => $title, 'new' => $new]);\n }", "public function getVideoCodec()\n\t{\n\t\treturn $this->videoCodec;\n\t}", "public function decoder($decoder = null)\n\t{\n\t\treturn $this->getSet(\"decoder\", $decoder);\n\t}", "public function setEncoding($encoding)\n {\n $this->_encoding = $encoding;\n Zend_XmlRpc_Value::setEncoding($encoding);\n return $this;\n }", "public function filterByCodec($codec = null, $comparison = null)\n {\n if (is_array($codec)) {\n $useMinMax = false;\n if (isset($codec['min'])) {\n $this->addUsingAlias(VoipTableMap::COL_CODEC, $codec['min'], Criteria::GREATER_EQUAL);\n $useMinMax = true;\n }\n if (isset($codec['max'])) {\n $this->addUsingAlias(VoipTableMap::COL_CODEC, $codec['max'], Criteria::LESS_EQUAL);\n $useMinMax = true;\n }\n if ($useMinMax) {\n return $this;\n }\n if (null === $comparison) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(VoipTableMap::COL_CODEC, $codec, $comparison);\n }", "public function setUniDecoder(UniDecoder $decoder)\n {\n $this->uniDecoder = $decoder;\n }", "public function setEncoding($encoding)\n {\n $this->_encoding = $encoding;\n \\Zend_XmlRpc_Value::setEncoding($encoding);\n return $this;\n }", "public function getEncoder()\n {\n return $this;\n }", "public function getVideoCodec()\n {\n if (array_key_exists(\"videoCodec\", $this->_propDict)) {\n if (is_a($this->_propDict[\"videoCodec\"], \"\\Microsoft\\Graph\\CallRecords\\Model\\VideoCodec\") || is_null($this->_propDict[\"videoCodec\"])) {\n return $this->_propDict[\"videoCodec\"];\n } else {\n $this->_propDict[\"videoCodec\"] = new VideoCodec($this->_propDict[\"videoCodec\"]);\n return $this->_propDict[\"videoCodec\"];\n }\n }\n return null;\n }", "public function __construct($type=null,$encoding=null){\n $this->handler = new RSALib();\n $this->mode($encoding);\n $this->key($type);\n }", "protected function setAvailableVideoCodecs(array $codecs, $force = false)\n\t{\n\t\tif ( ! $force && $this->getAvailableVideoCodecs())\n\t\t{\n\t\t\t$codecs = array_intersect($this->getAvailableVideoCodecs(), $codecs);\n\t\t}\n\t\t\n\t\t$this->videoAvailableCodecs = array_map('strval', $codecs);\n\t\t\n\t\treturn $this;\n\t}", "public function withEncoding($e) {\n $this->setEncoding($e);\n return $this;\n }", "public function setCompression($type, $value)\t\n\t{\n\t\tif (in_array($type, array(self::COMPRESSION_PNG, self::COMPRESSION_JPEG))) {\n\t\t\t$this->compressionType = $type;\t\t\t\n\t\t\t$this->compressionValue = (int) $value;\n\t\t} else {\n\t\t\tthrow new InvalidCompressionTypeException('A valid compression type must be defined');\n\t\t}\n\t\t\n\t\treturn $this;\n\t}", "public function setEncoding($encoding)\n {\n return $this;\n }", "public static function get ($instance=false) {\n\t\t$cname = self::_resolve_class_name($instance);\n\t\tif (!empty(self::$_codecs[$cname])) return self::$_codecs[$cname];\n\t\t\n\t\t$obj = new $cname;\n\t\tself::$_codecs[$cname] = $obj;\n\t\treturn $obj;\n\t}", "function withCode($code) {\n $this->code = $code;\n return $this;\n }", "public function setEncoding(One_Scheme $scheme, $encoding)\n\t{\n\t\treturn null;\n\t}", "public function setCode($value) {\n return $this->set(self::CODE, $value);\n }", "public function setYear($year = null): object\n {\n if (null !== $year && !($year instanceof FHIRString)) {\n $year = new FHIRString($year);\n }\n $this->_trackValueSet($this->year, $year);\n $this->year = $year;\n return $this;\n }", "public function setTranscoder(Transcoder $t)\n {\n $this->transcoder = $t;\n }", "public function setObjectEncoding($encoding);", "function setEncoding($encode){\n\t\t$this->encodetext=$encode;\n\t}", "public function setEncodingFrom($str)\n {\n return $this->setInputEncoding($str);\n }", "public function __construct(\\fpoirotte\\XRL\\EncoderInterface $encoder)\n {\n $this->encoder = $encoder;\n }", "public function getEncoder();", "public function getEncoder();", "public function getVideoCodecType()\n {\n return $this->videoCodecType;\n }", "public function setEncodings($encodings) {\n $this->properties['encodings'] = $encodings;\n\n return $this;\n }", "public function getAudioCodec() {}", "public function setCode($str)\n {\n $str = strtolower($str);\n\n if ($str == 'soundex' || $str == 'phonix') {\n $this->_code = $str;\n if ($str == 'phonix') {\n $this->_map = $this->_aphonixCode;\n } else {\n $this->_map = $this->_asoundexCode;\n }\n }\n\n return $this;\n }", "public function setCode(callable $callback): static\n {\n $this->loopCallback = $callback;\n\n return $this;\n }", "private function __construct()\n {\n $driverName = $this->getConfigValue('driver') ? $this->getConfigValue('driver') : 'mysqli';\n switch (strtolower($driverName)) {\n case 'mysqli':\n $this->driver = new Driver\\Mysqli($this->getConfigValue());\n break;\n case 'mssql':\n $this->driver = new Driver\\Mssql($this->getConfigValue());\n break;\n }\n $this->utf = $this->driver->hasUTF();\n if ($this->utf) {\n $this->driver->setUTF();\n }\n }", "public function setCode(string $code): self\n {\n $this->code = $code;\n return $this;\n }", "public function setCode(string $code): self\n {\n $this->code = $code;\n\n return $this;\n }", "public function setCode($code);", "public function setCode($code);", "public function setCode(?string $code): self\n {\n $this->code = $code;\n\n return $this;\n }", "public function __construct()\n\t {\n\t \t $data = SkrillPsp_Json::getPaySafeCardPAJson();\n\t \t $this->json = $this->decode($data, true);\n\t \t $this->json['id'] = $this->setId();\n\t }", "public function setEncoding($encoding) {\n $this->properties['encoding'] = $encoding;\n\n return $this;\n }", "public function setRenderer(Octopus_Renderer $renderer) {\n $this->_renderer = $renderer;\n return $this;\n }", "public function setCharset($charset) {\n\n $this->checkNotStopped();\n\n $h = $this->getHeader('Content-type');\n if (!$h) {\n $this->headers['content-type'] = array(\n 'name' => 'Content-type',\n 'value' => ';charset=' . $charset\n );\n return $this;\n }\n\n $pos = strpos($h, ';');\n\n if ($pos === false) {\n $h .= '; charset=' . $charset;\n } else {\n $h = substr($h, 0, $pos) . '; charset=' . $charset;\n }\n\n $this->headers['content-type'] = array(\n 'name' => 'Content-type',\n 'value' => $h\n );\n\n return $this;\n\n }", "public function setEncoding($encoding)\r\n\t{\r\n\t\t$this->encoding = $encoding;\r\n\t\treturn $this;\r\n\t}", "public function setValue($value, $encoding = 'UTF-8') {}", "public function setValue($value, $encoding = 'UTF-8') {}", "public function __construct()\n {\n $this->charset = strtoupper('UTF-8');\n }", "public function get_codec_config($id = null, $codec_id = null)\n {\n\n try {\n $codec_config = CodecConfigs::findOrFail($id);\n $title = 'Change Codec Configuration';\n $new = false;\n } catch (ModelNotFoundException $e) {\n $codec_config = new CodecConfigs();\n $title = 'New Codec Configuration';\n $new = true;\n $codec_config->codec = Codecs::findOrFail($codec_id);\n }\n\n return View::make('backend.codecs.codec_config', ['url' => $this->url, 'codec_config' => $codec_config, 'title' => $title, 'new' => $new]);\n }", "public function setRuleset(FHIRCoding $ruleset = null)\n {\n $this->ruleset = $ruleset;\n return $this;\n }", "public function code($code)\n {\n $this->code = $code;\n\n return $this;\n }", "private function __construct()\n {\n // Let it as a singleton class\n $this->_mux = new Mux;\n }", "public function setProductCode($val)\n {\n $this->_propDict[\"productCode\"] = $val;\n return $this;\n }", "public function setCode($code) { $this->code = (int)$code; return $this; }", "public function setCharset($charset)\n {\n $this->charset = $charset;\n return $this;\n }", "public function setEncode($encode)\n {\n $this->_encode = (bool) $encode;\n $this->_hrefCache = null;\n\n return $this;\n }", "public function setCode($code)\n {\n $this->setProperty(self::CODE, $code);\n\n return $this;\n }", "function setEncoding( $encoding )\n\t{\n\t\t$this->encoding\t=\t$encoding;\n\t}", "public function __construct($code)\n {\n $this->code = $code;\n }", "public function __construct($code)\n {\n $this->code = $code;\n }", "protected function setDriver($driver)\n {\n $this->driver = $driver;\n\n return $this;\n }", "public function setCode(string $code)\n {\n $this->code = $code;\n\n return $this;\n }", "public function setEncodingType($encoding)\n {\n $this->encoding = $encoding;\n }", "public function __construct($value) {\r\n $this->setValue($value);\r\n }", "protected function decodeFilters()\n {\n if (empty($this->options['filters'])) {\n $this->options['filters'] = [];\n }\n\n $this->options['filters'] = json_decode(base64_decode($this->options['filters']), true);\n\n return $this;\n }", "public function uniDecoder()\n {\n if ($this->uniDecoder === null) {\n if (self::$defaultUniDecoder === null) {\n self::$defaultUniDecoder = new UniDecoder();\n }\n\n $this->uniDecoder = self::$defaultUniDecoder;\n }\n\n return $this->uniDecoder;\n }", "public function setPublisher($publisher = null): object\n\t{\n\t\tif (null !== $publisher && !($publisher instanceof FHIRString)) {\n\t\t\t$publisher = new FHIRString($publisher);\n\t\t}\n\t\t$this->_trackValueSet($this->publisher, $publisher);\n\t\t$this->publisher = $publisher;\n\t\treturn $this;\n\t}", "public function setCharset($type = 'utf-8')\n\t{\n\t\t$this->_charset = $type;\n\n\t\treturn $this;\n\t}", "public function setEncoding($encoding = null)\n {\n if ($encoding !== null) {\n $orig = iconv_get_encoding('internal_encoding');\n $result = iconv_set_encoding('internal_encoding', $encoding);\n if (!$result) {\n /** Zend_View_Exception */\n require_once 'Zend/View/Exception.php';\n\n throw new Zend_View_Exception('Given encoding not supported on this OS!');\n }\n\n iconv_set_encoding('internal_encoding', $orig);\n }\n\n $this->_encoding = $encoding;\n return $this;\n }", "public function setCode($code) {\n\t\t$this->code = $code;\n\t\treturn $this;\n\t}", "public function setCode($code)\n {\n $this->code = $code;\n return $this;\n }", "public function setCode($code)\n {\n $this->code = $code;\n return $this;\n }", "public function setCode($code)\n {\n $this->code = $code;\n return $this;\n }", "public function code($code)\n {\n $this->code = $code;\n\n return $this;\n }", "public function __construct()\n {\n parent::__construct();\n $this->redCardsJSON = $this->encodeCards($this->redCards);\n $this->greenCardsJSON = $this->encodeCards($this->greenCards);\n }", "public function setCodeContext($codeContext)\n {\n $this->codeContext = $codeContext;\n return $this;\n }", "public static function setEncoding($encoding)\n {\n static::$encoding = $encoding;\n }", "public function __construct($code = null);", "public function addCode(?FHIRCoding $code = null): object\n\t{\n\t\t$this->_trackValueAdded();\n\t\t$this->code[] = $code;\n\t\treturn $this;\n\t}" ]
[ "0.6764379", "0.621892", "0.5887907", "0.5812258", "0.5812258", "0.5789779", "0.5463182", "0.54379034", "0.5437253", "0.50663173", "0.49901783", "0.49063995", "0.48797125", "0.48438305", "0.4828979", "0.48145452", "0.48068815", "0.48045623", "0.47773555", "0.47528595", "0.4720386", "0.4711151", "0.4697975", "0.4693715", "0.4672871", "0.46647686", "0.46581948", "0.46520305", "0.46499392", "0.46487904", "0.46473488", "0.46391368", "0.4616329", "0.46079606", "0.4605566", "0.46036106", "0.4552583", "0.4542267", "0.4529833", "0.45282745", "0.45107025", "0.44787076", "0.44728857", "0.4458709", "0.44583654", "0.44552433", "0.4448669", "0.44427302", "0.44415754", "0.44415754", "0.44246396", "0.44173315", "0.44029891", "0.43972412", "0.4388445", "0.4385631", "0.43708757", "0.43689644", "0.43563613", "0.43563613", "0.43556795", "0.4350237", "0.43381977", "0.4329141", "0.4320091", "0.43189442", "0.43108898", "0.43108413", "0.4308397", "0.43071678", "0.42963266", "0.42924532", "0.4284591", "0.4280965", "0.42780545", "0.42712837", "0.42690584", "0.42624202", "0.4251057", "0.42415914", "0.42415914", "0.42351812", "0.42348146", "0.4231059", "0.4224731", "0.42056254", "0.42052475", "0.41871652", "0.41869146", "0.4185239", "0.41838947", "0.41832322", "0.41832322", "0.41832322", "0.41797775", "0.4176673", "0.41675135", "0.41647223", "0.4156722", "0.41521898" ]
0.7557051
0
Get stream index value.
public function getIndex();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getIdx()\n {\n return $this->get(self::_IDX);\n }", "public static function getIndex(): int\n {\n return static::$index;\n }", "public function index(): int\n {\n return $this->index;\n }", "public function tell()\n {\n return $this->index;\n }", "public function getWaveIndex()\n {\n return $this->get(self::_WAVE_INDEX);\n }", "public function getIndex(): int\n {\n return $this->indexRequest;\n }", "public function key(): int\n {\n return $this->index;\n }", "public function getIndex() {\r\n\t\treturn $this->_index;\r\n\t}", "public function getIndex(): ?int {\n $val = $this->getBackingStore()->get('index');\n if (is_null($val) || is_int($val)) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'index'\");\n }", "public function getIndex(): ?int\n {\n return $this->index;\n }", "public function key(): int\n {\n return $this->_index;\n }", "public function getStreamId()\n {\n if (array_key_exists(\"streamId\", $this->_propDict)) {\n return $this->_propDict[\"streamId\"];\n } else {\n return null;\n }\n }", "public function getIndex()\n {\n return isset($this->index) ? $this->index : null;\n }", "protected function getStreamPos()\n {\n return gztell($this->file);\n }", "public function getIndex()\n\t\t{\n\t\t\treturn $this->_index;\n\t\t}", "public function getIndex() : ?string\n {\n return $this->index;\n }", "public function getStreamId()\n {\n return $this->stream_id;\n }", "public function getStreamId()\n {\n return $this->stream_id;\n }", "public function getStreamId()\n {\n return $this->stream_id;\n }", "public function getIndex() {\n\t\treturn $this->index;\n\t}", "public function getIndex() {\n\t\treturn $this->index;\n\t}", "public function getIndex() {\n\t\treturn $this->index;\n\t}", "public function getIndex() {\n\t\treturn $this->index;\n\t}", "public function getIndex() {\r\n\t\t\treturn $this->index;\r\n\t\t}", "public function getBytePositionInStream(): ?int\n {\n if ($this->operatorMetadata === null)\n throw new \\Exception(\"No Metadata available for this Operator\");\n return $this->operatorMetadata->bytePositionInStream;\n }", "public function getIndex() {\n \treturn $this->index;\n }", "function getIndex() ;", "public function index() {\n if ($this->_m_index !== null)\n return $this->_m_index;\n $this->_m_index = ($this->isIndexSeparate() ? $this->indexSeparate() : $this->indexInTag());\n return $this->_m_index;\n }", "public function getIndex() {\n return $this->index;\n }", "public function getIndex() {\n return $this->index;\n }", "public function getIndex() {\n return $this->index;\n }", "public function key() {\n\t\t\treturn $this->index;\n\t\t}", "public function key()\n {\n if(is_null($this->paginationVar))\n return 0;\n return $this->curIndex + $this->paginationVar->GetOffset();\n }", "public static function getKeyIndex(): int\n {\n if (self::$keyIndex == PHP_INT_MAX) {\n self::$keyIndex = 0;\n } else {\n self::$keyIndex++;\n }\n\n return self::$keyIndex;\n }", "public function get(int $index): mixed;", "public function key()\n\t{\n\t\treturn $this->index;\n\t}", "public function key()\n\t{\n\t\treturn $this->index;\n\t}", "protected function getPlayerIndexMarker(): int\n {\n $ind = 0;\n\n foreach ($this->players as $key => $player) {\n if ($player->marker) {\n $ind = $key;\n\n break;\n }\n }\n\n return $ind;\n }", "public function key(){\n return $this->index;\n }", "public function getIndex()\n {\n return $this->index;\n }", "public function getIndex()\n {\n return $this->index;\n }", "public function getIndex()\n {\n return $this->index;\n }", "public function getIndex()\n {\n return $this->index;\n }", "public function getIndex() {return $this->index;}", "public function stream_tell() {\r\n\t\treturn $this->pos;\r\n\t}", "public function stream_tell()\n {\n return $this->_pos;\n }", "function key()\n\t{\n\t\treturn $this->index;\n\t}", "public function stream_tell()\r\n {\r\n return $this->_pos;\r\n }", "public static function _index()\n\t{\n\t\treturn self::$_index;\n\t}", "public function key()\n {\n Psl\\invariant($this->valid(), 'The Iterator is invalid.');\n if (!contains_key($this->entries, $this->position)) {\n $this->progress();\n }\n\n return $this->entries[$this->position][0];\n }", "public function getCindex()\n {\n $value = $this->get(self::CINDEX);\n return $value === null ? (integer)$value : $value;\n }", "public function id() : StreamId {\n return $this->id;\n }", "public function stream_tell(): int\n {\n return $this->position;\n }", "public function key()\n {\n return $this->keys[$this->index];\n }", "public function offset()\n {\n $this->_checkStreamHandle();\n return ftell($this->_stream_handle);\n }", "public function key()\n {\n $pageSize = $this->getDataProvider()->getPagination()->pageSize;\n\n return $this->getCurrentPage() * $pageSize + $this->getCurrentIndex();\n }", "public function key(): int\n {\n return $this->position;\n }", "public function key(): int\n {\n return $this->position;\n }", "public function key(): int\n {\n return $this->position;\n }", "public function key() {\n return $this->keys[$this->index];\n }", "public static function get(string $stat): int\n {\n return (int)Resque::redis()->get(\"stat:$stat\");\n }", "public function getStageIndex()\n {\n return $this->get(self::_STAGE_INDEX);\n }", "public function getSearchIndexValue() {\n\t\treturn self::SEARCH_INDEX_DELIMITER.implode(self::SEARCH_INDEX_DELIMITER, $this->getValue()).self::SEARCH_INDEX_DELIMITER;\n\t}", "protected function getIndex()\n {\n if (!$this->indexes) {\n $this->addIndex();\n }\n $index = end($this->indexes);\n return $index['xml'];\n }", "public function tell(): int\n {\n $this->assertHandleIsOpen();\n \n return $this->offset;\n }", "public function get(): int\n {\n return (int) $this->filesystem->get($this->filename);\n }", "public function getCurrentOrdinal()\n {\n $bytes = $this->context->getBytes();\n $index = $bytes->indexOf($this->currentByte);\n $ordinal = '';\n\n for ($j = 0; $j < 4; $j++) {\n if ($index & 1) {\n $ordinal = OrdinalEnum::search($j);\n break;\n }\n\n $index >>= 1;\n }\n\n return $ordinal;\n }", "function stream_tell() {\r\n\t\treturn $this->position;\r\n\t}", "function get ($idx = \"\") {\n\t\tif ($idx)\n\t\t\treturn $this->get_event($idx);\n\t\telse {\n\t\t\tif ($this->cursor < $this->count())\t\n\t\t\t\treturn $this->get_event($this->cursor++);\n\t\t}\n\t}", "function key()\n\t\t{\n\t\t\t$this->current();\n\t\t\treturn $this->offset;\n\t\t}", "public function getValue($index) {}", "public function current()\n {\n return $this->offsetGet($this->index);\n }", "public function key() {\n\t\t$this->checkResultSet();\n\n\t\tif (! is_null($this->keyColumn)) {\n\t\t\t$row = $this->fetchRowAssoc($this->index, true);\n\t\t\treturn $row[$this->keyColumn];\n\t\t}\n\n\t\treturn $this->index;\n\t}", "private function getOffset()\n {\n $this->current_offset = null;\n \n $headers = $this->getHead();\n \n if (isset($headers['Offset']) === true) {\n $this->current_offset = $headers['Offset'];\n }\n \n return $this->current_offset;\n }", "public function getValue(int $indexX, int $indexY): int;", "public function currentSheetIndex(): ?int\n {\n if (!$this->valid()) {\n $this->sheetIndex = null;\n $this->sheetName = null;\n } elseif (is_null($this->sheetIndex)) {\n $sheet = $this->sheetIterator->current();\n $this->sheetIndex = $sheet->getIndex();\n $this->sheetName = $sheet->getName();\n }\n return $this->sheetIndex;\n }", "public function indexOf($value)\n {\n $firstIndex = array_search($value, $this->sessionData);\n if ($firstIndex === false) {\n $firstIndex = -1;\n }\n \n return $firstIndex; \n }", "public function get(int $index);", "public function get(int $index);", "public function getIndexFile() {\n return $this->index_file;\n }", "public function key()\n {\n return $this->offset;\n }", "public function key ()\n {\n return $this->offset;\n }", "public function getHashIndex();", "public function key() {\n return $this->currentIndex;\n }", "public function key()\n {\n return $this->_currentIndex;\n }", "public function getSmashIdxAt($offset)\n {\n return $this->get(self::_SMASH_IDX, $offset);\n }", "public function getCurrentPageIndex()\n {\n return ! empty($this->result) ? $this->result->getCurrentPageIndex() : NULL;\n }", "public function output (): int {\n return $this->get(0);\n }", "public function position()\n {\n return $this->i;\n }", "public function tell() {\r\n\t\t$pos=ftell($this->_handle);\r\n\t\tif($pos===false) {\r\n\t\t\tthrow new Curly_Stream_Exception('An error occured while determining the current stream offset');\r\n\t\t}\r\n\t\treturn $pos;\r\n\t}", "public function getPosition() : int\n {\n $rtn = $this->data['position'];\n\n return $rtn;\n }", "public function read()\n {\n return $this->counter++;\n }", "function key() {\r\n return $this->i >= 0 ? $this->i : NULL;\r\n }", "protected function map($index) // -> int\n\t{\n\t\t$r = $index;\n\t\t\n\t\tif( (null !== $index) && is_integer($index))\n\t\t{\n\t\t\t$r = $index + $this->start;\n\t\t\t$size = $this->data->getSize();\n\t\t\t\n\t\t\tif($r >= $size)\n\t\t\t{\n\t\t\t\t$r -= $size;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $r;\n\t}", "public function getStartIndex()\n {\n return $this->start_index;\n }", "public function current()\n {\n Psl\\invariant($this->valid(), 'The Iterator is invalid.');\n if (!contains_key($this->entries, $this->position)) {\n $this->progress();\n }\n\n return $this->entries[$this->position][1];\n }", "public function key() {\n return $this->keys[$this->pos];\n }", "public function getHashIndex()\n {\n return $this->hashIndex;\n }", "public function key()\n {\n return $this->current();\n }", "public function getIndexAttribute()\n {\n return $this->config['index'];\n }", "public function indexInTag() {\n if ($this->_m_indexInTag !== null)\n return $this->_m_indexInTag;\n $this->_m_indexInTag = ($this->tag() - 32);\n return $this->_m_indexInTag;\n }" ]
[ "0.6828944", "0.6751085", "0.6590643", "0.6250264", "0.6222612", "0.61239064", "0.6060569", "0.6024517", "0.5986603", "0.59834415", "0.5972244", "0.59177816", "0.5907719", "0.5880699", "0.58621943", "0.58496606", "0.5847496", "0.5847496", "0.5847496", "0.5839773", "0.5839773", "0.5839773", "0.5839773", "0.5808035", "0.58059365", "0.5797389", "0.5765877", "0.57514495", "0.57295406", "0.57295406", "0.57295406", "0.5722979", "0.5708832", "0.5685826", "0.56826824", "0.56745183", "0.56745183", "0.5658929", "0.56494266", "0.5627447", "0.5627447", "0.5627447", "0.5627447", "0.5625198", "0.5587358", "0.557213", "0.55569136", "0.5549943", "0.55431795", "0.55313736", "0.551344", "0.54716736", "0.546138", "0.543912", "0.54384", "0.54310906", "0.54309696", "0.54309696", "0.54309696", "0.54281676", "0.54192626", "0.5402507", "0.5400939", "0.53915155", "0.5384249", "0.5381709", "0.53803253", "0.53743815", "0.5367964", "0.53666186", "0.5362221", "0.5359258", "0.53537077", "0.5351499", "0.5350338", "0.5345569", "0.53412706", "0.5333024", "0.5333024", "0.5332164", "0.5331736", "0.53205395", "0.53194433", "0.5315964", "0.53117275", "0.53111196", "0.5307549", "0.53050995", "0.5276021", "0.52755433", "0.5274087", "0.5270007", "0.5266637", "0.52632123", "0.526142", "0.525373", "0.5252937", "0.5242547", "0.52404976", "0.523989", "0.5234947" ]
0.0
-1
Set a new order.
public function setIndex($position);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setOrder(?string $order): void\n {\n $this->order = $order;\n }", "public function setOrder(?string $order): void\n {\n $this->order = $order;\n }", "abstract public function setOrder(OrderModel $order);", "function setOrder($order);", "public function setOrder($order);", "function setOrder($order){\n\t\t$this->order=$order;\n\t}", "public function setOrder(string $order): void\n {\n $this->_order = $order;\n }", "function setOrder( $order )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n if ( get_class( $order ) == \"ezorder\" )\n {\n $this->OrderID = $order->id();\n } \n }", "public function setOrder(\\Magento\\Sales\\Model\\Order $order);", "public function setOrder ($value)\r\n\t{\r\n\t\t$this->order = $value;\r\n\t}", "public function setOrder($Order)\n {\n $this->__set(\"order\", $Order);\n }", "public function setOrderId(?string $orderId): void\n {\n $this->orderId['value'] = $orderId;\n }", "function set_order($value) {\n $this->set_mapped_property('order', $value);\n }", "public function setOrder($value)\n {\n return $this->set('Order', $value);\n }", "public function setOrder(OrderInterface $order);", "public function setOrder(array $order)\n {\n $this->order = $order;\n return $this;\n }", "public function setOrder($order)\n {\n //TODO: implement method, needed for drag and drop sortable\n }", "public function setOrder($name)\n {\n $this->order = $name;\n }", "function setOrder($array)\n\t{\n\t\t$this->table->order = $array;\n\t}", "public function setOrder(\\Magento\\Sales\\Model\\Order $order)\n {\n return $this->setData(self::ORDER_ID, $order->getId());\n }", "public function setOrders($value) \n {\n $this->_fields['Orders']['FieldValue'] = $value;\n return;\n }", "public function setOrder($order)\n {\n $this->_order = $order;\n return $this;\n }", "public static function order_set($orderId, $options) {\n //Modify the parameters of an order\n\t\t\treturn self::patch(self::order_index() . '/' . $orderId, $options);\n\t\t}", "private function SetOrderData()\n\t\t{\n\t\t\t// doesn't factor in cookies stored by Interspire Shopping Cart, so we have to pass back the\n\t\t\t// order token manually from those payment providers. We do this by taking the\n\t\t\t// cart ID passed back from the provider which stores the order's unique token.\n\t\t\tif(isset($_COOKIE['SHOP_ORDER_TOKEN'])) {\n\t\t\t\t$this->orderToken = $_COOKIE['SHOP_ORDER_TOKEN'];\n\t\t\t}\n\t\t\telse if(isset($_REQUEST['provider'])) {\n\t\t\t\tGetModuleById('checkout', $this->paymentProvider, $_REQUEST['provider']);\n\n\t\t\t\tif(in_array(\"GetOrderToken\", get_class_methods($this->paymentProvider))) {\n\t\t\t\t\t$this->orderToken = $this->paymentProvider->GetOrderToken();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tob_end_clean();\n\t\t\t\t\theader(sprintf(\"Location:%s\", $GLOBALS['ShopPath']));\n\t\t\t\t\tdie();\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Load the pending orders from the database\n\t\t\t$this->pendingData = LoadPendingOrdersByToken($this->orderToken, true);\n\t\t\tif(!$this->orderToken || $this->pendingData === false) {\n\t\t\t\t$this->BadOrder();\n\t\t\t\texit;\n\t\t\t}\n\n\t\t\tif($this->paymentProvider === null) {\n\t\t\t\tGetModuleById('checkout', $this->paymentProvider, $this->pendingData['paymentmodule']);\n\t\t\t}\n\n\t\t\tif($this->paymentProvider) {\n\t\t\t\t$this->paymentProvider->SetOrderData($this->pendingData);\n\t\t\t}\n\t\t}", "public function setOrder(?Order $order)\n {\n $this->order = $order;\n Session::put('mall.payment.order', optional($this->order)->id);\n\n return $this;\n }", "public function setOrder($val)\n {\n $this->_propDict[\"order\"] = $val;\n return $this;\n }", "public function setOrder($val)\n {\n $this->_propDict[\"order\"] = $val;\n return $this;\n }", "public function setOrder($order)\n {\n $this->order = $order;\n return $this;\n }", "public function setOrder($orderAttributes)\n {\n $this->email = $orderAttributes['email'];\n $this->orderId = $orderAttributes['orderId'];\n }", "public function setOrder($order) \n\t{\n\t\t$this->order = $order;\n\t\treturn $this;\n\t}", "public function setOrder($params)\n\t{\n\t\treturn $this->request('set-order', $params);\n\t}", "public function testSetOrder() {\n\n $obj = new DataTablesRequest();\n\n $obj->setOrder([\"order\"]);\n $this->assertEquals([\"order\"], $obj->getOrder());\n }", "public function setOrderById($orderId, $orderData)\n {\n }", "public function setOrder(BudgetEntry $entry, int $order): void\n {\n if ($order <= 0) {\n $order = 1;\n }\n\n $entries = BudgetEntry::where('id', '!=', $entry->id)\n ->where('budgetGroupId', $entry->budgetGroupId)\n ->orderBy('order', 'asc')\n ->get();\n\n $i = 1;\n foreach ($entries as $entry) {\n if ($i === $order) {\n $i++;\n }\n $entry->update(['order' => $i]);\n $i++;\n }\n\n if ($order > $entries->count()) {\n $order = $entries->count();\n }\n\n $entry->order = $order;\n }", "public function __construct($order)\n {\n $this->order = $order;\n }", "public function __construct($order)\n {\n $this->order = $order;\n }", "public function __construct($order)\n {\n $this->order = $order;\n }", "public function __construct($order)\n {\n $this->order = $order;\n }", "public function __construct($order)\n {\n $this->order = $order;\n }", "public function __construct($order)\n {\n $this->order = $order;\n }", "public function __construct($order)\n {\n $this->order = $order;\n }", "public function __construct($order)\n {\n $this->order = $order;\n }", "public function setOrder(Order $order)\n {\n $this->order = $order;\n\n return $this;\n }", "public function setOrder($order)\n {\n if ($order != null and !empty($order)) {\n $this->order = $order;\n $this->shippingData = $this->getShippingData();\n } else {\n $msg = \"[PagSeguroModuleException] Message: Parâmetro Inválido para o método setOrder().\";\n throw new Exception(Mage::helper('pagseguro')->__($msg));\n }\n }", "public function testUpdateOrder()\n {\n }", "function setOrdering($ordering) {\n $this->ordering = $ordering;\n }", "public function order(string $order): self\n {\n $this->order[] = $order;\n return $this;\n }", "public function setOrder($order)\n {\n $this->order = $order;\n\n return $this;\n }", "public function setOrder($order)\n {\n $this->order = $order;\n\n return $this;\n }", "public function setOrderAttribute($value)\n {\n $this->attributes['order'] = (GeneralFunctions::isSetAndIsNotNull($value)) ? $value : 0;\n }", "public function setOrderAttribute($value)\n {\n $this->attributes['order'] = (GeneralFunctions::isSetAndIsNotNull($value)) ? $value : 0;\n }", "public function setOrder($order = null)\n\t{\n\t\tif (is_string($order))\n\t\t{\n\t\t\t$temp = (int)$order;\n\t\t\tif ($temp < 0 || $temp > 0 || $order == '0')\n\t\t\t{\n\t\t\t\t$order = $temp;\n\t\t\t}\n\t\t}\n\n\t\tif (null !== $order && !is_int($order))\n\t\t{\n\t\t\trequire_once 'Zend/Navigation/Exception.php';\n\t\t\tthrow new Zend_Navigation_Exception(\n\t\t\t\t'Invalid argument: $order must be an integer or null, ' .\n\t\t\t\t'or a string that casts to an integer');\n\t\t}\n\n\t\t$this->_order = $order;\n\n\t\treturn $this;\n\t}", "public function setOrderId($orderId){\n return $this->setData(self::ORDER_ID, $orderId);\n }", "public function setOrderId($orderId)\n {\n $this->setParam('order-id', (int)$orderId, 'order');\n }", "public function __construct($order)\n {\n $this->order=$order;\n }", "public function setOrderId($orderId)\n {\n return $this->setData(self::ORDER_ID, $orderId);\n }", "public function setOrder(int $order)\n {\n $this->order = $order;\n\n return $this;\n }", "public function setOrder($ids);", "public function resetorder()\n {\n $oOrder = oxNew(\"oxorder\");\n if ($oOrder->load($this->getEditObjectId())) {\n $oOrder->oxorder__oxsenddate = new oxField(\"0000-00-00 00:00:00\");\n $oOrder->save();\n }\n }", "public function setOrder($value)\n {\n return $this->setParameter('order', $value);\n }", "public function setOrder($value)\n {\n $key = $this->determineOrderColumnName();\n $this->attributes[$key] = $value;\n }", "public function setTokenOrder (OrderEvent $event)\n {\n $order = $event->getOrder();\n $token = $this->tokenGenerator->generateToken();\n $order->setToken($token);\n\n }", "public function __construct(Order $order)\n {\n $this->order = $order;\n }", "public function __construct(Order $order)\n {\n $this->order = $order;\n }", "public function __construct(Order $order)\n {\n $this->order = $order;\n }", "public function __construct(Order $order)\n {\n $this->order = $order;\n }", "public function __construct(Order $order)\n {\n $this->order = $order;\n }", "public function __construct(Order $order)\n {\n $this->order = $order;\n }", "public function __construct(Order $order)\n {\n $this->order = $order;\n }", "public function __construct(Order $order)\n {\n $this->order = $order;\n }", "public function __construct(Order $order)\n {\n $this->order = $order;\n }", "public function __construct(Order $order)\n {\n $this->order = $order;\n }", "public function setOrder($order = Table::DIRECTION_DOWN)\n {\n $this->orderingColumnOrder = $order;\n }", "public function setOrder($order = self::DIRECTION_DOWN)\n {\n $this->config->setOrder($order);\n }", "public function addOrder($order){\n $this->collection[] = $order;\n }", "public function setOrderDate($date)\n {\n $this->order_date = $date;\n }", "public function setOrders($orders)\n {\n $this->orders = (int)$orders;\n\n return $this;\n }", "public function addOrder(Order $order);", "public function setOrder(string $order): TransactionRequest\n {\n $this->order = $order;\n return $this;\n }", "public function setOrder($order, $direction)\n {\n return $this->setParam(\"order\", array($order => $direction));\n }", "function setOrder(array $orderParams)\n {\n foreach ($orderParams as $row)\n {\n if (is_array($this->{$row['name']}))\n array_push($this->{$row['name']}, $row['value']);\n else\n $this->{$row['name']} = $row['value'];\n }\n }", "public function setOrd($ord) {\n $this->ord = $ord;\n }", "public function setOrderField($x) { $this->orderField = $x; }", "public function withOrders($value)\n {\n $this->setOrders($value);\n return $this;\n }", "public function __construct($order=null)\n {\n $this->data = $order;\n }", "public function setOrder(int $order = 1) : CNabuDataObject\n {\n if ($order === null) {\n throw new ENabuCoreException(\n ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,\n array(\"\\$order\")\n );\n }\n $this->setValue('nb_commerce_product_category_order', $order);\n \n return $this;\n }", "public function setOrderId($value)\n {\n return $this->set(self::order_id, $value);\n }", "public function setOrder($order = self::ORDER_DESC)\n {\n $this->data['order'] = $order;\n return $this;\n }", "public function set_order_id( $value ) {\n\t\t$this->set_prop( 'order_id', absint( $value ) ) ;\n\t}", "public function afterPlaceOrder($order)\n {\n $this->aliExpressOrderRepository->create(['order' => $order]);\n }", "public function testSetOrderr()\n {\n $game = new DiceGame(4, 1);\n $this->assertInstanceOf(\"\\Ida\\Dice\\DiceGame\", $game);\n\n $notSet = $game->hasOrder();\n $game->setOrder();\n $set = $game->hasOrder();\n\n $this->assertNotEquals($notSet, $set);\n }", "public function setOrderData($orderData) {\n\t\t$orderDataType = gettype($orderData);\n\t\t$validTypes = [\n\t\t\t'integer',\n\t\t\t'array',\n\t\t\t'NULL',\n\t\t];\n\t\t$validTypesString = str_replace(' and ', ' or ', Text::toList($validTypes));\n\t\tif (is_array($orderData)) {\n\t\t\tValidator::getInstance()->checkKeysValueTypesOrFail($orderData, 'integer', 'integer', '$orderData');\n\t\t} elseif ($orderDataType === 'integer' && $orderData < 0) {\n\t\t\tthrow new InvalidArgumentException(\"In \\$orderData must be greater or equal 0. Found: '$orderData'.\");\n\t\t} elseif (!in_array($orderDataType, $validTypes)) {\n\t\t\tthrow new InvalidArgumentException(\"In \\$orderData you can use only $validTypesString. Found: '$orderDataType'.\");\n\t\t}\n\t\t$this->_config = Hash::insert($this->_config, 'orderData', $orderData);\n\n\t\treturn $this;\n\t}", "public function setOrder($str) { $this->val .= ' ' . $str; }", "public function setOrderId(int $orderId): self\n {\n $this->setParam(self::ORDER_ID, $orderId);\n return $this;\n }", "public function setOrder(&$var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Google\\Datastore\\V1beta3\\PropertyOrder::class);\n $this->order = $arr;\n }", "public function updateOrder() {\n\n echo \"ok\";\n }", "public function set_order_field($order_field = NULL)\n\t{\n\t\t$this->_order_field = $order_field;\n\t}", "private function saveOrder() {\n $currentDate = new Zend_Date();\n $customer = Customer::findByEmail($this->getRequest()->getParam('email'));\n $customer->name = $this->getRequest()->getParam('name');\n $customer->phone = $this->getRequest()->getParam('phone');\n\n $ord = new Order();\n $ord->Customer = $customer;\n $ord->date = $currentDate->get();\n //TODO Take product id from param and check if it is available (not in future, still on sales, etc)\n $product = Product::getCurrentProduct();\n $ord->Product = $product;\n $customer->save();\n $ord->save();\n $product->takeFromStock();\n $customer->sendOrderNotification($ord);\n }", "private function setOrderAsPending($order){\r\n $this->log('Setting as pending order #'.$order->get_order_number());\r\n //Since the default status of the order is pending, we only add a note here.\r\n $this->addOrderNote($order, 'La orden se encuentra pendiente.');\r\n }", "public function updateOrder()\n {\n if (!empty($_POST['order'])) {\n $values = [];\n\n $key = $this->businessModel->data[$this->table]['key'];\n\n $query = '\n UPDATE '.$this->db->backtick($this->table).'\n SET '.$this->db->backtick($this->businessModel->data[$this->table]['order']['column']).' = CASE '.$this->db->backtick($key)\n ;\n\n foreach ($_POST['order'] as $order => $id) {\n $values[':'.$key.$id] = $id;\n $values[':order'.$order] = $order;\n $query .= ' WHEN :'.$key.$id.' THEN :order'.$order;\n }\n\n $query .= ' END WHERE '.$this->db->backtick($key).' IN ('.implode(',', array_values($_POST['order'])).')';\n\n $statement = $this->db->handle->prepare($query);\n\n exit($statement->execute($values));\n }\n }", "public function setOrderID(array $orderID)\n {\n $this->orderID = $orderID;\n return $this;\n }" ]
[ "0.7940713", "0.7940713", "0.7909693", "0.7887206", "0.7831107", "0.7827052", "0.7749063", "0.770804", "0.7522194", "0.74906635", "0.7319003", "0.7272334", "0.7163406", "0.71446306", "0.7099153", "0.7062017", "0.7051928", "0.6998357", "0.69695634", "0.6881182", "0.68457603", "0.6822294", "0.6783427", "0.67517203", "0.6735531", "0.6735415", "0.6735415", "0.6720338", "0.67202604", "0.6702792", "0.66995347", "0.66989", "0.66884065", "0.66338307", "0.66082734", "0.66082734", "0.66082734", "0.66082734", "0.66082734", "0.66082734", "0.66082734", "0.66082734", "0.6602123", "0.65685225", "0.65491617", "0.65421253", "0.65411824", "0.65219367", "0.65219367", "0.6519944", "0.6519944", "0.64874864", "0.64789605", "0.6471293", "0.64394414", "0.6394858", "0.6388707", "0.6344292", "0.6338264", "0.6298557", "0.62959105", "0.62950665", "0.62865883", "0.62865883", "0.62865883", "0.62865883", "0.62865883", "0.62865883", "0.62865883", "0.62865883", "0.62865883", "0.62865883", "0.6285325", "0.6242093", "0.6240457", "0.62115914", "0.62089694", "0.62043715", "0.6202578", "0.6188586", "0.61879426", "0.6173895", "0.61583346", "0.6156503", "0.6135655", "0.61054987", "0.61037314", "0.6077059", "0.60687226", "0.60660195", "0.6053612", "0.60521746", "0.603338", "0.6032178", "0.6004267", "0.6000974", "0.5978688", "0.59338504", "0.59289867", "0.59189403", "0.590754" ]
0.0
-1
Get bit rate value.
public function getBitrate();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBitRate() {}", "function getBitRate(){\n\t\treturn round($this->bitRate,2);\n\t}", "public function getAudioBitRate() {}", "public function getOverallBitRate()\n {\n return $this->overallBitRate;\n }", "public function getAudioBitRate()\n {\n return $this->audioBitRate;\n }", "public function getVideoBitRate() {}", "public function get_baudRate(): int\n {\n // $res is a int;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::BAUDRATE_INVALID;\n }\n }\n $res = $this->_baudRate;\n return $res;\n }", "public function getBitrate()\n {\n return $this->bitrate;\n }", "public function getVideoBitRate()\n {\n return $this->videoBitRate;\n }", "public function getResponseRateValue()\n {\n return isset($this->ResponseRateValue) ? $this->ResponseRateValue : null;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate()\n {\n return $this->rate;\n }", "public function getRate() {\n return $this->rate;\n }", "public function getBits()\n {\n return $this->bits;\n }", "public function getExchangeRate();", "public function getBitsPerSample();", "public function rate()\n {\n return $this->rate;\n }", "public function rate()\n {\n return $this->rate;\n }", "public function getBaseToGlobalRate();", "public function getBitsPerComponent() {}", "public function getBitsPerComponent() {}", "public function getBits(): int;", "public function getBitrateMode();", "public function getSamplingRate()\n {\n return $this->floatValue('sampling.rate', 1.0, 0.0, 1.0);\n }", "public function getRatePerSecond()\n {\n return $this->rate_per_second;\n }", "function calculate_rate($rate, $type, $bits) {\n\n\t$output = 0;\n\n\tif ($type == \"overage\") {\n\t\tif ($bits > $rate[\"rate_overage\"][\"threshold\"]) {\n\t\t\t$bits = $bits - $rate[\"rate_overage\"][\"threshold\"];\n\t\t}else{\n\t\t\t$bits = 0;\n\t\t}\t\n\t\t$multi = unit_multi($rate[\"rate_overage\"][\"unit\"]);\n\t\t$output = ($bits / $multi) * $rate[\"rate_overage\"][\"amount\"];\n\t} elseif ($type == \"committed\") {\n\t\tif ($bits > $rate[\"rate_overage\"][\"threshold\"]) {\n\t\t\t$bits = $rate[\"rate_overage\"][\"threshold\"];\n\t\t}\t\n\t\t$multi = unit_multi($rate[\"rate_committed\"][\"unit\"]);\n\t\t$output = ($bits / $multi) * $rate[\"rate_committed\"][\"amount\"];\n\t\tif (isset($rate[\"rate_committed\"][\"minimum\"])) {\n\t\t\tif ($output < $rate[\"rate_committed\"][\"minimum\"]) {\n\t\t\t\t$output = $rate[\"rate_committed\"][\"minimum\"];\n\t\t\t}\n\t\t}\n\t} elseif ($type == \"regular\") {\n\t\t$multi = unit_multi($rate[\"rate\"][\"unit\"]);\n\t\t$output = ($bits / $multi) * $rate[\"rate\"][\"amount\"];\n\t\tif (isset($rate[\"rate\"][\"minimum\"])) {\n\t\t\tif ($output < $rate[\"rate\"][\"minimum\"]) {\n\t\t\t\t$output = $rate[\"rate\"][\"minimum\"];\n\t\t\t}\n\t\t}\n\t} elseif ($type == \"fixed\") {\n\t\t$output = $rate[\"rate_fixed\"][\"amount\"];\n\t}\n\t\n\treturn round($output, 4);\n\n}", "public function getBits()\n {\n $size = $this->getImageSize();\n\n return $size['bits'];\n }", "public function getBits();", "public function getAudioBitsPerSample()\n {\n return $this->audioBitsPerSample;\n }", "public function quality() {\n\t\tif (!$bitRate = $this->get('bitRate')) {\n\t\t\treturn;\n\t\t}\n\t\tif (!$bitRateMax = $this->get('bitRateMax')) { // i.e. mpeg has max = 500000\n\t\t\t$bitRateMax = 320000;\n\t\t}\n\t\t$bitRateMin = 32000;\n\n\t\t$qualityMax = 5;\n\t\t$qualityMin = 1;\n\n\t\t/* Normalize between 1 and 5 where min = 32000 and max = see above */\n\t\tif ($bitRate >= $bitRateMax) {\n\t\t\t$quality = $qualityMax;\n\t\t} elseif ($bitRate <= $bitRateMin) {\n\t\t\t$quality = $qualityMin;\n\t\t} else {\n\t\t\t$quality =\n\t\t\t\t(($bitRate - $bitRateMin) / ($bitRateMax - $bitRateMin))\n\t\t\t\t* ($qualityMax - $qualityMin)\n\t\t\t\t+ $qualityMin;\n\t\t}\n\t\treturn (integer) round($quality);\n\t}", "public function getCurrentCurrencyRate() {\r\n\t\treturn $this->_storeManager->getStore()->getCurrentCurrencyRate();\r\n\t}", "public function getAmountRate()\n {\n return $this->amountRate;\n }", "public function getExchangeRate()\n\t{\n\t\treturn $this->exchangeRate; \n\n\t}", "public function getExchangeRate()\n {\n return $this->exchangeRate;\n }", "public function getExchangeRate()\n {\n return $this->exchangeRate;\n }", "public function getExchangeRate()\n {\n return $this->exchangeRate;\n }", "public function get_bandwidth(): int\n {\n // $res is a int;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::BANDWIDTH_INVALID;\n }\n }\n $res = $this->_bandwidth;\n return $res;\n }", "public function getStoreToBaseRate();", "public function getFrameRate()\n {\n return $this->frameRate;\n }", "public function getExchangeRate()\n {\n return $this->exchange_rate;\n }", "public function getBitDepth()\n {\n return $this->bitDepth;\n }", "public function getSpeed()\n {\n $value = $this->get(self::SPEED);\n return $value === null ? (integer)$value : $value;\n }", "public function getRate() : ?float \n {\n if ( ! $this->hasRate()) {\n $this->setRate($this->getDefaultRate());\n }\n return $this->rate;\n }", "public function getRateLimit(){\n\t\treturn $this->rateLimit;\n\t}", "public function getRate(): ?float\n {\n return $this->rate;\n }", "public function getPower() {\r\n // TODO\r\n return 1;\r\n }", "public function toMoney()\n {\n return $this->rate;\n }", "public function getBaseToOrderRate();", "public function getRatePeriod()\n {\n return $this->ratePeriod;\n }", "public function getAudioSampleRate() {}", "public function getSampleRate()\n {\n return isset($this->sample_rate) ? $this->sample_rate : 0.0;\n }", "public function getvalue()\n {\n $this->flushbits();\n return $this->_out;\n }", "public function readBits() {}", "public function getValue()\n {\n return 1;\n }", "public function getPower()\n {\n return $this->power;\n }", "public function getCompressRate(): string\n {\n }", "abstract protected function getSampleValue($scope_bit, $as_stored = false);", "public function get_powerFactor(): float\n {\n // $res is a float;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::POWERFACTOR_INVALID;\n }\n }\n $res = $this->_powerFactor;\n if ($res == self::POWERFACTOR_INVALID) {\n $res = $this->_cosPhi;\n }\n $res = round($res * 1000) / 1000;\n return $res;\n }", "public function getExchangeRate()\n {\n if (null !== $this->cache) {\n if ($exchangeRate = $this->cache->fetch($this->getCacheKey())) {\n\n return $exchangeRate;\n }\n }\n\n $exchangeRate = parent::getExchangeRate();\n\n if (null !== $this->cache) {\n $this->cache->save($this->getCacheKey(), $exchangeRate, 24 * 60 * 60);\n }\n\n return $exchangeRate;\n }", "public function get_framerate()\n {\n }", "public function get_sampling_rate()\n {\n }", "public function getInterestRate()\n {\n return (1 + ((float) $this->_webserviceHelper->getConfigData('interest_rate') / 100));\n }", "public function getTransactionSpeed() {\n return $this->getValue('speed');\n }", "public function getSize()\n {\n return $this->details['bits'];\n }", "public function getAudioSamplingRate()\n {\n return $this->audioSamplingRate;\n }", "public function getBU()\n {\n $value = $this->get(self::BU);\n return $value === null ? (integer)$value : $value;\n }", "public function getBias() {\r\n return $this->_bias;\r\n }", "public function getRate(): ?string\n {\n return $this->rate;\n }", "public function getRate(): ?string\n {\n return $this->rate;\n }", "function GetConversionRate($currency_code) {\n $query = \"SELECT rate FROM conversion_rates WHERE currency='$currency_code';\";\n $result = $GLOBALS['conn']->query($query);\n\n $output = $result->fetch_row();\n return $output[0];\n }", "public function getConvergenceSpeed()\n {\n $payload = '';\n\n $data = $this->sendRequest(self::FUNCTION_GET_CONVERGENCE_SPEED, $payload);\n\n $payload = unpack('v1speed', $data);\n\n return $payload['speed'];\n }", "public function getRatingValue(): int {\n\t\treturn ($this->ratingValue);\n\t}", "public static function getBitValue($status)\n {\n return \\array_key_exists($status, static::$bits) ? static::$bits[$status] : null;\n }", "public function get_signalStrength(): int\n {\n return $this->_dbm;\n }", "public function get_signalStrength(): int\n {\n return $this->_dbm;\n }", "public function getSpeed(){\n\t\t$request = $this->_sendPacketToController(self::GET_SPEED);\n\t\tif ($request->getState() == self::STATE_OK) // If the packet is send sucefully\n\t\t\treturn $this->_getResponse();\n\t\telse\n\t\t\treturn $request;\n\t}", "public function value(): Number\n {\n return $this->value;\n }", "public function getQuality()\n {\n $value = $this->get(self::quality);\n return $value === null ? (double)$value : $value;\n }", "public function getRateLimit()\n {\n return $this->xRateLimitRemaining;\n }", "public function getConversionRateAsString()\n {\n return $this->getConversionRate().'%';\n }", "public function getProcessRate() : int {\n return $this->iProcessRate;\n }", "public function getSpeed()\r\n {\r\n return $this->speed;\r\n }", "public function getMaxHeartRate(){\n return $this->maxHeartRate;\n }", "public function get_signal(): int\n {\n // $res is a int;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::SIGNAL_INVALID;\n }\n }\n $res = $this->_signal;\n return $res;\n }", "public function getAccelerationPeriod()\n {\n $payload = '';\n\n $data = $this->sendRequest(self::FUNCTION_GET_ACCELERATION_PERIOD, $payload);\n\n $payload = unpack('V1period', $data);\n\n return IPConnection::fixUnpackedUInt32($payload['period']);\n }", "public function getRate()\n {\n $ratesData = $this->getDataFromSource();\n\n if (!$ratesData) {\n return null;\n }\n\n $rateElements = $ratesData->xpath('/source/organizations/organization/currencies/c[@id=\"USD\"]');\n\n $rateSourcesCount = count($rateElements);\n\n if (!$rateSourcesCount) {\n return null;\n }\n\n $sumRate = 0;\n\n foreach ($rateElements as $rateSource) {\n $sumRate += (float)$rateSource->attributes()->ar;\n }\n\n return $sumRate / $rateSourcesCount;\n }", "public function getFrameRate() {}", "public function getBounceRate(Period $period);", "public function getBinaryValue()\n {\n return $this->readOneof(2);\n }", "public function getMeterGain();", "public function getRate(Currency $currency);", "public function get_rgbColorAtPowerOn(): int\n {\n // $res is a int;\n if ($this->_cacheExpiration <= YAPI::GetTickCount()) {\n if ($this->load(YAPI::$_yapiContext->GetCacheValidity()) != YAPI::SUCCESS) {\n return self::RGBCOLORATPOWERON_INVALID;\n }\n }\n $res = $this->_rgbColorAtPowerOn;\n return $res;\n }", "public function getValue()\n {\n return (float) $this->value;\n }", "public function getRmb()\n {\n return $this->get(self::RMB);\n }", "protected function LiveCurrentRate()\n {\n $this->currentTaxObjects();\n\n return self::$current_tax_objects_rate;\n }", "public function getBtcPrice() {\n\n\t\t$response = json_decode( $this->noCfCURLQuery( \"https://bittrex.com/api/v2.0/pub/currencies/GetBTCPrice\" ), 1 );\n\t\tif ( $response['success'] ) {\n\t\t\treturn $response['result'];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}" ]
[ "0.87101024", "0.8493702", "0.77780944", "0.752418", "0.7166275", "0.7161162", "0.6840894", "0.67323685", "0.6585165", "0.6512716", "0.64395356", "0.64395356", "0.64395356", "0.64395356", "0.64395356", "0.64348793", "0.6387861", "0.63706785", "0.6329854", "0.6276258", "0.6276258", "0.62715065", "0.61410785", "0.6139788", "0.6129249", "0.6122397", "0.6080409", "0.6080028", "0.60150677", "0.5995324", "0.5984102", "0.59833515", "0.5881613", "0.5830798", "0.5764486", "0.5685029", "0.567956", "0.567956", "0.567956", "0.567548", "0.5652338", "0.564923", "0.56400067", "0.56204337", "0.56145215", "0.5601751", "0.5594229", "0.5586379", "0.5579428", "0.55689013", "0.5555732", "0.5531609", "0.55210614", "0.5499411", "0.54891133", "0.5452554", "0.54176563", "0.5413436", "0.53923965", "0.5384868", "0.5379954", "0.533702", "0.5327663", "0.5307585", "0.5305984", "0.5283381", "0.5282781", "0.52774054", "0.52587813", "0.52584124", "0.5226167", "0.5226167", "0.52229595", "0.5207478", "0.5199206", "0.5192259", "0.51915234", "0.51915234", "0.51912403", "0.51861817", "0.5184302", "0.5183825", "0.51700467", "0.51640326", "0.51536894", "0.5151812", "0.51414835", "0.5135449", "0.5133802", "0.5133005", "0.5122905", "0.5117541", "0.5114647", "0.51059806", "0.5104793", "0.508621", "0.50834", "0.50617045", "0.5048173" ]
0.6621384
9
Get stream start time.
public function getStartTime();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getStart()\n {\n return $this->start_time;\n }", "public function getTimeStart() {\n return $this->time_start;\n }", "public function starttime() {\n return $this->info['starttransfer_time'];\n }", "public function getStartTime()\n {\n return $this->getData('start_time', 0);\n }", "public function getStartTime()\n {\n return $this->start_time;\n }", "public function getStartTime()\n {\n return $this->start_time;\n }", "public function getStartTime()\n {\n return $this->start_time;\n }", "public function getStartTime()\n {\n return $this->start_time;\n }", "public function getStartTime()\n {\n return $this->start_time;\n }", "public function getStartTime()\n {\n return $this->start_time;\n }", "public function getStartTime()\n {\n return $this->start_time;\n }", "public function getStartTime()\n {\n return $this->start_time;\n }", "public function getStartTime()\n {\n return $this->start_time;\n }", "public function getStartTime()\n {\n return $this->get(self::_START_TIME);\n }", "public function getStartTime()\n {\n return $this->get(self::_START_TIME);\n }", "public function getStartTime()\n {\n return $this->start;\n }", "public function getStartTime() {\n return $this->get(self::STARTTIME);\n }", "public function getStartTime()\n {\n return $this->get(self::START_TIME);\n }", "public function getTime_start()\n {\n return $this->time_start;\n }", "public function startTime() {\n return intval($this['started']);\n }", "public function getBeginTime()\n {\n return $this->get(self::_BEGIN_TIME);\n }", "public function getStartTimestamp() {}", "public function getStartTime() {\r\n\t\treturn $this->startTime;\r\n\t}", "public function getStartTime() {\n return $startTime;\n }", "public static function getStartTime(): float\n {\n return self::$startTimer;\n }", "public function getStartTime()\n {\n return $this->startTime;\n }", "public function getStartTime()\n {\n return $this->startTime;\n }", "public function getStartTime()\n {\n return $this->startTime;\n }", "public function getStartTimeOffset()\n {\n return $this->start_time_offset;\n }", "public static function get_request_start_time()\n { \n $timer = &self::$timer;\n $request_start = $timer->__get('request_start');\n return $request_start;\n }", "function GetStartTimestamp () {\n return $this->hunt_start_timestamp;\n }", "public function get_start_time()\r\n {\r\n return strtotime(date('Y-m-d 00:00:00', $this->get_display_time()));\r\n }", "public function getWindowStartTime()\n {\n return $this->window_start_time;\n }", "public function getStart()\n {\n return $this->start;\n }", "public function getStart()\n {\n return $this->start;\n }", "public function getStart()\n {\n return $this->start;\n }", "public function getStart()\n {\n return $this->start;\n }", "public function getStart()\n {\n return $this->start;\n }", "public function getStart()\n {\n return $this->start;\n }", "public function getStart()\n {\n return $this->start;\n }", "public static function getTimeFromStart()\n {\n return sprintf('%.0f', (microtime(true) - dm::getStartTime()) * 1000);\n }", "public function startTime(): int\n {\n return $this->startTime;\n }", "public static function getStartTime() : float\n {\n if (!isset(static::$startTime)) {\n static::$startTime = microtime(true);\n }//end if\n \n return static::$startTime;\n \n }", "public function getStart() {\n\t\treturn $this->start;\n\t}", "function start_time($start_time=null)\n {\n if (isset($start_time)) $this->start_time = $start_time;\n return $this->start_time;\n }", "public function getStart ()\r\n\t{\r\n\t\treturn $this->start;\r\n\t}", "public function getStartedAt()\n {\n return $this->started_at;\n }", "public function getStartedAt()\n {\n return $this->startedAt;\n }", "function getStart() {\n\t\t\treturn $this->start;\n\t\t}", "public function getTskTimeStart()\n {\n return $this->tsk_time_start;\n }", "public function getStartDateTime()\n {\n return $this->startDateTime;\n }", "public function getStart()\n {\n return isset($this->transaction['start']) ? $this->transaction['start'] : '';\n }", "public function getLoadProcessStartTime()\n {\n global $timestart;\n if ( empty( $timestart ) )\n return '';\n\n return @gmdate( $this->getPluginTimeFormat(), $timestart );\n }", "public function getStartTime() {\n\t\t$gentime = explode(' ',microtime());\n\t\t$gentime = $gentime[1] + $gentime[0];\n\t\treturn $gentime;\n\t}", "public function getStartAt()\n {\n return $this->start_at;\n }", "public function timeCaptureStart() { return $this->_m_timeCaptureStart; }", "public function get_starttime()\n {\n }", "public function getBeginTime(): ?string\n {\n return $this->_begin_time;\n }", "public function getStart() {}", "public static function timeSinceStart(): float\n {\n return \\microtime(true) - self::getRequestTime();\n }", "public function getStart();", "public function getStart();", "public function getStart() {\n\t\treturn $this->attributes['start'];\n\t}", "function getStartTime($event) {\n $timer = Filter::get(Timer::timers(), $event);\n if (!empty($timer)) {\n return Filter::get($timer, 'start');\n }\n return null;\n }", "public function getStartedIn()\n {\n return $this->started_in;\n }", "public function getStartTime()\n {\n $time = $this->eventdatetime->starttime;\n\n if ($this->eventdatetime->isRecurring() &&\n isset($this->recurringdate) &&\n $this->recurringdate instanceof \\UNL\\UCBCN\\Event\\RecurringDate\n ) {\n $first_recurring_date = $this->recurringdate->getFirstRecordInOngoingSeries();\n if (isset($first_recurring_date->recurringdate)) {\n $time = $first_recurring_date->recurringdate . ' ' . substr($time, 11);\n }\n }\n\n return $time;\n }", "public function getStart(): int\n {\n return $this->start;\n }", "public function getStart(): int\n {\n return $this->start;\n }", "public function getStart(): int\n {\n return $this->start;\n }", "public static function getScriptStartTime() {\n\t\t// TODO: Add here a better approach to get the time.\n\t\tif (isset($_SERVER['REQUEST_TIME'])) {\n\t\t\treturn $_SERVER['REQUEST_TIME'];\n\t\t}\n\t\telse {\n\t\t\treturn time();\n\t\t}\n\t}", "public function getStartDateTime();", "protected function startTime()\n {\n return microtime(true);\n }", "public function getBeginTime(): ?string\n {\n if (count($this->beginTime) == 0) {\n return null;\n }\n return $this->beginTime['value'];\n }", "public function getDateStart()\n {\n return $this->dateStart;\n }", "public function getDateStart()\n {\n return $this->dateStart;\n }", "public function getDateStart()\n {\n return $this->dateStart;\n }", "protected function getRequestStartTime()\n {\n if (defined('LARAVEL_START')) {\n return LARAVEL_START;\n }\n\n return $_SERVER[\"REQUEST_TIME_FLOAT\"] ?? microtime(true);\n }", "public static function getBeginningTurnTime(){\n\t\treturn $_SESSION['beginningTurnTime'];\n\t}", "public function getStart()\n {\n return clone $this->_start;\n }", "public function getStart() : \\DateTime\n {\n return new \\Datetime($this->start);\n }", "public static function start()\n {\n $start = round(microtime(true) * 1000);\n echo $start . \"\\n\";\n return $start;\n }", "public function GetStartTime_Min()\n {\n // phpcs:enable PSR1.Methods.CamelCapsMethodName.NotCamelCaps\n return $this->_start_after;\n }", "public function getStart()\n {\n if (array_key_exists(\"start\", $this->_propDict)) {\n if (is_a($this->_propDict[\"start\"], \"\\Beta\\Microsoft\\Graph\\Model\\DateTimeTimeZone\") || is_null($this->_propDict[\"start\"])) {\n return $this->_propDict[\"start\"];\n } else {\n $this->_propDict[\"start\"] = new DateTimeTimeZone($this->_propDict[\"start\"]);\n return $this->_propDict[\"start\"];\n }\n }\n return null;\n }", "function getStartMicrotime();", "static function ts(){\r\n $dt = microtime(true) - self::$starttime;\r\n return self::mtformat($dt);\r\n }", "public function getStarted()\n {\n return $this->started;\n }", "public function getStartDateTime()\n {\n if (array_key_exists(\"startDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"startDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"startDateTime\"])) {\n return $this->_propDict[\"startDateTime\"];\n } else {\n $this->_propDict[\"startDateTime\"] = new \\DateTime($this->_propDict[\"startDateTime\"]);\n return $this->_propDict[\"startDateTime\"];\n }\n }\n return null;\n }", "abstract public function getStart();", "public function start() {\n return $this->_start;\n }", "public function getCoverageStartTime() {\n\t\treturn $this->coverageStartTime;\n\t}", "public function time()\n {\n return $this->_requestTime;\n }", "protected function getStart()\n {\n return new Zend_Date(\n Mage::getStoreConfig(self::CONFIG_PREFIX . 'start', $this->getStore()),\n $this->getDateTimeFormat(),\n $this->getLocale()->getLocaleCode()\n );\n }", "public function getStartedDateTime()\n {\n if (array_key_exists(\"startedDateTime\", $this->_propDict)) {\n if (is_a($this->_propDict[\"startedDateTime\"], \"\\DateTime\") || is_null($this->_propDict[\"startedDateTime\"])) {\n return $this->_propDict[\"startedDateTime\"];\n } else {\n $this->_propDict[\"startedDateTime\"] = new \\DateTime($this->_propDict[\"startedDateTime\"]);\n return $this->_propDict[\"startedDateTime\"];\n }\n }\n return null;\n }", "public function getStartLocation()\n {\n return $this->start_location;\n }", "static public function getSessionTime(){\n if (!isset($_SESSION['start_time'])){\n return 0;\n } else {\n return time() - $_SESSION['start_time'];\n }\n }", "public function start() {\n return $this->start;\n }", "public function getDateBegin()\n {\n return $this->dateBegin;\n }" ]
[ "0.7784188", "0.765107", "0.7599046", "0.74782753", "0.7461665", "0.7461665", "0.7461665", "0.7461665", "0.7461665", "0.7461665", "0.7461665", "0.7461665", "0.7461665", "0.7435858", "0.7435858", "0.741217", "0.74101937", "0.73988014", "0.73061067", "0.7280486", "0.72568715", "0.7253088", "0.72138625", "0.7153514", "0.7144797", "0.71302426", "0.71302426", "0.71302426", "0.7123572", "0.71090955", "0.7078273", "0.70425946", "0.702236", "0.700356", "0.700356", "0.700356", "0.700356", "0.700356", "0.700356", "0.700356", "0.69613445", "0.69440764", "0.692117", "0.6894878", "0.6891052", "0.6877602", "0.6851267", "0.6832932", "0.6794272", "0.6752195", "0.6660364", "0.6639678", "0.66167915", "0.6600329", "0.6594985", "0.65945506", "0.6561936", "0.65593016", "0.65167147", "0.6509713", "0.6479539", "0.6479539", "0.6437491", "0.64313984", "0.6407333", "0.6399143", "0.6385574", "0.6385574", "0.6385574", "0.6385192", "0.6370279", "0.63447046", "0.6342622", "0.63081026", "0.63081026", "0.63081026", "0.6292739", "0.62825155", "0.62726563", "0.62394357", "0.62073934", "0.6163243", "0.61590785", "0.61091006", "0.61028826", "0.6083442", "0.6080954", "0.6008687", "0.60080296", "0.59830827", "0.59726334", "0.5965286", "0.59608346", "0.5943073", "0.5931011", "0.5920405", "0.5915868" ]
0.6653633
53
Get array of values.
public function toArray();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getValues(): array;", "public function getValues(): array;", "public function getValues() : array\n {\n return $this->values;\n }", "public function getValues(): array\n {\n return $this->values;\n }", "public function getArray () {\n\n return $this->values;\n\n }", "public function values() : array;", "public function values(): array\n {\n return $this->values;\n }", "abstract public static function getValues(): array;", "public function getValues(): array\n {\n return array_map(function ($model) {\n return $model->value;\n }, $this->values);\n }", "public function getValues()\n {\n return $this->getVal('value', []);\n }", "function getValues(){\n $values = [];\n \n foreach($this as $valor){\n $values[] = $valor;\n }\n \n return $values;\n }", "public function getValues();", "public static function getValues(): array\n {\n return array_values(self::getConstants());\n }", "public function getValues(): array\n {\n return $this->getEntityDao()->getValues();\n }", "public function toArray()\n\t{\n\t\treturn $this->values;\n\t}", "public function toArray()\n\t{\n\t\treturn $this->values;\n\t}", "abstract public function values(): array;", "public function getValues()\n {\n $values = array();\n\n foreach ($this->items as $item) {\n $values[] = $item['value'];\n }\n\n return $values;\n }", "public function getValues()\n\t{\n\t\t$params = array();\n\n\t\tforeach($this->values as $value)\n\t\t{\n\t\t\tswitch($value[self::TYPE])\n\t\t\t{\n\t\t\t\tcase self::TYPE_RAW:\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::TYPE_IN:\n\n\t\t\t\t\t$params+= $value[self::VALUE];\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase self::TYPE_SCALAR:\n\t\t\t\tdefault:\n\n\t\t\t\t\t$params[] = $value[self::VALUE];\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $params;\n\t}", "public function toArray(): array\n {\n return $this->values;\n }", "public function getValues(): array\n {\n $enumeration = $this->enumeration;\n $values = [];\n foreach ($this->getOrdinals() as $ord) {\n $values[] = $enumeration::byOrdinal($ord)->getValue();\n }\n return $values;\n }", "public function getValues() {}", "public function getValues() {}", "public function getValues () {\n\n return array_values($this->values);\n\n }", "public function getValues()\n {\n return $this->values;\n }", "public function getValues()\n {\n return $this->values;\n }", "public function getValues()\n {\n return $this->values;\n }", "public function getValues()\n {\n return $this->values;\n }", "public function getValues()\n\t\t{\n\t\t\treturn $this->values;\n\t\t}", "public static function getValues()\n {\n return array_values(self::getConstants());\n }", "public function toArray()\n {\n return $this->values;\n }", "public function toArray()\n {\n return $this->values;\n }", "public function getValues()\n {\n return array_values($this->data);\n }", "public function toArray ( )\n {\n return (array) $this->_values;\n }", "public function getAsArray();", "final public function getValues()\n {\n return $this->values;\n }", "public function values() {\n\t\treturn array_values($this->_value);\n\t}", "public function getValues()\n\t{\n\t\treturn $this->_values;\n\t}", "public function getValues() {\n return $this->values;\n }", "public function getValues() {\n return $this->values;\n }", "public function getValues()\n {\n return $this->_values;\n }", "public function getValuesList() {\n return $this->_get(2);\n }", "protected function _getValues()\n {\n $values = $this->getColumn()->getValues();\n return $this->_converter->toFlatArray($values);\n }", "public function values() : array\n {\n return array_values($this->entries);\n }", "protected function getValueAsArray()\n {\n if(strpos($this->value, '|') > 1){\n $values = array_filter(explode(\"|\", $this->value));\n } else {\n $values = [$this->value];\n }\n return $values;\n }", "public function values()\n {\n return $this->values;\n }", "public function values()\n {\n return $this->values;\n }", "public function values()\n {\n return $this->values;\n }", "public function values()\n {\n return $this->values;\n }", "public function getAsArray(): array\n {\n return \\GuzzleHttp\\json_decode(\\GuzzleHttp\\json_encode($this->values), true);\n }", "public function getValuesArray()\n {\n return $this->keyValues;\n }", "public function getValuesList() {\n return $this->_get(3);\n }", "public function all(): array\n {\n return $this->values;\n }", "public function Values()\n {\n return $this->values;\n }", "public function values(): array\n {\n return array_values($this->storage);\n }", "public function values() {\n\t\treturn array_values($this->toArray());\n\t}", "public function get_values() {\n\t\t$values = [];\n\n\t\tforeach ( $this->fields as $field ) {\n\t\t\t$values[$field->name] = $field->get_value();\n\t\t}\n\n\t\treturn $values;\n\t}", "public function toArray(): array\n {\n $array = [];\n\n for ($i = 1; $i <= $this->size; $i++) {\n $array[] = $this->elements[$i]['value'];\n }\n\n return $array;\n }", "public function values(): array\n\t{\n\t\treturn $this->fields()->values()->all();\n\t}", "public function getArray()\n {\n return $this->get(self::_ARRAY);\n }", "public function getValue(): array {\n\t\t\treturn $this->value;\n\t\t}", "public function getResult():array {\n\n # Return value\n return $this->values;\n\n }", "public function values()\n {\n return array_values($this->_data);\n }", "public static function listOfValues()\n {\n return array_values((new static)->_all);\n }", "public function getValues()\n {\n if ($this->_values === null) {\n $this->_values = $this->getColumn()->getData('values') ? $this->getColumn()->getData('values') : [];\n }\n return $this->_values;\n }", "public function toArray() {\n $return = array();\n foreach($this as $value) {\n $return[] = $value;\n }\n return $return;\n }", "public static function values()\n {\n return self::$values;\n }", "public function values(): array\n {\n return array_values($this->items);\n }", "public function getValuesList(){\n return $this->_get(1);\n }", "public function get_values(){ return $this->values; }", "public function getArrValores()\n {\n return $this->arrValores;\n }", "public function getValues()\n {\n $values = array();\n \n foreach ($this->_fields as $name => $info) {\n $values[$name] = (isset($info['value'])) ? $info['value'] : null;\n }\n \n return $values;\n }", "function getValues()\n {\n return $this->type->getValues();\n }", "public function getValues()\n {\n return array_values($this->elements);\n }", "public function getAll()\n {\n return $this->values;\n }", "public function getAll()\n {\n return $this->values;\n }", "abstract public function values(): Seq;", "public function getArray()\n {\n return iterator_to_array($this->getIterator());\n }", "public function values();", "public function values();", "public function values();", "public function values();", "public function values();", "public function getArray() {\n\t\treturn $this->data; \n\t}", "public function getArray() {\n\t\treturn $this->data; \n\t}", "abstract public function getArray();", "public function getValues()\n\t{\n\t\t$returnValue = NULL;\n\n\t\treturn $returnValue;\n\t}", "public function getValues()\n {\n\n\t\t$record = ProductAttributeValues::whereIn('avid',[1,6])->get();\n\t\t$rec = $record->pluck('pro_att_value');\n\t\treturn $rec;\n }", "public function all()\n {\n return $this->values;\n }", "public function getToArrayValues()\r\n\t\t{\r\n\t\t\t$obj = \t$this->getObject();\r\n\t\t\t$arrayValues = array();\r\n\t\t\tforeach ($obj as $key => $value) {\r\n\t\t\t\t$arrayValues[\":\".strtoupper($key)] = $value;\r\n\t\t\t}\r\n\t\t\treturn $arrayValues;\r\n\t\t}", "public function get() : array;", "public function getValues(): Collection\n {\n return $this->values;\n }", "final public function values($is=null):array\n {\n return Base\\Arrs::values($this->arr(),$is);\n }", "public function get(): array;", "public function get(): array;", "public function getData(): array\n\t{\n\t\treturn $this->valueMap;\n\t}", "public function getAllValues();", "public function values(): array\n {\n return $this->rolls;\n }", "public function values() {\n return array_merge(\n array(null),\n $this->primitives(),\n $this->arrays(),\n $this->maps(),\n $this->objects()\n );\n }", "public function getArray(): array\n {\n return $this->array;\n }", "public function getArray(): array\n {\n return $this->array;\n }" ]
[ "0.8668504", "0.8668504", "0.8442533", "0.8401335", "0.8314375", "0.8288904", "0.8237785", "0.8142347", "0.81092423", "0.8102943", "0.8066068", "0.80514735", "0.80386436", "0.8028678", "0.80209863", "0.80209863", "0.798436", "0.7969288", "0.7954389", "0.7920876", "0.7913961", "0.7901677", "0.7901677", "0.78562826", "0.7850014", "0.7850014", "0.7850014", "0.7850014", "0.78462535", "0.7832292", "0.781869", "0.781869", "0.77975297", "0.7759985", "0.775861", "0.7758256", "0.77575415", "0.77574724", "0.7749667", "0.7749667", "0.7737441", "0.77118355", "0.77027607", "0.7690615", "0.76803493", "0.7652391", "0.7652391", "0.7652391", "0.7652391", "0.764695", "0.7643696", "0.7643613", "0.75863475", "0.755924", "0.7535163", "0.7519185", "0.751183", "0.7505233", "0.75022954", "0.7490841", "0.74852604", "0.7471126", "0.74237895", "0.7402505", "0.7364005", "0.73615795", "0.734913", "0.73251873", "0.72895133", "0.727728", "0.7274154", "0.7258353", "0.72545546", "0.72281855", "0.72122544", "0.72122544", "0.71909463", "0.7169022", "0.7153308", "0.7153308", "0.7153308", "0.7153308", "0.7153308", "0.71523416", "0.71523416", "0.7145808", "0.7145278", "0.7139548", "0.7131613", "0.71288", "0.71270096", "0.7108784", "0.7073828", "0.70712525", "0.70712525", "0.70660716", "0.7065424", "0.7054161", "0.7029128", "0.70212024", "0.70212024" ]
0.0
-1
Returns a bit mask of type.
public function getType();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setMaskType($maskType)\n {\n $this->maskType = $maskType;\n return $this;\n }", "public function getBits();", "public function getMask()\n {\n return $this->mask;\n }", "public function getMask()\n {\n return $this->mask;\n }", "public function getMask()\n {\n return $this->mask;\n }", "public static function maskAll(): BitMask\n {\n static $mask = null;\n if (\\is_null($mask)) {\n $mask = new BitMask();\n foreach (static::listLevels() as $level) {\n $mask->add($level);\n }\n }\n return clone $mask;\n }", "public function getBits(): int;", "public function getMask(): string {\n return $this->mask;\n }", "public function getMask()\n {\n return self::prefix_to_mask($this->prefix, $this->version);\n }", "protected function getMask($mask)\n {\n if (is_array($mask)) {\n $mask = array_reduce($mask, function ($combined, $val) {\n return $combined |= $this->getMask($val);\n }, 0);\n }\n\n return parent::getMask($mask);\n }", "public function wireType() {\n if ($this->_m_wireType !== null)\n return $this->_m_wireType;\n $this->_m_wireType = ($this->key()->value() & 7);\n return $this->_m_wireType;\n }", "public static function testTypes($bits = self::INFO) {\n return $bits & self::$mode;\n }", "public function visitIsset(Node $node): UnionType\n {\n return BoolType::instance(false)->asRealUnionType();\n }", "public function getTributeType();", "public static function getMaskValue($bit_sequence){\n if(array_keys($bit_sequence, $this->filter_map)){\n return $this->filter_map[$bit_sequence];\n }\n \n return false;\n }", "public function getNetworkMask()\n {\n return $this->_networkMask;\n }", "public function getAllSetFieldsMask()\n {\n return isset($this->all_set_fields_mask) ? $this->all_set_fields_mask : null;\n }", "public function getMaskBuilder()\n {\n return new MaskBuilder();\n }", "public function getBits()\n {\n return $this->bits;\n }", "public function get_type();", "public function getType() : int {\n return 0100000;\n }", "public static function getBitmaskFlags($bitmask,$flags = array()) \r\n {\r\n $flags_set = array();\r\n foreach($flags as $i => $flag) {\r\n $bit = pow(2,$i);\r\n if($bitmask & $bit) $flags_set[] = $flag; \r\n } \r\n return $flags_set; \r\n }", "protected function getValidMasks()\n {\n return array_reduce(array_keys($this->lookupConstants), function ($validMasks, $key) {\n return $validMasks |= $key;\n }, 0);\n }", "public function getExpectedMask()\n {\n return isset($this->expected_mask) ? $this->expected_mask : null;\n }", "public function type($type);", "private static function getMaskOnes(int $n): int {\n // so (1 << 63) - 1 gets converted to float and loses precision (leading to incorrect result)\n // 2. (1 << 64) - 1 works fine, because (1 << 64) === 0 (it overflows) and -1 is exactly what we want\n // (`php -r 'var_dump(decbin(-1));'` => string(64) \"111...11\")\n $bit = 1 << $n;\n return $bit === PHP_INT_MIN ? ~$bit : $bit - 1;\n }", "public function type(): RootType\n {\n return Type::boolean();\n }", "public function createMaskBuilder()\n {\n return new MaskBuilder();\n }", "public static function ignoreMaskChannels()\n {\n return new FlagQualifier(self::IGNORE_MASK_CHANNELS);\n }", "public static function maskHigher(): BitMask\n {\n static $mask = null;\n if (empty($mask)) {\n $mask = self::maskAll()\n ->remove(self::DEBUG)\n ->remove(self::INFO)\n ->remove(self::NOTICE)\n ->remove(self::WARNING);\n }\n return clone $mask;\n }", "protected function type($type)\n {\n return $this->builder->where('type', $type);\n }", "public function getType()\r\n {\r\n return $this->m_type;\r\n }", "public function getUnionTypeWithUnmodifiedStatic(): UnionType;", "public function getFlags();", "private function _where_bits(string $type = '', string $field = '', $data = '', string $method = ''): self\n\t{\n\t\tif ($type != '' && $field != '' && $data != '')\n\t\t{\n\t\t\t$this->push_where_field($field, $this->_bits($type, $data));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->error('Specify 2 required arguments - field name and value in numeric bitmask, BinData bitmask or positions list format', $method);\n\t\t}\n\n\t\treturn $this;\n\t}", "public function getMask()\n {\n return 'table|thead|tbody|tfoot|th|tr|td';\n }", "function get_flags($id)\r\n\t{\r\n\t\tglobal $db;\r\n\t\t$results = $db->select(tbl($this->flag_tbl),\"*\",\"id = '$id' AND type='\".$this->type.\"'\");\r\n\t\tif(count($results)>0)\r\n\t\t\treturn $results;\r\n\t\treturn false;\r\n\t}", "function getType();", "function getType();", "function getType();", "function getType();", "function getType();", "public function getType()\n {\n return self::TYPE;\n }", "function getType() ;", "function getType() ;", "function getType() ;", "public function getType() {\n\t\treturn self::$_type;\n\t}", "function get_flag_checked($id, $flag){\n return ((get_val($id, \"RefFlags\") & $flag) != 0);\n}", "public function getTypeId()\n {\n return $this->readOneof(1);\n }", "public function setMask($var)\n {\n GPBUtil::checkMessage($var, \\Google\\Cloud\\Firestore\\V1beta1\\DocumentMask::class);\n $this->mask = $var;\n\n return $this;\n }", "protected function get_type() {\n\t\treturn 'boolean';\n\t}", "protected function get_type() {\n\t\treturn 'boolean';\n\t}", "public function getType()\n {\n return isset($this->type) ? $this->type : 0;\n }", "public function get_flag_type($typflag) {\n\t\tstatic $flag_types = array(\n\t\t\t'0' => 'LF_NORMAL',\n\t\t\t'1' => 'LF_LINK',\n\t\t\t'2' => 'LF_SYNLINK',\n\t\t\t'3' => 'LF_CHR',\n\t\t\t'4' => 'LF_BLK',\n\t\t\t'5' => 'LF_DIR',\n\t\t\t'6' => 'LF_FIFO',\n\t\t\t'7' => 'LF_CONFIG',\n\t\t\t'D' => 'LF_DUMPDIR',\n\t\t\t'K' => 'LF_LONGLINK',\n\t\t\t'L' => 'LF_LONGNAME',\n\t\t\t'M' => 'LF_MULTIVOL',\n\t\t\t'N' => 'LF_NAMES',\n\t\t\t'S' => 'LF_SPARSE',\n\t\t\t'V' => 'LF_VOLHDR'\n\t\t);\n\t\treturn (isset($flag_types[$typflag]) ? $flag_types[$typflag] : '');\n\t}", "public function testGetType0()\n{\n\n $actual = $this->bitwiseOr->getType();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function getType()\n\t{\n\t\t$types = $this->getValidTypes();\n\n\t\treturn $types[$this->type];\n\t}", "public function mask($mask = null){\n $mask = $mask !== null ? $mask : $this->mask;\n if(class_exists($mask)){\n return new $mask($this);\n }\n\n throw new MaskNotFoundException(\"Unknown mask provided: \".$mask);\n }" ]
[ "0.6160583", "0.58008623", "0.57621306", "0.57621306", "0.57621306", "0.57409036", "0.54727906", "0.54706585", "0.5433886", "0.5426602", "0.53068703", "0.5296069", "0.5131737", "0.5114931", "0.51127833", "0.50961035", "0.50612384", "0.50523573", "0.5027915", "0.49793056", "0.4973706", "0.49455005", "0.4878136", "0.48771626", "0.48587948", "0.48574728", "0.48513755", "0.4834539", "0.48119497", "0.47858062", "0.47691214", "0.47500226", "0.4741695", "0.4737464", "0.47248927", "0.471985", "0.46908453", "0.4686978", "0.4686978", "0.4686978", "0.4686978", "0.4686978", "0.4683005", "0.46592024", "0.46584404", "0.4658084", "0.46520966", "0.46511805", "0.4649729", "0.4649651", "0.46248737", "0.46248737", "0.46235165", "0.46224946", "0.46209583", "0.46183386", "0.46177095" ]
0.46514735
90
Create a new command instance.
public function __construct() { parent::__construct(); $this->permissions = config('xmake.createEverything'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function newCommand() {\n return newinstance(Command::class, [], '{\n public static $wasRun= false;\n public function __construct() { self::$wasRun= false; }\n public function run() { self::$wasRun= true; }\n public function wasRun() { return self::$wasRun; }\n }');\n }", "public function createCommand()\r\n\t{\r\n\t\t$obj = new DbCommand($this,$this->dbms);\r\n\t\treturn $obj;\r\n\t}", "public function createCommand() {\n\t\treturn new UnboxedCommand( $this );\n\t}", "protected function createCommand($args) {\n $command = new Command();\n $command->id = ifseta($args, 'id');\n $command->name = ifseta($args, 'name');\n $command->url = ifseta($args, 'url');\n $command->description = ifseta($args, 'description');\n $command->uses = ifseta($args, 'uses');\n $command->creationDate = ifseta($args, 'creation_date');\n $command->lastUseDate = ifseta($args, 'last_use_date');\n $command->goldenEggDate = ifseta($args, 'golden_egg_date');\n return $command;\n }", "static public function create($cmd = null, $args = null)\n {\n return new self($cmd, $args);\n }", "public function createCommand($kernel, string $commandName = null, string $commandDescription = null): Command;", "public function makeCommand() \n {\n if($this->CrontabCommandObject === NULL)\n {\n $this->CrontabCommandObject = new \\root\\library\\Crontab\\CrontabCommand\\CrontabCommand();\n }\n \n return $this->CrontabCommandObject;\n }", "public function testInstantiation()\n {\n $command = new CreateRule('dummy name');\n }", "public function command(Command $command);", "public function __construct($command)\n {\n $this->command = $command;\n }", "public static function create(array $data)\n {\n $command = new static();\n $command->exchangeArray($data);\n return $command;\n }", "protected function getCreateCommand()\n {\n $command = new IndexCreateCommand();\n $command->setContainer($this->getContainer());\n\n return $command;\n }", "public function createCommand($string = '')\n {\n return $this->createStringable($string);\n }", "public function createCommand($type) {\r\n $command = $this->xml->createElement('command');\r\n $command->setAttribute('xsi:type', $type);\r\n $command->setAttribute('xmlns', '');\r\n $this->xmlSchema($command);\r\n return $command;\r\n }", "public function __construct()\n {\n // We will go ahead and set the name, description, and parameters on console\n // commands just to make things a little easier on the developer. This is\n // so they don't have to all be manually specified in the constructors.\n if (isset($this->signature)) {\n $this->configureUsingFluentDefinition();\n } else {\n parent::__construct($this->name);\n }\n\n // Once we have constructed the command, we'll set the description and other\n // related properties of the command. If a signature wasn't used to build\n // the command we'll set the arguments and the options on this command.\n $this->setDescription((string) $this->description);\n\n $this->setHelp((string) $this->help);\n\n $this->setHidden($this->isHidden());\n\n if (! isset($this->signature)) {\n $this->specifyParameters();\n }\n }", "public function make(string $name, PreprocessorInterface $preprocessor = null): CommandInterface;", "private function _getCommandByClassName($className)\n {\n return new $className;\n }", "public function newCommand($regex, $callable) {\n $cmd = new Command();\n $cmd->regex = $regex;\n $cmd->callable = $callable;\n return $this->addCommand($cmd);\n }", "public static function create($commandID, ...$args)\n {\n $arguments = func_get_args();\n\n return new static(array_shift($arguments), $arguments);\n }", "private function __construct($command = null)\n {\n $this->command = $command;\n }", "public static function factory(string $command, string $before = '', string $after = ''): self\n {\n return new self($command, $before, $after);\n }", "public function getCommand() {}", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\ESCAPE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('tag', null, null, false))\n ->addArgument(new Argument($this->tag, null, null, true));\n\n return $command;\n }", "public function testCanBeInstantiated()\n {\n $command = $this->createInstance();\n $this->assertInstanceOf('\\\\Dhii\\\\ShellInterop\\\\CommandInterface', $command, 'Command must be an interoperable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\ConfigurableCommandInterface', $command, 'Command must be a configurable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\MutableCommandInterface', $command, 'Command must be a mutable command');\n }", "public function getCommand();", "protected function createCommand($name, array $parameters = [])\n {\n return new Fluent(\n array_merge(\n compact('name'),\n $parameters)\n );\n }", "public function testCanPassCommandStringToConstructor()\n {\n $command = new Command('/bin/ls -l');\n\n $this->assertEquals('/bin/ls -l', $command->getExecCommand());\n }", "public function makeCommandInstanceByType(...$args): CommandInterface\n {\n $commandType = array_shift($args);\n\n switch ($commandType) {\n case self::PROGRAM_READ_MODEL_FETCH_ONE_COMMAND:\n return $this->makeFetchOneCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_COMMAND:\n return $this->makeFindCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_LITE_COMMAND:\n return $this->makeFindLiteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_TASK_COMMAND:\n return $this->makeItemCreateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_COMMAND:\n return $this->makeItemCreateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_TASK_COMMAND:\n return $this->makeItemUpdateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_COMMAND:\n return $this->makeItemUpdateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_TASK_COMMAND:\n return $this->makeItemDeleteTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_COMMAND:\n return $this->makeItemDeleteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_ADD_ID_COMMAND:\n return $this->makeItemAddIdCommand(...$args);\n\n default:\n throw new FactoryException(sprintf('Command bus for type `%s` not found!', (string) $commandType));\n }\n }", "public function __construct($cmd)\n {\n $this->cmd = $cmd;\n }", "public function getCommand()\n {\n }", "public function command($class)\n {\n $runnable = $this->resolveClass($class);\n\n if ( ! $runnable instanceof Command) {\n throw new InvalidArgumentException(get_class($runnable).' must be an instance of '.Command::class.'.');\n }\n\n $command = $runnable;\n\n if ($runnable instanceof Taggable) {\n $command = new Cached($command, $this);\n }\n\n if ($runnable instanceof Transactional) {\n $command = new Transaction($command, $this, $this->makeFromContainer(ConnectionInterface::class));\n }\n\n if ($runnable instanceof Eventable) {\n $command = new Evented($command, $this);\n }\n\n return $this->newBuilder($command);\n }", "protected function createCommandFactory(): CommandFactory\n {\n return new CommandFactory([\n 'CLOSE' => Command\\CLOSE::class,\n ]);\n }", "public static function register() {\n\n if ( !defined( 'WP_CLI' ) || !WP_CLI ) {\n return;\n }\n \n $instance = new static;\n if(empty( $instance->namespace )) {\n throw new \\Exception(\"Command namespace not defined\", 1);\n \n }\n\t\t\\WP_CLI::add_command( $instance->namespace, $instance, $instance->args ?? null );\n\t}", "public function addCommand($command);", "public function add(Command $command);", "abstract protected function getCommand();", "public function createCommand()\r\n\t{\r\n\t\t//start the string\r\n\t\t$command = '';\r\n\t\t\r\n\t\t//add the java command or the path to java\r\n\t\t$command .= $this->java_path;\r\n\t\t\r\n\t\t//add the class path\r\n\t\t$command .= ' -cp \"'. $this->stanford_path . $this->seperator . '*\" ';\r\n\t\t\r\n\t\t//add options\r\n\t\t$options = implode(' ', $this->java_options);\r\n\t\t$command .= '-'.$options;\r\n\t\t\r\n\t\t//add the call to the pipeline object\r\n\t\t$command .= ' edu.stanford.nlp.pipeline.StanfordCoreNLP ';\r\n\r\n\t\t//add the annotators\r\n\t\t$command .= '-annotators '. $this->listAnnotators();\r\n\t\t\r\n\t\t//add the input and output directors\r\n\t\t$command .= ' -file '. $this->tmp_file . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//this is for testing purposes\r\n\t\t//$command .= ' -file '. $this->tmp_path .'\\\\nlp3F25.tmp' . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//if using regexner add this to the command string\r\n\t\tif($this->annotators['regexner'] === true)\r\n\t\t{\r\n\t\t\t$command .=' -regexner.mapping '. $this->regexner_path . $this->seperator . $this->regexner_file;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn $command;\r\n\t}", "protected function createCommand(string $name, array $parameters = []): Fluent\n {\n return new Fluent(array_merge(compact('name'), $parameters));\n }", "public function __construct()\n {\n parent::__construct(static::NAME, static::VERSION);\n $this->add(new DefaultCommand());\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->command_name = config(\"custom-commands.command_name\");\n\n parent::__construct($this->signature = $this->command_name);\n\n $this->commands = (array) config(\"custom-commands.commands\");\n \n $this->table = config(\"custom-commands.table\");\n\n $this->row = config(\"custom-commands.row\");\n\n $this->changeEnv = (boolean) config(\"custom-commands.change_env\");\n\n }", "protected function createCommandFile()\n {\n $command_file_full_path = $this->command_dir_path . DIRECTORY_SEPARATOR . $this->arg->getCommandFileName();\n\n // Check if the command already exists\n if (file_exists($command_file_full_path)) {\n throw new Exception('Command already exists.');\n }\n\n // Create the file for the new command\n $command_file = fopen($command_file_full_path, 'w');\n\n // TODO: Create Script Generator to generate the PHP scripts for the new command.\n\n fclose($command_file);\n\n $this->console->getOutput()->println('File created at: ' . $command_file_full_path);\n $this->console->getOutput()->success('Command ' . $this->arg->getSignature() . ' created successfully.');\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public static function create(InteropContainer $container)\n {\n $middleware = $container->get('cmd.middleware');\n return new CommandBusFactory($middleware);\n }", "private function createCli() {\n $this->cli = new Cli();\n $this->commands = $this->commandParser->getAllCommands();\n\n foreach ($this->commands as $command) {\n if ($command->isDefault()) {\n $this->cli->command(\"*\");\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n if ($command->getName() != \"\") {\n $this->cli->command($command->getName())->description($command->getDescription());\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n }\n\n\n }", "public function testInstantiation()\n {\n $this->assertInstanceOf('Contao\\ManagerBundle\\Command\\InstallWebDirCommand', $this->command);\n }", "public function command(string $command): self\n {\n $this->addCommands[] = $command;\n\n return $this;\n }", "public function create() {}", "protected function createProcess($cmd)\n {\n return new Process(explode(' ', $cmd));\n }", "public function create(){}", "protected function getCommandFactory(): Command\\Factory\n {\n return new Command\\RedisFactory();\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->commandData = new CommandData($this, CommandData::$COMMAND_TYPE_API);\n }", "public function testNewCommand() : void\n {\n $this->assertFalse($this->command->hasArguments());\n $this->assertEquals(\"\", $this->command->getArguments());\n }", "protected function createCommandBuilder()\n\t{\n\t\treturn new CSqliteCommandBuilder($this);\n\t}", "public function __construct($command, $config = [])\n {\n $this->command = $command;\n $this->_output = $this->getDefaultOutput();\n parent::__construct($config);\n }", "public function __construct(){\n\n global $argv;\n\n if(!isset($argv[1])){\n echo 'You must supply a command!' . PHP_EOL;\n exit;\n }//if\n\n $args = $argv;\n\n $scriptName = array_shift($args);\n $method = array_shift($args);\n\n $method = explode('-',$method);\n foreach($method as $k => $v){\n if($k != 0){\n $method[$k] = ucwords($v);\n }//if\n }//foreach\n\n $method = implode('',$method);\n\n $resolved = false;\n\n if(method_exists($this,$method)){\n call_user_func(Array($this,$method), $args);\n $resolved = true;\n }//if\n else {\n foreach(static::$extendedCommands as $commandClass){\n if(method_exists($commandClass,$method)){\n call_user_func(Array($commandClass,$method), $args);\n $resolved = true;\n break;\n }//if\n }//foreach\n }//el\n\n if(!$resolved){\n echo \"`{$method}` is not a valid CLI command!\";\n }//if\n\n echo PHP_EOL;\n exit;\n\n }", "public function forCommand($command)\n {\n $this->command = $command;\n $this->pipe = new NullPipe();\n $this->manager = new InteractiveProcessManager($this->userInteraction);\n\n return $this;\n }", "public function __construct()\n {\n parent::__construct('pwman', '0.1.0');\n\n $getCommand = new Get();\n $this->add($getCommand);\n\n $setCommand = new Set();\n $this->add($setCommand);\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function createCommand(?string $sql = null, array $params = []): Command;", "public function __construct($command = NULL, $name = NULL)\n {\n $args = func_get_args();\n\n switch ($command) {\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n case self::CONSTR_CMD_POP_FROM_ARR:\n case self::CONSTR_CMD_POP_FROM_OBJ:\n case self::CONSTR_CMD_POP_FROM_DB:\n case self::CONSTR_CMD_NEW:\n $this->setup_name = $name;\n\n # shift off known args\n array_shift($args);\n array_shift($args);\n break;\n }\n\n switch ($command) {\n case self::CONSTR_CMD_POP_FROM_ARR:\n $this->applyArray($args[0]);\n break;\n case self::CONSTR_CMD_POP_FROM_OBJ:\n break;\n case self::CONSTR_CMD_POP_FROM_DB:\n break;\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n $this->applyArray($args[0]);\n $this->setAllLoaded();\n break;\n default:\n throw new OrmInputException('Guessing not supported, please explicitly specify construction type');\n self::constructGuess($args);\n }\n\n $this->ensureObjectInDb();\n }", "public function generateCommands();", "protected function newInstanceCommand($commandClass)\n {\n $class = new ReflectionClass($commandClass);\n\n return $class->newInstanceArgs($this->resolveCommandParameters($class));\n }", "protected function buildCommand()\n {\n return $this->command;\n }", "public function makeItemCreateCommand(string $processUuid, array $item): ItemCreateCommand\n {\n $processUuid = ProcessUuid::fromNative($processUuid);\n $uuid = Uuid::fromNative(null);\n $item = Item::fromNative($item);\n\n return new ItemCreateCommand($processUuid, $uuid, $item);\n }", "public function __construct($commandName, $args = [], $description = '') {\n if (!$this->setName($commandName)) {\n $this->setName('--new-command');\n }\n $this->addArgs($args);\n\n if (!$this->setDescription($description)) {\n $this->setDescription('<NO DESCRIPTION>');\n }\n }", "public function getCommand($name, array $args = array())\n {\n return parent::getCommand($name, $args)\n ->setRequestSerializer(RequestSerializer::getInstance());\n }", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\DONT_ADD_SPACE_BEFORE_VALUE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('rev-parse'))\n ->addArgument(new Argument('HEAD'));\n\n return $command;\n }", "protected function instantiateCommand(Request $request, $args)\n {\n $command = new DeletePackageCustomerCommand($args);\n\n $requestBody = $request->getParsedBody();\n\n $this->setCommandFields($command, $requestBody);\n\n return $command;\n }", "public function createCommand($sql = null, $params = [])\n {\n $command = new Command([\n 'db' => $this,\n 'sql' => $sql,\n ]);\n\n return $command->bindValues($params);\n }", "protected function setCommand($value) {\n\t\t$this->_command = trim($value);\n\t\treturn $this;\n\t}", "public function setCommand($command)\n {\n $this->command = $command;\n\n return $this;\n }", "public function buildCommand()\n {\n return parent::buildCommand();\n }", "private function registerMakeModuleCommand()\n {\n $this->app->singleton('command.make.module', function($app) {\n return $app['Caffeinated\\Modules\\Console\\Generators\\MakeModuleCommand'];\n });\n\n $this->commands('command.make.module');\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->currentDirectory = getcwd();\n $this->baseIndentLevel = 0;\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\HelpCommand\", \"help\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\InitializePlanetCommand\", \"init\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackAndPushUniToolCommand\", \"packpushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackLightPluginCommand\", \"packlightmap\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushCommand\", \"push\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushUniverseSnapshotCommand\", \"pushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\UpdateSubscriberDependenciesCommand\", \"updsd\");\n\n }", "public function getCommand(string $command);", "protected function registerCommand(){\n\t\t$this->app->singleton('fakeid.command.setup', function ($app){\n\t\t\treturn new SetupCommand();\n\t\t});\n\n\t\t$this->commands('fakeid.command.setup');\n\t}", "public function addCommand($command, $args = [], $data = [])\n {\n $item = new ScreenCommand();\n $item->screen_id = $this->id;\n $item->command = $command;\n $item->arguments = $args;\n $item->fill($data);\n $item->save();\n\n return $item;\n }", "public function test_creating_command_from_container()\n {\n $now = new \\DateTime();\n $this->container->add('DateTime', $now);\n $command = 'Spekkionu\\DomainDispatcher\\Test\\Commands\\CommandWithConstructor';\n $result = $this->dispatcher->dispatch($command);\n $this->assertSame($now, $result);\n }", "protected function createProcess(): Process\n {\n $command = [\n $this->settings['executable']\n ];\n\n $command[] = $this->from;\n $command[] = $this->to;\n\n // Set the margins if needed.\n if ($this->settings['marginsType'] !== self::MARGIN_TYPE_NO_MARGINS) {\n $command[] = '--marginsType=' . $this->settings['marginsType'];\n }\n\n // If we need to proxy with node we just need to prepend the $command with `node`.\n if ($this->settings['proxyWithNode']) {\n array_unshift($command, 'node');\n }\n\n // If there's no graphical environment we need to prepend the $command with `xvfb-run\n // --auto-servernum`.\n if (! $this->settings['graphicalEnvironment']) {\n array_unshift($command, '--auto-servernum');\n array_unshift($command, 'xvfb-run');\n }\n\n return new Process($command);\n }", "private function registerCommand()\n {\n $this->app->singleton('command.shenma.push', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\Push();\n });\n\n $this->app->singleton('command.shenma.push.retry', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\PushRetry();\n });\n }", "public function __construct(string $command, string $before = '', string $after = '')\n {\n $this->command = $command;\n $this->before = $before;\n $this->after = $after;\n }", "public function generateCommand($singleCommandDefinition);", "public function create() {\n }", "public function create() {\n }", "public function create() {\r\n }", "public function create() {\n\n\t}", "private function getImportCommand()\n {\n return new IndexImportCommand(self::getContainer());\n }", "public function __construct($command)\n {\n $this->command = $command;\n\n $this->command->line('Installing Images: <info>✔</info>');\n }", "public function __construct()\n {\n self::$instance =& $this;\n\n $commanddir = Config::main('directory');\n $excludes = Config::main('exclude');\n\n if(is_null($commanddir))\n die('Could not find commands directory. It should be specified in the main config.');\n\n //The directory where commands reside should be relative\n //to the directory with the clip executable.\n $dir = realpath(__DIR__.\"/{$commanddir}\");\n\n $cmdfiles = scandir($dir);\n //Loop through each file in the commands directory\n foreach($cmdfiles as $file)\n {\n //Assume that each file uses the standard '.php' file extension.\n $command = substr($file, 0, -4);\n\n //Ignore the unnecessary directories as commands and anything that\n //has been marked for exclusion then attempt to include the valid ones.\n if($file !== '.' && $file !== '..' && array_search($command, $excludes) === false && include(\"{$dir}/{$file}\"))\n {\n if(class_exists($command, false))\n {\n $obj = new $command;\n //Only load commands that use the clip command interface\n if($obj instanceof Command)\n $this->commands[strtolower($command)] = $obj;\n }\n }\n }\n }", "public function __construct($action, $command = null) {\n parent::__construct($action, self::NAME);\n\n $fieldFactory = FieldFactory::getInstance();\n\n $commandField = $fieldFactory->createField(FieldFactory::TYPE_STRING, self::FIELD_COMMAND, $command);\n\n $this->addField($commandField);\n }", "public function createCommand($db = null, $action = 'get')\n {\n if ($db === null) {\n $db = Yii::$app->get(Connection::getDriverName());\n }\n $this->addAction($action);\n $commandConfig = $db->getQueryBuilder()->build($this);\n\n return $db->createCommand($commandConfig);\n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();" ]
[ "0.8010746", "0.7333379", "0.72606754", "0.7164165", "0.716004", "0.7137585", "0.6748632", "0.67234164", "0.67178184", "0.6697025", "0.6677973", "0.66454077", "0.65622073", "0.65437883", "0.64838654", "0.64696646", "0.64292693", "0.6382209", "0.6378306", "0.63773245", "0.6315901", "0.6248427", "0.6241929", "0.6194334", "0.6081284", "0.6075819", "0.6069913", "0.60685146", "0.6055616", "0.6027874", "0.60132784", "0.60118896", "0.6011778", "0.5969603", "0.59618074", "0.5954538", "0.59404427", "0.59388787", "0.5929363", "0.5910562", "0.590651", "0.589658", "0.589658", "0.589658", "0.58692765", "0.58665586", "0.5866528", "0.58663124", "0.5852474", "0.5852405", "0.58442044", "0.58391577", "0.58154446", "0.58055794", "0.5795853", "0.5780188", "0.57653266", "0.57640004", "0.57584697", "0.575748", "0.5742612", "0.5739361", "0.5732979", "0.572247", "0.5701043", "0.5686879", "0.5685233", "0.56819254", "0.5675983", "0.56670785", "0.56606543", "0.5659307", "0.56567776", "0.56534046", "0.56343585", "0.56290466", "0.5626615", "0.56255764", "0.5608852", "0.5608026", "0.56063116", "0.56026554", "0.5599553", "0.5599351", "0.55640906", "0.55640906", "0.5561977", "0.5559745", "0.5555084", "0.5551485", "0.5544597", "0.55397296", "0.5529626", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908" ]
0.0
-1
Execute the console command.
public function handle() { $this->askForModelName(); $this->askForFields(); $this->askIfIsApi(); $this->askForPermissions(); $this->askWhetherShouldNameAutomatically(); $this->createModel(); $this->createMigration(); $this->createFactory(); $this->createSeeder(); $this->createRequest(); $this->createResource(); $this->createController(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handle()\n {\n\t\t$this->info('league fetching ..');\n $object = new XmlFeed();\n\t\t$object->fetchLeague($this->argument('sports_id'));\n\t\t$this->info('league saved');\n }", "public function handle()\n {\n //get us the Converter class instance and call the convert() method on it.\n $this->info(\n \\Aregsar\\Converter\\ConverterFacade::convert($this->argument(\"currency\"))\n );\n }", "public function handle()\n {\n $this->locale = $this->argument('locale');\n\n $this->loadGroupLines();\n\n $this->loadNameSpacedLines();\n\n $this->info('Complete');\n }", "public function handle()\n {\n $this->importUser($this->argument('username'));\n $this->call('ldap:show-user', $this->arguments());\n }", "public function handle() {\n $user = User::where('id', $this->argument('userId'))->first();\n $this->info($user->email);\n }", "public function handle()\n {\n $translations = collect(json_decode(file_get_contents('https://raw.githubusercontent.com/getbible/Bibles/master/translations.json')))->flatten();\n switch($this->argument('action')) {\n case 'fetch':\n $this->fetchBibles($translations);\n break;\n case 'convert':\n $this->convertBibles($translations);\n break;\n }\n }", "public function handle()\n {\n\n $settings = Setting::fetch();\n $id = $this->argument('id');\n $this->scrape_game_data($id);\n }", "public function handle()\n {\n try {\n $evalstr = $this->evaluater->evaluate($this->argument('evalString'));\n $this->info($evalstr);\n } catch (ForbiddenSymbolsException $exception) {\n $this->error($exception->getMessage());\n } catch (IncorrectSymbolsException $exception) {\n $this->error($exception->getMessage());\n }\n }", "public function handle()\n {\n // env('CALENDARINDEX_TOKEN', '6f2bd927201ba4b22bb57df08db0c517e51732de')\n $this->getData($this->argument('country'), $this->argument('region'));\n }", "public function handle()\n {\n $email = $this->argument('email');\n $name = $this->argument('name');\n\n $this->info(\"starting to generate users details\");\n\n }", "public function handle()\n {\n\t\t$this->info('Importing translations...');\n\n\t\t$this->manager->importTranslations(true);\n }", "public function handle()\n {\n $user = null;\n\n if ($email = $this->option(\"email\", false)) {\n $user = $this->findByEmail($email);\n }\n\n if ($id = $this->option(\"id\", false)) {\n $user = $this->findById($id);\n }\n\n if (empty($user)) {\n $this->warn(\"User no found\");\n }\n else {\n $this->setRoleToUser($user);\n }\n }", "public function handle()\n {\n $name = ucwords($this->argument('name'));\n $this->call('repository:contract', [ 'name' => $name ]);\n $this->call('repository:class', [ 'name' => $name, '--driver' => $this->option('driver') ]);\n }", "public function handle()\n\t{\n\t\t// Superuser\n\t\tif( ! $this->option('no-superuser'))\n\t\t\t$this->call('setup:superuser');\n\n\t\t// Countries\n\t\tif( ! $this->option('no-countries'))\n\t\t\t$this->call('setup:countries', ['country' => array_filter(explode(',', $this->option('countries')))]);\n\n\t\t// Languages\n\t\tif( ! $this->option('no-languages'))\n\t\t\t$this->call('setup:languages', ['language' => array_filter(explode(',', $this->option('languages')))]);\n\n\t\t// Currencies\n\t\tif( ! $this->option('no-currencies'))\n\t\t\t$this->call('setup:currencies', ['currency' => array_filter(explode(',', $this->option('currencies')))]);\n\n\t\t// Clear cache\n\t\t$this->call('cache:clear');\n\t}", "public function handle()\n\t{\n\t\t$name = $this->argument('name');\n\t\t\n\t\t$this->info(\"Searching eve api for {$name}\");\n\t\t$result = Corporation::searchEVEAPI($name);\n\n\t\t$this->info(\"results\");\n\t\tforeach($result as $corp)\n\t\t{\n\t\t\tprint $corp->name . \" \" . $corp->id . \"\\r\\n\";\n\t\t}\n\t}", "public function handle()\n {\n $user = $this->argument('user');\n $this->info('Display this on the screen, user ' . $user);\n return 0;\n }", "public function handle()\n {\n $this->userVectors->test($this->option('force'));\n }", "public function handle()\n {\n $mapping = $this->formatMappingName((string)$this->argument('mapping'));\n \n $model = $this->option('model') ? $this->formatModelName($this->option('model')) : null;\n \n $this->filesystem->put(\n $this->buildMappingFilePath($mapping),\n $this->buildMapping(\n $this->getDefaultStub(),\n $mapping,\n $model\n )\n );\n \n $this->composer->dumpAutoloads();\n }", "public function handle()\n {\n $option = $this->argument('option');\n\n if (! in_array($option, ['expired', 'all'])) {\n return $this->error('Invalid option supplied to command...');\n }\n\n $this->comment('Beginning pruning process...');\n\n $this->comment($this->pruneDatabase($option) . ' deleted from database...');\n\n $this->comment($this->pruneFiles($option) . ' deleted from files...');\n\n $this->info('Nonces pruned successfully!');\n }", "public function handle()\n {\n switch ($this->argument('type')) {\n case 'dns':\n $this->dnscheck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n case 'whois':\n $this->whoischeck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n }\n }", "public function handle()\n\t{\n\t\t\n\t\t$source_directory = $this->argument( 'source_directory' );\n\t\t$target_directory = $this->argument( 'target_directory' );\n\t\t$template = (string) $this->option( 'template' );\n\n\t\t$statik = new \\App\\Statik\\Statik;\n\n\t\t$statik->generateHTMLFiles( $this, $source_directory, $target_directory, $template ) && $this->info( \"\\e[1;32mDONE!\" );\n\n\t}", "public function handle()\n {\n $subscriptionUpdateService = new SubscriptionUpdateService();\n $subscriptionUpdateService->runUpdates();\n }", "public function handle()\n {\n if (!$this->argument('file')) {\n $this->info('Please specify file to call.');\n }\n\n $file = $this->argument('file');\n\n if (!$this->fileHandler->exists($file)) {\n $this->info('Wrong path or file not exist.');\n }\n\n $this->executeFile($file);\n }", "public function handle()\n {\n $user = $this->argument('user');\n $this->scanner->setUserName($user);\n $this->scanner->scanUser();\n }", "public function handle()\n {\n if ($this->argument('user')) {\n $userId = $this->argument('user');\n\n $this->info(\"Liquidate affiliate commission for user \" . $userId);\n\n $user = $this->userService->findById($userId);\n\n if ($user) {\n $this->walletService->liquidateUserBalance($user);\n } else {\n $this->error(\"User not found\");\n }\n\n $this->info(\"Done\");\n } else {\n $this->info(\"Liquidate all commissions\");\n\n $this->walletService->liquidateAllUsersBalance();\n\n $this->info(\"Done\");\n }\n }", "public function handle()\n {\n $action = $this->choice('what action do you have on mind', [\n 'add-relation', 'remove-columns', 'column-type', 'rename-column'\n ]);\n switch ($action) {\n case 'add-relation':\n $this->addRelation();\n break;\n\n case 'remove-columns':\n $this->removeColumns();\n break;\n case 'column-type':\n $this->columnType();\n break;\n case 'rename-column':\n $this->renameColumn();\n break;\n default:\n $this->error('Unsupported action requested...');\n }\n $this->info('Command executed successfully');\n }", "public function handle()\n {\n $arguments = $this->arguments();\n $storageDir = $arguments['storageDir'];\n $localStorageDir = $arguments['localStorageDir'];\n $url = $arguments['url'];\n $cmd = sprintf(\"./app/Console/Commands/ShellScripts/screen_shot.sh %s %s %s\", $storageDir, $localStorageDir, $url);\n\n while (true) {\n $result = shell_exec($cmd);\n print_r($result);\n sleep(3);\n }\n }", "public function handle()\n {\n $city = $this->argument('city');\n\n $weatherService = new CurrentWeatherService();\n try {\n $weather = $weatherService->getByCity($city);\n } catch (WeatherException $e) {\n $this->error($e->getMessage());\n return;\n }\n\n $this->info('Weather for city '.$city);\n dump($weather->toArray());\n }", "public function handle()\n {\n $this->getModels($this->argument('model'));\n $this->getLanguages($this->argument('locale'));\n $this->createMultiLanguageRecords();\n }", "public function handle()\n {\n $this->processOptions();\n\n echo json_encode( $this->dateTimeRange ) . \"\\n\";\n\n $this->dispatch( new ProcessNewActionsJob(\n $this->dateTimeRange ,\n str_random( 16 ),\n $this->option('runtime-threshold')\n ) );\n }", "public function handle()\n {\n $fightId = $this->argument('fight_id');\n $metricId = $this->argument('metric_id');\n //$strategyName = 'App\\\\'.$this->argument('metric_name');\n\n $metric = BossMetric::find($metricId);\n if ($metric === null) {\n $this->error(\"Error: no metric with id: $metricId found!\");\n return;\n }\n\n $fight = Fight::find($fightId);\n\n if ($fight === null) {\n $this->error(\"Error: no fight with id: $fightId found!\");\n return;\n }\n\n $strategy = $metric->getStrategy();\n $strategy->setFight($fight);\n $strategy->run();\n }", "public function handle()\n {\n $user_id = $this->argument('user') ?? null;\n\n if (is_null($user_id)) {\n $users = User::all();\n\n foreach ($users as $user) {\n $this->showUserBalance($user);\n }\n } else {\n $user = User::find($user_id);\n\n $this->showUserBalance($user);\n }\n }", "public function handle()\n {\n\t\t$this->call('vendor:publish');\n\t\t$this->call('migrate');\n\t\t$this->call('db:seed');\n\t\t$this->call('factotum:storage');\n\t\t$this->call('factotum:storage');\n }", "public function handle()\n {\n $this->capsuleService->getAll();\n $this->line('Command Worked');\n }", "public function handle()\n {\n $platform_wechat_id = $this->argument('id');\n $customer_id = $this->argument('customer_id');\n $this->info(\"Starting at \".date('Y-m-d H:i:s').\". Running initial for 【{$this->signature}】\");\n $this->getUserInfoList($platform_wechat_id,$customer_id);\n $this->info(\"End at \".date('Y-m-d H:i:s').\". over for 【{$this->signature}】\");\n }", "public function handle()\n {\n $this->publishAssets();\n $this->call('twill:flush-manifest');\n $this->call('view:clear');\n }", "public function handle()\n {\n \n $argument = $this->argument('data');\n \n $this->prepare( $argument );\n \n $this->make();\n \n $this->info( 'migration has been created : '. $this->fileName );\n \n }", "public function handle()\n {\n chdir(resource_path('assets/ts'));\n $path = $this->argument(\"path\");\n if(isset($path))\n {\n Logger::info('execute '.$path);\n Command::executeRaw('tsc', [\"-p\", $path]);\n }else\n Logger::info('execute tsc');\n Command::executeRaw('tsc');\n }", "public function handle()\n {\n $this->info('Starting date change command.');\n\n Word::where('language_id', 1)->update(array('created_at' => '1970-01-01 00:00:01'));\n Word::where('language_id', 2)->update(array('created_at' => '1970-01-01 00:00:01'));\n\n $this->info('Dates have been changed to 1970-01-01 00:00:01');\n }", "public function handle()\n {\n $this->info($this->slugger->encode($this->argument('id')));\n }", "public function handle()\n {\n $this->line(static::$logo);\n $this->line('Neat admin current version:' . Neat::version());\n\n $this->comment('');\n $this->comment('Available commands:');\n\n $this->listAvailableCommands();\n }", "public function handle()\n {\n $this->revisions->updateListFiles();\n }", "public function handle(): void\n {\n // Set argument\n $this->url = $this->argument(self::URL_ARGUMENT);\n\n // Handler takes care of computation\n (new CommandHandler($this))->compute();\n }", "public function handle()\n {\n try\n {\n $filename = $this->argument('filename');\n Excel::import(new ObjectsImport, $filename);\n\n $this->info('Data import is now completed');\n }\n catch(Exception $ex)\n {\n $this->error($ex->getMessage());\n }\n }", "public function handle() {\n $entity = $this->validateEntity($this->argument('entity'));\n $job = new DataProcessingJob($entity, str_random(16));\n $this->dispatch($job);\n }", "public function handle()\n {\n $isProductionMode = 'prod' == $this->argument('mode');\n\n if ($isProductionMode) {\n if (!$this->confirm('Are you sure to run in production mode? Running this command may cause critical issues?')) {\n exit(1);\n }\n }\n\n $this->_recalculate($isProductionMode);\n }", "public function handle()\n {\n if(!$this->verify()) {\n $rank = $this->createRankSuperAdmin();\n $user = $this->createUserSuperAdmin();\n $user->Ranks()->attach($rank);\n $this->line('Felicitaciones');\n } else {\n $this->error('No se puede ejecutar');\n }\n }", "public function handle()\n {\n // Get CLI Input\n $user_id = $this->option(\"uid\");\n\n // User Products\n ( new CommandManager() )->showUserProducts( $user_id );\n }", "public function handle()\n {\n $force = $this->option('force');\n\n if($this->option('without-bulk')){\n $this->withoutBulk = true;\n }\n\n if ($this->generateClass($force)){\n $this->info('Generating permissions for '.$this->modelBaseName.' finished');\n }\n }", "public function handle()\n {\n $userId = $this->argument('user');\n\n /** @var User $user */\n $user = User::findOrFail($userId);\n\n // Get token.\n $info = (new Client())->auth();\n\n // Save to db.\n $user->access_token = $info['access_token'];\n $user->access_secret = $info['access_secret'];\n $user->save();\n\n $this->line(\"Saved access token and secret for user: {$user->email}\");\n }", "public function handle()\n {\n $tournaments = Tournament::all()->toArray();\n foreach ($tournaments as $tournament) {\n $slug = $this->tournamentRepoObj->generateSlug($tournament['name'].Carbon::createFromFormat('d/m/Y', $tournament['start_date'])->year,'');\n DB::table('tournaments')\n ->where('id', $tournament['id'])\n ->update([\n 'slug' => $slug\n ]);\n }\n $this->info('Script executed.');\n }", "public function handle()\n {\n $m = new MemberFromText;\n $m->train();\n $id = $m->predict($this->argument('text'));\n dump(Miembro::find($id)->toArray());\n }", "public function handle()\n {\n $this->generator\n ->setConsole($this)\n ->run();\n }", "public function handle()\n {\n $this->createController();\n $this->createServiceDir();\n\n exit;\n $args = [\n '--provider' => TestProvider::class\n ];\n $className = $this->argument('className');\n if (!$className) {\n $className = 'MethodsList';\n }\n $className = ucwords($className);\n $this->call('vendor:publish', $args);\n $this->info('Display this on the screen ' . $className);\n }", "public function handle()\n {\n $this->createDirectories();\n\n $this->publishTests();\n\n $this->info('Authentication tests generated successfully.');\n }", "public function handle()\n {\n $this->setDbConnection(\n $this->input->getOption('database') ?: config('ghost-database.default_connection')\n );\n\n $native = $this->input->getOption('native-import') ?: config('ghost-database.use_native_importer');\n\n $snapshot = $this->import($native);\n\n $this->info(\"Snapshot `{$snapshot->name}` loaded!\");\n }", "public function handle()\n {\n $exec = $this->argument('exec');\n\n switch ($exec) {\n case 'download' :\n $this->download();\n break;\n\n case 'generate' :\n $this->generate();\n break;\n\n default :\n echo \"Choose 'download' or 'generate' for this command\";\n break;\n }\n }", "public function handle()\n {\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-admin.js', '--group' => 'admin']);\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-frontend.js', '--group' => 'frontend']);\n $this->call(TranslationsGenerateCommand::class);\n }", "public function handle()\n {\n $tenantName = $this->argument('tenant');\n\n $tenant = Tenant::where('name', $tenantName)->orWhere('subdomain', $tenantName)->first();\n\n if ($tenant) {\n $tenant->setActive();\n \\Artisan::call('tinker');\n } else {\n $this->error('Error: Tenant not found');\n }\n }", "public function handle()\n {\n try {\n if (!empty($userId = $this->argument('user'))) {\n $user = User::find($userId);\n } else {\n $user = User::inRandomOrder()->first();\n }\n\n if (empty($user)) {\n throw new \\Exception('User not found');\n }\n\n echo JWTAuth::fromUser($user);\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n\n }", "public function handle()\n {\n $this->setCryptIVFromUrl($this->argument('url'));\n\n $participant = URLParser::parseByName('santa.index', $this->argument('url'))->participant;\n if($participant) {\n $draw = $participant->draw;\n } else {\n $draw = URLParser::parseByName('organizer.index', $this->argument('url'))->draw;\n }\n\n $this->table(\n ['ID', 'Name', 'Email'],\n $draw->participants()->get(['id', 'name', 'email'])->toArray()\n );\n }", "public function handle()\n {\n $this->fetchAndSetToken();\n $imagesToDownload = $this->peekImages(WatchedApp::pluck('package_name'));\n $this->fetchImages($imagesToDownload);\n\n if ($this->option('dont-optimize')) {\n return;\n }\n\n $this->runOptimizeCommand();\n }", "public function handle()\n {\n // if you are on the local environment\n if (!(app()->isLocal() || app()->runningUnitTests())) {\n $this->error('This command is only available on the local environment.');\n return;\n }\n\n $fqdn = $this->argument('fqdn');\n if ($tenant = Tenant::retrieveBy($fqdn)){\n $tenant->delete($fqdn);\n $this->info(\"Tenant {$fqdn} successfully deleted.\");\n }else {\n $this->error('This fqdn doesn\\'t exist.');\n }\n\n }", "public function handle()\n {\n $user_from = $this->option('from');\n $user_to = $this->option('to');\n $sum = $this->option('sum');\n\n CreateTransaction::dispatch($this->usersRepository->getByID($user_from), $this->usersRepository->getByID($user_to), $sum, true);\n $this->transactionsRepository->getAll()->each(function ($transaction){\n \tExecuteTransaction::dispatch($transaction);\n });\n }", "public function handle()\n {\n $this->warn('Starting Retrieve Data');\n\n PeopleService::retrieveData();\n\n $this->info('Retrieve Data Completed');\n }", "public function handle()\n {\n \n $period = $this->option('period');\n \n switch ($period) {\n\n case 'half_month':\n $this->info('Grabing Half Month Income...');\n $this->halfMonth();\n break;\n\n case 'monthly':\n $this->info('Grabing Monthly Income...');\n $this->monthly();\n break;\n \n default:\n $this->info('Grabing Daily Income...');\n $this->daily();\n break;\n\n }\n\n \n }", "public function fire()\n {\n $entityName = $this->argument('entityName');\n $startEntityId = $this->argument('startEntityId');\n $endEntityId = $this->argument('endEntityId');\n $depth = $this->argument('depth');\n\n $this->fixturePath = $this->option('outputPath');\n\n $this->info(\"Generating fixtures for $entityName in {$this->fixturePath}...\");\n \n $this->generateFixtures($entityName, $startEntityId, $endEntityId, $depth);\n }", "public function handle()\n {\n $countryFiles = $this->getFiles();\n\n foreach ($countryFiles as $fileName) {\n $this->seed($fileName);\n }\n\n $this->info('End.');\n }", "public function handle()\n {\n $check = PublishTraitsService::publishTraits();\n\n if ($check)\n {\n $this->info('All files have been published');\n }\n\n $this->info('Failed to publish');\n }", "public function handle()\n {\n $user = User::where('username', $this->argument('user'))\n ->orWhere('email', $this->argument('user'))\n ->first();\n\n if ($user != null) {\n $user->assign('admin');\n $this->line(\"{$user->email} was successfully made an admin.\");\n } else {\n $this->line(\"No user found where username or email is '{$this->argument('user')}'\");\n }\n }", "public function handle()\n {\n event( 'laraview:compile' );\n $this->checkForSelectedViewGeneration();\n\n app( RegisterBlueprint::class )\n ->console( $this )\n ->generate();\n }", "public function handle()\n {\n $project = Project::with(['team.admins', 'team.members'])->findOrFail($this->option('project-id'));\n $user = User::findOrFail($this->option('user-id'));\n if ($this->option('admin')) {\n $project->team->admins()->syncWithoutDetaching($user);\n } else {\n $project->team->members()->syncWithoutDetaching($user);\n }\n return Command::SUCCESS;\n }", "public function handle() {\n try {\n $this->roomService->loadRoomOccupations();\n Log::notice('untis:occupations executed successfully.');\n $this->line('Loaded room occupations from WebUntis.');\n } catch (Exception $e) {\n Log::error('Error loading room occupations.', ['exception' => $e]);\n $this->error('Error loading room occupations: ' . $e->getMessage());\n }\n }", "public function handle()\n {\n $this->loadIxList();\n $this->loadIxMembersList();\n $this->updateIxInfo();\n $this->updateIxMembersInfo();\n }", "public function handle()\n {\n $this->call('vendor:publish', [\n '--provider' => \"Qoraiche\\MailEclipse\\MailEclipseServiceProvider\",\n ]);\n }", "public function handle()\n\t{\n\t\tif ($this->option('dev')) {\n\t\t\tsystem('php '.base_path('.deploy/deploy-dev.php'));\n\t\t} else {\n\t\t\tsystem('php '.base_path('.deploy/deploy.php'));\n\t\t}\n\t}", "public function handle(Command $command);", "public function handle(Command $command);", "public function handle()\n {\n $date_from = $this->argument('date_from');\n\t\t$date_to = $this->argument('date_to');\n\t\tif(!$date_from) {\n\t\t\t$date_from = Carbon::today()->subDays(5);\n\t\t}\n\t\tif(!$date_to) {\n\t\t\t$date_to = Carbon::yesterday();\n\t\t}\n\t\tStats::computeMembers($this->argument('venue_id'), $date_from, $date_to);\n }", "public function handle()\n {\n switch ($this->argument('type')){\n case 'fih':\n $scrapper = new Scrappers\\FederationScrapper();\n $scrapper->get($this->option('level'));\n print $scrapper->message();\n break;\n }\n }", "public function handle()\n {\n Log::info(\"seed:dash Command is working fine!\");\n $this->info('Dashboard Database seeding completed successfully.');\n }", "public function handle()\n {\n $originalId = $this->argument('original_id');\n\n $status = true;\n if ($this->option('status') === 'false') {\n $status = false;\n }\n\n if ($video = Video::where('original_id', $originalId)->first()) {\n $video->dmca_claim = $status;\n $video->save();\n\n $this->info('Video\\'s dmca_claim set to: ' . json_encode($status));\n return ;\n }\n\n $this->error('No video found with original_id of: ' . $originalId);\n return;\n }", "public function handle()\n {\n $this->call('config:clear');\n\n $this->call('config:update');\n\n $this->info('Configuration cached successfully!');\n }", "public function handle()\n {\n $filePath = 'public/' . $this->argument('fileName');\n $count = $this->argument('count');\n \n $fileData = array_slice(file($filePath), 0, $count);\n $this->info(implode('', $fileData));\n }", "public function handle()\n {\n //\n $modelName = $this->argument('model');\n $column = $this->argument('column');\n $this->generateMutation($modelName, $column);\n\n }", "public function handle()\n {\n $email = $this->argument('email');\n\n Mail::to($email)->send(new SendMailable('Test Mail'));\n\n if (Mail::failures()) {\n $this->info('Email failed to send');\n } else {\n $this->info('Email successfully sent');\n }\n }", "public function handle()\n {\n $this->call('route:trans:clear');\n\n $this->cacheRoutesPerLocale();\n\n $this->info('Routes cached successfully for all locales!');\n }", "public function handle()\n {\n $this->info('Welcome to command for Bantenprov\\WilayahIndonesia package');\n }", "public function handle()\n {\n if($this->hasOption('no_dump') && $this->option('no_dump')){\n $this->composer_dump = false;\n }\n $this->readyDatas();\n $this->datas['startSymbol']='{{';\n $this->datas['endSymbol']='}}';\n $this->create();\n }", "public function handle()\n {\n $this->makeDir($this->basePath . $this->kebabPlural());\n\n $this->exportViews();\n\n $this->info('Resource views generated successfully.');\n }", "public function handle()\n {\n $repository = new OglasiCrawlerRepository();\n $ads = $repository->getAds();\n $repository->saveAds($ads);\n\n echo 'Ads were successfully retrieved' . PHP_EOL;\n }", "public function handle()\n {\n $movies = \\App\\Models\\Movie::whereNull('meta')->take(40)->orderBy('id')->get();\n $movies->each(function($movie){ sleep(1); $movie->getMeta(); });\n return Command::SUCCESS;\n }", "public function handle()\n {\n $this->packageGenerator->setConsole($this)\n ->setPackage($this->argument('package'))\n ->setType('shipping')\n ->setForce($this->option('force'))\n ->generate();\n }", "public function handle()\n {\n $test = $this->argument('test');\n\n $dir = config('speed-test.dir');\n\n $className = ucfirst(\\Str::camel($test));\n\n $namespace = config('speed-test.namespace');\n\n $class = class_entity($className)\n ->namespace($namespace);\n\n $class->method('speed1')\n ->line($this->option('line'))->doc(function ($doc) use ($className) {\n /** @var DocumentorEntity $doc */\n $doc->tagCustom('times', $this->option('times'));\n $doc->description($this->option('description') ?: \"{$className} Speed 1\");\n });\n\n if (! is_dir($dir)) {\n mkdir($dir, 0777, 1);\n }\n\n file_put_contents(\n $dir.'/'.$className.'.php',\n $class->wrap('php')\n );\n\n $this->info('Speed created!');\n\n return 0;\n }", "public function handle()\n {\n $message = $this->GenerateRandomUser($this->argument('count'));\n $this->info($message);\n }", "public function handle()\n {\n // Configuration...\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-config']);\n\n // Migrations\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-migrations']);\n\n $this->info('Model Login resources published.');\n }", "public function handle()\n {\n $host = Cache::get('executingHost', null);\n $this->info(\"Host: ${host}\");\n\n if ($host === null) {\n $this->info('実行するホストが選択されていません');\n return;\n }\n\n if (Schema::hasTable('companies') && Company::count() !== 0) {\n $this->info('マイグレーションが既に1回以上実行されています');\n return;\n }\n\n $should_execute = $host === $this->argument('executingHost');\n\n if ($should_execute) {\n Artisan::call('migrate:fresh', ['--seed' => true]);\n $this->info('マイグレーションが完了しました');\n\n Cache::forget('executingHost');\n } else {\n $this->info('別ホストにてマイグレーションが行われます');\n }\n }", "public function handle()\n {\n if ($this->validation()) {\n $money = $this->argument('money');\n Cache::increment('amount', $money);\n }\n }", "public function handle()\n {\n $this->publishConfig();\n $this->publishClassStub();\n $this->generateAndStoreKey();\n\n $this->info('Use the details below for your \"Lead delivery options\" in Google Ads.');\n $this->info('Webhook URL: ' . route('GoogleAdsLeadExtensionController@index'));\n $this->info('Key: ' . $this->generated_key);\n }", "public function handle()\n {\n $this->info('Publishing stuff..');\n\n $this->publishFiles();\n\n $this->info('Setup complete. Enjoy!');\n }", "public function handle()\n {\n $opts = $this->options();\n $args = $this->arguments();\n #print_r($opts);\n #print_r($args);\n\n # Redundant as argument validation handled by Laravel\n #\n if (!isset($args['destination'])) {\n printf(\"Usage: php artisan %s\\n\", $this->signature);\n exit(1);\n }\n\n # Default to normal message type\n #\n if (!isset($opts['type'])) {\n $opts['type'] = 'normal';\n }\n\n $uac = new UserApiController();\n\n if ($opts['type'] == 'normal') {\n if (!isset($opts['message'])) {\n printf(\"Usage: php artisan %s\\n\\n\", $this->signature);\n printf(\"ERROR: Message must be specified for type 'normal'\\n\");\n exit(1);\n }\n $result = $uac->sendSms(\n $args['destination'],\n $opts['message'],\n $opts['route']\n );\n }\n else if ($opts['type'] == 'otp') {\n $result = $uac->sendVerificationSms(\n $args['destination'],\n '<code>',\n '<name>',\n $opts['route'],\n '<appName>'\n );\n }\n\n if ($result === true) {\n printf(\"INFO: SMS message to %s sent successfully (%s)\\n\",\n $args['destination'], $opts['type']);\n }\n else {\n printf(\"INFO: SMS message to %s failed to send (%s)\\n\", \n $args['destination'], $opts['type']);\n printf(\"ERROR: %s\\n\", $result);\n }\n\n return;\n }" ]
[ "0.6469205", "0.6463761", "0.6426904", "0.63497347", "0.6316859", "0.6273603", "0.6260993", "0.6260039", "0.6234982", "0.6224031", "0.62203085", "0.62127924", "0.61931187", "0.61907774", "0.61823803", "0.61771643", "0.61763066", "0.6173071", "0.614875", "0.61481935", "0.61478025", "0.6146515", "0.61378634", "0.6134108", "0.61305386", "0.611494", "0.61125565", "0.6108917", "0.6107659", "0.61040413", "0.6102003", "0.6101093", "0.6099741", "0.60949016", "0.60936064", "0.6090574", "0.6088933", "0.6083463", "0.60809344", "0.60777074", "0.60756934", "0.6074443", "0.60738426", "0.6071605", "0.6068733", "0.6068527", "0.6067375", "0.6065772", "0.606112", "0.60584533", "0.6057447", "0.6056741", "0.6048619", "0.60417557", "0.6038975", "0.6032054", "0.60303104", "0.6027232", "0.6024652", "0.60196066", "0.60188687", "0.60179913", "0.6012857", "0.601259", "0.6012461", "0.6011362", "0.60076964", "0.600724", "0.6006366", "0.6005053", "0.6004709", "0.6001817", "0.599914", "0.59979004", "0.59978044", "0.5990107", "0.59885967", "0.59885967", "0.59871256", "0.59864116", "0.59845364", "0.5984081", "0.5979547", "0.59767544", "0.5976526", "0.597233", "0.59683913", "0.59669304", "0.5966169", "0.59638894", "0.5963461", "0.5961134", "0.596042", "0.59560114", "0.5954082", "0.5951348", "0.5949012", "0.5947517", "0.5945386", "0.5944714", "0.59442943" ]
0.0
-1
Get the console command options.
protected function getOptions() { return [ ['instant', 'i', InputOption::VALUE_NONE, "Don't run interactive shell and make everything based on options"], ['modelName', null, InputOption::VALUE_REQUIRED, 'Required model name'], ['fields', null, InputOption::VALUE_OPTIONAL, 'Get fields array, use comma as separator'], ['all', null, InputOption::VALUE_NONE, 'Create everything based on your config'], ['api', null, InputOption::VALUE_NONE, 'Create API version of Controller and enable resource creating'], ['model', null, InputOption::VALUE_NONE, 'Create model with given modelName'], ['migration', null, InputOption::VALUE_NONE, 'Create migration with given fields prepared or filled'], ['factory', null, InputOption::VALUE_NONE, 'Create factory with given fields prepared of filled'], ['seeder', null, InputOption::VALUE_NONE, 'Create seeder that invokes factory'], ['request', null, InputOption::VALUE_NONE, 'Create request with given fields prepared or filled'], ['resource', null, InputOption::VALUE_NONE, 'Create resource with given fields prepared of filled'], ['controller', null, InputOption::VALUE_NONE, 'Create controller with various options - request, resource and api'], ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function getOptions() {\n return [\n ['env', null, InputOption::VALUE_OPTIONAL, 'The environment the command should run under.', null],\n ];\n }", "protected function getOptions()\n {\n return [\n ['command', null, InputOption::VALUE_OPTIONAL, 'The terminal command that should be assigned', 'command:name'],\n ];\n }", "protected function getOptions()\n\t{\n\t\treturn [\n\t\t\t['testMode', null, InputOption::VALUE_OPTIONAL, 'Runs the command in Test Mode.', false],\n\t\t];\n\t}", "protected function getOptions()\n {\n $options = [];\n\n // Here we will gather all of the command line options that have been specified with\n // the double hyphens in front of their name. We will make these available to the\n // Blade task file so they can be used in echo statements and other structures.\n foreach ($_SERVER['argv'] as $argument) {\n if (! Str::startsWith($argument, '--') || in_array($argument, $this->ignoreOptions)) {\n continue;\n }\n\n $option = explode('=', substr($argument, 2), 2);\n\n if (count($option) == 1) {\n $option[1] = true;\n }\n\n $optionKey = $option[0];\n\n $options[Str::camel($optionKey)] = $option[1];\n $options[Str::snake($optionKey)] = $option[1];\n }\n\n return $options;\n }", "protected function getOptions()\n {\n return [\n ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use.'],\n ['force', null, InputOption::VALUE_NONE, 'Force the operation to run when in production.'],\n ['path', null, InputOption::VALUE_OPTIONAL, 'The path of migrations files to be executed.'],\n ['pretend', null, InputOption::VALUE_NONE, 'Dump the SQL queries that would be run.'],\n\n ];\n }", "protected function getOptions()\n {\n return [\n ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use.'],\n ];\n }", "protected function getOptions()\n {\n return [\n ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use'],\n ];\n }", "protected function getOptions()\n {\n return [\n ['database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use.'],\n ['native-import', null, InputOption::VALUE_NONE, 'Use the native importer'],\n ];\n }", "protected function getOptions()\n {\n return array(\n array('database', null, InputOption::VALUE_OPTIONAL, 'The database connection to use.'),\n array('pretend', null, InputOption::VALUE_NONE, 'Dump the SQL queries that would be run.'),\n array('seed', null, InputOption::VALUE_NONE, 'Indicates if the seed task should be re-run.'),\n array('force', null, InputOption::VALUE_NONE, 'Force the operation to run while in production.'),\n );\n }", "protected function getOptions()\n {\n return [\n ['port', null, InputOption::VALUE_OPTIONAL, 'The server port to use.', \\config('minions-server.port', 8085)],\n ];\n }", "protected function getOptions()\n {\n return [\n ['facade', '', InputOption::VALUE_NONE, 'Generate facade for current repository'],\n\n ['model', 'm', InputOption::VALUE_REQUIRED, 'Generate a resource repository for the given model'],\n ];\n }", "protected function getOptions()\n\t{\n\t\treturn [\n\t\t\t['attach', '-a', InputOption::VALUE_OPTIONAL, 'The pipes to attach to the workflow.', null],\n\t\t\t['unguard', '-u', InputOption::VALUE_NONE, 'Do not make this workflow validate data.', null],\n\t\t];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [\n\t\t];\n\t}", "public final function getOptions()\n {\n return $this->_getOptions();\n }", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions();", "public function getOptions() {}", "public function getOptions() {}", "public function getOptions() {}", "public function options()\n\t{\n\t\treturn [];\n\t}", "protected static abstract function getOptions();", "public function options()\n {\n return $this->options ?: [];\n }", "protected function getOptions() {\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n {\n\n return [\n ['dry-run' , 'd', InputOption::VALUE_NONE, 'Dry Run'],\n ['payment' , 'p', InputOption::VALUE_NONE, 'Payment Address Only'],\n ['public' , 'u', InputOption::VALUE_NONE, 'Public Address Only'],\n ];\n }", "public function options()\n {\n return $this->options;\n }", "public function options()\n {\n return $this->options;\n }", "public function options()\n {\n return $this->options;\n }", "protected function getOptions()\r\n\t{\r\n\t\treturn isset($this->options) ? $this->options : array();\r\n\t}", "function get_options()\n{\n return php_sapi_name() == 'cli' ? get_options_cli() : get_options_url();\n}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n\t{\n\t\treturn [];\n\t}", "protected function getOptions()\n {\n return [\n ['format', 'f', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'The names of formats you would like to generate.', null],\n ['regenerate', 'r', InputOption::VALUE_NONE, 'Whether all files must be regenerated even if exist.', null],\n ['temp', 't', InputOption::VALUE_NONE, 'Whether the temporary storage must be processed.', null],\n ];\n }", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t\tarray('dry-run', null, InputOption::VALUE_NONE, 'Displays the new cron without making any changes.', null),\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function getOptions()\n\t{\n\t\treturn array();\n\t}", "protected function _getCliOptions()\n {\n $cliOptions = array();\n\n foreach ($_SERVER['argv'] as $arg) {\n if (substr($arg, 0, 2) == '--' && strpos($arg, '=') !== false) {\n $option = substr($arg, 2);\n $option = explode('=', $option);\n\n $cliOptions[$option[0]] = $option[1];\n }\n }\n\n return $cliOptions;\n }", "protected function getOptions() {\n\t\treturn array();\n\t}", "public function getOpts(): array\n {\n return $this->opts;\n }", "public function getOpts(): array\n {\n return $this->opts;\n }", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getOptions()\n {\n return [\n ['model', 'm', InputOption::VALUE_OPTIONAL, 'Generate a repository for the given model.'],\n ];\n }", "public function getOptions()\n {\n return $this->options->getOptions();\n }", "protected function getOptions()\r\n\t{\r\n\t\treturn array();\r\n\t}", "protected function getOptions()\n {\n return [\n ['model', 'm', InputOption::VALUE_OPTIONAL, 'Inject a model to the controller.'],\n ['repository', 'r', InputOption::VALUE_OPTIONAL, 'Inject a repository to the controller.'],\n ['view', '', InputOption::VALUE_OPTIONAL, 'Generate a view controller class.'],\n ];\n }", "protected function getOptions()\n {\n return [\n ['show', null, InputOption::VALUE_NONE, 'Simply display the key instead of modifying files.'],\n ];\n }", "protected function getOptions()\n {\n return array(\n array('dry-run', null, InputOption::VALUE_NONE, 'Only shows which files would have been modified.'),\n array('force', 'f', InputOption::VALUE_NONE, 'Do not confirm before editing files.'),\n array('path', null, InputOption::VALUE_OPTIONAL, 'Path containing the files to be fixed.', 'app')\n );\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }", "public function getOptions()\n {\n return $this->options;\n }" ]
[ "0.7800682", "0.77591324", "0.751765", "0.7345173", "0.73404354", "0.7306238", "0.72790045", "0.7268271", "0.7237944", "0.71917665", "0.715652", "0.7155546", "0.7137", "0.71122515", "0.710945", "0.710945", "0.710945", "0.710945", "0.710945", "0.710945", "0.710945", "0.710945", "0.710945", "0.710945", "0.710945", "0.710945", "0.710945", "0.710945", "0.710945", "0.710945", "0.70998144", "0.70998144", "0.7099153", "0.7092979", "0.7084178", "0.70818704", "0.70631355", "0.7055609", "0.7040382", "0.7040382", "0.7040382", "0.7036282", "0.70356953", "0.70315164", "0.70315164", "0.70315164", "0.70315164", "0.70315164", "0.70315164", "0.70315164", "0.70315164", "0.70315164", "0.70281166", "0.70248216", "0.70230496", "0.70230496", "0.70230496", "0.70230496", "0.70230496", "0.70230496", "0.70230496", "0.70230496", "0.70230496", "0.70230496", "0.70230496", "0.70230496", "0.70230496", "0.7022473", "0.70166355", "0.70108926", "0.70108926", "0.70083207", "0.70083207", "0.70083207", "0.70083207", "0.70083207", "0.70083207", "0.70083207", "0.6996981", "0.6996434", "0.6994164", "0.6993292", "0.6984455", "0.69844353", "0.69752616", "0.69752616", "0.69752616", "0.69752616", "0.69752616", "0.69752616", "0.69752616", "0.69752616", "0.69752616", "0.69752616", "0.69752616", "0.69752616", "0.69752616", "0.69752616", "0.69752616", "0.69752616", "0.69752616" ]
0.0
-1
/ Edit Group method
public function edit(Pages $page) { $page_title = 'page'; $page_action = 'Show page'; $page = $this->meta($page); return view('packages::pages.edit', compact( 'page','banner' ,'page_title', 'page_action')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Group $group)\n {\n //\n }", "public function edit(Group $group)\n {\n //\n }", "public function edit(Group $group)\n {\n //\n }", "public function edit($group, $id)\n {\n //\n }", "public function edit( $group_id = 0 )\n\t{\n\t\t// TODO\n\t}", "function editGroupHandler() {\n global $inputs;\n\n updateDb('group',[\n 'group_name' => $inputs['name'],\n 'description' => $inputs['desc'],\n ], [\n 'id' => $inputs['id'],\n 'admin_id' => getLogin()['uid']\n ]);\n\n formatOutput(true, 'update success');\n}", "public function editAction(){\n $this->title = 'Edit user group';\n \n $form = new GroupForm();\n $groupModel = new Group();\n \n if ($this->getRequest()->isPost()) {\n if($form->isValid($this->getRequest()->getPost())) {\n $groupModel->save($form->getValues());\n $this->_helper->FlashMessenger(\n array(\n 'msg-success' => 'The group was successfully edited.',\n )\n );\n \n $this->_redirect('/groups/');\n }\n }else{\n $id = $this->_getParam('id');\n \n if (!is_numeric($id)) {\n $this->_helper->FlashMessenger(\n array(\n 'msg-success' => 'The provided group_id is invalid.',\n )\n );\n \n $this->_redirect('/groups/');\n }\n if(in_array($id,array(1,2,3,4))){\n $this->_helper->FlashMessenger(\n array(\n 'msg-error' => 'You can not edit default user groups',\n )\n );\n \n $this->_redirect('/groups/');\n }\n $row = $groupModel->findById($id);\n \n if (empty($row)) {\n $this->_helper->FlashMessenger(\n array(\n 'msg-success' => 'The requested group could not be found.',\n )\n );\n \n $this->_redirect('/groups/');\n }\n \n $form->populate($row);\n $this->view->item = $row;\n }\n \n $this->view->form = $form;\n }", "public function editGroupAction($id) {\n\t\t$this->group->id = $id;\n\t\t$this->group->id_parent = $this->data['id_parent'];\n\t\t$this->group->group_name = $this->data['group_name'];\n\t\t$this->group->description = $this->data['description'];\n\t\treturn $this->group->save();\n\t}", "function updateGroup() {\n\t\t$groupId = Request::getUserVar('groupId') === null? null : (int) Request::getUserVar('groupId');\n\t\tif ($groupId === null) {\n\t\t\t$this->validate();\n\t\t\t$group = null;\n\t\t} else {\n\t\t\t$this->validate($groupId);\n\t\t\t$group =& $this->group;\n\t\t}\n\t\t$this->setupTemplate($group);\n\n\t\timport('classes.manager.form.GroupForm');\n\n\t\t$groupForm = new GroupForm($group);\n\t\t$groupForm->readInputData();\n\n\t\tif ($groupForm->validate()) {\n\t\t\t$groupForm->execute();\n\t\t\tRequest::redirect(null, null, 'groups');\n\t\t} else {\n\n\t\t\t$templateMgr =& TemplateManager::getManager();\n\t\t\t$templateMgr->append('pageHierarchy', array(Request::url(null, 'manager', 'groups'), 'manager.groups'));\n\n\t\t\t$templateMgr->assign('pageTitle',\n\t\t\t\t$group?\n\t\t\t\t\t'manager.groups.editTitle':\n\t\t\t\t\t'manager.groups.createTitle'\n\t\t\t);\n\n\t\t\t$groupForm->display();\n\t\t}\n\t}", "public function editGroupController()\n {\n // mazání\n if($this->getRequestParam('action', false) == 'delete'\n && $this->getRequestParam('id', false) != null){\n (new Shop_Model_AttributesGroups())->delete($this->getRequestParam('id'));\n $this->infoMsg()->addMessage($this->tr('Skupina byla smazána'));\n $this->link()->rmParam('action')->rmParam('id')->redirect();\n }\n // přesun\n else if($this->getRequestParam('action', false) == 'changepos'\n && $this->getRequestParam('id', false) != null\n && $this->getRequestParam('pos', false) != null\n ){\n Shop_Model_AttributesGroups::changeOrder(\n $this->getRequestParam('id'),\n $this->getRequestParam('pos')\n );\n\n $this->infoMsg()->addMessage($this->tr('Skupina byla přesunuta na novou pozici'));\n $this->link()\n ->rmParam('action')\n ->rmParam('id')\n ->rmParam('pos')\n ->redirect();\n }\n\n // úprava a přidání\n $this->formEditGroup();\n }", "public function testUpdateGroup()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function editGroupHandler1() {\n global $inputs;\n\n updateDb('group',[\n 'group_name' => $inputs['name'],\n 'description' => $inputs['desc'],\n ], [\n 'id' => $inputs['id'],\n ]);\n\n formatOutput(true, 'update success');\n}", "function editGroup($args = array()) {\n\t\t$groupId = isset($args[0])?(int)$args[0]:null;\n\t\t$this->validate($groupId);\n\t\t$journal =& Request::getJournal();\n\n\t\tif ($groupId !== null) {\n\t\t\t$groupDao =& DAORegistry::getDAO('GroupDAO');\n\t\t\t$group =& $groupDao->getById($groupId, ASSOC_TYPE_JOURNAL, $journal->getId());\n\t\t\tif (!$group) {\n\t\t\t\tRequest::redirect(null, null, 'groups');\n\t\t\t}\n\t\t} else $group = null;\n\n\t\t$this->setupTemplate($group, true);\n\t\timport('classes.manager.form.GroupForm');\n\n\t\t$templateMgr =& TemplateManager::getManager();\n\n\t\t$templateMgr->assign('pageTitle',\n\t\t\t$group === null?\n\t\t\t\t'manager.groups.createTitle':\n\t\t\t\t'manager.groups.editTitle'\n\t\t);\n\n\t\t$groupForm = new GroupForm($group);\n\t\tif ($groupForm->isLocaleResubmit()) {\n\t\t\t$groupForm->readInputData();\n\t\t} else {\n\t\t\t$groupForm->initData();\n\t\t}\n\t\t$groupForm->display();\n\t}", "public function edit($id)\n\t{\n\t\tif (!$id || empty($id))\n\t\t{\n\t\t\tredirect('auth', 'refresh');\n\t\t}\n\n\t\t$this->data['title'] = $this->lang->line('edit_group_title');\n\n\t\tif (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())\n\t\t{\n\t\t\tredirect('auth', 'refresh');\n\t\t}\n\n\t\t$group = $this->ion_auth->group($id)->row();\n\n\t\t// validate form input\n\t\t$this->form_validation->set_rules('group_name', $this->lang->line('edit_group_validation_name_label'), 'required|alpha_dash');\n\n\t\tif (isset($_POST) && !empty($_POST))\n\t\t{\n\t\t\tif ($this->form_validation->run() === TRUE)\n\t\t\t{\n\t\t\t\t$group_update = $this->ion_auth->update_group($id, $_POST['group_name'], $_POST['group_description']);\n\n\t\t\t\tif ($group_update)\n\t\t\t\t{\n\t\t\t\t\t$this->session->set_flashdata('message', $this->lang->line('edit_group_saved'));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->session->set_flashdata('message', $this->ion_auth->errors());\n\t\t\t\t}\n\t\t\t\tredirect(\"auth\", 'refresh');\n\t\t\t}\n\t\t}\n\n\t\t// set the flash data error message if there is one\n\t\t$this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n\n\t\t// pass the user to the view\n\t\t$this->data['group'] = $group;\n\n\t\t$readonly = $this->config->item('admin_group', 'ion_auth') === $group->name ? 'readonly' : '';\n\n\t\t$this->data['group_name'] = array(\n\t\t\t'name' => 'group_name',\n\t\t\t'id' => 'group_name',\n\t\t\t'type' => 'text',\n\t\t\t'value' => $this->form_validation->set_value('group_name', $group->name),\n\t\t\t$readonly => $readonly,\n\t\t);\n\t\t$this->data['group_description'] = array(\n\t\t\t'name' => 'group_description',\n\t\t\t'id' => 'group_description',\n\t\t\t'type' => 'text',\n\t\t\t'value' => $this->form_validation->set_value('group_description', $group->description),\n\t\t);\n $this->load->view('auth/edit_group', $this->data);\n\n\t\t// $this->_render_page('auth' . DIRECTORY_SEPARATOR . 'edit_group', $this->data);\n\t}", "public function admin_edit(){\n \n $this->set(\"title_for_layout\",\"Edit a Group\");\n \n // Load the group in question\n $group = $this->Group->find('first', array('conditions' => array('Group.id' => $this->params->id)));\n if($group){\n // Load all of the satellites\n $satellites = $this->Satellite->find('all');\n $group_satellites = array();\n \n // Assemble an array of the ID's of the satellites in the group\n foreach($group['Satellite'] as $group_satellite){\n array_push($group_satellites, $group_satellite['id']);\n }\n \n $this->set('group', $group);\n $this->set('satellites', $satellites);\n $this->set('group_satellites', $group_satellites);\n } else {\n $this->Session->setFlash('That group could not be found.', 'default', array('class' => 'alert alert-error'));\n $this->redirect(array('controller' => 'group', 'action' => 'index', 'admin' => true));\n }\n }", "function edit($group_id)\n { \n // check if the group exists before trying to edit it\n $data['group'] = $this->Group_model->get_group($group_id);\n \n if(isset($data['group']['group_id']))\n {\n $this->load->library('form_validation');\n\n\t\t\t$this->form_validation->set_rules('group_name','Group Name','required|max_length[255]');\n\t\t\n\t\t\tif($this->form_validation->run()) \n { \n $params = array(\n\t\t\t\t\t'group_name' => $this->input->post('group_name'),\n\t\t\t\t\t'tournament_id' => $this->input->post('tournament_id'),\n );\n\n $this->Group_model->update_group($group_id,$params); \n $this->session->set_flashdata('edit_msg', 'The group has been edited'); \n redirect('group/index');\n }\n else\n {\n $data['all_tournaments'] = $this->Group_model->get_all_tournaments();\n \n $data['_view'] = 'group/edit';\n $this->load->view('layouts/main',$data);\n }\n }\n else\n show_error('The group you are trying to edit does not exist.');\n }", "public function editAction() {\n\t\t$groupId = $this->_request->getParam ( \"id\" );\n\t\tif ($groupId == \"\") {\n\t\t\t$this->_redirect ( 'index' );\n\t\t}\n\t\t$userGroupMapper = new Default_Model_Mapper_UserGroup ();\n\t\t$userGroup = $userGroupMapper->find ( $groupId );\n\t\tif (! $userGroup) {\n\t\t\t$this->_redirect ( 'index' );\n\t\t}\n\t\t$form = new Default_Form_UserGroup ();\n\t\t$this->_save ( $form, self::$EDIT_MODE );\n\t\t$formData = $userGroup->toArray ();\n\t\t$userGroupModuleMapper = new Default_Model_Mapper_UserGroupModule ();\n\t\t$userGroupModules = $userGroupModuleMapper->fetchAll ( \"user_group_id = \" . $groupId );\n\t\t$modules = array ();\n\t\tforeach ( $userGroupModules as $userGroupModule ) {\n\t\t\t$modules [] = $userGroupModule->getModuleId ();\n\t\t}\n\t\t$formData ['modules'] = $modules;\n\t\t$form->populate ( $formData );\n\t\t$form->setAction ( $this->view->url ( array (\n\t\t\t\t\"module\" => \"default\",\n\t\t\t\t\"controller\" => 'user-group',\n\t\t\t\t\"action\" => 'edit',\n\t\t\t\t'id' => $groupId \n\t\t) ) );\n\t\tunset($form->getElement('modules')->required);\n\t\t$this->view->form = $form;\n\t\t$this->render ( \"add-edit\" );\n\t}", "public function UpdateGroup()\n {\n $queryUpdateGroup = \"UPDATE groups SET\n group_name=:group_name,\n description=:description,\n department_id=:department_id\n WHERE id=:group_id\";\n\n $updateGroup = $this->sqlDataBase->prepare($queryUpdateGroup);\n $updateGroup->execute(array(\":group_name\"=>$this->groupName,\":description\"=>$this->description,\":department_id\"=>$this->departmentId,\":group_id\"=>$this->groupId));\n }", "function edit( $id = false )\n{\n$this->load->library('form_validation');\nswitch ( $_SERVER ['REQUEST_METHOD'] )\n{\ncase 'GET':\n$this->model_group->raw_data = TRUE;\n$data = $this->model_group->get( $id );\n$fields = $this->model_group->fields();\n$this->template->assign( 'action_mode', 'edit' );\n$this->template->assign( 'group_data', $data );\n$this->template->assign( 'group_fields', $fields );\n$this->template->assign( 'metadata', $this->model_group->metadata() );\n$this->template->assign( 'table_name', 'Group' );\n$this->template->assign( 'template', 'form_group' );\n$this->template->assign( 'record_id', $id );\n$this->template->display( 'frame_admin.tpl' );\nbreak;\ncase 'POST':\n$fields = $this->model_group->fields();\n/* we set the rules */\n/* don't forget to edit these */\n$this->form_validation->set_rules( 'group_name', lang('group_name'), 'required|max_length[255]' );\n$this->form_validation->set_rules( 'permission', lang('permission'), 'required' );\n$data_post['group_name'] = $this->input->post( 'group_name' );\n$data_post['permission'] = $this->input->post( 'permission' );\nif ( $this->form_validation->run() == FALSE )\n{\n$errors = validation_errors();\n$this->template->assign( 'action_mode', 'edit' );\n$this->template->assign( 'errors', $errors );\n$this->template->assign( 'group_data', $data_post );\n$this->template->assign( 'group_fields', $fields );\n$this->template->assign( 'metadata', $this->model_group->metadata() );\n$this->template->assign( 'table_name', 'Group' );\n$this->template->assign( 'template', 'form_group' );\n$this->template->assign( 'record_id', $id );\n$this->template->display( 'frame_admin.tpl' );\n}\nelseif ( $this->form_validation->run() == TRUE )\n{\n$this->model_group->update( $id, $data_post );\nredirect( 'group/show/' . $id ); \n}\nbreak;\n}\n}", "public function editAction()\n {\n $idGroup = (int)$this->params()->fromRoute('id', 0);\n\n if (!$idGroup) {\n return $this->forwardTo('home');\n }\n\n /** @var FlashMessenger $flashMessenger */\n $flashMessenger = $this->flashMessenger();\n\n $flashMessenger->clearMessages('success');\n $flashMessenger->clearCurrentMessages('success');\n\n $flashMessenger->clearMessages('error');\n $flashMessenger->clearCurrentMessages('error');\n\n try {\n /** @var Group $group */\n $group = $this->getGroupForEdit($idGroup);\n } catch (\\Exception $ex) {\n $this->flashMessenger()->addErrorMessage('notfound_record');\n $this->flashMessenger()->addErrorMessage($ex->getMessage());\n\n return $this->forwardTo('home');\n }\n\n $form = $this->groupForm;\n $form->bind($group);\n\n /** @var Request $request */\n $request = $this->getRequest();\n if ($request->isPost()) {\n $form->setData($request->getPost());\n\n if ($form->isValid()) {\n $storageData = $form->getData(FormInterface::VALUES_AS_ARRAY);\n $group = new Group();\n $group->exchangeArray($storageData['group']);\n $group->setId($idGroup);\n\n $this->groupTable->save($group);\n $this->flashMessenger()->addSuccessMessage('saved_group');\n $group = $this->getGroupForEdit($idGroup);\n $form->bind($group);\n } else {\n $this->flashMessenger()->addErrorMessage('form_invalid');\n }\n }\n\n $form->setAttribute('action', $this->makeUrl('group', 'edit', $idGroup));\n\n return $this->getAjaxView([\n 'customform' => $form,\n 'lockLists' => $this->getInstitutionLockLists(),\n 'title' => 'group_edit',\n ]);\n }", "public function edit(drugGroup $drugGroup)\n {\n //\n }", "public function editAction( $id )\n\t{\t\n\t\t$arrGroup = \"\";\n\t\t$group = \\Group::find($id);\n\n\t\tif(\\Input::server('REQUEST_METHOD') == 'POST')\n\t\t{\n\t\t\t$rules = array(\n\t\t\t\t'group' => 'required|unique:groups,group,'.$id,\n\t\t\t);\n\t\t\t$input \t\t= \\Input::all();\n\t\t\t\n\t\t\t$arrGroup \t= $input;\n\n\t\t\t$validator \t= \\Validator::make($input, $rules);\n\n\t\t\tif( $validator->passes() )\n\t\t\t{\n\t\t\t\t\n\n\t\t\t\t$group->group = $input['group'];\n\n\t\t\t\tif($group->save())\n\t\t\t\t{\n\t\t\t\t\treturn \\Redirect::to('admin/members/groups')\n\t\t\t\t\t\t->with('success_msg', 'Successfully saved');\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn \\Redirect::to('admin/members/group/'.$id.'/edit')\n\t\t\t\t\t->withInput()\n\t\t\t\t\t->with('errors', $validator->getMessageBag()->toArray());\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$arrGroup = $group->toArray();\n\t\t}\n\n\t\treturn \\View::make('user::group.edit')\n\t\t\t->with('group', $arrGroup);\n\t\t\n\t}", "function edit($id) {\n $this->set('groups', $this->Group->find('all'));\n if (!empty($this->data)) {\n if ($this->Group->save($this->data)) {\n $this->Session->setFlash('The group has been saved.');\n } else {\n $this->Session->setFlash('Failed saving the group.');\n }\n }\n }", "function editGroup(&$args, &$request) {\n\t\t$groupId = isset($args['rowId']) ? $args['rowId'] : null;\n\t\t// \tFIXME: add validation here\n\t\t//$this->validate($request, $groupId);\n\n\t\t$router =& $request->getRouter();\n\t\t$press =& $router->getContext($request);\n\n\t\tif ($groupId !== null) {\n\t\t\t$groupDao =& DAORegistry::getDAO('GroupDAO');\n\t\t\t$group =& $groupDao->getGroup($groupId, ASSOC_TYPE_PRESS, $press->getId());\n\t\t\tif (!$group) {\n\t\t\t\t$json = new JSON('false');\n\t\t\t\treturn $json->getString();\n\t\t\t}\n\t\t} else $group = null;\n\n\t\timport('controllers.grid.setup.masthead.form.GroupForm');\n\n\t\t$templateMgr =& TemplateManager::getManager();\n\n\t\t$templateMgr->assign('pageTitle',\n\t\t\t$group === null?\n\t\t\t\t'manager.groups.createTitle':\n\t\t\t\t'manager.groups.editTitle'\n\t\t);\n\n\t\t$groupForm = new GroupForm($group);\n\t\tif ($groupForm->isLocaleResubmit()) {\n\t\t\t$groupForm->readInputData();\n\t\t} else {\n\t\t\t$groupForm->initData();\n\t\t}\n\t\t$groupForm->display();\n\t}", "public function edit(UserGroup $userGroup)\n {\n //\n }", "public function edit(\\App\\Group $group){\n $filehelper = new FileHelper;\n\n $header_images = $filehelper->getImagesInDirectory('default_headers', \"Preview Header\");\n $avatar_images = $filehelper->getImagesInDirectory('default_avatars', \"Preview Avatar\");\n return view('groups.edit', ['group'=>$group,'header_images'=>$header_images, 'avatar_images'=>$avatar_images]);\n }", "public function edit(SmsGroup $smsGroup)\n {\n\n }", "public function edit_group_details(){\n if( !isset( $_REQUEST['pmstkn'] ) || !wp_verify_nonce( $_REQUEST['pmstkn'], 'pms_gm_edit_group_details_nonce' ) )\n return;\n\n if( empty( $_POST['pms_subscription_id'] ) )\n return;\n\n $subscription = pms_get_member_subscription( sanitize_text_field( $_POST['pms_subscription_id'] ) );\n\n if( !pms_gm_is_group_owner( $subscription->id ) )\n return;\n\n //validate fields\n $group_name = sanitize_text_field( $_POST['group_name'] );\n\n if( empty( $group_name ) )\n pms_errors()->add( 'group_name', esc_html__( 'Group name cannot be empty.', 'paid-member-subscriptions' ) );\n\n if ( count( pms_errors()->get_error_codes() ) > 0 )\n return;\n\n //save fields\n pms_update_member_subscription_meta( $subscription->id, 'pms_group_name', $group_name );\n\n $group_description = sanitize_text_field( $_POST['group_description'] );\n pms_update_member_subscription_meta( $subscription->id, 'pms_group_description', $group_description );\n }", "public function update() {\r\n\r\n // Does the Group object have an id?\r\n if ( is_null( $this->id ) ) trigger_error ( \"Group::update(): Attempt to update a Group object that does not have its ID property set.\", E_USER_ERROR );\r\n \r\n // Update the Group\r\n $conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD ); \r\n $conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\r\n $sql = \"UPDATE \" . DB_PREFIX . \"groups SET title = :title, dashboard = :dashboard, content = :content, themes = :themes, files = :files, settings = :settings, users = :users, status = :status WHERE id = :id\";\r\n \r\n $st = $conn->prepare ( $sql );\r\n $st->bindValue( \":title\", $this->title, PDO::PARAM_STR );\r\n $st->bindValue( \":dashboard\", $this->dashboard, PDO::PARAM_INT );\r\n $st->bindValue( \":content\", $this->content, PDO::PARAM_INT );\r\n $st->bindValue( \":themes\", $this->themes, PDO::PARAM_INT );\r\n $st->bindValue( \":files\", $this->files, PDO::PARAM_INT );\r\n $st->bindValue( \":settings\", $this->settings, PDO::PARAM_INT );\r\n $st->bindValue( \":users\", $this->users, PDO::PARAM_INT );\r\n $st->bindValue( \":status\", $this->status, PDO::PARAM_INT );\r\n $st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\r\n $st->execute();\r\n \r\n $conn = null;\r\n \r\n }", "public function edit(GroupLga $groupLga)\n {\n //\n }", "public function updateGroup() {\n if(!$this->request->is('restful')) {\n try {\n $this->CoGroupMember->updateGroupMemberships($this->request->data['CoGroupMember']['co_group_id'],\n $this->request->data['CoGroupMember']['rows'],\n $this->Session->read('Auth.User.co_person_id'));\n \n $this->Flash->set(_txt('rs.saved'), array('key' => 'success'));\n }\n catch(Exception $e) {\n $this->Flash->set($e->getMessage(), array('key' => 'error'));\n }\n \n // Issue redirect\n \n $this->redirect(array('controller' => 'co_groups',\n 'action' => 'edit',\n $this->request->data['CoGroupMember']['co_group_id'],\n 'co' => $this->cur_co['Co']['id']));\n }\n }", "public function editGroup($groupId=null) {\n\t\tif (!empty($groupId)) {\n\t\t\tif ($this->request -> isPut()) {\n\t\t\t\t$this->UserGroup->set($this->data);\n\t\t\t\tif ($this->UserGroup->addValidate()) {\n\t\t\t\t\t$this->UserGroup->save($this->request->data,false);\n\t\t\t\t\t$this->Session->setFlash(__('The group is successfully updated'));\n\t\t\t\t\t$this->redirect('/allGroups');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->request->data = $this->UserGroup->read(null, $groupId);\n\t\t\t}\n\t\t} else {\n\t\t\t$this->redirect('/allGroups');\n\t\t}\n\t}", "function edit()\r\n\t{\r\n\t\tJRequest::setVar('view', 'groups');\r\n\t\tJRequest::setVar('layout', 'edit');\r\n\t\tparent::display();\r\n\t}", "public function update(Request $request, Group $group)\n {\n //\n }", "public function update(Request $request, Group $group)\n {\n //\n }", "public function update(Request $request, Group $group)\n {\n //\n }", "public function editGroup($group_id, array $attributes) {\n return $this->get('edit_group', array_merge($attributes, ['group_id' => $group_id]));\n }", "function editMemberGroup($msg='', $group_id = null)\n {\n // ------------------------------------\n // Only super admins can administrate member groups\n // ------------------------------------\n\n if (Session::userdata('group_id') != 1) {\n return Cp::unauthorizedAccess(__('members.only_superadmins_can_admin_groups'));\n }\n\n $clone_id = Request::input('clone_id');\n\n // Incoming from a continue editing button?\n if (empty($group_id)) {\n $group_id = Request::input('group_id');\n }\n\n $id = (!empty($clone_id)) ? $clone_id : $group_id;\n\n // ------------------------------------\n // Fetch the Group's Data\n // ------------------------------------\n\n if (!empty($id)) {\n $group_data = (array) DB::table('member_groups')->where('group_id', $id)->first();\n $preferences = DB::table('member_group_preferences')->where('group_id', $id)->get();\n\n foreach($preferences as $row) {\n $group_data[$row->handle] = $row->value;\n }\n }\n\n if(empty($group_data['is_locked'])) {\n $group_data['is_locked'] = 'y';\n }\n\n // ------------------------------------\n // Group title\n // ------------------------------------\n\n $group_name = ($group_id == '') ? '' : $group_data['group_name'];\n $group_description = ($group_id == '') ? '' : $group_data['group_description'];\n\n if ($msg != '') {\n Cp::$body .= Cp::quickDiv('successMessage', $msg);\n }\n\n Cp::$body_props .= ' onload=\"showHideMenu(\\'group_name\\');\"';\n\n // ------------------------------------\n // Declare form and page heading\n // ------------------------------------\n\n $js = <<<EOT\n<script type=\"text/javascript\">\n var lastShownObj = '';\n var lastShownColor = '';\n function showHideMenu(objValue)\n {\n if (lastShownObj != '') {\n $('#' + lastShownObj+'_pointer a').first().removeAttr('style');\n\n $('#' + lastShownObj + '_on').css('display', 'none');\n }\n\n lastShownObj = objValue;\n lastShownColor = $('#' + lastShownObj+'_pointer a').first().css('color');\n\n $('#' + objValue + '_on').css('display', 'block');\n lastShownColor = $('#' + lastShownObj+'_pointer a').first().css('color', '#000')\n }\n</script>\nEOT;\n\n Cp::$body .= $js;\n\n $r = Cp::formOpen(\n [\n 'action' => 'C=Administration'.AMP.'M=members'.AMP.'P=updateMemberGroup'\n ]\n );\n\n if ($clone_id != '')\n {\n $group_name = '';\n $group_description = '';\n $r .= Cp::input_hidden('clone_id', $clone_id);\n }\n\n $r .= Cp::input_hidden('group_id', $group_id);\n\n // ------------------------------------\n // Group name form field\n // ------------------------------------\n\n $r .= '<div id=\"group_name_on\" style=\"display: none; padding:0; margin: 0;\">'.\n Cp::table('tableBorder', '0', '', '100%').\n '<tr>'.PHP_EOL.\n \"<td class='tableHeadingAlt' colspan='2'>\".\n NBS.__('members.group_name').\n '</tr>'.PHP_EOL.\n '<tr>'.PHP_EOL.\n Cp::td('', '40%').\n Cp::quickDiv('defaultBold', __('members.group_name')).\n '</td>'.PHP_EOL.\n Cp::td('', '60%').\n Cp::input_text('group_name', $group_name, '50', '70', 'input', '100%').\n '</td>'.PHP_EOL.\n '</tr>'.PHP_EOL.\n '</tr>'.PHP_EOL.\n '<tr>'.PHP_EOL.\n Cp::td('', '40%', '', '', 'top').\n Cp::quickDiv('defaultBold', __('members.group_description')).\n '</td>'.PHP_EOL.\n Cp::td('', '60%').\n Cp::input_textarea('group_description', $group_description, 10).\n '</td>'.PHP_EOL.\n '</tr>'.PHP_EOL.\n '</table>'.PHP_EOL.\n Cp::quickDiv('defaultSmall', '');\n\n // ------------------------------------\n // Top section of page\n // ------------------------------------\n\n if ($group_id == 1)\n {\n $r .= Cp::quickDiv('box', __('members.super_admin_edit_note'));\n }\n else\n {\n $r .= Cp::quickDiv('box', Cp::quickSpan('alert', __('members.warning')).'&nbsp;'.__('members.be_careful_assigning_groups'));\n }\n\n $r .= Cp::quickDiv('defaultSmall', '');\n\n $r .= '</div>'.PHP_EOL;\n\n // ------------------------------------\n // Group lock\n // ------------------------------------\n\n $r .= '<div id=\"group_lock_on\" style=\"display: none; padding:0; margin: 0;\">';\n\n $r .= Cp::table('tableBorder', '0', '', '100%');\n\n $r .= '<tr>'.PHP_EOL.\n Cp::td('tableHeadingAlt', '', '2').__('members.group_lock').\n '</td>'.PHP_EOL.\n '</tr>'.PHP_EOL;\n\n $r .= '<tr>'.PHP_EOL.\n Cp::td('', '60%').\n Cp::quickDiv('alert', __('members.enable_lock')).\n Cp::quickDiv('littlePadding', __('members.lock_description')).\n '</td>'.PHP_EOL.\n Cp::td('', '40%');\n\n $selected = ($group_data['is_locked'] == 'y') ? true : false;\n\n $r .= __('members.locked').NBS.\n Cp::input_radio('is_locked', 'y', $selected).'&nbsp;';\n\n $selected = ($group_data['is_locked'] == 'n') ? true : false;\n\n $r .= __('members.unlocked').NBS.\n Cp::input_radio('is_locked', 'n', $selected).'&nbsp;';\n\n $r .= '</td>'.PHP_EOL.\n '</tr>'.PHP_EOL.\n '</table>'.PHP_EOL.\n '</div>'.PHP_EOL;\n\n // ------------------------------------\n // Fetch the names and IDs of all weblogs\n // ------------------------------------\n\n $blog_names = [];\n $blog_ids = [];\n\n $query = DB::table('weblogs')\n ->orderBy('blog_title')\n ->select('weblog_id', 'site_id', 'blog_title')\n ->get();\n\n if ($id != 1)\n {\n foreach($query as $row)\n {\n $field = 'weblog_id_'.$row->weblog_id;\n\n $status = (isset($group_data[$field]) && $group_data[$field] == 'y') ? 'y' : 'n';\n\n $blog_names[$field] = $row->blog_title;\n $group_data[$field] = $status;\n }\n }\n\n // ------------------------------------\n // Fetch the names and IDs of all plugins\n // ------------------------------------\n\n $plugins = Plugins::list();\n $plugin_names = [];\n $plugin_ids = [];\n\n if ($id != 1)\n {\n foreach(Plugins::list() as $plugin)\n {\n $name = __(strtolower($plugin->plugin_name . '_plugin_name'));\n $name = str_replace('_', ' ', $name);\n $name = ($name == '' ? $plugin->plugin_name : $name);\n\n $field = 'plugin_name_'.$plugin->plugin_name;\n\n $status = (isset($group_data[$field]) && $group_data[$field] == 'y') ? 'y' : 'n';\n\n $plugin_names[$field] = $name;\n $group_data[$field] = $status;\n }\n }\n\n // ------------------------------------\n // Fetch the names and IDs of all Sites\n // ------------------------------------\n\n $site_cp_names = [];\n $site_offline_names = [];\n $site_ids = []; // Figure out where I am storing these\n\n if ($id != 1) {\n foreach(Site::sitesList() as $site) {\n\n $field = 'can_access_offline_site_id_'.$site->site_id;\n $site_offline_names[$field] = $site->site_name;\n $status = (isset($group_data[$field]) && $group_data[$field] == 'y') ? 'y' : 'n';\n $group_data[$field] = $status;\n\n $field = 'can_access_cp_site_id_'.$site->site_id;\n $site_cp_names[$field] = $site->site_name;\n $status = (isset($group_data[$field]) && $group_data[$field] == 'y') ? 'y' : 'n';\n $group_data[$field] = $status;\n }\n }\n\n // ------------------------------------\n // Assign clusters of member groups\n // - The associative value (y/n) is the default setting\n // ------------------------------------\n\n $G = static::$group_preferences;\n\n $G['cp_site_cp_access_privs'] = $site_cp_names;\n $G['cp_site_offline_privs'] = $site_offline_names;\n $G['cp_weblog_post_privs'] = $blog_names;\n $G['cp_plugin_access_privs'] = $plugin_names;\n\n // ------------------------------------\n // Super Admin Group cannot be edited\n // ------------------------------------\n\n if ($group_id == 1) {\n $G = ['mbr_account_privs' => ['include_in_authorlist' => 'n']];\n }\n\n // ------------------------------------\n // Assign items we want to highlight\n // ------------------------------------\n\n $alert = [\n 'can_view_offline_system',\n 'can_access_cp',\n 'can_admin_weblogs',\n 'can_admin_templates',\n 'can_delete_members',\n 'can_admin_mbr_groups',\n 'can_ban_users',\n 'can_admin_members',\n 'can_admin_preferences',\n 'can_admin_plugins',\n 'can_admin_utilities',\n 'can_edit_categories',\n 'can_delete_self'\n ];\n\n // ------------------------------------\n // Items that should be shown in an input box\n // ------------------------------------\n\n $tbox = [\n 'search_flood_control',\n 'mbr_delete_notify_emails'\n ];\n\n // ------------------------------------\n // Render the group matrix\n // ------------------------------------\n\n $special = ['cp_plugin_access_privs', 'cp_site_offline_privs', 'cp_site_cp_access_privs'];\n\n foreach ($G as $g_key => $g_val)\n {\n // ------------------------------------\n // Start the Table\n // ------------------------------------\n\n $r .= '<div id=\"'.$g_key.'_on\" style=\"display: none; padding:0; margin: 0;\">';\n $r .= Cp::table('tableBorder', '0', '', '100%');\n $r .= '<tr>'.PHP_EOL;\n\n $r .= \"<td class='tableHeadingAlt' id='\".$g_key.\"2' colspan='2'>\";\n $r .= NBS.__($g_key);\n $r .= '</tr>'.PHP_EOL;\n\n $i = 0;\n\n foreach($g_val as $key => $val)\n {\n if ( !in_array($g_key, $special) && ! isset($group_data[$key])) {\n $group_data[$key] = $val;\n }\n\n $line = __($key);\n\n if (substr($key, 0, strlen('weblog_id_')) == 'weblog_id_')\n {\n $line = __('members.can_post_in').Cp::quickSpan('alert', $blog_names[$key]);\n }\n\n if (substr($key, 0, strlen('plugin_name_')) == 'plugin_name_')\n {\n\n $line = __('members.can_access_plugin').Cp::quickSpan('alert', $plugin_names[$key]);\n }\n\n if (substr($key, 0, strlen('can_access_offline_site_id_')) == 'can_access_offline_site_id_')\n {\n $line = __('members.can_access_offline_site').Cp::quickSpan('alert', $site_offline_names[$key]);\n }\n\n if (substr($key, 0, strlen('can_access_cp_site_id_')) == 'can_access_cp_site_id_')\n {\n $line = __('members.can_access_cp').Cp::quickSpan('alert', $site_cp_names[$key]);\n }\n\n $mark = (in_array($key, $alert)) ? Cp::quickSpan('alert', $line) : Cp::quickSpan('defaultBold', $line);\n\n $r .= '<tr>'.PHP_EOL.\n Cp::td('', '60%').\n $mark;\n\n $r .= '</td>'.PHP_EOL.\n Cp::td('', '40%');\n\n if (in_array($key, $tbox))\n {\n $width = ($key == 'mbr_delete_notify_emails') ? '100%' : '100px';\n $length = ($key == 'mbr_delete_notify_emails') ? '255' : '5';\n $r .= Cp::input_text($key, $group_data[$key], '15', $length, 'input', $width);\n }\n else\n {\n $r .= __('cp.yes').NBS.\n Cp::input_radio($key, 'y', ($group_data[$key] == 'y') ? 1 : '').'&nbsp;';\n\n $r .= __('cp.no').NBS.\n Cp::input_radio($key, 'n', ($group_data[$key] == 'n') ? 1 : '').'&nbsp;';\n }\n\n $r .= '</td>'.PHP_EOL;\n $r .= '</tr>'.PHP_EOL;\n }\n\n $r .= '</table>'.PHP_EOL;\n $r .= '</div>'.PHP_EOL;\n }\n\n // ------------------------------------\n // Submit button\n // ------------------------------------\n\n if (empty($group_id))\n {\n $r .= Cp::quickDiv(\n 'paddingTop',\n Cp::input_submit(__('cp.submit'))\n .NBS.\n Cp::input_submit(__('cp.submit_and_return'),'return')\n );\n }\n else\n {\n $r .= Cp::quickDiv(\n 'paddingTop',\n Cp::input_submit(__('members.update')).\n NBS.\n Cp::input_submit(__('members.update_and_return'), 'return')\n );\n }\n\n $r .= '</form>'.PHP_EOL;\n\n // ------------------------------------\n // Create Our All Encompassing Table of Weblog Goodness\n // ------------------------------------\n\n Cp::$body .= Cp::table('', '0', '', '100%');\n\n $menu = '';\n $menu .= Cp::quickDiv('navPad',\n ' <span id=\"group_name_pointer\">&#8226; '.\n Cp::anchor(\"#\", __('members.group_name'),'onclick=\"showHideMenu(\\'group_name\\');\"').\n '</span>');\n\n if ($group_id != 1)\n {\n $menu .= Cp::quickDiv('navPad',\n ' <span id=\"group_lock_pointer\">&#8226; '.\n Cp::anchor(\"#\", __('members.security_lock'), 'onclick=\"showHideMenu(\\'group_lock\\');\"').\n '</span>');\n }\n\n // Sites Access\n if ($group_id != 1)\n {\n $menu .= Cp::quickDiv('navPad',\n ' <span id=\"cp_site_cp_access_privs_pointer\">&#8226; '.\n Cp::anchor(\"#\", __('members.cp_site_cp_access_privs'), 'onclick=\"showHideMenu(\\'cp_site_cp_access_privs\\');\"').\n '</span>'\n );\n }\n\n // Sites Access\n if ($group_id != 1)\n {\n $menu .= Cp::quickDiv('navPad',\n ' <span id=\"cp_site_offline_privs_pointer\">&#8226; '.\n Cp::anchor(\"#\", __('members.cp_site_offline_privs'), 'onclick=\"showHideMenu(\\'cp_site_offline_privs\\');\"').\n '</span>'\n );\n }\n\n\n foreach ($G as $g_key => $g_val)\n {\n if (in_array($g_key, $special)) {\n continue;\n }\n\n $menu .= Cp::quickDiv(\n 'navPad',\n ' <span id=\"'.$g_key.'_pointer\">&#8226; '.\n Cp::anchor(\n \"#\",\n __($g_key),\n 'onclick=\"showHideMenu(\\''.$g_key.'\\');\"'\n ).\n '</span>');\n }\n\n // Plugins\n if ($group_id != 1)\n {\n $menu .= Cp::quickDiv('navPad',\n ' <span id=\"cp_plugin_access_privs_pointer\">&#8226; '.\n Cp::anchor(\"#\", __('members.cp_plugin_access_privs'), 'onclick=\"showHideMenu(\\'cp_plugin_access_privs\\');\"').\n '</span>'\n );\n }\n\n // ------------------------------------\n // Compile all of it into output\n // ------------------------------------\n\n $title = (!empty($id)) ? __('members.edit_member_group') : __('members.create_member_group');\n\n $first_text = Cp::div('tableHeadingAlt').\n $title.\n '</div>'.PHP_EOL.\n Cp::div('profileMenuInner', '', 'membersMenu').\n $menu.\n '</div>'.PHP_EOL;\n\n // Create the Table\n $table_row = [\n 'first' => ['valign' => \"top\", 'width' => \"220px\", 'text' => $first_text],\n 'second' => ['class' => \"default\", 'width' => \"8px\"],\n 'third' => ['valign' => \"top\", 'text' => $r]\n ];\n\n Cp::$body .= Cp::tableRow($table_row).\n '</table>'.PHP_EOL;\n\n Cp::$title = $title;\n\n if ($group_id != '')\n {\n Cp::$crumb =\n Cp::anchor(\n BASE.'?C=Administration'.\n AMP.'area=members_and_groups',\n __('admin.members_and_groups')\n ).\n Cp::breadcrumbItem(\n Cp::anchor(\n BASE.'?C=Administration'.\n AMP.'M=members'.\n AMP.'P=mbr_group_manager',\n __('admin.member_groups')\n )\n ).\n Cp::breadcrumbItem(\n Cp::anchor(\n BASE.'?C=Administration'.\n AMP.'M=members'.\n AMP.'P=edit_mbr_group'.\n AMP.'group_id='.$group_data['group_id'],\n $title\n )\n ).\n Cp::breadcrumbItem($group_data['group_name']);\n }\n else\n {\n Cp::$crumb =\n Cp::anchor(\n BASE.'?C=Administration'.\n AMP.'area=members_and_groups',\n __('admin.members_and_groups')\n ).\n Cp::breadcrumbItem(\n Cp::anchor(\n BASE.'?C=Administration'.\n AMP.'M=members'.\n AMP.'P=mbr_group_manager',\n __('admin.member_groups')\n )\n ).\n Cp::breadcrumbItem($title);\n }\n }", "public function edit(Request $request, Group $group)\n {\n $this->validate($request, [\n 'name' => 'required|max:255',\n ]);\n\n $group->update([\n 'name' => $request->name,\n ]);\n\n return redirect('/groups.index');\n }", "function edit($id) {\n // check if the permission_group exists before trying to edit it\n $data['permission_group'] = $this->Permission_group_model->get_permission_group($id);\n\n if (isset($data['permission_group']['id'])) {\n $this->load->library('form_validation');\n\n $this->form_validation->set_rules('name', 'Name', 'required');\n\n if ($this->form_validation->run()) {\n $params = array(\n 'name' => $this->input->post('name'),\n );\n\n $this->Permission_group_model->update_permission_group($id, $params);\n redirect('permission_group/index');\n } else {\n $data['_view'] = 'permission_group/edit';\n $this->load->view('layouts/main', $data);\n }\n } else\n show_error('The permission_group you are trying to edit does not exist.');\n }", "public function edit()\n {\n $this->set('groupSelector', $this->app->make(GroupSelector::class));\n $this->set('form', $this->app->make('helper/form'));\n if ($this->config->has('auth.external_concrete')) {\n $this->set('data', (array)$this->config->get('auth.external_concrete', []));\n } else {\n // legacy support\n $this->set('data', (array)$this->config->get('auth.external_concrete5', []));\n }\n $this->set('redirectUri', $this->urlResolver->resolve(['/ccm/system/authentication/oauth2/external_concrete/callback']));\n\n $list = $this->app->make(GroupList::class);\n $this->set('groups', $list->getResults());\n }", "public function updateGroup(Request $request, $id){\n try{\n $group = Group::find($id);\n $group->title = $request->input('group_name');\n $group->category = $request->get('group_category');\n $group->child_count = $request->get('child_count');\n $group->first_mentor_id = $request->get('first_mentor');\n $group->second_mentor_id = $request->get('second_mentor');\n\n $group->save();\n\n }catch(QueryException $e){\n \\Session::flash('oops', trans('messages.please_fill_fields'));\n return \\Redirect('manager/groups/'.$group->id);\n }\n\n \\Session::flash('message', trans('messages.successfully_updated'));\n\n return \\Redirect('manager/groups');\n }", "public function update() {\n\t\t$data = array(\n\t\t\t'tstamp' => $this['timeStamp'],\n\t\t\t'crdate' => $this['createDate'],\n\t\t\t'cruser_id' => $this['cruserUid'],\n\t\t\t'name' => $this['name'],\n\t\t);\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_UPDATEquery(\n\t\t\t'tx_passwordmgr_group',\n\t\t\t'uid=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this['uid'],'tx_passwordmgr_group'),\n\t\t\t$data\n\t\t);\n\t\t$this->checkAffectedRows('updateGroup', 1);\n\t\ttx_passwordmgr_helper::addLogEntry(1, 'updateGroup', 'Update group '.$data['name'].' uid '.$this['uid']);\n\t}", "public function edit(Group $group)\n {\n //\n abort(404);\n }", "public function edit($id)\n\t{\n\t\t$group = Group::find($id);\n\n\t\t$username = Auth::user()->getUsername();\n\n\t\tif ($group == NULL) {\n\n\t\t\tSession::flash('info_message', 'Not a valid group!');\n\t\t\treturn redirect(route('groups.index'));\n\n\t\t} elseif ($username == $group->creator) {\n\n\t\t\t$tags = Tag::lists('name', 'name');\n\n\t\t\treturn view('groups.edit', compact('group', 'tags'));\n\n\t\t} else {\n\t\t\tSession::flash('info_message', 'You do not have that permission!');\n\t\t\treturn redirect(route('groups.show', [$group->id]));\n\t\t}\n\t}", "public function getGroupEdit($group_id){\n $group = NewsletterGroup::find($group_id);\n if(!$group){\n return redirect('administrator/newsletter/groups');\n }\n \n return view('Newsletter.Views.administrator.group-edit')->with([\n 'group' => $group\n ]);\n }", "public function edit(FeeGroup $feeGroup)\n {\n //\n }", "public function editGroup(Request $request, Group $group)\n {\n // Update name and save\n $group[Constants::FLD_GROUPS_NAME] = $request->get('name');\n\n if ($group->save()) {\n\n // Remove add admins then reattach\n $group->admins()->detach();\n\n // Update admins\n $admins = explode(\",\", $request->get('admins'));\n\n $admins = User::whereIn('username', $admins)->get(); //It's a Collection but a Model is needed\n foreach ($admins as $admin) {\n if ($admin[Constants::FLD_USERS_ID] != Auth::user()[Constants::FLD_USERS_ID])\n $group->admins()->save($admin);\n }\n } else { // return error message\n \\Session::flash(\"messages\", [\"Sorry, Group was not saved. Please retry later\"]);\n return redirect(route(Constants::ROUTES_GROUPS_INDEX));\n }\n\n return redirect(route(Constants::ROUTES_GROUPS_DISPLAY, $group[Constants::FLD_GROUPS_ID]));\n }", "function edit($id) {\n // Call the parent then override the title\n \n parent::edit($id);\n \n $gm = $this->viewVars['co_group_members'][0];\n \n $this->set('title_for_layout', _txt('op.grm.title', array(_txt('op.edit'),\n $gm['CoGroup']['name'],\n generateCn($gm['CoPerson']['PrimaryName']))));\n }", "public function update(Request $request, $id)\n {\n $user_id = auth() -> user() -> id;\n $group = Group::findOrfail($id);\n\n // access control - only the moderator can edit the group\n if (strtolower($group -> status) == 'p' && $user_id != $group -> moderator_id) abort(404);\n if ($user_id != $group -> moderator_id) abort(403);\n\n\n // 1.1. it is not allowed to create two groups with the same name\n $checker = Group::where('name', $request -> input('name')) -> get();\n if (sizeof($checker) > 0)\n {\n return view('groups.create') -> with('validation_failed', __('messages.group_store_failed'));\n }\n\n\n // the same validation as on store\n $this -> validate($request, [\n 'name' => 'required | max: 32',\n 'description' => 'required',\n 'group_img' => 'image | nullable | max: 1999'\n ]);\n\n\n\n $user = User::find($user_id);\n // handle file upload (only if a new file is provided)\n if ($request -> hasFile('group_img'))\n {\n // 1. delete the old file\n if (strtolower($group -> img) != 'no_image.jpg') Storage::delete('public/imgs_g/' . $group -> img);\n\n // 2. process the new file\n // get filename with the extension\n $fileNameWithExt = $request -> file('group_img') -> getClientOriginalName();\n // get just file name\n $fileName = pathinfo($fileNameWithExt, PATHINFO_FILENAME);\n // get just extension\n $ext = $request -> file('group_img') -> getClientOriginalExtension();\n $fileNameToStore = $user_id . $fileName . '_' . time() . '.' . $ext;\n \n // upload the image\n $path = $request -> file('group_img') -> storeAs('public/imgs_g/', $fileNameToStore);\n }\n\n\n // update the group info\n $group -> name = $request -> input('name');\n $group -> description = $request -> input('description');\n // update the image only if a new image is provided\n if ($request -> hasFile('group_img')) $group -> img = $fileNameToStore;\n // set status to \"pending\" only if the request had been rejected by the administrator\n // update a request to the administrator\n $stats = array('p', 'r');\n if (in_array(strtolower($group -> status), $stats))\n {\n $group -> status = 'p';\n\n $admin_req = $group -> adminNotification() -> get();\n if (sizeof($admin_req) > 0)\n {\n // initial request is available\n $admin_req = $admin_req -> first();\n $admin_req -> title = 'Updated Group Request';\n $admin_req -> message = 'I have made the corrections. Could you please review the group one more time ?';\n $admin_req -> status = 'n';\n $admin_req -> save();\n }\n else\n {\n // initial request has been deleted\n $admin_req = new AdminNotification;\n $admin_req -> name = $user -> name;\n $admin_req -> email = $user -> email;\n $admin_req -> title = 'Updated Group Reques';\n $admin_req -> message = 'I have made the corrections. Could you please review the group one more time ?';\n $admin_req -> status = 'n';\n $admin_req -> type = '1';\n $admin_req -> group_id = $group -> id;\n $admin_req -> save();\n }\n }\n \n $group -> save();\n\n unset($group, $admin_req, $user, $user_id);\n return redirect('/dashboard/groups') -> with('success', __('messages.group_update_success'));\n }", "public function update(Request $request,$group, $id)\n {\n //\n }", "public function edit(Request $request)\n {\n $findSectionName = Group::where('group_name', $request->group_name)\n ->where('user_id', $request->user_id)\n ->first();\n if ($findSectionName === NULL) {\n $group = Group::find($request->id);\n $group->group_name = $request->group_name;\n $group->group_pass = $request->pass_name;\n $group->save();\n } else{\n if ($findSectionName->id == $request->id){\n $group = Group::find($request->id);\n $group->group_name = $request->group_name;\n $group->group_pass = $request->pass_name;\n $group->save();\n } else {\n return response()->json(['error' => 'Error msg'], 209);\n }\n }\n }", "public function admin_change(){\n \n // Load the group in question\n $group = $this->Group->find('first', array('conditions' => array('Group.id' => $this->params->id)));\n if($group){\n\t\t\t// Edit the group\n\t\t\t$satellite_ids = array();\n\t\t\t\n\t\t\t// Loop through and add all of the satellite IDs\n\t\t\tforeach($_POST['satellites'] as $satellite_id){\n\t\t\t\tarray_push($satellite_ids, $satellite_id);\n\t\t\t}\n\t\t\t\n\t\t\t// Assemble query\n $show_on_home = (isset($_POST['show_on_home']))?'1':'0';\n $default_on_home = (isset($_POST['default_on_home']))?'1':'0';\n\t\t\t$group_changes['Group'] = array(\n 'id' => $group['Group']['id'],\n 'name' => $_POST['group_name'],\n 'description' => $_POST['group_description'],\n 'show_on_home' => $show_on_home,\n 'default_on_home' => $default_on_home,\n 'updated_on' =>date ('Y-m-d H:i:s', time())\n );\n\t\t\t$group_changes['Satellite'] = array('Satellite' => $satellite_ids);\n\t\t\t\n\t\t\t$edit_group = $this->Group->save($group_changes);\n\t\t\t\n\t\t\tif ($edit_group){\n\t\t\t\t$this->Session->setFlash('The group has been edited successfully.', 'default', array('class' => 'alert alert-success'));\n\t\t\t\tCakeLog::write('admin', '[success] The group \\''.$_POST['group_name'].'\\' has been edited.');\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash('An error occured while editing that group. Please try again.', 'default', array('class' => 'alert alert-error'));\n\t\t\t\tCakeLog::write('admin', '[error] Error editing the group \\''.$_POST['group_name'].'\\'.');\n\t\t\t}\n\t\t\t\n\t\t\t$this->redirect(array('controller' => 'group', 'action' => 'index'));\n } else {\n $this->Session->setFlash('That group could not be found.', 'default', array('class' => 'alert alert-error'));\n $this->redirect(array('controller' => 'group', 'action' => 'index', 'admin' => true));\n }\n }", "public function editGroup($id)\n {\n return view();\n }", "public function update_group($id)\n { \n if ($this->input->post() && has_permission('inventory_items', '', 'edit')) {\n $data = array(\n 'value' => $this->input->post('name'),\n //'updated_at' => date('Y-m-d H:i:s'),\n );\n $update = $this->inventory_model->edit_group('tblcustom', $data, $id);\n load_admin_language();\n if($update)\n {\n set_alert('success', 'Inventory Updated successfully!'); \n }\n else\n {\n set_alert('warning', 'There is problem while updating Inventory');\n }\n }\n }", "public function edit($id)\n {\n //dd($id);//debug\n //查询该分组的信息\n $group=DB::table(\"admin_group_rule\")->where(\"id\",$id)->first();\n// dd($group);//debug\n //查询所有权限数据\n $rules=DB::table(\"admin_auth_rule\")->get();\n// dd($rules);//debug\n //显示分组编辑模板\n return view(\"admin.group.edit\",[\"group\"=>$group,\"rules\"=>$rules]);\n\n \n }", "function update_group($id, array $data = array())\n\t{\n\t\treturn get_instance()->kbcore->groups->update($id, $data);\n\t}", "public function update_field_group($field_group)\n {\n }", "function timeconditions_timegroups_edit_group($timegroup,$description) {\n\tglobal $db;\n\n\t$sql = \"update timegroups_groups set description = '$description' where id = $timegroup\";\n\t$db->query($sql);\n\tneedreload();\n}", "public function saveEditedGroupData($group) {\n\t\t\t$info = getRequest('data');\n\n\t\t\t$title = getArrayKey($info, 'title');\n\t\t\t$name = getArrayKey($info, 'name');\n\t\t\t$is_visible = getArrayKey($info, 'is_visible');\n\t\t\t$tip = getArrayKey($info, 'tip');\n\n\t\t\tif($group instanceof iUmiFieldsGroup) {\n\t\t\t\t$group->setName($name);\n\t\t\t\t$group->setTitle($title);\n\t\t\t\t$group->setIsVisible($is_visible);\n\t\t\t\t$group->setIsActive(true);\n\t\t\t\t$group->setTip($tip);\n\t\t\t\t$group->commit();\n\t\t\t} else {\n\t\t\t\tthrow new coreException(\"Expected instance of type umiFieldsGroup\");\n\t\t\t}\n\t\t}", "public function edit($id)\n\t{\n\t\t$group = Group::find($id);\n\n\t\tif( is_null($group) )\n\t\t{\n\t\t\treturn Redirect::to( 'group' );\n\t\t}\n\n\t\treturn View::make('groups.edit')\n\t\t\t->with('group',$group);\n\t}", "public function editAction() {\n $uid = $this->getInput('uid');\n $userInfo = Admin_Service_User::getUser(intval($uid));\n list(, $groups) = Admin_Service_Group::getAllGroup();\n $this->assign('userInfo', $userInfo);\n $this->assign('groups', $groups);\n $this->assign('status', $this->status);\n $this->assign(\"meunOn\", \"sys_user\");\n }", "public function edit(Grupos $grupos)\n {\n //\n }", "function updateGroup($groupId, $groupName, $description, $type, $db) {\n strip_tags($groupName);\n strip_tags($description);\n strip_tags($type);\n\n $qString = ('UPDATE groups SET name = :name, description = :description, projectType = :type WHERE id = :groupId');\n $stm = $db -> prepare($qString);\n\n if ($stm -> execute( array(':name' => $groupName, ':description' => $description, ':type' => $type, ':groupId' => $groupId))) {\n if(addToGroup($userId, $db, getGroupId($groupName, $db), true)) {\n echo \"<meta http-equiv='REFRESH' content='0;url=/?page=group'>\";\n } else {\n echo 'couldnt add to group!';\n }\n } else {\n print_r($stm->errorInfo());\n }\n}", "function group_form($type='edit')\n\t{\n\t\t$all_groups = array( 0 => array ('none', 'Не продвигать') );\n\n\t\tif ($type == 'edit')\n\t\t{\n\t\t\tif ($this->ipsclass->input['id'] == \"\")\n\t\t\t{\n\t\t\t\t$this->ipsclass->admin->error(\"Невозможно определить идентификатор (id) группы пользователей.\");\n\t\t\t}\n\n\t\t\tif ( $this->ipsclass->vars['admin_group'] == $this->ipsclass->input['id'] )\n\t\t\t{\n\t\t\t\tif ( $this->ipsclass->member['mgroup'] != $this->ipsclass->vars['admin_group'] )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->admin->error(\"Извините, у вас нет доступа к редактированию этой группы. Эта группа относится к главным администраторам.\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$form_code = 'doedit';\n\t\t\t$button = 'Изменить';\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$form_code = 'doadd';\n\t\t\t$button = 'Добавить';\n\t\t}\n\n\t\tif ($this->ipsclass->input['id'] != \"\")\n\t\t{\n\t\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'groups', 'where' => \"g_id=\".intval($this->ipsclass->input['id']) ) );\n\t\t\t$this->ipsclass->DB->simple_exec();\n\n\t\t\t$group = $this->ipsclass->DB->fetch_row();\n\n\t\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'g_id, g_title',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'groups',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"g_id <> \".intval($this->ipsclass->input['id']),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'order' => 'g_title' ) );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$group = array();\n\n\t\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'g_id, g_title',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'groups',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'order' => 'g_title' ) );\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// sort out the promotion stuff\n\t\t//-----------------------------------------\n\n\t\tlist($group['g_promotion_id'], $group['g_promotion_posts']) = explode( '&', $group['g_promotion'] );\n\n\t\tif ($group['g_promotion_posts'] < 1)\n\t\t{\n\t\t\t$group['g_promotion_posts'] = '';\n\t\t}\n\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\twhile ( $r = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\tif ( $r['g_id'] == $this->ipsclass->vars['admin_group'] )\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$all_groups[] = array( $r['g_id'], $r['g_title'] );\n\t\t}\n\n\t\t//-----------------------------------------\n\n\t\t$perm_masks = array();\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'forum_perms' ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\twhile ( $r = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$perm_masks[] = array( $r['perm_id'], $r['perm_name'] );\n\t\t}\n\n\t\t//-----------------------------------------\n\n\t\tif ($type == 'edit')\n\t\t{\n\t\t\t$this->ipsclass->admin->page_title = \"Изменение группы пользователей «{$group['g_title']}»\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ipsclass->admin->page_title = 'Добавление группы пользователей';\n\t\t\t$group['g_title'] = 'Новая группа';\n\t\t}\n\n\t\t$guest_legend = \"\";\n\n\t\tif ($group['g_id'] == $this->ipsclass->vars['guest_group'])\n\t\t{\n\t\t\t$guest_legend = \"</b><br /><i>Не применительно к гостям.</i>\";\n\t\t}\n\n\t\t$this->ipsclass->admin->page_detail = \"Пожалуйста, перепроверьте все еще раз перед продолжением.\";\n\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= \"<script language='javascript'>\n\t\t\t\t\t\t <!--\n\t\t\t\t\t\t function checkform() {\n\n\t\t\t\t\t\t \tisAdmin = document.forms[0].g_access_cp;\n\t\t\t\t\t\t \tisMod = document.forms[0].g_is_supmod;\n\n\t\t\t\t\t\t \tmsg = '';\n\n\t\t\t\t\t\t \tif (isAdmin[0].checked == true)\n\t\t\t\t\t\t \t{\n\t\t\t\t\t\t \t\tmsg += 'Пользователи этой группы получат доступ в админцентр!\\\\n\\\\n';\n\t\t\t\t\t\t \t}\n\n\t\t\t\t\t\t \tif (isMod[0].checked == true)\n\t\t\t\t\t\t \t{\n\t\t\t\t\t\t \t\tmsg += 'Пользователи этой группы станут супермодераторами.\\\\n\\\\n';\n\t\t\t\t\t\t \t}\n\n\t\t\t\t\t\t \tif (msg != '')\n\t\t\t\t\t\t \t{\n\t\t\t\t\t\t \t\tmsg = 'Проверка безопасности\\\\n--------------\\\\nНазвание группы пользователей: ' + document.forms[0].g_title.value + '\\\\n--------------\\\\n\\\\n' + msg + 'Информация верна?';\n\n\t\t\t\t\t\t \t\tformCheck = confirm(msg);\n\n\t\t\t\t\t\t \t\tif (formCheck == true)\n\t\t\t\t\t\t \t\t{\n\t\t\t\t\t\t \t\t\treturn true;\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\treturn false;\n\t\t\t\t\t\t \t\t}\n\t\t\t\t\t\t \t}\n\t\t\t\t\t\t }\n\t\t\t\t\t\t //-->\n\t\t\t\t\t\t </script>\\n\";\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_form( array( 1 => array( 'code' , $form_code ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 2 => array( 'act' , 'group' ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 3 => array( 'id' , $this->ipsclass->input['id'] ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 4 => array( 'section', $this->ipsclass->section_code ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) , 'adform', \"onSubmit='return checkform()'\" );\n\n\n\t\tlist($p_max, $p_width, $p_height) = explode( \":\", $group['g_photo_max_vars'] );\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"40%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"60%\" );\n\n\t\t//-----------------------------------------\n\n\t\t$prefix = str_replace( \"'\", \"&#39;\", $group['prefix'] );\n\t\t$prefix = str_replace( '\"', \"&quot;\", $prefix );\n\t\t$prefix = str_replace( \"<\", \"&lt;\" , $prefix );\n\t\t$suffix = str_replace( \"'\", \"&#39;\", $group['suffix'] );\n\t\t$suffix = str_replace( '\"', \"&quot;\", $suffix );\n\t\t$suffix = str_replace( \"<\", \"&lt;\" , $suffix );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Глобальные настройки\", \"Основные настройки группы\" );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Название группы</b>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_input(\"g_title\", $group['g_title'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t//-----------------------------------------\n\t\t// Sort out default array\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .=\n\t\t\"<script type='text/javascript'>\n\n\t\t\tvar show = '';\n\t\t\";\n\n\t\tforeach ($perm_masks as $d)\n\t\t{\n\t\t\t$this->ipsclass->html .= \" \t\tperms_$d[0] = '$d[1]';\\n\";\n\t\t}\n\n\t\t$this->ipsclass->html .=\n\t\t\"\n\t\t\tvar show = '';\n\n\t\t \tfunction saveit(f)\n\t\t \t{\n\t\t \t\tshow = '';\n\n\t\t \t\tfor (var i = 0 ; i < f.options.length; i++)\n\t\t\t\t{\n\t\t\t\t\tif (f.options[i].selected)\n\t\t\t\t\t{\n\t\t\t\t\t\ttid = f.options[i].value;\n\t\t\t\t\t\tshow += '\\\\n' + eval('perms_'+tid);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfunction show_me()\n\t\t\t{\n\t\t\t\tif (show == '')\n\t\t\t\t{\n\t\t\t\t\tshow = 'Изменений не обнаружено\\\\nНажмите на мульти-выборочный блок для активации';\n\t\t\t\t}\n\n\t\t\t\talert('Выбранные маски доступа\\\\n---------------------------------\\\\n' + show);\n\t\t\t}\n\n\t\t</script>\";\n\n\t\t$arr = explode( \",\", $group['g_perm_id'] );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Использовать следующие маски доступа к форумам... </b><br />Можно выбрать несколько, удерживая клавишу Ctrl.\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_multiselect(\"permid[]\", $perm_masks, $arr, 5, 'onfocus=\"saveit(this)\"; onchange=\"saveit(this)\";' ).\"<br /><input style='margin-top:5px' id='editbutton' type='button' onclick='show_me();' value='Показать выбранные маски'>\"\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Картинка (иконка) группы</b><div class='desctext'>Может выглядеть как <b>style_images/1/folder_team_icons/admin.gif</b>,<br /> так и в виде полного адреса <b>'http://'</b><br/ >Используйте <b>style_images/<#IMG_DIR#>/folder_team_icons/{image}</b> (заменив {image} именем картинки) для динамической загрузки картинок из директории /style_images/ в стиль пользователей.<br />(заполнять не обязательно)</div>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_textarea(\"g_icon\", htmlspecialchars($group['g_icon']) )\n\t\t\t\t\t\t\t\t\t ) );\n\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Отображение в списке активных пользователей<br />[приставка перед именем пользователя]</b><br />(поле можно оставить пустым)<br />(Пример: &lt;span style='color:red'>)\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_input(\"prefix\", $prefix )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Отображение в списке активных пользователей<br />[суффикс после имени пользователя]</b><br />(поле можно оставить пустым)<br />(Пример: &lt;/span>)\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_input(\"suffix\", $suffix )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Скрыть эту группу из списка пользователей?</b>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_hide_from_list\", $group['g_hide_from_list'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"40%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"60%\" );\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Прикрепление файлов\", \"Управление правами на прикрепление файлов к сообщениям в темах, личных сообщениях и т.д.\" );\n\n\t\tif( $type == 'edit' AND $group['g_attach_max'] == 0 )\n\t\t{\n\t\t\t$group['g_attach_maxdis'] = \"<i>не ограничено</i>\";\n\t\t}\n\t\telse if( $type == 'edit' AND $group['g_attach_max'] == -1 )\n\t\t{\n\t\t\t$group['g_attach_maxdis'] = \"<i>отключено</i>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$group['g_attach_maxdis'] = $this->ipsclass->size_format( $group['g_attach_max'] * 1024 );\n\t\t}\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Глобальные: Максимальное общее место на диске для всех файлов (включая личные сообщения и сообщения в темах) (в килобайтах)</b>\".$this->ipsclass->adskin->js_help_link('mg_upload').\"<div class='desctext'>Введите -1 для отключения возможности прикреплять файлы.<br />Введите 0 для отключения действия ограничения на место.</div>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_input(\"g_attach_max\", $group['g_attach_max'] ). ' (сейчас: '.$group['g_attach_maxdis'].')'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) );\n\n\t\tif( $type == 'edit' AND $group['g_attach_per_post'] == 0 )\n\t\t{\n\t\t\t$group['g_attach_per_postdis'] = \"<i>не ограничено</i>\";\n\t\t}\n\t\telse if( $type == 'edit' AND $group['g_attach_per_post'] == -1 )\n\t\t{\n\t\t\t$group['g_attach_per_postdis'] = \"<i>отключено</i>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$group['g_attach_per_postdis'] = $this->ipsclass->size_format( $group['g_attach_per_post'] * 1024 );\n\t\t}\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>В сообщениях: Максимальное общее место на диске для прикрепленных файлов каждого сообщения или личного сообщения (в килобайтах)</b>\".$this->ipsclass->adskin->js_help_link('mg_upload').\"<div class='desctext'>Введите <b>0</b> для отключения действия ограничения на место.<br />Это значение должны быть меньшим, чем глобальное ограничение.</div>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_input(\"g_attach_per_post\", $group['g_attach_per_post'] ). ' (сейчас: '.$group['g_attach_per_postdis'].')'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Фотография: Максимальное место на диске для фотографии пользователя (в килобайтах)</b><br />(Оставьте поле пустым для запрета загрузки фотографии вообще)\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_input(\"p_max\", $p_max ).\"<br />\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .\"Максимальная ширина (px): <input type='text' size='3' class='textinput' name='p_width' value='{$p_width}'> \"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .\"Максимальная высота (px): <input type='text' size='3' class='textinput' name='p_height' value='{$p_height}'>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Аватар: Разрешить загрузку аватара с жесткого диска пользователя?$guest_legend\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_avatar_upload\", $group['g_avatar_upload'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Личные сообщения: Разрешить прикрепление файлов к личным сообщениям?$guest_legend\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_can_msg_attach\", $group['g_can_msg_attach'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"40%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"60%\" );\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Основные права\", \"Ограничения группы: что могут и не могут делать пользователи из данной группы\" );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Могут просматривать весь форум?</b>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_view_board\", $group['g_view_board'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Могут просматривать ОТКЛЮЧЕННЫЙ (OFFLINE) ФОРУМ?</b>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_access_offline\", $group['g_access_offline'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Могут просматривать профили пользователей и список пользователей?</b>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_mem_info\", $group['g_mem_info'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Могут просматривать темы, созданные другими пользователями?</b>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_other_topics\", $group['g_other_topics'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Могут использовать поиск по форуму?</b>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_use_search\", $group['g_use_search'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Временной интервал между повторным поиском по форуму (защита от массовых атак сервера) (в секундах)</b><div class='desctext'>Введите количество секунд, в течение которых пользователь этой группы после использования поиска не сможет им воспользоваться повторно. Эта опция защищает форум от атак на сервер за счет массового поиска в короткий период времени.<br />Введите <b>0</b> для отключения ограничения.</div>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_input(\"g_search_flood\", $group['g_search_flood'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\tlist( $limit, $flood ) = explode( \":\", $group['g_email_limit'] );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Пользователи этой группы могут отправлять письма с форума на e-mail?</b><br />Для отключения ограничений оставьте поле пустым $guest_legend\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_email_friend\", $group['g_email_friend'] )\n\t\t\t\t\t\t\t\t\t\t\t\t .\"<br />Разрешить отправку писем на e-mail только \". $this->ipsclass->adskin->form_simple_input(\"join_limit\", $limit, 2 ).\" штук в 24 часа\"\n\t\t\t\t\t\t\t\t\t\t\t\t .\"<br />... и разрешить отправку только 1 письма на e-mail каждые \".$this->ipsclass->adskin->form_simple_input(\"join_flood\", $flood, 2 ).\" минут\"\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Могут редактировать свои личные данные?$guest_legend\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_edit_profile\", $group['g_edit_profile'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Могут использовать личные сообщения (PM)?$guest_legend\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_use_pm\", $group['g_use_pm'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Введите максимальное число пользователей для массовой рассылки через личные сообщения пользователем данной группы?</b><div class='desctext'>(Введите 0 или оставьте поле пустым для отключения возможности массовой отправки личных сообщений)</div>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_input(\"g_max_mass_pm\", $group['g_max_mass_pm'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Максимальное количество сохраняемых личных сообщений?$guest_legend\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_input(\"g_max_messages\", $group['g_max_messages'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"40%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"60%\" );\n\n\t\t//-----------------------------------------\n\n\t\t$dd_topic_rate = array( 0 => array( 0, 'Нет' ), 1 => array( 1, 'Да (Не позволять изменять голоса)' ), 2 => array( 2, 'Да (Разрешить изменять голоса)' ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Настройки сообщений\", \"Права пользователей этой группы для тем и сообщений\" );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Могут открывать новые темы (где разрешено)?</b>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_post_new_topics\", $group['g_post_new_topics'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Могут оценивать темы (где это разрешено)?</b>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_dropdown(\"g_topic_rate_setting\", $dd_topic_rate, $group['g_topic_rate_setting'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Могут публиковать ответы в СВОИХ (созданных самим пользователем) темах?</b>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_reply_own_topics\", $group['g_reply_own_topics'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Могут публиковать ответы на ЧУЖИЕ темы (где разрешено)?</b>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_reply_other_topics\", $group['g_reply_other_topics'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Могут редактировать свои сообщения?$guest_legend\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_edit_posts\", $group['g_edit_posts'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Временное ограничение с даты публикации сообщения, после которого редактирование сообщения будет запрещено (в минутах)?$guest_legend</b><div class='desctext'>Запрещает пользователям этой группы редактировать свои сообщения после окончания указанного периода времени.<br />Введите <b>0</b> или оставьте поле пустым для отключения ограничения.</div>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_input(\"g_edit_cutoff\", $group['g_edit_cutoff'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Могут удалять пометку «Отредактировано...» при редактировании сообщения?$guest_legend</b>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_append_edit\", $group['g_append_edit'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Могут удалять свои сообщения?$guest_legend\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_delete_own_posts\", $group['g_delete_own_posts'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Могут открывать/закрывать свои темы?$guest_legend\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_open_close_posts\", $group['g_open_close_posts'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Могут изменять названия и описания своих тем?$guest_legend\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_edit_topic\", $group['g_edit_topic'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Могут удалять свои темы?$guest_legend\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_delete_own_topics\", $group['g_delete_own_topics'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Могут создавать новые опросы (где разрешено)?$guest_legend</b>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_post_polls\", $group['g_post_polls'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Могут голосовать (где разрешено)?$guest_legend\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_vote_polls\", $group['g_vote_polls'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Не применять к пользователям данной группы флуд-контроль?</b>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_avoid_flood\", $group['g_avoid_flood'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Не применять проверку сообщений перед публикацией модераторами для пользователей этой группы?</b>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_avoid_q\", $group['g_avoid_q'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Могут использовать HTML в сообщениях?$guest_legend</b><br />\".$this->ipsclass->adskin->js_help_link('mg_dohtml') ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_dohtml\", $group['g_dohtml'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Не применять к пользователям данной группы фильтры плохих слов?$guest_legend</b><br />\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_bypass_badwords\", $group['g_bypass_badwords'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\n\t\t//-----------------------------------------\n\t\t// DISPLAY NAME OPTIONS\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"40%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"60%\" );\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Права на изменения имен\", \"Действителен, только когда стоит показ имен\" );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<strong>Изменение имени: Лимит дней</strong><div class='desctext'>Это количество дней в течение которых пользователь может произвести изменения. Для примера \\\"30\\\" это означает, что пользователь может изменить свое имя только на протяжении 30-ти дней.</div>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_input(\"g_dname_date\", $group['g_dname_date'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<strong> Изменение имени: Макс. кол-во изменений в Х дней</strong><div class='desctext'>Здесь вы указываете число раз, сколько пользователь сможет изменить свое имя в течение Х дней. Установите \\\"0\\\", чтобы запретить пользоваться этим преимуществом.</div>\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_input(\"g_dname_changes\", $group['g_dname_changes'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\n\t\t//-----------------------------------------\n\t\t// MODERATOR OPTIONS\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"40%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"60%\" );\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Установки модерирования\", \"Управление модераторскими возможностями для этой группы пользователей\" );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Сделать пользователей этой группы супермодераторами (возможность модерировать везде)?$guest_legend\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_is_supmod\", $group['g_is_supmod'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Разрешить доступ к админцентру форума для пользователей этой группы (очень важный пункт!)?$guest_legend\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_access_cp\", $group['g_access_cp'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Позволить публиковать ответы в закрытых темах?\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t $this->ipsclass->adskin->form_yes_no(\"g_post_closed\", $group['g_post_closed'] )\n\t\t\t\t\t\t\t\t\t ) );\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"40%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"&nbsp;\" , \"60%\" );\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Продвижение пользователей группы\" );\n\n\t\tif ($group['g_id'] == $this->ipsclass->vars['admin_group'])\n\t\t{\n\t\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Выберите 'Не перемещать' для отключения продвижения</b><br />\".$this->ipsclass->adskin->js_help_link('mg_promote') ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"Эта возможность отключена для группы главных администраторов.\"\n\t\t\t\t\t\t\t\t\t\t\t ) );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<b>Выберите &laquo;Не продвигать&raquo; для отключения продвижения пользователей этой группы</b>$guest_legend<br />\".$this->ipsclass->adskin->js_help_link('mg_promote') ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'Перемещать пользователей этой группы в другую группу пользователей (например, с более высокими правами) '.$this->ipsclass->adskin->form_dropdown(\"g_promotion_id\", $all_groups, $group['g_promotion_id'] )\n\t\t\t\t\t\t\t\t\t\t\t\t\t .'<br />когда они набирают указанное далее количество сообщений: '.$this->ipsclass->adskin->form_simple_input('g_promotion_posts', $group['g_promotion_posts'] ).'<br />(Тут используется значение счетчика сообщений пользователя).'\n\t\t\t\t\t\t\t\t\t\t\t ) );\n\t\t}\n\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_form($button);\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\n\t\t$this->ipsclass->admin->output();\n\n\n\t}", "public function edit() {\r\n\t\tif (isset($_POST['title'])) {\r\n\t\t\t$id = (int)$_POST['id'];\r\n\t\t\t$data[MENUGROUP_TITLE] = trim($_POST['title']);\r\n\t\t\t$response['success'] = false;\r\n\t\t\tif ($this->db->update(MENUGROUP_TABLE, $data, MENUGROUP_ID . ' = ' . $id)) {\r\n\t\t\t\t$response['success'] = true;\r\n\t\t\t}\r\n\t\t\theader('Content-type: application/json');\r\n\t\t\techo json_encode($response);\r\n\t\t}\r\n\t}", "public function group($id){\n try{\n $id = Crypt::decryptString($id);\n } catch (DecryptException $e) {\n return 'UPD-E0001';\n }\n \n $group = Group::find($id);\n $container = GroupContainer::select('id', 'name')->find($group->group_container_id);\n $authors = AuthorsInContainer::select('author_id')->where('group_container_id', $group->group_container_id)->get();\n $books = Book::whereIn('author_id', $authors->pluck('author_id'))->get();\n $containers = GroupContainer::select('id', 'name')->get();\n return view('bahai.forms.update.group', compact('container', 'containers', 'authors', 'books', 'group'));\n }", "public function edit($id = null)\n\t{\n\t\t$result = AccountGroup::find($id);\n\t\t\n\t\tif (!$result) {\n\t\t\tabort(404);\n\t\t}\n\t\tif ($result->is_default == 1) {\n\t\t\treturn redirect()->route('account-group.index')\n\t\t\t\t->with('error', lang('messages.isdefault', string_manip(lang('account_group.account_group'))));\n\t\t}\n\t\t$accountGroup = (new AccountGroup)->getAccountGroupService();\n\t\treturn view('account-group.edit', compact('result', 'accountGroup'));\n\t}", "public function edit($id)\n {\n //\n $group = Group::find($id);\n return view('manage.groups.edit')->withGroup($group);\n }", "public function edit($id)\n {\n $group=Group::find($id);\n return view('group.edit', ['group'=>$group]);\n }", "public function edit($id)\n\t{\n\t\t$group = Group::findOrFail($id);\n\n\t\treturn view('groups.edit', compact('group'));\n\t}", "public function editGroupView(Group $group)\n {\n return view('groups.add_edit')\n ->with('formAction', route(Constants::ROUTES_GROUPS_UPDATE, $group[Constants::FLD_GROUPS_ID]))\n ->with('btnText', 'Edit')\n ->with('group', $group)\n ->with('pageTitle', config('app.name') . ' | ' . $group[Constants::FLD_GROUPS_NAME]);\n }", "public function edit( $id ) {\n\t\t$data = Group::findOrFail( $id );\n\t\t$this->page->create_option = 1;\n\t\treturn view('pages.settings.parts.groups.master' )\n\t\t\t->with( 'Page', $this->page )\n\t\t\t->with( 'Data', $data );\n\t}", "public function getEdit($id) {\n\t\tif ($id) {\n\t\t\t$navigationGroup = NavigationGroup::find($id);\n\t\t\t// Title\n\t\t\t$title = Lang::get('admin/navigation/title.navigation_group_update');\n\t\t\t// mode\n\t\t\t$mode = 'edit';\n\n\t\t\treturn View::make('admin/navigationgroups/create_edit', compact('navigationGroup', 'title', 'mode'));\n\t\t} else {\n\t\t\treturn Redirect::to('admin/navigationgroups') -> with('error', Lang::get('admin/navigation/messages.does_not_exist'));\n\t\t}\n\t}", "public function edit($id)\n\t{\n\t\t//\n\t\t$group = CepGroups::where('group_id',$id)->first();\n\t\treturn count($group) ? view(\"groups/edit\", compact('group')) : abort(404);\n\t}", "public function edit($id)\n {\n $user_id = auth() -> user() -> id;\n $group = Group::findOrfail($id);\n\n // access control - only the moderator can edit the group\n if (strtolower($group -> status) == 'p' && $user_id != $group -> moderator_id) abort(404);\n if ($user_id != $group -> moderator_id) abort(403);\n\n return view('groups.edit') -> with('group' , $group);\n\n }", "public function edit($id)\n {\n if (!$id || !$this->Groups->exists(['id' => $id])) {\n throw new NotFoundException();\n }\n if (!$this->request->is(['get', 'put'])) {\n throw new MethodNotAllowedException();\n }\n\n $group = $this->Groups->get($id);\n\n if ($this->request->is('put')) {\n $group = $this->Groups->patchEntity($group, $this->request->data);\n if ($this->Groups->save($group)) {\n $this->Flash->success(__d('wasabi_core', 'The group <strong>{0}</strong> has been saved.', $this->request->data['name']));\n $this->redirect(['action' => 'index']);\n return;\n } else {\n $this->Flash->error($this->formErrorMessage);\n }\n }\n $this->set('group', $group);\n $this->render('add');\n }", "function edit($stationkey_id = null) {\n\t\t\n\t\t$this->pageTitle = 'Group Edit';\n\t\t\n\t $stationkey_id=isset($this->params['url']['stationkey_id'])?$this->params['url']['stationkey_id']:(isset($this->params['named']['stationkey_id'])?$this->params['named']['stationkey_id']:\"\");\n\t\t $dn_id=isset($this->params['url']['dn_id'])?$this->params['url']['dn_id']:(isset($this->params['named']['dn_id'])?$this->params['named']['dn_id']:\"\");\n\t\t$spg=isset($this->params['url']['spg'])?$this->params['url']['spg']:(isset($this->params['named']['spg'])?$this->params['named']['spg']:\"\");\n\t\t \n\t\t$featureType=isset($this->params['url']['featureType'])?$this->params['url']['featureType']:(isset($this->params['named']['featureType'])?$this->params['named']['featureType']:\"\");\n\t\t$this->set('featureType', $featureType);\n\t\t$this->log('FEATURES CONTROLLER : EDIT => STATIONKEY_ID ' . $stationkey_id, LOG_DEBUG);\n\t\t$this->set('grpid',$dn_id);\n\t\t\n\t\t\n\t\t$groupDetailsdesc = $this->Group->find('first', array (\n\t\t\t\t\t'conditions' => array (\n\t\t\t\t\t\t\t'Group.id' => $dn_id,\n\t\t\t\t\t\t\t'Group.type' => array('MADN', 'XLH')\n\t\t\t\t\t)\n\t\t\t));\n\t\t\t\n\t\t\t$this->set('groupDetailsdesc',$groupDetailsdesc);\n\t\t\n\t\t\n\t\t#\n\t\t\n\t\t\n\t\tif(isset($spg) && ($spg != ''))\n\t\t{\n\t\t\t#if a soruce page is given send to the view.\n\t\t\t$this->set('spg', $spg);\n\t\t\t\n\t\t}\n\t\tif(isset($dn_id) && ($dn_id != ''))\n\t\t{\n\t\t\t#no key supplied. could have come from group edit or come from DN List page!\n\t\t\t\n\t\t\t\n\t\t\t#DEtermin if this number is a group number or not.\n\t\t\t\n\t\t\t$groupDetails = $this->Group->find('first', array (\n\t\t\t\t\t'conditions' => array (\n\t\t\t\t\t\t\t'Group.id' => $dn_id,\n\t\t\t\t\t\t\t'Group.type' => array('MADN', 'XLH')\n\t\t\t\t\t)\n\t\t\t));\n\t\t\t\n\t\t\n\t\t\tif(empty($groupDetails))\n\t\t\t{\n\t\t\t\t#treat as DN individual\n\t\t\t\t\n\t\t\t\t$stationkey = $this->Feature->find('first', array (\n\t\t\t\t\t\t'fields'=>'Feature.stationkey_id',\n\t\t\t\t\t\t'conditions' => array (\n\t\t\t\t\t\t\t\t'Feature.short_name' => 'DN',\n\t\t\t\t\t\t\t\t'Feature.primary_value' => $dn_id\n\t\t\t\t\t\t)\n\t\t\t\t));\n\t\t\t\t$stationkey_id = $stationkey['Feature']['stationkey_id'];\n\t\t\t\t$this->log(\"Features controller :PILOT KEY IS : $stationkey_id\", LOG_DEBUG);\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t#treat as a group\n\t\t\t\tif($groupDetails['Group']['type'] == 'MADN')\n\t\t\t\t{\n\t\t\t\t\t#Find Pilot \n\t\t\t\t\t$pilotData = $this->Station->getPilotFromDn($dn_id);\n\t\t\t\t\t\n\t\t\t\t\t#$results_array=print_r($pilotData, true);\n\t\t\t\t\t#$this->log(\"Features controller : Group Details : $results_array\", LOG_DEBUG);\n\t\t\t\t\tif (count($pilotData) == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t#Get lowest LEN.\n\t\t\t\t\t\t$stationkey_id = $this->calculateMADNLowestLen($dn_id);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\t\n\t\t\t\t\t\t$stationkey_id = $pilotData[0]['stationkeys']['id'];\n\t\t\t\t\t}\n\t\t\t\t\t$this->log(\"Features controller :PILOT KEY : $stationkey_id\", LOG_DEBUG);\n\t\t\t\t\t\n\t\t\t\t\t$groupname = $this->Station->getGroupDisplaynameFromDn($dn_id);\n\t\t\t\t\t$this->set('groupname',$groupname);\n\t\t\t\t}\n\t\t\t\telseif ($groupDetails['Group']['type'] == 'XLH')\n\t\t\t\t{\n\n\t\t\t\t\t#Get all Hunt GRoup name details\n\t\t\t\t\t$customer_id = $groupDetails['Customer']['id'];\n\t\t\t\t\t$xlhListDetails = $this->Station->getXlhGroupDisplaynameFromCust($customer_id);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tforeach ($xlhListDetails as $xlhListDetail)\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t // print_r($xlhListDetail['s2']['primary_value'].\"==\".$dn_id.\"</br>\");\n\t\t\t\t\t\tif ($xlhListDetail['s2']['primary_value'] == $dn_id) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$stationkey_id = $xlhListDetail['s1']['id'];\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->log(\"Features controller :PILOT KEY : $stationkey_id\", LOG_DEBUG);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\n\t\t\t\t\t\t\n\t\t\t\n\t\t\t#$results_array=print_r($stationkey, true);\n\t\t\t#$this->log(\"Features controller : feature results : $results_array\", LOG_DEBUG);\n\t\t\t$this->set('returnDNList', 'true');\n\t\t\t$this->log(\"Features controller : Stationkey : $stationkey_id\", LOG_DEBUG);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t#ORIGINAL FROM GROUP.\n\t\t\t#$groupnames = $this->Group->find('first',array('conditions'=>array('Group.id'=>$dn_id,'Group.type'=>'MADN')));\n\t\t\t\n\t\t\t#$grpname = $groupnames['Group']['name'];\n\t\t\t\n\t\t\t#REPLACE WITH DISPLAYNAME FROM PILOT\n\t\t\t\n\t\t\t#Find Pilot data\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t$stationFeaturesSource = $this->Feature->find('all', array (\n\t\t\t\t'conditions' => array (\n\t\t\t\t\t\t'Feature.stationkey_id' => $stationkey_id\n\t\t\t\t)\n\t\t\t\t,'order' => array (\n\t\t\t\t\t\t'Feature.id',\n\t\t\t\t),\n\t\t));\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t#$results_array=print_r($stationFeaturesSource, true);\n\t\t#$this->log(\"Features controller : feature results : $results_array\", LOG_DEBUG);\n\t\t\n\t\tpreg_match(\"/[0-9]+@([0-9]+)/\", $stationkey_id, $matches);\n\t\tif ($matches[1]) {\n\t\t\t#$this->redirect('/stations/edit/'.$matches[1]);\n\t\t\t$station_id = $matches[1];\n\t\t\t#print \"STATION DETECTED\";\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t$stationDetails = $this->Station->find('all', array (\n\t\t\t\t'conditions' => array (\n\t\t\t\t\t\t'Station.id' => $station_id\n\t\t\t\t)\n\t\t\t));\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t/**********for case of internal/external users********/\n\t\t\tif ($this->Session->read('SELECTED_CUSTOMER') != Configure :: read('access_id')) {\n\t\t\t\n\t\t\t\t#If The user is an external..\n\t\t\t\n\t\t\t\t\t\t$id = $this->Session->read('SELECTED_CUSTOMER');\n\t\t\t\t\t\t$cnt = count($this->_Filter);\n\t\t\t\n\t\t\t\t\t\tif (!$this->Customer->validCustomer($id, $stationDetails[0]['Customer']['id'])) {\n\t\t\t\t\t\t#print_r(\"not valid\");die();\n\t\t\t\t\t\t\t$this->redirect('/customers');\n\t\t\t\t\t\t\texit ();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t#print_r(\"valid checking $id $number\");die();\n\t\t\t\n\t\t\t}\n\t\t\t/**********************END*************************/\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$allFeaturesSource = $this->Feature->find('all', array (\n\t\t\t\t\t'conditions' => array (\n\t\t\t\t\t\t\t'Stationkey.station_id' => $station_id\n\t\t\t\t\t)\n\t\t\t\t\t,'order' => array (\n\t\t\t\t\t\t\t'Feature.id',\n\t\t\t\t\t),\n\t\t\t));\n\t\t\t\n\t\t\t#Loop throught the features and foreach stationeky determine a type for that key\n\t\t\tforeach($allFeaturesSource as $allkeyfeature)\n\t\t\t{\n\t\t\t\t$shortName = $allkeyfeature['Feature']['short_name'];\n\t\t\t\n\t\t\t\t$allstationFeatures[$shortName]['short_name'] = $shortName;\n\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$this->set('stationfeatures', $allstationFeatures);\n\t\t\t\t\t\t\n\t\t\t#$results_array=print_r($stationDetails, true);\n\t\t\t#$this->log(\"Features controller : stations results : $results_array\", LOG_DEBUG);\n\t\t\n\t\t\tif ($stationDetails[0]['Station']['customer_id'] != '')\n\t\t\t{\n\t\t\t\t$customer_id = $stationDetails[0]['Station']['customer_id'];\n\t\t\t\t\n\t\t\t\t#Find Locations\n\t\t\t\t$customer = $this->Customer->find('first',array('contain'=>array('Location'),'conditions'=>array('id'=>$customer_id)));\n\t\t\t\tforeach($customer['Location'] as $key=>$value):\n\t\t\t\t$locations[$value['id']] = $value['name'];\n\t\t\t\tendforeach;\n\t\t\t\t\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t#Loop throught the features and foreach stationeky determine a type for that key\n\t\tforeach($stationFeaturesSource as $keyfeature)\n\t\t{\n\t\t\t$shortName = $keyfeature['Feature']['short_name'];\n\t\t\t\t\t\t\n\t\t\t$stationFeatures[$shortName]['short_name'] = $shortName;\n\t\t\t#$stationFeatures[$shortName]['primary_value'] = $keyfeature['Feature']['short_name'];\n\t\t\t$stationFeatures[$shortName]['primary_value'] = $keyfeature['Feature']['primary_value'];\n\t\t\t$stationFeatures[$shortName]['created'] = $keyfeature['Feature']['created'];\n\t\t\t$stationFeatures[$shortName]['status'] = $keyfeature['Feature']['status'];\n\t\t\t$stationFeatures[$shortName]['location_id'] = $keyfeature['Stationkey']['location_id'];\n\t\t\t$stationFeatures[$shortName]['label'] = $keyfeature['Feature']['label'];\n\n\t\t}\n\t\t\n\t\t$dnDetails = $this->Dns->find('first', array (\n\t\t\t\t'conditions' => array (\n\t\t\t\t\t\t'Dns.id' => $stationFeatures['DN']['primary_value'],\n\t\t\t\t)\n\t\t));\n\t\t\n\t\t#ORIGINAL FROM GROUP.\n\t\t#$groupnames = $this->Group->find('first',array('conditions'=>array('Group.id'=>$dn_id,'Group.type'=>'MADN')));\n\t\t\t\n\t\t#$grpname = $groupnames['Group']['name'];\n\t\t\t\n\t\t#REPLACE WITH DISPLAYNAME FROM PILOT\n\t\t\t\n\t\t#Find Pilot data\n\t\t\t\n\t\t#$groupnamedetails = $this->Station->getGroupDisplaynameFromDn($stationFeatures['DN']['primary_value']);\n\t\t#$results_array=print_r($groupname, true);\n\t\t#$this->log(\"Features controller : GROUP DISPLAY : $results_array\", LOG_DEBUG);\n\t\t#$groupname = $groupnamedetails[0]['features']['primary_value'];\n\t\t#$this->set('groupname',$groupname);\n\t\t\n\t\t\n\t\t$this->set('dnDetails', $dnDetails);\n\t\t#Set Options.\n\t\t\n\t\t#CBM TEST\n\t\t\n\t\t\t\t\n\t\t#??? Replace at some point with read from config file.\n\t\t$statuses[0] = Inactive;\n\t\t$statuses[1] = Active;\n\t\t#???Add up to 60 in 4 increments.\n\t\t$cfdvtcounter = 12;\n\t\t#$cfdvtOptions['0'] = '--';\n\t\t\n\t\t$cfdvtOptions[$stationFeatures['CFDVT']['primary_value']] = $stationFeatures['CFDVT']['primary_value'];\n\t\t\n\t\twhile ($cfdvtcounter <= 60)\n\t\t{\n\t\t\t\n\t\t\t$cfdvtOptions[$cfdvtcounter] = $cfdvtcounter;\n\t\t\t$cfdvtcounter = $cfdvtcounter + 4;\n\t\t}\n\t\t\n\t\t$this->set('cfdvtOptions', $cfdvtOptions);\n\t\t#$languageOptions['en'] = 'EN';\n\t\t$languageOptions['de'] = 'DE';\n\t\t$languageOptions['fr'] = 'FR';\n\t\t$languageOptions['it'] = 'IT';\n\t\t$this->set('languageOptions', $languageOptions);\n\t\t$barringOptions['Set1'] = 'Set1';\n\t\t$barringOptions['Set2'] = 'Set2';\n\t\t$barringOptions['Set3'] = 'Set3';\n\t\t$barringOptions['Set4'] = 'Set4';\n\t\t$barringOptions['Set5'] = 'Set5';\n\t\t$this->set('barringOptions', $barringOptions);\n\t\t\n\t\t$this->set('locations', $locations);\n\t\t$this->set('location_id', $stationFeatures['DN']['location_id']);\n\t\t\n\t\t$this->set('porttype', $stationDetails[0]['Station']['type']);\n\t\t$this->set('custtype', $stationDetails[0]['Customer']['type']);\n\t\t\n\t\t\n\t\t\n\t\t$cond10 = array('Location.id'=>$stationFeatures['DN']['location_id']);\n\t\t$loc_name = $this->Location->find('first',array('conditions'=>$cond10,'fields'=>array('Location.name'),'recursive'=>-1));\n\t\t$this->set('location_name',$loc_name);\n\t\t\t\t\n\t\t\n\t\t#echo \"<pre>\";print_r($stationFeatures);\n\t\t#$results_array=print_r($stationFeatures, true);\n\t\t#$this->log(\"Station controller : feature results : $results_array\", LOG_DEBUG);\n\t\t#$results_array=print_r($stationFeaturesSource, true);\n\t\t#$this->log(\"Station controller : feature results : $results_array\", LOG_DEBUG);\n\t\t$this->set('features', $stationFeatures);\n\t\t$this->set('statId', $station_id);\n\t\t$this->set('customer_id', $customer_id);\n\t\t$this->set('statuses', $statuses);\n\t\t$this->set('stationkey_id', $stationkey_id);\n\t\t$this->set('statStatus',$stationDetails[0]['Station']['status']);\n\t\tif($stationDetails[0]['Station']['status'] == 7)\n\t\t{\n\t\t\t$this->set('error','stationInException');\n\t\t}\n\t\t\t\n\t\t$this->log(\"Group controller : END EDIT FUNCTION \", LOG_DEBUG);\n\t\t//$dnBlf_observers = $this->Feature->returnObservers($station_id);\n\t\t$dnIdStation=isset($this->params['url']['dnId'])?$this->params['url']['dnId']:(isset($this->params['named']['dnId'])?$this->params['named']['dnId']:\"\");\n\t\n\t if($dnIdStation!=\"\"){\n\t\t\t$primaryVal=$dnIdStation;\n\t\t\t\n\t\t}else{\n\t\t\t$primaryVal=$station_id;\n\t\t}\n\t\n\t\n\t\n\t\t$dnBlf_observers = $this->Feature->returnObservers($primaryVal);\n\t\t\n\t\t\n\t\t$this->set('observers', $dnBlf_observers);\n\t\t\n\t\tif($featureType == 'KEY1_DN'){\n\t\t\t$this->layout ='ajax';\n\t\t\t#Configure::write('debug',0);\n\t\t\t$this->render('/features/individual_dn_edit');\n\t\t}\n\t\tif(($featureType == 'DN_INDIVIDUAL') || ($featureType == 'DN_MADN_PILOT')|| ($featureType == 'DN_XLH_PILOT')||($featureType == 'DN_MADN')||($featureType == 'DN_XLH')){\n\t\t\t$this->layout ='ajax';\n\t\t\t#Configure::write('debug',0);\n\t\t\t\n\t\t\t$cond1 = array('Location.customer_id' => $customer_id);\n\t\t\t$cond1 = array_merge($cond1, array('Dns.function IS NOT NULL'));\n\t\t\t$results = $this->Dns->find('all', array('order' => 'Dns.id asc', 'conditions' => $cond1, 'group' => 'Dns.id', 'fields' => array('Dns.*,Location.name')));\n\t\t\t\t\n\t\t\t#echo \"<pre>\";print_r($results);\n\t\t\t\t\n\t\t\t$sdnaDns['0'] = '---';\n\t\t\tforeach ($results as $result)\n\t\t\t{\n\t\t\t\t$sdnaDns[$result['Dns']['id']] = $result['Dns']['id'];\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$existingDns = $this->Stationkey->find('all', array(\n\t\t\t\t\t\t\n\t\t\t\t\t\t'joins' => array(\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'table' => 'stations',\n\t\t\t\t\t\t\t\t'type' => 'LEFT',\n\t\t\t\t\t\t\t\t'alias' => 'Station',\n\t\t\t\t\t\t\t\t'conditions' => array('Stationkey.station_id = Station.id')\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t\t'table' => 'features',\n\t\t\t\t\t\t\t\t\t\t'type' => 'LEFT',\n\t\t\t\t\t\t\t\t\t\t'alias' => 'Feature',\n\t\t\t\t\t\t\t\t\t\t'conditions' => array('Feature.stationkey_id = Stationkey.id')\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\n\t\t\t\t\t\t),\t\t\n\t\t\t\t\t\t'conditions' => array('Station.customer_id' => $customer_id, 'Feature.short_name'=>'SDNA'), \n\t\t\t\t\t\t'fields' => array('Feature.primary_value')\n\t\t\t\t)\n\t\t\t);\n\t\t\t\t\n\t\t\tforeach ($existingDns as $result)\n\t\t\t{\n\t\t\t\t$sdnaDns[$result['Feature']['primary_value']] = $result['Feature']['primary_value'];\n\t\t\t\t\t\n\t\t\t}\n\t\t\t$this->set('sdnaDns', $sdnaDns);\n\t\t\t$this->render('/features/individual_dn_edit');\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\tif($featureType == 'DN_XLH'){\n\t\t\t$this->layout ='ajax';\n\t\t\t#Configure::write('debug',0);\n\t\t\t#$this->render('/features/madn_edit');\n\t\t\t$this->render('/features/individual_dn_edit');\n\t\t}\n\t\tif($featureType == 'DN_XLH_PILOT'){\n\t\t\t\n\t\t\t$this->layout ='ajax';\n\t\t\t#Configure::write('debug',0);\n\t\t\t#$this->render('/features/madn_edit');\n\t\t\t$this->render('/features/individual_dn_edit');\n\t\t}\n\t\tif($featureType == 'DN_MADN'){\n\t\t\t$this->layout ='ajax';\n\t\t\t#Configure::write('debug',0);\n\t\t\t#$this->render('/features/madn_edit');\n\t\t\t$this->render('/features/individual_dn_edit');\n\t\t}\n\t\tif($featureType == 'DN_MADN_PILOT'){\n\t\t\t\n\t\t\t$this->layout ='ajax';\n\t\t\t#Configure::write('debug',0);\n\t\t\t#$this->render('/features/madn_edit');\n\t\t\t$this->render('/features/individual_dn_edit');\n\t\t}\n\t\tif($featureType == 'SIMRING'){\n\t\t\t$this->layout ='ajax';\n\t\t\t#Configure::write('debug',0);\n\t\t\t$this->render('/features/simring_edit');\n\t\t}\n\t\tif($featureType == 'AUD'){\n\t\t\t$cond1 = array('Location.customer_id' => $customer_id);\n\t\t\t$cond1 = array_merge($cond1, array('Dns.function IS NOT NULL'));\n\t\t\t\n\t\t\t#Get a lis tof all blg with 8.\n\t\t\t\n\t\t\t$excludeBlfArray = $this->Feature->excludeObservers($customer_id);\n\t\t\t#$results_array=print_r($excludeBlfArray, true);\n\t\t\t#$this->log(\"Station controller : BLF : $results_array\", LOG_DEBUG);\n\t\t\t$excludeBlfDn = array('12345678987654321', '12345678987654322');\n\t\t\tforeach ($excludeBlfArray as $excludeBlf)\n\t\t\t{\n\t\t\t\tarray_push($excludeBlfDn, $excludeBlf['f']['primary_value']);\n\t\t\t}\n\t\t\t$cond1 = array_merge($cond1, array('Dns.id NOT' => $excludeBlfDn, 'Dns.function' => 'INDIVIDUAL'));\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$results = $this->Dns->find('all', array('order' => 'Dns.id asc', 'conditions' => $cond1, 'group' => 'Dns.id', 'fields' => array('Dns.*,Location.name')));\n\t\t\t\n\t\t\t$statoinLocaton = $this->Dns->find('all', array('order' => 'Dns.id asc', 'conditions' =>array('Location.customer_id' => $customer_id,'Dns.id'=>$station_id), 'group' => 'Dns.id', 'fields' => array('Location.name')));\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t#echo \"<pre>\";print_r($results);\n\t\t\tforeach ($statoinLocaton as $statoinLoc)\n\t\t\t{\n\t\t\t\t\n\t\t\t\t$dnsLocationName = $statoinLoc['Location']['name'];\n\t\t\t}\n\t\t\t#echo \"<pre>\";print_r($statoinLocaton);\n\t\t\t\n\t\t\t$blfDns[''] = '';\n\t\t\tforeach ($results as $result)\n\t\t\t{\n\t\t\t\t$blfDns[$result['Dns']['id']] = $result['Dns']['id'];\n\t\t\t\t//$dnsLocationName = $result['Location']['name'];\n\t\t\t}\n\t\t\t\n\t\t\t//$results = $this->paginate('Dns');\n\t\t\t//pr($results);die;\n\t\t\t$this->set('blfDns', $blfDns);\n\t\t\t$this->set('results', $results);\t\t\t\n\t\t\t$this->set('dnsLocationName', $dnsLocationName);\n\t\t\t\n\t\t\t$this->layout ='ajax';\n\t\t\t#Configure::write('debug',0);\n\t\t\t$this->render('/features/uf_edit');\n\t\t\t\n\t\t}\n\t\tif($featureType == 'BLF'){\n\t\t\t\t\n\t\t\t\t\n\t\t\t$stationinfo = $this->Stationkey->find('all', array (\n\t\t\t\t\t'conditions' => array (\n\t\t\t\t\t\t\t\"Stationkey.status\" => Configure :: read('status'),\n\t\t\t\t\t\t\t'Stationkey.station_id' => $station_id\n\t\t\t\t\t),\n\t\t\t\t\t'order' => 'Stationkey.keynumber'\n\t\t\t));\n\t\t\t\t\n\t\t\n\t\t\t$cond1 = array('Location.customer_id' => $customer_id);\n\t\t\t$cond1 = array_merge($cond1, array('Dns.function IS NOT NULL'));\n\t\t\t\n\t\t\t\n\t\t\t#Get a lis tof all blg with 8.\n\t\t\t\t\n\t\t\t$excludeBlfArray = $this->Feature->excludeObservers($customer_id);\n\t\t\t#$results_array=print_r($excludeBlfArray, true);\n\t\t\t#$this->log(\"Station controller : BLF : $results_array\", LOG_DEBUG);\n\t\t\t$excludeBlfDn = array('12345678987654321', '12345678987654322');\n\t\t\tforeach ($excludeBlfArray as $excludeBlf)\n\t\t\t{\n\t\t\t\tarray_push($excludeBlfDn, $excludeBlf['f']['primary_value']);\n\t\t\t}\n\t\t\t$cond1 = array_merge($cond1, array('Dns.id NOT' => $excludeBlfDn, 'Dns.function' => 'INDIVIDUAL'));\n\t\t\t\n\t\t\t\n\t\t\t$results = $this->Dns->find('all', array('order' => 'Dns.id asc', 'conditions' => $cond1, 'group' => 'Dns.id', 'fields' => array('Dns.*,Location.name')));\n\t\t\t\t\n\t\t\t\t$statoinLocaton = $this->Dns->find('all', array('order' => 'Dns.id asc', 'conditions' =>array('Location.customer_id' => $customer_id,'Dns.id'=>$station_id), 'group' => 'Dns.id', 'fields' => array('Location.name')));\n\t\t\t\n\t\t\t\n\t\t\t#echo \"<pre>\";print_r($results);\n\t\t\tforeach ($statoinLocaton as $statoinLoc)\n\t\t\t{\n\t\t\t\t$dnsLocationName = $statoinLoc['Location']['name'];\n\t\t\t}\n\t\t\t#$blfDns[''] = '';\n\t\t\t# $results = $this->Dns->find('all', array('conditions' => $cond, 'fields' => array('Dns.*,Location.name,Location.id'), 'group' => 'Dns.id', 'order' => 'Location.name asc'));\n\t\t\t#foreach ($results as $result)\n\t\t\t#{\n\t\t\t#\t$blfDns[$result['Dns']['id']] = $result['Dns']['id'];\n\t\t\t#\t$dnsLocationName = $result['Location']['name'];\n\t\t\t#}\n\t\t\t\n\t\t\t//$results = $this->paginate('Dns');\n\t\t\t//pr($results);die;\n\t\t\t#$this->set('blfDns', $blfDns);\n\t\t\t$this->set('results', $results);\n\t\t\t\n\t\t\t#echo \"<pre>\";print_r($results);\n\t\t\t\t\t\t\n\t\t\t$this->set('dnsLocationName', $dnsLocationName);\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t#blf_val contains the stationkeys that actually have BLF enabled.\n\t\t\n\t\t\t\n\t\t\t$blf_observers = $this->Feature->returnObservers($stationFeatures['BLF']['primary_value']);\n\t\t\t\n \n\t\t\t\n\t\t\t#$results_array=print_r($blf_val, true);\n\t\t\t#$this->log(\"Station controller : BLF : $results_array\", LOG_DEBUG);\n\t\t\t\n\t\t\t$this->set('observers', $blf_observers);\n\t\t\t$results_array=print_r($observers, true);\n\t\t\t$this->log(\"Station controller : BLF : $results_array\", LOG_DEBUG);\n\t\t\t\t\t\n\t\t\t\t$this->layout ='ajax';\n\t\t\t\t#Configure::write('debug',0);\n\t\t\t\t\n\t\t\t\t$this->render('/features/uf_edit');\n\t\t}\n\t\t\n\t}", "public function edit($id)\n\t{\n\t\t$group = Group::find($id);\n\n\t\treturn View::make('groups.edit', compact('group'));\n\t}", "public function update(Request $request, $id)\n { \n\n $group = Group::find($id);\n $this->validate($request,[\n \"name\" => \"required\",\n \"description\"=>\"required\",\n ]);\n \n $group->name = $request->name;\n $group->description = $request->description;\n $group->save();\n // $post->tags()->sync($request->tags);\n return redirect()->route('groups.index');\n }", "public function update($id)\n\t{\n\t\t$group = Group::find($id);\n\n\t\tif( is_null($group) )\n\t\t{\n\t\t\treturn Redirect::to( 'group' );\n\t\t}\n\n\t\t$group->nombre = Input::get('nombre');\n\t\t$group->email = Input::get('email');\n\t\t$group->telefono = Input::get('telefono');\n\t\t$group->save();\n\t\treturn Redirect::to( 'group' );\n\t}", "public function updateGroup(ItemRequest $request,$id)\n {\n \n }", "public function edit(Group $group) {\n $companies = Company::all();\n return view('groups.edit', ['group' => $group, 'companies' => $companies]);\n }", "public function edit($id)\n {\n $group = Group::find($id);\n $groups = Group::all(); \n return view('groups.edit', compact('group','groups'));\n }", "public function actionUpdateGroup($name)\n\t{\n\t\t$authManager=Yii::app()->authManager;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['GroupPermissions']))\n\t\t{\n\t\t\t$selGroupPermissions = array_combine($_POST['GroupPermissions'],$_POST['GroupPermissions']);\n\n\t\t\tforeach($authManager->getAuthItems(CAuthItem::TYPE_OPERATION) as $perm) \n\t\t\t{\t\n\t\t\t\t//var_dump(isset($selGroupPermissions[$perm->name]));\n\t\t\t\t//var_dump(!$authManager->hasItemChild($name,$perm->name));\n\t\t\t\t//var_dump('----');\n\t\t\t\tif(isset($selGroupPermissions[$perm->name]) && !$authManager->hasItemChild($name,$perm->name)) {\n\t\t\t\t\t$authManager->addItemChild($name,$perm->name);\n\t\t\t\t\t//echo 'adding permission'.$perm->name;\n\t\t\t\t} else if(!isset($selGroupPermissions[$perm->name])) {\n\t\t\t\t\t$authManager->removeItemChild($name,$perm->name);\n\t\t\t\t\t//echo 'removing permission'.$perm->name;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->redirect(array('/user/groups'));\n\t\t}\n\n\t\t$this->layout='//layouts/column1';\n\t\t$this->render('update_group',array(\n\t\t\t'name'=>$name,\n\t\t\t'permissions'=>$authManager->getAuthItems(CAuthItem::TYPE_OPERATION),\n\t\t\t'groupPermissions'=>$authManager->getItemChildren($name),\n\t\t\t'tasks'=>$authManager->getAuthItems(CAuthItem::TYPE_TASK),\n\t\t));\n\t}", "public function edit($pGroup)\n {\n // Changes to be saved in the database.\n $changes = array(\n 'number' => $pGroup->getNumber()\n );\n\n $this->db->where('idGroup', $pGroup->getId());\n $query = $this->db->update($this->groupTable, $changes); // Update the values.\n\n if($query)\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "function _displayFormEditGroup($infos='')\n\t{\n\t\t$utd =& $this->_utd;\n\t\t$ut =& $this->_ut;\n\n\t\t$utpage = new utPage('draws');\n\t\t$utpage->_page->addAction('onload', array('changeDrawType'));\n\t\t$utpage->_page->addJavaFile('draws/draws.js');\n\t\t$content =& $utpage->getPage();\n\t\t$form =& $content->addForm('fdraws', 'draws', DRAW_GROUP_UPDATE);\n\t\t$form->setTitle('tEditGroup');\n\n\t\t// Display warning if exist\n\t\tif (isset($infos['errMsg'])) $form->addWng($infos['errMsg']);\n\n\t\t$round = kform::getData();\n\t\tlist($drawId, $groupName) = explode(';', $round);\n\t\t$infos = $utd->getDrawById($drawId);\n\t\t$infos['group'] = $groupName;\n\n\t\t$oGroup = new objgroup();\n\t\t$group = $oGroup->getGroup($drawId, $groupName);\n\n\t\t$form->addInfo('theDraw', $infos['draw_name']);\n\t\t$form->addInfo('drawPairs', $infos['draw_nbPairs']);\n\t\t$form->addInfo('groupName', $infos['group']);\n\n\t\t// Initialize the field\n\t\t$form->addHide(\"drawId\", $drawId);\n\t\t$form->addHide(\"drawName\", $infos['draw_name']);\n\t\t$form->addHide('drawNbPairs', $infos['draw_nbPairs']);\n\t\t$form->addHide('group', $infos['group']);\n\n\t\t$actions = array( 1 => array('changeDrawType'));\n\t\t$types = array(WBS_GROUP => $ut->getLabel(WBS_GROUP),\n\t\tWBS_QUALIF => $ut->getLabel(WBS_QUALIF),\n\t\tWBS_KO => $ut->getLabel(WBS_KO),\n\t\tWBS_CONSOL => $ut->getLabel(WBS_CONSOL),\n\t\t);\n\t\t$kcombo =& $form->addCombo(\"drawType\", $types, $group['type']);\n\t\t$kcombo->setActions($actions);\n\t\t$kedit =& $form->addEdit('rundFinalPlace', $group['rund_rge'], 3);\n\t\t$kedit->setMaxLength(3);\n\t\t$form->addCheck('drawThird', $group['third']);\n\t\t$form->addBlock(\"blkThird\", 'drawThird');\n\n\t\t$elts=array('theDraw', 'drawPairs', 'groupName', 'drawType', 'rundFinalPlace', 'blkThird');\n\t\t$form->addBlock(\"blkOne\", $elts);\n\n\t\t$kedit =& $form->addEdit('drawNbp3', $group['nb3'], 2);\n\t\t$kedit->setMaxLength(2);\n\t\t$kedit =& $form->addEdit('drawNbs3', $group['nbs3'], 2);\n\t\t$kedit->setMaxLength(1);\n\t\t$kedit =& $form->addEdit('drawNbp4', $group['nb4'], 2);\n\t\t$kedit->setMaxLength(2);\n\t\t$kedit =& $form->addEdit('drawNbs4', $group['nbs4'], 2);\n\t\t$kedit->setMaxLength(1);\n\t\t$kedit =& $form->addEdit('drawNbp5', $group['nb5'], 2);\n\t\t$kedit->setMaxLength(2);\n\t\t$kedit =& $form->addEdit('drawNbs5', $group['nbs5'], 2);\n\t\t$kedit->setMaxLength(1);\n\t\t$kedit =& $form->addEdit('drawNbSecond', $group['nbsecond'], 2);\n\t\t$kedit->setMaxLength(1);\n\t\t$elts=array('drawNbp3', 'drawNbs3', 'drawNbp4', 'drawNbs4',\n \t\t\t\t\t'drawNbp5', 'drawNbs5', 'drawNbSecond');\n\t\t$form->addBlock('blkGroup', $elts);\n\t\t$infos['draw_nbpl'] = intval($infos['draw_nbPairs']);\n\t\t$kedit =& $form->addEdit('drawNbpl', $group['nbPlace'], 3);\n\t\t$kedit->setMaxLength(3);\n\t\t$kedit =& $form->addEdit('drawNbplq', 0, 3);\n\t\t$kedit->setMaxLength(3);\n\t\t$kedit =& $form->addEdit('drawNbq', $group['nbQ'], 3);\n\t\t$kedit->setMaxLength(2);\n\t\t//$kedit =& $form->addEdit('drawNbcons', $infos['draw_nbq'], 3);\n\t\t//$kedit->setMaxLength(3);\n\t\t$elts=array('drawNbpl', 'drawNbplq', 'drawNbq');\n\t\t$form->addBlock('blkKo', $elts);\n\n\t\t$form->addDiv('break', 'blkNewPage');\n\t\t$form->addBtn('btnRegister', KAF_SUBMIT);\n\t\t$form->addBtn('btnCancel');\n\t\t$elts=array('btnRegister', 'btnCancel');\n\t\t$form->addBlock('blkBtn', $elts);\n\n\t\t//Display the form\n\t\t$utpage->display();\n\t\texit;\n\t}", "public function edit($id)\n {\n //\n $group = Group::find($id);\n\n return view('groups.edit')->with('group',$group);\n }", "public function edit(Request $request,$id, Group $group)\n {\n $message = 'Edit your article '.$id;\n $article = Group::find($id);\n return view('edit',['message' => $message, 'group' =>$group]);\n }", "public function group_edit($id)\n { \n \n $group_edit = DB::table('tb_groups')->where('id',$id)->first(['id','group_name','remarks','group_leader_id','status']);\n return response()->json($group_edit);\n }", "public function edit(Group $group)\n {\n return view('backend.groups.update', compact('group'));\n }", "public function update($id)\n\t{\n\t\t//\n\t\t$groupUpdate = Request::only('group_name','group_code','group_description');\n $validate = Validator::make($groupUpdate,[\n 'group_name' => 'required|max:45',\n 'group_code' => 'required|unique:cep_groups,group_code,'.$id.',group_id|max:5',\n ]);\n\n if($validate->fails()){\n return redirect()->back()->withInput()->withErrors($validate->errors());\n }\n\t\t$group = CepGroups::where('group_id',$id)->first();\n\t\t$affectedRows = CepGroups::where('group_id','=',$id)->update($groupUpdate);\n\t\treturn redirect(\"groups\");\n\t}", "public function resetGroupEdit()\n {\n $this->editGroupId = null;\n }", "public function editGroup(AffinityGroupModel $group, ILoggerService $logger){\n \n $logger->info(\"Entering AffinityGroupService.editGroup()\");\n\n //Get a connection to the database\n $connection = new Connection();\n \n //Create an instance of the dao\n $DAO = new AffinityGroupDAO($connection, $logger);\n \n //Store the results of the dao method call\n $results = $DAO->edit($group);\n \n $connection = null;\n \n $logger->info(\"Exiting AffinityGroupService.editGroup()\");\n \n return $results;\n }", "public function editUserGroup($id)\n {\n\t if($this->validateUserGroup($id)=='true'){\n\t\t//This was checking for the administrators of the group so that in case one had already been assigned a group\n\t\t//then there would not be any need to return them to administer another group, but this design approach was dropped\n\t\t//and a user can now administer multiple groups\n\t\t$special_users=Company::find(Auth::User()->company_id)->hasUserGroups()->get();\n $groupAdmins[]='';\n for($i=0; $i<count($special_users); $i++){\n $groupAdmins[]=$special_users[$i]->administrator;\n }\n\t\t\n\t\t$group = User_Group::find($id);\n\t\t\n\t\t$administratorUser = DB::table('users')->where('id',$group->administrator)->first();\n\t\t\n\t\t\n $administrators = DB::table('users')\n\t\t\t\t\t\t\t->join('role_user','role_user.user_id','=','users.id')\n\t\t\t\t\t\t\t->where('company_id',Auth::User()->company_id)\n\t\t\t\t\t\t\t->where('role_user.role_id','=',2)\n\t\t\t\t\t\t\t->orderByRaw(\"CASE WHEN users.name='$administratorUser->name' THEN -1 ELSE users.name END\")\n\t\t\t\t\t\t\t->lists('users.name','users.id');\n\t\t\t\t\t\t\t\n\t\t//This returns the group members\n\t\t$members = DB::select(DB::raw(\n \"select users.id as user_id, users.name, users.email from users\n\t\t\t\t\t\t\t\tjoin role_user on role_user.user_id = users.id\n\t\t\t\t\t\t\t\twhere users.id in (select user_in_groups.user_id from user_in_groups \n\t\t\t\t\t\t\t\twhere user_in_groups.user_group_id = :groupId) and role_user.role_id != 1 and users.company_id = :companyId\"),\n array(\"groupId\"=>$id,\"companyId\"=>Auth::User()->company_id));\n\n\t\t\t\t\t\t\t\n\t\t//This returns all users that are not in this group\n\t\t$users = DB::select(DB::raw(\n \"select users.id as user_id, users.name, users.email from users\n\t\t\t\t\t\t\t\tjoin role_user on role_user.user_id = users.id\n\t\t\t\t\t\t\t\twhere users.id not in (select user_in_groups.user_id from user_in_groups \n\t\t\t\t\t\t\t\twhere user_in_groups.user_group_id = :groupId) and role_user.role_id != 1 and users.company_id = :companyId\"),\n array(\"groupId\"=>$id,\"companyId\"=>Auth::User()->company_id));\n\t\t\n return view('usergroup.editAdmin')\n\t\t\t\t\t\t->with('administrators',$administrators)\n\t\t\t\t\t\t->with('group',$group)\n\t\t\t\t\t\t->with('users',$users)\n\t\t\t\t\t\t->with('members',$members);\n\n }else{\n return view('errors.404')->with('title',' User group not found. ')\n ->with('message','The group you requested does not belong to your company.');\n }\n }", "public function edit($id)\n {\n $group = Group::find($id);\n $contacts = Auth::user()->contacts()->with('user')->paginate(10);\n $added_contacts = Auth::user()->groups()->find($id)->users()->paginate(10);\n\n if ($group == null) {\n return redirect('/groups')->with('error', __('error.unauthorized_page'));\n }\n\n if ($group->user_id != Auth::id()) {\n return redirect('/groups')->with('error', __('error.unauthorized_page'));\n }\n\n return view('groups.edit')->with('group', $group)->with('contacts', $contacts)->with('added_contacts', $added_contacts);\n }", "function set_userGroup($data, $oldId){\n $data_user = array();\n $data_group = array();\n $data_user['id'] = $data['id'];\n $data_user['username'] = $data['username'];\n $data_user['password'] = $data['password'];\n $data_user['email'] = $data['email'];\n\n $group = $data['group'];\n $data['group'] = selectRecord(TAB_GROUPS, \"role = '$group'\")['id'];\n $data_group['userId'] = $data['id'];\n $data_group['groupId'] = $data['group'];\n\n updateRecord(TAB_USR_ROLE, $data_group, \"userId = $oldId\");\n updateRecord(TAB_USERS, $data_user, \"id = $oldId\");\n $data_info = array();\n if($data['group'] == 1){\n $data_info = array();\n $data_info['employment'] = \"-\";\n $data_info['img_address'] = \"upload/user/user-default.png\";\n $data_info['user'] = $data['id'];\n insertRecord(TAB_PERSONALINFO, $data_info);\n }\n}", "public function edit($id) {\n\t\t$group = AdminGroup::findOrFail($id);\n\t\t$curentUsers = $group->users()->lists('user_id');\n\t\t$users = AdminUser::getLists('last_name');\n\t\treturn View::make('admin.groups.edit', array(\n\t\t\t\t\t'group' => $group,\n\t\t\t\t\t'users' => $users,\n\t\t\t\t\t'curentUsers' => $curentUsers\n\t\t));\n\t}", "public function edit($id)\n {\n //Get group\n $data = $this->Service->getDetail($id);\n $layoutData['js_plugin'] = $this->getJsPlugin([\"JSP_BOOTSTRAP_BOOTBOX\"]);\n $layoutData['userType'] = config(\"dashboard_constant.USER_TYPE\");\n $layoutData['userStatus'] = config(\"dashboard_constant.USER_STATUS\");\n $layoutData['title'] = 'Group List | '.config(\"app.name\");\n $layoutData['breadcrumb'] = [\n \"links\" => [\n [\n \"name\" => \"Group\",\n \"url\" => url(\"#/group-list\"),\n \"icon\" => \"flaticon-list-1\"\n ]\n ]\n ];\n $layoutData['data'] = $data;\n return response()->json($layoutData); \n }", "public function editarGrupoController()\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t{\n\t\t\t\t$datosController = $_GET[\"id\"];\n\t\t\t\t$respuesta = Datos::editarGrupoModel($datosController, \"grupo\");\n\t\t\t\t//Se crea un formulario que contendra los datos de los grupos en base a su id\n\t\t\t\techo'<div class=\"card card-success\">\n \t\t\t<div class=\"card-header\">\n \t\t\t<h3 class=\"card-title\">Editar Producto</h3>\n \t\t\t</div>\n \t\t\t<div class=\"card-body\">\n \t\t\t\t<input name=\"idEditar\" class=\"form-control form-control-lg\" type=\"hidden\" placeholder=\".input-lg\" value = \"'.$respuesta[\"id_grupo\"].'\">\n \t\t\t\t<br>\n \t\t\t<input name=\"nombreEditar\" class=\"form-control form-control-lg\" type=\"text\" placeholder=\".input-lg\" value = \"'.$respuesta[\"nombre_grupo\"].'\">\n \t\t\t<br>\n \t\t\t <button type=\"submit\" name=\"btn_actualizar\" id=\"btn\" class=\"btn btn-block btn-outline-primary\" onclick=\"confirmarUpdate();\" style=\"float:right;\">Guardar cambios</button>\n \t\t\t</div>\n \t\t</div>';\n\t\t\t}\n\n\t\t}", "function ProductGroupEdit()\n {\n // loading the prototypes of form fields\n loadCoreFile('html_form.php');\n\n // getting the list of attributes to show\n $settings = modApiFunc('Settings', 'getParamListByGroup',\n 'PRODUCT_GROUP_EDIT', SETTINGS_WITH_DESCRIPTION);\n $this -> _attrs = array('ID' => 'YES');\n if (is_array($settings))\n foreach($settings as $v)\n {\n if ($v['param_name'] == 'CTL_PGE_TABULATION')\n $this -> _tabbing = $v['param_current_value'];\n elseif ($v['param_current_value'] == 'YES')\n $this -> _attrs[$v['param_name']] = 'YES';\n }\n\n // initializing the template filler\n $this -> mTmplFiller = new TmplFiller();\n\n // filling the headermap\n $this -> _headermap = array(\n 'ID' => 'PRD_ID_NAME',\n 'CTL_PGE_NAME' => 'PRD_NAME_NAME',\n 'CTL_PGE_SALEPRC' => 'PRD_SALEPRC_NAME',\n 'CTL_PGE_LISTPRC' => 'PRD_LISTPRC_NAME',\n 'CTL_PGE_QUINSTOCK' => 'PRD_QUINSTOCK_NAME',\n 'CTL_PGE_LOWLEV' => 'PRD_LOWLEV_NAME',\n 'CTL_PGE_SKU' => 'PRD_SKU_NAME',\n 'CTL_PGE_QUINORDER' => 'PRD_QUINORDER_NAME',\n 'CTL_PGE_AVAIL' => 'PRD_AVAIL_NAME',\n 'CTL_PGE_TAXCLASS' => 'PRD_TAX_CLASS_NAME',\n 'CTL_PGE_MANUFACTURER' => 'PRD_MANUFACTURER_NAME',\n 'CTL_PGE_SHIPPRC' => 'PRD_SHIPPRC_NAME',\n 'CTL_PGE_HANDPRC' => 'PRD_HANDRC_NAME',\n 'CTL_PGE_WEIGHT' => 'PRD_WEIGHT_NAME',\n 'CTL_PGE_FREESHIP' => 'PRD_FREESHIP_NAME',\n 'CTL_PGE_NEEDSHIP' => 'PRD_NEEDSHIP_NAME',\n 'CTL_PGE_CUSTOMER_REVIEWS' => 'PRD_CUSTOMER_REVIEWS_NAME'\n );\n\n // filling the attribute map\n $this -> _attrmap = array(\n 'ID' => 'ID',\n 'CTL_PGE_NAME' => 'Name',\n 'CTL_PGE_SALEPRC' => 'SalePrice',\n 'CTL_PGE_LISTPRC' => 'ListPrice',\n 'CTL_PGE_QUINSTOCK' => 'QuantityInStock',\n 'CTL_PGE_LOWLEV' => 'LowStockLevel',\n 'CTL_PGE_SKU' => 'SKU',\n 'CTL_PGE_QUINORDER' => 'MinQuantity',\n 'CTL_PGE_AVAIL' => 'Available',\n 'CTL_PGE_TAXCLASS' => 'TaxClass',\n 'CTL_PGE_MANUFACTURER' => 'Manufacturer',\n 'CTL_PGE_SHIPPRC' => 'PerItemShippingCost',\n 'CTL_PGE_HANDPRC' => 'PerItemHandlingCost',\n 'CTL_PGE_WEIGHT' => 'Weight',\n 'CTL_PGE_FREESHIP' => 'FreeShipping',\n 'CTL_PGE_NEEDSHIP' => 'NeedShipping',\n 'CTL_PGE_CUSTOMER_REVIEWS' => 'CustomerReviews'\n );\n }" ]
[ "0.84694797", "0.84694797", "0.84694797", "0.8136598", "0.80554223", "0.8002514", "0.7860815", "0.7849915", "0.78409374", "0.78090525", "0.77199185", "0.76909316", "0.7688311", "0.7652101", "0.75921005", "0.75480497", "0.754174", "0.75253904", "0.7496925", "0.7495695", "0.74671394", "0.74670035", "0.74455386", "0.74442124", "0.73257786", "0.7321365", "0.73059386", "0.7300684", "0.7297584", "0.7281838", "0.72812104", "0.7253426", "0.7240726", "0.71895754", "0.71895754", "0.71895754", "0.7179326", "0.7161845", "0.7159573", "0.71582013", "0.71538806", "0.7153501", "0.71530354", "0.71476966", "0.71331227", "0.7125923", "0.71219385", "0.7119655", "0.7118434", "0.7072399", "0.70671976", "0.70590407", "0.70561695", "0.6998683", "0.6944925", "0.6943034", "0.6940343", "0.69320315", "0.68905866", "0.6890345", "0.68884504", "0.6882271", "0.6875076", "0.68689674", "0.6859949", "0.6858243", "0.6854135", "0.6853531", "0.6852312", "0.6849372", "0.68340904", "0.6830909", "0.6823188", "0.68157643", "0.68063766", "0.680551", "0.6805127", "0.6802663", "0.68025064", "0.6796683", "0.6795387", "0.67953837", "0.6791565", "0.67770004", "0.67756796", "0.6768343", "0.67610323", "0.67591053", "0.67540836", "0.6752715", "0.67524165", "0.6750272", "0.674062", "0.6739889", "0.67305475", "0.6701395", "0.6699788", "0.66984266", "0.66954505", "0.66930616", "0.6688368" ]
0.0
-1
add marker linefeeds to aid the prettytokeniser (adds a linefeed between all tagend boundaries)
function formatXmlString($xml) { $xml = preg_replace('/(>)(<)(\/*)/', "$1\n$2$3", $xml); // now indent the tags $token = strtok($xml, "\n"); $result = ''; // holds formatted version as it is built $pad = 0; // initial indent $matches = array(); // returns from preg_matches() // scan each line and adjust indent based on opening/closing tags while ($token !== false) : // test for the various tag states // 1. open and closing tags on same line - no change if (preg_match('/.+<\/\w[^>]*>$/', $token, $matches)) : $indent = 0; // 2. closing tag - outdent now elseif (preg_match('/^<\/\w/', $token, $matches)) : $pad--; // 3. opening tag - don't pad this one, only subsequent tags elseif (preg_match('/^<\w[^>]*[^\/]>.*$/', $token, $matches)) : $indent = 1; // 4. no indentation needed else : $indent = 0; endif; // pad the line with the required number of leading spaces $line = str_pad($token, strlen($token) + $pad, ' ', STR_PAD_LEFT); $result .= $line . "\n"; // add to the cumulative result, with linefeed $token = strtok("\n"); // get the next token $pad += $indent; // update the pad size for subsequent lines endwhile; return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function linebreak() {\n $this->doc .= '<br/>'.DOKU_LF;\n }", "function lineFeed(&$fp) {\n\n fwrite($fp, chr(10));\n }", "private function _format_lines($tokensource)\n\t{\n $nocls = $this->noclasses;\n $lsep = $this->lineseparator;\n // for <span style=\"\"> lookup only\n $getcls = &$this->ttype2class;\n $c2s = &$this->class2style;\n \n $lspan = '';\n $line = '';\n foreach($tokensource as $ttype => $value) {\n if($nocls) {\n $cclass = $getcls[$ttype];\n $i = 0;\n while(is_null($cclass)) {\n $ttype = Token::getToken($ttype)->parent;\n $cclass = $getcls[\"$ttype\"];\n\n if($i>=10) break;\n $i++;\n }\n $cspan = $cclass ? sprintf('<span style=\"%s\">', $c2s[$cclass][0]) : '';\n } else {\n $cls = $this->_get_css_class($ttype);\n $cspan = $cls ? sprintf('<span class=\"%s\">', $cls) : '';\n \n\t\t\t}\n\t\t\t$parts = htmlspecialchars($value, ENT_QUOTES);\n\t\t\t$parts = explode(\"\\n\", $parts);\n\t\t\t\n\t\t\t$part_last = array_pop($parts);\n\t\t\t\n\t\t\t// Weiler: ZERO bug, $part = '0'; we need to use !=''\n\t\t\t\n\t\t\t// for all but the last line\n\t\t\tforeach($parts as $part) {\n if($line!='') {\n if($lspan != $cspan) {\n $line .= ($lspan ? '</span>' : '') . $cspan . $part .\n ($cspan ? '</span>' : '') . $lsep;\n } else { // both are the same\n $line .= $part . ($lspan ? '</span>' : '') . $lsep;\n }\n yield [1, $line];\n $line = '';\n } elseif($part!='') {\n yield [1, $cspan . $part . ($cspan ? '</span>' : '') . $lsep];\n } else {\n yield [1, $lsep];\n }\n\t\t\t}\n // for the last line\n\t\t\tif($line!='' && $part_last!='') {\n if($lspan != $cspan) {\n $line .= ($lspan ? '</span>' : '') . $cspan . $part_last;\n $lspan = $cspan;\n } else {\n $line .= $part_last;\n }\n\t\t\t} elseif($part_last!='') {\n $line = $cspan . $part_last;\n $lspan = $cspan;\n\t\t\t}\n // else we neither have to open a new span nor set lspan\n }\n \n if($line!='') {\n \tyield [1, $line . ($lspan ? '</span>' : '') . $lsep];\n }\n\n\t}", "private function makeLines()\n\t{\n\t\t$line = 1;\n\t\t/** @var Token $token */\n\t\tforeach ($this->tokens as $token)\n\t\t{\n\t\t\t$token->line = $line;\n\t\t\tif (preg_match_all(\"/\\\\n/\", $token->text, $m))\n\t\t\t{\n\t\t\t\t$line += count($m[0]);\n\t\t\t}\n\t\t}\n\t}", "protected function getNL() {\n return PHP_EOL . PHP_EOL;\n }", "private function _wrap_inlinelinenos($inner)\n\t{\n $lines = $inner;\n $sp = $this->linenospecial;\n $st = $this->linenostep;\n $num = $this->linenostart;\n $mw = strlen((string)(count($lines) + $num - 1));\n $mw = str_repeat(' ', $mw);\t\n\n if($this->noclasses) {\n if($sp) {\n\t\t\t\tforeach($lines as $llines) {\n\t\t\t\t\tlist($t, $line) = $llines;\n if($num%$sp == 0) {\n $style = 'background-color: #ffffc0; padding: 0 5px 0 5px';\n } else {\n $style = 'background-color: #f0f0f0; padding: 0 5px 0 5px';\n\t\t\t\t\t}\n yield [1, sprintf('<span style=\"%s\">%s%s</span> ', \n $style, $mw, ($num%$st ? ' ' : $num)) . $line];\n $num += 1;\n\t\t\t\t}\n } else {\n\t\t\t\tforeach($lines as $llines) {\n\t\t\t\t\tlist($t, $line) = $llines;\n yield [1, sprintf('<span style=\"background-color: #f0f0f0; ' .\n 'padding: 0 5px 0 5px\">%s%s</span> ', \n $mw, ($num%$st ? ' ' : $num)) . $line];\n $num += 1;\n\t\t\t\t}\n\t\t\t}\n } elseif($sp) {\n\t\t\tforeach($lines as $llines) {\n\t\t\t\tlist($t, $line) = $llines;\n yield [1, sprintf('<span class=\"lineno%s\">%s%s</span> ',\n ($num%$sp == 0 ? ' special' : ''), $mw,\n ($num%$st ? ' ' : $num)) . $line];\n $num += 1;\n\t\t\t}\n } else {\n\t\t\tforeach($lines as $llines) {\n\t\t\t\tlist($t, $line) = $llines;\n yield [1, sprintf('<span class=\"lineno\">%s%s</span> ',\n $mw, ($num%$st ? ' ' : $num)) . $line];\n $num += 1;\t\n\t\t\t}\n\t\t}\n\t}", "function htmlSeparator(){\n\treturn \"\\n\\n<br/><hr/>\\n<!-- ----------------------------------------------->\\n\\n\";\n}", "public static function addNewLineBetweenAnnotations(bool $should = true): void\n {\n static::$shouldAddNewLineBetweenAnnotations = $should;\n }", "protected function new_line()\n {\n }", "public function addSeparator()\n\t{\n\t\t$this->body .= '<hr>';\n\t\treturn $this;\n\t}", "public function getLineEndingStyles() {}", "public function getLineEndingStyles() {}", "private function terminateLine()\n {\n if ($this->isInline) {\n $this->isInline = false;\n $this->writeToFile('<br>');\n }\n }", "public function wktGenerateMultilinestring();", "private function setNewLine() {\n $extension = pathinfo($this->path, PATHINFO_EXTENSION);\n if ($extension === Lexer::LINUX_FILE_EXTENSION) {\n $this->newLine = \"\\n\";\n } else {\n $this->newLine = \"\\r\\n\";\n }\n }", "public function enableRemoveLineBreaksFromTemplate() {}", "function __replaceWithNewlines() {\n\t\t$args = func_get_args();\n\t\t$numLineBreaks = count(explode(\"\\n\", $args[0][0]));\n\t\treturn str_pad('', $numLineBreaks - 1, \"\\n\");\n\t}", "public function setLineEndingStyle($lineEndingStyle) {}", "private function add_new_line() {\n\n\t\t$this->fields[] = array( 'newline' => true );\n\n\t}", "public function cleanMarkings()\n\t{\n\t\t$cleanMarkings=\"\";\n\t\tfor ($i=0;$i<count($this->tokens);++$i)\n\t\t{\n\t\t\t$c=$this->tokens[$i]['type'][0];\n\t\t\tif ($this->tokens[$i]['type']=='symbol')\n\t\t\t\t$c=\"@\";\n\t\t\t$cleanMarkings.=str_repeat($c, strlen($this->tokens[$i]['clean'])).\" \";\n\t\t\tif ($c=='c') //single line comment\n\t\t\t\t$cleanMarkings=substr($cleanMarkings,0,-1).\"\\n \";\n\t\t}\n\t\treturn $cleanMarkings;\n\t}", "function addSeperator() {\n $this->addSeparator();\n }", "function tagins($stuffing) {\n return \"<\".$stuffing.\">\".PHP_EOL;\n }", "public function getLineEndingStyle() {}", "public function ln()\n {\n $this->entries[] = '';\n }", "public static function lineBreakCorrectlyTransformedOnWayToRteProvider() {}", "function add_br(&$output)\n{\n\t$output = preg_replace(\"~\\n~\", \"<br />\\n\", $output);\n}", "function wploop_change_separator()\n{\nreturn '|';\n}", "public function getNewline(): string;", "function infy_nl($count = 1)\n {\n return str_repeat(PHP_EOL, $count);\n }", "private function add_next_line($content) {\r\n\t\treturn $content . \"\\n\";\r\n\t}", "public function newLine() {\n\t\t$this->_section=0;\n\t\t$this->_lineNumber++;\n\t\t$this->_text[$this->_lineNumber]=array();\n\t\t$this->_text[$this->_lineNumber][0]['text']='';\n\t\t$this->_text[$this->_lineNumber][0]['encoding']='';\n\t\t$this->_text[$this->_lineNumber][0]['font']=$this->_font;\n\t\t$this->_text[$this->_lineNumber][0]['fontSize']=$this->_fontSize;\n\t\t$this->_text[$this->_lineNumber][0]['width']=0;\n\n\t\t\n\t\t$this->_initializeLine();\n\t\t\n\t\t$this->_text[$this->_lineNumber]['alignment']=$this->_text[$this->_lineNumber-1]['alignment'];\n\t\t//add the last cell's height to the auto height if we have an auto-height box.\n\t\tif ($this->isAutoHeight()) {\n\t\t\t$this->_autoHeight+=$this->_text[$this->_lineNumber-1]['height'];\n\t\t}\n\t}", "protected function lineBreak() {\n\n return PHP_EOL;\n }", "function mEOL(){\n try {\n // Tokenizer11.g:622:3: ( '\\\\n' | '\\\\r' ) \n // Tokenizer11.g: \n {\n if ( $this->input->LA(1)==$this->getToken('10')||$this->input->LA(1)==$this->getToken('13') ) {\n $this->input->consume();\n\n }\n else {\n $mse = new MismatchedSetException(null,$this->input);\n $this->recover($mse);\n throw $mse;}\n\n\n }\n\n }\n catch(Exception $e){\n throw $e;\n }\n }", "private static function highlightSegment( $offset, $token_length ) {\n\t\t$max_expression_length = 60;\n\n\t\t$truncated = substr(\n\t\t\tself::$expression_string,\n\t\t\tmax( 0, $offset - ( $max_expression_length / 2 ) ), $max_expression_length\n\t\t);\n\n\t\tif ( strlen( $truncated ) < strlen( self::$expression_string ) ) {\n\t\t\t$truncated .= \"...\";\n\t\t}\n\n\t\tif ( $offset > ( $max_expression_length / 2 ) ) {\n\t\t\t$truncated = \"...\" . $truncated;\n\n\t\t\t// +3 because we add three dots.\n\t\t\t$offset = $offset - ( $offset - ( $max_expression_length / 2 ) ) + 3;\n\t\t}\n\n\t\tif ( $offset + $token_length > strlen( $truncated ) ) {\n\t\t\t$token_length = strlen( $truncated ) - $offset;\n\t\t}\n\n\t\treturn \"<pre>1|&nbsp;\" . str_replace( \" \", \"&nbsp;\", htmlspecialchars( $truncated ) ) . \"\\n\" .\n\t\t\tstr_repeat( \"&nbsp;\", $offset + 3 ) .\n\t\t\tstr_repeat( \"^\", $token_length ) .\n\t\t\t\"</pre>\";\n\t}", "public function eol()\n {\n return current($this->tokens)? false:true;\n\n }", "function mSEMICOLON(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$SEMICOLON;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:638:3: ( ';' ) \n // Tokenizer11.g:639:3: ';' \n {\n $this->matchChar(59); \n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "function addSeparator() {\n if (is_array($this->toolbar) && count($this->toolbar) > 0) {\n $last = end($this->toolbar);\n if (isset($last) && is_array($last)) {\n if ($last[0] != '-') {\n $this->toolbar[] = array('-', '<seperator/>');\n }\n }\n }\n }", "public function test_linebreaks_removed() {\n\n\t\t$this->assertStringMatchesFormat(\n\t\t\t'%s'\n\t\t\t, $this->export_data['classes'][0]['doc']['long_description']\n\t\t);\n\t}", "protected function lineBreaks() {\n\t\t$this->text = $this->removeUnneccesaryLinebreaks($this->text);\n\t\t$this->text = nl2br($this->text);\n\t\tReturn $this;\n\t}", "protected function linear_whitespace()\n {\n }", "public function eol()\n {\n $this->result .= PHP_EOL;\n return $this;\n }", "public function __construct()\n {\n parent::__construct();\n $this->setSeparator(PHP_EOL);\n }", "function lineBreak()\r\n {\r\n // have a $count parameter because of speed issues.\r\n return self::$lineBreak;\r\n }", "function fix_newlines($text) {\n\n#return str_replace('&#xD;', '', $text);\nreturn str_replace(\"\\r\", \"\", $text);\n\n}", "function tep_convert_linefeeds($from, $to, $string) {\n if ((PHP_VERSION < \"4.0.5\") && is_array($from)) {\n return ereg_replace('(' . implode('|', $from) . ')', $to, $string);\n } else {\n return str_replace($from, $to, $string);\n }\n }", "function separator() {\n echo \"<br>\\n<hr>\";\n }", "function AddAnnotation($str) {\r\n $this->RenderAnnotation($str);\r\n $this->Ln(7); // a little padding between lines\r\n }", "function br2line($item) {\n\t\treturn preg_replace('/<br[^>]*>/i', ' ', $item);\n\t}", "abstract protected function getTokenSeparators() : array;", "function xml_end_functions($dir, $k, &$xml, $prepinace){\n \n $newline = \"\";\n if($prepinace[\"pretty\"]){\n $newline = \"\\n\"; \n }\n \n $xml .= \"</functions>\".$newline;\n}", "function _autop_newline_preservation_helper($matches)\n {\n }", "public function setLineEndingStyles($first, $last) {}", "public function setLineEndingStyles($first, $last) {}", "public function nl() {\n $this->contexts[$this->current][self::TEXT] .= \"\\n\";\n return $this;\n }", "public function getRemoveLineBreaksFromTemplate() {}", "function fix_eol($r){\n\t\t$r = str_replace(\"\\r\\n\", \"\\n\", $r);\n\t\t$r = str_replace(\"\\r\", \"\\n\", $r);\n\t\t$t = str_replace(\"\\n\", $this->eol, $r);\n\t\treturn $r;\n\t}", "public function formatAnnotate(){\r\n\t\tforeach($this->template as $k=>$v){\r\n\t\t\tif(preg_match('/{\\s+\\*/', $v, $matches)){\r\n\t\t\t\t$this->include_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Annotate format error: The blank is not allowed with \\'{\\' near '.$matches[0].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t\tif(preg_match('/\\*\\s+}/', $v, $matches)){\r\n\t\t\t\t$this->include_lines = ($k+1);\r\n\t\t\t\t$this->error_notice[($k+1)] = 'Annotate format error: The blank is not allowed with \\'}\\' near '.$matches[0].' in '.$this->template_file.$this->template_postfix.' on line '.($k+1);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function showEnd( $appctx )\n\t{\n\t\t$appctx->Indent() ; echo( \"</span>\\n\") ;\n\t\t$appctx->Moins() ;\n\t}", "public function typoSearchTagsHandlesMultipleMarkerPairs() {}", "function line_break_shortcode() {\n\treturn '<br />';\n}", "private function _highlight_lines($inner) {\n\t\t$hls = $this->hl_lines;\n\t\t\n\t\tforeach ( $inner as $i => $iinner ) {\n\t\t\tlist ( $t, $value ) = $iinner;\n\t\t\tif ($t != 1) {\n\t\t\t\tyield [ \n\t\t\t\t\t\t$t,\n\t\t\t\t\t\t$value \n\t\t\t\t];\n\t\t\t}\n\t\t\tif (in_array ( $i + 1, $hls )) { // i + 1 because indexes start at 0\n\t\t\t\tif ($this->noclasses) {\n\t\t\t\t\t$style = '';\n\t\t\t\t\tif ($this->style->highlight_color) {\n\t\t\t\t\t\t$style = sprintf ( ' style=\"background-color: %s\"', $this->style->highlight_color );\n\t\t\t\t\t}\n\t\t\t\t\tyield [ \n\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\tsprintf ( '<span%s>%s</span>', $style, $value ) \n\t\t\t\t\t];\n\t\t\t\t} else {\n\t\t\t\t\tyield [ \n\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\tsprintf ( '<span class=\"hll\">%s</span>', $value ) \n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tyield [ \n\t\t\t\t\t\t1,\n\t\t\t\t\t\t$value \n\t\t\t\t];\n\t\t\t}\n\t\t}\n\t}", "public function testRenderNewlines() {\n\t\t$result = $this->View->render('newlines');\n\t\t$expected = \"There should be a newline about here: \\n\";\n\t\t$expected .= \"And this should be on the next line.\\n\";\n\t\t$expected .= \"\\n\";\n\t\t$expected .= \"There should be a single new line after this\\n\";\n\n\t\t$this->assertSame(\n\t\t\t$expected,\n\t\t\t$result,\n\t\t\t'Tags at the end of a line should not swallow new lines when rendered',\n\t\t);\n\t}", "function end_lvl(&$output, $depth = 0, $args = array()) {\n\t\t $output .= \"</span>\";\n\t\t}", "public static function tag_page_break() {\n\t//--\n\treturn '<!-- PAGE BREAK -->';\n\t//--\n}", "public function addSeparator() {\n $this->items[] = self::SEPARATOR;\n }", "function pun_linebreaks2($str)\r\n{\r\n\treturn str_replace(\"\\r\", \"\\n\", str_replace(\"\\r\\n\", \"<br>\", $str));\r\n}", "public function testMissingNewLineCharException()\r\n\t{\r\n\t\tnew Delimiters(\"//abcde1abcde2\");\r\n\t}", "function &nl2Br( $text ) {\n $text = preg_replace( \"/(\\015\\012)|(\\015)|(\\012)/\", \"<br />\", $text );\n return $text;\n }", "public function disableRemoveLineBreaksFromTemplate() {}", "function olc_convert_linefeeds($from, $to, $string) {\n\tif ((PHP_VERSION < \"4.0.5\") && is_array($from)) {\n\t\treturn ereg_replace('(' . implode('|', $from) . RPAREN, $to, $string);\n\t} else {\n\t\treturn str_replace($from, $to, $string);\n\t}\n}", "protected function deleteNewLines()\r\n {\r\n if (isset($this->data['event'])) {\r\n $this->data['event'] = str_replace(\"\\r\", '', $this->data['event']);\r\n $this->data['event'] = str_replace(\"\\n\", '', $this->data['event']);\r\n }\r\n }", "function convertlinebreaks ($str) {\r\n return preg_replace (\"/\\015\\012|\\015|\\012/\", \"\\n\", $str);\r\n}", "public function newLineWritten();", "protected function _outln($text = null, $num = 1, $replace = null)\n {\n $text .= PHP_EOL;\n $this->_out($text, $num, $replace);\n }", "protected function blockDelimiter()\n {\n return '';\n }", "private function makeLineBreaksHTML(): void {\n\t\t$this->setMsg(str_replace([PHP_EOL, '\\r\\n'], '<br />', $this->getMsg()));\n\n\t\tif($this->getMaxLineLength()) {\n\t\t\t$this->setMsg(wordwrap($this->getMsg(), $this->getMaxLineLength(), '<br />' . PHP_EOL));\n\t\t}\n\t}", "public function setLineDelimiter($delim) {\n $this->lineDelim= $delim; // could be more than one character\n }", "function FormatWithPrefixString( &$pContent, $pPutNewLine, $pFormattingSymbolsCount ){\n\tif( $pPutNewLine ){\n\t\t$pContent .= \"\\n\";\n\t}\n\t//~ var_dump($lPutFormattingSymbols);\n\tif( $pFormattingSymbolsCount < 0 ){//Ako trqbva da rejem simvoli ot teksta\n\t\t$pContent = mb_substr($pContent, 0, $pFormattingSymbolsCount);\n\t}else{//Ako trqbva da dobavqme simvoli\n\t\tfor( $i = 0; $i < $pFormattingSymbolsCount; ++$i)\n\t\t\t$pContent .= XML_FORMATTING_SYMBOL;\n\t}\n}", "public function lineThrough()\n {\n $this->label.= '9;';\n return $this;\n }", "public function __toString()\n {\n return implode(\"\\n\", $this->tokens);\n }", "function wkt_generate_multilinestring() {\n $start = $this->random_point();\n $num = $this->dd_generate(1, 3, TRUE);\n $lines[] = $this->wkt_generate_linestring($start);\n for ($i = 0; $i < $num; $i += 1) {\n $diff = $this->random_point();\n $start[0] += $diff[0] / 100;\n $start[1] += $diff[1] / 100;\n $lines[] = $this->wkt_generate_linestring($start);\n }\n return '(' . implode('), (', $lines) . ')';\n }", "private function inlineComment()\n {\n do {\n $this->next();\n if ($this->currentByte === \"\\n\" || $this->currentByte === \"\\r\") {\n $this->next();\n\n return;\n }\n } while ($this->currentByte !== null);\n }", "public function Header(){\n\t\t$this->lineFeed(10);\n\t}", "public function printTrailSpace()\n {\n fwrite($this->handle, self::TRAIL_SPACE);\n }", "function endTag($parser, $element) {\r\n echo \"<br />\";\r\n}", "function br2nl( $input ) {\n return preg_replace('/<br(\\s+)?\\/?>/i', \"\\n\", $input);\n}", "public function t_encapsed_and_whitespace($sTag) {\n\t\tif (! $this->inHereDoc) {\n\t\t\treturn PHP_Beautifier_Filter::BYPASS;\n\t\t}\n\t\t\n\t\t$lines = explode(\"\\n\", $sTag);\n\t\t$this->oBeaut->incIndent();\n\t\t\n\t\tforeach ($lines as $key => $line) {\n\t\t\t$line = str_replace('\\\\', '\\\\\\\\', $line);\n\t\t\t$line = str_replace('\"', '\\\\\"', $line);\n\t\t\t$this->oBeaut->add($line);\n\t\t\t\n\t\t\tif (isset($lines[$key + 1])) {\n\t\t\t\t// There is at least one more\n\t\t\t\t$this->oBeaut->add('\\\\n');\n\t\t\t\t\n\t\t\t\tif (isset($lines[$key + 2]) || $lines[$key + 1] != '') {\n\t\t\t\t\t$this->oBeaut->add('\" .');\n\t\t\t\t\t$this->oBeaut->addNewLineIndent();\n\t\t\t\t\t$this->oBeaut->add('\"');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->oBeaut->decIndent();\n\t}", "public function pad($newlines) {\n\t\tfor ($i = count($this->oBeaut->aOut) - 1; $i >= 0; $i --) {\n\t\t\t$cNow = &$this->oBeaut->aOut[$i];\n\t\t\t$cNow = rtrim($cNow);\n\t\t\t\n\t\t\tif (strlen($cNow) == 0) {\n\t\t\t\t// Delete it since it was only whitespace\n\t\t\t\tarray_pop($this->oBeaut->aOut);\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\twhile ($newlines --) {\n\t\t\t$this->oBeaut->addNewLineIndent();\n\t\t}\n\t}", "public function newLine()\n {\n echo \"\\n\";\n }", "public function nextLine($spacing = 1.0);", "protected function _format_newlines($str)\n\t{\n\t\tif ($str === '' OR (strpos($str, \"\\n\") === FALSE && ! in_array($this->last_block_element, $this->inner_block_required)))\n\t\t{\n\t\t\treturn $str;\n\t\t}\n\n\t\t// Convert two consecutive newlines to paragraphs\n\t\t$str = str_replace(\"\\n\\n\", \"</p>\\n\\n<p>\", $str);\n\n\t\t// Convert single spaces to <br /> tags\n\t\t$str = preg_replace(\"/([^\\n])(\\n)([^\\n])/\", '\\\\1<br />\\\\2\\\\3', $str);\n\n\t\t// Wrap the whole enchilada in enclosing paragraphs\n\t\tif ($str !== \"\\n\")\n\t\t{\n\t\t\t// We trim off the right-side new line so that the closing </p> tag\n\t\t\t// will be positioned immediately following the string, matching\n\t\t\t// the behavior of the opening <p> tag\n\t\t\t$str = '<p>'.rtrim($str).'</p>';\n\t\t}\n\n\t\t// Remove empty paragraphs if they are on the first line, as this\n\t\t// is a potential unintended consequence of the previous code\n\t\treturn preg_replace('/<p><\\/p>(.*)/', '\\\\1', $str, 1);\n\t}", "public function testSetLineSpacingDefault()\n {\n $this -> printer -> setLineSpacing();\n $this -> checkOutput(\"\\x1b@\\x1b2\");\n }", "function hybrid_comments_end_callback() {\n\techo '</li><!-- .comment -->';\n}", "public function _lines($lines, $prefix=' ', $color='white')\n\t{\n\t}", "public function setTerminator(ITerminatable $terminator): void;", "function crlf_endings(string $input) {\n\treturn str_replace(\"\\n\", \"\\r\\n\", $input);\n}", "private function makeLineBreaks(): void {\n\t\tif($this->getMaxLineLength()) {\n\t\t\t$this->setMsg(wordwrap($this->getMsg(), $this->getMaxLineLength(), PHP_EOL));\n\t\t}\n\n\t\t$this->setMsg(str_replace('<br />', PHP_EOL, str_replace('<br>', PHP_EOL, $this->getMsg())));\n\t}", "function formFeed(&$fp) {\n\n fwrite($fp, chr(12));\n }", "public function provideSafeStrings() {\n yield ['MarkSafe() > value', 'value'];\n yield [\"MarkSafe() >\\n value\", 'value'];\n yield [\"MarkSafe() >\\nline1\\nline2\", \"line1\\nline2\"];\n }", "function preint($v)\n{\n\techo '<pre style=\"border:1px solid grey;padding:.5em;\">';\n\tprint_r(md_function('htmlentities', $v));\n\techo '</pre>';\n}", "public function addTagToPostInTheMiddle() {}" ]
[ "0.56988513", "0.53720766", "0.53296113", "0.51444185", "0.5129252", "0.509232", "0.50571674", "0.50314164", "0.5016495", "0.49925894", "0.49802378", "0.4978669", "0.49766177", "0.49423662", "0.4941508", "0.49313563", "0.49069563", "0.48949575", "0.4876156", "0.48587704", "0.4848415", "0.48464173", "0.48279685", "0.4807132", "0.47941816", "0.4787784", "0.47821796", "0.47656992", "0.4753998", "0.4737171", "0.47290754", "0.47218513", "0.47162998", "0.46893546", "0.46867642", "0.46387064", "0.46272781", "0.4600143", "0.45790225", "0.45772332", "0.45760736", "0.457346", "0.4567626", "0.4566953", "0.45614517", "0.45567226", "0.45223662", "0.4515949", "0.45077515", "0.45038697", "0.45019197", "0.4501539", "0.44999027", "0.44723737", "0.4464662", "0.4460302", "0.44381472", "0.4433686", "0.4431823", "0.4430178", "0.4423324", "0.44168073", "0.4415234", "0.4403115", "0.44003928", "0.43737605", "0.43693238", "0.43611658", "0.4358593", "0.43517736", "0.4335039", "0.43333346", "0.43249634", "0.43164396", "0.43139437", "0.43047827", "0.42971057", "0.42935443", "0.42899022", "0.42885312", "0.42878276", "0.42869058", "0.4285429", "0.4282974", "0.42758515", "0.42685583", "0.42676267", "0.4255971", "0.42456985", "0.42419237", "0.424075", "0.42369568", "0.42368054", "0.42312416", "0.42287517", "0.4228023", "0.42271113", "0.42234132", "0.42177695", "0.4207011", "0.42040783" ]
0.0
-1
/ Initialize action controller here
public function init() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function init()\n {\n /* Initialize action controller here */\n }", "public function init()\n {\n /* Initialize action controller here */\n }", "protected function initializeController() {}", "protected function initializeAction() {}", "protected function initializeAction() {}", "protected function initializeAction() {}", "protected function initAction()\n {\n }", "protected function initializeAction() {\n\t\t/* Merge flexform and setup settings\n\t\t * \n\t\t */\n\t\t$this->settings['action'] = $this->actionMethodName;\n\t}", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {}", "public function initializeAction() {\n\n\t}", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }", "protected function initializeAction() {\n\t\t$this->akismetService->setCurrentRequest($this->request->getHttpRequest());\n\t}", "public function __construct($controller,$action) {\n\t\tparent::__construct($controller, $action);\n\t\t\n\t}", "public function init()\n {\n $controller = $this->router->getController();\n $action = $this->router->getAction();\n $params = $this->router->getParams();\n\n $objController = registerObject($controller);\n\n call_user_func_array([$objController, $action], $params);\n }", "public function __construct($controller, $action) {\n parent::__construct($controller, $action); //parent is Controller.php\n }", "protected function initAction()\r\n {\r\n $return = false;\r\n\r\n // parse request URI\r\n $parts_url = parse_url(strtolower(trim($_SERVER['REQUEST_URI'], '/')));\r\n // @TODO: fix\r\n $parts_url_array = explode('/', $parts_url['path']);\r\n list($this->controllerName, $this->itemId) = $parts_url_array;\r\n\r\n // parse method\r\n $this->requestMethod = strtolower($_SERVER['REQUEST_METHOD']);\r\n\r\n switch ($this->requestMethod) {\r\n case 'get':\r\n // default actions for GET\r\n if ($this->controllerName == 'login' || $this->controllerName == 'logout') {\r\n $this->actionName = $this->controllerName;\r\n $this->controllerName = 'users';\r\n } elseif (is_null($this->itemId)) {\r\n $this->actionName = 'index';\r\n } else {\r\n $this->actionName = 'view';\r\n }\r\n break;\r\n case 'post':\r\n // default action for POST\r\n $this->actionName = 'add';\r\n break;\r\n case 'put':\r\n // default action for PUT\r\n $this->actionName = 'edit';\r\n break;\r\n case 'delete':\r\n // default action for DELETE\r\n $this->actionName = 'delete';\r\n break;\r\n }\r\n\r\n if (!$this->controllerName) {\r\n $this->controllerName = 'main';\r\n }\r\n if (!$this->actionName) {\r\n $this->actionName = 'index';\r\n }\r\n\r\n // get, check & requre class\r\n $className = sprintf('mob%s', ucfirst($this->controllerName));\r\n $className = 'pages\\\\' . $className;\r\n \r\n if (class_exists($className)) {\r\n //create a instance of the controller\r\n $this->controller = new $className();\r\n\r\n //check if the action exists in the controller. if not, throw an exception.\r\n $actionName = sprintf('action%s', ucfirst($this->actionName));\r\n if (method_exists($this->controller, $actionName) !== false) {\r\n $this->action = $actionName;\r\n // set request params\r\n if ($this->itemId) {\r\n $this->controller->setParams(array('id' => $this->itemId));\r\n }\r\n $this->controller->setRequestParams($this->requestMethod);\r\n\r\n $return = true;\r\n } else {\r\n $this->controller->httpStatusCode = HTTP_STATUS_METHOD_NOT_ALLOWED;\r\n// throw new \\Exception('Action is invalid.');\r\n }\r\n } else {\r\n $this->controller = new clsMobController();\r\n $this->controller->httpStatusCode = HTTP_STATUS_NOT_FOUND;\r\n// throw new \\Exception('Controller class is invalid.');\r\n }\r\n\r\n return $return;\r\n }", "public function __construct()\n {\n // Prepare the action for execution, leveraging constructor injection.\n }", "public function __construct() {\n // filter controller, action and params\n $url = filter_input(INPUT_GET, 'url', FILTER_SANITIZE_URL); // $_GET['url']\n $params = explode('/', trim($url, '/'));\n\n // store first and seccond params, removing them from params list\n $controller_name = ucfirst(array_shift($params)); // uppercase classname\n $action_name = array_shift($params);\n\n require_once APP . 'config.php';\n\n // default controller and action\n if (empty($controller_name)) {\n $controller_name = AppConfig::DEFAULT_CONTROLLER;\n }\n if (empty($action_name)) {\n $action_name = AppConfig::DEFAULT_ACTION;\n }\n\n // load requested controller\n if (file_exists(APP . \"Controller/$controller_name.php\")) {\n require CORE . \"Controller.php\";\n require CORE . \"Model.php\";\n require APP . \"Controller/$controller_name.php\";\n $controller = new $controller_name();\n\n // verify if action is valid\n if (method_exists($controller, $action_name)) {\n call_user_func_array(array($controller, $action_name), $params);\n $controller->render(\"$controller_name/$action_name\"); // skipped if already rendered\n } else {\n // action not found\n $this->notFound();\n }\n } else {\n // controller not found\n $this->notFound();\n }\n }", "public static function init() {\n\t\tself::setup_actions();\n\t}", "protected function initializeAction()\n\t{\n\t\tparent::init('Form');\n\t}", "public function initController()\n {\n $this->model = new AliveSettingServiceMeta();\n\n $this->middleware([\n\n ]);\n }", "public function init() {\n\n $this->jobs = new Hb_Jobs();\n if ($this->_request->getActionName() == 'view') {\n\n $this->_request->setActionName('index');\n }\n\n $this->searchParams = $this->_request->getParams();\n $this->view->searchParams = $this->searchParams;\n\n $this->view->actionName = $this->_request->getActionName();\n }", "protected function initializeAction()\n {\n $this->extKey = GeneralUtility::camelCaseToLowerCaseUnderscored('BwrkOnepage');\n /** @var LanguageAspect $languageAspect */\n $languageAspect = GeneralUtility::makeInstance(Context::class)->getAspect('language');\n $this->languageUid = $languageAspect->getId();\n }", "protected function initializeAction()\n {\n parent::initializeAction();\n $this->customer = SubjectResolver::get()\n ->forClassName(Customer::class)\n ->forPropertyName('user')\n ->resolve();\n }", "public function initialize()\n {\n parent::initialize();\n $this->loadComponent('RequestHandler');\n $this->loadComponent('Flash');\n $this->loadComponent('Cookie');\n $this->cors();\n\n $currentController = $this->request->getParam('controller');\n // pr($currentController); die();\n if($currentController == 'Tenants'){\n $currentController = 'TenantUsers';\n }\n if($currentController == 'CorporateClients'){\n $currentController = 'CorporateClientUsers';\n // pr($currentController);die();\n }\n // $currentController = $this->request->params['controller'];\n $loginAction = $this->Cookie->read('loginAction');\n if(!$loginAction){\n $loginAction = ['controller' => $currentController,'action' => 'login'];\n }\n // pr($loginAction);die;\n $this->loadComponent('Auth',[\n 'loginAction' => ['controller' => $currentController,'action' => 'login'],\n 'authenticate' => [\n 'Form' =>\n [\n 'userModel' => $currentController,\n 'fields' => ['username' => 'email', 'password' => 'password']\n ]\n ],\n 'authorize'=> ['Controller'],\n 'loginAction' => $loginAction,\n 'loginRedirect' => $loginAction,\n 'logoutRedirect' => $loginAction \n\n ]);\n // $this->loadComponent('Auth', [\n\n // 'unauthorizedRedirect' => false,\n // 'checkAuthIn' => 'Controller.initialize',\n\n // // If you don't have a login action in your application set\n // // 'loginAction' to false to prevent getting a MissingRouteException.\n // 'loginAction' => false\n // ]);\n /*\n * Enable the following components for recommended CakePHP security settings.\n * see https://book.cakephp.org/3.0/en/controllers/components/security.html\n */\n }", "public function init() {\n\t\t$this->load_actions();\n\t}", "public function init()\r\n {\r\n\r\n /* Initialize action controller here */\r\n\r\n //=====================================must add in all Controller class constructor ===================================//\r\n if(defined('SITEURL')) $this->site_url = SITEURL;\r\n if(defined('SITEASSET')) $this->site_asset = SITEASSET;\r\n $this->view->site_url = $this->site_url;\r\n $this->view->site_asset = $this->site_asset;\r\n Zend_Loader::loadClass('Signup');\r\n Zend_Loader::loadClass('User');\r\n Zend_Loader::loadClass('Request');\r\n //Zend_Loader::loadClass('mailerphp');\r\n\t\t//Zend_Loader::loadClass('Permission');\r\n\r\n\r\n //-----------------------------------------------authenticate logged in user---------------------------------------------//\r\n Zend_Loader::loadClass('LoginAuth');\r\n $this->view->ob_LoginAuth = $this->sessionAuth = new LoginAuth();\r\n\r\n $this->sessionAuth->login_user_check();\r\n\r\n $this->sessionAuth->cookie_check();\r\n $this->view->server_msg = $this->sessionAuth->msg_centre();\r\n\r\n //-----------------------------------------------authenticate logged in user---------------------------------------------//\r\n unset($_SESSION['tranzgo_session']['export_list']);\r\n $this->view->ControllerName = $this->_request->getControllerName();\r\n $this->view->page_id = ($_SESSION['tranzgo_session']['role_id']==1)?'5':'7';\r\n //______________________________________must add in all Controller class constructor _____________________________________//\r\n\r\n\r\n }", "public function __construct() {\n\t\t\t$this->init_globals();\n\t\t\t$this->init_actions();\n\t\t}", "public function __construct()\n\t{\n\t\t$this->actionable = \"\";\n\t\t$this->action_taken = \"\";\n\t\t$this->action_summary = \"\";\n\t\t$this->resolution_summary = \"\";\n\t\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "public function __init()\n\t{\n\t\t// This code will run before your controller's code is called\n\t}", "function __construct()\n\t\t{\n\t\t\tparent::__construct();\n\t\t\t$this->_actionModel = new Action_Model();//khoi tao class\n\t\t}", "protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}", "protected function initializeAction() {\t\n\t\t$this->persdataRepository = t3lib_div::makeInstance('Tx_PtConference_Domain_Repository_persdataRepository');\n\t}", "public function __construct()\n\t{\n\t\t$this->actionable = \"\";\n\t\t$this->action_taken = \"\";\n\t\t$this->action_summary = \"\";\n\t\t$this->media_values = array(\n\t\t\t101 => Kohana::lang('ui_main.all'),\n\t\t\t102 => Kohana::lang('actionable.actionable'),\n\t\t\t103 => Kohana::lang('actionable.urgent'),\n\t\t\t104 => Kohana::lang('actionable.action_taken')\n\t\t);\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "public function __construct() {\n\n list($null,$controller, $action, $id) = explode(\"/\", $_SERVER['PATH_INFO']);\n \n $this->urlValues['base'] = \"http://\" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];\n $this->urlValues['controller'] = $controller ? $controller : \"home\";\n $this->urlValues['action'] = $action;\n $this->urlValues['id'] = $id;\n\n $this->controllerName = strtolower($this->urlValues['controller']);\n $this->controllerClass = ucfirst(strtolower($this->urlValues['controller'])) . \"Controller\";\n\n if ($this->urlValues['action'] == \"\") {\n $this->action = \"index\";\n } else {\n $this->action = $this->urlValues['action'];\n }\n }", "protected function _initControllers()\n\t{\n\t\treturn;\n\t}", "public function init()\n {\n $this->vars['CRUD']['Object'] = $this;\n $this->kernel = kernel();\n\n // Dynamic initialization\n if (! $this->modelName) {\n $modelRefl = new ReflectionClass($this->modelClass);\n $this->modelName = $modelRefl->getShortName();\n }\n\n\n if (! $this->crudId) {\n $this->crudId = \\Phifty\\Inflector::getInstance()->underscore($this->modelName);;\n }\n if (! $this->templateId) {\n $this->templateId = $this->crudId;\n }\n\n // Derive options from request\n if ($request = $this->getRequest()) {\n if ($useFormControls = $request->param('_form_controls')) {\n $this->actionViewOptions['submit_btn'] = true;\n $this->actionViewOptions['_form_controls'] = true;\n }\n }\n\n $this->reflect = new ReflectionClass($this);\n $this->namespace = $ns = $this->reflect->getNamespaceName();\n\n // XXX: currently we use FooBundle\\FooBundle as the main bundle class.\n $bundleClass = \"$ns\\\\$ns\";\n if (class_exists($bundleClass)) {\n $this->bundle = $this->vars['Bundle'] = $bundleClass::getInstance($this->kernel);\n } else {\n $bundleClass = \"$ns\\\\Application\";\n $this->bundle = $this->vars['Bundle'] = $bundleClass::getInstance($this->kernel);\n }\n\n $this->vars['Handler'] = $this;\n $this->vars['Controller'] = $this;\n\n // anyway, we have the model classname, and the namespace, \n // we should be able to registerRecordAction automatically, so we don't have to write the code.\n if ($this->registerRecordAction) {\n $self = $this;\n $this->kernel->event->register('phifty.before_action',function() use($self) {\n $self->kernel->action->registerAction('RecordActionTemplate', array(\n 'namespace' => $self->namespace,\n 'model' => $self->modelName,\n 'types' => (array) $self->registerRecordAction\n ));\n });\n }\n\n\n $this->initPermissions();\n\n /*\n * TODO: Move this to before render CRUD page, keep init method simple\n\n if ( $this->isI18NEnabled() ) {\n $this->primaryFields[] = 'lang';\n }\n */\n $this->initNavBar();\n }", "public function _initialize()\n {\n $this->cate=CONTROLLER_NAME;\n }", "protected function initializeActionEntries() {}", "protected function initializeAction() {\n\t\t$this->feusers = $this->feusersRepository->findByUid( $GLOBALS['TSFE']->fe_user->user['uid'] ) ;\n\t\t$this->schule = $this->feusers->getSchule();\n\t\n\t\t$this->extKey = $this->request->getControllerExtensionKey();\n\t\t$this->extPath = t3lib_extMgm::extPath($this->extKey);\n\t\n\t\t$this->importClassFile = $this->extPath.'Classes/tmp/class.importtext.php';\n\t\t$this->importClass = 'ImportText';\n\t \n\t\tif ( $this->settings[pidAjaxContainerKlassenuebersicht] > 0) $this->pidAjaxContainerKlassenuebersicht = (int) $this->settings[pidAjaxContainerKlassenuebersicht];\n\t\n\t}", "public function init(){\r\n\t$this->_helper->_acl->allow('public',NULL);\r\n\t$this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');\r\n\t$this->_contexts = array('xml','json');\r\n\t$this->_helper->contextSwitch()\r\n\t\t->setAutoDisableLayout(true)\r\n\t\t->addActionContext('oneto50k',$this->_contexts)\r\n\t\t->addActionContext('index',$this->_contexts)\r\n\t\t->initContext();\r\n\t}", "private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}", "public function initBaseController();", "public function init() {\n $this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');\n\t\t$this->_helper->acl->allow('public',null);\n\t\t$this->_helper->contextSwitch()\n\t\t\t ->setAutoDisableLayout(true)\n\t\t\t ->addActionContext('index', array('xml','json'))\n ->initContext();\n\t}", "public function __construct()\n {\n // Call the CI_Controller constructor\n parent::__construct();\n }", "public function __construct()\n\t{\t\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "public function initAction() : object\n {\n /**\n * Show all movies.\n */\n $response = $this->app->response;\n return $response->redirect(\"cms/posts\");\n }", "protected function initializeAction() {\n\t\t$this->frontendUserRepository = t3lib_div::makeInstance('Tx_GrbFeusermanager_Domain_Repository_FrontendUserRepository');\n\t}", "public function contentControllerInit()\n\t{\n\t}", "protected function initializeAction()\n {\n parent::initializeAction();\n\n $query = GeneralUtility::_GET('q');\n if ($query !== null) {\n $this->request->setArgument('q', $query);\n }\n }", "public function __construct()\n {\n $this->setAction('index', array('idle', 'toggleEnabled', 'expunge'));\n }", "public static function init() {\n\t\t$_GET = App::filterGET();\n\t\t\n\t\t// Checken of er params zijn meegegeven\n\t\ttry {\n\t\t\tif (count($_GET) == 0) {\n\t\t\t\t$_GET[0] = '';\n\t\t\t}\n\t\t\t\n\t\t\t// Is de eerste param een controller ? Anders een pageView\n\t\t\tif (self::isController($_GET[0])) {\n\t\t\t\t$controllerName = self::formatAsController($_GET[0]);\n\t\t\t\t$controller = self::loadController($controllerName);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Er is sprake van een pageview\n\t\t\t\t$controllerName = 'PagesController';\n\t\t\t\t$controller = self::loadController($controllerName);\n\t\t\t}\n\t\t\t\n\t\t\t$action = self::getAction($controller);\n\t\t\t$controller->setAction($action);\n\n\t\t\t// Try to exec the action\n\t\t\ttry {\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\tcatch(ActionDoesNotExistException $ex) {\n\n\t\t\t\techo $action;\n\t\t\t\t// Action bestaat niet\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\t\n\t\t\t\t// Als development is ingeschakeld, dan de ware error tonen, anders een 404 pagina\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('invalidAction');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\tcatch(MissingArgumentsException $ex) {\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\t\n\t\t\t\t// Als development is ingeschakeld, dan de ware error tonen, anders een 404 pagina\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('missingArguments');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t}\n\t\t\t\n\t\t\t// Try to render the view\n\t\t\ttry {\n\t\t\t\t$controller->render();\n\t\t\t}\n\t\t\tcatch(ViewDoesNotExistException $ex) {\n\t\t\t\t// View bestaat niet\n\t\t\t\t$controller = self::loadController('ErrorController');\n\t\t\t\tif (Config::DEVELOPMENT)\n\t\t\t\t\t$action = self::formatAsAction('invalidView');\n\t\t\t\telse\n\t\t\t\t\t$action = self::formatAsAction('notFound');\n\t\t\t\t\n\t\t\t\t$controller->setAction($action);\n\t\t\t\tself::dispatchAction($controller, $action);\n\t\t\t\t\n\t\t\t\t$controller->render();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tcatch(NoValidTemplateException $ex) {\n\t\t\techo 'Invalid template';\n\t\t}\n\t\tcatch(IsNotControllerException $ex) {\n\t\t\techo 'Controller not found';\n\t\t}\n\t}", "public function init()\r\n { \r\n //date_default_timezone_set('America/Phoenix');\r\n $ajaxContext = $this->_helper->getHelper('AjaxContext');\r\n\t$ajaxContext->addActionContext('list', 'html')\r\n ->addActionContext('edit', 'html')\r\n ->addActionContext('dashboard', 'html')\r\n ->addActionContext('handler', 'html')\r\n ->initContext();\r\n $auth = Zend_Auth::getInstance();\r\n $action = Zend_Controller_Front::getInstance()->getRequest()->getActionName();\r\n $type = $this->getRequest()->getParam('type');\r\n if (!$auth->hasIdentity() && $action!='handler') {\r\n //echo \"THIS IS AN ERROR: \".$action;\r\n $this->_redirect('login', array('UseBaseUrl' => true));\r\n }\r\n }", "public function __construct()\n {\n $this->model = new MainModel();\n $this->params[\"pagination\"][\"totalItemsPerPage\"] = 5;\n view()->share ('controllerName', $this->controllerName);//đặt controllerName cho all action\n }", "public function __construct()\n\t{\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "public function __construct()\n\t{\t\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "public function init() {\n $this->_temporizador = new Trf1_Admin_Timer ();\n $this->_temporizador->Inicio();\n\n /* Initialize action controller here */\n $this->view->titleBrowser = 'e-Sisad';\n }", "public function __construct()\n\t{\n\t\t// Hook into routing\n\t\tEvent::add('system.pre_controller', array($this, 'add'));\n\t}", "function __construct()\n {\n parent::Controller();\n }", "public function controller()\n\t{\n\t\n\t}", "public function init() {\n\t\t\t\t\t\t$this->view->controller = $this->_request->getParam ( 'controller' );\n\t\t\t\t\t\t$this->view->action = $this->_request->getParam ( 'action' );\n\t\t\t\t\t\t$this->getLibBaseUrl = new Zend_View_Helper_BaseUrl ();\n\t\t\t\t\t\t$this->GetModelOrganize = new Application_Model_ModOrganizeDb ();\n\t\t\t\t\t\t$this->_helper->ajaxContext->addActionContext('deleteOrganisme1','json')->initContext();\n\t\t\t\t\t\t// call function for dynamic sidebar\n\t\t\t\t\t\t$this->_Categories = new Application_Model_ModCatTerm ();\n\t\t\t\t\t\t$parent_id = $this->_getParam ( 'controller' );\n\t\t\t\t\t\t$this->view->secondSideBar = $this->_Categories->showCateParent ( $parent_id );\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}", "public function initializeAction() {\t\t\n\t\t$this->contactRepository = t3lib_div::makeInstance('Tx_Addresses_Domain_Repository_ContactRepository');\t\n\t}", "public function init() {\n\t$this->_flashMessenger = $this->_helper->getHelper('FlashMessenger');\n\t$this->_helper->acl->allow('public',null);\n\t$this->_helper->contextSwitch()\n\t\t->setAutoDisableLayout(true)\n\t\t->addActionContext('index', array('xml','json'))\n\t\t->addActionContext('mint', array('xml','json'))\n\t\t->initContext();\n }", "public function __construct()\n {\n if (get_called_class() != 'ApplicationController') {\n $this->_set_default_layout();\n $this->_vars = new stdClass();\n $this->_init();\n }\n }", "public function initializeAction() {\n parent::initializeAction();\n $this->umDiv = new Tx_Magenerator_Domain_UserManagement_Div();\n }", "public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }", "public function actionInit()\n {\n $this->initRoles($this->roles);\n $this->initPermissions($this->permissions);\n $this->initDependencies($this->dependencies);\n }", "public function getControllerAction() {}", "public function __construct($action = '') {\n\t\t$this->app = Application::app();\n\t\t$this->setAction($action);\n\t}", "function initialize(Controller $controller) {\n $this->controller=&$controller;\n \t}", "public function __construct($controller, $action) {\n parent::__construct($controller, $action);\n $this->loadModel('Baskets');\n $this->loadModel('Orders');\n $this->loadModel('Messages');\n $this->loadModel('Products');\n\n if(Session::exists(BUYER_SESSION_NAME)) {\n $this->view->totalProductInBasket = $this->BasketsModel->countProductInBasket();\n $this->view->totalOrders = $this->OrdersModel->countSentOrder();\n $this->view->msgCount = $this->MessagesModel->unReadMessages();\n } elseif(Session::exists(STORE_SESSION_NAME)) {\n $this->view->msgCount = $this->MessagesModel->unReadMessages();\n $this->view->newOrders = $this->OrdersModel->newOrders(Session::get(STORE_SESSION_NAME));\n }\n\n $this->view->setLayout('details');\n }", "function initialize(Controller $controller) {\n $this->controller = $controller;\n }", "public function __construct() {\n if (isset($_GET['rc'])) {\n $this->url = rtrim($_GET['rc'], '/'); // We don't want no empty arg\n $this->args = explode('/', $this->url);\n }\n \n // Load index controller by default, or first arg if specified\n $controller = ($this->url === null) ? 'null' : array_shift($this->args);\n $this->controllerName = ucfirst($controller);\n\n // Create controller and call method\n $this->route();\n // Make the controller display something\n $this->controllerClass->render();\n }", "public function __construct() {\r\n\t\t\r\n\t\tSession::init();\n\t\tif (!Session::get('local'))\n\t\t\tSession::set('local', DEFAULT_LANGUAGE);\r\n\t\t\r\n\t\t$this->getUrl();\r\n\t\t\r\n\t\t//No controller is specified.\r\n\t\tif (empty($this->url[0])) {\r\n\t\t\t$this->loadDefaultController();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t$this->loadCurrentController();\r\n\t\t$this->callControllerMethod();\r\n\r\n\t}", "public function __construct() {\n $this->urlValues = $_GET;\n if (!isset($this->urlValues['c'])) {\n $this->controllerName = \"home\";\n $this->controllerClass = \"HomeController\";\n } else {\n $this->controllerName = strtolower($this->urlValues['c']);\n $this->controllerClass = ucfirst(strtolower($this->urlValues['c'])) . \"Controller\";\n }\n \n if (!isset($this->urlValues['a'])) {\n $this->action = \"index\";\n } else {\n $this->action = $this->urlValues['a']; \n }\n }", "public function preAction() {\n $this->apiBrowser = new ApiBrowser();\n\n $basePath = $this->request->getBasePath();\n $this->namespaceAction = $basePath . '/namespace/';\n $this->classAction = $basePath . '/class/';\n $this->searchAction = $basePath . '/search';\n }", "function __construct($controller, $action)\n {\n global $inflect;\n\n $this->renderPage = true;\n $this->renderHeader = true;\n \t\n\t\t$this->requireUser = false;\n\t\t \n $this->_controller = ucfirst($controller);\n $this->_action = $action;\n \n $model = ucfirst($inflect->singularize($controller));\n $this->$model = new $model;\n\n $this->_template = new Template($controller, $action);\n }", "public function init()\n {\n $this->ctrlModel = new Admin_Model_Acl_ControllersActions();\n $this->dbCtrl = new Admin_Model_DbTable_Acl_ModuleController();\n }", "public function init(){\r\n\t\t$this->_data = $this->_request->getParams();\r\n $controller = $this->_data['controller']; //Get controller\r\n $action = $this->_data['action']; //Get action\r\n \r\n $loadfunction = new Default_Model_Common();\r\n foreach($loadfunction->loadFunction($controller) as $value){\r\n if($action == $value['action']){\r\n $load = new $value['model_load']();\r\n $this->view->$value['varname'] = $load->$value['function_load']();\r\n }\r\n }\r\n\r\n $this->view->lang = Zend_Registry::get(\"lang\"); //load language\r\n \r\n //List menu\r\n $listmenu = Zend_Registry::get(\"listmenu\");\r\n $this->view->listmenu = $listmenu;\r\n \r\n $this->view->selectaccount = ' class=\"selected\"';\r\n }", "public function setup_actions() {}", "function __construct() {\n\t\t\n\t\tparent::__construct();\n\t\t\n\t\t// skip the timestamp check for this app\n\t\tSession::check(true);\n\t\t$this->data[\"showActions\"] = true;\n\t\t$this->data[\"csrfToken\"] = CSRF::generateToken();\n\t\t\n\t}", "public function _construct($controller,$view){\r\n $this->controller = $controller;\r\n }", "abstract public function getControllerAction();", "public function initialize()\n { $model= new \\Yabasi\\ModelController();\n $this->setSchema($model->model());\n $this->setSource(\"notification\");\n }", "protected function __construct() {\n\t\t\tadd_action( 'init', array( $this, 'action__init' ), 11 );\n\t\t}", "public function init()\n {\n $this->ctrlActionModel = new Admin_Model_Acl_ControllersActions();\n $this->dbController = new Admin_Model_DbTable_Acl_ModuleController();\n $this->dbAction = new Admin_Model_DbTable_Acl_Action();\n }", "public function init()\n {\n $this->projectController->init();\n }", "function __construct() {\n\t\t\t$this->register_actions();\t\t\n\t\t\t$this->register_filters();\n\t\t}", "public function __construct() {\n // Call Module constructur\n parent::__construct();\n\n // Add additional route\n $this->_actions['GET']['/people/:id'] = 'people';\n }", "public function initialize()\n {\n $model= new \\Yabasi\\ModelController();\n $this->setSchema($model->model());\n $this->setSource(\"refund\");\n }", "function Controller()\n\t{\t\t\n\t\t$this->method = \"showView\";\n\t\tif (array_key_exists(\"method\", $_REQUEST))\n\t\t\t$this->method = $_REQUEST[\"method\"];\n\t\t\t\t\n\t\t$this->icfTemplating = new IcfTemplating();\n\t\t$this->tpl =& $this->icfTemplating->getTpl();\n\t\t$this->text =& $this->icfTemplating->getText();\t\t\n\t\t$this->controllerMessageArray = array();\n\t\t$this->pageTitle = \"\";\n\t\t$this->dateFormat = DateFormatFactory::getDateFormat();\n\t\t$this->controllerData =& $this->newControllerData();\n\t}", "function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}", "function __construct($module,$controller,$action) {\n\t\t$this->action = $action;\n\t\t$this->controller = preg_replace('%Controller$%','',$controller);\n\t\t$this->module = $module;\n\n\t\t$jadeCacheDir = J::path(\"App/Cache/Jade/$this->module/$this->controller\");\n\t\t(is_dir($jadeCacheDir)) || mkdir($jadeCacheDir,0777,true);\n\t\t$this->cacheFile = J::path(\"$jadeCacheDir/$this->action.php\");\n\t\t$this->viewFile = J::path(\"App/Modules/$this->module/Views/$this->controller/$this->action.jade\");\n\t}", "public function __construct()\n {\n $url = $this->getUrl();\n // Look in controllers folder for first value and ucwords(); will capitalise first letter \n if (isset($url[0]) && file_exists('../app/controllers/' . ucwords($url[0]) . '.php')) {\n $this->currentController = ucwords($url[0]); // Setting the current controllers name to the name capitilised first letter\n unset($url[0]); \n }\n\n // Require the controller\n require_once '../app/controllers/' . $this->currentController . '.php';\n // Taking the current controller and instantiating the controller class \n $this->currentController = new $this->currentController;\n // This is checking for the second part of the URL\n if (isset($url[1])) {\n if (method_exists($this->currentController, $url[1])) { // Checking the seond part of the url which is the corresponding method from the controller class\n $this->currentMethod = $url[1];\n unset($url[1]);\n }\n }\n\n // Get params, if no params, keep it empty\n $this->params = $url ? array_values($url) : []; \n\n // Call a callback with array of params\n call_user_func_array([$this->currentController, $this->currentMethod], $this->params);\n }", "public function __construct() {\n\t\tparent::__construct();\n\t\t$this->view = new ViewController();\t\t\n\t}", "public function __construct()\n {\n $this->controller = new Controller;\n $this->error_message = 'bad request or duplicate data';\n }", "public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }" ]
[ "0.89555573", "0.89555573", "0.8204698", "0.8002863", "0.8002863", "0.80028045", "0.79273975", "0.78016293", "0.7749248", "0.7749248", "0.7749248", "0.7749248", "0.7749248", "0.7741002", "0.7648697", "0.7542157", "0.75412816", "0.74583936", "0.74298215", "0.7382024", "0.73480386", "0.7331169", "0.73215866", "0.7304942", "0.72954893", "0.72756124", "0.7252959", "0.7245555", "0.7213444", "0.72055167", "0.7166803", "0.71537423", "0.71295327", "0.7116063", "0.7087286", "0.70805126", "0.70789105", "0.70648265", "0.7054432", "0.7047805", "0.7035078", "0.7028316", "0.6994974", "0.6991466", "0.6983527", "0.6981183", "0.6978", "0.6970972", "0.69654125", "0.6934351", "0.6933768", "0.69261926", "0.6923322", "0.6911111", "0.6908946", "0.6896637", "0.68910587", "0.6874299", "0.6869664", "0.6869664", "0.6862812", "0.6846716", "0.6843799", "0.6843699", "0.6806319", "0.6805242", "0.68019587", "0.6791775", "0.67693835", "0.67663324", "0.6765886", "0.6755697", "0.67245644", "0.6721506", "0.6721397", "0.6719413", "0.6709071", "0.6707734", "0.67069083", "0.67016375", "0.6700374", "0.66995394", "0.6693898", "0.6693774", "0.6692679", "0.6687027", "0.6685614", "0.6684059", "0.66738814", "0.66678077", "0.6657754", "0.6651159", "0.66420364", "0.6640831", "0.663447", "0.6611188", "0.6610412", "0.66077834", "0.6606336", "0.65999687", "0.65986174" ]
0.0
-1
GET Twig & city list
public function index(){ $twig = Config::getTwig(); if(isset($_POST["mail"]) && isset($_POST["pass"])) { $loginResult = User::login($_POST["mail"] , $_POST["pass"] ); //die($_SERVER['REQUEST_URI']); // -- ** -- Check $cityList content is exist with isset method $result = array('user' => $loginResult->content); // -- ** -- Render result with twig if($loginResult->isSuccess()) { header("Location: index.php"); } else{ return $twig->render('admin/pages/examples/login.html', $result); } }else{ return $twig->render('admin/pages/examples/login.html', array()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n \n $em = $this->getDoctrine()->getManager();\n /*\n $entities = $em->getRepository('NvCargaBundle:City')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n */\n $listall = $this->getUser()->getMaincompany()->getCountries();\n $countries = array();\n $count = 0;\n foreach ($listall as $country) {\n $countries[$count]['id'] = $country->getId();\n $countries[$count]['name'] = $country->getName();\n $count++;\n }\n return $this->render('NvCargaBundle:City:index.html.twig',array('countries' => $countries)); \n\n }", "public function index()\n {\n return CityApi::collection($this->city->paginate());\n }", "public function searchCitiesAction()\n\t{\n\t\t$city = $_GET['city'];\n\t\t\n\t\t#Get entity manager\n\t\t$em = $this->getDoctrine()->getEntityManager();\n\t\t\n\t\t#Get city repository\n\t\t$cityRepository = $em->getRepository('CmtCoreBundle:City');\n\t\t\n\t\t#Get result\n\t\t$citiesResult = $cityRepository->findAllLiveSearch($city);\n\t\t\n\t\t/* \n\t\t* Build response\n\t\t*/\n\t\t#Initialise return array\n\t\t$result = array();\n\t\t\n\t\t//Initialise counter\n\t\t$i = 0;\n\t\t#Loop results\n\t\tforeach($citiesResult as $city)\n\t\t{\n\t\t\t//Assign values\n\t\t\t$result[$i]['id'] = $city->getId();\n\t\t\t$result[$i]['slug'] = $city->getSlug();\n\t\t\t$result[$i]['name'] = $city->getName();\n\t\t\t\n\t\t\t$i++;\n\t\t}\n\t\t\n\t\t//Count\n\t\t$result['count'] = count($result);\n\t\t\n\t\t#Return response\n\t\treturn new Response(json_encode($result));\n\t}", "public function index()\n {\n $cities=City::where('status',1)->paginate(10);\n $provinces=City::selectRaw('distinct(province)')->get(10);\n return view('admin.city-list')->with('city',$cities)->withProvince($provinces);\n }", "public function listAction(Request $request)\n {\n if (! $request->isXmlHttpRequest()) {\n throw new NotFoundHttpException();\n }\n $name = $request->query->get('city_name');\n\n $em = $this->getDoctrine()->getManager();\n $user = $this->getUser();\n $maincompany = $user->getMaincompany();\n $countries = $maincompany->getCountries()->toArray();\n \n $states = $em->getRepository('NvCargaBundle:State')->findByCountry($countries);\n \n $entities = $em->getRepository('NvCargaBundle:City')->createQueryBuilder('o')\n ->where('o.name LIKE :name')\n //->setParameter('name', '%'.$name.'%')\n ->andWhere('o.state IN (:states)')\n ->andWhere('o.active =:active')\n ->setParameters(['name'=>$name.'%','states'=>$states, 'active'=>true])\n ->setFirstResult(0)\n ->setMaxResults(25)\n ->getQuery()\n ->getResult();\n \n $result=array();\n $counter = 0;\n foreach ($entities as $entity) {\n $result[$counter]['cityid'] = $entity->getId();\n $result[$counter]['cityname'] = $entity->getName();\n $result[$counter]['state'] = $entity->getState()->getName();\n $result[$counter]['country'] = $entity->getState()->getCountry()->getName();\n $counter++;\n }\n return new JsonResponse($result); \n }", "public function index()\n {\n $city = City::all();\n\n return $this->showAll($city,City::class);\n }", "public function index()\n {\n// return response()->json(City::all());\n return CityResource::collection(City::all());\n\n }", "public function index()\n {\n //\n $data=city::all();\n return response()->view('cms.cities.index',['cities'=>$data]);\n }", "public function index()\n {\n $cities = City::all();\n return $this->showAll($cities);\n }", "function City_list(){\n\t\t\n\t\t//fetch all cities from table\n\t\t$data = $this->View('*','city','','ORDER BY id DESC');\n\t\t\n\t\t//if city \n\t\tif($data){\n\t\t\t\n\t\t// for serial number\t\n\t\t$sno=1;\n\t\t\t\n\t\t//view all cities from table\n\t\tforeach($data as $value){\n\t\t\t\n\t\t\techo \" <tr>\n <td>\".$sno++.\"</td>\n <td>\".$value['city'].\"</td>\n <td><a href='Add-City?Edit=\".$value['id'].\"' class='btn btn-custon-two btn-primary btn-sm' >Edit</a></td>\n <td><a href='Add-City?Delete=\".$value['id'].\"' class='btn btn-custon-two btn-danger btn-sm' >Delete</a></td>\n </tr>\";\n\t\t} // foreach close\n\t\t} // if close\n\t}", "public function index()\n {\n if(LaravelLocalization::getCurrentLocale() == 'ar'){\n $name = 'name_ar';\n }else{\n $name = 'name_en';\n }\n $cities = City::with(['country' => function($query) use($name){\n $query->select('id', \"$name as name\");\n }])->select('id', \"$name as name\", 'country_id')->get();\n\n return view('backend.cities.index', compact('cities'));\n }", "public function index()\n\t{\n\t\t// Lấy danh sách thành phố\n\t\treturn Response::json(City::get());\n// return View::make('site.cities.index');\n\t}", "public function index()\n {\n $cities = City::orderby('id', 'name')->paginate(25); //show only 5 items at a time in descending order\n $returnVars = compact('cities');\n $returnVars['totalCities'] = City::count();\n \n return view('admin.city.index', $returnVars);\n }", "public function index()\n {\n $city = new City;\n $countries = Country::lists('countryname', 'id');\n $states = State::lists('statename', 'id');\n $cities = $city\n ->where('active','=',1)\n ->where('approved','=',1)\n ->get();\n return view('city.index')\n ->with('cities', $cities)\n ->with('countries', $countries)\n ->with('states', $states);\n }", "public function index() {\n $cities = City::all();\n return $cities;\n }", "public function getCityWidgetAction()\n {\n $term = $this->getRequest()->request('city', '', waRequest::TYPE_STRING_TRIM);\n\n try {\n $city = $this->suggestCity($term);\n } catch (waException $e) {\n $this->setError($e->getMessage());\n return;\n }\n\n $this->response = array(\n 'id' => $city['id'],\n 'city' => $city['cityName'],\n 'region' => $city['regionName'],\n 'country' => $city['countryName']\n );\n }", "public function show(cities $cities)\n {\n //\n }", "public function action_getcitylist() {\n $package = Model::factory('package');\n $output = '';\n $country_id = arr::get($_REQUEST, 'country_id');\n $state_id = arr::get($_REQUEST, 'state_id');\n $city_id = arr::get($_REQUEST, 'city_id');\n\n\n $getmodel_details = $package->getcity_details($country_id, $state_id);\n\n if (isset($country_id)) {\n\n $count = count($getmodel_details);\n if ($count > 0) {\n\n $output .= '<label>City</label><select class=\"form_control\" name=\"city\" id=\"city\" onchange=\"change_info();\"><option>Select city</option>';\n\n\n foreach ($getmodel_details as $modellist) {\n $output .= '<option value=\"' . $modellist[\"city_id\"] . '\"';\n if ($city_id == $modellist[\"city_id\"]) {\n $output .= 'selected=selected';\n }\n $output .= '>' . $modellist[\"city_name\"] . '</option>';\n }\n $output .= '</select>';\n } else {\n /* $output .='<select name=\"city\" id=\"city\" title=\" '.__('select_the_city').'\" class=\"required\">\n <option value=\"\">--Select--</option></select>'; */\n $output .= '<label>City</label><select class=\"form_control\" name=\"city\" id=\"city\" onchange=\"change_info();\"><option>Select city</option>';\n }\n }\n echo $output;\n exit;\n }", "public function index()\n\t{\n\t\t//Get all cities\n\t\treturn Response::json(Cities::all()->toArray());\n\t}", "public function index()\n\t{\n\t\t//Get all cities\n\t\treturn Response::json(Cities::all()->toArray());\n\t}", "public function index()\r\n {\r\n \r\n $Cities=City::orderBy('name','asc')->paginate(100); \r\n return view(\"city/index\", compact(\"Cities\"));\r\n \r\n }", "public function index()\r\n {\r\n $city = City::all();\r\n return $city;\r\n }", "public function index(Request $request)\n {\n $children = arrIntersect($this->geographicChildren, $request->get('include'));\n $data = City::with($children)->paginate($request->get('per_page'));\n\n return ResourcesCity::collection($data);\n }", "public function index()\n {\n $cities = City::with(['region', 'schools'])->get();\n\n return view('cities.index', [\n 'cities' => $cities\n ]);\n }", "public function listcountryAction(Request $request)\n {\n if (! $request->isXmlHttpRequest()) {\n throw new NotFoundHttpException();\n }\n $name = $request->query->get('city_name');\n $list = $request->query->get('countrylist');\n $countrylist = json_decode($list);\n\n $em = $this->getDoctrine()->getManager();\n $states = $em->getRepository('NvCargaBundle:State')->findByCountry($countrylist);\n \n $entities = $em->getRepository('NvCargaBundle:City')->createQueryBuilder('o')\n \t\t\t->where('o.name LIKE :name')\n //->setParameter('name', '%'.$name.'%')\n ->andWhere('o.state IN (:states)')\n ->andwhere('o.active =:active')\n ->setParameters(['name'=>$name.'%','states'=>$states, 'active'=>true])\n ->setFirstResult(0)\n ->setMaxResults(25)\n ->getQuery()\n ->getResult();\n $result=array();\n $counter = 0;\n foreach ($entities as $entity) {\n $result[$counter]['cityid'] = $entity->getId();\n $result[$counter]['cityname'] = $entity->getName();\n $result[$counter]['state'] = $entity->getState()->getName();\n $result[$counter]['country'] = $entity->getState()->getCountry()->getName();\n $counter++;\n }\n\t\n return new JsonResponse($result); \n }", "public function index()\n {\n return view('backend.system.cities.index');\n }", "public function index()\n {\n //\n $cities = City::withcount('states')->get();\n return view('admin.cities.index', ['cities' => $cities]);\n\n }", "function getCity()\n\t\t{\n\t\t\t$cities = $this->manage_content->getValue('city','city_name');\n\t\t\tforeach($cities as $city)\n\t\t\t{\n\t\t\t\techo '<option value=\"'.$city['city_name'].'\">'.$city['city_name'].'</option>';\n\t\t\t}\n\t\t}", "public function index()\n {\n //\n\n $cities = City::paginate(10);\n return view('cities.index', compact('governorates', 'cities'));\n }", "public function index(Request $request)\n {\n \n $orm = \\App\\City::orderBy('sort_id', 'ASC');\n if( $request->has('keywords') ){\n $orm->where('title', 'LIKE', '%'.$request->keywords.'%');\n }\n $cities = $orm->paginate(20);\n return view('admin.city.index', [\n 'items' => $cities,\n ]);\n }", "public function show(City $city)\n {\n //\n }", "public function show(City $city)\n {\n //\n }", "public function show(City $city)\n {\n //\n }", "public function show(City $city)\n {\n //\n }", "public function show(City $city)\n {\n //\n }", "public function show(City $city)\n {\n //\n }", "public function show(City $city)\n {\n //\n }", "public function index()\n {\n $cities = City::orderBy('city_name','asc')->with(['division','district'])->get();\n //dd($cities);\n return view('admin.city.manage',compact('cities'));\n }", "public function index()\n {\n $data = [\n 'cities' => City::all(),\n ];\n \n return view('city.index')->with('data',$data);\n }", "public function index()\n {\n $cities = City::all();\n return view('cities.index')->with('cities', $cities);\n }", "public function listpoboxAction(Request $request)\n {\n if (! $request->isXmlHttpRequest()) {\n throw new NotFoundHttpException();\n }\n\n $name = $request->query->get('city_name');\n $len = strlen($name);\n\n $em = $this->getDoctrine()->getManager();\n $rs = $em->getRepository('NvCargaBundle:Tariff')->createQueryBuilder('t')\n ->select('DISTINCT r.id')\n ->leftjoin('t.region', 'r')\n ->where('r.id = t.region')\n ->getQuery()\n ->getResult();\n\n // $regions = $em->getRepository('NvCargaBundle:Region')->findBy(array('id' => $rs));\n\n \n $regions = $em->getRepository('NvCargaBundle:Region')->createQueryBuilder('r')\n ->where('r.id IN (:ids)')\n ->setParameter('ids',$rs)\n ->getQuery()\n ->getResult();\n\n $entities = array();\n foreach ($regions as $region) {\n // exit(\\Doctrine\\Common\\Util\\Debug::dump($region->getName())); \n $cities = $region->getRegionCities();\n foreach ($cities as $city) {\n if ((!in_array($city, $entities)) && (strncasecmp($city->getName(), $name, $len) == 0) && ($city->getActive())){\n $entities[] = $city;\n }\n }\n }\n /*\n $entities = $em->getRepository('NvCargaBundle:City')->createQueryBuilder('c')\n ->select('c')\n ->where('c.state IN (:ids)')\n ->setParameter('ids',$states)\n ->getQuery()\n ->getResult();\n\n */\n $result=array();\n $counter = 0;\n foreach ($entities as $entity) {\n $result[$counter]['cityid'] = $entity->getId();\n $result[$counter]['cityname'] = $entity->getName();\n $result[$counter]['state'] = $entity->getState()->getName();\n $result[$counter]['country'] = $entity->getState()->getCountry()->getName();\n $counter++;\n }\n // exit(\\Doctrine\\Common\\Util\\Debug::dump($result));\n return new JsonResponse($result); \n }", "public function index(){\n return new CityCollection(City::all());\n }", "public function cityAction() {\n $request = $this->getRequest();\n $res = '<option value=\"\">Select City</option>';\n if ($request->isPost()) {\n $postdata = $request->getPost();\n $country_id = $postdata['country_id'];\n if ($country_id != '') {\n $em = $this->getEntityManager(); /* Call Entity Manager */\n $objCity = $em->getRepository('Admin\\Entity\\City')->findBy(array('countryId' => $country_id));\n \n if (count($objCity) > 0) {\n foreach ($objCity as $data) {\n $cityname = $data->getCityName();\n $cityId = $data->getId();\n $res .= '<option value=\"' . $cityId . '\">' . $cityname . '</option>';\n }\n }\n }\n }\n echo $res;\n exit;\n }", "public function index()\n {\n $cities = City::all();\n return response([\n 'cities' => CityResource::collection($cities),\n 'message' => 'Retreive Succefully'\n ], 200);\n }", "public function show(city $city)\n {\n //\n }", "public function index()\n {\n $country = Country::active();\n return view('city.index', compact('country'));\n }", "public function index()\n {\n $cities = City::all();\n return view('pages.cities.index' ,['cities' => $cities]);\n }", "#[Route('/', name: self::INDEX_ACTION)]\n public function index()\n {\n return $this->render('search/index.html.twig', [\n 'regions' => $this->getRegions(),\n 'departments' => $this->getDepartments()\n ]);\n }", "public function zipCitiesAction(Request $request){\n if ($this->get('cairn_user.api')->isRemoteCall()){\n $em = $this->getDoctrine()->getManager();\n $zcRepo = $em->getRepository(ZipCity::class);\n\n if($search = $request->query->get('search')){\n $zb = $zcRepo->createQueryBuilder('z');\n\n $zb->andWhere(\n $zb->expr()->orX(\n \"z.zipCode LIKE '%\".$search.\"%'\"\n ,\n \"z.city LIKE '%\".$search.\"%'\"\n )\n )\n ->orderBy('z.zipCode');\n $zipCities = $zb->getQuery()->getResult();\n }else{\n $zipCities = $zcRepo->findAll();\n }\n $returnArray = array();\n foreach ($zipCities as $zipCity){\n $returnArray[] = $zipCity->getName();\n }\n return $this->getRenderResponse(\n '',\n [],\n $returnArray,\n Response::HTTP_OK\n );\n }\n return new Response(\"JSON only\",400);\n }", "public function getAnnunciLavoroCittaPage($city)\n {\n $client = App::make('client.api');\n\n\n if ($city) {\n\n $response = $client->request('GET', \"/api/vacancy/searchbylocation?key=\" . $city);\n $res = $response->getBody()->getContents();\n $res = json_decode($res, true);\n\n\n $numVacancies = 0;\n $pagine = 0;\n\n if (isset($res)) {\n\n $numVacancies = count($res);\n\n $pagine = round($numVacancies / 20);\n\n\n $tagName = ucfirst($city);\n\n\n if (isset($res)) {\n foreach ($res as $key2 => $vacancy) {\n\n if ($vacancy['is_visible'] == false) {\n unset($res[$key2]);\n }\n }\n }\n\n $client = App::make('client.api');\n $response = $client->request('GET', \"/api/tags/category/JOBFUNCTION\");\n\n\n $jobFunctions = json_decode($response->getBody()->getContents(), true);\n\n\n $categories = [];\n\n foreach ($jobFunctions as $jobFunction) {\n\n if ($jobFunction['has_vacancy']) {\n $name = $jobFunction['name'];\n $link = \"/job-opportunities/\" . $city . \"/\" . $jobFunction['permalink_en'];\n\n\n if (\\Illuminate\\Support\\Facades\\App::getLocale() == \"it\") {\n $link = \"/annunci-lavoro/\" . $city . \"/\" . $jobFunction['permalink_it'];\n $name = $jobFunction['name_it'];\n\n }\n\n $categories[] = [\n \"name\" => $name,\n \"link\" => $link\n ];\n }\n\n }\n\n\n $description = \"Trova annunci di lavoro in \" . $tagName . \" per mettere a frutto il tuo talento. In tutto il mondo.\";\n\n\n if (\\Illuminate\\Support\\Facades\\App::getLocale() != \"it\") {\n $description = \"Find jobs in \" . $tagName . \" to nurture your talent. Worldwide.\";\n }\n if (!empty($res)) {\n usort($res, array($this, 'date_compare'));\n $res = array_reverse($res);\n }\n return View::make('vacancy-city', [\"categories\" => $categories, \"tag\" => $tagName, \"route\" => \"vacancy-category\", \"numVacancies\" => $numVacancies, \"customClass\" => \"jobs\", \"pagine\" => $pagine, \"vacancies\" => $res, \"key\" => $tagName, \"title\" => \"Annunci Lavoro \" . $tagName, \"tagName\" => $tagName, \"description\" => $description]);\n\n }\n\n\n }\n\n\n return Redirect::to('/');\n }", "public function index()\n {\n $cities = City::all();\n return view('backend.dashboard.real-estate.cities.index' , ['cities'=>$cities]);\n }", "public function index()\n\t{\n\t\t$cities = City::paginate(20);\n\t\t$citiesTotal = City::count();\n\n\t\treturn view('admin.cities.index', compact('cities', 'citiesTotal'));\n\t}", "public function city_list(){\n $state_id = $_REQUEST['state_id'];\n $city_list = $this->User_Model->get_list_by_id2('district_id as city_id , state_id, district_name as city_name','state_id',$state_id,'district');\n if($city_list) {\n $response[\"status\"] = TRUE;\n $response[\"city_list\"] = $city_list;\n } else {\n $response[\"status\"] = FALSE;\n $response[\"city_list\"] = $city_list;\n }\n\n $json_response = json_encode($response,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);\n echo str_replace('\\\\/','/',$json_response);\n }", "public function index()\n {\n return view(\"admin.cities.index\", [\"cities\" => City::all()]);\n }", "public function showCities(Request $request)\n {\n $cities = City::where('department', $request->id)->get();\n return json_encode($cities);\n }", "public function index()\n {\n $cities = City::all();\n\n return view('admin.cities.index', compact('cities'));\n }", "public function index()\n {\n // $users = users::all();\n\n \n $city = DB::table('city')\n ->join('countries','city.country_id','=','city.id')\n ->select('city.*','city.name as cities')\n ->get();\n\n \n return view('city.index',compact('city'));\n }", "public function locationshowAction()\n {\n $em = $this->getDoctrine()->getManager();\n $countries = $em->getRepository('adminBundle:countries')->findAll();\n return $this->render(':Location:index.html.twig', array(\n 'countries' => $countries,\n ));\n }", "public function getcitiesAction()\r\n {\r\n $cities = new PAP_Model_CityMapper();\r\n \r\n $this->_helper->layout()->disableLayout();\r\n $this->_helper->viewRenderer->setNoRender();\r\n \r\n if ($this->getRequest()->isXmlHttpRequest()) {\r\n $id = $this->_getParam('province_id');\r\n $citiesData = $cities->getCitiesByProvinceId($id);\r\n $this->_helper->json($citiesData);\r\n }\r\n \r\n /*\r\n if ($this->getRequest()->isXmlHttpRequest()) {\r\n $id = $this->_getParam('province_id');\r\n $citiesData = $cities->getCitiesByProvinceId($id);\r\n //$dojoData= new Zend_Dojo_Data('city_id',$citiesData);\r\n //echo $dojoData->toJson();\r\n echo json_encode($citiesData);\r\n }\r\n */\r\n }", "public function actionPlaces()\n {\n $city = Yii::$app->request->post('city');\n $api = new Kladr\\Api('51dfe5d42fb2b43e3300006e', '86a2c2a06f1b2451a87d05512cc2c3edfdf41969');\n\n $query = new Kladr\\Query();\n $query->ContentName = $city;\n $query->ContentType = Kladr\\ObjectType::City;\n $query->WithParent = true;\n $query->Limit = 2;\n\n $result = $api->QueryToArray($query);\n echo json_encode($result);\n }", "public function index()\n {\n $rules = City::paginate(5);\n return view('cities.index', compact('rules'));\n }", "public function index()\n {\n $cities = City::where('parent_id', '!=', 0)->get();\n $countries = City::where('parent_id', 0)->get();\n return view('admin.countries-cities.index', [\n 'cities' =>$cities,\n 'countries'=>$countries,\n ]);\n }", "public function cities_get()\n {\n $em = $this->doctrine->em;\n $citiesRepo = $em->getRepository('Entities\\City');\n $cities = $citiesRepo->findAll();\n foreach ($cities as $city) {\n $city->servicesCount = $city->getServices()->count();\n }\n $response[\"data\"] = $cities;\n $response[\"count\"] = count($cities);\n $this->set_response($response, REST_Controller::HTTP_OK);\n\n }", "public function getCityList()\n {\n return $this -> generate_city_list();\n }", "public function getCitiesByRegionAction(Request $request) {\n $em = $this->getDoctrine()->getManager();\n $id = $request->get('id');\n $type = $request->get('type');\n $typeClass = $request->get('typeClass');\n\n $cities = $em->getRepository('AppBundle:City')->getByRegion($id);\n\n $response = $this->render('AppBundle:Location/ajax:cities.html.twig', array(\n 'cities' => $cities,\n 'type' => $type,\n 'typeClass'=> $typeClass\n ))->getContent();\n\n return new Response(json_encode($response));\n }", "function getcity_get(){\n\n $stateID = $this->uri->segment(4);\n\n $stateID = isset($stateID) ? $stateID : \"\";\n\n if ($stateID == FALSE) {\n $responsedata = array(\n 'status' => FALSE,\n 'message' => 'State id should not be empty.'\n );\n $this->response($responsedata, REST_Controller::FIELD_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code\n }\n \n $from = 'cities';\n $where = array('state_id' => $stateID);\n $select = '*';\n $records = 2;\n\n $cities = $this->base_model->getCommon($from, $where, $select, $records);\n\n if ($cities) {\n $responsedata = array(\n 'status' => TRUE,\n 'message' => 'Cities found successfully.',\n 'result' => $cities\n );\n $this->set_response($responsedata, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code \n }else{\n $responsedata = array(\n 'status' => FALSE,\n 'message' => 'State not found.'\n );\n $this->response($responsedata, REST_Controller::FIELD_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code\n }\n }", "public function show(City $city)\n {\n// return view(\"admin.cities.show\", compact(\"city\"));\n }", "public function citiesAction(Request $request)\n {\n $province_id = $request->request->get('province_id');\n\n $em = $this->getDoctrine()->getManager();\n $cities = $em->getRepository('AppBundle:Localidad')\n ->findBy(array('provincia' => $province_id));\n \n //return new Response(json_encode($cities));\n \n $serializer = $this->container->get('serializer'); \n $citiesSerializer = $serializer->serialize($cities, 'json');\n return new Response($citiesSerializer);\n //return new JsonResponse($cities);\n }", "public function actionGet_cities() {\n if (isset($_POST['state_id']) != 0) {\n $output = '';\n $state_id = $_POST['state_id'];\n $att_name = $_POST['att_name'];\n $all_cities = DvCities::find()->where(['state_id' => $state_id])->all();\n $allcities = ArrayHelper::map($all_cities, 'id', 'name');\n if ($att_name == 'DvRegistration[state]') {\n $output .= '<select id=\"dvusers-city\" class=\"form-control\" name=\"DvRegistration[city]\" aria-invalid=\"false\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Select City\">';\n } else {\n $output .= '<select id=\"dvusers-city\" class=\"form-control\" name=\"usermeta[city]\" required=\"required\" aria-invalid=\"false\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Select City\">';\n }\n $output .= '<option value=\"\">Select City</option>';\n foreach ($allcities as $id => $name) {\n $output .= '<option value=\"' . $id . '\">' . $name . '</option>';\n }\n $output .= '</select>';\n return $output;\n } else {\n return $this->redirect(['dv-users/index']);\n }\n }", "public function index()\n {\n return view('cities/index', [\n\t\t\t'cities' => City::all(),\n\t\t]);\n }", "public function getCity() {}", "public function getCity();", "public function index()\n {\n $city = City::all();\n // return $kategori;\n return view('city.index', compact('city'));\n }", "public function get_cities()\n\t{\n\t\t$state_id = $this->input->post('state_id');\n\n\t\t$cities = $this->users->get_cities_by_state($state_id);\n\t\techo json_encode($cities);\n\t}", "public function listallAction(Request $request)\n {\n if (! $request->isXmlHttpRequest()) {\n throw new NotFoundHttpException();\n }\n\n $em = $this->getDoctrine()->getManager();\n $entities = $em->getRepository('NvCargaBundle:City')->findByActive(true);\n $result=array();\n $counter = 0;\n foreach ($entities as $entity) {\n $result[$counter]['cityid'] = $entity->getId();\n $result[$counter]['cityname'] = $entity->getName();\n $result[$counter]['state'] = $entity->getState()->getName();\n $result[$counter]['country'] = $entity->getState()->getCountry()->getName();\n $counter++;\n }\n // sleep(5);\n return new JsonResponse($result); \n }", "public function index() {\n return view('admin.cities.index');\n }", "public function getCityList() {\n\t\treturn $this->getByKey(Config::get('constants.KEY_CITY'));\n\t}", "public function index()\n {\n $records = District::all()->load('city');\n return view('admin/pages/districts.all', compact('records'));\n }", "public function getCityList() {\n return $this->_get(2);\n }", "public function get_all_city()\n\t {\n\t \t $data=(array)json_decode(file_get_contents(\"php://input\"));\n\t \t$id=$data['state_id'];\n\t \t$query=$this->ApiModel->get_all_city($id);\n\t \techo json_encode($query);\n\t }", "public function indexAction()\n {\n $this->setCustomRepositories();\n $frontRepository = $this->frontRepository;\n $data = $frontRepository->getCitiesPlacesCategories();\n\n $form = $this->createForm(MapType::class);\n return $this->render('FrontBundle:Index:index.html.twig', [\n 'form' => $form->createView(),\n 'cities' => $data['cities'],\n 'places' => $data['places'],\n 'categories' => $data['categories']\n ]);\n }", "public function index()\n {\n $cities = $this->cityRepo->getAll();\n return $this->sendResponse($cities->toArray(), 'Ciudades Encontradas!');\n }", "public function index()\n {\n $cities = City::all();\n return view('home', compact('cities'));\n }", "public function index()\n {\n // only test\n //$country = Countries::all()->pluck('name.common','cca2');\n //$country = Countries::where('cca2',\"IT\")->pluck('name.common','cca2');\n \n /*$user = User::find(1);\n $user->city; \n\n return response()->json([\n 'userCIty' => $country\n ]); */\n }", "public function getCity()\n {\n $cities = City::where('province_id', request()->province_id)->get();\n //KEMBALIKAN DATANYA DALAM BENTUK JSON\n return response()->json(['status' => 'success', 'data' => $cities]);\n }", "public function getCitiesByNameAction() {\n\n // Verifica a chave de comunicacao da API\n if(!parent::checkApi()) {\n // Retorna erro 400 na requisição se a chave não estiver correta\n return http_response_code(400);\n } else {\n // Descriptografa os dados vindos por POST\n $this->post = parent::checkApi();\n }\n\n // \n if(!isset($this->post->city)) {\n $this->response->errorCode = 1;\n $this->response->errorMessage = 'Falta o nome da cidade';\n return $this->return();\n }\n\n try {\n\n $cities = GeoCity::Find([\n 'conditions' => 'City LIKE :city:',\n 'bind' => [\n 'city' => '%' . parent::sanitize($this->post->city, 'string') . '%',\n ],\n 'limit' => 10\n ]);\n\n if(!count($cities) > 0) {\n\n throw new Exception(\"Nenhum registro encontrado\");\n } else {\n\n $this->response->data = $cities;\n return $this->return();\n }\n\n } catch (Exception $e) {\n \n // Resposta da API\n $this->response->errorCode = 1;\n $this->response->errorMessage = $e->getMessage();\n return $this->return();\n }\n }", "public function actionCity() {\n\t\t$term = (isset($_POST['term'])) ? $_POST['term'] : false;\n\t\t$region = (isset($_POST['region'])) ? (int)$_POST['region'] : false;\n\t\t//$simple = (isset($_POST['simple'])) ? (int)$_POST['simple'] : true;\n\n\t\tif(Yii::app()->request->isAjaxRequest && $term) {\n\t\t\t$criteria = new CDbCriteria;\n\t\t\t$criteria->addSearchCondition('t.name', $term);\n\t\t\tif ($region>0)\n\t\t\t\t$criteria->addSearchCondition('t.region_id', $region, false);\n\t\t\t$criteria->order = 't.type asc';\n\t\t\t$criteria->limit = (strlen($term)>4) ? 30 : 15;\n\t\t\t$criteria->with = 'district2';\n\n\t\t\t$citys = CityUa::model()->findAll($criteria);\n\n\t\t\t// обрабатываем результат\n\t\t\t$data = array();\n\t\t\tif (count($citys)>0) {\n\t\t\t\tforeach($citys as $city) {\n\t\t\t\t\t$data[] = array(\n\t\t\t\t\t\t'id'=>$city['id'],\n\t\t\t\t\t\t'label'=>$city->Li,\n\t\t\t\t\t\t'value'=>$city->preName,\n\t\t\t\t\t\t'r'=>$city['region_id'],\n\t\t\t\t\t\t'd'=>$city['district'],\n\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$data[] = array(\n\t\t\t\t\t'label'=>'Ничего не найдено',\n\t\t\t\t\t'value'=>'',\n\t\t\t\t\t'r'=>'',\n\t\t\t\t\t'd'=>''\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$this->sendResult($data);\n\t\t\tYii::app()->end();\n\t\t}\n\t}", "public function cities(Request $request): CityCollection\n {\n return CityCollection::make(City::query()->with('translates')->filter($request->only('region_id'))->paginate($request->get('perPage') ?? 50));\n }", "public function getCityAction(Request $request)\n {\n\n if($request->get('zipcode')!==null && $request->get('zipcode')!=='' && Tools::zipValidation($request->get('zipcode'),\"DE\")===false) return new View(\"zipcode: \".$request->get('zipcode').\" it's not a German valid zipcode\" , Response::HTTP_NOT_ACCEPTABLE);\n\n $em = $this->getDoctrine()->getManager();\n\n $qb = $em->createQueryBuilder();\n\n $qb->select('c')->from('MyHammerJobsBundle:City', 'c')\n ->leftJoin('c.country', 'ct')\n ->where('ct.isocode = :isocode')\n ->setParameter('isocode', $this->getParameter('isocode'));\n\n\n if($request->get('zipcode')!==null && $request->get('zipcode')!=='') $qb->andWhere('c.zipcode = :zipcode')->setParameter('zipcode', $request->get('zipcode'));\n\n $result = $qb->getQuery()->getResult();\n\n if ($result === null) return new View(\"No city are registrered\", Response::HTTP_NOT_FOUND);\n\n return $result;\n }", "public function index()\n {\n $districts= DB::table('districts')\n ->join('cities', 'districts.city_id', '=', 'cities.id')\n ->select('districts.*', 'cities.city')\n ->get();\n $cities=City::all();\n return response()->json(compact('cities','districts'));\n\n }", "public function get_city(){\n $statid = $this->input->post('sid');\n $this->depmodel->get_citylist($statid);\n }", "public function get_city(){\n \n $this->db->order_by('city', 'asc'); \n $result = $this->db->get('shiprate')->result();\n \n foreach($result as $res){\n $output[] = array (\"city_id\" => $res->cityid, \"city\" => $res->city);\n }\n $response['content'] = $output;\n $this->output\n ->set_status_header(200)\n ->set_content_type('application/json', 'utf-8')\n ->set_output(json_encode($response,128))\n ->_display();\n exit; \n }", "public function services()\n {\n \t\t//$services = $data->get_services();\n \t\t//dd($cities->ZA);\n \t\t$services = KitApi::get_services();\n \t\treturn view('services', compact('services'));\n }", "public function show(Request $request)\n {\n $city = City::findOrFail($request->input('id'));\n echo json_encode($city);\n \n// return view ('admin.city.show', compact('city'));\n }", "public function index()\n {\n $cities = City::all();\n $townships = Township::orderBy('id','DESC')->get();\n\n $townships = TownshipResource::collection($townships);\n\n return response()->json([\n 'townships' => $townships,\n ],200);\n }", "public function getcity(Request $request){\n\t\t$stateid = $request->input('stateid');\n\t\t$arrCitydata = City::where('state_id','=',$stateid)->get();\n\t\t$citydata = array();\n\t\t$i = 0;\n\t\tforeach($arrCitydata as $city)\n\t\t{\n\t\t\t$citydata[$i]['id'] = $city['city_id']; \n\t\t\t$citydata[$i]['name'] = $city['city_name'];\n\t\t\t$i++;\n\t\t}\n\t\treturn response()->json($citydata);\n\t\texit();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $placeCategories = $em->getRepository('App1ExampleBundle:PlaceCategory')->findAll();\n\n return $this->render('placecategory/index.html.twig', array(\n 'placeCategories' => $placeCategories,\n ));\n }", "public function listByNameAction()\n {\n $em = $this->getDoctrine()->getManager();\n $request = $this->get('request');\n $name = $request->get('nameVille');\n $entities = $em->getRepository('GarnetTaxiBeBundle:Endroit')->listByName($name);\n\n return $this->render('GarnetTaxiBeBundle:Common:autocomplete.html.twig', array(\n 'entities' => $entities\n ));\n }", "public function get()\n { \n try {\n $cities = City::getCitiesWithUser(Auth::user()->id);\n } catch (Exception $e) {\n return $this->respondInternalError();\n }\n \n return $this->respondSuccessWithArray($cities);\n\n }", "public function all()\n {\n $all = City::all();\n if($all->isEmpty()){\n return response()->json(['message' => 'No entries found in database'], 204);\n }\n\n return CityResource::collection($all); \n }", "public function index()\n { \n $cities = City::get();\n $items= array();\n foreach($cities as $city){\n \n $order = DB::table('districts')\n ->where('city_id',$city->id)\n ->join('orders', 'districts.id', '=', 'orders.district_id')\n ->count();\n // echo $city->id;\n $city['order']=$order;\n $city=json_decode($city);\n array_push($items, $city);\n }\n $items = array_filter($items);\n \n return view('pages/requestedCities',['items'=>$items]);\n }" ]
[ "0.7201711", "0.71849555", "0.7111482", "0.700946", "0.69950676", "0.69311595", "0.6881738", "0.6874478", "0.68596", "0.6840181", "0.6819589", "0.6805283", "0.67856026", "0.67654836", "0.6730122", "0.67281955", "0.6705616", "0.6665254", "0.6665031", "0.6665031", "0.66408974", "0.66342705", "0.66328233", "0.66197956", "0.6608047", "0.66060686", "0.6598032", "0.6594604", "0.65867555", "0.6579657", "0.65780044", "0.65780044", "0.65780044", "0.65780044", "0.65780044", "0.65780044", "0.65780044", "0.65765315", "0.6560617", "0.6556437", "0.654506", "0.6542834", "0.65372765", "0.65361875", "0.65188813", "0.6511276", "0.6502388", "0.6485717", "0.6477296", "0.6459694", "0.6447047", "0.64442444", "0.64389986", "0.63969094", "0.63888735", "0.63875043", "0.6384505", "0.6374509", "0.6353296", "0.6346842", "0.63403606", "0.63400614", "0.63392514", "0.63289136", "0.6319919", "0.63150686", "0.6308883", "0.6299158", "0.62863845", "0.62823766", "0.62758714", "0.6271902", "0.6257387", "0.6249269", "0.62491876", "0.6248993", "0.6245124", "0.62429774", "0.62395334", "0.62164336", "0.62151957", "0.6196267", "0.6191945", "0.6178396", "0.61746293", "0.6173292", "0.6145047", "0.61306816", "0.6126758", "0.61209315", "0.6117975", "0.61137", "0.61131054", "0.61119026", "0.61015934", "0.6097748", "0.6094361", "0.6073967", "0.60512894", "0.605035", "0.6031345" ]
0.0
-1
Get arguments from argument array
function sendMessage($vars) { extract($vars); list($dbconn) = lnDBGetConn(); $lntable = lnDBGetTables(); $privmsgstable = $lntable['privmsgs']; $privmsgscolumn = &$lntable['privmsgs_column']; $id = getMaxPrivMsgID(); $type = _MESSAGESEND; $send_time = time(); $ip = getenv("REMOTE_ADDR"); if (empty($from_uid)) { $from_uid = lnSessionGetVar('uid'); } if (empty($to_uid)) { $to_uid = lnUserGetUid($nickname); messageHead($vars); } if (empty($to_uid)) { echo '<P><TABLE CELLPADDING=10 CELLSPACING=1 BGCOLOR="#FF0000" HEIGHT="50"><TR><TD BGCOLOR="#FFFFFF" ALIGN="CENTER">'; echo '<B>Sorry but no such user exists</B>'; echo '<P><< <A HREF="javascript:history.go(-1)">Back</A>'; echo '</TD></TR></TABLE>'; } else { $query = "INSERT INTO $privmsgstable ( $privmsgscolumn[id], $privmsgscolumn[type], $privmsgscolumn[priority], $privmsgscolumn[subject], $privmsgscolumn[message], $privmsgscolumn[from_uid], $privmsgscolumn[to_uid], $privmsgscolumn[date], $privmsgscolumn[ip], $privmsgscolumn[enable] ) VALUES ( '". lnVarPrepForStore($id) ."', '". lnVarPrepForStore($type) ."', '". lnVarPrepForStore($priority) ."', '". lnVarPrepForStore($subject) ."', '". lnVarPrepForStore($message) ."', '". lnVarPrepForStore($from_uid) ."', '". lnVarPrepForStore($to_uid) ."', '". lnVarPrepForStore($send_time) ."', '". lnVarPrepForStore($ip) ."', '1' ) "; $result = $dbconn->Execute($query); /* echo '<P><TABLE CELLPADDING=10 CELLSPACING=1 BGCOLOR="#0066CC" HEIGHT="50"><TR><TD BGCOLOR="#FFFFFF" ALIGN="CENTER">'; echo '<B>Your message has been sent</B>'; echo '<P>Click <A HREF="index.php?mod=Private_Messages&amp;op=inbox">Here</A> to return to your Inbox'; echo '</TD></TR></TABLE>'; */ } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getArgs();", "public function getArgs();", "public function getArguments(): array;", "public function getArguments(): array;", "public function getArguments(): array;", "function getArguments() ;", "public function getArguments();", "public function getArguments();", "public function getArguments();", "public function getArguments();", "abstract public function getArguments(): array;", "public function arguments(): array;", "private function getArguments() {\n return array_slice($argv, 1);\n }", "protected function getArguments()\r\n\t{\r\n\t\treturn array();\r\n\t}", "protected function getArguments()\r\n\t{\r\n\t\treturn array();\r\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}", "public function getArgsArray(){\n\t\t$this->prepareArgs();\n\t\treturn $this->argsArray;\n\t}", "public function getArguments() {}", "public function getArguments() {}", "public function getArguments() {}", "public function getArguments() {}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn array(\n\t\t);\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [];\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn array();\n\t}", "protected function getArguments() {\n\t\treturn array(\n\t\t);\n\t}", "protected function getArguments() {\n\t\treturn array();\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\n\t\t];\n\t}", "protected function getArguments()\n\t{\n\t\treturn [\n\n\t\t];\n\t}", "protected function getArguments()\r\n\t{\r\n\t\treturn isset($this->arguments) ? $this->arguments : array();\r\n\t}", "public static function getArguments()\n {\n return func_get_args();\n }", "abstract protected function get_args();", "public function getArguments() : array\n {\n return $this->args;\n }", "abstract protected function arguments(): array;", "public function getArgs() : array\n {\n }", "public function getArgs() : array\n {\n return $this->args;\n }", "protected function getArguments()\n {\n return array(\n );\n }", "protected function getArguments()\n {\n return array();\n }", "protected function getArguments()\n {\n return array();\n }", "protected function getArguments()\n {\n return array();\n }", "protected function getArguments()\n {\n return array();\n }", "protected function getArguments()\n {\n return array();\n }", "protected function getArguments()\n {\n return array();\n }", "protected function getArguments()\n {\n return [\n\n ];\n }", "protected function getArguments()\n {\n return [\n\n ];\n }", "protected function getArguments()\n {\n return [\n ];\n }", "protected function getArguments() { return isset($this->_arguments) ? $this->_arguments : array();\n }", "protected function get_arguments(): array {\n\t\treturn [];\n\t}", "public function args()\n {\n return $this->arguments->get();\n }", "public function getArgs(): array\n {\n return $this->args;\n }", "public function getArgs()\n {\n if ($this['args']) {\n return $this['args'];\n }\n\n return [];\n }", "public function getArguments(): array\n {\n return $this->arguments;\n }", "public function getArguments(): array\n {\n return $this->arguments;\n }", "public function getArguments(): array\n {\n return $this->arguments;\n }", "protected function getArguments()\n {\n return [];\n }", "protected function getArguments()\n {\n return [];\n }", "protected function getArguments()\n {\n return [];\n }", "protected function getArguments()\n {\n return [];\n }", "protected function getArguments()\n {\n return [];\n }", "protected function getArguments()\n {\n return [];\n }", "protected function getArguments()\n {\n return [];\n }", "protected function getArguments()\n {\n return [];\n }", "protected function getArguments()\n {\n return [];\n }", "protected function getArguments()\n {\n return [];\n }", "protected function getArguments()\n {\n return [];\n }", "protected function getArguments()\n {\n return [];\n }", "protected function getArguments()\n {\n return [];\n }", "public function getArguments(): array\n {\n return $this->_arguments;\n }", "public function getArgs()\n {\n return $this->meta[Cli::ARGS] ?? [];\n }", "protected function getArguments() {\n return [];\n }", "protected function getArguments() {\n return [];\n }", "public function getArguments(): array {\n return $this->arguments;\n }", "abstract public static function args();", "protected function getArguments() : array\n {\n return [];\n }" ]
[ "0.7867659", "0.7867659", "0.7817831", "0.7817831", "0.7817831", "0.7733636", "0.7691432", "0.7691432", "0.7691432", "0.7691432", "0.7678605", "0.7652104", "0.76512504", "0.75659513", "0.75659513", "0.75611967", "0.75611967", "0.75611967", "0.75611967", "0.7548802", "0.7529502", "0.7529502", "0.7529502", "0.7529502", "0.7527565", "0.7527565", "0.7527565", "0.7527565", "0.7527565", "0.7527565", "0.7527565", "0.75179595", "0.75179595", "0.75179595", "0.75179595", "0.75179595", "0.75179595", "0.75179595", "0.75179595", "0.7514591", "0.7514591", "0.7514591", "0.7514591", "0.7514591", "0.7514591", "0.7514591", "0.7514591", "0.7514591", "0.7514591", "0.7514591", "0.7514591", "0.74994284", "0.74174434", "0.7414652", "0.7383657", "0.7383657", "0.73608625", "0.73549706", "0.73518", "0.7341976", "0.7305594", "0.7300895", "0.7293071", "0.7281076", "0.72647995", "0.72647995", "0.72647995", "0.72647995", "0.72647995", "0.72647995", "0.7264385", "0.7264385", "0.7248737", "0.7246539", "0.72455025", "0.72147727", "0.7204912", "0.719755", "0.7130008", "0.7130008", "0.7130008", "0.71096367", "0.71096367", "0.71096367", "0.71096367", "0.71096367", "0.71096367", "0.71096367", "0.71096367", "0.71096367", "0.71096367", "0.71096367", "0.71096367", "0.71096367", "0.7107487", "0.70465434", "0.7023153", "0.7023153", "0.7000748", "0.69686204", "0.6968072" ]
0.0
-1
Determine whether the user can view the vip.
public function read(User $user) { return in_array('read', $user->permissibles('vip')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function canView(): bool\n {\n return true;\n }", "public function isViewable(): bool\n\t{\n\t\treturn self::STATUS_ACTIVE === $this->get('status') && self::USER_VISIBLE === $this->get('visible');\n\t}", "public function hasAccess() : bool\n\t{\n\t\t$ip = Server::getIP();\n\t\t$access = false;\n\n\t\t// Allow local access\n\t\tif ( Stringify::contains(['127.0.0.1','::1'], $ip) ) {\n\t\t\t$access = true;\n\n\t\t} else {\n\n\t\t\t// Check allowed IPs\n\t\t\t$allowed = $this->applyFilter('access-allowed-ip', $this->getAllowedAccess());\n\t\t\tif ( !empty($allowed) ) {\n\t\t\t\tif ( Stringify::contains($allowed, $ip) ) {\n\t\t\t\t\t$access = true;\n\n\t\t\t\t} else {\n\t\t\t\t\t$access = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t// Deny access\n\t\t\t\t$denied = $this->applyFilter('access-denied-ip', $this->getDeniedAccess());\n\t\t\t\tif ( Stringify::contains($denied, $ip) ) {\n\t\t\t\t\t$access = false;\n\n\t\t\t\t} else {\n\t\t\t\t\t$access = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$data = ['ip' => $ip, 'access' => $access];\n\t\t$this->doAction('ip-access', $data);\n\t\treturn $access;\n\t}", "public function canBeViewed() {}", "public function isViewable()\n\t{\n\t\treturn true;\n\t}", "public function isUserIPAddressAllowedAccess()\n\t{\n\t\ttry\n {\n $IpBin = new IpBin();\n return $IpBin->isUserIPAddressAllowedAccess($this->getSiteUser()->getId());\n }\n catch(\\Whoops\\Example\\Exception $e)\n {\n Log::error(\"Could not check if ip address is allowed access for user [\" . $this->getSiteUser()->getId() . \"]. \" . $e);\n return FALSE;\n }\n\t}", "public function canView()\n {\n return !$this->is_private ||\n ( Auth::user() && ( $this->sender_id === Auth::id() || $this->recipient_id === Auth::id() ) );\n }", "public function isViewAllowed()\n {\n return $this->isAllowedAction('view');\n }", "public function authorize()\n {\n return $this->route('address')->userCanView($this->user());\n }", "public function canView()\n {\n return true;\n }", "public function view(User $user)\n {\n if ($user->can('point-list')) {\n return true;\n }\n\n return false;\n }", "public static function hasAccess(): bool\n {\n return in_array(Helper::getClientIP(), self::$ips);\n }", "public function isAccessAllowed()\n\t{\n\t\t$returnValue \t=\tFALSE;\n\n\t\tif($this->isUserIPAddressAllowedAccess())\n\t\t{\n\t\t\t$returnValue\t=\tTRUE;\n\t\t}\n\n\t\treturn $returnValue;\n\t}", "protected function authorizeIp()\n {\n //In unit test REMOTE_ADDR is not available and will return null\n $request = $this->getRequest();\n\n // E.g. command line user\n if (! $request instanceof \\Zend_Controller_Request_Http) {\n return true;\n }\n\n $remoteIp = $request->getServer('REMOTE_ADDR');\n if ($this->util->isAllowedIP($remoteIp, $this->getAllowedIPRanges())) {\n return true;\n }\n\n return $this->_('You are not allowed to login from this location.');\n }", "function userCanViewPage()\n\t{\n\t\t// use Yawp::authUsername() instead of $this->username because\n\t\t// we need to know if the user is authenticated or not.\n\t\treturn $this->acl->pageView(Yawp::authUsername(), $this->area, \n\t\t\t$this->page);\n\t}", "public static function isAllowedViewSite()\n {\n if ((int) SettingService::getSetting('application_disable_site')) {\n $user = UserIdentityService::getCurrentUserIdentity();\n\n if ($user['role'] != AclBaseModel::DEFAULT_ROLE_ADMIN) {\n // get a visitor IP\n $remote = new RemoteAddress;\n $remote->setUseProxy(true);\n\n $userIp = $remote->getIpAddress();\n\n // get list of allowed ACL roles\n if (null != ($allowedAclRoles = SettingService::getSetting('application_disable_site_acl'))) {\n if (!is_array($allowedAclRoles)) {\n $allowedAclRoles = [$allowedAclRoles];\n }\n }\n\n // get list of allowed IPs\n if (null != ($allowedIps = SettingService::getSetting('application_disable_site_ip'))) {\n $allowedIps = explode(',', $allowedIps);\n }\n\n if ($allowedAclRoles || $allowedIps) {\n if (($allowedAclRoles && in_array($user['role'], $allowedAclRoles)) \n || ($allowedIps && in_array($userIp, $allowedIps))) {\n\n return true;\n }\n }\n\n return false;\n }\n }\n\n return true;\n }", "public function hasVip(){\r\n return $this->_has(5);\r\n }", "private function checkIp(){\n\t\tif( !$this->isAuth() ){\n\t\t\treturn false;\n\t\t}\n\t\treturn ( $_SESSION['userIp'] == $_SERVER['REMOTE_ADDR'] );\n\t}", "public function canView($member = null) {\n\t\treturn true;\n\t}", "public function canView($member = null) {\n\t\treturn true;\n\t}", "public function IsViewable() {\r\n return false;\r\n }", "public function canView($member = null) \n {\n return true;\n }", "public function authorize()\n {\n return (Auth::user()->type === User::VENDEDOR);\n }", "public function canViewProfile() {\n\t\treturn (!$this->protectedProfile || WCF::getUser()->userID == $this->userID || UserProfile::isBuddy($this->userID) || WCF::getUser()->getPermission('admin.general.canViewPrivateUserOptions'));\n\t}", "public function canView($member=null) {\n\t\treturn $this->check(__FUNCTION__, $member);\n\t}", "function userCanViewUser( $sessionID, $userID ) {\r\n\t\t$thisUserID = $_SESSION['userid'];\r\n\t\tif($thisUserID == $userID)\r\n\t\t\treturn TRUE;\r\n\t\telse\r\n\t\t\treturn $this->getAccessLevel() > 9;\r\n\t}", "public function canView($member = null)\n {\n return true;\n }", "public function has_access() { \n\n\t\tif (!Access::check('interface','25')) { \n\t\t\treturn false; \n\t\t} \n\t\tif ($this->user == $GLOBALS['user']->id) { \n\t\t\treturn true; \n\t\t} \n\t\telse {\n\t\t\treturn Access::check('interface','100'); \n\t\t} \t\n\n\t\treturn false; \n\n\t}", "function userCanViewInterim( $sessionID ) {\r\n\t\treturn ($this->getAccessLevel() > 7 || $this->getAccessLevel() == 5);\r\n\t}", "public function isViewable()\n {\n return ($this->isPublished() && $this->isActive());\n }", "public function isViewable() {\n\t\tif ($this->isVariable()) {\n\t\t\t$editables = $this->parent->editables();\n\t\t\tif (!empty($editables)) {\n\t\t\t\treturn in_array($this->parsedVarName, $this->parent->viewables());\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function canView()\n\t{\n\t\treturn \\IPS\\Member::loggedIn()->hasAcpRestriction( 'nexus' , 'transactions', 'transactions_manage' );\n\t}", "public function check_access() {\n\n\t\tif (isset($this->current_entity_allowed)) {\n\t\t\treturn apply_filters('minerva_restrict_access_allowed', $this->current_entity_allowed);\n\t\t}\n\n\t\t$this->current_entity_allowed = MKB_Options::option('restrict_on') ?\n\t\t\t(bool) $this->check_entity_access($this->get_current_entity()) :\n\t\t\ttrue; // always allowed if restriction is off\n\n\t\treturn apply_filters('minerva_restrict_access_allowed', $this->current_entity_allowed);\n\t}", "function checkAccess () {\n if ($GLOBALS[\"pagedata\"][\"login\"] == 1) {\n if ($this->userid && $GLOBALS[\"user_show\"] == true) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n return true;\n }\n }", "function checkAccess () {\n if ($GLOBALS[\"pagedata\"][\"login\"] == 1) {\n if ($this->userid && $GLOBALS[\"user_show\"] == true) {\n return true;\n }\n else {\n return false;\n }\n }\n else {\n return true;\n }\n }", "public function authorize()\n {\n $videoId = $this->route('videos');\n\n $exists = Video::where('id', $videoId)->where('user_id', \\Auth::id())->exists();\n if (\\Auth::user()->is_admin) {\n $exists = true;\n }\n\n return true;\n }", "public function canEdit()\n {\n if (!$this->site) {\n return false;\n }\n\n if (!$this->current_user) {\n return false;\n }\n\n if ($this->site->userIsVerified($this->current_user)) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n // $user = app( 'auth' )->user();\n // $rsvp = Rsvp::findOrFail( $this->rsvps );\n\n // return $rsvp->user_id === $user->id;\n return true;\n }", "public static function allowed_in_view(View $view) {\r\n return $view->get('owner') != null;\r\n }", "public static function allowed_in_view(View $view) {\r\n return $view->get('owner') != null;\r\n }", "public static function allowed_in_view(View $view) {\r\n return $view->get('owner') != null;\r\n }", "function canView($user) {\n if($this->isOwner()) {\n return true;\n } // if\n \n return in_array($this->getId(), $user->visibleCompanyIds());\n }", "public function canViewSuggestions(){\n $viewer_id = Engine_Api::_()->user()->getViewer()->getIdentity();\n if(!empty($viewer_id)){\n return true;\n } \n }", "function Verify()\n{\n global $ip;\n if (IsVPN($ip)) die(\"Sorry, but VPNs and/or Proxies aren't allowed!\");\n}", "public function authorize()\n {\n $id = $this->route('id');\n if ($id) {\n $giftList = GiftList::find($id);\n if (!$giftList || $giftList->user->id != Auth::user()->id) {\n return false;\n }\n }\n return true;\n }", "public function canView($member = null)\n {\n return (Security::getCurrentUser() !== null);\n }", "public function canView($member = null)\n {\n return (Security::getCurrentUser() !== null);\n }", "public static function canViewNewTickets()\n\t{\n\t\tif (!auth()->check()) return false;\n\t\t$member = \\PanicHDMember::find(auth()->user()->id);\n\n\t\tif ($member->isAdmin()){\n\t\t\treturn true;\n\t\t}elseif($member->isAgent() and $member->currentLevel() == 2){\n\t\t\tif(Setting::grab('agent_restrict')==1){\n\t\t\t\treturn $member->categories()->wherePivot('autoassign','1')->count()==0 ? false : true;\n\t\t\t}else{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function authorize()\n {\n $user = Auth::user();\n $lecture = Lecture::findOrFail($this->route('lecture'));\n return $user->can('lecture-update') || $user->id == $lecture->user_id;\n }", "function canViewUsers( $sessionID ){\r\n\t\treturn $this->getAccessLevel() > 9;\r\n\t}", "protected function authorizeOrgIp()\n {\n //special case: project user should have no restriction\n if ($this->project->getSuperAdminName() == $this->getLoginName()) {\n return true;\n }\n\n //In unit test REMOTE_ADDR is not available and will return null\n $request = $this->getRequest();\n\n // E.g. command line user\n if (! $request instanceof \\Zend_Controller_Request_Http) {\n return true;\n }\n\n $remoteIp = $request->getServer('REMOTE_ADDR');\n if ($this->util->isAllowedIP($remoteIp, $this->getBaseOrganization()->getAllowedIpRanges())) {\n return true;\n }\n\n return $this->_('You are not allowed to login from this location.');\n }", "function controlAccess() {\n $ip = FILTER_INPUT(INPUT_SERVER, \"REMOTE_ADDR\");\n $whitelist = [\n \"127.0.0.1\",\n \"91.231.229.130\",\n \"176.38.54.30\",\n \"176.38.54.34\",\n \"94.153.222.226\"\n ];\n return array_search($ip, $whitelist) !== false;\n}", "public function canView($member = null)\n {\n if (!$member || !(is_a($member, 'Member')) || is_numeric($member)) {\n $member = Member::currentUser();\n }\n\n // extended access checks\n $results = $this->extend('canView', $member);\n if ($results && is_array($results)) {\n if (!min($results)) {\n return false;\n }\n }\n\n // user needs access to CMS_ACCESS_SecurityAdmin\n if (Permission::checkMember($member, \"CMS_ACCESS_AdminHelpAdmin\")) {\n return true;\n }\n\n return false;\n }", "function access_control_allowed($ip_address) {\n\n\t\t//invalid ip address\n\t\tif (!filter_var($ip_address, FILTER_VALIDATE_IP)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t//get the access control allowed nodes\n\t\t$sql = \"select access_control_node_uuid, access_control_uuid, node_cidr, node_description \";\n\t\t$sql .= \"from v_access_control_nodes \";\n\t\t$sql .= \"where node_type = 'allow' \";\n\t\t$sql .= \"and length(node_cidr) > 0 \";\n\t\t$parameters = null;\n\t\t$database = new database;\n\t\t$allowed_nodes = $database->select($sql, $parameters, 'all');\n\t\tunset($database);\n\n\t\t//default authorized to false\n\t\t$allowed = false;\n\n\t\t//use the ip address to get the authorized nodes\n\t\tif (is_array($allowed_nodes)) {\n\t\t\tforeach($allowed_nodes as $row) {\n\t\t\t\tif (check_cidr($row['node_cidr'], $ip_address)) {\n\t\t\t\t\t//debug info\n\t\t\t\t\t//if ($debug) {\n\t\t\t\t\t//\tprint_r($row);\n\t\t\t\t\t//\techo $ip_address.\"\\n\";\n\t\t\t\t\t//}\n\n\t\t\t\t\t//set the allowed to true\n\t\t\t\t\t$allowed = true;\n\n\t\t\t\t\t//exit the loop\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//return\n\t\treturn $allowed;\n\t}", "public function authorize()\n {\n return $this->user()->can('view', Assignment::class);\n }", "public function canView($member = null) {\n\t\treturn Permission::check('CMS_ACCESS_CMSMain');\n\t}", "function IsVPN($ip)\n{\n $iphub = json_decode(ReadURL(\"https://v2.api.iphub.info/guest/ip/\" . GetUserIP()));\n return $iphub->block;\n}", "public function authorize()\n // can access chef member who is 'logined' and 'chefprofile null === false'\n {\n $loginedUser = Auth::user();\n\n return $loginedUser->user_type === 'chef' && (\n\n is_null($loginedUser->chef) === false\n );\n }", "public function authorize()\n {\n $tag = $this->route()->parameter('tag');\n return Auth::user()->can('view', [Tag::class, $tag]);\n }", "public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }", "static function access(){\n return onapp_has_permission(array('hypervisors', 'hypervisors.read'));\n }", "public function view(User $user, File $file)\n {\n return Permission::anyoneCanAccess($file->id)\n || Permission::userCanAccess($user->id, $file->id);\n }", "public static function currentUserHasAccess() {\n return current_user_can('admin_access');\n }", "public function authorize()\n {\n //Get the 'mark' id\n switch ((int) request()->segment(6)) {\n case 0:\n return access()->allow('deactivate-users');\n break;\n\n case 1:\n return access()->allow('reactivate-users');\n break;\n }\n\n return false;\n }", "public function isAuthorize(){\n $userPlan = $this->request->session()->get('userPlan');\n return ($userPlan >= 1)? true : abort(404) ;\n }", "public function checkIpAllowed()\n {\n $ip_list = $this->options->get('allowed_ips');\n if ($ip_list) {\n $client_ip = $this->request->getClientIp();\n $status = Ip::match($client_ip, explode(',', $ip_list));\n if (!$status) {\n $this->logger->warning('IP Not Allowed');\n $response = Response::create('Access denied for IP: '.$client_ip, 403);\n $response->send();\n exit();\n }\n }\n }", "public function authorize()\n {\n $user = auth('web')->user();\n if ($user && $user->active) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n\n return true;\n\n if ($this->route('self_report')) { // If ID we must be changing an existing record\n return Auth::user()->can('self_report update');\n } else { // If not we must be adding one\n return Auth::user()->can('self_report add');\n }\n\n }", "public function canUserAssignUsage()\n {\n $user = $this->getUser();\n\n return $user->isAdmin || \\in_array('tl_news::usage', $user->alexf, true);\n }", "function checkIfUserCanAccessPage()\n{\n $permissionGranted = false;\n\n $request = Request::path();\n $path = $request[\"path\"];\n $currentUrlString = rtrim(str_replace(Request::server('SCRIPT_NAME'), '', $path), '/');\n\n $getUserPermissions = session()->get('user_permissions');\n\n if (in_array($currentUrlString, $getUserPermissions)) {\n $permissionGranted = true;\n }\n\n return $permissionGranted;\n}", "public function authorize()\n {\n $user = Auth::user();\n $vendor = $user->vendor->first();\n $isOwner = AvailableFacility::where(array(\n 'id' => $this->id,\n 'vendor_id' => $vendor->id\n ))->count();\n if ($isOwner) {\n return true;\n } else {\n return false;\n }\n }", "public function viewableByOwnerOnly();", "public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function view(User $user)\n {\n return $user->hasPermissionTo('experience_view');\n }", "public function user_can_edit() {\n if (has_capability('mod/swipe:manage', $this->context)) {\n return true;\n }\n }", "public function authorize()\n {\n $member = auth()->user()->member;\n return auth()->user()->can('pdg', $member) || auth()->user()->can('manager', $member);\n }", "public function isViewer()\n\t{\n\t\treturn ($this->role == self::ROLE_VIEWER);\n\t}", "abstract protected function canAccess();", "public function hasAccess()\n\t{\n\t\t/* Check Permissions */\n\t\treturn \\IPS\\Member::loggedIn()->hasAcpRestriction( 'core', 'members', 'member_edit' );\n\t}", "public function accessibleByCurrentUser(){\n // return true if AYC user\n if(\\Auth::isSuperAdmin()) return true;\n\n // otherwise check if personally added to this\n $allowedPages = \\Auth::getAllowedPages();\n if(in_array($this->id, $allowedPages)) return true;\n\n // if not specifically added personally to this page\n // check the user group can access this page\n if($this->groupHasPermission(\\Auth::getUserLevel())) return true;\n\n // otherwise return false\n return false;\n\n }", "public function isViewable($id)\n\t{\n\t\t// TODO: Implement isViewable() method.\n\t}", "public function profile_view(User $user)\n {\n return $user->hasPermission('profile-view');\n }", "public function isAccess();", "public function viewAny(User $user)\n {\n return $user->hasPermissionTo('view interview');\n }", "public function view(User $user)\n {\n return $user->hasRole('editor') || $user->hasRole('admin') ||\n $user->canDo('UPDATE_POLLS');\n }", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function canView($member = false) {\n if($member instanceof Member) {\n $memberID = $member->ID;\n } elseif(is_numeric($member)) {\n $memberID = $member;\n } else {\n $memberID = Member::currentUserID();\n }\n\n if($memberID && Permission::checkMember($memberID, array(\"ADMIN\", \"MESSAGE_MANAGE\"))) {\n return true;\n }\n\n return false;\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('MagePal_GuestToCustomer::guesttocustomer');\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('MagePal_GuestToCustomer::guesttocustomer');\n }", "protected function _isAllowed()\n {\n if ($this->_shipment) {\n return $this->_authorization->isAllowed('Temando_Temando::temando_shipments_view');\n } else {\n return $this->_authorization->isAllowed('Temando_Temando::temando_pickups_view');\n }\n }", "public function authorize() {\n\t\t$this->workplace = $this->route('workplace');\n\t\t$this->workFunction = $this->route('workFunction');\n\t\treturn $this->user()->can('update', $this->workplace) && $this->user()->can('update', $this->workFunction);\n\t}", "function access_allowed($ip_address) {\n\t\t//define global variables\n\t\tglobal $debug;\n\n\t\t//invalid ip address\n\t\tif (!filter_var($ip_address, FILTER_VALIDATE_IP)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t//check the cache to see if the address is allowed\n\t\t$cache = new cache;\n\t\tif ($cache->get(\"switch:allowed:\".$ip_address) === 'true') {\n\t\t\t//debug info\n\t\t\tif ($debug) {\n\t\t\t\techo \"address: \".$ip_address.\" allowed by: cache\\n\";\n\t\t\t}\n\n\t\t\t//return boolean true\n\t\t\treturn true;\n\t\t}\n\n\t\t//allow access for addresses with authentication status success\n\t\tif (user_log_allowed($ip_address)) {\n\t\t\t//save address to the cache as allowed\n\t\t\t$cache->set(\"switch:allowed:\".$ip_address, 'true');\n\n\t\t\t//debug info\n\t\t\tif ($debug) {\n\t\t\t\techo \"address: \".$ip_address.\" allowed by: user logs\\n\";\n\t\t\t}\n\n\t\t\t//return boolean true\n\t\t\treturn true;\n\t\t}\n\n\t\t//allow access for addresses that have been unblocked\n\t\t/*\n\t\tif (event_guard_log_allowed($ip_address)) {\n\t\t\t//save address to the cache as allowed\n\t\t\t$cache->set(\"switch:allowed:\".$ip_address, 'true');\n\n\t\t\t//debug info\n\t\t\tif ($debug) {\n\t\t\t\techo \"address: \".$ip_address.\" allowed by: unblocked\\n\";\n\t\t\t}\n\n\t\t\t//return boolean true\n\t\t\treturn true;\n\t\t}\n\t\t*/\n\n\t\t//allow access if the cidr address is allowed\n\t\tif (access_control_allowed($ip_address)) {\n\t\t\t//save address to the cache as allowed\n\t\t\t$cache->set(\"switch:allowed:\".$ip_address, 'true');\n\n\t\t\t//debug info\n\t\t\tif ($debug) {\n\t\t\t\techo \"address: \".$ip_address.\" allowed by: access controls\\n\";\n\t\t\t}\n\n\t\t\t//return boolean true\n\t\t\treturn true;\n\t\t}\n\n\t\t//auto allow if there is a registration from the same IP address\n\t\tif (is_registered($ip_address)) {\n\t\t\t//save address to the cache as allowed\n\t\t\t$cache->set(\"switch:allowed:\".$ip_address, 'true');\n\n\t\t\t//debug info\n\t\t\tif ($debug) {\n\t\t\t\techo \"address: \".$ip_address.\" allowed by: registration\\n\";\n\t\t\t}\n\n\t\t\t//return boolean true\n\t\t\treturn true;\n\t\t}\n\n\t\t//return\n\t\treturn false;\n\t}", "public function authorize()\n {\n return request()->user() != null;\n }", "public function isIpnUrlAccessRestricted()\n {\n return Mage::getStoreConfigFlag(self::GENERAL_SETTINGS_PATH . 'restrictaccess', $this->getStoreId());\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "public function isViewed() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn InputValidator::isEmpty($this->viewDate) ? false: true;\r\n\t}", "public function canMyLikes() {\n $viewer = Engine_Api::_()->user()->getViewer();\n if (!$viewer || !$viewer->getIdentity()) {\n return false;\n }\n\t\treturn true;\n }", "public function hasAccess(): bool;", "public function isPublic()\n {\n $allowsAllHosts = false;\n $allowsRListings = false;\n foreach ($this->rules as $rule) {\n if (self::READ & $rule['mask']) {\n if (!empty($rule['rlistings'])) {\n $allowsRListings = true;\n } elseif (!empty($rule['host']) && trim($rule['host']) == '*') {\n $allowsAllHosts = true;\n }\n }\n }\n\n return $allowsAllHosts && $allowsRListings;\n }" ]
[ "0.74126965", "0.7152955", "0.7127295", "0.7117387", "0.7103212", "0.7093804", "0.70358235", "0.6958197", "0.69511646", "0.6910033", "0.68704885", "0.68690157", "0.68030745", "0.678633", "0.6673828", "0.6595457", "0.65874004", "0.6550776", "0.6531951", "0.6531951", "0.65146554", "0.6504449", "0.65023685", "0.6499595", "0.64881754", "0.64656556", "0.6445196", "0.6437205", "0.6396543", "0.63635427", "0.6346201", "0.6343608", "0.63399416", "0.6327466", "0.6327466", "0.6321302", "0.6315939", "0.6313259", "0.6309366", "0.6309366", "0.6309366", "0.630904", "0.6296002", "0.62785697", "0.62775576", "0.62631077", "0.62631077", "0.6255318", "0.6235517", "0.6233405", "0.62226814", "0.6219999", "0.6217094", "0.6207331", "0.62062055", "0.61970687", "0.61910605", "0.6190395", "0.6190077", "0.6180629", "0.6173679", "0.6167653", "0.6163818", "0.6162724", "0.6161177", "0.61525786", "0.6149253", "0.6140624", "0.613749", "0.61299956", "0.61277896", "0.6119657", "0.6114559", "0.61103374", "0.6107495", "0.610681", "0.6099163", "0.6097007", "0.6089807", "0.60788935", "0.6075839", "0.606763", "0.6066923", "0.60649693", "0.60608196", "0.605942", "0.605942", "0.60578287", "0.6052782", "0.6052782", "0.6050643", "0.60448724", "0.6042251", "0.6038289", "0.603323", "0.6027898", "0.6022675", "0.6008007", "0.6005776", "0.5996622" ]
0.61047715
76
Determine whether the user can update the vip.
public function update(User $user) { return in_array('update', $user->permissibles('vip')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update(): bool\n {\n return $this->isAllowed(self::UPDATE);\n }", "function check_user() {\n\treturn false; // update allowed\n\treturn true; //no update allowed\n}", "protected function _isAllowed()\r\n {\r\n return $this->_authorization->isAllowed('AAllen_PriceUpdate::update');\r\n }", "public function isUpdateSecurityRelevant() {}", "public function authorize()\n {\n if (auth()->user()->can('update')) {\n return true;\n }\n\t\t\n\t\treturn false;\n }", "public function authorize()\n {\n return $this->user()->canUpdateSecurity();\n }", "function canUpdateUser($userid){\r\n\t\t$permissions = new dkpUserPermissions();\r\n\t\t$permissions->loadUserPermissions($userid);\r\n\r\n\t\t//make sure we are trying to edit a user who really belongs to our guild\r\n\t\tif($permissions->guildid != $this->guild->id || !$this->HasPermission(\"AccountSecondaryUsers\"))\r\n\t\t\treturn false;\r\n\t\treturn true;\r\n\t}", "static function canUpdate() {\n // as users can update their onw items\n return Session::haveRightsOr(self::$rightname, [\n CREATE,\n UPDATE,\n self::MANAGE_BG_EVENTS\n ]);\n }", "public function authorize()\n {\n return $this->user()->can('update_users');\n }", "function updatesAllowed() {\n\t\treturn $this->getupdatable() == 1 ? true : false;\n\t}", "public function authorizePatch()\n {\n return $this->user()->can('acme.update');\n }", "public function authorize()\n {\n return $this->user()->can('update', $this->user());\n }", "function update_access_allowed() {\n global $update_free_access, $user;\n\n // Allow the global variable in settings.php to override the access check.\n if (!empty($update_free_access)) {\n return TRUE;\n }\n // Calls to user_access() might fail during the Drupal 6 to 7 update process,\n // so we fall back on requiring that the user be logged in as user #1.\n try {\n require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'user') . '/user.module';\n return user_access('administer software updates');\n }\n catch (Exception $e) {\n return ($user->uid == 1);\n }\n}", "function update_access_allowed() {\n global $update_free_access, $user;\n\n // Allow the global variable in settings.php to override the access check.\n if (!empty($update_free_access)) {\n return TRUE;\n }\n // Calls to user_access() might fail during the Drupal 6 to 7 update process,\n // so we fall back on requiring that the user be logged in as user #1.\n try {\n require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'user') . '/user.module';\n return user_access('administer software updates');\n }\n catch (Exception $e) {\n return ($user->uid == 1);\n }\n}", "public function authorize()\n {\n return $this->user()->can('update', $this->route('user'));\n }", "public function canEdit()\n {\n if (!$this->site) {\n return false;\n }\n\n if (!$this->current_user) {\n return false;\n }\n\n if ($this->site->userIsVerified($this->current_user)) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n return $this->user()->can('update', \\App\\Models\\Member::withTrashed()->find($this->id));\n }", "public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "protected function canUpdate()\n {\n return $this->hasStrategy(self::STRATEGY_UPDATE);\n }", "public function authorize() {\n\t\t$this->workplace = $this->route('workplace');\n\t\t$this->workFunction = $this->route('workFunction');\n\t\treturn $this->user()->can('update', $this->workplace) && $this->user()->can('update', $this->workFunction);\n\t}", "public function authorize()\n {\n $user = \\Auth::user();\n \n if($user->can('update', \\App\\Product::class)){\n return true;\n }\n \n return false;\n }", "public function authorize()\n {\n // who can update ??\n // 1- admin\n if (auth()->user()->isAdmin()) {\n return true;\n }\n\n // 2- creator\n if ($this->offerItem->created_by == auth()->user()->id) {\n return true;\n }\n\n return false;\n }", "public function update(User $user)\n {\n if ($user->can('update plans')) {\n return true;\n }\n }", "public function update(User $user)\n {\n return $user->hasAccess(['update-zones']);\n }", "public function update(User $user)\n {\n if ($user->can('update_permission') || $user->can('manage_permissions')) {\n return true;\n }\n\n return false;\n }", "private function validateUpdate() {\n\t\t$this->context->checkPermission(\\Scrivo\\AccessController::WRITE_ACCESS);\n\t}", "protected function canUpdate(){\n $emptyComment = $this->getEmptyComment();\n\n return $this->canUserModify() &&\n ($this->isActive() || $this->isPending() ||\n ($this->isSuspended() && parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS, $emptyComment))) &&\n !$this->isDeleted() &&\n $this->isQuestionActive() &&\n $this->socialQuestion->SocialPermissions->isUnlockedOrUserCanChangeLockStatus() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE, $emptyComment);\n }", "public function authorize(): bool\n {\n return Gate::allows('update', $this->product);\n }", "public function authorize() {\n\t\t$this->competitor = $this->route('competitor');\n\t\treturn $this->user()->can('update', $this->competitor);\n\t}", "public function authorize()\n {\n $person = $this->findFromUrl('person');\n\n return $this->user()->can('update', $person);\n }", "public function update(User $user)\n {\n return $user->can('update_customer');\n }", "function canUpdateItem() {\n\n $ticket = new Ticket();\n if (!$ticket->getFromDB($this->fields['tickets_id'])) {\n return false;\n }\n\n // you can't change if your answer > 12h\n if (!is_null($this->fields['date_answered'])\n && ((strtotime(\"now\") - strtotime($this->fields['date_answered'])) > (12*HOUR_TIMESTAMP))) {\n return false;\n }\n\n if ($ticket->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID())\n || ($ticket->fields[\"users_id_recipient\"] === Session::getLoginUserID() && Session::haveRight('ticket', Ticket::SURVEY))\n || (isset($_SESSION[\"glpigroups\"])\n && $ticket->haveAGroup(CommonITILActor::REQUESTER, $_SESSION[\"glpigroups\"]))) {\n return true;\n }\n return false;\n }", "public function isUserIPAddressAllowedAccess()\n\t{\n\t\ttry\n {\n $IpBin = new IpBin();\n return $IpBin->isUserIPAddressAllowedAccess($this->getSiteUser()->getId());\n }\n catch(\\Whoops\\Example\\Exception $e)\n {\n Log::error(\"Could not check if ip address is allowed access for user [\" . $this->getSiteUser()->getId() . \"]. \" . $e);\n return FALSE;\n }\n\t}", "public function get_update_availability()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n $payload = $this->request('CheckForUpdate');\n\n if (preg_match('/' . self::CONSTANT_DO_UPDATE . 'true/i', $payload))\n return TRUE;\n else\n return FALSE;\n }", "protected function canUpdateStatus() {\n return $this->canUpdate() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS, $this->getEmptyComment());\n }", "public function canEdit()\n {\n return $this->is_locked == 0;\n }", "public function can_edit() {\n\t\t$can_edit = false;\n\t\t\n\t\t// is the user the owner of the package and the package is in edit mode?\n\t\tif ( ($this->get_user_id() == get_current_user_id()) && ($this->status == 1) ) {\n\t\t\t$can_edit = true;\n\t\t} else {\n\t\t\t// is the user an admin (has the right to edit all packages)\n\t\t\tif ( current_user_can( 'pvm_edit_other_packages' ) ) {\n\t\t\t\t$can_edit = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $can_edit;\n\t}", "public function update(User $user)\n {\n if($user->can('carts-update') || $user->can('cart-update')) {\n return true;\n }\n return false;\n }", "public function authorize(): bool\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function user_can_edit() {\n if (has_capability('mod/swipe:manage', $this->context)) {\n return true;\n }\n }", "public function authorize(): bool\n {\n // only allow updates if the user is logged in\n return Auth::check();\n }", "public function canBeUpdated()\n {\n return $this->isNotYetSubmitted();\n }", "function canEdit() {\r\n\t\tif($this->owner->ID == Member::currentUserID())\r\n\t\t\treturn true;\r\n\r\n\t\t$member = Member::currentUser();\r\n\t\tif($member)\r\n\t\t\treturn $member->isAdmin();\r\n\r\n\t\treturn false;\r\n\t}", "abstract public function isUpdatableByUser(User $user);", "function allowUpdate($allow){\n\t\t$this->canUpdate=$allow;\n\t}", "public function canModifyVisibilityOfUsers();", "public function authorize()\n {\n $user = Auth::user();\n\n if(!$user->can('update-role')) {\n return false;\n }\n\n return true;\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "private function checkIp(){\n\t\tif( !$this->isAuth() ){\n\t\t\treturn false;\n\t\t}\n\t\treturn ( $_SESSION['userIp'] == $_SERVER['REMOTE_ADDR'] );\n\t}", "public function update(User $user, $id)\n {\n if ($user->id == $id || $user->hasPermission('update_' . $this->name)) {\n return true;\n }\n\n return abort(403, __('messages.access-denied'));\n }", "public function updatePolicy(User $user)\n {\n return $user->may(static::PERMISSION_UPDATE);\n }", "public function authorize(): bool\n {\n return $this->user()->can('update_contact');\n }", "private function allowModify()\n { \n if($this->viewVar['loggedUserRole'] <= 40 )\n {\n return TRUE;\n }\n else\n {\n return FALSE;\n }\n }", "public function authorize()\n {\n return auth()->user()->can('update online assessment');\n }", "public function authorize()\n {\n $article = Article::find($this->route('article'));\n return $article && $this->user()->can('update', $article);\n }", "public function update(User $user)\n {\n //\n if(!$user->isAdmin()){\n return true;\n }\n\t return app(Gate::class)->authorize('financial.exchangeRate.setting');\n }", "public function isUpdateRequired();", "public function update(User $user)\n {\n return $user->hasPermission('tag-update');\n }", "public function update(User $user): bool\n {\n return $user->can('Update Role');\n }", "public function update(User $user)\n {\n return $user->hasPermissionTo('experience_edit');\n }", "public function authorize()\n {\n $user = Auth::user();\n $lecture = Lecture::findOrFail($this->route('lecture'));\n return $user->can('lecture-update') || $user->id == $lecture->user_id;\n }", "public function update(User $user)\n {\n if ($this->role($user)){\n return $user->hasDirectPermission($this->permission_list['update']);\n }\n }", "private function _is_api_request_allowed()\n\t{\n\t\t// STEP 1: Check to see if site is private\n\t\tif(Kohana::config('settings.private_deployment'))\n\t\t{\n\t\t\tif ( ! $this->_login())\n\t\t\t{\n\t\t\t\t// @todo better error message\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// STEP 2: Check if the IP has been banned\n\t\t$banned_count = ORM::factory('api_banned')\n\t\t\t\t\t\t->where('banned_ipaddress', $this->request_ip_address)\n\t\t\t\t\t\t->count_all();\n\n\t\tif ($banned_count > 0)\n\t\t\treturn FALSE;\n\n\t\t// STEP 3: Check if the IP address has exceeded the request quota\n\n\t\t// Get the API settings\n\t\t$api_settings = new Api_Settings_Model(1);\n\n\t\t// Check if an API request quota has been set\n\t\tif ( ! isset ($api_settings->max_requests_per_ip_address))\n\t\t\treturn TRUE;\n\n\t\t// Get the API request quota\n\t\t$request_quota = $api_settings->max_requests_per_ip_address;\n\n\t\t// Get the quota basis\n\t\t$quota_basis = (isset($api_settings->max_requests_quota_basis))\n\t\t\t? $api_settings->max_requests_quota_basis\n\t\t\t: NULL;\n\n\t\t$num_api_requests = -1; // Will hold the number of API requests for the specified IP\n\n\t\t// Database table prefix\n\t\t$table_prefix = Kohana::config('database.default.table_prefix');\n\n\t\t// Template query\n\t\t$template_query = \"SELECT COUNT(*) AS record_count \";\n\t\t$template_query .= \"FROM \".$table_prefix.\"api_log \";\n\t\t$template_query .= \"WHERE DATE_FORMAT(api_date, '%s') = '%s' \";\n\t\t$template_query .= \"AND api_ipaddress = '\".$this->request_ip_address.\"'\";\n\n\t\t// Get the number of api requests logged depending on the quota basis\n\t\tswitch ($quota_basis)\n\t\t{\n\t\t\t// Per day quota\n\t\t\tcase 0:\n\t\t\t\t$items = $this->db->query(sprintf($template_query, '%Y-%m-%d', date('Y-m-d', time())));\n\t\t\t\t$num_api_requests = (int)$items[0]->record_count;\n\t\t\tbreak;\n\n\t\t\t// Per month quota\n\t\t\tcase 1:\n\t\t\t\t$items = $this->db->query(sprintf($template_query, '%Y-%m', date('Y-m', time())));\n\t\t\t\t$num_api_requests = (int)$items[0]->record_count;\n\t\t\tbreak;\n\t\t}\n\n\t\t// Return value\n\t\treturn ($num_api_requests >= $request_quota)? FALSE : TRUE;\n\t}", "public function checkIpAllowed()\n {\n $ip_list = $this->options->get('allowed_ips');\n if ($ip_list) {\n $client_ip = $this->request->getClientIp();\n $status = Ip::match($client_ip, explode(',', $ip_list));\n if (!$status) {\n $this->logger->warning('IP Not Allowed');\n $response = Response::create('Access denied for IP: '.$client_ip, 403);\n $response->send();\n exit();\n }\n }\n }", "public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function update($user, $model)\n {\n if( $user->hasPermissionTo('update ' . static::$key) ) {\n return true;\n }\n\n return false;\n }", "public function update(User $user)\n {\n return $user->admin == false;\n }", "public function update(User $user)\n {\n return $user->hasAccess('update-conference-permission');\n }", "public function update(User $user, File $file)\n {\n return Permission::anyoneCanAccess($file->id)\n || Permission::userCanAccess($user->id, $file->id, \"write\");\n }", "public function isRemoteCheckRequired()\n {\n if ($this->uid && $this->sessionToken && $this->recheck) {\n if($this->recheck > (new DateTime('NOW'))) {\n return false;\n }\n }\n\n return true;\n }", "public function view(User $user, $id)\n {\n if ($user->id == $id || $user->hasPermission('update_' . $this->name)) {\n return true;\n }\n\n return abort(403, __('messages.access-denied'));\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return \\Auth::check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return \\Auth::check();\n }", "public function can_manage() {\n\t\t$can_manage = false;\n\t\t\n\t\t// is the user the owner of the package\n\t\tif ( ( $this->get_user_id() == get_current_user_id() ) && ( $this->status < 6 ) && ( $this->status > 0 ) ) {\n\t\t\t$can_manage = true;\n\t\t} else {\n\t\t\t// is the user an admin (has the right to edit all packages)\n\t\t\tif ( current_user_can( 'pvm_manage_other_packages' ) ) {\n\t\t\t\t$can_manage = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $can_manage;\n\t}", "public function executeUpdate(): bool\n {\n $this->updateDaysallowedField();\n return true;\n }", "public function iN_UpdateIpLimitStatus($userID, $mod) {\n\t\tif ($this->iN_CheckIsAdmin($userID) == 1) {\n\t\t\tmysqli_query($this->db, \"UPDATE i_configurations SET ip_limit = '$mod' WHERE configuration_id = '1'\") or die(mysqli_error($this->db));\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function can_do_updatemultiple() {\n $id = $this->required_param('id');\n return cmclasspage::_has_capability('block/curr_admin:track:enrol', $id);\n }", "function userCanModifyFW( $sessionID ) {\r\n\t\tif($this->getAccessLevel() >= 8) return true;\r\n return false;\r\n\t}", "public function update(User $user, Region $region)\n {\n return $user->isAdmin() || $user->isSupervisor();\n }", "public function isAllowedToChangeTemplate() {\n \treturn ($this->settings->tpl_ajax_template_change == 2 || ($this->settings->tpl_ajax_template_change && isset($_SESSION['User'])));\t\n }", "public function hasVip(){\r\n return $this->_has(5);\r\n }", "protected function isPowerUser()\n {\n return $this->user->can('sys_properties_edit', $this->app->modules[$this->area]);\n }", "public function authorize()\n {\n if ($this->route()->getName() === 'home.update') {\n $post = Post::findOrFail($this->id);\n return Auth::check() && Auth::user()->isAdminOrOwner($post->user_id);\n }\n return Auth::check();\n }", "public static function hasAccess(): bool\n {\n return in_array(Helper::getClientIP(), self::$ips);\n }", "public function hasAccess() : bool\n\t{\n\t\t$ip = Server::getIP();\n\t\t$access = false;\n\n\t\t// Allow local access\n\t\tif ( Stringify::contains(['127.0.0.1','::1'], $ip) ) {\n\t\t\t$access = true;\n\n\t\t} else {\n\n\t\t\t// Check allowed IPs\n\t\t\t$allowed = $this->applyFilter('access-allowed-ip', $this->getAllowedAccess());\n\t\t\tif ( !empty($allowed) ) {\n\t\t\t\tif ( Stringify::contains($allowed, $ip) ) {\n\t\t\t\t\t$access = true;\n\n\t\t\t\t} else {\n\t\t\t\t\t$access = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t// Deny access\n\t\t\t\t$denied = $this->applyFilter('access-denied-ip', $this->getDeniedAccess());\n\t\t\t\tif ( Stringify::contains($denied, $ip) ) {\n\t\t\t\t\t$access = false;\n\n\t\t\t\t} else {\n\t\t\t\t\t$access = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$data = ['ip' => $ip, 'access' => $access];\n\t\t$this->doAction('ip-access', $data);\n\t\treturn $access;\n\t}", "public function authorize()\n {\n if ($this->user()->is_admin){\n return true;\n }\n else if ($this->method == \"PUT\"){\n if ($this->user()->id == $this->input('id')){\n return true;\n }\n }\n return false;\n }", "public function authorize(): bool\n {\n return Auth::check() && Auth::user()->can('web.user.transcripts.update');\n }", "public function update(User $user)\n {\n return $user->hasPermissionTo('update campaign');\n }", "public function update(User $user, User $model): bool\n {\n return $user->isRole('admin') || (\n $user->is($model) &&\n $user->tokenCan('users:update')\n );\n }", "public function authorize()\n {\n return $this->user()->hasPermission('update-title');\n }", "public function canUpdate(IdentityInterface $user, sketch $sketch)\n {\n return true;\n }", "public function update(User $user, Ruvid $ruvid)\n {\n // Update $user authorization to update $ruvid here.\n return true;\n }" ]
[ "0.72160465", "0.7025353", "0.6918185", "0.68928015", "0.6877601", "0.68297684", "0.6785628", "0.6779692", "0.6771634", "0.6750269", "0.67261654", "0.67211497", "0.6712063", "0.6712063", "0.66922325", "0.66878825", "0.66600496", "0.6655419", "0.6600401", "0.65161073", "0.6495615", "0.64541173", "0.64294505", "0.6420162", "0.64149725", "0.63783795", "0.6366829", "0.63595325", "0.6351174", "0.63389885", "0.6282659", "0.62728935", "0.62708175", "0.62521344", "0.6250926", "0.6224914", "0.62219495", "0.62172526", "0.6184712", "0.6179878", "0.61524236", "0.6142738", "0.6138988", "0.6133859", "0.6110894", "0.6076266", "0.605693", "0.60364836", "0.60364836", "0.60364836", "0.60364836", "0.60364836", "0.60364836", "0.60364836", "0.60364836", "0.60364836", "0.6023201", "0.60180134", "0.60029167", "0.60016185", "0.59993297", "0.59955055", "0.59927404", "0.5983417", "0.59746647", "0.59665906", "0.59583116", "0.59357905", "0.59304523", "0.5907659", "0.5902982", "0.5897054", "0.5890258", "0.5884457", "0.58814025", "0.58717096", "0.5860363", "0.5860166", "0.5859991", "0.58558244", "0.58558244", "0.58505464", "0.5843896", "0.58372307", "0.5833574", "0.58275515", "0.58240366", "0.5814205", "0.58090734", "0.5808018", "0.58035475", "0.5800921", "0.5786368", "0.5786123", "0.57810545", "0.5774977", "0.5770862", "0.5764221", "0.57596815", "0.57497466" ]
0.7579372
0
this up() migration is autogenerated, please modify it to your needs
public function up(Schema $schema) : void { $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('CREATE TABLE comment_comment_images (comment_id INT NOT NULL, comment_images_id INT NOT NULL, INDEX IDX_224FF7B1F8697D13 (comment_id), INDEX IDX_224FF7B13D31E4B3 (comment_images_id), PRIMARY KEY(comment_id, comment_images_id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); $this->addSql('ALTER TABLE comment_comment_images ADD CONSTRAINT FK_224FF7B1F8697D13 FOREIGN KEY (comment_id) REFERENCES comment (id) ON DELETE CASCADE'); $this->addSql('ALTER TABLE comment_comment_images ADD CONSTRAINT FK_224FF7B13D31E4B3 FOREIGN KEY (comment_images_id) REFERENCES comment_images (id) ON DELETE CASCADE'); $this->addSql('ALTER TABLE comment DROP FOREIGN KEY FK_9474526C3DA5256D'); $this->addSql('DROP INDEX IDX_9474526C3DA5256D ON comment'); $this->addSql('ALTER TABLE comment DROP image_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function up();", "abstract public function up();", "abstract public function up();", "abstract public function up();", "public function up()\n {\n $this->execute(\"\n ALTER TABLE `tcmn_communication` \n CHANGE `tcmn_pprs_id` `tcmn_pprs_id` SMALLINT(5) UNSIGNED NULL COMMENT 'person',\n CHANGE `tcmn_tmed_id` `tcmn_tmed_id` TINYINT(4) UNSIGNED NULL COMMENT 'medijs';\n \");\n }", "public function up()\n {\n // This migration was removed, but fails when uninstalling plugin\n }", "public function up()\n {\n $this->execute(\"\n\n ALTER TABLE `cucp_user_company_position` \n ADD COLUMN `cucp_role` CHAR(20) NULL AFTER `cucp_name`;\n\n \");\n }", "public function up()\n\t{\n\t\t$this->dbforge->add_column($this->table, $this->field);\n\t}", "public function migrateUp()\n {\n //$this->migrate('up');\n $this->artisan('migrate');\n }", "public function up()\n {\n dbexec('ALTER TABLE #__subscriptions_coupons\n ADD `created_on` datetime DEFAULT NULL AFTER `usage`,\n ADD `created_by` bigint(11) unsigned DEFAULT NULL AFTER `created_on`,\n ADD INDEX `created_by` (`created_by`),\n ADD `modified_on` datetime DEFAULT NULL AFTER `created_by`,\n ADD `modified_by` bigint(11) unsigned DEFAULT NULL AFTER `modified_on`,\n ADD INDEX `modified_by` (`modified_by`) \n ');\n \n dbexec('ALTER TABLE #__subscriptions_vats\n ADD `created_on` datetime DEFAULT NULL AFTER `data`,\n ADD `created_by` bigint(11) unsigned DEFAULT NULL AFTER `created_on`,\n ADD INDEX `created_by` (`created_by`),\n ADD `modified_on` datetime DEFAULT NULL AFTER `created_by`,\n ADD `modified_by` bigint(11) unsigned DEFAULT NULL AFTER `modified_on`,\n ADD INDEX `modified_by` (`modified_by`) \n ');\n }", "public function up()\n\t{\n\t\t$this->dbforge->modify_column($this->table, $this->field);\n\t}", "public function safeUp()\n {\n $this->createTable(\n $this->tableName,\n [\n 'id' => $this->primaryKey(),\n 'user_id' => $this->integer(). ' UNSIGNED NOT NULL' ,\n 'source' => $this->string()->notNull(),\n 'source_id' => $this->string()->notNull(),\n ],\n 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB'\n );\n\n $this->addForeignKey('fk_social_auth_user_id_to_user_id', $this->tableName, 'user_id', '{{%user}}', 'id', 'CASCADE', 'CASCADE');\n }", "public function up()\n {\n }", "public function up()\n {\n $user = $this->table('products', ['collation' => 'utf8mb4_persian_ci', 'engine' => 'InnoDB']);\n $user\n ->addColumn('name', STRING, [LIMIT => 20])\n ->addColumn('count', STRING, [LIMIT => 75])\n ->addColumn('code', STRING, [LIMIT => 100])\n ->addColumn('buy_price', STRING, [LIMIT => 30])\n ->addColumn('sell_price', STRING, [LIMIT => 30])\n ->addColumn('aed_price', STRING, [LIMIT => 50])\n ->addTimestamps()\n ->save();\n }", "public function up()\n {\n // Drop table 'table_name' if it exists\n $this->dbforge->drop_table('lecturer', true);\n\n // Table structure for table 'table_name'\n $this->dbforge->add_field(array(\n 'nip' => array(\n \t'type' => 'VARCHAR(16)',\n\t\t\t\t'null' => true,\n\t\t\t\t'unique' => true\n\t\t\t),\n 'nik' => array(\n \t'type' => 'VARCHAR(16)',\n\t\t\t\t'null' => false,\n\t\t\t\t'unique' => true\n\t\t\t),\n 'name' => array(\n 'type' => 'VARCHAR(24)',\n 'null' => false,\n ),\n\t\t\t'id_study_program' => array(\n\t\t\t\t'type' => 'VARCHAR(24)',\n\t\t\t\t'null' => false,\n\t\t\t)\n\n ));\n $this->dbforge->add_key('nik', true);\n $this->dbforge->create_table('lecturer');\n }", "public function up()\n\t{\n\t\t// are not setting the foreign key constraint, to allow the examination module to work without the intravitreal\n\t\t// injection module being installed\n\t\t$this->addColumn('et_ophciexamination_injectionmanagementcomplex', 'left_treatment_id', 'int(10) unsigned');\n\t\t$this->addColumn('et_ophciexamination_injectionmanagementcomplex', 'right_treatment_id', 'int(10) unsigned');\n\t}", "public function safeUp()\n {\n $this->createTable('tbl_hand_made_item',\n [\n \"id\" => \"int(11) NOT NULL AUTO_INCREMENT PRIMARY KEY\",\n \"price\" => \"integer\",\n \"discount\" => \"integer\",\n \"preview_id\" => \"integer\",\n \"name\" => \"string\",\n \"description\" => \"text\",\n \"short_description\" => \"text\",\n \"slug\" => \"string\",\n ]\n );\n }", "public function preUp()\n {\n }", "public function up()\n\t{\n\t\t// create the purchase_order_details table\n\t\tSchema::create('purchase_order_details', function($table) {\n\t\t\t$table->engine = 'InnoDB';\n\t\t $table->increments('id');\t\t \n\t\t $table->integer('purchase_order_id')->unsigned();//->foreign()->references('id')->on('orders');\n\t\t $table->integer('product_id')->unsigned();//->foreign()->references('id')->on('products');\n\t\t $table->integer('quantity');\t\t \t \n\t\t $table->integer('created_by')->unsigned();//->foreign()->references('id')->on('users');\t\t \n\t\t $table->integer('updated_by')->unsigned();\n\t\t $table->timestamps();\t\t \n\t\t});\t\n\t}", "public function up()\n {\n if (!$this->isEdu()) {\n return;\n }\n \n $this->edu_up();\n }", "public function up()\n\t{\t\t\n\t\tDB::table('professor')->insert(array(\n\t\t\t'user_id'=>'2',\t\t\t\n\t\t\t'created_at'=>date('Y-m-d H:m:s'),\n\t\t\t'updated_at'=>date('Y-m-d H:m:s')\n\t\t));\t\t\n\n\t\tDB::table('professor')->insert(array(\n\t\t\t'user_id'=>'3',\t\t\t\n\t\t\t'created_at'=>date('Y-m-d H:m:s'),\n\t\t\t'updated_at'=>date('Y-m-d H:m:s')\n\t\t));\n\t\t//\n\t}", "public function up()\n {\n $table = $this->table('qobo_translations_translations');\n $table->renameColumn('object_foreign_key', 'foreign_key');\n $table->renameColumn('object_model', 'model');\n $table->renameColumn('object_field', 'field');\n $table->renameColumn('translation', 'content');\n\n if (!$table->hasColumn('locale')) {\n $table->addColumn('locale', 'char', [\n 'default' => null,\n 'limit' => 6,\n ]);\n }\n $table->update();\n\n $table = TableRegistry::getTableLocator()->get(\"Translations.Translations\");\n $entities = $table->find()->all();\n foreach($entities as $entity) {\n $entity->setDirty('locale', true);\n $table->save($entity);\n }\n }", "public function up()\n {\n $this->addForeignKey('tours_fk', 'tours', 'id', 'tour_to_hotel', 'tour_id');\n\n $this->addForeignKey('t2h_fkh', 'tour_to_hotel', 'hotel_id', 'hotels', 'id');\n $this->addForeignKey('t2h_fkt', 'tour_to_hotel', 'tour_id', 'tours', 'id');\n }", "public function safeUp()\r\n {\r\n $this->createTable('tbl_job_application', array(\r\n 'id' => 'pk',\r\n 'job_id' => 'integer NOT NULL',\r\n 'user_id' => 'integer NULL',\r\n 'name' => 'string NOT NULL',\r\n 'email' => 'text NOT NULL',\r\n 'phone' => 'text NOT NULL',\r\n 'resume_details' => 'text NOT NULL',\r\n 'create_date' => 'datetime NOT NULL',\r\n 'update_date' => 'datetime NULL',\r\n ));\r\n }", "public function up()\n {\n $fields = array(\n 'first_login' => array('type' => 'char', 'constraint' => '1', 'default' => '1'),\n );\n $this->dbforge->add_column('user', $fields);\n }", "public function safeUp() {\n\n $this->createTable('word', [\n 'word_id' => Schema::TYPE_PK,\n 'word_lang_id' => $this->integer(),\n 'word_name' => $this->string(500) . ' NOT NULL',\n 'word_detais' => $this->string(1000),\n ]);\n\n // Add foreign key\n $this->addForeignKey('fk_language_word_1', 'word',\n 'word_lang_id', 'language', 'lang_id', 'CASCADE', 'NO ACTION');\n \n // Create index of foreign key\n $this->createIndex('word_lang_id_idx', 'word', 'word_lang_id');\n }", "public function safeUp()\n {\n $this->alterColumn('item_keuangan', 'created_at', \"TIMESTAMP NOT NULL DEFAULT '2000-01-01 00:00:00'\");\n\n /* Tambah Field */\n $this->addColumn('item_keuangan', 'status', \"TINYINT(1) NOT NULL DEFAULT '1' COMMENT '0=tidak aktif; 1=aktif;' AFTER `jenis`\");\n }", "public function up()\n {\n $this->addForeignKey(\n 'fk_category_product_from_category',\n 'category_product',\n 'category_id',\n 'category',\n 'id',\n 'NO ACTION',\n 'NO ACTION'\n );\n\n $this->addForeignKey(\n 'fk_category_product_from_product',\n 'category_product',\n 'product_id',\n 'product',\n 'id',\n 'NO ACTION',\n 'NO ACTION'\n );\n }", "public function up()\n\t{\n\t\t$this->dropColumn('korzet','utca'); \n\t\t$this->addColumn('korzet','utca','string NOT NULL');\n\t}", "public function up()\n {\n // $this->fields()->create([]);\n // $this->streams()->create([]);\n // $this->assignments()->create([]);\n }", "public function up()\n {\n Schema::table($this->table, function (Blueprint $table) {\n // $table->bigInteger('user_id')->default(0)->after('id'); // Example\n $table->dropColumn([\n // 'user_id', // Example\n ]);\n });\n }", "public function up()\n {\n $table = $this->table('admins');\n $table->addColumn('name', 'string')\n ->addColumn('role', 'string')\n ->addColumn('username', 'string')\n ->addColumn('password', 'string')\n ->addColumn('created', 'datetime')\n ->addColumn('modified', 'datetime', ['null' => true])\n ->create();\n\n\n $data = [ \n [\n 'name' => 'Pedro Santos', \n 'username' => '[email protected]',\n 'password' => '101010',\n 'role' => 'Suporte',\n 'modified' => false\n ],\n ];\n\n $adminTable = TableRegistry::get('Admins');\n foreach ($data as $value) {\n $adminTable->save($adminTable->newEntity($value));\n }\n }", "public function up(): void\n {\n try {\n // SM: We NEVER delete this table.\n if ($this->db->tableExists('prom2_pages')) {\n return;\n }\n $this->db->ForeignKeyChecks(false);\n $statement=$this->db->prepare(\"CREATE TABLE `prom2_pages` (\n `cntPageID` int(10) unsigned NOT NULL AUTO_INCREMENT,\n `txtRelativeURL` varchar(255) NOT NULL COMMENT 'Relative URL',\n `txtTitle` varchar(70) NOT NULL COMMENT 'Title',\n `txtContent` text NOT NULL COMMENT 'Content',\n `blnRobots_DoNotAllow` bit(1) NOT NULL DEFAULT b'1',\n PRIMARY KEY (`cntPageID`),\n UNIQUE KEY `txtRelativeURL` (`txtRelativeURL`),\n KEY `txtTitle` (`txtTitle`)\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\");\n $statement->execute();\n $statement->close();\n $this->db->ForeignKeyChecks(true);\n } catch (\\mysqli_sql_exception $exception) {\n throw $exception;\n }\n }", "public function up()\n\t{\n\t\t// Add data to committee-members\n\t\tDB::table('committee_members')->insert(array(\n\t\t\t'name' => 'Brian O\\'Sullivan',\n\t\t\t'role' => 'Chairman',\n\t\t\t'telephone' => '087-1234567',\n\t\t\t'email' => '[email protected]'\n\t\t));\n\t\tDB::table('committee_members')->insert(array(\n\t\t\t'name' => 'Anthony Barker',\n\t\t\t'role' => 'PRO',\n\t\t\t'telephone' => '087-1234567',\n\t\t\t'email' => '[email protected]'\n\t\t));\t\t\n\t}", "public function up()\n {\n $this->query(\"UPDATE `subscription_types` SET `user_label` = `name` WHERE `user_label` = '' OR `user_label` IS NULL;\");\n\n $this->table('subscription_types')\n ->changeColumn('user_label', 'string', ['null' => false])\n ->update();\n }", "public function safeUp()\n\t{\n $sql = <<<SQL\n alter table r add R8 inte;\nSQL;\n\t\t//$this->execute($sql);\n $sql = <<<SQL\n ALTER TABLE r ADD constraint FK_r8_elgz1 FOREIGN KEY (r8) REFERENCES elgz (elgz1) ON DELETE SET DEFAULT ON UPDATE CASCADE;\nSQL;\n //$this->execute($sql);\n\t}", "public function up()\n\t{\n\t\techo $this->migration('up');\n\n\t\tci('o_role_model')->migration_add('Cookie Admin', 'Cookie Designer and Eater', $this->hash());\n\t\t\n\t\treturn true;\n\t}", "public function up()\n {\n\t\t$this->addColumn('{{%user}}', 'is_super', Schema::TYPE_SMALLINT . \"(1) NULL DEFAULT '0' AFTER `status`\");\n\t\t\n\t\t//Add new column for Option Group table\n\t\t$this->addColumn('{{%option_group}}', 'option_type', Schema::TYPE_STRING . \"(25) NULL DEFAULT 'text' AFTER `title`\");\n\t\t\n\t\t//Add new column for Order table\n\t\t$this->addColumn('{{%order}}', 'is_readed', Schema::TYPE_SMALLINT . \"(1) NULL DEFAULT '0' AFTER `shipment_method`\");\n }", "public function up()\n {\n $this->addColumn(\\backend\\models\\VodProfile::tableName(), 'language', \"char(5) not null default 'en-US'\");\n }", "public function up()\n {\n if (!Schema::hasTable($this->table))\n Schema::create($this->table, function (Blueprint $table)\n {\n $table->integer('parent_id')->unsigned()->index();\n $table->foreign('parent_id')->references('id')->on('organisations')->onDelete('restrict');\n\n $table->integer('child_id')->unsigned()->index();\n $table->foreign('child_id')->references('id')->on('organisations')->onDelete('restrict');\n\n $table->primary(['parent_id','child_id'],'organisation_relations_primary');\n\n $table->timestamps();\n $table->softDeletes();\n\n $table->engine = 'InnoDB';\n });\n }", "public function up(){\n $table = $this->table('users', array('id'=>false, 'primary_key'=>'id'));\n $table->addColumn('id', 'integer', array('identity'=>true, 'signed'=>false));\n $table->addColumn('email', 'string', array('limit'=>100));\n $table->save();\n }", "public function up() { return $this->run('up'); }", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'l_id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\t\t\t\t'model_id' => 'INT UNSIGNED NOT NULL',\n\t\t\t\t'lang_id' => 'VARCHAR(5) NULL DEFAULT NULL',\n\n\t\t\t\t// examples:\n\t\t\t\t'l_label' => 'VARCHAR(200) NULL DEFAULT NULL',\n\t\t\t\t'l_announce' => 'TEXT NULL DEFAULT NULL',\n\t\t\t\t//'l_content' => 'TEXT NULL DEFAULT NULL',\n\n\t\t\t\t'INDEX key_model_id_lang_id (model_id, lang_id)',\n\t\t\t\t'INDEX key_model_id (model_id)',\n\t\t\t\t'INDEX key_lang_id (lang_id)',\n\n\t\t\t\t'CONSTRAINT fk_principles_lang_model_id_to_main_model_id FOREIGN KEY (model_id) REFERENCES ' . $this->relatedTableName . ' (id) ON DELETE CASCADE ON UPDATE CASCADE',\n\t\t\t\t'CONSTRAINT fk_principles_lang_lang_id_to_language_id FOREIGN KEY (lang_id) REFERENCES {{language}} (code) ON DELETE RESTRICT ON UPDATE CASCADE',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}", "public function up()\n\t{\n\t\t// create the purchase_orders table\n\t\tSchema::create('purchase_orders', function($table) {\n\t\t\t$table->engine = 'InnoDB';\n\t\t $table->increments('id');\n\t\t $table->string('order_number', 128);\n\t\t $table->string('approved',50);\n\t\t $table->date('purchase_date');\t\t \t \t\t \t \n\t\t $table->integer('created_by')->unsigned();//->foreign()->references('id')->on('users');\t\t \t\t \n\t\t $table->integer('updated_by')->unsigned();\t\t \n\t\t $table->timestamps();\t\t \n\t\t});\t\n\t}", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\n\t\t\t\t'label' => 'VARCHAR(20) NULL DEFAULT NULL COMMENT \"language label\"',\n\t\t\t\t'code' => 'VARCHAR(5) NOT NULL COMMENT \"language code\"',\n\t\t\t\t'locale' => 'VARCHAR (5) NULL DEFAULT NULL',\n\n\t\t\t\t'visible' => 'TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT \"0 - not visible; 1 - visible\"',\n\t\t\t\t'published' => 'TINYINT(1) UNSIGNED NOT NULL DEFAULT 1 COMMENT \"0 - not published; 1 - published\"',\n\t\t\t\t'position' => 'INT UNSIGNED NOT NULL DEFAULT 0 COMMENT \"order by position DESC\"',\n\t\t\t\t'created' => 'INT UNSIGNED NOT NULL COMMENT \"unix timestamp - creation time\"',\n\t\t\t\t'modified' => 'INT UNSIGNED NOT NULL COMMENT \"unix timestamp - last entity modified time\"',\n\n\t\t\t\t'UNIQUE key_unique_code (code)',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\n\t\t$this->insert('{{language}}', array(\n\t\t\t'label' => 'рус',\n\t\t\t'code' => 'ru',\n\t\t\t'locale' => 'ru',\n\t\t));\n\t}", "public function up()\n {\n $this->execute('Update goods SET price_rub = price WHERE currency_id = 1');\n }", "public function up()\n\t{\n $this->dropColumn('calculo','fecha');\n\n //add column fecha in producto\n $this->addColumn('producto','fecha','date');\n\t}", "public function up(){\n Schema::table('entries', function (Blueprint $table) {\n $table->renameColumn('value', 'entry_value');\n });\n }", "public function safeUp() {\n\t$this->createTable('post', array(\n 'id' =>\"int(11) NOT NULL AUTO_INCREMENT\",\n 'created_on' =>\"int(11) NOT NULL\",\n 'title' =>\"varchar(255) NOT NULL\",\n 'context' =>\"text NOT NULL\",\n \"PRIMARY KEY (`id`)\"\n\t),'ENGINE=InnoDB DEFAULT CHARSET=utf8');\n }", "public function getUpSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nALTER TABLE `department_summary`\n\n CHANGE `twitter_account` `positive_twitter_account` TEXT NOT NULL,\n\n ADD `negative_twitter_account` TEXT NOT NULL AFTER `positive_twitter_account`;\n\nALTER TABLE `tweets`\n\n CHANGE `positive_twitter_account` `twitter_account` TEXT NOT NULL,\n\n DROP `negative_twitter_account`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function up()\n {\n $this->db->createCommand($this->DROP_SQL)->execute();\n $this->db->createCommand($this->CREATE_SQL)->execute();\n }", "public function up()\n {\n $this->db->createCommand($this->DROP_SQL)->execute();\n $this->db->createCommand($this->CREATE_SQL)->execute();\n }", "public function safeUp()\n {\n $this->addColumn('{{%organization}}', 'legal_entity', $this->string()->null());\n $this->addColumn('{{%organization}}', 'contact_name', $this->string()->null());\n $this->addColumn('{{%organization}}', 'about', $this->text()->null());\n $this->addColumn('{{%organization}}', 'picture', $this->string()->null());\n }", "public function up()\n {\n $this->table('agent_order_consignee_address')\n ->addColumn(Column::string('order_number')->setUnique()->setComment('订单编号'))\n \t\t->addColumn(Column::integer('agent_id')->setComment('代理商ID'))\n\t ->addColumn(Column::integer('create_time')->setDefault(1)->setComment('创建时间'))\n\t \n\t ->addColumn(Column::string('consignee_name')->setComment('收货人姓名'))\n\t ->addColumn(Column::string('consignee_phone')->setComment('收货人电话'))\n\t ->addColumn(Column::string('province')->setComment('省份'))\n\t ->addColumn(Column::string('city')->setComment('城市'))\n\t ->addColumn(Column::string('area')->setComment('地区'))\n\t ->addColumn(Column::string('address')->setComment('收货人详细地址'))\n ->create(); \n }", "public function up()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'l_id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\t\t\t\t'model_id' => 'INT UNSIGNED NOT NULL',\n\t\t\t\t'lang_id' => 'VARCHAR(5) NULL DEFAULT NULL',\n\n\t\t\t\t'l_value' => 'TEXT NULL DEFAULT NULL',\n\n\t\t\t\t'INDEX key_model_id_lang_id (model_id, lang_id)',\n\t\t\t\t'INDEX key_model_id (model_id)',\n\t\t\t\t'INDEX key_lang_id (lang_id)',\n\n\t\t\t\t'CONSTRAINT fk_configuration_lang_model_id_to_main_model_id FOREIGN KEY (model_id) REFERENCES ' . $this->relatedTableName . ' (id) ON DELETE CASCADE ON UPDATE CASCADE',\n\t\t\t\t'CONSTRAINT fk_configuration_lang_lang_id_to_language_id FOREIGN KEY (lang_id) REFERENCES {{language}} (code) ON DELETE RESTRICT ON UPDATE CASCADE',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}", "public function safeUp()\r\n {\r\n $this->up();\r\n }", "public function up(){\n // $table->table('kelas')\n // ->addColumn('Id', 'int', \"11\", false, null, true, true)\n // ->addColumn('NamaKelas', 'varchar', \"100\")\n // ->create();\n }", "public function safeUp()\n\t{\n\t\t$this->createTable('pesquisa', array(\n\t\t\t'id' => 'serial NOT NULL primary key',\n\t\t\t'nome' => 'varchar',\n\t\t));\n\t}", "public function safeUp()\n\t{\n\t\t$this->up();\n\t}", "public function up(){\n // $table->table('kelassiswa')\n // ->addColumn('Id', 'int', \"11\", false, null, true, true)\n // ->addColumn('Kelas_Id', 'int', \"11\")\n // ->addColumn('Peserta_Id', 'int', \"11\")\n // ->addForeignKey('Peserta_Id', 'peserta', \"Id\", \"CASCADE\")\n // ->addForeignKey('Kelas_Id', 'kelas', \"Id\")\n // ->create();\n\n }", "public function safeUp()\n {\n $this->up();\n }", "public function safeUp()\n {\n $this->up();\n }", "public function up()\n\t{\n\t\tSchema::table('project_sections', function($t){\n\t\t\t$t->integer('created_by_project_id')->nullable()->unsigned();\n\t\t\t$t->boolean('public')->default(0);\n\n $t->foreign('created_by_project_id')->references('id')->on('projects')->on_delete('SET NULL');\n\t\t});\n\t}", "public function up(){\n\t\tglobal $wpdb;\n\n\t\t$wpdb->query('ALTER TABLE `btm_tasks` ADD COLUMN `last_run` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `date_created`;');\n\t}", "public function up()\n {\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_create');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_mods');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->dropColumn('solder_modpacks');\n });\n\n Schema::table('user_permissions', function ($table) {\n $table->boolean('solder_keys')->default(0);\n $table->boolean('solder_clients')->default(0);\n $table->boolean('modpacks_create')->default(0);\n $table->boolean('modpacks_manage')->default(0);\n $table->boolean('modpacks_delete')->default(0);\n });\n }", "public function up()\n {\n Schema::dropIfExists('db_question_new.t_answer_type');\n Schema::create('db_question_new.t_answer_type', function (Blueprint $table){\n $table->increments('id');\n t_field($table->integer('answer_type_no'),\"答案序号\");\n t_field($table->string('name'),\"步骤名字\");\n t_field($table->integer('subject'),\"科目id\");\n t_field($table->integer('open_flag')->default(1),\"开启与否\");\n }); \n }", "public function up()\n\t{\n\t\t$sql = \"create table tbl_rights\n\t\t\t\t(\n\t\t\t\t\titemname varchar(64) not null,\n\t\t\t\t\ttype integer not null,\n\t\t\t\t\tweight integer not null,\n\t\t\t\t\tprimary key (itemname),\n\t\t\t\t\tforeign key (itemname) references tbl_auth_item (name) on delete cascade on update cascade\n\t\t\t\t)\";\n\t\t $this->execute($sql);\n\t\t \n\t}", "public function safeUp()\n\t{\n\t\t$this->createTable( 'tbl_auth_item', array(\n\t\t \"name\" => \"varchar(64) not null\",\n\t\t \"type\" => \"integer not null\",\n\t\t \"description\" => \"text\",\n\t\t \"bizrule\" => \"text\",\n\t\t \"data\" => \"text\",\n\t\t \"primary key (name)\",\n\t\t));\n\n\t\t$this->createTable(\"tbl_auth_item_child\", array(\n \t\t\"parent\" => \" varchar(64) not null\",\n\t\t\"child\" => \" varchar(64) not null\",\n \t\t\"primary key (parent,child)\",\n\t\t));\n\n\t\t$this->createTable(\"tbl_auth_assignment\",array(\n \t\t\"itemname\" => \"varchar(64) not null\",\n \t\t\"userid\" => \"varchar(64) not null\",\n \t\t\"bizrule\" => \"text\",\n \t\t\"data\"\t => \"text\",\n \t\t\"primary key (itemname,userid)\",\n\t\t));\n\n\t\t$this->addForeignKey('fk_auth_item_child_parent','tbl_auth_item_child','parent','tbl_auth_item','name','CASCADE','CASCADE');\n\t\t$this->addForeignKey('fk_auth_assignment_itemname','tbl_auth_assignment','itemname','tbl_auth_item','name');\n\t\t$this->addForeignKey('fk_auth_assignment_userid','tbl_auth_assignment','userid','tbl_user','id');\n\t}", "public function up()\n {\n // add foreign key for table `articles`\n $this->addForeignKey(\n 'fk-comments-article_id',\n 'comments',\n 'article_id',\n 'article',\n 'id'\n );\n }", "public function safeUp()\r\n\t{\r\n\t\t$this->up();\r\n\t}", "public function up()\n {\n\n $tableOptions = null;\n if ($this->db->driverName === 'mysql') {\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';\n }\n\n $this->createTable($this->createTableName, [\n 'id' => $this->primaryKey(),\n 'name' => $this->string()->notNull(),\n 'type' => $this->integer(1)->notNull(),\n 'location' => $this->text()->defaultValue(null),\n 'description' => $this->text()->defaultValue(null),\n 'created_by' => $this->integer()->notNull(),\n 'start_at' => $this->integer()->defaultValue(null),\n 'active' => $this->boolean()->defaultValue(true),\n\n ],$tableOptions);\n\n\n $this->addColumn($this->updateTableNameHoliday, $this->addColumnOne, $this->integer()->notNull()->after('name'));\n $this->addColumn($this->updateTableNameHoliday, $this->addColumnTwo, $this->integer()->notNull()->after($this->addColumnOne));\n $this->addColumn($this->updateTableNameHolidayConfig, $this->addColumnOne, $this->integer()->notNull()->after('name'));\n $this->addColumn($this->updateTableNameHolidayConfig, $this->addColumnTwo, $this->integer()->notNull()->after($this->addColumnOne));\n\n $moduleInvite = Module::findOne(['name' => 'Actioncalendar', 'slug' => 'actioncalendar']);\n if(empty($moduleInvite)) {\n $this->batchInsert('{{%module}}', ['parent_id', 'name', 'slug', 'visible', 'sorting'], [\n [null, 'Actioncalendar', 'actioncalendar', 1, 22],\n ]);\n }\n\n }", "public function up()\n\t{\n\t\tSchema::table('user_hasil', function($table)\n\t\t{\n\t\t\t$table->create();\n\t\t\t$table->integer('user_id');\n\t\t\t$table->string('grade', 2);\n\t\t\t$table->decimal('hasil', 5, 2);\n\t\t\t$table->year('tahun');\n\t\t\t$table->timestamps();\n\n\t\t\t$table->foreign('user_id')->references('id')->on('users')->on_update('cascade');\n\t\t});\n\t}", "public function safeUp()\r\n {\r\n $tableOptions = null;\r\n if ($this->db->driverName === 'mysql') {\r\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';\r\n }\r\n\r\n $this->createTable('{{%contact_msg}}', [\r\n 'id' => Schema::TYPE_PK,\r\n 'from_email' => Schema::TYPE_STRING . \"(320) NOT NULL\",\r\n 'to_email' => Schema::TYPE_STRING . \"(320) NULL\",\r\n 'subject' => Schema::TYPE_STRING . \"(300) NOT NULL\",\r\n 'text' => Schema::TYPE_TEXT,\r\n 'viewed' => Schema::TYPE_BOOLEAN . \"(1) NOT NULL DEFAULT '0'\",\r\n 'created_at' => Schema::TYPE_TIMESTAMP . \" NULL\",\r\n 'updated_at' => Schema::TYPE_TIMESTAMP . \" NULL\",\r\n ], $tableOptions);\r\n }", "public function up()\n {\n $this->alterColumn('{{%hystorical_data}}', 'project_id', $this->integer());\n\n $this->dropForeignKey('fk-hystorical_data-project_id',\n '{{%hystorical_data}}');\n\n $this->addForeignKey(\n 'fk-hystorical_data-project_id',\n '{{%hystorical_data}}',\n 'project_id',\n '{{%projects}}',\n 'id',\n 'SET NULL'\n );\n }", "public function safeUp()\n {\n $this->createTable('site_phrase', array(\n 'site_id' => self::MYSQL_TYPE_UINT,\n 'phrase' => 'string NOT NULL',\n 'hash' => 'varchar(32)',\n 'price' => 'decimal(10,2) NOT NULL',\n 'active' => self::MYSQL_TYPE_BOOLEAN,\n ));\n\n $this->addForeignKey('site_phrase_site_id', 'site_phrase', 'site_id', 'site', 'id', 'CASCADE', 'RESTRICT');\n }", "public function up()\n\t{\n\t\tSchema::create('flows_steps', function($table) {\n\n\t\t\t$table->engine = 'InnoDB';\n\n\t\t $table->increments('stepid');\n\t\t $table->integer('flowid');\n\t\t $table->string('step', 100);\n\t\t $table->integer('roleid');\n\t\t $table->integer('parentid');\n\t\t $table->integer('state');\n\t\t $table->integer('page');\n\t\t $table->integer('condition2');\n\t\t $table->timestamps();\n\n\t\t});\n\t}", "public function up()\n\t{\n\t\tSchema::table('devices', function($table)\n\t\t{\n\t\t\t$table->string('uuid')->unique;\n\t\t\t$table->drop_column('uid');\n\t\t});\n\t}", "public function up()\n\t{\n\t\t$this->execute(\"\n INSERT INTO `authitem` VALUES('D2finv.FiitInvoiceItem.*', 0, 'Edit invoice items', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FiitInvoiceItem.View', 0, 'View invoice items', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FinvInvoice.*', 0, 'Edit invoice records', NULL, 'N;');\n INSERT INTO `authitem` VALUES('D2finv.FinvInvoice.View', 0, 'View invoice records', NULL, 'N;');\n \n INSERT INTO `authitem` VALUES('InvoiceEdit', 2, 'Edit invoice records', NULL, 'N;');\n INSERT INTO `authitem` VALUES('InvoiceView', 2, 'View invoice records', NULL, 'N;');\n \n INSERT INTO `authitemchild` VALUES('InvoiceEdit', 'D2finv.FiitInvoiceItem.*');\n INSERT INTO `authitemchild` VALUES('InvoiceView', 'D2finv.FiitInvoiceItem.View');\n INSERT INTO `authitemchild` VALUES('InvoiceEdit', 'D2finv.FinvInvoice.*');\n INSERT INTO `authitemchild` VALUES('InvoiceView', 'D2finv.FinvInvoice.View');\n \");\n\t}", "public function up()\n {\n $this->createTable('post',[\n 'id' => $this->primaryKey(),\n 'author_id' => $this->integer(),\n 'title' => $this->string(255)->notNull()->unique(),\n 'content' => $this->text(),\n 'published_at' => $this->dateTime()->defaultExpression('CURRENT_TIMESTAMP'),\n 'updated_at' => $this->dateTime()->defaultExpression('CURRENT_TIMESTAMP'),\n 'status' => \"ENUM('draft','published')\",\n 'image' => $this->string(255)\n ]); \n\n $this->addForeignKey(\n 'fk_post_author_id',\n 'post',\n 'author_id',\n 'user',\n 'id',\n 'CASCADE',\n 'NO ACTION'\n );\n }", "public function up()\n\t{\n// $import->import();\n\t}", "public function up()\n\t{\n\t\tif(Yii::app()->db->getSchema()->getTable(\"{{rights}}\")){\n\t\t\t$this->dropTable(\"authItem\");\n\t\t}\n\n\t\t$this->createTable(\"{{rights}}\", array(\n\t\t\t\"itemname\" => \"varchar(64) CHARACTER SET UTF8 NOT NULL\",\n\t\t\t\"type\"\t => \"int not null\",\n\t\t\t\"weight\" => \"int not null\",\n\t\t\t\"PRIMARY KEY (itemname)\"\n\t\t\t));\n\t}", "public function up() {\r\n\t\t// UP\r\n\t\t$column = parent::Column();\r\n\t\t$column->setName('id')\r\n\t\t\t\t->setType('biginteger')\r\n\t\t\t\t->setIdentity(true);\r\n\t\tif (!$this->hasTable('propertystorage')) {\r\n\t\t\t$this->table('propertystorage', [\r\n\t\t\t\t\t\t'id' => false,\r\n\t\t\t\t\t\t'primary_key' => 'id'\r\n\t\t\t\t\t])->addColumn($column)\r\n\t\t\t\t\t->addColumn('path', 'text', ['limit' => 1024])\r\n\t\t\t\t\t->addColumn('name', 'text', ['limit' => 100])\r\n\t\t\t\t\t->addColumn('valuetype', 'integer',[])\r\n\t\t\t\t\t->addColumn('value', 'text', [])\r\n\t\t\t\t\t->create();\r\n\t\t}\r\n\t}", "public function up()\n {\n $perfis = [\n [\n 'id' => 1,\n 'perfil' => 'Genérico',\n 'ativo' => 1\n ]\n ];\n\n $this->insert('singular_perfil', $perfis);\n\n $usuarios = [\n [\n 'id' => 1,\n 'nome' => 'Singular Framework',\n 'login' => 'singular',\n 'senha' => 'singular',\n 'perfil_id' => 1\n ]\n ];\n\n $this->insert('singular_usuario', $usuarios);\n }", "public function safeUp()\n {\n $this->createTable('user', array(\n 'name' => 'string',\n 'username' => 'string NOT NULL',\n 'password' => 'VARCHAR(32) NOT NULL',\n 'salt' => 'VARCHAR(32) NOT NULL',\n 'role' => \"ENUM('partner', 'admin')\"\n ));\n }", "public function up()\n\t{\n\t\t$demoUser = new User();\n\t\t$demoUser->username = \"demo\";\n\t\t$demoUser->email = '[email protected]';\n\t\t$demoUser->password = 'password';\n\t\t$demoUser->create_time = new CDbExpression('NOW()');\n\t\t$demoUser->update_time = new CDbExpression('NOW()');\n\n\t\t$demoUser->save();\n\n\t\t$adminUser = new User();\n\t\t$adminUser->username = \"admin\";\n\t\t$adminUser->email = '[email protected]';\n\t\t$adminUser->password = 'password';\n\t\t$adminUser->create_time = new CDbExpression('NOW()');\n\t\t$adminUser->update_time = new CDbExpression('NOW()');\n\n\t\t$adminUser->save();\n\n\t}", "public function safeUp()\n {\n $tables = Yii::$app->db->schema->getTableNames();\n $dbType = $this->db->driverName;\n $tableOptions_mysql = \"CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB\";\n\n /* MYSQL */\n if (!in_array('question_tag', $tables)) {\n if ($dbType == \"mysql\") {\n $this->createTable('{{%question_tag}}', [\n 'question_id' => 'INT(11) NOT NULL',\n 'tag_id' => 'INT(11) NOT NULL',\n ], $tableOptions_mysql);\n }\n }\n }", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t'like',\n\t\t\tarray(\n\t\t\t\t'id'=>'int(11) UNSIGNED NOT NULL AUTO_INCREMENT',\n\t\t\t\t'user_id' => 'int(11) UNSIGNED NOT NULL',\n\t\t\t\t'post_id' => 'int (11) NOT NULL',\n\t\t\t\t'status' => 'TINYINT(1)',\n\t\t\t\t'created_at' => 'int(11)',\n\t\t\t\t'updated_at' => 'int(11)',\n\t\t\t\t'PRIMARY KEY (id)',\n\t\t\t\t),\n\t\t\t'ENGINE=InnoDB'\n\n\t\t\t);\n\t}", "public function up()\n\t{\n\t\tSchema::table('entries', function($table) {\n $table->create();\n $table->increments('id');\n $table->string('title', 128);\n $table->string('body');\n $table->integer('users_id')->unsigned();\n $table->index('users_id');\n $table->integer('last_edited_by');\n $table->foreign('users_id')->references('id')->on('users')->on_delete('no action');\n $table->timestamps();\n });\n\t}", "public function up()\n {\n $this->alterColumn(\\app\\models\\EmailImportLead::tableName(), 'password', $this->string()->null());\n $this->alterColumn(\\app\\models\\EmailImportLead::tableName(), 'status', $this->integer()->null());\n }", "public function up()\n {\n\t\t$tableOptions = null;\n if ($this->db->driverName === 'mysql') {\n $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';\n }\n\t\t\n\t\t$TABLE_NAME = 'HaberDeneme12';\n $this->createTable($TABLE_NAME, [\n 'HaberID' => $this->integer(10)->notNull(),\n 'Kategori' => $this->string(12)->notNull(),\n 'Baslik' => $this->string(128)->notNull(),\n 'Ozet' => $this->text()->notNull(),\n 'Detay' => $this->text()->notNull(),\n 'Resim' => $this->text()->notNull(),\n 'EklenmeTarihi' => $this->date(),\n 'GuncellenmeTarihi' => $this->date()\n ], $tableOptions);\n\t\t\n\t\t\n\t\t$TABLE_NAME = 'HaberKategoriDeneme12';\n\t\t $this->createTable($TABLE_NAME, [\n 'KategoriID' => $this->integer(10)->notNull(),\n 'Kategori' => $this->string(20)->notNull()\n ], $tableOptions);\n\t\t\n }", "public function up()\n\t{\n\t\t$fields = array(\n \"`piezas` DECIMAL(3,2) DEFAULT NULL\",\n\n\t\t);\n\t\t$this->dbforge->add_column('rel_monto_servicios', $fields);\n\n\t}", "public function up()\n {\n $this->insert('key_value', [\n 'key' => 'day_feed_count_dnr',\n 'value' => '15',\n ]);\n }", "public function up()\n {\n // 创建操作记录表\n $tables = $this->table('history');\n // 用户动作\n $tables->addColumn('action', 'string', ['limit' => 20])\n ->addColumn('ip', 'string', ['limit' => 129])\n // 建立用户\n ->addColumn('user_id', 'integer')\n // 登录时间\n ->addColumn('operation_time', 'datetime')\n // 操作详情\n ->addColumn('desc', 'string',['limit'=>500,'null' => true])\n ->create();\n }", "public function up()\n {\n $table = $this->table('vehicle_model_suggestions');\n\n if (!$table->exists()) {\n $table\n ->addPrimaryKey('id')\n ->addColumn('vehicle_id', 'integer', ['null' => false])\n ->addColumn('vehicle_model_id', 'integer', ['null' => false])\n ->addColumn('suggestion', 'text')\n ->addTimestamps()\n ->addColumn('deleted_at', 'datetime')\n ->create();\n }\n }", "public function safeUp()\n {\n $this->insert('category',['name'=>'Uncategorized', 'slug'=>'uncategorized', 'description'=>'Default Category', 'created_at'=> new Expression('NOW()'),\n 'updated_at'=> new Expression('NOW()')]);\n $this->insert('user',['username'=>'Administrator', 'password_hash'=>'$2y$13$6yoLjvVORp/7EO1u8phYTuWYzhMSM4LVVsebZgcqEKj/EQLvo5nJK',\n 'email'=>'[email protected]',\n 'created_at'=> new Expression('NOW()'),\n 'updated_at'=> new Expression('NOW()'),\n 'status'=>1\n ]\n );\n }", "public function safeUp()\n {\n $this->createTable($this->tableName, [\n 'post_id' => $this->bigInteger()->notNull(),\n 'category_id' => $this->bigInteger()->notNull(),\n ]);\n\n $this->addForeignKey('post_category_post_id_fk', $this->tableName, 'post_id', '{{%post}}', 'id', 'CASCADE', 'CASCADE');\n $this->addForeignKey('post_category_category_id_fk', $this->tableName, 'category_id', '{{%category}}', 'id', 'CASCADE', 'CASCADE');\n }", "public function up()\n {\n Schema::table('categories', function(Blueprint $table)\n {\n $table->integer('parent_id', false, true)->nullable()->after('cat_order');\n });\n }", "public function safeUp()\n\t{\n\t\t$this->createTable(\n\t\t\t$this->tableName,\n\t\t\tarray(\n\t\t\t\t'id' => 'INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT',\n\n\t\t\t\t'application_id' => 'VARCHAR(32) NOT NULL DEFAULT \"\" COMMENT \"Ид приложения\"',\n\n\t\t\t\t'message' => 'TEXT NOT NULL DEFAULT \"\" COMMENT \"Оригинал\"',\n\t\t\t\t'category' => 'VARCHAR(32) NOT NULL DEFAULT \"\" COMMENT \"Категория\"',\n\t\t\t\t'language' => 'VARCHAR(5) NOT NULL DEFAULT \"\" COMMENT \"Язык\"',\n\t\t\t),\n\t\t\t'ENGINE=InnoDB DEFAULT CHARACTER SET=utf8 COLLATE=utf8_unicode_ci'\n\t\t);\n\t}", "public function up()\n\t{\n\t\t//\n\t\tSchema::create('options',function($table){\n\t\t\t$table->increments('id');\n\t\t\t$table->boolean('activate_pn');\n\t\t\t$table->string('basic_name');\n\t\t\t$table->string('basic_pass');\n\t\t\t$table->timestamps();\n\t\t});\n\n\t\t$o = new Option;\n\t\t$o->activate_pn = 0;\n\t\t$o->save();\n\t}", "public function up() {\n\t\t$this->dbforge->add_field(array(\n\t\t\t'id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t\t'unsigned' => TRUE,\n\t\t\t\t'auto_increment' => TRUE\n\t\t\t),\n\t\t\t'name' => array(\n\t\t\t\t'type' => 'VARCHAR',\n\t\t\t\t'constraint' => '100',\n\t\t\t),\n\t\t\t'path' => array(\n\t\t\t\t'type' => 'VARCHAR',\n\t\t\t\t'constraint' => '100',\n\t\t\t)\n\t\t));\n\t\t$this->dbforge->add_key('id', TRUE);\n\t\t$this->dbforge->add_key('path');\n\t\t$this->dbforge->create_table('categories');\n\n\t\t// Table structure for table 'event_categories'\n\t\t$this->dbforge->add_field(array(\n\t\t\t'event_id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t),\n\t\t\t'category_id' => array(\n\t\t\t\t'type' => 'INT',\n\t\t\t\t'constraint' => '10',\n\t\t\t\t'unsigned' => TRUE,\n\t\t\t),\n\t\t));\n\t\t$this->dbforge->add_key('event_id', TRUE);\n\t\t$this->dbforge->add_key('category_id', TRUE);\n\t\t$this->dbforge->create_table('event_categories');\n\t}", "public function up()\n {\n $this->createTable('usuario_refeicao', [\n 'id' => $this->primaryKey(),\n 'usuario_id' => $this->integer(),\n 'refeicao_id' => $this->integer(),\n 'alimento_id' => $this->integer(),\n 'data_consumo' => $this->date(),\n 'horario_consumo' => $this->time(),\n 'quantidade' => $this->double(5,2),\n 'created_at' => $this->integer(),\n 'updated_at' => $this->integer() \n ]);\n\n $this->addForeignKey('fk_usuariorefeicao_usuario_id', 'usuario_refeicao', 'usuario_id', \n 'user', 'id', 'CASCADE');\n $this->addForeignKey('fk_usuariorefeicao_refeicao_id', 'usuario_refeicao', 'refeicao_id', \n 'refeicoes', 'id', 'CASCADE');\n $this->addForeignKey('fk_usuariorefeicao_alimento_id', 'usuario_refeicao', \n 'alimento_id', 'alimentos', 'id', 'CASCADE');\n }" ]
[ "0.8006627", "0.791524", "0.791524", "0.791524", "0.75730014", "0.75629234", "0.7529499", "0.7499871", "0.7494279", "0.74551433", "0.7447644", "0.7435697", "0.7432973", "0.7429338", "0.74190396", "0.73792154", "0.73769516", "0.73694724", "0.7365056", "0.7352234", "0.73305804", "0.73145753", "0.73004", "0.72967255", "0.72934073", "0.7293224", "0.72929984", "0.7286086", "0.72858834", "0.72744155", "0.7274093", "0.726757", "0.72637796", "0.7263359", "0.7258198", "0.7251566", "0.7249874", "0.72460544", "0.7242336", "0.72390556", "0.7220414", "0.7219169", "0.7206133", "0.72048616", "0.719763", "0.7192553", "0.7191949", "0.7178122", "0.71772486", "0.7168088", "0.7165854", "0.7165854", "0.7161322", "0.7149261", "0.71376073", "0.71309835", "0.7126766", "0.71254545", "0.71179867", "0.7106621", "0.7105991", "0.7105991", "0.7097945", "0.7094479", "0.70903504", "0.7088142", "0.7087532", "0.70846665", "0.7083984", "0.7079035", "0.7072098", "0.70709205", "0.7067515", "0.706364", "0.7060826", "0.70599985", "0.7057598", "0.7056473", "0.7056405", "0.70516217", "0.7049624", "0.7049068", "0.7047871", "0.7046788", "0.70444274", "0.70403147", "0.7039841", "0.7038223", "0.70360017", "0.7034038", "0.70333934", "0.70276994", "0.70157754", "0.7012181", "0.7007616", "0.6990435", "0.6985937", "0.69645053", "0.69627804", "0.6959676", "0.6959529" ]
0.0
-1
this down() migration is autogenerated, please modify it to your needs
public function down(Schema $schema) : void { $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); $this->addSql('DROP TABLE comment_comment_images'); $this->addSql('ALTER TABLE comment ADD image_id INT DEFAULT NULL'); $this->addSql('ALTER TABLE comment ADD CONSTRAINT FK_9474526C3DA5256D FOREIGN KEY (image_id) REFERENCES comment_images (id)'); $this->addSql('CREATE INDEX IDX_9474526C3DA5256D ON comment (image_id)'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function down()\n {\n //add your migration here \n }", "public function down()\n {\n //add your migration here\n }", "public function down()\n\t{\n $this->dropColumn('producto','fecha');\n\n //add column fecha in producto\n $this->addColumn('calculo','fecha','date');\n\t}", "public function down()\n {\n \t\n \t$this->createTable('os', [\n \t\t\t'id' => Schema::TYPE_PK,\n \t\t\t'name' => Schema::TYPE_STRING . ' NOT NULL',\n \t\t\t]);\n \t$this->insert('os', ['id' => 1, 'name' => 'Any']);\n \t$this->insert('os', ['id' => 2, 'name' => 'CentOS']);\n \t$this->insert('os', ['id' => 3, 'name' => 'RHEL']);\n \t$this->insert('os', ['id' => 4, 'name' => 'Fedora']);\n \t \n \t$this->createTable('os_bit', [\n \t\t\t'id' => Schema::TYPE_PK,\n \t\t\t'name' => Schema::TYPE_STRING . ' NOT NULL',\n \t\t\t]);\n\n return false;\n }", "public function down()\n {\n //Schema::dropIfExists('c');//回滚时执行\n\n }", "public function down()\n {\n $this->dbforge->drop_column('user', 'created_at');\n }", "public function down()\n {\n $this->dropForeignKey(\n 'fk-video-blog_id',\n 'video'\n );\n\n\n echo \"m160820_150846_video_create reverted.\\n\";\n\n }", "public function down()\n\t{\nDB::query(\n\"drop table haal;\");\nDB::query(\n\"drop table kandidaat;\");\nDB::query(\n\"drop table haaletaja;\");\nDB::query(\n\"drop table partei;\");\nDB::query(\n\"drop table valimisringkond;\");\n\t}", "public function down()\n\t{\n\t\t// Remove data from committee_members\n\t\tDB::table('committee_members')->where('id', '<', 3)->delete();\t\n\t}", "public function down(){\n $this->dropTable('users');\n }", "public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nALTER TABLE `department_summary`\n\n CHANGE `positive_twitter_account` `twitter_account` TEXT NOT NULL,\n\n DROP `negative_twitter_account`;\n\nALTER TABLE `tweets`\n\n CHANGE `twitter_account` `positive_twitter_account` TEXT NOT NULL,\n\n ADD `negative_twitter_account` INTEGER NOT NULL AFTER `quality_tweet`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function down()\n {\n Schema::table('attachments', function(Blueprint $table) {\n\n $table->dropColumn('viewable_id');\n $table->dropColumn('viewable_type');\n\n\n });\n }", "public function down()\n\t{\n\t\t//Schema::drop('purchase_order_details');\n\t}", "public function getDownSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nDROP TABLE IF EXISTS `movimiento`;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }", "public function down()\n\t{\n//\t\t$this->dbforge->drop_table('blog');\n\n//\t\t// Dropping a Column From a Table\n\t\t$this->dbforge->drop_column('categories', 'icon');\n\t}", "public function down()\n\t{\n\t\t// nothing to do here.\n\t}", "public function down(){\r\n $this->dbforge->drop_table('users'); //eliminacion de la tabla users\r\n }", "public function down()\n\t{\n\t\tSchema::drop('student');\n\t\t//\n\t}", "public function down()\n{\n\nSchema::drop('event_user');\nSchema::drop('events');\nSchema::drop('file');\nSchema::drop('file_ref');\nSchema::drop('groups');\nSchema::drop('project_user');\nSchema::drop('projects');\nSchema::drop('quicknote');\nSchema::drop('subtasks');\nSchema::drop('task_user');\nSchema::drop('tasks');\nSchema::drop('throttle');\nSchema::drop('timesheet');\nSchema::drop('todos');\nSchema::drop('user_profile');\nSchema::drop('users');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\n\n}", "public function down() \n {\n \n }", "public function down()\n\t{\n\t}", "public function down()\n\t{\n\t}", "public function down()\n\t{\n\t\t//\n\t}", "public function down()\n\t{\n\t\t//\n\t}", "public function down()\n\t{\n\t\t//\n\t}", "public function down()\n {\n $this->table('contents')->drop()->save();\n }", "public function down()\n\t{\n\t\tSchema::drop('education');\n\t}", "public function down()\n\t{\n\t\tSchema::drop('l_wardrobe_table');\n\t}", "public function down()\n\t{\n\t\techo $this->migration('down');\n\n\t\tci('o_role_model')->migration_remove($this->hash());\n\t\t\n\t\treturn true;\n\t}", "public function safeDown()\n\t{\n $sql=\" ALTER TABLE `tbl_venta` DROP `punto_venta_id` ;\";\n $this->execute($sql);\n //quitando la columna pto_venta de tbl_empleado\n $sql=\" ALTER TABLE `tbl_empleado` DROP `punto_venta_id` ;\";\n $this->execute($sql);\n\t}", "public function down()\n {\n\tSchema::drop('quizzes');\n }", "public function down()\n {\n $this->output->writeln('Down migration is not available.');\n }", "public function down()\n {\n $this->executeSQL('SET FOREIGN_KEY_CHECKS=0');\n\n $this->executeSQL('DROP TABLE link');\n $this->executeSQL('DROP TABLE link_category');\n\n $this->executeSQL('SET FOREIGN_KEY_CHECKS=1');\n }", "public function down ()\n {\n }", "abstract public function down();", "abstract public function down();", "abstract public function down();", "public function down()\n {\n // This migration was removed, but fails when uninstalling plugin\n }", "public function down()\r\n {\r\n $this->dbforge->drop_table('users');\r\n }", "public function down() {\n\n\t}", "public function down()\n {\n $this->dbforge->drop_table('lecturer', true);\n }", "public function down()\n\t{\n\t\tSchema::drop('flows_steps');\n\t}", "public function down(Schema $schema) : void\n {\n $this->addSql('CREATE TABLE galaxiee (id INT AUTO_INCREMENT NOT NULL, idu_id INT NOT NULL, nom VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_8576D2AF376A6230 (idu_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE trou_noir (id INT AUTO_INCREMENT NOT NULL, id_g_id INT DEFAULT NULL, nom VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`, INDEX IDX_AB27242D95951086 (id_g_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('ALTER TABLE galaxiee ADD CONSTRAINT FK_8576D2AF376A6230 FOREIGN KEY (idu_id) REFERENCES univers (id)');\n $this->addSql('ALTER TABLE trou_noir ADD CONSTRAINT FK_AB27242D95951086 FOREIGN KEY (id_g_id) REFERENCES galaxie (id)');\n $this->addSql('DROP TABLE trounoir');\n $this->addSql('ALTER TABLE galaxie DROP FOREIGN KEY FK_1C880711376A6230');\n $this->addSql('DROP INDEX IDX_1C880711376A6230 ON galaxie');\n $this->addSql('ALTER TABLE galaxie CHANGE idu_id id_u_id INT NOT NULL');\n $this->addSql('ALTER TABLE galaxie ADD CONSTRAINT FK_1C8807116F858F92 FOREIGN KEY (id_u_id) REFERENCES univers (id)');\n $this->addSql('CREATE INDEX IDX_1C8807116F858F92 ON galaxie (id_u_id)');\n $this->addSql('ALTER TABLE planete DROP FOREIGN KEY FK_490E3E5712013DEC');\n $this->addSql('DROP INDEX IDX_490E3E5712013DEC ON planete');\n $this->addSql('ALTER TABLE planete ADD id_s_id INT NOT NULL, ADD nb_sattelite INT NOT NULL, DROP ids_id, DROP nb_satelite');\n $this->addSql('ALTER TABLE planete ADD CONSTRAINT FK_490E3E574AEED04E FOREIGN KEY (id_s_id) REFERENCES systeme (id)');\n $this->addSql('CREATE INDEX IDX_490E3E574AEED04E ON planete (id_s_id)');\n $this->addSql('ALTER TABLE systeme DROP FOREIGN KEY FK_95796DE3CD7AFD24');\n $this->addSql('DROP INDEX IDX_95796DE3CD7AFD24 ON systeme');\n $this->addSql('ALTER TABLE systeme CHANGE idg_id id_g_id INT NOT NULL');\n $this->addSql('ALTER TABLE systeme ADD CONSTRAINT FK_95796DE395951086 FOREIGN KEY (id_g_id) REFERENCES galaxie (id)');\n $this->addSql('CREATE INDEX IDX_95796DE395951086 ON systeme (id_g_id)');\n }", "public function down() {\n $this->dbforge->drop_column('timesheets_items', 'orgID', TRUE);\n $this->dbforge->drop_column('timesheets_items', 'brandID', TRUE);\n $this->dbforge->drop_column('timesheets_items', 'reason_desc', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'orgID', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'brandID', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'reason_desc', TRUE);\n\n // change reason to note\n $fields = array(\n 'reason' => array(\n 'name' => 'note',\n 'type' => \"VARCHAR\",\n 'constraint' => 200,\n 'null' => TRUE\n )\n );\n $this->dbforge->modify_column('timesheets_items', $fields);\n $this->dbforge->modify_column('timesheets_expenses', $fields);\n }", "public function down(): void\n {\n // Remove your data\n }", "public function down()\n\t{\n\t\t//Schema::drop('purchase_orders');\n\t\t//Schema::drop('purchase_order_details');\n\t}", "public function down()\n {\n\tSchema::drop('activities');\n }", "public function down()\n {\n //return false;\n\t\t\n\t\t$TABLE_NAME = 'Haber';\n $this->dropTable($TABLE_NAME);\n\t\t\n\t\t$TABLE_NAME = 'HaberKategori';\n $this->dropTable($TABLE_NAME);\n }", "public function down(){\n $this->dbforge->drop_table('subcategories_news'); //eliminacion de la tabla subcategories_news\n }", "public function down()\n {\n }", "public function down()\n {\n }", "public function down()\n\t{\n\t\tDB::table('professor')->where('professor_id', '=', 1)->delete();\n\t\tDB::table('professor')->where('professor_id', '=', 2)->delete();\n\t\tDB::query('ALTER TABLE professor AUTO_INCREMENT = 1');\n\n\t\t//\n\t}", "public function down(): bool {\n\t\t// Remove & add logic to revert the migration here.\n\t\techo \"M230123030315BaseTables cannot be rolled back.\\n\";\n\t\treturn false;\n\t}", "public function getDownSQL()\r\n {\r\n return array (\n 'propel' => '\r\n# This is a fix for InnoDB in MySQL >= 4.1.x\r\n# It \"suspends judgement\" for fkey relationships until are tables are set.\r\nSET FOREIGN_KEY_CHECKS = 0;\r\n\r\nALTER TABLE `promocion` CHANGE `fecha_inicio` `fecha_inicio` DATE NOT NULL;\r\n\r\nALTER TABLE `promocion` CHANGE `fecha_fin` `fecha_fin` DATE NOT NULL;\r\n\r\nALTER TABLE `promocion` CHANGE `descuento` `descuento` DECIMAL;\r\n\r\nALTER TABLE `promocion`\r\n ADD `descripcion` VARCHAR(70) AFTER `id`,\r\n ADD `estado` VARCHAR(11) AFTER `fecha_fin`,\r\n ADD `promocion_global` TINYINT(1) NOT NULL AFTER `descuento`;\r\n\r\nALTER TABLE `promocion` DROP `activo`;\r\n\r\n# This restores the fkey checks, after having unset them earlier\r\nSET FOREIGN_KEY_CHECKS = 1;\r\n',\n);\r\n }", "public function down()\n\t{\n\t\t//return false;\n\t}", "public function down(): void\n {\n try {\n $this->db->ForeignKeyChecks(false);\n $statement=$this->db->prepare(\"DROP TABLE IF EXISTS prom2_pages\");\n $statement->execute();\n $statement->close();\n $this->db->ForeignKeyChecks(true);\n } catch (\\mysqli_sql_exception $exception) {\n throw $exception;\n }\n }", "public function down()\n\t{\n\t\t//\n\t\tSchema::drop('options');\n\t}", "public function change()\n {\n $this->schema->table('recurring_expenses',function($table){\n $table->date('end_repeat')->nullable();\n $table->boolean('ended')->default(false);\n $table->enum('repeat',['0','1','7','14','30','365'])->nullable();\n });\n\n $this->schema->table('expenses',function($table){\n $table->dropColumn('end_repeat');\n $table->dropColumn('repeat');\n $table->integer('parent_id')->nullable();\n $table->foreign('parent_id')->references('id')->on('expenses')->onDelete('cascade');\n });\n }", "public function down()\n {\n Schema::table('users', function (Blueprint $table) {\n $table->dropForeign('users_id_turma_foreign');\n });\n\n Schema::table('contato', function (Blueprint $table) {\n $table->dropForeign('contato_id_usuario_foreign');\n });\n\n Schema::table('monitores', function (Blueprint $table) {\n $table->dropForeign('monitores_id_turma_foreign');\n $table->dropForeign('monitores_id_usuario_foreign');\n });\n\n Schema::table('galeria_portifolio', function (Blueprint $table) {\n $table->dropForeign('galeria_portifolio_id_portifolio_foreign');\n });\n\n Schema::table('portifolio_alunos', function (Blueprint $table) {\n $table->dropForeign('portifolio_alunos_id_portifolio_foreign');\n $table->dropForeign('portifolio_alunos_id_usuario_foreign');\n });\n\n Schema::table('cobranca', function (Blueprint $table) {\n $table->dropForeign('cobranca_id_aluno_foreign');\n });\n\n Schema::table('lista_de_presenca', function (Blueprint $table) {\n $table->dropForeign('lista_de_presenca_id_usuario_foreign');\n });\n\n Schema::table('forum_da_turma', function (Blueprint $table) {\n $table->dropForeign('forum_da_turma_id_usuario_foreign');\n });\n\n Schema::table('posts_do_site', function (Blueprint $table) {\n $table->dropForeign('posts_do_site_id_usuario_foreign');\n });\n\n Schema::table('posts_do_forum', function (Blueprint $table) {\n $table->dropForeign('posts_do_forum_id_topico_foreign');\n $table->dropForeign('posts_do_forum_id_usuario_foreign');\n });\n }", "public function down()\n\t{\n\t\t$this->dropForeignKey('FK_task_creator','tbl_task');\n\n\t\t$this->dropTable('tbl_task');\n\t}", "public function down()\n {\n $this->table('articles')->drop()->save();\n $this->table('categories')->drop()->save();\n $this->table('football_ragistrations')->drop()->save();\n $this->table('friends')->drop()->save();\n $this->table('menus')->drop()->save();\n $this->table('picnic_ragistrations')->drop()->save();\n $this->table('products')->drop()->save();\n $this->table('profiles')->drop()->save();\n $this->table('skills')->drop()->save();\n $this->table('spouses')->drop()->save();\n $this->table('students')->drop()->save();\n $this->table('submenus')->drop()->save();\n $this->table('users')->drop()->save();\n }", "public function down(){\n\t\tSchema::dropIfExists('cargo');\n\t}", "public function down()\n {\n $this->table('users')\n ->dropForeignKey(\n 'role_id'\n )->save();\n\n $this->table('users')\n ->removeIndexByName('FK_users_roles')\n ->update();\n\n $this->table('users')\n ->addColumn('can_edit', 'boolean', [\n 'after' => 'enabled',\n 'default' => '0',\n 'length' => null,\n 'null' => false,\n ])\n ->removeColumn('role_id')\n ->update();\n\n $this->table('stundenplan')\n ->changeColumn('note', 'string', [\n 'default' => null,\n 'length' => 255,\n 'null' => true,\n ])\n ->removeColumn('loggedInNote')\n ->update();\n\n $this->table('roles')->drop()->save();\n }", "public function down()\n\t{\n\t\t//\n\t\tDB::query('TRUNCATE TABLE app_user_apps_publishes CASCADE');\n\t\tDB::query('TRUNCATE TABLE app_apps_fbapps CASCADE');\n\t\tDB::query('TRUNCATE TABLE app_apps_applications CASCADE');\n\t}", "protected abstract function do_down();", "public function down()\n\t{\n\t\t// Drop Table\n\t\tSchema::drop('activities_types');\n\t}", "public function down(Schema $schema) : void\n {\n $this->addSql('CREATE TABLE encherir_acheteur (encherir_id INT NOT NULL, acheteur_id INT NOT NULL, INDEX IDX_41ABAAFBB0BA17BB (encherir_id), INDEX IDX_41ABAAFB96A7BB5F (acheteur_id), PRIMARY KEY(encherir_id, acheteur_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('CREATE TABLE encherir_lot (encherir_id INT NOT NULL, lot_id INT NOT NULL, INDEX IDX_3C56919BB0BA17BB (encherir_id), INDEX IDX_3C56919BA8CBA5F7 (lot_id), PRIMARY KEY(encherir_id, lot_id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \\'\\' ');\n $this->addSql('ALTER TABLE encherir_acheteur ADD CONSTRAINT FK_41ABAAFB96A7BB5F FOREIGN KEY (acheteur_id) REFERENCES acheteur (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_acheteur ADD CONSTRAINT FK_41ABAAFBB0BA17BB FOREIGN KEY (encherir_id) REFERENCES encherir (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_lot ADD CONSTRAINT FK_3C56919BA8CBA5F7 FOREIGN KEY (lot_id) REFERENCES lot (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir_lot ADD CONSTRAINT FK_3C56919BB0BA17BB FOREIGN KEY (encherir_id) REFERENCES encherir (id) ON DELETE CASCADE');\n $this->addSql('ALTER TABLE encherir DROP FOREIGN KEY FK_503B7C878EB576A8');\n $this->addSql('ALTER TABLE encherir DROP FOREIGN KEY FK_503B7C878EFC101A');\n $this->addSql('DROP INDEX IDX_503B7C878EB576A8 ON encherir');\n $this->addSql('DROP INDEX IDX_503B7C878EFC101A ON encherir');\n $this->addSql('ALTER TABLE encherir DROP id_acheteur_id, DROP id_lot_id');\n }", "public function down()\n {\n $this->table('accounting_entries')\n ->dropForeignKey(\n 'accounting_entry_type_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('associations_events')\n ->dropForeignKey(\n 'event_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('events')\n ->dropForeignKey(\n 'event_type_id'\n )->save();\n\n $this->table('members')\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('statistics')\n ->dropForeignKey(\n 'statistics_type_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('statistics_event')\n ->dropForeignKey(\n 'statistics_id'\n )\n ->dropForeignKey(\n 'event_id'\n )->save();\n\n $this->table('users')\n ->dropForeignKey(\n 'role_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('accounting_entries')->drop()->save();\n $this->table('accounting_entry_type')->drop()->save();\n $this->table('associations')->drop()->save();\n $this->table('associations_events')->drop()->save();\n $this->table('event_type')->drop()->save();\n $this->table('events')->drop()->save();\n $this->table('members')->drop()->save();\n $this->table('roles')->drop()->save();\n $this->table('statistics')->drop()->save();\n $this->table('statistics_event')->drop()->save();\n $this->table('statistics_type')->drop()->save();\n $this->table('users')->drop()->save();\n }", "public function down()\n\t{\n\t\tif(Yii::app()->db->getSchema()->getTable(\"{{user_block}}\")){\n\t\t\t$this->dropTable(\"{{user_block}}\");\n\t\t}\n\n\t}", "public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nDROP TABLE IF EXISTS `user_login`;\n\nALTER TABLE `user` DROP `user_mname`;\n\nALTER TABLE `user` DROP `user_user`;\n\nALTER TABLE `user` DROP `user_password`;\n\nALTER TABLE `user` DROP `user_date_lastlogin`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function down()\n\t{\n\t\tSchema::table('officers', function($t){\n\t\t\t$t->drop_column('role');\n\t\t});\n\t}", "public function safeDown()\n {\n $this->down();\n }", "public function safeDown()\n {\n $this->down();\n }", "public function down()\n\t{\n\t\tSchema::drop('refs');\n\t}", "public function down () {\n\t\treturn $this->rename_column ('headline', 'title', 'string', array ('limit' => 72));\n\t}", "public function down()\n\t{\n\t\tSchema::drop('appeals');\n\t}", "public function safeDown()\r\n {\r\n $this->down();\r\n }", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n<<<<<<< HEAD\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCF082E755');\n $this->addSql('ALTER TABLE affaire DROP FOREIGN KEY FK_9C3F18EFED813170');\n=======\n<<<<<<< HEAD:src/Migrations/Version20200418121015.php\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCF082E755');\n $this->addSql('ALTER TABLE affaire DROP FOREIGN KEY FK_9C3F18EFED813170');\n=======\n $this->addSql('ALTER TABLE liste_affaire_affaire DROP FOREIGN KEY FK_CA81ADF3F082E755');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2463CD7C3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA25D493FF4');\n $this->addSql('ALTER TABLE correspondant_administratif DROP FOREIGN KEY FK_E1E7152EBF396750');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA246135043');\n>>>>>>> e1e13eb645b79ada7517f9d2be860dc1655c42db:src/Migrations/Version20200318150734.php\n>>>>>>> 0c1c04bb7c2bbee076bc5fdb1e2456d1af817866\n $this->addSql('ALTER TABLE enfant_sejour DROP FOREIGN KEY FK_159E7E65450D2529');\n $this->addSql('ALTER TABLE enfant_sejour DROP FOREIGN KEY FK_159E7E6584CF0CF');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2463CD7C3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA25D493FF4');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2FF631228');\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCE2687AC3');\n $this->addSql('ALTER TABLE sejour DROP FOREIGN KEY FK_96F52028E2687AC3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA246135043');\n $this->addSql('ALTER TABLE correspondant_administratif DROP FOREIGN KEY FK_E1E7152E46135043');\n $this->addSql('DROP TABLE affaire');\n<<<<<<< HEAD\n $this->addSql('DROP TABLE affaire_liste_affaire');\n $this->addSql('DROP TABLE type_affaire');\n=======\n<<<<<<< HEAD:src/Migrations/Version20200418121015.php\n $this->addSql('DROP TABLE affaire_liste_affaire');\n $this->addSql('DROP TABLE type_affaire');\n=======\n $this->addSql('DROP TABLE centre');\n $this->addSql('DROP TABLE correspondant_administratif');\n $this->addSql('DROP TABLE responsable_legal');\n>>>>>>> e1e13eb645b79ada7517f9d2be860dc1655c42db:src/Migrations/Version20200318150734.php\n>>>>>>> 0c1c04bb7c2bbee076bc5fdb1e2456d1af817866\n $this->addSql('DROP TABLE enfant');\n $this->addSql('DROP TABLE enfant_sejour');\n $this->addSql('DROP TABLE sejour');\n $this->addSql('DROP TABLE centre');\n $this->addSql('DROP TABLE correspondant_administratif');\n $this->addSql('DROP TABLE etablissement');\n $this->addSql('DROP TABLE liste_affaire');\n $this->addSql('DROP TABLE responsable_legal');\n $this->addSql('DROP TABLE user');\n }", "public function getDownSQL()\n {\n return array (\n 'default' => '\n# This is a fix for InnoDB in MySQL >= 4.1.x\n# It \"suspends judgement\" for fkey relationships until are tables are set.\nSET FOREIGN_KEY_CHECKS = 0;\n\nDROP TABLE IF EXISTS `user`;\n\nDROP TABLE IF EXISTS `question`;\n\nDROP TABLE IF EXISTS `answer`;\n\nDROP TABLE IF EXISTS `image`;\n\nDROP TABLE IF EXISTS `vote`;\n\n# This restores the fkey checks, after having unset them earlier\nSET FOREIGN_KEY_CHECKS = 1;\n',\n);\n }", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function safeDown()\n\t{\n\t\t$this->dropTable($this->tableName);\n\t}", "public function down()\n {\n $this->table('mail_contents')->drop()->save();\n }", "public function down() {\n\t}", "public function down() {\n\t}", "public function down() {\n\t}", "public function down()\n {\n Schema::dropIfExists('reunion');\n }", "public function down(): void\n {\n $this->table('services')\n ->dropForeignKey(\n ['currency_id','billing_period_id']\n )->save();\n $this->execute('DELETE FROM currencies');\n $this->execute('DELETE FROM billing_periods');\n $this->table('services')->drop()->save();\n $this->table('currencies')->drop()->save();\n $this->table('billing_periods')->drop()->save();\n }", "public function down()\n\t{\n\t\tSchema::drop('article_category');\n\t}", "public function down()\n {\n Schema::table('users', function (Blueprint $table) {\n $table->renameColumn('first_name', 'name');\n $table->dropIndex('users_first_name_index');\n $table->dropIndex('users_created_at_index');\n $table->dropIndex('users_updated_at_index');\n $table->dropColumn(\"last_name\");\n $table->dropColumn(\"username\");\n $table->dropColumn(\"provider\");\n $table->dropColumn(\"provider_id\");\n $table->dropColumn(\"api_token\");\n $table->dropColumn(\"code\");\n $table->dropColumn(\"remember_token\");\n $table->dropColumn(\"role_id\");\n $table->dropColumn(\"last_login\");\n $table->dropColumn(\"status\");\n $table->dropColumn(\"root\");\n $table->dropColumn('backend');\n $table->dropColumn(\"photo_id\");\n $table->dropColumn(\"lang\");\n $table->dropColumn(\"color\");\n $table->dropColumn(\"about\");\n $table->dropColumn(\"facebook\");\n $table->dropColumn(\"twitter\");\n $table->dropColumn(\"linked_in\");\n $table->dropColumn(\"google_plus\");\n });\n }", "public function down()\n\t{\n\t\tSchema::drop('entries');\n\t}", "public function down()\n\t{\n\t\tSchema::table('precios_aterrizajes_despegues', function(Blueprint $table)\n\t\t{\n\t\t\t//\n\t\t});\n\t}", "public function down()\n{\nSchema::drop('statustype');\nSchema::drop('area');\nSchema::drop('region');\nSchema::drop('territory');\nSchema::drop('trackedevent');\nSchema::drop('zip_territory');\nSchema::drop('messagetype');\nSchema::drop('optintype');\nSchema::drop('representative');\nSchema::drop('pediatrician');\nSchema::drop('application_messagestatus');\nSchema::drop('application_optin');\nSchema::drop('application_trackedevent');\nSchema::drop('application');\n}", "public function down()\n\t{\n\t\tSchema::drop(Config::get('sentry::sentry.table.users_metadata'));\n\t}", "protected function tearDown(): void {\n $migration = include __DIR__.'/../database/migrations/create_all_visitors_tables.php.stub';\n $migration->down();\n\n $migrationTest = include __DIR__.'/Support/migrations/2023_01_12_000000_create_test_models_table.php';\n $migrationTest->down();\n }", "public function down(Schema $schema) : void\n {\n $this->addSql('ALTER TABLE classe_personne DROP FOREIGN KEY FK_350001418F5EA509');\n $this->addSql('ALTER TABLE matiere_classe DROP FOREIGN KEY FK_AF649A8B8F5EA509');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA148F5EA509');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0E8F5EA509');\n $this->addSql('ALTER TABLE cours DROP FOREIGN KEY FK_FDCA8C9CF46CD258');\n $this->addSql('ALTER TABLE matiere_classe DROP FOREIGN KEY FK_AF649A8BF46CD258');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA14F46CD258');\n $this->addSql('ALTER TABLE personne_matiere DROP FOREIGN KEY FK_4E9BB3B7F46CD258');\n $this->addSql('ALTER TABLE absence DROP FOREIGN KEY FK_765AE0C9A21BD112');\n $this->addSql('ALTER TABLE classe_personne DROP FOREIGN KEY FK_35000141A21BD112');\n $this->addSql('ALTER TABLE contacte DROP FOREIGN KEY FK_C794A022A21BD112');\n $this->addSql('ALTER TABLE demande DROP FOREIGN KEY FK_2694D7A5A21BD112');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA14A6CC7B2');\n $this->addSql('ALTER TABLE personne_matiere DROP FOREIGN KEY FK_4E9BB3B7A21BD112');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EE455FCC0');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EBDDFA3C9');\n $this->addSql('ALTER TABLE seance DROP FOREIGN KEY FK_DF7DFD0EDC304035');\n $this->addSql('ALTER TABLE absence DROP FOREIGN KEY FK_765AE0C9E3797A94');\n $this->addSql('ALTER TABLE personne DROP FOREIGN KEY FK_FCEC9EFA76ED395');\n $this->addSql('ALTER TABLE reset_password_request DROP FOREIGN KEY FK_7CE748AA76ED395');\n $this->addSql('DROP TABLE absence');\n $this->addSql('DROP TABLE classe');\n $this->addSql('DROP TABLE classe_personne');\n $this->addSql('DROP TABLE contacte');\n $this->addSql('DROP TABLE cours');\n $this->addSql('DROP TABLE demande');\n $this->addSql('DROP TABLE matiere');\n $this->addSql('DROP TABLE matiere_classe');\n $this->addSql('DROP TABLE news');\n $this->addSql('DROP TABLE note');\n $this->addSql('DROP TABLE personne');\n $this->addSql('DROP TABLE personne_matiere');\n $this->addSql('DROP TABLE reset_password_request');\n $this->addSql('DROP TABLE salle');\n $this->addSql('DROP TABLE seance');\n $this->addSql('DROP TABLE user');\n }", "public function down()\n\t{\n\t\tSchema::drop('stor_mem');\n\t}", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('ALTER TABLE booking DROP FOREIGN KEY FK_E00CEDDEA76ED395');\n $this->addSql('ALTER TABLE booking DROP FOREIGN KEY FK_E00CEDDE19FCD424');\n $this->addSql('DROP TABLE booking');\n $this->addSql('DROP TABLE product_image');\n $this->addSql('DROP TABLE family_page_container');\n $this->addSql('DROP TABLE user');\n $this->addSql('DROP TABLE time_line');\n $this->addSql('ALTER TABLE family DROP FOREIGN KEY FK_A5E6215B727ACA70');\n $this->addSql('DROP INDEX IDX_A5E6215B727ACA70 ON family');\n $this->addSql('ALTER TABLE family ADD page_content_id INT NOT NULL, DROP parent_id, DROP has_uniques_prices, DROP has_seasonal_products');\n $this->addSql('ALTER TABLE family ADD CONSTRAINT FK_A5E6215B8F409273 FOREIGN KEY (page_content_id) REFERENCES page_content (id)');\n $this->addSql('CREATE INDEX IDX_A5E6215B8F409273 ON family (page_content_id)');\n $this->addSql('ALTER TABLE link ADD page_container_id INT DEFAULT NULL, DROP url');\n $this->addSql('ALTER TABLE link ADD CONSTRAINT FK_36AC99F123D5B0C FOREIGN KEY (page_container_id) REFERENCES page_container (id)');\n $this->addSql('CREATE INDEX IDX_36AC99F123D5B0C ON link (page_container_id)');\n $this->addSql('ALTER TABLE product DROP content, DROP order_by, DROP is_generic, DROP type, CHANGE title label VARCHAR(50) NOT NULL COLLATE utf8mb4_unicode_ci');\n $this->addSql('ALTER TABLE unit DROP duration');\n }", "public function down(Schema $schema) : void\n {\n $this->addSql('ALTER TABLE `order` DROP FOREIGN KEY FK_F5299398F5B7AF75');\n $this->addSql('ALTER TABLE suppliers DROP FOREIGN KEY FK_AC28B95C8486F9AC');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D6498486F9AC');\n $this->addSql('ALTER TABLE stock DROP FOREIGN KEY FK_4B365660D629F605');\n $this->addSql('ALTER TABLE stock DROP FOREIGN KEY FK_4B365660E308AC6F');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F46CFFE9AD6');\n $this->addSql('ALTER TABLE product DROP FOREIGN KEY FK_D34A04ADEE45BDBF');\n $this->addSql('ALTER TABLE suppliers DROP FOREIGN KEY FK_AC28B95CEE45BDBF');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649EE45BDBF');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F464584665A');\n $this->addSql('ALTER TABLE product_theme DROP FOREIGN KEY FK_36299C544584665A');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649D60322AC');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F46DCD6110');\n $this->addSql('ALTER TABLE order_detail DROP FOREIGN KEY FK_ED896F462ADD6D8C');\n $this->addSql('ALTER TABLE product_theme DROP FOREIGN KEY FK_36299C5459027487');\n $this->addSql('ALTER TABLE `order` DROP FOREIGN KEY FK_F5299398A76ED395');\n $this->addSql('DROP TABLE address');\n $this->addSql('DROP TABLE format');\n $this->addSql('DROP TABLE material');\n $this->addSql('DROP TABLE `order`');\n $this->addSql('DROP TABLE order_detail');\n $this->addSql('DROP TABLE picture');\n $this->addSql('DROP TABLE product');\n $this->addSql('DROP TABLE product_theme');\n $this->addSql('DROP TABLE role');\n $this->addSql('DROP TABLE stock');\n $this->addSql('DROP TABLE suppliers');\n $this->addSql('DROP TABLE theme');\n $this->addSql('DROP TABLE user');\n }", "public function down()\n {\n Schema::dropIfExists('data');\n }", "public function down()\n\t{\n\t\tSchema::create('jobs',function($table){$table->increments('id');});\n\t\tSchema::create('job_location',function($table){$table->increments('id');});\n\t\tSchema::create('job_skill',function($table){$table->increments('id');});\n\t\tSchema::create('locations',function($table){$table->increments('id');});\n\t\tSchema::create('location_program',function($table){$table->increments('id');});\n\t\tSchema::create('location_scholarship',function($table){$table->increments('id');});\n\t\tSchema::create('positions',function($table){$table->increments('id');});\n\t\tSchema::create('programs',function($table){$table->increments('id');});\n\t\tSchema::create('program_subject',function($table){$table->increments('id');});\n\t\tSchema::create('scholarships',function($table){$table->increments('id');});\n\t\tSchema::create('scholarship_subject',function($table){$table->increments('id');});\n\t\tSchema::create('skills',function($table){$table->increments('id');});\n\t\tSchema::create('subjects',function($table){$table->increments('id');});\n\t}" ]
[ "0.7950277", "0.78636813", "0.76065636", "0.7493955", "0.7320625", "0.7245268", "0.7187498", "0.71543235", "0.715298", "0.7141911", "0.7135835", "0.71214414", "0.71154845", "0.71057886", "0.7098064", "0.70800334", "0.7078775", "0.70729095", "0.7068331", "0.7066272", "0.7053364", "0.7053364", "0.7042174", "0.7042174", "0.7042174", "0.7041765", "0.7040102", "0.7028846", "0.70253754", "0.7021679", "0.6988633", "0.6986877", "0.6978061", "0.6971848", "0.6944203", "0.6944203", "0.6944203", "0.6942135", "0.6941429", "0.6939214", "0.6935277", "0.69334567", "0.6928689", "0.6924838", "0.6924794", "0.6913486", "0.6902361", "0.6897891", "0.6897845", "0.6897824", "0.6897824", "0.68886673", "0.688262", "0.6874051", "0.6869844", "0.6863713", "0.6858435", "0.68545175", "0.68440175", "0.6842142", "0.6836981", "0.6836124", "0.6834763", "0.68303466", "0.68297166", "0.68282366", "0.6826686", "0.6824025", "0.68185335", "0.6811099", "0.68078107", "0.68056506", "0.68056506", "0.6789167", "0.67755204", "0.67742497", "0.6765081", "0.67597127", "0.67596203", "0.67564446", "0.67564446", "0.67564446", "0.6753443", "0.6753351", "0.6753351", "0.6753351", "0.6752681", "0.674581", "0.6743746", "0.67387754", "0.6733766", "0.67331296", "0.6731279", "0.67302275", "0.6727377", "0.67273724", "0.672722", "0.672607", "0.67173517", "0.67139125", "0.671303" ]
0.0
-1
QTOS = Quality Time on Site
public function getQtos();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function eQTimeElapsed() {\n\t\tif ($GLOBALS['qTimeTotal']) {\n\t\t\treturn number_format($GLOBALS['qTimeTotal']*1000000.0,1);\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\t}", "public static function REALTIME()\n {\n return new Vp9Quality(self::REALTIME);\n }", "function getQueryTime($time_start,$time_end) {\n\t\treturn round($time_end - $time_start,4).'sec';\n\t}", "function timequery() {\n static $querytime_begin;\n list($usec, $sec) = explode(' ', microtime());\n\n if (!isset($querytime_begin)) {\n $querytime_begin = ((float) $usec + (float) $sec);\n } else {\n $querytime = (((float) $usec + (float) $sec)) - $querytime_begin;\n echo sprintf('<br />La consulta tardó %01.5f segundos.- <br />', $querytime);\n }\n}", "static function ts(){\r\n $dt = microtime(true) - self::$starttime;\r\n return self::mtformat($dt);\r\n }", "public function getUseTime() \n \t{\n \t\treturn $this->use_time;\n \t}", "public function getTimeInQueue($time){\n\t$desvioPadrao = 0.5;\n\t$tempoDePico = 12.5;\n\t$desvioPadrao = 0.5;\n\t$expoente = pow(($time - $tempoDePico), 2);\n\t$expoente /= $desvioPadrao;\n\t$tempoMaximoNaFila = 40;\n\t$tempoNaFila = $tempoMaximoNaFila*pow(M_E, -$expoente);\n\t\treturn $tempoNaFila;\n\t}", "public function getTimePerQuestion()\n {\n return $this->timePerQuestion;\n }", "public function getQ()\n {\n return $this->q;\n }", "public function getAnswerTime();", "private function calculateTime()\n {\n $slowest = 1000000;\n for($i=1; $i<=12; $i++){\n if($_GET['Tr'.$i] > 0 && $slowest > $this->troopCostsProperties['Tr'.$i][5] ){\n $slowest = $this->troopCostsProperties['Tr'.$i][5];\n }\n }\n $time = $this->distance/($slowest*SERVER_SPEED_RATE);\n return $time;\n }", "function trader_stochrsi($real, $timePeriod = NULL, $fastK_Period = NULL, $fastD_Period = NULL, $fastD_MAType = NULL)\n{\n}", "private function getQueryStringDate() {\n\t\tif($this->date) {\n\t\t\treturn $this->date . '['.$this->qType.']';\n\t\t}\n\t\t$startDate = (new DateTime('-14 days'))->format('Ymd');\n\t\t$endDate = (new DateTime('tomorrow'))->format('Ymd');\n\t\t$qDate = '`'.$this->qType.' > '.$startDate.' < '.$endDate;\n\t\treturn $qDate;\n\t}", "public function getSpeakTime()\n {\n return $this->get(self::_SPEAK_TIME);\n }", "public function qtype() \n {\n return 'scripted';\n }", "private function tick() {\r\n\t\treturn ceil( time() / 43200 );\r\n\t}", "public function getQntd()\n {\n return $this->qntd;\n }", "function convertToQt ($inputUnit, $inputValue) {\n\t\tswitch ($inputUnit) {\n\t\t\tcase 'tsp':\n\t\t\t\t$valueConverted = $inputValue * 0.00520833;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'tbsp':\n\t\t\t\t$valueConverted = $inputValue * 0.015625;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'flOz':\n\t\t\t\t$valueConverted = $inputValue * 0.03125;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'cp':\n\t\t\t\t$valueConverted = $inputValue * 0.25;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'pt':\n\t\t\t\t$valueConverted = $inputValue * 0.5;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'qt':\n\t\t\t\t$valueConverted = $inputValue;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t\tcase 'gal':\n\t\t\t\t$valueConverted = $inputValue * 4;\n\t\t\t\treturn $valueConverted;\n\t\t\t\tbreak;\n\t\t}\n\n}", "function ajan_core_print_generation_time() {\n?>\n\n<!-- Generated in <?php timer_stop(1); ?> seconds. (<?php echo get_num_queries(); ?> q) -->\n\n\t<?php\n}", "public function getQueryTime()\n {\n return $this->query_time;\n }", "function time() {\n if($this->active_invoice->isLoaded()) {\n if($this->active_invoice->canViewRelatedItems($this->logged_user)) {\n $this->wireframe->print->enable();\n \n $this->response->assign(array(\n 'time_records' => $this->active_invoice->getTimeRecords(),\n 'expenses' => $this->active_invoice->getExpenses(),\n 'items_can_be_released' => $this->active_invoice->isDraft() || $this->active_invoice->isCanceled()\n ));\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n }", "public function displayTimeQuestion()\n {\n\n }", "public function pausetimeAction()\n {\n $user_params=$this->_request->getParams();\n $ftvrequest_obj = new Ep_Ftv_FtvRequests();\n $ftvcontacts_obj = new Ep_Ftv_FtvContacts();\n $ftvtime_obj = new Ep_Ftv_FtvPauseTime();\n if($user_params['type'] == 'pause')\n {\n ////for goroup Id in users table////\n $ftvtime_obj->ftvrequest_id=$user_params['requestId'];\n $ftvtime_obj->pause_at=date('Y-m-d H:i:s') ;\n $ftvtime_obj->resume_at=null;\n $ftvtime_obj->insert();\n }\n else\n {\n $data = array(\"resume_at\"=>date('Y-m-d H:i:s'));////////updating\n $query = \"ftvrequest_id= '\".$user_params['requestId'].\"' AND resume_at is null\";\n $ftvtime_obj->updateFtvPauseTime($data,$query);\n }\n }", "public function getQSelo()\n {\n return $this->qSelo;\n }", "public function getQtde()\n {\n return $this->qtde;\n }", "function getTimeProccess(){\n\t\treturn round($this->timeProccess,5);\n\t}", "function when($parameters) { // $parameters = ['timestamp'], ['numberOfUnits']\n\t$currentTime = time();\n\t\n\tif (preg_match ( '/\\d{4}-\\d{1,2}-\\d{1,2}\\s\\d{1,2}:\\d{1,2}:\\d{1,2}/u', $parameters['timestamp'] )) // /d -> 0-9, nt 1978-2-3 5:8:9, u on seotud UTF-8 ga\n\t{\n\t\t$time = strtotime( $parameters['timestamp'] ); //konventeerib sekunditeks\n\t}\n\telse {\n\t\t$time = $parameters['timestamp'];\n\t}\n\n\tif($currentTime > $time){\n\t\t$difference = $currentTime - $time;\n\t} else {\n\t\t$difference = $time - $currentTime;\n\t}\n\n\t$units = array (\n\t\t\t'second',\n\t\t\t'minute',\n\t\t\t'hour',\n\t\t\t'day',\n\t\t\t'week',\n\t\t\t'month',\n\t\t\t'year',\n\t\t\t'decade'\n\t);\n\t\n\t$secondsInSecond = 1;\n\t$secondsInMinute = 60;\n\t$secondsInHour = $secondsInMinute*60;\n\t$secondsInDay = $secondsInHour*24;\n\t$secondsInWeek = $secondsInDay*7;\n\t$secondsInMonth = $secondsInWeek*(4+1/3);\n\t$secondsInYear = $secondsInMonth*12;\n\t$secondsInDecade = $secondsInYear*10;\n\t\n\t$sizes = array (\t\t\t\t//$sizes = array (\n\t\t\t$secondsInSecond, \t\t//1, //sekund\n\t\t\t$secondsInMinute, \t\t//60, //minut\n\t\t\t$secondsInHour, \t\t// 60*60, //tund\n\t\t\t$secondsInDay,\t\t\t//60*60*24, //päev\n\t\t\t$secondsInWeek, \t\t//60*60*24*7, //nädal\n\t\t\t$secondsInMonth,\t\t//60*60*24*7*(4+1/3), //kuu\n\t\t\t$secondsInYear, \t\t//60*60*24*7*(4+1/3)*12, //aasta\n\t\t\t$secondsInDecade \t\t//60*60*24*7*(4+1/3)*12*10 //kümmend\n\t);\n\n\tfor($positionInUnits = sizeof ( $sizes ) - 1; ($positionInUnits >= 0) && \n\t\t(($amountOfTime = $difference / $sizes [$positionInUnits]) <= 1); $positionInUnits --); \n\t\tif ($positionInUnits < 0)\n\t\t\t$positionInUnits = 0;\n\t\t$remainedTime = $currentTime - ($difference % $sizes [$positionInUnits]);\n\t\t$amountOfTime = floor ( $amountOfTime );\n\t\tif ($amountOfTime != 1) \n\t\t\t$units [$positionInUnits] .= 's';\n\t\t$when = sprintf ( \"%d %s \", $amountOfTime, $units [$positionInUnits] );\n\t\tif (($parameters['numberOfUnits'] == 0) && ($positionInUnits >= 1) && (($currentTime - $remainedTime) > 0))\n\t\t$when .= when ( $remainedTime);\n\t\treturn $when;\n}", "function qualificationServ(): string\n{\n $FtPqr = getFtPqr();\n $FtPqrCalificacion = $FtPqr->getLastCalificacion();\n\n return $FtPqrCalificacion ? $FtPqrCalificacion->getFieldValue('experiencia_servicio') : '-';\n}", "public function getTermsAndCondition() {\n\t\treturn $this->_getResponse(self::URL_TOS);\n\t}", "public function time()\n {\n return $this->_requestTime;\n }", "public function getSvrTime()\n {\n return $this->get(self::_SVR_TIME);\n }", "function getHtmlTime(){\r\n\treturn('P&aacute;gina generada en <b>'.(time() - $_SERVER['REQUEST_TIME']) .'</b> segundos');\r\n}", "public function get_starttime()\n {\n }", "public function getTermsAndCondition()\n {\n return $this->getResponse(self::URL_TOS);\n }", "public function getQueryTime()\n {\n return $this->queryTime;\n }", "public function getQueryTime()\n {\n return $this->queryTime;\n }", "public function set_play_offs_qtt($arg) {\n while ($arg * 2 > $this->participants_qtt) { //when there's more play offs than participants\n $arg /= 2;\n }\n if ($arg * 2 < $this->group_qtt) {\n $arg = $this->group_qtt / 2;\n }\n //$this->play_offs_qtt = $arg / 2;\n $this->play_offs_qtt = $arg;\n }", "private function time($float = false)\r\n {\r\n return $float ? Input::server('REQUEST_TIME_FLOAT') : Input::server('REQUEST_TIME');\r\n }", "public function getQueryTime()\n {\n return $this->result->getQueryTime();\n }", "function _getDmstcTransitTimes() {\r\n\t\t$transitreq = 'USERID=\"' . MODULE_SHIPPING_USPS_USERID . '\">' .\r\n\t\t\t\t'<OriginZip>' . SHIPPING_ORIGIN_ZIP . '</OriginZip>' .\r\n\t\t\t\t'<DestinationZip>' . $this->dest_zip . '</DestinationZip>';\r\n\t\t$transitpriorityreq = 'API=PriorityMail&XML=' . urlencode( '<PriorityMailRequest ' . $transitreq . '</PriorityMailRequest>');\r\n\t\t$transitexpressreq = 'API=ExpressMailCommitment&XML=' . urlencode( '<ExpressMailCommitmentRequest USERID=\"' . MODULE_SHIPPING_USPS_USERID . '\"><OriginZIP>' . SHIPPING_ORIGIN_ZIP . '</OriginZIP><DestinationZIP>' . $this->dest_zip . '</DestinationZIP><Date></Date></ExpressMailCommitmentRequest>');\r\n\t\t$transitparcelreq = 'API=StandardB&XML=' . urlencode( '<StandardBRequest ' . $transitreq . '</StandardBRequest>');\r\n\t\t$usps_server = 'production.shippingapis.com';\r\n\t\t$api_dll = 'shippingAPI.dll';\r\n\t\t$body = '';\r\n\t\tif (!class_exists('httpClient')) {\r\n\t\t\tinclude(DIR_FS_CATALOG . DIR_WS_CLASSES . 'http_client.php');\r\n\t\t}\r\n\t\t$http = new httpClient();\r\n\t\tif ($http->Connect($usps_server, 80)) {\r\n\t\t\t$http->addHeader('Host', $usps_server);\r\n\t\t\t$http->addHeader('User-Agent', 'IntenseCart');\r\n\t\t\t$http->addHeader('Connection', 'Close');\r\n\t\t\tif ($http->Get('/' . $api_dll . '?' . $transitpriorityreq)) $transpriorityresp = $http->getBody();\r\n\t\t\tif ($http->Get('/' . $api_dll . '?' . $transitexpressreq)) $transexpressresp = $http->getBody();\r\n\t\t\tif ($http->Get('/' . $api_dll . '?' . $transitparcelreq)) $transparcelresp = $http->getBody();\r\n\t\t\t$http->Disconnect();\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$prioritytime = '';\r\n\t\t$expresstime = '';\r\n\t\t$parceltime = '';\r\n\t\t\r\n\t\t$doc = XML_unserialize($transpriorityresp);\r\n\t\tif( isset($doc['PriorityMailResponse']['Days']) ){\r\n\t\t\t// add processing time..\r\n\t\t\t$doc['PriorityMailResponse']['Days'] += $this->processing;\r\n\t\t\t\r\n\t\t\t$prioritytime = \r\n\t\t\t\tMODULE_SHIPPING_USPS_TEXT_ESTIMATED \r\n\t\t\t\t. $doc['PriorityMailResponse']['Days'] \r\n\t\t\t\t. ' ' \r\n\t\t\t\t. (\r\n\t\t\t\t\t$doc['PriorityMailResponse']['Days'] == 1 \r\n\t\t\t\t\t\t? \r\n\t\t\t\t\tMODULE_SHIPPING_USPS_TEXT_DAY \r\n\t\t\t\t\t\t: \r\n\t\t\t\t\tMODULE_SHIPPING_USPS_TEXT_DAYS\r\n\t\t\t\t)\r\n\t\t\t;\r\n\t\t}\r\n\t\t\r\n\t\t$doc = XML_unserialize($transparcelresp);\r\n\t\tif( isset($doc['StandardBResponse']['Days']) ){\r\n\t\t\t// add processing time..\r\n\t\t\t$doc['StandardBResponse']['Days'] += $this->processing;\r\n\t\t\t\r\n\t\t\t$parceltime = \r\n\t\t\t\tMODULE_SHIPPING_USPS_TEXT_ESTIMATED \r\n\t\t\t\t. $doc['StandardBResponse']['Days'] \r\n\t\t\t\t. ' ' \r\n\t\t\t\t. (\r\n\t\t\t\t\t$doc['StandardBResponse']['Days'] == 1 \r\n\t\t\t\t\t\t? \r\n\t\t\t\t\tMODULE_SHIPPING_USPS_TEXT_DAY \r\n\t\t\t\t\t\t: \r\n\t\t\t\t\tMODULE_SHIPPING_USPS_TEXT_DAYS\r\n\t\t\t\t)\r\n\t\t\t;\r\n\t\t}\r\n\t\t\r\n\t\t$doc = XML_unserialize($transexpressresp);\r\n// \t\tprint_r( $doc );\r\n\t\tif( isset($doc['ExpressMailCommitmentResponse']['Commitment']) ){\r\n\t\t\tif( isset($doc['ExpressMailCommitmentResponse']['Commitment']['CommitmentName']) ){ // single date\r\n\t\t\t\t$sequence = str_replace(\r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'Next', \r\n\t\t\t\t\t\t'Days', \r\n\t\t\t\t\t\t'Day'\r\n\t\t\t\t\t), \r\n\t\t\t\t\tarray(\r\n\t\t\t\t\t\t'1', \r\n\t\t\t\t\t\tMODULE_SHIPPING_USPS_TEXT_DAYS, \r\n\t\t\t\t\t\tMODULE_SHIPPING_USPS_TEXT_DAY\r\n\t\t\t\t\t), \r\n\t\t\t\t\t$doc['ExpressMailCommitmentResponse']['Commitment']['CommitmentName']\r\n\t\t\t\t);\r\n\t\t\t} else { // multiple dates returned, choose longest time\r\n\t\t\t\t$seqlist = array();\r\n\t\t\t\tforeach( $doc['ExpressMailCommitmentResponse']['Commitment'] as $commit ){\r\n\t\t\t\t\tif( isset($commit['CommitmentName']) ){\r\n\t\t\t\t\t\t$seqlist[] = str_replace(\r\n\t\t\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\t\t'Next', \r\n\t\t\t\t\t\t\t\t'Days', \r\n\t\t\t\t\t\t\t\t'Day'\r\n\t\t\t\t\t\t\t), \r\n\t\t\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\t\t'1', \r\n\t\t\t\t\t\t\t\tMODULE_SHIPPING_USPS_TEXT_DAYS, \r\n\t\t\t\t\t\t\t\tMODULE_SHIPPING_USPS_TEXT_DAY\r\n\t\t\t\t\t\t\t), \r\n\t\t\t\t\t\t\t$commit['CommitmentName']\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\trsort($seqlist);\r\n\t\t\t\t$sequence = $seqlist[0];\r\n\t\t\t}\r\n\t\t\t$expresstime = MODULE_SHIPPING_USPS_TEXT_ESTIMATED . $sequence;\r\n\t\t}\r\n\t\t\r\n\t\treturn array(\r\n\t\t\t'express' => $expresstime, \r\n\t\t\t'priority' => $prioritytime, \r\n\t\t\t'parcel' => $parceltime\r\n\t\t);\r\n\t}", "public function qms()\n {\n \n \n\t\n return view('qms');\n }", "public function __toString ()\r\n\t{\r\n\t\treturn implode ( ' ', $this->_qts );\r\n\t}", "function getStartMicrotime();", "protected static function _timeToStopwatch()\n {\n return self::$_startupTime - $_SERVER['REQUEST_TIME_FLOAT'];\n }", "function refreshTime(){\n\n global $refreshTime;\n getChannel();\n if ((getChannel()[Name] == 'SmartPolitech') || (getChannel()[Name] == 'NoticiasEpcc')){\n $refreshTime = 960;\n }\n return $refreshTime;\n}", "function duration($from = false)\n {\n if ($from) {\n return microtime(true) - $from;\n }\n return microtime(true) - $_SERVER[\"REQUEST_TIME_FLOAT\"];\n }", "public function perimetre()\n {\n // section -64--88--103-1-2c9bd139:16deeff2ef5:-8000:000000000000099C begin\n // section -64--88--103-1-2c9bd139:16deeff2ef5:-8000:000000000000099C end\n }", "protected static function _timeToCake()\n {\n return TIME_START - $_SERVER['REQUEST_TIME_FLOAT'];\n }", "function reply_time() {\n\tglobal $reply;\n\treturn $reply['time'];\n}", "public static function getTimer()\n {\n return microtime(true) - $_SERVER[\"REQUEST_TIME_FLOAT\"];\n }", "function getTimeShoppingCarActive(){\n\treturn campo('config_system','id','1','time_in_minutes_shopping_cart_active');\n}", "function getTimeShoppingCarActive(){\n\treturn campo('config_system','id','1','time_in_minutes_shopping_cart_active');\n}", "public function getSvrtime()\n {\n $value = $this->get(self::SVRTIME);\n return $value === null ? (integer)$value : $value;\n }", "function process_time(){\n $time = number_format( microtime(true) - LIM_START_MICROTIME, 6);\n return($time);\n}", "private function __construct(){\r\n $this->ttl_by_type = array(\r\n 'short' => 300 , // 5 minutes\r\n 'default' => 7200, // 2 hours\r\n 'halfday' => 43200, // 12 hours\r\n 'day' => 86400, // 24 hours\r\n 'week' => 604800, // 7 days\r\n 'month' => 2592000, // 30 days (1 month)\r\n 'longterm' => 15811200 // 183 days (6 months)\r\n );\r\n }", "protected function startTime()\n {\n return microtime(true);\n }", "function get_timing_type() {\n\t\t$when = Clean::string( $this->get_option( 'when_to_run' ) );\n\t\tif ( ! $when ) $when = 'immediately';\n\t\treturn $when;\n\t}", "function GetuTime()\n{\n\tlist($uSec, $Sec)=explode(\" \", microtime()); \n\treturn((float)$uSec+(float)$Sec); \n}", "public static function time() {\n if (is_null(self::$_time)) {\n self::$_time = microtime(true);\n } else {\n echo 'Time-Consumed:- ' . (microtime(true) - self::$_time) . PHP_EOL;\n }\n }", "public function changetimeframe() {\n $sessionstaff = $this->Session->read('staff');\n if ($_POST['tier_timeframe'] == '') {\n $_POST['tier_timeframe'] = 0;\n }\n $this->AccessStaff->query('update access_staffs set tier_timeframe=' . $_POST['tier_timeframe'] . ' where clinic_id=' . $sessionstaff['clinic_id']);\n $this->Session->write('staff.staffaccess.AccessStaff.tier_timeframe', $_POST['tier_timeframe']);\n echo 1;\n\n die;\n }", "public function microtime();", "function getEndMicrotime();", "function COM_NOW() {\r\n\t$now = new DateTime();\r\n\t$offset = $_SESSION[\"org_TZO\"] - $_SESSION[\"_SITE_CONF\"][\"TZO\"]; //offset from server to organization\r\n\tif ($offset == 0) return $now;\r\n\t$invert = 0;\r\n\tif ($offset < 0) {\r\n\t\t$offset = abs($offset);\r\n\t\t$invert = 1;\r\n\t}\r\n\t$format = \"PT\".$offset.\"H\";\r\n\t$interval = new DateInterval($format);\r\n\t$interval->invert = $invert;\r\n\t$now->add($interval);\r\n\treturn $now;\r\n}", "function get_variable_time() {\n\t\t$datetime = $this->get_option( 'queue_datetime', true );\n\n\t\tif ( ! $datetime ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$timestamp = strtotime( $datetime, current_time( 'timestamp' ) );\n\n\t\t$date = new DateTime();\n\t\t$date->setTimestamp( $timestamp );\n\t\t$date->convert_to_utc_time();\n\n\t\treturn $date;\n\t}", "function getStartTime($startTime = null, $today = null, $orderType = null, $preOrder = null, $endTime = null, $storeId = null) {\n App::import('Model', 'Store');\n $this->Store = new Store();\n $store_data = $this->Store->find('first', array('conditions' => array(\"Store.id\" => $storeId), 'fields' => array('Store.delivery_interval', 'Store.delivery_delay', 'Store.pick_up_delay')));\n $poststartTime = $startTime;\n //Check Order Type (i.e. Delivery/Pick Up)\n $deliveryInterval = 0;\n if ($orderType == 3) {\n $deliveryInterval = !empty($store_data['Store']['delivery_delay']) ? $store_data['Store']['delivery_delay'] : 0;\n } else if ($orderType == 2) {\n $deliveryInterval = !empty($store_data['Store']['pick_up_delay']) ? $store_data['Store']['pick_up_delay'] : 0;\n } else if ($orderType == 1) {\n //$deliveryInterval = 60;\n $deliveryInterval = 0;\n }\n //Check Day (i.e. Today/ another)\n if ($today) {\n //$nowDate = date(\"Y-m-d H:i:s\");\n $nowDate=$this->getcurrentTime($storeId,1);\n $minute = date(\"i\");\n if ($minute % 5 != 0) {\n $mod = $minute % 5;\n $rem = 5 - $mod;\n $nowDate = date(\"Y-m-d H:i:s\", strtotime((date(\"Y-m-d H:\") . $minute . \":00\")) + ($rem * 60));\n } \n $currentStoreactual = date(\"H:i:s\", strtotime($this->storeTimeZoneUser('', $nowDate)));\n $currentStoreTime = date(\"H:i:s\", strtotime($currentStoreactual) + ($deliveryInterval * 60));\n $var1 = explode(\":\", $currentStoreactual);\n $hours = $var1[0];\n $minutes = $var1[1];\n $TotalCurrentminutes = $hours * 60 + $minutes;\n $actualminutes = $TotalCurrentminutes + ($deliveryInterval);\n $var2 = explode(\":\", $endTime);\n $Ehours = $var2[0];\n $Eminutes = $var2[1];\n $TotalEndminutes = $Ehours * 60 + $Eminutes;\n if (!empty($endTime)) {\n if (strtotime($currentStoreactual) > strtotime($endTime)) {\n return 0;\n }\n if ($actualminutes >= 1440 || $actualminutes >= $TotalEndminutes) {\n return 0;\n }\n }\n $currentStoreTime = strtotime($currentStoreTime);\n $startTime = strtotime($startTime);\n //Check Day (i.e. Now/ Predor)\n $currentTime = 0;\n $currentTime = date(\"H:i:s\", ($currentStoreTime));\n $currentTimestr = strtotime($currentTime);\n $hour24 = array('24:00:00', '24:00', '00:00:00', '00:00');\n //store start time is greater than or not to current time\n if ($startTime > $currentTimestr && (!in_array($poststartTime, $hour24))) {\n $currentTime = date(\"H:i:s\", $startTime + ($deliveryInterval * 60));\n }\n //echo \"CurrentTime3\".$currentTime.\"<br>\";\n } else {\n $currentTime = date(\"H:i:s\", (strtotime($startTime) + ($deliveryInterval * 60)));\n }\n return $currentTime;\n }", "function query_info()\r\n\t\t{\r\n\t\t\techo \"<u>Your Previous Query Consisted of:</u><br>\";\r\n\t\t\techo \"SQL = '\".$this->last_query[\"sql\"].\"'<br>\";\r\n\t\t\t$temp = ($this->last_query[\"end_time\"] - $this->last_query[\"start_time\"]);\r\n\t\t\t$temp *= 1000;\r\n\t\t\t$temp = number_format($temp, 3);\r\n\t\t\techo \"Time Elapsed: \".$temp.\"(ms)<br>\";\r\n\t\t\techo \"Number of Records: \".$this->numrows.\"<br>\";\r\n\t\t\techo \"Number of Rows Affected: \".$this->affected_rows;\r\n\t\t}", "public function getSmallVClock() {}", "function Time($time){\r\n\r\n\t}", "public function GetTTL();", "function buildfoot() {\n\tglobal $loq;\n $mtime = explode(\" \",microtime());\n\t$endtime = $mtime[1] + $mtime[0];\n\t\n\t$pagetime = round($endtime - $loq->begintime,5);\n\t$foot = \"\n<!--//\nThis page took $pagetime seconds to make\nPowered by Loquacity : http://www.loquacity.info/\n//-->\";\n\treturn $foot;\n}", "function now() {\n return microtime(true)*1000;\n}", "public function getQtdAtendida()\n {\n return $this->qtdAtendida;\n }", "public function getScheduleTime(){return $this->time_of_day;}", "public function currentTime();", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->q10_sequencial = ($this->q10_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q10_sequencial\"]:$this->q10_sequencial);\n $this->q10_inscr = ($this->q10_inscr == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q10_inscr\"]:$this->q10_inscr);\n $this->q10_numcgm = ($this->q10_numcgm == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q10_numcgm\"]:$this->q10_numcgm);\n if($this->q10_dtini == \"\"){\n $this->q10_dtini_dia = ($this->q10_dtini_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q10_dtini_dia\"]:$this->q10_dtini_dia);\n $this->q10_dtini_mes = ($this->q10_dtini_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q10_dtini_mes\"]:$this->q10_dtini_mes);\n $this->q10_dtini_ano = ($this->q10_dtini_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q10_dtini_ano\"]:$this->q10_dtini_ano);\n if($this->q10_dtini_dia != \"\"){\n $this->q10_dtini = $this->q10_dtini_ano.\"-\".$this->q10_dtini_mes.\"-\".$this->q10_dtini_dia;\n }\n }\n if($this->q10_dtfim == \"\"){\n $this->q10_dtfim_dia = ($this->q10_dtfim_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q10_dtfim_dia\"]:$this->q10_dtfim_dia);\n $this->q10_dtfim_mes = ($this->q10_dtfim_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q10_dtfim_mes\"]:$this->q10_dtfim_mes);\n $this->q10_dtfim_ano = ($this->q10_dtfim_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q10_dtfim_ano\"]:$this->q10_dtfim_ano);\n if($this->q10_dtfim_dia != \"\"){\n $this->q10_dtfim = $this->q10_dtfim_ano.\"-\".$this->q10_dtfim_mes.\"-\".$this->q10_dtfim_dia;\n }\n }\n }else{\n $this->q10_sequencial = ($this->q10_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q10_sequencial\"]:$this->q10_sequencial);\n }\n }", "function get_cuentadigital_schedule(){\n $next = wp_next_scheduled('cuentadigital_cron_hook');\n $output = '<p>Current Time: ' . current_time('mysql') . '</p>';\n $output .= '<p>Next Scheduled Run: ' . date('Y-m-d H:i:s', $next) . '</p>';\n return $output;\n }", "function getSimilarTime($obj, $socket_id, $channel_id, $_DATA)\n {\n $dp=$this->dp;\n \n $start = $_DATA['start'];\n $stop = $_DATA['stop'];\n $isin = $_DATA['isin'];\n $fdate = $_DATA['fdate'];\n\n\t$q=\"SELECT OASIS_TIME\"\n \t\t\t.\t\" FROM imk_IT WHERE TRADE_DATE='$fdate' AND SECURITY_ISIN='$isin' AND OASIS_TIME >= \\\"$start\\\" ORDER BY ORDER_ID,OASIS_TIME LIMIT 0,1\" ;\n\n\t$dp->setQuery($q);\n\t$js_start=$dp->loadResult();\n\tif ($dp->getErrorNum()){\n \t$obj->write($socket_id, $channel_id, $dp->stderr());\n\t\treturn;\n\t\t}\n\t\n\t$q=\"SELECT OASIS_TIME\"\n \t\t\t.\t\" FROM imk_IT WHERE TRADE_DATE='$fdate' AND SECURITY_ISIN='$isin' AND OASIS_TIME >= \\\"$stop\\\" ORDER BY ORDER_ID,OASIS_TIME LIMIT 0,1\" ;\n \t\n\t$dp->setQuery($q);\n\t$js_stop=$dp->loadResult();\n\tif ($dp->getErrorNum()){\n \t$obj->write($socket_id, $channel_id, $dp->stderr());\t\t\n\t\treturn;\n\t\t}\n\t\t\t\n $script .= \"custom_start='\".$js_start.\"';\";\n $script .= \"custom_end='\".$js_stop.\"';\";\n \n $obj->write($socket_id, $channel_id, $script);\n }", "function atualizacampos($exclusao=false) {\n if($exclusao==false){\n $this->q23_sequencial = ($this->q23_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q23_sequencial\"]:$this->q23_sequencial);\n $this->q23_issarqsimples = ($this->q23_issarqsimples == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q23_issarqsimples\"]:$this->q23_issarqsimples);\n $this->q23_seqreg = ($this->q23_seqreg == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q23_seqreg\"]:$this->q23_seqreg);\n if($this->q23_dtarrec == \"\"){\n $this->q23_dtarrec_dia = ($this->q23_dtarrec_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q23_dtarrec_dia\"]:$this->q23_dtarrec_dia);\n $this->q23_dtarrec_mes = ($this->q23_dtarrec_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q23_dtarrec_mes\"]:$this->q23_dtarrec_mes);\n $this->q23_dtarrec_ano = ($this->q23_dtarrec_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q23_dtarrec_ano\"]:$this->q23_dtarrec_ano);\n if($this->q23_dtarrec_dia != \"\"){\n $this->q23_dtarrec = $this->q23_dtarrec_ano.\"-\".$this->q23_dtarrec_mes.\"-\".$this->q23_dtarrec_dia;\n }\n }\n if($this->q23_dtvenc == \"\"){\n $this->q23_dtvenc_dia = ($this->q23_dtvenc_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q23_dtvenc_dia\"]:$this->q23_dtvenc_dia);\n $this->q23_dtvenc_mes = ($this->q23_dtvenc_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q23_dtvenc_mes\"]:$this->q23_dtvenc_mes);\n $this->q23_dtvenc_ano = ($this->q23_dtvenc_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q23_dtvenc_ano\"]:$this->q23_dtvenc_ano);\n if($this->q23_dtvenc_dia != \"\"){\n $this->q23_dtvenc = $this->q23_dtvenc_ano.\"-\".$this->q23_dtvenc_mes.\"-\".$this->q23_dtvenc_dia;\n }\n }\n $this->q23_cnpj = ($this->q23_cnpj == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q23_cnpj\"]:$this->q23_cnpj);\n $this->q23_tiporec = ($this->q23_tiporec == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q23_tiporec\"]:$this->q23_tiporec);\n $this->q23_vlrprinc = ($this->q23_vlrprinc == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q23_vlrprinc\"]:$this->q23_vlrprinc);\n $this->q23_vlrmul = ($this->q23_vlrmul == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q23_vlrmul\"]:$this->q23_vlrmul);\n $this->q23_vlrjur = ($this->q23_vlrjur == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q23_vlrjur\"]:$this->q23_vlrjur);\n if($this->q23_data == \"\"){\n $this->q23_data_dia = ($this->q23_data_dia == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q23_data_dia\"]:$this->q23_data_dia);\n $this->q23_data_mes = ($this->q23_data_mes == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q23_data_mes\"]:$this->q23_data_mes);\n $this->q23_data_ano = ($this->q23_data_ano == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q23_data_ano\"]:$this->q23_data_ano);\n if($this->q23_data_dia != \"\"){\n $this->q23_data = $this->q23_data_ano.\"-\".$this->q23_data_mes.\"-\".$this->q23_data_dia;\n }\n }\n $this->q23_vlraut = ($this->q23_vlraut == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q23_vlraut\"]:$this->q23_vlraut);\n $this->q23_nroaut = ($this->q23_nroaut == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q23_nroaut\"]:$this->q23_nroaut);\n $this->q23_codbco = ($this->q23_codbco == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q23_codbco\"]:$this->q23_codbco);\n $this->q23_codage = ($this->q23_codage == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q23_codage\"]:$this->q23_codage);\n $this->q23_codsiafi = ($this->q23_codsiafi == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q23_codsiafi\"]:$this->q23_codsiafi);\n $this->q23_codserpro = ($this->q23_codserpro == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q23_codserpro\"]:$this->q23_codserpro);\n $this->q23_anousu = ($this->q23_anousu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q23_anousu\"]:$this->q23_anousu);\n $this->q23_mesusu = ($this->q23_mesusu == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q23_mesusu\"]:$this->q23_mesusu);\n $this->q23_acao = ($this->q23_acao == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q23_acao\"]:$this->q23_acao);\n }else{\n $this->q23_sequencial = ($this->q23_sequencial == \"\"?@$GLOBALS[\"HTTP_POST_VARS\"][\"q23_sequencial\"]:$this->q23_sequencial);\n }\n }", "public function timeLowHi();", "protected function getPeriodicidad() {\n\t\treturn 'mensual';\n\t}", "public function ts()\n {\n return $this->ts;\n }", "function trader_rocp($real, $timePeriod = NULL)\n{\n}", "public static function getRequestTime(): float\n {\n return $_SERVER['REQUEST_TIME_FLOAT'] ?? 0.0;\n }", "function tp ()\n{\n return TPL;\n}", "function phpTrafficA_getmicrotime() {\nlist($usec, $sec) = explode(\" \", microtime());\nreturn ((float)$usec + (float)$sec);\n}", "private function getCurrentTime()\n {\n return microtime(true);\n }", "public function timeLowLow();", "public function get_quality()\n {\n }", "function PiG()\n\t{\n\t\tif(isset($_GET[\"maintainTime\"]))\n\t\t{\n\t\t\t$this->maintainTime = $_GET[\"maintainTime\"];\n\t\t}\n\t\t$this->time = time();\n\t\t\n\t\t$this->Poll();\n\t}", "public function getShowTime()\n\t{\n\t\treturn $this->showtime;\n\t}", "function mqqtPublish($mqtt, $SrcAddr, $ClusterId, $AttributId, $data, $qos = 0)\n {\n // Abeille / short addr / Cluster ID - Attr ID -> data\n // deamonlog(\"debug\",\"mqttPublish with Qos: \".$qos);\n if ($mqtt->connect(true, null, $GLOBALS['username'], $GLOBALS['password'])) {\n $mqtt->publish(\"Abeille/\".$SrcAddr.\"/\".$ClusterId.\"-\".$AttributId, $data, $qos);\n $mqtt->publish(\"Abeille/\".$SrcAddr.\"/Time-TimeStamp\", time(), $qos);\n $mqtt->publish(\"Abeille/\".$SrcAddr.\"/Time-Time\", date(\"Y-m-d H:i:s\"), $qos);\n $mqtt->close();\n } else {\n deamonlog('WARNING', 'Time out!');\n echo \"\\n\\nWARNING', Time out!\\n\\n\";\n }\n }", "public function query_analytics($time)\n\t{\n\t\t$result = array();\n\n\t\tswitch ($time)\n\t\t{\n\t\t\tcase CF_UV_DAY:\n\t\t\t\t{\n\t\t\t\t\t$result[\"unit_time\"] = \"day\";\n\t\t\t\t\t$result[\"per_time\"] = \"hour\";\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase CF_UV_WEEK:\n\t\t\t\t{\n\t\t\t\t\t$result[\"unit_time\"] = \"week\";\n\t\t\t\t\t$result[\"per_time\"] = \"day\";\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase CF_UV_MONTH:\n\t\t\t\t{\n\t\t\t\t\t$result[\"unit_time\"] = \"month\";\n\t\t\t\t\t$result[\"per_time\"] = \"day\";\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t{\n\t\t\t\t\t$result[\"unit_time\"] = \"\";\n\t\t\t\t\t$result[\"per_time\"] = \"\";\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$since = \"\";\n\t\t$until = \"\";\n\t\t$this->get_date_range($time, $since, $until);\n\n\t\t$zoneid = CloudFlare::Instance()->zone_id();\n\n\t\t$gql = '\n\t\t{\n\t\t\t\"query\": \"query GetZoneAnalytics($zoneTag: string, $since: string, $until: string) {\\\\n viewer {\\\\n zones(filter: {zoneTag: $zoneTag}) {\\\\n totals: httpRequests1dGroups(limit: 10000, filter: {date_geq: $since, date_lt: $until}) {\\\\n uniq {\\\\n uniques\\\\n }\\\\n }\\\\n zones: httpRequests1dGroups(orderBy: [date_ASC], limit: 10000, filter: {date_geq: $since, date_lt: $until}) {\\\\n dimensions {\\\\n timeslot: date\\\\n }\\\\n uniq {\\\\n uniques\\\\n }\\\\n sum {\\\\n pageViews\\\\n }\\\\n }\\\\n }\\\\n }\\\\n}\\\\n\",\n\t\t\t\"variables\": {\n\t\t\t\t\"zoneTag\": \"'.$zoneid.'\",\n\t\t\t\t\"since\": \"'.$since.'\",\n\t\t\t\t\"until\": \"'.$until.'\"\n\t\t\t},\n\t\t\t\"operationName\": \"GetZoneAnalytics\"\n\t\t}\n\t\t';\n\n\t\t$jdata = CloudFlare::Instance()->get_graphql_object($gql);\n\t\tif (!$jdata)\n\t\t{\n\t\t\treturn json_encode($result);\n\t\t}\n\n\t\t$tmp = (array)$jdata->data->viewer->zones[0];\n\t\t$tmp[\"__result__\"] = $result;\n\n\t\treturn a2j($tmp);\n\t}", "public function getProduceSpeed()\n {\n return $this->get(self::_PRODUCE_SPEED);\n }", "public function hasSugvgtime(){\n return $this->_has(3);\n }", "function getDatatoSend($type, $ext, $metering_ID, $time_interval, $unit, $factor, $timelastsend, $DeviceID){\n\t\n\t$timestamp_now = time();\n\t//echo $timestamp_now.\"<br>\";\n\t$diff_time = $timestamp_now - $timelastsend;\n\t$time_interval_seconds = $time_interval * 60;\n\t//echo $diff_time.\"<br>\";\n\tif ($diff_time >= $time_interval_seconds)\n\t{\n\t\t$type_split = explode(\"_\",$type);\n\t\n\t\t$PT1000 = new PT1000();\n\t\t$AIN = new AIN();\n\t\t$GPIO = new GPIO();\n\t\t$AOUT = new AOUT();\n\t\t$HUMIDITY = new HUMIDITY();\n\n\t\tswitch (trim($type_split[0])){\n\t\tcase \"DigiOUT\":\n\t\t\t$value_metering = $GPIO->getOutSingle($type_split[1]);\n\t\t\tbreak;\n\t\tcase \"DigiIN\":\n\t\t\t$value_metering = $GPIO->getInSingle($type_split[1]);\n\t\t\tbreak;\n\t\tcase \"AIN\":\n\t\t\t$value_metering = $AIN->getAIN($type_split[1], $ext);\n\t\t\t$value_metering = $value_metering * $factor;\n\t\t\tbreak;\n\t\tcase \"AOUT\":\n\t\t\t$value_metering = $AOUT->getAOUT($type_split[1], $ext);\n\t\t\t$value_metering = $value_metering * $factor;\n\t\t\tbreak;\n\t\tcase \"PT1000\":\n\t\t\t$value_metering = $PT1000->getPT1000($type_split[1], $ext);\n\t\t\t$value_metering = $value_metering * $factor;\n\t\t\tbreak;\n\t\tcase \"HUMIDITY\":\n\t\t\tif($type_split[1] == 0){ \n\t\t\t\t$value_metering = $HUMIDITY->getHUMIDITY($ext);\n\t\t\t\t$value_metering = $value_metering * $factor;\n\t\t\t}\n\t\t\telse if ($type_split[1] == 1){\n\t\t\t\t$value_metering = $HUMIDITY->getTemperature_C($ext);\n\t\t\t\t$value_metering = $value_metering * $factor;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\t$timestamp = time();\n\n\t\t$metering_array = array($DeviceID, $metering_ID, trim($value_metering), $timestamp, $unit);\n\t} else {\n\t\t$metering_array = null;\n\t}\n\n\treturn $metering_array;\n}", "function get_qsos_for_print($station_id = 'All') {\n\t\tif ($station_id != 'All') {\n\t\t\t$this->db->where($this->config->item('table_name').'.station_id', $station_id);\n\t\t}\n\n\t\t$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');\n\t\t$this->db->where_in('COL_QSL_SENT', array('R', 'Q'));\n\t\t$this->db->order_by(\"COL_TIME_ON\", \"ASC\");\n\t\t$query = $this->db->get($this->config->item('table_name'));\n\n\t\treturn $query;\n\t}", "public function get_questions_quality()\n\t{\n\t\treturn $this->questions_quality;\n\t}", "abstract public function getForecastTime();", "function delete_quartermile_time($qmid)\n\t{\n\t\tglobal $userdata, $db, $lang, $phpEx, $phpbb_root_path, $garage_config, $board_config;\n\t\n\t\t//Right They Want To Delete A QuarterMile Time\n\t\tif (empty($qmid))\n\t\t{\n\t \t\tmessage_die(GENERAL_ERROR, 'Quartermile ID Not Entered', '', __LINE__, __FILE__);\n\t\t}\n\t\n\t\t//Let Get All Info For Run, Including Image Info\n\t\t$data = $this->select_quartermile_data($qmid);\n\t\n\t\t//Lets See If There Is An Image Associated With This Run\n\t\tif (!empty($data['image_id']))\n\t\t{\n\t\t\tif ( (!empty($data['attach_location'])) OR (!empty($data['attach_thumb_location'])) )\n\t\t\t{\n\t\t\t\t//Seems To Be An Image To Delete, Let Call The Function\n\t\t\t\t$this->delete_image($data['image_id']);\n\t\t\t}\n\t\t}\n\n\t\t//Time To Delete The Actual Quartermile Time Now\n\t\t$this->delete_rows(GARAGE_QUARTERMILE_TABLE, 'id', $qmid);\n\n\t\treturn ;\n\t}", "private function _upTime() \n {\n return microtime(true) - $this->_startTime;\n }" ]
[ "0.57182527", "0.5611911", "0.5415562", "0.53776145", "0.5280558", "0.52314895", "0.51861566", "0.5180928", "0.5177119", "0.51687944", "0.5162115", "0.5146016", "0.51277494", "0.51193535", "0.5104396", "0.509741", "0.50942254", "0.509344", "0.5090969", "0.50785714", "0.5069718", "0.5061073", "0.50598544", "0.50594866", "0.5054239", "0.50514716", "0.50497377", "0.5046487", "0.5005235", "0.49869984", "0.4977962", "0.49548513", "0.4929507", "0.49250087", "0.49207154", "0.49207154", "0.49027485", "0.49000138", "0.48978603", "0.48954704", "0.48909682", "0.48861283", "0.48834348", "0.48830402", "0.48504972", "0.48485133", "0.48331347", "0.48286253", "0.4828106", "0.48231158", "0.4819942", "0.4819942", "0.48184532", "0.48161757", "0.48116693", "0.48086733", "0.4807253", "0.48030528", "0.4798312", "0.47830042", "0.47751892", "0.47751355", "0.47712466", "0.47613955", "0.47537917", "0.47493365", "0.47452512", "0.47391984", "0.473039", "0.4728366", "0.47260216", "0.47257838", "0.47257724", "0.47219968", "0.47205925", "0.47175005", "0.47165892", "0.47150844", "0.47118053", "0.47040722", "0.47030866", "0.4701643", "0.47005713", "0.46992177", "0.4695912", "0.46947595", "0.46864927", "0.4675149", "0.4673992", "0.46720317", "0.46701047", "0.46687022", "0.46655318", "0.46653515", "0.46603084", "0.4647309", "0.4647074", "0.46470153", "0.46461162", "0.46426675" ]
0.725313
0
Deletes multiple attachments on a given beacon. This operation is permanent and cannot be undone. You can optionally specify `namespacedType` to choose which attachments should be deleted. If you do not specify `namespacedType`, all your attachments on the given beacon will be deleted. You also may explicitly specify `` to delete all. Authenticate using an [OAuth access token]( from a signedin user with Is owner or Can edit permissions in the Google Developers Console project. (attachments.batchDelete)
public function batchDelete($beaconName, $optParams = array()) { $params = array('beaconName' => $beaconName); $params = array_merge($params, $optParams); return $this->call('batchDelete', array($params), "Google_Service_Proximitybeacon_DeleteAttachmentsResponse"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function entityDeleteMultiple($fids) {\n $files = file_load_multiple($fids);\n foreach ($files as $file) {\n file_delete($file);\n }\n }", "protected function entityDeleteMultiple($ids) {\n farm_asset_delete_multiple($ids);\n }", "public function massDelete(Request $request)\n\t{\n\t\t$ids = $request->input('ids', []);\n\t\t\n\t\tif(is_array($ids) && !empty($ids))\n\t\t{\n\t\t\tforeach(Mail::whereIn('id', $ids)->get() as $mail)\n\t\t\t{\n\t\t\t\t$mail->delete();\n\t\t\t}\n\t\t}\n\t\t\n\t\t$result = [\n\t\t\t'success' => 1,\n\t\t];\n\t\t\n\t\treturn $result;\n\t}", "public function delete_attachments($contextid = 1) {\n $fs = get_file_storage();\n $fs->delete_area_files($contextid, 'mod_documents', 'attachment', $this->id);\n $fs->delete_area_files($contextid, 'mod_documents', 'picture', $this->id);\n\n }", "public function deleteByFileIds()\n\t{\n\t\tif ( isset( \\IPS\\Request::i()->fileIds ) )\n\t\t{\n\t\t\t$ids = \\IPS\\Request::i()->fileIds;\n\t\t\t\n\t\t\tif ( ! \\is_array( $ids ) )\n\t\t\t{\n\t\t\t\t$try = json_decode( $ids, TRUE );\n\t\t\t\t\n\t\t\t\tif ( ! \\is_array( $try ) )\n\t\t\t\t{\n\t\t\t\t\t$ids = array( $ids );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$ids = $try;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ( \\count( $ids ) )\n\t\t\t{\n\t\t\t\t\\IPS\\cms\\Media::deleteByFileIds( $ids );\n\t\t\t}\n\t\t}\n\t}", "protected function entityDeleteMultiple($ids) {\n waywire_video_delete_multiple($ids);\n }", "public function bulkDelete(Request $request)\n {\n return $this->model->bulkDelete($request->ids);\n }", "public function actionBatchDelete() {\n if (($ids = Yii::$app->request->post('ids')) !== null) {\n $models = $this->findModelAll($ids);\n foreach ($models as $model) {\n $model->delete();\n }\n return $this->redirect(['index']);\n } else {\n throw new HttpException(400);\n }\n }", "static public function deleteMultiple($ids) {\n return entity_delete_multiple('nuntius_room', $ids);\n }", "public function multiDelete()\n {\n if(is_array(request()->item)){\n foreach (request()->item as $id) {\n $tradmark = Tradmark::findOrfail($id);\n Storage::delete($tradmark->logo);\n $tradmark->delete();\n }\n\n }else{\n $tradmark = Tradmark::findOrfail(request('item'));\n Storage::delete($tradmark->logo);\n $tradmark->delete();\n }\n\n session()->flash('success', trans('admin.deleted_successfully'));\n return redirect(route('admin.tradmarks.index'));\n }", "public function deleteImages()\n {\n if ($images = $this->getImages()->all()) {\n foreach ($images as $image) {\n /* @var $image AdImages */\n $image->delete();\n }\n }\n }", "public function deleteMultipleActivitiesInBulk(\n $ids\n ) {\n //check or get oauth token\n OAuthManager::getInstance()->checkAuthorization();\n\n //prepare query string for API call\n $_queryBuilder = '/activities';\n\n //process optional query parameters\n APIHelper::appendUrlWithQueryParameters($_queryBuilder, array (\n 'ids' => $ids,\n ));\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => BaseController::USER_AGENT,\n 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken)\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::delete($_queryUrl, $_headers);\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n\n return CamelCaseHelper::keysToCamelCase($response->body);\n }", "public function executeBatchDelete(sfWebRequest $request)\n {\n $q = Doctrine::getTable('Group')->createQuery('g')\n ->andWhereIn('g.id', $request->getParameter('ids'))\n ;\n $ids = array();\n foreach ( $q->execute() as $group )\n $ids[] = $group->id;\n $request->setParameter('ids', $ids);\n \n parent::executeBatchDelete($request);\n }", "public function batchDeleteAction(Request $request)\n {\n $this->checkCreateBroadcastDisabled();\n\n $ids = $this->getRequest()->get('ids');\n\n if ('string' === gettype($ids)) {\n $ids = json_decode($ids, true);\n }\n\n $factory = $this->get('pumukitschema.factory');\n foreach ($ids as $id) {\n $broadcast = $this->find($id);\n if (0 !== $broadcast->getNumberMultimediaObjects()) {\n continue;\n }\n\n try {\n $factory->deleteResource($broadcast);\n } catch (\\Exception $e) {\n return new Response($e->getMessage(), Response::HTTP_BAD_REQUEST);\n }\n if ($id === $this->get('session')->get('admin/broadcast/id')) {\n $this->get('session')->remove('admin/broadcast/id');\n }\n }\n\n return $this->redirect($this->generateUrl('pumukitnewadmin_broadcast_list'));\n }", "function messageDeleteBulk(Collection $messages);", "public function delete(array $ids);", "public static function batch_delete($object_array)\n\t{\n \t\tS3Persister::init();\n $client = S3Client::factory(array(\n 'key' => S3Persister::$AWS_KEY,\n 'secret' => S3Persister::$AWS_SECRET_KEY,\n 'region' => S3Persister::REGION));\n $bucket = S3Persister::$BUCKET_NAME;\n\n\t\t$delete_objects = array();\n\t\tforeach($object_array as $object)\n\t\t{\n \t//$object_path = \"{$bucket}/{$object}\";\n\t\t\tarray_push($delete_objects,array(\"Key\" => $object));\t\n\t\t}\n\t\t\n $request = $client->deleteObjects(array('Bucket' => \"$bucket\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Objects'=> $delete_objects));\n\n return TRUE;\t\t\n\t}", "public function deleteMultipleActivityTypesInBulk(\n $ids\n ) {\n //check or get oauth token\n OAuthManager::getInstance()->checkAuthorization();\n\n //prepare query string for API call\n $_queryBuilder = '/activityTypes';\n\n //process optional query parameters\n APIHelper::appendUrlWithQueryParameters($_queryBuilder, array (\n 'ids' => $ids,\n ));\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => BaseController::USER_AGENT,\n 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken)\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::DELETE, $_headers, $_queryUrl);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::delete($_queryUrl, $_headers);\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n\n return CamelCaseHelper::keysToCamelCase($response->body);\n }", "public function do_batch() {\n\t\t$post_ids = array_map( 'intval', $this->get_post_ids() );\n\t\tforeach( $post_ids as $post_to_delete ) {\n\t\t\tadd_filter( Toolset_Association_Cleanup_Post::IS_DELETING_FILTER, '__return_true' );\n\t\t\twp_delete_post( $post_to_delete, true );\n\t\t\tremove_filter( Toolset_Association_Cleanup_Post::IS_DELETING_FILTER, '__return_true' );\n\t\t}\n\n\t\t$this->deleted_posts = count( $post_ids );\n\t}", "static public function deleteMulti($subject, $keys) {\n\t\tforeach($keys as $oneKey)\n\t\t\tself::delete($subject, $oneKey);\n\t}", "public function deleteItemBatch($keys)\n {\n $this->batchRequests = [];\n $response = [];\n\n foreach (array_chunk($keys, $this->batchWriteChunkSize) as $keyChunk) {\n $this->batchRequests[] = Write::make()\n ->addMany(\n $this->from,\n array_map(function ($key) {\n return DeleteRequest::make($key);\n }, $keyChunk)\n );\n }\n\n $queries = $this->grammar->compileBatchWriteItem($this);\n\n foreach ($queries as $query) {\n $response[] = $this->connection->getClient()->batchWriteItem($query);\n }\n\n return $this->processor->processBatchWriteItems($response);\n }", "public function actionBulkDelete() {\n\n if (Yii::$app->request->post('selection')) {\n $where = ['id' => Yii::$app->request->post('selection', []), 'sender_id' => Yii::$app->user->identity->id, 'status_del' => $this->modelClass::STATUS_DEL_TRASH];\n $this->modelClass::updateAll(['status_del' => $this->modelClass::STATUS_DEL_DELETE, 'deleted_at' => time()], $where);\n\n $whereVia = ['mailbox_id' => Yii::$app->request->post('selection', []), 'receiver_id' => Yii::$app->user->identity->id, 'status_del' => $this->modelClass::STATUS_DEL_TRASH];\n $this->modelViaClass::updateAll(['status_del' => $this->modelClass::STATUS_DEL_DELETE, 'deleted_at' => time()], $whereVia);\n }\n }", "public function deleteAll($dataItemType, $dataItemID, $criteria = '')\r\n {\r\n /* Get all attachment IDs for the Data Item. */\r\n $sql = sprintf(\r\n \"SELECT\r\n attachment_id AS attachmentID,\r\n directory_name AS directoryName\r\n FROM\r\n attachment\r\n WHERE\r\n data_item_id = %s\r\n AND\r\n data_item_type = %s\r\n AND\r\n site_id = %s\r\n %s\",\r\n $this->_db->makeQueryInteger($dataItemID),\r\n $this->_db->makeQueryInteger($dataItemType),\r\n $this->_siteID,\r\n $criteria\r\n );\r\n $rs = $this->_db->getAllAssoc($sql);\r\n\r\n /* Return if we have no attachments. */\r\n if (empty($rs))\r\n {\r\n return;\r\n }\r\n\r\n foreach ($rs as $rowNumber => $row)\r\n {\r\n /* Sanity check. Don't delete the whole attachments directory. */\r\n $directoryName = trim($row['directoryName']);\r\n if (empty($directoryName) || $directoryName = '.')\r\n {\r\n continue;\r\n }\r\n\r\n $directory = 'attachments/' . $directoryName;\r\n\r\n if (is_dir($directory))\r\n {\r\n FileUtility::recursivelyRemoveDirectory($directory);\r\n }\r\n }\r\n\r\n /* Delete the attachments metadata. */\r\n $sql = sprintf(\r\n \"DELETE FROM\r\n attachment\r\n WHERE\r\n data_item_id = %s\r\n AND\r\n data_item_type = %s\r\n AND\r\n site_id = %s\r\n %s\",\r\n $this->_db->makeQueryInteger($dataItemID),\r\n $this->_db->makeQueryInteger($dataItemType),\r\n $this->_siteID,\r\n $criteria\r\n );\r\n $this->_db->query($sql);\r\n }", "public function delete($attachment_id) {\r\n\t\t\r\n\t\tif(is_array($attachment_id)) {\r\n\t\t\r\n\t\t\twhile(list($ind, $val) = each($attachment_id)) {\r\n\t\t\t\t\r\n\t\t\t\t$query = \"DELETE FROM $this->att WHERE attachment_id = $val\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t$Affected = $this->execute($query);\r\n\t\t\t\t\r\n\t\t\t\tif (PEAR::isError($Affected)) {\r\n\t\t\t\t\tdie($Affected->getMessage());\r\n\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\t$query = \"DELETE FROM $this->att WHERE attachment_id = $attachment_id\";\r\n\t\t\t\r\n\t\t\t$Affected = $this->execute($query);\r\n\t\t\t\t\r\n\t\t\t\tif (PEAR::isError($Affected)) {\r\n\t\t\t\t\tdie($Affected->getMessage());\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\r\n\t}", "public function massDestroy(Request $request)\n {\n if (! Gate::allows('jobtype_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = Jobtype::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function batch_delete($data)\n {\n $required = array(\n 'ids' => 'IDs not passed',\n );\n $this->di['validator']->checkRequiredParamsForArray($required, $data);\n\n foreach ($data['ids'] as $id) {\n $this->delete(array('id' => $id));\n }\n\n return true;\n }", "function mongo_node_mass_delete($entity_type, $entities) {\n entity_delete_multiple($entity_type, $entities);\n}", "public function multipleDelete(Request $request)\n {\n $user = \\Auth::user();\n $permission = new Permission();\n if ($user->can('delete', $permission)) {\n try {\n $data_ids = $_REQUEST['data_ids'];\n $data_id_array = explode(\",\", $data_ids);\n \n if ($this->permission->delete($data_id_array)) {\n return \"successfully deleted\";\n } else {\n return \"Permission cannot be deleted.\";\n }\n } catch (Exception $e) {\n return $e;\n }\n } else {\n return view('errors.401');\n }\n }", "public function massDestroy(Request $request)\n {\n if (! Gate::allows('document_delete')) {\n return abort(401);\n }\n\n if ($request->input('ids')) {\n $entries = Document::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function bulk_delete(Request $request){\n $this->isAuthorize();\n\n // Delete the Data\n $userID = $this->request->session()->get('userID');\n $ids = $request->ids;\n DB::table(\"apt_time_slots\")->where('userID','=',$userID)->whereIn('id',explode(\",\",$ids))->delete();\n return response()->json(['success'=>\"Deleted successfully.\"]);\n }", "public function delete(array $ids)\n {\n\n }", "public static function bulk_delete($items) {\r\n\t\tif(!empty($items)){\r\n\t\t\treturn self::massdelete($items);\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function deleteMultiple( $keys )\n\t{\n\t\t$this->getObject()->deleteMultiple( $keys );\n\t}", "public function deleteLineItems(array $ids);", "public static function batchDelete() {\n $result = array();\n $copied = lC_Products_Admin::batchDelete($_GET['batch']);\n if ($copied) {\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n }\n\n echo json_encode($result);\n }", "public function deleteMultipleById(array $ids) : int\n {\n }", "public function multiple_delete(Request $request)\n {\n Category::destroy($request->ids);\n $response = ['model_type' => 'Category', 'ids' => $request->ids, 'action_type' => 'delete'];\n return json_encode($response);\n }", "function messageDeleteBulkRaw(TextChannelInterface $channel, array $messageIDs);", "function deleteItems($itemids) {\r\n $event = new mosEventCal_Event();\r\n\tforeach($itemids AS $itemid) {\r\n\t $event->delete($itemid);\t\r\n\t}\r\n}", "public function deleteAllImage(Request $request)\n\t{\n\t\t$ids = $request->ids;\n\t\t$row = DB::table(\"images\")\n\t\t\t->where('created_by', '=', Auth::user()->name)\n\t\t\t->whereIn('id', explode(\",\", $ids))->whereNull('tour_id')->delete();\n\t\t$imageCount = DB::table('images')->count();\n\n\t\treturn response()->json(['success' => \"360 Images deleted.\", 'imageCount' => $imageCount, 'row' => $row]);\n\t}", "public function bulk_destroy(Request $request)\n {\n $banners = Banners::find($request->ids);\n\n foreach ($banners as $item) {\n //languages\n $languages = Language::all();\n if($languages->count()){\n foreach ($request->language as $language) {\n $banners_trans = BannersTrans::where('lang', '=', $language)->where('tid', '=', $item->id)->first();\n\n if($banners_trans) {\n $banners_trans->delete();\n }\n }\n $check_banners_trans = BannersTrans::where('tid', '=', $item->id)->first();\n if(!$check_banners_trans){\n $item->delete();\n }\n }\n // end languages\n }\n \n Flash::success(trans('backend.deleted_successfully'));\n $Currentlanguage = Lang::getLocale();\n return redirect(''.$Currentlanguage.'/admin/banners');\n }", "public function deleteMultiple(Request $request)\n {\n $ids = explode(\",\", $request->ids);\n\n foreach ($ids as $key => $id) {\n $product = Product::with('categories', 'tags', 'attributes')->find($id);\n if (!empty($product)) {\n if (count($product->categories) > 0) {\n foreach ($product->categories as $category) {\n if ($category->total_products > 0) {\n $category->decrement('total_products');\n }\n }\n }\n if (count($product->tags) > 0) {\n foreach ($product->tags as $tag) {\n if ($tag->total_products > 0) {\n $tag->decrement('total_products');\n }\n }\n }\n\n $product->attributes()->detach();\n $product->categories()->detach();\n $this->removeThisCache($product->slug, $product->id);\n\n if ($product->delete() > 0) {\n// return response(1);\n }\n }\n// return response(0);\n }\n return response()->json(['success' => \"Products Multi Deleted successfully.\"]);\n\n }", "public static function massdelete($items) {\r\n\t\t$retval = Doctrine_Query::create ()->delete ()->from ( 'DomainsTlds d' )->whereIn ( 'd.tld_id', $items )->execute ();\r\n\t\treturn $retval;\r\n\t}", "public function massDestroy(Request $request)\n {\n if (! Gate::allows('believer_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = Believer::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function bulkDeleteRecurringSMS(Request $request)\n {\n $appStage = app_config('AppStage');\n if ($appStage == 'Demo') {\n return redirect('user/sms/recurring-sms')->with([\n 'message' => language_data('This Option is Disable In Demo Mode'),\n 'message_important' => true\n ]);\n }\n\n if ($request->has('data_ids')) {\n $all_ids = explode(',', $request->get('data_ids'));\n\n if (is_array($all_ids) && count($all_ids) > 0) {\n foreach ($all_ids as $id) {\n\n $check_exist = RecurringSMS::where('userid', Auth::guard('client')->user()->id)->find($id);\n\n if ($check_exist) {\n RecurringSMSContacts::where('campaign_id', $id)->delete();\n $check_exist->delete();\n }\n }\n }\n }\n }", "public function multi_delete(Request $request)\n {\n if (count($request->selected_data)) {\n foreach ($request->selected_data as $id) {\n $this->destroy($id, false);\n }\n session()->flash('success', trans('main.deleted-message'));\n return redirect()->route('classes.index');\n }\n }", "public function bulkDeleteVideo(Request $request)\n {\n try {\n $validateData = Validator::make($request->all(),[\n 'video_ids.*' => 'required'\n ]);\n if ($validateData->fails()) {\n $messages = $validateData->errors()->all();\n return APIResponse('201', 'Validation errors.', $messages);\n }\n $videoIds = $request->get('video_ids');\n\n foreach ($videoIds as $id) {\n $deleted= VideoContent::where('ID','=', (int) $id)->update(['status' => false]);\n }\n\n if ($deleted) {\n $response = APIResponse('200', 'Video has been deleted successfully.');\n } else {\n $response = APIResponse('201', 'Something went wrong, please try again.');\n }\n } catch (\\Throwable $e) {\n $response = APIResponse('201', $e->getMessage());\n }\n return $response;\n }", "public function bulkDelete(Request $request)\n {\n $ids = $request->get('ids');\n Guest::whereIn('id', $ids)->delete();\n return $this->index(request());\n }", "public static function batchDelete() {\n $result = lC_Weight_classes_Admin::batchDelete($_GET['batch']);\n if (isset($result['namesString']) && $result['namesString'] != null) {\n } else {\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n }\n\n echo json_encode($result);\n }", "public function delete_multiple(array $keys, $group = '')\n {\n }", "public function testDeleteBatch()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function delete_attachments ($pid, $tid, $aid = '')\n {\n global $f_upload_path;\n $delete_files = array ();\n $query = sql_query ('SELECT a_name FROM ' . TSF_PREFIX . 'attachments WHERE a_pid = ' . sqlesc ($pid) . ' AND a_tid = ' . sqlesc ($tid));\n if (0 < mysql_num_rows ($query))\n {\n while ($delete = mysql_fetch_assoc ($query))\n {\n $delete_files[] = $delete['a_name'];\n }\n }\n\n if (0 < count ($delete_files))\n {\n foreach ($delete_files as $nowdelete)\n {\n if (file_exists ($f_upload_path . $nowdelete))\n {\n unlink ($f_upload_path . $nowdelete);\n continue;\n }\n }\n }\n\n sql_query ('DELETE FROM ' . TSF_PREFIX . 'attachments WHERE a_pid = ' . sqlesc ($pid) . ' AND a_tid = ' . sqlesc ($tid) . ($aid ? ' AND a_id = ' . sqlesc ($aid) : ''));\n }", "public function delete()\n {\n if (method_exists(get_class($this), 'attachments'))\n {\n /** @var Attachment $attachment */\n /** @noinspection PhpUndefinedMethodInspection */\n foreach ($this->attachments()->get() as $attachment)\n {\n $attachment->delete();\n }\n }\n return parent::delete();\n }", "private function removeFiles($db, array $fileids, $linktype)\n {\n \tLogger::log($fileids, Zend_Log::DEBUG);\n \t$linktype = $db->quote($linktype);\n \tforeach ($fileids as $fileid)\n \t{Logger::log('FileID=' . $fileid . ' AND LinkType=' . $linktype);\n \t\t$db->delete('Files', 'FileID=' . $fileid . ' AND LinkType=' . $linktype);\n \t}\n }", "public function actionBatchDelete($vid)\n {\n if (($ids = Yii::$app->request->post('ids')) !== null) {\n $models = $this->findModel($ids, $vid);\n foreach ($models as $model) {\n $model->delete();\n }\n return $this->redirect(['index', 'vid' => $vid]);\n } else {\n throw new HttpException(400);\n }\n }", "public function delete($files);", "public function multi_delete(Request $request)\n {\n if (count($request->selected_data)) {\n foreach ($request->selected_data as $id) {\n $this->destroy($id, false);\n }\n session()->flash('success', trans('main.deleted-message'));\n return redirect()->route('posts.index');\n }\n }", "public function actionDeleteMultiple()\n {\n $request = Yii::$app->request;\n Yii::$app->response->format = Response::FORMAT_JSON;\n $js = $request->post('js');\n $jk = $request->post('jk');\n\n $mata_kuliah_tayang = MataKuliahTayang::find()\n ->joinWith('refCpmks')\n ->where([MataKuliahTayang::tableName() . '.id' => $jk])\n ->all();\n // $count = count($mata_kuliah_tayang[0]['refCpmks']);\n\n foreach ($js as $id_mahasiswa) {\n foreach ($mata_kuliah_tayang as $key => $value) {\n foreach ($value['refCpmks'] as $key => $value) {\n CapaianMahasiswa::deleteAll(['id_ref_mahasiswa' => $id_mahasiswa, 'id_ref_cpmk' => $value->id]);\n }\n }\n }\n }", "public static function massdelete($items) {\r\n\t\t$retval = Doctrine_Query::create ()->delete ()->from ( 'Wiki w' )->whereIn ( 'w.wiki_id', $items )->execute ();\r\n\t\treturn $retval;\r\n\t}", "public function deleteMany($ids)\n {\n $placeholders = array_fill(0, count($ids), \"?\");\n $placeholders = implode(\", \", $placeholders);\n\n $sql = \"DELETE FROM `%s` WHERE `%s` IN (%s)\";\n $this->_sql[] = sprintf($sql, $this->_table, $this->_key, $placeholders);\n $parameters = array();\n foreach ($ids as $id) {\n $parameters[] = array($this->_key => $id);\n }\n $this->_parameters[] = $this->parameterize($parameters);\n return $this->run();\n }", "function multi_delete () {\n\t\t$ids_to_delete = array();\n\t\t// Prepare ids to delete\n\t\tforeach ((array)$_POST[\"items\"] as $_cur_id) {\n\t\t\tif (empty($_cur_id)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$ids_to_delete[$_cur_id] = $_cur_id;\n\t\t}\n\t\t// Do delete ids\n\t\tif (!empty($ids_to_delete)) {\n\t\t\tdb()->query(\"DELETE FROM \".db('search_keywords').\" WHERE id IN(\".implode(\",\",$ids_to_delete).\")\");\n\t\t}\n\t\t// Return user back\n\t\treturn js_redirect($_SERVER[\"HTTP_REFERER\"]);\n\t}", "public function massDestroy(Request $request)\n {\n if (! Gate::allows('invoice_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = Invoice::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->deletePreservingMedia();\n }\n }\n }", "public function massDestroy(Request $request)\n {\n if (! Gate::allows('bill_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = Bill::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function massDestroy(Request $request)\n {\n if ($request->input('ids')) {\n $entries = Article::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function multiDeleteAction() {\n if ($this->getRequest()->isPost()) {\n $values = $this->getRequest()->getPost();\n foreach ($values as $key => $value) {\n if ($key == 'delete_' . $value) {\n //DELETE OFFERS FROM DATABASE AND SCRIBD\n $offer_id = (int) $value;\n\t\t\t\t\tEngine_Api::_()->sitestoreoffer()->deleteContent($offer_id);\n }\n }\n }\n return $this->_helper->redirector->gotoRoute(array('action' => 'index'));\n }", "public function delete($idlist)\n {\n // Check if we have multiple IDs to destroy\n $idArray = explode(',', $idlist);\n foreach($idArray as $id) {\n $issue = Issue::find($id);\n $attachments = $issue->attachments()->get();\n foreach($attachments as $attachment) {\n $this->dispatch(new DestroyAttachmentCommand($attachment));\n }\n Issue::destroy($id);\n }\n return true;\n }", "public function massDestroy(Request $request)\n {\n if ($request->input('ids')) {\n $entries = Subjects::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function massDestroy(Request $request)\n {\n if (! Gate::allows('commentaire_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = Commentaire::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function ajax_batch_delete(Request $request, $id)\n {\n foreach ($request->id as $id) {\n \n $tag = Tag::find($id);\n Tag::destroy($id);\n }\n echo 1;\n }", "public function bulkdelete(Request $request)\n {\n\n User::whereIn('id',explode(\",\",$request->bulkDeleteArray))->delete();\n $userHobby = Userhobby::whereIn('user_id',explode(\",\",$request->bulkDeleteArray))->delete();\n $userData = User::with('hobby')->get();\n $categories = Category::get();\n $hobby = Hobby::get();\n return response(['status' => true, 'statusCode' => 1, 'userData' => $userData,'categories'=>$categories,'hobby'=>$hobby]);\n }", "public function massDestroy(Request $request)\n {\n \n if ($request->input('ids')) {\n $entries = Donation::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function massDestroy(Request $request)\n {\n if (! Gate::allows('tire_brand_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = TireBrand::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function massDelete(Request $request)\n {\n if ($request->get('toDelete') != 'mass') {\n $toDelete = json_decode($request->get('toDelete'));\n ApplicationImages::destroy($toDelete);\n } else {\n ApplicationImages::whereNotNull('id')->delete();\n }\n\n return redirect()->route(config('quickadmin.route').'.applicationimages.index');\n }", "public function actionBulkDelete()\n {\n $request = Yii::$app->request;\n $pks = explode(',', $request->post('pks')); // Array or selected records primary keys\n foreach ($pks as $pk) {\n $model = $this->findModel($pk);\n $model->delete();\n }\n\n if ($request->isAjax) {\n /*\n * Process for ajax request\n */\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ['forceClose' => true, 'forceReload' => '#crud-datatable-pjax'];\n } else {\n /*\n * Process for non-ajax request\n */\n return $this->redirect(['index']);\n }\n }", "public function actionBulkDelete()\n {\n $request = Yii::$app->request;\n $pks = explode(',', $request->post('pks')); // Array or selected records primary keys\n foreach ($pks as $pk) {\n $model = $this->findModel($pk);\n $model->delete();\n }\n\n if ($request->isAjax) {\n /*\n * Process for ajax request\n */\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ['forceClose' => true, 'forceReload' => '#crud-datatable-pjax'];\n } else {\n /*\n * Process for non-ajax request\n */\n return $this->redirect(['index']);\n }\n }", "function delete_files($obj,$where)\n\n\t{\n\n\t\t\n\n\t\t$param_array = func_get_args();\n\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::delete_files() - PARAMETER LIST : ', $param_array);\n\n\n\n\t\tif(strlen(trim($obj->file_flds)) > 0)\n\n\t\t{\n\n\t\t\t\n\n\t\t\t$res = $this->fetch_flds($obj->cls_tbl, $obj->file_flds, $where);\n\n\t\t\t\n\n\t\t\t$fld_count = count(explode(\",\", $obj->file_flds));\n\n\n\n\t\t\twhile($data = mysql_fetch_row($res[0]))\n\n\t\t\t{\n\n\t\t\t\tfor($i = 0;$i < $fld_count; $i++)\n\n\t\t\t\t{\n\n\t\t\t\t\t$file_path = $obj->attachment_path . $data[$i];\n\n\t\t\t\t\t\n\n\t\t\t\t\tif(file_exists($file_path) && is_file($file_path))\n\n\t\t\t\t\tunlink($file_path);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\n\n\t\t}\n\n\t\t\n\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::delete_files() - Return Value : ', 'Deletes all the attachments made to the particular record and returns void');\n\n\n\n\t}", "public function mutipleDelete(Request $request)\n {\n foreach($request->all() as $product){\n Product::find($product['id'])->delete();\n }\n }", "public function massDestroy(Request $request)\n {\n if (! Gate::allows('type_tache_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = TypeTache::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public static function batchDelete() {\n $result = lC_Product_variants_Admin::batchDelete($_GET['batch']);\n if (isset($result['namesString']) && $result['namesString'] != null) {\n } else {\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n }\n\n echo json_encode($result);\n }", "public function massDestroy(Request $request)\n {\n if (! Gate::allows('test_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = TestHeader::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function multiDeleteAction() {\n\n if ($this->getRequest()->isPost()) {\n $values = $this->getRequest()->getPost();\n\n foreach ($values as $key => $value) {\n if ($key == 'delete_' . $value) {\n Engine_Api::_()->getItem('list_listing', (int) $value)->delete();\n }\n }\n }\n return $this->_helper->redirector->gotoRoute(array('action' => 'index'));\n }", "public function massDestroy(Request $request)\n {\n if (! Gate::allows('klanten_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = Klanten::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public static function batchDeleteEntries() {\n global $_module;\n\n $result = lC_Product_variants_Admin::batchDeleteEntries($_GET['batch'], $_GET[$_module]);\n if (isset($result['namesString']) && $result['namesString'] != null) {\n } else {\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\n }\n\n echo json_encode($result);\n }", "public function actionBulkDelete() {\n $request = Yii::$app->request;\n $pks = explode(',', $request->post('pks')); // Array or selected records primary keys\n foreach ($pks as $pk) {\n $model = $this->findModel($pk);\n $model->delete();\n }\n\n if ($request->isAjax) {\n /*\n * Process for ajax request\n */\n Yii::$app->response->format = Response::FORMAT_JSON;\n return ['forceClose' => true, 'forceReload' => '#crud-datatable-pjax'];\n } else {\n /*\n * Process for non-ajax request\n */\n return $this->redirect(['index']);\n }\n }", "public function handlePostBatchDelete($postIds = [])\n {\n $deleted = 0;\n\n if (!empty($postIds)) {\n $client = $this->getClient();\n $engineSlug = $this->getConfig()->getEngineSlug();\n $documentType = $this->getConfig()->getDocumentType();\n\n $deleteResponse = $client->deleteDocuments($engineSlug, $documentType, $postIds);\n\n foreach ($deleteResponse as $currentDocIndexing) {\n if ($currentDocIndexing === true) {\n $deleted = 0;\n }\n }\n }\n\n \\do_action('swiftype_batch_post_delete_result', $deleted);\n }", "public function massDestroy(Request $request)\n {\n if (! Gate::allows('chocolate_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = Chocolate::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->deletePreservingMedia();\n }\n }\n }", "public function deleteItems(array $uuids)\n {\n foreach ($uuids as $uuid) {\n $this->deleteItem($uuid);\n }\n }", "public function massDestroy(Request $request)\n {\n if (! Gate::allows('exam_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = Exam::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function bulkDelete(Request $request)\n {\n $delete_check_box_value = $request->delete_check_box_value;\n $delete_check_box_value = explode('|',$delete_check_box_value);\n User::whereIn('id',$delete_check_box_value)->delete();\n\n $message = \"<strong>Notice!</strong> Ticket deleted successfully.\n <a href=\\\"#\\\" class=\\\"close\\\" data-dismiss=\\\"alert\\\" aria-label=\\\"close\\\">×</a>\";\n\n \n echo json_encode(\n [\n 'success' => 200,\n ]\n );\n }", "public function massDestroy(Request $request)\n {\n if (!Gate::allows('testimonials_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = DB::table('testimonials')->whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function massDeleteAction() {\n $messageIds = $this->getRequest()->getParam('connector');\n\n if (!is_array($messageIds)) {\n Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('Please select item(s)'));\n } else {\n try {\n foreach ($messageIds as $messageId) {\n $notice = Mage::getModel('connector/notice')->load($messageId);\n $notice->delete();\n }\n Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('adminhtml')->__('Total of %d record(s) were successfully deleted', count($bannerIds)));\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n }\n }\n $this->_redirect('*/*/index');\n }", "public function massDestroy(Request $request)\n {\n if (! Gate::allows('driver_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = Driver::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "function initializeDeleteMultipleFilesDialog() {\n $files = $this->getFilesById(array_keys($this->params['batch_files']));\n if (is_array($files) && count($files) > 0) {\n include_once(PAPAYA_INCLUDE_PATH.'system/base_msgdialog.php');\n $hidden = array(\n 'cmd' => $this->params['cmd'],\n 'batch_files' => $this->params['batch_files'],\n 'confirm' => 1,\n );\n\n foreach ($files as $fileId => $file) {\n $fileNames[] = $file['file_name'];\n }\n\n $fileNamesList = '\"'.implode('\", \"', $fileNames).'\"';\n\n $this->dialog = new base_msgdialog(\n $this,\n $this->paramName,\n $hidden,\n sprintf(\n $this->_gt('Do you really want to delete %s ?'),\n $fileNamesList\n ),\n 'warning'\n );\n $this->dialog->msgs = &$this->msgs;\n $this->dialog->buttonTitle = 'Delete';\n } else {\n $this->addMSG(MSG_INFO, $this->_gt('No files found.'));\n }\n }", "public function deleteMultipleEntriesAction()\n {\n $personsToDelete = $this->request->getArguments()['personsToDelete'];\n $this->personRepository->deleteMultipleEntries($personsToDelete);\n $this->redirect('list');\n }", "public function massDestroy(Request $request)\n {\n if (! Gate::allows('event_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = Event::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function massDestroy(Request $request)\n {\n if (! Gate::allows('coursescertificate_delete')) {\n return abort(401);\n }\n if ($request->input('ids')) {\n $entries = Coursescertificate::whereIn('id', $request->input('ids'))->get();\n\n foreach ($entries as $entry) {\n $entry->delete();\n }\n }\n }", "public function multiDeleteApplicationAction() {\n $listing_id = $this->_getParam('listing_id');\n $listingtype_id = $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id)->listingtype_id;\n\n if ($this->getRequest()->isPost()) {\n $values = $this->getRequest()->getPost();\n\n foreach ($values as $key => $value) {\n if ($key == 'delete_' . $value) {\n Engine_Api::_()->getItem('sitereview_job', (int) $value)->delete();\n }\n }\n }\n //REDIRECTING\n return $this->_helper->redirector->gotoRoute(array('action' => 'show-application', 'listing_id' => $listing_id), \"sitereview_dashboard_listtype_$listingtype_id\", true);\n }", "public function afterDelete($event)\n {\n\n\n $imagesList = $this->owner->attachments;\n //die(print_r($imagesList));\n if (!empty($imagesList)) {\n foreach ($imagesList as $image) {\n\n\n $alias = $this->attachmentAttributes['path'];\n\n\n // Delete file\n if (file_exists(Yii::getPathOfAlias(\"webroot.uploads.{$alias}\") . '/' . $image->name))\n unlink(Yii::getPathOfAlias(\"webroot.uploads.{$alias}\") . '/' . $image->name);\n\n if (file_exists(Yii::getPathOfAlias(\"webroot.assets.{$alias}\"))) {\n $listfile = CFileHelper::findFiles(Yii::getPathOfAlias(\"webroot.assets.{$alias}\"), array(\n 'absolutePaths' => true\n ));\n foreach ($listfile as $path) {\n if (strpos($path, $image->name) !== false) {\n if (file_exists($path)) {\n unlink($path);\n }\n }\n }\n }\n if ($image->is_main) {\n // Get first image and set it as main\n $model = AttachmentModel::model()->find();\n if ($model) {\n $model->is_main = 1;\n $model->save(false, false, false);\n }\n }\n\n $image->delete();\n }\n }\n return parent::afterDelete($event);\n }", "public function deleteRequirements(array $requirements = []);", "function delete_multiple_blog_category()\n {\n $blog_categories = $this->input->post('table_records');\n $website_id = $this->input->post('website_id');\n foreach ($blog_categories as $blog_category):\n $this->db->where(array(\n 'id' => $blog_category,\n 'website_id' => $website_id\n ));\n $this->db->update($this->table_blog_category, array(\n 'is_deleted' => 1\n ));\n endforeach;\n }" ]
[ "0.6238352", "0.6026112", "0.59627557", "0.5920845", "0.5877035", "0.5796132", "0.57709795", "0.5654801", "0.5618383", "0.55749494", "0.5558357", "0.55516684", "0.5533098", "0.5526734", "0.55125", "0.5509071", "0.54763347", "0.5447636", "0.5444962", "0.5437601", "0.5416639", "0.5399298", "0.5398604", "0.53733855", "0.53314054", "0.53232163", "0.5310142", "0.53059554", "0.53018105", "0.5294", "0.52924836", "0.52922124", "0.52879536", "0.52773225", "0.5259889", "0.5252135", "0.5246183", "0.52186525", "0.521782", "0.5199937", "0.5195661", "0.5192571", "0.51817167", "0.51796734", "0.51796454", "0.51778823", "0.51773846", "0.51729447", "0.51725346", "0.51633185", "0.5153129", "0.5153031", "0.5149165", "0.5143738", "0.5143257", "0.51308274", "0.5126171", "0.51232934", "0.5108743", "0.50996006", "0.5094937", "0.50935566", "0.5092123", "0.50878793", "0.5087459", "0.5077532", "0.5075058", "0.5053094", "0.5052511", "0.5045837", "0.50378376", "0.502485", "0.5024443", "0.5011549", "0.5011549", "0.5005047", "0.49991015", "0.49949023", "0.49916124", "0.49845868", "0.4979202", "0.49781936", "0.4972535", "0.49704972", "0.4968129", "0.49656895", "0.49637833", "0.4962588", "0.49619386", "0.49614996", "0.4959696", "0.4959366", "0.4956053", "0.49448285", "0.49441987", "0.49441597", "0.49383035", "0.4928705", "0.49253038", "0.4923607" ]
0.75982326
0
Associates the given data with the specified beacon. Attachment data must contain two parts: A namespaced type. The actual attachment data itself. The namespaced type consists of two parts, the namespace and the type. The namespace must be one of the values returned by the `namespaces` endpoint, while the type can be a string of any characters except for the forward slash (`/`) up to 100 characters in length. Attachment data can be up to 1024 bytes long. Authenticate using an [OAuth access token]( from a signedin user with Is owner or Can edit permissions in the Google Developers Console project. (attachments.create)
public function create($beaconName, Google_Service_Proximitybeacon_BeaconAttachment $postBody, $optParams = array()) { $params = array('beaconName' => $beaconName, 'postBody' => $postBody); $params = array_merge($params, $optParams); return $this->call('create', array($params), "Google_Service_Proximitybeacon_BeaconAttachment"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function addAttachment($data)\n {\n $data = array_merge($data, ['created_at' => Carbon::now()]);\n\n return DB::table('attachments')->insertGetId($data);\n }", "public function addAttachmentFromData($name, $data, $mimeType = 'application/octet-stream', $contentId = null, $attachmentType = 'attachment') {\n $this->attachments[$name] = array(\n 'name' => $name,\n 'mimeType' => $mimeType,\n 'data' => $data,\n 'contentId' => $contentId,\n 'attachmentType' => ($attachmentType == 'inline' ? 'inline; filename=\"' . $name . '\"' : $attachmentType),\n );\n return $this;\n }", "public function create( $data = array() )\n\t{\n\t\treturn Attachment::create($data);\n\t}", "public function attachFile($filename, $fileData){\r\n\r\n $f = [];\r\n $f['filename'] = $filename;\r\n $f['binary'] = chunk_split(base64_encode($fileData));\r\n\r\n $this->_attachments[] = $f;\r\n $this->_attachmentsLen ++;\r\n }", "function attachmentsCreateExample($service, $beaconName, $optParams)\n{\n\ttry\n\t{\n\t\t// Parameter validation.\n\t\tif ($service == null)\n\t\t\tthrow new Exception(\"service is required.\");\n\t\tif ($optParams == null)\n\t\t\tthrow new Exception(\"optParams is required.\");\n\t\tif (beaconName == null)\n\t\t\tthrow new Exception(\"beaconName is required.\");\n\t\t// Make the request and return the results.\n\t\treturn $service->attachments->CreateAttachments($beaconName, $optParams);\n\t}\n\tcatch (Exception $e)\n\t{\n\t\tprint \"An error occurred: \" . $e->getMessage();\n\t}\n}", "public function createWithAttachments($data) {\r\n $dstailieu = array();\r\n if (!empty($data['Attachment'][0]['attachment']['name'])) {\r\n foreach ($data['Attachment'] as $i => $tailieu) {\r\n if (is_array($data['Attachment'][$i])) {\r\n // Force setting the `model` field to this model\r\n $tailieu['model'] = $this->name;\r\n\r\n // Unset the foreign_key if the user tries to specify it\r\n if (isset($tailieu['foreign_key'])) {\r\n unset($tailieu['foreign_key']);\r\n }\r\n $dstailieu[] = $tailieu;\r\n }\r\n }\r\n }\r\n $data['Attachment'] = $dstailieu;\r\n if (empty($data[$this->name]['id'])) {\r\n $this->create();\r\n }\r\n return $this->saveAll($data, array('validate' => 'first', 'deep' => true));\r\n }", "public function addAttachmentFromBase64Data($filename, $mimetype, $contents)\n {\n $attachment = new Attachment($filename, $mimetype, $contents);\n $this->attachments[] = $attachment;\n }", "public function __construct($data, $attachment = '') {\n //\n $this->data = $data;\n $this->attachment = $attachment;\n }", "public function addAttachment($content, $name, $content_type, $content_disposition);", "public function addActivity($data);", "public function __construct($attachmentKey, array $data = [])\n {\n if (!$attachmentKey && !$data) {\n throw new InvalidArgumentException(\"both \\\"attachmentKey\\\" and \\\"data\\\" must not be missing\");\n }\n\n if ($attachmentKey instanceof AttachmentKey) {\n $this->attachmentKey = $attachmentKey;\n } elseif (is_array($attachmentKey)) {\n $data = $attachmentKey;\n }\n\n\n $missing = \"\";\n if (!isset($data[\"content\"])) {\n $missing = \"content\";\n } elseif (!isset($data[\"encoding\"])) {\n $missing = \"encoding\";\n }\n\n if ($missing) {\n throw new InvalidArgumentException(\n \"value for property \\\"\" . $missing . \"\\\" missing\"\n );\n }\n\n parent::__construct(is_array($attachmentKey) ? null : $attachmentKey, $data);\n }", "public function addAttachment(TrickAttachmentData $attachment)\n {\n if ($this->attachments === null) {\n $this->attachments = new ArrayCollection();\n }\n\n $this->attachments->add($attachment);\n }", "public function add_attachment(Attachment $attachment);", "public function addAttachmentFromBinaryData($filename, $mimetype, $contents)\n {\n $attachment = new Attachment($filename, $mimetype, base64_encode($contents));\n $this->attachments[] = $attachment;\n }", "private static function addAttachments($mailer, $fields, $data)\n\t{\n\t\t$attachmentsPath = JPATH_ROOT . '/media/com_osmembership/upload/';\n\t\tfor ($i = 0, $n = count($fields); $i < $n; $i++)\n\t\t{\n\t\t\t$field = $fields[$i];\n\t\t\tif ($field->fieldtype == 'File' && isset($data[$field->name]))\n\t\t\t{\n\t\t\t\t$fileName = $data[$field->name];\n\t\t\t\tif ($fileName && file_exists($attachmentsPath . '/' . $fileName))\n\t\t\t\t{\n\t\t\t\t\t$pos = strpos($fileName, '_');\n\t\t\t\t\tif ($pos !== false)\n\t\t\t\t\t{\n\t\t\t\t\t\t$originalFilename = substr($fileName, $pos + 1);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$originalFilename = $fileName;\n\t\t\t\t\t}\n\t\t\t\t\t$mailer->addAttachment($attachmentsPath . '/' . $fileName, $originalFilename);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static function createWithAttachments(\n array $data,\n array $attachments,\n array $include = [],\n string|Connection|null $connection = null\n ): static {\n $resource = static::make($data, $connection);\n\n // Ensure that \"attachments\" are automatically included,\n // if not already requested.\n $include = array_merge($include, [ 'attachments' ]);\n\n // Create new issue\n $resource\n ->withAttachments($attachments)\n ->withIncludes($include)\n ->save();\n\n return $resource;\n }", "public function create ($aData)\n {\n if ( is_array ($aData['app_msg_attach']) )\n {\n $attachment = $aData['app_msg_attach'];\n }\n else\n {\n $attachment = @unserialize ($aData['app_msg_attach']);\n if ( $attachment === false )\n {\n $attachment = explode (',', $aData['app_msg_attach']);\n }\n }\n $aData['app_msg_attach'] = serialize ($attachment);\n $aData['app_msg_show_message'] = (isset ($aData['app_msg_show_message'])) ? $aData['app_msg_show_message'] : 1;\n $aData[\"app_msg_error\"] = (isset ($aData[\"app_msg_error\"])) ? $aData[\"app_msg_error\"] : '';\n $sUID = $this->db_insert ($aData);\n\n $aData['app_msg_date'] = isset ($aData['app_msg_date']) ? $aData['app_msg_date'] : '';\n\n if ( isset ($aData['app_msg_status']) )\n {\n $this->status = strtolower ($aData['app_msg_status']);\n }\n\n $aData[\"contentTypeIsHtml\"] = (isset ($aData[\"contentTypeIsHtml\"])) ? $aData[\"contentTypeIsHtml\"] : true;\n\n $this->setData ($sUID, $aData[\"app_msg_subject\"], $aData[\"app_msg_from\"], $aData[\"app_msg_to\"], $aData[\"app_msg_body\"], $aData[\"app_msg_date\"], $aData[\"app_msg_cc\"], $aData[\"app_msg_bcc\"], $aData[\"app_msg_template\"], $aData[\"app_msg_attach\"], $aData[\"contentTypeIsHtml\"], $aData[\"app_msg_error\"]);\n }", "public function setAttachments($type = null, $name = null, $content = null)\n {\n $attachments = array();\n\n if (!empty($type)) {\n $this->attachments_type = $attachments['type'] = $type;\n }\n\n if (!empty($name)) {\n $this->attachments_name = $attachments['name'] = $name;\n }\n\n if (!empty($content)) {\n $this->attachments_content = $attachments['content'] = base64_encode(file_get_contents($content));\n }\n\n $this->message['attachments'][] = $attachments;\n }", "public function testCreateAttachment()\n {\n }", "public function add($data)\n {\n $d['mimetype'] = $data['newMimetype'];\n $d['description'] = $data['description'];\n \n return $this->getDbTable()->insert($d);\n }", "public function addData(string $data);", "public function create(DataSigner $dataSigner);", "public function addAttachment($path, $name = '', $encoding = self::ENCODING_BASE64, $type = '', $disposition = 'attachment')\n {\n }", "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 updateEmailData($emailData, &$attachments) {\n $fields = isset($emailData['Fields']) ? $emailData['Fields'] : false;\n if($fields) {\n foreach($fields as $field) {\n if(!($field instanceof SubmittedUploadField)) {\n continue;\n }\n /** @var \\SilverStripe\\ORM\\HasManyList */\n $files = $field->getSubmittedFiles();\n foreach($files as $file) {\n $attachments[] = $file;\n }\n }\n }\n }", "function attach($message,$name,$ctype = '')\n {\n \n // type de contenu non defini\n if(empty($ctype)){\n // on essaie de reconnaitre l'extension \n switch(strrchr(basename($name), \".\")){ \n case \".gz\": $ctype = \"application/x-gzip\"; break;\n case \".tgz\": $ctype = \"application/x-gzip\"; break;\n case \".zip\": $ctype = \"application/zip\"; break;\n case \".pdf\": $ctype = \"application/pdf\"; break; \n case \".png\": $ctype = \"image/png\"; break;\n case \".gif\": $ctype = \"image/gif\"; break;\n case \".jpg\": $ctype = \"image/jpeg\"; break;\n case \".txt\": $ctype = \"text/plain\"; break;\n case \".htm\": $ctype = \"text/html\"; break;\n case \".html\": $ctype = \"text/html\"; break;\n default: $ctype = \"application/octet-stream\"; break;\n }\n }\n\n $this->parts[] = \n array (\n \"ctype\" => $ctype,\n \"message\" => $message,\n \"encode\" => $encode,\n \"name\" => $name\n );\n \n // fin de fonction\n }", "public function __construct($data = '', $contentType = 'application/octet-stream', $filename = 'attachment')\n {\n $this->data = $data;\n $this->contentType = $contentType;\n $this->filename = $filename;\n }", "public function uploadAttachment($type){\n\n\t\t$viewDataController = new ViewDataController();\n\t\t$data = $viewDataController->buildData();\n\n\t\t$input = Request::all();\n\t\t// Create message arrays\n\t\t$error_alert = array(\n\t\t\t'img' => '/images/topAlert/urgent.png',\n\t\t\t'bkg' => '#de4728',\n\t\t\t'textColor' => '#fff',\n\t\t\t'dur' => '7000'\n\t\t);\n\t\t$success_alert = array(\n\t\t\t'img' => '/images/topAlert/checkmark.png',\n\t\t\t'bkg' => '#a0db39',\n\t\t\t'textColor' => '#fff',\n\t\t\t'dur' => '5000'\n\t\t);\n\n\t\t// Validation rules\n\t\t$rules = array(\n\t\t\t'remove' => array(\n\t\t\t\t'regex:/^1$/'\n\t\t\t),\n\t\t\t'profile_picture' => array(\n\t\t\t\t'mimes:jpeg,png,gif'\n\t\t\t)\n\t\t);\n\n\t\t// Validate\n\t\t$validator = Validator( $input, $rules );\n\t\tif( $validator->fails() ){\n\t\t\t$error_alert['msg'] = 'An image of type: jpeg, png, or gif is required.';\n\t\t\treturn json_encode( $error_alert );\n\t\t}\n\n\t\tif ($type == 'attach') {\n\t\t\t$file_info = (array)$input['files'];\n\t\t}\n\n\t\tif ($type == 'img') {\n\t\t\t$file_info = (array)$input['files2'];\n\t\t}\n\t\n\t\t$cnt = 0;\n\t\tforeach ($file_info as $key => $val) {\n\t\t\tif ($cnt == 1) {\n\t\t\t\t$originalName = $val;\n\t\t\t}\n\t\t\tif ($cnt == 2) {\n\t\t\t\t$fileType = $val;\n\t\t\t}\n\t\t\t$cnt++;\n\t\t}\n\n\t\tif ($fileType != 'image/jpeg' && $fileType != 'image/png' && $fileType != 'image/gif') {\n\n\t\t\tif (Request::hasFile('files') || Request::hasFile('files2')) {\n\n\t\t\t\tif ($type == 'attach') {\n\t\t\t\t\t$file = Request::file('files');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($type == 'img') {\n\t\t\t\t\t$file = Request::file('files2');\n\t\t\t\t}\n\n\t\t\t\treturn $this->uploadAFile($file, $data);\n\t\t\t}else{\n\t\t\t\treturn json_encode( array( 'msg' => \"There was an error uploading your transcript.\" ) );\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t// add photo or update\n\t\t$Obj = new User();\n\n\t\tif ($type == 'attach') {\n\t\t\t$profile_image_name = $Obj->ProcessResize( 'files', $data['user_id']);\n\t\t}\n\t\t\n\t\tif ($type == 'img') {\n\t\t\t$profile_image_name = $Obj->ProcessResize( 'files2', $data['user_id']);\n\t\t}\n\t\t\n\t\t// Get extension to set AWS's 'content type' field in s3\n\t\t$exploded = explode( '.', $profile_image_name );\n\t\t$extension = $exploded[ count( $exploded ) -1 ];\n\t\t// return 'jpg'\n\n\t\tswitch( $extension ){\n\t\t\tcase 'jpg':\n\t\t\tcase 'jpeg':\n\t\t\t\t$content_type = 'image/jpeg';\n\t\t\t\tbreak;\n\t\t\tcase 'png':\n\t\t\t\t$content_type = 'image/png';\n\t\t\t\tbreak;\n\t\t\tcase 'gif':\n\t\t\t\t$content_type = 'image/gif';\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// Halt upload process\n\t\tif( !isset( $content_type ) ){\n\t\t\t// Delete temp image\n\t\t\tunlink('dropzone/images/' . $profile_image_name);\n\t\t\t// Return topAlert object\n\t\t\t$error_alert['msg'] = 'The uploaded image must be in jpeg, png, or gif format.';\n\t\t\treturn json_encode( $error_alert );\n\t\t}\n\n\t\t$Pic_Src = $Obj->get_profile_image_path();\n\n\t\t/*\n\t\t// testing on this output, GetAnimation() successfully returns a long string includes all the animation needed.\n\n\t\t$file_path = $input['files2']->getPathName();\n\t\t$text = \"Hello World\";\n\t\t$image = imagecreatefromgif($file_path);\n\t\t$text_color = imagecolorallocate($image, 200, 200, 200);\n\t\timagestring($image, 5, 20, 20, $text, $text_color);\n\n\t\tob_start();\n\t\timagegif($image);\n\t\t$frames[] = ob_get_contents();\n\t\t$framed[] = 40;\n\t\tob_end_clean();\n\n\t\t$gif = new GIFEncoder($frames,$framed,0,2,0,0,0,'bin');\n\t\tdd( $gif->GetAnimation() );\n\t\t*/\n\n\n\t\t// Upload to AWS bucket\n\t\t$aws = AWS::get('s3');\n\t\t$aws->putObject(array(\n\t\t\t'ACL' => 'public-read',\n\t\t\t'Bucket' => 'asset.plexuss.com/admin/campaign/uploads',\n\t\t\t'Key' => $profile_image_name,\n\t\t\t'ContentType' => $content_type,\n\t\t\t'SourceFile' => $Obj->get_profile_image_path() .'\\\\'. $profile_image_name\n\t\t));\n\n\t\t// Delete temp image\n\t\tunlink( $Obj->get_profile_image_path() .'\\\\'. $profile_image_name );\n\t\t// Update user image in DB\n\n\t\t$ret = array();\n\t\t$ret['is_image'] = 1;\n\t\t$ret['name'] = $profile_image_name;\n\n\t\treturn json_encode($ret);\n\t}", "private function attach_attachments( $post_id, $data ) {\n\t\tglobal $wpdb;\n\t\t$args = array(\n\t\t\t'post_type' => 'attachment',\n\t\t\t'post_parent' => 0,\n\t\t\t'suppress_filters' => false\n\t\t);\n\n\t\t$attachments = get_posts( $args );\n\n\t\tif ( is_array( $attachments ) ) {\n\t\t\tforeach ( $attachments as $file ) {\n\t\t\t\tif ( is_array( $data['attachments'] ) ) {\n\t\t\t\t\tforeach ( $data['attachments'] as $attachmentExt ) {\n\t\t\t\t\t\tif ( $attachmentExt == $file->guid ) {\n\t\t\t\t\t\t\t$wpdb->update($wpdb->posts, array('post_parent' => $post_id), array('ID' => $file->ID) );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif ( false !== strpos( $attachmentExt, $file->guid.'featured' ) ) {\n\t\t\t\t\t\t\tdelete_post_meta($post_id, '_thumbnail_id');\n\t\t\t\t\t\t\tadd_post_meta($post_id, '_thumbnail_id', $file->ID, false);\n\t\t\t\t\t\t\t$wpdb->update($wpdb->posts, array('post_parent' => $post_id), array('ID' => $file->ID) );\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function create($data) {\n\t\t// Create an ID\n\t\t$id = $this->idCreate();\n\t\t// Write the data file\n\t\tfile_put_contents( $this->init['path']['data'] . $id . $this->init['data']['ext'] );\n\t}", "public function encodeData( array &$data, $type = null )\n\t{\n $From = get( $this->config, 'From' );\n $BenAccNo = get( $this->config, 'BenAccNo' ); \n $BenName = get( $this->config, 'BenName' );\n $BenLegalId = get( $this->config, 'BenLegalId' );\n \n $language = strtoupper( $this->getLanguageCode() );\n $transaction = $this->getTransaction();\n \n \n switch( $type )\n {\n case self::DATA_AUTH_ENCODE:\n \n $xml = '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>' . \n '<FIDAVISTA xmlns=\"http://ivis.eps.gov.lv/XMLSchemas/100017/fidavista/v1-1\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://ivis.eps.gov.lv/XMLSchemas/100017/fidavista/v1-1 http://ivis.eps.gov.lv/XMLSchemas/100017/fidavista/v1-1/fidavista.xsd\">' . \n '<Header>' . \n '<Timestamp>' . substr(date('YmdHisu'), 0, 17) . '</Timestamp>' . \n '<From>' . $From . '</From>' . \n '<Extension>' . \n '<Amai xmlns=\"http://online.citadele.lv/XMLSchemas/amai/\" xsi:schemaLocation=\"http://online.citadele.lv/XMLSchemas/amai/ http://online.citadele.lv/XMLSchemas/amai/amai.xsd\">' . \n '<Request>AUTHREQ</Request>' . \n '<RequestUID>' . time() . '</RequestUID>' . \n '<Version>2.0</Version>' . \n '<Language>' . $language . '</Language>' . \n '<ReturnURL>' . $this->getResponseURL() . '</ReturnURL>' . \n '<SignatureData />' . \n '</Amai>' . \n '</Extension>' . \n '</Header>' . \n '</FIDAVISTA>';\n \n break;\n \n case self::DATA_ENCODE:\n \n $xml = '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>' . \n '<FIDAVISTA xmlns=\"http://ivis.eps.gov.lv/XMLSchemas/100017/fidavista/v1-1\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://ivis.eps.gov.lv/XMLSchemas/100017/fidavista/v1-1 http://ivis.eps.gov.lv/XMLSchemas/100017/fidavista/v1-1/fidavista.xsd\">' . \n '<Header>' . \n '<Timestamp>' . substr(date('YmdHisu'), 0, 17) . '</Timestamp>' . \n '<From>' . $From . '</From>' . \n '<Extension>' . \n '<Amai xmlns=\"http://online.citadele.lv/XMLSchemas/amai/\" xsi:schemaLocation=\"http://online.citadele.lv/XMLSchemas/amai/ http://online.citadele.lv/XMLSchemas/amai/amai.xsd\">' . \n '<Request>PMTREQ</Request>' . \n '<RequestUID>' . $this->getToken() . '</RequestUID>' . \n '<Version>2.0</Version>' . \n '<Language>LV</Language>' . \n '<ReturnURL>' . $this->getResponseURL() . '</ReturnURL>' . \n '<SignatureData />' . \n '<PaymentRequest>' . \n '<ExtId>' . $transaction->id . '</ExtId>' .\n '<DocNo>' . $transaction->id . '</DocNo>' . \n '<TaxPmtFlg>N</TaxPmtFlg>' .\n '<Ccy>' . $this->getCurrency() . '</Ccy>' .\n '<PmtInfo>' . $this->getDescription() . '</PmtInfo>' .\n '<BenSet>' .\n '<Priority>N</Priority>' . \n '<Comm>OUR</Comm>' .\n '<Amt>' . $this->getAmount() . '</Amt>' .\n '<BenAccNo>' . $BenAccNo . '</BenAccNo>' . \n '<BenName>' . $BenName . '</BenName>' .\n '<BenLegalId>' . $BenLegalId . '</BenLegalId>' . \n '<BenCountry>LV</BenCountry>' . \n '</BenSet>' . \n '</PaymentRequest>' . \n '</Amai>' . \n '</Extension>' . \n '</Header>' . \n '</FIDAVISTA>';\n \n break;\n }\n \n if( isset( $xml ) )\n {\n $doc = new DOMDocument();\n $doc->formatOutput = false;\n $doc->preserveWhiteSpace = false; \n $doc->loadXML( $xml );\n \n $objDSig = new XMLSecurityDSig();\n \n $objDSig->setCanonicalMethod( XMLSecurityDSig::EXC_C14N );\n \n $objDSig->addReference(\n $doc, \n XMLSecurityDSig::SHA1, \n array( 'http://www.w3.org/2000/09/xmldsig#enveloped-signature' ), \n array( 'force_uri' => true, )\n );\n \n $objKey = new XMLSecurityKey( XMLSecurityKey::RSA_SHA1, array( 'type' => 'private', ) );\n $objKey->loadKey( self::getPrivateKeyPath(), TRUE );\n \n $appendTo = $doc->getElementsByTagName('SignatureData')->item(0);\n $objDSig->sign( $objKey, $appendTo );\n \n $objDSig->add509Cert( file_get_contents( self::getPublicKeyPath() ) );\n \n $data['xmldata'] = $doc->saveXML();\n }\n\t\t\n\t\treturn;\n\t}", "protected function _parseStructure($data)\n {\n $ob = new Horde_Mime_Part();\n\n $ob->setType(strtolower($data->type) . '/' . strtolower($data->subType));\n\n // Optional for multipart-parts, required for all others\n if (isset($data->parameters)) {\n $params = array();\n foreach ($data->parameters as $key => $value) {\n $params[strtolower($key)] = $value;\n }\n\n $params = Horde_Mime::decodeParam('content-type', $params, 'UTF-8');\n foreach ($params['params'] as $key => $value) {\n $ob->setContentTypeParameter($key, $value);\n }\n }\n\n // Optional entries. 'location' and 'language' not supported\n if (isset($data->disposition)) {\n $ob->setDisposition($data->disposition);\n if (isset($data->dparameters)) {\n $dparams = array();\n foreach ($data->dparameters as $key => $value) {\n $dparams[strtolower($key)] = $value;\n }\n\n $dparams = Horde_Mime::decodeParam('content-disposition', $dparams, 'UTF-8');\n foreach ($dparams['params'] as $key => $value) {\n $ob->setDispositionParameter($key, $value);\n }\n }\n }\n\n if ($ob->getPrimaryType() == 'multipart') {\n // multipart/* specific entries\n foreach ($data->subParts as $val) {\n $ob->addPart($this->_parseStructure($val));\n }\n } else {\n // Required options\n if (isset($data->partID)) {\n $ob->setContentId($data->partID);\n }\n\n $ob->setTransferEncoding(strtolower($data->encoding));\n $ob->setBytes($data->bytes);\n\n if ($ob->getType() == 'message/rfc822') {\n $ob->addPart($this->_parseStructure(reset($data->subParts)));\n }\n }\n\n return $ob;\n }", "protected function setSmtpApi(&$data, Swift_Mime_SimpleMessage $message)\n {\n foreach ($message->getChildren() as $attachment) {\n if (!$attachment instanceof Swift_Image\n || !in_array(self::SMTP_API_NAME, [$attachment->getFilename(), $attachment->getContentType()])\n ) {\n continue;\n }\n $data['x-smtpapi'] = json_encode($attachment->getBody());\n }\n }", "public function attachment($name, $content)\n {\n if (!is_string($content) && (!is_resource($content) || get_resource_type($content) != 'stream')) {\n throw new Exception\\InvalidArgumentException(\n sprintf(\n \"Attachment content must be either string or stream, %s passed\",\n gettype($content)\n )\n );\n }\n \n $this->attachments[$name] = [\n 'content' => $content\n ];\n }", "public function AddImageStringAttachment($string, $filename, $encoding = \"base64\", $type = \"application/octet-stream\")\n {\n $cur = count($this->attachment);\n $this->attachment[$cur][0] = $string;\n $this->attachment[$cur][1] = $filename;\n $this->attachment[$cur][2] = $filename;\n $this->attachment[$cur][3] = $encoding;\n $this->attachment[$cur][4] = $type;\n $this->attachment[$cur][5] = true; // isString\n $this->attachment[$cur][6] = \"inline\";\n $this->attachment[$cur][7] = $filename;\n }", "public function add_data($data)\n {\n $this->builder->insert($data);\n }", "protected function _parseAttachFile($fileData)\n\t{\n\t\t// Get Header(sub) information\n\t\t$contentType = $this->getHeader('Content-Type');\n\t\t$contentDisposition = $this->getHeader('Content-Disposition');\n\t\t$contentTransferEncoding = $this->getHeader('Content-Transfer-Encoding');\n\n\t\t// mimetype\n\t\t$exp = explode(';', trim($contentType));\n\t\t$mimeType = reset($exp);\n\t\t// filename\n\t\t$fileName = preg_replace('/.+filename=\"?(.+)\"?.*/u', '$1', $contentDisposition);\n\t\tswitch ( $contentTransferEncoding )\n\t\t{\n\t\t\tcase 'base64':\n\t\t\t\t$data = base64_decode($fileData);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$data = $fileData;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$this->attachFiles[] = array(\n\t\t 'filename' => $fileName,\n\t\t 'mimetype' => $mimeType,\n\t\t 'data' => $data\n\t\t);\n\t}", "public function addStringAttachment($string, $filename, $encoding = self::ENCODING_BASE64, $type = '', $disposition = 'attachment')\n {\n }", "function addAward($data,$firebase)\n\t{\n\t\t$key = array(\"award_title\",\"given_by\");\n\t\t$values = array($data['award_title'],$data['award_by']);\n\t\t$final = array_combine($key,$values);\n\t\tif(!empty($data['award_title']) && !empty($data['award_by']))\n\t\t\t$firebase->push(DEFAULT_PATH.'awards/',$final);\n\t\t$firebase->set(DEFAULT_PATH.'last_updated',date(\"m/d/Y\"));\n\t}", "public function addAttachment(string $path, string $name = '', string $type = '')\n {\n $this->mailObj->addAttachment($path, $name, 'base64', $type);\n }", "public static function savenewsletterData($data)\n\t {\n\t \n\t\t DB::table('newsletter')->insert($data);\n\t\t \n\t \n\t }", "private function createMeetingRequest($data)\n {\n $user = Auth::user(); //get authenticated user\n $request = new \\App\\Request();\n $request->course_id = $data->course_id;\n // $request->instructorMeeting = false; assumed to be studentMeeting\n $request->start_time = $data->start_time;\n $request->end_time = $data->end_time;\n $request->save();\n //attach authenticated user and other student to the request\n $request->users()->attach($user, ['sender' => true]);\n $request->users()->attach($data->student, ['sender' => false]);\n }", "protected function appendData($data)\n {\n $this->sha1 = null;\n $this->data.=$data;\n }", "function attachInEvent($idevent, $fileName, $length, $file, $parentDocumentUrn = null) {\n\n\t\t\t$method = WALL . \"/feeds/$idevent/attach/@oauthtoken\";\n\n\t\t\t$verbmethod = \"POST\";\n\n\t\t\t$params = array(\"fileName\" => $fileName,\n\t\t\t\t\t\t\t \"length\" => $length,\n\t\t\t\t\t\t\t \"file\" => $file,\n\t\t\t\t\t\t\t \"parentDocumentUrn\" => $parentDocumentUrn);\n\n\t\t\t$params = array_filter($params, function($item) { return !is_null($item); });\n\n\t\t\t$response = json_decode($this->zyncroApi->callApiDirect( $method, $params, $verbmethod), true);\n\n\t\t\treturn $response;\n\t\t}", "public function create()\n {\n $attachment = $this->Attachments->newEntity();\n \n if ($this->request->is('post')) {\n \n // Assure file was uploaded\n if (!array_key_exists('file', $_FILES)) {\n $this->set('error', 'No attachment provided');\n $this->set('_serialize', [ 'error' ]);\n return;\n }\n \n $uuid = Text::uuid();\n $file = $_FILES['file'];\n \n // Validate file upload\n if ($file['error'] !== UPLOAD_ERR_OK) {\n switch ($file['error']) {\n case UPLOAD_ERR_INI_SIZE:\n $this->set('error', 'The selected file is too big');\n break;\n case UPLOAD_ERR_FORM_SIZE:\n $this->set('error', 'The selected file is too big');\n break;\n case UPLOAD_ERR_NO_FILE:\n $this->set('error', 'No attachment provided');\n break;\n default:\n $this->set('error', 'An unexpected error occured');\n }\n $this->set('_serialize', [ 'error' ]);\n return;\n }\n \n // Move uploaded file\n if (!move_uploaded_file($file[\"tmp_name\"], UPLOADS . $uuid)) {\n $this->set('error', 'An unexpected error occured');\n $this->set('_serialize', [ 'error' ]);\n return;\n }\n \n $data = $this->request->getData();\n \n $data['path'] = $uuid;\n $data['name'] = $file['name'];\n $data['mime'] = $file['type'];\n $data['size'] = $file['size'];\n $attachment = $this->Attachments->patchEntity($attachment, $data);\n if (!$this->Attachments->save($attachment)) {\n $this->set('error', 'An unexpected error occured');\n $this->set('_serialize', [ 'error' ]);\n return;\n }\n }\n \n $this->set('attachment', $attachment);\n $this->set('_serialize', 'attachment');\n }", "function _build_attachement()\r\n\t\t{\r\n\t\t$this->boundary= \"------------\" . md5( uniqid(\"myboundary\") ); // TODO : variable bound\r\n\r\n\t\t$this->headers .= \"MIME-Version: 1.0\\nContent-Type: multipart/mixed;\\n boundary=\\\"$this->boundary\\\"\\n\\n\";\r\n\t\t$this->fullBody = \"This is a multi-part message in MIME format.\\n--$this->boundary\\nContent-Type: text/plain; charset=utf-8\\n\"\r\n\t\t\t. \"Content-Transfer-Encoding: 7bit\\n\\n\" . $this->body .\"\\n\";\r\n\t\t$sep= chr(13) . chr(10);\r\n\r\n\t\t$ata= array();\r\n\t\t$k=0;\r\n\r\n\t\t// for each attached file, do...\r\n\t\tfor( $i=0; $i < sizeof( $this->aattach); $i++ )\r\n\t\t\t{\r\n\t\t\t$filename = $this->aattach[$i];\r\n\t\t\t$basename = $this->aattachname[$i];\r\n\t\t\t$ctype = $this->actype[$i]; // content-type\r\n\t\t\t$disposition = $this->adispo[$i];\r\n \t\t\tif( ! file_exists( $filename) )\r\n\t\t\t\t{\r\n\t\t\t\techo \"Class Mail, method attach : file $filename can't be found\";\r\n\t\t\t\texit;\r\n\t\t\t\t}\r\n\t\t\t$subhdr= \"--$this->boundary\\nContent-type: $ctype;\\n name=\\\"$basename\\\"\\nContent-Transfer-Encoding: base64\\nContent-Disposition: $disposition;\\n filename=\\\"$basename\\\"\\n\";\r\n\t\t\t$ata[$k++] = $subhdr;\r\n\t\t\t// non encoded line length\r\n\t\t\t$linesz= filesize( $filename)+1;\r\n\t\t\t$fp= fopen( $filename, 'r' );\r\n\t\t\t$data= base64_encode(fread( $fp, $linesz));\r\n\t\t\tfclose($fp);\r\n\t\t\t$ata[$k++] = chunk_split( $data );\r\n \t}\r\n\t\t$this->attachment= implode($sep, $ata);\r\n\t\t}", "public static function addActivity($data) {\n\t\tif (!is_array($data)) return false;\n\t\t$data = self::_cookData($data);\n\t\treturn self::_getDao()->insert($data);\n\t}", "public function CreateAttachment($request)\n {\n return $this->makeRequest(__FUNCTION__, $request);\n }", "public function onAttachDocument($data)\n {\n if( !is_array($data) || empty($data['document_id']) ) {\n return;\n }\n\n $document = Engine_Api::_()->getItem('document', $data['document_id']);\n\n if( !empty($data['document_title']) ) {\n $document->title = trim(strip_tags($data['document_title']));\n }\n\n if( !empty($data['document_description']) ) {\n $document->description = trim(strip_tags($data['document_description']));\n }\n\n if (Engine_Api::_()->core()->hasSubject()) {\n // set parent\n $subject = Engine_Api::_()->core()->getSubject();\n $subject_type = $subject->getType();\n $subject_id = $subject->getIdentity();\n\n $document->parent_type = $subject_type;\n $document->parent_id = $subject_id;\n }\n\n $document->search = 1; // make the document visible now (see DocumentController for where search is initially set to zero)\n $document->save();\n\n if( !($document instanceof Core_Model_Item_Abstract) || !$document->getIdentity() )\n {\n return;\n }\n\n return $document;\n }", "public function addStringAttachment(\n $string,\n $filename,\n $encoding = 'base64',\n $type = '',\n $disposition = 'attachment'\n ) {\n // If a MIME type is not specified, try to work it out from the file name\n if ($type == '') {\n $type = self::filenameToType($filename);\n }\n // Append to $attachment array\n $this->attachment[] = array(\n 0 => $string,\n 1 => $filename,\n 2 => basename($filename),\n 3 => $encoding,\n 4 => $type,\n 5 => true, // isStringAttachment\n 6 => $disposition,\n 7 => 0\n );\n }", "private function uploadAFile($file, $data){\n\n\t\t$path = $file->getRealPath();\n\t\t$filename = $file->getClientOriginalName();\n\t\t$ext = $file->getClientOriginalExtension();\n\t\t$mime = $file->getMimeType();\n\t\t$file_path = pathinfo($filename);\n\n\t\t$hashed_id = Crypt::encrypt($data['user_id']);\n\n\t\t$hashed_id = substr($hashed_id, 0, 10);\n\t\t\n\t\t$saveas = $file_path['filename'].'_' . date('Y-m-d_H-i-s') . '_' . $hashed_id . \".\" . strtolower($ext);\n\n\t\t// upload to aws regardless of filetype\n\t\t$s3 = AWS::get('s3');\n\t\t$s3->putObject(array(\n\t\t\t'ACL' => 'public-read',\n\t\t\t'Bucket' => 'asset.plexuss.com/admin/campaign/uploads',\n\t\t\t'Key' => $saveas,\n\t\t\t'SourceFile' => $path\n\t\t));\n\n\t\t$ret = array();\n\t\t$ret['is_image'] = 0;\n\t\t$ret['name'] = $saveas;\n\n\t\treturn json_encode($ret);\n\t\t\n\t}", "public function createItem($data);", "public function _curl_storeAsFile($url,$data,$content_type) {\n\t\tif ( !strlen($url) )\tthrow new InvalidArgumentException(\"Attachment URL can't be empty\");\n\t\tif ( !strlen($content_type) ) throw new InvalidArgumentException(\"Attachment Content Type can't be empty\");\n\t\t$url = $this->dsn.$url;\n\t\t$http = curl_init($url);\n\t\t$http_headers = array('Accept: application/json,text/html,text/plain,*/*','Content-Type: '.$content_type,'Expect: ','Content-Length: '.strlen($data)) ;\n\t\tcurl_setopt($http, CURLOPT_CUSTOMREQUEST, 'PUT');\n\t\tcurl_setopt($http, CURLOPT_HTTPHEADER,$http_headers);\n\t\tcurl_setopt($http, CURLOPT_HEADER, true);\n\t\tcurl_setopt($http, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($http, CURLOPT_FOLLOWLOCATION, true);\n\t\tcurl_setopt($http, CURLOPT_POSTFIELDS, $data);\n\t\t$response = curl_exec($http);\n\t\tcurl_close($http);\n\t\treturn $response;\n\t}", "private function insertMediaObject($data_array) {\n }", "public function addAttachment($file)\n {\n $this->hasAttachment = true;\n $this->attachments[] = $file;\n }", "function attach_files($attachment)\n\t{\n\t\t\n\t\t$this->file_attachment = true;\n\t\tif(file_exists($attachment))\n\t\t{\n\t\t\t$this->attached_files[] = $attachment;\n\t\t\t$fileatt = $attachment; // Path to the file \n\t\t\t$fileatt_type = \"application/octet-stream\"; // File Type \n\t\t\t$start=\tstrrpos($attachment, '/') == -1 ? strrpos($attachment, '//') : strrpos($attachment, '/')+1;\n\t\t\t$fileatt_name = substr($attachment, $start, strlen($attachment));\n\t\n\t\t\t$file = fopen($fileatt,'rb'); \n\t\t\t$data = fread($file,filesize($fileatt)); \n\t\t\tfclose($file); \n\t\t\n\t\t\t$semi_rand = md5(time()); \n\t\t\t$mime_boundary = \"==Multipart_Boundary_x{$semi_rand}x\"; \n\t\t\t$this->headers[] = \t\"Content-Type: multipart/mixed;\";\n\t\t\t$this->headers[] = \t\" boundary=\\\"{$mime_boundary}\\\"\";\n\t\t\t$this->headers[] = \"MIME-Version: 1.0\";\n\t\t\t\t\t \n\t\t\t$this->email_message = \"--{$mime_boundary}\\n\" . \n\t\t\t\t\t\t\t\t \"Content-Type: {$fileatt_type};\\n\" . \n\t\t\t\t\t\t\t\t \" name=\\\"{$fileatt_name}\\\"\\n\" . \n\t\t\t\t\t //\"Content-Disposition: attachment;\\n\" . \n\t\t\t\t\t //\" filename=\\\"{$fileatt_name}\\\"\\n\" . \n\t\t\t\t\t\t\t\t \"Content-Transfer-Encoding: base64\\n\\n\" . \n\t\t\t\t\t\t\t\t $this->email_message . \"\\n\\n\" . \n\t\t\t\t\t\t\t\t \"--{$mime_boundary}--\\n\"; \n\t\t}\t\t\t\t \n\n\t}", "private function createMeeting($data)\n {\n $user = Auth::user(); //get authenticated user\n $meeting = new \\App\\Meeting();\n $meeting->course_id = $data->course_id;\n $meeting->instructorMeeting = $data->instructorMeeting;\n $meeting->start_time = $data->start_time;\n $meeting->end_time = $data->end_time;\n $meeting->save();\n //attach authenticated user and instructor XOR student to the meeting\n $meeting->users()->attach($user);\n if($data->instructorMeeting){\n $meeting->users()->attach($data->instructor);\n }else{\n $meeting->users()->attach($data->student);\n }\n }", "public function setAttachments($attachments) {\n\t\t$attach = [];\n\t\tforeach ((array)$attachments as $name => $fileInfo) {\n\t\t\tif (!is_array($fileInfo)) {\n\t\t\t\t$fileInfo = ['file' => $fileInfo];\n\t\t\t}\n\t\t\tif (!isset($fileInfo['file'])) {\n\t\t\t\tif (!isset($fileInfo['data'])) {\n\t\t\t\t\tthrow new InvalidArgumentException('No file or data specified.');\n\t\t\t\t}\n\t\t\t\tif (is_int($name)) {\n\t\t\t\t\tthrow new InvalidArgumentException('No filename specified.');\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$fileName = $fileInfo['file'];\n\t\t\t\tif (!preg_match('~^https?://~i', $fileInfo['file'])) {\n\t\t\t\t\t$fileInfo['file'] = realpath($fileInfo['file']);\n\t\t\t\t}\n\t\t\t\tif ($fileInfo['file'] === false || !Utility::fileExists($fileInfo['file'])) {\n\t\t\t\t\tthrow new InvalidArgumentException(sprintf('File not found: \"%s\"', $fileName));\n\t\t\t\t}\n\t\t\t\tif (is_int($name)) {\n\t\t\t\t\t$name = basename($fileInfo['file']);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!isset($fileInfo['mimetype'])) {\n\t\t\t\t$ext = pathinfo($name, PATHINFO_EXTENSION);\n\t\t\t\t$fileInfo['mimetype'] = $this->_getMimeByExtension($ext);\n\t\t\t}\n\t\t\t$attach[$name] = $fileInfo;\n\t\t}\n\t\tparent::setAttachments($attach);\n\n\t\treturn $this;\n\t}", "public function addAttachment()\n {\n global $injector, $notification;\n\n $result = new stdClass;\n $result->action = 'addAttachment';\n if (isset($this->vars->file_id)) {\n $result->file_id = $this->vars->file_id;\n }\n $result->success = 0;\n\n /* A max POST size failure will result in ALL HTTP parameters being\n * empty. Catch that here. */\n if (!isset($this->vars->composeCache)) {\n $notification->push(_(\"Your attachment was not uploaded. Most likely, the file exceeded the maximum size allowed by the server configuration.\"), 'horde.warning');\n } else {\n $imp_compose = $injector->getInstance('IMP_Factory_Compose')->create($this->vars->composeCache);\n\n if ($imp_compose->canUploadAttachment()) {\n try {\n foreach ($imp_compose->addAttachmentFromUpload('file_upload') as $val) {\n if ($val instanceof IMP_Compose_Exception) {\n $notification->push($val, 'horde.error');\n } else {\n $result->success = 1;\n\n /* This currently only occurs when\n * pasting/dropping image into HTML editor. */\n if ($this->vars->img_data) {\n $result->img = new stdClass;\n $result->img->src = strval($val->viewUrl()->setRaw(true));\n\n $temp1 = new DOMDocument();\n $temp2 = $temp1->createElement('span');\n $imp_compose->addRelatedAttachment($val, $temp2, 'src');\n $result->img->related = array(\n $imp_compose::RELATED_ATTR,\n $temp2->getAttribute($imp_compose::RELATED_ATTR)\n );\n } else {\n $this->_base->queue->attachment($val);\n $notification->push(sprintf(_(\"Added \\\"%s\\\" as an attachment.\"), $val->getPart()->getName()), 'horde.success');\n }\n }\n }\n\n $this->_base->queue->compose($imp_compose);\n } catch (IMP_Compose_Exception $e) {\n $notification->push($e, 'horde.error');\n }\n } else {\n $notification->push(_(\"Uploading attachments has been disabled on this server.\"), 'horde.error');\n }\n }\n\n return $this->vars->json_return\n ? $result\n : new Horde_Core_Ajax_Response_HordeCore_JsonHtml($result);\n }", "function wp_update_attachment_metadata($attachment_id, $data)\n {\n }", "public function _socket_storeAsFile($url,$data,$content_type) {\n\t\tif ( !strlen($url) )\tthrow new InvalidArgumentException(\"Attachment URL can't be empty\");\n\t\tif ( !strlen($content_type) ) throw new InvalidArgumentException(\"Attachment Content Type can't be empty\");\n\n\t\t$req = $this->_socket_startRequestHeaders('PUT',$url);\n\t\t$req .= 'Content-Length: '.strlen($data).\"\\r\\n\"\n\t\t\t\t.'Content-Type: '.$content_type.\"\\r\\n\\r\\n\";\n\t\t$this->_connect();\n\t\tfwrite($this->socket, $req);\n\t\tfwrite($this->socket, $data);\n\t\t$response = '';\n\t\twhile(!feof($this->socket))\n\t\t\t$response .= fgets($this->socket);\n\t\t$this->_disconnect();\n\t\treturn $response;\n }", "public function __invoke($data)\n {\n $beer = $this->repository->findById($data['id']);\n if (!isset($beer)) {\n throw new \\InvalidArgumentException();\n }\n $beer->setName($data['name']);\n $beer->setBrewery($data['brewery']);\n $beer->setStyle($data['style']);\n $beer->setAbv($data['abv']);\n $beer->setCountry($data['country']);\n $beer->setPhoto($data['photo']);\n\n return $this->repository->save($beer);\n }", "private function _build_attachments () {\n $sep = chr(13).chr(10);\n $ata = array();\n $k=0;\n\n foreach ((array) $this->attachments as $att) {\n $path = $att['path'];\n $name = $att['name'];\n $mimetype = $att['mimetype'];\n $disposition = $att['disposition'];\n $contentID = $att['cid'];\n $data = file_get_contents($path);\n\n $subhdr = '--'.$this->boundary.\"\\nContent-type: \".$mimetype.\";\\n\\tname=\\\"\".$name.\"\\\"\\nContent-Transfer-Encoding: base64\\nContent-Disposition: \".$disposition.\";\\n\\tfilename=\\\"\".$name.\"\\\"\\n\";\n if ($contentID) $subhdr .= 'Content-ID: <'.$contentID.\">\\n\";\n $ata[$k++] = $subhdr;\n $ata[$k++] = chunk_split(base64_encode($data)).\"\\n\\n\";\n }\n $this->full_body .= \"\\n\".implode($sep, $ata);\n }", "public function addAttachment($attachmentPath, array $parameters = null) {\n \n if (!empty($attachmentPath)) {\n $this->instance->add($this->calendar->createProperty('ATTACH', $attachmentPath, $parameters));\n }\n }", "public function addAttachment() {\n try {\n if (!($this->attachment instanceof Base_Model_ObtorLib_App_Core_Qualification_Entity_Attachment)) {\n throw new Base_Model_ObtorLib_App_Core_Qualification_Exception(\" Attachment Entity not initialized\");\n } else {\n $objAttachment = new Base_Model_ObtorLib_App_Core_Qualification_Dao_Attachment();\n $objAttachment->attachment = $this->attachment;\n return $objAttachment->addAttachment();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Qualification_Exception($ex);\n }\n }", "public function testInboundDocumentAddAttachment()\n {\n }", "function addArtifactAttachedFile($sessionKey,$group_id,$group_artifact_id,$artifact_id,$encoded_data,$description,$filename,$filetype) {\n global $art_field_fact; \n if (session_continue($sessionKey)) {\n $pm = ProjectManager::instance();\n try {\n $grp = $pm->getGroupByIdForSoap($group_id, 'addArtifactAttachedFile');\n } catch (SoapFault $e) {\n return $e;\n }\n\n $at = new ArtifactTracker($grp,$group_artifact_id);\n if (!$at || !is_object($at)) {\n return new SoapFault(get_artifact_type_fault,'Could Not Get ArtifactTracker','addArtifactFile');\n } elseif ($at->isError()) {\n return new SoapFault(get_artifact_type_fault,$at->getErrorMessage(),'addArtifactFile');\n }\n \n $art_field_fact = new ArtifactFieldFactory($at);\n if (!$art_field_fact || !is_object($art_field_fact)) {\n return new SoapFault(get_artifact_field_factory_fault, 'Could Not Get ArtifactFieldFactory','addArtifactFile');\n } elseif ($art_field_fact->isError()) {\n return new SoapFault(get_artifact_field_factory_fault, $art_field_fact->getErrorMessage(),'addArtifactFile');\n }\n\n $a = new Artifact($at,$artifact_id);\n if (!$a || !is_object($a)) {\n return new SoapFault(get_artifact_fault,'Could Not Get Artifact','addArtifactFile');\n } elseif ($a->isError()) {\n return new SoapFault(get_artifact_fault,$a->getErrorMessage(),'addArtifactFile');\n }\n\n $af = new ArtifactFile($a);\n if (!$af || !is_object($af)) {\n return new SoapFault(get_artifact_file_fault,'Could Not Create File Object','addArtifactFile');\n } else if ($af->isError()) {\n return new SoapFault(get_artifact_file_fault,$af->getErrorMessage(),'addArtifactFile');\n }\n\n $bin_data = base64_decode($encoded_data);\n\n $filesize = strlen($bin_data);\n\n $id = $af->create($filename,$filetype,$filesize,$bin_data,$description, $changes);\n\n if (!$id) {\n return new SoapFault(get_artifact_file_fault,$af->getErrorMessage(),'addArtifactFile');\n } else {\n // Send the notification\n if ($changes) {\n $agnf =& new ArtifactGlobalNotificationFactory();\n $addresses = $agnf->getAllAddresses($at->getID(), true);\n $a->mailFollowupWithPermissions($addresses, $changes);\n }\n }\n\n return $id;\n } else {\n return new SoapFault(invalid_session_fault, 'Invalid Session', 'addArtifactFile');\n }\n}", "private function addAttachments($message)\n {\n if (count($this->attachments) > 0)\n {\n foreach ($this->attachments as $file)\n {\n\n $attachment = \\Swift_Attachment::newInstance()\n ->setFilename($file->getName())\n ->setContentType($file->getMimeType())\n ->setBody($file->getFile())\n\n ;\n $message->attach($attachment);\n }\n }\n }", "public function AddAttachment($path, $name = '', $encoding = 'base64', $type = 'application/octet-stream') {\n\n $filename = basename($path);\n if ( $name == '' ) {\n $name = $filename;\n }\n\n $this->attachment[] = array(\n 0 => $path,\n 1 => $filename,\n 2 => $name,\n 3 => $encoding,\n 4 => $type,\n 5 => false, // isStringAttachment\n 6 => 'attachment',\n 7 => 0\n );\n\n return true;\n }", "public function put($data)\n {\n global $_PM_;\n $api = 'handler_'.$this->handler.'_api';\n $this->api = new $api($_PM_, PHM_API_UID, $this->principalId);\n $this->api->update_item_content($this->item['id'], $data);\n }", "public function insert($scheme, $data, $identifyingDataSpecifiers);", "public function setData($data) {\n \n if (!is_array($data)) {\n throw new InvalidArgumentException(\"No or invalid message data was sent\");\n }\n \n $this->data = $data;\n \n }", "public function send_attachment($subscriber_data, $product_data, $file_content, $alt_email = '')\n {\n\n //make sure required parameters are set\n if (\n empty($subscriber_data) ||\n empty($product_data) ||\n !isset($subscriber_data['delivery_email']) ||\n empty($subscriber_data['delivery_email']) ||\n !isset($file_content) ||\n empty($file_content)\n ) {\n return false;\n }\n\n //set container for email content parameters\n $content_params = array();\n $content_params['contact_name'] = $subscriber_data['contact_name'];\n $content_params['product_name'] = $product_data['name'];\n $content_params['product_sku'] = $product_data['sku'];\n $content_params['subscription_term'] = $product_data['subscription_term'];\n $content_params['delivery_interval'] = ucwords($subscriber_data['product_delivery_interval']);\n $content_params['data_filter'] = ucwords($subscriber_data['product_data_filter']);\n $content_params['data_needle'] = implode(' / ', (array)json_decode($subscriber_data['product_data_needle']));\n $content_params['subscriber_id'] = $subscriber_data['subscriber_id'];\n\n //generate cross-sell content\n $content_params['cross_sell'] = $this->make_cross_sell($product_data['product_id']);\n\n //load email template\n $content = file_get_contents(ROOT . 'secure/email/attach_deliver.html');\n\n //replace keys in template with content parameters\n foreach ($content_params as $k => $v) {\n\n //replace template keys with content values\n $content = str_replace('{{'.$k.'}}', $v, $content);\n }\n\n //instantiate AWS SES\n include_once(LOCAL.'secure/class/SES.php');\n $ses = new SimpleEmailService(IAM_KEY_ID, IAM_KEY_SECRET);\n $m = new SimpleEmailServiceMessage();\n\n //alter delivery email if an alternate email is set\n if(!empty($alt_email)){\n $m->addTo($alt_email);\n }else{\n $m->addTo($subscriber_data['delivery_email']);\n }\n\n //set filename\n $file_name = trim(str_replace(' ', '_', strtolower($product_data['name']))).'_'.trim(str_replace(' ', '_', strtolower($product_data['sku']))).'_' . date('dmY') . '.csv';\n\n //set the rest of the email parameters\n $m->setFrom('Australia Post <[email protected]>');\n $m->setSubject($product_data['name'].' Delivery - Australia Post');\n $m->setMessageFromString('This is an email from Australia Post. HTML is required to view this email', $content);\n $m->addAttachmentFromData($file_name, $file_content, 'text/csv');\n $ses->sendEmail($m);\n\n return true;\n }", "function createBadge($badgeId, $badgeName, $description, $image='', $criteria='', $alignment=[], $tags=[])\n {\n $data = array('name' => $badgeName,\n 'description' => $description,\n 'image' => $image,\n 'criteria' => $criteria,\n 'alignment' => $alignment,\n 'tags' => $tags);\n $data_json = json_encode($data);\n print_r($data_json);\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL,$_SESSION[\"COUCHDB\"].\"/badge_management/_design/badge_management/_update/add_badge/badges?name=$badgeId\");\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Cookie: '.$_SESSION[\"TOKEN\"],'Content-Length: ' . strlen($data_json)));\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data_json);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $response = curl_exec($ch);\n curl_close($ch);\n }", "public function testComAdobeCqSocialCalendarClientOperationextensionsEventAttachmen()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.cq.social.calendar.client.operationextensions.EventAttachment';\n\n $crawler = $client->request('POST', $path);\n }", "public function setAttachments(array $attachments)\n {\n $attach = [];\n foreach ($attachments as $name => $fileInfo) {\n if (!is_array($fileInfo)) {\n $fileInfo = ['file' => $fileInfo];\n }\n if (!isset($fileInfo['file'])) {\n if (!isset($fileInfo['data'])) {\n throw new InvalidArgumentException('No file or data specified.');\n }\n if (is_int($name)) {\n throw new InvalidArgumentException('No filename specified.');\n }\n $fileInfo['data'] = chunk_split(base64_encode($fileInfo['data']), 76, \"\\r\\n\");\n } elseif ($fileInfo['file'] instanceof UploadedFileInterface) {\n $fileInfo['mimetype'] = $fileInfo['file']->getClientMediaType();\n if (is_int($name)) {\n $name = $fileInfo['file']->getClientFilename();\n assert(is_string($name));\n }\n } elseif (is_string($fileInfo['file'])) {\n $fileName = $fileInfo['file'];\n $fileInfo['file'] = realpath($fileInfo['file']);\n if ($fileInfo['file'] === false || !file_exists($fileInfo['file'])) {\n throw new InvalidArgumentException(sprintf('File not found: `%s`', $fileName));\n }\n if (is_int($name)) {\n $name = basename($fileInfo['file']);\n }\n } else {\n throw new InvalidArgumentException(sprintf(\n 'File must be a filepath or UploadedFileInterface instance. Found `%s` instead.',\n gettype($fileInfo['file'])\n ));\n }\n if (\n !isset($fileInfo['mimetype'])\n && isset($fileInfo['file'])\n && is_string($fileInfo['file'])\n && function_exists('mime_content_type')\n ) {\n $fileInfo['mimetype'] = mime_content_type($fileInfo['file']);\n }\n if (!isset($fileInfo['mimetype'])) {\n $fileInfo['mimetype'] = 'application/octet-stream';\n }\n $attach[$name] = $fileInfo;\n }\n $this->attachments = $attach;\n\n return $this;\n }", "public function create(AdditionalInfoInterface $data, $urlParams);", "private function addData($data)\n {\n if(!is_array($data))\n\t\t\tthrow new Exception(\"Could not load a non-array data!\");\n\t\tif(!isset ($data['id']))\n\t\t\tthrow new Exception(\"Every array of data needs an 'id'!\");\n\t\tif(!isset ($data['data']))\n\t\t\tthrow new Exception(\"Loaded array needs an element 'data'!\");\n\n\t\t$this->_data[]=$data;\n }", "protected function prepareAttachments(array $data): array\n {\n // List of attachment to associate with this resources\n $uploads = [];\n\n foreach ($this->pendingAttachments as $pending) {\n $uploads[] = $pending->toArray();\n }\n\n // Assign to payload\n $data['uploads'] = $uploads;\n\n // Clear pending attachments\n $this->pendingAttachments = [];\n\n return $data;\n }", "public function addNew($data, $type)\n {\n $add = $type === 'add' ? new Delivery : Delivery::find($type);\n $add->store_id = isset($data['user_id']) ? $data['user_id'] : 0;\n $add->name = isset($data['name']) ? $data['name'] : null;\n $add->phone = isset($data['phone']) ? $data['phone'] : null;\n $add->status = isset($data['status']) ? $data['status'] : 0;\n $add->start_time = isset($data['start_time']) ? $data['start_time'] : null;\n $add->end_time = isset($data['end_time']) ? $data['end_time'] : null;\n $add->address = isset($data['address']) ? $data['address'] : null;\n\n if (isset($data['password'])) {\n $add->password = bcrypt($data['password']);\n $add->shw_password = $data['password'];\n }\n\n $add->save();\n }", "public static function sendMessage ($data) {\n\t\tself::initMailgun()->sendMessage(self::$mg_domain, $data);\n\t}", "function mkAttachment()\n {\n $boundary = \"--\" . md5(uniqid(time()));\n if ($this->attfile) {\n $this->headers[\"Content-Type\"] = \"multipart/mixed;\\n boundary=\\\"\" . $boundary . \"\\\"; type=\\\"multipart/mixed\\\"\";\n $mailbody = \"This is a multi-part message in MIME format.\\n\";\n $mailbody .= \"--\" . $boundary;\n $mailbody .= \"\\nContent-Type: text/$this->type; charset=\\\"$this->charset\\\"\\nContent-Transfer-Encoding: $this->encoding\\n\\n\" . $this->mailbody . \"\\n\";\n $i = 0;\n $sep = chr(13) . chr(10);\n for ($x = 0; $x < count($this->attfile['name']); $x++) {\n $base = $this->attfile['name'][$x];\n $type = $this->attfile['type'][$x];\n $disp = $this->attfile['disp'][$x];\n $subhdr = \"--\" . $boundary . \"\\nContent-type: $type;\\n name=\\\"$base\\\"\\nContent-Transfer-Encoding: base64\\nContent-Disposition: $disp;\\n filename=\\\"$base\\\"\\n\";\n $subheader[$i++] = $subhdr;\n $fsize = $this->attfile['size'][$x] + 1;\n $fp = fopen($this->attfile['tmp_name'][$x], 'rb');\n $filecont = \"\";\n while (!feof($fp)) $filecont .= fread($fp, $fsize);\n $subheader[$i++] = chunk_split(base64_encode($filecont));\n fclose($fp);\n }\n $mailbody .= implode($sep, $subheader);\n $mailbody .= \"\\n--\" . $boundary . \"--\";\n $mailbody .= \"\\n-- End --\";\n $this->mailbody = $mailbody;\n }\n }", "public function upload(array $data);", "public function upload(array $data);", "public function add_data($data)\n {\n }", "public function create($data);", "public function create($data);", "public function create($data);", "public function create($data);", "public function create($data);", "protected function attachAll($disposition_type, $boundary)\n {\n }", "public static function handle_posted_attachments($message, $formdata, $filearea) {\n $filehandler = new self($message);\n\n // Store the filearea's files within moodle.\n $filehandler->store_posted_filearea($formdata, $filearea);\n\n // Update this message's list of file attachments.\n $filehandler->sync_attachments();\n }", "public function deserializeStatement($data, array $attachments = array());", "public function badgeUpload($eid)\n {\n $pngdata = \\Drupal::request()->request->get('data');\n if (!empty($pngdata)) {\n list($id, $base64) = explode('|', $pngdata);\n list($type, $data) = explode(';', $base64);\n list(, $data) = explode(',', $data);\n $pngdata = base64_decode($data);\n $path = 'public://badges/'.$eid;\n \\Drupal::service('file_system')->prepareDirectory($path, FileSystemInterface::CREATE_DIRECTORY);\n file_save_data($pngdata, $path.'/'.$id.'.png', FileSystemInterface::EXISTS_REPLACE);\n }\n\n $content['markup'] = array(\n '#markup' => '<p>Badge Upload.</p>',\n );\n return $content;\n }", "public function addStringEmbeddedImage(\n $string,\n $cid,\n $name = '',\n $encoding = 'base64',\n $type = '',\n $disposition = 'inline'\n ) {\n // If a MIME type is not specified, try to work it out from the name\n if ($type == '' and !empty($name)) {\n $type = self::filenameToType($name);\n }\n\n // Append to $attachment array\n $this->attachment[] = array(\n 0 => $string,\n 1 => $name,\n 2 => $name,\n 3 => $encoding,\n 4 => $type,\n 5 => true, // isStringAttachment\n 6 => $disposition,\n 7 => $cid\n );\n return true;\n }", "public function addData(string $data): IRequest;", "protected function createBoundary(): void\n {\n if (\n $this->boundary === null &&\n (\n $this->attachments ||\n $this->emailFormat === static::MESSAGE_BOTH\n )\n ) {\n $this->boundary = md5(Security::randomBytes(16));\n }\n }", "private function generateAssocData (&$_data) {\n\n $_data['venue_id'] = $this->venue_id;\n $_data['created'] = $this->created;\n $_data['modified'] = $this->modified;\n $_data['user_id'] = $this->user_id;\n $_data['name'] = $this->name;\n $_data['description'] = $this->description;\n $this->address->generateAssocData ($_data);\n $_data['phone'] = $this->phone;\n $_data['website'] = $this->website;\n $_data['email'] = $this->email;\n $_data['accessibility_info'] = $this->accessibility_info;\n $_data['seating_info'] = $this->seating_info;\n $_data['parking_info'] = $this->parking_info;\n $_data['image_url'] = $this->image_url;\n\n }", "public static function attachment( $FILENAME )\n {\n self::$_attachments[] = $FILENAME;\n }", "public static function updateAttachment($data, $existingPath = null)\n {\n if (empty($data)) {\n return false;\n }\n\n $data = array_merge($data, ['updated_at' => Carbon::now()]);\n\n DB::table('attachments')\n ->where('scope_key', $data['scope_key'])\n ->where('scope_id', $data['scope_id'])\n ->where('attachment_type_id', $data['attachment_type_id'])\n ->update($data);\n\n if (!empty($existingPath) && ($data['attachment_path'] !== $existingPath)) {\n self::removeAttachment($existingPath);\n }\n }" ]
[ "0.6182299", "0.5975112", "0.5804944", "0.56398153", "0.5528883", "0.54997", "0.5452637", "0.5362298", "0.5333096", "0.5298123", "0.515871", "0.5067172", "0.5051906", "0.5044301", "0.4994384", "0.49621752", "0.491312", "0.49091896", "0.4833724", "0.48228067", "0.48067805", "0.47837806", "0.4775062", "0.4748212", "0.47297364", "0.47215363", "0.4718775", "0.4705931", "0.46975458", "0.46970317", "0.46877712", "0.46510395", "0.46466967", "0.45607525", "0.45440727", "0.45405796", "0.45387995", "0.45278955", "0.45182866", "0.4518194", "0.4496865", "0.44945228", "0.4488387", "0.4484253", "0.44609877", "0.4449464", "0.44384274", "0.44356245", "0.44275576", "0.44263217", "0.4422841", "0.44207627", "0.44198206", "0.4418187", "0.44100273", "0.44098553", "0.4406069", "0.43963528", "0.43889666", "0.43684494", "0.436379", "0.4360617", "0.43576455", "0.43560016", "0.43479717", "0.4338175", "0.43357405", "0.43353122", "0.43350086", "0.43188408", "0.43182173", "0.43164942", "0.43124294", "0.43092304", "0.4296696", "0.42945662", "0.42856693", "0.42645198", "0.42635804", "0.4253437", "0.4251161", "0.42484298", "0.4246534", "0.4246534", "0.42414302", "0.4236063", "0.4236063", "0.4236063", "0.4236063", "0.4236063", "0.42334926", "0.42309523", "0.42119044", "0.42026758", "0.4198044", "0.41952202", "0.4194797", "0.41727418", "0.41707847", "0.41641244" ]
0.49240938
16
Deletes the specified attachment for the given beacon. Each attachment has a unique attachment name (`attachmentName`) which is returned when you fetch the attachment data via this API. You specify this with the delete request to control which attachment is removed. This operation cannot be undone. Authenticate using an [OAuth access token]( from a signedin user with Is owner or Can edit permissions in the Google Developers Console project. (attachments.delete)
public function delete($attachmentName, $optParams = array()) { $params = array('attachmentName' => $attachmentName); $params = array_merge($params, $optParams); return $this->call('delete', array($params), "Google_Service_Proximitybeacon_ProximitybeaconEmpty"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function batchDelete($beaconName, $optParams = array())\n {\n $params = array('beaconName' => $beaconName);\n $params = array_merge($params, $optParams);\n return $this->call('batchDelete', array($params), \"Google_Service_Proximitybeacon_DeleteAttachmentsResponse\");\n }", "function deleteAttachment($attachment) {\n\t\t$fileToDelete = substr($attachment['uri'], strpos($attachment['uri'], \"/\") + 1);\n\n\t\t//Delete the original file.\n\t\t$this->deleteFile(Configure::read(\"S3.bucket\"), $fileToDelete);\n\t}", "public function delete($attachment_id) {\r\n\t\t\r\n\t\tif(is_array($attachment_id)) {\r\n\t\t\r\n\t\t\twhile(list($ind, $val) = each($attachment_id)) {\r\n\t\t\t\t\r\n\t\t\t\t$query = \"DELETE FROM $this->att WHERE attachment_id = $val\";\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t$Affected = $this->execute($query);\r\n\t\t\t\t\r\n\t\t\t\tif (PEAR::isError($Affected)) {\r\n\t\t\t\t\tdie($Affected->getMessage());\r\n\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t} else {\r\n\t\t\t\r\n\t\t\t$query = \"DELETE FROM $this->att WHERE attachment_id = $attachment_id\";\r\n\t\t\t\r\n\t\t\t$Affected = $this->execute($query);\r\n\t\t\t\t\r\n\t\t\t\tif (PEAR::isError($Affected)) {\r\n\t\t\t\t\tdie($Affected->getMessage());\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\r\n\t}", "public function deleteAttachment($attachmentid){\n $header = $this->app->request->headers->all();\n $body = $this->app->request->getBody();\n //getAttachment to get the file of the Attachment\n $URL = $this->lURL.'/DB/attachment/attachment/'.$attachmentid;\n $answer = Request::custom('GET', $URL, $header, \"\");\n $body = json_decode($answer['content'], true);\n\n if (isset($body['file'])) {\n // request to database\n $URL = $this->lURL.'/DB/attachment/attachment/'.$attachmentid;\n $answer = Request::custom('DELETE', $URL, $header, $body);\n $this->app->response->setStatus($answer['status']);\n\n // delete the file\n LFileHandler::delete($this->lURL, $header, $body['file']);\n } else {\n $this->app->response->setStatus(409);\n }\n }", "public function delete($itemId, $attachmentId, $optParams = array())\n {\n $params = array('itemId' => $itemId, 'attachmentId' => $attachmentId);\n $params = array_merge($params, $optParams);\n return $this->call('delete', array($params));\n }", "function wise_chat_action_delete_attachment($attachmentId) {\n\t$wiseChatImagesService = WiseChatContainer::get('services/WiseChatImagesService');\n\t$wiseChatImagesService->removeRelatedImages($attachmentId);\n}", "public function deleteAttachment() {\n try {\n if (!($this->attachment instanceof Base_Model_ObtorLib_App_Core_Qualification_Entity_Attachment)) {\n throw new Base_Model_ObtorLib_App_Core_Qualification_Exception(\" Attachment Entity not initialized\");\n } else {\n $objAttachment = new Base_Model_ObtorLib_App_Core_Qualification_Dao_Attachment();\n $objAttachment->attachment = $this->attachment;\n return $objAttachment->deleteAttachment();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Qualification_Exception($ex);\n }\n }", "public function DeleteAttachment($request)\n {\n return $this->makeRequest(__FUNCTION__, $request);\n }", "public function deleteattachmentAction()\r\n {\r\n try {\r\n if ( ($id = $this->getRequest()->getParam('id')) ) {\r\n $attachment = Mage::getModel('link/node_attachment')->load($id);\r\n\r\n $attachment->delete();\r\n }\r\n } catch (Exception $error) { }\r\n }", "public function deleted(Attachment $attachment)\n {\n \n UnSearchableJob::dispatch($attachment->name);\n \n }", "public function onAttachmentDelete(Attachment $attachment, Entity $container = null)\n {\n }", "public function delete_attachment($attachment_id)\n {\n $current_usage = $this->get_current_usage();\n\n $this->debug(\"Updating used size after deletion- old = \".$current_usage[self::OPTION_USAGE_USED].\" MB\");\n\n /* We get current usage on disk */\n $used_infos = EPFLQuota::get_usage_on_disk();\n\n /* Because file hasn't been deleted yet, we have to remove informations from stats */\n $used_infos[self::OPTION_USAGE_NB_FILES] -= 1;\n\n /* If there's no file anymore */\n if($used_infos[self::OPTION_USAGE_NB_FILES] == 0)\n {\n /* We set usage to 0 instead of substracting removed file size, to avoid rounding problems */\n $used_infos[self::OPTION_USAGE_USED] = 0;\n }\n else\n {\n $used_infos[self::OPTION_USAGE_USED] -= filesize(get_attached_file($attachment_id))/1024/1024;\n }\n\n $current_usage[self::OPTION_USAGE_USED] = $used_infos[self::OPTION_USAGE_USED];\n $current_usage[self::OPTION_USAGE_NB_FILES] = $used_infos[self::OPTION_USAGE_NB_FILES];\n $this->debug(\"Updating used size after deletion - new = \".$current_usage[self::OPTION_USAGE_USED].\" MB (calculated from real disk usage)\");\n\n EPFLQuota::set_current_usage($current_usage);\n }", "public function deleteAttachment($document_id, $attachment_id): string\n {\n return $this->request('documents/'.$document_id.'/attachments/'.$attachment_id, 'DELETE');\n }", "public function delete_attachments($contextid = 1) {\n $fs = get_file_storage();\n $fs->delete_area_files($contextid, 'mod_documents', 'attachment', $this->id);\n $fs->delete_area_files($contextid, 'mod_documents', 'picture', $this->id);\n\n }", "public function destroy(Attachment $attachment)\n {\n $attachment->delete();\n return redirect()->route('attachment.index');\n }", "public function deleteByAttachmentId($attachmentId)\n {\n $attachmentId = (int)$attachmentId;\n $photo = $this->getByAttachmentId($attachmentId);\n\n do_action('gg_delete_photo_attachment_id', $attachmentId);\n\n return $this->deleteBy('attachment_id', $attachmentId);\n }", "public function deleteAttachment($id)\n\t{\n\t\t$attachment = MailAttachment::find($id);\n\t\t$attachment->delete();\n\t\t\n\t\t$result = [\n\t\t\t'success' => 1\n\t\t];\n\t\t\n\t\treturn response($result);\n\t}", "public function removeAttachmentById() {\n\n if (!empty($_GET['attachmentId']) && !empty($_GET['attachment'])) {\n $attachmentId = $_GET['attachmentId'];\n $attachment = $_GET['attachment'];\n $unlinkPath = $_SERVER['DOCUMENT_ROOT'].'/fintech/laravel/public/po_image/';\n unlink($unlinkPath.$attachment);\n date_default_timezone_set('Asia/Kolkata'); \n $time = date('d-m-Y h:i:s A');\n $ticketData = [\n 'is_deleted_status' => 'Y',\n 'deleted_at' => $time\n ];\n $deleteResults = DB::table('purchase_order_image')\n ->where('id', $attachmentId)\n ->update($ticketData);\n echo $attachmentId;\n\n }\n }", "public function delete($id = null)\n {\n $attachment = $this->Attachments->get($id);\n \n if (!@unlink(UPLOADS . $attachment->path)) {\n $this->set('error', 'An unexpected error occured');\n $this->set('_serialize', [ 'error' ]);\n return;\n }\n \n if ($this->request->is(['delete', 'post'])) {\n if (!$this->Attachments->delete($attachment)) {\n $this->set('error', 'An unexpected error occured');\n $this->set('_serialize', [ 'error' ]);\n return;\n }\n }\n \n $this->set('attachment', $attachment);\n $this->set('_serialize', 'attachment');\n }", "public function removeAttachment(){\r\n $fid = Input::get('FID');\r\n $file = UploadedFiles::find($fid);\r\n if($file == null)\r\n return -1;\r\n $file->delete();\r\n return $fid;\r\n }", "public static function action_delete_attachment( $post_id ) {\n\t\t$post = get_post( $post_id );\n\t\tself::purge_post_with_related( $post );\n\t}", "public function actionDeleteAttachment($id)\n\t{\n\t\tif (Yii::app()->request->isPostRequest)\n\t\t{\n\t\t\t// we only allow deletion via POST request\n\t\t\tCmsAttachment::model()->findByPk($id)->delete();\n\t\t\tYii::app()->user->setFlash(Yii::app()->cms->flashes['success'], Yii::t('CmsModule.core', 'Attachment deleted.'));\n\n\t\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\t\tif (!isset($_GET['ajax']))\n\t\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('node'));\n\t\t}\n\t\telse\n\t\t\tthrow new CHttpException(400, Yii::t('CmsModule.core', 'Invalid request. Please do not repeat this request again.'));\n\t}", "public function delete(string $attachmentId)\n {\n /** @var Attachment $attachment */\n $attachment = Attachment::query()->findOrFail($attachmentId);\n $this->checkOwnablePermission('attachment-delete', $attachment);\n $this->attachmentService->deleteFile($attachment);\n\n return response()->json(['message' => trans('entities.attachments_deleted')]);\n }", "public function delete_video( int $attachment_id ): void {\n\t\tdelete_metadata( 'post', 0, self::CROPPED_ID_POST_META_KEY, $attachment_id, true );\n\t}", "public function deleteAttachment($assignment_id, $id)\n {\n// $submission = Submission::where('id', $submission_id)->first();\n $attachment = AssignmentAttachment::findOrFail($id);\n\n if($attachment != null){\n// foreach ($attachment->media as $delItem) {\n// $this->deleteMedia($delItem);\n// }\n\n // Only delete attachment as the media might be using by student\n $attachment->delete();\n }\n\n return back();\n }", "public function destroy($id) {\n\n $attachment = Attachment::find($id);\n unlink($attachment->path);\n $attachment->delete();\n }", "public function delete($objectAttachment) {\n $sql = \"DELETE FROM attachments WHERE id = {$objectAttachment->id}\";\n\n if ($this->conn->query($sql) === TRUE) {\n return TRUE;\n } else {\n return FALSE;\n }\n }", "function delete_attachment( $post ) {\n\tif( $_POST['att_ID'] ) {\n\t\t$msg = _e( 'Attachment ID [' . $_POST['att_ID'] . '] has been deleted!' );\n\t\tif( wp_delete_attachment( $_POST['att_ID'], true )) {\n\t\t\techo $msg;\n\t\t}\n\t}\n\tdie();\n}", "function wp_delete_attachment($post_id, $force_delete = \\false)\n {\n }", "public function delete()\n {\n if (method_exists(get_class($this), 'attachments'))\n {\n /** @var Attachment $attachment */\n /** @noinspection PhpUndefinedMethodInspection */\n foreach ($this->attachments()->get() as $attachment)\n {\n $attachment->delete();\n }\n }\n return parent::delete();\n }", "function delete_attachment_data()\r\n\t{\r\n\t\tglobal $auth, $config, $db, $phpbb_root_path, $phpEx, $user;\r\n\r\n\t\tif (sizeof($this->hard_delete['p']))\r\n\t\t{\r\n\t\t\t$num_files = $config['num_files'];\r\n\r\n\t\t\t$sql = 'SELECT * FROM ' . ATTACHMENTS_TABLE . '\r\n\t\t\t\tWHERE ' . $db->sql_in_set('post_msg_id', $this->hard_delete['p']) . '\r\n\t\t\t\t\tAND in_message = 0\r\n\t\t\t\t\tAND topic_id != 0';\r\n\t\t\t$result = $db->sql_query($sql);\r\n\t\t\twhile ($row = $db->sql_fetchrow($result))\r\n\t\t\t{\r\n\t\t\t\t@unlink($phpbb_root_path . $config['upload_path'] . '/' . $row['physical_filename']);\r\n\t\t\t\t$num_files--;\r\n\t\t\t}\r\n\r\n\t\t\tif ($num_files != $config['num_files'])\r\n\t\t\t{\r\n\t\t\t\tset_config('num_files', $num_files, true);\r\n\t\t\t}\r\n\r\n\t\t\t$sql = 'DELETE FROM ' . ATTACHMENTS_TABLE . '\r\n\t\t\t\tWHERE ' . $db->sql_in_set('post_msg_id', $this->hard_delete['p']) . '\r\n\t\t\t\t\tAND in_message = 0\r\n\t\t\t\t\tAND topic_id != 0';\r\n\t\t\t$db->sql_query($sql);\r\n\t\t}\r\n\t}", "public function removeAttachment(TrickAttachmentData $attachment)\n {\n $this->attachments->removeElement($attachment);\n }", "public static function _deleteAttachment($entity, $field, $name, $config) {\n\t\t$file = Interpolation::run($config['path'], $entity, $field, array(\n\t\t\t'filename' => $name\n\t\t));\n\t\t$path = dirname($file);\n\t\tif (is_file($file) && unlink($file)) {\n\t\t\t$files = @scandir($path);\n\t\t\tif ($files && count($files) === 2) {\n\t\t\t\trmdir($path);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}", "public static function deleteAttachment($scopeKey, $scopeId, $existingPath)\n {\n DB::table('attachments')\n ->where('scope_key', $scopeKey)\n ->where('scope_id', $scopeId)\n ->where('attachment_path', $existingPath)\n ->delete();\n\n self::removeAttachment($existingPath);\n }", "public function afterDelete($event)\n {\n\n\n $imagesList = $this->owner->attachments;\n //die(print_r($imagesList));\n if (!empty($imagesList)) {\n foreach ($imagesList as $image) {\n\n\n $alias = $this->attachmentAttributes['path'];\n\n\n // Delete file\n if (file_exists(Yii::getPathOfAlias(\"webroot.uploads.{$alias}\") . '/' . $image->name))\n unlink(Yii::getPathOfAlias(\"webroot.uploads.{$alias}\") . '/' . $image->name);\n\n if (file_exists(Yii::getPathOfAlias(\"webroot.assets.{$alias}\"))) {\n $listfile = CFileHelper::findFiles(Yii::getPathOfAlias(\"webroot.assets.{$alias}\"), array(\n 'absolutePaths' => true\n ));\n foreach ($listfile as $path) {\n if (strpos($path, $image->name) !== false) {\n if (file_exists($path)) {\n unlink($path);\n }\n }\n }\n }\n if ($image->is_main) {\n // Get first image and set it as main\n $model = AttachmentModel::model()->find();\n if ($model) {\n $model->is_main = 1;\n $model->save(false, false, false);\n }\n }\n\n $image->delete();\n }\n }\n return parent::afterDelete($event);\n }", "function delete_file()\n{\n\n if (isset($_POST['attachment_id']) \n && isset($_POST['woa-secudeal-nonce'])\n && wp_verify_nonce($_POST['woa-secudeal-nonce'], 'woa_secudeal_ajax_nonce')\n ) {\n $attachment_id = absint($_POST['attachment_id']);\n\n $result = wp_delete_attachment($attachment_id, true); // permanently delete attachment\n\n if ($result) {\n wp_send_json(array('status' => 'ok'));\n }\n }\n wp_send_json(array('status' => 'error'));\n}", "public function upload_delete($id = '')\n\t{\n\t\t$this->load->helper('file');\n\t\tif ( ! is_numeric($id))\n\t\t{\n\t\t\tredirect('admin/kb/articles/');\n\t\t}\n\t\t$id = (int) $id;\n\n\t\t$this->db->select('attach_id, article_id, attach_file')->from('attachments')->where('attach_id', $id);\n\t\t$query = $this->db->get();\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\t$row = $query->row();\n\t\t\t$article_id = $row->article_id;\n\t\t\tunlink(ROOTPATH .'uploads/'.$row->article_id.'/'.$row->attach_file);\n\t\t\t$this->db->delete('attachments', array('attach_id' => $id));\n\t\t\tredirect('admin/kb/articles/edit/'.$article_id.'/#attachments');\n\t\t}\n\t\telse\n\t\t{\n\t\t\tredirect('admin/kb/articles/');\n\t\t}\n\t}", "public function deleted(Activity $activity)\n {\n $this->tryRemoveFile($activity->content_path);\n foreach($activity->images as $image){\n $image->delete();\n }\n }", "public function EventFileUploadedDeleted( $attachment_id ) {\n\t\tif ( $this->is_file_uploaded ) {\n\t\t\treturn;\n\t\t}\n\t\t$file = get_attached_file( $attachment_id );\n\t\t$this->plugin->alerts->Trigger(\n\t\t\t2011, array(\n\t\t\t\t'AttachmentID' => $attachment_id,\n\t\t\t\t'FileName' => basename( $file ),\n\t\t\t\t'FilePath' => dirname( $file ),\n\t\t\t)\n\t\t);\n\t}", "public function deleteAttachment($commentId)\n {\n $attachmentId = get_comment_meta($commentId, 'attachmentId', TRUE);\n if(is_numeric($attachmentId) && !empty($attachmentId) && ATT_DEL){\n wp_delete_attachment($attachmentId, TRUE);\n }\n }", "public function deleteItem($itemId)\n {\n\n $orm = $this->getOrm();\n\n // andere attachments löschen\n $orm->delete('WbfsysAddressItem', $itemId);\n\n }", "public function destroy( $id )\n\t{\n\t\treturn Attachment::find($id)->delete();\n\t}", "public function destroy(Download $download)\n {\n $download->delete();\n redirect('/download');\n }", "public function remove($attachmentId, $recursive = true)\n {\n // Prepare return.\n $results = array();\n\n // No data to remove\n if (empty($attachmentId)) {\n return array();\n }\n\n // Find a master.\n $sql = $this->getAttachmentProvider()->createModel()->whereId($attachmentId);\n\n // If recursive find related.\n if ($recursive == true) {\n $sql = $sql->orWhere(function($query) use ($attachmentId) {\n $query->whereMaster($attachmentId);\n });\n }\n\n // Get attachments.\n $attachments = $sql->get();\n\n if (count($attachments)) foreach ($attachments as $attachment) {\n // Subpath from db.\n $subpath = trim($attachment->path, '/');\n\n // Inject a config, then remove a attachment related.\n $this->uploader->inject(array(\n 'subpath' => $subpath,\n 'onRemove' => function($result) use ($attachment, &$results) {\n $attachment->delete(false);\n Cache::forget('attachment-'.$attachment->getKey());\n array_push($results, $result);\n }\n ))\n ->open($attachment->toArray())->remove();\n }\n\n return $results;\n }", "function delete_attachments ($pid, $tid, $aid = '')\n {\n global $f_upload_path;\n $delete_files = array ();\n $query = sql_query ('SELECT a_name FROM ' . TSF_PREFIX . 'attachments WHERE a_pid = ' . sqlesc ($pid) . ' AND a_tid = ' . sqlesc ($tid));\n if (0 < mysql_num_rows ($query))\n {\n while ($delete = mysql_fetch_assoc ($query))\n {\n $delete_files[] = $delete['a_name'];\n }\n }\n\n if (0 < count ($delete_files))\n {\n foreach ($delete_files as $nowdelete)\n {\n if (file_exists ($f_upload_path . $nowdelete))\n {\n unlink ($f_upload_path . $nowdelete);\n continue;\n }\n }\n }\n\n sql_query ('DELETE FROM ' . TSF_PREFIX . 'attachments WHERE a_pid = ' . sqlesc ($pid) . ' AND a_tid = ' . sqlesc ($tid) . ($aid ? ' AND a_id = ' . sqlesc ($aid) : ''));\n }", "public function essQualificationDeleteAttachment($employee_qualification_id, $document_id, $employee_id, string $contentType = self::contentTypes['essQualificationDeleteAttachment'][0])\n {\n $this->essQualificationDeleteAttachmentWithHttpInfo($employee_qualification_id, $document_id, $employee_id, $contentType);\n }", "public function destroy(Letter $letter, $attachmentId)\n {\n $this->authorize('letters.update');\n\n $letter->attachments()->find($attachmentId)->delete();\n\n return $letter->prints;\n }", "public function forceRemoteDeleteAttachment($attachmentID)\r\n {\r\n if (!eval(Hooks::get('FORCE_ATTACHMENT_DELETE'))) return;\r\n }", "public function essQualificationDeleteAttachmentRequest($employee_qualification_id, $document_id, $employee_id, string $contentType = self::contentTypes['essQualificationDeleteAttachment'][0])\n {\n\n // verify the required parameter 'employee_qualification_id' is set\n if ($employee_qualification_id === null || (is_array($employee_qualification_id) && count($employee_qualification_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $employee_qualification_id when calling essQualificationDeleteAttachment'\n );\n }\n\n // verify the required parameter 'document_id' is set\n if ($document_id === null || (is_array($document_id) && count($document_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $document_id when calling essQualificationDeleteAttachment'\n );\n }\n\n // verify the required parameter 'employee_id' is set\n if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $employee_id when calling essQualificationDeleteAttachment'\n );\n }\n\n\n $resourcePath = '/api/v2/ess/{employeeId}/qualification/{employeeQualificationId}/attachment/{documentId}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($employee_qualification_id !== null) {\n $resourcePath = str_replace(\n '{' . 'employeeQualificationId' . '}',\n ObjectSerializer::toPathValue($employee_qualification_id),\n $resourcePath\n );\n }\n // path params\n if ($document_id !== null) {\n $resourcePath = str_replace(\n '{' . 'documentId' . '}',\n ObjectSerializer::toPathValue($document_id),\n $resourcePath\n );\n }\n // path params\n if ($employee_id !== null) {\n $resourcePath = str_replace(\n '{' . 'employeeId' . '}',\n ObjectSerializer::toPathValue($employee_id),\n $resourcePath\n );\n }\n\n\n $headers = $this->headerSelector->selectHeaders(\n [],\n $contentType,\n $multipart\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 (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('apiKey');\n if ($apiKey !== null) {\n $headers['apiKey'] = $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 $operationHost = $this->config->getHost();\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'DELETE',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function delete(Message $message)\n {\n if (!Config::getInstance()->get('CDASH_REMOTE_PROCESSOR')) {\n // A more descriptively named copy of this file should now\n // exist on the server if it is configured to save backups.\n if (file_exists($message->file)) {\n unlink($message->file);\n }\n return;\n }\n\n // When remotely executing we tell the server to delete the file\n // after it has been parsed.\n $query_args = ['filename' => basename($message->file)];\n if ($this->backupFileName) {\n // If the handler provided us with a descriptive backup filename\n // we pass this on to the server in case it is configured to rename\n // (rather than delete) processed submission files.\n $query_args['dest'] = basename($this->backupFileName);\n }\n $url = config('app.url') . '/api/v1/deleteSubmissionFile.php';\n $this->getHttpClient()->request('DELETE', $url,\n ['query' => $query_args]);\n }", "public function deleteDownloadFile()\r\n\t{\r\n\t\t@unlink($this->reference);\r\n\t}", "public function delete(Message $message)\n {\n if (!Config::getInstance()->get('CDASH_REMOTE_PROCESSOR')) {\n // A more descriptively named copy of this file should now\n // exist on the server if it is configured to save backups.\n if (file_exists($message->file)) {\n unlink($message->file);\n }\n return;\n }\n\n // When remotely executing we tell the server to delete the file\n // after it has been parsed.\n $query_args = ['filename' => basename($message->file)];\n if ($this->backupFileName) {\n // If the handler provided us with a descriptive backup filename\n // we pass this on to the server in case it is configured to rename\n // (rather than delete) processed submission files.\n $query_args['dest'] = basename($this->backupFileName);\n }\n $url = Config::getInstance()->get('CDASH_BASE_URL') .\n '/api/v1/deleteSubmissionFile.php';\n $this->getHttpClient()->request('DELETE', $url,\n ['query' => $query_args]);\n }", "public function listBeaconsAttachments($beaconName, $optParams = array())\n {\n $params = array('beaconName' => $beaconName);\n $params = array_merge($params, $optParams);\n return $this->call('list', array($params), \"Google_Service_Proximitybeacon_ListBeaconAttachmentsResponse\");\n }", "public function delete($filepath);", "function removeFile($iaf_id)\n {\n $iaf_id = Misc::escapeInteger($iaf_id);\n $stmt = \"DELETE FROM\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"issue_attachment_file\n WHERE\n iaf_id=\" . $iaf_id;\n $res = DB_Helper::getInstance()->query($stmt);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return -1;\n }\n }", "public function delete($filename);", "function deleteUploadedFile($args) {\t\t\r\n\t\t$meetingId = isset($args[0]) ? (int) $args[0] : 0;\r\n\t\t$fileId = isset($args[1]) ? (int) $args[1] : 0;\r\n\t\t\r\n\t\t$this->validate($meetingId);\r\n\t\t\r\n\t\timport('classes.file.MinutesFileManager');\r\n\t\t$minutesFileManager = new MinutesFileManager($meetingId);\r\n\t\t$minutesFileManager->deleteFile($fileId);\t\t\r\n\t\tRequest::redirect(null, null, 'manageMinutes', $meetingId);\r\n\t}", "function email_delete_attachments($mailid) {\n\n\t$result = true;\n\n if ( $basedir = email_file_area($mailid) ) {\n\n\t\t// Delete all files of mail\n if ( $files = get_directory_list($basedir) ) {\n\n\t\t\tforeach ($files as $file) {\n\n if (! $result = unlink(\"$basedir/$file\") ) {\n \t\tnotify(\"Existing file '$file' has been deleted!\");\n }\n \t\t}\n \t\t}\n\n\t\t// Delete directory as well, if empty\n \trmdir(\"$basedir\");\n }\n\n return $result;\n}", "public function delete_attachment_data($post_id)\n {\n }", "public function essLeaveDeleteAttachment($leave_request_id, $employee_id, string $contentType = self::contentTypes['essLeaveDeleteAttachment'][0])\n {\n $this->essLeaveDeleteAttachmentWithHttpInfo($leave_request_id, $employee_id, $contentType);\n }", "public function deleteAction() {\r\n\t\t$id = $this->getInput('id');\r\n\t\t$info = Gou_Service_Ad::getAd($id);\r\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\r\n//\t\tUtil_File::del(Common::getConfig('siteConfig', 'attachPath') . $info['img']);\r\n\t\t$result = Gou_Service_Ad::deleteAd($id);\r\n\t\tif (!$result) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功');\r\n\t}", "function remove($iat_id, $add_history = true)\n {\n $iat_id = Misc::escapeInteger($iat_id);\n $usr_id = Auth::getUserID();\n $stmt = \"SELECT\n iat_iss_id\n FROM\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"issue_attachment\n WHERE\n iat_id=$iat_id\";\n if (Auth::getCurrentRole() < User::getRoleID(\"Manager\")) {\n $stmt .= \" AND\n iat_usr_id=$usr_id\";\n }\n $res = DB_Helper::getInstance()->getOne($stmt);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return -1;\n }\n\n if (empty($res)) {\n return -2;\n }\n\n $issue_id = $res;\n $files = self::getFileList($iat_id);\n $stmt = \"DELETE FROM\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"issue_attachment\n WHERE\n iat_id=$iat_id AND\n iat_iss_id=$issue_id\";\n $res = DB_Helper::getInstance()->query($stmt);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return -1;\n }\n foreach ($files as $file) {\n self::removeFile($file['iaf_id']);\n }\n if ($add_history) {\n Issue::markAsUpdated($usr_id);\n // need to save a history entry for this\n History::add($issue_id, $usr_id, History::getTypeID('attachment_removed'), 'Attachment removed by ' . User::getFullName($usr_id));\n }\n return 1;\n }", "public function testDeleteAttachment()\n {\n }", "function deleteactivity() {\n $this->auth(WL_ADM_LEVEL);\n $activity_id = $this->uri->segment(3);\n $this->m_activities->delete($activity_id);\n $this->activities();\n }", "public function testDeleteWhenDepotFileDeleted()\n {\n $services = $this->getApplication()->getServiceManager();\n // Override the service container to set depot_storage_path\n $config = $services->get('config');\n $config['depot_storage']['base_path'] = '//depot/swarm-attachments';\n $services->setService('config', $config);\n $depot = $services->get('depot_storage');\n $services->get('p4_admin')->setService('depot_storage', $depot);\n $attachment = new Attachment($this->p4);\n $attachment->set(\n array(\n 'name' => 'test.txt',\n 'size' => 4,\n 'type' => 'text/plain',\n )\n );\n\n $tempFile = tempnam(DATA_PATH, 'attachtest');\n file_put_contents($tempFile, 'test');\n\n $attachment->save($tempFile);\n\n $attachmentId = $attachment->getId();\n $attachment = Attachment::fetch($attachmentId, $this->p4);\n\n $fileSpec = $attachment->get('depotFile');\n\n // certain conditions might cause $attachment->delete() to fail unexpectedly. Here, we try to simulate one.\n // the call to $depot->delete() that is *inside* $attachment->delete() will fail, but failure\n // should be caught and ignored.\n $depot->delete($fileSpec);\n $attachment->delete();\n\n // then, when an attempt is made to fetch the attachment record, it shouldn't exist.\n // this verifies that the attachment records are deleted cleanly.\n $attachmentRefetch = false;\n try {\n $attachmentRefetch = Attachment::fetch($attachmentId, $this->p4);\n } catch (NotFoundException $e) {\n if ($e->getMessage() != 'Cannot fetch entry. Id does not exist.') {\n throw $e;\n }\n }\n\n $this->assertSame(false, $attachmentRefetch);\n }", "public function delete_file( string $blob_name ): void {\n\t\t$blob_client = $this->get_blob_client();\n\t\t$container_name = $this->get_container_name();\n\t\t$blob_client->deleteBlob( $container_name, $blob_name );\n\t}", "public function delete_photo ($photo_id){\n\t\t$q_extension = \"SELECT extension FROM photos WHERE photo_id =\".$photo_id;\t\n\t\t$q_photo = 'WHERE photo_id = '.$photo_id;\n\t\t#delete photo record from database\n\t\t\t\n\t\t$ext = DB::instance(DB_NAME)->select_field($q_extension);\n\t\tDB::instance(DB_NAME)->delete('photos', $q_photo);\t\t\n\t\t//delete photo from uploads images folder\n\t\tunlink(\"uploads/images/\".$photo_id.\".\".$ext);\n\t\t#send user back to message index\n\t\tRouter::redirect(\"/photos/gallery\");\n\t\n\t}", "public function deleteAsset($path_to_file)\n\t{\n\t\t$path_to_file = rawurlencode(urldecode($path_to_file));\n\t\t\n\t\t$url = \"http://{$this->wnServer}/webnative/portalDI?action=filemgr&filemgraction=delete&filename=\".$path_to_file;\n\t\t$result = json_decode($this->curlObj->fetch_url($url),true);\n \n\t\treturn $result[\"MSG\"];\n\t}", "public function removeAttachments($event_id) {\r\n\t\t\r\n\t\t$query = \"UPDATE $this->att SET event_id = 0 WHERE event_id = $event_id\";\r\n\t\t\t\r\n\t\treturn $this->execute($query);\r\n\t}", "function deleteContactRequest($request_id) {\n global $pdo;\n $request = getContactRequest($request_id);\n if ($request['attachment'] != \"\") // check if attachment exists\n deleteFile($request['attachment']); // delete file out of database\n $statement = $pdo->prepare('DELETE FROM `contact` WHERE `id` = :id');\n $statement->bindParam(\":id\", $request_id);\n return $statement->execute();\n}", "public function delete(bool $flush = true): void\n {\n $filepath = $this->getPath();\n if (file_exists($filepath)) {\n if (@unlink($filepath) === false) {\n // @codeCoverageIgnoreStart\n Log::warning(\"Failed deleting file for attachment thumbnail with id={$this->getAttachmentId()}, size={$this->getSize()} at {$filepath}\");\n // @codeCoverageIgnoreEnd\n }\n }\n Cache::delete(self::getCacheKey($this->getAttachmentId(), $this->getSize()));\n DB::remove($this);\n if ($flush) {\n DB::flush();\n }\n }", "public function create($beaconName, Google_Service_Proximitybeacon_BeaconAttachment $postBody, $optParams = array())\n {\n $params = array('beaconName' => $beaconName, 'postBody' => $postBody);\n $params = array_merge($params, $optParams);\n return $this->call('create', array($params), \"Google_Service_Proximitybeacon_BeaconAttachment\");\n }", "public function deleteAddress($storageId)\n {\n\n $orm = $this->getOrm();\n\n $orm->delete('WbfsysFileAddress', $storageId);\n\n // andere attachments löschen\n $orm->deleteWhere('WbfsysEntityFileAddress', \"id_storage=\".$storageId);\n\n }", "public function destroy(Download $download)\n {\n //\n }", "public function detachDefect($defectAttachmentId);", "public function sendAttachment(Templates\\Attachment $attachment) {\n $options = [\n 'json' => [\n 'message' => $attachment->getData()\n ]\n ];\n\n return $this->guzzle()->post('https://graph.facebook.com/v6.0/me/message_attachments?access_token=' . $this->accessToken, $options);\n }", "public function delete_experiment( $experiment_id, $archive = TRUE ) {\n\t\tif ( $archive ) {\n\t\t\treturn $this->update_experiment( $experiment_id, array( 'status' => 'Archived' ) );\n\t\t}//end if\n\n\t\treturn $this->request( array(\n\t\t\t'function' => 'experiments/' . abs( intval( $experiment_id ) ),\n\t\t\t'method' => 'DELETE',\n\t\t) );\n\t}", "public function delete_foto_file($uuid)\n\t{\n\t\tif (!$this->is_allowed('m_ads_delete', false)) {\n\t\t\techo json_encode([\n\t\t\t\t'success' => false,\n\t\t\t\t'error' => cclang('sorry_you_do_not_have_permission_to_access')\n\t\t\t\t]);\n\t\t\texit;\n\t\t}\n\n\t\techo $this->delete_file([\n 'uuid' => $uuid, \n 'delete_by' => $this->input->get('by'), \n 'field_name' => 'foto', \n 'upload_path_tmp' => './uploads/tmp/',\n 'table_name' => 'm_ads',\n 'primary_key' => 'id',\n 'upload_path' => 'uploads/m_ads/'\n ]);\n\t}", "public function essQualificationDeleteAttachmentWithHttpInfo($employee_qualification_id, $document_id, $employee_id, string $contentType = self::contentTypes['essQualificationDeleteAttachment'][0])\n {\n $request = $this->essQualificationDeleteAttachmentRequest($employee_qualification_id, $document_id, $employee_id, $contentType);\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 (int) $e->getCode(),\n $e->getResponse() ? $e->getResponse()->getHeaders() : null,\n $e->getResponse() ? (string) $e->getResponse()->getBody() : null\n );\n } catch (ConnectException $e) {\n throw new ApiException(\n \"[{$e->getCode()}] {$e->getMessage()}\",\n (int) $e->getCode(),\n null,\n 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 (string) $request->getUri()\n ),\n $statusCode,\n $response->getHeaders(),\n (string) $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 }", "function attachmentsCreateExample($service, $beaconName, $optParams)\n{\n\ttry\n\t{\n\t\t// Parameter validation.\n\t\tif ($service == null)\n\t\t\tthrow new Exception(\"service is required.\");\n\t\tif ($optParams == null)\n\t\t\tthrow new Exception(\"optParams is required.\");\n\t\tif (beaconName == null)\n\t\t\tthrow new Exception(\"beaconName is required.\");\n\t\t// Make the request and return the results.\n\t\treturn $service->attachments->CreateAttachments($beaconName, $optParams);\n\t}\n\tcatch (Exception $e)\n\t{\n\t\tprint \"An error occurred: \" . $e->getMessage();\n\t}\n}", "public function delete( $args, $assoc_args ) {\n\n\t\t$site_id = $assoc_args['site-id'];\n\t\t$backup_id = $args[0];\n\n\t\t$this->set_account();\n\n\t\t$args = array(\n\t\t\t'endpoint' => '/site/' . $site_id . '/backup/' . $backup_id,\n\t\t\t'method' => 'DELETE',\n\t\t\t);\n\n\t\t$response = $this->api_request( $args );\n\n\t\tif ( is_wp_error( $response ) )\n\t\t\tWP_CLI::error( $response->get_error_message() );\n\n\t\tWP_CLI::success( 'Deleted backup ' . $backup_id );\n\t}", "function delete() {\n\t\tif (!forge_check_perm ('tracker', $this->Artifact->ArtifactType->getID(), 'tech')) {\n\t\t\t$this->setPermissionDeniedError();\n\t\t\treturn false;\n\t\t}\n\t\t$res = db_query_params ('DELETE FROM artifact_file WHERE id=$1',\n\t\t\t\t\tarray ($this->getID())) ;\n\t\tif (!$res || db_affected_rows($res) < 1) {\n\t\t\t$this->setError('ArtifactFile: Unable to Delete');\n\t\t\treturn false;\n\t\t} else {\n\t\t\tArtifactStorage::instance()->delete($this->getID())->commit();\n\n\t\t\t$this->Artifact->addHistory('File Deleted',$this->getID().': '.$this->getName());\n\t\t\treturn true;\n\t\t}\n\t}", "public function delete($extension)\n {\n }", "public function deleteMessage($messageId);", "public function clearAttachments()\n {\n $this->attachment = array();\n }", "public function deleteFile($filename) {\r\n global $db;\r\n\r\n $userId= $this->userId;\r\n $trackingId = $this->trackingFormId;\r\n\r\n $basePath = FILEPATH . $userId. '/' . $trackingId;\r\n $filePath = $basePath . '/' . $filename;\r\n\r\n\r\n if(!isset($userId) || !isset($trackingId)) {\r\n throw new Exception(\"Unable to delete file \" . $filePath . \". Missing tracking form information.\");\r\n }\r\n\r\n\r\n $basePath = FILEPATH . $userId. '/' . $trackingId;\r\n $filePath = $basePath . '/' . $filename;\r\n\r\n $filePath = realpath($filePath);\r\n if(is_readable($filePath)){\r\n unlink($filePath);\r\n $sql = \"DELETE FROM `forms_tracking_files` WHERE `name` = '\" . $filename . \"' AND `trackingId` = \" . $trackingId;\r\n $db->Execute($sql);\r\n }\r\n\r\n $this->loadFilesFromDir($basePath); // refresh what files are associated with this trackingform\r\n }", "function deleteFile($uuid) {\r\n $sql = '\r\n DELETE FROM\r\n files\r\n WHERE\r\n uuid = ?\r\n ';\r\n\r\n return $this->query_exec($sql, array($uuid));\r\n }", "function wp_delete_attachment_files($post_id, $meta, $backup_sizes, $file)\n {\n }", "public function deleteFile($adapter)\n {\n }", "public function destroy(Request $request)\n {\n\n $delete = invoice_attachments::find($request->id);\n if ($delete->delete()) {\n Storage::disk('file_invoices')->delete($request->invoice_number.'/'.$request->file_name);\n Session::flash('message', 'تم حذف المرفق بنجاح.');\n return back();\n } else {\n Session::flash('message', ' لم يتم الحذف ');\n }\n }", "public function file_delete($filename);", "public function delete(User $user, Attachment $attachment)\n {\n return $attachment->user_id === $user->id;\n }", "public function destroy($invoice_id,$file_id)\n {\n $Attachment = Attachment::findOrFail($file_id);\n\n $file = $Attachment->invoice_number.'/'.$Attachment->file_name;\n\n // file system storage public_upload\n if(Storage::disk(\"public_uploads\")->exists($file)){\n Storage::disk('public_uploads')->delete($file);\n }\n\n $Attachment->delete();\n\n request()->session()->flash('msgSuccess', 'تم حذف المرفق بنجاح');\n return back();\n }", "protected function getAttachment_DeleteService()\n {\n $a = ${($_ = isset($this->services['dbal.conn']) ? $this->services['dbal.conn'] : ($this->services['dbal.conn'] = new \\phpbb\\db\\driver\\factory($this))) && false ?: '_'};\n\n return new \\phpbb\\attachment\\delete(${($_ = isset($this->services['config']) ? $this->services['config'] : $this->getConfigService()) && false ?: '_'}, $a, ${($_ = isset($this->services['dispatcher']) ? $this->services['dispatcher'] : $this->getDispatcherService()) && false ?: '_'}, ${($_ = isset($this->services['filesystem']) ? $this->services['filesystem'] : ($this->services['filesystem'] = new \\phpbb\\filesystem\\filesystem())) && false ?: '_'}, new \\phpbb\\attachment\\resync($a), './../');\n }", "public function clearAttachments()\n {\n }", "protected function cleanup() {\n\t\tif(isset($this->data['attachment'])) {\n\t\t\tunlink($this->data['attachment']);\n\t\t}\n\t\tparent::cleanup();\n\t}", "public function delete_attachment_data( $post_id ) {\n\t\t$site_logo_id = get_theme_mod( 'site_logo' );\n\n\t\tif ( $site_logo_id && $site_logo_id == $post_id ) {\n\t\t\tremove_theme_mod( 'site_logo' );\n\t\t}\n\t}", "public function delete_gallery_item() {\n\t\n\t\t\t// Delete attachment\n\t\t\twp_delete_attachment( intval( $_POST[ 'attachment_id' ] ) );\n\t\n\t\t\t// Return the updated gallery\n\t\t\t$this->draw_gallery_items( intval( $_POST[ 'gallery_id' ] ) );\n\t\n\t\t\texit;\n\t\t}", "public static function delete_local_files(){\n $attachments = new \\CFCDN_Attachments();\n $attachments->delete_local_files();\n }", "public function essLeaveDeleteAttachmentRequest($leave_request_id, $employee_id, string $contentType = self::contentTypes['essLeaveDeleteAttachment'][0])\n {\n\n // verify the required parameter 'leave_request_id' is set\n if ($leave_request_id === null || (is_array($leave_request_id) && count($leave_request_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $leave_request_id when calling essLeaveDeleteAttachment'\n );\n }\n\n // verify the required parameter 'employee_id' is set\n if ($employee_id === null || (is_array($employee_id) && count($employee_id) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $employee_id when calling essLeaveDeleteAttachment'\n );\n }\n\n\n $resourcePath = '/api/v2/ess/{employeeId}/leave/{leaveRequestId}/attachment';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($leave_request_id !== null) {\n $resourcePath = str_replace(\n '{' . 'leaveRequestId' . '}',\n ObjectSerializer::toPathValue($leave_request_id),\n $resourcePath\n );\n }\n // path params\n if ($employee_id !== null) {\n $resourcePath = str_replace(\n '{' . 'employeeId' . '}',\n ObjectSerializer::toPathValue($employee_id),\n $resourcePath\n );\n }\n\n\n $headers = $this->headerSelector->selectHeaders(\n [],\n $contentType,\n $multipart\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 (stripos($headers['Content-Type'], 'application/json') !== false) {\n # if Content-Type contains \"application/json\", json_encode the form parameters\n $httpBody = \\GuzzleHttp\\Utils::jsonEncode($formParams);\n } else {\n // for HTTP post (form)\n $httpBody = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires API key authentication\n $apiKey = $this->config->getApiKeyWithPrefix('apiKey');\n if ($apiKey !== null) {\n $headers['apiKey'] = $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 $operationHost = $this->config->getHost();\n $query = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'DELETE',\n $operationHost . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }" ]
[ "0.75928193", "0.7019951", "0.6882661", "0.6874216", "0.6844878", "0.6837348", "0.6559351", "0.64923155", "0.639589", "0.6385387", "0.63666534", "0.6289987", "0.6250941", "0.62203264", "0.61278385", "0.60949725", "0.608382", "0.6060837", "0.59632385", "0.59626645", "0.58990407", "0.58838356", "0.579686", "0.5755157", "0.57371104", "0.55870247", "0.5586511", "0.55563265", "0.5520093", "0.5515026", "0.54873693", "0.54425603", "0.5390527", "0.5371456", "0.5361661", "0.5354663", "0.52994055", "0.52891916", "0.5286162", "0.51911896", "0.5187801", "0.51742774", "0.5173104", "0.51428586", "0.5136399", "0.51243174", "0.5107069", "0.5102507", "0.5097026", "0.5093136", "0.50894976", "0.50812393", "0.5079119", "0.5029168", "0.5024399", "0.5022386", "0.4980629", "0.4960247", "0.4939782", "0.4898564", "0.48924643", "0.4886608", "0.48858103", "0.48751602", "0.48730198", "0.48625502", "0.48458278", "0.4843869", "0.48347616", "0.48050377", "0.4786987", "0.47687888", "0.47569174", "0.47536984", "0.4748432", "0.47347838", "0.47307268", "0.47255602", "0.4719702", "0.47158283", "0.47096172", "0.47065037", "0.46954688", "0.46862623", "0.46826246", "0.46804494", "0.4678165", "0.46775717", "0.46623084", "0.46602654", "0.46582344", "0.46491042", "0.46438083", "0.46349174", "0.46217793", "0.46211648", "0.46141294", "0.46076968", "0.4605062", "0.4597936" ]
0.70749915
1
Returns the attachments for the specified beacon that match the specified namespacedtype pattern. To control which namespaced types are returned, you add the `namespacedType` query parameter to the request. You must either use ``, to return all attachments, or the namespace must be one of the ones returned from the `namespaces` endpoint. Authenticate using an [OAuth access token]( from a signedin user with viewer, Is owner or Can edit permissions in the Google Developers Console project. (attachments.listBeaconsAttachments)
public function listBeaconsAttachments($beaconName, $optParams = array()) { $params = array('beaconName' => $beaconName); $params = array_merge($params, $optParams); return $this->call('list', array($params), "Google_Service_Proximitybeacon_ListBeaconAttachmentsResponse"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAttachmentsList() {\n return $this->_get(10);\n }", "public function getAttachmentsList() {\n return $this->_get(20);\n }", "public function getAttachments();", "public function getAttachments();", "public function getAttachmentsList() {\n return $this->_get(14);\n }", "public function getNoticeAttachments($notice_id, $mdb_control)\n\t{\n\t\t$attachment_list = array();\n\t\t$controller = $mdb_control->getController(\"notice_attachment\");\n\t\t$attachment_list = $controller->getByAttribute(\"notice_id\", $notice_id);\n\t\t\n\t\treturn $attachment_list;\n\t}", "public function batchDelete($beaconName, $optParams = array())\n {\n $params = array('beaconName' => $beaconName);\n $params = array_merge($params, $optParams);\n return $this->call('batchDelete', array($params), \"Google_Service_Proximitybeacon_DeleteAttachmentsResponse\");\n }", "public function listAttachmentByBill(AccessToken $token, $id, $requestBodyParameters = [])\n\t{\n\t\treturn $this->executeAndParse(self::METHOD_GET, \"{$this->getBaseApiUrl()}/bills/{$id}/attachments\", $token, $requestBodyParameters);\n\t}", "protected function _shortcode_get_attachments( $atts ) {\n\t\t$attachments = array();\n\n\t\tif ( ! empty( $atts['include'] ) ) :\n\t\t\t$_attachments = get_posts( array(\n\t\t\t\t'include' => $atts['include'],\n\t\t\t\t'post_status' => 'inherit',\n\t\t\t\t'post_type' => 'attachment',\n\t\t\t\t'post_mime_type' => 'image',\n\t\t\t\t'order' => $atts['order'],\n\t\t\t\t'orderby' => $atts['orderby']\n\t\t\t) );\n\n\t\t\tforeach ( $_attachments as $key => $val )\n\t\t\t\t$attachments[$val->ID] = $_attachments[$key];\n\n\t\telseif ( ! empty( $atts['exclude'] ) ) :\n\t\t\t$attachments = get_children( array(\n\t\t\t\t'post_parent' => $atts['id'],\n\t\t\t\t'exclude' => $atts['exclude'],\n\t\t\t\t'post_status' => 'inherit',\n\t\t\t\t'post_type' => 'attachment',\n\t\t\t\t'post_mime_type' => 'image',\n\t\t\t\t'order' => $atts['order'],\n\t\t\t\t'orderby' => $atts['orderby']\n\t\t\t) );\n\n\t\telse :\n\t\t\t$attachments = get_children( array(\n\t\t\t\t'post_parent' => $atts['id'],\n\t\t\t\t'post_status' => 'inherit',\n\t\t\t\t'post_type' => 'attachment',\n\t\t\t\t'post_mime_type' => 'image',\n\t\t\t\t'order' => $atts['order'],\n\t\t\t\t'orderby' => $atts['orderby']\n\t\t\t) );\n\t\tendif;\n\n\t\treturn $attachments;\n\t}", "public function getAttachments(): array;", "abstract protected function _attachmentsList();", "function attachmentsCreateExample($service, $beaconName, $optParams)\n{\n\ttry\n\t{\n\t\t// Parameter validation.\n\t\tif ($service == null)\n\t\t\tthrow new Exception(\"service is required.\");\n\t\tif ($optParams == null)\n\t\t\tthrow new Exception(\"optParams is required.\");\n\t\tif (beaconName == null)\n\t\t\tthrow new Exception(\"beaconName is required.\");\n\t\t// Make the request and return the results.\n\t\treturn $service->attachments->CreateAttachments($beaconName, $optParams);\n\t}\n\tcatch (Exception $e)\n\t{\n\t\tprint \"An error occurred: \" . $e->getMessage();\n\t}\n}", "public function getAttachments()\n\t{\n\t\t$app = Factory::getApplication();\n\t\t$data = $app->input->post->get('jform', array(), 'array');\n\t\t$files = $app->input->files->get('jform');\n\t\t$allowed_extensions = ComponentHelper::getParams('com_tkdclub')->get('allowed_extensions', 'pdf');\n\t\t$allowed_extensions_array = explode(',', $allowed_extensions);\n\n\t\t$attachments = array();\n\t\t$paths = array();\n\t\t$filenames = array();\n\n\t\tforeach($files as $file)\n\t\t{\n\t\t\tif($file['name'] != '' && $file['error'] == (int) 0)\n\t\t\t{\t\n\t\t\t\t// Check for right file extension\n\t\t\t\tif(!in_array(File::getExt($file['name']), $allowed_extensions_array))\n\t\t\t\t{\n\t\t\t\t\t$app->enqueueMessage(Text::_('COM_TKDCLUB_EMAIL_ATTACHMENT_NOT_ALLOWED') . $allowed_extensions, 'error');\n\t\t\t\t\t$app->setUserState('com_tkdclub.email.data', $data);\n\t\t\t\t\t\n\t\t\t\t\treturn false;\t\n\t\t\t\t}\n\n\t\t\t\t$paths[] = $file['tmp_name'];\n\t\t\t\t$filenames[] = $file['name'];\n\t\t\t}\n\t\t}\n\n\t\tif(empty($paths))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$attachments['paths'] = $paths;\n\t\t$attachments['filenames'] = $filenames;\n\n\t\treturn $attachments;\n\t}", "private function getAttachementFiles(array $attachments = [])\n {\n $files = [];\n if (empty($attachments)) {\n return $files;\n }\n foreach ($attachments as $key => $attachment) {\n if (!ine($attachment, 'type') || !ine($attachment, 'value')) {\n throw new InvalideAttachment(\"Email sending fails. Invalid Attachment.\");\n }\n $files[] = $this->getFile($attachment['type'], $attachment['value']);\n }\n return $files;\n }", "public function getAttachments(): array\n {\n return $this->attachments;\n }", "public function getAttachments(): array\n {\n return $this->attachments;\n }", "public function listAttachmentByPiggyBank(AccessToken $token, $id, $requestBodyParameters = [])\n\t{\n\t\treturn $this->executeAndParse(self::METHOD_GET, \"{$this->getBaseApiUrl()}/piggy_banks/{$id}/attachments\", $token, $requestBodyParameters);\n\t}", "public function getCustomerNotificationAttachments(): array;", "private function retrieveAttachmentInformation() : array {\n $quarantineEmailAttachmentsParser = new QuarantineEmailAttachmentsParser();\n return $quarantineEmailAttachmentsParser->parse($this->currentEmail);\n }", "public function listTimelineAttachments($itemId, $optParams = array())\n {\n $params = array('itemId' => $itemId);\n $params = array_merge($params, $optParams);\n return $this->call('list', array($params), 'Google\\Service\\Mirror\\AttachmentsListResponse');\n }", "public function getAttachments()\n {\n $attachments = array();\n\n /** @var MailMessage $attachment */\n foreach ($this as $attachment) {\n $headers = $attachment->headers;\n\n $ct = $headers->get('Content-Type');\n // attempt to extract filename\n // 1. try Content-Type: name parameter\n // 2. try Content-Disposition: filename parameter\n // 3. as last resort use Untitled with extension from mime-type subpart\n /** @var ContentType $ct */\n $filename = $ct->getParameter('name')\n ?: $attachment->getHeaderField('Content-Disposition', 'filename')\n ?: ev_gettext('Untitled.%s', end(explode('/', $ct->getType())));\n\n // get body.\n // have to decode ourselves or use something like Mime\\Message::createFromMessage\n $body = $attachment->getContent();\n /** @var ContentTransferEncoding $cte */\n $cte = $headers->get('Content-Transfer-Encoding');\n switch ($cte->getTransferEncoding()) {\n case 'quoted-printable':\n $body = quoted_printable_decode($body);\n break;\n case 'base64':\n $body = base64_decode($body);\n break;\n case '7bit':\n case '8bit':\n case 'binary':\n // these need no transformation\n break;\n default:\n throw new LogicException(\"Unsupported Content-Transfer-Encoding: '{$cte->getTransferEncoding()}'\");\n }\n\n $attachments[] = array(\n 'filename' => $filename,\n 'cid' => $headers->get('Content-Id')->getFieldValue(),\n 'filetype' => $ct->getType(),\n 'blob' => $body,\n );\n }\n\n return $attachments;\n }", "public static function getAttachmentsArray()\n {\n return Attachment::$attachmentsArray;\n }", "public function getAttachments()\n {\n }", "protected function renderAttachments($content)\r\n\t{\r\n\t\t$matches = array();\r\n\t\tpreg_match_all($this->_patterns['file'], $content, $matches);\r\n\r\n\t\t$pairs = array();\r\n\t\tforeach ($matches[1] as $index => $id)\r\n\t\t{\r\n\t\t\t/** @var CmsAttachment $attachment */\r\n\t\t\t$attachment = CmsAttachment::model()->findByPk($id);\r\n\t\t\tif ($attachment instanceof CmsAttachment)\r\n\t\t\t{\r\n\t\t\t\t// Use custom name if specified. The first letter must be trimmed\r\n\t\t\t\tif (!empty($matches[2][$index]))\r\n\t\t\t\t{\r\n\t\t\t\t\t// TODO: fix 'file' pattern so the colon isn't included\r\n\t\t\t\t\t$name = $matches[2][$index];\r\n\t\t\t\t\t$name = substr($name, 1, strlen($name) - 1);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t$name = $attachment->resolveName();\r\n\t\t\t\r\n\t\t\t\t$url = $attachment->getUrl();\r\n\t\t\t\t$pairs[$matches[0][$index]] = CHtml::link($name, $url);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!empty($pairs))\r\n\t\t\t$content = strtr($content, $pairs);\r\n\r\n\t\treturn $content;\r\n\t}", "public function find_message_attachments($struct, $skip_ids=array(), $attachments=array()) {\n\t\tif (!is_array($struct) || empty($struct)) {\n\t\t\treturn $attachments;\n\t\t}\n\n\t\tforeach ($struct as $id => $vals) {\n\t\t\t//if(!is_array($vals) || in_array($id, $skip_ids))\n\t\t\tif(!is_array($vals))\n\t\t\t\tcontinue;\n//var_dump($vals);\n\t\t\t// Strict must be true as 2.1 == 2.10 if false\n\t\t\tif(isset($vals['type']) && !in_array($id, $skip_ids, true)){\n\t\t\t\t$vals['number'] = $id;\n\n\t\t\t\t//sometimes NIL is returned from Dovecot?!?\n\t\t\t\tif($vals['id']=='NIL')\n\t\t\t\t\t$vals['id']='';\n\n\t\t\t\t$attachments[]=$vals;\n\t\t\t}elseif(isset($vals['subs'])) {\n\t\t\t\t$attachments = $this->find_message_attachments($vals['subs'],$skip_ids,\t$attachments);\n\t\t\t}\n\t\t}\n\t\treturn $attachments;\n\t}", "public function getAttachments() {\n\t\treturn $this->attachments;\n\t}", "public function getAttachedFiles()\n\t{\n\t\t$this->loadMailAttachment();\n\n\t\treturn $this->m_attachedFiles;\n\t}", "public function attachments()\n {\n return $this->morphMany(Attachment::class, 'model')->AttachmentType();\n }", "public function &getAttachments(): array {\n return $this->attachments;\n }", "public function getAttachments()\n {\n return $this->attachment;\n }", "public function getAttachments($field = null, $data = null, $attachmentKey = 'Attachment') {\n\t\tif ($data === null)\n\t\t\t$data = $this->data;\n\n\t\tif (!isset($data[$attachmentKey]) || ($field && !isset($data[$attachmentKey][$field])))\n\t\t\treturn array();\n\n\t\tif ($field)\n\t\t\treturn $data[$attachmentKey][$field];\n\n\t\treturn $data[$attachmentKey];\n\n\t}", "public function getFiles()\n {\n $files = [];\n if($attachmentData = $this->setAttachmentData()){\n $files['attachment'] = $this->setAttachmentData();\n }\n return $files;\n }", "public function setAttachments(array $attachments = []);", "public function testComDayCqWcmFoundationSecurityImplDefaultAttachmentTypeBlacklist()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.day.cq.wcm.foundation.security.impl.DefaultAttachmentTypeBlacklistService';\n\n $crawler = $client->request('POST', $path);\n }", "protected function attachmentsFromMessageBody(Message $body)\n {\n $attachments = [];\n /** @var \\Zend\\Mime\\Part $part */\n foreach ($body->getParts() as $part) {\n\n if (!isset($part->filename)) {\n continue;\n }\n\n $attachments[] = [\n 'content' => $part->getContent(),\n 'type' => $part->type,\n 'name' => $part->filename,\n ];\n }\n return $attachments;\n\n }", "public function getAllBreaches($domain = null)\n {\n $options = [];\n if (is_string($domain)) {\n $options['domain'] = $domain;\n }\n\n return $this->decodeResponse(\n $this->getResponse(['breaches'], $options)\n );\n }", "public function get($itemId, $attachmentId, $optParams = array())\n {\n $params = array('itemId' => $itemId, 'attachmentId' => $attachmentId);\n $params = array_merge($params, $optParams);\n return $this->call('get', array($params), 'Google\\Service\\Mirror\\Attachment');\n }", "public function getAttachments($type, $parentId)\n {\n $args = array(\n 'post_parent' => $parentId,\n 'post_type' => 'attachment',\n 'post_status' => 'any',\n 'posts_per_page' => -1,\n 'post_mime_type' => $type,\n );\n\n $query = new Query($args);\n $attachment_ids = array();\n\n if ($query->havePosts()) {\n while ($query->havePosts()) {\n $query->thePost();\n $attachment_ids[] = get_the_ID();\n }\n $query->clear();\n }\n\n return $this->attachments = $attachment_ids;\n }", "public function retrieveAttachments($id)\n {\n try\n {\n $attachments = new Collection();\n //init the catching\n $this->exceptionThrower->start();\n $structure = imap_fetchstructure($this->mailbox, $id);\n if(property_exists($structure,'parts'))\n {\n foreach ($structure->parts as $key => $value) {\n $encoding = $structure->parts[ $key ]->encoding;\n if ($structure->parts[ $key ]->ifdparameters) {\n $param_merge = array_merge(\n $structure->parts[ $key ]->dparameters,\n $structure->parts[ $key ]->parameters\n );\n foreach ($param_merge as $param) {\n if (\n $param->attribute == 'FILENAME' ||\n $param->attribute == 'NAME'\n ) {\n $name = $param->value;\n break;\n }\n }\n\n $message = imap_fetchbody($this->mailbox, $id, $key + 1);\n if ($encoding == 0) {\n $message = imap_8bit($message);\n }\n if ($encoding == 1) {\n $message = imap_8bit($message);\n }\n if ($encoding == 2) {\n $message = imap_binary($message);\n }\n if ($encoding == 3) {\n $message = imap_base64($message);\n }\n if ($encoding == 4) {\n $message = quoted_printable_decode($message);\n }\n $this->exceptionThrower->stop();\n $name_ext = pathinfo($name);\n $attachment = new Attachment($name_ext[ 'filename' ], $message, $name_ext[ 'extension' ], sizeof($message));\n $attachments->add($attachment);\n }\n }\n }\n return $attachments;\n }catch (\\Exception $e)\n {\n throw new SimpleMailReceiverException(\"Error retrieving attachments no: \". $id . \" .\" . $e->getMessage(), $e->getCode());\n }\n }", "function get_attachments($content, $part = null, $skip_parts = false) {\r\n\tstatic $results;\r\n \r\n\t// First round, emptying results\r\n\tif (is_null($part)) {\r\n\t\t$results = array();\r\n\t}\r\n\telse {\r\n\t\t// Removing first dot (.)\r\n\t\tif (substr($part, 0, 1) == '.') {\r\n\t\t\t$part = substr($part, 1);\r\n\t\t}\r\n\t}\r\n \r\n\t// Saving the current part\r\n\t$actualpart = $part;\r\n\t// Split on the \".\"\r\n\t$split = explode('.', $actualpart);\r\n \r\n\t// Skipping parts\r\n\tif (is_array($skip_parts)) {\r\n\t\tforeach ($skip_parts as $p) {\r\n\t\t\t// Removing a row off the array\r\n\t\t\tarray_splice($split, $p, 1);\r\n\t\t}\r\n\t\t// Rebuilding part string\r\n\t\t$actualpart = implode('.', $split);\r\n\t}\r\n \r\n\t// Each time we get the RFC822 subtype, we skip this part.\r\n\tif (strtolower($content->subtype) == 'rfc822') {\r\n\t\t// Never used before, initializing\r\n\t\tif (!is_array($skip_parts)) {\r\n\t\t\t$skip_parts = array();\r\n\t\t}\r\n\t\t// Adding this part into the skip list\r\n\t\tarray_push($skip_parts, count($split));\r\n\t}\r\n \r\n\t// Checking ifdparameters\r\n\tif (isset($content->ifdparameters) && $content->ifdparameters == 1 && isset($content->dparameters) && is_array($content->dparameters)) {\r\n\t\tforeach ($content->dparameters as $object) {\r\n\t\t\tif (isset($object->attribute) && preg_match('~filename~i', $object->attribute)) {\r\n\t\t\t\t$results[] = array(\r\n\t\t\t\t'type' => (isset($content->subtype)) ? $content->subtype : '',\r\n\t\t\t\t'encoding' => $content->encoding,\r\n\t\t\t\t'part' => empty($actualpart) ? 1 : $actualpart,\r\n\t\t\t\t'filename' => $object->value\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Checking ifparameters\r\n\telse if (isset($content->ifparameters) && $content->ifparameters == 1 && isset($content->parameters) && is_array($content->parameters)) {\r\n\t\tforeach ($content->parameters as $object) {\r\n\t\t\tif (isset($object->attribute) && preg_match('~name~i', $object->attribute)) {\r\n\t\t\t\t$results[] = array(\r\n\t\t\t\t'type' => (isset($content->subtype)) ? $content->subtype : '',\r\n\t\t\t\t'encoding' => $content->encoding,\r\n\t\t\t\t'part' => empty($actualpart) ? 1 : $actualpart,\r\n\t\t\t\t'filename' => $object->value\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\t// Recursivity\r\n\tif (isset($content->parts) && count($content->parts) > 0) {\r\n\t// Other parts into content\r\n\t\tforeach ($content->parts as $key => $parts) {\r\n\t\t\tget_attachments($parts, ($part.'.'.($key + 1)), $skip_parts);\r\n\t\t}\r\n\t}\r\n\treturn $results;\r\n}", "public function getAttachments(): Collection\n {\n return $this->attachments;\n }", "public function files($object)\n {\n if( !is_object($object) )\n {\n throw new Exception(\"Can't retrieve the attachments of a \".get_type($object));\n }\n \n $class = new ReflectionClass($object);\n $files = array();\n foreach( $this->reader->getClassAnnotations($class) as $annotation)\n {\n if(!($annotation instanceof FileAttachment)) continue;\n \n $file = new File($annotation,$object,$this);\n $files[$file->getName()] = $file;\n }\n \n return $files;\n }", "public function list(array $parameters): ListResponse\n {\n $payload = Payload::list('attachments', $parameters);\n\n /** @var array{object: string, data: array<int, array{id: string, object: string, created_at: int, bytes: int, filename: string, purpose: string, status: string, status_details: array<array-key, mixed>|string|null}>} $result */\n $result = $this->transporter->requestObject($payload);\n\n return ListResponse::from($result);\n }", "public function loadMessageAttachments($msgId)\n {\n\n $db = $this->getDb();\n\n $sql = <<<SQL\n\nselect\n file.rowid as file_id,\n file.name as file_name,\n\tattach.rowid as attach_id\nFROM\n buiz_file file\n\nJOIN\n\tbuiz_entity_attachment attach\n\t\tON attach.id_file = file.rowid\n\nWHERE\n attach.vid = {$msgId};\n\nSQL;\n\n //$references = $db->select($sql)->getAll();\n\n return $db->select($sql);\n\n }", "public function extract_uuencoded_attachments(&$body)\n\t{\n\t\t$body = str_replace(\"\\r\", '', $body);\n\t\t$regex = \"/(begin ([0-7]{3}) (.+))\\n(.+)\\nend/Us\";\n\n\t\tpreg_match_all($regex, $body, $matches);\n\n\t\t$attachments = array();\n\n\t\tfor ($i = 0; $i < count($matches[3]); $i++) {\n\t\t\t\t$boundary\t= $matches[1][$i];\n\t\t\t\t$fileperm\t= $matches[2][$i];\n\t\t\t\t$filename\t= $matches[3][$i];\n\n\t\t\t\t$size = strlen($matches[4][$i]);\n\n\t\t\t\t$mime = File::get_mime($matches[3][$i]);\n\t\t\t\t$ct = explode('/', $mime);\n\t\t\t\t$attachments[]=array(\n\t\t\t\t\t'boundary'=>$matches[1][$i],\n\t\t\t\t\t'permissions'=>$matches[2][$i],\n\t\t\t\t\t'name'=>$matches[3][$i],\n\t\t\t\t\t'data'=>$matches[4][$i],\n\t\t\t\t\t'disposition'=>'ATTACHMENT',\n\t\t\t\t\t'encoding'=>'',\n\t\t\t\t\t'type'=>$ct[0],\n\t\t\t\t\t'subtype'=>$ct[1],\n\t\t\t\t\t'size'=>$size,\n\t\t\t\t\t'human_size'=>Number::format_size($size)\n\t\t\t\t);\n\t\t}\n\n //remove it from the body.\n $body = preg_replace($regex, \"\", $body);\n //\\GO::debug($body);\n\n\t\treturn $attachments;\n\t}", "public function listattachments() {\n\t\t//Attachmentsmodel\n\t\t$this->load->model('Attachmentsmodel');\n\t\t\n\t\t//Return result to jTable\n\t\t$jTableResult = array();\n\t\t$jTableResult['Result'] = \"OK\";\n\t\t$jTableResult['TotalRecordCount'] = $this->Attachmentsmodel->countAll($this->userID);\n\t\t$jTableResult['Records'] = $this->Attachmentsmodel->ListAllByUser($this->userID,$this->input->get('jtSorting', TRUE), $this->input->get('jtPageSize', TRUE), $this->input->get('jtStartIndex', TRUE));\n\t\tprint json_encode($jTableResult);\n\t}", "public function addAttachments(\\obiba\\mica\\AttachmentDto $value) {\n return $this->_add(14, $value);\n }", "public function column_attachments( $request ) {\n\t\t$attachments = get_children( array( 'post_parent' => $request->ID ) );\n\t\t$attachments = array_map( 'wp_get_attachment_url', wp_list_pluck( $attachments, 'ID' ) );\n\n\t\t$output = array();\n\t\tforeach ( $attachments as $attachment ) {\n\t\t\t$output[] = sprintf( '<a href=\"%s\" target=\"_blank\" class=\"dashicons dashicons-media-default\" title=\"%s\"></a>',\n\t\t\t\tesc_url( $attachment ), esc_attr( $attachment ) );\n\t\t}\n\n\t\treturn implode( '', $output );\n\t}", "public function attachments() {\n return $this->hasMany(Attachment::class);\n }", "public function actionIndex()\n {\n $searchModel = new EntityAttachmentSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'model' => $this->retrieveModel(),\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function get_attached_content_object_ids($type = self :: ATTACHMENT_NORMAL)\n {\n if (!is_array($this->attachment_ids[$type]))\n {\n $conditions = array();\n $conditions[] = new EqualityCondition(\n new PropertyConditionVariable(\n ContentObjectAttachment::class_name(),\n ContentObjectAttachment::PROPERTY_CONTENT_OBJECT_ID\n ),\n new StaticConditionVariable($this->get_id())\n );\n if ($type != self::ATTACHMENT_ALL)\n {\n $conditions[] = new EqualityCondition(\n new PropertyConditionVariable(\n ContentObjectAttachment::class_name(),\n ContentObjectAttachment::PROPERTY_TYPE\n ),\n new StaticConditionVariable($type)\n );\n }\n $condition = new AndCondition($conditions);\n\n $parameters = new DataClassDistinctParameters(\n $condition,\n new DataClassProperties(\n array(\n new PropertyConditionVariable(\n ContentObjectAttachment::class,\n ContentObjectAttachment::PROPERTY_ATTACHMENT_ID\n )\n )\n )\n );\n $this->attachment_ids[$type] = DataManager::distinct(ContentObjectAttachment::class_name(), $parameters);\n }\n\n return $this->attachment_ids[$type];\n }", "function get_campaign_attachments( $post_ids ) {\n\n\tglobal $wpdb;\n\n\tif ( empty( $post_ids ) ) {\n\t\treturn [];\n\t}\n\n\t$sql = '\n\t\tSELECT id\n\t\tFROM %1$s\n\t\tWHERE post_type = \\'attachment\\'\n\t\tAND post_parent IN (' . generate_list_placeholders( $post_ids, 2 ) . ')';\n\n\t$prepared_sql = $wpdb->prepare(\n\t\t$sql, // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\t\tarray_merge( [ $wpdb->posts ], $post_ids )\n\t);\n\t$results = $wpdb->get_results( $prepared_sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\t$attachment_ids = array_map(\n\t\tfunction ( $result ) {\n\t\t\treturn $result->id;\n\t\t},\n\t\t$results\n\t);\n\n\t/**\n\t * Post thumbnails\n\t */\n\t$sql = '\n\t\tSELECT meta_value\n\t\tFROM %1$s\n\t\tWHERE ( meta_key = \\'_thumbnail_id\\' OR meta_key = \\'background_image_id\\' )\n\t\tAND post_id IN(' . generate_list_placeholders( $post_ids, 2 ) . ')';\n\n\t$prepared_sql = $wpdb->prepare(\n\t\t$sql, // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\t\tarray_merge( [ $wpdb->postmeta ], $post_ids )\n\t);\n\t$results = $wpdb->get_results( $prepared_sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\n\t$attachment_ids = array_merge(\n\t\t$attachment_ids,\n\t\tarray_map(\n\t\t\tfunction ( $result ) {\n\t\t\t\treturn $result->meta_value;\n\t\t\t},\n\t\t\t$results\n\t\t)\n\t);\n\n\t$sql = '\n\t\t\tSELECT post_content\n\t\t\tFROM %1$s\n\t\t\tWHERE ID IN(' . generate_list_placeholders( $post_ids, 2 ) . ')\n\t\t\tAND post_content REGEXP \\'((wp-image-|wp-att-)[0-9][0-9]*)|gallery_block_style|wp\\:planet4\\-blocks|href=|src=\\'';\n\n\t$prepared_sql = $wpdb->prepare( $sql, array_merge( [ $wpdb->posts ], $post_ids ) ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\t$results = $wpdb->get_results( $prepared_sql ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared\n\n\tforeach ( (array) $results as $text ) {\n\t\t$text = $text->post_content;\n\t\t$attachment_ids = array_merge( $attachment_ids, get_attachments_used_in_content( $text ) );\n\t}\n\n\t$attachment_ids = array_unique( $attachment_ids );\n\tsort( $attachment_ids );\n\n\t// The post ids are reordered as sort all attachment ids first and then append the post id to array.(Added for simplification of import process).\n\t$attachment_ids = array_diff( $attachment_ids, $post_ids );\n\t$post_ids = array_merge( $attachment_ids, $post_ids );\n\n\treturn $post_ids;\n}", "function get_attachments( $post_id = null, $custom_query_args = array(), $only_images = true, $allowed_file_types = array() ) {\n\t\tif ( is_null( $post_id ) ) {\n\t\t\tglobal $post;\n\t\t\t$post_id = $post->ID;\n\t\t} // if()\n\n\t\t$default_query_args = array(\n\t\t\t'post_type' => 'attachment',\n\t\t\t'post_status' => 'inherit',\n\t\t\t'post_parent' => $post_id,\n\t\t\t'order' => 'DESC',\n\t\t\t'orderby' => 'menu_order',\n\t\t);\n\t\t$query_args = array_merge( $default_query_args, $custom_query_args );\n\t\t$attachments = $this->get_posts( $query_args );\n\n\t\t// Removes all attachments that are not an image\n\t\tif ( $only_images ) {\n\t\t\tforeach ( $attachments as $key => $attachment ) {\n\t\t\t\tif ( ! wp_attachment_is_image( $attachment->ID ) ) {\n\t\t\t\t\tunset( $attachments[$key] );\n\t\t\t\t} // if()\n\t\t\t} // foreach()\n\t\t} // if()\n\n\t\t// Removes all attachments that not allowed file types\n\t\tif ( ! empty( $allowed_file_types ) ) {\n\t\t\tforeach ( $attachments as $key => $attachment ) {\n\t\t\t\t$pathinfo = pathinfo( wp_get_attachment_url( $attachment->ID ) );\n\t\t\t\textract( $pathinfo );\n\t\t\t\tif ( ! in_array( $extension, $allowed_file_types ) ) {\n\t\t\t\t\tunset( $attachments[$key] );\n\t\t\t\t} // if()\n\t\t\t} // foreach()\n\t\t} // if()\n\n\t\treturn $attachments;\n\t}", "function get_attachments_used_in_content( string $content ): array {\n\t$blocks = parse_blocks( $content );\n\n\t$attachment_ids = [];\n\n\tforeach ( $blocks as $block ) {\n\t\t// Fetch the attachement id/s from block fields.\n\t\tswitch ( $block['blockName'] ) {\n\t\t\tcase 'planet4-blocks/enform':\n\t\t\t\t$attachment_ids[] = $block['attrs']['background'] ?? '';\n\t\t\t\tbreak;\n\n\t\t\tcase 'core/image':\n\t\t\tcase 'planet4-blocks/happypoint':\n\t\t\t\t$attachment_ids[] = $block['attrs']['id'] ?? '';\n\t\t\t\tbreak;\n\n\t\t\tcase 'planet4-blocks/media-video':\n\t\t\t\t$attachment_ids[] = $block['attrs']['video_poster_img'] ?? '';\n\t\t\t\tbreak;\n\n\t\t\tcase 'planet4-blocks/gallery':\n\t\t\t\tif ( isset( $block['attrs']['multiple_image'] ) ) {\n\t\t\t\t\t$multiple_images = explode( ',', $block['attrs']['multiple_image'] );\n\t\t\t\t\t$attachment_ids = array_merge( $attachment_ids, $multiple_images );\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'planet4-blocks/carousel-header':\n\t\t\t\tif ( isset( $block['attrs']['slides'] ) ) {\n\t\t\t\t\tforeach ( $block['attrs']['slides'] as $slide ) {\n\t\t\t\t\t\t$attachment_ids[] = $slide['image'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'planet4-blocks/split-two-columns':\n\t\t\t\t$attachment_ids[] = $block['attrs']['issue_image'] ?? '';\n\t\t\t\t$attachment_ids[] = $block['attrs']['tag_image'] ?? '';\n\t\t\t\tbreak;\n\n\t\t\tcase 'planet4-blocks/columns':\n\t\t\t\tif ( isset( $block['attrs']['columns'] ) ) {\n\t\t\t\t\tforeach ( $block['attrs']['columns'] as $column ) {\n\t\t\t\t\t\t$attachment_ids[] = $column['attachment'] ?? '';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'planet4-blocks/social-media-cards':\n\t\t\t\tif ( isset( $block['attrs']['cards'] ) ) {\n\t\t\t\t\tforeach ( $block['attrs']['cards'] as $card ) {\n\t\t\t\t\t\t$attachment_ids[] = $card['image_id'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase 'planet4-blocks/take-action-boxout':\n\t\t\t\t$attachment_ids[] = $block['attrs']['background_image'] ?? '';\n\t\t\t\tbreak;\n\n\t\t}\n\t}\n\n\treturn $attachment_ids;\n}", "public function attachments()\n {\n return $this->hasMany(Attachment::class, 'mail_id', 'id');\n }", "function getFileList($attachment_id)\n {\n $attachment_id = Misc::escapeInteger($attachment_id);\n $stmt = \"SELECT\n iaf_id,\n iaf_filename,\n iaf_filesize\n FROM\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"issue_attachment_file\n WHERE\n iaf_iat_id=$attachment_id\";\n $res = DB_Helper::getInstance()->getAll($stmt, DB_FETCHMODE_ASSOC);\n if (PEAR::isError($res)) {\n Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);\n return \"\";\n }\n\n foreach ($res as &$row) {\n $row[\"iaf_filesize\"] = Misc::formatFileSize($row[\"iaf_filesize\"]);\n }\n return $res;\n }", "public function delete_attachments($contextid = 1) {\n $fs = get_file_storage();\n $fs->delete_area_files($contextid, 'mod_documents', 'attachment', $this->id);\n $fs->delete_area_files($contextid, 'mod_documents', 'picture', $this->id);\n\n }", "public function attachments()\n {\n return $this->morphMany(Attachment::class, 'attachmentable');\n }", "public function attachments()\n {\n return $this->morphMany(Attachment::class, 'attachmentable');\n }", "public function addAttachments(\\obiba\\mica\\AttachmentDto $value) {\n return $this->_add(20, $value);\n }", "public function addAttachments(\\obiba\\mica\\AttachmentDto $value) {\n return $this->_add(10, $value);\n }", "public function getAttachments()\r\n\t{\r\n\t\t$attachments = array();\r\n\t\t$dispositions = array(\"attachment\", \"inline\");\r\n\t\t$content_types = array(\r\n\t\t\t'application/octet-stream' => null,\r\n\t\t\t'application/zip' => 'zip',\r\n\t\t\t'text/calendar' => 'ics',\r\n\t\t\t'application/pdf' => 'pdf',\r\n\t\t\t'image/jpeg' => 'jpg',\r\n\t\t\t'image/gif' => 'gif',\r\n\t\t\t'image/png' => 'png',\r\n\t\t\t'image/bmp' => 'bmp',\r\n\t\t\t'video/3gpp' => '3gp',\r\n\t\t\t'audio/3gpp' => '3gp',\r\n\t\t\t'video/3gpp2' => '3g2',\r\n\t\t\t'audio/3gpp2' => '3g2',\r\n\t\t\t'video/mp4' => 'mp4',\r\n\t\t\t'audio/mp4' => 'mp4',\r\n\t\t\t'audio/wav' => 'wav',\r\n\t\t\t'audio/mpeg' => 'mp3'\r\n\t\t);\r\n\r\n\t\t$mime_encrypted = null;\r\n\t\t$mime_signed = null;\r\n\t\t// fix MS/Exchange garbling\r\n\t\t$garbled_mime_encrypt = false;\r\n\r\n\t\tforeach ($this->parts as $part_id => $part) {\r\n\r\n\t\t\t$headers = $this->getPartHeaders($part);\r\n\r\n\t\t\tif (isset($part['content-type'])) {\r\n\r\n\t\t\t\tif (isset($part['content-protocol']) && !$mime_signed && !$mime_encrypted) {\r\n\t\t\t\t\tif ($part['content-type'] === 'multipart/encrypted' && $part['content-protocol'] === 'application/pgp-encrypted') {\r\n\t\t\t\t\t\t$mime_encrypted = $part_id;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ($part['content-type'] === 'multipart/signed' && $part['content-protocol'] === 'application/pgp-signature') {\r\n\t\t\t\t\t\t$mime_signed = $part_id;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ($part['content-type'] === 'application/pgp-encrypted' && !$mime_encrypted) {\r\n\t\t\t\t $body = $this->getPartBody($part);\r\n\t\t\t\t $transferEncoding = array_key_exists('content-transfer-encoding', $headers) ? $this->pickOne($headers['content-transfer-encoding']) : '';\r\n\t\t\t\t\t$decoded_body = $this->decode($body, $transferEncoding);\r\n\r\n\t\t\t\t\tif (trim($decoded_body) === 'Version: 1') {\r\n\t\t\t\t\t\t// next part might be the pgp mime message\r\n\t\t\t\t\t\t$garbled_mime_encrypt = explode('.', $part_id);\r\n\t\t\t\t\t\t$garbled_mime_encrypt[count($garbled_mime_encrypt) - 1]++;\r\n\t\t\t\t\t\t$garbled_mime_encrypt = implode('.', $garbled_mime_encrypt);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif ($mime_encrypted || $mime_signed || $garbled_mime_encrypt) {\r\n\r\n\t\t\t\t\t$disposition = null;\r\n\r\n\t\t\t\t\t// PGP encrypted\r\n\t\t\t\t\tif ( ($mime_encrypted . '.2' === $part_id || $garbled_mime_encrypt === $part_id) &&\r\n\t\t\t\t\t\t$part['content-type'] === 'application/octet-stream') {\r\n\t\t\t\t\t\t$attachments = [];\r\n\t\t\t\t\t\t$disposition = 'pgp-encrypted';\r\n\t\t\t\t\t\t$content = $this->getAttachmentStream($part);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// PGP signed\r\n\t\t\t\t\telse if ($mime_signed . '.2' === $part_id && $part['content-type'] === 'application/pgp-signature') {\r\n\t\t\t\t\t\t$disposition = 'pgp-signature';\r\n\t\t\t\t\t\t$content = $this->getAttachmentStream($part);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ($mime_signed . '.1' === $part_id) {\r\n\t\t\t\t\t\t$disposition = 'pgp-signed';\r\n\t\t\t\t\t\t$content = $this->getStream($this->getPartRaw($part));\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ($disposition) {\r\n\t\t\t\t\t\t$attachments[] = new Attachment(\r\n\t\t\t\t\t\t\t$disposition,\r\n\t\t\t\t\t\t\t$this->getPartContentType($part),\r\n\t\t\t\t\t\t\t$content,\r\n\t\t\t\t\t\t\t$disposition,\r\n\t\t\t\t\t\t\t$headers\r\n\t\t\t\t\t\t);\r\n\r\n\t\t\t\t\t\tif ($disposition === 'pgp-encrypted') {\r\n\t\t\t\t\t\t\t// We are done, no need to parse further\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Regular attachments\r\n\t\t\t$disposition = $this->getPartContentDisposition($part);\r\n if ((in_array($disposition, $dispositions) && (isset($part['content-name']) || isset($part['name']) || isset($part['disposition-filename']))) ||\r\n (isset($part['content-type']) && array_key_exists($part['content-type'], $content_types))\r\n ) {\r\n\t\t\t\t$default_name = 'default';\r\n\t\t\t\tif ( isset($part['content-type']) && $part['content-type'] == 'text/calendar') {\r\n\t\t\t\t\t$default_name = 'calendar.ics';\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Attachment naming priority list\r\n\t\t\t\t$name = ( isset($part['disposition-filename']) ) ? $part['disposition-filename'] : '';\r\n\t\t\t\t$name = ( strlen($name) === 0 && isset($part['content-name']) ) ? $part['content-name'] : $name;\r\n\t\t\t\t$name = ( strlen($name) === 0 && isset($part['name']) ) ? $part['name'] : $name;\r\n\t\t\t\t$name = ( strlen($name) === 0 && isset($part['content-location']) ) ? $part['content-location'] : $name;\r\n\t\t\t\t// Content name\r\n\t\t\t\tif ( strlen($name) === 0 && isset($part['content-location']) ) {\r\n\t\t\t\t\t$path = parse_url($part['content-location'], PHP_URL_PATH);\r\n\t\t\t\t\tsetlocale(LC_ALL, 'en_US.utf8');\r\n\t\t\t\t\t$name = basename($path);\r\n\t\t\t\t}\r\n\t\t\t\t// Content ID\r\n\t\t\t\t$name = ( strlen($name) === 0 && isset($part['content-id']) ) ? str_replace('>','',str_replace('<','',$part['content-id'])) : $name;\r\n\t\t\t\t// Default\r\n $name = strlen($name) === 0 ? $default_name : $name;\r\n\r\n\t\t\t\t// Guess at missing disposition\r\n\t\t\t\tif (!$disposition) {\r\n\t\t\t\t\tif (isset($headers['content-id']) || isset($headers['content-location'])) {\r\n\t\t\t\t\t\t$disposition = 'inline';\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$disposition = 'attachment';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$headers['content-disposition'] = $disposition;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$attachments[] = new Attachment(\r\n\t\t\t\t\t$name,\r\n\t\t\t\t\t$this->getPartContentType($part),\r\n\t\t\t\t\t$this->getAttachmentStream($part),\r\n\t\t\t\t\t$disposition,\r\n\t\t\t\t\t$headers\r\n\t\t\t\t);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $attachments;\r\n\t}", "public function getBulkAttachments()\r\n {\r\n $sql = sprintf(\r\n \"SELECT\r\n attachment_id as attachmentID,\r\n site_id as siteID,\r\n title,\r\n original_filename as originalFileName,\r\n stored_filename as storedFileName,\r\n content_type as contentType,\r\n resume,\r\n text,\r\n date_created as dateCreated,\r\n date_modified as dateModified,\r\n directory_name as directoryName,\r\n file_size_kb as fileSizeKB,\r\n stored_on_s3 as storedOnS3,\r\n stored_locally as storedLocally\r\n FROM\r\n attachment\r\n WHERE\r\n data_item_type = %s\r\n AND\r\n site_id = %d\",\r\n $this->_db->makeQueryInteger(DATA_ITEM_BULKRESUME),\r\n $this->_siteID\r\n );\r\n\r\n return $this->_db->getAllAssoc($sql);\r\n }", "protected function attachAll($disposition_type, $boundary)\n {\n // Return text of body\n $mime = array();\n $cidUniq = array();\n $incl = array();\n\n // Add all attachments\n foreach ($this->attachment as $attachment) {\n // Check if it is a valid disposition_filter\n if ($attachment[6] == $disposition_type) {\n // Check for string attachment\n $string = '';\n $path = '';\n $bString = $attachment[5];\n if ($bString) {\n $string = $attachment[0];\n } else {\n $path = $attachment[0];\n }\n\n $inclhash = md5(serialize($attachment));\n if (in_array($inclhash, $incl)) {\n continue;\n }\n $incl[] = $inclhash;\n $name = $attachment[2];\n $encoding = $attachment[3];\n $type = $attachment[4];\n $disposition = $attachment[6];\n $cid = $attachment[7];\n if ($disposition == 'inline' && array_key_exists($cid, $cidUniq)) {\n continue;\n }\n $cidUniq[$cid] = true;\n\n $mime[] = sprintf('--%s%s', $boundary, $this->LE);\n //Only include a filename property if we have one\n if (!empty($name)) {\n $mime[] = sprintf(\n 'Content-Type: %s; name=\"%s\"%s',\n $type,\n $this->encodeHeader($this->secureHeader($name)),\n $this->LE\n );\n } else {\n $mime[] = sprintf(\n 'Content-Type: %s%s',\n $type,\n $this->LE\n );\n }\n // RFC1341 part 5 says 7bit is assumed if not specified\n if ($encoding != '7bit') {\n $mime[] = sprintf('Content-Transfer-Encoding: %s%s', $encoding, $this->LE);\n }\n\n if ($disposition == 'inline') {\n $mime[] = sprintf('Content-ID: <%s>%s', $cid, $this->LE);\n }\n\n // If a filename contains any of these chars, it should be quoted,\n // but not otherwise: RFC2183 & RFC2045 5.1\n // Fixes a warning in IETF's msglint MIME checker\n // Allow for bypassing the Content-Disposition header totally\n if (!(empty($disposition))) {\n $encoded_name = $this->encodeHeader($this->secureHeader($name));\n if (preg_match('/[ \\(\\)<>@,;:\\\\\"\\/\\[\\]\\?=]/', $encoded_name)) {\n $mime[] = sprintf(\n 'Content-Disposition: %s; filename=\"%s\"%s',\n $disposition,\n $encoded_name,\n $this->LE . $this->LE\n );\n } else {\n if (!empty($encoded_name)) {\n $mime[] = sprintf(\n 'Content-Disposition: %s; filename=%s%s',\n $disposition,\n $encoded_name,\n $this->LE . $this->LE\n );\n } else {\n $mime[] = sprintf(\n 'Content-Disposition: %s%s',\n $disposition,\n $this->LE . $this->LE\n );\n }\n }\n } else {\n $mime[] = $this->LE;\n }\n\n // Encode as string attachment\n if ($bString) {\n $mime[] = $this->encodeString($string, $encoding);\n if ($this->isError()) {\n return '';\n }\n $mime[] = $this->LE . $this->LE;\n } else {\n $mime[] = $this->encodeFile($path, $encoding);\n if ($this->isError()) {\n return '';\n }\n $mime[] = $this->LE . $this->LE;\n }\n }\n }\n\n $mime[] = sprintf('--%s--%s', $boundary, $this->LE);\n\n return implode('', $mime);\n }", "public function attachments($attachments)\n {\n $this->attachments = $attachments;\n\n return $this;\n }", "public function getAttachment($attachmentid) {\n $header = $this->app->request->headers->all();\n $body = $this->app->request->getBody();\n $URL = $this->lURL.'/DB/attachment/attachment/'.$attachmentid;\n $answer = Request::custom('GET', $URL, $header, $body);\n $this->app->response->setBody($answer['content']);\n $this->app->response->setStatus($answer['status']);\n }", "public static function attachmentBaseFieldDefinitions(EntityTypeInterface $entity_type) {\n if (!$entity_type->hasKey('attachments')) {\n throw new UnsupportedEntityTypeDefinitionException('The entity type ' . $entity_type->id() . ' does not have a \"attachments\" entity key.');\n }\n\n return [\n $entity_type->getKey('attachments') => BaseFieldDefinition::create('file')\n ->setLabel(t('Attachments'))\n ->setCardinality(FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED)\n ->setSetting('file_extensions', 'doc docx xls xlsx jpeg png txt')\n ->setDisplayOptions('view', [\n 'type' => 'file_default',\n 'weight' => 110,\n 'label' => 'inline',\n ])\n ->setDisplayOptions('form', [\n 'type' => 'file_generic',\n 'weight' => 110,\n ])\n ->setDisplayConfigurable('form', TRUE)\n ->setDisplayConfigurable('view', TRUE)\n ];\n }", "public function getAttachments() : CompactTweetFieldsAttachments\n {\n return $this->attachments;\n }", "private function getAttachmentsData($attachments, $thumb_size)\n {\n $data = [];\n\n foreach ($attachments as $id => $attachment) {\n $img_url = wp_get_attachment_url($id);\n $home_url = home_url();\n if (substr($img_url, 0, strlen($home_url)) == $home_url) {\n /** @var Entry $entry */\n $entry = new Entry();\n $img_relative_path = substr($img_url, strlen($home_url));\n $entry->Server_File_Name = $img_relative_path;\n $entry->ID = $attachment->ID;\n\n if (trim($attachment->post_excerpt)) {\n $caption_title = $attachment->post_excerpt;\n } else {\n $caption_title = $attachment->post_title;\n }\n $caption_photographer_first_name = get_post_meta($attachment->ID, '_rps_photographer_name', true);\n\n $data[] = $this->getImageData($entry,\n $thumb_size,\n $caption_title,\n $caption_photographer_first_name,\n '');\n }\n }\n\n return $data;\n }", "public function GetAttachment($request)\n {\n return $this->makeRequest(__FUNCTION__, $request);\n }", "function getAttachment($pid){\n\t \t$data = array();\n\t\t$this->db->select('*');\n\t\t$this->db->from('pof_attachment');\n\t\t$this->db->where('pof_id', $pid);\n\t\t $Q = $this->db->get();\n\t if ($Q->num_rows() > 0){\n\t \tforeach ($Q->result_array() as $row){\n\t $data[] = $row;\n\t }\n\t }\n\t $Q->free_result(); \n\t return $data; \n\t }", "protected function attachFiles(?string $boundary = null): array\n {\n $boundary ??= $this->boundary;\n\n $msg = [];\n foreach ($this->attachments as $filename => $fileInfo) {\n if (!empty($fileInfo['contentId'])) {\n continue;\n }\n $data = $fileInfo['data'] ?? $this->readFile($fileInfo['file']);\n $hasDisposition = (\n !isset($fileInfo['contentDisposition']) ||\n $fileInfo['contentDisposition']\n );\n $part = new FormDataPart('', $data, '', $this->getHeaderCharset());\n\n if ($hasDisposition) {\n $part->disposition('attachment');\n $part->filename($filename);\n }\n $part->transferEncoding('base64');\n $part->type($fileInfo['mimetype']);\n\n $msg[] = '--' . $boundary;\n $msg[] = (string)$part;\n $msg[] = '';\n }\n\n return $msg;\n }", "public function get($attachmentID, $verifySiteID = true)\r\n {\r\n $sql = sprintf(\r\n \"SELECT\r\n IF(ISNULL(text), 0, 1) AS hasText,\r\n attachment_id AS attachmentID,\r\n data_item_id AS dataItemID,\r\n data_item_type AS dataItemType,\r\n title AS title,\r\n original_filename AS originalFilename,\r\n stored_filename AS storedFilename,\r\n content_type AS contentType,\r\n profile_image AS isProfileImage,\r\n directory_name AS directoryName,\r\n md5_sum AS md5sum,\r\n file_size_kb AS fileSizeKB,\r\n DATE_FORMAT(date_created, '%s') AS dateCreated\r\n FROM\r\n attachment\r\n WHERE\r\n attachment_id = %s\r\n AND\r\n (site_id = %s || content_type = 'OSATSbackup' || %s)\",\r\n $this->dateformat,\r\n $this->_db->makeQueryInteger($attachmentID),\r\n $this->_siteID,\r\n ($verifySiteID ? 'false' : 'true')\r\n );\r\n $rs = $this->_db->getAssoc($sql);\r\n\r\n // FIXME: This doesn't follow the normal paradigm. Normally, we return\r\n // array() on failed queries so upper layers know the query failed.\r\n if (empty($rs))\r\n {\r\n /* This url is designed for failure. */\r\n $rs['retrievalURL'] = 'index.php?m=attachments&amp;a=getAttachment';\r\n }\r\n else\r\n {\r\n $rs['retrievalURL'] = sprintf(\r\n '%s?m=attachments&amp;a=getAttachment&amp;id=%s&amp;directoryNameHash=%s',\r\n osatutil::getIndexName(),\r\n $rs['attachmentID'],\r\n urlencode(md5($rs['directoryName']))\r\n );\r\n }\r\n\r\n return $rs;\r\n }", "function getAttachments($project_path)\n {\n $result = [];\n\n foreach ($this->getFiles() as $file) {\n if (is_array($file)) {\n list($filename, $mime_type) = $file;\n } else {\n $filename = $file;\n $mime_type = 'application/octet-stream';\n }\n\n $path = $project_path . '/files/' . $filename;\n\n if (is_file($path) && is_readable($path)) {\n $result[] = [$path, $mime_type];\n }\n }\n\n return $result;\n }", "public function index(AttachmentsDataTable $dataTable)\n {\n return $dataTable->render('hr.attachments.index');\n }", "function get_post_attachments($post_id) {\n $args = array(\n 'post_type' => 'attachment',\n 'numberposts' => -1,\n 'post_status' => null,\n 'post_parent' => $post_id\n );\n\n return get_posts($args);\n }", "public function attachmentsAction(Request $request, $id)\n {\n if (!$this->container->getParameter('manhattan_posts.include_attachments')) {\n throw new AccessDeniedHttpException('Attachment functionality has not been enabled in the bundle.');\n }\n\n if (false === $this->get('security.context')->isGranted('ROLE_USER')) {\n throw new AccessDeniedException();\n }\n\n $em = $this->getDoctrine()->getManager();\n\n $post = $em->getRepository('ManhattanPostsBundle:Post')\n ->findOneByIdJoinAttachments($id);\n\n if (!$post) {\n throw $this->createNotFoundException('Unable to find Post entity.');\n }\n\n $document = new Attachment();\n $document->addPost($post);\n $form = $this->createForm(new AttachmentType(), $document);\n\n return $this->render('ManhattanPostsBundle:Document:documents.html.twig', array(\n 'entity' => $post,\n 'form' => $form->createView()\n ));\n }", "public static function getAttachmentUrlList($valueList = array(), $entityType = '', $entityId = 0, $authorId = 0, $attachmentList = array())\n\t{\n\t\t$result = array();\n\n\t\tif (\n\t\t\tempty($valueList)\n\t\t\t|| empty($attachmentList)\n\t\t\t|| intval($authorId) <= 0\n\t\t\t|| intval($entityId) <= 0\n\t\t\t|| !Loader::includeModule('disk')\n\t\t)\n\t\t{\n\t\t\treturn $result;\n\t\t}\n\n\t\t$userFieldManager = \\Bitrix\\Disk\\Driver::getInstance()->getUserFieldManager();\n\t\tlist($connectorClass, $moduleId) = $userFieldManager->getConnectorDataByEntityType($entityType);\n\n\t\tforeach($valueList as $value)\n\t\t{\n\t\t\t$attachedFileId = false;\n\t\t\t$attachedObject = false;\n\n\t\t\tlist($type, $realValue) = \\Bitrix\\Disk\\Uf\\FileUserType::detectType($value);\n\t\t\tif ($type == \\Bitrix\\Disk\\Uf\\FileUserType::TYPE_NEW_OBJECT)\n\t\t\t{\n\t\t\t\t$attachedObject = \\Bitrix\\Disk\\AttachedObject::load(array(\n\t\t\t\t\t'=ENTITY_TYPE' => $connectorClass,\n\t\t\t\t\t'ENTITY_ID' => $entityId,\n\t\t\t\t\t'=MODULE_ID' => $moduleId,\n\t\t\t\t\t'OBJECT_ID'=> $realValue\n\t\t\t\t), array('OBJECT'));\n\n\t\t\t\tif($attachedObject)\n\t\t\t\t{\n\t\t\t\t\t$attachedFileId = $attachedObject->getId();\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$attachedFileId = $realValue;\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tintval($attachedFileId) > 0\n\t\t\t\t&& !empty($attachmentList[$attachedFileId])\n\t\t\t)\n\t\t\t{\n\t\t\t\tif (!$attachmentList[$attachedFileId][\"IS_IMAGE\"])\n\t\t\t\t{\n\t\t\t\t\t$result[$value] = array(\n\t\t\t\t\t\t'TYPE' => 'file',\n\t\t\t\t\t\t'URL' => $attachmentList[$attachedFileId][\"URL\"]\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (!$attachedObject)\n\t\t\t\t\t{\n\t\t\t\t\t\t$attachedObject = \\Bitrix\\Disk\\AttachedObject::loadById($attachedFileId, array('OBJECT'));\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($attachedObject)\n\t\t\t\t\t{\n\t\t\t\t\t\t$file = $attachedObject->getFile();\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!$file)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$extLinks = $file->getExternalLinks(array(\n\t\t\t\t\t\t'filter' => array(\n\t\t\t\t\t\t\t'OBJECT_ID' => $file->getId(),\n\t\t\t\t\t\t\t'CREATED_BY' => $authorId,\n\t\t\t\t\t\t\t'TYPE' => \\Bitrix\\Disk\\Internals\\ExternalLinkTable::TYPE_MANUAL,\n\t\t\t\t\t\t\t'IS_EXPIRED' => false,\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'limit' => 1,\n\t\t\t\t\t));\n\n\t\t\t\t\tif (empty($extLinks))\n\t\t\t\t\t{\n\t\t\t\t\t\t$externalLink = $file->addExternalLink(array(\n\t\t\t\t\t\t\t'CREATED_BY' => $authorId,\n\t\t\t\t\t\t\t'TYPE' => \\Bitrix\\Disk\\Internals\\ExternalLinkTable::TYPE_MANUAL,\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t/** @var \\Bitrix\\Disk\\ExternalLink $externalLink */\n\t\t\t\t\t\t$externalLink = reset($extLinks);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($externalLink)\n\t\t\t\t\t{\n\t\t\t\t\t\t$originalFile = $file->getFile();\n\n\t\t\t\t\t\t$result[$value] = array(\n\t\t\t\t\t\t\t'TYPE' => 'image',\n\t\t\t\t\t\t\t'URL' => \\Bitrix\\Disk\\Driver::getInstance()->getUrlManager()->getUrlExternalLink(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'hash' => $externalLink->getHash(),\n\t\t\t\t\t\t\t\t\t'action' => 'showFile'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\ttrue\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'WIDTH' => intval($originalFile[\"WIDTH\"]),\n\t\t\t\t\t\t\t'HEIGHT' => intval($originalFile[\"HEIGHT\"])\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "private function setAttachmentData()\n {\n $attachments = [];\n if($this->attachments){\n foreach($this->attachments as $attachment){\n $attachments[] = $attachment['file']->getRealPath();\n }\n }\n return $attachments;\n }", "public function get_medias_svg() {\n\t\t$args = array(\n\t\t\t'post_type' => 'attachment',\n\t\t\t'posts_per_page' => '-1',\n\t\t\t'post_status' => 'inherit',\n\t\t\t'post_mime_type' => 'image/svg+xml',\n\t\t);\n\n\t\t/**\n\t\t * Filter WP Query get attachments args\n\t\t *\n\t\t * @param array $args\n\t\t *\n\t\t * @since 2.0.0\n\t\t *\n\t\t */\n\t\t$args = apply_filters( 'acf_svg_icon_wp_medias_svg_args', $args );\n\n\t\t$attachments = new WP_Query( $args );\n\t\tif ( empty( $attachments->posts ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\t$svg = array();\n\t\tforeach ( $attachments->posts as $attachment ) {\n\t\t\t$svg[] = [\n\t\t\t\t'type' => 'media',\n\t\t\t\t'id' => $attachment->ID,\n\t\t\t\t'file' => get_attached_file( $attachment->ID ),\n\t\t\t\t'file_url' => wp_get_attachment_url( $attachment->ID ),\n\t\t\t];\n\t\t}\n\n\t\treturn $svg;\n\t}", "public function attachments()\r\n {\r\n $this->CI->db->where('rel_id', $this->leadId);\r\n $this->CI->db->where('rel_type', 'lead');\r\n\r\n return $this->CI->db->count_all_results('files');\r\n }", "public function getPostGalleryAttachments($short_code_atts, $id)\n {\n $attachments = [];\n if (!empty($short_code_atts['include'])) {\n $_attachments = get_posts([\n 'include' => $short_code_atts['include'],\n 'post_status' => 'inherit',\n 'post_type' => 'attachment',\n 'post_mime_type' => 'image',\n 'order' => $short_code_atts['order'],\n 'orderby' => $short_code_atts['orderby']\n ]);\n\n foreach ($_attachments as $key => $val) {\n $attachments[$val->ID] = $_attachments[$key];\n }\n } elseif (!empty($short_code_atts['exclude'])) {\n $attachments = get_children([\n 'post_parent' => $id,\n 'exclude' => $short_code_atts['exclude'],\n 'post_status' => 'inherit',\n 'post_type' => 'attachment',\n 'post_mime_type' => 'image',\n 'order' => $short_code_atts['order'],\n 'orderby' => $short_code_atts['orderby']\n ]);\n } else {\n $attachments = get_children([\n 'post_parent' => $id,\n 'post_status' => 'inherit',\n 'post_type' => 'attachment',\n 'post_mime_type' => 'image',\n 'order' => $short_code_atts['order'],\n 'orderby' => $short_code_atts['orderby']\n ]);\n }\n\n return $attachments;\n }", "public function search() {\n try {\n if (!($this->attachment instanceof Base_Model_ObtorLib_App_Core_Qualification_Entity_Attachment)) {\n throw new Base_Model_ObtorLib_App_Core_Qualification_Exception(\" Attachment Entity not initialized\");\n } else {\n $objAttachment = new Base_Model_ObtorLib_App_Core_Qualification_Dao_Attachment();\n $objAttachment->attachment = $this->attachment;\n return $objAttachment->search();\n }\n } catch (Exception $ex) {\n throw new Base_Model_ObtorLib_App_Core_Qualification_Exception($ex);\n }\n }", "public function DocumentAttachment() {\n\n\t\tif ($this->parameter_check) {\n\n\t\t\t$db=$GLOBALS['db'];\n\n\t\t\t$sql=\"SELECT attachment\n\t\t\t\t\t\tFROM \".$GLOBALS['database_prefix'].\"document_files\n\t\t\t\t\t\tWHERE document_id = '\".$this->document_id.\"'\n\t\t\t\t\t\t\";\n\t\t\t//echo $sql.\"<br>\";\n\t\t\t$result = $db->Query($sql);\n\t\t\tif ($db->NumRows($result) > 0) {\n\t\t\t\twhile($row = $db->FetchArray($result)) {\n\t\t\t\t\tif ($GLOBALS['database_type'] == \"postgres\") {\n\t\t\t\t\t\treturn pg_unescape_bytea($row[\"attachment\"]);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\treturn $row[\"attachment\"];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function viewAttachedFiles($sessionID, $contactID){\r\n\t\tif( $this->userCanViewFiles( $sessionID, $contactID )){\r\n\t\t\t$query = \"SELECT * FROM `attachments` WHERE `contactid` = '$contactID'\";\r\n\t\t\t$result = mysql_query($query);\r\n\t\t\tfor($i=0; $results = mysql_fetch_array($result); $i++){\r\n\t\t\t\t$IDs[$i]=$results['ID'];\r\n\t\t\t}\r\n\t\t\tif(empty($IDs)) return;\r\n\t\t\telse return $IDs;\t\t\r\n\t\t}\r\n\t\t//echo 'permission denied to view files';\r\n\t}", "function &getAttachments() {\n\t\t$attachments =& $this->getData('attachments');\n\t\treturn $attachments;\n\t}", "public function getAll($dataItemType, $dataItemID)\r\n {\r\n $sql = sprintf(\r\n \"SELECT\r\n IF(ISNULL(text), 0, 1) AS hasText,\r\n attachment_id AS attachmentID,\r\n data_item_id AS dataItemID,\r\n data_item_type AS dataItemType,\r\n title AS title,\r\n original_filename AS originalFilename,\r\n stored_filename AS storedFilename,\r\n content_type AS contentType,\r\n profile_image AS isProfileImage,\r\n directory_name AS directoryName,\r\n md5_sum AS md5sum,\r\n file_size_kb AS fileSizeKB,\r\n DATE_FORMAT(date_created, '%s') AS dateCreated\r\n FROM\r\n attachment\r\n WHERE\r\n data_item_id = %s\r\n AND\r\n data_item_type = %s\r\n AND\r\n site_id = %s\",\r\n $this->dateformat,\r\n $this->_db->makeQueryInteger($dataItemID),\r\n $this->_db->makeQueryInteger($dataItemType),\r\n $this->_siteID\r\n );\r\n $rs = $this->_db->getAllAssoc($sql);\r\n\r\n foreach ($rs as $index => $data)\r\n {\r\n $rs[$index]['retrievalURL'] = sprintf(\r\n '%s?m=attachments&amp;a=getAttachment&amp;id=%s&amp;directoryNameHash=%s',\r\n osatutil::getIndexName(),\r\n $data['attachmentID'],\r\n urlencode(md5($data['directoryName']))\r\n );\r\n\r\n $directoryName = $data['directoryName'];\r\n $fileName = $data['storedFilename'];\r\n $filePath = sprintf('attachments/%s/%s', $directoryName, $fileName);\r\n\r\n $rs[$index]['retrievalURLLocal'] = $filePath;\r\n\r\n $rs[$index]['retrievalLink'] = self::makeRetrievalLink(\r\n sprintf(\r\n 'id=%s&amp;directoryNameHash=%s',\r\n $data['attachmentID'],\r\n urlencode(md5($data['directoryName']))\r\n ),\r\n $rs[$index]['retrievalURL']\r\n );\r\n }\r\n\r\n return $rs;\r\n }", "public function get_log_entry_attachments( $id ) {\n\t\t$attachments = get_post_meta( $id, 'attachments', true );\n\n\t\tif ( ! empty( $attachments ) ) {\n\t\t\t$file_collection = [];\n\t\t\tforeach ( $attachments as $attachment ) {\n\t\t\t\t$file_collection[] = ( new LogAttachment() )->unpack( $attachment );\n\t\t\t}\n\n\t\t\treturn $file_collection;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public function getFacebookData($attachments)\n {\n $entries = [];\n $attachments_key = array_keys($attachments);\n foreach ($attachments_key as $id) {\n $img_url = wp_get_attachment_url($id);\n $home_url = home_url();\n if (substr($img_url, 0, strlen($home_url)) == $home_url) {\n $entry = new Entry();\n $img_relative_path = substr($img_url, strlen($home_url));\n $entry->Server_File_Name = $img_relative_path;\n $entries[] = $entry;\n }\n }\n $data = $this->photo_helper->getFacebookThumbs($entries);\n\n return $data;\n }", "function get_campaign_attachments( $post_ids ) {\n\n\tglobal $wpdb;\n\n\t// phpcs:disable\n\t$sql = 'SELECT ID, guid, post_parent FROM %1$s WHERE post_type = \\'attachment\\'';\n\t$prepared_sql = $wpdb->prepare(\n\t\t$sql,\n\t\t[\n\t\t\t$wpdb->posts,\n\t\t] );\n\t$attachments = $wpdb->get_results( $prepared_sql, OBJECT_K );\n\t// phpcs:enable\n\n\tif ( empty( $attachments ) ) {\n\t\treturn $post_ids;\n\t}\n\n\t$attachment_ids = [];\n\n\t/**\n\t * Post thumbnails\n\t */\n\tif ( $post_ids ) {\n\t\t$placeholders = implode( ',', array_fill( 0, count( $post_ids ), '%d' ) );\n\t\t$sql = 'SELECT meta_value FROM %1$s WHERE ( meta_key = \\'_thumbnail_id\\' or meta_key = \\'background_image_id\\' ) AND post_id IN(' . $placeholders . ')';\n\t\t$values = [];\n\t\t$values[0] = $wpdb->postmeta;\n\t\t$values = array_merge( $values, $post_ids );\n\t\t$prepared_sql = $wpdb->prepare( $sql, $values ); // WPCS: unprepared SQL OK.\n\t\t$results = $wpdb->get_results( $prepared_sql ); // WPCS: unprepared SQL OK.\n\t\t$attachment_ids = [];\n\t\tforeach ( (array) $results as $result ) {\n\t\t\t$attachment_ids[] = $result->meta_value;\n\t\t}\n\t}\n\n\t/**\n\t * Uploaded to (post_parent)\n\t */\n\tforeach ( $attachments as $id => $att ) {\n\t\tif ( in_array( $att->post_parent, $post_ids, true ) ) {\n\t\t\t$attachment_ids[] = $id;\n\t\t}\n\t}\n\n\t$placeholders = implode( ',', array_fill( 0, count( $post_ids ), '%d' ) );\n\n\t$sql = 'SELECT post_content \n\t\t\tFROM %1$s \n\t\t\tWHERE ID IN(' . $placeholders . ') \n\t\t\t\tAND post_content REGEXP \\'((wp-image-|wp-att-)[0-9][0-9]*)|\\\\\\[gallery |shortcake\\_|href=|src=\\'';\n\n\t$values = [];\n\t$values[0] = $wpdb->posts;\n\t$values = array_merge( $values, $post_ids );\n\t$prepared_sql = $wpdb->prepare( $sql, $values ); // WPCS: unprepared SQL OK.\n\t$results = $wpdb->get_results( $prepared_sql ); // WPCS: unprepared SQL OK.\n\n\tforeach ( (array) $results as $text ) {\n\t\t$text = $text->post_content;\n\n\t\t// Filter attachment ids from caption.\n\t\tpreg_match_all( '#(wp-image-|wp-att-|attachment\\_)(\\d+)#', $text, $matches, PREG_SET_ORDER );\n\t\tforeach ( $matches as $match ) {\n\t\t\t$attachment_ids[] = $match[2];\n\t\t}\n\n\t\t// Filter attachment ids from shortcake code(shortcake_gallery, shortcake_happy_point, shortcake_media_video).\n\t\tpreg_match_all( '#\\[shortcake\\_[a-zA-Z0-9\\_\\\"\\'\\-\\s\\:\\/\\/\\=\\.\\?\\&]*\\s(multiple_image|background|video_poster_img)[=][\\\"|\\']([\\d\\s\\,]*)[\\\"|\\']#', $text, $matches, PREG_SET_ORDER );\n\t\tforeach ( $matches as $match ) {\n\t\t\tif ( 'multiple_image' === $match[1] ) {\n\t\t\t\t$multiple_images = explode( ',', $match[2] );\n\t\t\t\t$attachment_ids = array_merge( $attachment_ids, $multiple_images );\n\t\t\t} else {\n\t\t\t\t$attachment_ids[] = $match[2];\n\t\t\t}\n\t\t}\n\n\t\t// Filter attachment ids from shortcake code(shortcake_carousel_header, shortcake_split_two_columns, shortcake_columns).\n\t\tpreg_match_all( '#\\s(image_[0-9]*|attachment_[0-9]*|issue_image|tag_image)[=][\\\"|\\']([\\d\\s\\,]*)[\\\"|\\']#', $text, $matches, PREG_SET_ORDER );\n\t\tforeach ( $matches as $match ) {\n\t\t\t$attachment_ids[] = $match[2];\n\t\t}\n\n\t\t// Filter attachment ids from [gallery] shortcode.\n\t\tpreg_match_all( '#\\[gallery\\s+[ids=\\\"\\']+([\\d\\s,]*)[\\\"\\'].#', $text, $matches, PREG_SET_ORDER );\n\t\tforeach ( $matches as $match ) {\n\t\t\tforeach ( explode( ',', $match[1] ) as $id ) {\n\t\t\t\t$attachment_ids[] = (int) $id;\n\t\t\t}\n\t\t}\n\t}\n\n\t$attachment_ids = array_unique( $attachment_ids );\n\tsort( $attachment_ids );\n\n\t// The post ids are reorderd as sort all attachment ids first and then append the post id to array.(Added for simplification of import process).\n\t$attachment_ids = array_diff( $attachment_ids, $post_ids );\n\t$post_ids = array_merge( $attachment_ids, $post_ids );\n\n\treturn $post_ids;\n}", "private function _build_attachments () {\n $sep = chr(13).chr(10);\n $ata = array();\n $k=0;\n\n foreach ((array) $this->attachments as $att) {\n $path = $att['path'];\n $name = $att['name'];\n $mimetype = $att['mimetype'];\n $disposition = $att['disposition'];\n $contentID = $att['cid'];\n $data = file_get_contents($path);\n\n $subhdr = '--'.$this->boundary.\"\\nContent-type: \".$mimetype.\";\\n\\tname=\\\"\".$name.\"\\\"\\nContent-Transfer-Encoding: base64\\nContent-Disposition: \".$disposition.\";\\n\\tfilename=\\\"\".$name.\"\\\"\\n\";\n if ($contentID) $subhdr .= 'Content-ID: <'.$contentID.\">\\n\";\n $ata[$k++] = $subhdr;\n $ata[$k++] = chunk_split(base64_encode($data)).\"\\n\\n\";\n }\n $this->full_body .= \"\\n\".implode($sep, $ata);\n }", "private function attachmentPaths(): array\n {\n $sql = \"SELECT meta_value FROM {$this->wpdb->postmeta} WHERE meta_key = %s\";\n /** @var \\stdClass[] $metadata */\n $metadata = $this->wpdb->get_results($this->wpdb->prepare($sql, '_wp_attachment_metadata'));\n\n if (!$metadata) {\n return [];\n }\n\n $paths = [];\n foreach ($metadata as $metadataValue) {\n list($dir, $files) = $this->attachmentPathFiles($metadataValue);\n if ($dir && $files) {\n array_key_exists($dir, $paths)\n ? $paths[$dir] = array_merge($paths[$dir], $files)\n : $paths[$dir] = $files;\n }\n }\n\n return $paths;\n }", "function get_activity_attachments( $activity_id, $activity_type ) {\r\n\r\n\t\tif ( ! yzea_is_user_can_edit_attachments() ) {\r\n\t\t\treturn 'hide';\r\n\t\t}\r\n\r\n\t\t// Init Vars\r\n\t\t$item = '';\r\n\r\n\t\t// Get Attachments.\r\n\t\t$attachments = yz_get_activity_attachments( $activity_id, '*' );\r\n\r\n\t\t// Unserialze Attachments.\r\n\t\t// $attachments = unserialize( $attachments );\r\n\r\n\t\tif ( ! empty( $attachments ) ) {\r\n\r\n\t\t\t// Get Photos Extension.\r\n\t\t\t$photos_extensions = array( 'jpg', 'png', 'gif', 'jpeg' ); \r\n\r\n\t\t\t// Get Upload Directory.\r\n\t\t\t$dir = wp_get_upload_dir();\r\n\r\n\t\t\tforeach ( $attachments as $attachment ) {\r\n\r\n\t\t\t\t$src = maybe_unserialize( $attachment['src'] );\r\n\t\t\t\t$data = maybe_unserialize( $attachment['data'] );\r\n\r\n\t\t\t\t// Get File Url.\r\n\t\t\t\t$url = yz_get_wall_file_url( $src );\t\r\n\t\t\t\t\t\r\n\t\t\t\t// Get Uploaded File extension\r\n\t\t\t\t$ext = strtolower( pathinfo( $src['original'], PATHINFO_EXTENSION ) );\r\n\r\n\t\t\t\t// Get File Data.\r\n\t\t\t\t$data = '[{\"real_name\": \"' . $data['real_name'] . '\", \"file_size\": \"' . $data['file_size'] . '\", \"original\": \"'. $src['original'] . '\"}]';\r\n\r\n\t\t\t\tif ( in_array( $ext, $photos_extensions ) ) {\r\n\t\t\t\t\t$item = $item . \"<div data-item-id='{$attachment['id']}' class='yz-attachment-item yz-image-preview' style='background-image: url($url);'><div class='yz-attachment-details'><i class='fas fa-trash-alt yz-delete-attachment'></i></div><input type='hidden' class='yz-attachment-data' name='attachments_files[]' value='$data'></div>\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$item = $item . \"<div class='yz-attachment-item yz-file-preview'><div class='yz-attachment-details'><i class='fas fa-paperclip yz-file-icon'></i><span class='yz-file-name'>{$src['real_name']}</span><i class='fas fa-trash-alt yz-delete-attachment'></i></div><input type='hidden' class='yz-attachment-data' name='attachments_files[]' value='$data'></div>\";\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\treturn apply_filters( 'yzea_get_activity_attachments', $item, $activity_id, $activity_type );\r\n\r\n\t}", "public function setAttachments($attachments) {\n\t\t$this->attachments = $attachments;\n\t}", "public function bySubtype(string $pbx, string $subtype)\n {\n return $this->send(\"pbx/{$pbx}/audits/subtype/$subtype\")->entries;\n\n }", "public function DeleteAttachment($request)\n {\n return $this->makeRequest(__FUNCTION__, $request);\n }", "public function setAttachments($type = null, $name = null, $content = null)\n {\n $attachments = array();\n\n if (!empty($type)) {\n $this->attachments_type = $attachments['type'] = $type;\n }\n\n if (!empty($name)) {\n $this->attachments_name = $attachments['name'] = $name;\n }\n\n if (!empty($content)) {\n $this->attachments_content = $attachments['content'] = base64_encode(file_get_contents($content));\n }\n\n $this->message['attachments'][] = $attachments;\n }", "protected function includeAttachments($raw)\n {\n $attachments = [];\n\n foreach ($this->attachments as $attachment => $refinery) {\n if (isset($refinery['raw'])) {\n $attachments[$attachment] = $refinery['raw']($raw);\n } else {\n $class = $refinery['class'];\n $callback = $refinery['callback'];\n\n if ( ! $callback) {\n $items = $this->getItems($raw, $class, $attachment);\n } else {\n $items = $this->getItemsUsingCallback($raw, $class, $callback);\n }\n\n $attachments[$attachment] = ! is_null($items) ? $class->with($this->attributes)->refine($items) : null;\n }\n }\n\n return $attachments;\n }", "public function testComAdobeCqSocialCalendarClientOperationextensionsEventAttachmen()\n {\n $client = static::createClient();\n\n $path = '/system/console/configMgr/com.adobe.cq.social.calendar.client.operationextensions.EventAttachment';\n\n $crawler = $client->request('POST', $path);\n }", "public function attachments()\n {\n return $this->belongsToMany(Media::class);\n }" ]
[ "0.56232435", "0.5537076", "0.5451142", "0.5451142", "0.54085815", "0.5380164", "0.5332533", "0.51475906", "0.50720733", "0.5044913", "0.5006742", "0.4993605", "0.49494988", "0.49395376", "0.4881001", "0.4881001", "0.4835176", "0.4831308", "0.4797166", "0.47818804", "0.4718333", "0.46705034", "0.46564192", "0.45757082", "0.45662245", "0.45612326", "0.45555332", "0.45466104", "0.4534007", "0.45338157", "0.45047134", "0.4504284", "0.44949862", "0.44934964", "0.4481891", "0.4473503", "0.44692144", "0.44667464", "0.446497", "0.4441955", "0.444002", "0.4432565", "0.4418034", "0.44087264", "0.4407723", "0.43980435", "0.43975383", "0.4377686", "0.43710056", "0.43694407", "0.43548805", "0.43525347", "0.4339938", "0.43361163", "0.43295172", "0.43131256", "0.43015862", "0.4295742", "0.4295742", "0.42679977", "0.42598554", "0.42561778", "0.42471427", "0.4213692", "0.42131332", "0.41737553", "0.41672596", "0.41410407", "0.41352662", "0.4113774", "0.41052893", "0.41015923", "0.40718293", "0.40655982", "0.40501377", "0.4047464", "0.40445423", "0.404044", "0.4038057", "0.4035967", "0.40308696", "0.4029926", "0.40207312", "0.4011907", "0.40114132", "0.40085033", "0.4004902", "0.3984617", "0.39832306", "0.39828652", "0.39788198", "0.3970205", "0.39482012", "0.39428684", "0.3936818", "0.39332142", "0.39258465", "0.3921883", "0.3920652", "0.39191103" ]
0.65270567
0
Method to check if the window dates have already been set for a semester
public function checkSet($array){ $sql="select * from windows where semester=?"; $data[0]=$array['season'] . ' ' . $array['year']; $res=$this->db->query($sql,$data); if ($res->num_rows() >= 1){ return true; }else{ return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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}", "public function checkValidSeason()\n {\n if (!$this->season_helper->isValidSeason($this->selected_season)) {\n $this->selected_season = $this->season_helper->getSeasonId(date('r'));\n $competitions = $this->query_competitions->getCompetitionBySeasonId($this->selected_season,\n ['Scored' => 'Y']);\n /** @var QueryCompetitions $competition */\n $competition = end($competitions);\n $date_object = new \\DateTime($competition->Competition_Date);\n $this->selected_date = $date_object->format(('Y-m-d'));\n }\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}", "function attendance_session_open_for_students($sess) {\n $sessionopens = empty($sess->studentsearlyopentime) ? $sess->sessdate : $sess->sessdate - $sess->studentsearlyopentime;\n if (time() > $sessionopens) {\n return true;\n } else {\n return false;\n }\n}", "public function hasDate() {\n return $this->_has(3);\n }", "function testSummer($testDate) {\n //set as globals so only calculated once\n global $memorialDay, $laborDay;\n\n if ($testDate > $memorialDay && $testDate < $laborDay){\n return true;\n }\n else{\n return false;\n }\n\n}", "static function checkIfDateSameWeek($startDate,$endDate)\n { \n $startDateCarbon = new Carbon($startDate);\n $endDateCarbon = new Carbon($endDate);\n\n\t\t$diff = $startDateCarbon->diffInDays($endDateCarbon);\n return $startDateCarbon->weekOfYear == $endDateCarbon->weekOfYear \n \t&& $diff <= 7 ;\n }", "public static function checkSettings() {\r\n \t\r\n \t$currentYear = date('Y');\r\n \tif(date('m') == 1){\r\n\t $record = Doctrine_Query::create ()\r\n\t ->from ( 'InvoicesSettings is' )\r\n\t ->where ( \"is.year = ?\", $currentYear )\r\n\t\t\t\t\t->andWhere('is.isp_id = ?',Shineisp_Registry::get('ISP')->isp_id)\r\n\t ->limit ( 1 )\r\n\t ->execute ( array (), Doctrine_Core::HYDRATE_ARRAY );\r\n\t \r\n\t if(empty($record)){\r\n\t\t\t\t$is = new InvoicesSettings();\r\n\t\t\t\t$is['year'] = $currentYear;\r\n\t\t\t\t$is['next_number'] = 1;\r\n\t\t\t\t$is->save();\r\n\t }\r\n \treturn true;\r\n \t}\r\n \treturn false;\r\n }", "function are_we_timesheeting_today() {\n\t\t$timesheet_regex = str_replace('{{DATE}}',date('Ymd',time()+($this->config['timesheet_lead_time_days'] * 86400)),$this->config['timesheet_file_find_by_date']);\n\n\t\t$dh = opendir($this->config['timesheet_path']);\n\n\t\twhile ($file = readdir($dh)) {\n\t\t\tif (preg_match($timesheet_regex,$file)) { \n\t\t\t\techo \"Today's timesheet has already been generated: $file\\n\";\n\t\t\t\treturn false;\n\t\t\t} \n\t\t}\n\t\n\t\tclosedir($dh);\n\n\t\tforeach ($this->get_calendar_events(time()+($this->config['timesheet_lead_time_days'] * 86400), ((time()+($this->config['timesheet_lead_time_days']+1) * 86400)-86400)) as $event) {\n\n\t\t\tif (preg_match($this->config['calendar_entry'], $event->title->text, $m)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function valid()\n {\n return $this->_current !== null\n && $this->_current->getTimestamp() < $this->_endDate->getTimestamp();\n }", "function expDateCallback()\n {\n $months = array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');\n $years = array('2012','2013','2014','2015','2016','2017','2018');\n \n if (in_array($_POST['exp_mon'], $months) && in_array($_POST['exp_yr'], $years)) {\n return true;\n }\n return false;\n }", "public function matchWeekOfMonth()\n {\n $weeks = $this->getDataValue('weeks');\n return in_array(Carbon::now($this->automation->customer->getTimezone())->weekOfMonth, $weeks, false);\n }", "public function session_validate(){\n\t\tif(!empty($this->data['Leave']['leave_from']) && !empty($this->data['Leave']['leave_to'])){\n\t\t\t$leave_from = $this->format_date_save($this->data['Leave']['leave_from']);\n\t\t\t$leave_to = $this->format_date_save($this->data['Leave']['leave_to']);\n\t\t\t$diff = $this->diff_date($leave_from, $leave_to);\t\t\t\n\t\t\tif($diff > 0 && $this->data['Leave']['session'] != 'D'){\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}", "private function check_meet_creation_limit()\n {\n $recent_shackmeet_count = count($this->load_recent_shackmeet_count());\n \n return $recent_shackmeet_count < 2;\n }", "public function hasStartMonth() {\n return $this->_has(5);\n }", "public function validate() {\n//\t\tif( intval($this->params[\"startYear\"] < date(\"yyyy\"))) $this->add_validation_error(\"Season cannot exist in the past.\");\n\t}", "function recommends_req_wizard_schools_info_validate($form, &$form_state) {\n\n for ($i = 1; $i <= $form_state['num_schools']; $i++) {\n \n $date_due_month = $form_state['values']['schname'][$i]['r_date_due']['month'];\n $date_due_day = $form_state['values']['schname'][$i]['r_date_due']['day'];\n $date_due_year = $form_state['values']['schname'][$i]['r_date_due']['year'];\n \n $d2=mktime(0,0,0,$date_due_month,$date_due_day,$date_due_year);\n $d1=time();\n $days_diff = floor(($d2-$d1)/86400);\n if ($days_diff < 30 ) {\n form_set_error(\"schname][$i][r_date_due\", 'The due date must be at least 30 days from today. Please contact the professor to discuss exceptions.');\n }\n\n }\n}", "function checkWeeks() {\n\t\tglobal $weeklyhours; \n\t\t\n\t\tforeach ( $this->weeklyAnalysis as &$week ) {\n\t\t\tif ( $week['total'] < $weeklyhours ) {\n\t\t\t\t$week['complete'] = 0; \t\t\t\t\t\t\t// set this week incomplete\n\t\t\t\t$this->complete = 0; \t\t\t\t\t\t\t// set entire analysis to incomplete\n\t\t\t}\n\t\t\telse $week['complete'] = 1;\n\t\t\t\t\n\t\t}\n\t}", "private function checkDatesValidity(){\n\t\t$valid=true;\n\t\t$today = date(\"Y-m-d\");\n\t\tif($this->validFrom!=\"\" && $this->validFrom!=\"0000-00-00\" && $today<$this->validFrom) $valid=false;\n\t\tif($this->validUntil!=\"\" && $this->validUntil!=\"0000-00-00\" && $today>$this->validUntil) $valid=false;\n\t\treturn $valid;\n\t}", "public function isNotFillFirstStartDate () {\n return '0000-00-00' == $this->first_start_date;\n }", "public function isSummerSemester()\n {\n if ($this->semesterNumber > 8) {\n return true;\n }\n\n return false;\n }", "public function hasStartYear() {\n return $this->_has(14);\n }", "public function hasDate() : bool;", "public function isSetEventDate()\n {\n return !is_null($this->_fields['EventDate']['FieldValue']);\n }", "public function panelist_dwid_availability() {\n\t\t$partner_users = $this->PartnerUser->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'PartnerUser.partner' => 'mbd',\n\t\t\t\t'PartnerUser.created >=' => date(DB_DATETIME, strtotime('-14 days'))\n\t\t\t)\n\t\t));\n\t\t\n\t\t$missing_dwids = $missing_from_stales = array();\n\t\t$this->out('Analyzing '.count($partner_users).' exported panelists to MBD');\n\t\tforeach ($partner_users as $partner_user) {\n\t\t\t$user_id = $partner_user['PartnerUser']['user_id'];\n\t\t\tif (empty($partner_user['PartnerUser']['uid'])) {\n\t\t\t\t$missing_dwids[] = $user_id;\n\n\t\t\t\t// confirm they are missing from stale\n\t\t\t\t$count = $this->MbdStale->find('count', array(\n\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'MbdStale.user_id' => $partner_user['PartnerUser']['user_id']\n\t\t\t\t\t)\n\t\t\t\t));\n\t\t\t\tif ($count == 0) {\n\t\t\t\t\t$missing_from_stales[] = $user_id;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$missing_dwid_pct = round(count($missing_dwids) / count($partner_users) * 100, 2); \n\t\t$missing_stale_pct = round(count($missing_from_stales) / count($partner_users) * 100, 2); \n\t\t$diff = array_diff($missing_dwids, $missing_from_stales);\n\t\t\n\t\t$this->out(count($missing_dwids).' missing DWIDs ('.$missing_dwid_pct.'%)');\n\t\t$this->out(count($missing_from_stales).' missing from stales ('.$missing_stale_pct.'%)');\n\t}", "private function CheckStartFinishDate()\n\t{\n\t\t$start_date = MicroGrid::GetParameter('start_date', false);\n\t\t$finish_date = MicroGrid::GetParameter('finish_date', false);\n\t\t\n\t\tif($start_date > $finish_date){\n\t\t\t$this->error = _START_FINISH_DATE_ERROR;\n\t\t\treturn false;\n\t\t}\t\n\t\treturn true;\t\t\n\t}", "private function compare_with_date()\n {\n }", "public function hasStartYear() {\n return $this->_has(4);\n }", "private function validate_booking(): bool {\n\t $this->errors = array();\n\n // Clear data using test_input function\n foreach ($this->request->post as $key => $value) {\n $this->request->post[$key] = self::test_input($this->request->post[$key]);\n }\n\n // Time\n if(!(preg_match(\"/^(?:2[0-3]|[01][0-9]):[0-5][0-9]$/\", $this->request->post[\"time\"]))){\n array_push($this->errors,$this->language->get('time_error'));\n }\n\n // Date\n $temp = new DateTime();\n\n // Create date object (without time)\n $date = DateTime::createFromFormat('Y-m-d', $this->request->post[\"date\"]);\n\n // Remove time from datetime string\n $now = DateTime::createFromFormat(\"Y-m-d\", $temp->format(\"Y-m-d\"));\n\n // Extract data\n $year = $date->format(\"Y\");\n $month = $date->format(\"m\");\n $day = $date->format(\"d\");\n\n if($date < $now){\n array_push($this->errors,$this->language->get('date_past_error'));\n }\n else if(!checkdate($month,$day,$year)) {\n //$this->errors[\"date\"] = $this->language->get('date_error');\n array_push($this->errors,$this->language->get('date_value_error'));\n }\n\n //TODO: REMOVE\n return count($this->errors) == 0;\n }", "public function hasDate() : bool\n {\n return isset($this->date);\n }", "public function hasDate(): bool\n {\n return isset($this->date);\n }", "public function hasDate(): bool\n {\n return isset($this->date);\n }", "function wp_checkdate($month, $day, $year, $source_date)\n {\n }", "private function checkEventDateNotDue(){\n $event = Event::find($this->id);\n $now = Carbon::now();\n \n $startTime = Carbon::createFromFormat('Y-m-d H:i:s', $event->start_time);\n return $startTime->gt($now);\n }", "public function isSetStartDate()\n {\n return !is_null($this->_fields['StartDate']['FieldValue']);\n }", "public function needs_run() {\n $today = time();\n $lastrun = $this->info[\"last_run\"];\n $interval = (int)$this->freq * 86400;\n\n return($today > ($lastrun + $interval));\n }", "public function checkDateVisit(){\n $yearError = new DaYearError($this->record[\"DateVisit\"]);\n if($yearError->getErrorType() != DaYearError::ERR_NONE){\n $this->addError(\"[DateVisit] invalid: \\\"{$yearError}\\\" \");\n return false;\n }\n return true;\n }", "public function isWorkingDay($datum){\n $jahr = substr($datum, 0, 4);\n $monat = substr($datum, 5, 2);\n $day = substr($datum, 8, 2);\n $svatkyArray = $this->getSvatkyArray($jahr, $monat);\n \n $cislodne = sprintf(\"%02d\",date('w',mktime(0, 1, 1, $monat, $day, $jahr)));\n\n\n $svatek = array_search($day, $svatkyArray);\n\n// Debug::fireLog(\"svatek=$svatek,cislodne=$cislodne\".\"svatkyArray=\".join(',', $svatkyArray));\n\n if($cislodne==0 || $cislodne==6 || $svatek!==false)\n return false;\n else\n return true;\n\n }", "function CHECK_valability($endDATE) {\n\n $TMSP_end = strtotime($endDATE);\n $TMSP_today = time();\n\n if($TMSP_end > $TMSP_today) return true;\n else return false;\n }", "public function checkInput()\n\t{\n\t\tglobal $lng;\n\t\t\n\t\tif($this->getDisabled())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t$post = $_POST[$this->getPostVar()];\n\t\tif(!is_array($post))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$start = $post[\"start\"];\n\t\t$end = $post[\"end\"];\n\t\t\n\t\t// if full day is active, ignore time format\n\t\t$format = $post['tgl']\n\t\t\t? 0\n\t\t\t: $this->getDatePickerTimeFormat();\n\t\t\n\t\t// always done to make sure there are no obsolete values left\n\t\t$this->setStart(null);\n\t\t$this->setEnd(null);\n\t\t\n\t\t$valid_start = false;\n\t\tif(trim($start))\n\t\t{\n\t\t\t$parsed = ilCalendarUtil::parseIncomingDate($start, $format);\n\t\t\tif($parsed)\n\t\t\t{\t\t\t\t\t\t\t\t\t\n\t\t\t\t$this->setStart($parsed);\n\t\t\t\t$valid_start = true;\n\t\t\t}\t\t\t\t\t\t\n\t\t}\n\t\telse if(!$this->getRequired() && !trim($end))\n\t\t{\n\t\t\t$valid_start = true;\t\t\t\n\t\t}\n\t\t\t\t\t\t\t\t\n\t\t$valid_end = false;\t\t\n\t\tif(trim($end))\n\t\t{\t\t\t\n\t\t\t$parsed = ilCalendarUtil::parseIncomingDate($end, $format);\t\t\n\t\t\tif($parsed)\n\t\t\t{\n\t\t\t\t$this->setEnd($parsed);\n\t\t\t\t$valid_end = true;\n\t\t\t}\t\t\t\t\t\n\t\t}\n\t\telse if(!$this->getRequired() && !trim($start))\n\t\t{\t\t\t\t\t\n\t\t\t$valid_end = true;\t\t\t\n\t\t}\n\t\t\n\t\tif($this->getStartYear())\n\t\t{\n\t\t\tif($valid_start && \n\t\t\t\t$this->getStart()->get(IL_CAL_FKT_DATE, \"Y\") < $this->getStartYear())\n\t\t\t{\n\t\t\t\t$valid_start = false;\n\t\t\t}\n\t\t\tif($valid_end && \n\t\t\t\t$this->getEnd()->get(IL_CAL_FKT_DATE, \"Y\") < $this->getStartYear())\n\t\t\t{\n\t\t\t\t$valid_end = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$valid = ($valid_start && $valid_end);\t\n\t\t\n\t\tif($valid && \n\t\t\t$this->getStart() && \n\t\t\t$this->getEnd() &&\n\t\t\tilDateTime::_after($this->getStart(), $this->getEnd()))\t\t\t\n\t\t{\n\t\t\t$valid = false;\t\t\t\n\t\t}\n\t\t\n\t\tif(!$valid)\n\t\t{\n\t\t\t$this->invalid_input_start = $start;\n\t\t\t$this->invalid_input_end = $end;\n\t\t\t\n\t\t\t$_POST[$this->getPostVar()][\"start\"] = null;\n\t\t\t$_POST[$this->getPostVar()][\"end\"] = null;\n\t\t\t\n\t\t\t$this->setAlert($lng->txt(\"form_msg_wrong_date\"));\n\t\t}\t\n\t\telse\n\t\t{\t\t\t\n\t\t\tif($this->getStart() &&\n\t\t\t\t$this->getEnd())\n\t\t\t{\n\t\t\t\t// getInput() should return a generic format\t\n\t\t\t\t$post_format = $format\n\t\t\t\t\t? IL_CAL_DATETIME\n\t\t\t\t\t: IL_CAL_DATE;\t\t\t\n\t\t\t\t$_POST[$this->getPostVar()][\"start\"] = $this->getStart()->get($post_format);\n\t\t\t\t$_POST[$this->getPostVar()][\"end\"] = $this->getEnd()->get($post_format);\t\t\t\t\n\t\t\t\tunset($_POST[$this->getPostVar()][\"tgl\"]);\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$_POST[$this->getPostVar()][\"start\"] = null;\n\t\t\t\t$_POST[$this->getPostVar()][\"end\"] = null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif($valid)\n\t\t{\n\t\t\t$valid = $this->checkSubItemsInput();\n\t\t}\n\t\t\n\t\treturn $valid;\n\t}", "public function hasCalendarEvents(): bool\n {\n return ($this->calendarEvents->count() !== 0) ? true : false;\n }", "public function hasEndYear() {\n return $this->_has(6);\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 hasDw()\n {\n return isset($this->dw);\n }", "public function hasDw()\n {\n return isset($this->dw);\n }", "function valida_dates($enter_date, $obsolescense_date)\n{\n $day1 = substr($enter_date, 0, 2);\n $month1 = substr($enter_date, 3, 2);\n $year1 = substr($enter_date, 6, 4);\n $day2 = substr($obsolescense_date, 0, 2);\n $month2 = substr($obsolescense_date, 3, 2);\n $year2 = substr($obsolescense_date, 6, 4);\n\n if ($enter_date <= $obsolescense_date) {\n return true;\n }\n\n return false;\n}", "public function issetMovementDate(): bool\n {\n return isset($this->movementDate);\n }", "public function valid(): bool\n {\n return isset($this->intervals[$this->position]);\n }", "private function checkNewCommondaty()\n {\n $date = new DateTime($this->addDate);\n $date->modify(self::TIME_INTERVAL);\n $date->format('Y-m-d H:i:s');\n $dateNow = new DateTime();\n $dateNow->format('Y-m-d H:i:s');\n\n if ($dateNow < $date) {\n return 1;\n }\n return 0;\n }", "function haltDecrementation()\n {\n return ( //THIS BLOCK TEST WHETHER THE CURRENT DAY IS A SUNDAY\n date('N', intval($this->workTime)) == 7\n && // THIS BLOCK CHECKS THAT THE DATE HAS ASCENDED IN DECREMENTATION\n // MEANING THAT WE HAVE ENTERED A NEW MONTH\n (\n intval(date('m', $this->workTime - 86400))\n !=\n intval(date('m', intval($_GET['currT'])))\n || // IF IT WAS JUST A WEEK VIEW, WE WILL STOP NOW.\n $_GET['weekOrMonth'] == 'week'\n )\n );\n }", "public function check_class_register_deadline(){\n $sessionID = $this->input->post('class_session_id');\n // set correct timezone\n date_default_timezone_set(\"America/New_York\");\n // collect the current time \n $currentTime = date(\"h:i:s\");\n $currentDate = date(\"Y/m/d\");\n \n //search of session date\n $this->db->select('*');\n $this->db->where('class_session_id', $sessionID);\n $getSessionInfo = $this->db->get('class_sessions'); \n $fetchDate = $getSessionInfo->row(); \n $scheduledDate = $fetchDate->date;\n echo $scheduledDate; \n // check is the date is right\n \n if($currentDate == $scheduledDate ){\n \n // get session start time\n $fetchStartTime = $getSessionInfo->row();\n $scheduledStartTime = $fetchStartTime->start_time;\n // get session cut off time\n $fetchCutOffTime = $getSessionInfo->row();\n $scheduledCutOffTime = $fetchCutOffTime->cut_off_time; \n \n \n if($currentTime >= $scheduledStartTime && $currentTime < $scheduledCutOffTime){\n \n return true; \n \n \n }else{\n \n return false; \n \n }\n \n }else{\n \n echo \"This is the wrong day for the class session to be registered.\";\n \n }\n }", "function has_supergroup_standings() {\n return last_aggregate_roundid() !== 0;\n}", "public function checkDateWithInvalidDateValuesDataProvider() {}", "protected function all_unavailable_dates($room_for_check){\r\n $all_unavailable_dates = array();\r\n \r\n foreach (self::$db_table_months as $month){\r\n foreach (self::$db_table_years as $year){\r\n $unav_dates = $this->unav_days_to_dates($month, $year, $room_for_check);\r\n// var_dump($unav_dates);\r\n if (!$unav_dates) continue; //otarasim se onih koji su null\r\n// var_dump($unav_dates);\r\n foreach ($unav_dates as $unav_date){ \r\n if (is_bool($unav_date)) continue;\r\n $all_unavailable_dates[] = $unav_date;\r\n }\r\n }\r\n \r\n }\r\n return $all_unavailable_dates;\r\n }", "public function isOpen()\n {\n $opened = new Zend_Date($this->opened);\n $closed = new Zend_Date($this->closed);\n\n if ($closed->equals($opened)) {\n return true;\n }\n\n return false;\n }", "function haltIncrementation()\n {\n return ( //it must be a saturday\n date('N', $this->workTime) == 7\n && // AND the month has changed\n (\n intval(date('m', $this->workTime + 86400))\n !=\n intval(date('m', intval($_GET['currT'])))\n || // OR we only ever wanted to see a week anyway\n $_GET['weekOrMonth'] == 'week'\n || // OR the last day of the month is a Saturday\n date('t', intval($_GET['currT'])) == date('d', intval($this->workTime))\n )\n );\n }", "function _registration_open( $event_month, $event_year ){\n $open_month = ((floor(($event_month + 1) / 2) - 1) * 2) + (12 - floor(($event_month + 9) / 12) * 12);\n $open_year = $event_year + floor (($event_month + 9) / 12) - 1;\n $open_time = mktime( 0, 0, 0, $open_month, 1, $open_year);\n return $open_time < time();\n }", "public function hasStudySummaries() {\n return $this->_has(13);\n }", "public function hasPassed()\n {\n if (empty($this->startDate) || empty($this->endDate)) {\n return false;\n }\n\n $next = $this->next()->next;\n\n return DateTimeHelper::isInThePast($next);\n }", "public function hasAdddate(){\n return $this->_has(29);\n }", "public function valid() {\n\t\tif (isset($this->allSets[$this->key()])) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function isNeedUpdate()\n {\n if (is_null($this['episode_update_date'])){\n return true;\n }\n if (Carbon::now()->diffInDays(new Carbon($this['episode_update_date'])) > 3){\n return true;\n }\n return false;\n }", "function room_reservations_admin_settings_daily_hours_validate($form_id, &$form_state) {\n if ($form_state['clicked_button']['#value'] == t('Save configuration')) {\n $month_value = $form_state['values']['month'];\n $month = intval(drupal_substr($month_value, 5));\n $year = drupal_substr($month_value, 0, 4);\n // Days in the month.\n $days = date('t', mktime(0, 0, 0, $month, 1, $year));\n for ($day = 0; $day < $days; $day++) {\n // Day of the week.\n $dow = date('l', mktime(0, 0, 0, $month, $day + 1, $year));\n // Day of month.\n $dom = $day + 1;\n $open = TRUE;\n $second_shift = FALSE;\n $first_shift_open\n = $form_state['values']['day_' . $day]['first_shift_open_' . $day];\n $first_shift_close\n = $form_state['values']['day_' . $day]['first_shift_close_' . $day];\n $second_shift_open\n = $form_state['values']['day_' . $day]['second_shift_open_' . $day];\n $second_shift_close\n = $form_state['values']['day_' . $day]['second_shift_close_' . $day];\n $int_first_shift_open\n = intval(\n $form_state['values']['day_' . $day]['first_shift_open_' . $day]);\n $int_first_shift_close\n = intval(\n $form_state['values']['day_' . $day]['first_shift_close_' . $day]);\n $int_second_shift_open\n = intval(\n $form_state['values']['day_' . $day]['second_shift_open_' . $day]);\n $int_second_shift_close\n = intval(\n $form_state['values']['day_' . $day]['second_shift_close_' . $day]);\n // Closed.\n if (($int_first_shift_open == 9999) && \n ($int_first_shift_close == 9999) && \n ($int_second_shift_open == 9999) && \n ($int_second_shift_close == 9999)) {\n $open = FALSE;\n }\n // First shift.\n if ($open) {\n if ($int_first_shift_open == 9999) {\n $field = 'day_' . $day . '][first_shift_open_' . $day;\n $message = t('!day - First shift open is required.', \n array('!day' => $dom . ' ' . $dow));\n form_set_error($field, check_plain($message));\n }\n elseif ($int_first_shift_close == 9999) {\n $field = 'day_' . $day . '][first_shift_close_' . $day;\n $message = t('!day - First shift close is required.', \n array('!day' => $dom . ' ' . $dow));\n form_set_error($field, check_plain($message));\n }\n elseif ($int_first_shift_open >= $int_first_shift_close) {\n $field = 'day_' . $day . '][first_shift_close_' . $day;\n $message = t('!day - First shift close must be later than first shift\n open.', array('!day' => $dom . ' ' . $dow));\n form_set_error($field, check_plain($message));\n }\n }\n // Second shift.\n if ($open) {\n if (($int_second_shift_open != 9999) || \n ($int_second_shift_close != 9999)) {\n $second_shift = TRUE;\n }\n }\n if ($second_shift) {\n if (($int_first_shift_open == 9999) && \n ($int_first_shift_close == 9999)) {\n $field = 'day_' . $day . '][second_shift_open_' . $day;\n $message = t('!day - Cannot have a second shift without a first\n shift.', array('!day' => $dom . ' ' . $dow));\n form_set_error($field, check_plain($message));\n }\n elseif ($int_second_shift_open == 9999) {\n $field = 'day_' . $day . '][second_shift_open_' . $day;\n $message = t('!day - Second shift open is missing.', \n array('!day' => $dom . ' ' . $dow));\n form_set_error($field, check_plain($message));\n }\n elseif ($int_second_shift_close == 9999) {\n $field = 'day_' . $day . '][second_shift_close_' . $day;\n $message = t('!day - Second shift close is missing.', \n array('!day' => $dom . ' ' . $dow));\n form_set_error($field, check_plain($message));\n }\n elseif ($int_second_shift_open <= $int_first_shift_close) {\n $field = 'day_' . $day . '][second_shift_open_' . $day;\n $message = t('!day - Second shift open must be later than first\n shift close.', array('!day' => $dom . ' ' . $dow));\n form_set_error($field, check_plain($message));\n }\n elseif ($int_second_shift_open >= $int_second_shift_close) {\n $field = 'day_' . $day . '][second_shift_close_' . $day;\n $message = t('!day - Second shift close must be later than second\n shift opten.', array('!day' => $dom . ' ' . $dow));\n form_set_error($field, check_plain($message));\n }\n }\n }\n }\n}", "protected function dates_filter(){\n \t//+Constraint Isgi: only one year data\n \t$temporal = $this->get_temporal();\n \tif( strtolower($temporal->end) == \"now\"){\n \t\t$now = new \\DateTime();\n \t\t$temporal->end = $now->format(\"Y-m-d\");\n \t}\n \t\n \t\n \t//change start and end\n \tif( $this->start < $temporal->start){\n \t\t$this->start = $temporal->start;\n \t}\n \tif( $this->end > $temporal->end){\n \t\t$this->end = $temporal->end;\n \t}\n \t$update = $this->get_update();\n \tif( !empty( $update) && $update < $this->end){\n \t\t$this->end = $update;\n \t}\n \t// diff between start and end\n \t$start = new \\DateTime( $this->start);\n \t$end = new \\DateTime( $this->end);\n \t$interval = $start->diff( $end);\n \tif( $interval->invert){\n \t\t//end < start\n \t\t$this->error = \"NO_DATA\";\n \t}else{\n\t \tif( $interval->days > 365){\n\t \t\t$start = clone $end;\n\t \t\t$start->sub( new \\DateInterval(\"P364D\"));\n\t \t\t$this->start = $start->format(\"Y-m-d\");\n\t \t}\n \t}\n }", "public function validateDate(){\n \t$attrs = ['requested_at', 'replied_at', 'fixed_begin', 'fixed_end'];\n \tforeach ($attrs as $a){\n \t\tif (is_array($d = $this->getAttribute($a)) && array_key_exists('date', $d) && array_key_exists('time', $d)){\n \t\t\t$fmt = ['Y-m-d H:i:s', 'Y-m-d H:i', 'Y-m-d H', 'Y-m-d '];\n \t\t\tforeach ($fmt as $f){\n\t \t\t\t$date = \\DateTime::createFromFormat($f, $d['date'] . ' ' . $d['time']);\n\t \t\t\tif (is_object($date)){\n\t \t\t\t\t$this->setAttribute($a, $date->format('Y-m-d H:i:s'));\n\t \t\t\t\tbreak;\n\t \t\t\t}\n \t\t\t}\n \t\t}\n \t}\n }", "public function validate_date()\n {\n if( is_null( $this->participant_id ) )\n throw lib::create( 'exception\\runtime',\n 'Cannot validate appointment date, participant id is not set.', __METHOD__ );\n\n $db_participant = lib::create( 'database\\participant', $this->participant_id );\n $db_site = $db_participant->get_primary_site();\n if( is_null( $db_site ) )\n throw lib::create( 'exception\\runtime',\n 'Cannot validate an appointment date, participant has no primary address.', __METHOD__ );\n \n $shift_template_class_name = lib::get_class_name( 'database\\shift_template' );\n $shift_class_name = lib::get_class_name( 'database\\shift' );\n\n // determine the full and half appointment intervals\n $setting_manager = lib::create( 'business\\setting_manager' );\n $half_duration = $setting_manager->get_setting( 'appointment', 'half duration' );\n $full_duration = $setting_manager->get_setting( 'appointment', 'full duration' );\n\n $start_datetime_obj = util::get_datetime_object( $this->datetime );\n $next_day_datetime_obj = clone $start_datetime_obj;\n $next_day_datetime_obj->add( new\\DateInterval( 'P1D' ) );\n $end_datetime_obj = clone $start_datetime_obj;\n $duration = 'full' == $this->type ? $full_duration : $half_duration;\n $end_datetime_obj->add( new \\DateInterval( sprintf( 'PT%dM', $duration ) ) );\n\n // determine whether to test for shifts or shift templates on the appointment day\n $modifier = lib::create( 'database\\modifier' );\n $modifier->where( 'site_id', '=', $db_site->id );\n $modifier->where( 'start_datetime', '>=', $start_datetime_obj->format( 'Y-m-d' ) );\n $modifier->where( 'start_datetime', '<', $next_day_datetime_obj->format( 'Y-m-d' ) );\n\n $diffs = array();\n\n if( 0 == $shift_class_name::count( $modifier ) )\n { // determine slots using shift template\n $modifier = lib::create( 'database\\modifier' );\n $modifier->where( 'site_id', '=', $db_site->id );\n $modifier->where( 'start_date', '<=', $start_datetime_obj->format( 'Y-m-d' ) );\n foreach( $shift_template_class_name::select( $modifier ) as $db_shift_template )\n {\n if( $db_shift_template->match_date( $start_datetime_obj->format( 'Y-m-d' ) ) )\n {\n $start_time_as_int =\n intval( preg_replace( '/[^0-9]/', '',\n substr( $db_shift_template->start_time, 0, -3 ) ) );\n if( !array_key_exists( $start_time_as_int, $diffs ) ) $diffs[$start_time_as_int] = 0;\n $diffs[$start_time_as_int] += $db_shift_template->operators;\n\n $end_time_as_int =\n intval( preg_replace( '/[^0-9]/', '',\n substr( $db_shift_template->end_time, 0, -3 ) ) );\n if( !array_key_exists( $end_time_as_int, $diffs ) ) $diffs[$end_time_as_int] = 0;\n $diffs[$end_time_as_int] -= $db_shift_template->operators;\n }\n }\n }\n else // determine slots using shifts\n {\n $modifier = lib::create( 'database\\modifier' );\n $modifier->where( 'site_id', '=', $db_site->id );\n $modifier->where( 'start_datetime', '<', $end_datetime_obj->format( 'Y-m-d H:i:s' ) );\n $modifier->where( 'end_datetime', '>', $start_datetime_obj->format( 'Y-m-d H:i:s' ) );\n foreach( $shift_class_name::select( $modifier ) as $db_shift )\n {\n $start_time_as_int =\n intval( preg_replace( '/[^0-9]/', '',\n substr( $db_shift->start_datetime, -8, -3 ) ) );\n $end_time_as_int =\n intval( preg_replace( '/[^0-9]/', '',\n substr( $db_shift->end_datetime, -8, -3 ) ) );\n\n if( !array_key_exists( $start_time_as_int, $diffs ) ) $diffs[$start_time_as_int] = 0;\n $diffs[$start_time_as_int]++;\n if( !array_key_exists( $end_time_as_int, $diffs ) ) $diffs[$end_time_as_int] = 0;\n $diffs[$end_time_as_int]--;\n }\n }\n \n // and how many appointments are during this time?\n $modifier = lib::create( 'database\\modifier' );\n $modifier->where( 'datetime', '>=', $start_datetime_obj->format( 'Y-m-d' ) );\n $modifier->where( 'datetime', '<', $next_day_datetime_obj->format( 'Y-m-d' ) );\n if( !is_null( $this->id ) ) $modifier->where( 'appointment.id', '!=', $this->id );\n $appointment_class_name = lib::get_class_name( 'database\\appointment' );\n foreach( $appointment_class_name::select_for_site( $db_site, $modifier ) as $db_appointment )\n {\n $state = $db_appointment->get_state();\n if( 'reached' != $state && 'not reached' != $state )\n { // incomplete appointments only\n $appointment_datetime_obj = util::get_datetime_object( $db_appointment->datetime );\n \n $start_time_as_int = intval( $appointment_datetime_obj->format( 'Gi' ) );\n \n $duration = 'full' == $db_appointment->type ? $full_duration : $half_duration;\n $appointment_datetime_obj->add( new \\DateInterval( sprintf( 'PT%dM', $duration ) ) );\n $end_time_as_int = intval( $appointment_datetime_obj->format( 'Gi' ) );\n \n if( !array_key_exists( $start_time_as_int, $diffs ) ) $diffs[ $start_time_as_int ] = 0;\n $diffs[ $start_time_as_int ]--;\n if( !array_key_exists( $end_time_as_int, $diffs ) ) $diffs[ $end_time_as_int ] = 0;\n $diffs[ $end_time_as_int ]++;\n }\n }\n \n // if we have no diffs on this day, then we have no slots\n if( 0 == count( $diffs ) ) return false;\n\n // use the 'diff' arrays to define the 'times' array\n $times = array();\n ksort( $diffs );\n $num_operators = 0;\n foreach( $diffs as $time => $diff )\n {\n $num_operators += $diff;\n $times[$time] = $num_operators;\n }\n\n // end day with no operators (4800 is used because it is long after the end of the day)\n $times[4800] = 0;\n \n // Now search the times array for any 0's inside the appointment time\n // NOTE: we need to include the time immediately prior to the appointment start time\n $start_time_as_int = intval( $start_datetime_obj->format( 'Gi' ) );\n $end_time_as_int = intval( $end_datetime_obj->format( 'Gi' ) );\n $match = false;\n $last_slots = 0;\n $last_time = 0;\n\n foreach( $times as $time => $slots )\n {\n // check the start time\n if( $last_time <= $start_time_as_int &&\n $time > $start_time_as_int &&\n 1 > $last_slots ) return false;\n\n // check the end time\n if( $last_time < $end_time_as_int &&\n $time >= $end_time_as_int &&\n 1 > $last_slots ) return false;\n\n $last_slots = $slots;\n $last_time = $time;\n }\n \n return true;\n }", "public function validateDate()\n {\n if (\n ($from = $this->getAvailableFrom()) &&\n ($till = $this->getAvailableTill()) &&\n $from->InPast() &&\n $till->InFuture()\n ) {\n return true;\n }\n\n return false;\n }", "public static function areDirtShiftsAvailable()\n {\n return DB::table('slot')\n ->where('slot.active', true)\n ->whereYear('slot.begins', current_year())\n ->where('slot.position_id', Position::DIRT)\n ->exists();\n }", "public function BeforeInsertRecord()\n\t{\n\t\tif(!$this->CheckStartFinishDate()) return false;\n\t\tif(!$this->CheckDateOverlapping()) return false;\n\t\treturn true;\n\t}", "function valid_date($sup,$inf='') {\n\tif (!isset($inf) or $inf == 0) {\n\t\t$inf = date('Y-m-d');\n\t}\n\n\t$defaultTimeZone=\"Europe/Paris\";\n\tif (date_default_timezone_get()!=$defaultTimeZone) date_default_timezone_set($defaultTimeZone);\n\t\n\t// DECOUPE DE LA DATE INF\n\t// VERIFIE date complete yyyy-mm-jj hh:mm:ss\n\tif (strpos($inf, \" \")===false) {\n\t\t$tinf = explode (\"-\", $inf);\n\t\t$tinfheure = array(date(\"H\"),date(\"i\"),date(\"s\"));\n\t}else {\n\t\t$z = explode(\" \",$inf);\n\t\t$tinf = explode (\"-\", $z[0]);\n\t\t$tinfheure = explode (\":\", $z[1]);\n\t}\n\n\t// DECOUPE DE LA DATE SUP\n\t// VERIFIE date complete yyyy-mm-jj hh:mm:ss\n\tif (strpos($sup, \" \")===false) {\n\t\t$tsup = explode (\"-\", $sup);\n\t\t$tsupheure = array(date(\"H\"),date(\"i\"),date(\"s\"));\n\t}else {\n\t\t$z = explode(\" \",$sup);\n\t\t$tsup = explode (\"-\", $z[0]);\n\t\t$tsupheure = explode (\":\", $z[1]);\n\t}\n\n\t$nowt = mktime($tinfheure[0],$tinfheure[1],$tinfheure[2], $tinf[1], $tinf[2], $tinf[0]);\n\t$supt = mktime($tsupheure[0],$tsupheure[1],$tsupheure[2], $tsup[1], $tsup[2], $tsup[0]);\n\tif ($supt >= $nowt) {\n\t\treturn 1;\n\t} else {\n\t\treturn 0;\n\t}\t\n}", "public function has_date( $date ) {\n\t\n\t\treturn in_array( $date, $this->dates );\n\t\n\t}", "public function check_exists(){\n\t\tif(!empty($this->data['Leave']['leave_from']) && !empty($this->data['Leave']['leave_to'])){\n\t\t\t$from = $this->format_date_save($this->data['Leave']['leave_from']);\n\t\t\t$to = $this->format_date_save($this->data['Leave']['leave_to']);\n\t\t\t$count = $this->find('count', array('conditions' => array('or' => array('leave_from between ? and ?' => array($from, $to),\n\t\t\t'leave_to between ? and ?' => array($from, $to)), 'Leave.users_id' => CakeSession::read('USER.Login.id'), \n\t\t\t'Leave.is_deleted'=> 'N', 'Leave.is_approve !=' => 'R')));\n\t\t\tif($count > 0){\n\t\t\t\treturn false;\n\t\t\t}else{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "function canBookRoom($startDate,$endDate,$roomID)\n {\n $result = \"TRUE\";\n $query = $this->db->query(\"SELECT * FROM bookings where roomID = $roomID\");\n if($query->num_rows()>0)\n {\n $bookings=$query->result_array();\n\n\n for ($i =0 ; $i < count($bookings); $i++)\n {\n $bookStartTime = $bookings[$i][\"startDate\"];\n $bookEndTime = $bookings[$i][\"endDate\"];\n\n if ($startDate >= $bookStartTime && $startDate <=$bookEndTime)\n {\n $result = \"FALSE\";\n return $result;\n }\n if ($endDate >= $bookStartTime && $endDate <= $bookEndTime)\n {\n $result = \"FALSE\";\n return $result;\n\n }\n }\n }\n return $result;\n\n }", "public function check() {\n\n // Set name\n $this->title = htmlspecialchars_decode($this->title, ENT_QUOTES);\n\n // Set alias\n $this->alias = JApplication::stringURLSafe($this->alias);\n if (empty($this->alias)) {\n $this->alias = JApplication::stringURLSafe($this->title);\n }\n\n // Check the publish down date is not earlier than publish up.\n if ($this->publish_down > $this->_db->getNullDate() && $this->publish_down < $this->publish_up) {\n $this->setError(JText::_('JGLOBAL_START_PUBLISH_AFTER_FINISH'));\n return false;\n }\n\n return true;\n }", "public function checkWin() {\n\n $data = $this->getDeathRecord();\n $data = array_map(function($d) {\n return $d[key($d)];\n }, $data);\n\n if ($data) {\n if (in_array(\"FARMER\", $data)) {\n return FALSE;\n }\n if (in_array(\"COW_1\", $data) && in_array(\"COW_2\", $data)) {\n return FALSE;\n }\n if (in_array(\"BUNNY_1\", $data) && in_array(\"BUNNY_2\", $data) && in_array(\"BUNNY_4\", $data) && in_array(\"BUNNY_4\", $data)) {\n return FALSE;\n }\n }\n return true;\n }", "public function hasStudySummaries() {\n return $this->_has(18);\n }", "public function executionDateExceed(){\n\t\t// Program : Execution Date Exceed\n\t\t\t $totalSiaNumber=DB::table('sia_program')->where('date','<',date('Y-m-d'))->lists('sia_number');\n\t\t\t $executedSiaNumber=DB::table('sia_action')->lists('sia_number');\n\t\t\t $notExecuted=array_diff($totalSiaNumber,$executedSiaNumber);\n\t\t\t// $numberOfNotExecutedSia=count($notExecuted);\n\n\t\treturn View::make('surveillance.notiExecutionDateExceed')\n\t\t\t\t\t\t->with('PageName','Execution Date Exceed List')\n\t\t\t\t\t\t->with('active','sia')\n\t\t\t\t\t\t->with('notExecuted',$notExecuted)\n\t\t\t\t\t\t\n\t\t\t\t;\n\t}", "public function isSameDay()\n {\n $this->getSameDay();\n }", "public function allowedForOvertime()\n { return (($this->esgrp == 'ES') || ($this->esgrp == 'EF') || ($this->esgrp == 'F')) ? true : 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 hasPastManagers()\n {\n return $this->pastManagers->isNotEmpty();\n }", "function isEvent($var){\n\tif ($this->calEvents){\n\t\t$checkTime=$this->mkActiveTime(0,0,1,$this->actmonth,$var,$this->actyear);\n\t\t$selectedTime=$this->mkActiveTime(0,0,1,$this->selectedmonth,$this->selectedday,$this->selectedyear);\n\t\t$todayTime=$this->mkActiveTime(0,0,1,$this->monthtoday,$this->daytoday,$this->yeartoday);\n\t\tforeach($this->calEvents as $eventTime => $eventID){\n\t\t\tif ($eventTime==$checkTime){\n\t\t\t\tif ($eventTime==$selectedTime) $this->eventID=$this->cssPrefixSelecEvent.$eventID;\n\t\t\t\telseif ($eventTime==$todayTime) $this->eventID=$this->cssPrefixTodayEvent.$eventID;\n\t\t\t\telse $this->eventID=$eventID;\n\t\t\t\tif ($this->calEventsUrl[$eventTime]) $this->eventUrl=$this->calEventsUrl[$eventTime];\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\treturn false;\n\t}\n}", "private function __checkIfExistsOfSchedule(Model $schedule_model,$room_id,$start,$end)\r\n\t{\r\n\t\t$conditions=array();\r\n\t\t//$start=\"20180101\";\r\n\t\t$schedule_model->unbindFully();\r\n\t\t$conditions[\"and\"][\"CONCAT({$schedule_model->name}.start_month_prefix,lpad({$schedule_model->name}.start_day,2,0)) between ? AND ?\"]=array($start,$end);\r\n\t\t$conditions[\"and\"][\"{$schedule_model->name}.del_flg\"]=0;\r\n\r\n\t\t//the last day of schedule indivisually.\r\n\t\t$conditions[]=\"1=1 group by {$schedule_model->name}.reserve_id\";\r\n\t\t$fields=array(\"{$schedule_model->name}.reserve_id\",\"MAX(CONCAT({$schedule_model->name}.start_month_prefix,lpad({$schedule_model->name}.start_day,2,0))) as date\");\r\n\t\t$data=$schedule_model->find(\"all\",array(\"conditions\"=>$conditions,\"fields\"=>$fields));\r\n\t\tif(empty($data)) return true;\r\n\r\n\t\t//target reservations.\r\n\t\t$reserve_ids=array_unique(Set::extract($data,\"{}.{$schedule_model->name}.reserve_id\"));\r\n\t\t$schedule_lastdays=Set::combine($data,\"{n}.{$schedule_model->name}.reserve_id\",\"{}.0.date\");\r\n\r\n\t\t//$room_id=3;\r\n\t\t$conditions=array();\r\n\t\t$association=$this->K9DataReservation->association[\"hasMany\"][\"K9DataSchedulePlan\"];\r\n\t\t//$association[\"conditions\"][\"K9DataSchedulePlan.room_id\"]=$room_id;\r\n\t\t$association[\"conditions\"][\"K9DataSchedulePlan.del_flg\"]=0;\r\n\t\t$association[\"order\"]=array(\"K9DataSchedulePlan.start DESC\");\r\n\t\t$conditions[\"and\"][\"K9DataReservation.id\"]=$reserve_ids;\r\n\t\t$this->K9DataReservation->bindModel(array(\"hasMany\"=>array(\"K9DataSchedulePlan\"=>$association)));\r\n\t\t$this->K9DataReservation->unbindModel(array(\"belongsTo\"=>array(\"K9DataGuest\")));\r\n\t\t$data=$this->K9DataReservation->find(\"all\",array(\"conditions\"=>$conditions));\r\n\t\t//there is no posivily can't find reservation based on reservation_ids;\r\n\t\t//if(empty($data)) throw new Exception(__(\"正常に処理が終了しませんでした\"));\r\n\r\n\t\t//it shuld be ununique data dosen't come from frontside but just in case this function is being working here.\r\n\t\t$res=$this->__checkIfHasAlreadySetOn($room_id,$data,$schedule_lastdays,array( \"start\"=>$start,\"end\"=>$end ));\r\n\t\tif(empty($res)) return false;\r\n\t\treturn true;\r\n\t}", "public function isAnyGuysOnThisDay($date,$ta,$srt,$cat=0){\n\t\tif(!$this->getStatusLockPublic())\n\t\t\theader(\"location:\".base_url().\"gateinout.aspx\");\n\t\t$this->setHelper('date');\n\t\t//$this->setModel('');\n\t\tif(nice_date($date,\"Y-m-d h:i:s\") == 'Invalid Date')\n\t\t\treturn $this->setCategoryPrintMessage($cat, false, \"anda melakukan debugging terhadap format date\");\n\t\t$this->setModel('sc_sst');\n\t\t$time = nice_date($date,\"h:i:s\");\n\t\t$date = nice_date($date,\"Y-m-d\");\n\t\t//$temp = $this->sc_sst->query(\"s_time as time\",\"s_date='\".$date.\"'\")->result();\n\t\t$this->sc_sst->openPermission('mahasiswa',\"Lock.Mahasiswa.Open.Methode.JaservTech\");\n\t\t$temp = $this->sc_sst->getTimeEventRoomOnDate($srt,$date);\n\t\tif(isset($temp)){\n\t\t\tforeach ($temp as $value){\n\t\t\t\techo $value->timeSeminarTA.\"<br>\";\n\t\t\t\t$hour = intval(nice_date($value->timeSeminarTA,\"h\"));\n\t\t\t\t$minute = intval(nice_date($value->timeSeminarTA,\"i\"));\n\t\t\t\t$hourN = intval(nice_date($time,\"h\"));\n\t\t\t\t$minuteN = intval(nice_date($time,\"i\"));\n\t\t\t\tif($ta == 1 ){\n\t\t\t\t\t$jam = 2;\n\t\t\t\t}else if($ta == 2){\n\t\t\t\t\t$jam = 3;\n\t\t\t\t}else{\n\t\t\t\t\treturn $this->setCategoryPrintMessage($cat, false, \"anda melakukan debugging terhadap input ta\");\n\t\t\t\t}\n\t\t\t\tif($hour <= $hourN){\n\t\t\t\t\tif($hour+$jam > $hourN){\n\t\t\t\t\t\treturn $this->setCategoryPrintMessage($cat, false, \"jam sudah ada yang mengambil\");\n\t\t\t\t\t}else if($hour+$jam == $hourN){\n\t\t\t\t\t\tif($minute > $minuteN){\n\t\t\t\t\t\t\treturn $this->setCategoryPrintMessage($cat, false, \"Jam sudah ada yang mengambil\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\tif($hour < $hourN+$jam){\n\t\t\t\t\t\treturn $this->setCategoryPrintMessage($cat, false, \"jam sudah ada yang mengambil\");\n\t\t\t\t\t}else if($hour == $hourN+$jam){\n\t\t\t\t\t\tif($minute < $minuteN){\n\t\t\t\t\t\t\treturn $this->setCategoryPrintMessage($cat, false, \"Jam sudah ada yang mengambil\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn $this->setCategoryPrintMessage($cat, true, \"valid\");\n\t\t\t}\n\t\t}\n\t\treturn $this->setCategoryPrintMessage($cat, true, \"valid\");\n\t\t\n\t}", "public function shouldExecute()\n\t{\n\t\t// date range check\n\t\tif( strtotime($this->start_date) > utc_time() || strtotime($this->end_date) < utc_time() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// time range check, for the current day-of-week\n\t\t$dow_abbrevs = [null, 'mon', 'tues', 'wed', 'thurs', 'fri', 'sat', 'sun'];\n\t\t$dow_int = utc_date()->format('N');\t// 1 = mon, 7 = sun\n\t\t$dow = $dow_abbrevs[$dow_int];\n\t}", "private function _reloadSemesterSchedule ( $semester ) {\n $request = $this->CacheRequest->find( 'first', array(\n 'conditions' => array( 'CacheRequest.idul' => $this->Session->read( 'User.idul' ), 'CacheRequest.name' => 'schedule-' . $semester )\n ) );\n if ( !empty( $request ) ) {\n $md5Hash = array( $request[ 'CacheRequest' ][ 'name' ] => $request[ 'CacheRequest' ][ 'md5' ] );\n } else {\n $md5Hash = array();\n }\n\n\t\t// Reload schedule from Capsule\n\t\t$this->Capsule->forceReload = true;\n\t\t$result = $this->Capsule->getSchedule( $md5Hash );\n\n\t\t// Similar data have been found in DB (not reloaded)\n if ( !$result ) {\n // Unknown error\n return false;\n } elseif ( $result[ 'status' ] ) {\n // Delete user's schedule saved in DB for the registration semester\n $this->User->ScheduleSemester->deleteAll( array(\n 'ScheduleSemester.idul' \t=> $this->Session->read( 'User.idul' ),\n 'ScheduleSemester.semester'\t=>\t$semester\n ) );\n\n // Save schedule data\n $this->User->ScheduleSemester->saveAll( $result[ 'schedule' ], array( 'deep' => true ) );\n\n // Update last data checkup timestamp\n foreach ( $result[ 'md5Hash' ] as $name => $hash ) {\n $this->CacheRequest->saveRequest( $this->Session->read( 'User.idul' ), $name, $hash );\n }\n\n $this->CacheRequest->saveRequest( $this->Session->read( 'User.idul' ), 'schedule' );\n\n return true;\n }\n\t}", "private function isWeekend() \n {\n return (date('N') >= 6);\n }", "static function isWeekend($date) {\n \treturn (date('N', $date) >= 5);\n\t}", "private function Check_File_Semester($semester,$year,$file_name)\n {\n $file_name = substr($file_name, 0, -4);\n $file_name = explode(\"_\",$file_name);\n $prefix = count($file_name);\n if($file_name[$prefix -1 ] == $year && $file_name[$prefix - 2 ] == $semester )\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "public static function hasReservationsTimeSlots() {\n $idTimeSlot = $_REQUEST[\"idTimeSlot\"];\n $result = DB::dataQuery(\"SELECT * FROM timeslots WHERE idTimeSlot = '$idTimeSlot'\");\n if($result != null && count($result)>0){\n return true;\n }else{\n return false;\n }\n }", "private function checkSevenDayInCol():bool\n {\n $stmt = $this->pdo->query(\"SHOW COLUMNS FROM `distribution_municipalities` LIKE '%_sevendayin'\");\n return !is_bool($stmt->fetch());\n }", "function isCalendarCompleted()\n {\n if ($this->isCalendarCompleted === null) {\n $this->isCalendarCompleted = true;\n $configuration = $this->configuration;\n if ($configuration->isCalendar()) {\n if (!empty($configuration->getCalendar())) {\n foreach ($configuration->getCalendar() as $month => $days) {\n foreach ($days as $day => $prayers) {\n foreach ($prayers as $prayerIndex => $prayer) {\n if (empty($prayer)) {\n $this->isCalendarCompleted = false;\n }\n }\n }\n }\n }\n }\n }\n return $this->isCalendarCompleted;\n }", "public function isWeekend($date);", "function checkRefreshDate($refreshdate)\n{\n \n if($refreshdate < (time()-(60*60*24*21)))\n {\n return true;\n }\n else\n {\n return false;\n }\n}", "function check_date( $day, $month, $year )\n{\n if ( ( 12 <= $month && $month <= 31 ) && $day <= 12 )\n {\n $m = $month;\n $month = $day;\n $day = $m;\n };\n\n if ( $day > 31 || $month > 12 )\n {\n return array( FALSE, array() );\n };\n\n if ( ! ( ( 1900 <= $year && $year <= 2019 ) ) )\n {\n return array( FALSE, array() );\n }\n\n return array( TRUE, array( $day, $month, $year ) );\n}", "public function checkDateOccurrenceByGameId($instant_win)\n {\n $now = new \\DateTime(\"now\");\n $now = $now->format('Y-m-d H:i:s');\n\n $query = $this->em->createQuery(\n 'SELECT i FROM PlaygroundGame\\Entity\\InstantWinOccurrence i\n WHERE i.instantwin = :game\n AND i.active = 1\n AND i.value <= :now\n ORDER BY i.value DESC\n '\n );\n $query->setParameter('game', $instant_win);\n $query->setParameter('now', $now);\n $query->setMaxResults(1);\n $result = $query->getResult();\n\n if (count($result) == 1) {\n return current($result);\n } else {\n return null;\n }\n }", "function checkDataInTable($noOfDays){\n $listOfWorkingDays = getWorkingDays($noOfDays);\n $listOfRecordedDates = getRecordDates($noOfDays);\n $result = array_diff($array1, $array2);\n if(empty($result)){\n $result = array_diff($array1, $array2);\n }\n return $result;\n}", "public function isWorkingDay()\r\n {\r\n $dayWeek = $this->getDayOfWeek();\r\n\r\n if ($dayWeek >= 6)\r\n {\r\n return FALSE;\r\n }\r\n\r\n return TRUE;\r\n }", "public function isWeekday()\n {\n return ! $this->isWeekend();\n }", "public function isValidDate() {\n\t\t// TODO\n\t\treturn TRUE;\n\t}" ]
[ "0.6079869", "0.5817621", "0.5561663", "0.5528896", "0.5523777", "0.55085075", "0.5504671", "0.54375416", "0.5417533", "0.53976905", "0.53973454", "0.5385209", "0.5348545", "0.5316661", "0.5313944", "0.5313737", "0.53029484", "0.53021604", "0.53001446", "0.5274669", "0.5261718", "0.5251922", "0.524827", "0.5233669", "0.5225234", "0.52215403", "0.52074933", "0.5193355", "0.5133145", "0.512916", "0.51166695", "0.51166695", "0.51125145", "0.51074153", "0.51046103", "0.5086849", "0.50808567", "0.5080334", "0.5066375", "0.50378627", "0.50290865", "0.5011047", "0.5003209", "0.49977678", "0.49977678", "0.4990395", "0.49900562", "0.498515", "0.4980566", "0.4976636", "0.4975629", "0.49707764", "0.49572763", "0.49439737", "0.4936713", "0.4929218", "0.49243414", "0.49227044", "0.49182588", "0.49123168", "0.49049667", "0.49018908", "0.48986202", "0.4897115", "0.48932326", "0.4891479", "0.48911887", "0.48899272", "0.4886032", "0.48760843", "0.48758432", "0.48751014", "0.48685193", "0.4868063", "0.48657364", "0.48617104", "0.4861259", "0.48610997", "0.48522496", "0.48374358", "0.48362136", "0.48341268", "0.48331723", "0.4831737", "0.48307663", "0.48255473", "0.4818774", "0.48165572", "0.4809899", "0.4809224", "0.480768", "0.4798972", "0.47980788", "0.47972637", "0.47899404", "0.47887626", "0.47838593", "0.4782232", "0.47816703", "0.47805235" ]
0.62588704
0
Method to update window dates in the windows table for a given semester if they have already been set
public function updateDates($array){ $sql="UPDATE windows SET appOpen=?, appClose=?, commentOpen=?, commentClose=? WHERE semester=?"; $data[0]=$array['appfrom']; $data[1]=$array['appto']; $data[2]=$array['commentfrom']; $data[3]=$array['commentto']; $data[4]=$array['season'] . ' ' . $array['year']; $bol=$this->db->query($sql,$data); if($bol) return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update_week(){\n\t\t$time = array('id'=>1, 'ending_date' => date('Y-m-d'));\n\t\treturn $this->save($time);\n\t}", "public function update(Request $request, Semester $semester)\n {\n $validate=$request->validate([\n 'name' => 'required',\n 'year' => 'required',\n 'examDate' => 'required',\n\n ]);\n\n\n if ($request->input('current') == 'on') {\n $current=1;\n }else {\n $current=0;\n }\n\n $updateSemester=Semester::where('id',$semester->id)->update([\n 'name'=>$request->input('name'),\n 'year_id'=>$request->input('year'),\n 'exam_date'=>$request->input('examDate'),\n 'current' =>$current,\n ]);\n\n flash('Semester updated')->success()->important();\n return redirect()->route('semester.index');\n }", "private function _reloadSemesterSchedule ( $semester ) {\n $request = $this->CacheRequest->find( 'first', array(\n 'conditions' => array( 'CacheRequest.idul' => $this->Session->read( 'User.idul' ), 'CacheRequest.name' => 'schedule-' . $semester )\n ) );\n if ( !empty( $request ) ) {\n $md5Hash = array( $request[ 'CacheRequest' ][ 'name' ] => $request[ 'CacheRequest' ][ 'md5' ] );\n } else {\n $md5Hash = array();\n }\n\n\t\t// Reload schedule from Capsule\n\t\t$this->Capsule->forceReload = true;\n\t\t$result = $this->Capsule->getSchedule( $md5Hash );\n\n\t\t// Similar data have been found in DB (not reloaded)\n if ( !$result ) {\n // Unknown error\n return false;\n } elseif ( $result[ 'status' ] ) {\n // Delete user's schedule saved in DB for the registration semester\n $this->User->ScheduleSemester->deleteAll( array(\n 'ScheduleSemester.idul' \t=> $this->Session->read( 'User.idul' ),\n 'ScheduleSemester.semester'\t=>\t$semester\n ) );\n\n // Save schedule data\n $this->User->ScheduleSemester->saveAll( $result[ 'schedule' ], array( 'deep' => true ) );\n\n // Update last data checkup timestamp\n foreach ( $result[ 'md5Hash' ] as $name => $hash ) {\n $this->CacheRequest->saveRequest( $this->Session->read( 'User.idul' ), $name, $hash );\n }\n\n $this->CacheRequest->saveRequest( $this->Session->read( 'User.idul' ), 'schedule' );\n\n return true;\n }\n\t}", "public function changeWeek(Request $request,$next_date){\n\n $start_date=Carbon::parse($next_date)->addDay(1);\n $date = Carbon::parse($next_date)->addDay(1);\n\n \n $end_date=Carbon::parse($start_date)->addDay(7);\n $this_week= $week_number = $end_date->weekOfYear;\n \n $period = CarbonPeriod::create($start_date, $end_date);\n \n\n $dates=[];\n foreach ($period as $date){\n $dates[] = $date->format('Y-m-d');\n \n }\n \n if (ApiBaseMethod::checkUrl($request->fullUrl())) {\n $user_id = $id;\n } else {\n $user = Auth::user();\n\n if ($user) {\n $user_id = $user->id;\n } else {\n $user_id = $request->user_id;\n }\n }\n\n $student_detail = SmStudent::where('user_id', $user_id)->first();\n //return $student_detail;\n $class_id = $student_detail->class_id;\n $section_id = $student_detail->section_id;\n\n $sm_weekends = SmWeekend::orderBy('order', 'ASC')->where('active_status', 1)->where('school_id',Auth::user()->school_id)->get();\n\n $class_times = SmClassTime::where('type', 'class')->where('academic_id', getAcademicId())->where('school_id',Auth::user()->school_id)->get();\n\n if (ApiBaseMethod::checkUrl($request->fullUrl())) {\n $data = [];\n $data['student_detail'] = $student_detail->toArray();\n $weekenD = SmWeekend::all();\n foreach ($weekenD as $row) {\n $data[$row->name] = DB::table('sm_class_routine_updates')\n ->select('sm_class_times.period', 'sm_class_times.start_time', 'sm_class_times.end_time', 'sm_subjects.subject_name', 'sm_class_rooms.room_no')\n ->join('sm_classes', 'sm_classes.id', '=', 'sm_class_routine_updates.class_id')\n ->join('sm_sections', 'sm_sections.id', '=', 'sm_class_routine_updates.section_id')\n ->join('sm_class_times', 'sm_class_times.id', '=', 'sm_class_routine_updates.class_period_id')\n ->join('sm_subjects', 'sm_subjects.id', '=', 'sm_class_routine_updates.subject_id')\n ->join('sm_class_rooms', 'sm_class_rooms.id', '=', 'sm_class_routine_updates.room_id')\n\n ->where([\n ['sm_class_routine_updates.class_id', $class_id], ['sm_class_routine_updates.section_id', $section_id], ['sm_class_routine_updates.day', $row->id],\n ])->where('sm_class_routine_updates.academic_id', getAcademicId())->where('sm_classesschool_id',Auth::user()->school_id)->get();\n }\n\n return ApiBaseMethod::sendResponse($data, null);\n }\n\n return view('lesson::student.student_lesson_plan', compact('dates','this_week','class_times', 'class_id', 'section_id', 'sm_weekends'));\n \n }", "public function update_date_ranges()\r\n\t{\r\n\t\t// So give INSERT and UPDATE their own code blocks, rather than try to combine them in one statement.\r\n\t\t$tbl = 'codes';\r\n\t\t$where = 'WHERE groupID = 7';\r\n\t\t$sql = \"SELECT ID FROM $tbl $where\";\r\n\t\t$r = $this->db->query($sql);\r\n\t\t// Using static keys, to align with quarter numbers. \r\n\t\t$field_vals[1] = $this->input->post('winter_open') . '|' . $this->input->post('winter_closed');\r\n\t\t$field_vals[2] = $this->input->post('spring_open') . '|' . $this->input->post('spring_closed');\r\n\t\t$field_vals[3] = $this->input->post('summer_open') . '|' . $this->input->post('summer_closed');\r\n\t\t$field_vals[4] = $this->input->post('autumn_open') . '|' . $this->input->post('autumn_closed');\r\n\r\n\t\tif (! $r->num_rows()) // Group 7 doesn't exist.\r\n\t\t{\r\n\t\t\tfor ($i = 1; $i < 5; $i++)\r\n\t\t\t{\r\n\t\t\t\t$insert_vals[] = \"(7, $i, '{$field_vals[$i]}')\";\r\n\t\t\t}\r\n\t\t\t$fields = implode(',', $insert_vals);\r\n\t\t\t$sql = \"INSERT INTO codes (groupID, ID, description) VALUES $fields\";\r\n\t\t\t$this->db->query($sql);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$sql = \"UPDATE $tbl SET description = ? WHERE groupID = 7 and ID = ?\";\r\n\t\t\tfor ($i = 1; $i < 5; $i++)\r\n\t\t\t{\r\n\t\t\t\t$this->db->query($sql, [$field_vals[$i], $i]); // Array holds values for `description` and `id`.\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function testUpdate_Semesters($link, $semester_id) {\n\t\t$semester = Semester::select($link, $semester_id);\n\t\t\n\t\t// set attributes\n $year \t\t\t= $semester->year;\n $term \t\t\t= $semester->term;\n\t\t\n\t\t// perform update operation\n\t\tswitch($semester_id % 2) {\n\n\t\t\tcase(0):\n\t\t\t\tSemester::update($link, $semester_id, 9999, $term);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tcase(1):\n\t\t\t\tSemester::update($link, $semester_id, 0000, $term);\n\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\tdefault:\n\t\t\t\techo \"semester id does not exist.\";\n\t\t\t\tbreak;\n\t\t}\n\t}", "public static function updateSched($sched) {\n //LoginDao::authenticateSchedId($sched->id);\n /*\n $d = dateToString($sched->date);\n $sql = \"UPDATE scheds SET \";\n $sql .= \"date=\" . quote($d);\n $sql .= \", time_start=\" . quote($sched->timeStart);\n $sql .= \", timestamp=\" . quote($d . \" \" . SchedDao::div($sched->timeStart, 100) . \":\" . ($sched->timeStart % 100));\n $sql .= \", duration=\" . quote($sched->duration);\n $sql .= \", status=\" . quote($sched->status);\n $sql .= \", comment=\" . quote($sched->comment, true);\n $sql .= \", type=\" . quote($sched->type);\n $sql .= \" WHERE sched_id=\" . $sched->id;\n query($sql);\n */\n $appt = ApptEdit::from($sched);\n $appt->save();\n if (isset($sched->schedEvent)) {\n $event = SchedEvent::from($sched->schedEvent);\n /*\n $sql = \"UPDATE sched_events SET \";\n $sql .= \"rp_type=\" . quote($sched->schedEvent->type);\n $sql .= \", rp_every=\" . quote($sched->schedEvent->every);\n $sql .= \", rp_until=\" . quoteDate($sched->schedEvent->until);\n $sql .= \", rp_on=\" . quote($sched->schedEvent->on);\n $sql .= \", rp_by=\" . quote($sched->schedEvent->by);\n $sql .= \", comment=\" . quote($sched->schedEvent->comment);\n $sql .= \" WHERE sched_event_id=\" . $sched->schedEvent->id;\n query($sql);\n */\n $event->save();\n }\n if (isSet($sched->schedEvent)) {\n $sched->schedEvent->maxRepeatDate = SchedDao::repeatSched($sched);\n }\n /*\n if ($sched->clientId && $sched->clientId != 0) {\n AuditDao::log($sched->clientId, AuditDao::ENTITY_SCHED, $sched->id, AuditDao::ACTION_UPDATE, null, CommonCombos::getApptTypeDesc($sched->type));\n // SchedDao::saveClientUpdate(new ClientUpdate($sched->clientId, ClientUpdate::TYPE_APPT_UPDATED, $sched->id, CommonCombos::getApptTypeDesc($sched->type)));\n }\n */\n return $sched;\n }", "function insertGamesToDate() {\n $conn = getConnection();\n $yesterdayDate = date('Y-m-d',strtotime(\"-1 days\"));\n\n $url = \"https://statsapi.web.nhl.com/api\";\n $all_games = \"/v1/schedule?startDate=2018-10-03&endDate=\".$yesterdayDate;\n\n $jsonString = file_get_contents($url.$all_games);\n $jsonObject = json_decode($jsonString);\n $sql = \"INSERT INTO Games_ToDate VALUES \";\n $jsonObject = $jsonObject -> dates;\n\n // populate associative array of win streaks for teams\n $streakArray = array();\n $dayBeforeGames = array();\n $dayOfGames = array();\n $teams_from_db = $conn -> query(\"SELECT id FROM teams\");\n while($row = $teams_from_db -> fetch_assoc()) {\n $streakArray = array_push_assoc($streakArray, $row['id'], 0);\n $dayBeforeGames = array_push_assoc($dayBeforeGames, $row['id'], 0);\n $dayOfGames = array_push_assoc($dayOfGames, $row['id'], 0);\n }\n\n // loop through json object of all games from last year\n foreach($jsonObject as $key => $item) {\n $date = $item->date;\n\n // move values from dayOfGames to dayBeforeGames\n // the make all day of games 0\n foreach($dayOfGames as $key => $value) {\n $dayBeforeGames[$key] = $value;\n $dayOfGames[$key] = 0;\n }\n\n for($i = 0; $i < sizeof($item->games); $i++) {\n // store home and away teams\n $home_id = $item->games[$i]->teams->home->team->id;\n $away_id = $item->games[$i]->teams->away->team->id;\n\n // loop through day of games and update values to 1 of teams playing\n foreach($dayOfGames as $key => $value) {\n if($value == $home_id) {\n $dayOfGames[$key] = 1;\n }elseif($key == $away_id) {\n $dayOfGames[$key] = 1;\n }\n }\n\n // ignore games from all star weekend\n if($home_id == 90 || $home_id == 89|| $home_id == 88 || $home_id == 87) {\n continue;\n }\n\n //ignore non NHL team that played this year\n if($home_id == 7202) {\n continue;\n }\n\n // score of the game to determine winner\n $homeScore = $item->games[$i]->teams->home->score;\n $awayScore = $item->games[$i]->teams->away->score;\n\n // store current streaks for teams\n $homeStreak = $streakArray[$home_id];\n $awayStreak = $streakArray[$away_id];\n\n // determine winner and store winner (winner is 1 for home team and 0 for away)\n // store wins for home and away teams\n // winning team is wins -1 because api store wins based on outcome of current game\n if($homeScore > $awayScore) {\n $winner = 1;\n $winner_id = $home_id;\n\n // update streaks for both teams\n $streakArray[$winner_id]++;\n $streakArray[$away_id] = 0;\n $home_wins = $item->games[$i]->teams->home->leagueRecord->wins - 1;\n $away_wins = $item->games[$i]->teams->away->leagueRecord->wins;\n } else {\n $winner = 0;\n $winner_id = $away_id;\n\n // update streaks for both teams\n $streakArray[$winner_id]++;\n $streakArray[$home_id] = 0;\n $away_wins = $item->games[$i]->teams->away->leagueRecord->wins - 1;\n $home_wins = $item->games[$i]->teams->home->leagueRecord->wins;\n }\n // add game states to sql for insert\n $sql .= \"(\".$home_id.\", \".$away_id.\", \".$home_wins.\", \".$away_wins.\", \".$homeStreak.\", \".$awayStreak.\", \".$dayBeforeGames[$home_id].\", \".$dayBeforeGames[$away_id].\", \".$winner.\", '\".$date.\"'),\";\n }\n }\n // replace last comma with a semicolon\n $sql = substr($sql, 0, -1).\";\";\n\n // insert to db\n $conn -> query($sql);\n }", "protected function updateLeagueStandings()\n {\n $conditions = array('needs_standings_update' => true);\n $fields = array('_id');\n $leagues_needing_update = Leagues::all(compact('conditions', 'fields'));\n }", "public function setDays($regNr, $ssNr) {\n // Selecting the right row from history table bases on the personal number and registration number to update on right place.\n $historyQuery = \"SELECT * FROM history WHERE regNr = :regNr AND ssNr = :ssNr ORDER BY checkOutTime DESC LIMIT 1\";\n $historyStatement = $this->db->prepare($historyQuery);\n $historyParameters = [\"regNr\" => $regNr, \"ssNr\" => $ssNr];\n $historyRows = $historyStatement->execute($historyParameters);\n if (!$historyRows) die(\"Fatal Error\");\n \n // Fetching the checkin and checkout time from row selected above.\n $time = $historyStatement->fetch();\n $checkOut = $time[\"checkOutTime\"];\n $checkIn = $time[\"checkInTime\"];\n \n // Redefining times as Datetime-objects.\n $checkOutTime = new \\DateTime($checkOut);\n $checkInTime = new \\DateTime($checkIn);\n \n // Adding days, hours, minutes and seconds to total amount of minutes car has been rented.\n $difference = $checkOutTime->diff($checkInTime);\n $minutes = $difference->days * 24 * 60;\n $minutes += $difference->h * 60;\n $minutes += $difference->i;\n $minutes += $difference->s / 60;\n \n // Divide minutes with minutes in an hour and then hours in a day to get the amount in days and then rounding it up so we get amount of started days.\n $unroundedDays = $minutes / 60 / 24;\n $days = ceil($unroundedDays);\n \n // Updating history row we selected above with the total amount of days started.\n $historyQuery = \"UPDATE history SET days = :days WHERE regNr = :regNr AND ssNr = :ssNr ORDER BY checkOutTime DESC LIMIT 1\";\n $historyStatement = $this->db->prepare($historyQuery);\n $historyParameters = [\"days\" => $days, \"regNr\" => $regNr, \"ssNr\" => $ssNr];\n $historyStatement->execute($historyParameters);\n if (!$historyStatement) die(\"Fatal Error\");\n \n }", "function wfCalendarRefresh()\n{\n global $wgRequest, $wgTitle, $wgScriptPath;\n // this is the \"refresh\" code that allows the calendar to switch time periods\n $v = $wgRequest->getValues();\n if (isset($v[\"calendar_info\"]))\n {\n $today = getdate(); // today\n $temp = explode(\"`\", $v[\"calendar_info\"]); // calling calendar info (name, title, etc..)\n\n // set the initial values\n $month = $temp[0];\n $day = $temp[1];\n $year = $temp[2];\n $title = $temp[3];\n $name = $temp[4];\n\n // the yearSelect and monthSelect must be on top... the onChange triggers\n // whenever the other buttons are clicked\n if (isset($v[\"yearSelect\"]))\n $year = $v[\"yearSelect\"];\n if (isset($v[\"monthSelect\"]))\n $month = $v[\"monthSelect\"];\n\n if (isset($v[\"yearBack\"]))\n --$year;\n if (isset($v[\"yearForward\"]))\n ++$year;\n\n if (isset($v[\"today\"]))\n {\n $day = $today['mday'];\n $month = $today['mon'];\n $year = $today['year'];\n }\n\n if (isset($v[\"monthBack\"]))\n {\n $year = ($month == 1 ? --$year : $year);\n $month = ($month == 1 ? 12 : --$month);\n }\n\n if (isset($v[\"monthForward\"]))\n {\n $year = ($month == 12 ? ++$year : $year);\n $month = ($month == 12 ? 1 : ++$month);\n }\n\n if (isset($v[\"weekBack\"]))\n {\n $arr = getdate(mktime(12, 0, 0, $month, $day-7, $year));\n $month = $arr['mon'];\n $day = $arr['mday'];\n $year = $arr['year'];\n }\n\n if (isset($v[\"weekForward\"]))\n {\n $arr = getdate(mktime(12, 0, 0, $month, $day+7, $year));\n $month = $arr['mon'];\n $day = $arr['mday'];\n $year = $arr['year'];\n }\n\n if (wfCalendarIsValidMode($v[\"viewSelect\"]))\n $mode = $v[\"viewSelect\"];\n\n $p = \"cal\".crc32(\"$title $name\");\n $v = sprintf(\"%04d-%02d-%02d-%s\", $year, $month, $day, $mode);\n\n // reload the page... clear any purge commands that may be in it from an ical load...\n $url = $wgTitle->getFullUrl(array($p => $v));\n header(\"Location: \" . $url);\n exit;\n }\n}", "public static function addShift($request)\n {\t\n\t\t$getDate = UserShifts::where('date',$request['date'])->get();\n\t\tif(count($getDate) > 0) {\n\t\t\tforeach($getDate as $gd) {\n\t\t\t\tif($gd->date == $request['date'] && $gd->user_id == $request['user_id']) {\n\t\t\t\t\t$update = DB::table('user_shifts')\n\t\t\t\t\t->where(['user_id' => $request['user_id'], 'date' => $request['date']])\n\t\t\t\t\t->update(array('shift' => $request['shift'],'ps_color' => $request['ps_color'],'ps_desc' => $request['ps_desc']));\n\t\t\t\t\treturn $update;\n\t\t\t\t} else {\n\t\t\t\t$shift = UserShifts::create([\n\t\t\t\t\t'shift' => $request['shift'],\n\t\t\t\t\t'ps_color' => $request['ps_color'],\n\t\t\t\t\t'ps_desc' => $request['ps_desc'],\n\t\t\t\t\t'date' => $request['date'],\n\t\t\t\t\t'user_id' => $request['user_id'],\n\t\t\t\t\t'shift_type_id' => 5,\n\t\t\t\t\t'loc_id'=>0\n\t\t\t\t]);\n\t\t\t\treturn $shift;\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t$shift = UserShifts::create([\n 'shift' => $request['shift'],\n\t\t\t'ps_color' => $request['ps_color'],\n\t\t\t'ps_desc' => $request['ps_desc'],\n 'date' => $request['date'],\n 'user_id' => $request['user_id'],\n\t\t\t'shift_type_id' => 5,\n\t\t\t'loc_id'=>0\n ]);\n\t\treturn $shift;\n\t\t}\n }", "public function changeWeek($next_date)\n{\n try {\n $start_date=Carbon::parse($next_date)->addDay(1);\n $date = Carbon::parse($next_date)->addDay(1);\n\n\n $end_date=Carbon::parse($start_date)->addDay(7);\n $this_week= $week_number = $end_date->weekOfYear;\n\n $period = CarbonPeriod::create($start_date, $end_date);\n\n\n $dates=[];\n foreach ($period as $date){\n $dates[] = $date->format('Y-m-d');\n\n }\n\n $login_id = Auth::user()->id;\n $teachers = SmStaff::where('active_status', 1)->where('user_id',$login_id)->where('role_id', 4)->where('school_id', Auth::user()->school_id)->first();\n\n $user = Auth::user();\n $class_times = SmClassTime::where('academic_id', getAcademicId())->where('school_id', Auth::user()->school_id)->orderBy('period', 'ASC')->get();\n $teacher_id =$teachers->id;\n $sm_weekends = SmWeekend::where('school_id', Auth::user()->school_id)->orderBy('order', 'ASC')->where('active_status', 1)->get();\n\n $data = [];\n $data['message'] = 'operation Successful';\n return ApiBaseMethod::sendResponse($data, null);\n\n } catch (Exception $e) {\n return ApiBaseMethod::sendError('operation Failed');\n }\n\n}", "public function index()\n {\n $is_current_month = !request()->get('next');\n $days_in_month = date('t', strtotime($is_current_month ? 'now' : '+1 month'));\n $month_number = date('n', strtotime($is_current_month ? 'now' : '+1 month'));\n $year_number = date('y', strtotime($is_current_month ? 'now' : '+1 month'));\n\n $shifts = [];\n\n foreach (range(1,$days_in_month) as $day_number) {\n $date = mktime(0, 0, 0, $month_number, $day_number, $year_number);\n\n $shifts[date('j.n.y', $date)] = [\n 'date_without_year' => date('j.n', $date),\n 'date' => date('j.n.y', $date),\n 'day_of_week' => str_replace(['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], ['ראשון', 'שני', 'שלישי', 'רביעי', 'חמישי', 'שישי', 'שבת'], date('l', $date)),\n 'shift1' => [\n 'saturday' => date('w', $date) == 6,\n 'title' => NULL,\n 'users' => []\n ],\n 'shift2' => [\n 'saturday' => date('w', $date) == 6,\n 'title' => NULL,\n 'users' => []\n ],\n 'shift3' => [\n 'saturday' => date('w', $date) == 5 || date('w', $date) == 6,\n 'title' => NULL,\n 'users' => []\n ],\n ];\n }\n\n $registered = Shift::with('user')\n ->where('date_str', 'LIKE', \"%.$month_number.$year_number\")\n ->get();\n\n foreach ($registered as $register) {\n $shifts[$register['date_str']]['shift'.$register['shift_id']]['users'][] = [\n 'user_id' => $register['user_id'],\n 'status' => $register['status'],\n 'name' => array_get($register, 'user.name', 'משתמש נמחק'),\n ];\n }\n\n $is_admin = request()->get('admin') && Auth::user()->is_admin;\n\n return view('home')\n ->with('shifts', array_values($shifts))\n ->with('current_user_id', Auth::user()->id)\n ->with('is_current_month', $is_current_month)\n ->with('can_admin', Auth::user()->is_admin)\n ->with('users', $is_admin ? User::orderBy('name')->get() : [])\n ->with('is_admin', $is_admin);\n }", "public function updateSchedule()\n\t{\n\t\t// Removing old days if we have any days\n\t\tif (count(self::$schedule) > 0) {\n\t\t\t$currDate = date('Y/m/d');\n\n\t\t\twhile (isset(self::$schedule[0]) && self::$schedule[0]->date != $currDate) {\n\t\t\t\tarray_shift(self::$schedule);\n\t\t\t}\n\t\t}\n\n\t\t// Building out the schedule if we're missing days\n\t\tif (count(self::$schedule) < 7) $this->build();\n\t}", "function saveGroupWorksheet($worksheetDetails, $grade_boundaries, $userid, $worksheet_inputs, $worksheet_tags) {\n try{\n $gwid = $worksheetDetails[\"gwid\"];\n $staff1 = (!$worksheetDetails[\"staff1\"] || $worksheetDetails[\"staff1\"] == \"0\") ? $userid : $worksheetDetails[\"staff1\"];\n $staff2 = (!$worksheetDetails[\"staff2\"] || $worksheetDetails[\"staff2\"] == \"0\") ? \"null\" : $worksheetDetails[\"staff2\"];\n $staff3 = (!$worksheetDetails[\"staff3\"] || $worksheetDetails[\"staff3\"] == \"0\") ? \"null\" : $worksheetDetails[\"staff3\"];\n $datedue = $worksheetDetails[\"dateDueMain\"];\n $stuNotes = array_key_exists(\"studentNotes\", $worksheetDetails) ? db_escape_string($worksheetDetails[\"studentNotes\"]) : \"\";\n //$staffNotes = array_key_exists(\"staffNotes\", $worksheetDetails) ? db_escape_string($worksheetDetails[\"staffNotes\"]) : \"\";\n $displayName = array_key_exists(\"displayName\", $worksheetDetails) ? db_escape_string($worksheetDetails[\"displayName\"]) : \"\";\n $hidden = $worksheetDetails[\"hide\"] == \"true\" ? \"0\" : \"1\";\n $student_input = $worksheetDetails[\"student\"] == \"true\" ? \"1\" : \"0\";\n $enter_totals = $worksheetDetails[\"enter_totals\"] == \"true\" ? \"1\" : \"0\";\n\n $query = \"UPDATE TGROUPWORKSHEETS SET `Primary Staff ID` = $staff1, `Additional Staff ID` = $staff2, `Additional Staff ID 2` = $staff3, \"\n . \"`Date Due` = STR_TO_DATE('$datedue', '%d/%m/%Y'), `Additional Notes Student` = '$stuNotes', `DisplayName` = '$displayName' \"\n . \",`Hidden` = $hidden, `StudentInput` = $student_input, `Date Last Modified` = NOW() , `EnterTotals` = $enter_totals \"\n . \"WHERE `Group Worksheet ID` = $gwid;\";\n\n db_query_exception($query);\n updateGradeBoundaries($grade_boundaries, $gwid);\n updateWorksheetTags($worksheet_tags, $gwid);\n updateWorksheetInputs($worksheet_inputs, $gwid);\n } catch (Exception $ex) {\n $message = \"There was an error saving the details for the worksheet.\";\n log_error($message . \" Exception: \" . $ex->getMessage(), \"requests/setWorksheetResult.php\", __LINE__);\n $array = array(\n \"result\" => FALSE,\n \"message\" => $message\n );\n echo json_encode($array);\n exit();\n }\n $response = array(\"result\" => TRUE);\n echo json_encode($response);\n exit();\n}", "function\nsave_monthly_summary_for_timeslot($dbconn, $target_area, $language, $start_time, $target, $season,$start_date,$stop_date,$freeze)\n{\n\t$obs_query = query_for_detail($language, $season, $target_area, $start_time, $start_date, $stop_date, $freeze, 'T');\n\n\t$query = \"INSERT INTO saved_monthly_summaries\"\n\t\t.\" (target_area, language, start_time, target, month, score, freeze_date)\"\n\t\t.\" SELECT '$target_area','$language','$start_time',$target,'$start_date', round(avg(o),1) AS score, '$freeze'\"\n\t\t.\" FROM (SELECT \\\"date\\\", max(o) AS o FROM ($obs_query) AS o GROUP BY \\\"date\\\") AS d\";\n\n\t$result = pg_query($dbconn, $query);\n\tpg_free_result($result);\n\n\t$obs_query = query_for_detail($language, $season, $target_area, $start_time, $start_date, $stop_date, $freeze, 'F');\n\n\t$query = \"UPDATE saved_monthly_summaries SET out_score = o\"\n\t\t.\" FROM (SELECT round(avg(o),1) AS o\"\n\t\t.\" FROM (SELECT \\\"date\\\", max(o) AS o FROM ($obs_query) AS o GROUP BY \\\"date\\\") AS d) AS a\"\n\t\t.\" WHERE \\\"language\\\"='$language'\"\n\t\t.\" AND target_area='$target_area'\"\n\t\t.\" AND start_time = '$start_time'\"\n\t\t.\" AND month = '$start_date'\";\n\n\t$result = pg_query($dbconn, $query);\n\tpg_free_result($result);\n}", "function insertLastYearGames() {\n\n $conn = getConnection();\n\n $url = \"https://statsapi.web.nhl.com/api\";\n $all_games = \"/v1/schedule?startDate=2017-10-04&endDate=2018-04-10\";\n\n $jsonString = file_get_contents($url.$all_games);\n $jsonObject = json_decode($jsonString);\n $sql = \"INSERT INTO LastYear_Games VALUES \";\n $jsonObject = $jsonObject -> dates;\n\n // populate associative array of win streaks for teams\n $streakArray = array();\n $dayBeforeGames = array();\n $dayOfGames = array();\n $teams_from_db = $conn -> query(\"SELECT id FROM teams\");\n while($row = $teams_from_db -> fetch_assoc()) {\n $streakArray = array_push_assoc($streakArray, $row['id'], 0);\n $dayBeforeGames = array_push_assoc($dayBeforeGames, $row['id'], 0);\n $dayOfGames = array_push_assoc($dayOfGames, $row['id'], 0);\n }\n\n // loop through json object of all games from last year\n foreach($jsonObject as $key => $item) {\n $date = $item->date;\n\n // move values from dayOfGames to dayBeforeGames\n // the make all day of games 0\n foreach($dayOfGames as $key => $value) {\n $dayBeforeGames[$key] = $value;\n $dayOfGames[$key] = 0;\n }\n\n for($i = 0; $i < sizeof($item->games); $i++) {\n // store home and away teams\n $home_id = $item->games[$i]->teams->home->team->id;\n $away_id = $item->games[$i]->teams->away->team->id;\n\n // loop through day of games and update values to 1 of teams playing\n foreach($dayOfGames as $key => $value) {\n if($value == $home_id) {\n $dayOfGames[$key] = 1;\n }elseif($key == $away_id) {\n $dayOfGames[$key] = 1;\n }\n }\n\n // ignore games from all star weekend\n if($home_id == 90 || $home_id == 89|| $home_id == 88 || $home_id == 87) {\n continue;\n }\n\n // score of the game to determine winner\n $homeScore = $item->games[$i]->teams->home->score;\n $awayScore = $item->games[$i]->teams->away->score;\n\n // store current streaks for teams\n $homeStreak = $streakArray[$home_id];\n $awayStreak = $streakArray[$away_id];\n\n // determine winner and store winner (winner is 1 for home team and 0 for away)\n // store wins for home and away teams\n // winning team is wins -1 because api store wins based on outcome of current game\n if($homeScore > $awayScore) {\n $winner = 1;\n $winner_id = $home_id;\n\n // update streaks for both teams\n $streakArray[$winner_id]++;\n $streakArray[$away_id] = 0;\n $home_wins = $item->games[$i]->teams->home->leagueRecord->wins - 1;\n $away_wins = $item->games[$i]->teams->away->leagueRecord->wins;\n } else {\n $winner = 0;\n $winner_id = $away_id;\n\n // update streaks for both teams\n $streakArray[$winner_id]++;\n $streakArray[$home_id] = 0;\n $away_wins = $item->games[$i]->teams->away->leagueRecord->wins - 1;\n $home_wins = $item->games[$i]->teams->home->leagueRecord->wins;\n }\n // add game states to sql for insert\n $sql .= \"(\".$home_id.\", \".$away_id.\", \".$home_wins.\", \".$away_wins.\", \".$homeStreak.\", \".$awayStreak.\", \".$dayBeforeGames[$home_id].\", \".$dayBeforeGames[$away_id].\", \".$winner.\", '\".$date.\"'),\";\n }\n }\n // replace last comma with a semicolon\n $sql = substr($sql, 0, -1).\";\";\n\n // insert to db\n $conn -> query($sql);\n }", "public function snapToSemester(): self\n {\n return new self(\n DatePoint::fromDate($this->startDate)->semester()->startDate(),\n DatePoint::fromDate($this->endDate)->semester()->endDate(),\n $this->bounds\n );\n }", "public static function updateBulkEmployees($shift,$date,$employees=\"\"){ \r\t\tif(is_gt_zero_num($shift) && isValidDate($date)){\r\t\t\t\t$search_arr = array(EMP_SFT_SHIFT=>$shift,EMP_SFT_DATE=>$date,SES_RESTAURANT=>$_SESSION[SES_RESTAURANT]); \r\t\t\t\t // check employees for updating \r\t\t\t\t if(is_not_empty($employees)){\r\t\t\t\t \t\t// split the employees string to array\r\t\t\t\t\t\t$emp_arr = explode(',',$employees); \r\t\t\t\t\t\t$emp_arr = array_filter($emp_arr);\r\t\t\t\t\t\t\r\t\t\t\t \t\t// get the previous records for the shift & date\r\t\t\t\t \t\t$info = self::readArray($search_arr);\r\t\t\t\t\t\t$new_emp = array();\r\t\t\t\t\t\t// assign each employee to emp arr \r\t\t\t\t\t\tforeach ($emp_arr as $emp){\r\t\t\t\t\t\t\t$new_emp[$emp] = $emp; //mk key and value same\r\t\t\t\t\t\t}\r\t\t\t\t\t\t$del_emp_shift = array();\r\t\t\t\t\t\tforeach($info as $key=>$val){\r\t\t\t\t\t\t\t// chk the employee in the list\r\t\t\t\t\t\t\tif(in_array($val[EMP_SFT_EMPLOYEE],$emp_arr)){\r\t\t\t\t\t\t\t\t //..if found remove from the new list\r\t\t\t\t\t\t\t unset($new_emp[$val[EMP_SFT_EMPLOYEE]]);\r\t\t\t\t\t\t\t}else{\r\t\t\t\t\t\t\t\t //..if not found add shift to delete qry\r\t\t\t\t\t\t\t\t\t$del_emp_shift[] = $key;\r\t\t\t\t\t\t\t}\r\t\t\t\t\t\t} \r\t\t\t\t\t\t//.. Insert New Employees\r\t\t\t\t\t\tif(is_not_empty($new_emp)){\r\t\t\t\t\t\t\t$prm = array();\r\t\t\t\t\t\t\tforeach($new_emp as $emp_id){\r\t\t\t\t\t\t\t\t$prm[]= '('.$emp_id.','.$shift.',\\''.$date.'\\',NOW())';\r\t\t\t\t\t\t\t}\r\t\t\t\t\t\t\tif(is_not_empty($prm)){\r\t\t\t\t\t\t\t\t$ins_qry = 'INSERT INTO '.TBL_EMP_SHIFT_ASSIGNMENT.' ('.RET.''.EMP_SFT_EMPLOYEE.', '.EMP_SFT_SHIFT.', '.EMP_SFT_DATE.', '.EMP_SFT_START_DATE.') VALUES '.implode(',',$prm).';';\r\t\t\t\t\t\t\t\tmysql_query($ins_qry); \r\t\t\t\t\t\t\t} \r\t\t\t\t\t\t} \r\t\t\t\t\t //..delete the shifts \r\t\t\t\t\tif(is_not_empty($del_emp_shift)){\r\t\t\t\t\t\t$lst_to_del = implode(',',$del_emp_shift);\r\t\t\t\t\t\tself::delete(array(EMP_SFT_ID=>$lst_to_del)); \r\t\t\t\t\t}\r\t\t\t\t\t\t\r\t\t\t\t }else{\r\t\t\t\t \t// Now clear all records for shift & date\r\t\t\t\t \t self::delete($search_arr); \r\t\t\t\t }\r\t\t\t\t return OPERATION_SUCCESS;\r\t\t} \r\t\treturn OPERATION_FAIL; \r\t}", "public function update(SchoolYearRequest $request)\n {\n $id = $request->id;\n $earlyYear = $request->early_year;\n $endYear = $request->end_year;\n $semester = $request->semester;\n $checkDuplicate = SchoolYear::where('early_year', $earlyYear)\n ->where('end_year', $endYear)\n ->where('semester', $semester)\n ->first();\n $checkOddOrEven = ($semester == 1) ? 'Ganjil' : 'Genap';\n\n /* check duplicate data */\n if (!is_null($checkDuplicate)) {\n return response()->json(['status' => 500, 'message' => 'Semester ' . $checkOddOrEven . ' pada tahun ajaran ini sudah ada']);\n }\n\n $update = SchoolYear::where('id', $id)->first()->update([\n 'early_year' => $earlyYear,\n 'end_year' => $endYear,\n 'semester' => $semester\n ]);\n\n if ($update) {\n $json = ['status' => 200, 'message' => 'Data berhasil diubah'];\n } else {\n $json = ['status' => 500, 'message' => 'Data gagal diubah'];\n }\n\n return response()->json($json);\n }", "public function index($date = null)\n {\n $user = Auth::user();\n $workouts = $user->workouts;\n $currentWeek = $user->currentWeek;\n\n //will be checking against this to fix problem where refreshing takes users to previous or next weeks\n $pageWasRefreshed = isset($_SERVER['HTTP_CACHE_CONTROL']) && $_SERVER['HTTP_CACHE_CONTROL'] === 'max-age=0';\n\n if($date && !$pageWasRefreshed){ \n switch($date){\n case 'previous':\n $currentWeek--;\n $user->update(['currentWeek' => $currentWeek]);\n break;\n case 'next':\n $currentWeek++;\n $user->update(['currentWeek' => $currentWeek]);\n break;\n case 'current':\n $currentWeek = date('W');\n $user->update(['currentWeek' => $currentWeek]);\n break;\n }\n }\n\n //Use Currentweek to delegate weeks\n //Refactor this\n\n $dto = new DateTime();\n $ret['monday'] = $dto->setISODate(date('Y'), $currentWeek)->format('Y-m-d');\n $ret['sunday'] = $dto->modify('+6 days')->format('Y-m-d'); \n\n $monday = $ret['monday'];\n $sunday = $ret['sunday'];\n $weekof = $monday;\n \n $mondayWorkout = $this->findWorkout('Monday', $monday, $sunday, $workouts);\n $tuesdayWorkout = $this->findWorkout('Tuesday', $monday, $sunday, $workouts);\n $wednesdayWorkout = $this->findWorkout('Wednesday', $monday, $sunday, $workouts);\n $thursdayWorkout = $this->findWorkout('Thursday', $monday, $sunday, $workouts);\n $fridayWorkout = $this->findWorkout('Friday', $monday, $sunday, $workouts);\n // $saturdayWorkout = $this->findWorkout('Saturday', $monday, $sunday, $workouts);\n // $sundayWorkout = $this->findWorkout('Sunday', $monday, $sunday, $workouts);\n\n if($mondayWorkout){\n $mondayExercises = $mondayWorkout->exercises;\n }\n if($tuesdayWorkout){\n $tuesdayExercises = $tuesdayWorkout->exercises;\n }\n if($wednesdayWorkout){\n $wednesdayExercises = $wednesdayWorkout->exercises;\n }\n if($thursdayWorkout){\n $thursdayExercises = $thursdayWorkout->exercises;\n }\n if($fridayWorkout){\n $fridayExercises = $fridayWorkout->exercises;\n }\n // if($saturdayWorkout){\n // $saturdayExercises = $saturdayWorkout->exercises;\n // } \n // if($sundayWorkout){\n // $sundayExercises = $sundayWorkout->exercises;\n // }\n // \n \n //get the exercises of last week and current day for dashboard\n //for comparison week to week\n \n $lastweekDate = date('Y-m-d', strtotime('-1 week'));\n $lastweekWorkout = $workouts->where('week', $lastweekDate)->first();\n \n if($lastweekWorkout){\n $lastweekExercises = $lastweekWorkout->exercises;\n }\n\n return view('home', compact('weekof', \n 'lastweekWorkout', 'lastweekExercises',\n 'mondayExercises', 'mondayWorkout',\n 'tuesdayExercises', 'tuesdayWorkout',\n 'wednesdayExercises', 'wednesdayWorkout',\n 'thursdayExercises', 'thursdayWorkout',\n 'fridayExercises', 'fridayWorkout'//,\n // 'saturdayExercises', 'saturdayWorkout',\n // 'sundayExercises', 'sundayWorkout'\n ));\n }", "function chunk($chunk_start_date, $chunk_end_date, $j)\n{\n\n global $db;\n $sharedFunctions = new Shared($db);\n\n $query = \"SELECT *\n\t\tFROM ibl_schedule\n\t\tWHERE Date BETWEEN '$chunk_start_date' AND '$chunk_end_date'\n\t\tORDER BY SchedID ASC\";\n $result = $db->sql_query($query);\n $num = $db->sql_numrows($result);\n\n $teamSeasonRecordsQuery = \"SELECT tid, leagueRecord FROM ibl_standings ORDER BY tid ASC;\";\n $teamSeasonRecordsResult = $db->sql_query($teamSeasonRecordsQuery);\n\n $arrayLastSimDates = $sharedFunctions->getLastSimDatesArray();\n $lastSimStartDate = date_create($arrayLastSimDates[\"Start Date\"]);\n $lastSimEndDate = date_create($arrayLastSimDates[\"End Date\"]);\n $projectedNextSimEndDate = date_add($lastSimEndDate, date_interval_create_from_date_string('7 days'));\n\n // override $projectedNextSimEndDate to account for the blank week at end of HEAT\n $currentSeasonEndingYear = $sharedFunctions->getCurrentSeasonEndingYear();\n $currentSeasonBeginningYear = $currentSeasonEndingYear - 1;\n if ($projectedNextSimEndDate >= date_create(\"$currentSeasonBeginningYear-10-23\") and $projectedNextSimEndDate < date_create(\"$currentSeasonBeginningYear-11-01\")) {\n $projectedNextSimEndDate = date_create(\"$currentSeasonBeginningYear-11-08\");\n }\n\n echo \"<table width=\\\"500\\\" cellpadding=\\\"6\\\" cellspacing=\\\"0\\\" border=\\\"1\\\" align=center>\";\n\n $i = 0;\n $z = 0;\n while ($i < $num) {\n $date = $db->sql_result($result, $i, \"Date\");\n $visitor = $db->sql_result($result, $i, \"Visitor\");\n $visitorScore = $db->sql_result($result, $i, \"VScore\");\n $home = $db->sql_result($result, $i, \"Home\");\n $homeScore = $db->sql_result($result, $i, \"HScore\");\n $boxid = $db->sql_result($result, $i, \"BoxID\");\n\n $visitorTeamname = $sharedFunctions->getTeamnameFromTid($visitor);\n $homeTeamname = $sharedFunctions->getTeamnameFromTid($home);\n $visitorRecord = $db->sql_result($teamSeasonRecordsResult, $visitor - 1, \"leagueRecord\");\n $homeRecord = $db->sql_result($teamSeasonRecordsResult, $home - 1, \"leagueRecord\");\n\n if (($i % 2) == 0) {\n $bgcolor = \"FFFFFF\";\n } else {\n $bgcolor = \"DDDDDD\";\n }\n\n if (($z % 2) == 0) {\n $bgcolor2 = \"0070C0\";\n } else {\n $bgcolor2 = \"C00000\";\n }\n\n if ($visitorScore == $homeScore and date_create($date) <= $projectedNextSimEndDate) {\n $bgcolor = \"DDDD00\";\n }\n\n if ($visitorScore > $homeScore) {\n $visitorTeamname = '<b>' . $visitorTeamname . '</b>';\n $visitorRecord = '<b>' . $visitorRecord . '</b>';\n $visitorScore = '<b>' . $visitorScore . '</b>';\n } elseif ($homeScore > $visitorScore) {\n $homeTeamname = '<b>' . $homeTeamname . '</b>';\n $homeRecord = '<b>' . $homeRecord . '</b>';\n $homeScore = '<b>' . $homeScore . '</b>';\n }\n\n if ($date == $datebase) {\n echo \"<tr bgcolor=$bgcolor>\n\t\t\t\t<td>$date</td>\n\t\t\t\t<td><a href=\\\"modules.php?name=Team&op=team&tid=$visitor\\\">$visitorTeamname ($visitorRecord)</a></td>\n\t\t\t\t<td align=right>$visitorScore</td>\n\t\t\t\t<td><a href=\\\"modules.php?name=Team&op=team&tid=$home\\\">$homeTeamname ($homeRecord)</a></td>\n\t\t\t\t<td align=right>$homeScore</td>\n\t\t\t\t<td><a href=\\\"ibl/IBL/box$boxid.htm\\\">View</a></td>\n\t\t\t</tr>\";\n } else {\n echo \"<tr>\n\t\t\t\t<td></td><td></td><td></td><td></td><td></td><td></td>\n\t\t\t</tr>\";\n echo \"<tr bgcolor=$bgcolor2>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Date</td>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Visitor</td>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Score</td>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Home</td>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Score</td>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Box Score</td>\n\t\t\t</tr>\";\n echo \"<tr bgcolor=$bgcolor>\n\t\t\t\t<td>$date</td>\n\t\t\t\t<td><a href=\\\"modules.php?name=Team&op=team&tid=$visitor\\\">$visitorTeamname ($visitorRecord)</a></td>\n\t\t\t\t<td align=right>$visitorScore</td>\n\t\t\t\t<td><a href=\\\"modules.php?name=Team&op=team&tid=$home\\\">$homeTeamname ($homeRecord)</a></td>\n\t\t\t\t<td align=right>$homeScore</td>\n\t\t\t\t<td><a href=\\\"ibl/IBL/box$boxid.htm\\\">View</a></td>\n\t\t\t</tr>\";\n $datebase = $date;\n $z++;\n }\n $i++;\n }\n echo \"</table>\";\n //return array($homewin, $homeloss, $visitorwin, $visitorloss);\n}", "public function manifest_semesters()\n {\n // get all imported semesters\n $imported_semesters = $this->get_all_imported_type('semester');\n\n // iterate through rows of semester import table\n foreach ($imported_semesters as $sem)\n {\n // arrange semester input data\n list($year, $name) = $this->parse_term_code($sem->term_code);\n\n list($campus, $is_starting) = $this->parse_code_value($sem->code_value);\n\n if ( ! $year || ! $name || ! $campus)\n continue;\n\n // @TODO - difference in dates seems a little funky but follows existing system\n $grades_due_at = $campus == 'LAW' \n ? $this->parse_date($sem->calendar_date) + (46 * 24 * 60 * 60) \n : $this->parse_date($sem->calendar_date) + (21 * 24 * 60 * 60);\n\n // update or create this semester\n $semester = \\enrol_oes\\model\\semester::update_or_create([\n 'code' => $sem->term_code,\n 'year' => $year,\n 'name' => $name,\n 'campus' => $campus,\n 'session_key' => (string) $sem->session,\n 'classes_start_at' => $this->parse_date($sem->calendar_date),\n 'grades_due_at' => $grades_due_at,\n ]);\n\n // construct this semester's unique \n // $semester_cache_key = $sem->term_code . '-' . $sem->session . '-' . $campus;\n\n $semester_cache_key = $this->get_semester_cache_key([\n 'term_code' => $sem->term_code,\n 'session_key' => $sem->session,\n 'campus' => $campus\n ]);\n\n // cache this semester for later\n $this->manifested_semesters[$semester_cache_key] = $semester;\n }\n\n $this->oes_driver->enrol_plugin->trace->output('Semesters manifested.');\n }", "public function update() {\n $hasduedate = isset($this->mumie->duedate) && $this->mumie->duedate > 0;\n if (!$this->event && $hasduedate) {\n $this->create_calendar_event(\n self::EVENT_TYPE,\n $this->mumie->duedate\n );\n } else if ($this->event && $hasduedate) {\n $update = new \\stdClass();\n $update->name = $this->title;\n $update->timestart = $this->mumie->duedate;\n $this->event->update($update, false);\n } else if ($this->event && !$hasduedate) {\n $this->event->delete();\n }\n }", "public function update(Request $request, Shift $shift)\n {\n $shift->update(request()->validate([\n 'course_id' => 'required',\n 'day' => 'required',\n 'shift1' => 'required',\n 'shift2' => 'required',\n ]));\n\n return redirect('/shifts')->with('success','Shift updated successfully');\n }", "function draw_calendar($conn, $month,$year,$alat){\n\n /* draw table */\n $calendar = '<table cellpadding=\"0\" cellspacing=\"0\" class=\"calendar\">';\n\n /* table headings */\n $headings = array('Sun','Mon','Tue','Wed','Thu','Fri','Sat');\n $calendar.= '<tr class=\"calendar-row\"><td class=\"calendar-day-head\">'.implode('</td><td class=\"calendar-day-head\">',$headings).'</td></tr>';\n\n /* days and weeks vars now ... */\n $running_day = date('w',mktime(0,0,0,$month,1,$year));\n $days_in_month = date('t',mktime(0,0,0,$month,1,$year));\n $days_in_this_week = 1;\n $day_counter = 0;\n\n $booked[] = $days_in_month;\n for($i = 0; $i<=$days_in_month; $i++){\n $booked[$i] = '';\n }\n\n $now = $month + $year *12;\n\n //PENGECEKKAN STATUS UNTUK KEPENTINGAN KALENDER\n //booking\n $result = mysqli_query($conn,\"SELECT * FROM booking NATURAL JOIN alat where nama_alat = '$alat' and ((year(tanggal_rencana_peminjaman)*12 + month(tanggal_rencana_peminjaman)) <= '$now') and ((year(tanggal_rencana_pengembalian)*12 + month(tanggal_rencana_pengembalian)) >= '$now')\");\n if(mysqli_num_rows($result)>0){\n markdate($booked,$result,$days_in_month,$month,2);\n }\n mysqli_free_result($result);\n\n //peminjaman\n $result = mysqli_query($conn,\"SELECT * FROM peminjaman NATURAL JOIN alat where nama_alat = '$alat' and tanggal_pengembalian IS NULL and ((year(tanggal_peminjaman)*12 + month(tanggal_peminjaman)) <= '$now') and ((year(tanggal_rencana_pengembalian)*12 + month(tanggal_rencana_pengembalian)) >= '$now')\");\n if(mysqli_num_rows($result)>0){\n markdate($booked,$result,$days_in_month,$month,1);\n }\n mysqli_free_result($result);\n\n //perbaikan\n $result = mysqli_query($conn,\"SELECT * FROM perbaikan NATURAL JOIN alat where nama_alat = '$alat' and tanggal_selesai_perbaikan IS NULL and ((year(tanggal_mulai_perbaikan)*12 + month(tanggal_mulai_perbaikan)) <= '$now') and ((year(estimasi_selesai_perbaikan)*12 + month(estimasi_selesai_perbaikan)) >= '$now')\");\n if(mysqli_num_rows($result)>0){\n markdate($booked,$result,$days_in_month,$month,3);\n }\n mysqli_free_result($result);\n\n //END OF PENGECEKKAN STATUS\n\n /* row for week one */\n $calendar.= '<tr class=\"calendar-row\">';\n\n /* print \"blank\" days until the first of the current week */\n for($x = 0; $x < $running_day; $x++):\n $calendar.= '<td class=\"calendar-day-np\"> </td>';\n $days_in_this_week++;\n endfor;\n\n /* keep going with days.... */\n for($list_day = 1; $list_day <= $days_in_month; $list_day++):\n\n $calendar.= '<td class=\"calendar-day\">';\n\n /* add in the day number */\n $calendar.= '<div class=\"day-number\">'.$list_day.'</div>';\n\n /** QUERY THE DATABASE FOR AN ENTRY FOR THIS DAY !! IF MATCHES FOUND, PRINT THEM !! **/\n $calendar.= $booked[$list_day-1];\n\n $calendar.= '</td>';\n if($running_day == 6):\n $calendar.= '</tr>';\n if(($day_counter+1) != $days_in_month):\n $calendar.= '<tr class=\"calendar-row\">';\n endif;\n $running_day = -1;\n $days_in_this_week = 0;\n endif;\n $days_in_this_week++; $running_day++; $day_counter++;\n\n endfor;\n\n /* finish the rest of the days in the week */\n if($days_in_this_week < 8):\n for($x = 1; $x <= (8 - $days_in_this_week); $x++):\n $calendar.= '<td class=\"calendar-day-np\"> </td>';\n endfor;\n endif;\n\n /* final row */\n $calendar.= '</tr>';\n\n /* end the table */\n $calendar.= '</table>';\n\n\n /* all done, return result */\n return $calendar;\n}", "public function setWindow($window)\n {\n $this->window = $window;\n }", "function calendar_week_mod($num)\n {\n }", "public function save($data)\n\t{\n\t\t$input = JFactory::getApplication()->input;\n\t\t$filter = JFilterInput::getInstance();\n\t\t\n\t\t$db = JFactory::getDbo();\n\t $query = $db->getQuery(true);\n\t\t\n\t\t$calendarDays = $this->getCalendarDays($data['calendaroflessons']);\n\t\t$checkedDays = $calendarDays['checkedays'];\n\t\t$unCheckedDays = $calendarDays['uncheckedays'];\n\t\t\n\t\t//Save the end date in sql format\n\t\tuksort($checkedDays, array($this, \"date_compare\"));\n\t\t$data['end_date'] = date(\"Y-m-d\",strtotime(key( array_slice( $checkedDays, -1, 1, TRUE ))));\n\t\t\n\t\t//Actual hours for week Convert in seconds\n\t\t$hoursForWeek = strtotime('1970-01-01 '.$data['hours_for_week'].' UTC');\n\t\t//Actual days for week\n\t\t$daysForWeek = $data['days_for_week'];\n\t\t\n\t\t//Total duration we can't change during the course \n\t\t$duration = $data[\"duration_in_hours\"] * 60 * 60;//Convert duration from hours to seconds\n\n\t\t//Re-Calculate hours for week and days for week\n\t\t$totalDaysAndHoursForWeek = $this->getTotalDaysAndHoursForWeek($data[\"weeklyfrequency\"]);\n\t\t//We check this for brief course like one or two days\n\t\tif ($totalDaysAndHoursForWeek['totalHoursForWeek'] > $duration)\n\t\t{\n\t\t\t$this->setError('COM_COOLTOURAMAN_HOURS_GT_TO_DURATION_ERROR');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t//Save the calculate hours for week\n\t\t$data['hours_for_week'] = $totalDaysAndHoursForWeek['totalHoursForWeek'];\n\t\t//Save the calculate days for week\n\t\t$data['days_for_week'] = implode(',', array_keys($totalDaysAndHoursForWeek['totalDaysForWeek']));\n\t\n\t\t//Rebuild the new calendar array; WARNING: (Itsn't possible when the course started) \t\t\n\t\tif (($data[\"start_date\"] !== $input->get('start_date_beforetosave')) ||\n\t\t\t((int)$data[\"duration_in_hours\"] !== (int)$input->get('duration_in_hours_beforetosave'))\n\t\t )\n\t\t{\n\t\t\t$data['calendaroflessons'] = $this->createCalendarOfLessons($data[\"weeklyfrequency\"], $data[\"duration_in_hours\"], $data[\"start_date\"]);\n\t\t}\n\t\telse if ($hoursForWeek !== $data['hours_for_week'] || $daysForWeek !== $data['days_for_week'])\n\t\t{\n\t\t\t\n\t\t\t$timeZone = new DateTimeZone(JFactory::getConfig()->get('offset'));\n\t\t\t$now = JFactory::getDate('now', $timeZone);\n\t\t\t$currentTime = $now->toUnix();\n\t\t\t$timesStamp = $this->stringToDate(array_keys($checkedDays));\n\t\t\t$firstCourseDay = min($timesStamp);\n\t\t\t$lastCourseDay = max($timesStamp);\n\t\t\t$closestTimestamp = $this->closestNumber($timesStamp, $currentTime); //find closest date\n\t\t\t$closestDate = array_search($closestTimestamp, $timesStamp);\n\t\t\t$spentDuration = 0;\n\t\t\t$calendarToSave = $this->getCalendarPart($data['calendaroflessons'], $closestDate, $spentDuration);\n\t\t\t$remainingTime = 0;\n\t\t\tif ($duration > $spentDuration)\n\t\t\t\t$remainingTime = ($duration - $spentDuration)/60/60;\n\t\t\t\n\t\t\tif ($remainingTime > 0)\n\t\t\t{\t\n\t\t\t\t//Course has yet to start make a new calendar\n\t\t\t\tif ($firstCourseDay > $currentTime)\n\t\t\t\t\t$data['calendaroflessons'] = $this->createCalendarOfLessons($data[\"weeklyfrequency\"], $data[\"duration_in_hours\"], $data[\"start_date\"]);\n\t\t\t\telse if ($currentTime >= $firstCourseDay && $currentTime <= $lastCourseDay) //merge old calendar part whit new one \n\t\t\t\t\t$data['calendaroflessons'] = $this->createCalendarOfLessons($data[\"weeklyfrequency\"], $remainingTime, $now->format('d-m-Y', true), $calendarToSave);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ($firstCourseDay > $currentTime)\n\t\t\t\t\t$data['calendaroflessons'] = $this->createCalendarOfLessons($data[\"weeklyfrequency\"], $data[\"duration_in_hours\"], $data[\"start_date\"]);\n\t\t\t\telse\n\t\t\t\t\t$data['calendaroflessons'] = $calendarToSave;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($calendarDays['total_checked_duration'] != $duration)\n\t\t\t{\n\t\t\t\t$msg = '';\n\t\t\t\tif ($calendarDays['total_checked_duration'] > $duration)\n\t\t\t\t\t$msg = JText::_('COM_COOLTOURAMAN_DAYS_GT_TO_DURATION_ERROR', true);\n\t\t\t\telseif ($calendarDays['total_checked_duration'] < $duration)\n\t\t\t\t\t$msg = JText::_('COM_COOLTOURAMAN_DAYS_LT_TO_DURATION_ERROR', true);\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->setError($msg);\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Convert hours for week in human readble\n\t\t$data['hours_for_week'] = gmdate(\"H:i\", $data['hours_for_week']); \n\n\t\tif (isset($data['created_by_alias']))\n\t\t{\n\t\t\t$data['created_by_alias'] = $filter->clean($data['created_by_alias'], 'TRIM');\n\t\t}\n\t\t\n\t\tif ($data[\"teacher_id\"] !== $input->get('teacher_id_beforetosave'))\n\t\t{\t\n\t\t\t//Delete actual relate from teacher to the course\n\t\t\t$conditions = array(\n\t\t\t\t$db->quoteName('course_id') . ' = '.$input->getInt('id'), \n\t\t\t\t$db->quoteName('teacher_id') . ' = ' . $input->getInt('teacher_id_beforetosave')\n\t\t\t);\n\t\t\t$query->delete($db->quoteName('#__cooltouraman_course_teacher_relations'));\n\t\t\t$query->where($conditions);\n\t\t\t \n\t\t\techo $query->__toString();\n\t\t\t$db->setQuery($query);\n\t\t\t \n\t\t\tif(!$db->execute())\n\t\t\t{\n\t\t\t\t$this->setError($db->getError());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t//Add new relate from teacher to the course\n\t\t\t$columns = array('course_id', 'teacher_id');\n\t\t\t$values = array($input->getInt('id'), (int)$data[\"teacher_id\"]);\n\t\t\t$query\n\t\t\t\t->insert($db->quoteName('#__cooltouraman_course_teacher_relations'))\n\t\t\t\t->columns($db->quoteName($columns))\n\t\t\t\t->values(implode(',', $values));\n\t\t\t\t\n\t\t\t$db->setQuery($query);\n\t\t\tif(!$db->execute())\n\t\t\t{\n\t\t\t\t$this->setError($db->getError());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$query->clear();\n\t\t//Join course to the students; First delete all relations;\n\t\t$conditions = array(\n\t\t\t$db->quoteName('course_id') . ' = '.$input->getInt('id')\n\t\t);\n\t\t$query->delete($db->quoteName('#__cooltouraman_course_student_relations'));\n\t\t$query->where($conditions);\n\t\t$db->setQuery($query);\n\t\t\n\t\tif(!$db->execute())\n\t\t{\n\t\t\t$this->setError($db->getError());\n\t\t\treturn false;\n\t\t}\n\n\t\t$query->clear();\n\t\t// Second relate each student to the course\n\t\t$values = array();\n\t\tforeach($data['attendanceregister']['students'] as $i => $student)\n\t\t\tif (is_numeric($student['id']))\n\t\t\t\t$values[] = $input->getInt('id').','.(int)$student['id'];\n\t\tif (!empty($values))\n\t\t{\n\t\t\t$columns = array('course_id', 'student_id');\n\t\t\t$query\n\t\t\t\t->insert($db->quoteName('#__cooltouraman_course_student_relations'))\n\t\t\t\t->columns($db->quoteName($columns))\n\t\t\t\t->values($values);\n\t\t\t\t\n\t\t\t$db->setQuery($query);\n\t\t\tif(!$db->execute())\n\t\t\t{\n\t\t\t\t$this->setError($db->getError());\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Alter the title for save as copy\n\t\tif ($input->get('task') == 'save2copy')\n\t\t{\n\t\t\t$origTable = clone $this->getTable();\n\t\t\t$origTable->load($input->getInt('id'));\n\n\t\t\tif ($data['title'] == $origTable->title)\n\t\t\t{\n\t\t\t\tlist($title, $alias) = $this->generateNewTitle($data['catid'], 'copy', $data['title']);\n\t\t\t\t$data['title'] = $title;\n\t\t\t}\n\t\t\t\n\t\t\t$data['state'] = 0;\n\n\t\t}\n\t\t\n\t\tif (parent::save($data))\n\t\t\treturn true;\n\n\t\treturn false;\n\t}", "public static function update(){\n $idTimeSlot = $_REQUEST[\"idTimeSlot\"];\n $dayOfWeek = $_REQUEST[\"dayOfWeek\"];\n $startTime = $_REQUEST[\"startTime\"];\n $endTime = $_REQUEST[\"endTime\"];\n\n $result = DB::dataManipulation(\"UPDATE timeslots \n SET dayOfWeek='$dayOfWeek', startTime='$startTime', endTime='$endTime'\n WHERE idTimeSlot = '$idTimeSlot'\");\n return $result;\n }", "function season_by_week($season_start, $season_end, $type=\"schedule\", $sport_id=1, $week_current=0, $conference_id=0)\n{\n $season_start = strtotime($season_start);\n $season_end = strtotime($season_end);\n $seconds_in_a_week = 604800;\n \n // How many weeks are in a season?\n $season_weeks = round(( $season_end - $season_start ) / $seconds_in_a_week);\n \n $this_week = round(( time() - $season_start ) / $seconds_in_a_week);\n if ( $this_week < 0 ) $this_week = 0;\n\n switch ( strtolower($type) )\n {\n case \"schedule\":\n $week_start = $this_week;\n break;\n case \"results\":\n $week_start = 0;\n $season_weeks = $this_week;\n break;\n default:\n \n $week_start = 0;\n break;\n }\n\n\n //echo \"<dd>Weeks: $season_weeks</dd>\";\n //echo \"<dd>This week: $this_week</dd>\";\n //echo \"<dd>Week start: $week_start</dd>\";\n \n if ( $conference_id > 0 )\n {\n $conference_link = \"&ConferenceID=$conference_id\";\n }\n \n // Loop through the weeks, put the dates in an array.\n $return = \"\";\n for ( $i = $week_start; $i <= $season_weeks; $i ++ )\n {\n $week_display = $i + 1;\n $timestamp = $season_start + ( $seconds_in_a_week * $i );\n $week[$i] = week_generate($timestamp);\n \n $link = \"/home.html?site=default&tpl=Schedule&Sport=\" . $sport_id . \"&SearchDate=\" . date(\"m/d/Y\", $week[$i][0]) . \"&SearchDateEnd=\" . date(\"m/d/Y\", $week[$i][1]) . \"&start=0&count=250&Week=\" . $week_display . $conference_link;\n \n \n \n if ( $week_current == $week_display )\n {\n $return .= $week_display . \" \";\n }\n else\n {\n $return .= \"<a href=\" . $link . \" class=pageNumberLink>\" . $week_display . \"</a> \";\n }\n \n }\n return $return;\n}", "public function run()\n\t{\n $lastFallStart = Date('Y-m-d', strtotime('september ' . Date('Y', strtotime('last year')) . ' first monday'));\n $lastFallEnd = Date('Y-m-d', strtotime('december 25 ' . Date('Y', strtotime('last year')) . ' -2 weeks next monday'));\n $fallStart = Date('Y-m-d', strtotime('september first monday'));\n $fallEnd = Date('Y-m-d', strtotime('december 25 first monday'));\n $nextFallStart = Date('Y-m-d', strtotime('september ' . Date('Y', strtotime('next year')) . ' first monday'));\n $nextFallEnd = Date('Y-m-d', strtotime('december 25 ' . Date('Y', strtotime('next year')) . ' -2 weeks next monday'));\n $lastSpringStart = Date('Y-m-d', strtotime('january ' . Date('Y', strtotime('last year')) . ' second monday'));\n $lastSpringEnd = Date('Y-m-d', strtotime('may ' . Date('Y', strtotime('last year')) . ' first monday'));\n $springStart = Date('Y-m-d', strtotime('january second monday'));\n $springEnd = Date('Y-m-d', strtotime('may first monday'));\n $nextSpringStart = Date('Y-m-d', strtotime('january ' . Date('Y', strtotime('next year')) . ' second monday'));\n $nextSpringEnd = Date('Y-m-d', strtotime('may ' . Date('Y', strtotime('next year')) . ' first monday'));\n $lastSummerStart = Date('Y-m-d', strtotime(\"$lastSpringEnd +1 weeks next monday\"));\n $lastSummerEnd = Date('Y-m-d', strtotime(\"$lastFallStart -2 weeks next monday\"));\n $summerStart = Date('Y-m-d', strtotime(\"$springEnd + 1 weeks next monday\"));\n $summerEnd = Date('Y-m-d', strtotime(\"$fallStart -2 weeks next monday\"));\n $nextSummerStart = Date('Y-m-d', strtotime(\"$nextSpringEnd +1 weeks next monday\"));\n $nextSummerEnd = Date('Y-m-d', strtotime(\"$nextFallStart -2 weeks next monday\"));\n\t\t\\DB::table('semester_start')->delete();\n \n $semesters = array (\n\t\t\t0 => \n\t\t\tarray (\n\t\t\t\t'id' => 'fall'.explode('-', $lastFallStart)[0],\n\t\t\t\t'start_date' => $lastFallStart,\n\t\t\t\t'end_date' => $lastFallEnd,\n\t\t\t\t'updated_at' => '2014-07-08 00:00:00',\n\t\t\t\t'created_at' => '2014-07-08 00:00:00',\n\t\t\t),\n\t\t\t1 => \n\t\t\tarray (\n\t\t\t\t'id' => 'fall'.explode('-', $fallStart)[0],\n\t\t\t\t'start_date' => $fallStart,\n\t\t\t\t'end_date' => $fallEnd,\n\t\t\t\t'updated_at' => '2014-07-08 00:00:00',\n\t\t\t\t'created_at' => '2014-07-08 00:00:00',\n\t\t\t),\n\t\t\t2 => \n\t\t\tarray (\n\t\t\t\t'id' => 'fall'.explode('-', $nextFallStart)[0],\n\t\t\t\t'start_date' => $nextFallStart,\n\t\t\t\t'end_date' => $nextFallEnd,\n\t\t\t\t'updated_at' => '2014-07-08 00:00:00',\n\t\t\t\t'created_at' => '2014-07-08 00:00:00',\n\t\t\t),\n\t\t\t3 => \n\t\t\tarray (\n\t\t\t\t'id' => 'spring'.explode('-', $lastSpringStart)[0],\n\t\t\t\t'start_date' => $lastSpringStart,\n\t\t\t\t'end_date' => $lastSpringEnd,\n\t\t\t\t'updated_at' => '2014-07-08 00:00:00',\n\t\t\t\t'created_at' => '2014-07-08 00:00:00',\n\t\t\t),\n\t\t\t4 => \n\t\t\tarray (\n\t\t\t\t'id' => 'spring'.explode('-', $springStart)[0],\n\t\t\t\t'start_date' => $springStart,\n\t\t\t\t'end_date' => $springEnd,\n\t\t\t\t'updated_at' => '2014-07-08 00:00:00',\n\t\t\t\t'created_at' => '2014-07-08 00:00:00',\n\t\t\t),\n\t\t\t5 => \n\t\t\tarray (\n\t\t\t\t'id' => 'spring'.explode('-', $nextSpringStart)[0],\n\t\t\t\t'start_date' => $nextSpringStart,\n\t\t\t\t'end_date' => $nextSpringEnd,\n\t\t\t\t'updated_at' => '2014-11-03 17:20:13',\n\t\t\t\t'created_at' => '2014-11-03 17:20:13',\n\t\t\t),\n\t\t\t6 => \n\t\t\tarray (\n\t\t\t\t'id' => 'summer'.explode('-', $lastSummerStart)[0],\n\t\t\t\t'start_date' => $lastSummerStart,\n\t\t\t\t'end_date' => $lastSummerEnd,\n\t\t\t\t'updated_at' => '2015-11-30 10:30:00',\n\t\t\t\t'created_at' => '2015-11-30 10:30:00',\n\t\t\t),\n\t\t\t7 => \n\t\t\tarray (\n\t\t\t\t'id' => 'summer'.explode('-', $summerStart)[0],\n\t\t\t\t'start_date' => $summerStart,\n\t\t\t\t'end_date' => $summerEnd,\n\t\t\t\t'updated_at' => '2014-07-08 00:00:00',\n\t\t\t\t'created_at' => '2014-07-08 00:00:00',\n\t\t\t),\n\t\t\t8 => \n\t\t\tarray (\n\t\t\t\t'id' => 'summer'.explode('-', $nextSummerStart)[0],\n\t\t\t\t'start_date' => $nextSummerStart,\n\t\t\t\t'end_date' => $nextSummerEnd,\n\t\t\t\t'updated_at' => '2014-07-08 00:00:00',\n\t\t\t\t'created_at' => '2014-07-08 00:00:00',\n\t\t\t),\n );\n\n \\DB::table('semester_start')->insert($semesters);\n\t}", "public function run()\n {\n $students = Student::get();\n \n foreach($students as $key => $student) {\n $disciplines = $student->discipline(null)->get();\n foreach($disciplines as $key => $discipline) {\n if(!is_null($discipline->pivot->year_semester)) {\n if(is_null($student->egress_date)) {\n $student->egress_date = $discipline->pivot->year_semester;\n } else {\n list ($actual_year, $actual_semester) = explode('/', $student->egress_date);\n list ($incoming_year, $incoming_semester) = explode('/', $discipline->pivot->year_semester);\n if((int)$actual_year > (int)$incoming_year) {\n $student->egress_date = $discipline->pivot->year_semester;\n } else if((int)$actual_year == (int)$incoming_year) {\n if((int)$actual_semester > (int)$incoming_semester) {\n $student->egress_date = $discipline->pivot->year_semester;\n }\n }\n }\n }\n }\n $student->save();\n }\n }", "public function updateStageDates(Request $request, NotificationManager $notificationManager){\n $stgId = $request->get('id');\n $startdateStr = $request->get('sd');\n $enddateStr = $request->get('ed');\n $startdate = new DateTime($startdateStr);\n $enddate = $enddateStr ? new DateTime($enddateStr) : null;\n $em = $this->em;\n $property = null;\n\n /** @var Stage */\n $stage = $em->getRepository(Stage::class)->find($stgId);\n /*\n if($stage->getStartdate() != $startdate && $stage->getEnddate() == $enddate){\n $property = 'startdate';\n } else if ($stage->getStartdate() == $startdate && $stage->getEnddate() != $enddate){\n $property = 'enddate';\n }\n */\n\n //if($property){\n $stage->setStartdate($startdate)\n ->setEnddate($enddate);\n \n $notifiedUsers = $stage->getParticipants()->map(fn(Participation $p) => $p->getUser());\n $notificationManager->registerUpdates($stage, $notifiedUsers, ElementUpdate::CHANGE, $property);\n $em->persist($stage);\n $em->flush();\n //}\n return new JsonResponse(['msg' => 'success', 'sd' => intval($startdate->format(\"U\")), 'p' => $stage->getPeriod()], 200);\n }", "public function update(Request $request, $id)\n {\n $lesson = Lesson::whereId($id)->firstOrFail();\n $schedules = [];\n\n// $lesson->update($request->all());\n\n if ($request['edit-datetimes'] != null) {\n// $schedules = Schedule::where('lesson_id', $id);\n// $schedules->delete();\n\n foreach ($request['edit-datetimes'] as $date) {\n $newdate = Carbon::createFromFormat('d.m.Y H:i', $date, 'Europe/Moscow')->format('Y-m-d H:i');\n\n $fields = ['lesson_id' => $id, 'schedule' => $newdate . ':00'];\n\n $schedules[] = Schedule::create($fields);\n }\n\n foreach ($schedules as $schedule) {\n if ($schedule->lesson->group_id) {\n foreach ($schedule->lesson->group->users as $user) {\n Payment::create(['user_id' => $user->id, 'schedule_id' => $schedule->id]);\n }\n } else {\n foreach ($schedule->lesson->users as $user) {\n if ($user->hasRole('student')) {\n $user_id = $user->id;\n }\n }\n Payment::create(['user_id' => $user_id, 'schedule_id' => $schedule->id]);\n }\n }\n }\n\n $lesson->users()->sync($request['users']);\n\n return redirect()->back();\n }", "function display_teamsingleschedule($season, $team, $output = 'html', $week = null)\n{\n\tglobal $tpl, $db;\n\n\tif (empty($season)) {\n\t\t// default to this year\n\t\t$season = get_current_season();\n\t}\n\n\tif (!is_numeric($season)) {\n\t\tdisplay_message(\"Invalid season\", SCHEDULE_HEADER);\n\t\treturn;\n\t}\n\n\t$user = user_logged_in();\n\n\t$gamesstmt = $db->prepare('SELECT games.week, games.start, games.home_score, games.away_score, home_teams.abbreviation AS home_team_abbr, away_teams.abbreviation AS away_team_abbr FROM ' . TOTE_TABLE_GAMES . ' AS games LEFT JOIN ' . TOTE_TABLE_SEASONS . ' AS seasons ON games.season_id=seasons.id LEFT JOIN ' . TOTE_TABLE_TEAMS . ' AS home_teams ON games.home_team_id=home_teams.id LEFT JOIN ' . TOTE_TABLE_TEAMS . ' AS away_teams ON games.away_team_id=away_teams.id WHERE seasons.year=:year AND (games.away_team_id=:away_team_id OR games.home_team_id=:home_team_id) ORDER BY week');\n\t$gamesstmt->bindParam(':year', $season, PDO::PARAM_INT);\n\t$gamesstmt->bindParam(':away_team_id', $team, PDO::PARAM_INT);\n\t$gamesstmt->bindParam(':home_team_id', $team, PDO::PARAM_INT);\n\t$gamesstmt->execute();\n\n\t$tz = date_default_timezone_get();\n\tdate_default_timezone_set('UTC');\n\t$teamgames = array();\n\twhile ($game = $gamesstmt->fetch(PDO::FETCH_ASSOC)) {\n\t\t$game['start'] = strtotime($game['start']);\n\t\t$game['localstart'] = get_local_datetime($game['start'], (!empty($user['timezone']) ? $user['timezone'] : null));\n\t\t$teamgames[(int)$game['week']] = $game;\n\t}\n\tdate_default_timezone_set($tz);\n\t\n\t$gamesstmt = null;\n\n\t$seasonweeks = get_season_weeks($season);\n\n\tfor ($i = 1; $i <= $seasonweeks; $i++) {\n\t\tif (!isset($teamgames[$i])) {\n\t\t\t$teamgames[$i] = array('bye' => true);\n\t\t}\n\t}\n\tksort($teamgames);\n\n\t$teamstmt = $db->prepare('SELECT teams.home, teams.team FROM . ' . TOTE_TABLE_TEAMS . ' WHERE id=:team_id');\n\t$teamstmt->bindParam(':team_id', $team, PDO::PARAM_INT);\n\t$teamstmt->execute();\n\t$teamobj = $teamstmt->fetch(PDO::FETCH_ASSOC);\n\t$teamstmt = null;\n\n\thttp_headers();\n\n\t$tpl->assign('team', $teamobj);\n\tif (empty($week)) {\n\t\t$tpl->assign('allseasons', array_reverse(get_seasons()));\n\t}\n\t$mobile = mobile_browser();\n\tif ($mobile) {\n\t\t$tpl->assign('mobile', true);\n\t}\n\n\t$tpl->assign('year', $season);\n\t$tpl->assign('games', $teamgames);\n\tif (!empty($week))\n\t\t$tpl->assign('week', $week);\n\n\tif ($output == 'js')\n\t\t$tpl->assign('js', true);\n\n\t$tpl->display('teamsingleschedule.tpl');\n}", "public function checkSet($array){\n\t\t$sql=\"select * from windows where semester=?\";\n\t\t$data[0]=$array['season'] . ' ' . $array['year'];\n\t\t$res=$this->db->query($sql,$data);\n\n\t\tif ($res->num_rows() >= 1){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function review_schedule($sch_id, $status, $comm){\r\n\t $dates = date('Y-m-d');\r\n\r\n$res = $this->db->query('UPDATE leave_schedule SET status='.$status.', sup_update_date=\"'.$dates.'\", super_comment=\"'.$comm.'\" WHERE sched_id='.$sch_id);\r\n\t return $res;\r\n\t }", "public function checkValidSeason()\n {\n if (!$this->season_helper->isValidSeason($this->selected_season)) {\n $this->selected_season = $this->season_helper->getSeasonId(date('r'));\n $competitions = $this->query_competitions->getCompetitionBySeasonId($this->selected_season,\n ['Scored' => 'Y']);\n /** @var QueryCompetitions $competition */\n $competition = end($competitions);\n $date_object = new \\DateTime($competition->Competition_Date);\n $this->selected_date = $date_object->format(('Y-m-d'));\n }\n }", "function provjeri_oglase(){\n\t\tglobal $db;\n\t\t$oglasi = $db->query(\"SELECT * FROM jf_oglasi WHERE status=1\");\n\t\twhile($podatak = $oglasi->fetch_assoc()){\n\t\t\tif (date(\"d-m-Y\", strtotime($podatak['konkurs_end'])) < date(\"d-m-Y\")){\n\t\t\t\t$db->query(\"UPDATE jf_oglasi SET status=0 WHERE id={$podatak['id']}\");\n\t\t\t}\n\t\t}\n\t}", "function get_openstaandeDossiersStatistiek() {\n $jaren = $this->db->query(\"select distinct year from view_statOpenstaandeDossiers\");\n if (!$jaren) {\n $this->error(\"Check query in get_openstaandeDossiersStatistiek in klasse functioneelBeheer_model\");\n }\n while ($row = $jaren->fetch_assoc()) {\n $rows[] = $row;\n }\n foreach ($rows as $var) {\n if (date(\"Y\") == $var[year]) {\n $huidig_jaar = $var[year];\n } else {\n $huidig_jaar = date(\"Y\");\n }\n }\n $vorig_jaar = $huidig_jaar - 1;\n $twee_jaar = $huidig_jaar - 2;\n\n $result = $this->db->query(\"select * from view_statOpenstaandeDossiers\");\n if (!$result) {\n $this->error(\"Check query in get_openstaandeDossiersStatistiek in klasse functioneelBeheer_model\");\n }\n $associativeArray = array(\n $twee_jaar => array(\n 1 => 0,\n 2 => 0,\n 3 => 0,\n 4 => 0,\n 5 => 0,\n 6 => 0,\n 7 => 0,\n 8 => 0,\n 9 => 0,\n 10 => 0,\n 11 => 0,\n 12 => 0),\n $vorig_jaar => array(\n 1 => 0,\n 2 => 0,\n 3 => 0,\n 4 => 0,\n 5 => 0,\n 6 => 0,\n 7 => 0,\n 8 => 0,\n 9 => 0,\n 10 => 0,\n 11 => 0,\n 12 => 0),\n $huidig_jaar => array(\n 1 => 0,\n 2 => 0,\n 3 => 0,\n 4 => 0,\n 5 => 0,\n 6 => 0,\n 7 => 0,\n 8 => 0,\n 9 => 0,\n 10 => 0,\n 11 => 0,\n 12 => 0)\n );\n while ($row = mysqli_fetch_array($result)) {\n $associativeArray[$row['year']][$row['month']] = $row['aantalDossiers'];\n }\n return array($huidig_jaar, $vorig_jaar, $twee_jaar, $associativeArray);\n }", "function suppr_evenement($id_evenement, $id_agenda, $date_suppr=\"\")\r\n{\r\n\t////\tInit\r\n\tglobal $objet, $AGENDAS_AFFICHES;\r\n\t$evt_tmp = db_ligne(\"SELECT * FROM gt_agenda_evenement WHERE id_evenement='\".intval($id_evenement).\"'\");\r\n\t$droit_acces = droit_acces($objet[\"evenement\"],$id_evenement,false);\r\n\t$droit_acces_agenda = @$AGENDAS_AFFICHES[$id_agenda][\"droit\"];\r\n\t////\tSUPPR A UNE DATE (créé \"period_date_exception\") / SUPPR DANS TOUS LES AGENDAS / SUPPR DANS UN AGENDA\r\n\tif($id_agenda==\"tous\" && $droit_acces==3 && $date_suppr!=\"\")\t\t{ db_query(\"UPDATE gt_agenda_evenement SET period_date_exception='\".trim($evt_tmp[\"period_date_exception\"].\"@@\".$date_suppr,\"@@\").\"' WHERE id_evenement=\".db_format($id_evenement)); }\r\n\telseif($id_agenda==\"tous\" && $droit_acces==3)\t\t\t\t\t\t{ db_query(\"DELETE FROM gt_agenda_jointure_evenement WHERE id_evenement=\".db_format($id_evenement)); }\r\n\telseif($id_agenda>0 && ($droit_acces==3 || $droit_acces_agenda>=2))\t{ db_query(\"DELETE FROM gt_agenda_jointure_evenement WHERE id_evenement=\".db_format($id_evenement).\" AND id_agenda=\".db_format($id_agenda)); }\r\n\t////\tON SUPPRIME L'ÉVÉNEMENT S'IL N'EST AFFECTÉ À AUCUN AGENDA + FICHIERS JOINTS\r\n\tif(db_valeur(\"SELECT count(*) FROM gt_agenda_jointure_evenement WHERE id_evenement='\".intval($id_evenement).\"'\")==0){\r\n\t\tglobal $objet;\r\n\t\tsuppr_objet($objet[\"evenement\"], $id_evenement);\r\n\t}\r\n}", "public function update(ShiftRequest $request, $id)\n {\n if(!Auth::user()->can('shift.edit'))\n abort(403);\n\n $shift = Shift::findOrFail($id);\n $shift->template_id = $request->template_id;\n $shift->start = Carbon::createFromFormat(\"d/m/Y H:i\", \"$request->startDate $request->startHour\");\n $shift->end = Carbon::createFromFormat(\"d/m/Y H:i\", \"$request->endDate $request->endHour\");\n $shift->save();\n\n ShiftHasActivities::where('shift_id', $shift->id)->delete();\n if($request->has('activities') && $shift){\n foreach ($request->activities as $activity) {\n ShiftHasActivities::create([\n 'shift_id' => $shift->id,\n 'activity_id' => $activity\n ]);\n }\n }\n\n if($request->has('users') && $shift){\n ShiftHasUsers::where('shift_id', $shift->id)->delete();\n foreach ($request->users as $user) {\n ShiftHasUsers::create([\n 'shift_id' => $shift->id,\n 'user_id' => $user\n ]);\n }\n }\n\n flash()->success(\"Il turno è stato salvato con successo\");\n return redirect()->route('shifts.calendar.index');\n }", "function week($week,$date){\nglobal $maand,$week,$language,$m,$d,$y,$ld,$fd,$viewweekok,$searchweekok,$popupevent,$popupeventwidth,$popupeventheight;\n\nif ($viewweekok == 1){\n\nif (!$date){\n$year = $y;\n$month = $m;\n$day = $d;\n}\nelse{\n$year = substr($date,0,4);\n$month = substr($date,5,2);\n$day = substr($date,8,2);\n}\n\n// weeknummer\nfunction weekNumber($dag,$maand,$jaar)\n{\n $a = (14-$maand)/12;\n settype($a,\"integer\");\n $y = $jaar+4800-$a;\n settype($y,\"integer\");\n $m = $maand + 12*$a - 3;\n settype($m,\"integer\");\n $J = $dag + (153*$m+2)/5 + $y*365 + $y/4 - $y/100 + $y/400 - 32045;\n $d4 = ($J+31741 - ($J % 7)) % 146097 % 36524 % 1461;\n $L = $d4/1460;\n $d1 = (($d4-$L) % 365) + $L;\n $WeekNumber = ($d1/7)+1;\n settype($WeekNumber,\"integer\");\n return $WeekNumber;\n}\n\n$deesweek = mktime(0,0,0,date(\"d\"), date(\"m\"), date(\"Y\"));\n$weeknummer = weekNumber($day,$month,$year);\n$laatsteweek = ($weeknummer + 10);\nif ($laatsteweek > 52){\n $laatsteweek = $laatsteweek - 52;\n}\n\n// eerste dag van de week\nfunction firstDayOfWeek($year,$month,$day){\n global $fd;\n $dayOfWeek=date(\"w\");\n $sunday_offset=$dayOfWeek * 60 * 60 * 24;\n $fd = date(\"Y-m-d\", mktime(0,0,0,$month,$day+1,$year) - $sunday_offset);\n return $fd;\n}\nfirstDayOfWeek($year,$month,$day);\n\n// laatste dag van de week\nfunction lastDayOfWeek($year,$month,$day){\n global $ld;\n $dayOfWeek=date(\"w\");\n $saturday_offset=(6-$dayOfWeek) * 60 * 60 * 24 ;\n $ld = date(\"Y-m-d\", mktime(0,0,0,$month,$day+1,$year) + $saturday_offset);\n return $ld;\n}\nlastDayOfWeek($year,$month,$day);\n\nif (($date) && ($date != date(\"Y-m-d\"))){\necho \"<a href=calendar.php?op=week&date=\".date(\"Y-m-d\", mktime(0,0,0,$month,$day-7,$year)).\"><== \".translate(\"prevweek\").\"</a> - \";\n}\necho \"<a href=calendar.php?op=week&date=\".date(\"Y-m-d\", mktime(0,0,0,$month,$day+7,$year)).\">\".translate(\"nextweek\").\" ==> </a>\";\n\n// zin met datum begin van weeknummer en datum eind weeknummer\necho \"<br><br>\".translate(\"eventsthisweek\");\n$fdy = substr($fd,0,4);\n$fdm = substr($fd,5,2);\nif (substr($fdm,0,1) == \"0\"){\n $fdm = str_replace(\"0\",\"\",$fdm);}\n$fdd = substr($fd,8,2);\necho $fdd.\" \".$maand[$fdm].\" \".$fdy;\necho \" \".translate(\"till\").\" \";\n$ldy = substr($ld,0,4);\n$ldm = substr($ld,5,2);\nif (substr($ldm,0,1) == \"0\"){\n $ldm = str_replace(\"0\",\"\",$ldm);}\n$ldd = substr($ld,8,2);\necho $ldd.\" \".$maand[$ldm].\" \".$ldy;\necho \" (\".translate(\"weeknr\").\" : \".$weeknummer.\")\";\n\n// en nu de evenementen eruit halen :)\n$ld = date(\"Y-m-d\", mktime(0,0,0,$ldm,$ldd+1,$ldy));\necho \"<br><br>\";\nwhile ($fd != $ld){\n$fdy = substr($fd,0,4);\n$fdm = substr($fd,5,2);\nif (substr($fdm,0,1) == \"0\"){\n $fdm = str_replace(\"0\",\"\",$fdm);}\n$fdd = substr($fd,8,2);\n$query = \"select id,title,description,url,cat_name,day,month,year from events left join calendar_cat on events.cat=calendar_cat.cat_id where day='$fdd' and month='$fdm' and year='$fdy' and approved='1' order by title ASC\";\n//echo $query.\"<br>\";\n$result = mysql_query($query);\n while ($row = mysql_fetch_object($result)){\n echo \"<li><b><U>\".stripslashes($row->title).\"</u></b><font size=-1> (\".$row->day.\" \".$row->month.\" \".$row->year.\")</font><br>\";\n echo translate(\"cat\").\" : \".$row->cat_name.\"<br>\";\n $de = str_replace(\"<br>\",\"\",$row->description);\n $de = str_replace(\"<br />\",\"\",$row->description);\n echo substr(stripslashes($de),0,100).\" ...\";\n echo \"<br>\";\n if ($popupevent == 1)\n echo \"<a href=\\\"#\\\" onclick=\\\"MM_openBrWindow('cal_popup.php?op=view&id=\".$row->id.\"','Calendar','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=\".$popupeventwidth.\",height=\".$popupeventheight.\"')\\\">\";\n else\n echo \"<a href=calendar.php?op=view&id=\".$row->id.\">\";\n echo translate(\"readmore\").\"</a>\";\n echo \"<br><br>\";\n }\n$fd = date(\"Y-m-d\", mktime(0,0,0,$fdm,$fdd+1,$fdy));\n}\nif ($searchweekok == 1)\n\tsearch();\n}\nelse{\n echo translate(\"disabled\");\n}\n}", "public function availability_submit($room){\r\n \r\n $update_query = \"UPDATE \" . self::$db_table . \" SET \" . $this->active_month() . \"='\";\r\n \r\n// echo \"MJESEC: \"; var_dump($month);\r\n \r\n $days_in_month = $this->no_of_days_in_month($this->active_month(), $this->active_year()); \r\n for ($i=1; $i<=$days_in_month ; $i++){\r\n $availability = $_POST['availability'][$i-1]; //jer pocinje od 0\r\n $availability = boolval($availability); \r\n// var_dump($availability);\r\n if (!$availability){\r\n $query_content = \"$i,\";\r\n \r\n// echo $query_content;\r\n $update_query .= $query_content;\r\n }\r\n }\r\n $update_query .= \"'\r\n WHERE room_name = '\" . $room->name . \"'\";\r\n $update_query .= \" AND facility_name = '\" . $room->facility_name . \"'\";\r\n $update_query .= \" AND owner = '\" . $room->get_owner() . \"'\";\r\n $update_query .= \" AND year = '\" . $this->active_year() . \"'\";\r\n// echo $update_query . \"<br>\";\r\n \r\n return $this->update_query_to_db($update_query);\r\n \r\n }", "function drugSiteTable($semaine)\n{\n\n $jourDebutSemaine = getdate2($semaine); // récupère les jours de la semaine en fonction de la date sélectionnée\n $stupSheetId = GetSheetbyWeek($semaine, $_SESSION[\"Selectsite\"])[\"stupsheet_id\"]; // la feuille de stupéfiants à afficher\n $novas = getNovasForSheet($stupSheetId); // Obtient la liste des ambulances utilisées par cette feuille\n $drugs = getDrugs(); // Obtient la liste des drugs\n $BatchesForSheet = getBatchesForSheet($stupSheetId); // Obtient la liste des batches utilisées par cette feuille\n\n // preparer un tableau de batchs par médicament pour faciliter le travail de la vue\n foreach ($BatchesForSheet as $p) {\n $batchesByDrugId[$p[\"drug_id\"]][] = $p;\n }\n\n $listofbaseid = getListOfStupSheets($_SESSION[\"Selectsite\"]);\n $date = strtotime($jourDebutSemaine);\n $site = getbasebyid($_SESSION[\"Selectsite\"])[\"name\"];\n $jours = array(\"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"vendredi\", \"samedi\", \"dimanche\");\n require_once 'view/Drug/drugSiteTable.php';\n}", "function updateSchool($u_id, $school_id, $type){\r\n\tglobal $dbc;\r\n\t\r\n\tif($type =='update'){\r\n\t\tclose_school_rel($u_id);\r\n\t}\r\n\t$query = 'INSERT INTO teach_school_rel (\r\n\t\t\t\t\tu_id,\r\n\t\t\t\t\tschool_id,\r\n\t\t\t\t\tdate_start,\r\n\t\t\t\t\tdate_end\r\n\t\t\t\t )\r\n\t\t\t\t VALUES (\r\n\t\t\t\t \t\\''. $u_id .'\\',\r\n\t\t\t\t \t\\''. $school_id .'\\',\r\n\t\t\t\t \tCURDATE(),\r\n\t\t\t\t \t\\'0000-00-00\\' )';\r\n\t\r\n\t$result = mysqli_query($dbc, $query);\r\n\tif(!$result){\r\n\t\t$msg = 'Error - not added to database'. mysqli_errno($dbc) .'<br />';\r\n\t}\r\n\telse {\r\n\t\t$msg = 'Successfully updated your current school.<br />';\r\n\t}\r\n\t\r\n\treturn $msg;\r\n\t\r\n}", "protected function updateTeamStats()\n {\n $conditions = array('stats.needs_update' => true);\n $fields = array('league_id');\n $teams_needing_update = Teams::all(compact('conditions', 'fields'));\n\n $team_id_list = array();\n $team_stats = array();\n foreach ($teams_needing_update as $team) {\n $team_id_list[] = $team->_id;\n $team_stats[(string)$team->_id] = array(\n 'wins' => 0,\n 'losses' => 0,\n 'point_differential' => 0\n );\n }\n\n // Grab all of the games that apply to these teams, standings should be re-calced from the ground up.\n $conditions = array('teams' => array('$in' => $team_id_list), 'scores' => array('$exists' => true), 'winner' => array('$ne' => null));\n $fields = array('scores', 'winner', 'teams', 'league_id');\n $relevant_games_list = Games::all(compact('conditions', 'fields'));\n\n $league_list = array();\n foreach ($relevant_games_list as $game) {\n // Calculate stats for each team\n foreach ($game->getTeams() as $t) {\n $team_id = (string)$t->_id;\n if (!isset($team_stats[$team_id])) {\n // If we didn't pull all of this team's games, do not update their stats. \n continue;\n }\n\n if ($t->_id == $game->winner) {\n $team_stats[$team_id]['wins']++;\n $team_stats[$team_id]['point_differential'] += $game->getScoreDiff();\n } else {\n $team_stats[$team_id]['losses']++;\n $team_stats[$team_id]['point_differential'] -= $game->getScoreDiff();\n }\n }\n\n // Make sure we have a list of all of the leagues being updated\n $league_list[] = $game->league_id;\n }\n\n // Do the team stats updates:\n foreach ($team_stats as $team_id => $stats) {\n $conditions = array('_id' => new \\MongoId($team_id));\n $query = array('$set' => array('stats' => $stats));\n Teams::update($query, $conditions);\n }\n\n // Mark leagues as needing an update\n $league_list = array_unique($league_list);\n $conditions = array('_id' => array('$in' => $league_list));\n $query = array('$set' => array('needs_standings_update' => true));\n Leagues::update($query, $conditions); \n }", "public function work($year, $month, $day)\n {\n if (!!Dates::dates($year, $month, $day)->first()) {\n $weekday_range = unserialize(Dates::dates($year, $month, $day)->first()->weekday->range);\n\n $pt_dates = $this->buildPtDates($year, $month, $day);\n $ft_date = $this->buildFtDate($year, $month, $day);\n\n //only first condition!!!!!!!\n $result = $this->simpleLogic($pt_dates, $ft_date, $weekday_range[0]);\n $result ? $this->completeShift($result, 'create', $year, $month, $day) : '';\n } else {\n Schedules::create([\n 'year' => $year,\n 'month' => $month,\n 'day' => $day,\n 'week_id' => date('w', mktime(0, 0, 0, $month, $day, $year)),\n 'actived' => false,\n 'shift' => 'off'\n ]);\n }\n }", "public function run()\n {\n\n $wd_open = new Shift();\n $wd_open->name = 'weekday_opening';\n $wd_open->startTime = '083000';\n $wd_open->endTime = '173000';\n $wd_open->paidHours = 8;\n $wd_open->isActive = true;\n $wd_open->sortOrder = 1;\n $wd_open->save();\n\n $wd_close = new Shift();\n $wd_close->name = 'weekday_closing';\n $wd_close->startTime = '123000';\n $wd_close->endTime = '213000';\n $wd_close->paidHours = 8;\n $wd_close->isActive = true;\n $wd_close->sortOrder = 3;\n $wd_close->save();\n\n $wd_midshift = new Shift();\n $wd_midshift->name = 'weekday_midshift';\n $wd_midshift->startTime = '103000';\n $wd_midshift->endTime = '193000';\n $wd_midshift->paidHours = 8;\n $wd_midshift->isActive = true;\n $wd_midshift->sortOrder = 2;\n $wd_midshift->save();\n\n }", "public function submissionWindow($seconds = 28800) {\n $window = array(\n 'x_duplicate_window'=>(int)$seconds,\n );\n $this->NVP = array_merge($this->NVP, $window); \n }", "public function update(Request $request){\n $code = $request->codigo_semestre;\n $period = Period::where(['codigo_semestre' => $code])->first();\n $period->timestamps = false;\n\n if ($period != null){\n if ($period->estado === 1){\n //$period->estado = 0;\n $period->update(['estado' => 0]);\n }\n else{\n //$period->enabled = 1;\n //$period->description = $request->description;\n }\n //$period->save();\n }\n return redirect('/dashboard/periods');\n }", "public function windowChange() {\n\t\t$this->Event->emit(\"WindowChange\", (func_get_args()));\n\t}", "public function update($id)\n\t{\n\t\t// Validate the input\n\t\t$validator = Validator::make(Input::all(), [\n\t\t\t'startDate' => 'required|date',\n\t\t\t'wagerTotalValue' => 'required|integer'\n\t\t]);\n\n\t\tif ($validator->fails())\n\t\t{ // Something was wrong with our input\n\t\t\treturn Redirect::back()->with('error', $validator->messages());\n\t\t}\n\n\t\t$wager = Wager::find($id);\n\t\t$startDate = Input::get('startDate');\n\t\t$wagerTotalValue = Input::get('wagerTotalValue');\n\n\t\t// Check to see if wager total value has changed\n\t\tif ($wager->wagerTotalValue != $wagerTotalValue)\n\t\t{ // Total value has changed, let's set up the values to update unit value with\n\n\t\t\t// Grab the total number of meetings and calculate new unit value\n\t\t\t$courses = Auth::user()->courses;\n\t\t\t$numMeetings = WagersController::getNumOfMeetings($courses);\n\t\t\t$wagerUnitValue = round($wagerTotalValue / $numMeetings, 2);\n\t\t}\n\n\t\t// Check to see if start date has changed\n\t\t$wagerSession = WagerSession::find($wager->session_id);\n\n\t\tif ($wagerSession->startDate != $startDate)\n\t\t{ // Start date has changed, check to see if the new start date is valid\n\n\t\t\t$session = WagerSession::where('startDate', '=', $startDate)->first();\n\t\t\tif ($session)\n\t\t\t{ // We have a valid session\n\n\t\t\t\t// Check to see if user has a wager already for that session\n\t\t\t\tif (!WagersController::userHasWagerFor($session->id))\n\t\t\t\t{ // No wager found for the user in this session\n\t\t\t\t\t$session_id = $session->id;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{ // The user already has a wager for the session\n\t\t\t\t\treturn Redirect::back()->with('error', 'You already have made a wager for that session.');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{ // We have an invalid session\n\t\t\t\treturn Redirect::back()->with('error', 'The start date you entered is invalid.');\n\t\t\t}\n\n\t\t}\n\n\t\t// Make the wager\n\t\t$wager->wagerTotalValue = isset($wagerTotalValue) ? $wagerTotalValue : $wager->wagerTotalValue;\n\t\t$wager->wagerUnitValue = isset($wagerUnitValue) ? $wagerUnitValue : $wager->wagerUnitValue;\n\t\t$wager->session_id = isset($session_id) ? $session_id : $wager->session_id;\n\t\t$wager->save();\n\n\t\treturn Redirect::back()->with('success', 'Wager successfully updated!');\n\t}", "public function updateSQL() {\n $query = \"UPDATE TempRota SET e_id = %s WHERE shift_name = '%s' AND rdate = '%s'\";\n $q = \"\";\n if ($this->eid == \"-1\")\n $q = sprintf($query, \"NULL\", $this->shift_name, $this->rdate);\n else {\n $q = sprintf($query, $this->eid, $this->shift_name, $this->rdate);\n\n $quick_query = \"UPDATE Employees \"\n .\"SET fair_hours = fair_hours + (SELECT TIME_TO_SEC(TIMEDIFF(end_time, start_time))/3600 FROM ShiftType WHERE shift_name = '%s') \" \n .\"WHERE e_id = %s\";\n QFunc::getQuery(sprintf($quick_query, $this->shift_name, $this->eid));\n }\n QFunc::getQuery($q);\n }", "public function testUpdateSession()\n {\n $response = $this->loginAsRole(Role::ADMIN)\n ->put($this->url('sessions/1'), [\n 'name' => '2020-2021'\n ]);\n\n $response->assertStatus(200);\n\n $response->assertJsonStructure([\n 'name',\n 'school_id',\n 'start_date',\n 'end_date'\n ]);\n\n $response->assertJson([\n 'name' => '2020-2021'\n ]);\n }", "public function update()\n {\n try\n {\n if (empty($this->getWNumber()))\n {\n die(\"error: the wnumber is not provided\");\n }\n else\n {\n // Update the basic information required for a user\n parent::update();\n\n $dbh = DatabaseConnection::getInstance();\n\n // Prepare sql statement to update information for a student\n $stmtHandle = $dbh->prepare(\n \"UPDATE `Student` \n SET `OverallGPA`= :overallGPA,\n `MajorGPA`= :majorGPA,\n `ACTScore`= :actScore,\n `CurrentMajor`= :currentMajor,\n `FutureMajor`= :futureMajor,\n `CurrentAcademicLevel`= :currentAcademicLevel,\n `DegreeGoal`= :degreeGoal,\n `HighSchool`= :highSchool,\n `PreviousUniversity`= :previousUniversity,\n `FirstWSUSemester`= :firstWSUSemester,\n `FirstWSUYear`= :firstWSUYear,\n `ScheduleStatus`= :scheduleStatus,\n `ClubOrganizations`= :clubOrganizations,\n `HonorsAwards`= :honorsAwards,\n `CSTopicInterests`= :csTopicInterests,\n `PastScholarshipFinancialAid`= :pastScholarshipFinancialAid,\n `GreatestAchievement`= :greatestAchievement \n WHERE `wNumber` = :wNumber\");\n\n $stmtHandle->bindValue(\":wNumber\", $this->getWNumber());\n $stmtHandle->bindValue(\":overallGPA\", $this->overallGPA);\n $stmtHandle->bindValue(\":majorGPA\", $this->majorGPA);\n $stmtHandle->bindValue(\":actScore\", $this->actScore);\n $stmtHandle->bindValue(\":currentMajor\", $this->currentMajor);\n $stmtHandle->bindValue(\":futureMajor\", $this->futureMajor);\n $stmtHandle->bindValue(\":currentAcademicLevel\", $this->currentAcademicLevel);\n $stmtHandle->bindValue(\":degreeGoal\", $this->degreeGoal);\n $stmtHandle->bindValue(\":highSchool\", $this->highSchool);\n $stmtHandle->bindValue(\":previousUniversity\", $this->previousUniversity);\n $stmtHandle->bindValue(\":firstWSUSemester\", $this->firstSemester);\n $stmtHandle->bindValue(\":firstWSUYear\", $this->firstYear);\n $stmtHandle->bindValue(\":scheduleStatus\", $this->scheduleStatus);\n $stmtHandle->bindValue(\":clubOrganizations\", $this->clubsOrganizations);\n $stmtHandle->bindValue(\":honorsAwards\", $this->honorsAwards);\n $stmtHandle->bindValue(\":csTopicInterests\", $this->csTopicInterests);\n $stmtHandle->bindValue(\":pastScholarshipFinancialAid\", $this->pastScholarshipFinancialAid);\n $stmtHandle->bindValue(\":greatestAchievement\", $this->greatestAchievement);\n\n $success = $stmtHandle->execute();\n\n if (!$success) {\n throw new \\PDOException(\"user full update operation failed.\");\n }\n\n // Delete all the course records related to this student to avoid redundant primary key in db\n $stmtHandle = $dbh->prepare(\"DELETE FROM `ConcurrentPastCourse` WHERE `wNumber` = :wNumber\");\n $stmtHandle->bindValue(\":wNumber\", $this->getWNumber());\n $stmtHandle->execute();\n\n // Delete all the ap tests passed records related to this student to avoid rendundant primary key in db\n $stmtHandle = $dbh->prepare(\"DELETE FROM `APTestPassed` WHERE `wNumber` = :wNumber\");\n $stmtHandle->bindValue(\":wNumber\", $this->getWNumber());\n $stmtHandle->execute();\n\n // When the current courses info for this student are passed in\n if (!empty($this->currentCourses) && !($this->currentCourses === null)) {\n $this->insertCourses(self::CURRENT_COURSE);\n }\n\n // When the previous courses info for this student are passed in\n if (!empty($this->previousCourses) && !($this->previousCourses === null)) {\n $this->insertCourses(self::PREVIOUS_COURSE);\n }\n\n // When the AP tests info for this student are passed in\n if (!empty($this->apTests) && !($this->apTests === null)) {\n $this->insertTests();\n }\n }\n }\n catch(\\PDOException $e)\n {\n throw $e;\n }\n\n }", "function insertLastFiveYears() {\n\n $conn = getConnection();\n\n $url = \"https://statsapi.web.nhl.com/api\";\n // all games from the start of the 2013-2014 season to 2017-2018 season\n $all_games = \"/v1/schedule?startDate=2013-10-01&endDate=2018-04-10\";\n\n $jsonString = file_get_contents($url.$all_games);\n $jsonObject = json_decode($jsonString);\n $sql = \"INSERT INTO Games_Last5Years VALUES \";\n $jsonObject = $jsonObject -> dates;\n\n // populate associative array of win streaks for teams\n $streakArray = array();\n $dayBeforeGames = array();\n $dayOfGames = array();\n $teams_from_db = $conn -> query(\"SELECT id FROM teams\");\n while($row = $teams_from_db -> fetch_assoc()) {\n $streakArray = array_push_assoc($streakArray, $row['id'], 0);\n $dayBeforeGames = array_push_assoc($dayBeforeGames, $row['id'], 0);\n $dayOfGames = array_push_assoc($dayOfGames, $row['id'], 0);\n }\n\n // loop through json object of all games from last year\n foreach($jsonObject as $key => $item) {\n $date = $item->date;\n\n // move values from dayOfGames to dayBeforeGames\n // the make all day of games 0\n foreach($dayOfGames as $key => $value) {\n $dayBeforeGames[$key] = $value;\n $dayOfGames[$key] = 0;\n }\n\n for($i = 0; $i < sizeof($item->games); $i++) {\n\n // skip over playoff games\n if(strcmp($item->games[$i]->gameType, \"P\") == 0) {\n break;\n }\n\n\n // store home and away teams\n $home_id = $item->games[$i]->teams->home->team->id;\n $away_id = $item->games[$i]->teams->away->team->id;\n\n // skip over all star games and team that is not in the nhl anymore (27)\n if($home_id == 90 || $home_id == 89|| $home_id == 88 || $home_id == 87 || $home_id == 93 || $home_id == 94 ||\n $home_id == 27 || $away_id == 27) {\n continue;\n }\n\n // loop through day of games and update values to 1 of teams playing\n foreach($dayOfGames as $key => $value) {\n if($value == $home_id) {\n $dayOfGames[$key] = 1;\n }elseif($key == $away_id) {\n $dayOfGames[$key] = 1;\n }\n }\n\n // score of the game to determine winner\n $homeScore = $item->games[$i]->teams->home->score;\n $awayScore = $item->games[$i]->teams->away->score;\n\n // store current streaks for teams\n $homeStreak = $streakArray[$home_id];\n $awayStreak = $streakArray[$away_id];\n\n // determine winner and store winner (winner is 1 for home team and 0 for away)\n // store wins for home and away teams\n // winning team is wins -1 because api store wins based on outcome of current game\n if($homeScore > $awayScore) {\n $winner = 1;\n $winner_id = $home_id;\n\n // update streaks for both teams\n $streakArray[$winner_id]++;\n $streakArray[$away_id] = 0;\n $home_wins = $item->games[$i]->teams->home->leagueRecord->wins - 1;\n $away_wins = $item->games[$i]->teams->away->leagueRecord->wins;\n } else {\n $winner = 0;\n $winner_id = $away_id;\n\n // update streaks for both teams\n $streakArray[$winner_id]++;\n $streakArray[$home_id] = 0;\n $away_wins = $item->games[$i]->teams->away->leagueRecord->wins - 1;\n $home_wins = $item->games[$i]->teams->home->leagueRecord->wins;\n }\n // add game states to sql for insert\n $sql .= \"(\".$home_id.\", \".$away_id.\", \".$home_wins.\", \".$away_wins.\", \".$homeStreak.\", \".$awayStreak.\", \".$dayBeforeGames[$home_id].\", \".$dayBeforeGames[$away_id].\", \".$winner.\", '\".$date.\"'),\";\n }\n }\n // replace last comma with a semicolon\n $sql = substr($sql, 0, -1).\";\";\n\n // insert to db\n $conn -> query($sql);\n }", "public function updated(AwardSeason $awardSeason)\n {\n //\n }", "public function ics_update()\n\t{\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\t'name' => 'category',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'site_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'min_value' => 1,\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'calendar_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'min_value' => 1,\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'calendar_name',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'time_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'time'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'time_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'time'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'minute_interval',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => 60\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'status',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'default' => 'open'\n\t\t\t\t\t)\n\t\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// If we are not currently in the time range, scram\n\t\t// -------------------------------------\n\n\t\t$time = date('Hi', time());\n\n\t\tif ($this->P->value('time_range_start', 'time') !== FALSE AND\n\t\t\t$this->P->value('time_range_start', 'time') > $time)\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: It is not time to update icalendar data yet.');\n\t\t\treturn;\n\t\t}\n\t\telse if ($this->P->value('time_range_end', 'time') !== FALSE AND\n\t\t\t\t$this->P->value('time_range_end', 'time') < $time)\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: The time to update icalendar data has passed.');\n\t\t\treturn;\n\t\t}\n\n\t\tif ($this->P->value('calendar_id') == '')\n\t\t{\n\t\t\t// -------------------------------------\n\t\t\t// For those who prefer names over numbers\n\t\t\t// -------------------------------------\n\n\t\t\tif ($this->P->value('calendar_name') != '')\n\t\t\t{\n\t\t\t\t$ids = $this->data->get_calendar_id_from_name($this->P->value('calendar_name'));\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Just a site ID -- get all calendars\n\t\t\t// -------------------------------------\n\n\t\t\telse\n\t\t\t{\n\t\t\t\t$ids = $this->data->get_calendars_by_site_id($this->P->value('site_id'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$ids = explode('|', $this->P->value('calendar_id'));\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Only look at calendars that are due for an update\n\t\t// -------------------------------------\n\n\t\tif ( ! empty($ids) AND $this->P->value('minute_interval') !== FALSE)\n\t\t{\n\t\t\t$ids = $this->data->get_calendars_needing_update(\n\t\t\t\t$ids,\n\t\t\t\t$this->P->value('minute_interval')\n\t\t\t);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Leave if empty\n\t\t// -------------------------------------\n\n\t\tif (empty($ids))\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: Nobody is due for an update');\n\t\t\treturn;\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Go get those data!\n\t\t// -------------------------------------\n\n\t\t$this->actions();\n\n//ee()->TMPL->log_item('Calendar: Fetching data');\n\n\t\tforeach ($ids as $id)\n\t\t{\n\t\t\t$this->actions->import_ics_data($id);\n\t\t}\n\t}", "function perd_load_scores_semester( $appGlobals, $classDate=NULL, $kidPeriodId=NULL, $gameType=NULL, $periodId=NULL,$mode='u') {\n}", "protected function _syncModDate() {}", "public function save_dates() {\n\t\t// Nothing to do here.\n\t}", "private function saveRepeatWeekly(){\n if( isset($this->settings['weekday_index']) && !empty($this->settings['weekday_index']) ){\n foreach( $this->settings['weekday_index'] AS $dayIndex ){\n Loader::db()->Execute(\"INSERT INTO SchedulizerEventRepeat (eventID, repeatWeekday) VALUES (?,?)\", array(\n $this->eventObj->getEventID(), $dayIndex\n ));\n }\n }\n }", "public function testUpdateUpdatesDateValue()\n {\n $account_status_spans_table = $this->insight->getTableName('account_status_spans');\n\n $this->insight->accounts->addTrial(1);\n $this->insight->accounts->changePlan(1, new PlanM(), new Yearly());\n\n $row = $this->connection->executeFirstRow(\"SELECT * FROM `$account_status_spans_table` WHERE `id` = ?\", 1);\n\n $this->assertInternalType('array', $row);\n\n $this->assertInstanceOf(DateTimeValue::class, $row['started_at']);\n $this->assertInstanceOf(DateValue::class, $row['started_on']);\n $this->assertEquals($row['started_at']->format('Y-m-d'), $row['started_on']->format('Y-m-d'));\n\n $this->assertInstanceOf(DateTimeValue::class, $row['ended_at']);\n $this->assertInstanceOf(DateValue::class, $row['ended_on']);\n $this->assertEquals($row['ended_at']->format('Y-m-d'), $row['ended_on']->format('Y-m-d'));\n }", "function increment_working_days($period_name,$port_id){\r\n\r\n\t\t$this->db->where('holiday_port_period_name', $period_name);\r\n\r\n\t\t$this->db->where('holiday_port_port_id', $port_id);\r\n\r\n\t\t$this->db->set('working_days', 'working_days+1',FALSE);\r\n\r\n\t\t$res=$this->db->update('holiday_port');\r\n\r\n\t\t//echo $this->db->last_query();break;\r\n\r\n\t\treturn $res;\r\n\r\n\t}", "function updateLeagueForWeek($league, $week, $db) {\n\t$query = \"SELECT * FROM {$league[\"name\"]}_schedule WHERE week={$week}\";\n\n\t$result = mysqli_query($db, $query);\n\tif (!$result) {\n\t\tdie(\"Database query failed with errer: \" . mysqli_error($db));\n\t}\n\n\twhile ($match = mysqli_fetch_assoc($result)) {\n\t\t$user0 = $match[\"user_id_0\"];\n\t\t$user1 = $match[\"user_id_1\"];\n\n\t\t$score0 = getScoreForUser($user0, $league, $week);\n\t\t$score1 = getScoreForUser($user1, $league, $week);\n\n\t\t// tell the databse to update the scores\n\t\t$query = \"UPDATE {$league[\"name\"]}_schedule\";\n\t\t$query .= \" SET score_0={$score0}, score_1={$score1}, completed=1\";\n\t\t$query .= \" WHERE id={$match[\"id\"]}\";\n\n\t\t$tmp = mysqli_query($db, $query);\n\t\tif (!$tmp) {\n\t\t\tdie(\"Database query failed with errer: \" . mysqli_error($db));\n\t\t}\n\t}\n}", "public function update($id, Requests\\CreateShift $request)\n\t{\n\t\t$input = Request::all();\n\n\t\t$payableHours = strtotime($input['endShift'])-strtotime($input['startShift']);\n\t\t$overtimeHours = 0;\n\t\t//check for unpaid breaks\n\t\tif ($payableHours >= 18000){\n\t\t \t$payableHours = $payableHours - 1800;\n\t\t}\n\t\t//check for overtime hours and format accordingly\n\t\tif ($payableHours > 28800){\n\t\t\t$overtimeHours = $payableHours - 28800;\n\t\t\t$overtimeHours = $overtimeHours/3600;\n\t\t\t$payableHours = 28800;\n\t\t}\n\t\t$payableHours = $payableHours/3600;\n\t\t\n\t\t$calendar = Calendar::findOrFail($id);\n\t\t$calendar->startShift = new Carbon($input['date'].\" \".$input['startShift']);\n\t\t$calendar->endShift = new Carbon ($input['date'].\" \".$input['endShift']);\n\t\t$calendar->payableHours = $payableHours;\n\t\t$calendar->overtimeHours = $overtimeHours;\n\t\t$calendar->shiftDate = $input['date'];\t\t\n\t\t$calendar->save();\n\n\t\treturn redirect('home');\t\t\n\t}", "public static function AfterDatabaseCreation(Config $oConfiguration, $sPreviousVersion, $sCurrentVersion)\n\t\t{\n\t\t\tif ($sPreviousVersion != '')\n\t\t\t{\n\t\t\t\t// Convert the previous format where all data were stored as fields: monday_start, monday_end, tuesday_start...\n\t\t\t\t// directly inside the CoverageWindow class, to the new format where the open hours are stored as \"CoverageWindowInterval\" objects\n\n\t\t\t\t// Check if the \"old\" column \"start_monday\" exists. If so, then the data needs to be migrated\n\t\t\t\t$sTableName = MetaModel::DBGetTable('CoverageWindow');\n\n\t\t\t\t$aFields = CMDBSource::QueryToArray(\"SHOW COLUMNS FROM `$sTableName`\");\n\t\t\t\t// Note: without backticks, you get an error with some table names (e.g. \"group\")\n\t\t\t\t$bOldColumns = false;\n\t\t\t\tforeach ($aFields as $aFieldData)\n\t\t\t\t{\n\t\t\t\t\tif ($aFieldData[\"Field\"] == 'monday_start')\n\t\t\t\t\t{\n\t\t\t\t\t\t$bOldColumns = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($bOldColumns)\n\t\t\t\t{\n\t\t\t\t\t$aCoverageWindows = CMDBSource::QueryToArray(\"SELECT * FROM `$sTableName`\");\n\t\t\t\t\t$iCount = 0;\n\n\t\t\t\t\tforeach($aCoverageWindows as $aCW)\n\t\t\t\t\t{\n\t\t\t\t\t\t$iId = $aCW['id'];\n\n\t\t\t\t\t\tforeach(array('monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday', 'sunday') as $sWeekday)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($sWeekday == 'wednesday')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$sStartTime = $aCW['wendnesday_start']; // Arghhh!!!\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$sStartTime = $aCW[$sWeekday.'_start'];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$sEndTime = $aCW[$sWeekday.'_end'];\n\n\t\t\t\t\t\t\tif ($sStartTime != $sEndTime)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// Non-empty interval\n\t\t\t\t\t\t\t\t$oInterval = new CoverageWindowInterval();\n\t\t\t\t\t\t\t\t$oInterval->Set('coverage_window_id', $iId);\n\t\t\t\t\t\t\t\t$oInterval->Set('weekday', $sWeekday);\n\t\t\t\t\t\t\t\t$oInterval->Set('start_time', self::FromDecimalIfNeeded($sStartTime));\n\t\t\t\t\t\t\t\t$oInterval->Set('end_time', self::FromDecimalIfNeeded($sEndTime));\n\t\t\t\t\t\t\t\t$oInterval->DBInsert();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$iCount++;\n\t\t\t\t\t}\n\t\t\t\t\tSetupPage::log_info(\"Conversion of open hours intervals: $iCount CoverageWindow instance(s) successfully processed.\");\n\t\t\t\t\t// Be careful 'wendnesday_start !!!\n\t\t\t\t\t$sCleanup = \"ALTER TABLE `$sTableName` DROP `monday_start`, DROP `monday_end`, DROP `tuesday_start`, DROP `tuesday_end`, DROP `wendnesday_start`, DROP `wednesday_end`, \";\n\t\t\t\t\t$sCleanup .= \"DROP `thursday_start`, DROP `thursday_end`, DROP `friday_start`, DROP `friday_end`, DROP `saturday_start`, DROP `saturday_end`, DROP `sunday_start`, DROP `sunday_end`\";\n\t\t\t\t\tCMDBSource::Query($sCleanup);\n\n\t\t\t\t\tSetupPage::log_info(\"CoverageWindow: cleanup of old columns: done.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function week4_changes() \n{\n\t\techo \"<div id=\\\"checkboxes\\\">\n\t\t\t\t\t<label class=\\\"tag\\\"><input type=\\\"checkbox\\\" name=\\\"MON_PRI\\\" value=\\\"YES\\\" class=\\\"regular-checkbox\\\"/>MON_PRI</label> \n\t\t\t\t\t<label class=\\\"tag\\\"><input type=\\\"checkbox\\\" name=\\\"MON_ALT\\\" value=\\\"YES\\\" class=\\\"regular-checkbox\\\"/>MON_ALT</label> \n\t\t\t\t\t<label class=\\\"tag\\\"><input type=\\\"checkbox\\\" name=\\\"WED\\\" value=\\\"YES\\\" class=\\\"regular-checkbox\\\" />WED</label> \n\t\t\t\t\t<label class=\\\"tag\\\"><input type=\\\"checkbox\\\" name=\\\"FRI\\\" value=\\\"YES\\\" class=\\\"regular-checkbox\\\" />FRI</label>\n\t\t\t\t</div>\";\n\tglobal $connection;\n\n\tif(isset($_POST['playdaz'])) \n\t{\n\t\t$LastName=$_SESSION['LAST_NAME'];\t\n\n\t\t$monpri= (isset($_POST['MON_PRI'])) ? \"YES\" :\"NO\";\n\t\t$monalt= (isset($_POST['MON_ALT'])) ? \"YES\" :\"NO\";\n\t\t$wed= (isset($_POST['WED'])) ? \"YES\" :\"NO\";\n\t\t$fri= (isset($_POST['FRI'])) ? \"YES\" :\"NO\";\n\n\t\t//Cannot select 2 courses on the same day\n\t\tif (($monpri ==\"NO\")|| ($monalt==\"NO\"))\n\t\t{\t\t\n\t\t\t$LastName=$_SESSION['LAST_NAME'];\t\n\t\t\t$query = \"UPDATE players3 SET MON_PRI='$monpri',MON_ALT='$monalt',WED='$wed',FRI='$fri' WHERE LAST_NAME='$LastName'\";\n\t\t\tmysqli_query($connection, $query);\t\n\t\t}\t\n\t}\n\n\tif (isset($_POST['goback']))\n\t{\n\t\techo \"<meta http-equiv='refresh' content='1;url=/play1.php'>\\n\";\n\t\texit(96);\n\t}\n\n}", "function getpreviousweek_data_monday($school_id,$classid,$sectionid,$previous_week_fst)\n\t{\n\t\t \n\t\t $result = $this->db->get_where('schoolnew_timetable_weekly_classwise',array('school_id'=>$school_id,'class_id'=>$classid,'section'=>$sectionid,'timetable_date'=>$previous_week_fst))->result();\n\t\t \n\t\t\t$time_table_arr = [];\n\t\t\t\n\t\tif(!empty($result))\n\t\t{\n\t\t\t\t$leave_result = $this->db->get_where('schoolnew_school_assign_holidays',array('school_id'=>$school_id,'class_id'=>$classid,'section'=>$sectionid,'leavedate'=>$previous_week_fst))->result();\n\t\t\t\t\t\n\t\t\t\tforeach($result as $time_index => $period_result)\n\t\t\t\t{\n\t\t\t\t\t if(!empty($leave_result))\n\t\t\t\t\t { \n\t\t\t\t\t\t\tforeach($leave_result as $leave){\n\t\t\t\t\t\t\t\t// echo $leave->periods;\n\t\t\t\t\t\t\t\tif($leave->periods == $period_result->status)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$result[$time_index]->PS = '';\n\t\t\t\t\t\t\t\t\t$result[$time_index]->PT ='';\n\t\t\t\t\t\t\t\t}else\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t }\n\t\t\t\t}\n\t\t}\n\t\t\t// else\n\t\t// {\n\t\t\t\n\t\t // $leave_result = $this->db->get_where('schoolnew_school_assign_holidays',array('school_id'=>$school_id,'class_id'=>$classid,'section'=>$sectionid,'leavedate'=>$this_week_fst))->result();\n\t\t\t\t // // print_r($leave_result);\n\t\t\t\t // $result = [];\n\t\t\t\t\t \n\t\t\t\t\t\t\t// $j = 1;\n\t\t\t\t\t\t\t// for($i=0;$i<8;$i++)\n\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\t\t// if(!empty($leave_result)){\n\t\t\t\t\t\t\t\t\t// if(array_key_exists($i,$leave_result))\n\t\t\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\t\t\t\t// if($leave_result[$i]->periods == $j)\n\t\t\t\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\t\t\t\t\t// $result[$i]['PS'] ='';\n\t\t\t\t\t\t\t\t\t\t\t// $result[$i]['PT'] ='';\n\t\t\t\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// }\t\n\t\t\t\t\t\t\t\t// }else\n\t\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\t\t\t// $result[$i]['PS'] =1;\n\t\t\t\t\t\t\t\t\t// $result[$i]['PT'] =1;\t\n\t\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t\t\t// $j++;\n\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t \n\t\t// }\n\t\tsort($result);\n\t\t// print_r($result);die;\n return $result;\n\t\t\n\t}", "function wp_booking_calendar_process_update(){\n\tglobal $wpdb;\n\t\n\t\n\t$current_version = get_option('wbc_version');\n\tif($current_version == '') {\n\t\t$current_version = \"1.0.0\";\n\t}\n\tswitch($current_version) {\n\t\tcase '1.0.0':\n\t\t\tupdate_option('wbc_show_text_update_admin','1');\n\t\t\tupdate_option('wbc_show_text_update_public','1');\n\t\t\twp_booking_multisite_update();\n\t\t\t\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\t\n\t\t\tbreak;\n\t\tcase '2.0.0':\n\t\t\tupdate_option('wbc_show_text_update_admin','1');\n\t\t\tupdate_option('wbc_show_text_update_public','1');\n\t\t\twp_booking_multisite_update();\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\t\n\t\t\tbreak;\n\t\tcase '2.0.1':\n\t\t\tupdate_option('wbc_show_text_update_admin','1');\n\t\t\tupdate_option('wbc_show_text_update_public','1');\n\t\t\twp_booking_multisite_update();\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\t\n\t\t\tbreak;\n\t\tcase '2.0.2':\n\t\t\tupdate_option('wbc_show_text_update_admin','1');\n\t\t\tupdate_option('wbc_show_text_update_public','1');\n\t\t\twp_booking_multisite_update();\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\t\n\t\t\tbreak;\n\t\tcase '2.0.3':\n\t\t\tupdate_option('wbc_show_text_update_admin','1');\n\t\t\tupdate_option('wbc_show_text_update_public','1');\n\t\t\twp_booking_multisite_update();\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\t\n\t\t\tbreak;\n\t\tcase '2.0.4':\n\t\t\tupdate_option('wbc_show_text_update_admin','1');\n\t\t\tupdate_option('wbc_show_text_update_public','1');\n\t\t\twp_booking_multisite_update();\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\t\n\t\t\tbreak;\n\t\tcase '2.0.5':\n\t\t\tupdate_option('wbc_show_text_update_admin','1');\n\t\t\tupdate_option('wbc_show_text_update_public','1');\n\t\t\twp_booking_multisite_update();\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\t\n\t\t\tbreak;\n\t\tcase '2.0.6':\n\t\t\t\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\twp_booking_multisite_update();\n\t\t\tbreak;\n\t\tcase '2.0.7':\n\t\t\t\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\twp_booking_multisite_update();\n\t\t\tbreak;\n\t\tcase '3.0.0':\n\t\t\t\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\twp_booking_multisite_update();\n\t\t\t\n\t\t\tbreak;\n\t\tcase '3.0.1':\n\t\t\t\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\twp_booking_multisite_update();\n\t\t\tbreak;\n\t\tcase '3.0.2':\n\t\t\t\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\twp_booking_multisite_update();\n\t\t\tbreak;\n\t\tcase '3.0.3':\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\twp_booking_multisite_update();\n\t\t\tbreak;\n\t\tcase '3.0.4':\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\twp_booking_multisite_update();\n\t\t\tbreak;\n\t\tcase '3.0.5':\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\twp_booking_multisite_update();\n\t\t\tbreak;\n\t\tcase '3.0.6':\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\twp_booking_multisite_update();\n\t\t\tbreak;\n\t\tcase '3.0.7':\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\twp_booking_multisite_update();\n\t\t\tbreak;\n\t\tcase '4.0.0':\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\twp_booking_multisite_update();\n\t\t\tbreak;\n\t\tcase '4.0.1':\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\twp_booking_multisite_update();\n\t\t\tbreak;\n\t\tcase '4.0.2':\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\twp_booking_multisite_update();\n\t\t\tbreak;\n\t\tcase '4.0.3':\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\twp_booking_multisite_update();\n\t\t\tbreak;\n\t\tcase '4.0.4':\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\twp_booking_multisite_update();\n\t\t\tbreak;\n\t\tcase '4.0.5':\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\twp_booking_multisite_update();\n\t\t\tbreak;\n\t\tcase '4.0.6':\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\twp_booking_multisite_update();\n\t\t\tbreak;\n\t\tcase '4.0.7':\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\twp_booking_multisite_update();\n\t\t\tbreak;\n\t\tcase '4.0.8':\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\twp_booking_multisite_update();\n\t\t\tbreak;\n\t\tcase '4.0.9':\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\twp_booking_multisite_update();\n\t\t\tbreak;\n\t\tcase '4.1.0':\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\twp_booking_multisite_update();\n\t\t\tbreak;\n\t\tcase '4.1.1':\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\twp_booking_multisite_update();\n\t\t\tbreak;\n\t\tcase '4.1.2':\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\twp_booking_multisite_update();\n\t\t\tbreak;\n\t\tcase '4.1.3':\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\twp_booking_multisite_update();\n\t\t\tbreak;\n\t\tcase '4.1.4':\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\twp_booking_multisite_update();\n\t\t\tbreak;\n\t\tcase '4.1.5':\n\t\t\tupdate_option('wbc_version','4.1.6');\n\t\t\twp_booking_multisite_update();\n\t\t\tbreak;\n\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\n\t}\n\t//wp_booking_multisite_update(); ///FOR TESTING PURPOSE; REMOVE\n\t\n\t\n\t\n\t\n}", "public function fillTime($dayNum,$branch_id,$serv,$org_user,$date)\n { \n //Flag T Check If It Is ShiftNight\n $nightFlag=0;\n //Query To Get Working Hours Of Specific Day Of Specific Branch\n $sqlGetsch=\"SELECT * FROM work_hours WHERE branch_id=? AND day=?\";\n $values=array($branch_id,$dayNum);\n $sch=$this->getInfo($sqlGetsch,$values);\n \n //Query To Get The Average Time Of Service\n $sqlGetServiceID=\"SELECT app_time_avg FROM service WHERE service_id=?\";\n $values=array($serv);\n $getAvg=$this->getInfo($sqlGetServiceID,$values);\n $avgTime=$getAvg[0]['app_time_avg'];\n $avg='+'.$avgTime.' minutes';\n \n //Check If It Is Night Shifts\n if($sch[0]['startA']>\"12:00\" && $sch[0]['endB']>=\"00:00\" && $sch[0]['endB']<=\"12:00\")\n {\n $nightFlag=1;\n $freeTime1 = $this->create_time_range($sch[0]['startA'], \"23:59\" , $avg);\n //To Add Avg And Avoid Duplication Cell\n $time = strtotime(end($freeTime1));\n $avoidTime = date(\"H:i\", strtotime($avg, $time));\n $freeTime2 = $this->create_time_range($avoidTime, $sch[0]['endB'] , $avg);\n $freeTime = array_merge($freeTime1, $freeTime2);\n }\n else // So It Is Morning Shifts\n {\n $freeTime = $this->create_time_range($sch[0]['startA'], $sch[0]['endB'], $avg);\n }\n \n $minTime='-'.$avgTime.' minutes'; //To Get Out The Dates That Are Less Than the Average Appointment Time\n \n //loop To Take out all The Break Time \n for($i=0;$i<count($freeTime);$i++)\n {\n if(isset($freeTime[$i]))//If this index exists\n {\n $t = date(\"H:i\",strtotime($freeTime[$i]));\n $time = strtotime($sch[0]['endA']);\n $endA = date(\"H:i\", strtotime($minTime, $time));\n $startB = date(\"H:i\",strtotime($sch[0]['startB']));\n if($startB==\"00:00\")\n $startB=\"23:59\";\n $time = strtotime($sch[0]['endB']);\n $endB = date(\"H:i\", strtotime($minTime, $time));\n if($t>=$endA && $t<$startB)\n unset($freeTime[$i]);\n }\n }\n //Query To Get All The Appointment Of Specific Day Of Specific Branch With Specific Service\n $sqlGetAllApp=\"SELECT appointment_time FROM appointment WHERE branch_id=? AND service_id=? AND appointment_date=?\";\n $values=array($branch_id,$serv,$date);\n $apps=$this->getInfo($sqlGetAllApp,$values);\n\n\n //loop To Take out all The Exists Time \n for($i=0;$i<count($freeTime);$i++)\n {\n if(isset($freeTime[$i]))//If this index exists\n {\n $t = date(\"H:i\",strtotime($freeTime[$i]));\n foreach($apps as $p)\n {\n $time = date(\"H:i\",strtotime($p['appointment_time']));\n if($t==$time)\n unset($freeTime[$i]);\n }\n }\n }\n //IF Its NightShift So We Remove ALl The Queues In The Next Day\n if($nightFlag==1)\n {\n $newDate=date($date);\n $newDate++;\n //Query To Get All The Appointment Of Specific Day Of Specific Branch With Specific Service\n $sqlGetAllApp=\"SELECT appointment_time FROM appointment WHERE branch_id=? AND service_id=? AND appointment_date=?\";\n $values=array($branch_id,$serv,$newDate);\n $apps=$this->getInfo($sqlGetAllApp,$values);\n\n\n //loop To Take out all The Exists Time \n for($i=0;$i<count($freeTime);$i++)\n {\n if(isset($freeTime[$i]))//If this index exists\n {\n $t = date(\"H:i\",strtotime($freeTime[$i]));\n foreach($apps as $p)\n {\n $time = date(\"H:i\",strtotime($p['appointment_time']));\n if($t==$time)\n unset($freeTime[$i]);\n }\n }\n }\n }\n \n //Paste The Selection List Code Of Time Except The Last One\n foreach($freeTime as $time)\n {\n if($time!=end($freeTime))//Except the ending time\n {\n $startAp = date(\"H:i\",strtotime($time));\n ?> \n <option value=\"<?php echo $startAp; ?>\"><?php echo $startAp; ?></option>\n <?php\n \n }\n }\n }", "private function publishUnpublishSchedule($status, $date_published)\n {\n if(isset($_POST[\"selection\"]) && !empty($_POST[\"selection\"]))\n {\n //if user wants to schedule, get date\n if($date_published==Story::STATUS_SCHEDULE)\n {\n $date_published=$_POST[\"Story\"][\"date_published\"];\n if(empty($date_published))\n {\n Yii::$app->session->setFlash('danger', Yii::t('app', 'Select the date'));\n return $this->goBack();\n }\n\n }\n\n $selection=$_POST[\"selection\"]; //it is checkbox array and value is \"id\" in Story\n foreach ($selection as $key=>$IDstory)\n {\n $story=Story::findOne($IDstory);\n if($date_published==NULL)//unpublish story but leave last date_published\n $date_published=$story->date_published;\n\n $story->status = $status;\n $story->date_published = $date_published;\n $story->date_modified = date(\"Y-m-d H:i:s\"); //this is necesary because of cache dependancy so cache can change\n $story->save(false, ['status', 'date_published', 'date_modified']);\n }\n Yii::$app->session->setFlash('success', Yii::t('app', 'Everything went fine'));\n }\n else\n Yii::$app->session->setFlash('danger', Yii::t('app', 'Something was wrong'));\n\n return $this->goBack();\n }", "function room_reservations_admin_settings_daily_hours_validate($form_id, &$form_state) {\n if ($form_state['clicked_button']['#value'] == t('Save configuration')) {\n $month_value = $form_state['values']['month'];\n $month = intval(drupal_substr($month_value, 5));\n $year = drupal_substr($month_value, 0, 4);\n // Days in the month.\n $days = date('t', mktime(0, 0, 0, $month, 1, $year));\n for ($day = 0; $day < $days; $day++) {\n // Day of the week.\n $dow = date('l', mktime(0, 0, 0, $month, $day + 1, $year));\n // Day of month.\n $dom = $day + 1;\n $open = TRUE;\n $second_shift = FALSE;\n $first_shift_open\n = $form_state['values']['day_' . $day]['first_shift_open_' . $day];\n $first_shift_close\n = $form_state['values']['day_' . $day]['first_shift_close_' . $day];\n $second_shift_open\n = $form_state['values']['day_' . $day]['second_shift_open_' . $day];\n $second_shift_close\n = $form_state['values']['day_' . $day]['second_shift_close_' . $day];\n $int_first_shift_open\n = intval(\n $form_state['values']['day_' . $day]['first_shift_open_' . $day]);\n $int_first_shift_close\n = intval(\n $form_state['values']['day_' . $day]['first_shift_close_' . $day]);\n $int_second_shift_open\n = intval(\n $form_state['values']['day_' . $day]['second_shift_open_' . $day]);\n $int_second_shift_close\n = intval(\n $form_state['values']['day_' . $day]['second_shift_close_' . $day]);\n // Closed.\n if (($int_first_shift_open == 9999) && \n ($int_first_shift_close == 9999) && \n ($int_second_shift_open == 9999) && \n ($int_second_shift_close == 9999)) {\n $open = FALSE;\n }\n // First shift.\n if ($open) {\n if ($int_first_shift_open == 9999) {\n $field = 'day_' . $day . '][first_shift_open_' . $day;\n $message = t('!day - First shift open is required.', \n array('!day' => $dom . ' ' . $dow));\n form_set_error($field, check_plain($message));\n }\n elseif ($int_first_shift_close == 9999) {\n $field = 'day_' . $day . '][first_shift_close_' . $day;\n $message = t('!day - First shift close is required.', \n array('!day' => $dom . ' ' . $dow));\n form_set_error($field, check_plain($message));\n }\n elseif ($int_first_shift_open >= $int_first_shift_close) {\n $field = 'day_' . $day . '][first_shift_close_' . $day;\n $message = t('!day - First shift close must be later than first shift\n open.', array('!day' => $dom . ' ' . $dow));\n form_set_error($field, check_plain($message));\n }\n }\n // Second shift.\n if ($open) {\n if (($int_second_shift_open != 9999) || \n ($int_second_shift_close != 9999)) {\n $second_shift = TRUE;\n }\n }\n if ($second_shift) {\n if (($int_first_shift_open == 9999) && \n ($int_first_shift_close == 9999)) {\n $field = 'day_' . $day . '][second_shift_open_' . $day;\n $message = t('!day - Cannot have a second shift without a first\n shift.', array('!day' => $dom . ' ' . $dow));\n form_set_error($field, check_plain($message));\n }\n elseif ($int_second_shift_open == 9999) {\n $field = 'day_' . $day . '][second_shift_open_' . $day;\n $message = t('!day - Second shift open is missing.', \n array('!day' => $dom . ' ' . $dow));\n form_set_error($field, check_plain($message));\n }\n elseif ($int_second_shift_close == 9999) {\n $field = 'day_' . $day . '][second_shift_close_' . $day;\n $message = t('!day - Second shift close is missing.', \n array('!day' => $dom . ' ' . $dow));\n form_set_error($field, check_plain($message));\n }\n elseif ($int_second_shift_open <= $int_first_shift_close) {\n $field = 'day_' . $day . '][second_shift_open_' . $day;\n $message = t('!day - Second shift open must be later than first\n shift close.', array('!day' => $dom . ' ' . $dow));\n form_set_error($field, check_plain($message));\n }\n elseif ($int_second_shift_open >= $int_second_shift_close) {\n $field = 'day_' . $day . '][second_shift_close_' . $day;\n $message = t('!day - Second shift close must be later than second\n shift opten.', array('!day' => $dom . ' ' . $dow));\n form_set_error($field, check_plain($message));\n }\n }\n }\n }\n}", "function _updateDocmanDocument($sessionKey, $group_id, $item_id, $title, $description, $status, $obsolescence_date, $type, $permissions, $metadata, $owner, $create_date, $update_date, $extraParams = array()) {\n if ($obsolescence_date !== null) {\n $extraParams['item']['obsolescence_date'] = $obsolescence_date;\n }\n return _updateDocmanItem($sessionKey, $group_id, $item_id, $title, $description, $status, $type, $permissions, $metadata, $owner, $create_date, $update_date, $extraParams);\n}", "public function update()\n {\n $persist = false;\n\n $user = $this->database;\n $history = $user->addCureentSemesterToHistory();\n\n $level = null;\n $branch = $this->ldap->getNiveau();\n\n preg_match('/^(.+)[0-9]$/i', $this->ldap->getNiveau(), $match);\n\n if (isset($match[1])) {\n $branch = $match[1];\n $level = str_replace($branch, '', $this->ldap->getNiveau());\n }\n\n $branchList = [];\n $niveauList = [];\n foreach ($this->ldap->getNiveauList() as $niveau) {\n preg_match('/^(.+)[0-9]$/i', $niveau, $match);\n if (isset($match[1])) {\n $branchList[] = $match[1];\n $niveauList[] = str_replace($match[1], '', $niveau);\n }\n }\n\n // Updates\n if (ucfirst(mb_strtolower($this->ldap->getFormation())) != $this->database->getFormation()) {\n $persist = true;\n $user->setFormation(ucfirst(mb_strtolower($this->ldap->getFormation())));\n }\n\n if ($this->array_different($this->ldap->getFormationList(), $this->database->getFormationList())) {\n $persist = true;\n $user->setFormationList($this->ldap->getFormationList());\n }\n\n if ($this->array_different($this->ldap->getNiveauList(), $this->database->getBranchNiveauList())) {\n $persist = true;\n $user->setBranchNiveauList($this->ldap->getNiveauList());\n }\n\n if ($level != $this->database->getNiveau()) {\n $persist = true;\n $user->setNiveau($level);\n }\n\n if ($branch != $this->database->getBranch()) {\n $persist = true;\n $user->setBranch($branch);\n }\n\n // On remet les branches et niveaux dans l'ordre\n if(count($this->ldap->getFormationList()) == count($branchList)) {\n for ($position = 0; $position < count($branchList); $position++) {\n $branch = $branchList[$position];\n if(array_key_exists($branch, DbUser::$branchToFormation) && in_array(DbUser::$branchToFormation[$branch], $this->ldap->getFormationList())) {\n $positionInBranch = array_search(DbUser::$branchToFormation[$branch], $this->ldap->getFormationList());\n if($position != $positionInBranch) {\n $temp = $branchList[$positionInBranch];\n $temp2 = $niveauList[$positionInBranch];\n $branchList[$positionInBranch] = $branch;\n $niveauList[$positionInBranch] = $niveauList[$position];\n $branchList[$position] = $temp;\n $niveauList[$position] = $temp2;\n }\n }\n }\n }\n\n // On remet les filieres dans l'ordre\n $filiereList = $this->ldap->getFiliereList();\n if(count($filiereList) == count($branchList)) {\n for ($position = 0; $position < count($filiereList); $position++) {\n $filiere = $filiereList[$position];\n if(array_key_exists($filiere, DbUser::$filieresToBranch) && in_array(DbUser::$filieresToBranch[$filiere], $branchList)) {\n $positionInBranch = array_search(DbUser::$filieresToBranch[$filiere], $branchList);\n if($position != $positionInBranch) {\n $temp = $filiereList[$positionInBranch];\n $filiereList[$positionInBranch] = $filiere;\n $filiereList[$position] = $temp;\n }\n }\n }\n }\n\n if ($this->ldap->getFiliere() !== $this->database->getFiliere()) {\n $persist = true;\n $user->setFiliere($this->ldap->getFiliere());\n }\n\n if ($this->array_different($filiereList, $this->database->getFiliereList())) {\n $persist = true;\n $user->setFiliereList($filiereList);\n }\n\n if($this->array_different($branchList, $this->database->getBranchList())) {\n $persist = true;\n $user->setBranchList($branchList);\n }\n\n if ($this->array_different($niveauList, $this->database->getNiveauList())) {\n $persist = true;\n $user->setNiveauList($niveauList);\n }\n\n if (implode('|', $this->ldap->getUvs()) != $this->database->getUvs()) {\n $persist = true;\n $user->setUvs(implode('|', $this->ldap->getUvs()));\n }\n\n if ($this->ldap->getFullName() != $this->database->getFullName()) {\n $persist = true;\n $user->setFullName($this->ldap->getFullName());\n }\n\n if ($this->ldap->getFirstName() != $this->database->getFirstName()) {\n $persist = true;\n $user->setFirstName($this->ldap->getFirstName());\n }\n\n if ($this->ldap->getLastName() != $this->database->getLastName()) {\n $persist = true;\n $user->setLastName($this->ldap->getLastName());\n }\n\n if ($this->ldap->getMail() != $this->database->getMail()) {\n $persist = true;\n $user->setMail($this->ldap->getMail());\n }\n\n if ($this->ldap->getRoom() != $this->database->getRoom()) {\n $persist = true;\n $user->setRoom($this->ldap->getRoom());\n }\n\n if ($this->ldap->getStudentId() != $this->database->getStudentId()) {\n $persist = true;\n $user->setStudentId($this->ldap->getStudentId());\n }\n\n if ($this->ldap->getTitle() != $this->database->getTitle()) {\n $persist = true;\n $user->setTitle($this->ldap->getTitle());\n }\n\n if ($this->ldap->getIsStudent() != $this->database->getIsStudent()) {\n $persist = true;\n $user->setIsStudent($this->ldap->getIsStudent());\n }\n\n if ($this->ldap->getIsStaffUTT() != $this->database->getIsStaffUTT()) {\n $persist = true;\n $user->setIsStaffUTT($this->ldap->getIsStaffUTT());\n }\n\n if (!empty($this->ldap->getPhoneNumber()) && 'NC' != $this->ldap->getPhoneNumber() && $this->ldap->getPhoneNumber() != $this->database->getPhoneNumber()) {\n $persist = true;\n $user->setPhoneNumber($this->ldap->getPhoneNumber());\n }\n\n if (!$this->database->getIsInLDAP()) {\n $persist = true;\n $user->setIsInLDAP(true);\n }\n\n // Update official avatar\n $imagine = new Imagine();\n $webDirectory = __DIR__.'/../../../../../../../web';\n $profilePicturesDirectory = __DIR__.'/../../../../../../../profilePictures';\n $avatar = $this->ldap->getLogin().'_official.jpg';\n try {\n $image = $imagine->open($profilePicturesDirectory.'/'.$this->ldap->getStudentId().'.jpg');\n\n $image->copy()\n ->thumbnail(new Box(200, 200), Image::THUMBNAIL_OUTBOUND)\n ->save($webDirectory.'/uploads/photos/'.$this->ldap->getLogin().'_official.jpg');\n } catch (\\Exception $e) {\n $avatar = 'default-avatar.png';\n }\n\n if ($this->database->getAvatar() === $avatar || 'default-avatar.png' === $this->database->getAvatar()) {\n $persist = true;\n $user->setAvatar($avatar);\n }\n\n /*\n * Add badges\n */\n if ('TC' == mb_substr($history['niveau'], 0, 2) && 'TC' != mb_substr($user->getNiveau(), 0, 2)) {\n BadgesManager::userAddBadge($user, 'tc_survivor');\n }\n\n if ($persist) {\n $this->doctrine->getManager()->persist($user);\n }\n\n return $persist;\n }", "private static function printWeeks($startDate, $endDate, $formNum, $id)\r\n {\r\n $newDate = self::splitDates($startDate,$endDate);//retrive array of monday dates\r\n $divs =\"\";\r\n $numDates = count($newDate);\r\n if($numDates===0){//no future mondays meaning end date and start date only range of values\r\n $futuredate= new DateTime($startDate);\r\n $startDate= $futuredate->format(\"Y-m-d\");\r\n $displayStart = $futuredate->format(\"M d,Y\");//format date for route get hive\r\n $futuredate= new DateTime($endDate);\r\n $displayEnd= $futuredate->format(\"M d,Y\");\r\n $divs = \"<li class='list-group-item'><a href='viewform?form=\".$formNum. \"&weekStart=\".$startDate.\"&weekEnd=\".\r\n $futuredate->format(\"Y-m-d\").\"&id=\".$id.\"'>\". $displayStart.\r\n \" - \". $displayEnd.\"</a></li>\" . $divs;\r\n } else{//multiple weeks\r\n\r\n //display start day to saturday\r\n $futuredate= new DateTime($startDate);\r\n $startDate = new DateTime($startDate);\r\n $startDate= $startDate->format(\"Y-m-d\");\r\n if($futuredate->format('N')!=1)// if start date does not fall on a monday create first div\r\n {\r\n $displayStart = $futuredate->format(\"M d,Y\");//format date for route get hive\r\n $futuredate= $futuredate->modify('next sunday');\r\n $displayEnd= $futuredate->format(\"M d,Y\");\r\n $divs = \"<li class='list-group-item'><a href='viewform?form=\".$formNum. \"&weekStart=\".$startDate.\"&weekEnd=\".\r\n $futuredate->format(\"Y-m-d\").\"&id=\".$id.\"'>\". $displayStart.\r\n \" - \". $displayEnd.\"</a></li>\" . $divs;\r\n }\r\n //display all but last week\r\n for($i=0; $i<count($newDate)-1; $i++)\r\n {\r\n $futuredate = new DateTime($newDate[$i]);//convert date time object to be converted to next saturday\r\n $displayStart = $futuredate->format(\"M d,Y\");//format date for route get hive\r\n $futuredate->modify('next sunday');//grab saturday of the weeks monday date provided\r\n $futuredate->format(\"Y-m-d\");//format for route get hive\r\n\r\n $displayEnd =$futuredate->format(\"M d,Y\");//format for html example (October 31, 2018)\r\n //put together href utilizing all the information provided\r\n $divs = \"<li class='list-group-item'><a href='viewform?form=\".$formNum. \"&weekStart=\".$newDate[$i].\"&weekEnd=\".\r\n $futuredate->format(\"Y-m-d\").\"&id=\".$id.\"'>\". $displayStart.\r\n \" - \". $displayEnd.\"</a></li>\" . $divs;\r\n }\r\n\r\n //print last week making end date forms end date\r\n $futuredate = new DateTime($newDate[count($newDate)-1]);//convert date time object to be converted to next saturday\r\n $displayStart = $futuredate->format(\"M d,Y\");//format date for route get hive\r\n $futuredate= new DateTime($endDate);//grab saturday of the weeks monday date provided\r\n\r\n $futuredate->format(\"Y-m-d\");//format for route get hive\r\n\r\n $displayEnd =$futuredate->format(\"M d,Y\");//format for html example (October 31, 2018)\r\n //put together href utilizing all the information provided\r\n $divs = \"<li class='list-group-item'><a href='viewform?form=\".$formNum. \"&weekStart=\".$newDate[count($newDate)-1].\"&weekEnd=\".\r\n $futuredate->format(\"Y-m-d\").\"&id=\".$id.\"'>\". $displayStart.\r\n \" - \". $displayEnd.\"</a></li>\" . $divs;\r\n\r\n }\r\n return $divs;\r\n }", "function Update(){\r\n $query = \"UPDATE userschedules\r\n SET branchId = $this->branchId, \r\n locationCode = '$this->locationCode',\r\n date = '$this->date',\r\n startingTime = '$this->startingTime',\r\n finishingTime = '$this->finishingTime',\r\n status = '$this->status'\r\n WHERE referenceId = $this->referenceId\r\n AND organizationId = $this->organizationId\";\r\n include(\"includes/dbConnection.php\");\t\t\t\r\n $executeQuery = $db->prepare($query);\r\n $executeQuery->execute() or exit(\"Error: UPDATE query failed.\");\r\n }", "public function workersplanning($weeknb = null,$year = null)\n {\n\n //if values are null, takes the date of the day\n if($weeknb == null || $year == null)\n {\n $date = Carbon::now();\n $year = $date->year; \n $weeknb = $date->startOfWeek();\n }\n else\n { \n //creates DateTime object from year and week number and transforms it to a Carbon date \n $date = new DateTime();\n $date->setISODate($year,$weeknb);\n $date = Carbon::instance($date);\n }\n\n return View::make('workersplanning', [\n 'week' => $this->getWeek($date),\n 'year' => $year\n ]);\n }", "public function semester($semester)\n\t{\n\t\t// @todo Please modify the following code to remove attributes that should not be searched.\n\t\t$criteria=new CDbCriteria;\n\t\t$sms=Yii::app()->session->get('sms');\n\t\t$sSmt=Yii::app()->session->get('smt');\n\t\t\n\t\t$criteria->compare('id_kls',$this->id_kls,true);\n\t\t$criteria->compare('id_sms',$this->id_sms,true);\n\t\t$criteria->compare('id_smt',$this->id_smt,true);\n\t\t$criteria->compare('id_mk',$this->id_mk,true);\n\t\t$criteria->compare('nm_kls',$this->nm_kls,true);\n\t\t/*\n\t\t$criteria->compare('sks_mk',$this->sks_mk,true);\n\t\t$criteria->compare('sks_tm',$this->sks_tm,true);\n\t\t$criteria->compare('sks_prak',$this->sks_prak,true);\n\t\t$criteria->compare('sks_prak_lap',$this->sks_prak_lap,true);\n\t\t$criteria->compare('sks_sim',$this->sks_sim,true);\n\t\t$criteria->compare('bahasan_case',$this->bahasan_case,true);\n\t\t$criteria->compare('tgl_mulai_koas',$this->tgl_mulai_koas,true);\n\t\t$criteria->compare('tgl_selesai_koas',$this->tgl_selesai_koas,true);\n\t\t$criteria->compare('id_mou',$this->id_mou,true);\n\t\t$criteria->compare('a_selenggara_pditt',$this->a_selenggara_pditt,true);\n\t\t$criteria->compare('kuota_pditt',$this->kuota_pditt,true);\n\t\t$criteria->compare('a_pengguna_pditt',$this->a_pengguna_pditt,true);\n\t\t$criteria->compare('id_kls_pditt',$this->id_kls_pditt,true);\n\t\t*/\n\t\t$criteria->select=\"mk.kode_mk,mk.nm_mk,mk.sks_mk,mk.id_mk,t.id_kls,t.nm_kls\";\n\t\t$criteria->join='JOIN akt_ajar_dosen as dosen ON dosen.id_kls=t.id_kls';\n\t\t$criteria->join = \"JOIN matkul as mk ON mk.id_mk=t.id_mk\";\n\t\t$criteria->condition = \"t.id_sms = :id_sms AND mk.semester= :semester AND t.id_smt= :id_smt\";\n\t\t\n\t\t$criteria->params = array (\t\n\t\t':id_sms' => $sms,\n\t\t':semester' => $semester,\n\t\t':id_smt' => $sSmt,\n\t\t);\n\n\t\treturn new CActiveDataProvider($this, array(\n\t\t\t'criteria'=>$criteria,\n\t\t\t'pagination'=>false,\n\t\t));\n\t}", "function handleCalendar( $showID, $dates=null, $venueWPID=\"\", $mobile = false ) {\n $monthVal;\n if ( $dates == null ) {\n\n $showID = $_POST['data']['showID'];\n \n $monthVal = $_POST['data']['monthVal'];\n\n $venueWPID = $_POST['data']['venueVal'];\n \n $mobile = isset($_POST['data']['mobile'])? true : false;\n \n // grab \"week\" variable from $_POST, if set, use that to build start and end dates, else call \"getDates\"\n $week = $_POST['data']['week'];\n\n $today = new DateTime('today');\n // if there's no week value, and the selected month matches current month, choose current week\n if ( $week == \"\" && $today->format('n') - 1 == $monthVal ) {\n $start = new DateTime();\n $start->setISODate( $today->format('Y'), $today->format('W'), 0);\n $week = $start->format('Y-m-d');\n }\n\n //echo \"Week is $week\";\n if ( $week != '' ) {\n $trashDate = new DateTime( $week );\n $dates['start'] = new DateTime( $trashDate->format( 'Y-m-d' ) );\n $trashDate->modify( \"+6 days\" );\n $dates['end'] = new DateTime( $trashDate->format( 'Y-m-d' ) );\n } else if ( $week == '' ) {\n // check if current month matches selected month, select current week if so\n $today = new DateTime();\n if ( $today->format('n')-1 == $monthVal) {\n $week = $today->format('W');\n //printDat($week);\n }\n $dates = getDates( $week, $monthVal );\n }\n //var_dump($dates);\n //wp_die();\n }\n\n /*echo \"<pre>\";\n print_r($dates);\n echo \"</pre>\";*/\n\n // set previous and next week variables\n $prevWeek = new DateTime( $dates[\"start\"]->format(\"Y-m-d\") );\n $prevWeek->modify( \"-1 week\" );\n $nextWeek = new DateTime( $dates[\"start\"]->format(\"Y-m-d\") );\n $nextWeek->modify( \"+1 week\" );\n \n $fullEvents = getShowEvents( $showID, $venueWPID, $dates['start']->format( \"Y-m-d\" ), $dates['end']->format( \"Y-m-d\" ) );\n\n if($mobile){\n return array(\n 'events' => $fullEvents,\n 'week' => $nextWeek\n );\n }\n /*echo \"<pre>\";\n print_r($fullEvents);\n echo \"</pre>\";*/\n\n // for each event, create a new array containing their ID, day of the week and time; push that into events array\n $events;\n foreach( $fullEvents as $event ) {\n $daDate = new DateTime( $event->time );\n $toInsert = array (\n \"id\" => $event->id,\n \"hour\" => $daDate->format( 'G' ),\n \"minute\"=> $daDate->format( 'i' ),\n \"day\" => $daDate->format( 'w' )\n );\n $events[] = $toInsert;\n }\n\n\n // new DateTime to hold current start date...will be used to iterate over and populate the day headers without messing with the dates array\n $currWeek = new DateTime( $dates['start']->format(\"Y-m-d\") );\n \n //start building out the HTML that will display the calendar\n $html = \"<div class='cal-nav'><a id='prev-week-btn'><input type='hidden' id='prev-week' value='\" . $prevWeek->format('Y-m-d') . \"' /><img src='\" . get_template_directory_uri() . \"/library/assets/icons/dotted-arrow.png' /></a>\";\n $html .= \"<span id='date-range'>\" . $dates['start']->format('M j') . \" - \" . $dates['end']->format( 'M j' ) . \"</span>\";\n $html .= \"<a id='next-week-btn'><input type='hidden' id='next-week' value='\" . $nextWeek->format('Y-m-d') . \"' /><img src='\" . get_template_directory_uri() . \"/library/assets/icons/dotted-arrow.png' /></a></div>\";\n $html .= \"<table id='events-calendar'><tr class='days-heading'>\";\n\n // while loop to create the day of the week headers (complete month/day indications)\n $cntr = 0;\n while( $cntr < 7 ) {\n $html .= \"<td>\" . $currWeek->format( 'D n/j' ) . \"</td>\";\n $currWeek->modify( '+1 day' );\n $cntr++;\n }\n $html .= \"</tr>\"; // finish off the day headings row\n\n // another loop, this one to populate in events on each day\n $cntr = 0;\n $html .= \"<tr>\";\n if ( isset( $events ) ) {\n while( $cntr < 7 ) {\n $html .= \"<td>\";\n\n // cycle through events array, grabbing any for current day (based on \"day\" value)\n foreach( $events as $event ) {\n\n $url = home_url( '/' ) . \"tickets/?eventID=\" . $event['id'];\n if( $event['day'] == $cntr ) {\n // build time variable, including converting from 24 hour to 12 hour time\n if ( $event['hour'] > 12 ) {\n $time = $event['hour']-12 . \":\" . $event['minute'] . \" PM\";\n } else {\n $time = $event['hour'] . \":\" . $event['minute'] . \" AM\";\n }\n \n $html .= \"<a href='\" . $url . \"' class='show-time' id='\" . $event['id'] . \"' >\" . $time . \"</a>\";\n }\n }\n $html .= \"</td>\";\n $cntr++;\n }\n } else {\n $html .= \"<td colspan='7'>No events for this week</td>\";\n }\n $html .= \"</tr>\";\n\n $html .= \"<tr><td colspan='7' style='height: 50px'> </td></tr>\";\n\n $html .= \"</table>\";\n\n\n echo $html;\n\n if( $_POST ) {\n wp_die();\n }\n}", "public function get_semester()\n {\n $round = $this->get_round();\n $roundNumber = $round['numero'];\n /*Se obtiene la fecha final para sacar el mes*/\n $r = $round['fecha_final'];\n \n /*Se obtiene el mes de la ronda*/\n $m = $r[5].$r[6];\n /*Cómo la ronda no indica cual semestre es el actual la única forma de sacarlo es comparando las fecha actual, si es Junio o antes es el semestre 1, en caso contrario es semestre 2\n En julio se pueden empezar a pedir asistencias del segundo semestre?*/\n if ($m <= 6){\n $semestre = 1;\n } else {\n $semestre = 2;\n }\n \n return $semestre;\n }", "public function songoftheweek() {\n list($year,$week) = explode('.', date(\"Y.W\",time()));\n\n //$this->loadModel('Part');\n $this->loadModel('Song');\n $mSong = $this->Song->find('first', array('conditions'=>array('year' => $year, 'week' => $week)));\n // 1. Determine if we have a song for this week yet\n if ($mSong) {\n // We have an song to display\n $song = Song::normalizeArrayKeys($mSong['Song']['arrangement']);\n } else {\n // Create a new one\n $song = $this->Song->createSong();\n\n // Save it to db as this week's song\n $savedata = array(\n 'Song' => array(\n 'created'=>date(\"Y-m-d H:i:s\", time()),\n 'arrangement'=>$song\n ),\n 'Songs_week' => array(\n 'year'=>$year,\n 'week'=>$week,\n ),\n );\n $this->Song->saveAll($savedata);\n }\n\n // Shows song of the week\n $songoftheweek = $this->Song->makeSongDisplayParts($song);\n $this->set('key', $songoftheweek['key']);\n $this->set('affinity', $songoftheweek['affinity']);\n $this->set('chords', $songoftheweek['chords']);\n $this->set('concepts', $songoftheweek['concepts']);\n $this->set('arrangement', $songoftheweek['arrangement']);\n $this->set('mode', $songoftheweek['mode']);\n $this->set('scale', Song::getKeyValue($songoftheweek,'scale'));\n\n // Calculate how much time to next song\n $nextweek = (date(\"W\",time())) + 1;\n $curyear = date(\"Y\",time());\n $dt = new DateTime('now');\n $dt->setISODate($curyear,$nextweek);\n $newsongtime = strtotime($dt->format('Y-m-d') . ' 00:00:00');\n // Calculate times\n $seconds = ($newsongtime - time());\n $minutes = ($seconds / 60);\n $hours = ($minutes / 60);\n $days = ($hours / 24);\n //Decide whether to show days, hours, minutes, or seconds\n $timevalue = (float)$days;\n $units = (int)$timevalue == 1 ? 'day' : 'days';\n // Switch to hours\n if ($timevalue < 1.0) {\n $timevalue = (float)$hours;\n $units = (int)$timevalue == 1 ? 'hour' : 'hours';\n }\n // Switch to minutes\n if ($timevalue < 1.0) {\n $timevalue = (float)$minutes;\n $units = (int)$timevalue ? 'minute' : 'minutes';\n }\n // Switch to seconds\n if ($timevalue < 1.0) {\n $timevalue = (float)$seconds;\n $units = (int)$timevalue ? 'second' : 'seconds';\n }\n // Round timeval\n $timevalue = floor((float)$timevalue);\n\n $this->set('timeleft', \"$timevalue $units\");\n\n // Show existing songs\n // $this->set('songs', $this->Song->find('all'));\n\n // Show my todo list\n $list = <<<qq\n <li>Song of the week has to recover and fill in missing weeks if not gen'd\n <li>Concepts came up with same word twice.\n <li>Unique constraint on week+year on arr_weeks\n <li>have a debug controller, so I can just, when logged in, type in my\n ideas and they save in a pagn'td list.\n <li>Unit tests, deploy\n <li>on 1/1/2012 at 5 pm it said there are 364 more days until the next song</li>\n <li>LInking to the site always send you to login page.</li>\n\t\nqq;\n $this->set('todo', $list);\n }", "public function updateSalary() \r\n\t{\r\n\t\t$query = \"UPDATE \" . $this->table . \" SET\r\n\t\t poslednja_plata = current_date(),\r\n\t\tsledeca_plata = current_date() + interval 30 day\r\n\t\t\tWHERE id_radnik = ?\";\r\n\r\n\t\t$stmt = $this->conn->prepare($query);\r\n\r\n\t\t$stmt->bindParam(1, $this->id_radnik);\r\n\r\n\t\t$stmt->execute();\r\n\t}", "function update() {\n\t\n\t \t$sql = \"UPDATE evs_database.evs_group \n\t \t\t\tSET\tgru_id=?, gru_name=?, gru_head_dept=? \n\t \t\t\tWHERE gru_id=?\";\n\t\t\n\t\t$this->db->query($sql, array($this->gru_id_new, $this->gru_name, $this->gru_head_dept, $this->gru_id_old));\n\t\t \n\t }", "private function updateUnPublishOnDate()\n {\n $this->owner->UnPublishOnDate = $this->owner->DesiredUnPublishDate;\n // Remove the DesiredUnPublishDate.\n $this->owner->DesiredUnPublishDate = null;\n }", "function week3_changes() \n{\n\t\techo \"<div id=\\\"checkboxes\\\">\n\t\t\t\t\t<label class=\\\"tag\\\"><input type=\\\"checkbox\\\" name=\\\"MON_PRI\\\" value=\\\"YES\\\" class=\\\"regular-checkbox\\\"/>MON_PRI</label> \n\t\t\t\t\t<label class=\\\"tag\\\"><input type=\\\"checkbox\\\" name=\\\"MON_ALT\\\" value=\\\"YES\\\" class=\\\"regular-checkbox\\\"/>MON_ALT</label> \n\t\t\t\t\t<label class=\\\"tag\\\"><input type=\\\"checkbox\\\" name=\\\"WED\\\" value=\\\"YES\\\" class=\\\"regular-checkbox\\\" />WED</label> \n\t\t\t\t\t<label class=\\\"tag\\\"><input type=\\\"checkbox\\\" name=\\\"FRI\\\" value=\\\"YES\\\" class=\\\"regular-checkbox\\\" />FRI</label>\n\t\t\t\t</div>\";\n\n\tglobal $connection;\n\n\tif(isset($_POST['playdaz'])) \n\t{\n\t\t$LastName=$_SESSION['LAST_NAME'];\t\n\n\t\t$monpri= (isset($_POST['MON_PRI'])) ? \"YES\" :\"NO\";\n\t\t$monalt= (isset($_POST['MON_ALT'])) ? \"YES\" :\"NO\";\n\t\t$wed= (isset($_POST['WED'])) ? \"YES\" :\"NO\";\n\t\t$fri= (isset($_POST['FRI'])) ? \"YES\" :\"NO\";\n\n\t\t//Cannot select 2 courses on the same day\n\t\tif (($monpri ==\"NO\")|| ($monalt==\"NO\"))\n\t\t{\t\t\n\t\t\t$LastName=$_SESSION['LAST_NAME'];\t\n\t\t\t$query = \"UPDATE players2 SET MON_PRI='$monpri',MON_ALT='$monalt',WED='$wed',FRI='$fri' WHERE LAST_NAME='$LastName'\";\n\t\t\tmysqli_query($connection, $query);\t\n\t\t}\t\n\t}\n\n\tif (isset($_POST['goback']))\n\t{\n\t\techo \"<meta http-equiv='refresh' content='1;url=/play1.php'>\\n\";\n\t\texit(96);\n\t}\n}", "function modif_date_dern($db, $username, $date_dern_conn)\n{\n $query = $db->prepare(\"\n \n UPDATE users SET date_dern_conn=:date_dern_conn\n\n WHERE username=:username\n \n \");\n\n $query->bindParam(\":username\", $username);\n $query->bindParam(\":date_dern_conn\", $date_dern_conn);\n\n return $query->execute();\n}", "public function setNewWindow($newWindow) {}", "public function setNewWindow($newWindow) {}", "public function inscribirAlumno(Request $request)\n {\n // if(!$request->ajax()) return redirect('/');\n try {\n DB::beginTransaction();\n //Search the user who's about to get modified\n\n $student = Student::where('id_user', '=', $request->id_user)->firstOrFail();\n $student->id_group = $request->id_group;\n $student->save();\n\n $group = Group::findOrFail($request->id_group);\n $group->num_students++;\n $group->save();\n\n DB::commit();\n\n } catch (Exception $e) {\n DB::rollBack();\n }\n }", "function createRegistrationDates($regID, $time_data, $group)\n {\n \n $data['registrationID'] = $regID;\n $data['registration_active'] = 1;\n\n //Rooms Available\n $rooms = 6;\n foreach($time_data as $key => $item){\n if( $item != null ){\n //echo \"\\nDate: $key\";\n $data['registration_date'] = $key;\n foreach($item as $detail){\n //echo \"($detail)\";\n //the user selected times go here (one hour time slot)\n $data['registration_timein'] = \"$detail:00:00\";\n $data['registration_timeout'] = \"$detail:59:59\";\n //send to database here the times.\n for($room = 1; $room <= $rooms; $room++){\n if($group == 1) {\n if($room == 3) { //needs to upload into room 3\n if( !$this->getRegistrationByDate($key, $room, \"$detail:00:00\", \"$detail:59:59\") ){ //find an open space\n $data['roomspotID'] = $room;\n //$sql = $this->db->set($data)->get_compiled_insert('pt_registration_dates');\n $this->db->insert('pt_registration_dates', $data);\n //echo $sql;\n $room = $rooms;\n } else {\n //keep going\n }\n }\n } else {\n echo \"else-\";\n if($room == 3) { //needs to upload into room 3\n echo $room; // do nothing\n } else {\n if( !$this->getRegistrationByDate($key, $room, \"$detail:00:00\", \"$detail:59:59\") ){ //find an open space\n $data['roomspotID'] = $room;\n //$sql = $this->db->set($data)->get_compiled_insert('pt_registration_dates');\n $this->db->insert('pt_registration_dates', $data);\n //echo $sql;\n $room = $rooms;\n } else {\n //keep going\n }\n }\n } //else end\n } // end rooms loop\n\n } //item detail\n } //item != null\n }\n\n }", "public function update()\n {\n if ( ! $this->bean->getId()) {\n $this->bean->user = R::dispense('user')->current();\n }\n $this->bean->year = date('Y', strtotime($this->bean->invoicedate));\n $this->bean->m = date('m', strtotime($this->bean->invoicedate));\n $this->bean->d = date('d', strtotime($this->bean->invoicedate));\n $this->bean->yearname = $this->bean->year.$this->bean->name;\n parent::update();\n }", "public static function week_calendar($day, $month, $year) {\r\n global $langNoEvents, $langDay, $langWeek, $langMonth, $langViewShow;\r\n\r\n $calendar_content = \"\";\r\n if (is_null($day)) {\r\n $day = 1;\r\n }\r\n $nextweekdate = new DateTime(\"$year-$month-$day\");\r\n $nextweekdate->add(new DateInterval('P1W'));\r\n $previousweekdate = new DateTime(\"$year-$month-$day\");\r\n $previousweekdate->sub(new DateInterval('P1W'));\r\n\r\n $thisweekday = new DateTime(\"$year-$month-$day\");\r\n $difffromMonday = ($thisweekday->format('w') == 0)? 6:$thisweekday->format('w')-1;\r\n $monday = $thisweekday->sub(new DateInterval('P'.$difffromMonday.'D')); //Sunday->1, ..., Saturday->7\r\n $weekdescription = ucfirst(format_locale_date($monday->getTimestamp()));\r\n $sunday = $thisweekday->add(new DateInterval('P6D'));\r\n $weekdescription .= ' - '.ucfirst(format_locale_date($sunday->getTimestamp()));\r\n $cursorday = $thisweekday->sub(new DateInterval('P6D'));\r\n\r\n $backward = array('day'=>$previousweekdate->format('d'), 'month'=>$previousweekdate->format('m'), 'year' => $previousweekdate->format('Y'));\r\n $foreward = array('day'=>$nextweekdate->format('d'), 'month'=>$nextweekdate->format('m'), 'year' => $nextweekdate->format('Y'));\r\n\r\n $calendar_content .= '<div class=\"right\" style=\"width:100%\">'.$langViewShow.':&nbsp;'.\r\n '<a href=\"#\" onclick=\"show_day(selectedday, selectedmonth, selectedyear);return false;\">'.$langDay.'</a>&nbsp;|&nbsp;'.\r\n '<a href=\"#\" onclick=\"show_week(selectedday, selectedmonth, selectedyear);return false;\">'.$langWeek.'</a>&nbsp;|&nbsp;'.\r\n '<a href=\"#\" onclick=\"show_month(selectedday, selectedmonth, selectedyear);return false;\">'.$langMonth.'</a></div>';\r\n\r\n $calendar_content .= \"<table class='table-default'>\";\r\n $calendar_content .= \"<tr>\";\r\n $calendar_content .= '<td width=\"25\"><a href=\"#\" onclick=\"show_week('.$backward['day'].','.$backward['month'].','.$backward['year'].'); return false;\">&laquo;</a></td>';\r\n $calendar_content .= \"<td class='center'><b>$weekdescription</b></td>\";\r\n $calendar_content .= '<td width=\"25\" class=\"right\"><a href=\"#\" onclick=\"show_week('.$foreward['day'].','.$foreward['month'].','.$foreward['year'].'); return false;\">&raquo;</a></td>';\r\n $calendar_content .= \"</tr>\";\r\n $calendar_content .= \"</table>\";\r\n $eventlist = Calendar_Events::get_calendar_events(\"week\", \"$year-$month-$day\");\r\n\r\n $calendar_content .= \"<table class='table-default'>\";\r\n\r\n $curday = 0;\r\n $now = getdate();\r\n $today = new DateTime($now['year'].'-'.$now['mon'].'-'.$now['mday']);\r\n $curstartddate = \"\";\r\n foreach ($eventlist as $thisevent) {\r\n if ($curstartddate != $thisevent->startdate) { //event date changed\r\n $thiseventdatetime = new DateTime($thisevent->startdate);\r\n while($cursorday < $thiseventdatetime) {\r\n if ($cursorday == $today)\r\n $class = 'today';\r\n else\r\n $class = 'monthLabel';\r\n $calendar_content .= \"<tr><td colspan='3' class='$class'>\" . \"&nbsp;<b>\" . ucfirst(format_locale_date($cursorday->getTimestamp())) . \"</b></td></tr>\";\r\n $calendar_content .= \"<tr><td colspan='3'>$langNoEvents</td></tr>\";\r\n $cursorday->add(new DateInterval('P1D'));\r\n $curday++;\r\n }\r\n if ($thiseventdatetime == $today)\r\n $class = 'today';\r\n else\r\n $class = 'monthLabel';\r\n $calendar_content .= \"<tr><td colspan='3' class='$class'>\" . \"&nbsp;<b>\" . ucfirst(format_locale_date(strtotime($thisevent->startdate))) . \"</b></td></tr>\";\r\n if ($cursorday <= $thiseventdatetime) {\r\n $cursorday->add(new DateInterval('P1D'));\r\n $curday++;\r\n }\r\n }\r\n $calendar_content .= Calendar_Events::week_calendar_item($thisevent, 'even');\r\n $curstartddate = $thisevent->startdate;\r\n }\r\n /* Fill with empty days*/\r\n for($i=$curday;$i<7;$i++) {\r\n if ($cursorday == $today)\r\n $class = 'today';\r\n else\r\n $class = 'monthLabel';\r\n $calendar_content .= \"<tr><td colspan='3' class='$class'>\" . \"&nbsp;<b>\" . ucfirst(format_locale_date($cursorday->getTimestamp())) . \"</b></td></tr>\";\r\n $calendar_content .= \"<tr><td colspan='3'>$langNoEvents</td></tr>\";\r\n $cursorday->add(new DateInterval('P1D'));\r\n }\r\n $calendar_content .= \"</table>\";\r\n /* Legend */\r\n $calendar_content .= Calendar_Events::calendar_legend();\r\n\r\n return $calendar_content;\r\n }", "public function updateStatusOnNewDay() {\n // Update advs\n UIAdv::where('last_update_time', '<', Carbon::now()->subDays(1))->where('status', '=', 1)->update([\n 'last_update_time' => Carbon::now(),\n 'status' => 0\n ]);\n\n // Update advgroups\n UIAdvGroup::where('last_update_time', '<', Carbon::now()->subDays(1))->where('status', '=', 1)->update([\n 'last_update_time' => Carbon::now(),\n 'status' => 0\n ]);\n\n // Update campaign\n UICampaign::where('last_update_time', '<', Carbon::now()->subDays(1))->where('status', '=', 1)->update([\n 'last_update_time' => Carbon::now(),\n 'status' => 0\n ]);\n\n // Update project\n UIProject::where('last_update_time', '<', Carbon::now()->subDays(1))->where('status', '=', 1)->update([\n 'last_update_time' => Carbon::now(),\n 'status' => 0\n ]);\n }", "public function saveUrsprung($monat,$jahr){\n $this->db->query(\"delete from dzeitsoll2 where MONTH(datum)='$monat' and YEAR(datum)='$jahr'\");\n $sql_select = \"select * from dzeitsoll where MONTH(datum)='$monat' and YEAR(datum)='$jahr'\";\n $result = $this->db->query($sql_select);\n $vlozeno =0;\n $user = \"PHP_\".$_SERVER[\"REMOTE_ADDR\"];//.\"/\".$_SESSION[\"user\"];\n while($row = $result->fetch()){\n $sql_insert = \"insert into dzeitsoll2 (persnr,datum,oe,stunden,user) values('\".$row['persnr'].\"','\".$row['datum'].\"','\".$row['oe'].\"','\".$row['stunden'].\"','\".$user.\"')\";\n $this->db->query($sql_insert);\n $vlozeno++;\n }\n\n return $vlozeno;\n }", "public function updateStatuses()\n {\n $affected = DB::update('UPDATE los_orders SET status_code=1 WHERE status_code=0 AND order_date IN (SELECT provide_date FROM los_lunchdates WHERE orders_placed IS NOT NULL)');\n $affected = DB::update('UPDATE los_orders SET status_code=0 WHERE status_code=1 AND order_date IN (SELECT provide_date FROM los_lunchdates WHERE orders_placed IS NULL)');\n }", "public function listenrolladminstu(){\n\t\t$data['deptlist'] = $this->commodel->get_list('Department');\n\t\t$currentacadyear =$this->datesemmodel->getcurrentAcadYear();\n $semester = 1;\n\t\tif(isset($_POST['search'])) \n \t\t{\n\t\t\t$date1 = $this->input->post('stu_sdate');\n\t\t\t$date2 = $this->input->post('stu_edate');\n\t\t\t$department = $this->input->post('stu_dept',TRUE);\n\t\t\tif($date1 == '' && $date2 == '' && $department == ''){\n\t\t\t\t$this->session->set_flashdata('err_message', 'Please Select The Date or Department.');\n\t\t\t\tredirect('adminadmissionstu/listenrolladminstu');\n\t\t\t}else{\n\t\t\t\tif(($date1 != \"\" && $date2 == \"\") || ($date1 == \"\" && $date2 != \"\")){\n\t\t\t\t\t$this->session->set_flashdata('err_message', 'Both date fields are required.');\n\t\t\t\t\tredirect('adminadmissionstu/listenrolladminstu');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(($date1 != \"\" && $date2 != \"\") && $department != ''){\n\t\t\t\t\t$wharray = array('sp_semregdate >=' =>$date1 , 'sp_semregdate <=' => $date2 ,'sp_deptid' => $department,'sp_acadyear' => $currentacadyear,'sp_semester' => $semester);\n\t\t\t\t}\n\t\t\t\telseif(($date1 != \"\" && $date2 != \"\") && $department == ''){\n\t\t\t\t\t$wharray = array('sp_semregdate >=' =>$date1 , 'sp_semregdate <=' => $date2 ,'sp_acadyear' => $currentacadyear,'sp_semester' => $semester);\t\n\t\t\t\t}\n\t\t\t\telseif(($date1 == \"\" && $date2 == \"\") && $department != ''){\n\t\t\t\t\t$wharray = array('sp_deptid' => $department,'sp_acadyear' => $currentacadyear,'sp_semester' => $semester);\t\t\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t$wharray = array('sp_acadyear' => $currentacadyear,'sp_semester' => $semester);\n\t\t}\n\t\t$selectdata = 'sp_smid,sp_programid,sp_semregdate';\t\n\t\t$getstuid = $this->commodel->get_listspficemore('student_program',$selectdata,$wharray);\n \t$data['getstuid'] = $getstuid;\t\t\n\t\n\t\t\n $this->load->view('student_admission/adminstu_enrollment',$data);\n\n }" ]
[ "0.54173446", "0.53403986", "0.5276634", "0.52528405", "0.5057836", "0.504292", "0.49953982", "0.4977624", "0.49515852", "0.49476478", "0.4934838", "0.48512033", "0.48436323", "0.48073518", "0.47486657", "0.4690914", "0.4671974", "0.4659962", "0.46387848", "0.46379924", "0.46104428", "0.46083206", "0.45919278", "0.45737085", "0.454121", "0.45406863", "0.4540405", "0.453843", "0.4536801", "0.45331722", "0.4517616", "0.45172063", "0.45116708", "0.45060351", "0.4502193", "0.44998267", "0.44978252", "0.44977117", "0.44882432", "0.44607994", "0.44596136", "0.44584388", "0.44559196", "0.44403726", "0.44373488", "0.44306394", "0.4422404", "0.44199455", "0.44095656", "0.4401593", "0.44002715", "0.4397443", "0.4395672", "0.43956518", "0.43881452", "0.43750036", "0.4365325", "0.43598804", "0.43493494", "0.43464917", "0.43422544", "0.4326677", "0.4322057", "0.43127123", "0.43119735", "0.4306571", "0.43039814", "0.43030632", "0.42836046", "0.4283535", "0.42781577", "0.42744088", "0.42737925", "0.42727214", "0.42677498", "0.42614162", "0.4258104", "0.4245323", "0.42443368", "0.42431965", "0.42430905", "0.4240987", "0.42391616", "0.42378485", "0.42372835", "0.423439", "0.42279541", "0.4227246", "0.42173237", "0.42158148", "0.4214402", "0.4214402", "0.42141217", "0.42126712", "0.4210973", "0.4200622", "0.4191321", "0.41859397", "0.41812584", "0.4181238" ]
0.55120105
0
Method to insert window dates into the windows table for a given semester
public function insert($array){ $sql="INSERT into windows values(?,?,?,?,?)"; $data[0]=$array['season'] . ' ' . $array['year']; $data[1]=$array['appfrom']; $data[2]=$array['appto']; $data[3]=$array['commentfrom']; $data[4]=$array['commentto']; $bol=$this->db->query($sql,$data); if($bol) return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function insertGamesToDate() {\n $conn = getConnection();\n $yesterdayDate = date('Y-m-d',strtotime(\"-1 days\"));\n\n $url = \"https://statsapi.web.nhl.com/api\";\n $all_games = \"/v1/schedule?startDate=2018-10-03&endDate=\".$yesterdayDate;\n\n $jsonString = file_get_contents($url.$all_games);\n $jsonObject = json_decode($jsonString);\n $sql = \"INSERT INTO Games_ToDate VALUES \";\n $jsonObject = $jsonObject -> dates;\n\n // populate associative array of win streaks for teams\n $streakArray = array();\n $dayBeforeGames = array();\n $dayOfGames = array();\n $teams_from_db = $conn -> query(\"SELECT id FROM teams\");\n while($row = $teams_from_db -> fetch_assoc()) {\n $streakArray = array_push_assoc($streakArray, $row['id'], 0);\n $dayBeforeGames = array_push_assoc($dayBeforeGames, $row['id'], 0);\n $dayOfGames = array_push_assoc($dayOfGames, $row['id'], 0);\n }\n\n // loop through json object of all games from last year\n foreach($jsonObject as $key => $item) {\n $date = $item->date;\n\n // move values from dayOfGames to dayBeforeGames\n // the make all day of games 0\n foreach($dayOfGames as $key => $value) {\n $dayBeforeGames[$key] = $value;\n $dayOfGames[$key] = 0;\n }\n\n for($i = 0; $i < sizeof($item->games); $i++) {\n // store home and away teams\n $home_id = $item->games[$i]->teams->home->team->id;\n $away_id = $item->games[$i]->teams->away->team->id;\n\n // loop through day of games and update values to 1 of teams playing\n foreach($dayOfGames as $key => $value) {\n if($value == $home_id) {\n $dayOfGames[$key] = 1;\n }elseif($key == $away_id) {\n $dayOfGames[$key] = 1;\n }\n }\n\n // ignore games from all star weekend\n if($home_id == 90 || $home_id == 89|| $home_id == 88 || $home_id == 87) {\n continue;\n }\n\n //ignore non NHL team that played this year\n if($home_id == 7202) {\n continue;\n }\n\n // score of the game to determine winner\n $homeScore = $item->games[$i]->teams->home->score;\n $awayScore = $item->games[$i]->teams->away->score;\n\n // store current streaks for teams\n $homeStreak = $streakArray[$home_id];\n $awayStreak = $streakArray[$away_id];\n\n // determine winner and store winner (winner is 1 for home team and 0 for away)\n // store wins for home and away teams\n // winning team is wins -1 because api store wins based on outcome of current game\n if($homeScore > $awayScore) {\n $winner = 1;\n $winner_id = $home_id;\n\n // update streaks for both teams\n $streakArray[$winner_id]++;\n $streakArray[$away_id] = 0;\n $home_wins = $item->games[$i]->teams->home->leagueRecord->wins - 1;\n $away_wins = $item->games[$i]->teams->away->leagueRecord->wins;\n } else {\n $winner = 0;\n $winner_id = $away_id;\n\n // update streaks for both teams\n $streakArray[$winner_id]++;\n $streakArray[$home_id] = 0;\n $away_wins = $item->games[$i]->teams->away->leagueRecord->wins - 1;\n $home_wins = $item->games[$i]->teams->home->leagueRecord->wins;\n }\n // add game states to sql for insert\n $sql .= \"(\".$home_id.\", \".$away_id.\", \".$home_wins.\", \".$away_wins.\", \".$homeStreak.\", \".$awayStreak.\", \".$dayBeforeGames[$home_id].\", \".$dayBeforeGames[$away_id].\", \".$winner.\", '\".$date.\"'),\";\n }\n }\n // replace last comma with a semicolon\n $sql = substr($sql, 0, -1).\";\";\n\n // insert to db\n $conn -> query($sql);\n }", "function insertLastYearGames() {\n\n $conn = getConnection();\n\n $url = \"https://statsapi.web.nhl.com/api\";\n $all_games = \"/v1/schedule?startDate=2017-10-04&endDate=2018-04-10\";\n\n $jsonString = file_get_contents($url.$all_games);\n $jsonObject = json_decode($jsonString);\n $sql = \"INSERT INTO LastYear_Games VALUES \";\n $jsonObject = $jsonObject -> dates;\n\n // populate associative array of win streaks for teams\n $streakArray = array();\n $dayBeforeGames = array();\n $dayOfGames = array();\n $teams_from_db = $conn -> query(\"SELECT id FROM teams\");\n while($row = $teams_from_db -> fetch_assoc()) {\n $streakArray = array_push_assoc($streakArray, $row['id'], 0);\n $dayBeforeGames = array_push_assoc($dayBeforeGames, $row['id'], 0);\n $dayOfGames = array_push_assoc($dayOfGames, $row['id'], 0);\n }\n\n // loop through json object of all games from last year\n foreach($jsonObject as $key => $item) {\n $date = $item->date;\n\n // move values from dayOfGames to dayBeforeGames\n // the make all day of games 0\n foreach($dayOfGames as $key => $value) {\n $dayBeforeGames[$key] = $value;\n $dayOfGames[$key] = 0;\n }\n\n for($i = 0; $i < sizeof($item->games); $i++) {\n // store home and away teams\n $home_id = $item->games[$i]->teams->home->team->id;\n $away_id = $item->games[$i]->teams->away->team->id;\n\n // loop through day of games and update values to 1 of teams playing\n foreach($dayOfGames as $key => $value) {\n if($value == $home_id) {\n $dayOfGames[$key] = 1;\n }elseif($key == $away_id) {\n $dayOfGames[$key] = 1;\n }\n }\n\n // ignore games from all star weekend\n if($home_id == 90 || $home_id == 89|| $home_id == 88 || $home_id == 87) {\n continue;\n }\n\n // score of the game to determine winner\n $homeScore = $item->games[$i]->teams->home->score;\n $awayScore = $item->games[$i]->teams->away->score;\n\n // store current streaks for teams\n $homeStreak = $streakArray[$home_id];\n $awayStreak = $streakArray[$away_id];\n\n // determine winner and store winner (winner is 1 for home team and 0 for away)\n // store wins for home and away teams\n // winning team is wins -1 because api store wins based on outcome of current game\n if($homeScore > $awayScore) {\n $winner = 1;\n $winner_id = $home_id;\n\n // update streaks for both teams\n $streakArray[$winner_id]++;\n $streakArray[$away_id] = 0;\n $home_wins = $item->games[$i]->teams->home->leagueRecord->wins - 1;\n $away_wins = $item->games[$i]->teams->away->leagueRecord->wins;\n } else {\n $winner = 0;\n $winner_id = $away_id;\n\n // update streaks for both teams\n $streakArray[$winner_id]++;\n $streakArray[$home_id] = 0;\n $away_wins = $item->games[$i]->teams->away->leagueRecord->wins - 1;\n $home_wins = $item->games[$i]->teams->home->leagueRecord->wins;\n }\n // add game states to sql for insert\n $sql .= \"(\".$home_id.\", \".$away_id.\", \".$home_wins.\", \".$away_wins.\", \".$homeStreak.\", \".$awayStreak.\", \".$dayBeforeGames[$home_id].\", \".$dayBeforeGames[$away_id].\", \".$winner.\", '\".$date.\"'),\";\n }\n }\n // replace last comma with a semicolon\n $sql = substr($sql, 0, -1).\";\";\n\n // insert to db\n $conn -> query($sql);\n }", "public function insertcreatedperiods()\n {\n if (!Gate::allows('Administrator')) return redirect('/home')->with('warning', __('Somehow you the system tried to let you do something which is not allowed. So you are sent home!'));\n Input::merge(['test' => 'redirected']);\n $seasons = Input::get('seasons', 5);\n $periodlength = Input::get('periodlength', 7);\n $houseid = Input::get('houseid', 1);\n $ownerid = House::Find($houseid)->ownerid;\n $errors = [];\n $success = __('No new period have been created');\n $houses = House::filter(Input::all())->pluck('name', 'id')->toArray();\n $thisyear = Carbon::now()->year;\n\n\n\n //Set default data for each season\n $defaultperiod = [];\n $data = Input::get('data');\n\n $defaultperiod['basepersons'] = $data['basepersons'];\n $defaultperiod['maxpersons'] = $data['maxpersons'];\n $defaultperiod['baseprice'] = $data['baseprice'];\n $defaultperiod['personprice'] = $data['personprice'];\n $seasonstart = $data['seasonstart'];\n $seasonend = $data['seasonend'];\n\n\n for($i=0;$i<$seasons;$i++)\n {\n $seasonstart[$i] = Carbon::parse($seasonstart[$i]);\n $seasonend[$i] = Carbon::parse($seasonend[$i]);\n if ($seasonstart[$i]->gte($seasonend[$i])) $errors[$i] = __('Season').$i.': '.__('The end date must be after start date.');\n if ($i > 0)\n {\n if ($seasonend[$i-1]->gt($seasonstart[$i])) $errors[$i] = __('The start date must be after the previous end date.');\n }\n }\n\n //echo('Redirecting test: '.Input::get('test', 'nothing') . ' seasonend 0: ' .$seasonend[0]->format('d-m-Y'));\n if (sizeof($errors) > 0)\n {\n $success = __('Noting created, please check the errors below.');\n }\n\n //Find Easter sundays\n for($i=0;$i<6;$i++)\n {\n $year[$i] = $thisyear + $i;\n $easter[$i] = date('d-m-Y',easter_date($year[$i]));\n }\n\n //We create periods\n if (sizeof($errors) == 0)\n {\n for($i=0;$i<$seasons;$i++)\n {\n $from = clone($seasonstart[$i]);\n $to = clone($from);\n $to->addDays($periodlength);\n $counter = 0;\n //die(\"Periodlength: $periodlength from: \".$from.\" to: \".$to);\n while ($to->lte($seasonend[$i]))\n {\n //check for committed periods\n $count = Periodcontract::where('houseid', $houseid)->where('committed', 1)->whereDate('from', '<=', $from)->whereDate('to', '>=', $to)->count();\n $count += Periodcontract::where('houseid', $houseid)->where('committed', 1)->whereDate('from', '<=', $to)->whereDate('to', '>=', $to)->count();\n $count += Periodcontract::where('houseid', $houseid)->where('committed', 1)->whereDate('from', '<=', $from)->whereDate('to', '>=', $from)->count();\n\n if($count > 0)\n {\n $errors[] = __('There are committed periods among the new, it will not be saved').'.';\n }\n else\n {\n //Check for overlapping non-committed periods and delete them\n $periodfrom = Periodcontract::where('houseid', $houseid)->where('committed', null)->whereDate('from', '<=', $from)->whereDate('to', '>', $from)->orderBy('to', 'desc')->first();\n $periodto = Periodcontract::where('houseid', $houseid)->where('committed', null)->whereDate('from', '<', $to)->whereDate('to', '>=', $to)->orderBy('to')->first();\n if (($periodfrom) && ($periodto))\n {\n $overlappingtpdelete = Period::where('houseid', $houseid)->whereDate('to', '>=', $periodfrom->from)->whereDate('from', '<=', $periodto->to)->count();\n if ($overlappingtpdelete > 0) $errors[] = __('At least one existing overlapping period has been deleted.');\n Period::where('houseid', $houseid)->whereDate('to', '>=', $periodfrom->from)->whereDate('from', '<=', $periodto->to)->delete();\n }\n elseif($periodfrom)\n {\n Period::where('id', $periodfrom->id)->delete();\n $errors[] = __('One existing overlapping period has been deleted.');\n }\n\n //There are no committed period clashing with the period we will create no, so we go ahead\n //die(var_dump($defaultperiod));\n //if (!array_key_exists($i, $defaultperiod)) die(\"Key $i does not exist in array:\".var_dump($defaultperiod));\n $period = new Period(['basepersons' => $defaultperiod['basepersons'][$i],\n 'maxpersons' => $defaultperiod['maxpersons'][$i],\n 'baseprice' => $defaultperiod['baseprice'][$i],\n 'personprice' => $defaultperiod['personprice'][$i],\n 'houseid' => $houseid,\n 'ownerid' => $ownerid]);\n $period->from = $from;\n $period->to = $to;\n $period->year = $from->year;\n $period->weeknumber = $to->weekOfYear;\n if(!$period->save())\n {\n die(\"Errors: \".var_dump($period->getErrors()));\n }\n $counter++;\n $success = $counter.' '.__('new periods created');\n }\n $from = clone($to);\n $to = $to->addDays($periodlength);\n }\n }\n }\n\n session()->flash('success', $success);\n return view('house/createperiods', [\n 'houses' => $houses,\n 'houseid' => $houseid,\n 'seasons' => $seasons,\n 'periodlength' => $periodlength, 'seasons' => $seasons,\n 'year' => $year,\n 'errors' => $errors,\n 'easter' => $easter,\n 'data' => $data]);\n\n }", "function chunk($chunk_start_date, $chunk_end_date, $j)\n{\n\n global $db;\n $sharedFunctions = new Shared($db);\n\n $query = \"SELECT *\n\t\tFROM ibl_schedule\n\t\tWHERE Date BETWEEN '$chunk_start_date' AND '$chunk_end_date'\n\t\tORDER BY SchedID ASC\";\n $result = $db->sql_query($query);\n $num = $db->sql_numrows($result);\n\n $teamSeasonRecordsQuery = \"SELECT tid, leagueRecord FROM ibl_standings ORDER BY tid ASC;\";\n $teamSeasonRecordsResult = $db->sql_query($teamSeasonRecordsQuery);\n\n $arrayLastSimDates = $sharedFunctions->getLastSimDatesArray();\n $lastSimStartDate = date_create($arrayLastSimDates[\"Start Date\"]);\n $lastSimEndDate = date_create($arrayLastSimDates[\"End Date\"]);\n $projectedNextSimEndDate = date_add($lastSimEndDate, date_interval_create_from_date_string('7 days'));\n\n // override $projectedNextSimEndDate to account for the blank week at end of HEAT\n $currentSeasonEndingYear = $sharedFunctions->getCurrentSeasonEndingYear();\n $currentSeasonBeginningYear = $currentSeasonEndingYear - 1;\n if ($projectedNextSimEndDate >= date_create(\"$currentSeasonBeginningYear-10-23\") and $projectedNextSimEndDate < date_create(\"$currentSeasonBeginningYear-11-01\")) {\n $projectedNextSimEndDate = date_create(\"$currentSeasonBeginningYear-11-08\");\n }\n\n echo \"<table width=\\\"500\\\" cellpadding=\\\"6\\\" cellspacing=\\\"0\\\" border=\\\"1\\\" align=center>\";\n\n $i = 0;\n $z = 0;\n while ($i < $num) {\n $date = $db->sql_result($result, $i, \"Date\");\n $visitor = $db->sql_result($result, $i, \"Visitor\");\n $visitorScore = $db->sql_result($result, $i, \"VScore\");\n $home = $db->sql_result($result, $i, \"Home\");\n $homeScore = $db->sql_result($result, $i, \"HScore\");\n $boxid = $db->sql_result($result, $i, \"BoxID\");\n\n $visitorTeamname = $sharedFunctions->getTeamnameFromTid($visitor);\n $homeTeamname = $sharedFunctions->getTeamnameFromTid($home);\n $visitorRecord = $db->sql_result($teamSeasonRecordsResult, $visitor - 1, \"leagueRecord\");\n $homeRecord = $db->sql_result($teamSeasonRecordsResult, $home - 1, \"leagueRecord\");\n\n if (($i % 2) == 0) {\n $bgcolor = \"FFFFFF\";\n } else {\n $bgcolor = \"DDDDDD\";\n }\n\n if (($z % 2) == 0) {\n $bgcolor2 = \"0070C0\";\n } else {\n $bgcolor2 = \"C00000\";\n }\n\n if ($visitorScore == $homeScore and date_create($date) <= $projectedNextSimEndDate) {\n $bgcolor = \"DDDD00\";\n }\n\n if ($visitorScore > $homeScore) {\n $visitorTeamname = '<b>' . $visitorTeamname . '</b>';\n $visitorRecord = '<b>' . $visitorRecord . '</b>';\n $visitorScore = '<b>' . $visitorScore . '</b>';\n } elseif ($homeScore > $visitorScore) {\n $homeTeamname = '<b>' . $homeTeamname . '</b>';\n $homeRecord = '<b>' . $homeRecord . '</b>';\n $homeScore = '<b>' . $homeScore . '</b>';\n }\n\n if ($date == $datebase) {\n echo \"<tr bgcolor=$bgcolor>\n\t\t\t\t<td>$date</td>\n\t\t\t\t<td><a href=\\\"modules.php?name=Team&op=team&tid=$visitor\\\">$visitorTeamname ($visitorRecord)</a></td>\n\t\t\t\t<td align=right>$visitorScore</td>\n\t\t\t\t<td><a href=\\\"modules.php?name=Team&op=team&tid=$home\\\">$homeTeamname ($homeRecord)</a></td>\n\t\t\t\t<td align=right>$homeScore</td>\n\t\t\t\t<td><a href=\\\"ibl/IBL/box$boxid.htm\\\">View</a></td>\n\t\t\t</tr>\";\n } else {\n echo \"<tr>\n\t\t\t\t<td></td><td></td><td></td><td></td><td></td><td></td>\n\t\t\t</tr>\";\n echo \"<tr bgcolor=$bgcolor2>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Date</td>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Visitor</td>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Score</td>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Home</td>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Score</td>\n\t\t\t\t<td><font color=\\\"FFFFFF\\\"><b>Box Score</td>\n\t\t\t</tr>\";\n echo \"<tr bgcolor=$bgcolor>\n\t\t\t\t<td>$date</td>\n\t\t\t\t<td><a href=\\\"modules.php?name=Team&op=team&tid=$visitor\\\">$visitorTeamname ($visitorRecord)</a></td>\n\t\t\t\t<td align=right>$visitorScore</td>\n\t\t\t\t<td><a href=\\\"modules.php?name=Team&op=team&tid=$home\\\">$homeTeamname ($homeRecord)</a></td>\n\t\t\t\t<td align=right>$homeScore</td>\n\t\t\t\t<td><a href=\\\"ibl/IBL/box$boxid.htm\\\">View</a></td>\n\t\t\t</tr>\";\n $datebase = $date;\n $z++;\n }\n $i++;\n }\n echo \"</table>\";\n //return array($homewin, $homeloss, $visitorwin, $visitorloss);\n}", "function insertLastFiveYears() {\n\n $conn = getConnection();\n\n $url = \"https://statsapi.web.nhl.com/api\";\n // all games from the start of the 2013-2014 season to 2017-2018 season\n $all_games = \"/v1/schedule?startDate=2013-10-01&endDate=2018-04-10\";\n\n $jsonString = file_get_contents($url.$all_games);\n $jsonObject = json_decode($jsonString);\n $sql = \"INSERT INTO Games_Last5Years VALUES \";\n $jsonObject = $jsonObject -> dates;\n\n // populate associative array of win streaks for teams\n $streakArray = array();\n $dayBeforeGames = array();\n $dayOfGames = array();\n $teams_from_db = $conn -> query(\"SELECT id FROM teams\");\n while($row = $teams_from_db -> fetch_assoc()) {\n $streakArray = array_push_assoc($streakArray, $row['id'], 0);\n $dayBeforeGames = array_push_assoc($dayBeforeGames, $row['id'], 0);\n $dayOfGames = array_push_assoc($dayOfGames, $row['id'], 0);\n }\n\n // loop through json object of all games from last year\n foreach($jsonObject as $key => $item) {\n $date = $item->date;\n\n // move values from dayOfGames to dayBeforeGames\n // the make all day of games 0\n foreach($dayOfGames as $key => $value) {\n $dayBeforeGames[$key] = $value;\n $dayOfGames[$key] = 0;\n }\n\n for($i = 0; $i < sizeof($item->games); $i++) {\n\n // skip over playoff games\n if(strcmp($item->games[$i]->gameType, \"P\") == 0) {\n break;\n }\n\n\n // store home and away teams\n $home_id = $item->games[$i]->teams->home->team->id;\n $away_id = $item->games[$i]->teams->away->team->id;\n\n // skip over all star games and team that is not in the nhl anymore (27)\n if($home_id == 90 || $home_id == 89|| $home_id == 88 || $home_id == 87 || $home_id == 93 || $home_id == 94 ||\n $home_id == 27 || $away_id == 27) {\n continue;\n }\n\n // loop through day of games and update values to 1 of teams playing\n foreach($dayOfGames as $key => $value) {\n if($value == $home_id) {\n $dayOfGames[$key] = 1;\n }elseif($key == $away_id) {\n $dayOfGames[$key] = 1;\n }\n }\n\n // score of the game to determine winner\n $homeScore = $item->games[$i]->teams->home->score;\n $awayScore = $item->games[$i]->teams->away->score;\n\n // store current streaks for teams\n $homeStreak = $streakArray[$home_id];\n $awayStreak = $streakArray[$away_id];\n\n // determine winner and store winner (winner is 1 for home team and 0 for away)\n // store wins for home and away teams\n // winning team is wins -1 because api store wins based on outcome of current game\n if($homeScore > $awayScore) {\n $winner = 1;\n $winner_id = $home_id;\n\n // update streaks for both teams\n $streakArray[$winner_id]++;\n $streakArray[$away_id] = 0;\n $home_wins = $item->games[$i]->teams->home->leagueRecord->wins - 1;\n $away_wins = $item->games[$i]->teams->away->leagueRecord->wins;\n } else {\n $winner = 0;\n $winner_id = $away_id;\n\n // update streaks for both teams\n $streakArray[$winner_id]++;\n $streakArray[$home_id] = 0;\n $away_wins = $item->games[$i]->teams->away->leagueRecord->wins - 1;\n $home_wins = $item->games[$i]->teams->home->leagueRecord->wins;\n }\n // add game states to sql for insert\n $sql .= \"(\".$home_id.\", \".$away_id.\", \".$home_wins.\", \".$away_wins.\", \".$homeStreak.\", \".$awayStreak.\", \".$dayBeforeGames[$home_id].\", \".$dayBeforeGames[$away_id].\", \".$winner.\", '\".$date.\"'),\";\n }\n }\n // replace last comma with a semicolon\n $sql = substr($sql, 0, -1).\";\";\n\n // insert to db\n $conn -> query($sql);\n }", "function drugSiteTable($semaine)\n{\n\n $jourDebutSemaine = getdate2($semaine); // récupère les jours de la semaine en fonction de la date sélectionnée\n $stupSheetId = GetSheetbyWeek($semaine, $_SESSION[\"Selectsite\"])[\"stupsheet_id\"]; // la feuille de stupéfiants à afficher\n $novas = getNovasForSheet($stupSheetId); // Obtient la liste des ambulances utilisées par cette feuille\n $drugs = getDrugs(); // Obtient la liste des drugs\n $BatchesForSheet = getBatchesForSheet($stupSheetId); // Obtient la liste des batches utilisées par cette feuille\n\n // preparer un tableau de batchs par médicament pour faciliter le travail de la vue\n foreach ($BatchesForSheet as $p) {\n $batchesByDrugId[$p[\"drug_id\"]][] = $p;\n }\n\n $listofbaseid = getListOfStupSheets($_SESSION[\"Selectsite\"]);\n $date = strtotime($jourDebutSemaine);\n $site = getbasebyid($_SESSION[\"Selectsite\"])[\"name\"];\n $jours = array(\"Lundi\", \"Mardi\", \"Mercredi\", \"Jeudi\", \"vendredi\", \"samedi\", \"dimanche\");\n require_once 'view/Drug/drugSiteTable.php';\n}", "public function run()\n {\n DB::table('periods')->insert([\n 'month_year' => '2021-06',\n 'month' => 'June',\n 'year' => '2021',\n 'description'=>'Monthly Adjustment'\n ]);\n DB::table('periods')->insert([\n 'month_year' => '2021-07',\n 'month' => 'July',\n 'year' => '2021',\n 'description'=>'Adjustment Semester 1'\n ]);\n }", "function insertweek($Name,$day1,$day2,$day3,$day4,$day5,$day6,$day7,$day8)\n{\n\tmysql_query(\"INSERT INTO clusterdata_week\n\t(topic_name, Cluster_0,Cluster_1,Cluster_2,Cluster_3,Cluster_4,Cluster_5,Cluster_6,Cluster_7) VALUES('$Name', '$day1', '$day2', '$day3', '$day4', '$day5', '$day6', '$day7','$day8' ) \")\n\tor die(mysql_error());\n\t//echo \"Data Inserted!\";\n}", "public function run()\n {\n DB::table('users_season')->insert([\n 'users_ID' => 1,\n 'season_ID' => 1,\n ]);\n\n DB::table('users_season')->insert([\n 'users_ID' => 2,\n 'season_ID' => 2,\n ]);\n }", "public static function addShift($request)\n {\t\n\t\t$getDate = UserShifts::where('date',$request['date'])->get();\n\t\tif(count($getDate) > 0) {\n\t\t\tforeach($getDate as $gd) {\n\t\t\t\tif($gd->date == $request['date'] && $gd->user_id == $request['user_id']) {\n\t\t\t\t\t$update = DB::table('user_shifts')\n\t\t\t\t\t->where(['user_id' => $request['user_id'], 'date' => $request['date']])\n\t\t\t\t\t->update(array('shift' => $request['shift'],'ps_color' => $request['ps_color'],'ps_desc' => $request['ps_desc']));\n\t\t\t\t\treturn $update;\n\t\t\t\t} else {\n\t\t\t\t$shift = UserShifts::create([\n\t\t\t\t\t'shift' => $request['shift'],\n\t\t\t\t\t'ps_color' => $request['ps_color'],\n\t\t\t\t\t'ps_desc' => $request['ps_desc'],\n\t\t\t\t\t'date' => $request['date'],\n\t\t\t\t\t'user_id' => $request['user_id'],\n\t\t\t\t\t'shift_type_id' => 5,\n\t\t\t\t\t'loc_id'=>0\n\t\t\t\t]);\n\t\t\t\treturn $shift;\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t$shift = UserShifts::create([\n 'shift' => $request['shift'],\n\t\t\t'ps_color' => $request['ps_color'],\n\t\t\t'ps_desc' => $request['ps_desc'],\n 'date' => $request['date'],\n 'user_id' => $request['user_id'],\n\t\t\t'shift_type_id' => 5,\n\t\t\t'loc_id'=>0\n ]);\n\t\treturn $shift;\n\t\t}\n }", "function insertAll(&$msg){\n global $githubOutput,$worldometersOutput;\n\n $firstDate = \"2020-01-22\";\n $lastDate = \"2020-03-21\";\n\n worldometersDownload();\n $msg.= \"<br><b>stiahnute z Worldometers</b>\";\n\n //podla: https://stackoverflow.com/questions/45566865/how-to-iterate-between-two-dates-with-php?noredirect=1&lq=1\n $date = $firstDate;\n\n //prechadzaju sa vsetky datumy a pre kazdy sa ulozia data do tabulky\n while (strtotime($date) <= strtotime($lastDate)) {\n $newDate = date(\"m-d-Y\",strtotime($date));\n githubDownload($newDate);\n insertGithubIntoPlace($githubOutput);\n insertWorldmetersIntoPlace($worldometersOutput);\n insertIntoData($githubOutput);\n $date = date (\"Y-m-d\", strtotime(\"+1 day\", strtotime($date)));\n }\n $msg.= \"<br><b>stiahnute z Github</b>\";\n}", "public static function insert(){\n $dayOfWeek = $_REQUEST[\"dayOfWeek\"];\n $startTime = $_REQUEST[\"startTime\"];\n $endTime = $_REQUEST[\"endTime\"];\n \n $result = DB::dataManipulation(\"INSERT INTO timeslots (dayOfWeek, startTime, endTime)\n VALUES ('$dayOfWeek','$startTime','$endTime')\");\n return $result;\n }", "function\nsave_monthly_summary_for_timeslot($dbconn, $target_area, $language, $start_time, $target, $season,$start_date,$stop_date,$freeze)\n{\n\t$obs_query = query_for_detail($language, $season, $target_area, $start_time, $start_date, $stop_date, $freeze, 'T');\n\n\t$query = \"INSERT INTO saved_monthly_summaries\"\n\t\t.\" (target_area, language, start_time, target, month, score, freeze_date)\"\n\t\t.\" SELECT '$target_area','$language','$start_time',$target,'$start_date', round(avg(o),1) AS score, '$freeze'\"\n\t\t.\" FROM (SELECT \\\"date\\\", max(o) AS o FROM ($obs_query) AS o GROUP BY \\\"date\\\") AS d\";\n\n\t$result = pg_query($dbconn, $query);\n\tpg_free_result($result);\n\n\t$obs_query = query_for_detail($language, $season, $target_area, $start_time, $start_date, $stop_date, $freeze, 'F');\n\n\t$query = \"UPDATE saved_monthly_summaries SET out_score = o\"\n\t\t.\" FROM (SELECT round(avg(o),1) AS o\"\n\t\t.\" FROM (SELECT \\\"date\\\", max(o) AS o FROM ($obs_query) AS o GROUP BY \\\"date\\\") AS d) AS a\"\n\t\t.\" WHERE \\\"language\\\"='$language'\"\n\t\t.\" AND target_area='$target_area'\"\n\t\t.\" AND start_time = '$start_time'\"\n\t\t.\" AND month = '$start_date'\";\n\n\t$result = pg_query($dbconn, $query);\n\tpg_free_result($result);\n}", "public function run()\n {\n\n $wd_open = new Shift();\n $wd_open->name = 'weekday_opening';\n $wd_open->startTime = '083000';\n $wd_open->endTime = '173000';\n $wd_open->paidHours = 8;\n $wd_open->isActive = true;\n $wd_open->sortOrder = 1;\n $wd_open->save();\n\n $wd_close = new Shift();\n $wd_close->name = 'weekday_closing';\n $wd_close->startTime = '123000';\n $wd_close->endTime = '213000';\n $wd_close->paidHours = 8;\n $wd_close->isActive = true;\n $wd_close->sortOrder = 3;\n $wd_close->save();\n\n $wd_midshift = new Shift();\n $wd_midshift->name = 'weekday_midshift';\n $wd_midshift->startTime = '103000';\n $wd_midshift->endTime = '193000';\n $wd_midshift->paidHours = 8;\n $wd_midshift->isActive = true;\n $wd_midshift->sortOrder = 2;\n $wd_midshift->save();\n\n }", "public function run()\n {\n// DB::table('week_tracker')->delete();\n//\n// $begin = '05-10-2015';\n//\n// for ($i = 1; $i <= 156; $i++) {\n// DB::table('week_tracker')->insert(\n// [\n// 'id' => $i,\n// 'start_date' => 'John',\n// 'end_date' => 'Doe',\n// 'month' => md5('test'),\n// 'year' => '[email protected]'\n// ]\n// );\n// }\n }", "public function insert($calendario);", "function teacher_assign_class_weeklytable_monday($savemonday,$tablename)\n\t{\t\n\t $this->db->insert($tablename,$savemonday); \n return $this->db->insert_id();\t\n\t}", "public function run()\n {\n DB::table('series')->insert([[\n 'title' => \"the walking dead\",\n 'publication_year' => 2011,],[\n 'title' => \"how i met your mother\",\n 'publication_year' => 2009,\n\n ]\n\n ]);\n }", "function createRegistrationDates($regID, $time_data, $group)\n {\n \n $data['registrationID'] = $regID;\n $data['registration_active'] = 1;\n\n //Rooms Available\n $rooms = 6;\n foreach($time_data as $key => $item){\n if( $item != null ){\n //echo \"\\nDate: $key\";\n $data['registration_date'] = $key;\n foreach($item as $detail){\n //echo \"($detail)\";\n //the user selected times go here (one hour time slot)\n $data['registration_timein'] = \"$detail:00:00\";\n $data['registration_timeout'] = \"$detail:59:59\";\n //send to database here the times.\n for($room = 1; $room <= $rooms; $room++){\n if($group == 1) {\n if($room == 3) { //needs to upload into room 3\n if( !$this->getRegistrationByDate($key, $room, \"$detail:00:00\", \"$detail:59:59\") ){ //find an open space\n $data['roomspotID'] = $room;\n //$sql = $this->db->set($data)->get_compiled_insert('pt_registration_dates');\n $this->db->insert('pt_registration_dates', $data);\n //echo $sql;\n $room = $rooms;\n } else {\n //keep going\n }\n }\n } else {\n echo \"else-\";\n if($room == 3) { //needs to upload into room 3\n echo $room; // do nothing\n } else {\n if( !$this->getRegistrationByDate($key, $room, \"$detail:00:00\", \"$detail:59:59\") ){ //find an open space\n $data['roomspotID'] = $room;\n //$sql = $this->db->set($data)->get_compiled_insert('pt_registration_dates');\n $this->db->insert('pt_registration_dates', $data);\n //echo $sql;\n $room = $rooms;\n } else {\n //keep going\n }\n }\n } //else end\n } // end rooms loop\n\n } //item detail\n } //item != null\n }\n\n }", "function add_game($name, $categories, $platforms, $editor, $dates) {\n\n $result = true;\n $id_editor = get_editor_by_name($editor);\n\n $query = \"INSERT INTO jeu VALUES ('', '$name', '$id_editor')\";\n $result = $result && ( mysql_query($query) or die(mysql_error()) );\n\n // Recuperation de l'id de jeu insere\n $game_id = mysql_fetch_array( mysql_query(\"SELECT idJeu FROM jeu WHERE nomJeu = '$name'\") )[\"idJeu\"];\n \n // Construction de la requete d'insertion pour les plateformes\n $query = \"INSERT INTO estDisponible VALUES\";\n \n // Parcours des plateformes à ajouter\n for ($i = 0; $i < count($platforms); ++$i) {\n // Recuperation de la date de sortie correspondante\n $date = $dates[$platforms[$i] - 1];\n\n $pattern = \"/^[0-9]{4}-[0-9]{2}-[0-9]{2}/\"; // Regexp du format date : AAAA-MM-JJ (la taille est limitee a 10 par le formulaire)\n\n // Si la date n'est pas fournie ou n'est pas au bon format, utiliser la date du jour\n if ( $date == \"\" or ( ! preg_match($pattern, $date)) ) {\n $date = date(\"Y-m-d\");\n }\n // Sinon, si la date est au bon format mais est invalide ou postérieure à la date actuelle, utiliser la date du jour\n else {\n $dateParsee = date_parse_from_format(\"Y-m-d\", $date);\n if ( ! checkdate($dateParsee['month'], $dateParsee['day'], $dateParsee['year']) ) {\n\t$date = date(\"Y-m-d\");\n }\n else {\n\t$now = date_parse_from_format(\"Y-m-d\", date(\"Y-m-d\"));\n\tif ( ($dateParsee['year'] > $now['year']) ||\n\t ( ($dateParsee['year'] == $now['year']) && ($dateParsee['month'] > $now['month']) ) ||\n\t ( ($dateParsee['year'] == $now['year']) && ($dateParsee['month'] == $now['month']) && ($dateParsee['day'] > $now['day']) ) ) {\n\t $date = date(\"Y-m-d\");\n\t}\n }\n }\n \n // Construction de la requete\n $query .= \" ('$platforms[$i]', '$game_id', '$date'),\";\n }\n \n $query = substr($query, 0, -1); // Suppression de la virgule en trop en fin de ligne\n $result = $result && ( mysql_query($query) or die(mysql_error()) );\n\n // Construction de la requete d'insertion pour les categories\n $query = \"INSERT INTO appartient VALUES\"; \n foreach ($categories as $id_category) {\n $query .= \" ('$id_category', '$game_id'),\";\n }\n $query = substr($query, 0, -1); // Suppression de la virgule en trop en fin de ligne\n $result = $result && ( mysql_query($query) or die(mysql_error()) );\n \n return $result;\n}", "function insert_into_database($journey_times, $dow, $hod) {\n $save_sql = \"INSERT INTO link_times_development (start_stopid,end_stopid,\"\n \t .\"hour,day,link_time) \"\n\t .\"VALUES (:start_stopid, :end_stopid, :hour, :day, :link_time)\";\n\n $save_time = $this->DBH->prepare($save_sql);\n\n foreach($journey_times as $entry) {\n $save_time->bindValue(':start_stopid', $entry['start'],PDO::PARAM_STR);\n $save_time->bindValue(':end_stopid', $entry['end'],PDO::PARAM_STR);\n $save_time->bindValue(':hour', $hod,PDO::PARAM_INT);\n $save_time->bindValue(':day', $dow,PDO::PARAM_INT);\n $save_time->bindValue(':link_time', $entry['average_time']);\n $save_time->execute();\n }\n }", "public function run()\n {\n DB::table('week_days')->insert([\n [\n 'number' => 2,\n 'description' => 'Monday',\n 'short' => 'mon', \n 'days_to_end' => 6, \n ],\n [\n 'number' => 3,\n 'description' => 'Tuesday',\n 'short' => 'tue', \n 'days_to_end' => 5, \n ],\n [\n 'number' => 4,\n 'description' => 'Wednesday',\n 'short' => 'wed', \n 'days_to_end' => 4, \n ],\n [\n 'number' => 5,\n 'description' => 'Thursday',\n 'short' => 'thu', \n 'days_to_end' => 3, \n ],\n [\n 'number' => 6,\n 'description' => 'Friday',\n 'short' => 'fri', \n 'days_to_end' => 2, \n ],\n [\n 'number' => 7,\n 'description' => 'Saturday',\n 'short' => 'sat', \n 'days_to_end' => 1, \n ],\n [\n 'number' => 8,\n 'description' => 'Sunday',\n 'short' => 'sun', \n 'days_to_end' => 0, \n ], \n ]); \n }", "function insert($Name,$day1,$day2,$day3,$day4,$day5,$day6,$day7)\n{\n\tmysql_query(\"INSERT INTO current_week\n\t(topic_name, day_1,day_2,day_3,day_4,day_5,day_6,day_7) VALUES('$Name', '$day1', '$day2', '$day3', '$day4', '$day5', '$day6', '$day7' ) \") \n\tor die(mysql_error()); \n\t\n}", "static function prePopulateFromPastWeeks($startDate, $dayHeaders) {\n global $user;\n global $i18n;\n\n // First, determine past week start and end dates.\n $objDate = new DateAndTime(DB_DATEFORMAT, $startDate);\n $objDate->decDay(7);\n $pastWeekStartDate = $objDate->toString(DB_DATEFORMAT);\n $objDate->incDay(6);\n $pastWeekEndDate = $objDate->toString(DB_DATEFORMAT);\n unset($objDate);\n\n // Obtain past week(s) records.\n $records = ttWeekViewHelper::getRecordsForInterval($pastWeekStartDate, $pastWeekEndDate);\n // Handle potential situation of no records by re-trying for up to 4 more previous weeks (after a long vacation, etc.).\n if (!$records) {\n for ($i = 0; $i < 4; $i++) {\n $objDate = new DateAndTime(DB_DATEFORMAT, $pastWeekStartDate);\n $objDate->decDay(7);\n $pastWeekStartDate = $objDate->toString(DB_DATEFORMAT);\n $objDate->incDay(6);\n $pastWeekEndDate = $objDate->toString(DB_DATEFORMAT);\n unset($objDate);\n\n $records = ttWeekViewHelper::getRecordsForInterval($pastWeekStartDate, $pastWeekEndDate);\n // Break out of the loop if we found something.\n if ($records) break;\n }\n }\n\n // Construct the first row for a brand new entry.\n $dataArray[] = array('row_id' => null,'label' => $i18n->get('form.week.new_entry').':'); // Insert row.\n // Insert empty cells with proper control ids.\n for ($i = 0; $i < 7; $i++) {\n $control_id = '0_'. $dayHeaders[$i];\n $dataArray[0][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'duration' => null);\n }\n $includeNotes = $user->isOptionEnabled('week_notes');\n if ($includeNotes) {\n // Construct the second row for daily comments for a brand new entry.\n $dataArray[] = array('row_id' => null,'label' => $i18n->get('label.notes').':'); // Insert row.\n // Insert empty cells with proper control ids.\n for ($i = 0; $i < 7; $i++) {\n $control_id = '1_'. $dayHeaders[$i];\n $dataArray[1][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'note' => null);\n }\n }\n\n // Iterate through records and build an \"empty\" $dataArray.\n foreach ($records as $record) {\n // Create row id with 0 suffix. In prepopulated view, we only need one row for similar records.\n $row_id = ttWeekViewHelper::makeRowIdentifier($record).'_0';\n // Find row.\n $pos = ttWeekViewHelper::findRow($row_id, $dataArray);\n if ($pos < 0) {\n // Insert row for durations.\n $dataArray[] = array('row_id' => $row_id,'label' => ttWeekViewHelper::makeRowLabel($record));\n $pos = ttWeekViewHelper::findRow($row_id, $dataArray);\n // Insert empty cells with proper control ids.\n for ($i = 0; $i < 7; $i++) {\n $control_id = $pos.'_'. $dayHeaders[$i];\n $dataArray[$pos][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'duration' => null);\n }\n // Insert row for comments.\n if ($includeNotes) {\n $dataArray[] = array('row_id' => $row_id.'_notes','label' => $i18n->get('label.notes').':');\n $pos++;\n // Insert empty cells with proper control ids.\n for ($i = 0; $i < 7; $i++) {\n $control_id = $pos.'_'. $dayHeaders[$i];\n $dataArray[$pos][$dayHeaders[$i]] = array('control_id' => $control_id, 'tt_log_id' => null,'note' => null);\n }\n $pos--;\n }\n }\n }\n\n return $dataArray;\n }", "public function submissionWindow($seconds = 28800) {\n $window = array(\n 'x_duplicate_window'=>(int)$seconds,\n );\n $this->NVP = array_merge($this->NVP, $window); \n }", "public function run()\n {\n DB::table('days')->insert([\n [ 'name' => 'Segunda' ],\n [ 'name' => 'Terça' ],\n [ 'name' => 'Quarta' ],\n [ 'name' => 'Quinta' ],\n [ 'name' => 'Sexta' ],\n ]);\n\n DB::table('shifts')->insert([\n [ 'name' => 'Matutino' ],\n [ 'name' => 'Vespertino' ],\n [ 'name' => 'Noturno' ],\n ]);\n\n $matutino = DB::table('shifts')->where('name', 'Matutino')->first()->id;\n $vespertino = DB::table('shifts')->where('name', 'Vespertino')->first()->id;\n $noturno = DB::table('shifts')->where('name', 'Noturno')->first()->id;\n\n DB::table('times')->insert([\n // MATUTINO\n [\n 'name' => 'M1',\n 'starts' => extract_time('7:00'),\n 'ends' => extract_time('7:50'),\n 'shift_id' => $matutino\n ],\n [\n 'name' => 'M2',\n 'starts' => extract_time('7:50'),\n 'ends' => extract_time('8:40'),\n 'shift_id' => $matutino\n ],\n [\n 'name' => 'M3',\n 'starts' => extract_time('8:40'),\n 'ends' => extract_time('9:30'),\n 'shift_id' => $matutino\n ],\n [\n 'name' => 'M4',\n 'starts' => extract_time('9:50'),\n 'ends' => extract_time('10:40'),\n 'shift_id' => $matutino\n ],\n [\n 'name' => 'M5',\n 'starts' => extract_time('1:40'),\n 'ends' => extract_time('11:30'),\n 'shift_id' => $matutino\n ],\n [\n 'name' => 'M6',\n 'starts' => extract_time('11:30'),\n 'ends' => extract_time('12:20'),\n 'shift_id' => $matutino\n ],\n\n // VESPERTINO\n [\n 'name' => 'T1',\n 'starts' => extract_time('13:00'),\n 'ends' => extract_time('13:50'),\n 'shift_id' => $vespertino\n ],\n [\n 'name' => 'T2',\n 'starts' => extract_time('13:50'),\n 'ends' => extract_time('14:40'),\n 'shift_id' => $vespertino\n ],\n [\n 'name' => 'T3',\n 'starts' => extract_time('14:40'),\n 'ends' => extract_time('15:30'),\n 'shift_id' => $vespertino\n ],\n [\n 'name' => 'T4',\n 'starts' => extract_time('15:50'),\n 'ends' => extract_time('16:40'),\n 'shift_id' => $vespertino\n ],\n [\n 'name' => 'T5',\n 'starts' => extract_time('16:40'),\n 'ends' => extract_time('17:30'),\n 'shift_id' => $vespertino\n ],\n [\n 'name' => 'T6',\n 'starts' => extract_time('17:30'),\n 'ends' => extract_time('18:20'),\n 'shift_id' => $vespertino\n ],\n\n // NOTURNO\n [\n 'name' => 'N1',\n 'starts' => extract_time('18:20'),\n 'ends' => extract_time('19:10'),\n 'shift_id' => $noturno\n ],\n [\n 'name' => 'N2',\n 'starts' => extract_time('19:10'),\n 'ends' => extract_time('20:00'),\n 'shift_id' => $noturno\n ],\n [\n 'name' => 'N3',\n 'starts' => extract_time('20:00'),\n 'ends' => extract_time('20:50'),\n 'shift_id' => $noturno\n ],\n [\n 'name' => 'N4',\n 'starts' => extract_time('20:50'),\n 'ends' => extract_time('21:40'),\n 'shift_id' => $noturno\n ],\n [\n 'name' => 'N5',\n 'starts' => extract_time('21:40'),\n 'ends' => extract_time('22:30'),\n 'shift_id' => $noturno\n ],\n [\n 'name' => 'N6',\n 'starts' => extract_time('22:30'),\n 'ends' => extract_time('23:20'),\n 'shift_id' => $noturno\n ],\n ]);\n\n DB::table('classroom_types')->insert([\n [\n 'name' => 'Sala',\n 'prefix' => 'SALA'\n ],\n [\n 'name' => 'Laboratório',\n 'prefix' => 'LAB'\n ]\n ]);\n\n DB::table('education_levels')->insert([\n [ 'name' => 'Geral' ],\n [ 'name' => 'Integrado' ],\n [ 'name' => 'Mestrado' ],\n [ 'name' => 'Subsequente' ],\n [ 'name' => 'Superior' ]\n ]);\n\n DB::table('employment_bonds')->insert([\n [ 'name' => 'Efetivo' ],\n [ 'name' => 'Temporário' ]\n ]);\n\n DB::table('employment_types')->insert([\n [\n 'name' => 'Integral',\n 'hours_week' => '40'\n ],\n [\n 'name' => 'Parcial',\n 'hours_week' => '20'\n ]\n ]);\n\n DB::table('teaching_class_types')->insert([\n [\n 'name' => 'Turma Única',\n 'initials' => 'U'\n ],\n [\n 'name' => 'Turma A',\n 'initials' => 'A'\n ],\n [\n 'name' => 'Turma B',\n 'initials' => 'B'\n ]\n ]);\n }", "public function run()\n {\n Semester::create([\n \"semester\" => \"Semester 1\"\n ]);\n Semester::create([\n \"semester\" => \"Semester 2\"\n ]);\n Semester::create([\n \"semester\" => \"Semester 3\"\n ]);\n Semester::create([\n \"semester\" => \"Semester 4\"\n ]);\n Semester::create([\n \"semester\" => \"Semester 5\"\n ]);\n }", "public function store(ShiftRequest $request)\n {\n if(!Auth::user()->can('shift.create'))\n abort(403);\n\n $shift = new Shift;\n $shift->template_id = $request->template_id;\n $shift->start = Carbon::createFromFormat(\"d/m/Y H:i\", \"$request->startDate $request->startHour\");\n $shift->end = Carbon::createFromFormat(\"d/m/Y H:i\", \"$request->endDate $request->endHour\");\n $shift->save();\n\n if($request->has('activities') && $shift){\n foreach ($request->activities as $activity) {\n ShiftHasActivities::create([\n 'shift_id' => $shift->id,\n 'activity_id' => $activity\n ]);\n }\n }\n\n if($request->has('users') && $shift){\n foreach ($request->users as $user) {\n ShiftHasUsers::create([\n 'shift_id' => $shift->id,\n 'user_id' => $user\n ]);\n }\n }\n\n flash()->success(\"Il turno è stato creato con successo\");\n return redirect()->route('shifts.calendar.index');\n\n }", "function wGHasStats($idWG, $idStat){\n $connexion = openDBConnexion();\n $request = $connexion->prepare('\n INSERT INTO bdd_satisfevent.workinggroups_has_statistics\n SET WorkingGroups_idWorkingGroups = ?, Statistics_idStatistics = ?');\n $request->execute(array($idWG, $idStat));\n}", "function insert($thisDay, $seriesID = 0){\n\t\tglobal $db;\n\t\t\n\t\t//check if this is a midnight show\n\t\t//figure out if times lie in the same day or not...\n\t\tif(($_POST[edHour]>$_POST[sdHour]) or (($_POST[edHour] == $_POST[sdHour]) and ($_POST[edMinute]>$_POST[sdMinute]))){\t\t\t\n\t\t\t// if the end hour is after the start hour, then this is the same day, I presume there are no shows that take more than 24 hours\n\t\t\t$nextDay = $thisDay;\n\t\t}else{\n\t\t\t$nextDay = $thisDay + 60*60*24;\n\t\t}\n\t\t\n\t\t//call the query\n\t\t$db->query(\"INSERT INTO programme(series_id,intime,outtime) VALUES(\n\t\t\t\t\t\t\t\t\t\t\t'$seriesID',\n\t\t\t\t\t\t\t\t\t\t\t'\" . date(\"Y-m-d\",$thisDay) . \" $_POST[sdHour]:$_POST[sdMinute]:00',\n\t\t\t\t\t\t\t\t\t\t\t'\" . date(\"Y-m-d\",$nextDay) . \" $_POST[edHour]:$_POST[edMinute]:00')\");\n\t}", "function insert_slot($id,$date,$month,$year,$slot_schedule){\n\t\t$database=new Database();\n\t\t$sql=\"INSERT INTO `schedule`(`id`, `date`, `month`, `year`, `slot_schedule`, `counselor_id`) VALUES (NULL,'$date','$month','$year','$slot_schedule','$id')\";\n\t\t$stmt=$database->connect()->prepare($sql);\n\t\t$stmt->execute();\n\t}", "public function testInsertUpdatesDateValue()\n {\n $account_status_spans_table = $this->insight->getTableName('account_status_spans');\n $this->insight->accounts->addTrial(1);\n\n $row = $this->connection->executeFirstRow(\"SELECT `started_at`, `started_on` FROM `$account_status_spans_table`\");\n\n $this->assertInternalType('array', $row);\n\n $this->assertInstanceOf(DateTimeValue::class, $row['started_at']);\n $this->assertInstanceOf(DateValue::class, $row['started_on']);\n $this->assertEquals($row['started_at']->format('Y-m-d'), $row['started_on']->format('Y-m-d'));\n }", "public function run()\n {\n DB::table('kendaraan')->insert([\n 'plat_nomer' => 'D75648EF',\n 'jam_masuk' => '08:26:19',\n 'jam_keluar' => '13:54:59',\n ]);\n DB::table('kendaraan')->insert([\n 'plat_nomer' => 'D54687VV',\n 'jam_masuk' => '09:26:19',\n 'jam_keluar' => '14:54:59',\n ]);\n }", "public function run()\n {\n $carbonDateObj = new Carbon();\n $dateDay = 10;\n\n $wolverineShiftId = DB::table('shifts')\n ->select(['shifts.id'])\n ->where(['first_name' => 'Wolverine'])\n ->whereDay('start_time','=', $dateDay)\n ->leftJoin('staff', 'shifts.staff_id','=','staff.id')\n ->first()->id\n ;\n\n $gamoraShiftId = DB::table('shifts')\n ->select(['shifts.id'])\n ->where(['first_name' => 'Gamora'])\n ->whereDay('start_time', '=', $dateDay)\n ->leftJoin('staff', 'shifts.staff_id','=','staff.id')\n ->first()->id\n ;\n\n $data = [\n [\n 'shift_id' => $wolverineShiftId,\n 'start_time' => $carbonDateObj->setDateTime(2019,1,$dateDay,12,0)->toDateTimeString(),\n 'end_time' => $carbonDateObj->setDateTime(2019,1,$dateDay,13,0)->toDateTimeString()\n ],\n [\n 'shift_id' => $gamoraShiftId,\n 'start_time' => $carbonDateObj->setDateTime(2019,1,$dateDay,14,0)->toDateTimeString(),\n 'end_time' => $carbonDateObj->setDateTime(2019,1,$dateDay,15,0)->toDateTimeString()\n ],\n\n ];\n\n DB::table('shift_breaks')->insert($data);\n }", "function add_day() {\n\t\t\t$date = new DateTime($this->entry_date);\n\t\t\t\n\t\t\t$qry = sprintf(\"INSERT INTO %s (tkr_id, entry_date, open, high, low, close, volume, adj_close) \n\t\t\t\t\tVALUES (%d,'%s',%8.2f,%8.2f,%8.2f,%8.2f,%d,%8.2f)\",\n\t\t\t\t\tmysql_real_escape_string(HISTORICAL_TBL), $this->tkr_id, mysql_real_escape_string($date->format('Y-m-d')),\n\t\t\t\t\t$this->open, $this->high, $this->low, $this->close, $this->vol, $this->adj_close);\n\t\t\tmysql_query($qry) or die(mysql_error());\n\t\t\t}", "public function run()\n {\n DB::table('sms_years')->insert([\n ['name' => \"2010(Jan)-2010(Dec)\" , \"year\" => \"2010\"],\n ['name' => \"2011(Jan)-2011(Dec)\" , \"year\" => \"2011\"],\n ['name' => \"2012(Jan)-2012(Dec)\" , \"year\" => \"2012\"],\n ['name' => \"2013(Jan)-2013(Dec)\" , \"year\" => \"2013\"],\n ['name' => \"2014(Jan)-2014(Dec)\" , \"year\" => \"2014\"],\n ['name' => \"2015(Jan)-2015(Dec)\" , \"year\" => \"2015\"],\n ['name' => \"2016(Jan)-2016(Dec)\" , \"year\" => \"2016\"],\n ['name' => \"2017(Jan)-2017(Dec)\" , \"year\" => \"2017\"],\n ['name' => \"2018(Jan)-2018(Dec)\" , \"year\" => \"2018\"],\n ['name' => \"2019(Jan)-2019(Dec)\" , \"year\" => \"2019\"],\n ['name' => \"2020(Jan)-2020(Dec)\" , \"year\" => \"2020\"],\n ['name' => \"2021(Jan)-2021(Dec)\" , \"year\" => \"2021\"],\n ]);\n }", "public function index()\n {\n $is_current_month = !request()->get('next');\n $days_in_month = date('t', strtotime($is_current_month ? 'now' : '+1 month'));\n $month_number = date('n', strtotime($is_current_month ? 'now' : '+1 month'));\n $year_number = date('y', strtotime($is_current_month ? 'now' : '+1 month'));\n\n $shifts = [];\n\n foreach (range(1,$days_in_month) as $day_number) {\n $date = mktime(0, 0, 0, $month_number, $day_number, $year_number);\n\n $shifts[date('j.n.y', $date)] = [\n 'date_without_year' => date('j.n', $date),\n 'date' => date('j.n.y', $date),\n 'day_of_week' => str_replace(['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], ['ראשון', 'שני', 'שלישי', 'רביעי', 'חמישי', 'שישי', 'שבת'], date('l', $date)),\n 'shift1' => [\n 'saturday' => date('w', $date) == 6,\n 'title' => NULL,\n 'users' => []\n ],\n 'shift2' => [\n 'saturday' => date('w', $date) == 6,\n 'title' => NULL,\n 'users' => []\n ],\n 'shift3' => [\n 'saturday' => date('w', $date) == 5 || date('w', $date) == 6,\n 'title' => NULL,\n 'users' => []\n ],\n ];\n }\n\n $registered = Shift::with('user')\n ->where('date_str', 'LIKE', \"%.$month_number.$year_number\")\n ->get();\n\n foreach ($registered as $register) {\n $shifts[$register['date_str']]['shift'.$register['shift_id']]['users'][] = [\n 'user_id' => $register['user_id'],\n 'status' => $register['status'],\n 'name' => array_get($register, 'user.name', 'משתמש נמחק'),\n ];\n }\n\n $is_admin = request()->get('admin') && Auth::user()->is_admin;\n\n return view('home')\n ->with('shifts', array_values($shifts))\n ->with('current_user_id', Auth::user()->id)\n ->with('is_current_month', $is_current_month)\n ->with('can_admin', Auth::user()->is_admin)\n ->with('users', $is_admin ? User::orderBy('name')->get() : [])\n ->with('is_admin', $is_admin);\n }", "public function run()\n {\n Shift::create([\n 'start_time' => '00:00:00',\n 'end_time' => '23:59:59',\n\n\n ]);\n }", "function addUserToWorkinggroup($idWG){\n require_once 'model/dbConnector.php';\n $connexion = openDBConnexion();\n $request = $connexion->prepare('\n INSERT INTO bdd_satisfevent.users_has_workinggroups \n SET Users_idUsers = ?, WorkingGroups_idWorkingGroups = ?');\n $request->execute(array($_SESSION['logged']['idUsers'], $idWG));\n}", "function addGame()\n {\t\n\t\t$uid = $_SESSION['uid'];\n\t\t$gid = time();\n\t\t$ct = $_POST['country'];\n $query = \"INSERT INTO games(gid, year, season, running, players)\n VALUES($gid, 1901, 's', false, 1);\";\n \n $result = mysql_query($query) or die(\"db access error\" . mysql_error());\n \n $query = \"INSERT INTO in_game(uid, gid, country)\n VALUES('$uid', $gid, '$ct');\";\n \n $result = mysql_query($query) or die(\"db access error\" . mysql_error());\n \n $this->addStartUnits($ct, $gid, $uid);\n\t}", "public function manifest_semesters()\n {\n // get all imported semesters\n $imported_semesters = $this->get_all_imported_type('semester');\n\n // iterate through rows of semester import table\n foreach ($imported_semesters as $sem)\n {\n // arrange semester input data\n list($year, $name) = $this->parse_term_code($sem->term_code);\n\n list($campus, $is_starting) = $this->parse_code_value($sem->code_value);\n\n if ( ! $year || ! $name || ! $campus)\n continue;\n\n // @TODO - difference in dates seems a little funky but follows existing system\n $grades_due_at = $campus == 'LAW' \n ? $this->parse_date($sem->calendar_date) + (46 * 24 * 60 * 60) \n : $this->parse_date($sem->calendar_date) + (21 * 24 * 60 * 60);\n\n // update or create this semester\n $semester = \\enrol_oes\\model\\semester::update_or_create([\n 'code' => $sem->term_code,\n 'year' => $year,\n 'name' => $name,\n 'campus' => $campus,\n 'session_key' => (string) $sem->session,\n 'classes_start_at' => $this->parse_date($sem->calendar_date),\n 'grades_due_at' => $grades_due_at,\n ]);\n\n // construct this semester's unique \n // $semester_cache_key = $sem->term_code . '-' . $sem->session . '-' . $campus;\n\n $semester_cache_key = $this->get_semester_cache_key([\n 'term_code' => $sem->term_code,\n 'session_key' => $sem->session,\n 'campus' => $campus\n ]);\n\n // cache this semester for later\n $this->manifested_semesters[$semester_cache_key] = $semester;\n }\n\n $this->oes_driver->enrol_plugin->trace->output('Semesters manifested.');\n }", "function insert_day( $date, $min, $max, $noon, $r, $f, $s, $h, $t, $o )\n {\n $data = array(\n 'date_day' => $date, \n 'temp_low' => $min,\n 'temp_high' => $max,\n 'noon' => $noon,\n 'rain' => $r,\n 'fog' => $f,\n 'snow' => $s,\n 'hail' => $h,\n 'thunder' => $t,\n 'tornado' => $o );\n $insert = $this->_db->insert( 'weather_days', $data );\n }", "public function snapToSemester(): self\n {\n return new self(\n DatePoint::fromDate($this->startDate)->semester()->startDate(),\n DatePoint::fromDate($this->endDate)->semester()->endDate(),\n $this->bounds\n );\n }", "function build($sDates = array())\n {\n include_once CALENDAR_ROOT.'Table/Helper.php';\n $this->tableHelper = new Calendar_Table_Helper($this, $this->firstDay);\n include_once CALENDAR_ROOT.'Week.php';\n $numWeeks = $this->tableHelper->getNumWeeks();\n for ($i=1, $d=1; $i<=$numWeeks; $i++,\n $d+=$this->cE->getDaysInWeek(\n $this->thisYear(),\n $this->thisMonth(),\n $this->thisDay()\n )\n ) {\n $this->children[$i] = new Calendar_Week(\n $this->year, $this->month, $d, $this->tableHelper->getFirstDay());\n }\n //used to set empty days\n $this->children[1]->setFirst(true);\n $this->children[$numWeeks]->setLast(true);\n\n // Handle selected weeks here\n if (count($sDates) > 0) {\n $this->setSelection($sDates);\n }\n return true;\n }", "public function insert($tahunAjaran, $semester, $start_date, $end_date, $topik_tugas_akhir, $deadline_tugas_akhir) {\n $data = array('tahun_ajaran' => $tahunAjaran,\n 'no_semester' => $semester,\n 'start_date' => $start_date,\n 'end_date' => $end_date,\n 'topik_tugas_akhir' => $topik_tugas_akhir,\n 'deadline_tugas_akhir' => $deadline_tugas_akhir);\n\n try {\n $this->db->insert('Semester', $data);\n $insert_id = $this->db->insert_id();\n return $insert_id;\n } catch (Exception $e) {\n echo 'Caught exception: ', $e->getMessage(), \"\\n\";\n }\n }", "public function run()\n {\n //\n\n $y=1;\n $t=1;\n\n for($i=1;$i<5;$i++)\n { \t\n\t $y=$i;\n\t for($j=1;$j<3;$j++)\n\t {\n\t \t$t=$j;\n\n\t\t $semester=[\n\t\t \t'semester'=>'Y-'.$y.',T-'.$t.''\n\t\t ];\n\t\t App\\Semester::create($semester);\n\t }\n\n\n\n }\n\n\n\n }", "public function save_dates() {\n\t\t// Nothing to do here.\n\t}", "private function insert($DataSet) {\r\n\t\t\r\n\t\twhile (list($ind, $ItemData) = each($DataSet)) {\r\n\t\t\t\r\n\t\t\t// Check if time has been specified\t\t\t\r\n\t\t\tif($ItemData->getTimeSpec()) {\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t// shift data start date to current timezone\r\n\t\t\t\t$DataStartDate = Utilities::shiftTime($ItemData->getStartDate(), 0, $this->timezone);\r\n\t\t\t\t$DataStopDate = Utilities::shiftTime($ItemData->getStopDate(), 0, $this->timezone);\r\n\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\r\n\t\t\t\t$DataStartDate = $ItemData->getStartDate();\r\n\t\t\t\t$DataStopDate = $ItemData->getStopDate();\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$MonthStartDate = new SC_DateTime(1,$this->Month->getMonthOfYear(), $this->Month->getYear());\r\n\t\t\t$MonthStopDate = new SC_DateTime($this->Month->getDaysInMonth(),$this->Month->getMonthOfYear(), $this->Month->getYear());\r\n\t\t\r\n\t\t\t\r\n\t\t\tif($DataStartDate->compareDate($MonthStopDate) <= 0 && $DataStopDate->compareDate($MonthStartDate) >= 0) {\r\n\t\t\t\t\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\tswitch ($ItemData->getType()) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Single day event check\r\n\t\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$this->addOneDayItem($ItemData, $DataStartDate, $DataStopDate);\t\r\n\t\t\t\t\t\t\tbreak;\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Every day event check\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$this->addEveryDayItem($ItemData, $DataStartDate, $DataStopDate);\t\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Every TUE THU check\r\n\t\t\t\t\t\tcase 3:\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// get the day of week set\r\n\t\t\t\t\t\t\t$set = Utilities::getTueThuArray($ItemData, $DataStartDate);\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$this->addMultipleWeekItem($ItemData, $DataStartDate, $DataStopDate, $set);\t\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Every MON WED FRI check\r\n\t\t\t\t\t\tcase 4:\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// get the day of week set\r\n\t\t\t\t\t\t\t$set = Utilities::getMonWedFriArray($ItemData, $DataStartDate);\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$this->addMultipleWeekItem($ItemData, $DataStartDate, $DataStopDate, $set);\t\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Every Weekday check\r\n\t\t\t\t\t\tcase 5:\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// get the day of week set\r\n\t\t\t\t\t\t\t$set = Utilities::getWeekdayArray($ItemData, $DataStartDate, $this->weekend);\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$this->addMultipleWeekItem($ItemData, $DataStartDate, $DataStopDate, $set);\t\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Every Weekend check\r\n\t\t\t\t\t\tcase 6:\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t// get the day of week set\r\n\t\t\t\t\t\t\t$set = Utilities::getWeekendArray($ItemData, $DataStartDate, $this->weekend);\t\r\n\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$this->addMultipleWeekItem($ItemData, $DataStartDate, $DataStopDate, $set);\t\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Every Week check\r\n\t\t\t\t\t\tcase 7:\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$this->addWeekItem($ItemData, $DataStartDate, $DataStopDate);\t\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Every other week check\r\n\t\t\t\t\t\tcase 8:\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$this->addEveryOtherWeekItem($ItemData, $DataStartDate, $DataStopDate);\t\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Every month check\r\n\t\t\t\t\t\tcase 9:\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$this->addMonthItem($ItemData, $DataStartDate, $DataStopDate);\t\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Every year check\r\n\t\t\t\t\t\tcase 10:\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$this->addYearItem($ItemData, $DataStartDate, $DataStopDate);\t\r\n\t\t\t\t\t\t\tbreak;\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Every Monthly periodical check\r\n\t\t\t\t\t\tcase 11:\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$this->addMonthlyPeriodicItem($ItemData, $DataStartDate, $DataStopDate);\t\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Every yearly periodical check\t\r\n\t\t\t\t\t\tcase 12:\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$this->addYearlyPeriodicItem($ItemData, $DataStartDate, $DataStopDate);\t\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t}\t// end switch\r\n\t\t\t\r\n\t\t\t} \r\n\t\t\t\r\n\t\t} \t\r\n\t\r\n\t}", "public function update_date_ranges()\r\n\t{\r\n\t\t// So give INSERT and UPDATE their own code blocks, rather than try to combine them in one statement.\r\n\t\t$tbl = 'codes';\r\n\t\t$where = 'WHERE groupID = 7';\r\n\t\t$sql = \"SELECT ID FROM $tbl $where\";\r\n\t\t$r = $this->db->query($sql);\r\n\t\t// Using static keys, to align with quarter numbers. \r\n\t\t$field_vals[1] = $this->input->post('winter_open') . '|' . $this->input->post('winter_closed');\r\n\t\t$field_vals[2] = $this->input->post('spring_open') . '|' . $this->input->post('spring_closed');\r\n\t\t$field_vals[3] = $this->input->post('summer_open') . '|' . $this->input->post('summer_closed');\r\n\t\t$field_vals[4] = $this->input->post('autumn_open') . '|' . $this->input->post('autumn_closed');\r\n\r\n\t\tif (! $r->num_rows()) // Group 7 doesn't exist.\r\n\t\t{\r\n\t\t\tfor ($i = 1; $i < 5; $i++)\r\n\t\t\t{\r\n\t\t\t\t$insert_vals[] = \"(7, $i, '{$field_vals[$i]}')\";\r\n\t\t\t}\r\n\t\t\t$fields = implode(',', $insert_vals);\r\n\t\t\t$sql = \"INSERT INTO codes (groupID, ID, description) VALUES $fields\";\r\n\t\t\t$this->db->query($sql);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$sql = \"UPDATE $tbl SET description = ? WHERE groupID = 7 and ID = ?\";\r\n\t\t\tfor ($i = 1; $i < 5; $i++)\r\n\t\t\t{\r\n\t\t\t\t$this->db->query($sql, [$field_vals[$i], $i]); // Array holds values for `description` and `id`.\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function run()\n {\n $students = Student::get();\n \n foreach($students as $key => $student) {\n $disciplines = $student->discipline(null)->get();\n foreach($disciplines as $key => $discipline) {\n if(!is_null($discipline->pivot->year_semester)) {\n if(is_null($student->egress_date)) {\n $student->egress_date = $discipline->pivot->year_semester;\n } else {\n list ($actual_year, $actual_semester) = explode('/', $student->egress_date);\n list ($incoming_year, $incoming_semester) = explode('/', $discipline->pivot->year_semester);\n if((int)$actual_year > (int)$incoming_year) {\n $student->egress_date = $discipline->pivot->year_semester;\n } else if((int)$actual_year == (int)$incoming_year) {\n if((int)$actual_semester > (int)$incoming_semester) {\n $student->egress_date = $discipline->pivot->year_semester;\n }\n }\n }\n }\n }\n $student->save();\n }\n }", "public function run()\n {\n SchoolStatus::create([\n 'school_year' => '2019-2020',\n 'semester' => '1st'\n ]);\n }", "function teacher_assign_class_dailytable_monday($savemonday)\n\t{\t\n\t $this->db->insert('schoolnew_timetable_daily_classwise',$savemonday); \n return $this->db->insert_id();\t\n\t}", "public function insert_services_slots($postdata) {\n $weekdays_timings = array();\n foreach ($postdata['weekdays']['start_time'] as $key => $value) {\n $weekdays_timings[$key]['start_time'] = $value;\n }\n foreach ($postdata['weekdays']['end_time'] as $key => $value) {\n $weekdays_timings[$key]['end_time'] = $value;\n }\n $i = 60;\n $current_date = date('Y-m-d');\n for ($z = 0; $z <= $i; $z++) {\n foreach ($postdata['weekdays']['day'] as $key => $value) {\n foreach ($weekdays_timings as $keys => $values) {\n $date = date('Y-m-d', strtotime($current_date . ' + ' . $z . ' days'));\n $check_date = date('D', strtotime($date));\n if ($check_date == $value) {\n $service_slots = array(\n 'service_id' => $postdata['services'],\n 'date' => $date,\n 'start_time' => $values['start_time'],\n 'end_time' => $values['end_time'],\n 'number_of_slots' => $postdata['no_slots'],\n 'active' => 'enable'\n );\n $this->db->insert('services_slots', $service_slots);\n }\n }\n }\n }\n $weekend_timings = array();\n foreach ($postdata['weekends']['start_time'] as $key => $value) {\n $weekend_timings[$key]['start_time'] = $value;\n }\n foreach ($postdata['weekends']['end_time'] as $key => $value) {\n $weekend_timings[$key]['end_time'] = $value;\n }\n\n $j = 60;\n for ($z = 0; $z <= $j; $z++) {\n foreach ($postdata['weekends']['day'] as $key => $value) {\n foreach ($weekend_timings as $keys => $values) {\n $date = date('Y-m-d', strtotime($current_date . ' + ' . $z . ' days'));\n $check_date = date('D', strtotime($date));\n if ($check_date == $value) {\n\n $service_slots = array(\n 'service_id' => $postdata['services'],\n 'date' => $date,\n 'start_time' => $values['start_time'],\n 'end_time' => $values['end_time'],\n 'number_of_slots' => $postdata['no_slots'],\n 'active' => 'enable'\n );\n $this->db->insert('services_slots', $service_slots);\n }\n }\n }\n }\n\n return true;\n }", "public function run()\n {\n\n\n \\DB::table('schijven')->delete();\n\n \\DB::table('schijven')->insert(array(\n 0 =>\n array(\n 'id' => 1,\n 'created_at' => null,\n 'updated_at' => null,\n 'naam' => '2010',\n 'capaciteit' => 2000,\n 'beschikbaar' => 88,\n 'scandatum' => '2016-11-10',\n ),\n 1 =>\n array(\n 'id' => 2,\n 'created_at' => null,\n 'updated_at' => null,\n 'naam' => '2011',\n 'capaciteit' => 1500,\n 'beschikbaar' => 52,\n 'scandatum' => '2016-11-10',\n ),\n 2 =>\n array(\n 'id' => 3,\n 'created_at' => null,\n 'updated_at' => null,\n 'naam' => '2012',\n 'capaciteit' => 2000,\n 'beschikbaar' => 92,\n 'scandatum' => '2016-11-10',\n ),\n 3 =>\n array(\n 'id' => 4,\n 'created_at' => null,\n 'updated_at' => null,\n 'naam' => '2013',\n 'capaciteit' => 2000,\n 'beschikbaar' => 62,\n 'scandatum' => '2016-11-10',\n ),\n 4 =>\n array(\n 'id' => 5,\n 'created_at' => null,\n 'updated_at' => null,\n 'naam' => '2014',\n 'capaciteit' => 2000,\n 'beschikbaar' => 24,\n 'scandatum' => '2016-11-10',\n ),\n ));\n\n\n App\\Schijf::where('created_at',null)->update(['created_at' => \\Carbon\\Carbon::now()]);\n\n }", "public function run()\n {\n DB::table('students')->insert([\n [\n 'std_number' => '1800721135',\n 'reg_number' => '18/U/21135/PS',\n 'course' => 'BSE',\n 'user_id' => '1',\n 'field_supervisor_id' => '3'\n ],[\n 'std_number' => '1800721090',\n 'reg_number' => '18/U/21090/PS',\n 'course' => 'BSE',\n 'user_id' => '2',\n 'field_supervisor_id' => '3'\n ]\n ]);\n }", "function new_calendar_year($year,$schoolid)\n\n {\n\n $data = array(\n\n 'school' => $year,\n\n 'year' => $schoolid,\n\n\n\n );\n\n $query = $this->db->insert('calendar_year',$data);\n\n $result = $this->db->query($query);\n\n return $result;\n\n return $result;\n\n\n\n }", "function Insert(){\r\n $query = \"INSERT INTO userschedules\r\n (userName,organizationId,branchId,locationCode,date,startingTime,signedIn,finishingTime,signedOut,status)\r\n VALUES('$this->userName',$this->organizationId,$this->branchId,'$this->locationCode','$this->date',\r\n '$this->startingTime','$this->signedIn','$this->finishingTime','$this->signedOut','$this->status')\";\r\n include(\"includes/dbConnection.php\");\t\t\t\r\n $executeQuery = $db->prepare($query);\r\n $executeQuery->execute() or exit(\"Error: INSERT query failed.\");\r\n }", "private function addSection() {\n // courseid, secNo, daysMet, startTime, endTime, totalReleasedSeats, building, room\n\n $courseID = $_POST['courseID'];\n $secNo = $_POST['secNo'];\n $daysMet = $_POST['daysMet'];\n $startTime = $_POST['startTime'];\n $endTime = $_POST['endTime'];\n $totalReleasedSeats = $_POST['totalReleasedSeats'];\n $building = $_POST['building'];\n $room = $_POST['room'];\n\n $this->openConn();\n\n $sql = \"SELECT DISTINCT term, secStartDate, secEndDate, sessionYear, sessionCode FROM Section WHERE courseID = :courseID\";\n $stmt = $this->conn->prepare($sql);\n $stmt->execute(array(':courseID'=> $courseID));\n\n while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {\n $term = $row['term'];\n $secStartDate = $row['secStartDate'];\n $secEndDate = $row['secEndDate'];\n $sessionYear = $row['sessionYear'];\n $sessionCode = $row['sessionCode'];\n }\n\n $totalEnrolment = 0;\n $isOptimized = 0;\n $secType = \"LAB\";\n\n // if($row){\n //\n // }\n\n $sql2 = \"INSERT INTO Section (courseID, secNo, daysMet, startTime, endTime, totalReleasedSeats, totalEnrolment, building, room,\n term, isOptimized, secStartDate, secEndDate, sessionYear, sessionCode, secType)\n VALUES (:courseID, :secNo, :daysMet, :startTime, :endTime, :totalReleasedSeats, :totalEnrolment, :building, :room,\n :term, :isOptimized, :secStartDate, :secEndDate, :sessionYear, :sessionCode, :secType)\";\n $stmt2 = $this->conn->prepare($sql2);\n $stmt2->execute(array(':courseID'=> $courseID, ':secNo'=> $secNo, ':daysMet'=> $daysMet, ':startTime'=> $startTime, ':endTime'=> $endTime, ':totalReleasedSeats'=> $totalReleasedSeats, ':totalEnrolment'=> $totalEnrolment, ':building'=> $building, ':room'=> $room,\n ':term'=> $term, ':isOptimized'=> $isOptimized, ':secStartDate'=> $secStartDate, ':secEndDate'=> $secEndDate, ':sessionYear'=> $sessionYear, ':sessionCode'=> $sessionCode, ':secType'=> $secType));\n\n $this->closeConn();\n\n }", "public function run()\n {\n DB::table('semestres')->insert([\n 'rotulo' => '2018/1',\n 'inicio' => Carbon::create('2018', '03', '12'),\n 'fim' => Carbon::create('2018', '07', '21')\n ]);\n\n DB::table('semestres')->insert([\n 'rotulo' => '2018/2',\n 'inicio' => Carbon::create('2018', '08', '13'),\n 'fim' => Carbon::create('2018', '12', '22')\n ]);\n\n // $Semestre = new Semestre();\n // $Semestre->rotulo = '2018/1';\n // $Semestre->inicio = Carbon::create('2018', '03', '12');\n // $Semestre->fim = Carbon::create('2018', '07', '21');\n // $Semestre->save();\n }", "private function _saveNewShift()\n {\n // each timestamp action\n $this->shift = Shift::storeNewByEmployeeId($this->_employeeId);\n // log shift creation\n Log::info(\"New shift created.\", ['employee_id' => $this->_employeeId, 'shift_id' => $this->shift->id]);\n }", "public function run()\n {\n DB::table(\"disciplines\")->insert([[\n \"code\" => \"2302\",\n \"departamentId\" => 1,\n \"name\" => \"Computadores e Sociedade\",\n \"idealYear\" => 1,\n \"semester\" => 1\n ], [\n \"code\" => \"2303\",\n \"departamentId\" => 2,\n \"name\" => \"Geometria Analítica e Vetores\",\n \"idealYear\" => 1,\n \"semester\" => 1\n ], [\n \"code\" => \"2304\",\n \"departamentId\" => 1,\n \"name\" => \"Introdução à Ciência da Computação I\",\n \"idealYear\" => 1,\n \"semester\" => 1\n ], [\n \"code\" => \"2305\",\n \"departamentId\" => 1,\n \"name\" => \"Lógica para Computação\",\n \"idealYear\" => 1,\n \"semester\" => 1\n ], [\n \"code\" => \"2306\",\n \"departamentId\" => 1,\n \"name\" => \"Organização de Computadores\",\n \"idealYear\" => 1,\n \"semester\" => 1\n ], [\n \"code\" => \"2307\",\n \"departamentId\" => 2,\n \"name\" => \"Pré-Cálculo\",\n \"idealYear\" => 1,\n \"semester\" => 1\n ], [\n \"code\" => \"2308\",\n \"departamentId\" => 1,\n \"name\" => \"Programação de Computadores I\",\n \"idealYear\" => 1,\n \"semester\" => 1\n ],\n // SECOND SEMESTER, FIRST YEAR\n [\n \"code\" => \"2309\",\n \"departamentId\" => 3,\n \"name\" => \"Álgebra Linear\",\n \"idealYear\" => 1,\n \"semester\" => 2\n ], [\n \"code\" => \"2310\",\n \"departamentId\" => 2,\n \"name\" => \"Calculo I \",\n \"idealYear\" => 1,\n \"semester\" => 2\n ], [\n \"code\" => \"2311\",\n \"departamentId\" => 2,\n \"name\" => \"Fundamentos Matemáticos para Computação\",\n \"idealYear\" => 1,\n \"semester\" => 2\n ], [\n \"code\" => \"2312\",\n \"departamentId\" => 1,\n \"name\" => \"Introdução à Ciência da Computação II \",\n \"idealYear\" => 1,\n \"semester\" => 2\n ], [\n \"code\" => \"2313\",\n \"departamentId\" => 1,\n \"name\" => \"Lógica Digital \",\n \"idealYear\" => 1,\n \"semester\" => 2\n ], [\n \"code\" => \"2314\",\n \"departamentId\" => 1,\n \"name\" => \"Programação de Computadores II\",\n \"idealYear\" => 1,\n \"semester\" => 2\n ], [\n \"code\" => \"2315\",\n \"departamentId\" => 1,\n \"name\" => \"Sistemas de Informação \",\n \"idealYear\" => 1,\n \"semester\" => 2\n ],\n //Second Year, First Semester\n [\n \"code\" => \"2316\",\n \"departamentId\" => 1,\n \"name\" => \"Algoritmos e Estruturas de Dados I\",\n \"idealYear\" => 2,\n \"semester\" => 1\n ], [\n \"code\" => \"2317\",\n \"departamentId\" => 1,\n \"name\" => \"Arquitetura de Computadores\",\n \"idealYear\" => 2,\n \"semester\" => 1\n ], [\n \"code\" => \"2318\",\n \"departamentId\" => 1,\n \"name\" => \"Banco de Dados I\",\n \"idealYear\" => 2,\n \"semester\" => 1\n ], [\n \"code\" => \"2319\",\n \"departamentId\" => 2,\n \"name\" => \"Cálculo II\",\n \"idealYear\" => 2,\n \"semester\" => 1\n ], [\n \"code\" => \"2320\",\n \"departamentId\" => 1,\n \"name\" => \"Engenharia de Software I\",\n \"idealYear\" => 2,\n \"semester\" => 1\n ], [\n \"code\" => \"2321\",\n \"departamentId\" => 1,\n \"name\" => \"Metodologia Científica para Computação \",\n \"idealYear\" => 2,\n \"semester\" => 1\n ], [\n \"code\" => \"2322\",\n \"departamentId\" => 2,\n \"name\" => \"Probabilidade e Estatística \",\n \"idealYear\" => 2,\n \"semester\" => 1\n ], [\n \"code\" => \"2323\",\n \"departamentId\" => 1,\n \"name\" => \"Programação Orientada a Objetos I\",\n \"idealYear\" => 2,\n \"semester\" => 1\n ],\n //Second Year, Second Semester\n [\n \"code\" => \"2324\",\n \"departamentId\" => 1,\n \"name\" => \"Algoritmos e Estruturas de Dados II\",\n \"idealYear\" => 2,\n \"semester\" => 2\n ], [\n \"code\" => \"2325\",\n \"departamentId\" => 1,\n \"name\" => \"Banco de Dados II\",\n \"idealYear\" => 2,\n \"semester\" => 2\n ], [\n \"code\" => \"2326\",\n \"departamentId\" => 1,\n \"name\" => \"Cálculo Numérico\",\n \"idealYear\" => 2,\n \"semester\" => 2\n ], [\n \"code\" => \"2327\",\n \"departamentId\" => 1,\n \"name\" => \"Engenharia de Software II \",\n \"idealYear\" => 2,\n \"semester\" => 2\n ], [\n \"code\" => \"2328\",\n \"departamentId\" => 1,\n \"name\" => \"Linguagens Formais e Autômatos\",\n \"idealYear\" => 2,\n \"semester\" => 2\n ], [\n \"code\" => \"2329\",\n \"departamentId\" => 1,\n \"name\" => \"Programação Orientada a Objetos II\",\n \"idealYear\" => 2,\n \"semester\" => 2\n ], [\n \"code\" => \"2330\",\n \"departamentId\" => 1,\n \"name\" => \"Redes de Computadores I \",\n \"idealYear\" => 2,\n \"semester\" => 2\n ], [\n \"code\" => \"2331\",\n \"departamentId\" => 1,\n \"name\" => \"Sistemas Operacionais I\",\n \"idealYear\" => 2,\n \"semester\" => 2\n ],]);\n }", "function create($student,$year,$month,$datevalue)\n {\n if ( $this->cek($student,$year) == FALSE ){ $this->edit($student,$year,$month,$datevalue); }\n else { $this->new_add($student,$year,$month,$datevalue); }\n }", "public static function updateBulkEmployees($shift,$date,$employees=\"\"){ \r\t\tif(is_gt_zero_num($shift) && isValidDate($date)){\r\t\t\t\t$search_arr = array(EMP_SFT_SHIFT=>$shift,EMP_SFT_DATE=>$date,SES_RESTAURANT=>$_SESSION[SES_RESTAURANT]); \r\t\t\t\t // check employees for updating \r\t\t\t\t if(is_not_empty($employees)){\r\t\t\t\t \t\t// split the employees string to array\r\t\t\t\t\t\t$emp_arr = explode(',',$employees); \r\t\t\t\t\t\t$emp_arr = array_filter($emp_arr);\r\t\t\t\t\t\t\r\t\t\t\t \t\t// get the previous records for the shift & date\r\t\t\t\t \t\t$info = self::readArray($search_arr);\r\t\t\t\t\t\t$new_emp = array();\r\t\t\t\t\t\t// assign each employee to emp arr \r\t\t\t\t\t\tforeach ($emp_arr as $emp){\r\t\t\t\t\t\t\t$new_emp[$emp] = $emp; //mk key and value same\r\t\t\t\t\t\t}\r\t\t\t\t\t\t$del_emp_shift = array();\r\t\t\t\t\t\tforeach($info as $key=>$val){\r\t\t\t\t\t\t\t// chk the employee in the list\r\t\t\t\t\t\t\tif(in_array($val[EMP_SFT_EMPLOYEE],$emp_arr)){\r\t\t\t\t\t\t\t\t //..if found remove from the new list\r\t\t\t\t\t\t\t unset($new_emp[$val[EMP_SFT_EMPLOYEE]]);\r\t\t\t\t\t\t\t}else{\r\t\t\t\t\t\t\t\t //..if not found add shift to delete qry\r\t\t\t\t\t\t\t\t\t$del_emp_shift[] = $key;\r\t\t\t\t\t\t\t}\r\t\t\t\t\t\t} \r\t\t\t\t\t\t//.. Insert New Employees\r\t\t\t\t\t\tif(is_not_empty($new_emp)){\r\t\t\t\t\t\t\t$prm = array();\r\t\t\t\t\t\t\tforeach($new_emp as $emp_id){\r\t\t\t\t\t\t\t\t$prm[]= '('.$emp_id.','.$shift.',\\''.$date.'\\',NOW())';\r\t\t\t\t\t\t\t}\r\t\t\t\t\t\t\tif(is_not_empty($prm)){\r\t\t\t\t\t\t\t\t$ins_qry = 'INSERT INTO '.TBL_EMP_SHIFT_ASSIGNMENT.' ('.RET.''.EMP_SFT_EMPLOYEE.', '.EMP_SFT_SHIFT.', '.EMP_SFT_DATE.', '.EMP_SFT_START_DATE.') VALUES '.implode(',',$prm).';';\r\t\t\t\t\t\t\t\tmysql_query($ins_qry); \r\t\t\t\t\t\t\t} \r\t\t\t\t\t\t} \r\t\t\t\t\t //..delete the shifts \r\t\t\t\t\tif(is_not_empty($del_emp_shift)){\r\t\t\t\t\t\t$lst_to_del = implode(',',$del_emp_shift);\r\t\t\t\t\t\tself::delete(array(EMP_SFT_ID=>$lst_to_del)); \r\t\t\t\t\t}\r\t\t\t\t\t\t\r\t\t\t\t }else{\r\t\t\t\t \t// Now clear all records for shift & date\r\t\t\t\t \t self::delete($search_arr); \r\t\t\t\t }\r\t\t\t\t return OPERATION_SUCCESS;\r\t\t} \r\t\treturn OPERATION_FAIL; \r\t}", "public function run()\n {\n DB::table('workspaces')->insert([\n [\n 'workspace_title' => 'Our First Workspace'\n ] ,\n [\n 'workspace_title' => 'Our Second Workspace'\n ]\n ]);\n }", "function insert_rand_dates($count){\n\t//Make connection for DB 'my_web_db'\n\t$conn = check_connection_db(\"my_web_db\");\n\n\t// prepare and bind\n\t$stmt = $conn->prepare(\"INSERT INTO history (user_id, app_id, time) VALUES (?, ?, ?)\");\n\t$stmt->bind_param(\"iis\", $user_id, $app_id, $time);\n\n\tfor ($i=0;$i<$count;$i++){\n\t\t// set parameters and execute\n\t\t$user_id = mt_rand(0,20);\n\t\t$app_id = mt_rand(0, 10); \n\t\t$time = date('Y-m-d h:i:s');\n\t\t$stmt->execute();\n\t}\n\n\techo \"New records created successfully\";\n\n\t$stmt->close();\n\n\t//Close connection DB\n\t$conn->close();\n}", "public function run()\n {\n \n\n \\DB::table('periods')->delete();\n \n \\DB::table('periods')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'production_id' => 1,\n 'location_id' => 6,\n 'start' => '2017-08-28 10:38:32',\n 'end' => '2017-08-30 00:00:00',\n 'notes' => 'Stoyanova , Florez, Adbrazakov',\n 'created_at' => '2017-08-28 10:11:21',\n 'updated_at' => '2017-08-28 10:38:32',\n ),\n 1 => \n array (\n 'id' => 2,\n 'production_id' => 2,\n 'location_id' => 1,\n 'start' => '2017-09-01 00:00:00',\n 'end' => '2017-09-06 00:00:00',\n 'notes' => NULL,\n 'created_at' => '2017-08-28 10:41:39',\n 'updated_at' => '2017-08-28 10:41:39',\n ),\n 2 => \n array (\n 'id' => 3,\n 'production_id' => 3,\n 'location_id' => 1,\n 'start' => '2017-08-28 10:47:54',\n 'end' => '2017-08-28 10:47:54',\n 'notes' => 'Netrebko,Alvarez,Petean,D\\'Intino',\n 'created_at' => '2017-08-28 10:47:39',\n 'updated_at' => '2017-08-28 10:48:01',\n ),\n 3 => \n array (\n 'id' => 4,\n 'production_id' => 4,\n 'location_id' => 4,\n 'start' => '2017-09-18 00:00:00',\n 'end' => '2017-11-03 23:59:59',\n 'notes' => 'Kensley,Polenzani,Feola,Svede,Tsymbalyuk',\n 'created_at' => '2017-08-28 10:48:40',\n 'updated_at' => '2017-08-28 10:48:40',\n ),\n 4 => \n array (\n 'id' => 5,\n 'production_id' => 5,\n 'location_id' => 8,\n 'start' => '2017-11-22 00:00:00',\n 'end' => '2017-12-08 23:59:59',\n 'notes' => 'Kaufmann,Harteros,Salsi',\n 'created_at' => '2017-08-28 10:55:37',\n 'updated_at' => '2017-08-28 10:55:37',\n ),\n 5 => \n array (\n 'id' => 6,\n 'production_id' => 6,\n 'location_id' => 3,\n 'start' => '2017-12-01 00:00:00',\n 'end' => '2018-01-12 23:59:59',\n 'notes' => 'Nagelstad,Jovanovic,Hendricks',\n 'created_at' => '2017-08-28 10:56:01',\n 'updated_at' => '2017-08-28 10:56:01',\n ),\n 6 => \n array (\n 'id' => 7,\n 'production_id' => 7,\n 'location_id' => 2,\n 'start' => '2018-02-12 00:00:00',\n 'end' => '2018-03-10 23:59:59',\n 'notes' => 'Yoncheva,Fabiano, Phillips,',\n 'created_at' => '2017-08-28 10:56:31',\n 'updated_at' => '2017-08-28 10:56:31',\n ),\n 7 => \n array (\n 'id' => 8,\n 'production_id' => 8,\n 'location_id' => 2,\n 'start' => '2018-02-12 00:00:00',\n 'end' => '2018-03-17 23:59:59',\n 'notes' => 'Yaho,Zifchak,Aronica,Frontali',\n 'created_at' => '2017-08-28 10:56:55',\n 'updated_at' => '2017-08-28 10:56:55',\n ),\n 8 => \n array (\n 'id' => 9,\n 'production_id' => 9,\n 'location_id' => 2,\n 'start' => '2018-03-08 00:00:00',\n 'end' => '2018-04-07 23:59:59',\n 'notes' => 'Serafin,Yu,Alvarez,Tsymbalyuk',\n 'created_at' => '2017-08-28 10:57:31',\n 'updated_at' => '2017-08-28 10:57:31',\n ),\n ));\n \n \n }", "public function AddReservation($Room_id,$cust_id,$B_date,$E_date)\n{\n$DB=new DBManager();\n\n$DBegin=date_create($B_date);\n$DEnd=date_create($E_date);\n\n$diff=date_diff($DBegin,$DEnd);\n$interval = $DBegin->diff($DEnd);\n$intervalDays=$interval->days;\n\n\n$sql1=\"INSERT INTO reservation(cust_id,dateBegin,DateEnd,Room_id,period) VALUES ('$cust_id','$B_date','$E_date','$Room_id','$intervalDays')\";\n$resSel=$DB->AddDB($sql1);\n\n$sql2=\"UPDATE room SET status=1 WHERE id='$Room_id'\";\n$resUP=$DB->updateDB($sql2);\n\nif($resUP == \"Updated\")\n{\n return \" ***** Congratulations , You Reserved Room Successfully ***** \";\n}\nelse return \"problem\";\n\n}", "function saveEntry ($galaDetails, $swimmerDetails, $entryCost, $entryDetails)\n{\n global $db_gala_name;\n $paymentStatus = \"UNPAID\";\n $mysqli = openDatabase($db_gala_name);\n // save the entry to the database\n $stmt = $mysqli->prepare('INSERT INTO gala_swimmer_entry (AsaNo, gala_id, payment_amount, payment_status) VALUES (?, ?, ?, ?)');\n $stmt->bind_param('sids', $swimmerDetails['AsaNo'], $galaDetails['gala_index'], $entryCost, $paymentStatus);\n $stmt->execute();\n $swimmerEntryIndex = $mysqli->insert_id;\n // save the entered events to the database\n $stmt = $mysqli->prepare('INSERT INTO gala_event_entry (swimmer_entry, event_no, time) VALUES (?, ?, ?)');\n $stmt->bind_param('iis', $swimmerEntryIndex, $eventNo, $time);\n $eventCount = count($entryDetails['times']);\n $indx = 0;\n while ($indx < $eventCount) {\n if ($entryDetails['times'][$indx] != \"NOENTRY\" ) {\n $eventNo = $entryDetails['eventno'][$indx];\n $time = $entryDetails['times'][$indx];\n $stmt->execute();\n }\n $indx++;\n }\n return $swimmerEntryIndex;\n}", "public function run()\n {\n foreach ([1994, 1995] as $year) {\n for ($m = 1; $m <= 12; $m++) {\n for ($d = 1; $d <= 28; $d++) {\n $this->calendarDb->createCalendar(\n factory(User::class)->create(),\n $year,\n $m,\n $d\n );\n }\n }\n }\n }", "public function startSeason(){\n ini_set('max_execution_time',300000);\n $rallyDataService = parent::getService('rally','rallyData');\n $rallyService = parent::getService('rally','rally');\n $leagueService = parent::getService('league','league');\n \n $seasonInfo = $leagueService->getSeasonInfo();\n \n $rallies = $rallyDataService->getAllRallies();\n foreach($rallies as $rally):\n $rallyService->saveRallyFromData($rally,$seasonInfo['season_start']);\n $rallyService->saveRallyFromData($rally,$seasonInfo['season_start'],2);\n $rallyService->saveRallyFromData($rally,$seasonInfo['season_start'],3);\n endforeach;\n \n $this->createRalliesForAllLeagues();\n echo \"done\";exit;\n }", "public function store(Request $request)\n {\n $request->validate([\n 'season_id' => 'required|int',\n 'scheduled_start' => 'required',\n 'scheduled_end' => 'required',\n 'rounds' => 'required|integer',\n ]);\n\n $draft = Draft::create([\n 'season_id' => $request->input('season_id'),\n 'scheduled_start' => date('Y-m-d H:i:s', strtotime($request->input('scheduled_start'))),\n 'scheduled_end' => date('Y-m-d H:i:s', strtotime($request->input('scheduled_end'))),\n 'rounds' => $request->input('rounds')\n ]);\n\n // attach users\n Season::find($request->input('season_id'))\n ->groups\n ->each(function($group) use($request, $draft) {\n foreach($request->input('users-' . $group->id) as $order) {\n $order = explode(\"-\", $order);\n $user = User::find($order[0]);\n $order = $order[1];\n\n $draft->users()->attach($user, ['order' => $order, 'group_id' => $group->id]);\n }\n });\n }", "public function createSacksWeight()\n {\n \n \t$shift = $finished = $cols = \"\";\n\t\t\n $shift = trim($_POST[\"shift\"]);\n $shift = stripslashes($shift);\n $shift = htmlspecialchars($shift);\n\t\t\n\t\t$finished = trim($_POST[\"finished\"]);\n $finished = stripslashes($finished);\n $finished = htmlspecialchars($finished);\n\t\n\t\t$cols = trim($_POST[\"cols\"]);\n $cols = stripslashes($cols);\n $cols = htmlspecialchars($cols);\n\t\t\n //DATE\n $date = date(\"Y-m-d\");\n if($shift == 2)\n {\n $date = date(\"Y-m-d\", time() - 60 * 60 * 24);\n }\n if(!empty($_POST['date']))\n {\n $myDateTime = DateTime::createFromFormat('d/m/Y', $_POST['date']);\n $newDateString = $myDateTime->format('Y-m-d');\n $date = $newDateString;\n }\n\t\t\n\t\t$totalnet = $totalSacks = $number = 0;\n\t\t\n\t\t$sacks = \"INSERT INTO `injection_sacks_weight`\n(`injection_sacks_weight_id`,`date_sacks`,`shift`,`number`,`weight`,`user_id`,`finishproduct`,`cols`)\nVALUES\";\n\t\tforeach ($_POST as $k=>$v)\n\t\t{\n\t\t\tif (substr( $k, 0, 3 ) === \"wt_\" and !empty($v)){\n\t\t\t\t$i = explode(\"_\",$k)[1];\n\t\t\t\t\n\t\t\t\t$no = trim($_POST[\"no_\".$i]);\n\t\t\t\t$number = $number + $no;\n\t\t\t\t$totalSacks = $totalSacks + $no;\n\t\t\t\t$totalnet = $totalnet + $v;\n\t\t\t\t$sacks = $sacks. \" (NULL, '\". $date.\"', \". $shift .\", \". $no .\", \". $v .\", \". $_SESSION['Userid'] .\", \". $finished .\", \". $cols .\") ,\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t$update = \"\";\n\t\t\n\t\t\n\t\t$sql = \"SELECT `injection_sacks_production_id`, SUM(`sacks`) as total, SUM(used) as used\nFROM `injection_sacks_production`\nWHERE `status_production` = 0 AND cols= \". $cols.\" AND finishproduct = \". $finished .\"\n\";\n\t\t\n if($stmt = $this->_db->prepare($sql))\n {\n $stmt->execute();\n while($row = $stmt->fetch())\n {\n\t\t\t\tif(!is_null($row['injection_sacks_production_id']))\n\t\t\t\t{\n\t\t\t\t\t$TOTAL = $row['total'] - $row['used'];\n\t\t\t\t\tif($TOTAL<$number)\n\t\t\t\t\t{\n\t\t\t\t\t\techo '<strong>ERROR</strong> The sacks were not added to the production. Because there is not enought injection sacks production in stock. <br> There are <strong>'. $TOTAL .'</strong> kgs in stock, and you need <strong>'. $number .'</strong> sacks. Please try again after submit the sacks for the production.';\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t {\n\t\t\t\t\t\techo '<strong>ERROR</strong> The sack was not added to the production. ecause there is not enought injection sacks production in stock. <br> Please try again after submit the sacks for the production.';\n\t\t\t\t\t\treturn false;\n\t\t\t\t }\n }\n\t\t}\n\t\t\n\t\t$sql = \"SELECT `injection_sacks_production_id`, `sacks`, used\n\t\t\t\tFROM `injection_sacks_production`\n\t\t\t\tWHERE `status_production` = 0 AND cols= \". $cols.\" AND finishproduct = \". $finished .\"\n\t\t\t\tORDER BY `date_production` DESC, `injection_sacks_production_id`\n\t\t\t\tLIMIT 10;\";\n\t\t\n if($stmt = $this->_db->prepare($sql))\n {\n $stmt->execute();\n while($row = $stmt->fetch())\n {\n\t\t\t\tif(!is_null($row['injection_sacks_production_id']))\n\t\t\t\t{\n\t\t\t\t\t$TOTAL = $row['sacks'] - $row['used'];\n\t\t\t\t\tif(($TOTAL > $number) and ($number > 0))\n\t\t\t\t\t{\n\t\t\t\t\t\tif($number + $row['used'] == $row['sacks'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$update = $update . \"\n\t\t\t\t\t\tUPDATE `injection_sacks_production` SET\n `used` = `used`+\". $number .\", `status_production` = 1\n\t\t\t\t\t\tWHERE `injection_sacks_production_id` = \". $row['injection_sacks_production_id'].\"; \";\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\n\t\t\t\t\t\t\t$update = $update . \"\n\t\t\t\t\t\tUPDATE `injection_sacks_production` SET\n `used` = `used`+\". $number .\", `status_production` = 0\n\t\t\t\t\t\tWHERE `injection_sacks_production_id` = \". $row['injection_sacks_production_id'].\"; \";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$number = 0;\n\t\t\t\t\t\t$stmt->closeCursor();\n\t\t\t\t\t}\n\t\t\t\t\telse if(($TOTAL <= $number) and ($number > 0))\n\t\t\t\t\t{\n\t\t\t\t\t\t$update = $update . \"\n\t\t\t\t\t\tUPDATE `injection_sacks_production` SET\n `used` = `used`+\". $TOTAL .\", `status_production` = 1\n\t\t\t\t\t\tWHERE `injection_sacks_production_id` = \". $row['injection_sacks_production_id'].\";\";\n\t\t\t\t\t\t$number = $number - $TOTAL;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t {\n\t\t\t\t\t\techo '<strong>ERROR 3</strong> The sack was not added to the production. ecause there is not enought injection sacks production in stock. <br> Please try again after submit the sacks for the production.';\n\t\t\t\t\t\treturn false;\n\t\t\t\t }\n }\n\t\t\n\t\t\t\t\t\n\t\t\t$transfer = \" INSERT INTO `stock_materials_transfers`(`stock_materials_transfers_id`,`machine_from`,`machine_to`,`material_id`,`date_required`,`bags_required`,`bags_approved`,`bags_issued`,`bags_receipt`,`user_id_required`,`user_id_approved`,`user_id_issued`,`user_id_receipt`,`status_transfer`,`remarks_approved`,`remarks_issued`)VALUES(NULL,6,12, '\". $finished .\"','\". $date .\"',\". $totalSacks . \",\". $totalSacks . \",\". $totalSacks . \",NULL,\". $_SESSION['Userid'] . \",\". $_SESSION['Userid'] . \",\". $_SESSION['Userid'] . \",NULL,2,'Total Weight of Sacks = \". $totalnet .\"',NULL);\";\n\t\t\t\n\t\t\t$sql = substr($sacks,0,strlen($sacks)-2). \"; \". $update . $transfer ;\n\t\t\t\n\t\t\ttry { \n\t\t\t\t$this->_db->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\n\t\t\t\t$stmt = $this->_db->prepare($sql);\n\t\t\t\t$stmt->execute();\n\t\t\t\t$stmt->closeCursor();\n\t\t\t\t\n\t\t\t\techo '<strong>SUCCESS!</strong> The sacks were successfully added to the database for the shift: <strong>'. $this->giveShiftname($shift) .'</strong>';\n\t\t\t\treturn TRUE;\n\t\t\t\t\t\n\t\t\t}\n\t\t\tcatch (PDOException $e) {\n\t\t\t\techo '<strong>ERROR</strong> Could not insert the sacks into the database. Please try again.<br>'. $e->getMessage();\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\t}\n\t\t}", "public function run()\n {\n DB::table('shift')->insert(array(\n array(\n 'time' => 'من 8 الى 1',\n 'description' => 'فترة أولى',\n ),\n array(\n 'time' => 'من 2 الى 5',\n 'description' => 'فترة ثانية',\n ),\n ));\n }", "public function run()\n {\n $carbon = Carbon::now('America/Lima');\n\n $year = $carbon->year;\n\n $start = clone $carbon;\n $start->firstOfYear();\n\n $end = clone $carbon;\n $end->lastOfYear();\n\n $prev_start = clone $start;\n $prev_start->subYear();\n\n $prev_end = clone $end;\n $prev_end->subYear();\n\n // A past school year\n SchoolYear::create([\n 'name' => ($year-1) . '-II',\n 'start' => $prev_start,\n 'end' => $prev_end,\n 'course_handbook_id' => 1 // malla curricular\n ]);\n\n // Current school year\n SchoolYear::create([\n 'name' => $year . '-I',\n 'start' => $start,\n 'end' => $end,\n 'course_handbook_id' => 1 // malla curricular\n ]);\n }", "public function run()\n {\n $records = factory(WikiCate::class)->times(12)->make()->each(function ($record) {\n });\n WikiCate::insert($records->toArray());\n }", "public function run()\n {\n DB::table('students')->insert([\n 'fname' => 'student',\n 'lname' => 'test',\n 'bday' => '10/09/1997',\n 'studid' => 'abc1123',\n 'overAllPoints' => 10,\n 'pointsBal' => 6,\n 'pointsUsed' => 4,\n 'userId' => 2\n ]);\n }", "function update_week(){\n\t\t$time = array('id'=>1, 'ending_date' => date('Y-m-d'));\n\t\treturn $this->save($time);\n\t}", "public function setDays($regNr, $ssNr) {\n // Selecting the right row from history table bases on the personal number and registration number to update on right place.\n $historyQuery = \"SELECT * FROM history WHERE regNr = :regNr AND ssNr = :ssNr ORDER BY checkOutTime DESC LIMIT 1\";\n $historyStatement = $this->db->prepare($historyQuery);\n $historyParameters = [\"regNr\" => $regNr, \"ssNr\" => $ssNr];\n $historyRows = $historyStatement->execute($historyParameters);\n if (!$historyRows) die(\"Fatal Error\");\n \n // Fetching the checkin and checkout time from row selected above.\n $time = $historyStatement->fetch();\n $checkOut = $time[\"checkOutTime\"];\n $checkIn = $time[\"checkInTime\"];\n \n // Redefining times as Datetime-objects.\n $checkOutTime = new \\DateTime($checkOut);\n $checkInTime = new \\DateTime($checkIn);\n \n // Adding days, hours, minutes and seconds to total amount of minutes car has been rented.\n $difference = $checkOutTime->diff($checkInTime);\n $minutes = $difference->days * 24 * 60;\n $minutes += $difference->h * 60;\n $minutes += $difference->i;\n $minutes += $difference->s / 60;\n \n // Divide minutes with minutes in an hour and then hours in a day to get the amount in days and then rounding it up so we get amount of started days.\n $unroundedDays = $minutes / 60 / 24;\n $days = ceil($unroundedDays);\n \n // Updating history row we selected above with the total amount of days started.\n $historyQuery = \"UPDATE history SET days = :days WHERE regNr = :regNr AND ssNr = :ssNr ORDER BY checkOutTime DESC LIMIT 1\";\n $historyStatement = $this->db->prepare($historyQuery);\n $historyParameters = [\"days\" => $days, \"regNr\" => $regNr, \"ssNr\" => $ssNr];\n $historyStatement->execute($historyParameters);\n if (!$historyStatement) die(\"Fatal Error\");\n \n }", "public function run()\n\t{\n DB::table('produit')->insert(array(\n array('date' => \"2016-01-01\", 'heure' => \"10:10\", 'valeurScan' => 10001),\n array('date' => \"2016-01-01\", 'heure' => \"10:20\", 'valeurScan' => 10002),\n array('date' => \"2016-01-01\", 'heure' => \"10:30\", 'valeurScan' => 10003),\n array('date' => \"2016-01-01\", 'heure' => \"10:40\", 'valeurScan' => 10004),\n array('date' => \"2016-01-01\", 'heure' => \"10:50\", 'valeurScan' => 10005),\n array('date' => \"2016-01-01\", 'heure' => \"11:00\", 'valeurScan' => 10006),\n array('date' => \"2016-01-01\", 'heure' => \"11:10\", 'valeurScan' => 10007),\n array('date' => \"2016-01-01\", 'heure' => \"11:20\", 'valeurScan' => 10008),\n array('date' => \"2016-01-01\", 'heure' => \"11:30\", 'valeurScan' => 10009),\n array('date' => \"2016-01-01\", 'heure' => \"11:40\", 'valeurScan' => 10010),\n array('date' => \"2016-01-01\", 'heure' => \"11:50\", 'valeurScan' => 10011),\n array('date' => \"2016-01-01\", 'heure' => \"12:00\", 'valeurScan' => 20001),\n array('date' => \"2016-01-01\", 'heure' => \"12:10\", 'valeurScan' => 20002),\n array('date' => \"2016-01-01\", 'heure' => \"12:20\", 'valeurScan' => 20003),\n array('date' => \"2016-01-01\", 'heure' => \"12:30\", 'valeurScan' => 20004),\n array('date' => \"2016-01-01\", 'heure' => \"12:40\", 'valeurScan' => 20005),\n array('date' => \"2016-01-01\", 'heure' => \"12:50\", 'valeurScan' => 20006),\n array('date' => \"2016-01-01\", 'heure' => \"13:00\", 'valeurScan' => 20007),\n ));\n\t}", "function perd_load_scores_semester( $appGlobals, $classDate=NULL, $kidPeriodId=NULL, $gameType=NULL, $periodId=NULL,$mode='u') {\n}", "public function changeWeek(Request $request,$next_date){\n\n $start_date=Carbon::parse($next_date)->addDay(1);\n $date = Carbon::parse($next_date)->addDay(1);\n\n \n $end_date=Carbon::parse($start_date)->addDay(7);\n $this_week= $week_number = $end_date->weekOfYear;\n \n $period = CarbonPeriod::create($start_date, $end_date);\n \n\n $dates=[];\n foreach ($period as $date){\n $dates[] = $date->format('Y-m-d');\n \n }\n \n if (ApiBaseMethod::checkUrl($request->fullUrl())) {\n $user_id = $id;\n } else {\n $user = Auth::user();\n\n if ($user) {\n $user_id = $user->id;\n } else {\n $user_id = $request->user_id;\n }\n }\n\n $student_detail = SmStudent::where('user_id', $user_id)->first();\n //return $student_detail;\n $class_id = $student_detail->class_id;\n $section_id = $student_detail->section_id;\n\n $sm_weekends = SmWeekend::orderBy('order', 'ASC')->where('active_status', 1)->where('school_id',Auth::user()->school_id)->get();\n\n $class_times = SmClassTime::where('type', 'class')->where('academic_id', getAcademicId())->where('school_id',Auth::user()->school_id)->get();\n\n if (ApiBaseMethod::checkUrl($request->fullUrl())) {\n $data = [];\n $data['student_detail'] = $student_detail->toArray();\n $weekenD = SmWeekend::all();\n foreach ($weekenD as $row) {\n $data[$row->name] = DB::table('sm_class_routine_updates')\n ->select('sm_class_times.period', 'sm_class_times.start_time', 'sm_class_times.end_time', 'sm_subjects.subject_name', 'sm_class_rooms.room_no')\n ->join('sm_classes', 'sm_classes.id', '=', 'sm_class_routine_updates.class_id')\n ->join('sm_sections', 'sm_sections.id', '=', 'sm_class_routine_updates.section_id')\n ->join('sm_class_times', 'sm_class_times.id', '=', 'sm_class_routine_updates.class_period_id')\n ->join('sm_subjects', 'sm_subjects.id', '=', 'sm_class_routine_updates.subject_id')\n ->join('sm_class_rooms', 'sm_class_rooms.id', '=', 'sm_class_routine_updates.room_id')\n\n ->where([\n ['sm_class_routine_updates.class_id', $class_id], ['sm_class_routine_updates.section_id', $section_id], ['sm_class_routine_updates.day', $row->id],\n ])->where('sm_class_routine_updates.academic_id', getAcademicId())->where('sm_classesschool_id',Auth::user()->school_id)->get();\n }\n\n return ApiBaseMethod::sendResponse($data, null);\n }\n\n return view('lesson::student.student_lesson_plan', compact('dates','this_week','class_times', 'class_id', 'section_id', 'sm_weekends'));\n \n }", "public function academicprogressCoursesInsert($lintidreg,$academicprogressID,$landscapeID,$programID,$studentdetails,$userId) {\r\n $db = Zend_Db_Table::getDefaultAdapter();\r\n //$tableNAme = 'tbl_academicprogress_subjects';\r\n //$Year_Level_Block = ''; \r\n \r\n // check all DUMMY SEMESTERS and their subjects for the student. This will be listed in registered courses listing.\r\n $this->fninsertDummySubjects($lintidreg,$academicprogressID,$landscapeID,$programID,$studentdetails,$userId); \r\n \r\n // COUNT the latest sem for the STUDENT\r\n $sqlTotalSem = $db->select()\r\n ->from(array('totstudsem' => 'tbl_studentsemesterstatus'),array('totstudsem.*')) \r\n ->where('totstudsem.IdStudentRegistration = ?',$lintidreg); \r\n $resultTotalSem = $db->fetchAll($sqlTotalSem);\r\n $finalTotal = count($resultTotalSem);\r\n //die;\r\n \r\n //CHECK FOR ALL \"CT\" SUBJECTS and are not \"DUMMY\", will be listed in registered course listing.\r\n $this->fninsertCTSubjects($lintidreg,$academicprogressID,$landscapeID,$programID,$studentdetails,$userId); \r\n \r\n \r\n \r\n // from semester status, order by date asc, get the semester list, the first semId will be treated as sem1, next id will be sem2, ...\r\n $this->fninsertSemesterSubjects($lintidreg,$academicprogressID,$landscapeID,$programID,$studentdetails,$userId); \r\n \r\n \r\n \r\n \r\n \r\n // CHECK FOR THE LATEST SEM and check from the landscape, the semester.\r\n $this->fninsertLandscapeSubjects($lintidreg,$academicprogressID,$landscapeID,$programID,$studentdetails,$userId,$finalTotal); \r\n //$currentDate = date('Y-m-d'); \r\n \r\n \r\n \r\n \r\n \r\n }", "function draw_calendar($month,$year,$activityStartDateArray = array()){\r\n\r\n\t/* draw table */\r\n\t$calendar = '<table cellpadding=\"0\" cellspacing=\"0\" class=\"calendar\">';\r\n\r\n\t/* table headings */\r\n\t$headings = array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');\r\n\t$calendar.= '<tr class=\"calendar-row\"><td class=\"calendar-day-head\">'.implode('</td><td class=\"calendar-day-head\">',$headings).'</td></tr>';\r\n\r\n\t/* days and weeks vars now ... */\r\n\t$running_day = date('w',mktime(0,0,0,$month,1,$year));\r\n\t$days_in_month = date('t',mktime(0,0,0,$month,1,$year));\r\n\t$days_in_this_week = 1;\r\n\t$day_counter = 0;\r\n\t$dates_array = array();\r\n\r\n\t/* row for week one */\r\n\t$calendar.= '<tr class=\"calendar-row\">';\r\n\r\n\t/* print \"blank\" days until the first of the current week */\r\n\tfor($x = 0; $x < $running_day; $x++):\r\n\t\t$calendar.= '<td class=\"calendar-day-np\">&nbsp;</td>';\r\n\t\t$days_in_this_week++;\r\n\tendfor;\r\n\r\n\t/* keep going with days.... */\r\n\tfor($list_day = 1; $list_day <= $days_in_month; $list_day++):\r\n\t\t$calendar.= '<td class=\"calendar-day\"><div style=\"position:relative;height:100px;\">';\r\n\t\t\t/* add in the day number */\r\n\t\t\t$calendar.= '<div class=\"day-number\">'.$list_day.'</div>';\r\n\t\t\t\r\n\t\t\t//eventdate=startdate and enddate, depends which we talks about \r\n\r\n\t\t\t$startDate = $year.'-'.$month.'-'.$list_day;\r\n\t\t\t//$endDate = $year.'-'.$month.'-'.$list_day;\r\n\t\t\techo \"<br>the start date is\".$startDate;\r\n\t\t\t//something is wrong wit hteh startDate, the origin code has a while loop in the beginning, think why \r\n\t\t\t\r\n\t\t\tif(isset($activityStartDateArray[$startDate])) {\r\n\t\t\t\tforeach($activityStartDateArray[$startDate] as $activity) {\r\n\t\t\t\t\t$calendar.= '<div class=\"activity\">'.$activity['activityName'].'</div>';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\r\n\t\t\telse {\r\n\t\t\t\t$calendar.= str_repeat('<p>&nbsp;</p>',2);\r\n\t\t\t}\r\n\t\t$calendar.= '</div></td>';\r\n\t\tif($running_day == 6):\r\n\t\t\t$calendar.= '</tr>';\r\n\t\t\tif(($day_counter+1) != $days_in_month):\r\n\t\t\t\t$calendar.= '<tr class=\"calendar-row\">';\r\n\t\t\tendif;\r\n\t\t\t$running_day = -1;\r\n\t\t\t$days_in_this_week = 0;\r\n\t\tendif;\r\n\t\t$days_in_this_week++; $running_day++; $day_counter++;\r\n\tendfor;\r\n\t\r\n\t\r\n\t/* finish the rest of the days in the week */\r\n\tif($days_in_this_week < 8):\r\n\t\tfor($x = 1; $x <= (8 - $days_in_this_week); $x++):\r\n\t\t\t$calendar.= '<td class=\"calendar-day-np\">&nbsp;</td>';\r\n\t\tendfor;\r\n\tendif;\r\n\r\n\t/* final row */\r\n\t$calendar.= '</tr>';\r\n\t\r\n\r\n\t/* end the table */\r\n\t$calendar.= '</table>';\r\n\r\n\t/** DEBUG **/\r\n\t$calendar = str_replace('</td>','</td>'.\"\\n\",$calendar);\r\n\t$calendar = str_replace('</tr>','</tr>'.\"\\n\",$calendar);\r\n\t\r\n\t/* all done, return result */\r\n\treturn $calendar;\r\n}", "public function saveUrsprung($monat,$jahr){\n $this->db->query(\"delete from dzeitsoll2 where MONTH(datum)='$monat' and YEAR(datum)='$jahr'\");\n $sql_select = \"select * from dzeitsoll where MONTH(datum)='$monat' and YEAR(datum)='$jahr'\";\n $result = $this->db->query($sql_select);\n $vlozeno =0;\n $user = \"PHP_\".$_SERVER[\"REMOTE_ADDR\"];//.\"/\".$_SESSION[\"user\"];\n while($row = $result->fetch()){\n $sql_insert = \"insert into dzeitsoll2 (persnr,datum,oe,stunden,user) values('\".$row['persnr'].\"','\".$row['datum'].\"','\".$row['oe'].\"','\".$row['stunden'].\"','\".$user.\"')\";\n $this->db->query($sql_insert);\n $vlozeno++;\n }\n\n return $vlozeno;\n }", "public function store(Request $request)\n {\n $datetimes = $addedDays = $schedules = $DBSchedules = $interGetDays = $interAddedDays = [];\n $quantity = $request['quantity'] ?? 40;\n\n if (!$request['group_id']) {\n $user_id = User::userIdByRole($request['users'], 'student');\n }\n $teacher_id = User::userIdByRole($request['users'], 'teacher');\n\n foreach ($request['datetimes'] as $times) {\n $date[] = Carbon::createFromFormat('d.m.Y H:i', $times, 'Europe/Moscow');\n\n $time = Carbon::createFromFormat('d.m.Y H:i', $times, 'Europe/Moscow');\n $datetimes[] = $time->format('Y-m-d H:i');\n\n $interGetDays[] = Carbon::createFromFormat('d.m.Y H:i', $times, 'Europe/Moscow')->format('Y-m-d H');\n }\n\n while (count(array_merge($datetimes, $addedDays)) < $quantity) {\n foreach ($date as $day) {\n $addedDays[] = $day->addDays(7)->format('Y-m-d H:i');\n\n $interAddedDays[] = $day->format('Y-m-d H');\n }\n }\n\n $teacherSchedules = Schedule::whereHas('lesson.users', function($q) use ($teacher_id) {\n $q->where('user_id', $teacher_id);\n })->pluck('schedule');\n\n foreach ($teacherSchedules as $schedule) {\n $DBSchedules[] = Carbon::createFromFormat('Y-m-d H:i:s', $schedule, 'Europe/Moscow')->format('Y-m-d H');\n }\n\n $intersect = array_intersect($DBSchedules, array_merge($interGetDays, $interAddedDays));\n\n if ($intersect) {\n return redirect()->back()->with(['message' => 'Обнаружены повторяющиеся даты', 'intersect' => $intersect]);\n }\n\n $lesson = Lesson::create($request->all());\n $lesson->users()->attach($request['users']);\n\n foreach (array_merge($datetimes, $addedDays) as $finalDate) {\n $fields = ['lesson_id' => $lesson->id, 'schedule' => $finalDate . ':00'];\n $schedules[] = Schedule::create($fields);\n }\n\n foreach ($schedules as $schedule) {\n if ($schedule->lesson->group_id) {\n foreach ($schedule->lesson->group->users as $user) {\n $schedule->users()->attach($user->id);\n Payment::create(['user_id' => $user->id, 'schedule_id' => $schedule->id]);\n }\n } else {\n Payment::create(['user_id' => $user_id, 'schedule_id' => $schedule->id]);\n }\n }\n\n return redirect()->route('admin.lessons');\n }", "function teacher_assign_class_timetable_monday($savemonday)\n\t{\n\t $this->db->insert('schoolnew_timetable_term_classwise',$savemonday); \n return $this->db->insert_id();\t\n\t}", "public function insert_addSiswa($dat_siswa)\n\t{\n\t\t$this->db->insert_batch('tb_hakakses-to',$dat_siswa);\n\t}", "public function run()\n {\n $data = [\n \t ['title'=>'Demo Event-1', 'start_date'=>'2018-02-19', 'end_date'=>'2018-02-19'],\n \t ['title'=>'Demo Event-2', 'start_date'=>'2018-02-21', 'end_date'=>'2018-02-21'],\n ['title'=>'Demo Event-2-2', 'start_date'=>'2018-02-21', 'end_date'=>'2018-02-21'],\n ['title'=>'Demo Event-2-3', 'start_date'=>'2018-02-21', 'end_date'=>'2018-02-21'],\n ['title'=>'Demo Event-2-4', 'start_date'=>'2018-02-21', 'end_date'=>'2018-02-21'],\n ['title'=>'Demo Event-2-5', 'start_date'=>'2018-02-21', 'end_date'=>'2018-02-21'],\n ];\n\n\n DB::table('events')->insert($data);\n\n }", "public function run()\n {\n DB::table('tbluspl')->insert([\n 'tblplancdgo' => 3,\n 'tblusrocdgo' => 2,\n 'tblusplflag' => 'A',\n 'tblusplfech' => '2021-09-07'\n ]);\n }", "public function run()\n {\n Semestre::create([\n \"ano\" => \"2020\",\n \"periodo\" => '2'\n ]);\n }", "public function run()\n {\n $param = [\n 'user_id' => 2,\n 'shop_id' => 9,\n 'table_id' => 8,\n 'date_time' => '2021-07-30 20:00:00',\n 'number_of_people'=> 5,\n 'created_at' => '2021-07-29 20:00:00',\n 'updated_at' => '2021-07-29 20:00:00',\n\n ];\n DB::table('reservations')->insert($param);\n\n $param = [\n 'user_id' => 2,\n 'shop_id' => 9,\n 'table_id' => 9,\n 'date_time' => '2021-07-30 20:00:00',\n 'number_of_people'=> 6,\n 'created_at' => '2021-07-29 20:00:00',\n 'updated_at' => '2021-07-29 20:00:00',\n ];\n DB::table('reservations')->insert($param);\n }", "public function run()\n\t{\n $lastFallStart = Date('Y-m-d', strtotime('september ' . Date('Y', strtotime('last year')) . ' first monday'));\n $lastFallEnd = Date('Y-m-d', strtotime('december 25 ' . Date('Y', strtotime('last year')) . ' -2 weeks next monday'));\n $fallStart = Date('Y-m-d', strtotime('september first monday'));\n $fallEnd = Date('Y-m-d', strtotime('december 25 first monday'));\n $nextFallStart = Date('Y-m-d', strtotime('september ' . Date('Y', strtotime('next year')) . ' first monday'));\n $nextFallEnd = Date('Y-m-d', strtotime('december 25 ' . Date('Y', strtotime('next year')) . ' -2 weeks next monday'));\n $lastSpringStart = Date('Y-m-d', strtotime('january ' . Date('Y', strtotime('last year')) . ' second monday'));\n $lastSpringEnd = Date('Y-m-d', strtotime('may ' . Date('Y', strtotime('last year')) . ' first monday'));\n $springStart = Date('Y-m-d', strtotime('january second monday'));\n $springEnd = Date('Y-m-d', strtotime('may first monday'));\n $nextSpringStart = Date('Y-m-d', strtotime('january ' . Date('Y', strtotime('next year')) . ' second monday'));\n $nextSpringEnd = Date('Y-m-d', strtotime('may ' . Date('Y', strtotime('next year')) . ' first monday'));\n $lastSummerStart = Date('Y-m-d', strtotime(\"$lastSpringEnd +1 weeks next monday\"));\n $lastSummerEnd = Date('Y-m-d', strtotime(\"$lastFallStart -2 weeks next monday\"));\n $summerStart = Date('Y-m-d', strtotime(\"$springEnd + 1 weeks next monday\"));\n $summerEnd = Date('Y-m-d', strtotime(\"$fallStart -2 weeks next monday\"));\n $nextSummerStart = Date('Y-m-d', strtotime(\"$nextSpringEnd +1 weeks next monday\"));\n $nextSummerEnd = Date('Y-m-d', strtotime(\"$nextFallStart -2 weeks next monday\"));\n\t\t\\DB::table('semester_start')->delete();\n \n $semesters = array (\n\t\t\t0 => \n\t\t\tarray (\n\t\t\t\t'id' => 'fall'.explode('-', $lastFallStart)[0],\n\t\t\t\t'start_date' => $lastFallStart,\n\t\t\t\t'end_date' => $lastFallEnd,\n\t\t\t\t'updated_at' => '2014-07-08 00:00:00',\n\t\t\t\t'created_at' => '2014-07-08 00:00:00',\n\t\t\t),\n\t\t\t1 => \n\t\t\tarray (\n\t\t\t\t'id' => 'fall'.explode('-', $fallStart)[0],\n\t\t\t\t'start_date' => $fallStart,\n\t\t\t\t'end_date' => $fallEnd,\n\t\t\t\t'updated_at' => '2014-07-08 00:00:00',\n\t\t\t\t'created_at' => '2014-07-08 00:00:00',\n\t\t\t),\n\t\t\t2 => \n\t\t\tarray (\n\t\t\t\t'id' => 'fall'.explode('-', $nextFallStart)[0],\n\t\t\t\t'start_date' => $nextFallStart,\n\t\t\t\t'end_date' => $nextFallEnd,\n\t\t\t\t'updated_at' => '2014-07-08 00:00:00',\n\t\t\t\t'created_at' => '2014-07-08 00:00:00',\n\t\t\t),\n\t\t\t3 => \n\t\t\tarray (\n\t\t\t\t'id' => 'spring'.explode('-', $lastSpringStart)[0],\n\t\t\t\t'start_date' => $lastSpringStart,\n\t\t\t\t'end_date' => $lastSpringEnd,\n\t\t\t\t'updated_at' => '2014-07-08 00:00:00',\n\t\t\t\t'created_at' => '2014-07-08 00:00:00',\n\t\t\t),\n\t\t\t4 => \n\t\t\tarray (\n\t\t\t\t'id' => 'spring'.explode('-', $springStart)[0],\n\t\t\t\t'start_date' => $springStart,\n\t\t\t\t'end_date' => $springEnd,\n\t\t\t\t'updated_at' => '2014-07-08 00:00:00',\n\t\t\t\t'created_at' => '2014-07-08 00:00:00',\n\t\t\t),\n\t\t\t5 => \n\t\t\tarray (\n\t\t\t\t'id' => 'spring'.explode('-', $nextSpringStart)[0],\n\t\t\t\t'start_date' => $nextSpringStart,\n\t\t\t\t'end_date' => $nextSpringEnd,\n\t\t\t\t'updated_at' => '2014-11-03 17:20:13',\n\t\t\t\t'created_at' => '2014-11-03 17:20:13',\n\t\t\t),\n\t\t\t6 => \n\t\t\tarray (\n\t\t\t\t'id' => 'summer'.explode('-', $lastSummerStart)[0],\n\t\t\t\t'start_date' => $lastSummerStart,\n\t\t\t\t'end_date' => $lastSummerEnd,\n\t\t\t\t'updated_at' => '2015-11-30 10:30:00',\n\t\t\t\t'created_at' => '2015-11-30 10:30:00',\n\t\t\t),\n\t\t\t7 => \n\t\t\tarray (\n\t\t\t\t'id' => 'summer'.explode('-', $summerStart)[0],\n\t\t\t\t'start_date' => $summerStart,\n\t\t\t\t'end_date' => $summerEnd,\n\t\t\t\t'updated_at' => '2014-07-08 00:00:00',\n\t\t\t\t'created_at' => '2014-07-08 00:00:00',\n\t\t\t),\n\t\t\t8 => \n\t\t\tarray (\n\t\t\t\t'id' => 'summer'.explode('-', $nextSummerStart)[0],\n\t\t\t\t'start_date' => $nextSummerStart,\n\t\t\t\t'end_date' => $nextSummerEnd,\n\t\t\t\t'updated_at' => '2014-07-08 00:00:00',\n\t\t\t\t'created_at' => '2014-07-08 00:00:00',\n\t\t\t),\n );\n\n \\DB::table('semester_start')->insert($semesters);\n\t}", "function draw_calendar($conn, $month,$year,$alat){\n\n /* draw table */\n $calendar = '<table cellpadding=\"0\" cellspacing=\"0\" class=\"calendar\">';\n\n /* table headings */\n $headings = array('Sun','Mon','Tue','Wed','Thu','Fri','Sat');\n $calendar.= '<tr class=\"calendar-row\"><td class=\"calendar-day-head\">'.implode('</td><td class=\"calendar-day-head\">',$headings).'</td></tr>';\n\n /* days and weeks vars now ... */\n $running_day = date('w',mktime(0,0,0,$month,1,$year));\n $days_in_month = date('t',mktime(0,0,0,$month,1,$year));\n $days_in_this_week = 1;\n $day_counter = 0;\n\n $booked[] = $days_in_month;\n for($i = 0; $i<=$days_in_month; $i++){\n $booked[$i] = '';\n }\n\n $now = $month + $year *12;\n\n //PENGECEKKAN STATUS UNTUK KEPENTINGAN KALENDER\n //booking\n $result = mysqli_query($conn,\"SELECT * FROM booking NATURAL JOIN alat where nama_alat = '$alat' and ((year(tanggal_rencana_peminjaman)*12 + month(tanggal_rencana_peminjaman)) <= '$now') and ((year(tanggal_rencana_pengembalian)*12 + month(tanggal_rencana_pengembalian)) >= '$now')\");\n if(mysqli_num_rows($result)>0){\n markdate($booked,$result,$days_in_month,$month,2);\n }\n mysqli_free_result($result);\n\n //peminjaman\n $result = mysqli_query($conn,\"SELECT * FROM peminjaman NATURAL JOIN alat where nama_alat = '$alat' and tanggal_pengembalian IS NULL and ((year(tanggal_peminjaman)*12 + month(tanggal_peminjaman)) <= '$now') and ((year(tanggal_rencana_pengembalian)*12 + month(tanggal_rencana_pengembalian)) >= '$now')\");\n if(mysqli_num_rows($result)>0){\n markdate($booked,$result,$days_in_month,$month,1);\n }\n mysqli_free_result($result);\n\n //perbaikan\n $result = mysqli_query($conn,\"SELECT * FROM perbaikan NATURAL JOIN alat where nama_alat = '$alat' and tanggal_selesai_perbaikan IS NULL and ((year(tanggal_mulai_perbaikan)*12 + month(tanggal_mulai_perbaikan)) <= '$now') and ((year(estimasi_selesai_perbaikan)*12 + month(estimasi_selesai_perbaikan)) >= '$now')\");\n if(mysqli_num_rows($result)>0){\n markdate($booked,$result,$days_in_month,$month,3);\n }\n mysqli_free_result($result);\n\n //END OF PENGECEKKAN STATUS\n\n /* row for week one */\n $calendar.= '<tr class=\"calendar-row\">';\n\n /* print \"blank\" days until the first of the current week */\n for($x = 0; $x < $running_day; $x++):\n $calendar.= '<td class=\"calendar-day-np\"> </td>';\n $days_in_this_week++;\n endfor;\n\n /* keep going with days.... */\n for($list_day = 1; $list_day <= $days_in_month; $list_day++):\n\n $calendar.= '<td class=\"calendar-day\">';\n\n /* add in the day number */\n $calendar.= '<div class=\"day-number\">'.$list_day.'</div>';\n\n /** QUERY THE DATABASE FOR AN ENTRY FOR THIS DAY !! IF MATCHES FOUND, PRINT THEM !! **/\n $calendar.= $booked[$list_day-1];\n\n $calendar.= '</td>';\n if($running_day == 6):\n $calendar.= '</tr>';\n if(($day_counter+1) != $days_in_month):\n $calendar.= '<tr class=\"calendar-row\">';\n endif;\n $running_day = -1;\n $days_in_this_week = 0;\n endif;\n $days_in_this_week++; $running_day++; $day_counter++;\n\n endfor;\n\n /* finish the rest of the days in the week */\n if($days_in_this_week < 8):\n for($x = 1; $x <= (8 - $days_in_this_week); $x++):\n $calendar.= '<td class=\"calendar-day-np\"> </td>';\n endfor;\n endif;\n\n /* final row */\n $calendar.= '</tr>';\n\n /* end the table */\n $calendar.= '</table>';\n\n\n /* all done, return result */\n return $calendar;\n}", "public function insert() {\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\r\n\t\t\t$ks_db->beginTransaction ();\r\n\r\n\t\t\t$arrBindings = array ();\r\n\t\t\t$insertCols = '';\r\n\t\t\t$insertVals = '';\r\n\t\t\t\t\r\n\t\t\tif (isset ( $this->title )) {\r\n\t\t\t\t$insertCols .= \"dsh_title, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->title;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->desc )) {\r\n\t\t\t\t$insertCols .= \"dsh_desc, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->desc;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->portlet )) {\r\n\t\t\t\t$insertCols .= \"dsh_portlet, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->portlet;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->hide )) {\r\n\t\t\t\t$insertCols .= \"dsh_hide, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->hide;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->createdBy )) {\r\n\t\t\t\t$insertCols .= \"dsh_created_by, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->createdBy;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->modifiedBy )) {\r\n\t\t\t\t$insertCols .= \"dsh_modified_by, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->modifiedBy;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->createdDate )) {\r\n\t\t\t\t$insertCols .= \"dsh_created_date, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->createdDate;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->modifiedDate )) {\r\n\t\t\t\t$insertCols .= \"dsh_modified_date, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->modifiedDate;\r\n\t\t\t}\r\n\r\n\t\t\t//remove trailing commas\r\n\t\t\t$insertCols = preg_replace(\"/, $/\", \"\", $insertCols);\r\n\t\t\t$insertVals = preg_replace(\"/, $/\", \"\", $insertVals);\r\n\r\n\t\t\t$sql = \"INSERT INTO $this->sqlTable ($insertCols)\";\r\n\t\t\t$sql .= \" VALUES ($insertVals)\";\r\n\r\n\t\t\t$ks_db->query ( $sql, $arrBindings );\r\n\r\n\t\t\t//set the auto-increment property, only if the primary column is auto-increment\r\n\t\t\t$this->id = $ks_db->lastInsertId();\r\n\r\n\t\t\t$ks_db->commit ();\r\n\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_db->rollBack ();\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "function saveGroupWorksheet($worksheetDetails, $grade_boundaries, $userid, $worksheet_inputs, $worksheet_tags) {\n try{\n $gwid = $worksheetDetails[\"gwid\"];\n $staff1 = (!$worksheetDetails[\"staff1\"] || $worksheetDetails[\"staff1\"] == \"0\") ? $userid : $worksheetDetails[\"staff1\"];\n $staff2 = (!$worksheetDetails[\"staff2\"] || $worksheetDetails[\"staff2\"] == \"0\") ? \"null\" : $worksheetDetails[\"staff2\"];\n $staff3 = (!$worksheetDetails[\"staff3\"] || $worksheetDetails[\"staff3\"] == \"0\") ? \"null\" : $worksheetDetails[\"staff3\"];\n $datedue = $worksheetDetails[\"dateDueMain\"];\n $stuNotes = array_key_exists(\"studentNotes\", $worksheetDetails) ? db_escape_string($worksheetDetails[\"studentNotes\"]) : \"\";\n //$staffNotes = array_key_exists(\"staffNotes\", $worksheetDetails) ? db_escape_string($worksheetDetails[\"staffNotes\"]) : \"\";\n $displayName = array_key_exists(\"displayName\", $worksheetDetails) ? db_escape_string($worksheetDetails[\"displayName\"]) : \"\";\n $hidden = $worksheetDetails[\"hide\"] == \"true\" ? \"0\" : \"1\";\n $student_input = $worksheetDetails[\"student\"] == \"true\" ? \"1\" : \"0\";\n $enter_totals = $worksheetDetails[\"enter_totals\"] == \"true\" ? \"1\" : \"0\";\n\n $query = \"UPDATE TGROUPWORKSHEETS SET `Primary Staff ID` = $staff1, `Additional Staff ID` = $staff2, `Additional Staff ID 2` = $staff3, \"\n . \"`Date Due` = STR_TO_DATE('$datedue', '%d/%m/%Y'), `Additional Notes Student` = '$stuNotes', `DisplayName` = '$displayName' \"\n . \",`Hidden` = $hidden, `StudentInput` = $student_input, `Date Last Modified` = NOW() , `EnterTotals` = $enter_totals \"\n . \"WHERE `Group Worksheet ID` = $gwid;\";\n\n db_query_exception($query);\n updateGradeBoundaries($grade_boundaries, $gwid);\n updateWorksheetTags($worksheet_tags, $gwid);\n updateWorksheetInputs($worksheet_inputs, $gwid);\n } catch (Exception $ex) {\n $message = \"There was an error saving the details for the worksheet.\";\n log_error($message . \" Exception: \" . $ex->getMessage(), \"requests/setWorksheetResult.php\", __LINE__);\n $array = array(\n \"result\" => FALSE,\n \"message\" => $message\n );\n echo json_encode($array);\n exit();\n }\n $response = array(\"result\" => TRUE);\n echo json_encode($response);\n exit();\n}", "function RegisterNewDate($date_id, $user_id, $gid){\r\n\r\n\tglobal $conn;\r\n\r\n\t$q = \"DELETE FROM studentslots WHERE user_id='\".$user_id.\"' AND gid='\".$gid.\"' \";\r\n\r\n\tmysql_query($q,$conn);\r\n\r\n\t\r\n\r\n\t$query = \"INSERT INTO studentslots (user_id, sch_date_id, gid) VALUES ($user_id, $date_id, $gid) \";\r\n\r\n\treturn mysql_query($query,$conn);\r\n\r\n\r\n\r\n}", "public function run()\n {\n DB::table('reservations')->insert([\n 'client_id' => 1,\n 'storage_spot_id' => 1,\n 'type_vehicle' => 2,\n 'from_when' => date_create(),\n 'until_when' => date_create(),\n 'agenda_from' => date_create(),\n 'agenda_until' => date_create()\n ]);\n }", "function __construct($month)\n\t{\n\t\tforeach ($month as $date)\n\t\t{\n\t\t\t\n\t\t\t$this->schema[$date][0] = ShiftFactory::createShift($date , 0);\n\t\t\t$this->schema[$date][1] = ShiftFactory::createShift($date , 1);\n\t\t\t$this->schema[$date][2] = ShiftFactory::createShift($date , 2);\n\t\t\t$this->schema[$date][3] = ShiftFactory::createShift($date , 3);\n\t\t\t\n\t\t}\n\t}", "private function saveRepeatWeekly(){\n if( isset($this->settings['weekday_index']) && !empty($this->settings['weekday_index']) ){\n foreach( $this->settings['weekday_index'] AS $dayIndex ){\n Loader::db()->Execute(\"INSERT INTO SchedulizerEventRepeat (eventID, repeatWeekday) VALUES (?,?)\", array(\n $this->eventObj->getEventID(), $dayIndex\n ));\n }\n }\n }", "public function run()\n {\n DB::table('tgf_hora_dia')->insert([\n ['hor_inicio' => '07:15', 'hor_fin' => '08:00'], // 1\n ['hor_inicio' => '08:00', 'hor_fin' => '09:00'], // 2\n ['hor_inicio' => '09:00', 'hor_fin' => '10:00'], // 3\n ['hor_inicio' => '10:00', 'hor_fin' => '11:00'], // 4\n ['hor_inicio' => '11:00', 'hor_fin' => '12:00'], // 5\n ['hor_inicio' => '12:00', 'hor_fin' => '13:00'], // 6\n ['hor_inicio' => '13:00', 'hor_fin' => '14:00'], // 7\n ['hor_inicio' => '14:00', 'hor_fin' => '15:00'], // 8\n ['hor_inicio' => '15:00', 'hor_fin' => '16:00'], // 9\n ['hor_inicio' => '16:00', 'hor_fin' => '17:00'], // 10\n ['hor_inicio' => '17:00', 'hor_fin' => '18:00'], // 11\n ['hor_inicio' => '18:00', 'hor_fin' => '19:00'], // 12\n ['hor_inicio' => '19:00', 'hor_fin' => '20:00'], // 13\n ['hor_inicio' => '20:00', 'hor_fin' => '21:00'], // 14\n ['hor_inicio' => '21:00', 'hor_fin' => '22:00'] // 15\n ]);\n }", "public function run()\n {\n //\n DB::table('Reservation')->insert([\n 'resSerial' => 1,\n 'periodSerial' => 1,\n 'isWeekday' => true,\n 'location' => 'Taipei',\n 'isOn' => true,\n 'date' => '2017-07-25',\n 'endDate' => '2017-07-26',\n 'remark' => 'Nothing',\n 'categorySerial' => 2\n ]);\n \n DB::table('DoctorAndReservation')->insert([\n 'resSerial' => 1,\n 'doctorID' => 1\n ]);\n }" ]
[ "0.571908", "0.5340115", "0.52796763", "0.52718824", "0.5201995", "0.5193836", "0.5140203", "0.5128383", "0.5077591", "0.5018783", "0.4997183", "0.49969497", "0.4958663", "0.4953279", "0.494099", "0.4931952", "0.49304944", "0.4914554", "0.49121016", "0.49108258", "0.49098873", "0.48848444", "0.48758435", "0.48744857", "0.48742297", "0.48727393", "0.48579505", "0.4856628", "0.48564973", "0.48440978", "0.4833739", "0.4828332", "0.48274016", "0.48185495", "0.48136693", "0.4801361", "0.4797733", "0.47901633", "0.47889787", "0.47703478", "0.47689855", "0.4767764", "0.47659644", "0.47472805", "0.47424787", "0.4735466", "0.47303087", "0.4714988", "0.470367", "0.46792364", "0.4677181", "0.46631342", "0.4660441", "0.46577913", "0.46530294", "0.46333846", "0.46320486", "0.46305996", "0.46304148", "0.46200928", "0.46084747", "0.46048635", "0.46038437", "0.45890006", "0.458604", "0.45843318", "0.4584316", "0.4579503", "0.45763335", "0.45762613", "0.45744488", "0.45693535", "0.45630586", "0.455645", "0.45562991", "0.45523214", "0.453559", "0.45350093", "0.45302755", "0.45294926", "0.45268857", "0.4519045", "0.45172992", "0.4517078", "0.45168602", "0.451484", "0.45135635", "0.4510081", "0.45069277", "0.44981253", "0.4497579", "0.4488284", "0.4486279", "0.44835916", "0.44810015", "0.4479402", "0.44723484", "0.44663414", "0.4462071", "0.4459392", "0.4454869" ]
0.0
-1
Clone a git repository.
public static function cloneRepo($repo, $path, $initSubModules = false) { $cloneCmd = sprintf(self::CLONE_CMD_TMPL, $repo, $path); passthru($cloneCmd); if ($initSubModules) { self::initSubmodules($path); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function gitClone()\n\t{\n\t\t$repoURL = 'https://github.com/' . $this->getUserName() . '/' . $this->getProjectName() . '.git';\n\t\t$path = $this->getPath();\n\t\t$this->gitWrapper->clone($repoURL, $path);\n\t}", "function git_clone($repo, $path, $initSubModules = false) {\n\tGitUtil::cloneRepo($repo, $path, $initSubModules);\n}", "public function cloneGitRepo($repo, $dir);", "public function cloneRepo($repo)\n {\n return $this->passthru('git', ['clone', '[email protected]:' . $repo]);\n }", "public function gitCloneRepositories() {\n\t\t$count = 0;\n\n\t\t$packages = $this->Package->find('list');\n\t\tforeach ($packages as $id => $name) {\n\t\t\t$this->out(sprintf(__(\"* Downloading package %s\"), $name));\n\t\t\tif ($this->Package->setupRepository($id)); {\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\t\t$this->out(sprintf(__('* Downloaded %s of %s repositories'), $count, count($packages)));\n\t}", "public function cloneRepository();", "public function cloneRepository($url, $directory = NULL, array $params = NULL)\n\t\t{\n\t\t\tif ($directory !== NULL && is_dir(\"$directory/.git\")) {\n\t\t\t\tthrow new GitException(\"Repo already exists in $directory.\");\n\t\t\t}\n\n\t\t\t$cwd = $this->runner->getCwd();\n\n\t\t\tif ($directory === NULL) {\n\t\t\t\t$directory = Helpers::extractRepositoryNameFromUrl($url);\n\t\t\t\t$directory = \"$cwd/$directory\";\n\n\t\t\t} elseif(!Helpers::isAbsolute($directory)) {\n\t\t\t\t$directory = \"$cwd/$directory\";\n\t\t\t}\n\n\t\t\tif ($params === NULL) {\n\t\t\t\t$params = '-q';\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t$this->run($cwd, [\n\t\t\t\t\t'clone',\n\t\t\t\t\t$params,\n\t\t\t\t\t'--end-of-options',\n\t\t\t\t\t$url,\n\t\t\t\t\t$directory\n\t\t\t\t]);\n\n\t\t\t} catch (GitException $e) {\n\t\t\t\t$stderr = '';\n\t\t\t\t$result = $e->getRunnerResult();\n\n\t\t\t\tif ($result !== NULL && $result->hasErrorOutput()) {\n\t\t\t\t\t$stderr = implode(PHP_EOL, $result->getErrorOutput());\n\t\t\t\t}\n\n\t\t\t\tthrow new GitException(\"Git clone failed (directory $directory).\" . ($stderr !== '' ? (\"\\n$stderr\") : ''));\n\t\t\t}\n\n\t\t\treturn $this->open($directory);\n\t\t}", "protected function cloneScmRepository()\n\t{\n\t\t// Get Git credentials\n\t\tif (!$this->rocketeer->hasCredentials() and !$this->rocketeer->usesSsh()) {\n\t\t\t$username = $this->command->ask('What is your SCM username ?');\n\t\t\t$password = $this->command->secret('And your password ?');\n\t\t\t$repository = $this->rocketeer->getRepository($username, $password);\n\t\t} else {\n\t\t\t$repository = $this->rocketeer->getRepository();\n\t\t}\n\n\t\t// Clone release\n\t\t$branch = $this->rocketeer->getRepositoryBranch();\n\t\treturn $this->cloneRepository($repository, $branch);\n\t}", "function do_clone($key,$url,$path) {\n $cmd = \"ssh-agent bash -c 'ssh-add $key; git clone $url $path' 2>&1\";\n _log(\"Exec command: $cmd\\n\");\n return shell_exec($cmd);\n}", "protected function cloneRepoToTempDirectory(): void {\n\t\t$this->gitRepository->clone(\n\t\t\t$this->settings->getRepoUri(),\n\t\t\t$this->settings->getTempPath(),\n\t\t\t$this->settings->getRepoBranch()\n\t\t)->removeGitConfig( $this->settings->getTempPath() . '/.git' );\n\t}", "public function cloneRepository($destination = null)\n\t{\n\t\tif (!$destination) {\n\t\t\t$destination = $this->releasesManager->getCurrentReleasePath();\n\t\t}\n\n\t\t// Executing checkout\n\t\t$this->command->info('Cloning repository in \"' .$destination. '\"');\n\t\t$output = $this->scm->execute('checkout', $destination);\n\t\t$this->history[] = $output;\n\n\t\t// Cancel if failed and forget credentials\n\t\t$success = $this->checkStatus('Unable to clone the repository', $output) !== false;\n\t\tif (!$success) {\n\t\t\t$this->server->forgetValue('credentials');\n\n\t\t\treturn false;\n\t\t}\n\n\t\t// Deploy submodules\n\t\t$this->command->info('Initializing submodules if any');\n\t\t$this->runForCurrentRelease($this->scm->submodules());\n\n\t\treturn $success;\n\t}", "protected function freshClone($branch = false, $depth = false)\n {\n $fs = new Filesystem();\n if (is_dir($this->dir)) {\n $fs->remove($this->dir);\n }\n $fs->mkdir(dirname($this->dir));\n\n $branchTerm = $branch ? \"--branch=$branch \" : '';\n $depthTerm = $depth ? \"--depth=$depth \" : '';\n exec(\"git clone '{$this->url()}' $branchTerm$depthTerm'{$this->dir}' 2>/dev/null\", $output, $result);\n\n // Fail if we could not clone.\n if ($result) {\n $project = $this->projectWithOrg();\n throw new \\Exception(\"Could not clone $project: git failed with exit code $result\");\n }\n }", "public function clone_from($source) {\n\t\t\treturn $this->run(\"clone --local $source \".$this->repo_path);\n\t\t}", "public function init() {\n $git_wrapper = new \\GitWrapper\\GitWrapper();\n if (file_exists($this->directory)) {\n $this->git = $git_wrapper->workingCopy($this->directory);\n $this->git->checkout($this->branch);\n }\n else {\n $this->git = $git_wrapper->cloneRepository($this->getRepositoryURL(), $this->directory, ['branch' => $this->branch]);\n }\n }", "public function createGit()\n {\n if($GLOBALS['TL_CONFIG']['bx_git_path'])\n {\n $gitPath = TL_ROOT.$GLOBALS['TL_CONFIG']['bx_git_path'];\n }else{\n $gitPath = TL_ROOT.\"/\";\n }\n\n $git = new GitPhp\\GitRepository($gitPath);\n $git->init()->execute();\n \n //Set Remote\n $url = explode(\"://\", $GLOBALS['TL_CONFIG']['bx_git_host_url']);\n $git->remote()->setUrl('origin', $url[0].\"://\".$GLOBALS['TL_CONFIG']['bx_git_host_user'].\":\".$GLOBALS['TL_CONFIG']['bx_git_host_pass'].\"@\".$url[1]);\n }", "function rclone() {\n\t\t$this->checkOnce();\n\t\t$versionPath = $this->getVersionPath();\n\t\t$paths = $this->getMain()->getPaths();\n\t\t$default = $paths['default'];\n\t\t$remoteCmd = 'cd '.$versionPath.' && hg clone '.$default .' .';\n\t\t$this->ssh_exec($remoteCmd);\n\t}", "private function _fetchGitRepository($url, $ref = 'master')\n\t{\n\t\t// Create a Git repository object within the system tmp folder for the url.\n\t\t$root = sys_get_temp_dir() . md5($url);\n\n\t\t// If the folder doesn't exist attempt to create it.\n\t\tif (!is_dir($root))\n\t\t{\n\t\t\tmkdir($root, 0777, true);\n\t\t}\n\n\t\t// Instantiate the repository object.\n\t\t$repo = new PackagerGitRepository($root);\n\n\t\t// Only clone the repository if it doesn't exist.\n\t\tif (!$repo->exists())\n\t\t{\n\t\t\t$repo->create();\n\t\t}\n\n\t\t// Get a clean checkout of the branch/tag required.\n\t\t$repo->fetch()\n\t\t\t->branchCheckout($ref)\n\t\t\t->clean();\n\n\t\treturn $root;\n\t}", "public function cloneRepository(Server $server, Application $application)\n {\n try {\n $this->getUser();\n\n $server->exec(\n view('scripts.deployments.bitbucket-deployment', [\n 'application' => $application,\n 'access_token' => $this->sourceProvider->access_token\n ])->render()\n ); \n } catch (ClientException $e) {\n if ($e->getResponse()->getStatusCode() === 401) {\n if ($this->retries <= $this->maxRetries) {\n $this->retries = $this->retries + 1;\n $this->refreshToken();\n }\n }\n }\n }", "public static function &clone_remote($repo_path, $remote, $reference = null) {\n\t\t\treturn GitRepo::create_new($repo_path, $remote, true, $reference);\n\t\t}", "public function cloneAndConfig()\n {\n if (! is_dir($this->directory)) {\n try {\n $this->git->cloneRepository()->execute($this->repo_url);\n $this->git->remote()->add(\n $this->client_remote,\n $this->client_remote_url\n )->execute();\n\n $this->git->fetch()->execute($this->client_remote);\n\n if (! file_put_contents($this->config_file,\n $this->user_config, FILE_APPEND)) {\n $this->logger->error('Can\\'t write Git config file');\n }\n } catch (GitException $e) {\n $this->logger->error('Failed to clone or config Git repository. '\n . 'Error: ' . $e->getMessage());\n }\n }\n }", "public static function open($repo_path) {\n\t\t\treturn new GitRepo($repo_path);\n\t\t}", "public function create($remote = 'http://github.com/joomla/joomla-platform.git')\n\t{\n\t\t// Initialize variables.\n\t\t$out = array();\n\t\t$return = null;\n\n\t\t// We add the users repo to our remote list if it isn't already there\n\t\tif (!file_exists($this->_root . '/.git'))\n\t\t{\n\t\t\t// Execute the command.\n\t\t\texec('git clone -q ' . escapeshellarg($remote) . ' ' . escapeshellarg($this->_root), $out, $return);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new InvalidArgumentException('Repository already exists at ' . $this->_root . '.');\n\t\t}\n\n\t\t// Validate the response.\n\t\tif ($return !== 0)\n\t\t{\n\t\t\tthrow new RuntimeException(sprintf('The clone failed from remote %s with code %d and message %s.', $remote, $return, implode(\"\\n\", $out)));\n\t\t}\n\n\t\treturn $this;\n\t}", "public static function &create($repo_path, $source = null) {\n\t\t\treturn GitRepo::create_new($repo_path, $source);\n\t\t}", "public static function &create_new($repo_path, $source = null, $remote_source = false, $reference = null) {\n\t\t\tif (is_dir($repo_path) && file_exists($repo_path.\"/.git\") && is_dir($repo_path.\"/.git\")) {\n\t\t\t\tthrow new Exception('\"'.$repo_path.'\" is already a git repository');\n\t\t\t} else {\n\t\t\t\t$repo = new self($repo_path, true, false);\n\t\t\t\tif (is_string($source)) {\n\t\t\t\t\tif ($remote_source) {\n\t\t\t\t\t\tif (!is_dir($reference) || !is_dir($reference.'/.git')) {\n\t\t\t\t\t\t\tthrow new Exception('\"'.$reference.'\" is not a git repository. Cannot use as reference.');\n\t\t\t\t\t\t} else if (strlen($reference)) {\n\t\t\t\t\t\t\t$reference = realpath($reference);\n\t\t\t\t\t\t\t$reference = \"--reference $reference\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$repo->clone_remote($source, $reference);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$repo->clone_from($source);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$repo->run('init');\n\t\t\t\t}\n\t\t\t\treturn $repo;\n\t\t\t}\n\t\t}", "public function getGitCloneLocation()\n {\n return $this->gitCloneLocation;\n }", "private function syncRepository()\n {\n $cwd = '/tmp/'.$this->migrationId;\n (new ProcessBuilder(['mkdir']))->add('-p')->add($cwd)->getProcess()->mustRun();\n\n $cloneSourceCommandBuilder = new ProcessBuilder(['git', 'clone', $this->sourceProject->getSshUrlToRepo(), '.']);\n $cloneSourceCommandBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $addNewRemoteBuilder = new ProcessBuilder(['git', 'remote', 'add', 'new']);\n $addNewRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->add($this->targetProject->getSshUrlToRepo())\n ->getProcess()\n ->mustRun();\n\n $pushToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--all']);\n $pushToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $pushTagsToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--tags']);\n $pushTagsToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n }", "protected function setupGitRepo()\n {\n $td = $this->getTestDir();\n\n $this->fs->removeDirectory($td);\n $this->fs->ensureDirectoryExists($td);\n\n $currentWorkDir = getcwd();\n chdir($td);\n\n $result = $this->process->execute(\"git init -q\");\n if ($result > 0) {\n throw new \\RuntimeException(\n \"Could not init: \" . $this->process->getErrorOutput());\n }\n $result = file_put_contents('b', 'a');\n if (false === $result) {\n throw new \\RuntimeException(\"Could not save file.\");\n }\n $result = $this->process->execute(\"git add b && git commit -m 'commit b' -q\");\n if ($result > 0) {\n throw new \\RuntimeException(\n \"Could not init: \" . $this->process->getErrorOutput());\n }\n chdir($currentWorkDir);\n }", "public function testGitLabRemoteRepository(): void\n {\n $repo = new GitLabRemoteRepository('r/r', './');\n $this->assertEquals('https://gitlab.com/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "final private function __clone() {}", "final private function __clone() {}", "final private function __clone() {}", "final private function __clone() {}", "private function createRepository()\n {\n $this->output->write('Creating repository... ');\n\n try {\n $versionControlRepository = ($this->config->scm->type == 'gitlab') ?\n new VersionControlRepositoryGitLab($this->config) : new VersionControlRepositoryGitHub($this->config);\n $versionControlRepository->create($this->project);\n\n $this->output->writeln('<info>OK</info>');\n } catch (\\Exception $e) {\n $message = 'Error: '. $e->getMessage();\n $this->output->writeln('<error>'. $message .'</error>');\n throw new \\RuntimeException($message);\n }\n }", "protected function getRepository() {\n\t\tif ($this->_repository === null) {\n\t\t\t$this->_repository = new AGitRepository();\n\t\t\t$this->_repository->setPath($this->path,true,true);\n\t\t\t$this->assertTrue(file_exists($this->path));\n\t\t}\n\t\treturn $this->_repository;\n\t}", "public function cloneIfNecessary($branch = false, $depth = false)\n {\n // If the directory exists, we have already validated that it points\n // at the correct repository.\n if (!is_dir($this->dir)) {\n $this->freshClone($branch, $depth);\n }\n // Make sure that we are on 'master' (or the specified branch) and up-to-date.\n $branchTerm = $branch ?: 'master';\n exec(\"git -C '{$this->dir}' reset --hard 2>/dev/null\", $output, $result);\n exec(\"git -C '{$this->dir}' checkout $branchTerm 2>/dev/null\", $output, $result);\n exec(\"git -C '{$this->dir}' pull origin $branchTerm 2>/dev/null\", $output, $result);\n }", "public function clone_remote($source, $reference) {\n\t\t\treturn $this->run(\"clone $reference $source \".$this->repo_path);\n\t\t}", "public function clone_to($target) {\n\t\t\treturn $this->run(\"clone --local \".$this->repo_path.\" $target\");\n\t\t}", "public function createReference($repository) { \n if ( $repository->exists() ) {\n throw new GitBackendException('Repository already exists');\n } \n $path = $repository->getPath();\n //create git root if does not exist\n $this->createGitRoot();\n //create project dir if does not exists\n $this->createProjectRoot($repository);\n $path = $this->getGitRootPath().DIRECTORY_SEPARATOR.$path;\n mkdir($path, 0770, true);\n chdir($path);\n $this->getDriver()->init($bare=true);\n\n return $this->setUpRepository($repository);\n }", "final private function __clone() { }", "final private function __clone() { }", "public function getGitRepository(): string\n {\n return 'https://github.com/Sylius/Sylius.git';\n }", "public function __clone();", "public function __clone();", "public function setRepository($var)\n {\n GPBUtil::checkString($var, True);\n $this->repository = $var;\n\n return $this;\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() {}", "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() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "function do_clone_or_pull($key, $url, $path, $operation) {\n // Already a git repo there. Do a pull.\n if ((is_dir($path)) && (file_exists($path . \"/.git\"))) {\n\tif($operation==\"TAG\"){\n\t\treturn do_fetch($key,$url,$path);\n\t}\n\telse{\n\t\treturn do_pull($key,$url,$path);\n\t}\n }\n \n // Try a clone\n $out = do_clone($key,$url,$path);\n if (!is_dir($path)) {\n $out .= \"\\nClone appeared to fail.\\n\";\n }\n return $out;\n}", "protected function makeRepository()\n {\n if ($this->files->exists($path = $this->getRepositoryPath())) {\n return $this->error($this->className . ' already exists!');\n }\n $this->makeDirectory($path);\n $this->files->put($path, $this->compileRepositoryStub());\n $this->info('Repository created successfully.');\n }", "private function __clone()\r\n {}", "protected function pull()\n {\n $local_repo = $this->getLocalRepoPath();\n if (!is_dir($local_repo))\n {\n if(!mkdir($local_repo, 0777, true))\n {\n throw new Exception('Could not create directory '.$local_repo);\n }\n $this->execute('clone', array($this->getRemoteScmUrl(), $local_repo));\n }\n else\n {\n $cwd = getcwd();\n chdir($local_repo);\n $this->execute('pull', array(), array());\n chdir($cwd);\n }\n }", "protected function createRepository()\n {\n $repositoryOptions = [\n 'repository' => $this->info['repositoryName'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'parent',\n 'uploads',\n 'data',\n 'int',\n 'float',\n 'bool',\n ]);\n\n $this->call('engez:repository', array_merge($repositoryOptions, $options));\n }", "public static function getCloneUrl($module_name) {\n\n $module_path = conf::pathModules() . \"/$module_name\";\n if (!file_exists($module_path)) {\n common::echoStatus('NOTICE', 'y', \"module $module_name has no module source\");\n return false;\n }\n\n $command = \"cd $module_path && git config --get remote.origin.url\";\n $ret = common::execCommand($command, array('silence' => 1), 0);\n if ($ret == 0) {\n $git_url = shell_exec($command);\n return trim($git_url);\n }\n return false;\n }", "public function setGitCloneLocation($gitCloneLocation)\n {\n $this->gitCloneLocation = $gitCloneLocation;\n\n return $this;\n }", "final public function __clone() {}", "public function repository(string $targetPath, string $repoUrl): VcsRepository\n {\n if (preg_match(\"/^mock\\@(.*)$/\", $repoUrl, $matches)) {\n if (!DEV_MODE) {\n throw new InvalidArgumentException(\"Mock repositories '$repoUrl' are allowed only in dev-mode\");\n }\n return new MockVcsRepository($matches[1], $targetPath);\n }\n if (preg_match(\"/^(?<user>[a-z0-9_\\-]+)@(?<host>[a-z0-9\\-\\.]+)\\:(?<path>.*?)(\\?(?<params>.*))?$/\", $repoUrl, $matches)) {\n if (isset($matches[\"params\"])) {\n $opts = phore_parse_url($repoUrl);\n\n // Load the key from file\n $sshKeyFile = $opts->getQueryVal(\"ssh_priv_key_file\", null);\n if ($sshKeyFile !== null) {\n $this->sshPrivKey = phore_file($sshKeyFile)->get_contents();\n }\n\n // Load the key directly from parameter\n $sshKey = $opts->getQueryVal(\"ssh_priv_key\", null);\n if ($sshKey !== null) {\n $this->sshPrivKey = $sshKey;\n }\n }\n\n $url = $matches[\"user\"] . \"@\" . $matches[\"host\"] . \":{$matches[\"path\"]}\";\n\n return new SshGitRepository($url, $targetPath, $this->commitUserName, $this->commitEmail, $this->sshPrivKey);\n }\n if (preg_match(\"/^https.*$/\", $repoUrl)) {\n $opts = phore_parse_url($repoUrl);\n\n // Load the key from file\n $authUser = $opts->getQueryVal(\"auth_user\", null);\n if ($authUser !== null) {\n $this->gitUser = $opts->getQueryVal(\"auth_user\");\n }\n\n // Load the key directly from file\n $passFile = $opts->getQueryVal(\"auth_pass_file\", null);\n if ($passFile !== null) {\n $this->gitPassword = phore_file($passFile)->get_contents();\n }\n\n // Load the key directly from parameter\n $pass = $opts->getQueryVal(\"auth_pass\", null);\n if ($pass !== null) {\n $this->gitPassword = $pass;\n }\n\n $urlWithoutOpts = $opts->withQueryParams();\n\n return new HttpsGitRepository((string)$urlWithoutOpts, $targetPath, $this->commitUserName, $this->commitEmail, $this->gitUser,$this->gitPassword);\n }\n throw new InvalidArgumentException(\"Cannot determine repository type: $repoUrl\");\n }", "public function clone()\n {\n Az::debug($this->newName, 'cloning directories');\n $this->load(self::mode['clone']);\n\n $this->appCopy();\n\n // updating /service/ALL/App.php and\n // launch norms\n Az::$app->smart->service->serviceAdd($this->newName);\n\n Az::debug($this->newName, 'cloning DB & tables');\n $this->createDb();\n\n Az::debug($this->newName, 'excuting insert apply cmd');\n $this->insertCreateFunc();\n $this->insertCloneFolder();\n $this->insertApplyFunc();\n $this->fillDb();\n\n Az::debug($this->newName, 'excuting page run cmd');\n $this->callPageRunCmd();\n\n Az::debug($this->newName, 'adding domain name into hosts');\n $this->addDomainNameIntoHosts();\n\n Az::debug($this->newName, 'updating nginx');\n $this->updateNgnix(false);\n }", "function __clone()\n {\n\t\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() { }", "private function __clone() { }", "final private function __clone()\n {\n }", "final private function __clone()\n {\n }", "protected static function getGitWrapper() {\n\t\t$dir = self::getGitDir();\n\t\tif ( !self::$git ) {\n\t\t\tself::$git = new GitWrapper();\n\n\t\t\t$extDir = MediaWikiServices::getInstance()->getMainConfig()->get( \"ExtensionDirectory\" );\n\t\t\tself::$git->setEnvVar( \"PERL5LIB\", \"$extDir/MABS/lib/mediawiki-git-remote/lib:\"\n\t\t\t\t\t\t\t\t . \"$extDir/MABS/lib/mediawiki-git-remote/localcpan\" );\n\t\t\tself::$git->setEnvVar( \"GIT_EXEC_PATH\", \"$extDir/MABS/lib/mediawiki-git-remote:\"\n\t\t\t\t\t\t\t\t . \"/usr/lib/git-core\" );\n\t\t\tself::$git->setEnvVar( \"GIT_MW_DEBUG\", \"1\" );\n\t\t\tself::$git->setEnvVar( \"GIT_TRACE\", \"0\" );\n\t\t\tif ( !chdir( $dir ) ) {\n\t\t\t\tthrow new ErrorPageError( \"mabs-system-error\", \"mabs-no-chdir\", $dir );\n\t\t\t}\n\t\t}\n\t\treturn self::$git->workingCopy( $dir );\n\t}", "function __clone()\n {\n }", "function __clone()\n {\n }", "public function __clone() {}", "public function __clone() {}", "public function __clone() {}" ]
[ "0.8578925", "0.795135", "0.7878203", "0.7335249", "0.6966539", "0.69380933", "0.6843903", "0.66874427", "0.6276409", "0.62629807", "0.6205684", "0.61906266", "0.6131012", "0.61304164", "0.6081793", "0.60349464", "0.59183985", "0.57594395", "0.5751796", "0.5695916", "0.56346375", "0.5566067", "0.54633844", "0.5459396", "0.54396176", "0.5346841", "0.5307172", "0.5303704", "0.5252917", "0.5252917", "0.5252917", "0.5252917", "0.5252169", "0.52350986", "0.52311856", "0.5217535", "0.5214418", "0.5202631", "0.51879513", "0.51879513", "0.51750654", "0.5171942", "0.5171942", "0.51662976", "0.5152476", "0.5152476", "0.5152476", "0.5152476", "0.5152476", "0.5152476", "0.5152476", "0.5152476", "0.5152476", "0.5152476", "0.5152476", "0.5152476", "0.5152476", "0.5152476", "0.5152476", "0.5152476", "0.5152476", "0.5152476", "0.5152476", "0.5152476", "0.5152476", "0.5152476", "0.5152476", "0.5152476", "0.5152476", "0.51317227", "0.5129162", "0.5121222", "0.51203555", "0.50887567", "0.5073108", "0.50564957", "0.5049299", "0.50362647", "0.5035627", "0.50247395", "0.5018008", "0.50160515", "0.5015868", "0.5015868", "0.5015868", "0.5015868", "0.5015868", "0.5015868", "0.5015868", "0.5015868", "0.5015868", "0.5015868", "0.50155777", "0.50155777", "0.49999937", "0.49963358", "0.49963358", "0.49931073", "0.49931073", "0.49931073" ]
0.64750063
8
Commit all pending changes in a repository.
public static function commit($repo, $msg) { $cmds =[ String(self::ADD_ALL), String(self::COMMIT_CMD)->format($msg) ]; return self::doInDir($repo, $cmds); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function commitAndPush()\n {\n try {\n // Add files to git index, commit and push to client remote\n $this->git->add()->all()->execute();\n $this->git->commit()->message($this->commit_msg)->execute();\n $this->git->push()->execute($this->client_remote, $this->branch);\n } catch (GitException $e) {\n $this->logger->error('Failed to commit to Git repository. Error: '\n . $e->getMessage());\n }\n }", "public function testCommit() {\n\t\t$repo = $this->getRepository();\n\t\t$repo->commit(\"test\"); // make sure there are no hidden changes\n\t\t$this->assertFalse($repo->commit(\"test\")); // no changes, should fail\n\t\t$files = $this->getFiles();\n\t\tforeach($files as $file) {\n\t\t\t$repo->add($this->path.\"/\".$file);\n\t\t\tfile_put_contents($this->path.\"/\".$file,uniqid());\n\t\t}\n\t\t$commitMessage = \"Test Commit: \".uniqid();\n\t\t$response = $repo->commit($commitMessage,true);\n\n\t\t$this->assertTrue(is_array($response));\n\t\tforeach($this->getFiles() as $file) {\n\t\t\t$this->assertTrue(isset($response[$file]));\n\t\t}\n\t}", "public function commit(): void\n {\n if ($this->transactions == 1) {\n $this->call('commit');\n }\n\n $this->transactions = max(0, $this->transactions - 1);\n }", "private function do_commit_post()\n {\n // so will re-run 'porcelain' to get a list of files. We'll only 'git add'\n // any files supplied by the user that are in the list we get from porcelain\n // we'll then go ahead and commit them with the message supplied\n require_once 'Git-php-lib';\n $repo = Git::open('.');\n $status = $repo->porcelain();\n $git_files = array();\n foreach($status as $item) {\n $git_files[$item['file']] = $item['y'];\n }\n\n $to_add = array();\n $to_rm = array();\n foreach($_REQUEST['file'] as $requested_file) {\n if(array_key_exists($requested_file, $git_files)) {\n if($git_files[$requested_file] == 'D') {\n $to_rm[] = $requested_file;\n } else {\n $to_add[] = $requested_file;\n }\n }\n }\n\n $add_output = '';\n if(count($to_add) > 0) {\n try {\n $add_output = $repo->add($to_add);\n }\n catch(Exception $e) {\n $add_output = 'Failed to run git-add: ' . $e->getMessage();\n }\n }\n #$add_output = preg_replace('/\\r?\\n\\r?/', \"<br>\\n\", $add_output);\n if(count($to_rm) > 0) {\n $rm_output = '';\n try {\n $rm_output = $repo->rm($to_rm);\n }\n catch(Exception $e) {\n $rm_output = 'Failed to run git-rm: ' . $e->getMessage();\n }\n }\n\n $commit_output = '';\n try {\n $commit_output = $repo->commit($_REQUEST['message'], false);\n }\n catch(Exception $e) {\n $commit_output = 'Failed to run git-commit: ' . $e->getMessage();\n }\n #$commit_output = preg_replace('/\\r?\\n\\r?/', \"<br>\\n\", $add_output);\n\n if(file_exists('./plugins/pico_edit/commitresponse.html')) {\n $loader = new Twig_Loader_Filesystem('./plugins/pico_edit');\n $twig = new Twig_Environment($loader, array('cache' => null));\n $twig->addExtension(new Twig_Extension_Debug());\n $twig_vars = array(\n 'add' => $add_output,\n 'rm' => $rm_output,\n 'commit' => $commit_output,\n );\n $content = $twig->render('commitresponse.html', $twig_vars);\n die($content);\n } else {\n die('Sorry, commitresponse.html was not found in the backend plugin. This is an installation problem.');\n }\n }", "abstract protected function commit_changes($changes);", "public function commit(): void\n {\n $this->eventDispatcher->dispatchPreFlush();\n\n if (\n $this->objectsToPersist === [] &&\n $this->objectsToUpdate === [] &&\n $this->objectsToRemove === []\n ) {\n return; // Nothing to do.\n }\n\n $objects = array_merge(\n $this->objectsToPersist,\n $this->objectsToUpdate,\n $this->objectsToRemove,\n );\n $this->eventDispatcher->dispatchPreFlushLifecycleCallbacks($objects);\n\n $this->eventDispatcher->dispatchOnFlush();\n\n $this->persister->executePersists();\n $this->persister->executeUpdates();\n $this->persister->executeRemoves();\n\n $this->eventDispatcher->dispatchPostFlush();\n\n $this->objectsToPersist = [];\n $this->objectsToUpdate = [];\n $this->objectsToRemove = [];\n $this->objectChangeSets = new ChangeSets();\n }", "public static function commit()\n {\n }", "function _versioncontrol_git_log_update_repository(&$repository) {\n $root = escapeshellcmd($repository['root']);\n $chdir_ok = @chdir($root); // Set working directory to root.\n if ($chdir_ok === FALSE) {\n return FALSE;\n }\n if ($repository['git_specific']['locked'] == TRUE) {\n drupal_set_message(t('This repository is locked, there is already a fetch in progress. If this is not the case, press the clear lock button.'), 'error');\n return FALSE;\n }\n db_query('UPDATE {versioncontrol_git_repositories}\n SET locked = 1 WHERE repo_id = %d', $repository['repo_id']);\n\n // Get the list of current branches from Git.\n $branch_list = _versioncontrol_git_log_get_branches();\n $add_branch_label = array(\n 'name' => '', //filled later\n 'type' => VERSIONCONTROL_OPERATION_BRANCH,\n 'action' => VERSIONCONTROL_ACTION_MODIFIED\n );\n $branches = array();\n foreach ($branch_list as $branch_name) {\n $add_branch_label['name'] = $branch_name;\n $label_ret = versioncontrol_ensure_label($repository, $add_branch_label);\n $branches[$branch_name] = $label_ret;\n }\n //jpetso and me (corni) came to the conclusion that we will not delete branches.\n // TODO: revisit this!\n // Record new commits.\n $constraints = array(\n 'vcs' => array('git'),\n 'repo_ids' => array($repository['repo_id']),\n 'types' => array(VERSIONCONTROL_OPERATION_COMMIT),\n 'branches' => array() // used in the loop\n );\n $branches_per_commit = array();\n $existing_revs = array();\n // Get the existing revisions from the cache.\n $cache_object = cache_get('versioncontrol_git_rev_cache');\n // Check wether the cache object exists or not.\n if (is_object($cache_object)) {\n $existing_revs = $cache_object->data;\n }\n // Get the list of current branches from Git.\n // Generate the range per branch with which git shall be called.\n foreach ($branches as $branch_name => $label) {\n if (is_object($cache_object)) {\n // We get all commits we have in this branch to not process them later.\n $constraints['branches'] = array($branch_name);\n $latest_commit_date = 0;\n $commit_op = versioncontrol_get_operations($constraints);\n $latest_commit = FALSE;\n foreach ($commit_op as $vc_op_id => $c_op) {\n if ($latest_commit_date < $c_op['date']) {\n $latest_commit = $c_op['revision'];\n $latest_commit_date = $c_op['date'];\n $existing_revs[$branch_name][$latest_commit] = TRUE;\n }\n }\n }\n // No way to free the damned mysql result!!\n unset($commit_op);\n\n $commits_in_branch = _versioncontrol_git_log_get_commits_in_branch($repository, escapeshellarg($branch_name));\n foreach ($commits_in_branch as $i => $commit) {\n if (!isset($existing_revs[$branch_name][$commit])) {\n if (!isset($branches_per_commit[$commit]) || !is_array($branches_per_commit[$commit])) {\n $branches_per_commit[$commit] = array($label);\n }\n else {\n $branches_per_commit[$commit][] = $label;\n }\n }\n }\n }\n // This uses an extra loop on purpose!\n // Process all commits on a per-branch base.\n foreach ($branches_per_commit as $revision => $branch) {\n // Update commits from Git.\n _versioncontrol_git_process_commits($repository, $revision, $branches_per_commit, $existing_revs);\n }\n // Check tags.\n $tags = _versioncontrol_git_log_get_tags(); //Now we have the current list of tags as array of strings.\n $constraints = array(\n 'vcs' => array('git'),\n 'repo_ids' => array($repository['repo_id']),\n 'types' => array(VERSIONCONTROL_OPERATION_TAG)\n );\n $existing_tag_ops = versioncontrol_get_operations($constraints);\n $existing_tags = array();\n foreach ($existing_tag_ops as $tag_op) {\n if (!in_array($tag_op['labels'][0]['name'], $existing_tags)) {\n $existing_tags[] = $tag_op['labels'][0]['name'];\n }\n }\n // Deleting tags is *not* supported. Read the manual if you want to know why...\n // Check for new tags.\n $new_tags = array_diff($tags, $existing_tags);\n if (!empty($new_tags)) {\n _versioncontrol_git_process_tags($repository, $new_tags);\n }\n\n // Update repository updated field. Displayed on administration interface for documentation purposes.\n $repository['git_specific']['updated'] = time();\n db_query('UPDATE {versioncontrol_git_repositories}\n SET updated = %d, locked = 0 WHERE repo_id = %d',\n $repository['git_specific']['updated'], $repository['repo_id']);\n\n // Write back the cache.\n cache_set('versioncontrol_git_rev_cache', $existing_revs);\n return TRUE;\n}", "private function commitAll(): void\n {\n while ($this->transactionNestingLevel !== 0) {\n if ($this->autoCommit === false && $this->transactionNestingLevel === 1) {\n // When in no auto-commit mode, the last nesting commit immediately starts a new transaction.\n // Therefore we need to do the final commit here and then leave to avoid an infinite loop.\n $this->commit();\n\n return;\n }\n\n $this->commit();\n }\n }", "public function commit()\r\n {\r\n if ($this->_txns == 1) {\r\n $this->getMaster()->commit();\r\n }\r\n --$this->_txns;\r\n }", "public function commit()\n {\n $this->getActivePdo()->commit();\n }", "public function commit($messages): void;", "public function updateRepository() {\n $scheduledFile = __DIR__ . '/scheduled.txt';\n if (!file_exists($scheduledFile))\n return;\n\n $requested = file_get_contents($scheduledFile);\n if (!unlink($scheduledFile))\n return;\n\n if ((time() - intval(trim($requested))) > 600)\n return;\n\n $commands = [\n // Updates the local copy of the repository with the most recent remote changes.\n 'git fetch --all',\n\n // Resets the repository to the state the remote currently is in.\n 'git reset --hard origin/master',\n\n // Remove any left-over files that are not part of the checkout, and not in .gitignore.\n 'git clean -f -d',\n\n // Write the latest commit SHA to the VERSION file.\n 'git rev-parse HEAD > VERSION',\n ];\n\n $directory = realpath(__DIR__ . '/../../../');\n\n foreach ($commands as $command)\n Info(trim(shell_exec('cd ' . $directory . ' && ' . $command . ' 2>&1')));\n\n Info('AutoDeploy: Updated to revision ' . file_get_contents(__DIR__ . '/../../../VERSION') . '.');\n }", "public function commit()\n{\n\t$this->query('COMMIT');\n}", "public function commit()\n {\n if ($this->transactions == 1) {\n $this->getPdo()->commit();\n }\n\n $this->transactions--;\n }", "public function flush()\n {\n $this->unitOfWork->commit();\n }", "public function commit()\n {\n if ($this->transactions == 1) {\n $this->transaction->commit();\n }\n\n $this->transactions--;\n\n $this->fireConnectionEvent('committed');\n }", "public function commit() {\n $repo = Repo::getById($this->repoId);\n\n $commit = $repo->getCommitInformation($this->commit);\n $commit->avatar = $commit->user ? $commit->user->getProfileData('avatar') : null;\n $commit->formattedDate = date(Lang::get('main.date-format'), $commit->date);\n\n $diff = $repo->getDiff($commit->parent ? $commit->hash . '^1' : '', $commit->hash);\n\n $this->addJavaScript($this->getPlugin()->getJsUrl('commit-diff.js'));\n $this->addCss('//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.9.0/styles/monokai-sublime.min.css');\n\n $content = View::make($this->getPlugin()->getView('commits/commit.tpl'), array(\n 'repo' => $repo,\n 'commit' => $commit,\n 'diff' => $diff,\n ));\n\n return RepoController::getInstance(array(\n 'repoId' => $this->repoId\n ))\n ->display('commits', $content, Lang::get($this->_plugin . '.repo-commit-title', array(\n 'commit' => $commit->shortHash,\n 'repo' => $repo->name\n )));\n }", "public function commit()\n {\n }", "public function commit()\n {\n }", "public function commit() {}", "public function commit()\n {\n if ($this->store->transactions == 1) {\n $this->store->commit();\n }\n\n --$this->transactions;\n }", "public function commit();", "public function commit();", "public function commit();", "public function commit();", "public function commit();", "function commit(): void;", "public function commit()\n {\n $this->getConnection()->commit();\n }", "public function flushAllChanges()\r\n {\r\n $this->em->flush();\r\n }", "public function commit($entity = null)\n {\n // Compute changes done since last commit.\n if ($entity === null) {\n $this->computeChangeSets();\n } elseif (is_object($entity)) {\n $this->computeSingleEntityChangeSet($entity);\n } elseif (is_array($entity)) {\n foreach ((array)$entity as $object) {\n $this->computeSingleEntityChangeSet($object);\n }\n }\n if (!($this->entityInsertions ||\n $this->entityDeletions ||\n $this->entityUpdates ||\n $this->collectionUpdates ||\n $this->collectionDeletions ||\n $this->orphanRemovals)\n ) {\n return; // Nothing to do.\n }\n if ($this->orphanRemovals) {\n foreach ($this->orphanRemovals as $orphan) {\n $this->remove($orphan);\n }\n }\n // Now we need a commit order to maintain referential integrity\n $commitOrder = $this->getCommitOrder();\n\n // Collection deletions (deletions of complete collections)\n // foreach ($this->collectionDeletions as $collectionToDelete) {\n // //fixme: collection mutations\n // $this->getCollectionPersister($collectionToDelete->getMapping())->delete($collectionToDelete);\n // }\n if ($this->entityInsertions) {\n foreach ($commitOrder as $class) {\n $this->executeInserts($class);\n }\n }\n if ($this->entityUpdates) {\n foreach ($commitOrder as $class) {\n $this->executeUpdates($class);\n }\n }\n // Extra updates that were requested by persisters.\n if ($this->extraUpdates) {\n $this->executeExtraUpdates();\n }\n // Collection updates (deleteRows, updateRows, insertRows)\n foreach ($this->collectionUpdates as $collectionToUpdate) {\n //fixme: decide what to do with collection mutation if API does not support this\n //$this->getCollectionPersister($collectionToUpdate->getMapping())->update($collectionToUpdate);\n }\n // Entity deletions come last and need to be in reverse commit order\n if ($this->entityDeletions) {\n for ($count = count($commitOrder), $i = $count - 1; $i >= 0 && $this->entityDeletions; --$i) {\n $this->executeDeletions($commitOrder[$i]);\n }\n }\n\n // Take new snapshots from visited collections\n foreach ($this->visitedCollections as $coll) {\n $coll->takeSnapshot();\n }\n\n // Clear up\n $this->entityInsertions =\n $this->entityUpdates =\n $this->entityDeletions =\n $this->extraUpdates =\n $this->entityChangeSets =\n $this->collectionUpdates =\n $this->collectionDeletions =\n $this->visitedCollections =\n $this->scheduledForSynchronization =\n $this->orphanRemovals = [];\n }", "public static function commits(array $logs);", "private function syncRepository()\n {\n $cwd = '/tmp/'.$this->migrationId;\n (new ProcessBuilder(['mkdir']))->add('-p')->add($cwd)->getProcess()->mustRun();\n\n $cloneSourceCommandBuilder = new ProcessBuilder(['git', 'clone', $this->sourceProject->getSshUrlToRepo(), '.']);\n $cloneSourceCommandBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $addNewRemoteBuilder = new ProcessBuilder(['git', 'remote', 'add', 'new']);\n $addNewRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->add($this->targetProject->getSshUrlToRepo())\n ->getProcess()\n ->mustRun();\n\n $pushToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--all']);\n $pushToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $pushTagsToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--tags']);\n $pushTagsToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n }", "protected function commit()\n\t{\n\t\t$this->db->commit();\n\t}", "function commitChanges() {\r\n\t\tglobal $file;\r\n\t\tglobal $expenses;\r\n\r\n\t\tsortExpensesDate();\r\n\t\trenumber(&$expenses);\r\n\r\n\t\t$xmlString = toXML();\r\n\r\n\t\t$fp = fopen($file.\".bak\", \"w\");\r\n\t\tflock($fp, LOCK_EX);\r\n\t\tfputs($fp, $xmlString);\r\n\t\tflock($fp, LOCK_UN);\r\n\t\tfclose($fp);\r\n\r\n\t\tswapFiles();\r\n\t}", "protected function commit(array $ranks): void\n {\n $this->ranks = $ranks;\n\n $this->save();\n }", "public function commit() {\n\t\t$this->execute(\"COMMIT; SET autocommit = 1;\");\n\t}", "protected function commit() {\n $this->get_search_client()->commit();\n }", "function commit() {\n\t\t\tself::$db->commit();\n\t\t\t$this->begin_executed = false;\n\t\t}", "public function insCommits($project_key)\n {\n $table = 'git_commits_' . $project_key;\n $issue_table = 'issue_' . $project_key;\n\n $commits = $this->getCommits();\n foreach($commits as $commit)\n {\n $new_commit = $this->arrangeCommit($commit);\n\n $issue_data = $this->relateIssue($project_key, $new_commit['message']);\n if ($issue_data === false)\n {\n continue;\n }\n $issue_no = $issue_data['no'];\n $action = $issue_data['action'];\n\n $issue = DB::collection($issue_table)->where('no', $issue_no)->where('del_flg', '<>', 1)->first();\n if (!$issue)\n {\n return;\n }\n\n // insert the commit to issue \n DB::collection($table)->insert($new_commit + [ 'issue_id' => $issue['_id']->__toString() ]);\n // transimit the issue status\n if ($action > 0 && isset($new_commit['author']['id']) && $new_commit['author']['id'])\n {\n $this->execWorkflow($project_key, $issue, $action, $new_commit['author']['id']);\n }\n }\n return;\n }", "public function applyChanges()\n {\n $em = $this->doctrine->getManager();\n $em->flush();\n\n // TODO: Can we be sure that the changes are available in the DB now?\n $ch = $this->getMasterRabbit()->channel();\n $msg = new AMQPMessage(\"sync\");\n $ch->basic_publish($msg, \"\", $this->name . \"_master\");\n }", "public function commit($vendor, $bundle) {\n $items = $this->repo->findBy(array(\n 'vendor' => $vendor,\n 'bundle' => $bundle,\n 'commit' => $this->translationManager->getCurrentCommit($vendor . $bundle)\n )\n );\n\n $commit = $this->translationManager->getCurrentCommit($vendor . $bundle);\n $this->log('Commiting ' . count($items) . ' translations...');\n $data = $this->serializeForCommit($items);\n $this->buildFilesToCommit($data, $vendor, $bundle);\n $workingDir = $this->gitDirectory . $vendor . $bundle;\n $branch = 'translations-' . $commit;\n chdir($workingDir);\n $this->log('git checkout ' . $branch);\n exec('git checkout ' . $branch);\n $this->log('git add .'); \n exec('git add .');\n $this->log('git commit -m \"translations from claroline.net\"');\n exec('git commit -m \"translations from claroline.net\"');\n $this->log('git push origin ' . $branch);\n exec('git push origin ' . $branch);\n }", "public function committed();", "function commit();", "function commit() ;", "public function updateGitHooks()\n {\n $tasks = [];\n $hooks = ['pre-commit'];\n \n foreach($hooks as $hook) {\n $tasks += $this->getAppendingTasks($hook);\n }\n\n return $this->collectionBuilder()->addTaskList($tasks);\n }", "public static function git_commit() {\r\n\t\tcheck_admin_referer('plugin-name-action_wpidenonce'); \r\n\t\tif ( !is_super_admin() )\r\n\t\t\twp_die('<p>'.__('You do not have sufficient permissions to edit templates for this site. SORRY').'</p>');\r\n\t\t\r\n error_reporting(E_ALL);\r\n ini_set(\"display_errors\", 1);\r\n \r\n require_once('git/autoload.php.dist');\r\n //use TQ\\Git\\Cli\\Binary;\r\n //use TQ\\Git\\Repository\\Repository;\r\n \r\n $root = apply_filters( 'wpide_filesystem_root', WP_CONTENT_DIR ) . \"/\"; \r\n \r\n //check repo path entered or die\r\n if ( !strlen($_POST['gitpath']) ) \r\n die(\"Error: Path to your git repository is required!\");\r\n \r\n \r\n $repo_path = $root . sanitize_text_field( $_POST['gitpath'] );\r\n $gitbinary = sanitize_text_field( stripslashes($_POST['gitbinary']) );\r\n \r\n if ( $gitbinary===\"I'll guess..\" ){ //the binary path\r\n \r\n $thebinary = TQ\\Git\\Cli\\Binary::locateBinary();\r\n $git = TQ\\Git\\Repository\\Repository::open($repo_path, new TQ\\Git\\Cli\\Binary( $thebinary ) );\r\n \r\n }else{\r\n \r\n $git = TQ\\Git\\Repository\\Repository::open($repo_path, new TQ\\Git\\Cli\\Binary( $_POST['gitbinary'] ) );\r\n \r\n }\r\n \r\n $files = array();\r\n foreach ($_POST['files'] as $file){\r\n $files[] = base64_decode( $file );\r\n }\r\n \r\n //get the current user to be used for the commit\r\n $current_user = wp_get_current_user();\r\n \r\n $git->add( $files );\r\n $git->commit( sanitize_text_field($_POST['gitmessage']) , $files, \"{$current_user->user_firstname} {$current_user->user_lastname} <{$current_user->user_email}>\");\r\n\r\n wpide::show_changed_files();\r\n \r\n\t\tdie(); // this is required to return a proper result\r\n\t}", "public abstract function commit();", "public function commit()\n {\n $this->connection->commit();\n }", "public static function commit() {\n\t\tforeach (self::$con as $instanceName => $instance) {\n\t\t\t$instance->commit();\n\t\t}\n\t}", "public function commit()\n {\n return $this->update($this->columns, $this->table)->where($this->clauses)->execute();\n }", "protected function commit()\n {\n $commit = function(Control $ctrl) use(&$commit)\n {\n $this->vs[$ctrl->attr('id')] = $ctrl->getVS();\n $this->controls[$ctrl->attr('id')] = $ctrl;\n if ($ctrl instanceof Panel)\n {\n foreach ($ctrl as $uniqueID => $child)\n {\n $commit($child);\n }\n }\n };\n foreach ($this->controls as $ctrl) $commit($ctrl);\n }", "public function commit() {\n if ($this->tx_active) {\n $this->x('COMMIT');\n $this->tx_active = false;\n } else {\n throw new GDBException(\"can't commit, no active transaction\");\n }\n }", "public function all($account, $repo, array $params = array())\n {\n $endpoint = sprintf('/repositories/%s/%s/commits', $account, $repo);\n\n if (!empty($params['branch'])) {\n $endpoint .= '/'.$params['branch']; // can also be a tag\n unset($params['branch']);\n }\n\n return $this->getClient()->setApiVersion('2.0')->get(\n $endpoint,\n $params\n );\n }", "public function commit()\n {\n if (self::$_transactionLevel == 1) {\n $this->getConnection()->commit();\n }\n \n if (self::$_transactionLevel > 0) {\n self::$_transactionLevel--;\n }\n }", "protected function commitTransaction()\n {\n $this->container->make('db')->commit();\n }", "public function commit()\n\t{\n $this->neoeloquent->commit();\n\t}", "public function commit()\n {\n if ($this->hasActiveTransaction) {\n parent::commit();\n $this->hasActiveTransaction = false;\n }\n }", "public function flushChanges()\n {\n $this->om->flush();\n }", "public function commitUpdate();", "static function commit($ignoreLimit = false) {\n $atoms = array_pop(static::$stack);\n if (!is_array($atoms)) {\n return error('Bad nesting of Atoms calls - no stack to commit().');\n }\n\n static::$accumulated[] = $atoms;\n\n if (!$ignoreLimit) {\n $total = array_sum(array_map('count', static::$accumulated))\n - count(static::$accumulated); // excluding FirstAtom's.\n if ($total < cfg('atomsPerFile')) { return; }\n }\n\n $transactions = static::$accumulated;\n // null buffer indicates that a commit is taking place.\n static::$accumulated = null;\n\n $code = \"<?php\\n// Committed \";\n\n if ($ignoreLimit instanceof \\Exception) {\n $code .= \"due to exception:\\n// \".exLine($ignoreLimit).\"\\n//\\n// \";\n } elseif ($ignoreLimit) {\n $code .= \"ignoring atomsPerFile limit (typically flushing on shutdown)\\n// \";\n }\n\n $code .= join(\"\\n// \", static::selfSign());\n\n foreach ($transactions as $atoms) {\n if (count($atoms) > 1 or !(reset($atoms) instanceof FirstAtom)) {\n foreach ($atoms as $id => $atom) {\n $lines = $atom->code($id, $atoms);\n $lines and $code .= \"\\n\\n\".join(\"\\n\", $lines);\n\n // if kept following atoms will recognize its 0 key as atom ID and\n // use it in expression like '$0->id' for zero-value fields.\n if ($id === 0 and $atom instanceof FirstAtom) { unset($atoms[$id]); }\n }\n }\n }\n\n if (isset($lines)) {\n $dest = static::generateDest();\n\n if (!file_put_contents($dest, $code, LOCK_EX)) {\n throw new EAtoms(\"Cannot commit atom transaction to [$dest].\");\n }\n }\n\n // indicating that the commit has been successfully finished.\n static::$accumulated = array();\n }", "public function transactionCommit()\n\t{\n\t\treturn;\n\t}", "public function commitEvents();", "public function commit() \n {\n $log = FezLog::get();\n $db = DB_API::get();\n \n if (!$this->_ids || count($this->_ids) == 0) {\n if ($this->size() == 0) {\n return; \n }\n }\n \n foreach ($this->_ids as $id => $action) {\n try {\n $db->beginTransaction();\n $sql = \"DELETE FROM \".$this->_dbtp.\"queue WHERE \".$this->_dbqp.\"id=? \".\n \"AND \".$this->_dbqp.\"op=?\";\n $db->query($sql, array($id, $action)); \n $sql = \"INSERT INTO \".$this->_dbtp.\"queue (\".$this->_dbqp.\"id,\".$this->_dbqp.\"op) VALUES (?,?)\";\n $db->query($sql, array($id, $action));\n $db->commit();\n }\n catch(Exception $ex) {\n $db->rollBack();\n $log->err($ex);\n return false;\n }\n unset($this->_ids[$id]);\n }\n\n // reset cached object ids\n $this->_ids = array();\n $this->triggerUpdate(); \n return true;\n }", "function changeBranch(){\r\n\t\t// $gitpss = isset($_COOKIE['gitpss']) ? $_COOKIE['gitpss'] : '';\r\n\t\t// $repo = 'https://'.$gitusr.':'.$gitpss.'@github.com/nelsoft/nelsoft_inventory.git';\r\n\t\tchdir($_POST['path']);\r\n\t\texec('git clean -df');\r\n\t\texec('git checkout -- .');\r\n\t\t// exec('git fetch '.$repo);\r\n\t\texec('git checkout '.$_POST['branch'], $data);\r\n\t\t// exec('git pull '.$repo.' '.$_POST['branch'], $data);\r\n\r\n\t\t$return['version'] = '0.00';\r\n\t\t$return['version'] = getversion($_POST['path'], 'version');\t\r\n\t\t$return['data'] = $data;\r\n\r\n\t\tjdie($return);\r\n}", "public function commit() {\n\t\treturn false;\n\t}", "public function flush(): void\n {\n $this->issues = [];\n }", "public function commit()\r\n {\r\n\t\treturn false;\r\n }", "function gitUpdate()\n{\n \n $config = json_decode(file_get_contents(\"/app/config.json\"), true);\n\n $git = $config['git'];\n $remote = \"https://\" . $git['user'] . \":\" . $git['token'] . \"@github.com/\" . $git['git_dir'];\n exec(\"cd \" . $config['project_dir'] . \" && git init && git pull $remote \" . $git['branch']);\n exec(\"cd \" . $config['project_dir'] . \" && composer update\");\n}", "public function commitTransaction() {\n\t\t//noop\n\t}", "public function retrieveLatestCommits() {\n\t\t\n\t\t$client = new \\Github\\Client();\n\t\t$commits = $client->api('repo')->commits()->all('nodejs','node', array('sha','master'));\n\t\t$repository = $this->em->getRepository('AppBundle:Commit');\n\n\t\tfor ($i = 0; $i < 25; ++$i) {\n\t\t\t$thisCommit = $commits[$i];\n\n\t\t\tif(!$repository->findOneBy(array('sha' => $thisCommit['sha']))) {\n\t\t\t\t$commit = new ent\\Commit;\n\n\t\t\t\t$commit->setSha($thisCommit['sha']);\n\t\t\t\t$commit->setAuthorName($thisCommit['commit']['author']['name']);\n\t\t\t\t$commit->setAuthorEmail($thisCommit['commit']['author']['email']);\n\t\t\t\t$commit->setAuthorID($thisCommit['author']['id']);\n\t\t\t\t$commit->setAuthorAvatar($thisCommit['committer']['avatar_url']);\n\t\t\t\t$commit->setAuthorLogin($thisCommit['committer']['login']);\n\t\t\t\t$commit->setCommitterName($thisCommit['commit']['committer']['name']);\n\t\t\t\t$commit->setCommitterEmail($thisCommit['commit']['committer']['email']);\n\t\t\t\t$commit->setCommitterID($thisCommit['committer']['id']);\n\t\t\t\t$commit->setTreeSha($thisCommit['commit']['tree']['sha']);\n\t\t\t\t$commit->setTreeUrl($thisCommit['commit']['tree']['url']);\n\t\t\t\t$commit->setMessage($thisCommit['commit']['message']);\n\t\t\t\t$commit->setUrl($thisCommit['url']);\n\t\t\t\t$commit->setHtmlUrl($thisCommit['html_url']);\n\t\t\t\t$commit->setComments($thisCommit['commit']['comment_count']);\n\t\t\t\t$commit->setCommitDate(new \\DateTime($thisCommit['commit']['committer']['date']));\n\n\n\t\t\t\t$this->em->persist($commit);\n\t\t\t} \n\t\t}\n\t\t$this->em->flush();\n $this->em->clear(); \n\t}", "function CommitTrans()\n\t{\n\t\tif ($this->__transCount > 0) {\n\t\t\t$this->__connection->commit();\n\t\t\t$this->__transCount--;\n\t\t}\n\t}", "public function testPartialDirty()\n {\n copy(__DIR__ . '/functional_dirty/Test_new_commit.php', $this->folder_final . '/Test.php'); // make file dirty\n $cmd = 'git commit -a -m \"second commit\" --no-edit 2>&1';\n $err = exec($cmd, $out, $code);\n if ($code) {\n $this->fail(\"Failed to create commit: $err\");\n }\n\n $cmd = \"git branch new_branch 2>&1 && git checkout new_branch 2>&1\";\n exec($cmd, $out, $code);\n if ($code) {\n $this->fail(\"Failed to create new branch\");\n }\n copy(__DIR__ . '/functional_dirty/Test_after_commit.php', $this->folder_final . '/Test.php'); // make file dirty\n \n // formatter see differences\n $res = $this->callFormatter('check-git');\n $this->assertEquals(1, $res['code']);\n $this->assertStringMatchesFormat('Test.php issues:%a', $res['out']);\n\n // apply only to changed\n $res = $this->callFormatter('apply-git');\n $this->assertEquals(0, $res['code']);\n $this->assertStringMatchesFormat('Test.php formatted successfully%a', $res['out']);\n \n // re-check\n $res = $this->callFormatter('check-git');\n $this->assertEquals(0, $res['code']);\n $this->assertStringMatchesFormat('Test.php does not need formatting%a', $res['out']);\n \n // check for content equality (partially formatted)\n $this->assertFileEquals(__DIR__ . '/functional_dirty/Test_new_branch_formatted.php', $this->folder_final . '/Test.php');\n }", "public function commit( $which = 'default' )\n\t{\n\t\t$this->getHandle( $which )->commit();\n\t}", "public function transactionCommit()\n {\n $this->connectionManager->commit();\n $this->connectionManager->autocommit(true);\n }", "public function commit()\n {\n if ($this->transactionCount < 1) {\n return;\n }\n $transaction = $this->unprepared(\"COMMIT;\");\n if (false !== $transaction) {\n $this->transactionCount--;\n }\n }", "public function runPending()\r\n\t{\r\n\t\t$response = \"\";\r\n\t\t$response .= $this->ensureRepositoryExist();\r\n\t\t$migration_batch = $this->repository->getNextBatchNumber();\r\n\t\t$pending_migrations = $this->pendingMigrations();\r\n\t\tif (count($pending_migrations) > 0) {\r\n\t\t\tforeach ($pending_migrations as $file) {\r\n\t\t\t\t$migration_name = $this->removeDotPhp($file);\r\n\t\t\t\t$schema = $this->runUp($file);\r\n\t\t\t\tif ($schema != \"\") {\r\n\t\t\t\t\t$query_response = DB()->query($schema);\r\n\t\t\t\t\tif ($query_response) {\r\n\r\n\t\t\t\t\t\t// Once we have run a migrations file, we will log that it was run in this\r\n\t\t\t\t\t\t// repository so that we don't try to run it next time we do a migration\r\n\t\t\t\t\t\t// in the application. A migration repository keeps the migrate order.\r\n\t\t\t\t\t\t$this->repository->log($migration_name, $migration_batch);\r\n\t\t\t\t\t\t$response .= nl2br(\"Migrated: $migration_name\\n\");\r\n\t\t\t\t\t} else {\r\n\r\n\t\t\t\t\t\t// if the schema failed to execute against the database\r\n\t\t\t\t\t\t$response .= nl2br(\"Failed: $migration_name\\n\");\r\n\t\t\t\t\t\t$response .= nl2br(\"-- $query_response[error]\\n\");\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\t// if the migrations file has nothing\r\n\t\t\t\t\t$response .= nl2br(\"Empty: $migration_name\\n\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} else {\r\n\r\n\t\t\t// if we have no outstanding migrations to migrate\r\n\t\t\t$response .= nl2br(\"Nothing to migrate\\n\");\r\n\t\t}\r\n\r\n\t\treturn $response;\r\n\t}", "public function commit() {\n return UPS_SUCCESS;\n }", "function commit() {\n\t\tif (!$this->error) return OciCommit($this->conn);\n\t}", "public function commit($message = \"\", $commit_all = true) {\n\t\t\t$flags = $commit_all ? '-av' : '-v';\n\t\t\treturn $this->run(\"commit \".$flags.\" -m \".escapeshellarg($message));\n\t\t}", "public function commit()\n {\n if ($this->transactionLevel === 0)\n {\n throw new DatabaseException('transaction-nothing-to-commit');\n }\n \n --$this->transactionLevel;\n \n if ($this->transactionLevel === 0)\n {\n if (!$this->pdo->commit())\n {\n throw new DatabaseException('transaction-commit');\n }\n }\n else\n {\n // Release savepoint, we no longer need it.\n $this->pdo->exec('RELEASE SAVEPOINT LEVEL' . $this->transactionLevel);\n }\n }", "public function commit()\n {\n return true;\n }", "public function commit($id);", "public function updateRepositories() {\n $projects = $this->loadProjects();\n if (!$projects)\n return;\n\n $this->m_authors = $this->loadAuthors();\n\n foreach ($projects as $project)\n $this->updateProject($project);\n }", "public function flush() {\n if ($this->c_owner) {\n if ($this->update('owner', $this->owner, Project::$tableName)) {\n $this->c_owner = false;\n }\n }\n if ($this->c_name) {\n if ($this->update('name', $this->name, Project::$tableName)) {\n $this->c_name = false;\n }\n }\n if ($this->c_description) {\n if ($this->update('description', $this->description, Project::$tableName)) {\n $this->c_description = false;\n }\n }\n \n if ($this->c_deadline) {\n if ($this->update('deadline', $this->deadline, Project::$tableName)) {\n $this->c_deadline = false;\n }\n }\n if ($this->c_time) {\n if ($this->update('time', $this->time, Project::$tableName)) {\n $this->c_time = false;\n }\n }\n }", "public function commitDatabases()\n {\n $databases = Manager::getObjectsByTag(self::MEMORY_MANAGER_TAG);\n if ($databases) {\n $this->logger->debug(sprintf('Number of open databases: %d', count($databases)));\n\n /** @var DatabaseInterface $database */\n foreach ($databases as $database) {\n $this->logger->debug(sprintf('Check state of database \"%s\"', $database->getIdentifier()));\n if ($database->getState() === DatabaseStateInterface::STATE_DIRTY) {\n $this->commitDatabase($database);\n } else {\n $this->logger->debug(sprintf('Database \"%s\" is in clean state', $database->getIdentifier()));\n }\n }\n } else {\n $this->logger->debug('No databases to commit');\n }\n }", "public function commit() {\n return true;\n }", "protected function _commit() {\n $this->dataSource->commit($this);\n }", "public function commit()\n {\n $this->voucherService->addVoucher($this->voucher);\n \n }", "public function commitChanges(OutputInterface $output, $modules) {\n\t\t$this->log($output, 'Committing translations to git');\n\t\t\n\t\tforeach($modules as $module) {\n\t\t\t$repo = $module->getRepository();\n\n\t\t\t// Add all changes\n\t\t\t$jsPath = $module->getJSLangDirectory();\n\t\t\t$langPath = $module->getLangDirectory();\n\t\t\tforeach(array_merge((array)$jsPath, (array)$langPath) as $path) {\n\t\t\t\tif(is_dir($path)) {\n\t\t\t\t\t$repo->run(\"add\", array($path . \"/*\"));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Commit changes if any exist\n\t\t\t$status = $repo->run(\"status\");\n\t\t\tif(stripos($status, 'Changes to be committed:')) {\n\t\t\t\t$this->log($output, \"Comitting changes for module \" . $module->getName());\n\t\t\t\t$repo->run(\"commit\", array(\"-m\", \"Update translations\"));\n\t\t\t}\n\n\t\t\t// Do push if selected\n\t\t\tif($this->push) {\n\t\t\t\t$this->log($output, \"Pushing upstream for module \" . $module->getName());\n\t\t\t\t$repo->run(\"push\", array(\"origin\"));\n\t\t\t}\n\t\t}\n\t}", "function git_update($path) {\n\t$status = GitUtil::update($path);\n}", "public function flush()\n {\n $this->manager->flush();\n }", "public function commit() {\n\t$idAvailable = \\is_numeric($this->getId());\n\t//We're checking if the id is available and it's marked for delete. If not, we need to check if the id is available.\n\t//Finally, we need to make sure it hasn't been marked for delete. if it has and there's no id, nothing needs to be\n\t//done.\n\tif ($idAvailable && $this->_markForDelete) {\n\t $this->delete();\n\t}\n\telse if ($idAvailable) {\n\t $this->update();\n\t}\n\telse if (!$this->_markForDelete) {\n\t $this->insert();\n\t}\n }", "public function commitTransaction() {\r\n\t\t// TODO: Implement transaction stuff.\r\n\t\t//$this->query('COMMIT TRANSACTION');\r\n\t}", "public function commitTransaction()\n {\n if ($this->isTransactionEnabled() === false) {\n throw new ServiceException(sprintf(\n 'The repository for %s doesn\\'t support Transactions',\n $this->getEntityServiceName()\n ));\n }\n\n $this->getRepository()->commitTransaction();\n }", "function drush_patchfile_patch_apply_all() {\n $projects = drush_patchfile_get_patched_projects();\n\n if (empty($projects)) {\n return drush_print(dt('No patches found.'));\n }\n\n foreach ($projects as $project_name => $project_info) {\n drush_patchfile_patch_project($project_name);\n }\n}", "public function commit(): void\n {\n try {\n $this->getConnection()->commit();\n } catch (DbalConnectionException $e) {\n throw new Exception('Commit failed', 0, $e);\n }\n }", "public function commitIndex()\n {\n // either open or create the index\n $this->index = $this->openIndex(APPLICATION_PATH . '/data/search/jobs');\n $this->index->commit();\n $this->_log($this->index->count() . ' documents indexed.');\n }", "public function flushAll();", "public function commit()\n {\n throw new Exception('transactions are not yet supported');\n $this->db->commit_delegated_transaction();\n }" ]
[ "0.6372576", "0.60300004", "0.595329", "0.5945049", "0.5905837", "0.577819", "0.5757286", "0.5738349", "0.5681188", "0.56398624", "0.5630802", "0.5629216", "0.561454", "0.55256623", "0.5506624", "0.550386", "0.5478474", "0.5472514", "0.5422855", "0.5422855", "0.54043853", "0.5392005", "0.5381987", "0.5381987", "0.5381987", "0.5381987", "0.5381987", "0.53785247", "0.53402215", "0.5337216", "0.53358907", "0.5329182", "0.53263307", "0.530621", "0.5299695", "0.526717", "0.5265812", "0.5260055", "0.5258192", "0.52526855", "0.5250254", "0.52451", "0.5238447", "0.5206008", "0.52026653", "0.5195447", "0.51914686", "0.51748496", "0.51720476", "0.51645666", "0.51598525", "0.5138264", "0.51081586", "0.51079106", "0.50855446", "0.50827414", "0.50520444", "0.50498104", "0.5037824", "0.5037407", "0.5022183", "0.50182986", "0.5011772", "0.5009598", "0.49740386", "0.49738103", "0.4968434", "0.49231583", "0.49141556", "0.49042407", "0.49004057", "0.4900208", "0.4899543", "0.4887297", "0.48805574", "0.4867369", "0.4860959", "0.4860629", "0.4859256", "0.48574182", "0.48570582", "0.48461396", "0.48435363", "0.48427105", "0.48310864", "0.48133898", "0.48132873", "0.4804828", "0.4802791", "0.4799629", "0.4796474", "0.47724852", "0.47692078", "0.47632328", "0.47518384", "0.47294515", "0.47245836", "0.47084802", "0.47018805", "0.46901742" ]
0.5042066
58
Export a git repository.
public static function export($source, $target, $prefix, $version = 'HEAD') { $exportCmd = String(self::EXPORT_CMD_TMPL)->format([ 'src' => $source, 'tgt' => $target, 'pre' => $prefix, 'ver' => $version ]); passthru($exportCmd); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drush_cmi_config_export_git() {\n drush_cmi_config_export();\n drush_shell_exec_interactive('git add -p ' . config_get_config_directory('export'));\n}", "function git_export($path, $output, $prefix = null, $version = 'HEAD') {\n\tif ($prefix === null) {\n\t\t$prefix = basename($output);\n\t\t$output = dirname($output);\n\t}\n\tGitUtil::export($path, $output, $prefix, $version);\n}", "public function gitCloneRepositories() {\n\t\t$count = 0;\n\n\t\t$packages = $this->Package->find('list');\n\t\tforeach ($packages as $id => $name) {\n\t\t\t$this->out(sprintf(__(\"* Downloading package %s\"), $name));\n\t\t\tif ($this->Package->setupRepository($id)); {\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\t\t$this->out(sprintf(__('* Downloaded %s of %s repositories'), $count, count($packages)));\n\t}", "public function cloneGitRepo($repo, $dir);", "public function createGit()\n {\n if($GLOBALS['TL_CONFIG']['bx_git_path'])\n {\n $gitPath = TL_ROOT.$GLOBALS['TL_CONFIG']['bx_git_path'];\n }else{\n $gitPath = TL_ROOT.\"/\";\n }\n\n $git = new GitPhp\\GitRepository($gitPath);\n $git->init()->execute();\n \n //Set Remote\n $url = explode(\"://\", $GLOBALS['TL_CONFIG']['bx_git_host_url']);\n $git->remote()->setUrl('origin', $url[0].\"://\".$GLOBALS['TL_CONFIG']['bx_git_host_user'].\":\".$GLOBALS['TL_CONFIG']['bx_git_host_pass'].\"@\".$url[1]);\n }", "private function _fetchGitRepository($url, $ref = 'master')\n\t{\n\t\t// Create a Git repository object within the system tmp folder for the url.\n\t\t$root = sys_get_temp_dir() . md5($url);\n\n\t\t// If the folder doesn't exist attempt to create it.\n\t\tif (!is_dir($root))\n\t\t{\n\t\t\tmkdir($root, 0777, true);\n\t\t}\n\n\t\t// Instantiate the repository object.\n\t\t$repo = new PackagerGitRepository($root);\n\n\t\t// Only clone the repository if it doesn't exist.\n\t\tif (!$repo->exists())\n\t\t{\n\t\t\t$repo->create();\n\t\t}\n\n\t\t// Get a clean checkout of the branch/tag required.\n\t\t$repo->fetch()\n\t\t\t->branchCheckout($ref)\n\t\t\t->clean();\n\n\t\treturn $root;\n\t}", "function write_zip($repo) {\n $p = basename($repo);\n $proj = explode(\".\", $p);\n $proj = $proj[0];\n //TODO: clean this up\n exec(\"cd /tmp && git-clone $repo && rm -Rf /tmp/$proj && zip -r $proj.zip $proj && rm -Rf /tmp/$proj\");\n\n $filesize = filesize(\"/tmp/$proj.zip\");\n header(\"Pragma: public\"); // required\n header(\"Expires: 0\");\n header(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n header(\"Cache-Control: private\", false); // required for certain browsers\n header(\"Content-Transfer-Encoding: binary\");\n header(\"Content-Type: application/x-zip\");\n header(\"Content-Length: \" . $filesize);\n header(\"Content-Disposition: attachment; filename=\\\"$proj.zip\\\";\");\n echo file_get_contents(\"/tmp/$proj.zip\");\n die();\n}", "function git_clone($repo, $path, $initSubModules = false) {\n\tGitUtil::cloneRepo($repo, $path, $initSubModules);\n}", "protected function createRepository()\n {\n $repositoryOptions = [\n 'repository' => $this->info['repositoryName'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'parent',\n 'uploads',\n 'data',\n 'int',\n 'float',\n 'bool',\n ]);\n\n $this->call('engez:repository', array_merge($repositoryOptions, $options));\n }", "public function gitClone()\n\t{\n\t\t$repoURL = 'https://github.com/' . $this->getUserName() . '/' . $this->getProjectName() . '.git';\n\t\t$path = $this->getPath();\n\t\t$this->gitWrapper->clone($repoURL, $path);\n\t}", "public function cloneRepository();", "function write_plain($repos) {\n $repo = get_repo_path($_GET['p'], $repos);\n $hash = $_GET['h'];\n header(\"Content-Type: text/plain\");\n $str = system(\"GIT_DIR=$repo/.git git cat-file blob $hash\");\n echo $str;\n die();\n}", "public function github(){\n\n\t\t$user = '';\n\t\tif(isset($this->request->get['user'])){\n\t\t\t$user = $this->request->get['user'];\n\t\t}\n\t\t$repo = '';\n\t\tif(isset($this->request->get['repo'])){\n\t\t\t$repo = $this->request->get['repo'];\n\t\t}\n\t\t$branch = '';\n\t\tif(isset($this->request->get['branch'])){\n\t\t\t$branch = $this->request->get['branch'];\n\t\t}\n\t\tnew d_shopunity\\GitHub($user, $repo, str_replace(\"catalog/\", \"\", DIR_APPLICATION), $branch );\n\t}", "public function getGitRepository(): string\n {\n return 'https://github.com/Sylius/Sylius.git';\n }", "public function export(ExportcandidateRequest $request, candidateRepository $repository) {\n\n return $this->handleExport($request, $repository);\n }", "public function _archive_repo( $gitlab_path ) {\n\n\t\t[ 'group' => $group, 'name' => $project_name ] = $gitlab_path; // php 7.1 🚀\n\n\t\tif ( ! empty( $project_name ) ) {\n\n\t\t\tarchive_repo_by_id( rawurlencode( $group . '/' . $project_name ) );\n\n\t\t} else {\n\n\t\t\t$projects_data = get_projects( $gitlab_path );\n\n\t\t\tforeach ( $projects_data as $project ) {\n\n\t\t\t\t$this->_display_project_data( $project, 'Archiving' );\n\n\t\t\t\tarchive_repo_by_id( $project['id'] );\n\t\t\t}\n\t\t}\n\t}", "function prueba_git ()\r\n{\r\n\t/* Aqui estaria el codigo de la funcion */\r\n\r\n}", "public function store()\n {\n $validated = request()->validate([\n 'name' => ['required', 'regex:/^[A-Za-z0-9_]*$/']\n ]);\n\n $repository = new Repository();\n $repository->name = $validated['name'];\n\n chdir('D:\\repositories');\n// file_put_contents('conf/gitolite.conf', $lines);// insert gitolite.conf\n// shell_exec('git config user.email tarc@admin');\n// shell_exec('git config user.name TARC_Admin');\n// shell_exec('git add conf/gitolite.conf');\n// shell_exec('git commit -m '.Staff::where('user_id', Auth::user()->id)->first()->staff_id);\n// shell_exec('git pull');\n// shell_exec('git push');\n shell_exec('git clone '. config('gitolite.git_server_url') .':' . $repository->name);\n// $output = shell_exec('rm -rf '.escapeshellarg($repository->name));\n// dd($output);\n return redirect('repositories')->with('success', 'Your '.$repository->name . ' repository has been created.');;\n }", "public function testGitLabRemoteRepository(): void\n {\n $repo = new GitLabRemoteRepository('r/r', './');\n $this->assertEquals('https://gitlab.com/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "public function createReference($repository) { \n if ( $repository->exists() ) {\n throw new GitBackendException('Repository already exists');\n } \n $path = $repository->getPath();\n //create git root if does not exist\n $this->createGitRoot();\n //create project dir if does not exists\n $this->createProjectRoot($repository);\n $path = $this->getGitRootPath().DIRECTORY_SEPARATOR.$path;\n mkdir($path, 0770, true);\n chdir($path);\n $this->getDriver()->init($bare=true);\n\n return $this->setUpRepository($repository);\n }", "protected function svnExport($path) \n {\n $absolute_path = $this->absolutePath($path);\n\n $this->log('svn export: ' \n . shell_exec(\"svn export {$this->ullright_repo_url}/{$path} {$absolute_path}\"));\n }", "public function testGitHubRemoteRepository(): void\n {\n $repo = new GitHubRemoteRepository('r/r', './');\n $this->assertEquals('https://github.com/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "private function createRepository()\n {\n $this->output->write('Creating repository... ');\n\n try {\n $versionControlRepository = ($this->config->scm->type == 'gitlab') ?\n new VersionControlRepositoryGitLab($this->config) : new VersionControlRepositoryGitHub($this->config);\n $versionControlRepository->create($this->project);\n\n $this->output->writeln('<info>OK</info>');\n } catch (\\Exception $e) {\n $message = 'Error: '. $e->getMessage();\n $this->output->writeln('<error>'. $message .'</error>');\n throw new \\RuntimeException($message);\n }\n }", "public function repo($dir, $remote);", "public function pushRepository($dir, $target_project);", "public function export();", "public function export();", "public function export();", "public function export();", "public function export();", "protected function setupGitRepo()\n {\n $td = $this->getTestDir();\n\n $this->fs->removeDirectory($td);\n $this->fs->ensureDirectoryExists($td);\n\n $currentWorkDir = getcwd();\n chdir($td);\n\n $result = $this->process->execute(\"git init -q\");\n if ($result > 0) {\n throw new \\RuntimeException(\n \"Could not init: \" . $this->process->getErrorOutput());\n }\n $result = file_put_contents('b', 'a');\n if (false === $result) {\n throw new \\RuntimeException(\"Could not save file.\");\n }\n $result = $this->process->execute(\"git add b && git commit -m 'commit b' -q\");\n if ($result > 0) {\n throw new \\RuntimeException(\n \"Could not init: \" . $this->process->getErrorOutput());\n }\n chdir($currentWorkDir);\n }", "public function export(ExportUserRequest $request, UserRepository $repository) {\n\n return $this->handleExport($request, $repository);\n }", "function do_clone($key,$url,$path) {\n $cmd = \"ssh-agent bash -c 'ssh-add $key; git clone $url $path' 2>&1\";\n _log(\"Exec command: $cmd\\n\");\n return shell_exec($cmd);\n}", "function export( $id, $format, $back_url ) {\n\t\t\n\t}", "public function testGitLabRemoteRepositoryExternal(): void\n {\n $repo = new GitLabRemoteRepository('r/r', './', 'https://salsa.debian.org/');\n $this->assertEquals('https://salsa.debian.org/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "private function syncRepository()\n {\n $cwd = '/tmp/'.$this->migrationId;\n (new ProcessBuilder(['mkdir']))->add('-p')->add($cwd)->getProcess()->mustRun();\n\n $cloneSourceCommandBuilder = new ProcessBuilder(['git', 'clone', $this->sourceProject->getSshUrlToRepo(), '.']);\n $cloneSourceCommandBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $addNewRemoteBuilder = new ProcessBuilder(['git', 'remote', 'add', 'new']);\n $addNewRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->add($this->targetProject->getSshUrlToRepo())\n ->getProcess()\n ->mustRun();\n\n $pushToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--all']);\n $pushToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $pushTagsToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--tags']);\n $pushTagsToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n }", "public static function open($repo_path) {\n\t\t\treturn new GitRepo($repo_path);\n\t\t}", "protected function makeRepository()\n {\n if ($this->files->exists($path = $this->getRepositoryPath())) {\n return $this->error($this->className . ' already exists!');\n }\n $this->makeDirectory($path);\n $this->files->put($path, $this->compileRepositoryStub());\n $this->info('Repository created successfully.');\n }", "public function createExport();", "public function init() {\n $git_wrapper = new \\GitWrapper\\GitWrapper();\n if (file_exists($this->directory)) {\n $this->git = $git_wrapper->workingCopy($this->directory);\n $this->git->checkout($this->branch);\n }\n else {\n $this->git = $git_wrapper->cloneRepository($this->getRepositoryURL(), $this->directory, ['branch' => $this->branch]);\n }\n }", "public function git_directory_path() {\n\t\t\treturn ($this->bare) ? $this->repo_path : $this->repo_path.\"/.git\";\n\t\t}", "function devshop_project_create_step_git($form, $form_state) {\n $project = &$form_state['project'];\n \n drupal_add_js(drupal_get_path('module', 'devshop_projects') . '/inc/create/create.js');\n \n if ($project->verify_error) {\n $form['note'] = array(\n '#markup' => t('We were unable to connect to your git repository. Check the messages, edit your settings, and try again.'),\n '#prefix' => '<div class=\"alert alert-danger\">',\n '#suffix' => '</div>',\n );\n $form['error'] = array(\n '#markup' => $project->verify_error,\n );\n \n // Check for \"host key\"\n if (strpos($project->verify_error, 'Host key verification failed')) {\n $form['help'] = array(\n '#markup' => t('Looks like you need to authorize this host. SSH into the server as <code>aegir</code> user and run the command <code>git ls-remote !repo</code>. <hr />Add <code>StrictHostKeyChecking no</code> to your <code>~/.ssh/config</code> file to avoid this for all domains in the future.', array(\n '!repo' => $project->git_url,\n )),\n '#prefix' => '<div class=\"alert alert-warning\">',\n '#suffix' => '</div>',\n );\n }\n }\n \n if (empty($project->name)) {\n $form['title'] = array(\n '#type' => 'textfield',\n '#title' => t('Project Code Name'),\n '#required' => TRUE,\n '#suffix' => '<p>' . t('Choose a unique name for your project. Only letters and numbers are allowed.') . '</p>',\n '#size' => 40,\n '#maxlength' => 255,\n );\n }\n else {\n $form['title'] = array(\n '#type' => 'value',\n '#value' => $project->name,\n );\n $form['title_display'] = array(\n '#type' => 'item',\n '#title' => t('Project Code Name'),\n '#markup' => $project->name,\n );\n }\n \n $username = variable_get('aegir_user', 'aegir');\n \n $tips[] = t('Use the \"ssh\" url whenever possible. For example: <code>[email protected]:opendevshop/repo.git</code>');\n $tips[] = t('You can use a repository with a full Drupal stack committed, but using composer is recommended.');\n $tips[] = t('Use the !link project as a starting point for Composer based projects.', [\n '!link' => l(t('DevShop Composer Template'), 'https://github.com/opendevshop/devshop-composer-template'),\n ]);\n $tips[] = t('If a composer.json file is found in the root of the project, <code>composer install</code> will be run automatically.');\n $tips = theme('item_list', array('items' => $tips));\n \n $form['git_url'] = array(\n '#type' => 'textfield',\n '#required' => 1,\n '#title' => t('Git URL'),\n '#suffix' => '<p>' . t('Enter the Git URL for your project') . '</p>' . $tips,\n '#default_value' => $project->git_url,\n '#maxlength' => 1024,\n );\n\n//\n// // Project code path.\n// $form['code_path'] = array(\n// '#type' => variable_get('devshop_projects_allow_custom_code_path', FALSE) ? 'textfield' : 'value',\n// '#title' => t('Code path'),\n// '#description' => t('The absolute path on the filesystem that will be used to create all platforms within this project. There must not be a file or directory at this path.'),\n// '#required' => variable_get('devshop_projects_allow_custom_code_path', FALSE),\n// '#size' => 40,\n// '#default_value' => $project->code_path,\n// '#maxlength' => 255,\n// '#attributes' => array(\n// 'data-base_path' => variable_get('devshop_project_base_path', '/var/aegir/projects'),\n// ),\n// );\n//\n// // Project base url\n// $form['base_url'] = array(\n// '#type' => variable_get('devshop_projects_allow_custom_base_url', FALSE) ? 'textfield' : 'value',\n// '#title' => t('Base URL'),\n// '#description' => t('All sites will be under a subdomain of this domain.'),\n// '#required' => variable_get('devshop_projects_allow_custom_base_url', FALSE),\n// '#size' => 40,\n// '#default_value' => $project->base_url,\n// '#maxlength' => 255,\n// '#attributes' => array(\n// 'data-base_url' => devshop_projects_url($project->name, ''),\n// ),\n// );\n \n // Display helpful tips for connecting.\n $pubkey = variable_get('devshop_public_key', '');\n \n // If we don't yet have the server's public key saved as a variable...\n if (empty($pubkey)) {\n $output = t(\"This DevShop doesn't yet know your server's public SSH key. To import it, run the following command on your server as <code>aegir</code> user:\");\n $command = 'drush @hostmaster vset devshop_public_key \"$(cat ~/.ssh/id_rsa.pub)\" --yes';\n $output .= \"<div class='command'><input size='160' value='$command' onclick='this.select()' /></div>\";\n }\n else {\n // @TODO: Make this Translatable\n $output = <<<HTML\n <div class=\"empty-message\">If you haven't granted this server access to your Git repository, you should do so now using it's public SSH key.</div>\n <textarea id=\"rsa\" onclick='this.select()'>$pubkey</textarea>\nHTML;\n }\n \n // Add info about connecting to Repo\n $form['connect'] = array(\n '#type' => 'fieldset',\n '#title' => t('Repository Access'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n );\n $form['connect']['public_key'] = array(\n '#markup' => $output,\n );\n return $form;\n}", "public function export() {\n $folder = $this->config->get('oxygen.mod-import-export.path');\n if(!file_exists($folder)) {\n mkdir($folder);\n }\n $path = $folder . $this->environment;\n if(!file_exists($path)) {\n mkdir($path);\n }\n\n $this->exportStrategy->create($path);\n\n foreach($this->workers as $worker) {\n $files = $worker->export($this->output);\n foreach($files as $localPath => $path) {\n $this->output->writeln('Adding file: ' . $path);\n $this->exportStrategy->addFile($path, $localPath);\n }\n }\n\n $this->exportStrategy->commit();\n\n foreach($this->workers as $worker) {\n $worker->postExport($this->output);\n }\n }", "protected function getRepository() {\n\t\tif ($this->_repository === null) {\n\t\t\t$this->_repository = new AGitRepository();\n\t\t\t$this->_repository->setPath($this->path,true,true);\n\t\t\t$this->assertTrue(file_exists($this->path));\n\t\t}\n\t\treturn $this->_repository;\n\t}", "function cvs_add_repository($cvs_user, $cvs_pass, $cvs_project) {\r\n global $cvs_root, $cvs_cmd;\r\n\r\n $cvs_dir = $cvs_root.\"/\".$cvs_project;\r\n\r\n exec($cvs_cmd.\" -d \".$cvs_dir.\" init\");\r\n\r\n cvs_add_user($cvs_user, $cvs_pass, $cvs_project);\r\n}", "function saveRepo($name) {\n\tglobal $repos, $counter;\n\t$counter++;\n\tif(!array_key_exists($name, $repos)) {\n\t\t$repos[$name] = $name;\n\t\tfile_put_contents('repos.txt', implode(\"\\r\\n\",$repos));\n\t\t//echo sizeof($repos).\"/$counter\\n\";\n\t}\n}", "function html_desc($repo, $proj) {\n\n // Check if the git repo has a description file\n if(file_exists(\"$repo/.git/description\")){\n $desc = short_desc(file_get_contents(\"$repo/.git/description\"));\n }else{\n $desc = \"No description\";\n }\n $owner = get_file_owner($repo);\n $last = get_last($repo);\n $git_clone_url = 'http://'.$_SERVER['HTTP_HOST'].'/git/'.$proj;\n \n echo \"<table>\";\n echo \"<tr><td>description</td><td>$desc</td></tr>\";\n echo \"<tr><td>owner</td><td>$owner</td></tr>\";\n echo \"<tr><td>last change</td><td>$last</td></tr>\";\n echo \"<tr><td>URL</td><td>$git_clone_url</td></tr>\";\n echo \"</table>\";\n}", "public function cloneRepo($repo)\n {\n return $this->passthru('git', ['clone', '[email protected]:' . $repo]);\n }", "public function getRepository();", "function export()\n\t{\n\t\t$zip = $this->buildExportFile();\n\t\t\n\t ilUtil::deliverFile($zip, $this->object->getTitle().\".zip\", '', false, true);\n\t}", "public function repository()\n {\n return new Eadrax\\Repository\\Project\\Add;\n }", "public function index()\n {\n $output = shell_exec('ssh [email protected] info');\n return view('repositories.index', compact('output'));\n }", "protected function download($output, $type, $name, $version = 'master')\n {\n $url = 'https://github.com/' . $this->getRepo($type);\n $this->executeCommand(\"git clone --single-branch --branch $version $url $name\", getcwd(), $output);\n return $this;\n }", "function git_is_repo($path) {\n\treturn GitUtil::isRepo($path);\n}", "public function export(ExportUserPermissionRequest $request, UserPermissionRepository $repository) {\n\n return $this->handleExport($request, $repository);\n }", "function do_fetch($key,$url,$path) {\n $cmd = \"ssh-agent bash -c 'cd $path; ssh-add $key; git fetch' 2>&1\";\n _log(\"Exec command: $cmd\\n\");\n return shell_exec($cmd);\n}", "protected function cloneRepoToTempDirectory(): void {\n\t\t$this->gitRepository->clone(\n\t\t\t$this->settings->getRepoUri(),\n\t\t\t$this->settings->getTempPath(),\n\t\t\t$this->settings->getRepoBranch()\n\t\t)->removeGitConfig( $this->settings->getTempPath() . '/.git' );\n\t}", "public function testBitBucketRemoteRepository(): void\n {\n $repo = new BitBucketRemoteRepository('r/r', './');\n $this->assertEquals('https://bitbucket.org/r/r/src/v2/src/Project.php#Project.php-30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "public function create($repository);", "public function zipball($url, $bundle, $path)\n\t{\n\t\t$work = path('storage').'github/';\n\n\t\t// When installing a bundle from a Zip archive, we'll first clone\n\t\t// down the bundle zip into the bundles \"working\" directory so\n\t\t// we have a spot to do all of our bundle extraction work.\n\t\t$target = $work.'git-repo.zip';\n\n\t\tFile::put($target, $this->download($url));\n\n\t\t$zip = new \\ZipArchive;\n\n\t\t$zip->open($target);\n\n\t\t// Once we have the Zip archive, we can open it and extract it\n\t\t// into the working directory. By convention, we expect the\n\t\t// archive to contain one root directory with the bundle.\n\t\tmkdir($work.'zip');\n\n\t\t$zip->extractTo($work.'zip');\n\n\t\t$latest = File::latest($work.'zip')->getRealPath();\n\n\t\t@chmod($latest, 0777);\n\n\t\t// Once we have the latest modified directory, we should be\n\t\t// able to move its contents over into the bundles folder\n\t\t// so the bundle will be usable by the developer.\n\t\tFile::mvdir($latest, $path);\n\n\t\tFile::rmdir($work.'zip');\n\n\t\t$zip->close();\n\t\t//@unlink($target);\n\t}", "public function fetch($destDir)\n {\n shell_exec('rm -rf ' . $destDir);\n shell_exec('git clone --depth=1 ' . $this->extraArgs . ' ' . $this->url . ' ' . $destDir);\n }", "public function createRepo(string $repo = null)\n {\n $end = $this->getVendorType() === 'org'\n ? '/orgs/' . $this->getVendor() . '/repos'\n : '/user/repos';\n $res = $this->request('POST', $end, [\n 'name' => $this->getName(),\n 'description' => $this->getDescription(),\n ]);\n if (Helper::isResponseOk($res)) {\n echo \"\\ngit remote add origin [email protected]:{$this->getFullName()}.git\\n\";\n echo \"git push -u origin master\\n\";\n }\n\n return $res;\n }", "public function download(string $version): Archive\n {\n $meta = $this->get($version);\n $url = $meta['dist']['url'];\n\n $zip = $this->repository->download($url);\n \n $baseFolder = null;\n if (preg_match('/api.github.com/', $url)) {\n $baseFolder = str_replace('/', '-', $meta['name']) . '-' . substr($meta['dist']['reference'], 0, 7);\n }\n\n return new Archive($zip, ['baseFolder' => $baseFolder,'package' => $this->name, 'version' => $version]);\n }", "public function cloneAndConfig()\n {\n if (! is_dir($this->directory)) {\n try {\n $this->git->cloneRepository()->execute($this->repo_url);\n $this->git->remote()->add(\n $this->client_remote,\n $this->client_remote_url\n )->execute();\n\n $this->git->fetch()->execute($this->client_remote);\n\n if (! file_put_contents($this->config_file,\n $this->user_config, FILE_APPEND)) {\n $this->logger->error('Can\\'t write Git config file');\n }\n } catch (GitException $e) {\n $this->logger->error('Failed to clone or config Git repository. '\n . 'Error: ' . $e->getMessage());\n }\n }\n }", "public static function &create($repo_path, $source = null) {\n\t\t\treturn GitRepo::create_new($repo_path, $source);\n\t\t}", "public function setRepository($var)\n {\n GPBUtil::checkString($var, True);\n $this->repository = $var;\n\n return $this;\n }", "public function getRepo()\n {\n return $this->repo;\n }", "function cvs_delete_repository($cvs_project) {\r\n global $cvs_root;\r\n \r\n //We really don't want to delete the repository,\r\n //just erase the passwd file...\r\n\r\n $cvs_passwd_file = $cvs_root.\"/\".$cvs_project.\"/CVSROOT/passwd\";\r\n unlink( $cvs_passwd_file);\r\n\r\n $cvs_deleted_file = $cvs_root.\"/\".$cvs_project.\"/DELETED\";\r\n touch( $cvs_deleted_file);\r\n}", "function changeBranch(){\r\n\t\t// $gitpss = isset($_COOKIE['gitpss']) ? $_COOKIE['gitpss'] : '';\r\n\t\t// $repo = 'https://'.$gitusr.':'.$gitpss.'@github.com/nelsoft/nelsoft_inventory.git';\r\n\t\tchdir($_POST['path']);\r\n\t\texec('git clean -df');\r\n\t\texec('git checkout -- .');\r\n\t\t// exec('git fetch '.$repo);\r\n\t\texec('git checkout '.$_POST['branch'], $data);\r\n\t\t// exec('git pull '.$repo.' '.$_POST['branch'], $data);\r\n\r\n\t\t$return['version'] = '0.00';\r\n\t\t$return['version'] = getversion($_POST['path'], 'version');\t\r\n\t\t$return['data'] = $data;\r\n\r\n\t\tjdie($return);\r\n}", "public function git_repository()\n\t{\n\t\texec( 'cd ' . $this->theme_dir . '; git remote -v', $remotes );\n\n\t\tpreg_match( '#origin[\\s\\t][email protected]\\:([^\\.]+)#', $remotes[0], $matches );\n\n\t\t$remote = $matches[1];\n\n\t\treturn $remote;\n\t}", "function get_composer_content($commit, $filename) {\n\n return json_decode(shell_exec('git show ' . $commit . ':' . $filename));\n}", "protected function makeRepositoryInterface()\n {\n if ($this->files->exists($path = $this->getInterfacePath())) {\n return $this->error($this->classParts() . 'Interface already exists!');\n }\n $this->makeDirectory($path);\n $this->files->put($path, $this->compileInterfaceStub());\n $this->info('Repository Interface created successfully.');\n }", "protected function getRepository() {}", "abstract public function repository();", "public static function git_commit() {\r\n\t\tcheck_admin_referer('plugin-name-action_wpidenonce'); \r\n\t\tif ( !is_super_admin() )\r\n\t\t\twp_die('<p>'.__('You do not have sufficient permissions to edit templates for this site. SORRY').'</p>');\r\n\t\t\r\n error_reporting(E_ALL);\r\n ini_set(\"display_errors\", 1);\r\n \r\n require_once('git/autoload.php.dist');\r\n //use TQ\\Git\\Cli\\Binary;\r\n //use TQ\\Git\\Repository\\Repository;\r\n \r\n $root = apply_filters( 'wpide_filesystem_root', WP_CONTENT_DIR ) . \"/\"; \r\n \r\n //check repo path entered or die\r\n if ( !strlen($_POST['gitpath']) ) \r\n die(\"Error: Path to your git repository is required!\");\r\n \r\n \r\n $repo_path = $root . sanitize_text_field( $_POST['gitpath'] );\r\n $gitbinary = sanitize_text_field( stripslashes($_POST['gitbinary']) );\r\n \r\n if ( $gitbinary===\"I'll guess..\" ){ //the binary path\r\n \r\n $thebinary = TQ\\Git\\Cli\\Binary::locateBinary();\r\n $git = TQ\\Git\\Repository\\Repository::open($repo_path, new TQ\\Git\\Cli\\Binary( $thebinary ) );\r\n \r\n }else{\r\n \r\n $git = TQ\\Git\\Repository\\Repository::open($repo_path, new TQ\\Git\\Cli\\Binary( $_POST['gitbinary'] ) );\r\n \r\n }\r\n \r\n $files = array();\r\n foreach ($_POST['files'] as $file){\r\n $files[] = base64_decode( $file );\r\n }\r\n \r\n //get the current user to be used for the commit\r\n $current_user = wp_get_current_user();\r\n \r\n $git->add( $files );\r\n $git->commit( sanitize_text_field($_POST['gitmessage']) , $files, \"{$current_user->user_firstname} {$current_user->user_lastname} <{$current_user->user_email}>\");\r\n\r\n wpide::show_changed_files();\r\n \r\n\t\tdie(); // this is required to return a proper result\r\n\t}", "abstract public function getRepository();", "abstract public function getRepository();", "function export(){\n\t\t$this->db_tools->export();\n\t\t$this->db_tools->echo_export();\n\t}", "public abstract function getRepository();", "public function exportAction()\n {\n $helpers = $this->get(\"app.helpers\");\n $em = $this->getDoctrine()->getManager();\n\n $comparendos = $em->getRepository('JHWEBContravencionalBundle:CvCdoComparendo')->findAll();\n \n $response = array(\n 'status' => 'success',\n 'code' => 200,\n 'message' => \"lista de comparendos\",\n 'data' => $comparendos,\n );\n return $helpers->json($response);\n }", "public function export()\n {\n //\n }", "function drush_default_content_deploy_export($entity_type_id) {\n $entity_ids = drush_get_option('entity_id', '');\n $entity_bundles = drush_get_option('bundle', '');\n $skip_entities = drush_get_option('skip_entities', '');\n\n /** @var \\Drupal\\default_content_deploy\\Exporter $exporter */\n $exporter = \\Drupal::service('default_content_deploy.exporter');\n try {\n $count = $exporter->export($entity_type_id, $entity_bundles, $entity_ids, $skip_entities);\n drush_log(dt('Exported @count entities.', ['@count' => $count]), 'success');\n }\n catch (\\InvalidArgumentException $e) {\n drush_print($e->getMessage());\n drush_print(dt('List of available content entity types:'));\n drush_print(implode(', ', array_keys($exporter->getContentEntityTypes())));\n }\n}", "public function repository(): RepositoryContract;", "protected function initializeEmptyGitRepository(): string\n {\n try {\n $repoPath = sys_get_temp_dir()\n . '/CaptainHook/tests/repo-'\n . time() . '-' . bin2hex(random_bytes(4));\n } catch (Exception $exception) {\n TestCase::fail($exception->getMessage());\n }\n\n $gitConfigFile = $repoPath . '/.git/config';\n\n $this->filesystem()->mkdir($repoPath);\n\n $this->mustRunInShell(['git', 'init', '--initial-branch=main', $repoPath]);\n $this->mustRunInShell(['git', 'config', '--file', $gitConfigFile, 'user.name', 'Acceptance Tester']);\n $this->mustRunInShell(['git', 'config', '--file', $gitConfigFile, 'user.email', '[email protected]']);\n\n return $repoPath;\n }", "protected static function getGitWrapper() {\n\t\t$dir = self::getGitDir();\n\t\tif ( !self::$git ) {\n\t\t\tself::$git = new GitWrapper();\n\n\t\t\t$extDir = MediaWikiServices::getInstance()->getMainConfig()->get( \"ExtensionDirectory\" );\n\t\t\tself::$git->setEnvVar( \"PERL5LIB\", \"$extDir/MABS/lib/mediawiki-git-remote/lib:\"\n\t\t\t\t\t\t\t\t . \"$extDir/MABS/lib/mediawiki-git-remote/localcpan\" );\n\t\t\tself::$git->setEnvVar( \"GIT_EXEC_PATH\", \"$extDir/MABS/lib/mediawiki-git-remote:\"\n\t\t\t\t\t\t\t\t . \"/usr/lib/git-core\" );\n\t\t\tself::$git->setEnvVar( \"GIT_MW_DEBUG\", \"1\" );\n\t\t\tself::$git->setEnvVar( \"GIT_TRACE\", \"0\" );\n\t\t\tif ( !chdir( $dir ) ) {\n\t\t\t\tthrow new ErrorPageError( \"mabs-system-error\", \"mabs-no-chdir\", $dir );\n\t\t\t}\n\t\t}\n\t\treturn self::$git->workingCopy( $dir );\n\t}", "protected function execute(InputInterface $input, OutputInterface $output)\n {\n $url = \"https://github.com/teamdigitalde/sitepackage-v10/archive/master.zip\";\n $extDir = Environment::getPublicPath().'/typo3conf/ext/';\n $ch = curl_init();\n\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Downloade Zip-Archiv.');\n\n $f = fopen($extDir.'/master.zip', 'w+');\n $opt = [\n CURLOPT_URL => $url,\n CURLOPT_FILE => $f,\n CURLOPT_FOLLOWLOCATION => true,\n // CURLOPT_RETURNTRANSFER => true,\n CURLOPT_BINARYTRANSFER => true,\n CURLOPT_HEADER => false,\n CURLOPT_SSL_VERIFYHOST => false,\n CURLOPT_SSL_VERIFYPEER => false,\n ];\n curl_setopt_array($ch, $opt);\n $file = curl_exec($ch);\n\n curl_close($ch);\n fclose($f);\n\n $zip = new \\ZipArchive();\n $res = $zip->open($extDir.'/master.zip');\n if ($res === TRUE) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('File wurde gefunden und wird nun entzippt.');\n $zip->extractTo($extDir); // wohin soll es entpackt werden\n $zip->close();\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Zip-Archiv wurde nicht gefunden.');\n }\n\n // Sync sitepackages\n $test = $this->smartCopy($extDir.'sitepackage-v10-master/',$extDir.'sitepackage/');\n if($test == TRUE) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Hat synchonisiert');\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Hat nicht synchonisiert');\n return false;\n }\n\n // Remove Files and Sitepackage\n if(file_exists($extDir.'sitepackage/'.'index.php')) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Lösche die Datei Sitepackage -> index.php');\n unlink($extDir.'sitepackage/'.'index.php');\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Die Datei Sitepackage -> index.php konnte nicht gefunden werden.');\n }\n if(file_exists($extDir.'sitepackage/'.'kickstart.sql')) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Lösche die Datei Sitepackage -> kickstart.sql');\n unlink($extDir.'sitepackage/'.'kickstart.sql');\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Die Datei Sitepackage -> kickstart.sql konnte nicht gefunden werden.');\n }\n if(file_exists($extDir.'sitepackage/'.'.htaccess')) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Lösche die Datei Sitepackage -> .htaccess');\n unlink($extDir.'sitepackage/'.'.htaccess');\n } else {\n \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Die Datei Sitepackage -> .htaccess konnte nicht gefunden werden.');\n }\n if(file_exists($extDir.'sitepackage/'.'.editorconfig')) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Lösche die Datei Sitepackage -> .editorconfig');\n unlink($extDir.'sitepackage/'.'.editorconfig');\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Die Datei Sitepackage -> .editorconfig konnte nicht gefunden werden.');\n }\n if(file_exists($extDir.'sitepackage/'.'.gitignore')) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Lösche die Datei Sitepackage -> .gitignore');\n unlink($extDir.'sitepackage/'.'.gitignore');\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Die Datei Sitepackage -> .gitignore konnte nicht gefunden werden.');\n }\n if(is_dir($extDir.'sitepackage/Build')) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Lösche den Ordner Sitepackage -> Build');\n $this->rrmdir($extDir.'sitepackage/Build');\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Der Ordner Sitepackage -> Build konnte nicht gefunden werden.');\n }\n if(is_dir($extDir.'sitepackage/autoload')) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Lösche den Ordner Sitepackage -> Autoload');\n $this->rrmdir($extDir.'sitepackage/autoload');\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Der Ordner Sitepackage -> Autoload konnte nicht gefunden werden.');\n }\n if(is_dir($extDir.'sitepackage/sites')) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Lösche den Ordner Sitepackage -> Sites');\n $this->rrmdir($extDir.'sitepackage/sites');\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Der Ordner Sitepackage -> Sites konnte nicht gefunden werden.');\n }\n if(is_dir($extDir.'sitepackage-v10-master')) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Lösche den Ordner Sitepackage -> Sitepackage-Master');\n $this->rrmdir($extDir.'sitepackage-v10-master');\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Der Ordner Sitepackage-Master konnte nicht gefunden werden.');\n }\n if(file_exists($extDir.'master.zip')) {\n unlink($extDir.'master.zip');\n }\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Das Sitepackage wurde erfolgreich aktualisiert.');\n $io = new SymfonyStyle($input, $output);\n $io->title($this->getDescription());\n $io->write('Write something');\n return 0;\n }", "public function _create_single_repo( $gitlab_path, $include_values, $is_public, $gh_repo_name ) {\n\n\t\tif ( 'all' === $include_values || in_array( 'all', $include_values ) ) {\n\n\t\t\t$migrate_data = [ 'issues', 'wiki', 'pr', 'snippets' ];\n\n\t\t} else {\n\n\t\t\t$migrate_data = $include_values;\n\n\t\t}\n\n\t\t[ 'group' => $group, 'name' => $project_name ] = $gitlab_path; // php 7.1 🚀\n\n\t\t$projects_data = get_projects( $gitlab_path );\n\n\t\tforeach ( $projects_data as $project ) {\n\t\t\tif ( strtolower( $group ) === strtolower( $project['namespace']['full_path'] ) ) {\n\t\t\t\tif ( ! empty( get_param_value( '--yes' ) || ask_yes_no( $project['path_with_namespace'] ) ) ) {\n\t\t\t\t\t$this->_create_repositories( $project, $migrate_data, $is_public, $gh_repo_name );\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t}", "public static function svnExportFromUllright($path, $targetDir = null)\n {\n // Get ullright repo root path\n $infoXml = shell_exec('svn info --xml plugins/ullCorePlugin/');\n $infoArray = simplexml_load_string($infoXml);\n $root = $infoArray->entry->repository->root;\n \n // Calculate target path\n if (!$targetDir)\n {\n $targetDir = dirname($path);\n }\n \n $filename = basename($path);\n \n $cmd = 'svn export ' . $root . '/trunk/' . $path . \n ' ' . $targetDir . '/' . $filename;\n \n return shell_exec($cmd);\n }", "abstract protected function getGitCommand(): string;", "public function create($remote = 'http://github.com/joomla/joomla-platform.git')\n\t{\n\t\t// Initialize variables.\n\t\t$out = array();\n\t\t$return = null;\n\n\t\t// We add the users repo to our remote list if it isn't already there\n\t\tif (!file_exists($this->_root . '/.git'))\n\t\t{\n\t\t\t// Execute the command.\n\t\t\texec('git clone -q ' . escapeshellarg($remote) . ' ' . escapeshellarg($this->_root), $out, $return);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new InvalidArgumentException('Repository already exists at ' . $this->_root . '.');\n\t\t}\n\n\t\t// Validate the response.\n\t\tif ($return !== 0)\n\t\t{\n\t\t\tthrow new RuntimeException(sprintf('The clone failed from remote %s with code %d and message %s.', $remote, $return, implode(\"\\n\", $out)));\n\t\t}\n\n\t\treturn $this;\n\t}", "public function get_repo_data(){\n\n\t\t\treturn $this->get_repo();\n\n\t\t}", "public function gitPull() {\n $current_branch = exec('git rev-parse --abbrev-ref HEAD');\n\n $collection = $this->collectionBuilder();\n $collection->taskGitStack()\n ->pull()\n ->run();\n\n $name = $this->confirm(\"Run Composer Install?\");\n if ($name) {\n $this->composerInstall();\n }\n\n $name = $this->confirm(\"Run Config Import?\");\n if ($name) {\n $this->drushCim();\n }\n }", "function download_project(){\n $this->_HTML = false;\n if(isset($this->_url_params['project_id'])) $project_id = $this->_url_params['project_id'];\n else exit();\n \n /**\n * @var \\AWorDS\\App\\Models\\Project $project\n */\n $project = $this->set_model();;\n $logged_in = $project->login_check();\n if($logged_in){\n if((string) ((int) $project_id) == $project_id AND $project->verify($project_id)) {\n $file = $project->export($project_id, Constants::EXPORT_ALL);\n if ($file != null) {\n header('Content-Type: ' . $file['mime']);\n header('Content-Disposition: attachment; filename=\"' . $file['name'] . '\"');\n readfile($file['path']);\n } else $this->redirect(Config::WEB_DIRECTORY . 'projects');\n }else $this->redirect(Config::WEB_DIRECTORY . 'projects');\n }else $this->redirect();\n }", "public function cloneRepository(Server $server, Application $application)\n {\n try {\n $this->getUser();\n\n $server->exec(\n view('scripts.deployments.bitbucket-deployment', [\n 'application' => $application,\n 'access_token' => $this->sourceProvider->access_token\n ])->render()\n ); \n } catch (ClientException $e) {\n if ($e->getResponse()->getStatusCode() === 401) {\n if ($this->retries <= $this->maxRetries) {\n $this->retries = $this->retries + 1;\n $this->refreshToken();\n }\n }\n }\n }", "public function repository()\n {\n return Repository::i();\n }", "public function writeRevision()\n {\n $locRev = $this->git->localRevision();\n $temp = tempnam(sys_get_temp_dir(), 'gitRevision');\n\n file_put_contents($temp, $locRev);\n ftp_put($this->connection, $this->revisionFile, $temp, FTP_BINARY);\n unlink($temp);\n }", "protected static function getGitDir() {\n\t\tif ( !self::$gitDir ) {\n\t\t\t$conf = MediaWikiServices::getInstance()->getConfigFactory()->makeConfig( \"MABS\" );\n\t\t\tself::$gitDir = $conf->get( Config::REPO );\n\t\t}\n\t\treturn self::$gitDir;\n\t}", "public function export()\n {\n }", "private function get_repository_info() {\n if ( is_null( $this->github_response ) ) {\n $request_uri = sprintf( 'https://api.github.com/repos/%s/%s/releases', $this->username, $this->repository );\n\n $response = json_decode( wp_remote_retrieve_body( wp_remote_get( $request_uri ) ), true );\n if( is_array( $response ) ) {\n $response = current( $response );\n }\n $this->github_response = $response;\n }\n }", "public function getName()\n\t{\n\t\treturn 'git';\n\t}", "public function export($baseId);" ]
[ "0.6487203", "0.6383873", "0.587284", "0.57490593", "0.57172847", "0.5669102", "0.5661655", "0.56557685", "0.56092596", "0.56021774", "0.5447175", "0.5383424", "0.5302148", "0.53012496", "0.529111", "0.52697265", "0.5154076", "0.51367396", "0.50754076", "0.50661576", "0.5041692", "0.5030542", "0.50285643", "0.5023216", "0.49835745", "0.49651533", "0.49651533", "0.49651533", "0.49651533", "0.49651533", "0.4959942", "0.49572492", "0.48892516", "0.4881587", "0.48812684", "0.4879436", "0.48256338", "0.48253518", "0.4820376", "0.4815357", "0.48148125", "0.4800733", "0.4794684", "0.479404", "0.4752913", "0.475238", "0.47511464", "0.47448352", "0.4728095", "0.4725479", "0.47188094", "0.47104207", "0.469375", "0.4691099", "0.46851045", "0.46731964", "0.46515673", "0.46294156", "0.46243137", "0.46129304", "0.4597963", "0.4591667", "0.45617953", "0.4547362", "0.45466936", "0.45385492", "0.45221844", "0.4507932", "0.45046502", "0.45041895", "0.449633", "0.44741184", "0.44728285", "0.44678736", "0.4467536", "0.44626647", "0.44626647", "0.44608667", "0.44545355", "0.44341275", "0.4432516", "0.44315696", "0.44304448", "0.44236884", "0.44231784", "0.44229698", "0.44175333", "0.4414351", "0.44123405", "0.44052786", "0.44004706", "0.4398532", "0.43839285", "0.43835425", "0.43817312", "0.43812093", "0.43753093", "0.43719783", "0.43658406", "0.43495244", "0.43486005" ]
0.0
-1
Return an array containing the status of any modified files in the repository.
public static function getStatus($path) { if (!file_exists($path)) { throw new Exception( "Unable to get git status of $path. Path does not exist."); } if (!is_dir($path)) { throw new Exception( "Unable to get git status of $path. Path is not a directory."); } if (!self::isRepo($path)) { throw new Exception( "Unable to get git status of $path. Path is not a git repository."); } $origCwd = getcwd(); chdir($path); $output = array(); exec("git status --porcelain", $output); if (count($output) === 0) { return $output; } $files = array(); foreach ($output AS $status) { $flag = substr($status, 0, 2); $file = trim(substr($status, 2)); $idx = null; $fileInfo = null; switch ($flag) { case ' M': // Modified, not updated $idx = 'changed'; $fileInfo = $file; break; case 'A ': // New file $idx = 'new'; $fileInfo = $file; break; case 'D ': // Deleted file $idx = 'removed'; $fileInfo = $file; break; case 'M ': // Modified, updated $idx = 'modified'; $fileInfo = $file; break; case 'R ': // Renamed $idx = 'moved'; $fileInfo = array_map(function ($a) { return trim($a); }, explode('->', $file)); break; case '??': // Untracked $idx = 'untracked'; $fileInfo = $file; break; default: assert("false /*Unrecognized git status flag $flag*/"); } if ($idx !== null) { if (!isset($files[$idx])) { $files[$idx] = array(); } $files[$idx][] = $fileInfo; } } chdir($origCwd); return $files; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function getFiles()\n {\n $process = new Process('git diff --cached --name-status --diff-filter=ACMR');\n $process->run();\n\n if ($process->isSuccessful()) {\n return \\array_filter(\\explode(\"\\n\", $process->getOutput()));\n }\n\n return [];\n }", "public function analyzeModifications()\n {\n $this->logManager->logMessage(lang('Revision.analyzeModifications'));\n\n foreach ($this->files as $file) {\n // Compare the previous snapshot with the new snapshot from update.\n $oldCopy = $this->workspace . 'oldSnapshot' . \\DIRECTORY_SEPARATOR . $file['destination'];\n $project = $this->config->rootPath . $file['destination'];\n $doCopy = true;\n\n // If hashes are different, this can be new or modified.\n if (! FileManager::areIdenticalFiles($oldCopy, $file['origin'])\n || ($this->config->fallThroughToProject && ! FileManager::areIdenticalFiles($project, $file['origin']))\n ) {\n $newCopy = $this->workspace . 'newSnapshot' . \\DIRECTORY_SEPARATOR . $file['destination'];\n\n try {\n if (! is_file($oldCopy) || ! is_file($project)) {\n $this->fileManager->createdFiles[] = $file['destination']; // @codeCoverageIgnore\n } elseif (is_file($file['origin'])) {\n $this->fileManager->modifiedFiles[] = $file['destination'];\n } else {\n // @codeCoverageIgnoreStart\n $this->fileManager->deletedFiles[] = $file['destination'];\n $doCopy = false;\n // @codeCoverageIgnoreEnd\n }\n\n if ($doCopy) {\n $this->filesystem->copy($file['origin'], $newCopy, true);\n }\n\n // @codeCoverageIgnoreStart\n } catch (IOExceptionInterface $e) {\n $this->logManager->logMessage($e->getMessage(), 'error');\n // @codeCoverageIgnoreEnd\n }\n }\n }\n\n // Log the update results\n $cc = \\count($this->fileManager->createdFiles);\n $mc = \\count($this->fileManager->modifiedFiles);\n $dc = \\count($this->fileManager->deletedFiles);\n\n $cs = 1 === $cc ? lang('Revision.fileSingular') : lang('Revision.filePlural');\n $ms = 1 === $mc ? lang('Revision.fileSingular') : lang('Revision.filePlural');\n $ds = 1 === $dc ? lang('Revision.fileSingular') : lang('Revision.filePlural');\n\n $this->logManager->logMessage([\n lang('Revision.createdFilesAfterUpdate', [$cc, $cs]),\n lang('Revision.modifiedFilesAfterUpdate', [$mc, $ms]),\n lang('Revision.deletedFilesAfterUpdate', [$dc, $ds]),\n ]);\n }", "protected function getCreatedFilesWorldWritableStatus() {}", "public function getFiles()\n\t{\n\t\tif ($this->_files === null) {\n\t\t\t$command = 'show --pretty=\"format:\" --name-only '.$this->hash;\n\t\t\tforeach(explode(\"\\n\",$this->repository->run($command)) as $line) {\n\t\t\t\t$this->_files[] = trim($line);\n\t\t\t}\n\t\t}\n\t\treturn $this->_files;\n\t}", "protected function getFilesToCheck(Repository $repository): array\n {\n return $repository->getIndexOperator()->getStagedFiles();\n }", "public function getFilesAdded(): array\n {\n return $this->files_added;\n }", "public function getFiles() {\n\t\tif ($this->_files === null) {\n\t\t\t$command = 'show --pretty=\"format:\" --name-only '.$this->hash;\n\t\t\tforeach(explode(\"\\n\",$this->branch->repository->run($command)) as $line) {\n\t\t\t\t$this->_files[] = trim($line);\n\t\t\t}\n\t\t}\n\t\treturn $this->_files;\n\t}", "public function checkStatus() {\r\n\t\t$tmpArray = [1, 1]; // INIT;\r\n\t\t\r\n\t\t$tmpArray = [ $this->is_updated[0], $this->is_updated[1] ];\r\n\t\treturn $tmpArray;\r\n\t}", "public function git_working_branch_status()\n\t{\n\t\t$remotes = $this->git_remotes();\n\n\t\t$status = array();\n\n\t\tforeach( $remotes as $remote )\n\t\t{\n\t\t\texec( __DIR__ . \"/git-log {$this->theme_dir} {$remote} '>'\", $ahead );\n\t\t\texec( __DIR__ . \"/git-log {$this->theme_dir} {$remote} '<'\", $behind );\n\n\t\t\t$status[ $remote ]['ahead'] = (int) $ahead[0];\n\t\t\t$status[ $remote ]['behind'] = (int) $behind[0];\n\t\t}//end foreach\n\n\t\treturn $status;\n\t}", "public function localRepository()\r\n\t{\r\n\t\t$scanned = array_diff(scandir($this->migrationFiles), array('.', '..'));\r\n\t\treturn $scanned;\r\n\t}", "protected function detectChangedFiles(array $pathAndFilenames)\n {\n $changedFiles = array();\n foreach ($pathAndFilenames as $pathAndFilename) {\n $status = $this->changeDetectionStrategy->getFileStatus($pathAndFilename);\n if ($status !== \\TYPO3\\Flow\\Monitor\\ChangeDetectionStrategy\\ChangeDetectionStrategyInterface::STATUS_UNCHANGED) {\n $changedFiles[$pathAndFilename] = $status;\n }\n }\n return $changedFiles;\n }", "public function getModified($file);", "function get_changes($path, $to, $from = null) {\n $changes = [];\n $currentPath = getcwd();\n chdir($path);\n\n if ($from == null) {\n $shellOutput = shell_exec('git log --pretty=oneline ' . $to);\n } else {\n $shellOutput = shell_exec('git log --pretty=oneline ' . $from . '...' . $to);\n }\n\n $lines = preg_split('/\\R/', trim($shellOutput));\n foreach ($lines as $line) {\n if (null != $line) {\n $changes[substr($line, 0, 40)] = trim(substr($line, 40, strlen($line)));\n } else {\n echo 'Could not get changes of repository ' . $path . PHP_EOL;\n }\n }\n\n chdir($currentPath);\n\n return $changes;\n}", "public function detectChanges()\n {\n return [];\n }", "public static function getStatuses(): array;", "public function lastModified(){\n if( $this->modifications ){\n return end( $this->modifications );\n }\n }", "public function getFiles()\n {\n return isset($this->source['files']) && is_array($this->source['files']) ? $this->source['files'] : [];\n }", "public function getChangedFiles( $baseDir, $from, $to )\r\n {\r\n $patchFile = 'patch-' . str_random( 8 ) . '.tmp';\r\n\r\n if ( file_exists( $patchFile ) )\r\n {\r\n unlink( $patchFile );\r\n }\r\n\r\n $baseDir = str_replace( '/', DIRECTORY_SEPARATOR, trim( $baseDir ) );\r\n\r\n if ( DIRECTORY_SEPARATOR !== $baseDir[ strlen( $baseDir ) - 1 ] )\r\n {\r\n $baseDir .= DIRECTORY_SEPARATOR;\r\n }\r\n\r\n try\r\n {\r\n $result = [ 'added' => [ ], 'modified' => [ ], 'deleted' => [ ] ];\r\n\r\n $cmd = 'git diff --name-status --patch';\r\n\r\n $cmd = $cmd . \" $from $to\";\r\n $cmd = $cmd . ' > ' . $patchFile;\r\n $out = [ ];\r\n $ret = NULL;\r\n\r\n exec( $cmd, $out, $ret );\r\n\r\n $output = file_get_contents( $patchFile );\r\n\r\n $files = explode( \"\\n\", $output );\r\n\r\n foreach ( $files as $file )\r\n {\r\n if ( 0 === strlen( trim( $file ) ) )\r\n {\r\n continue;\r\n }\r\n\r\n list( $type, $path ) = explode( \"\\t\", $file );\r\n\r\n switch ( trim( $type ) )\r\n {\r\n case 'A':\r\n $result[ 'added' ][] = str_replace( '/', DIRECTORY_SEPARATOR, $baseDir . $path );\r\n break;\r\n case 'M':\r\n $result[ 'modified' ][] = str_replace( '/', DIRECTORY_SEPARATOR, $baseDir . $path );\r\n break;\r\n case 'D':\r\n $result[ 'deleted' ][] = str_replace( '/', DIRECTORY_SEPARATOR, $baseDir . $path );\r\n break;\r\n case 'C':\r\n case 'R':\r\n list( $from, $to ) = explode( \"\\t\", $path );\r\n $result[ 'deleted' ][] = str_replace( '/', DIRECTORY_SEPARATOR, $baseDir . $from );\r\n $result[ 'added' ][] = str_replace( '/', DIRECTORY_SEPARATOR, $baseDir . $to );\r\n break;\r\n default:\r\n syslog( LOG_ALERT, 'Unknown Value - Type: ' . $type . ' - Path: ' . $path );\r\n break;\r\n }\r\n }\r\n\r\n if ( file_exists( $patchFile ) )\r\n {\r\n unlink( $patchFile );\r\n }\r\n\r\n return $result;\r\n }\r\n catch ( Exception $e )\r\n {\r\n echo $e->getMessage() . PHP_EOL;\r\n\r\n if ( file_exists( $patchFile ) )\r\n {\r\n unlink( $patchFile );\r\n }\r\n }\r\n\r\n return NULL;\r\n }", "public function getFilestatus()\n {\n return $this->filestatus;\n }", "function listLastupdate() {\n //$fileList = glob(\"../blogs/*.md\");\n $fileList = glob(\"blogs/*.md\");\n array_multisort(\n array_map( 'filemtime', $fileList ),\n SORT_NUMERIC,\n SORT_DESC,\n $fileList\n );\n\n $resultList = array();\n\n foreach ($fileList as $filename) {\n $fp = fopen($filename, \"r\");\n $content = fread($fp, filesize($filename));\n fclose($fp);\n\n $contentSplit = explode('---', $content);\n $headers = Yaml::parse($contentSplit[0]);\n\n if( $headers['published'] == 'true' ) {\n $result = new stdClass;\n $result->title = $headers['title'];\n $result->content = Markdown::defaultTransform($contentSplit[1]);;\n $resultList[$filename] = $result;\n }\n }\n return $resultList;\n}", "function GetUpdatesFilesList($updates_dir)\n\t{\n\t\t$updates = array(); \n\t\t\n\t\t$d = dir(\"$updates_dir\");\n\t\twhile (false !== ($entry = $d->read())) {\n\t\t\tif (preg_match('/^update-(.+?) (\\d+)(.*?)\\.php/', $entry, $match)) {\n\t\t\t\t$item = array (\n\t\t\t\t\t'filename' => $entry,\n\t\t\t\t\t'type' => strtoupper($match[1]),\n\t\t\t\t\t'rev_num' => (int)$match[2],\n\t\t\t\t\t'desc' => trim($match[3]),\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$updates[$item['rev_num'].'-'.$item['type']] = $item;\n\t\t }\n\t\t}\n\t\t$d->close();\n\t\t\n\t\treturn $updates;\n\t}", "public function getFiles() : array\n {\n return $this->files;\n }", "public function getFiles(): array\n {\n return $this->files;\n }", "function getfileModifiedDates($fileArray){\n $imageDatesArray = [];\n date_default_timezone_set('America/Sao_Paulo');\n foreach($fileArray as $file){\n $imageDatesArray[] = date(\"d/m/Y H:i:s\", strtotime($file[\"modifiedTime\"]));\n }\n return $imageDatesArray;\n}", "function list_files () {\n\t\t$root = $this->get_root();\n\t\t\n\t\treturn $this->_list_files($root);\n\t}", "function updatedb_status() {\n $return = array();\n\n $modules = drupal_get_installed_schema_version(NULL, FALSE, TRUE);\n foreach ($modules as $module => $schema_version) {\n $updates = drupal_get_schema_versions($module);\n // Skip incompatible module updates completely, otherwise test schema versions.\n if (!update_check_incompatibility($module) && $updates !== FALSE && $schema_version >= 0) {\n // module_invoke returns NULL for nonexisting hooks, so if no updates\n // are removed, it will == 0.\n $last_removed = module_invoke($module, 'update_last_removed');\n if ($schema_version < $last_removed) {\n drush_set_error('PROVISION_DRUPAL_UPDATE_FAILED', dt( $module .' module can not be updated. Its schema version is '. $schema_version .'. Updates up to and including '. $last_removed .' have been removed in this release. In order to update '. $module .' module, you will first <a href=\"http://drupal.org/upgrade\">need to upgrade</a> to the last version in which these updates were available.'));\n continue;\n }\n\n $updates = drupal_map_assoc($updates);\n\n // Record the starting update number for each module.\n foreach (array_keys($updates) as $update) {\n if ($update > $schema_version) {\n $start[$module] = $update;\n break;\n }\n }\n if (isset($start['system'])) {\n // Ensure system module's updates run first.\n $start = array('system' => $start['system']) + $start;\n }\n\n // Record any pending updates. Used for confirmation prompt.\n foreach (array_keys($updates) as $update) {\n if ($update > $schema_version) {\n if (class_exists('ReflectionFunction')) {\n // The description for an update comes from its Doxygen.\n $func = new ReflectionFunction($module. '_update_'. $update);\n $description = trim(str_replace(array(\"\\n\", '*', '/'), '', $func->getDocComment()));\n }\n if (empty($description)) {\n $description = dt('description not available');\n }\n\n $return[] = array('module' => ucfirst($module), 'update_id' => $update, 'description' => $description);\n }\n }\n }\n }\n\n return array($return, $start);\n}", "public function getContent_statusArray() {\n\t\tif (!$this->_content_statusArray) {\n\t\t\t$this->_content_statusArray[CONTENT_CONTENT_STATUS_PUBLISHED] = _CO_CONTENT_CONTENT_STATUS_PUBLISHED;\n\t\t\t$this->_content_statusArray[CONTENT_CONTENT_STATUS_PENDING] = _CO_CONTENT_CONTENT_STATUS_PENDING;\n\t\t\t$this->_content_statusArray[CONTENT_CONTENT_STATUS_DRAFT] = _CO_CONTENT_CONTENT_STATUS_DRAFT;\n\t\t\t$this->_content_statusArray[CONTENT_CONTENT_STATUS_PRIVATE] = _CO_CONTENT_CONTENT_STATUS_PRIVATE;\n\t\t\t$this->_content_statusArray[CONTENT_CONTENT_STATUS_EXPIRED] = _CO_CONTENT_CONTENT_STATUS_EXPIRED;\n\t\t}\n\t\treturn $this->_content_statusArray;\n\t}", "public function pendingMigrations()\r\n\t{\r\n\t\t$outstanding = [];\r\n\t\t$this->ensureMigrationBinExist();\r\n\t\tforeach ($this->localRepository() as $file) {\r\n\t\t\t$line = $this->removeDotPhp($file);\r\n\r\n\t\t\t// Once we grab all of the migration files for the path, we will compare them\r\n\t\t\t// against the migrations that have already been run for this package then\r\n\t\t\t// run each of the outstanding migrations against a database connection.\r\n\t\t\t$result = $this->repository->getRan();\r\n\t\t\tif (!in_array($line, $result)) {\r\n\t\t\t\t$outstanding[] = $file;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn $outstanding;\r\n\t}", "public function statuses(): array\n {\n $json = $this->parent->performAPICallWithJsonResponse('get', 'artwork/statuses');\n return DataParser::parseDataArray($json, ArtworkStatus::class);\n }", "public function updateGitHooks()\n {\n $tasks = [];\n $hooks = ['pre-commit'];\n \n foreach($hooks as $hook) {\n $tasks += $this->getAppendingTasks($hook);\n }\n\n return $this->collectionBuilder()->addTaskList($tasks);\n }", "function GetUpdatesList($updates_dir)\n\t{\n\t\t$updates = $this->GetUpdatesFilesList($updates_dir);\n\t\t\n\t\t// get statuses from database\n\t\t$this->db->q('SELECT * FROM #_PREF_updates');\n\t\twhile ($item = $this->db->fetchAssoc()) {\n\t\t\t$u_id = $item['rev_num'].'-'.strtoupper($item['type']);\n\t\t\tif (isset($updates[$u_id])) {\n\t\t\t\t$updates[$u_id]['status'] = $item['status'];\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tforeach ($updates as $k=>$update) {\n\t\t\t// remove update\n\t\t\tif ($this->do_not_show_included_updates && $update['rev_num'] <= $this->current_revision) {\n\t\t\t\tunset($updates[$k]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t// set update status\n\t\t\tif (empty($updates[$k]['status'])) {\n\t\t\t\tif ($update['rev_num'] <= $this->current_revision) $updates[$k]['status'] = 'included';\n\t\t\t\telse $updates[$k]['status'] = 'not applied';\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif ($update['rev_num'] <= $this->current_revision) $updates[$k]['status'] = 'included';\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tswitch ($updates[$k]['status']) {\n\t\t\t\tcase 'ok': $updates[$k]['status_html'] = '<span style=\"color: green; font-weight: bold;\">Ok</span>'; break;\n\t\t\t\tcase 'included': $updates[$k]['status_html'] = '<span style=\"color: silver; font-weight: bold;\">Included</span>'; break;\n\t\t\t\tcase 'not applied': $updates[$k]['status_html'] = '<span style=\"color: #D2D200; font-weight: bold;\">Not Applied</span>'; break;\n\t\t\t\tcase 'error': $updates[$k]['status_html'] = '<span style=\"color: red; font-weight: bold;\">Error!</span>'; break;\n\t\t\t\tdefault: \n\t\t\t\t\t$updates[$k]['status_html'] = $updates[$k]['status'];\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tuksort($updates, \"compare_updates\");\n\t\t\n\t\t/*echo \"<pre>\";\n\t\tvar_dump($updates);\n\t\techo \"</pre>\";*/\n\t\t\t\t\n\t\treturn $updates;\n\t}", "private function get_files(): array {\n\t\t$files = [];\n\n\t\tif ( $this->directory->is_readable() ) {\n\t\t\tforeach ( $this->directory->get_files() as $file ) {\n\t\t\t\tif ( ! $file->isFile() || ! $file->isReadable() || $file->getSize() === 0 ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif ( $this->extension !== null && $this->extension !== $file->getExtension() ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$files[] = $file->getFileInfo();\n\t\t\t}\n\t\t}\n\n\t\treturn $files;\n\t}", "private function getAvailableUpdates()\n\t{\n\t\t$updateArray = array();\n\t\t$updateFiles = get_dir_contents (INCLUDE_FILES . '/updates');\n\n\t\tforeach ($updateFiles as $file)\n\t\t{\n\t\t\t$updateVersion = substr($file, -8, -4);\n\t\t\t// .. and where the version indicator is greater than the current ph version\n\t\t\tif (ctype_digit($updateVersion) && $this->currentVersion < (int)$updateVersion)\n\t\t\t{\n\t\t\t\t$updateArray[$updateVersion] = $file;\n\t\t\t}\n\t\t}\n\n\t\tasort($updateArray); // vital to get them in the correct order!\n\n\t\treturn $updateArray;\n\t}", "public function getStatus()\n {\n return $this->file->get('status');\n }", "public function getStatusList()\n {\n return [\n self::STATUS_CREATED,\n self::STATUS_SUCCESS,\n self::STATUS_FAIL\n ];\n }", "public function getBuiltFiles()\n {\n return $this->builtFiles;\n }", "public function getLastModifiedAudit();", "public function getMonitoredFiles()\n {\n return $this->monitoredFiles;\n }", "function GetProjectStatuses()\n\t{\n\t\t$result = $this->sendRequest(\"GetProjectStatuses\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}", "function &getStatus(){\n\t\treturn array();\n\t}", "private function getChangeArr(\\SimpleXMLElement $xml) {\n\t\t\t$files\t\t = array(\n\t\t\t\t'deleted'\t=> array(),\n\t\t\t\t'changed'\t=> array(),\n\t\t\t\t'other'\t\t=> array()\n\t\t\t);\n\n\t\t\tforeach($xml->paths->path as $file) {\n\t\t\t\t// extract file path\n\t\t\t\t$svnPath\t= $file->__toString();\n\t\t\t\t$path\t\t= $this->getPathWithoutSVNUrl($svnPath);\n\t\t\t\t$tempPath\t= $this->getTempPathForFile($path);\n\n\t\t\t\t// get the current type\n\t\t\t\t$type = (string) $file['item'];\n\n\t\t\t\t// if path is in ignore list, or the repository itself ignore them\n\t\t\t\tif($this->isInIgnoreList($path)\n\t\t\t\t\t|| $file == rtrim($this->getRepositoryUrl(), DS)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// file info to reduce replaces in other classe\n\t\t\t\t$fileInfo = array(\n\t\t\t\t\t'tempPath'\t=> $tempPath,\n\t\t\t\t\t'path'\t\t=> $path,\n\t\t\t\t\t'svnPath'\t=> $svnPath\n\t\t\t\t);\n\n\t\t\t\tswitch($type) {\n\t\t\t\t\tcase 'modified':\n\t\t\t\t\tcase 'added':\t\t// file to upload\n\t\t\t\t\t\t// set array key to have every file only once\n\t\t\t\t\t\t$files['changed'][$path] = $fileInfo;\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'deleted':\t\t// file to delete\n\t\t\t\t\t\t// set array key to have every file only once\n\t\t\t\t\t\t$files['deleted'][$path] = $fileInfo;\n\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\t\t\t// files where the svn properties changed\n\t\t\t\t\t\t$files['other'][$path] = $fileInfo;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $files;\n\t\t}", "public function getLastUpdatedDatas(): array\n {\n $default = ['_wpgb_last_sync' => 0];\n\n $lastUpdatedFile = $this->getLastUpdatedFile();\n\n if (!file_exists($lastUpdatedFile)) {\n return $default;\n }\n\n $this->lastUpdated = include $lastUpdatedFile;\n\n if (!is_array($this->lastUpdated)) {\n return $default;\n }\n\n if (!isset($this->lastUpdated['_wpgb_last_sync'])) {\n $this->lastUpdated['_wpgb_last_sync'] = 0;\n }\n\n return $this->lastUpdated;\n }", "public function files()\n {\n return $this->_array[\"files\"];\n }", "public abstract function getStagedFiles();", "public function detectChanges()\n {\n $changedDirectories = array();\n $changedFiles = $this->detectChangedFiles($this->monitoredFiles);\n\n foreach ($this->monitoredDirectories as $path => $filenamePattern) {\n if (!isset($this->directoriesAndFiles[$path])) {\n $currentSubDirectoriesAndFiles = $this->readMonitoredDirectoryRecursively($path);\n $this->directoriesAndFiles[$path] = $currentSubDirectoriesAndFiles;\n\n $this->directoriesChanged = true;\n $changedDirectories[$path] = \\TYPO3\\Flow\\Monitor\\ChangeDetectionStrategy\\ChangeDetectionStrategyInterface::STATUS_CREATED;\n }\n }\n\n foreach ($this->directoriesAndFiles as $path => $pathAndFilenames) {\n try {\n $currentSubDirectoriesAndFiles = $this->readMonitoredDirectoryRecursively($path);\n if ($currentSubDirectoriesAndFiles != $pathAndFilenames) {\n $pathAndFilenames = array_unique(array_merge($currentSubDirectoriesAndFiles, $pathAndFilenames));\n $this->directoriesAndFiles[$path] = $pathAndFilenames;\n $this->directoriesChanged = true;\n }\n $changedFiles = array_merge($changedFiles, $this->detectChangedFiles($pathAndFilenames));\n } catch (\\TYPO3\\Flow\\Utility\\Exception $exception) {\n unset($this->directoriesAndFiles[$path]);\n $this->directoriesChanged = true;\n $changedDirectories[$path] = \\TYPO3\\Flow\\Monitor\\ChangeDetectionStrategy\\ChangeDetectionStrategyInterface::STATUS_DELETED;\n }\n }\n\n if (count($changedFiles) > 0) {\n $this->emitFilesHaveChanged($this->identifier, $changedFiles);\n }\n if (count($changedDirectories) > 0) {\n $this->emitDirectoriesHaveChanged($this->identifier, $changedDirectories);\n }\n if (count($changedFiles) > 0 || count($changedDirectories) > 0) {\n $this->systemLogger->log(sprintf('File Monitor \"%s\" detected %s changed files and %s changed directories.', $this->identifier, count($changedFiles), count($changedDirectories)), LOG_INFO);\n }\n }", "public function status()\n {\n return array_map(\n function (array $status) {\n return Status::fromArray($status);\n },\n $this->client->get('status')\n );\n }", "public function getFiles(): array\n {\n return [$this->file];\n }", "public function getFiles()\n {\n if (isset($this->raw->files)) {\n $base = $this->getBasePath();\n $files = array();\n\n foreach ((array) $this->raw->files as $file) {\n $file = new SplFileInfo(\n $path = $base . DIRECTORY_SEPARATOR . Path::canonical($file)\n );\n\n if (false === $file->isFile()) {\n throw new RuntimeException(\n sprintf(\n 'The file \"%s\" does not exist or is not a file.',\n $path\n )\n );\n }\n\n $files[] = $file;\n }\n\n return $files;\n }\n\n return array();\n }", "public function getUpdatedTypes()\n {\n return $this->updatedTypes;\n }", "public function getStatuses() {\n\t}", "public function getAll()\n {\n return $files;\n }", "public function getFiles() : Array\n\t{\n\t\t$files = [];\n\n\t\tif ($this->exists() && $this->isReadable()) {\n\n\t\t\t$directory = opendir($this->directory);\n\t\t\twhile($opened = readdir($directory)) {\n\t\t\t\n\t\t\t\tif (is_file($this->directory . DIRECTORY_SEPARATOR . $opened) && !Directory::isBlockListed($opened)) {\n\t\t\t\t\t$files[] = $opened;\n\t\t\t\t}\n\t\t\n\t\t\t}\n\n\t\t\tclosedir($directory);\n\t\t}\n\n\t\treturn $files;\n\t}", "protected function getMainRepositoryStatus() {}", "public function getCurrentWorkflows()\n {\n $files = scandir(base_path().'/app/Trident/Workflows/Logic/');\n\n $filenames = [];\n foreach ($files as $file) {\n if ($file != '.' && $file != '..') {\n $filenames []= str_replace('.php','',$file);\n }\n }\n\n return $filenames;\n }", "public function getExecutedFiles()\n\t\t{\n\t\t\treturn $this->_executedFiles;\n\t\t}", "public function getFiles(): array\n {\n return $this->pluginRepository->config('stubs.files');\n }", "public function Get_Status() {\n $flags = array(\n 'complete' => array(\n 'code' => 'complete',\n 'name' => 'Complete',\n //'_update' => array($this,'_Status_Make_Complete'),\n ),\n 'cool' => array(\n 'code' => 'cool',\n 'name' => 'Cool',\n //'_update' => array($this,'_Status_Make_Complete'),\n )\n );\n // Apply any filter for adding to the flag list\n $status = apply_filters('vcff_reports_status',$status,$this);\n // Return the flag list\n return $flags;\n }", "public function getModified() {}", "public function getUnresolvedStatusDependencies(): array\n {\n return $this->unresolved_status_dependencies;\n }", "public function fileList()\n {\n return array_values(array_diff(scandir($this->location), ['.', '..']));\n }", "public function getStagedFiles()\n {\n $base = $this->getProjectBase();\n\n $files = new FileCollection();\n\n foreach ($this->getFiles() as $file) {\n $fileData = \\explode(\"\\t\", $file);\n $status = \\reset($fileData);\n $relativePath = \\end($fileData);\n\n $fullPath = \\rtrim($base . DIRECTORY_SEPARATOR . $relativePath);\n\n $file = new File($status, $fullPath, $base);\n $this->saveFileToCache($file);\n $files->append($file);\n }\n\n return $files;\n }", "protected function getFileSystemStatus() {}", "protected function getFiles(): array\n {\n return [];\n }", "public static function getModifiedDate($path) {\n\n //Check for the last modified \n $lmodified = 0;\n $files = glob($path . '/*');\n\n foreach ($files as $file) {\n if (is_dir($file)) {\n $modified = dirmtime($file);\n } else {\n $modified = filemtime($file);\n }\n if ($modified > $lmodified) {\n $lmodified = $modified;\n }\n }\n return $lmodified;\n }", "public function getFiles(): array;", "public function getRepos()\n {\n $success = true;\n\n // Check the DB to see if the repos already exist.\n $stmt = Db::$pdo->query(\"SELECT updated FROM config where item = 'lastRepoUpdate' LIMIT 1\");\n $logExists = $stmt->rowCount();\n $result = $stmt->fetch();\n\n // Use PHP time instead of MySQL so that we ensure the\n // timezone is consistent throughout the app.\n $nowDt = new \\DateTimeImmutable('now');\n $now = $nowDt->format('Y-m-d H:i:s');\n\n // If there is no log entry\n if (!$logExists) {\n\n // Update the repos\n $success = $this->saveUpdateRepos();\n if ($success) {\n // If they were saved properly,\n // insert a new entry for the time for the last repo update\n $stmt = Db::$pdo->prepare(\"INSERT INTO config\n (item, updated)\n VALUES ('lastRepoUpdate', :now )\");\n $stmt->bindParam(':now', $now);\n $stmt->execute();\n }\n\n } else { // There is a log entry\n\n // We're only going to update the repos every 15 min.\n // So lets check to see if they need to be updated.\n $lastUpdateDt = new \\DateTime($result['updated']);\n // go back 15 min\n $timeToUpdateDt = $nowDt->modify('-15 minutes');\n\n // Check to see if we need to update\n if ($lastUpdateDt < $timeToUpdateDt) {\n\n // Update the repos\n $success = $this->saveUpdateRepos();\n if ($success) {\n // If they were updated properly,\n // Update the time for the last repo update\n $stmt = Db::$pdo->prepare(\"UPDATE config\n SET updated = :now\n WHERE item = 'lastRepoUpdate' \");\n $stmt->bindParam(':now', $now);\n $stmt->execute();\n }\n }\n }\n\n // If there was a problem, return error\n if (!$success) {\n return [\n 'status' => 'error',\n 'message' => $this->error\n ];\n }\n\n // Get the total count from the db\n $stmt = Db::$pdo->prepare(\"SELECT amount FROM config\n WHERE item = 'totalRepos' LIMIT 1 \");\n $stmt->execute();\n\n $total = $stmt->fetch();\n $total = $total['amount'];\n\n\n // Get the repo info from the db\n $stmt = Db::$pdo->prepare(\"SELECT * FROM repos\");\n $stmt->execute();\n\n $items = $stmt->fetchAll();\n\n\n return [\n 'status' => 'success',\n 'total' => $total,\n 'items' => $items\n ];\n }", "public function files()\r\n {\r\n return $this->files;\r\n }", "public function getModifications()\n {\n return $this->modifications;\n }", "function getModifiedTests()\n {\n // first scan for new .phpt files\n foreach (new \\RegexIterator(\n new \\RecursiveIteratorIterator(\n new \\RecursiveDirectoryIterator($this->testpath,\n 0|\\RecursiveDirectoryIterator::SKIP_DOTS)),\n '/\\.phpt$/') as $file) {\n if (strpos((string) $file, '.svn')) {\n continue;\n }\n $tests[] = realpath((string) $file);\n }\n $newtests = array();\n foreach ($tests as $path) {\n if ($path == $this->db->querySingle('SELECT testpath FROM tests WHERE testpath=\"' .\n $this->db->escapeString($path) . '\"')) {\n continue;\n }\n $newtests[] = $path;\n }\n\n $modifiedPaths = array();\n $modifiedTests = array();\n $paths = $this->retrievePaths(1);\n echo \"Scanning \", count($paths), \" source files\";\n foreach ($paths as $path) {\n echo '.';\n $query = '\n SELECT id, filepathmd5, issource FROM files where filepath=\"' .\n $this->db->escapeString($path) . '\"';\n $result = $this->db->query($query);\n while ($res = $result->fetchArray(SQLITE3_ASSOC)) {\n if (!file_exists($path) || md5_file($path) == $res['filepathmd5']) {\n if ($res['issource'] && !file_exists($path)) {\n echo 'here';\n $this->db->exec('\n DELETE FROM files WHERE id='. $res['id'] .';\n DELETE FROM coverage WHERE files_id='. $res['id'] . ';\n DELETE FROM all_lines WHERE files_id='. $res['id'] . ';\n DELETE FROM line_info WHERE files_id='. $res['id'] . ';');\n }\n break;\n }\n $modifiedPaths[] = $path;\n // file is modified, get a list of tests that execute this file\n if ($res['issource']) {\n $query = '\n SELECT t.testpath\n FROM coverage c, tests t\n WHERE\n c.files_id=' . $res['id'] . '\n AND t.id=c.tests_id';\n $result2 = $this->db->query($query);\n while ($res = $result2->fetchArray(SQLITE3_NUM)) {\n $modifiedTests[$res[0]] = true;\n }\n } else {\n $query = '\n SELECT t.testpath\n FROM coverage_nonsource c, tests t\n WHERE\n c.files_id=' . $res['id'] . '\n AND t.id=c.tests_id';\n $result2 = $this->db->query($query);\n while ($res = $result2->fetchArray(SQLITE3_NUM)) {\n $modifiedTests[$res[0]] = true;\n }\n }\n break;\n }\n }\n echo \"done\\n\";\n echo count($modifiedPaths), ' modified files resulting in ',\n count($modifiedTests), \" modified tests\\n\";\n $paths = $this->retrieveTestPaths();\n echo \"Scanning \", count($paths), \" test paths\";\n foreach ($paths as $path) {\n echo '.';\n $query = '\n SELECT id, testpathmd5 FROM tests where testpath=\"' .\n $this->db->escapeString($path) . '\"';\n $result = $this->db->query($query);\n while ($res = $result->fetchArray(SQLITE3_ASSOC)) {\n if (!file_exists($path)) {\n $this->removeOldTest($path, $res['id']);\n continue;\n }\n if (md5_file($path) != $res['testpathmd5']) {\n $modifiedTests[$path] = true;\n }\n }\n }\n echo \"done\\n\";\n echo count($newtests), ' new tests and ', count($modifiedTests), \" modified tests should be re-run\\n\";\n return array_merge($newtests, array_keys($modifiedTests));\n }", "public function getDataFilesList(){\r\n $data_dir = dirname(__FILE__) . DIRECTORY_SEPARATOR . 'Data';\r\n $files = scandir($data_dir);\r\n\r\n $files_list = array();\r\n $index = 0;\r\n foreach ($files as $file) {\r\n if($file != '.' && $file != '..'){\r\n $files_list[$index]['name'] = $file;\r\n $files_list[$index]['update_time'] = filemtime($data_dir . DIRECTORY_SEPARATOR . $file);\r\n $files_list[$index]['type'] = $this->getFileType($file);\r\n $index++;\r\n }\r\n }\r\n\r\n $update_times = array();\r\n foreach($files_list as $data){\r\n $update_times[] = $data['update_time'];\r\n }\r\n array_multisort($update_times, SORT_DESC, $files_list);\r\n return $files_list;\r\n }", "function getFiles()\r\n\t{\r\n\t\treturn $this->files;\r\n\t}", "public function all(): array\n\t{\n\t\treturn array_replace_recursive($this->get(), $this->files->all());\n\t}", "public function getLastModified();", "public function getLastModified();", "public function getLastModified();", "public function getLastModified();", "public static function getSyncList()\n {\n $fileList = array();\n $project = EcrProjectHelper::getProject();\n $syncList = self::readSyncList();\n\n if(false === $syncList)\n throw new Exception(jgettext('No synchronization list found - Please synchronize with your remote'));\n\n $allCopies = array();\n\n foreach($project->copies as $copy)\n {\n $files = JFolder::files($copy, '.', true, true);\n\n $allCopies = array_merge($files, $allCopies);\n\n foreach($files as $file)\n {\n $fShort = str_replace(JPATH_ROOT.'/', '', $file);\n\n //-- File does not exist\n if( ! array_key_exists($fShort, $syncList))\n {\n $f = new stdClass;\n $f->path = $fShort;\n $f->status = 'new';\n\n $fileList[$fShort] = $f;\n }\n else\n {\n $f = $syncList[$fShort];\n\n //-- File size is different\n if($f->size != filesize($file))\n {\n $f->status = 'changed';\n\n $fileList[$fShort] = $f;\n }\n }\n }\n }\n\n foreach($syncList as $item)\n {\n if( ! in_array(JPATH_ROOT.'/'.$item->path, $allCopies))\n {\n $f = new stdClass;\n $f->path = $item->path;\n $f->status = 'deleted';\n\n $fileList[$item->path] = $f;\n }\n }\n\n ksort($fileList);\n\n return $fileList;\n }", "public function getFiles() {\n\t\treturn $this->files;\n\t}", "public function lastModified();", "public function lastModified();", "public function getJobStatus() {\r\n\t\t$status = array();\r\n\t\t\t$status[0] = snappy_image('icons/cross.png') . 'Canceled';\r\n\t\t\t$status[1] = snappy_image('icons/bullet_yellow.png'). 'Inprogress';\r\n\t\t\t$status[2] = snappy_image('icons/tick.png'). 'Completed';\r\n\t\treturn $status; //array\r\n\t}", "public function getUpdateStatus() {\n return $this->_statusManager->getStatus ();\n }", "public function show_changed_files() {\r\n\t\tcheck_admin_referer('plugin-name-action_wpidenonce'); \r\n\t\tif ( !is_super_admin() )\r\n\t\t\twp_die('<p>'.__('You do not have sufficient permissions to edit templates for this site. SORRY').'</p>');\r\n\t\t\r\n error_reporting(E_ALL);\r\n ini_set(\"display_errors\", 1);\r\n \r\n require_once('git/autoload.php.dist');\r\n //use TQ\\Git\\Cli\\Binary;\r\n //use TQ\\Git\\Repository\\Repository;\r\n \r\n $root = apply_filters( 'wpide_filesystem_root', WP_CONTENT_DIR ) . \"/\"; \r\n \r\n //check repo path entered or die\r\n if ( !strlen($_POST['gitpath']) ) \r\n die(\"Error: Path to your git repository is required!\");\r\n \r\n \r\n $repo_path = $root . sanitize_text_field( $_POST['gitpath'] );\r\n $gitbinary = sanitize_text_field( stripslashes($_POST['gitbinary']) );\r\n \r\n if ( $gitbinary===\"I'll guess..\" ){ //the binary path\r\n \r\n $thebinary = TQ\\Git\\Cli\\Binary::locateBinary();\r\n $git = TQ\\Git\\Repository\\Repository::open($repo_path, new TQ\\Git\\Cli\\Binary( $thebinary ) );\r\n \r\n }else{\r\n \r\n $git = TQ\\Git\\Repository\\Repository::open($repo_path, new TQ\\Git\\Cli\\Binary( $_POST['gitbinary'] ) );\r\n \r\n }\r\n\r\n //echo branch\r\n $branch = $git->getCurrentBranch();\r\n echo \"<p><strong>Current branch:</strong> \" . $branch . \"</p>\";\r\n \r\n // [0] => Array\r\n //(\r\n // [file] => WPide.php\r\n // [x] => \r\n // [y] => M\r\n // [renamed] => \r\n //)\r\n $status = $git->getStatus();\r\n $i=0;//row counter\r\n if ( count($status) ){\r\n \r\n //echo out rows of staged files \r\n foreach ($status as $item){\r\n echo \"<div class='gitfilerow \". ($i % 2 != 0 ? \"light\" : \"\") .\"'><span class='filename'>{$item['file']}</span> <input type='checkbox' name='\". str_replace(\"=\", '_', base64_encode($item['file']) ) .\"' value='\". base64_encode($item['file']) .\"' checked /> \r\n <a href='\". base64_encode($item['file']) .\"' class='viewdiff'>[view diff]</a> <div class='gitdivdiff \". str_replace(\"=\", '_', base64_encode($item['file']) ) .\"'></div> </div>\";\r\n $i++;\r\n }\r\n }else{\r\n echo \"<p class='red'>No changed files in this repo so nothing to commit.</p>\";\r\n }\r\n \r\n //output the commit message box\r\n echo \"<div id='gitdivcommit'><label>Commit message</label><br /><input type='text' id='gitmessage' name='message' class='message' />\r\n <p><a href='#' class='button-primary'>Commit the staged chanages</a></p></div>\";\r\n \r\n //echo $thebinary;\r\n \r\n //$git = Repository::open($repo_path, new Binary('/var/www/siddtes/wpsites.co.uk/git') );\r\n //echo $git->getFileCreationMode().\" ----- \";\r\n // get status of working directory\r\n //$branch = $git->getCurrentBranch();\r\n //echo \"current branch: \" . $branch;\r\n \r\n \r\n //print_r($_POST);\r\n \r\n\t\tdie(); // this is required to return a proper result\r\n\t}", "public function getChanges($localPath = '', $synced = '', $localDir = '', &$localRenames, $connections)\n\t{\n\t\t//Stub for compatibility\n\t\treturn array();\n\t}", "public function getDateModified();", "protected function processChangedAndNewFiles() {}", "public function getFiles()\n {\n return $this->_files;\n }", "public function detectChanges()\n\t{\n\t\t$events = parent::detectChanges();\n\n\t\t// If the parent directories event is a modified code then we'll remove it so we don't\n\t\t// get a double up of modified events when a child file or directory is created or\n\t\t// deleted.\n\t\tif ($events and $events[0]->getCode() == Event::RESOURCE_MODIFIED)\n\t\t{\n\t\t\t$events = array();\n\t\t}\n\n\t\tforeach ($this->children as $key => $child)\n\t\t{\n\t\t\t$childEvents = $child->detectChanges();\n\n\t\t\tforeach ($childEvents as $childEvent)\n\t\t\t{\n\t\t\t\tif ($childEvent instanceof Event and $childEvent->getCode() == Event::RESOURCE_DELETED)\n\t\t\t\t{\n\t\t\t\t\tunset($this->children[$key]);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$events = array_merge($events, $childEvents);\n\t\t}\n\n\t\t// If this directory still exists we'll check the directory children again for any\n\t\t// new children. We'll then create a created event.\n\t\tif ($this->exists)\n\t\t{\n\t\t\tforeach ($this->detectDirectoryChildren() as $key => $child)\n\t\t\t{\n\t\t\t\tif ( ! isset($this->children[$key]))\n\t\t\t\t{\n\t\t\t\t\t$this->children[$key] = $child;\n\n\t\t\t\t\t$events[] = new Event($child, Event::RESOURCE_CREATED);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $events;\n\t}", "function getFiles(){\n\t\treturn $this->used_files;\n\t}", "abstract public static function getStatuses();", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }", "public function getFiles()\n {\n return $this->files;\n }" ]
[ "0.6773189", "0.64256406", "0.60155654", "0.59181017", "0.5909338", "0.59080946", "0.59034914", "0.5889677", "0.58518493", "0.5841763", "0.5822169", "0.58087367", "0.5768888", "0.57652396", "0.5688381", "0.56595325", "0.5617935", "0.5617297", "0.55780476", "0.5576914", "0.5528347", "0.5527328", "0.55249834", "0.5489283", "0.5483906", "0.5473576", "0.54612356", "0.5458083", "0.5451867", "0.5449823", "0.54291064", "0.5428017", "0.54246044", "0.5421228", "0.5420465", "0.54184186", "0.5416537", "0.54148376", "0.5400488", "0.5396323", "0.5387908", "0.538742", "0.53790087", "0.537063", "0.5362767", "0.5349519", "0.5339091", "0.53301525", "0.5317868", "0.5317243", "0.5310116", "0.53063244", "0.5304622", "0.5303412", "0.5303265", "0.5281499", "0.5280648", "0.5272596", "0.526834", "0.5266259", "0.5261805", "0.5261305", "0.525953", "0.525447", "0.5250903", "0.5247773", "0.5245279", "0.5229741", "0.5222507", "0.52221584", "0.5216759", "0.5216168", "0.5215171", "0.5215171", "0.5215171", "0.5215171", "0.5207469", "0.5192114", "0.518273", "0.518273", "0.518255", "0.5178061", "0.51690716", "0.5168941", "0.51649725", "0.5163178", "0.51550967", "0.5146648", "0.51385725", "0.51382315", "0.5136513", "0.5136513", "0.5136513", "0.5136513", "0.5136513", "0.5136513", "0.5136513", "0.5136513", "0.5136513", "0.5136513" ]
0.6887717
0
Initialize the submodules of the repo at the specified path.
public static function initSubmodules($path) { $oldDir = getcwd(); chdir($path); passthru(self::INIT_SUBMODULES_CMD); chdir($oldDir); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function git_init_submodules($path) {\n\tGitUtil::initSubmodules($path);\n}", "function git_update_submodules($path) {\n\t$status = GitUtil::updateExternals($path);\n}", "static function loadModules($path) {\n // Prepare the iterator\n $core = new RecursiveDirectoryIterator($_SERVER['DOCUMENT_ROOT'] . $path);\n $iterator = new RecursiveIteratorIterator($core);\n $modules = new RegexIterator($iterator, '/^.+\\.php$/i', RecursiveRegexIterator::GET_MATCH);\n // Load all modules in the directory structure recursively\n foreach ($modules as $component => $filename) {\n require_once $component;\n }\n }", "public function load_modules() {\n\t\tforeach ( $this->modules as $module_name ) {\n\t\t\t$module = $this->build( $module_name );\n\t\t\tif ( $module !== null ) {\n\t\t\t\t$module->init();\n\t\t\t}\n\t\t}\n\t}", "public static function cloneRepo($repo, $path, $initSubModules = false) {\n\t\t$cloneCmd = sprintf(self::CLONE_CMD_TMPL,\n\t\t\t$repo,\n\t\t\t$path);\n\t\tpassthru($cloneCmd);\n\n\t\tif ($initSubModules) {\n\t\t\tself::initSubmodules($path);\n\t\t}\n\t}", "function git_clone($repo, $path, $initSubModules = false) {\n\tGitUtil::cloneRepo($repo, $path, $initSubModules);\n}", "function __construct ($path)\n {\n $this->basepath = $path ;\n // pull the module and package names out of the path\n $this->moduleName = basename ( $path, \"/\" ) ; // just in case there are any trailing /\n $this->packageName = basename ( dirname ( dirname ( $path ) ) ) ; // simpler than explode :)\n require_once 'modules/ModuleBuilder/MB/ModuleBuilder.php' ;\n $mb = new ModuleBuilder ( ) ;\n $this->packageKey = $mb->getPackageKey ( $this->packageName ) ;\n \n $this->load () ;\n \n }", "public function init_repo() {\n\n\t\t\t// we don't need to maintain local repos for slim deploys\n\t\t\tif ( SLIM ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// if the repo is already initialised, we don't need to\n\t\t\tif ( is_dir( \"wpd-repos/{$this->config->repo[ 'name' ]}/.git\" ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// store the directory we're in right now, so we can come back\n\t\t\t$original_dir = getcwd();\n\n\t\t\t// switch the repo's directory\n\t\t\tchdir( \"wpd-repos/{$this->config->repo[ 'name' ]}\" );\n\n\t\t\t// initialise git\n\t\t\texec( 'git init' );\n\n\t\t\t// add the remote repo as a remote called origin\n\t\t\texec( \"git remote add origin \" . $this->config->repo[ 'git_url' ] );\n\n\t\t\t// switch back to the original directory\n\t\t\tchdir( $original_dir );\n\t\t}", "final function __construct($path)\n\t{\n\t\t$this->path = $path;\n\t\t$this->mods = array();\n\t\t$this->init();\n\t}", "public function init($path);", "protected function init()\n {\n $files = $this->fs->findFile('', 'init', 'php', true, true);\n\n if (!$files) {\n return;\n }\n\n $files = array_reverse($files);\n\n $di = $this->getDI();\n\n foreach ($files as $file) {\n include $file;\n }\n\n }", "public function initExtensions(): void\n {\n $modules = $this->config->__toArray();\n\n if (empty($modules)) {\n return;\n }\n\n $templatesPaths = [];\n $langPaths = [];\n\n $extensionsDir = $this->extensionsConfig['path'];\n\n foreach ($modules as $index => $config) {\n if (!$config['enabled'] || isset($this->loadedExtensions[$index]['init'])) {\n continue;\n }\n\n $path = $extensionsDir . File::fillEndSep($config['dir']);\n\n\n if (!empty($config['paths']['locales'])) {\n $langPaths[] = $path . $config['paths']['locales'] . '/';\n }\n\n if (!empty($config['paths']['templates'])) {\n $templatesPaths[] = $path . $config['paths']['templates'] . '/';\n }\n\n $this->loadedExtensions[$index]['init'] = true;\n }\n\n // Add localization paths\n if (!empty($langPaths)) {\n /**\n * @var StorageInterface $langStorage\n */\n $langStorage = $this->di->get(Lang::class)->getStorage();\n foreach ($langPaths as $path) {\n $langStorage->addPath($path);\n }\n }\n\n // Add Templates paths\n if (!empty($templatesPaths)) {\n $templateStorage = $this->di->get(Storage::class);\n $paths = $templateStorage->getPaths();\n $mainPath = array_shift($paths);\n // main path\n $pathsResult = [];\n $pathsResult[] = $mainPath;\n $pathsResult = array_merge($pathsResult, $templatesPaths, $paths);\n $templateStorage->setPaths($pathsResult);\n }\n }", "public function init() {\n\t\t$this->getFrontController()->addModuleDirectory(APPLICATION_PATH . '/modules');\n\n\t\t// initialize navigation\n\t\t$this->_initNavigation();\n\t}", "public function load() {\n $this->loadModules($this->dir['modules_core'], 'core');\n $this->loadModules($this->dir['modules_custom'], 'custom');\n $this->runModules();\n }", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n Yii::import('cms_core.components.CmsModule');\n CmsModule::initCore($this); \n CmsModule::loadModule('cms_content');\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'cms_gallery.models.*',\n\t\t\t'cms_gallery.components.*',\n\t\t));\n\t}", "function xh_initModules()\r\n\t{\r\n\t}", "public static function initModuleLoading(){\n\n\t}", "public function init_modules() {\n\t\t\t$this->dynamic_css = $this->get_core()->init_module( 'cherry-dynamic-css' );\n\n\t\t\tif ( is_admin() ) {\n\t\t\t\t$this->get_core()->init_module( 'cherry5-insert-shortcode', array() );\n\t\t\t}\n\t\t}", "function module_init () {\n global $core_stylesheets;\n global $core_scripts;\n \n foreach (module_list() as $module) {\n $style_func = $module . '_stylesheets';\n if (function_exists($style_func)) {\n $stylesheets = call_user_func($style_func);\n foreach ($stylesheets as $sheet) {\n $core_stylesheets[] = \"include/$module/$sheet\";\n }\n }\n $style_func = $module . '_scripts';\n if (function_exists($style_func)) {\n $scripts = call_user_func($scripts_func);\n foreach ($scripts as $script) {\n $core_scripts[] = \"include/$module/$script\";\n }\n }\n }\n}", "public function init()\n {\n $this->gmodule = new Zfmodules_Model_GroupModules();\n $this->module = new Zfmodules_Model_Modules();\n }", "public function init() {\n $git_wrapper = new \\GitWrapper\\GitWrapper();\n if (file_exists($this->directory)) {\n $this->git = $git_wrapper->workingCopy($this->directory);\n $this->git->checkout($this->branch);\n }\n else {\n $this->git = $git_wrapper->cloneRepository($this->getRepositoryURL(), $this->directory, ['branch' => $this->branch]);\n }\n }", "public static function updateExternals($path) {\n\t\tif (!file_exists($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path does not exist.\");\n\t\t}\n\n\t\tif (!is_dir($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path is not a directory.\");\n\t\t}\n\n\t\tif (!self::isRepo($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path is not a git repository.\");\n\t\t}\n\n\t\t$origCwd = getcwd();\n\t\tchdir($path);\n\n\t\t$updateCmd = sprintf(self::UPDATE_SUBMODULES_CMD);\n\t\tpassthru($updateCmd);\n\n\t\tchdir($origCwd);\n\t}", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'user.models.*',\n\t\t\t'user.components.*',\n\t\t\t'application.modules.system.models.*',\n\t\t\t'application.modules.system.components.*',\n\t\t\t'application.modules.storage.models.*',\n\t\t\t'application.modules.storage.components.*'\n\t\t));\n\t}", "function load_modules() {\n $module_folders = scandir(clientele_ROOT . '/modules/');\n foreach ($module_folders as $key => $folder) {\n $module_folders[$key] = clientele_ROOT. '/modules/'. $module_folders[$key] . '/' . $module_folders[$key] . '.class.php'; \n }\n $module_folders = apply_filters('clientele_module_folders', $module_folders);\n foreach ($module_folders as $module_folder) {\n if (file_exists($module_folder)) {\n require($module_folder);\n $file_name = basename($module_folder, '.class.php');\n $this->register_module($file_name);\n }\n }\n do_action('clientele_modules_loaded');\n }", "static function initialize($path)\n {\n self::register();\n self::addPath($path);\n }", "function init()\r\n {\r\n //Copy components to comps, so you can alter components properties\r\n //on init() methods\r\n $comps=$this->components->items;\r\n //Calls children's init recursively\r\n reset($comps);\r\n while (list($k,$v)=each($comps))\r\n {\r\n $v->init();\r\n }\r\n }", "public function init($module_name) {\n $buildmodule = \\Drupal::service('embedded_block_generator.setup_module');\n try {\n $path_name = preg_replace('@[^a-z0-9-]+@', '_', strtolower($module_name));\n $path = DRUPAL_ROOT . '/modules/custom/' . $path_name;\n if (\\Drupal::service('file_system')->prepareDirectory($path, FileSystemInterface::CREATE_DIRECTORY)) {\n $buildmodule->buildModuleFiles($module_name, $path);\n }\n $this->output()->writeln('Module ' . $module_name . ' Created successfully');\n }\n catch (Exception $e) {\n $this->output()->writeln($e->getMessage());\n }\n }", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n \n\t\t$this->setImport(array('my.models.*',));\n\t}", "protected function initGitignore() {\n $dirsWithGitignore = [\n ProjectTools::me()->getProjectDir(),\n ProjectTools::me()->getProjectDir() . '/www/',\n ];\n\n foreach ($dirsWithGitignore as $dir) {\n $this->rename('.gitignore.example', '.gitignore', $dir, TRUE);\n }\n }", "public function loadModules();", "public function set_repo_path($repo_path, $create_new = false, $_init = true) {\n\t\t\tif (is_string($repo_path)) {\n\t\t\t\tif ($new_path = realpath($repo_path)) {\n\t\t\t\t\t$repo_path = $new_path;\n\t\t\t\t\tif (is_dir($repo_path)) {\n\t\t\t\t\t\t// Is this a work tree?\n\t\t\t\t\t\tif (file_exists($repo_path.\"/.git\") && is_dir($repo_path.\"/.git\")) {\n\t\t\t\t\t\t\t$this->repo_path = $repo_path;\n\t\t\t\t\t\t\t$this->bare = false;\n\n\t\t\t\t\t\t\tif (!is_writable($repo_path.\"/.git\")) {\n\t\t\t\t\t\t\t\t$user_info = posix_getpwuid(fileowner($repo_path.\"/.git\"));\n\t\t\t\t\t\t\t\t$file_owner = $user_info['name'];\n\t\t\t\t\t\t\t\t$this->command_prefix = 'sudo -u '.$file_owner.' ';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Is this a bare repo?\n\t\t\t\t\t\t} else if (is_file($repo_path.\"/config\")) {\n\t\t\t\t\t\t\t$parse_ini = parse_ini_file($repo_path.\"/config\");\n\t\t\t\t\t\t\tif ($parse_ini['bare']) {\n\t\t\t\t\t\t\t\t$this->repo_path = $repo_path;\n\t\t\t\t\t\t\t\t$this->bare = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($create_new) {\n\t\t\t\t\t\t\t\t$this->repo_path = $repo_path;\n\t\t\t\t\t\t\t\tif ($_init) {\n\t\t\t\t\t\t\t\t\t$this->run('init');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthrow new Exception('\"'.$repo_path.'\" is not a git repository');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception('\"'.$repo_path.'\" is not a directory');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ($create_new) {\n\t\t\t\t\t\tif ($parent = realpath(dirname($repo_path))) {\n\t\t\t\t\t\t\tmkdir($repo_path);\n\t\t\t\t\t\t\t$this->repo_path = $repo_path;\n\t\t\t\t\t\t\tif ($_init) $this->run('init');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new Exception('cannot create repository in non-existent directory');\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception('\"'.$repo_path.'\" does not exist');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function init() {\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'music.models.*',\n\t\t\t'music.components.*',\n\t\t));\n\t}", "public function loadModules()\n {\n foreach ($this->getListOfModules() as $module) {\n $this->loadViews($module);\n $this->loadRoutes($module);\n $this->loadMigrations($module);\n }\n }", "public function init_modules() {\n\n\t\tif ( wp_doing_ajax() ) {\n\t\t\t$this->maybe_load_module_on_ajax();\n\t\t} else {\n\t\t\t$this->maybe_load_module();\n\t\t}\n\t}", "public function __construct($repo_path = null, $create_new = false, $_init = true) {\n\t\t\tif (is_string($repo_path)) {\n\t\t\t\t$this->set_repo_path($repo_path, $create_new, $_init);\n\t\t\t}\n\t\t}", "public function init () {\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array( //'sitemap.models.*',\n\t\t 'sitemap.extensions.sitemap.*',\n\t\t));\n\t}", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n parent::init();\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'info.models.*',\n\t\t\t'info.components.*',\n\t\t));\n\t}", "public function init() {\n\t\t// you may place code here to customize the module or the application\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'common.components.*',\n\t\t));\n\t}", "public static function run_init_scripts() {\n foreach (self::$_roots as $module_name => $root_path) {\n if (file_exists($fname =\n ($root_path . self::MODULE_BOOTSTRAP_FILE))) {\n include $fname;\n }\n }\n }", "public static function init() {\n foreach (static::$dirs as $dir) {\n if($phpFiles = glob($dir . DIRECTORY_SEPARATOR . '*.php')) {\n foreach ($phpFiles as $phpFile) {\n $namespace = basename($phpFile, '.php');\n static::$config[$namespace] = require_once $phpFile;\n }\n }\n }\n }", "public function init()\n {\n // TODO: initialize by config ordering\n foreach ($this->plugins as $name => $plugin) {\n $plugin->init();\n }\n }", "protected function initBundleDirectoryStructure(InputInterface $input, OutputInterface $output)\n {\n // Bootstrap SS so we can use module listing\n $frameworkPath = $this->container->getParameter('behat.silverstripe_extension.framework_path');\n $_GET['flush'] = 1;\n require_once $frameworkPath . '/core/Core.php';\n unset($_GET['flush']);\n\n $featuresPath = $input->getArgument('features');\n if(!$featuresPath) {\n throw new \\InvalidArgumentException('Please specify a module name (e.g. \"@mymodule\")');\n }\n\n // Can't use 'behat.paths.base' since that's locked at this point to base folder (not module)\n $pathSuffix = $this->container->getParameter('behat.silverstripe_extension.context.path_suffix');\n $currentModuleName = null;\n $modules = \\SS_ClassLoader::instance()->getManifest()->getModules();\n $currentModuleName = $this->container->getParameter('behat.silverstripe_extension.module');\n\n // get module from short notation if path starts from @\n if (preg_match('/^\\@([^\\/\\\\\\\\]+)(.*)$/', $featuresPath, $matches)) {\n $currentModuleName = $matches[1];\n // TODO Replace with proper module loader once AJShort's changes are merged into core\n if (!array_key_exists($currentModuleName, $modules)) {\n throw new \\InvalidArgumentException(sprintf('Module \"%s\" not found', $currentModuleName));\n }\n $currentModulePath = $modules[$currentModuleName];\n } \n\n if (!$currentModuleName) {\n throw new \\InvalidArgumentException('Can not find module to initialize suite.');\n }\n\n // TODO Retrieve from module definition once that's implemented\n if($input->getOption('namespace')) {\n $namespace = $input->getOption('namespace');\n } else {\n $namespace = ucfirst($currentModuleName);\n }\n $namespace .= '\\\\' . $this->container->getParameter('behat.silverstripe_extension.context.namespace_suffix');\n\n $featuresPath = rtrim($currentModulePath.DIRECTORY_SEPARATOR.$pathSuffix,DIRECTORY_SEPARATOR);\n $basePath = $this->container->getParameter('behat.paths.base').DIRECTORY_SEPARATOR;\n $bootstrapPath = $featuresPath.DIRECTORY_SEPARATOR.'bootstrap';\n $contextPath = $bootstrapPath.DIRECTORY_SEPARATOR.'Context';\n\n if (!is_dir($featuresPath)) {\n mkdir($featuresPath, 0777, true);\n mkdir($bootstrapPath, 0777, true);\n // touch($bootstrapPath.DIRECTORY_SEPARATOR.'_manifest_exclude');\n $output->writeln(\n '<info>+d</info> ' .\n str_replace($basePath, '', realpath($featuresPath)) .\n ' <comment>- place your *.feature files here</comment>'\n );\n }\n\n if (!is_dir($contextPath)) {\n mkdir($contextPath, 0777, true);\n\n $className = $this->container->getParameter('behat.context.class');\n file_put_contents(\n $contextPath . DIRECTORY_SEPARATOR . $className . '.php',\n strtr($this->getFeatureContextSkelet(), array(\n '%NAMESPACE%' => $namespace\n ))\n );\n\n $output->writeln(\n '<info>+f</info> ' .\n str_replace($basePath, '', realpath($contextPath)) . DIRECTORY_SEPARATOR .\n 'FeatureContext.php <comment>- place your feature related code here</comment>'\n );\n }\n }", "public function internalLoad(string $path)\n {\n // Scan path\n $scan = array_diff(scandir($path), array('.', '..', 'Core.php', 'Resources'));\n // Foreach found item\n foreach ($scan as $item) {\n // Check if item is a file\n if (substr($item, -4) == \".php\") {\n // Require file once\n require_once $path . '/' . $item;\n } else {\n // Rerun autoload on new folder\n $this->internalLoad($path . '/' . $item);\n }\n }\n }", "private function initRepositories(): void {\n $this->usersRepository = new UsersRepository();\n }", "public function _setupObjects()\n {\n if ((count ($this -> _mXoopsModules) == 0) && $handler = opendir (XOOPS_MODULE_PATH)) {\n while (($dir = readdir($handler)) !== false) {\n if (!in_array ($dir, $this -> _mExclusions, true) && is_dir(XOOPS_MODULE_PATH . '/' . $dir)) {\n $module =& $this->get($dir);\n if ($module !== false) {\n $this->_mXoopsModules[] =& $module;\n }\n unset($module);\n }\n }\n }\n }", "public function init()\n\t{\n\t\t$this->resolvePackagePath();\n\t\t$this->registerCoreScripts();\n\t\tparent::init();\n\t}", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'admin.models.*',\n\t\t\t'admin.components.*',\n\t\t));\n\t}", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'clinics.models.*',\n\t\t\t'clinics.components.*',\n\t\t));\n\t}", "public function __construct($template_path = null) \n {\n Benchmark::start('GridModule Loading');\n \n if($template_path) \n {\n $this->template_path = $template_path;\n }\n \n Kohana::log('debug', 'Grid :: Grid_Core Module loaded');\n \n }", "protected function _initModules()\n {\n $this->_config->setNode('global/models/ecocode_profiler/class', 'Ecocode_Profiler_Model');\n $this->_config->setNode('global/helpers/ecocode_profiler/class', 'Ecocode_Profiler_Helper');\n if (!$this->_config->loadModulesCache()) {\n $this->_config->loadModules();\n if ($this->_config->isLocalConfigLoaded() && !$this->_shouldSkipProcessModulesUpdates()) {\n Varien_Profiler::start('mage::app::init::apply_db_schema_updates');\n Mage_Core_Model_Resource_Setup::applyAllUpdates();\n Varien_Profiler::stop('mage::app::init::apply_db_schema_updates');\n }\n /* start */\n /* load development.xml for all modules if present */\n $this->_config->loadModulesConfiguration(['development.xml'], $this->_config);\n /* end */\n $this->_config->loadDb();\n $this->enableSymlinks();\n $this->_config->saveCache();\n }\n return $this;\n }", "public function init() {\n // you may place code here to customize the module or the application\n // import the module-level models and components\n $this->setImport(array(\n 'sys.models.*',\n 'product.models.*',\n 'sys.components.*',\n 'hr.models.*',\n ));\n }", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t\t'admin.models.*',\n\t\t\t\t'admin.components.*',\n\t\t));\n\n\t}", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'forum.models.*',\n\t\t\t'forum.components.*',\n 'forum.controllers.*',\n\t\t));\n\t}", "public static function init($path)\n {\n $path .= '/';\n if (!is_dir($path)) {\n mkdir($path);\n } elseif (is_dir($path . 'objects')) {\n return false;\n }\n\n mkdir($path . 'objects');\n mkdir($path . 'objects/info');\n mkdir($path . 'objects/pack');\n mkdir($path . 'refs');\n mkdir($path . 'refs/heads');\n mkdir($path . 'refs/tags');\n\n file_put_contents($path . 'HEAD', 'ref: refs/heads/master');\n\n return true;\n }", "public function init()\n {\n chdir($this->context['source_dir']);\n $this->loadConfig();\n $this->context['temp_dir'] = $this->cacheDir(\"upgrades/temp\");\n $this->context['extract_dir'] = $this->context['temp_dir'];\n $this->ensureDir($this->context['temp_dir']);\n $this->context['state_file'] = $this->cacheDir('upgrades/') . self::STATE_FILE;\n $this->context['upgrader_dir'] = dirname(__FILE__);\n $this->loadState();\n $this->context['backup_dir'] = $this->config['upload_dir'] . \"/upgrades/backup/\" . pathinfo(\n $this->context['zip'],\n PATHINFO_FILENAME\n ) . \"-restore\";\n if (isset($this->context['script_mask'])) {\n $this->script_mask &= $this->context['script_mask'];\n }\n if (isset($this->state['extract_dir'])) {\n $this->context['extract_dir'] = $this->state['extract_dir'];\n }\n if (empty($this->context['health_check_path'])) {\n $this->context['health_check_path'] =\n realpath($this->context['extract_dir']) . self::DEFAULT_HEALTHCHECK_PATH;\n }\n $this->context['case_insensitive_fs'] = $this->testFilesystemCaseInsensitive();\n $this->context['versionInfo'] = self::getVersion();\n\n $this->initialized = true;\n }", "public function load($path)\n {\n if (!is_dir($path)) {\n return false;\n }\n $modules = glob($path.DIRECTORY_SEPARATOR.'*', GLOB_ONLYDIR);\n\n foreach($modules as $name) {\n $module = new \\Arch\\Module($name);\n $this->set(dirname($name), $module);\n $module->loadConfig();\n }\n return true;\n }", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'message.models.*',\n\t\t\t'message.components.*',\n 'message.forms.*',\n\t\t));\n\t}", "public function init()\r\n {\r\n $this->admin = Shopware()->Modules()->Admin();\r\n $this->basket = Shopware()->Modules()->Basket();\r\n $this->session = Shopware()->Session();\r\n $this->db = Shopware()->Db();\r\n $this->moduleManager = Shopware()->Modules();\r\n $this->eventManager = Shopware()->Events();\r\n }", "public function __construct($path, $config)\n\t{\n\t\tchdir($path);\n\t\trequire($config);\n\t}", "public function __construct()\n {\n // Store module path\n $this->module_path = dirname(__FILE__);\n }", "public function __construct()\n {\n // Store module path\n $this->module_path = dirname(__FILE__);\n }", "public function __construct()\n {\n // Store module path\n $this->module_path = dirname(__FILE__);\n }", "public function __construct()\n {\n // Store module path\n $this->module_path = dirname(__FILE__);\n }", "public function __construct()\n {\n // Store module path\n $this->module_path = dirname(__FILE__);\n }", "public function __construct()\n {\n // Store module path\n $this->module_path = dirname(__FILE__);\n }", "protected function init() {\n if (!$this->configModule) {\n $this->configModule = $this->id;\n }\n $moduleData = $this->getModuleData();\n\n if ($moduleData['disabled']) {\n $this->moduleDisabled();\n }\n\n if (($this->getSiteVar('SECURE_REQUIRED', 0, Config::SUPRESS_ERRORS) || $moduleData['secure']) && \n (!isset($_SERVER['HTTPS']) || ($_SERVER['HTTPS'] !='on'))) { \n $this->secureModule();\n }\n \n if ($this->getSiteVar('AUTHENTICATION_ENABLED')) {\n includePackage('Authentication');\n if ($moduleData['protected']) {\n if (!$this->isLoggedIn()) {\n $this->unauthorizedAccess();\n }\n }\n \n if (!$this->evaluateACLS(self::ACL_USER)) {\n $this->unauthorizedAccess();\n }\n }\n }", "public static function init()\n {\n if (is_readable(__DIR__ . '/config/test.config.php')) {\n $testConfig = include __DIR__ . '/config/test.config.php';\n } else {\n $testConfig = include __DIR__ . '/config/test.config.php.dist';\n }\n \n $zf2ModulePaths = array();\n \n if (isset($testConfig['module_listener_options']['module_paths'])) {\n $modulePaths = $testConfig['module_listener_options']['module_paths'];\n foreach ($modulePaths as $modulePath) {\n if (($path = static::findParentPath($modulePath)) ) {\n $zf2ModulePaths[] = $path;\n }\n }\n }\n \n $zf2ModulePaths = implode(PATH_SEPARATOR, $zf2ModulePaths) . PATH_SEPARATOR;\n $zf2ModulePaths .= getenv('ZF2_MODULES_TEST_PATHS') ?: (defined('ZF2_MODULES_TEST_PATHS') ? ZF2_MODULES_TEST_PATHS : '');\n \n static::initAutoloader();\n \n // use ModuleManager to load this module and it's dependencies\n $baseConfig = array(\n 'module_listener_options' => array(\n 'module_paths' => explode(PATH_SEPARATOR, $zf2ModulePaths),\n ),\n );\n \n $config = ArrayUtils::merge($baseConfig, $testConfig);\n $serviceManager = new ServiceManager(new ServiceManagerConfig());\n $serviceManager->setService('ApplicationConfig', $config);\n $serviceManager->get('ModuleManager')->loadModules();\n \n static::$serviceManager = $serviceManager;\n static::$config = $config;\n }", "private function setIncludes($repo)\n {\n #add other paths here .\n $proj_dir = dirname($repo);\n $current_path = getenv('PATH');\n ini_set('include_path',\n '.'\n . ':' . '/usr/local/lib/php'\n . ':' . '/usr/local/bin'\n\t\t\t. ':' . $repo . '/libmx'\n\t\t. ':' . $repo . '/src'\n\t\t. ':' . $repo . '/config'\n . ':' . $repo . '/public'\n # . ':' . $repo . '/public/scripts'\n . ':' . $current_path\n\n );\n }", "public function init() {\n if (!class_exists(TableBuilderManager::class)) {\n $loader = new ClassLoader();\n $loader->addPsr4('Drush\\\\dmt_structure_export\\\\', __DIR__ . '/src');\n $loader->register();\n }\n }", "private function _initialize(){\n\t\t\t//Root Folders\n\t\t\tDefined(\"SRC_PATH\") || Define('SRC_PATH', realpath(dirname(dirname(__file__))) . DS . 'src' . DS);\n\t\t\tDefined(\"DB_PATH\") || Define('DB_PATH', realpath(dirname(__file__)).DS.'database'.DS);\n\t\t\t//$dir = array_filter(glob('*'),'is_dir');\n\t\t\t//print_r($dir);\n\t\t\tspl_autoload_extensions('.php');\n\t\t\tspl_autoload_register(function ($class) {\n\t\t\t\t$parts = explode('\\\\', $class);\n\t\t\t\t$class = end($parts); \n\n\t\t\t\tif (file_exists(PROJECT_PATH.$this->_implementation.DS.$class.'.php'))\n\t\t\t\t\t\trequire_once PROJECT_PATH.$this->_implementation.DS.$class.'.php';\n\t\t\t\t\n //Impliments \n\t\t\t\t$folders = scandir(PROJECT_PATH . $this->_implementation);\n\t\t\t\t$remove = array('.', '..');\n\t\t\t\t$folders = array_diff($folders, $remove);\n\t\t\t\tif (!empty($folders)) {\n\t\t\t\t\t$folders = array_clean($folders);\n\t\t\t\t\tforeach ($folders as $folder) {\n\t\t\t\t\t\tif (file_exists(PROJECT_PATH.$this->_implementation.DS.$folder.DS.$class.'.php'))\n\t\t\t\t\t\t\trequire_once PROJECT_PATH.$this->_implementation.DS.$folder.DS.$class.'.php';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//Initalize Plugins\n\t\t\t\t$folders = scandir(PROJECT_PATH . $this->_pluginPath);\n\t\t\t\t$remove = array('.', '..');\n\t\t\t\t$folders = array_diff($folders, $remove);\n\t\t\t\tif (!empty($folders)) {\n\t\t\t\t\t$folders = array_clean($folders);\n\t\t\t\t\tforeach ($folders as $folder) {\n\t\t\t\t\t\tif (file_exists(PROJECT_PATH.$this->_pluginPath.DS.$folder.DS.$class.'.php'))\n\t\t\t\t\t\t\trequire_once PROJECT_PATH.$this->_pluginPath.DS.$folder.DS.$class.'.php';\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\t//System vendor \n\t\t\t\t$folders = scandir(APP_PATH . $this->_systemVendor);\n\t\t\t\t$remove = array('.', '..');\n\t\t\t\t$folders = array_diff($folders, $remove);\n\t\t\t\tif (!empty($folders)) {\n\t\t\t\t\t$folders = array_clean($folders);\n\t\t\t\t\tforeach ($folders as $folder) {\n\t\t\t\t\t\tif (file_exists(APP_PATH.$this->_systemVendor.DS.$folder.DS.$class.'.php'))\n\t\t\t\t\t\t\trequire_once APP_PATH.$this->_systemVendor.DS.$folder.DS.$class.'.php';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//User Vendor\n\t\t\t\t$folders = scandir(PROJECT_PATH . $this->_userVendor);\n\t\t\t\t$remove = array('.', '..');\n\t\t\t\t$folders = array_diff($folders, $remove);\n\t\t\t\tif (!empty($folders)) {\n\t\t\t\t\t$folders = array_clean($folders);\n\t\t\t\t\tforeach ($folders as $folder) {\n\t\t\t\t\t\tif (file_exists(PROJECT_PATH.$this->_userVendor.DS.$folder.DS.$class.'.php'))\n\t\t\t\t\t\t\trequire_once PROJECT_PATH.$this->_userVendor.DS.$folder.DS.$class.'.php';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (!empty($_SERVER['QUERY_STRING']))\n\t\t\t\t$this->_route = preg_replace('/^url=index.php&url=(.*)/', '$1', $_SERVER['QUERY_STRING']);\n\t\t\t\t\t\n\t\t\tif(utils\\Config::get('role/module_active') == 'YES'){\n\t\t\t\t//Create All Roles Tables \n\t\t\t\t$userTable = utils\\Config::get('webadmin/userTable');\n\t\t\t\t$userKey = utils\\Config::get('webadmin/userKey');\n\t\t\t\tif(isset($userTable) && isset($userKey)){\n\t\t\t\t\tif(\\orm\\Query::is_table($userTable)){\n\t\t\t\t\t\t$roleTables = new roles\\tables\\RoleTables($userTable,$userKey);\n\t\t\t\t\t\t$roleTables->addRoleTables();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n }", "public function setInitialPaths() {}", "public function initRepository(): void;", "public function __construct()\n {\n $this->module_roots = Main::$module_roots;\n $this->load_supported_features();\n }", "public function init() {\n\t\trequire(__DIR__ . '/../setup-scripts/createExplicitUsers.php');\n\t\trequire(__DIR__ . '/../setup-scripts/createExplicitGroups.php');\n\t\trequire(__DIR__ . '/../setup-scripts/createExplicitGroupsDifferentOU.php');\n\t\tparent::init();\n\t}", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'admin.models.*',\n\t\t\t'admin.components.*',\n\t\t));\n\n\t\t$this->_initBootstrap();\n\t\t$this->_initJsCss();\n\t}", "public function __construct($path)\n{\n$this->path=$path;\nforeach(get_subdirs($path) as $name)\n\t{\n\t$this->artists[]=$name;\n\t}\n}", "public function loadModules()\n\t{\n\t\t$this->modulesToLoad = array_unique($this->modulesToLoad);\n\n\t\tif($this->doLoadAlwaysActivatedModules)\n\t\t{\n\t\t\t$this->modulesToLoad = array_merge($this->modulesToLoad, $this->moduleToAlwaysActivate);\n\t\t}\n\t\t\n\t\tforeach($this->modulesToLoad as $moduleName)\n\t\t{\n\t\t\tif(!$this->isModuleLoaded($moduleName))\n\t\t\t{\n\t\t\t\t$newModule = $this->loadModule($moduleName);\t\n\t\t\t\tif($this->doLoadModules\n\t\t\t\t\t&& $this->isModuleActivated($moduleName))\n\t\t\t\t{\n\t\t\t\t\t$this->addModuleObservers( $newModule );\n\t\t\t\t\t$this->addLoadedModule( $moduleName, $newModule);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function addModuleDirectory($path) {\r\n\t\t$path = realpath($path);\r\n\t\tif (!is_dir($path)) throw new Exception('module path err!');\r\n\t\t\r\n\t\t$dh = opendir($path);\r\n while (($file = readdir($dh)) !== false) {\r\n if ('.' == $file || '..' == $file || !is_dir($path . DIRECTORY_SEPARATOR. $file)) {\r\n \tcontinue;\r\n }\r\n $module = $file;\r\n\t\t\t$moduleDir = $path . DIRECTORY_SEPARATOR. $file . DIRECTORY_SEPARATOR . $this->getModuleControllerDirectoryName();\r\n\t\t\t$this->addControllerDirectory($moduleDir, $module);\r\n }\r\n closedir($dh);\r\n\r\n\t\treturn $this;\r\n\t}", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'yiiauth.models.*',\n\t\t\t'yiiauth.components.*',\n\t\t));\n\t}", "public function initializeChildren() {\n\t\tif ($this->initialized === TRUE) {\n\t\t\treturn;\n\t\t}\n\t\t/** @var \\TYPO3\\CMS\\Core\\Resource\\Folder $folder */\n\t\t$subFolders = $this->folder->getSubfolders();\n\t\tforeach ($subFolders as $folder) {\n\t\t\t$f = new Storage($this->mapFolderIdToEntityName($folder->getName()), array());\n\t\t\t$f->setStorage($this->storage);\n\t\t\t$f->setFolder($folder);\n\t\t\t$this->addChild($f);\n\t\t}\n\n\t\t$files = $this->folder->getFiles();\n\t\tforeach ($files as $file) {\n\t\t\t$f = new File();\n\t\t\t$f->setFalFileObject($file);\n\t\t\t$this->addChild($f);\n\t\t}\n\t\t$this->initialized = TRUE;\n\t}", "public function loadExtensions(): void\n {\n /**\n * @var ConfigStorageInterface $configStorage\n */\n $configStorage = $this->di->get(ConfigStorageInterface::class);\n $modules = $this->config->__toArray();\n\n if (empty($modules)) {\n return;\n }\n\n $autoLoadPaths = [];\n $autoLoadPathsPsr4 = [];\n $configPaths = [];\n\n $dependencyPaths = [];\n\n $extensionsDir = $this->extensionsConfig['path'];\n\n foreach ($modules as $index => $config) {\n if (!$config['enabled'] || isset($this->loadedExtensions[$index]['loaded'])) {\n continue;\n }\n\n $path = $extensionsDir . File::fillEndSep($config['dir']);\n\n if (!empty($config['paths']['src'])) {\n $autoLoadPaths[] = $path . $config['paths']['src'];\n }\n\n if (!empty($config['paths']['configs'])) {\n $configPaths[] = $path . $config['paths']['configs'] . '/';\n }\n\n if (!empty($config['paths']['dependency'])) {\n $dependencyPaths[] = $path . $config['paths']['dependency'];\n }\n\n /*\n * @todo implement extension locales and templates\n\n if (!empty($modCfg['autoloader-psr-4'])) {\n foreach ($modCfg['autoloader-psr-4'] as $ns =>$classPath) {\n $autoLoadPathsPsr4[$ns] = str_replace('./', $path, $classPath);\n }\n }\n\n */\n $this->loadedExtensions[$index]['load'] = true;\n }\n\n // Add autoloader paths\n if (!empty($autoLoadPaths)) {\n $autoloaderConfig = $configStorage->get('autoloader.php');\n $autoloaderCfg = $autoloaderConfig->__toArray();\n $newChain = $autoloaderCfg['priority'];\n\n foreach ($autoLoadPaths as $path) {\n $newChain[] = $path;\n }\n $currentAutoloadPaths = $this->autoloader->getRegisteredPaths();\n foreach ($currentAutoloadPaths as $path) {\n if (!in_array($path, $newChain, true)) {\n $newChain[] = $path;\n }\n }\n\n $autoloaderCfg['psr-4'] = array_merge($autoLoadPathsPsr4, $autoloaderCfg['psr-4']);\n $autoloaderCfg['paths'] = $newChain;\n\n // update autoloader paths\n $this->autoloader->setConfig(['paths' => $autoloaderCfg['paths'], 'psr-4' => $autoloaderCfg['psr-4']]);\n // update main configuration\n $autoloaderConfig->setData($autoloaderCfg);\n }\n // Add Config paths\n if (!empty($configPaths)) {\n $writePath = $configStorage->getWrite();\n $applyPath = $configStorage->getApplyTo();\n\n $paths = $configStorage->getPaths();\n $resultPaths = [];\n\n foreach ($paths as $path) {\n if ($path !== $writePath && $path !== $applyPath) {\n $resultPaths[] = $path;\n }\n }\n foreach ($configPaths as $path) {\n \\array_unshift($resultPaths, $path);\n }\n\n \\array_unshift($resultPaths, $applyPath);\n $resultPaths[] = $writePath;\n $configStorage->replacePaths($resultPaths);\n }\n // register dependencies\n if (!empty($dependencyPaths)) {\n foreach ($dependencyPaths as $file) {\n if ($this->di instanceof DependencyContainer || method_exists($this->di, 'bindArray')) {\n $this->di->bindArray(include $file);\n }\n }\n }\n }", "public function init_required_modules() {\n\t\t\t$required_modules = apply_filters( 'cherry_core_required_modules', array(\n\t\t\t\t'cherry-toolkit',\n\t\t\t\t'cherry-widget-factory',\n\t\t\t), $this );\n\n\t\t\tforeach ( $required_modules as $module ) {\n\n\t\t\t\tif ( ! array_key_exists( $module, $this->settings['modules'] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$settings = $this->settings['modules'][ $module ];\n\t\t\t\t$args = ! empty( $settings['args'] ) ? $settings['args'] : array();\n\n\t\t\t\t$this->init_module( $module, $args );\n\t\t\t}\n\t\t}", "private function init(): void\n {\n // Load composer.json\n $this->composerJson = $this->loadJsonFile($this->composerJsonFilename);\n\n // Reconstitute the composer.lock filename\n $composerLockFilename = dirname($this->composerJsonFilename) .\n DIRECTORY_SEPARATOR .\n basename($this->composerJsonFilename, '.json') .\n '.lock';\n\n // Check if composer.lock file exists\n if (!file_exists($composerLockFilename)) {\n throw new ComposerException(\n sprintf('Project is not initialized with Composer, \"%s\" file doest not exists', $composerLockFilename)\n );\n }\n\n // Get JSON content of composer.json file\n if (($this->composerLock = json_decode(file_get_contents($composerLockFilename), true)) === false) {\n throw new ComposerException(\n sprintf('\"%s\" file of project is corrupted or not readable', $composerLockFilename)\n );\n }\n\n // Reindex packages\n $this->composerLock['packages'] = array_column($this->composerLock['packages'], null, 'name');\n\n // Load packages\n $this->packages = array_fill_keys(array_column($this->composerLock['packages'], 'name'), null);\n }", "function __construct()\n\t{\n\t\t// Store module path\n\t\t$this->module_path = dirname(__FILE__);\n }", "function __construct()\n\t{\n\t\t// Store module path\n\t\t$this->module_path = dirname(__FILE__);\n\t}", "public function set_needed_repos(): void {}", "public function set_needed_repos(): void {}", "public function actionInit()\n {\n $this->initRoles($this->roles);\n $this->initPermissions($this->permissions);\n $this->initDependencies($this->dependencies);\n }", "protected function readModules()\n {\n foreach ($this->moduleList as $vendorName => &$modulesArray) {\n $directoryIterator = new \\DirectoryIterator(\n $this->getAppCodeAbsolutePath() . DIRECTORY_SEPARATOR . $vendorName\n );\n foreach ($directoryIterator as $element) {\n if ($element->isDir()\n && $this->isBaseNameValid($element->getBasename())\n ) {\n $modulesArray[] = $element->getBasename();\n }\n }\n }\n }", "function maquetador_precarga_modulos( $path=\"./modulos\") {\n global $aEstado;\n $nlong = mb_strlen($path)+1;\n foreach ( glob (\"$path/*.php\") as $modulo ) { \n if ( mb_substr($modulo,-9) ==\"_load.php\" ) {\n $aEstado[\"modulos\"][mb_substr($modulo,$nlong,-9)]= false;\n include_once ( $modulo );\n } else {\n $aEstado[\"modulos\"][mb_substr($modulo,$nlong,-4)]= $modulo;\n }\n }\n}", "public function _construct()\r\n {\r\n $this->moduleHelper->setModuleName(self::MODULE_NAME_CONFIG_PATH);\r\n }", "public function git_init($dir)\n\t\t{\n\t\t\t$cmd=\"git init \".$dir;\n\t\t\t//printf(\"cmd:%s<br/>\",$cmd);//test\n\t\t\t$last_line=exec ($cmd , $output , $retval);\n\t\t\tcheck_error($cmd,$retval);\n\t\t}", "public function setModules()\n\t{\n \t//Zend_Registry::set('modules', $modules->getList());\n\t}", "function loadSubModules()\n{\n $debug_prefix = debug_indent(\"Module->loadSubModules() {$this->ModuleID}:\");\n $submodule_elements = $this->_map->selectChildrenOfFirst('SubModules', null, null, true, true);\n if(count($submodule_elements) > 0){\n foreach($submodule_elements as $submodule_element){\n $submodule = $submodule_element->createObject($this->ModuleID);\n $subModuleID = $submodule_element->getAttr('moduleID', true);\n $this->SubModules[$subModuleID] = $submodule;\n print \"$debug_prefix Submodule $subModuleID parsed.\\n\";\n unset($submodule);\n }\n\n //special for best practices: add the IsBestPractice SummaryField\n if(isset($this->SubModules['bpc'])){\n $this->useBestPractices = true;\n $recordIDField = end($this->PKFields);\n\n $field_object = MakeObject(\n $this->ModuleID,\n 'IsBestPractice',\n 'SummaryField',\n array(\n 'name' => 'IsBestPractice',\n 'type' => 'tinyint',\n 'summaryFunction' => 'count',\n 'summaryField' => 'BestPracticeID',\n 'summaryKey' => 'RelatedRecordID',\n 'summaryModuleID' => 'bpc',\n 'localKey' => $recordIDField,\n 'phrase' => 'Is Best Practice|Whether the associated record is a best practice'\n )\n );\n//print \"best practice auto field\";\n//print_r($field_object);\n//die();\n $this->ModuleFields['IsBestPractice'] = $field_object;\n }\n\n //copies submodule conditions to summary fields\n foreach($this->ModuleFields as $fieldName => $field){\n if('summaryfield' == strtolower(get_class($field))){\n if(!$field->isGlobal){\n\n if(isset($this->SubModules[$field->summaryModuleID])){\n $subModule =& $this->SubModules[$field->summaryModuleID];\n if(count($subModule->conditions) > 0){\n //$field->conditions = $subModule->conditions;\n $field->conditions = array_merge($subModule->conditions, (array)$field->conditions);\n $this->ModuleFields[$fieldName] = $field;\n }\n unset($subModule);\n } else {\n trigger_error(\"The summaryfield '{$field->name}' requires a '{$field->summaryModuleID}' submodule.\", E_USER_ERROR);\n }\n }\n }\n }\n }\n debug_unindent();\n}", "protected function setUp(): void\n {\n parent::setUp();\n\n $this->modulePath = base_path('modules/Blog');\n $this->finder = $this->app['files'];\n $this->artisan('module:make', ['name' => ['Blog']]);\n }", "public function initialize(Bootstrap $bootstrap): void\n {\n $this->bootstrap = $bootstrap;\n $this->packageStatesConfiguration = $this->getCurrentPackageStates();\n $this->registerPackagesFromConfiguration($this->packageStatesConfiguration);\n /** @var PackageInterface $package */\n\n foreach ($this->packages as $package) {\n if ($package instanceof FlowPackageInterface) {\n $this->flowPackages[$package->getPackageKey()] = $package;\n }\n if (!$package instanceof BootablePackageInterface) {\n continue;\n }\n $package->boot($bootstrap);\n }\n }", "public static function initModuleAccess()\n\t{\n\t\tself::$modulePath =\t_PS_MODULE_DIR_. 'mondialrelay/';\n\t\n\t\t$protocol = (Configuration::get('PS_SSL_ENABLED') || (!empty($_SERVER['HTTPS']) \n\t\t\t&& strtolower($_SERVER['HTTPS']) != 'off')) ? 'https://' : 'http://';\n\t\t\n\t\t$endURL = __PS_BASE_URI__.'/modules/mondialrelay/';\n\t\n\t\tif (method_exists('Tools', 'getShopDomainSsl'))\n\t\t\tself::$moduleURL = $protocol.Tools::getShopDomainSsl().$endURL;\n\t\telse\n\t\t\tself::$moduleURL = $protocol.$_SERVER['HTTP_HOST'].$endURL;\t\t\t\n\t}", "public function initialize() {\n $loadjquery = $this->modx->getOption('sekusergalleries.load_jquery');\n $this->setDefaultProperties(array(\n 'tplDirContainer' => 'directory.container',\n 'tplDirGraph' => 'directory.bargraph',\n 'graphcss' => '',\n 'customcss' => '',\n 'loadjquery' => $loadjquery,\n ));\n\n $this->directory_name = $this->modx->user->get('id');\n }", "public function initialize()\n {\n if (file_exists($this->path.'init.php')) {\n require_once($this->path.'init.php');\n }\n }", "public function init()\n\t{\n\t\t$this->loader->init();\n\t\t$this->routing->init();\n\t}" ]
[ "0.8622318", "0.63352215", "0.6253569", "0.62153804", "0.61189395", "0.61161506", "0.5994897", "0.58679426", "0.57577866", "0.57424986", "0.5734071", "0.57059604", "0.5612512", "0.5531654", "0.54932", "0.54730964", "0.5472321", "0.54546887", "0.54544926", "0.5442336", "0.5428891", "0.5347971", "0.5298989", "0.529162", "0.52904946", "0.52855444", "0.52721655", "0.5259071", "0.52417713", "0.5241227", "0.5234939", "0.5221014", "0.52047133", "0.5194363", "0.5190081", "0.51387614", "0.51270884", "0.5115839", "0.51154923", "0.5096337", "0.5083305", "0.50830406", "0.50756514", "0.5065049", "0.5051635", "0.5044986", "0.5038823", "0.50372165", "0.5035962", "0.50292504", "0.5017531", "0.50169665", "0.50021577", "0.49895105", "0.49880755", "0.4945494", "0.49418768", "0.49290383", "0.49214086", "0.49080378", "0.49080378", "0.49080378", "0.49080378", "0.49080378", "0.49080378", "0.49065804", "0.48936087", "0.48822677", "0.48811448", "0.4873813", "0.4872769", "0.48726183", "0.48536113", "0.4852924", "0.48522875", "0.4848996", "0.48486924", "0.48399717", "0.48320472", "0.48316804", "0.48265922", "0.48256883", "0.48252016", "0.4821507", "0.48178065", "0.48176455", "0.48176455", "0.47982535", "0.47861916", "0.47813717", "0.47796547", "0.4778767", "0.4773363", "0.47706416", "0.47693902", "0.4765504", "0.47600213", "0.47580022", "0.47542265", "0.47522855" ]
0.83416283
1
Indicates whether or not the given path contains a Git repository.
public static function isRepo($path) { $dotGitPath = $path . DIRECTORY_SEPARATOR . '.git'; $dotGitExists = file_exists($dotGitPath); $dotGitIsDir = is_dir($dotGitPath); return $dotGitExists && $dotGitIsDir; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function git_is_repo($path) {\n\treturn GitUtil::isRepo($path);\n}", "private function isGitObject(string $path): bool\n {\n // Non-bare Git repository.\n if (1 === preg_match('/.*\\/\\.git\\/objects\\/.+$/', $path)) {\n return true;\n }\n\n // Bare Git repository.\n preg_match('/(.*)\\/objects\\/.+$/', $path, $matches);\n\n if (isset($matches[1])) {\n return $this->gitDiscovery->isBareGitRepo($matches[1]);\n }\n\n return false;\n }", "private function isGitHook(string $path): bool\n {\n if (1 === preg_match('/.*\\/\\.git\\/hooks\\/.+$/', $path)) {\n return true;\n }\n\n // Bare Git repository.\n preg_match('/(.*)\\/hooks\\/.+$/', $path, $matches);\n\n if (isset($matches[1])) {\n return $this->gitDiscovery->isBareGitRepo($matches[1]);\n }\n\n return false;\n }", "public static function is_repo($var) {\n\t\t\treturn (get_class($var) == 'GitRepo');\n\t\t}", "public static function exists($repo)\n {\n return !static::exec('git', ['ls-remote', '[email protected]:' . $repo], true);\n }", "public static function repoExists($repo)\n\t{\n\t\treturn file_exists(\\Config::get('repoPath').$repo);\n\t}", "function git_is_clean($path) {\n\t$status = GitUtil::getStatus($path);\n\treturn count($status) === 0;\n}", "public function exists()\n\t{\n\t\t// If we don't have a configuration file for the repository it doesn't exist.\n\t\treturn file_exists($this->_root . '/.git/config');\n\t}", "public static function isGitHubRepoUrl(string $url): bool\n {\n return preg_match(self::GH_REGEX, $url);\n }", "function isGit($resource,$site) {\n\t\n //$error=[];\n //chdir(\"../../zone/\". $resource . \"/\" . $site);\n //exec('\"C:\\Program Files\\Git\\cmd\\git.exe\" rev-parse --verify master 2>&1', $output, $error[0]);\n //exec('\"C:\\Program Files\\Git\\cmd\\git.exe\" ls-remote -q --refs 2>&1', $output, $error[1]); \n\t$result = checkIsGit($resource,$site);\n\t\n if ($result == \"Y\")\n return TRUE;\n else \n return FALSE; \n}", "public function hasRepository(string $repository) :bool\n {\n return array_key_exists($repository, $this->repositories);\n }", "public function hasRepository(string $className): bool;", "public function existsRepo($repo = null)\n {\n return static::exists($repo ?: $this->getFull_name());\n }", "public function hasRepository(): bool;", "private function isRepo($method)\n {\n return substr($method, 4, 10) == 'Repository';\n }", "abstract function is_org_repo_compliant();", "public function isFileInGit($filename)\n\t{\n\t\ttry\n\t\t{\n\t\t\t$this->execute(['ls-files', '--error-unmatch', $filename]);\n\t\t}\n\t\tcatch (GitException $git_exception)\n\t\t{\n\t\t\tswitch ($git_exception->getCode())\n\t\t\t{\n\t\t\tcase 1:\n\t\t\t\t// The `git ls-files --error-unmatch` command didn't find the given file in git and has yelled an error\n\t\t\t\t// number 1. This exception can be considered normal. We can just report that the file is not in git and\n\t\t\t\t// continue the execution normally.\n\t\t\t\treturn false;\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// An unrecognised error has occurred. Rethrow the exception.\n\t\t\t\tthrow $git_exception;\n\t\t\t}\n\t\t}\n\t\t// As the command didn't give any error code when exiting, it's a sign for us to know that the file _does_ exist in git.\n\t\treturn true;\n\t}", "public function hasRepository();", "public function folderExists(string $path): bool;", "abstract protected function isValid(Repository $repository, string $file): bool;", "public function validateGitPlatform() : bool\n {\n /** @var string */\n $bitbucketPath = '/bitbucket';\n\n try {\n $response = $this->httpClient->request(\n ExternalLibraryHttpClient::GET,\n $bitbucketPath\n );\n\n if (self::HTTP_OK !== $response->getStatusCode()) {\n $this->logger->warning('Failed to login Bitbucket.');\n\n return false;\n }\n } catch (ClientException $exception) {\n $this->logger->warning(\n sprintf(\n 'Failed to login Bitbucket. %s ',\n $exception->getMessage()\n )\n );\n\n return false;\n }\n\n return true;\n }", "public function parse_git_url( $git_url ) {\n\n\t\t\t// no git url, no deploy\n\t\t\tif ( empty( $git_url ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$matches = array();\n\n\t\t\t// match regex against url\n\t\t\tpreg_match( self::GIT_URL_PATTERN, $git_url, $matches );\n\n\t\t\t// didn't match, git url is not proper, no deploy\n\t\t\tif ( empty( $matches ) || ! is_array( $matches ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// didn't get the name of repo from url, url is malformed, no deploy\n\t\t\tif ( ! isset( $matches[ 2 ] ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// first matches key has the domain name of remote,\n\t\t\t// useful for picking appropriate schema\n\t\t\t$this->repo[ 'remote_domain' ] = $matches[ 1 ];\n\n\t\t\t// name of the repo, used to create the appropriate directories\n\t\t\t$this->repo[ 'name' ] = $matches[ 2 ];\n\n\t\t\t// everything went well\n\t\t\treturn true;\n\t\t}", "public function has($path) {\n $return = parent::has($path);\n // Appease file.inc's calls to is_dir()\n return ($return !== FALSE) ? $return : parent::has($path . '/');\n }", "public function git_directory_path() {\n\t\t\treturn ($this->bare) ? $this->repo_path : $this->repo_path.\"/.git\";\n\t\t}", "public function exists(string $path): bool;", "public function exists(string $path): bool;", "public function hasRepository($className);", "public function isDirectory(string $path): bool;", "public function isDirectory(string $path): bool;", "public function has(string $path): bool;", "public function has(string $path): bool;", "public static function pathExists($path) {\n return file_exists($path) || is_link($path);\n }", "public function exists(string $path, string $version): bool;", "public static function exists($path)\r\n\t{\r\n\t\t$pathObject = new JFilesystemWrapperPath;\r\n\r\n\t\treturn is_dir($pathObject->clean($path));\r\n\t}", "public function exists($path);", "public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)\n {\n return parent::isInstalled($repo, $package) && is_dir($this->getComponentPath());\n }", "function exists($path) \n {\n return is_dir($this->_fs->path()->clean($path));\n }", "protected function getRepository() {\n\t\tif ($this->_repository === null) {\n\t\t\t$this->_repository = new AGitRepository();\n\t\t\t$this->_repository->setPath($this->path,true,true);\n\t\t\t$this->assertTrue(file_exists($this->path));\n\t\t}\n\t\treturn $this->_repository;\n\t}", "function pathExists($path);", "public static function isWorld(string $path): bool;", "public static function init($path)\n {\n $path .= '/';\n if (!is_dir($path)) {\n mkdir($path);\n } elseif (is_dir($path . 'objects')) {\n return false;\n }\n\n mkdir($path . 'objects');\n mkdir($path . 'objects/info');\n mkdir($path . 'objects/pack');\n mkdir($path . 'refs');\n mkdir($path . 'refs/heads');\n mkdir($path . 'refs/tags');\n\n file_put_contents($path . 'HEAD', 'ref: refs/heads/master');\n\n return true;\n }", "public function hasDirectory(): bool;", "public function hasDirectory(): bool;", "function isFileExists($relativePath): bool;", "public function has($path);", "function valid_folder($path){\r\n\t$ignore = array('.', '..', '.svn', 'CVS', 'cache', 'install', 'index.html', '.htaccess', '_images');\r\n\tif (isset($path)){\r\n\t\tif (!is_file($path) && !is_link($path) && !in_array(basename($path), $ignore)){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "public function has($path)\n {\n return $this->findByLocation($path) !== null;\n }", "public function exist($id){\n\t\t$sql = \"SELECT id FROM repositories WHERE id=:id\";\n\t\t$stmt = $this->db->prepare($sql);\n\t\t\n\t\t$stmt->bindParam(':id', $id);\n\t\t$stmt->execute();\n\t\t\n\t\tif( $stmt->rowCount() > 0 ){\n\t\t\treturn true;\n\t\t} \n\t\t\n\t\treturn false;\n\t}", "public static function exists(string $path) : bool\n {\n return (new File($path))->exists();\n }", "public static function isModulePath($path)\n {\n if (!static::isLibraryPath($path)) {\n return false;\n }\n\n // Check for _config\n if (!is_file(\"$path/_config.php\") && !is_dir(\"$path/_config\")) {\n return false;\n }\n\n // Skip ignored modules\n $name = basename($path);\n $ignore = array('mysite', 'assets', 'vendor');\n return !in_array($name, $ignore);\n }", "public function pathExists($path);", "public function is_local( $path ){\r\n\r\n\t\tif ( count( explode( root, $path ) ) > 1 )\r\n\t\t\treturn true;\r\n\r\n\t\treturn false;\r\n\r\n\t}", "public function has($path): bool\n {\n $meta = $this->getMetadata($path);\n if ($meta) {\n return true;\n }\n return false;\n }", "public function isSelf($path)\n\t{\n\t\t$path = $this->resolve($path);\n\n\t\treturn $path === $this->root;\n\t}", "final public static function exists($path) {\n return file_exists( $path );\n }", "public function isParentOf($path)\n\t{\n\t\t$path = $this->resolve($path);\n\n\t\tif ($path === $this->root) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn 0 === \\strpos($path, $this->root);\n\t}", "public function hasAsset(string $path): bool\n {\n if (!empty($path)) {\n $paths = explode('/', $path);\n\n $type = !empty($paths[0]) ? $paths[0] : '';\n $asset = !empty($paths[1]) ? $paths[1] : '';\n\n if (!empty($type) && !empty($asset)) {\n return !empty($this->dependencies[$type][$asset]);\n }\n\n if (!empty($type)) {\n return !empty($this->dependencies[$type]);\n }\n }\n\n return false;\n }", "protected function repositoryExists()\n {\n return retry(2, fn() => $this->migrator->repositoryExists(), 0, function ($e) {\n try {\n if ($e->getPrevious() instanceof SQLiteDatabaseDoesNotExistException) {\n return $this->createMissingSqliteDatabase($e->getPrevious()->path);\n }\n\n $connection = $this->migrator->resolveConnection($this->option('database'));\n\n if (\n $e->getPrevious() instanceof PDOException &&\n $e->getPrevious()->getCode() === 1049 &&\n $connection->getDriverName() === 'mysql') {\n return $this->createMissingMysqlDatabase($connection);\n }\n\n return false;\n } catch (Throwable) {\n return false;\n }\n });\n }", "public function checkIsDirectory($path);", "public function supports($path)\n {\n return is_string($path)\n && is_dir($this->findAbsolutePath($path));\n }", "public function exists()\n {\n return $this->isDir() || $this->isFile() || $this->isLink();\n }", "public function moduleExists()\n {\n $location1 = $this->files->isDirectory(base_path('Modules/' . $this->module));\n $location2 = $this->files->isDirectory(base_path('vendor/typicms/' . mb_strtolower($this->module)));\n\n return $location1 || $location2;\n }", "public function has($path)\n {\n $location = $this->applyPathPrefix($path);\n\n if ($this->ossClient->doesObjectExist($this->bucket, $location, $this->options)) {\n return true;\n }\n\n return $this->doesDirectoryExist($location);\n }", "public function pathExists($path)\n {\n $url = $_ENV['app_frontend_url'] . self::URL . '?path=' . urlencode($path);\n $curl = $this->transport;\n $curl->write($url, [], CurlInterface::GET);\n $result = $curl->read();\n $curl->close();\n\n return strpos($result, 'path exists: true') !== false;\n }", "public function checkIsPathExists($path);", "public function exists(string $path) : bool\n {\n return array_key_exists($path, $this->children);\n }", "public static function getStatus($path) {\n\t\tif (!file_exists($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to get git status of $path. Path does not exist.\");\n\t\t}\n\n\t\tif (!is_dir($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to get git status of $path. Path is not a directory.\");\n\t\t}\n\n\t\tif (!self::isRepo($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to get git status of $path. Path is not a git repository.\");\n\t\t}\n\n\t\t$origCwd = getcwd();\n\t\tchdir($path);\n\n\t\t$output = array();\n\t\texec(\"git status --porcelain\", $output);\n\t\tif (count($output) === 0) {\n\t\t\treturn $output;\n\t\t}\n\n\t\t$files = array();\n\t\tforeach ($output AS $status) {\n\t\t\t$flag = substr($status, 0, 2);\n\t\t\t$file = trim(substr($status, 2));\n\n\t\t\t$idx = null;\n\t\t\t$fileInfo = null;\n\t\t\tswitch ($flag) {\n\n\t\t\t\tcase ' M': // Modified, not updated\n\t\t\t\t$idx = 'changed';\n\t\t\t\t$fileInfo = $file;\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'A ': // New file\n\t\t\t\t$idx = 'new';\n\t\t\t\t$fileInfo = $file;\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'D ': // Deleted file\n\t\t\t\t$idx = 'removed';\n\t\t\t\t$fileInfo = $file;\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'M ': // Modified, updated\n\t\t\t\t$idx = 'modified';\n\t\t\t\t$fileInfo = $file;\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'R ': // Renamed\n\t\t\t\t$idx = 'moved';\n\t\t\t\t$fileInfo = array_map(function ($a) {\n\t\t\t\t\treturn trim($a);\n\t\t\t\t}, explode('->', $file));\n\t\t\t\tbreak;\n\n\t\t\t\tcase '??': // Untracked\n\t\t\t\t$idx = 'untracked';\n\t\t\t\t$fileInfo = $file;\n\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\tassert(\"false /*Unrecognized git status flag $flag*/\");\n\t\t\t}\n\n\t\t\tif ($idx !== null) {\n\t\t\t\tif (!isset($files[$idx])) {\n\t\t\t\t\t$files[$idx] = array();\n\t\t\t\t}\n\t\t\t\t$files[$idx][] = $fileInfo;\n\t\t\t}\n\t\t}\n\n\t\tchdir($origCwd);\n\n\t\treturn $files;\n\t}", "private function isExists($path)\r\n {\r\n $file = PATH . DS . str_replace('/', DS, $path);\r\n if(file_exists($file)){\r\n return true;\r\n }\r\n return false;\r\n }", "public static function exists($path)\n {\n }", "function fn_check_path($path)\n{\n $real_path = realpath($path);\n\n return str_replace('\\\\', '/', $real_path) == $path ? true : false;\n}", "public function exists($path) {\n return file_exists($path);\n }", "function get_repo_path($proj, $repos) {\n\n foreach ($repos as $repo) {\n $path = basename($repo);\n if ($path == $proj)\n return $repo;\n }\n}", "public static function isSaveRelativePath($path)\n {\n if (false === self::isRelativePath($path)) {\n return false;\n }\n\n $parts = explode('/', $path);\n $level = 0;\n foreach ($parts as $part) {\n if ('..' === $part) {\n --$level;\n if ($level < 0) {\n return false;\n }\n } elseif ('' !== $part) {\n ++$level;\n }\n }\n\n return true;\n }", "public static function determineGit($arg, &$matches)\n {\n $reg0 = '#^\n (?:git|https|http|ssh|rsync|file?)(://|@).*?(/|\\:)\n (?P<package>[a-zA-Z0-9\\-_]+)\n (?:\n (?:\\.git|)\n (?:\\#(?P<reference>.*?)|)\n )?\n $#x';\n\n return self::match([$reg0], $arg, $matches);\n }", "function exists() {\n\t\treturn is_file($this->path);\n\t}", "public static function isLocal(string $path): bool\n {\n return '' !== $path && !str_contains($path, '://');\n }", "public function isExists($path)\n {\n $headers = array_change_key_case(get_headers($this->getScheme() . $path, 1), CASE_LOWER);\n\n $status = $headers[0];\n\n if (strpos($status, '200 OK') === false) {\n $result = false;\n } else {\n $result = true;\n }\n\n return $result;\n }", "public static function exists ($path) {\n\t\t\\clearstatcache(true, $path);\n\t\treturn \\file_exists($path);\n\t}", "public function testGitLabRemoteRepository(): void\n {\n $repo = new GitLabRemoteRepository('r/r', './');\n $this->assertEquals('https://gitlab.com/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "public function exist($path)\n {\n return file_exists($path);\n }", "protected function isRepositoryReadable()\n {\n return $this->getRepository() instanceof ReadableInterface;\n }", "public function isPath( string $path ): bool {\n\t\t\treturn (bool) @preg_match(\n\t\t\t\t'/^(.+)/([^/]+)$/',\n\t\t\t\t$path\n\t\t\t);\n\t\t}", "protected static function pathIsRelative($path) {\n\t\treturn !preg_match(\"|^\".DIRECTORY_SEPARATOR.\"|\", $path);\n\t}", "public function hasPath(string $path) : bool {\n\t\t\treturn ($this->getValue($path) !== null);\n\t\t}", "public function exists()\n {\n if (is_string($this->current_filepath)) {\n return is_file($this->current_filepath);\n }\n return false;\n }", "public function isValidPathReturnsTrueIfPathExists() {}", "public function isARepository($class)\n {\n return is_subclass_of($class, 'PostIt\\Repositories\\EntityRepository');\n }", "public function isMerging(): bool\n {\n foreach (['MERGE_MSG', 'MERGE_HEAD', 'MERGE_MODE'] as $fileName) {\n if (file_exists($this->dotGitDir . DIRECTORY_SEPARATOR . $fileName)) {\n return true;\n }\n }\n return false;\n }", "public function isFullPath( string $path ): bool {\n\t\t\treturn (bool) @preg_match(\n\t\t\t\t'/((\\/|\\\\|\\/\\/|https?:\\\\\\\\|https?:\\/\\/)[a-z0-9 _@\\-^!#$%&+={}.\\/\\\\\\[\\]]+)+\\.[a-z]+$/',\n\t\t\t\t$path\n\t\t\t);\n\t\t}", "public function isdir(string $path): Promise;", "public function checkPathExists($path);", "public function exists(): bool\n {\n return is_file($this->path);\n }", "public function hasRelativePath()\n {\n return false;\n }", "public function has($path)\n {\n if ($this->client->doesObjectExist($this->bucket,$path)) {\n return true;\n }\n return false;\n }", "public static function exists($path)\n {\n if (file_exists($path)) return true;\n\n return false;\n }", "public static function exists($path)\n {\n return file_exists($path);\n }", "public function testGitLabRemoteRepositoryExternal(): void\n {\n $repo = new GitLabRemoteRepository('r/r', './', 'https://salsa.debian.org/');\n $this->assertEquals('https://salsa.debian.org/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "public function exists(string $path): bool\n {\n return file_exists($path);\n }", "public function exists($path)\n {\n return file_exists($path);\n }", "public function isFile(string $path): bool;" ]
[ "0.82872033", "0.7625667", "0.70613265", "0.67163795", "0.64855003", "0.64713067", "0.64349276", "0.643219", "0.6230931", "0.6193124", "0.60056543", "0.58625686", "0.585077", "0.58260787", "0.57926124", "0.5738129", "0.5722523", "0.5540091", "0.55369014", "0.5531937", "0.5523598", "0.5462151", "0.5436347", "0.54031956", "0.5401062", "0.5401062", "0.5378653", "0.5362548", "0.5362548", "0.53519046", "0.53519046", "0.5342328", "0.5277228", "0.5254393", "0.5253509", "0.5248328", "0.5216188", "0.51970977", "0.51817733", "0.5179366", "0.51781446", "0.5156796", "0.5156796", "0.51420057", "0.51360726", "0.5114036", "0.5091249", "0.5087544", "0.5062357", "0.5057072", "0.5046006", "0.5030585", "0.5030538", "0.5022127", "0.50186425", "0.5011954", "0.50090647", "0.4991523", "0.49910975", "0.4981796", "0.49786365", "0.49763426", "0.4974008", "0.4971671", "0.49703604", "0.49541038", "0.49530673", "0.49483696", "0.49438074", "0.49402025", "0.4921743", "0.49209198", "0.49176493", "0.49154827", "0.49132177", "0.49104545", "0.49087337", "0.4901534", "0.4884162", "0.48841003", "0.48834354", "0.4870218", "0.4869802", "0.4865802", "0.48650852", "0.48611918", "0.48596835", "0.4858842", "0.48194182", "0.48133254", "0.48119393", "0.48089376", "0.48083043", "0.4806238", "0.48013273", "0.47981298", "0.4796069", "0.47871473", "0.4785196", "0.47819003" ]
0.78893626
1
Move or create an existing lightweight tag.
public static function moveTag($repo, $tag, $version = 'HEAD') { $cmd = String(self::MOVE_TAG_CMD)->format([ 'tag' => $tag, 'version' => $version ]); return self::doInDir($repo, $cmd); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function createNewTag(object $tag) \n {\n if(Tag::find($tag->id)) return;\n\n $newTag = new Tag;\n \n $newTag->id = $tag->id;\n $newTag->name = $tag->name;\n $newTag->description = $tag->description;\n\n if(isset($tag->category->id)){\n\n $category = Category::firstOrCreate([\n 'id' => $tag->category->id,\n 'name' => $tag->category->name,\n 'description' => $tag->category->description,\n ]);\n\n $newTag->category()->associate($category->fresh());\n }\n\n $newTag->save();\n }", "public function insert(Tag $tag);", "private function createTag($tag_name, $row) {\n // Check if we already have the tag in the destination.\n $result = \\Drupal::database()\n ->select('taxonomy_term_field_data', 't')\n ->fields('t', ['tid'])\n ->condition('t.vid', 'tags', '=')\n ->condition('t.name', $tag_name, '=')\n ->execute()\n ->fetchField();\n if ($result) {\n return $result;\n }\n // If we didn't have the tag already,\n // then create a new tag and return its id.\n $term = Term::create([\n 'name' => $tag_name,\n 'vid' => 'tags',\n ]);\n if ($term->save()) {\n return $term->id();\n }\n\n // If we didn't save for some reason, add a notice\n // to the migration, and return a null.\n $message = 'Taxonomy term failed to migrate. Missing term was: ' . $tag_name;\n $this->migration\n ->getIdMap()\n ->saveMessage(['nid' => $row->getSourceProperty('nid')], $message);\n return FALSE;\n }", "function update_tag( $tag_id, $tag_name = null, $tag_color = null, $tag_bg = null ) {\n $tag = E_Tag::set_instance( $tag_id, $tag_name, $tag_color, $tag_bg );\n return $tag;\n}", "function git_move_tag($path, $tag, $version = 'HEAD') {\n\tGitUtil::moveTag($path, $tag, $version);\n}", "public function addTagToPostInTheMiddle() {}", "static function GetOrCreateTag($tag){\n\t\tif(!strlen($tag)){ return null; }\n\n\t\t($out = Tag::FindByTag($tag)) ||\n\t\t($out = Tag::CreateNewRecord(array(\"tag\" => $tag)));\n\n\t\treturn $out;\n\t}", "public function moveTagFromEndToTheMiddle() {}", "public function create()\n {\n getAuthentication()->requireAuthentication();\n $tag = $_POST['tag'];\n unset($_POST['tag']);\n return $this->update($tag);\n }", "public function createTag()\n {\n return new Tag();\n }", "public function undo_tag() {\n\t\t$version = $this->conf['common']['releasever'];\n\t\t$tag = str_replace( '$1', $version, $this->conf['common']['tagname'] );\n\n\t\tforeach ( $this->conf['extensions'] as $ext => $checkout ) {\n\t\t\tchdir( \"{$this->dir}/extensions/$ext\" );\n\t\t\t$cTag = escapeshellarg( $tag );\n\t\t\texec( \"git checkout master\" );\n\t\t\texec( \"git tag -d $cTag\" );\n\t\t\t$cTag = escapeshellarg( \":refs/tags/$tag\" );\n\t\t\texec( \"git push origin $cTag\" );\n\t\t}\n\t}", "function add_tag($tag) {\n if (!is_object($tag)) {\n return false;\n }\n if (!isset($tag->name) or\n !isset($tag->value) or\n !isset($tag->ticketid) or\n isset($tag->id)){\n\n return false;\n }\n\n if (!insert_record('helpdesk_ticket_tag', $tag)) {\n return false;\n }\n\n // Lets make an update saying we added this tag.\n $dat = new stdClass;\n $dat->ticketid = $this->id;\n $dat->notes = get_string('tagaddedwithnameof', 'block_helpdesk') . $tag->name;\n $dat->status = HELPDESK_NATIVE_UPDATE_TAG;\n $dat->type = HELPDESK_UPDATE_TYPE_DETAILED;\n\n if(!$this->add_update($dat)) {\n notify(get_string('cantaddupdate', 'block_helpdesk'));\n }\n\n // Update modified time and refresh the ticket.\n $this->store();\n $this->fetch();\n return true;\n }", "public function addNewTag($tagName) {\n $sql = \"INSERT INTO t_tags VALUES(?)\";\n $select = $this->con->prepare($sql);\n $select->bind_param(\"s\", $tagName);\n $select->execute();\n $select->close();\n }", "function create_tag($tag_id, $tip_id) {\n $rel_res = false;\n \n if (!$tag_id) {\n return null;\n }\n \n $sql = '\n INSERT INTO\n tags (id)\n VALUES\n (?)';\n \n // Note tag insert is always attempted, but may have no effect\n // if tag with $tag_id already exists\n $tag_res = $this->prep_and_exec($sql, [$tag_id]);\n \n if ($tag_res) {\n $rel_res = $this->associate_tag($tag_id, $tip_id);\n }\n \n return ($tag_res and $rel_res);\n }", "public function create()\n {\n $tag = new Tag();\n $this->vars['tag'] = $tag;\n $this->title = __('system.tag_add');\n $this->template = 'admin.tag';\n \n return $this->renderOutput();\n }", "public function inserirTag(Tag $tag){\n $this->tag[] = $tag;\n }", "private function addTag($tagName)\n\t{\n\t\tif (is_null($tagName) || $tagName == '') return;\n\n\t\t// return Builder\n $tag = Tag::where('tag', '=', $tagName)->first();\n\t\t\n\t\tif (is_object($tag))\n\t\t{\n\t\t\t// To increment count number to exists tag\n\t\t\tTagUtil::incrementCount($tagName, 1, $tag);\n\n\t\t\t// return collection object\n\t\t\t$tagPivot = $this->tags()->wherePivot('tag_id', '=', $tag->id)->get();\n\t\t\t\n\t if ($tagPivot->count() === 0)\n\t {\n\t\t\t\t// To attach a related item to taggable\n\t \t$this->tags()->attach($tag->id);\n\t }\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tag = new Tag(['tag' => $tagName]);\n\t\t\t\n\t\t\t$this->tags()->save($tag);\t\n\t\t}\n\t}", "public function testUpdateInvalidTag() {\n\t\t// Create a tag and try to update it without actually inserting it\n\t\t$tag = new Tag(null, $this->VALID_TAG_LABEL);\n\t\t$tag->update($this->getPDO());\n\t}", "public function createTag(string $tagName) : Tag {\n \n // Forsøg på XSS forhindres\n $tagName = htmlentities($tagName);\n \n // Tagget slås op i databasen \n $query = 'SELECT tag_id, tag_name FROM tags WHERE tag_name=?';\n if($stmt = $this->conn->prepare($query)) {\n $stmt->bind_param('s', $tagName);\n \n $stmt->execute();\n $stmt->bind_result($id, $name);\n $result = $stmt->fetch();\n $stmt->close();\n \n if(!$result) { \n // Tagget findes ikke\n if($stmt = $this->conn->prepare('INSERT INTO tags (tag_name) VALUES (?)')){\n $stmt->bind_param('s', $tagName);\n $stmt->execute();\n $stmt->close();\n $tagId = $this->conn->insert_id;\n \n $tag = new Tag($tagId, $tagName);\n return $tag; \n } else {\n die(\"Fejl: Kunne ikke indsætte tag i databasen.\");\n }\n } else {\n // Tagget findes\n $tag = new Tag($id, $name);\n return $tag; \n }\n \n } else {\n die(\"Fejl: Kunne ikke hente taginfo fra databasen.\");\n } \n }", "public function tagged( $tag );", "public static function add_tag($name) {\n global $wpdb;\n $data = array(\n 'name' => $name\n );\n\n // Si no se inserta nada, retornamos false\n if (!$wpdb->insert('XTB_TAGS', $data, array('%s'))) {\n return null;\n }\n\n return $wpdb->insert_id;\n //return true;\n }", "public function createTag()\n {\n $this->di->common->verifyAdmin();\n $form = new Form('tag-form', Models\\Tag::class);\n if ($this->di->request->getMethod() == 'POST') {\n if ($this->di->tag->createFromForm($form)) {\n $this->di->common->redirectMessage('admin/tag', 'Taggen <strong>' . htmlspecialchars($form->getModel()->name) . '</strong> har skapats.');\n }\n }\n \n return $this->di->common->renderMain('tag/edit', [\n 'tag' => $form->getModel(),\n 'update' => false,\n 'form' => $form\n ], 'Skapa tagg');\n }", "public function tag($name = null, $force = false) {\n\t\treturn $this->cmd('tag')->name($name)->force($force);\n\t}", "function create_tag( $tag_name, $tag_color = null, $tag_bg = null ) {\n $tag = E_Tag::new_instance( $tag_name, $tag_color, $tag_bg );\n return $tag;\n}", "public function addTag($tag) {\n $this->init(); //it would actually work without it\n\n if (!in_array($tag,$this->tags)) {\n $tag = trim($tag);\n\n $this->tags['new'][] = $tag;\n return true;\n }\n\n return false;\n }", "public function createTag($tag){\n\t\t$user = $this->getUser();\n\t\tif(!isset($user[\"id\"]))return false;\n\t\tif(is_array($tag)){\n\t\t\t$success = true;\n\t\t\tforeach($tag as $t){\n\t\t\t\tif(!$this->createTag($t)){\n\t\t\t\t\t$success = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $success;\n\t\t}else{\n\t\t\t$tags = $this->getTag($tag);\n\t\t\tif(isset($tags[\"tagid\"])){\n\t\t\t\treturn $tags[\"tagid\"];\n\t\t\t}\n\t\t\tif(strlen(trim($tag))<3)return false;\n\t\t\t$tag = strtolower($tag);\n\t\t\t$this->log(\"@\".$user[\"id\"].\" (\".$user[\"username\"].\") creates tag '\".$tag.\"'\");\n\t\t\t$query = Queries::createtag($tag);\n\t\t\treturn $this->query($query);\n\t\t}\n\t}", "abstract protected function getTag() : Tag;", "function updateTag($tagName) {\r\n\r\n // debug( $tagName);\r\n // $newTagName = $stemmer->stem($tagName);\r\n\r\n if (empty($tagName) )\r\n return false;\r\n \r\n $result = $this->findByName($tagName);\r\n\r\n if ($result)\r\n return($result['Tag']['id']);\r\n else {\r\n $this->create();\r\n $this->saveField('name', $tagName);\r\n return($this->id);\r\n }\r\n \r\n }", "function add_tag($tag) {\n array_push($this->tags, $tag);\n }", "public function tagAs($objid, $tag);", "function doTagStuff(){}", "protected function _initTag()\n {\n $tagId = (int)$this->getRequest()->getParam('tag_id', false);\n $storeId = (int)$this->getRequest()->getParam('store', false);\n $tag = $this->_objectManager->create(\\Magepow\\ProductTags\\Model\\Tag::class);\n if ($tagId) {\n $tag->load($tagId);\n }\n $coreRegistry = $this->_objectManager->get(\\Magento\\Framework\\Registry::class);\n $coreRegistry->register('tag', $tag);\n $coreRegistry->register('current_tag', $tag);\n $this->_objectManager->get(\\Magento\\Cms\\Model\\Wysiwyg\\Config::class)\n ->setStoreId($storeId);\n return $tag;\n }", "public function store(NewTagRequest $request)\n {\n Tag::create( $request->validated() );\n\n return response([], 201);\n }", "private function addNode(Stack $stack, $label, $id, $tag = null)\n {\n $labels = ['RegistryObject', 'test', $label];\n if ($tag === null) {\n $tag = strtolower($id);\n }\n $labels = implode(\":\", $labels);\n $stack->push(\"MERGE (n:{$labels} {roId: {roId}, class: {class}, type: {type} }) RETURN n\",\n [\n 'roId' => $id,\n 'class' => $label,\n 'type' => $label\n ],\n $tag\n );\n return $stack;\n }", "public function addTag(string $name, TagInterface $tag, string $placement = null);", "public function tagOfNameOrCreate(TagName $name)\n {\n $tag = $this->tagOfName($name);\n if ($tag === null) {\n $tag = Tag::register($name);\n $this->add($tag);\n }\n return $tag;\n }", "function createTag($tag,$force=false,$msg=false){\n\t$default='tmp'.rand(0,99);\n\t$path='img/tags';\n\t$debug=isset($_GET['debug'])||(is_array($tag)&&$tag['debug']!='');\n\t$tid=substr(intToMd5(is_array($tag)?($tag['idTag']==''?$default:$tag['idTag']):$tag),-16);\n\t$tmpFile=$default;\n\tif($tid==$default){\n\t\t$force=true;\n\t\t$tid=$tmpFile;\n\t}\n\t$photo=$tid.'.jpg';\n\t$photom=$tid.'.m.jpg';\n\t$photopath=$path.'/'.$photo;\n\t$photompath=$path.'/'.$photom;\n\t$_path=LOCAL?RELPATH:FILESERVER;\n\t//Se busca la imagen de la tag\n\tif(!$force) $im=imagecreatefromany($_path.$photopath);\n\t//Si la imagen de la tag no existe,se crea\n\tif(!$im||$debug){\n\t\tif(!is_array($tag)) $tag=getTagData($tid);\n\t\t//Debugger\n\t\tif($debug){\n\t\t\t_imprimir($tag);\n\t\t\techo '<br/>fondo='.(strpos(' '.$tag['fondoTag'],'default')?RELPATH:$_path).'img/templates/'.$tag['fondoTag'];\n\t\t\techo '<br/>path='.$_path;\n\t\t\techo '<br/>photo='.$tag['photoOwner'];\n\t\t\techo '<br/>getUserPicture='.getUserPicture($tag['photoOwner']);\n\t\t}\n\t\tif($tag){\n\t\t\t$font=array(\n\t\t\t\tRELPATH.'fonts/trebuc.ttf',\n\t\t\t\tRELPATH.'fonts/trebucbd.ttf',\n\t\t\t\tRELPATH.'fonts/verdana.ttf',\n\t\t\t\tRELPATH.'fonts/verdanab.ttf'\n\t\t\t);\n\t\t\t//Se crea la imagen con el tamaño normal - 650 x 300.\n\t\t\t$im=imagecreatetruecolor(TAGWIDTH,TAGHEIGHT);\n\t\t\t//Crear algunos colores\n\t\t\t$blanco=imagecolorallocate($im,255,255,255);\n\t\t\t$negro=imagecolorallocate($im,0,0,0);\n\t\t\t//Fondo\n\t\t\t$imagen=(strpos(' '.$tag['fondoTag'],'default')?RELPATH:$_path).'img/templates/'.$tag['fondoTag'];\n\t\t\t$img=imagecreatefromany($imagen);\n\t\t\tif($img){\n\t\t\t\t$is=getimagesize($imagen);\n\t\t\t\t$dy=intval((TAGHEIGHT-$is[1])/2);\n\t\t\t\twhile($dy>0) $dy-=$is[1];\n\t\t\t\tdo{\n\t\t\t\t\t$dx=$is[0]>TAGWIDTH?intval((TAGWIDTH-$is[0])/2):0;\n\t\t\t\t\tdo{\n\t\t\t\t\t\timagecopy($im,$img,$dx,$dy,0,0,$is[0],$is[1]);\n\t\t\t\t\t\t$dx+=$is[0];\n\t\t\t\t\t}while($dx<TAGWIDTH);\n\t\t\t\t\t$dy+=$is[1];\n\t\t\t\t}while($dy<TAGHEIGHT);\n\t\t\t\timagedestroy($img);\n\t\t\t}\n\t\t\t//Bordes redondeados\n\t\t\t$cr=25;//radio de la curva\n\t\t\t$ce=array(1,1,1,1);//esquinas a redondear. (si,sd,ii,id). (tl,tr,bl,br).\n\t\t\t$mask=imagecreatetruecolor($cr*2+1,$cr*2+1);\n\t\t\timagealphablending($mask,false);\n\t\t\t//$maskcolor=imagecolorallocate($im,255,0,255);//color para remplazar por transparencia\n\t\t\t$maskcolor=imagecolorallocate($im,255,255,255);\n\t\t\t$transparent=imagecolorallocatealpha($im,0,0,0,127);\n\t\t\timagefilledrectangle($mask,0,0,$cr*2+1,$cr*2+1,$maskcolor);\n\t\t\timagefilledellipse($mask,$cr,$cr,$cr*2,$cr*2,$transparent);\n\t\t\t//Top-left corner-esquina superior izquierda\n\t\t\tif ($ce[0]){\n\t\t\t\t$cx=0;\n\t\t\t\t$cy=0;\n\t\t\t\t$dx=0;\n\t\t\t\t$dy=0;\n\t\t\t\timagecopy($im,$mask,$dx,$dy,$cx,$cy,$cr,$cr);\n\t\t\t}\n\t\t\t//Top-right corner - esquina superior derecha\n\t\t\tif ($ce[1]){\n\t\t\t\t$cx=$cr+1;\n\t\t\t\t$cy=0;\n\t\t\t\t$dx=TAGWIDTH-$cr;\n\t\t\t\t$dy=0;\n\t\t\t\timagecopy($im,$mask,$dx,$dy,$cx,$cy,$cr,$cr);\n\t\t\t}\n\t\t\t//Bottom-left corner - esquina inferior izquierda\n\t\t\tif ($ce[2]){\n\t\t\t\t$cx=0;\n\t\t\t\t$cy=$cr+1;\n\t\t\t\t$dx=0;\n\t\t\t\t$dy=TAGHEIGHT-$cr;\n\t\t\t\timagecopy($im,$mask,$dx,$dy,$cx,$cy,$cr,$cr);\n\t\t\t}\n\t\t\t//Bottom-right corner - esquina inferior derecha\n\t\t\tif ($ce[3]){\n\t\t\t\t$cx=$cr+1;\n\t\t\t\t$cy=$cr+1;\n\t\t\t\t$dx=TAGWIDTH-$cr;\n\t\t\t\t$dy=TAGHEIGHT-$cr;\n\t\t\t\timagecopy($im,$mask,$dx,$dy,$cx,$cy,$cr,$cr);\n\t\t\t}\n\t\t\timagedestroy($mask);\n\t\t\t/*\n\t\t\t//Transparencia en las esquinas (solo para png)\n\t\t\timagealphablending($im,false);\n\t\t\timagesavealpha($im,true);\n\t\t\t$transparent=imagecolorallocatealpha($im,255,0,255,127);\n\t\t\tfor($i=0;$i<TAGWIDTH;$i++)for($j=0;$j<TAGHEIGHT;$j++){\n\t\t\t\t$rgb=imagecolorat($im,$i,$j);\n\t\t\t\tif($rgb==16711935) imagesetpixel($im,$i,$j,$transparent);\n\t\t\t}\n\t\t\timagealphablending($im,true);\n\t\t\t/**/\n\t\t\t//Imagen de placa\n\t\t\t$imagen=RELPATH.'img/placaFondo.png';\n\t\t\t\t$img=imagecreatefromany($imagen);\n\t\t\t\tif($img){\n\t\t\t\t$is=getimagesize($imagen);\n\t\t\t\timagecopy($im,$img,0,0,0,0,$is[0],$is[1]);\n\t\t\t\timagedestroy($img);\n\t\t\t}\n\t\t\t//Imagen de usuario\n if($tag['idProduct'])\n $imagen=$_path.$tag['photoOwner'];\n else\n $imagen=$_path.getUserPicture($tag['photoOwner'],'img/users/default.png');\n\t\t\tif($debug) echo '<br/>'.$imagen;\n\t\t\t$img=imagecreatefromany($imagen);\n\t\t\tif($img){\n\t\t\t\t$is=getimagesize($imagen);\n\t\t\t\t$x=40;\n\t\t\t\t$y=215;\n\t\t\t\t//imagefilledrectangle($im,$x-1,$y-1,$x+60,$y+60,$blanco);//marco\n\t\t\t\timagecopyresampled($im,$img,$x,$y,0,0,60,60,$is[0],$is[1]);\n\t\t\t\timagedestroy($img);\n\t\t\t}\n\t\t\t//Textos de la tag.\n\t\t\t//texto1 y texto2 por su tamaño se les define un ancho maximo y pueden tener multiples lineas\n\t\t\t$luz\t=imagecolorhexallocatealpha($im,'#FFFFFF');\n\t\t\t$sombra\t=imagecolorhexallocatealpha($im,'#000000');\n\t\t\t//Tipos de fuentes. 0=normal,1=negrita\n\t\t\t//texto1 - Parte superior\n\t\t\t$fuente=$font[1];\n\t\t\t$texto=strclean($tag['texto']);\n\t\t\t$color=imagecolorhexallocate($im,$tag['color_code']);\n\t\t\t$size=15;\n\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto);\n\t\t\t$y=73;\n\t\t\t$mw=600;//max width - ancho maximo\n\t\t\t$tmp=explode(' ',$texto);\n\t\t\t$i=0;\n\t\t\tdo{\n\t\t\t\t$texto=$tmp[$i++];\n\t\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto);\n\t\t\t\twhile(count($tmp)>$i&&$txt[2]<$mw){\n\t\t\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto.' '.$tmp[$i]);\n\t\t\t\t\tif($txt[2]<$mw) $texto.=' '.$tmp[$i++];\n\t\t\t\t}\n\t\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto);\n\t\t\t\t$x=intval((TAGWIDTH-$txt[2])/2);\n\t\t\t\timagettftext($im,$size,0,$x+1,$y+1,$sombra,$fuente,$texto);\n\t\t\t\timagettftext($im,$size,0,$x-1,$y-1,$luz,$fuente,$texto);\n\t\t\t\timagettftext($im,$size,0,$x,$y,$color,$fuente,$texto);\n\t\t\t\t$y+=23;\n\t\t\t}while(count($tmp)>$i);\n\t\t\t//texto principal - Centro\n\t\t\t$fuente=$font[0];\n\t\t\t$texto=strtoupper(strclean($tag['code_number']));\n\t\t\t$color=imagecolorhexallocate($im,$tag['color_code2']);\n\t\t\t$size=45;\n\t\t\t$s=0;//separacion entre letras\n\t\t\t$len=strlen($texto);\n\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto);\n\t\t\t$x=intval((TAGWIDTH-$txt[2])/2);\n\t\t\t$y=165;\n\t\t\timagettftext($im,$size,0,$x+1,$y+1,$sombra,$fuente,$texto);\n\t\t\timagettftext($im,$size,0,$x-1,$y-1,$luz,$fuente,$texto);\n\t\t\timagettftext($im,$size,0,$x,$y,$color,$fuente,$texto);\n\t\t\t//nombre usuario\n\t\t\t$fuente=$font[1];\n\t\t\t$texto=strclean($tag['nameOwner']);\n\t\t\t$color=$blanco;\n\t\t\t$sombra=$negro;\n\t\t\t$size=15;\n\t\t\t$x=115;\n\t\t\t$y=223;\n\t\t\timagettftext($im,$size,0,$x+1,$y+1,$sombra,$fuente,$texto);\n\t\t\timagettftext($im,$size,0,$x,$y,$color,$fuente,$texto);\n\t\t\t//fecha\n\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto);\n\t\t\t$fuente=$font[0];\n\t\t\t$texto=date('d-M-Y H:i',$tag['date']);\n\t\t\t$size=8;\n\t\t\t$x+=$txt[2]+10;\n\t\t\timagettftext($im,$size,0,$x+1,$y+1,$sombra,$fuente,$texto);\n\t\t\timagettftext($im,$size,0,$x,$y,$color,$fuente,$texto);\n\n\t\t\t//texto2 - parte baja\n\t\t\t$fuente=$font[1];\n\t\t\t$texto=strclean($tag['texto2']);\n\t\t\t$color=imagecolorhexallocate($im,$tag['color_code3']);\n\t\t\t$size=10;\n\t\t\t$x=115;\n\t\t\t$y=241;\n\t\t\t$mw=430;//max width-ancho maximo\n\t\t\t$tmp=explode(' ',$texto);\n\t\t\t$i=0;\n\t\t\tdo{\n\t\t\t\t$texto=$tmp[$i++];\n\t\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto);\n\t\t\t\twhile(count($tmp)>$i&&$txt[2]<$mw){\n\t\t\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto.' '.$tmp[$i]);\n\t\t\t\t\tif($txt[2]<$mw) $texto.=' '.$tmp[$i++];\n\t\t\t\t}\n\t\t\t\timagettftext($im,$size,0,$x+1,$y+1,$sombra,$fuente,$texto);\n\t\t\t\timagettftext($im,$size,0,$x-1,$y-1,$luz,$fuente,$texto);\n\t\t\t\timagettftext($im,$size,0,$x,$y,$color,$fuente,$texto);\n\t\t\t\t$y+=15;\n\t\t\t}while(count($tmp)>$i);\n\t\t}\n\t\t//subir el archivo al servidor\n\t\tif(!$debug){//si estamos en debug no se guarda\n\t\t\t$phototmp=RELPATH.$path.'/tmp'.rand().'.png';\n\t\t\timagepng($im,$phototmp);\n\t\t\tif (redimensionar($phototmp,RELPATH.$photopath,650)){\n\t\t\t\t@unlink($phototmp);\n\t\t\t\tuploadFTP($photo,'tags',RELPATH,1);\n\t\t\t\tif($msg) echo '<br/>guardada imagen '.$photo;\n\t\t\t}\n\t\t}\n\t}elseif($msg) echo '<br/>ya existe la imagen '.$photo;\n\t//FIN - creacion de la imagen de la tag\n\t//creamos la miniatura si no existe\n\tif(!fileExistsRemote($_path.$photompath)||$force){\n\t\tif(!$debug){//si estamos en debug no se guarda\n\t\t\t$phototmp=RELPATH.$path.'/'.$tmpFile.'.png';\n\t\t\timagepng($im,$phototmp);\n\t\t\tif (redimensionar($phototmp,RELPATH.$photompath,200)){\n\t\t\t\t@unlink($phototmp);\n\t\t\t\tuploadFTP($photom,'tags',RELPATH,1);\n\t\t\t\tif($msg) echo '<br/>guardada miniatura '.$photom;\n\t\t\t}\n\t\t}\n\t}\n\t$GLOBALS['cn']->query('UPDATE `tags` SET `img` =\"'.$tid.'\" WHERE `id` =\"'.$tag['id'].'\";');\n\treturn $tid;\n}", "private function ADD_SINGLE_TAG($tagName)\n {\n $tagName = trim($tagName);\n\n if(strlen($tagName) == 0) {\n return;\n }\n\n $tagSlug = TaggUtility::SLUG($tagName);\n\n $checkTag = $this->tagModel::FIND($tagSlug);\n if(!empty($checkTag)){\n if(is_array($checkTag)){\n return $checkTag[0]->tagIdentifier;\n }else{\n return $checkTag->tagIdentifier;\n }\n }\n\n $tagged = [\n 'tag_name' => $tagName,\n 'tag_slug' => $tagSlug,\n 'meta_title' => ucfirst($tagName)\n ];\n\n $id = $this->tagModel::INSERT($tagged);\n\n if($id) return $id;\n return false;\n }", "private function createNewTags(array $tags)\n {\n foreach ($tags as &$tag) {\n if (substr($tag, 0, 4) == 'new:') {\n $newTag = Tag::create(['name' => substr($tag, 4)]);\n $tag = $newTag->id;\n }\n }\n return $tags;\n }", "abstract protected function doSaveTag(TagInterface $tag);", "public static function insert_tag_item($tagname, $image=null, $default_topic_id=0) {\n try {\n $new_tag_id = 0;\n \n $newtagname = '';\n #$tagname = eregi_replace(\" \", \"\", $tagname);\n $words = str_word_count($tagname, 1, \".\");\n foreach ($words as $word) {\n $newtagname .= $word;\n }\n $tagname = $newtagname;\n\n //Clean Tag Name\n $tagname = ADODB::dbclean(Tag::clean_tag($tagname));\n \n if ($tagname != '') {\n $db = ADODB::connect();\n \n //Check if tag exists first\n $tag = new Tbl_tag;\n $tag = Tbl_tag::get_tag($tagname);\n \n if (!isset($tag->tag_id)) {\n if (!$default_topic_id || $default_topic_id == 0) $default_topic_id = 'null';\n if (is_null($image)) {\n $query = \"INSERT INTO tbl_tag_item (tag, default_topic_id, topic_count) VALUES ('$tagname', $default_topic_id, 0)\";\n } else {\n $query = \"INSERT INTO tbl_tag_item (tag, default_topic_id, image, topic_count) VALUES ('$tagname', $default_topic_id, '$image', 0)\";\n }\n $rs = $db->Execute($query);\n $new_tag_id = $db->Insert_ID();\n } else {\n $new_tag_id = $tag->tag_id;\n }\n }\n return $new_tag_id;\n } catch (exception $e) {\n Info::exception_handler($e, __file__, get_class($this), __FUNCTION__, __LINE__);\n } \n }", "public function putAction() {\n\t\t$rawData = json_decode($this->_request->getRawBody(), true);\n\t\tif (!empty($rawData)) {\n\t\t\t$rawData['name'] = ucfirst($rawData['name']);\n\t\t\t$result = Models_Mapper_Tag::getInstance()->save($rawData);\n\t\t} else {\n\t\t\t$this->_error();\n\t\t}\n\t\tif ($result === null) {\n\t\t\t$this->_error('This tag already exists', self::REST_STATUS_BAD_REQUEST);\n\t\t} else {\n\t\t\treturn $result->toArray();\n\t\t}\n\t}", "function convert_tag( &$obj )\n\t{\n\t\t// set default photo\n\t\t$obj->default_photo = $this->get_default_photo( $obj->id, 'tag' );\n\n\t\t// set default icon \n\t\t$obj->default_icon = $this->get_default_photo( $obj->id, 'tag-icon' );\n\n\t}", "public function testEditWithNewTag() {\n $this->markTestIncomplete('Not implemented yet.');\n }", "public static function create($tag, $id = null, $class = null)\r\n {\r\n return new Tag($tag, $id, $class);\r\n }", "function save_tag($edit = false)\n{\n global $xoopsConfig, $xoopsSecurity;\n\n $page = rmc_server_var($_POST, 'page', 1);\n\n if (!$xoopsSecurity->check()) {\n redirectMsg('tags.php?page=' . $page, __('Operation not allowed!', 'mywords'), 1);\n die();\n }\n\n $name = rmc_server_var($_POST, 'name', '');\n $short = rmc_server_var($_POST, 'short', '');\n\n if ('' == $name) {\n redirectMsg('tags.php?page=' . $page, __('You must provide a name!', 'mywords'), 1);\n die();\n }\n\n if ($edit) {\n $id = rmc_server_var($_POST, 'id', 0);\n if ($id <= 0) {\n redirectMsg('tags.php?page=' . $page, __('Tag id not provided!', 'mywords'), 1);\n die();\n }\n\n $tag = new MWTag($id);\n if ($tag->isNew()) {\n redirectMsg('tags.php?page=' . $page, __('Tag does not exists!', 'mywords'), 1);\n die();\n }\n } else {\n $tag = new MWTag();\n }\n\n if ('' == trim($short)) {\n $short = TextCleaner::sweetstring($name);\n } else {\n $short = TextCleaner::sweetstring($short);\n }\n\n // Check if tag exists\n $db = XoopsDatabaseFactory::getDatabaseConnection();\n if ($edit) {\n $sql = 'SELECT COUNT(*) FROM ' . $db->prefix('mod_mywords_tags') . \" WHERE (tag='$name' OR shortname='$short') AND id_tag<>$id\";\n } else {\n $sql = 'SELECT COUNT(*) FROM ' . $db->prefix('mod_mywords_tags') . \" WHERE tag='$name' OR shortname='$short'\";\n }\n\n list($num) = $db->fetchRow($db->query($sql));\n if ($num > 0) {\n redirectMsg('tags.php?page=' . $page, __('A tag with same name or same short name already exists!', 'mywords'), 1);\n die();\n }\n\n $tag->setVar('tag', $name);\n $tag->setVar('shortname', $short);\n if ($tag->save()) {\n redirectMsg('tags.php', __('Database updated successfully!', 'mywords'), 0);\n die();\n }\n redirectMsg('tags.php?page=' . $page, __('A problem occurs while trying to save tag.', 'mywords') . '<br>' . $tag->errors(), 1);\n die();\n}", "public static function create(){\n\t\tglobal $current_user;\n\t\t$name \t= $_POST['name'];\n\t\tinsert('INSERT INTO tag (name, user_id)\n\t\t\t\tVALUES (\"' . $name . '\", ' . $current_user['id'] . ')');\n\t}", "public function attachTag(Tag $tag)\n {\n $elementTagClass = $this->getElementTagClass();\n\n $transaction = static::getDb()->beginTransaction();\n try {\n // open space to add composite\n $elementTag = Yii::createObject($elementTagClass);\n $elementTag->{$this->getElementIdColumn()} = $this->id;\n $elementTag->{$this->getTagIdColumn()} = $tag->id;\n $status = $elementTag->save();\n $transaction->commit();\n } catch(\\Exception $e) {\n $transaction->rollBack();\n $status = false;\n }\n return $status;\n }", "public function addTag(Tag $tag)\n {\n throw new \\RuntimeException('Adding a tag on an ImageVariant is not supported.', 1371237593);\n }", "public function testUpdateInvalidTag() {\n\t\t// create a Tag with a non null tag id and watch it fail\n\t\t$tag = new Tag(null, $this->VALID_TAGCONTENT);\n\t\t$tag->update($this->getPDO());\n\t}", "public function findOrCreate($inputTag)\n {\n $inputTag = $tag = trim( $inputTag );\n\n if ( empty( $inputTag ) )\n return false;\n\n $tag = Tag::with( $this->eagerLoad )->where( 'name', '=', $inputTag )->first();\n if ( $tag === null )\n $tag = Tag::create( ['name' => $inputTag] );\n\n return $tag;\n }", "private function _addTags()\n {\n $metadata = $this->getRecordMetadata();\n $this->_record->addTags($metadata[self::TAGS]);\n }", "public function setTag($value)\n {\n return $this->set('Tag', $value);\n }", "public function setTag($value)\n {\n return $this->set('Tag', $value);\n }", "public function setTag($value)\n {\n return $this->set('Tag', $value);\n }", "public function setTag($value)\n {\n return $this->set('Tag', $value);\n }", "public function setTag($value)\n {\n return $this->set('Tag', $value);\n }", "private function makeNode(ISystemTag $tag) {\n\t\treturn new SystemTagNode($tag, $this->userSession->getUser(), $this->isAdmin(), $this->tagManager);\n\t}", "#[\\ReturnTypeWillChange]\n\tfunction addChild($name, $value = null, $namespace = null):CX {/** @var CX $r */\n\t\ttry {$r = parent::addChild($this->k($name), $value, $namespace);}\n\t\tcatch (Th $th) {df_error(\"Tag <{$name}>. Value: «{$value}». Error: «%s».\", df_xts($th));}\n\t\treturn $r;\n\t}", "public function autoTag()\n {\n $tags = Tag::string2array($this->tags);\n \n if(isset($this->name) && !empty($this->name)) {\n $tags[] = $this->name;\n }\n \n $tags[] = $this->arena->name;\n $tags[] = $this->ltype->display_name;\n \n $this->tags = Tag::array2string(array_unique($tags));\n }", "function tag_book( $id, $tag ) {\r\n\treturn set_book_tags($id, $tag, true);\r\n}", "public function createTagFromContent() {\n\n\t\ttry {\n\n\t\t\t$content_id = Request::input('content_id');\n\n\t\t\tif (empty($content_id)) throw new \\Exception('Content ID is missing');\n\n\t\t\t$content = ConnectContent::findOrFail($content_id);\n\n\t\t\t$currentUser = \\Auth::User();\n\n\t\t\t$now = getCurrentMilisecondsTimestamp();\n\n\t\t\t$newTag = Tag::create([\n\t\t\t\t'tagger_id' \t\t\t=> $currentUser->id,\n\t\t\t\t'station_id'\t\t\t=> $currentUser->station_id,\n\t\t\t\t'content_type_id'\t\t=> $content->content_type_id,\n\t\t\t\t'tag_timestamp'\t\t\t=> $now,\n\t\t\t\t'who'\t\t\t\t\t=> $content->who,\n\t\t\t\t'what'\t\t\t\t\t=> $content->what,\n\t\t\t\t'adkey'\t\t\t\t\t=> $content->ad_key,\n\t\t\t\t'is_valid'\t\t\t\t=> 1,\n\t\t\t\t'insert_timestamp'\t\t=> $now,\n\t\t\t\t'insert_lag'\t\t\t=> 0,\n\t\t\t\t'connect_content_id'\t=> $content->id,\n\t\t\t\t'coverart_id'\t\t\t=> 0,\n\t\t\t\t'tag_duration'\t\t\t=> 0,\n\t\t\t\t'cart'\t\t\t\t\t=> \"\",\n\t\t\t\t'original_who'\t\t\t=> $content->who,\n\t\t\t\t'original_what'\t\t\t=> $content->what\n\t\t\t]);\n\n\t\t\treturn response()->json(array('code' => 0, 'msg' => 'Success', 'data' => array('tag_id_list' => implode(\", \", $content->tagIDListForContent()))));\n\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('code' => -1, 'msg' => $ex->getMessage()));\n\t\t}\n\t}", "function addTag($line)\n{\n\t$elem = $this->parser->parseLine($line);\n\n\tif (isset($elem['after'])) {\n\t\t$this->elements = $this->insertAfter($this->elements, \n\t\t\tarray($elem['id'] => $elem), $elem['after']\n\t\t);\n\t}\n\telse {\n\t\t$this->elements[$elem['id']] = $elem;\n\t}\n}", "public function store(StoreBlogTagRequest $request)\n {\n $inputs = $request->except('_token','seo_title', 'seo_description', 'seo_keyword', 'page_title');\n $inputs['slug'] = str_slug($request->slug);\n $tag = BlogTag::create($inputs);\n\n $tag->seo()->create([\n 'seo_title' => $request->seo_title ?? '',\n 'seo_keyword' => $request->seo_keyword ?? '',\n 'seo_description' => $request->seo_description ?? '',\n 'page_title' => $request->page_title ?? '',\n ]);\n\n Helper::custom_session_flash('success','store');\n return redirect()->back();\n }", "function insertTagToTalent($tagid) {\n\t\t$mysqli = $this->getConnection();\n\t\t$tagid = $mysqli->real_escape_string ( $tagid );\n\t\t$query = \"insert into talent_has_tag(talent_talentid,tag_tagid) values((SELECT talentid FROM talent ORDER BY talentid DESC limit 1),$tagid)\";\n\t\treturn $mysqli->query ( $query );\n\t}", "public function removeTag(string $name);", "public function store(TagRequest $request)\n {\n try {\n\n DB::beginTransaction();\n if (isset($request->is_active) && $request->is_active == 1)\n $request->request->add(['is_active' => 1]);\n else\n $request->request->add(['is_active' => 0]);\n\n $request->request->add(['slug' => \\Str::slug($request->slug)]);\n\n // return $request->except('_token','type');\n $Tag = Tag::create($request->except('_token'));\n\n //save translations\n // $Tag->name = $request->name;\n // $Tag->save();\n\n // return $Tag;\n DB::commit();\n return redirect()->route('Tag.index')->with(['success' => 'تم ألاضافة بنجاح']);\n } catch (\\Exception $ex) {\n DB::rollback();\n return redirect()->route('Tag.index')->with(['error' => 'حدث خطا ما برجاء المحاوله لاحقا']);\n }\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'seo_title' => 'max:70',\n 'meta_description' => 'max:215'\n ]);\n $tag = new Tag();\n $tag->title = $request->title;\n $tag->description = $request->description;\n $tag->seo_title = $request->input(\"seo_title\", \"\");\n $tag->meta_key = $request->input(\"meta_key\", \"\");\n $tag->meta_description = $request->input(\"meta_description\", \"\");\n\n if (SM::is_admin() || isset($permission) &&\n isset($permission['tags']['status_update'])\n && $permission['tags']['status_update'] == 1) {\n $tag->status = $request->status;\n }\n if (isset($request->image) && $request->image != '') {\n $tag->image = $request->image;\n }\n\n $slug = (trim($request->slug) != '') ? $request->slug : $request->title;\n $tag->slug = SM::create_uri('tags', $slug);\n $tag->created_by = SM::current_user_id();\n\n if ($tag->save()) {\n $this->removeThisCache();\n\n return redirect(SM::smAdminSlug(\"tags/$tag->id/edit\"))\n ->with('s_message', 'Tag created successfully!');\n } else {\n return redirect(SM::smAdminSlug('tags'))\n ->with('s_message', 'Tag Save Failed!');\n }\n }", "public function add_tag($tag, $message = null) {\n\t\t\tif ($message === null) {\n\t\t\t\t$message = $tag;\n\t\t\t}\n\t\t\treturn $this->run(\"tag -a $tag -m \" . escapeshellarg($message));\n\t\t}", "public function addSingleTag($tag, $id = null)\n {\n try {\n if (!empty($id)) {\n $result = $this->database->prepare('UPDATE tags SET name = :name WHERE id = :id');\n } else {\n $result = $this->database->prepare('INSERT INTO tags (name) VALUES (:name)');\n }\n $result->bindParam('name', $tag);\n if (!empty($id)) {\n $result->bindParam('id', $id);\n }\n if ($result->execute()) {\n if (!empty($id)) {\n return true;\n } else {\n $tag_id = $this->database->lastInsertId();\n return $tag_id;\n }\n } \n } catch (Exception $e) {\n $e->getMessage();\n }\n return false;\n }", "public function open($tag, $attributes = array())\n {\n $node = new self($tag, $attributes);\n\n $this->addChild($node);\n\n return $node;\n\n }", "public function create()\n {\n /**\n * @var ProductTag $tag\n */\n $classNamespace = $this->getEntityNamespace();\n $tag = new $classNamespace();\n $tag\n ->setProducts(new ArrayCollection())\n ->setEnabled(true)\n ->setCreatedAt(new DateTime());\n\n return $tag;\n }", "public function saveTag($data) {\n $criteria = craft()->elements->getCriteria(ElementType::Tag);\n $criteria->title = $data['title'];\n $criteria->group = $data['groupId'];\n $result = $criteria->find();\n if (isset($result[0])) {\n return $result[0]->id;\n } else {\n //Create a new tag if not\n $tag = new TagModel();\n $tag->groupId = $data['groupId'];\n $tag->getContent()->setAttribute('title', $data['title']);\n $success = craft()->tags->saveTag($tag);\n if ($success) {\n return $tag->id;\n }\n }\n }", "public static function createElement($tag = '')\n {\n self::$instance = new static($tag);\n return self::$instance;\n }", "function git_tag($path, $tag, $version = 'HEAD') {\n\treturn GitUtil::tag($path, $tag, null, $version);\n}", "private function __getCreateTagID( $name )\n {\n $name = mb_convert_encoding( $name, 'utf-8', 'auto' );\n $name = wp_kses( $name, [] );\n\n $slug = Str::slug( $name );\n if ( empty( $slug ) ) {\n return false;\n }\n\n if ( !Util::isUniqueTagSlug( $slug, $this->languageID, $this->postType->id ) ) {\n return Tag::where( 'slug', $slug )->first()->id;\n }\n\n $r = false;\n try {\n $r = Tag::create( [\n 'name' => $name,\n 'slug' => $slug,\n 'language_id' => $this->languageID,\n 'post_type_id' => $this->postType->id,\n ] );\n }\n catch ( \\Exception $e ) {\n logger( 'Error creating tag: ' . $e->getMessage() );\n }\n return ( $r ? $r->id : false );\n }", "public function store(AdminTagCreate $request)\n {\n $request->validated();\n $post = new Tag();\n $data = $request->all();\n $post->fill($data);\n// $post->title = $request->title;\n// $post->subtitle = $request->subtitle;\n// $post->slug = $request->slug;\n// $post->body = $request->body;\n $post->save();\n\n //TODO redirect to created post\n return redirect(route('tag.index'));\n }", "public function create($idArticulo,$idTag){\n\n $articulo = Article::find($idArticulo);\n $tag = Tag::find($idTag);\n $articulo->tags()->attach($tag);\n }", "public function addElement($tag = '')\n {\n $htmlTag = (\n is_object($tag) && $tag instanceof self ?\n $tag :\n new static($tag)\n );\n $htmlTag->top = $this->getTop();\n $htmlTag->parent = &$this;\n $this->content[] = $htmlTag;\n return $htmlTag;\n }", "function set_book_tags( $id, $tags, $append = false ) {\r\n\treturn wp_set_post_tags($id, $tags, $append);\r\n}", "public\n\tfunction setTagLabel(string $newTagLabel) {\n\t\tif($newTagLabel === null) {\n\t\t\t$this->tagLabel = $newTagLabel;\n\t\t}\n\t}", "function associate_tag($tag_id, $tip_id) {\n $sql = '\n INSERT INTO\n tips_tags (tip_id, tag_id)\n VALUES\n (?, ?)';\n \n return $this->prep_and_exec($sql, [$tip_id, $tag_id]);\n }", "public function setTag(string $tag): HtmlElementInterface;", "function _migrateLyftenTags()\n\t{\n\t // no relations created for each blog vs tag\n\n\t $db \t= EasyBlogHelper::db();\n\t $suId = $this->_getSAUserId();\n\t $now\t= EasyBlogHelper::getDate();\n\n\t $query = 'insert into `#__easyblog_tag` (`created_by`, `title`, `alias`, `created`, `published`)';\n\t\t$query .= ' select ' . $db->Quote($suId) . ', `name`, `slug`, '. $db->Quote($now->toMySQL()).', ' . $db->Quote('1');\n\t\t$query .= ' from `#__bloggies_tags`';\n\t\t$query .= ' where `name` not in (select `title` from `#__easyblog_tag`)';\n\n\t\t$db->setQuery($query);\n\t\t$db->query();\n\n\t\treturn true;\n\t}", "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 }", "private function retrieve_tag($tag)\n {\n if (isset($this->tags[$tag . 'count'])) { //if the openener is not in the Object we ignore it\n $temp_parent = $this->tags['parent']; //check to see if it's a closable tag.\n while ($temp_parent) { //till we reach '' (the initial value);\n if ($tag . $this->tags[$tag . 'count'] === $temp_parent) { //if this is it use it\n break;\n }\n $temp_parent = isset($this->tags[$temp_parent . 'parent']) ? $this->tags[$temp_parent . 'parent'] : ''; //otherwise keep on climbing up the DOM Tree\n }\n if ($temp_parent) { //if we caught something\n $this->indent_level = $this->tags[$tag . $this->tags[$tag . 'count']]; //set the indent_level accordingly\n $this->tags['parent'] = $this->tags[$temp_parent . 'parent']; //and set the current parent\n }\n unset($this->tags[$tag . $this->tags[$tag . 'count'] . 'parent']); //delete the closed tags parent reference...\n unset($this->tags[$tag . $this->tags[$tag . 'count']]); //...and the tag itself\n if ($this->tags[$tag . 'count'] === 1) {\n unset($this->tags[$tag . 'count']);\n } else {\n $this->tags[$tag . 'count']--;\n }\n }\n }", "protected function saveTags()\n {\n $this->checkConstants();\n $articleId = $this->id;\n $tags = $this->tags;\n if ( $this->isNewRecord )\n {\n if ( !empty( $tags ) )\n {\n $this->addTags( $articleId, $tags );\n }\n }\n else\n {\n if ( is_array( $tags ) &&( !empty( $tags ) ) )\n {\n /*\n we received array with the same or different values of tags -\n in any case that will be an array with numbers\n */\n if ( is_numeric( $tags[0] ) )\n {\n $this->changeTags( $articleId, $tags );\n }\n /*\n if $tags was filled with models and user has removed from form all tags\n we will receive empty array and $tags will be the same as after initialization\n */\n elseif( is_object( $tags[0] ) )\n {\n $this->deleteAllTags( $articleId );\n }\n }\n }\n }", "public function testUpdateValidTag() {\n\t\t// count the number of rows and save it for later\n\t\t$numRows = $this->getConnection()->getRowCount(\"tag\");\n\t\t// create a new Tag and insert to into mySQL\n\t\t$tag = new Tag(null, $this->VALID_TAGCONTENT);\n\t\t$tag->insert($this->getPDO());\n\t\t// edit the Tag and update it in mySQL\n\t\t$tag->setTagName($this->VALID_TAGCONTENT2);\n\t\t$tag->update($this->getPDO());\n\t\t// grab the data from mySQL and enforce the fields match our expectations\n\t\t$pdoTag = Tag::getTagByTagId($this->getPDO(), $tag->getTagId());\n\t\t$this->assertEquals($numRows + 1, $this->getConnection()->getRowCount(\"tag\"));\n\t\t$this->assertEquals($pdoTag->getTagName(), $this->VALID_TAGCONTENT2);\n\t}", "public function addTag($id){\n\t\t$crl = curl_init();\n\t\tcurl_setopt($crl, CURLOPT_URL, $this->buildTagUrl($id) );\n\t\tcurl_setopt($crl, CURLOPT_CUSTOMREQUEST, \"PUT\"); \n\t\tcurl_setopt($crl, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($crl, CURLOPT_HTTPHEADER, array( \n\t\t\t\t'Authorization: Bearer '.$this->getToken(), \n\t\t\t 'Content-Type: application/json',\n\t\t\t 'Accept: application/vnd.vimeo.*+json;version=3.4'\n\t\t\t) \n\t\t);\n\t\tcurl_setopt($crl, CURLOPT_SSL_VERIFYPEER, true); \n\t\t$result = curl_exec($crl);\n\t}", "public static function ADMIN_ARCHIVE_CREATE_USER_TAG(){\n\t $SQL_String = \"INSERT INTO user_tags VALUES (NULL,:owner,:tag_term,NULL);\";\n\t return $SQL_String;\n\t}", "function single_tag($name='', $attrs='')\n{\n return \"<${name} ${attrs} />\";\n}", "protected function addTag($tag_name, $value = null)\n {\n $this->startElement($tag_name);\n\n if ($value !== null) {\n $this->writeRaw($value);\n }\n\n $this->endElement();\n }", "protected function createNewTag($tags, $relation)\n {\n if($tags) {\n foreach( $tags as $val) {\n $tag = $this->tag->create([ 'nama' => $val ]);\n $relation->tag()->attach($tag);\n }\n }\n }", "public function tag($id=null)\n\t{\n\t\tif (!$this->_cache['tags.one']\n\t\t || (\n\t\t\t\t$id !== null\n\t\t\t && (int) $this->_cache['tags.one']->get('id') != $id\n\t\t\t && (string) $this->_cache['tags.one']->get('tag') != $this->normalize($id)\n\t\t\t)\n\t\t )\n\t\t{\n\t\t\t$this->_cache['tags.one'] = is_numeric($id) ? Tag::oneOrNew($id) : Tag::oneByTag($id);\n\t\t}\n\n\t\treturn $this->_cache['tags.one'];\n\t}", "public static function add_tag_ignore($name) {\n global $wpdb;\n $wpdb->query(\"INSERT IGNORE XTB_TAGS (name) VALUES('{$name}')\");\n }", "protected function setUp()\n\t{\n\t\tif (isset($this->configurator->tags[$this->tagName]))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Create tag\n\t\t$tag = $this->configurator->tags->add($this->tagName);\n\n\t\t// Create attribute\n\t\t$tag->attributes->add($this->attrName);\n\n\t\t// Create a template that replaces its content with the replacement chat\n\t\t$tag->template\n\t\t\t= '<xsl:value-of select=\"@' . htmlspecialchars($this->attrName) . '\"/>';\n\t}", "public function postAction() {\n\t\t$rawData = json_decode($this->_request->getRawBody(), true);\n\t\tif (!empty($rawData)) {\n\t\t\t$rawData['name'] = ucfirst($rawData['name']);\n\t\t\t$result = Models_Mapper_Tag::getInstance()->save($rawData);\n\t\t} else {\n\t\t\t$this->_error();\n\t\t}\n\t\tif ($result === null) {\n\t\t\t$this->_error('This tag already exists', self::REST_STATUS_BAD_REQUEST);\n\t\t} else {\n\t\t\treturn $result->toArray();\n\t\t}\n\t}", "public function store(CreateTagRequest $request)\n {\n $tag = new Tag();\n $tag->title = request('title');\n $tag->slug = request('slug')?: request('title');\n $tag->publish = request('publish')?: false;\n $tag->save();\n\n return response()->json([\n 'tag' => $tag\n ]);\n }", "public function created(Tags $tag): void\n {\n $user = auth()->user(); \n $tag->author()->associate($user)->save();\n }", "protected function cloneAndRenameDomElement(\\DOMElement $el, $tagname)\n {\n $new_el = $el->ownerDocument->createElement($tagname);\n\n // Renamed DOMElement should have the same children as original\n /** @var \\DOMElement $child */\n foreach ($el->childNodes as $child) {\n // @TODO must we cloneNode(true) ?\n $new_el->appendChild($child->cloneNode(true));\n }\n\n // Renamed DOMElement should have the same attributes as original\n /** @var \\DOMAttr $attr */\n foreach ($el->attributes as $attr) {\n $new_el->setAttribute($attr->nodeName, $attr->nodeValue);\n }\n\n // Replace the old element with new element\n $el->parentNode->insertBefore($new_el, $el);\n\n return $new_el;\n }" ]
[ "0.6109087", "0.59246194", "0.589587", "0.5867307", "0.581812", "0.57739264", "0.5728646", "0.5708221", "0.5561559", "0.5531146", "0.5402403", "0.5308", "0.52834713", "0.52766544", "0.5266624", "0.52549946", "0.5231516", "0.52259624", "0.5204697", "0.51762384", "0.5171251", "0.5138757", "0.51367545", "0.51032174", "0.5092914", "0.504493", "0.504406", "0.5043662", "0.5043487", "0.5014984", "0.5014438", "0.49989092", "0.4978626", "0.49785346", "0.49734822", "0.49687195", "0.49665305", "0.49581468", "0.49560958", "0.49468333", "0.4943731", "0.49221247", "0.4918791", "0.4909862", "0.4907822", "0.48996088", "0.48897713", "0.48824185", "0.48813808", "0.48670888", "0.48606113", "0.48604643", "0.48541123", "0.48541123", "0.48541123", "0.4853357", "0.48528555", "0.4845339", "0.4845218", "0.48425803", "0.48340315", "0.48332137", "0.48236", "0.48138356", "0.48047933", "0.4802179", "0.47982344", "0.479507", "0.47709358", "0.47665066", "0.4746878", "0.47381186", "0.47346073", "0.47321406", "0.47296014", "0.47293907", "0.4728999", "0.47111756", "0.47079542", "0.4706783", "0.4700177", "0.46966153", "0.46898663", "0.46616498", "0.46556947", "0.4653766", "0.46454835", "0.46449244", "0.46420157", "0.46391913", "0.46376657", "0.46363074", "0.46353087", "0.46308395", "0.4628699", "0.46279052", "0.46200287", "0.461914", "0.46157062", "0.46129015" ]
0.50355506
29
Updates the given repository by performing a fetch from the specified remote and then a merge with the specified remote branch.
public static function update($path, $remote = 'origin', $branch = 'master') { if (!file_exists($path)) { throw new Exception( "Unable to update git repo $path. Path does not exist."); } if (!is_dir($path)) { throw new Exception( "Unable to update git repo $path. Path is not a directory."); } if (!self::isRepo($path)) { throw new Exception( "Unable to update git repo $path. Path is not a git repository."); } $origCwd = getcwd(); chdir($path); $fetchCmd = sprintf(self::FETCH_CMD_TMPL, $remote); passthru($fetchCmd); $mergeCmd = sprintf(self::MERGE_CMD_TMPL, $remote, $branch); passthru($mergeCmd); chdir($origCwd); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pull( $remote, $branch ) {\n return $this->_exec( \"pull {$remote} {$branch}\" );\n }", "public function gitPull ()\n {\n\n $this->updates[ ] = Hallmark_Misc::shell ( 'git pull ' . Hallmark_Misc::removeQuotes ( Hallmark_Misc::args () ) );\n\n }", "public function pull($remote, $branch) {\n\t\t\treturn $this->run(\"pull $remote $branch\");\n\t\t}", "public function fetch($remote, $branch)\n {\n $this->git('fetch {remote} {branch}', ['remote' => $remote, 'branch' => $branch]);\n return $this;\n }", "public function pull($remote, $branch)\n {\n $this->git('pull {remote} {branch}', ['remote' => $remote, 'branch' => $branch]);\n return $this;\n }", "public function pullRepo($branchName = null) {\n\n if(is_null($branchName)){\n // pull all branches\n \\Utils::gitCommand('pull --all');\n exec('git pull --all', $pullop);\n // fetch all brnaches\n \\Utils::gitCommand('fetch --all');\n// exec('git fetch --all', $pullop);\n }else{\n // checkout to the branch which we have to pull.\n// exec('git checkout ' . $branchName, $op);\n \\Utils::gitCommand('checkout ' . $branchName);\n $this->output('Checkout to ' . $branchName);\n // pull all branches\n \\Utils::gitCommand('pull --all');\n// exec('git pull --all', $pullop);\n // fetch all brnaches\n \\Utils::gitCommand('fetch --all');\n// exec('git fetch --all', $pullop);\n // reset all local files and make exact copy of remote\n \\Utils::gitCommand('reset --hard origin/' . $branchName);\n// exec('git reset --hard origin/' . $branchName, $pullop);\n /*\n * Go back to master.\n */\n if ($branchName !== 'master') {\n// exec('git checkout master');\n \\Utils::gitCommand('checkout master');\n }\n }\n }", "public function gitPull() {\n $current_branch = exec('git rev-parse --abbrev-ref HEAD');\n\n $collection = $this->collectionBuilder();\n $collection->taskGitStack()\n ->pull()\n ->run();\n\n $name = $this->confirm(\"Run Composer Install?\");\n if ($name) {\n $this->composerInstall();\n }\n\n $name = $this->confirm(\"Run Config Import?\");\n if ($name) {\n $this->drushCim();\n }\n }", "function target_gitup()\n{\n\t// git remote add upstream git://github.com/<user>/<repo>.git\n\tsystem('git fetch upstream');\n\tsystem('git merge upstream/master');\n}", "function rupdate() {\n\t\t$this->checkOnce();\n\t\t$deployPath = $this->getVersionPath();\n\t\t$branch = $this->branch ?: 'default';\n\t\t$remoteCmd = 'cd '.$deployPath.' && hg update -r '.$branch;\n\t\t$this->ssh_exec($remoteCmd);\n\t}", "public function updateRepository($reset = true)\n\t{\n\t\t$this->command->info('Pulling changes');\n\t\t$tasks = array($this->scm->update());\n\n\t\t// Reset if requested\n\t\tif ($reset) {\n\t\t\tarray_unshift($tasks, $this->scm->reset());\n\t\t}\n\n\t\treturn $this->runForCurrentRelease($tasks);\n\t}", "public function fetch($remote = 'origin')\n\t{\n\t\t// Initialize variables.\n\t\t$out = array();\n\t\t$return = null;\n\n\t\t// Ensure that either the remote exists or is a valid URL.\n\t\tif (!filter_var($remote, FILTER_VALIDATE_URL) && !in_array($remote, $this->_getRemotes()))\n\t\t{\n\t\t\tthrow new InvalidArgumentException('No valid remote ' . $remote . ' exists.');\n\t\t}\n\n\t\t// Execute the command.\n\t\t$wd = getcwd();\n\t\tchdir($this->_root);\n\t\texec('git fetch -q ' . escapeshellarg($remote), $out, $return);\n\t\tchdir($wd);\n\n\t\t// Validate the response.\n\t\tif ($return !== 0)\n\t\t{\n\t\t\tthrow new RuntimeException(sprintf('The fetch failed from remote %s with code %d and message %s.', $remote, $return, implode(\"\\n\", $out)));\n\t\t}\n\n\t\treturn $this;\n\t}", "function rpull() {\n\t\t$this->checkOnce();\n\t\t$versionPath = $this->getVersionPath();\n\t\t/** @var Repo $repo */\n\t\tforeach ($this->repos as $repo) {\n\t\t\techo BR, '## ', $repo->path, BR;\n\t\t\t$deployPath = $versionPath . '/' . $repo->path();\n\t\t\ttry {\n\t\t\t\t$exists = $this->rexists($deployPath);\n\t\t\t\tif ($exists) {\n\t\t\t\t\t$remoteCmd = 'cd ' . $deployPath . ' && hg pull';\n\t\t\t\t\t$this->ssh_exec($remoteCmd);\n\t\t\t\t} else {\n\t\t\t\t\techo TAB, '*** path ', $deployPath, ' does not exist', BR;\n\t\t\t\t}\n\t\t\t} catch (\\SystemCommandException $e) {\n\t\t\t\techo 'Error: '.$e, BR;\n\t\t\t}\n\t\t}\n\t}", "public function merge($branch = 'origin/master')\n\t{\n\t\t// Initialize variables.\n\t\t$out = array();\n\t\t$return = null;\n\n\t\t// Execute the command.\n\t\t$wd = getcwd();\n\t\tchdir($this->_root);\n\t\texec('git merge ' . escapeshellarg($branch), $out, $return);\n\t\tchdir($wd);\n\n\t\t// Validate the response.\n\t\tif ($return !== 0)\n\t\t{\n\t\t\tthrow new RuntimeException(sprintf('Unable to merge branch %s with code %d and message %s.', $branch, $return, implode(\"\\n\", $out)));\n\t\t}\n\n\t\treturn $this;\n\t}", "protected function pullRepo()\n {\n assert(valid_num_args());\n\n $pull = new GitHubPullProcess($this->config, $this->env, $this->output);\n $pull->execute();\n }", "protected function utilGitPull()\n {\n foreach (File::directories(plugins_path()) as $authorDir) {\n foreach (File::directories($authorDir) as $pluginDir) {\n if (!File::isDirectory($pluginDir.'/.git')) {\n continue;\n }\n\n $exec = 'cd ' . $pluginDir . ' && ';\n $exec .= 'git pull 2>&1';\n echo 'Updating plugin: '. basename(dirname($pluginDir)) .'.'. basename($pluginDir) . PHP_EOL;\n echo shell_exec($exec);\n }\n }\n\n foreach (File::directories(themes_path()) as $themeDir) {\n if (!File::isDirectory($themeDir.'/.git')) {\n continue;\n }\n\n $exec = 'cd ' . $themeDir . ' && ';\n $exec .= 'git pull 2>&1';\n echo 'Updating theme: '. basename($themeDir) . PHP_EOL;\n echo shell_exec($exec);\n }\n }", "protected function pull()\n {\n $local_repo = $this->getLocalRepoPath();\n if (!is_dir($local_repo))\n {\n if(!mkdir($local_repo, 0777, true))\n {\n throw new Exception('Could not create directory '.$local_repo);\n }\n $this->execute('clone', array($this->getRemoteScmUrl(), $local_repo));\n }\n else\n {\n $cwd = getcwd();\n chdir($local_repo);\n $this->execute('pull', array(), array());\n chdir($cwd);\n }\n }", "public function repo($dir, $remote);", "function changeBranch(){\r\n\t\t// $gitpss = isset($_COOKIE['gitpss']) ? $_COOKIE['gitpss'] : '';\r\n\t\t// $repo = 'https://'.$gitusr.':'.$gitpss.'@github.com/nelsoft/nelsoft_inventory.git';\r\n\t\tchdir($_POST['path']);\r\n\t\texec('git clean -df');\r\n\t\texec('git checkout -- .');\r\n\t\t// exec('git fetch '.$repo);\r\n\t\texec('git checkout '.$_POST['branch'], $data);\r\n\t\t// exec('git pull '.$repo.' '.$_POST['branch'], $data);\r\n\r\n\t\t$return['version'] = '0.00';\r\n\t\t$return['version'] = getversion($_POST['path'], 'version');\t\r\n\t\t$return['data'] = $data;\r\n\r\n\t\tjdie($return);\r\n}", "function gitUpdate()\n{\n \n $config = json_decode(file_get_contents(\"/app/config.json\"), true);\n\n $git = $config['git'];\n $remote = \"https://\" . $git['user'] . \":\" . $git['token'] . \"@github.com/\" . $git['git_dir'];\n exec(\"cd \" . $config['project_dir'] . \" && git init && git pull $remote \" . $git['branch']);\n exec(\"cd \" . $config['project_dir'] . \" && composer update\");\n}", "function do_pull($key,$url,$path) {\n $cmd = \"ssh-agent bash -c 'cd $path; ssh-add $key; git reset --hard; git pull' 2>&1\";\n _log(\"Exec command: $cmd\\n\");\n return shell_exec($cmd);\n}", "public function fetch($from = null, $branch = null) {\n\t\t$this->repository->fetch($from, $branch);\n\t}", "function _versioncontrol_git_log_update_repository(&$repository) {\n $root = escapeshellcmd($repository['root']);\n $chdir_ok = @chdir($root); // Set working directory to root.\n if ($chdir_ok === FALSE) {\n return FALSE;\n }\n if ($repository['git_specific']['locked'] == TRUE) {\n drupal_set_message(t('This repository is locked, there is already a fetch in progress. If this is not the case, press the clear lock button.'), 'error');\n return FALSE;\n }\n db_query('UPDATE {versioncontrol_git_repositories}\n SET locked = 1 WHERE repo_id = %d', $repository['repo_id']);\n\n // Get the list of current branches from Git.\n $branch_list = _versioncontrol_git_log_get_branches();\n $add_branch_label = array(\n 'name' => '', //filled later\n 'type' => VERSIONCONTROL_OPERATION_BRANCH,\n 'action' => VERSIONCONTROL_ACTION_MODIFIED\n );\n $branches = array();\n foreach ($branch_list as $branch_name) {\n $add_branch_label['name'] = $branch_name;\n $label_ret = versioncontrol_ensure_label($repository, $add_branch_label);\n $branches[$branch_name] = $label_ret;\n }\n //jpetso and me (corni) came to the conclusion that we will not delete branches.\n // TODO: revisit this!\n // Record new commits.\n $constraints = array(\n 'vcs' => array('git'),\n 'repo_ids' => array($repository['repo_id']),\n 'types' => array(VERSIONCONTROL_OPERATION_COMMIT),\n 'branches' => array() // used in the loop\n );\n $branches_per_commit = array();\n $existing_revs = array();\n // Get the existing revisions from the cache.\n $cache_object = cache_get('versioncontrol_git_rev_cache');\n // Check wether the cache object exists or not.\n if (is_object($cache_object)) {\n $existing_revs = $cache_object->data;\n }\n // Get the list of current branches from Git.\n // Generate the range per branch with which git shall be called.\n foreach ($branches as $branch_name => $label) {\n if (is_object($cache_object)) {\n // We get all commits we have in this branch to not process them later.\n $constraints['branches'] = array($branch_name);\n $latest_commit_date = 0;\n $commit_op = versioncontrol_get_operations($constraints);\n $latest_commit = FALSE;\n foreach ($commit_op as $vc_op_id => $c_op) {\n if ($latest_commit_date < $c_op['date']) {\n $latest_commit = $c_op['revision'];\n $latest_commit_date = $c_op['date'];\n $existing_revs[$branch_name][$latest_commit] = TRUE;\n }\n }\n }\n // No way to free the damned mysql result!!\n unset($commit_op);\n\n $commits_in_branch = _versioncontrol_git_log_get_commits_in_branch($repository, escapeshellarg($branch_name));\n foreach ($commits_in_branch as $i => $commit) {\n if (!isset($existing_revs[$branch_name][$commit])) {\n if (!isset($branches_per_commit[$commit]) || !is_array($branches_per_commit[$commit])) {\n $branches_per_commit[$commit] = array($label);\n }\n else {\n $branches_per_commit[$commit][] = $label;\n }\n }\n }\n }\n // This uses an extra loop on purpose!\n // Process all commits on a per-branch base.\n foreach ($branches_per_commit as $revision => $branch) {\n // Update commits from Git.\n _versioncontrol_git_process_commits($repository, $revision, $branches_per_commit, $existing_revs);\n }\n // Check tags.\n $tags = _versioncontrol_git_log_get_tags(); //Now we have the current list of tags as array of strings.\n $constraints = array(\n 'vcs' => array('git'),\n 'repo_ids' => array($repository['repo_id']),\n 'types' => array(VERSIONCONTROL_OPERATION_TAG)\n );\n $existing_tag_ops = versioncontrol_get_operations($constraints);\n $existing_tags = array();\n foreach ($existing_tag_ops as $tag_op) {\n if (!in_array($tag_op['labels'][0]['name'], $existing_tags)) {\n $existing_tags[] = $tag_op['labels'][0]['name'];\n }\n }\n // Deleting tags is *not* supported. Read the manual if you want to know why...\n // Check for new tags.\n $new_tags = array_diff($tags, $existing_tags);\n if (!empty($new_tags)) {\n _versioncontrol_git_process_tags($repository, $new_tags);\n }\n\n // Update repository updated field. Displayed on administration interface for documentation purposes.\n $repository['git_specific']['updated'] = time();\n db_query('UPDATE {versioncontrol_git_repositories}\n SET updated = %d, locked = 0 WHERE repo_id = %d',\n $repository['git_specific']['updated'], $repository['repo_id']);\n\n // Write back the cache.\n cache_set('versioncontrol_git_rev_cache', $existing_revs);\n return TRUE;\n}", "function do_clone_or_pull($key, $url, $path, $operation) {\n // Already a git repo there. Do a pull.\n if ((is_dir($path)) && (file_exists($path . \"/.git\"))) {\n\tif($operation==\"TAG\"){\n\t\treturn do_fetch($key,$url,$path);\n\t}\n\telse{\n\t\treturn do_pull($key,$url,$path);\n\t}\n }\n \n // Try a clone\n $out = do_clone($key,$url,$path);\n if (!is_dir($path)) {\n $out .= \"\\nClone appeared to fail.\\n\";\n }\n return $out;\n}", "function updateSourceBranching() {\n if ($this->isModuleInstalled('source')) {\n try {\n $source_commits_table = TABLE_PREFIX . 'source_commits';\n $commit_project_objects_table = TABLE_PREFIX . 'commit_project_objects';\n $source_repositories_table = TABLE_PREFIX . 'source_repositories';\n\n DB::execute(\"ALTER TABLE $source_commits_table ADD branch_name VARCHAR(255) DEFAULT '' AFTER commited_by_email\");\n DB::execute(\"ALTER TABLE $commit_project_objects_table ADD branch_name VARCHAR(255) DEFAULT '' AFTER revision\");\n\n // Add default branch for existing data\n\n DB::execute(\"UPDATE $source_commits_table SET branch_name = 'master' WHERE type = 'GitCommit'\");\n DB::execute(\"UPDATE $source_commits_table SET branch_name = 'default' WHERE type = 'MercurialCommit'\");\n\n $commit_project_objects = DB::execute(\"\n SELECT $commit_project_objects_table.id, $source_repositories_table.type\n FROM $commit_project_objects_table, $source_repositories_table\n WHERE $commit_project_objects_table.repository_id = $source_repositories_table.id\"\n );\n\n if (is_foreachable($commit_project_objects)) {\n foreach ($commit_project_objects as $commit_project_object) {\n if ($commit_project_object['type'] == 'GitRepository') {\n DB::execute(\"UPDATE $commit_project_objects_table SET branch_name = 'master' WHERE id = ?\", $commit_project_object['id']);\n } //if\n if ($commit_project_object['type'] == 'MercurialRepository') {\n DB::execute(\"UPDATE $commit_project_objects_table SET branch_name = 'default' WHERE id = ?\", $commit_project_object['id']);\n } //if\n } //foreach\n } //if\n\n DB::execute('INSERT INTO ' . TABLE_PREFIX . \"config_options (name, module, value) VALUES ('default_source_branch', 'source', 'N;')\");\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n } //if\n return true;\n }", "public function performPull($source);", "function git_update($path) {\n\t$status = GitUtil::update($path);\n}", "public function updateRepositories() {\n $projects = $this->loadProjects();\n if (!$projects)\n return;\n\n $this->m_authors = $this->loadAuthors();\n\n foreach ($projects as $project)\n $this->updateProject($project);\n }", "public function update($remoteFile = IniLoader::PHP_INI, $buildFolder = null, $buildNumber = null)\n {\n $this->getLogger()->debug('started fetching remote file');\n\n $converter = new Converter($this->getLogger(), $this->getCache());\n\n if (class_exists('\\Browscap\\Browscap')) {\n $resourceFolder = 'vendor/browscap/browscap/resources/';\n\n if (null === $buildNumber) {\n $buildNumber = (int)file_get_contents('vendor/browscap/browscap/BUILD_NUMBER');\n }\n\n if (null === $buildFolder) {\n $buildFolder = 'resources';\n }\n\n $buildFolder .= '/browscap-ua-test-'.$buildNumber;\n $iniFile = $buildFolder.'/full_php_browscap.ini';\n\n mkdir($buildFolder, 0777, true);\n\n $writerCollectionFactory = new PhpWriterFactory();\n $writerCollection = $writerCollectionFactory->createCollection($this->getLogger(), $buildFolder);\n\n $buildGenerator = new BuildGenerator($resourceFolder, $buildFolder);\n $buildGenerator\n ->setLogger($this->getLogger())\n ->setCollectionCreator(new CollectionCreator())\n ->setWriterCollection($writerCollection)\n ->run($buildNumber, false)\n ;\n\n $converter\n ->setVersion($buildNumber)\n ->storeVersion()\n ->convertFile($iniFile)\n ;\n\n $filesystem = new Filesystem();\n $filesystem->remove($buildFolder);\n } else {\n if (null === ($cachedVersion = $this->checkUpdate($remoteFile))) {\n // no newer version available\n return;\n }\n\n $this->getLoader()\n ->setRemoteFilename($remoteFile)\n ->setOptions($this->options)\n ->setLogger($this->getLogger())\n ;\n\n try {\n $content = $this->getLoader()->load();\n } catch (Helper\\Exception $e) {\n throw new FetcherException('an error occured while loading remote data', 0, $e);\n }\n\n if (false === $content) {\n $internalLoader = $this->getLoader()->getLoader();\n $error = error_get_last();\n\n throw FetcherException::httpError($internalLoader->getUri(), $error['message']);\n }\n\n $this->getLogger()->debug('finished fetching remote file');\n\n $this->storeContent($converter, $content, $cachedVersion);\n }\n }", "public function merge($branch) {\n\t\t\treturn $this->run(\"merge $branch --no-ff\");\n\t\t}", "public function fetch($destDir)\n {\n shell_exec('rm -rf ' . $destDir);\n shell_exec('git clone --depth=1 ' . $this->extraArgs . ' ' . $this->url . ' ' . $destDir);\n }", "public function cloneIfNecessary($branch = false, $depth = false)\n {\n // If the directory exists, we have already validated that it points\n // at the correct repository.\n if (!is_dir($this->dir)) {\n $this->freshClone($branch, $depth);\n }\n // Make sure that we are on 'master' (or the specified branch) and up-to-date.\n $branchTerm = $branch ?: 'master';\n exec(\"git -C '{$this->dir}' reset --hard 2>/dev/null\", $output, $result);\n exec(\"git -C '{$this->dir}' checkout $branchTerm 2>/dev/null\", $output, $result);\n exec(\"git -C '{$this->dir}' pull origin $branchTerm 2>/dev/null\", $output, $result);\n }", "public function executePull(){\r\n\t\t// set return array\r\n\t\t$return = array('pull_result' => '');\r\n\r\n\t\t// fetch data\r\n\t\t$jsonData = $this->getJsonData();\r\n\r\n\t\t//try executing\r\n\t\ttry {\r\n\t\t\t// check if git is still processing anything\r\n\t\t\tif ($this->isProcessing() === FALSE) {\r\n\t\t\t\t// set the process to active\r\n\t\t\t\t$this->setProcess();\r\n\r\n\t\t\t\t// execute pull command\r\n\t\t\t\t$return['pull_result'] = $this->executeCommand('cd ' . MAIN_DIR . ' && git reset --hard ' . GIT_BRANCH_REF . ' 2>&1');\r\n\r\n\t\t\t\t// handle the git result\r\n\t\t\t\t$this->handleGitResult($return);\r\n\r\n\t\t\t\t// refetch data\r\n\t\t\t\t$jsonData = $this->getJsonData();\r\n\r\n\t\t\t\t// decrement process\r\n\t\t\t\t$jsonData->status = 0;\r\n\t\t\t} else {\r\n\t\t\t\t$jsonData->status = isset($jsonData->status) ? 1 : 0;\r\n\t\t\t\t$return['pull_result'] = \"Max attempts (\" . MAX_ATTEMPTS . \") reached!\\n\";\r\n\t\t\t}\r\n\r\n\t\t\t// echo for hook window\r\n\t\t\techo \"PULL RETURN (\" . $this->attempts . \")\\n\";\r\n\t\t\techo $return['pull_result'];\r\n\r\n\t\t\t// overwrite file\r\n\t\t\t$this->overWriteFile($this->jsonFile, json_encode($jsonData));\r\n\r\n\t\t\t// renew json data from json file\r\n\t\t\t$jsonData = $this->getJsonData();\r\n\r\n\t\t\t// check jsondata\r\n\t\t\tif ($jsonData->status > 0 && $this->attempts < MAX_ATTEMPTS) {\r\n\t\t\t\t// execute again after 1 scond\r\n\t\t\t\tsleep(1);\r\n\t\t\t\t$this->attempts++;\r\n\t\t\t\t$this->executePull();\r\n\t\t\t\techo \"\\n\";\r\n\t\t\t} else if ($this->attempts >= MAX_ATTEMPTS) {\r\n\t\t\t\t$this->handleGitResult($return);\r\n\t\t\t} else {}\r\n\t\t} catch (Exception $e) {\r\n\t\t\t$jsonData->status = 0;\r\n\t\t\t$this->overWriteFile($this->jsonFile, json_encode($jsonData));\r\n\t\t}\r\n\t}", "public function updateRepository() {\n $scheduledFile = __DIR__ . '/scheduled.txt';\n if (!file_exists($scheduledFile))\n return;\n\n $requested = file_get_contents($scheduledFile);\n if (!unlink($scheduledFile))\n return;\n\n if ((time() - intval(trim($requested))) > 600)\n return;\n\n $commands = [\n // Updates the local copy of the repository with the most recent remote changes.\n 'git fetch --all',\n\n // Resets the repository to the state the remote currently is in.\n 'git reset --hard origin/master',\n\n // Remove any left-over files that are not part of the checkout, and not in .gitignore.\n 'git clean -f -d',\n\n // Write the latest commit SHA to the VERSION file.\n 'git rev-parse HEAD > VERSION',\n ];\n\n $directory = realpath(__DIR__ . '/../../../');\n\n foreach ($commands as $command)\n Info(trim(shell_exec('cd ' . $directory . ' && ' . $command . ' 2>&1')));\n\n Info('AutoDeploy: Updated to revision ' . file_get_contents(__DIR__ . '/../../../VERSION') . '.');\n }", "public function push($remote, $branch) {\n\t\t\treturn $this->run(\"push --tags $remote $branch\");\n\t\t}", "public function create($remote = 'http://github.com/joomla/joomla-platform.git')\n\t{\n\t\t// Initialize variables.\n\t\t$out = array();\n\t\t$return = null;\n\n\t\t// We add the users repo to our remote list if it isn't already there\n\t\tif (!file_exists($this->_root . '/.git'))\n\t\t{\n\t\t\t// Execute the command.\n\t\t\texec('git clone -q ' . escapeshellarg($remote) . ' ' . escapeshellarg($this->_root), $out, $return);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new InvalidArgumentException('Repository already exists at ' . $this->_root . '.');\n\t\t}\n\n\t\t// Validate the response.\n\t\tif ($return !== 0)\n\t\t{\n\t\t\tthrow new RuntimeException(sprintf('The clone failed from remote %s with code %d and message %s.', $remote, $return, implode(\"\\n\", $out)));\n\t\t}\n\n\t\treturn $this;\n\t}", "public function update() {\n\t\t$webhook_secret = $this->config->item ( 'github_webhook_secret' );\n\t\t$client_id = $this->config->item ( 'github_client_id' );\n\t\t$client_secret = $this->config->item ( 'github_client_secret' );\n\t\t\n\t\tif (! isset ( $_SERVER ['HTTP_X_HUB_SIGNATURE'] )) {\n\t\t\tthrow new \\Exception ( \"HTTP header 'X-Hub-Signature' is missing.\" );\n\t\t} elseif (! extension_loaded ( 'hash' )) {\n\t\t\tthrow new \\Exception ( \"Missing 'hash' extension to check the secret code validity.\" );\n\t\t}\n\t\t\n\t\tlist ( $algo, $hash ) = explode ( '=', $_SERVER ['HTTP_X_HUB_SIGNATURE'], 2 ) + array (\n\t\t\t\t'',\n\t\t\t\t'' \n\t\t);\n\t\tif (! in_array ( $algo, hash_algos (), TRUE )) {\n\t\t\tthrow new \\Exception ( \"Hash algorithm '$algo' is not supported.\" );\n\t\t}\n\t\t$rawPost = file_get_contents ( 'php://input' );\n\t\tif ($hash !== hash_hmac ( $algo, $rawPost, $webhook_secret )) {\n\t\t\tthrow new \\Exception ( 'Hook secret does not match.' );\n\t\t}\n\t\t\n\t\t$url = \"https://api.github.com/users/UoLCompSoc/repos?per_page=10&client_id=\" . $client_id . \"&client_secret=\" . $client_secret;\n\t\t\n\t\t$decoded = json_decode ( $this->_getContent ( $url ) );\n\t\t\n\t\t$github_data = array ();\n\t\t\n\t\tforeach ( $decoded as $repo ) {\n\t\t\tif ($repo->fork === TRUE) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$collaborators = json_decode ( $this->_getContent ( $repo->contributors_url ) );\n\t\t\t$repo->collaborator_count = sizeof ( $collaborators );\n\t\t\t\n\t\t\tarray_push ( $github_data, $repo );\n\t\t}\n\t\t\n\t\t$filepath = APPPATH . 'cache/repocache.json';\n\t\t\n\t\tif (! write_file ( $filepath, json_encode ( $github_data ), 'w' )) {\n\t\t\tlog_message ( 'error', 'Cannot write to github cache file at ' . $filepath );\n\t\t}\n\t\t\n\t\t// $this->load->view ( 'admin' );\n\t}", "function do_fetch($key,$url,$path) {\n $cmd = \"ssh-agent bash -c 'cd $path; ssh-add $key; git fetch' 2>&1\";\n _log(\"Exec command: $cmd\\n\");\n return shell_exec($cmd);\n}", "public function testGitHubRemoteRepository(): void\n {\n $repo = new GitHubRemoteRepository('r/r', './');\n $this->assertEquals('https://github.com/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "private function syncRepository()\n {\n $cwd = '/tmp/'.$this->migrationId;\n (new ProcessBuilder(['mkdir']))->add('-p')->add($cwd)->getProcess()->mustRun();\n\n $cloneSourceCommandBuilder = new ProcessBuilder(['git', 'clone', $this->sourceProject->getSshUrlToRepo(), '.']);\n $cloneSourceCommandBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $addNewRemoteBuilder = new ProcessBuilder(['git', 'remote', 'add', 'new']);\n $addNewRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->add($this->targetProject->getSshUrlToRepo())\n ->getProcess()\n ->mustRun();\n\n $pushToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--all']);\n $pushToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $pushTagsToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--tags']);\n $pushTagsToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n }", "private function _fetchGitRepository($url, $ref = 'master')\n\t{\n\t\t// Create a Git repository object within the system tmp folder for the url.\n\t\t$root = sys_get_temp_dir() . md5($url);\n\n\t\t// If the folder doesn't exist attempt to create it.\n\t\tif (!is_dir($root))\n\t\t{\n\t\t\tmkdir($root, 0777, true);\n\t\t}\n\n\t\t// Instantiate the repository object.\n\t\t$repo = new PackagerGitRepository($root);\n\n\t\t// Only clone the repository if it doesn't exist.\n\t\tif (!$repo->exists())\n\t\t{\n\t\t\t$repo->create();\n\t\t}\n\n\t\t// Get a clean checkout of the branch/tag required.\n\t\t$repo->fetch()\n\t\t\t->branchCheckout($ref)\n\t\t\t->clean();\n\n\t\treturn $root;\n\t}", "public function commitAndPush()\n {\n try {\n // Add files to git index, commit and push to client remote\n $this->git->add()->all()->execute();\n $this->git->commit()->message($this->commit_msg)->execute();\n $this->git->push()->execute($this->client_remote, $this->branch);\n } catch (GitException $e) {\n $this->logger->error('Failed to commit to Git repository. Error: '\n . $e->getMessage());\n }\n }", "function WebhookPullSubrepository(){\n \n $MagicWord=BlowfishEncrypt('Pull Subrepository From Github');\n if(\n isset($_GET[$MagicWord])\n ){\n $Path=dirname(__FILE__);\n $Path=str_replace('/core','',$Path);\n $Subrepository=BlowfishDecrypt($_GET[$MagicWord]);;\n $Path.=trim($Subrepository);\n \n echo '<p>Pulling Subrepository: '.$Path.'</p>';\n \n if(!is_dir($Path)){\n die('Path not found: '.$Path);\n }\n \n $Command = 'cd '.$Path.' && git reset --hard && git pull';\n echo '<p>'.$Command.'</p><pre>';\n echo shell_exec($Command);\n echo '</pre>';\n \n exit;\n }\n}", "public function actionUpdate($id)\n\t{\n $model=$this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if(isset($_POST['Repository']))\n {\n $model->attributes=$_POST['Repository'];\n if($model->save())\n $this->redirect(array('admin'));\n }\n\n $this->render('update',array(\n 'model'=>$model,\n ));\n\t}", "function do_checkout_branch($req, $deployto, $operation){\n \n\tif($operation != \"TAG\"){\n\t//if($operation == \"Push Hook\" && !empty($DEPLOY_BRANCH)){\n\t\t$branch=determine_branch_name($req);\n\t\tif($branch == $operation){\n\t\t\t$cmd = \"bash -c 'cd $deployto; git checkout $branch' 2>&1\";\n\t\t}\n\t\telse{\n\t\t\t$cmd = \"bash -c 'cd $deployto; git checkout $operation' 2>&1\";\n\t\t}\n\t}\n\telse{\n\t\t$tag= $req['ref'];\n\t\t$cmd = \"bash -c 'cd $deployto; git checkout $tag' 2>&1\";\n\t}\n\t\n\tif(file_exists($deployto . \"/.gitmodules\")){\n\t\t_log(\"Initializing and Updating submodules...\\n\");\n\t\t$subcmd = \"bash -c 'cd $deployto; git submodule init; git submodule update' 2>&1\";\n\t}\n\n\t_debug(\"Operation: $operation\\n\");\n _log(\"Exec Command: $cmd\\n\");\n\n\t$result = shell_exec($cmd);\n\tif(isset($subcmd)){\n\t\t$result .= shell_exec($subcmd);\n \t}\n \treturn $result;\n\n}", "public function updateRepository($id, UpdateRepository $repository)\n {\n $this->apiClient->updateRepository(['id' => $id, 'body' => new RepositoryRequest($repository)]);\n }", "public function git_repository()\n\t{\n\t\texec( 'cd ' . $this->theme_dir . '; git remote -v', $remotes );\n\n\t\tpreg_match( '#origin[\\s\\t][email protected]\\:([^\\.]+)#', $remotes[0], $matches );\n\n\t\t$remote = $matches[1];\n\n\t\treturn $remote;\n\t}", "public function getRevision(RepositoryEntry $repository, $branch);", "public function merge($branch, $modes = 0)\n {\n $flags = '';\n if ($modes & static::FORCE_MERGE_COMMIT) {\n $flags .= ' --no-ff';\n }\n\n $this->git('merge{flags} {branch}', ['branch' => $branch, 'flags' => $flags]);\n return $this;\n }", "public function testDestiny2PullFromPostmaster()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "public function actionUpdate(): int\n {\n try {\n GithubCache::flush();\n\n $service = GithubService::getInstance();\n $service->saveCache();\n } catch (Exception $e) {\n throw $e;\n }\n\n return ExitCode::OK;\n }", "public function fetch(string $branch = '--all', bool $prune = false)\n {\n $this->progress('Fetching latest code.');\n\n $command = 'git fetch ' . $branch;\n\n if ($prune) {\n $command .= ' --prune';\n }\n\n $this->runProcess(new Process($command));\n\n return $this;\n }", "protected function execute(InputInterface $input, OutputInterface $output) {\n $github = $this->getGithub();\n\n // Request all open issues in created order. 1st come 1st serve.\n $paginator = new Github\\ResultPager($github);\n $issues_api = $github->api('issue');\n $pull_requests = $paginator->fetchAll($issues_api, 'all', array($this->getConfigParameter('organization'), $this->getConfigParameter('repository'), array(\n 'state' => 'open',\n 'sort' => 'created',\n 'direction' => 'asc',\n )));\n\n // Get current branch or commit.\n $current_head = '';\n $process = new Process('git symbolic-ref --short HEAD');\n $process->run();\n if ($process->isSuccessful()) {\n $current_head = trim($process->getOutput());\n }\n else {\n $process = new Process('git rev-parse HEAD');\n $process->run();\n if ($process->isSuccessful()) {\n $current_head = trim($process->getOutput());\n }\n }\n\n $process = new Process('git checkout -B integration');\n $process->run();\n if (!$process->isSuccessful()) {\n throw new \\RuntimeException($process->getErrorOutput());\n }\n\n foreach ($pull_requests as $pr) {\n\n // If the issue is not a PR we skip it.\n if (empty($pr['pull_request']['patch_url'])) {\n continue;\n }\n\n // If this issue has any of the following labels, we also skip it.\n foreach ($pr['labels'] as $label) {\n // TODO: Have a function check this.\n if (in_array($label['name'], $this->invalid_labels)) {\n // This continue breaks us out of the top foreach.\n continue 2;\n }\n }\n\n // Now try to apply the patch or else mark it as failure.\n $url = $pr['pull_request']['html_url'];\n if ($input->getOption('am')) {\n $command = \"hub am --3way {$url}\";\n }\n else {\n $command = \"hub merge {$url}\";\n }\n $output->writeln(\"\\n\" . $command);\n $process = new Process($command);\n $process->run();\n if (!$process->isSuccessful()) {\n // We reset the failed AM & mark the PR as GITHUB_LABEL_MERGE_FAILED.\n $output->writeln(\"<error>Failed to applied PR# {$pr['number']}: {$url}.</error>\");\n $output->writeln($process->getOutput());\n if (!$input->getOption('no-label')) {\n $this->addGithubLabel($pr['number'], self::GITHUB_LABEL_MERGE_FAILED);\n $this->addGithubComment($pr['number'], implode('\\n\\n', array(\n 'I was unable to merge this Pull Request with the other open Pull Requests.',\n 'Perhaps the following log will assist your debugging…',\n '```sh',\n $process->getErrorOutput(),\n '```',\n )));\n }\n\n $process = new Process('git merge --abort');\n $process->run();\n }\n else {\n $output->writeln(\"<info>Successfully applied PR #{$pr['number']}: {$url}.</info>\");\n }\n }\n\n // Now we deploy integration to acquia always fresh.\n // We only do this if the --push flag is set.\n if ($input->getOption('push')) {\n $process = new Process('git push acquia integration --force');\n $process->run();\n if (!$process->isSuccessful()) {\n throw new \\RuntimeException($process->getErrorOutput());\n }\n $output->writeln(\"<info>Successfully Pushed integration branch to Acquia.</info>\");\n }\n\n // Return to the branch the user was previously on, if they were on one.\n if (!empty($current_head)) {\n $process = new Process(\"git checkout {$current_head}\");\n $process->run();\n }\n }", "public function github(){\n\n\t\t$user = '';\n\t\tif(isset($this->request->get['user'])){\n\t\t\t$user = $this->request->get['user'];\n\t\t}\n\t\t$repo = '';\n\t\tif(isset($this->request->get['repo'])){\n\t\t\t$repo = $this->request->get['repo'];\n\t\t}\n\t\t$branch = '';\n\t\tif(isset($this->request->get['branch'])){\n\t\t\t$branch = $this->request->get['branch'];\n\t\t}\n\t\tnew d_shopunity\\GitHub($user, $repo, str_replace(\"catalog/\", \"\", DIR_APPLICATION), $branch );\n\t}", "public function update($username, $repository, $id, array $params)\n {\n return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$id, $params);\n }", "function rinstall() {\n\t\t$versionPath = $this->getVersionPath();\n//\t\tdebug($versionPath);\n\t\t/** @var Repo $repo */\n\t\tforeach ($this->repos as $repo) {\n\t\t\techo BR, '## ', $repo->path(), BR;\n\t\t\tif ($this->rexists($repo->path())) {\n\t\t\t\t$deployPath = $versionPath . '/' . $repo->path();\n\t\t\t\t$cmd = 'cd ' . $deployPath . ' && hg update -r ' . $repo->getHash();\n\t\t\t\t$this->ssh_exec($cmd);\n\t\t\t} else {\n\t\t\t\techo 'Error: '.$repo->path.' is not on the server. Maybe do rdeploy?', BR;\n\t\t\t}\n\t\t}\n\t}", "public function setUpRepository($repository) {\n $path = $this->getGitRootPath().DIRECTORY_SEPARATOR.$repository->getPath();\n $this->getDriver()->activateHook('post-update', $path);\n $this->deployPostReceive($path);\n $id = $this->getDao()->save($repository);\n $repository->setId($id);\n $this->setUpMailingHook($repository);\n $this->changeRepositoryAccess($repository);\n $this->setRepositoryPermissions($repository);\n return true;\n }", "public function update(Request $request, BranchModel $branchModel)\n {\n //\n }", "public function updateMilestone($repository, $number, array $options = [])\n {\n return $this->request()->patch('repos/' . $repository . '/milestones/' . $number, $options);\n }", "public function testGitLabRemoteRepository(): void\n {\n $repo = new GitLabRemoteRepository('r/r', './');\n $this->assertEquals('https://gitlab.com/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "function updateStatus()\n\t{\n\t\t$this->setPost();\n\n\t\t$postData = $_POST;\n\n\t\tif ($postData->status_id == 1) {\n\t\t\t$updateData = array('status_id' => 2);\n\t\t} else {\n\t\t\t$updateData = array('status_id' => 1);\n\t\t}\n\n\t\t$where = array('id' => $postData->id);\n\n\t\t$result = $this->base_model->updateCommon($this->primaryTable, $updateData, $where);\n\n\t\t$response = array('status' => true, 'message' => 'Branch status updated successfully.');\n\n\t\techo json_encode($response);\n\t}", "public function update($id, array $properties): RepositoryEntity;", "private function restoreBranch() {\n $repository_api = $this->getRepositoryAPI();\n $repository_api->execxLocal(\n 'checkout %s',\n $this->oldBranch);\n if ($this->isGit) {\n $repository_api->execxLocal(\n 'submodule update --init --recursive');\n }\n echo phutil_console_format(\n \"Switched back to {$this->branchType} **%s**.\\n\",\n $this->oldBranch);\n }", "public function __construct(RepositoryService $repositoryService, Repository $repository, $branch = null)\n {\n $this->branch = $branch;\n $this->repository = $repository;\n $this->repositoryService = $repositoryService;\n $this->clonePath = storage_path('patches/'.$this->repository->id);\n\n if (empty($branch)) {\n $this->branch = 'master';\n }\n\n $this->repositoryPatch = RepositoryPatch::create([\n 'branch' => $this->branch,\n 'repository_id' => $this->repository->id,\n ]);\n\n $this->repositoryService->updateCommitStatus($this->repositoryPatch, 'pending');\n }", "public function gitPush($remoteAlias, $remoteBranch)\n\t{\n\t\t$WorkingCopy = $this->gitWrapper->workingCopy($this->getPath());\n\t\treturn $WorkingCopy->push($remoteAlias, $remoteBranch);\n\t}", "private function githubSyncProcess()\n\t{\n\n\t\t// Delete any existing file.\n\t\tif(file_exists(e_TEMP.\"e107-master.zip\"))\n\t\t{\n\t\t\tunlink(e_TEMP.\"e107-master.zip\");\n\t\t}\n\n\t\t$result = e107::getFile()->getRemoteFile('https://codeload.github.com/e107inc/e107/zip/master', 'e107-master.zip', 'temp');\n\n\t\tif($result == false)\n\t\t{\n\t\t\te107::getMessage()->addError( DBLAN_118 );\n\t\t}\n\n\n\t\t$localfile = 'e107-master.zip';\n\n\t\tchmod(e_TEMP.$localfile, 0755);\n\t\trequire_once(e_HANDLER.\"pclzip.lib.php\");\n\n//\t$base = realpath(dirname(__FILE__));\n\n\n\t\t$newFolders = array(\n\t\t\t'e107-master/e107_admin/' => e_BASE.e107::getFolder('ADMIN'),\n\t\t\t'e107-master/e107_core/' => e_BASE.e107::getFolder('CORE'),\n\t\t\t'e107-master/e107_docs/' => e_BASE.e107::getFolder('DOCS'),\n\t\t\t'e107-master/e107_handlers/' => e_BASE.e107::getFolder('HANDLERS'),\n\t\t\t'e107-master/e107_images/' => e_BASE.e107::getFolder('IMAGES'),\n\t\t\t'e107-master/e107_languages/' => e_BASE.e107::getFolder('LANGUAGES'),\n\t\t\t'e107-master/e107_media/' => e_BASE.e107::getFolder('MEDIA'),\n\t\t\t'e107-master/e107_plugins/' => e_BASE.e107::getFolder('PLUGINS'),\n\t\t\t'e107-master/e107_system/' => e_BASE.e107::getFolder('SYSTEM'),\n\t\t\t'e107-master/e107_themes/' => e_BASE.e107::getFolder('THEMES'),\n\t\t\t'e107-master/e107_web/' => e_BASE.e107::getFolder('WEB'),\n\t\t\t'e107-master/' => e_BASE\n\t\t);\n\n\t\t$srch = array_keys($newFolders);\n\t\t$repl = array_values($newFolders);\n\n\t\t$archive \t= new PclZip(e_TEMP.$localfile);\n\t\t$unarc \t\t= ($fileList = $archive -> extract(PCLZIP_OPT_PATH, e_TEMP, PCLZIP_OPT_SET_CHMOD, 0755)); // Store in TEMP first.\n\n\t\t$error = array();\n\t\t$success = array();\n\t\t$skipped = array();\n//\tprint_a($unarc);\n\n\n\t\t$excludes = array('e107-master/','e107-master/install.php','e107-master/favicon.ico');\n\n\t\tforeach($unarc as $k=>$v)\n\t\t{\n\t\t\tif(in_array($v['stored_filename'],$excludes))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$oldPath = $v['filename'];\n\t\t\t$newPath = str_replace($srch,$repl, $v['stored_filename']);\n\n\t\t\t$message = e107::getParser()->lanVars(DBLAN_121, array('x'=>$oldPath, 'y'=>$newPath));\n\n\t\t\tif($v['folder'] ==1 && is_dir($newPath))\n\t\t\t{\n\t\t\t\t// $skipped[] = $newPath. \" (already exists)\";\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif(!rename($oldPath,$newPath))\n\t\t\t{\n\t\t\t\t$error[] = $message;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$success[] = $message;\n\t\t\t}\n\n\n\t\t\t//\techo $message.\"<br />\";\n\n\t\t}\n\n\t\tif(!empty($success))\n\t\t{\n\t\t\te107::getMessage()->addSuccess(print_a($success,true));\n\t\t}\n\n\t\tif(!empty($skipped))\n\t\t{\n\t\t\te107::getMessage()->setTitle(\"Skipped\",E_MESSAGE_INFO)->addInfo(print_a($skipped,true));\n\t\t}\n\n\t\tif(!empty($error))\n\t\t{\n\t\t\te107::getMessage()->addError(print_a($error,true));\n\t\t}\n\n\n\n\n\t\te107::getRender()->tablerender(DBLAN_10.SEP.DBLAN_112, e107::getMessage()->render());\n\n\t}", "public function testBitBucketRemoteRepository(): void\n {\n $repo = new BitBucketRemoteRepository('r/r', './');\n $this->assertEquals('https://bitbucket.org/r/r/src/v2/src/Project.php#Project.php-30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "public function update(Request $request, Repository $repository)\n {\n //\n }", "public function mergeBranch()\n\t{\n\t\t$this->Checklogin();\n\t\n\t\t$branchId=$this->input->post('branchId');\n\t\t$mainbranchId=$this->input->post('selectBranch');\n\t\n\t\tif ($mainbranchId !=0 && $branchId !=0 )\n\t\t{\n\t\t\t$a=$this->branch_model->mergeBranch($branchId,$mainbranchId);\n\t\t\t\n\t\t\t$this->session->set_flashdata('success','Branch has been successfully merged');\n\t\t\techo true;\n\t\t\t\t\n\t\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\n\t\t\t$this->session->set_flashdata('success','Something went wrong');\n\t\t\techo true;\n\t\t}\n\t\n\t}", "public function run()\n {\n passthru('cd ' . realpath($this->basedir) . ' && git pull origin master && curl -sS https://getcomposer.org/installer | php && php composer.phar install && git remote update && cd -');\n }", "public function pull()\n {\n }", "public function update($id, $properties)\n {\n Assert::integerish($id, __METHOD__ . ' expects an $id as an integer');\n Assert::isArray($properties, __METHOD__ . ' expects $properties to be supplied as an array');\n return $this->call('PUT', \"/branches/{$id}.json\", $properties);\n }", "public function pushRepository($dir, $target_project);", "public function setRepo($user, $repo)\n {\n $this->apibase = \"https://api.github.com/repos/$user/$repo/\";\n }", "public function cloneGitRepo($repo, $dir);", "public function do_download_update($protocol, $repo_to_update, $new_version)\n {\n try\n {\n global $wpdb;\n $repo = $protocol . '://' . esc_sql($repo_to_update) . '/@';\n $sql = \"SELECT a.post_title,b.post_id,b.meta_value FROM $wpdb->posts a inner join $wpdb->postmeta b on a.ID=b.post_id WHERE b.meta_key = '_scb_edd_repo_url' AND b.meta_value like '%$repo%' \";\n $posts = $wpdb->get_results($sql, ARRAY_A);\n\n p_l($posts);\n if (!is_array($posts) || !count($posts))\n {\n throw new Exception('nothing to process ' . $sql);\n }\n $failed = array();\n $passed = array();\n foreach ($posts as $download)\n {\n try\n {\n if (!isset($download['meta_value']))\n {\n throw new Exception('Download to update not found was looking for ' . $repo);\n }\n $repo_to_update_url = @unserialize($download['meta_value']);\n if (!is_array($repo_to_update_url))\n {\n throw new Exception('Download to update was found but data is not valid.Received ' . $download['meta_value']);\n }\n\n $files = get_post_meta($download['post_id'], 'edd_download_files', true);\n $found = false;\n foreach ($files as $index => $file)\n {\n if (isset($repo_to_update_url[$file['attachment_id']]))\n {\n $found = $index;\n break;\n }\n }\n if ($found === false || empty($repo_to_update_url[$file['attachment_id']]['url']))\n {\n throw new Exception('Unable to find correct download to update <pre>' . print_r($files, true) . \"----\" . print_r($repo_to_update_url, true) . \"</pre>\");\n }\n $file = array_merge($files[$index], scb_edd_merge_repo_input($repo_to_update_url[$file['attachment_id']]['url']));\n\n $file['new_tag'] = scb_edd_clean_tag_input($new_version);\n p_l($file);\n if (version_compare($file['new_tag'], $file['tag_num'], 'lt'))\n {\n p_l(\"lower version pushed skip\");\n throw new Exception('lower version pushed skipping ' . $file['new_tag'] . \"<\" . $file['tag_num']);\n\n return;\n }\n elseif (version_compare($file['new_tag'], $file['tag_num'], 'gt'))\n {\n $file = array_merge($file, scb_edd_merge_repo_input($protocol . '://' . $repo_to_update . '/@' . $file['new_tag']));\n //$file['repo_url'] = 'git://' . $repo_to_update . '/@' . $file['new_tag'];\n //$file['tag'] = $file['new_tag'];\n }\n elseif (version_compare($file['new_tag'], $file['tag_num'], 'eq'))\n {\n $file = array_merge($file, scb_edd_merge_repo_input($protocol . '://' . $repo_to_update . '/@' . $file['new_tag']));\n\n }\n else\n {\n throw new Exception('Unable to get new version');\n }\n p_l($file);\n $file = apply_filters('scb_repo_' . $protocol . '_save_edd_download_files', array($file), $download['post_id']);\n\n $files[$index] = scb_edd_clear_temp_indexes($file[0]);\n p_l($files);\n update_post_meta($download['post_id'], 'edd_download_files', $files);\n $passed[] = sprintf('Download %1$s updated succesfuly from %2$s respositry %3$s tag %4$s ',\n isset($download['post_title']) ? '\"' . $download['post_title'] . '\"' : '',\n $protocol,\n $repo_to_update,\n $new_version);\n\n }\n catch (Exception $e)\n {\n $failed[] = \"Failed to Update download :\" . (isset($download['post_title']) ? '\"' . $download['post_title'] . '\" ' : '') . $e->getMessage();\n }\n }\n\n if (count($passed) && count($failed))\n {\n $msg = \"Successfull:\\n\" . implode(\"\\n\", $passed) . \"\\n\\n\";\n $msg .= \"Failed:\\n\" . implode(\"\\n\", $failed);\n p_l($msg);\n scb_edd_send_email('Download Deploy Result', nl2br($msg));\n return array(1, 'done but few failed');\n }\n elseif (count($failed))\n {\n $msg = implode(\"\\n\", $failed);\n p_l($msg);\n scb_edd_send_email('Download Failed to deploy from repo', nl2br($msg));\n return array(0, 'failed');\n }\n elseif (count($passed))\n {\n $msg = implode(\"\\n\", $passed);\n p_l($msg);\n scb_edd_send_email('Download Deployed from repo succesfuly', nl2br($msg));\n return array(1, 'All done');\n }\n\n }\n catch (Exception $e)\n {\n $msg = \"Failed to Update download :\" . (isset($download['post_title']) ? '\"' . $download['post_title'] . '\" ' : '') . $e->getMessage();\n p_l($msg);\n scb_edd_send_email('Download Failed to deploy from repo', nl2br($msg));\n\n return array(0, $msg);\n }\n\n }", "public function fetch($file, $remoteFile = IniLoader::PHP_INI)\n {\n if (null === ($cachedVersion = $this->checkUpdate($remoteFile))) {\n // no newer version available\n return;\n }\n\n $this->getLoader()\n ->setRemoteFilename($remoteFile)\n ->setOptions($this->options)\n ->setLogger($this->getLogger())\n ;\n\n $this->getLogger()->debug('started fetching remote file');\n\n try {\n $content = $this->getLoader()->load();\n } catch (Helper\\Exception $e) {\n throw new FetcherException('an error occured while fetching remote data', 0, $e);\n }\n\n if (false === $content) {\n $error = error_get_last();\n throw FetcherException::httpError($this->getLoader()->getRemoteIniUrl(), $error['message']);\n }\n\n $this->getLogger()->debug('finished fetching remote file');\n $this->getLogger()->debug('started storing remote file into local file');\n\n $content = $this->sanitizeContent($content);\n\n $converter = new Converter($this->getLogger(), $this->getCache());\n $iniVersion = $converter->getIniVersion($content);\n\n if ($iniVersion > $cachedVersion) {\n $fs = new Filesystem();\n $fs->dumpFile($file, $content);\n }\n\n $this->getLogger()->debug('finished storing remote file into local file');\n }", "private function get_repository_info() {\n if ( is_null( $this->github_response ) ) {\n $request_uri = sprintf( 'https://api.github.com/repos/%s/%s/releases', $this->username, $this->repository );\n\n $response = json_decode( wp_remote_retrieve_body( wp_remote_get( $request_uri ) ), true );\n if( is_array( $response ) ) {\n $response = current( $response );\n }\n $this->github_response = $response;\n }\n }", "public function handleGitResult($result){\r\n\t\t// contains the message for slack\r\n\t\t$slackMessage = \"\";\r\n\t\t$slackMessage .= \"*PULL RESULT*\";\r\n\t\t$slackMessage .= \"```\";\r\n\t\t$slackMessage .= $result['pull_result'];\r\n\t\t$slackMessage .= \"```\\n\";\r\n\r\n\t\t$slackMessage .= \"*COMMIT LINK*\";\r\n\t\t$slackMessage .= \"```\";\r\n\t\t$slackMessage .= @$this->payload->compare;\r\n\t\t$slackMessage .= \"```\\n\";\r\n\r\n\t\t$slackMessage .= \"*SITE*\";\r\n\t\t$slackMessage .= \"```\";\r\n\t\t$slackMessage .= SITE_NAME;\r\n\t\t$slackMessage .= \"```\\n\";\r\n\r\n\t\t$slackMessage .= \"*User*\";\r\n\t\t$slackMessage .= \"```\";\r\n\t\t$slackMessage .= @$this->payload->head_commit->author->name;\r\n\t\t$slackMessage .= \"```\";\r\n\r\n\t\t// slack username\r\n\t\t$slackUname = GIT_BRANCH_LABEL.\" Auto Deployment \" . date('F j, Y H:i:s');\r\n\r\n\t\t// set the slack username\r\n\t\t$this->slack->username = $slackUname;\r\n\t\t\t\r\n\t\t// set the slack message\r\n\t\t$this->slack->text = $slackMessage;\r\n\r\n\t\t// send slack message\r\n\t\t$this->slack->sendSlack();\r\n\t}", "public function buildBranch($branch, $options = ['clean' => TRUE]) {\n $this->stopOnFail(TRUE);\n $this->getGitCommands()->ensureGitWorkspaceIsClean();\n\n $previous_branch = $this->_execSilent(\"git rev-parse --abbrev-ref HEAD\")->getOutput();\n $buildBranch = $this->phappManifest->getGitBranchForBuild($branch);\n $branchEscaped = escapeshellarg($branch);\n $collection = $this->collectionBuilder();\n $symfony_fs = new \\Symfony\\Component\\Filesystem\\Filesystem();\n\n // Add the rollback action.\n $collection->rollback($this->taskGitStack()\n ->exec('git reset --hard')\n ->checkout($previous_branch));\n\n // Make sure the target branch exists.\n if ($this->_execSilent(\"git branch --list $branchEscaped | grep $branchEscaped\")->getExitCode() != 0) {\n throw new InvalidArgumentException(\"The branch $branchEscaped does not exist.\");\n }\n\n // Update the branch and build branch.\n $this->getGitCommands()->setupGitRemotes(['fetch' => TRUE]);\n $collection->addTask(\n $this->getGitCommands()->pullBranch($branch)\n );\n\n // Make sure the build branch exists.\n $branch_exists = $this->_execSilent(\"git branch -a --list | grep $buildBranch -q\")->getExitCode() == 0;\n\n if ($branch_exists) {\n $task = $this->taskGitStack()\n ->checkout($buildBranch)\n ->exec('reset --hard')\n ->exec(\"merge $branchEscaped --no-edit\");\n $collection->addTask($task);\n }\n else {\n $ancestorBranch = $this->determineBuildBranchAncestor($branch, $buildBranch);\n $collection->addCode(function() use ($ancestorBranch) {\n $this->say(\"Creating a new build branch based upon <info>$ancestorBranch</info>\");\n });\n // Update the ancestor branch.\n $collection->addTask(\n $this->getGitCommands()->pullBranch($ancestorBranch)\n );\n // Create the build branch and merge in changes.\n $task = $this->taskGitStack()\n ->exec(\"branch $buildBranch $ancestorBranch\")\n ->checkout($buildBranch)\n ->exec(\"merge $branchEscaped --no-edit\");\n $collection->addTask($task);\n }\n\n // Ensure the build branch correctly contains the src branch.\n $collection->addCode(function() use ($branch, $buildBranch) {\n $this->say(\"Ensure build branch is in sync with the src branch...\");\n $result = $this->_execSilent(\"git checkout $branch && \\\n # Remove all tracked files and replace them with files from the build\n # branch.\n git ls-files | grep -v '.gitignore' | xargs rm -rf && \\\n git checkout $buildBranch -- . && \\\n # Remove the files from the stage.\n git reset -- && \\\n # Ensure workspace is clean as that means all src files in the build\n # branch are equal to the src branch.\n test ! -n \\\"$(git status --porcelain)\\\" && \\\n # If all is ok, go back to the build branch.\n git checkout $buildBranch\");\n if ($result->getExitCode() != 0) {\n throw new TaskExitException($this, \"Build branch $buildBranch differs from the src branch $branch. \" .\n \"The build branch needs to be cleaned or resetted by deleting it.\"\n , $result->getExitCode());\n }\n });\n\n // Handle .gitignore files.\n // Keep track of modified ignore files so we can undo changes later.\n $gitignore_files = [];\n\n $collection->addCode(function() use ($symfony_fs, &$gitignore_files) {\n $finder = new Finder();\n $finder->name('.gitignore-build')->ignoreDotFiles(FALSE)->in(getcwd());\n\n if ($finder->count() != 0) {\n foreach ($finder as $file) {\n $filePathname = $file->getPathname();\n $this->say(\"Found $filePathname - applying it.\");\n $gitignore_files[] = $file->getPath() . '/.gitignore';\n file_put_contents($file->getPath() . '/.gitignore', file_get_contents($filePathname), FILE_APPEND);\n }\n }\n // Deprecated - Fallback for older projects.\n // May be removed in future.\n elseif ($symfony_fs->exists('.build-gitignore')) {\n $this->io()\n ->warning('Deprecation warning: .build-gitingore is no longer supported, use .gitignore-build instead.');\n $this->say('Found .build-gitingore - applying it.');\n $this->taskExec('cp .build-gitignore .gitignore')->run();\n $gitignore_files[] = getcwd() . '/.gitignore';\n }\n elseif ($symfony_fs->exists('.gitignore')) {\n $this->taskExec('rm .gitignore')->run();\n $gitignore_files[] = getcwd() . '/.gitignore';\n }\n });\n\n // Now, as we are on a the clean and prepared build branch, start the build.\n $collection->addTask(\n $this->doBuild($options, TRUE)\n );\n\n // And then commit it!\n $commit_hash = $this->_execSilent(\"git rev-parse $branch\")->getOutput();\n $commit_hash = trim($commit_hash);\n\n $collection->addCode(function () use (&$gitignore_files, $branchEscaped, $commit_hash) {\n $task = $this->taskGitStack()\n ->exec(\"add -A\");\n // To ensure files of src branches match with the files in build branches,\n // do not commit changes to .gitignore files.\n foreach ($gitignore_files as $gitignore_file) {\n $task->exec(\"reset HEAD $gitignore_file\");\n }\n // Note that git commit uses ' already, so we remove ours. Also, we allow\n // empty commits in case no assets were changed the merge might be enough.\n $task->commit(sprintf(\"Build %s commit %s.\", trim($branchEscaped, '\\''), trim($commit_hash, '\\'')), '--allow-empty --no-verify');\n $task->run();\n });\n\n $collection->completionCode(\n function() use ($buildBranch) {\n $this->yell(\"Committed build to branch $buildBranch.\");\n }\n );\n\n // Fetch the version tag.\n $tag = FALSE;\n if ($prefix = $this->phappManifest->getGitVersionTagPrefix()) {\n $prefix = escapeshellarg($prefix);\n $result = $this->_execSilent(\"git tag --points-at $branchEscaped | grep $prefix\");\n if ($result->getExitCode() == 0) {\n $tag = $result->getOutput();\n }\n }\n\n // Automatically forward version tags to builds. We only supported\n // forwarding tags when there is a build branch prefix.\n if ($tag && $this->phappManifest->getGitBranchForBuild($tag) != $tag) {\n $target_tag = $this->phappManifest->getGitBranchForBuild($tag);\n\n // Ensure the target tag is not already existing (e.g. if building the\n // same commit multiple times).\n $process = $this->_execSilent(\"git show -q $target_tag\");\n if (!$process->isSuccessful()) {\n $collection->addTask(\n $this->taskGitStack()\n ->tag($target_tag, \"Build of tag $tag.\")\n );\n $collection->completionCode(\n function() use ($target_tag) {\n $this->say(\"Tagged build as $target_tag\");\n }\n );\n }\n else {\n $collection->completionCode(\n function() use ($target_tag) {\n $this->io()->warning(\"Tag $target_tag already exists - the tag remains unchanged.\");\n }\n );\n }\n }\n\n // Restore .gitignore and previous branch.\n $collection->completion(\n $this->taskGitStack()\n ->exec('git reset --hard')\n ->checkout($previous_branch)\n );\n return $collection;\n }", "function update( $revision = false ) {\n if( ! empty( $revision ) ) {\n $output = $this->_exec( \"checkout {$revision}\" );\n } else {\n $output = $this->_exec( 'checkout' );\n }\n return $output;\n }", "public function gitCloneRepositories() {\n\t\t$count = 0;\n\n\t\t$packages = $this->Package->find('list');\n\t\tforeach ($packages as $id => $name) {\n\t\t\t$this->out(sprintf(__(\"* Downloading package %s\"), $name));\n\t\t\tif ($this->Package->setupRepository($id)); {\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\t\t$this->out(sprintf(__('* Downloaded %s of %s repositories'), $count, count($packages)));\n\t}", "public function mergeSquash(string $branch, ?string $message = null): void;", "public function update(RepoRequest $request, Repo $repo)\n {\n $repo->fill($request->all());\n if (!$request->auto_deploy)\n {\n $repo->auto_deploy = 0;\n }\n $repo->save();\n\n return redirect()->back();\n }", "public function updateRepo(Bundle $bundle)\n {\n $message = array('bundle_id' => $bundle->getId());\n\n if ($this->bundleUpdateProducer) {\n // RabbitMQ, publish my message!\n $this->bundleUpdateProducer->publish(serialize($message));\n }\n }", "public function updateRepo(Bundle $bundle)\n {\n $message = array('bundle_id' => $bundle->getId());\n\n if ($this->bundleUpdateProducer) {\n // RabbitMQ, publish my message!\n $this->bundleUpdateProducer->publish(json_encode($message));\n }\n }", "public function fetch_from_repo($files, $post_id)\n {\n\n $inloop = -1;\n try\n {\n $post = get_post($post_id);\n $trans = 'scb_edd_repo_%1$s_' . $post_id . \"_\" . get_current_user_id();\n $meta = array();\n foreach ($files as $index => $file)\n {\n $inloop = $index;\n\n if (isset($file['repo']))\n {\n $repo_url = $this->translate_short_repo_url($file['repo'], $file['tag']);\n $ret = $this->save_remote_tag_url($file, $repo_url, $post);\n p_l($ret);\n\n $files[$index]['file'] = $ret['file'];\n $files[$index]['attachment_id'] = $ret['attachment_id'];\n $msg = 'Successfully fetched from repo:' . $file['repo'];\n $meta[$ret['attachment_id']]['url'] = $file['repo_url'];\n\n if ($this->get_setting('withhook'))\n {\n $ret_hook = $this->create_push_hook($meta[$ret['attachment_id']]['url']);\n if (!$ret_hook[0])\n {\n $msg .= \"Unable to Hook:\" . $ret_hook[1];\n $meta[$ret['attachment_id']]['hook_error'] = $ret_hook[1];\n }\n elseif (!$ret_hook[1])\n {\n $msg .= \" and hooked\";\n $meta[$ret['attachment_id']]['hook_error'] = '';\n }\n else\n {\n $msg .= \" \" . $ret_hook[1];\n $meta[$ret['attachment_id']]['hook_error'] = '';\n }\n }\n else\n {\n $msg .= \" no hook attached\";\n $meta[$ret['attachment_id']]['hook_error'] = '';\n\n }\n\n set_transient(sprintf($trans, 1), $msg, 45);\n\n }\n }\n if (count($meta))\n {\n update_post_meta($post_id, '_scb_edd_repo_url', $meta);\n }\n return $files;\n }\n catch (Exception $e)\n {\n if (isset($files[$inloop]))\n {\n $msg = \"Error while processing Repo(\" . $files[$inloop]['repo'] . \") : \" . $e->getMessage();\n }\n else\n {\n $msg = \"Unable to fetch From Repo : \" . $e->getMessage();\n }\n set_transient(sprintf($trans, 0), $msg, 45);\n\n unset($_POST['edd_download_meta_box_nonce']);\n wp_update_post(array(\"ID\" => $_REQUEST[\"post_ID\"], 'post_status' => 'draft'));\n return $files;\n\n }\n }", "function ngUpdateDetails()\n\t{\n\t\t$this->setPost();\n\t\t$postData = $_POST->branch;\n\t\t$result = false;\n\t\t$response = '';\n\t\t$where = array('id !=' => $postData->id, 'branch_email' => $postData->branch_email);\n\t\t$profile = $this->base_model->getCommon($this->primaryTable, $where);\n\n\t\tif (!$profile) {\n\t\t\t$where = array('id !=' => $postData->id, 'branch_mobile' => $postData->branch_mobile);\n\t\t\t$profile = $this->base_model->getCommon($this->primaryTable, $where);\n\t\t}\n\t\t// print_r($profile);die;\n\n\t\tif (!$profile) {\n\t\t\t$updateData = array(\n\t\t\t\t'branch_name' => $postData->branch_name,\n\t\t\t\t'branch_code' => $postData->branch_code,\n\t\t\t\t'branch_email' => $postData->branch_email,\n\t\t\t\t'branch_mobile' => $postData->branch_mobile,\n\t\t\t\t'branch_phone' => $postData->branch_phone,\n\t\t\t\t'branch_fax' => $postData->branch_fax,\n\t\t\t\t'status_id' => $postData->status_id\n\t\t\t);\n\t \t// print_r($updateData);die;\n\t\t\t$where = array('id' => $postData->id);\n\n\t\t\t$result = $this->base_model->updateCommon($this->primaryTable, $updateData, $where);\n\n\t\t\tif ($result) {\n\t\t\t\t$response = array('status' => true, 'message' => 'Branch updated successfully.', 'data' => '');\n\t\t\t\t$this->setSessionSuccessMessage('Branch updated successfully.');\n\t\t\t} else {\n\t\t\t\t$response = array('status' => false, 'message' => 'Failed to update branch.', 'data' => '');\n\t\t\t}\n\t\t} else {\n\t\t\t$response = array('status' => false, 'message' => 'Duplicate email id or mobile no.', 'data' => '');\n\t\t}\n\t\techo json_encode($response);\n\t}", "public static function &clone_remote($repo_path, $remote, $reference = null) {\n\t\t\treturn GitRepo::create_new($repo_path, $remote, true, $reference);\n\t\t}", "protected function cherryPickCommit(\n Split $cli,\n array $package,\n Commit $commit,\n string $distributionDirectory,\n string $branch\n ): void {\n $hash = $commit->getHash();\n $this->git('config advice.detachedHead false');\n $this->git(\"checkout -f $hash\", [], '2>&1');\n rename(\"$distributionDirectory/.git\", $this->output.'/.git.temp');\n $this->remove($distributionDirectory);\n $this->copyCurrentDirectory($distributionDirectory);\n\n $this->remove(\"$distributionDirectory/.git\");\n rename($this->output.'/.git.temp', \"$distributionDirectory/.git\");\n $cli->chdir($distributionDirectory);\n $this->setGitCommitter($commit->getCommit()->getAuthor());\n $author = $commit->getAuthor();\n\n $commitMessageFile = sys_get_temp_dir().'/commit-message-'.mt_rand(0, 99999999);\n file_put_contents($commitMessageFile, $commit->getMessage().\"\\n\\n\".$this->hashPrefix.$hash);\n $this->git('add .');\n $this->git('commit --file='.escapeshellarg($commitMessageFile), [\n 'author' => $author,\n 'date' => $author->getDate(),\n ], '2>&1');\n unlink($commitMessageFile);\n\n if (!$this->noPush) {\n $name = $package['name'];\n $push = (string) $this->git(\"push origin $branch\", [], '2>&1');\n $cli->writeLine(\"Pushing $name\\n\".$push, strpos($push, 'error:') === false ? 'light_cyan' : 'red');\n }\n\n $localUser = $this->getLocalUserConfig();\n\n foreach (['name', 'email'] as $userConfig) {\n $this->setGitConfig(\"user.$userConfig\", $localUser[$userConfig] ?? null);\n }\n }", "private function oembed_github_repo ( $owner, $repository ) {\n\t\t$repo = $this->api->get_repo( $owner, $repository );\n\t\t$commits =$this->api->get_repo_commits( $owner, $repository );\n\n\t\t$response = new stdClass();\n\t\t$response->type = 'rich';\n\t\t$response->width = '10';\n\t\t$response->height = '10';\n\t\t$response->version = '1.0';\n\t\t$response->title = $repo->description;\n\n\t\t// @TODO This should all be templated\n\t\t$response->html = '<div class=\"github-embed github-embed-repository\">';\n\t\t$response->html .= '<p><a href=\"' . esc_attr( $repo->html_url ) . '\" target=\"_blank\"><strong>' . esc_html( $repo->description ) . '</strong></a><br/>';\n\t\t$response->html .= '<a href=\"' . esc_attr( $repo->html_url ) . '\" target=\"_blank\">' . esc_html( $repo->html_url ) . '</a><br/>';\n\t\t$response->html .= '<a href=\"' . esc_attr( $repo->html_url . '/network' ) . '\" target=\"_blank\">' . esc_html( number_format_i18n( $repo->forks_count ) ) . '</a> forks.<br/>';\n\t\t$response->html .= '<a href=\"' . esc_attr( $repo->html_url . '/stargazers' ) . '\" target=\"_blank\">' . esc_html( number_format_i18n( $repo->stargazers_count ) ) . '</a> stars.<br/>';\n\t\t$response->html .= '<a href=\"' . esc_attr( $repo->html_url . '/issues' ) . '\" target=\"_blank\">' . esc_html( number_format_i18n( $repo->open_issues_count ) ) . '</a> open issues.<br/>';\n\n\t\tif ( count( $commits ) ) {\n\t\t\t$cnt = 0;\n\t\t\t$response->html .= 'Recent commits:';\n\t\t\t$response->html .= '<ul class=\"github_commits\">';\n\t\t\tforeach ( $commits as $commit ) {\n\t\t\t\tif ( $cnt > 4 ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$response->html .= '<li class=\"github_commit\">';\n\t\t\t\t$response->html .= '<a href=\"https://github.com/' . $owner . '/' . $repository . '/commit/' . esc_attr( $commit->sha ) . '\" target=\"_blank\">' . esc_html( $commit->commit->message ) . '</a>, ';\n\t\t\t\t$response->html .= esc_html( $commit->commit->committer->name );\n\t\t\t\t$response->html .= '</li>';\n\t\t\t\t$cnt++;\n\t\t\t}\n\t\t\t$response->html .= '</ul>';\n\t\t}\n\t\t$response->html .= '</p>';\n\t\t$response->html .= '</div>';\n\t\theader( 'Content-Type: application/json' );\n\t\techo json_encode( $response );\n\t\tdie();\n\t}", "public function checkout(string $branch) : Git\n {\n $this->progress('Checking out ' . $branch);\n\n $process = $this->runProcess(new Process('git checkout ' . $branch));\n\n return $this;\n }", "public function update($username, $repository, $label, $newName, $color)\n {\n $params = [\n 'name' => $newName,\n 'color' => $color,\n ];\n\n return $this->patch('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels/'.rawurlencode($label), $params);\n }", "public function updateCommand() {\n\t\t$this->browser->setRequestEngine($this->browserRequestEngine);\n\t\t$flowPackages = array();\n\n\t\tforeach ($this->repositories as $baseUrl => $repository) {\n\t\t\t$domain = parse_url($repository, PHP_URL_HOST);\n\t\t\t#$baseUrl = dirname($repository) . '/';\n\t\t\t$basePath = FLOW_PATH_DATA . 'Packages/' . $domain;\n\n\t\t\tif (!is_dir(FLOW_PATH_DATA . 'Packages/')) {\n\t\t\t\tmkdir(FLOW_PATH_DATA . 'Packages/');\n\t\t\t}\n\n\t\t\tif (!is_dir(FLOW_PATH_DATA . 'Packages/' . $domain)) {\n\t\t\t\tmkdir(FLOW_PATH_DATA . 'Packages/' . $domain);\n\t\t\t}\n\n\t\t\t$response = $this->browser->request($repository);\n\t\t\t$packagesFile = $basePath . '/packages.json';\n\t\t\tfile_put_contents($packagesFile, $response->getContent());\n\t\t\t$packageList = json_decode($response->getContent());\n\n\t\t\tif (isset($packageList->includes)) {\n\t\t\t\t$includes = get_object_vars($packageList->includes);\n\t\t\t\tif (!empty($includes)) {\n\t\t\t\t\tforeach ($includes as $file => $meta) {\n\t\t\t\t\t\t$packagesFile = $basePath . '/' . $file;\n\t\t\t\t\t\tif (file_exists($packagesFile) && sha1_file($packagesFile) == $meta->sha1) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!is_dir(dirname(($packagesFile)))) {\n\t\t\t\t\t\t\t\\TYPO3\\Flow\\Utility\\Files::createDirectoryRecursively(dirname($packagesFile));\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t$response = $this->browser->request($baseUrl . $file);\n\t\t\t\t\t\t\tfile_put_contents($packagesFile, $response->getContent());\n\t\t\t\t\t\t} catch(\\Exception $e) {\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($packageList->providers)) {\n\t\t\t\t$providers = get_object_vars($packageList->providers);\n\t\t\t\tif (!empty($providers)) {\n\t\t\t\t\tforeach ($providers as $file => $meta) {\n\t\t\t\t\t\t$packagesFile = $basePath . '/' . $file;\n\t\t\t\t\t\tif (file_exists($packagesFile) && sha1_file($packagesFile) == $meta->sha1) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!is_dir(dirname(($packagesFile)))) {\n\t\t\t\t\t\t\t\\TYPO3\\Flow\\Utility\\Files::createDirectoryRecursively(dirname($packagesFile));\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t$response = $this->browser->request($baseUrl . $file);\n\t\t\t\t\t\t\tfile_put_contents($packagesFile, $response->getContent());\n\t\t\t\t\t\t} catch(\\Exception $e) {\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$files = \\TYPO3\\Flow\\Utility\\Files::readDirectoryRecursively($basePath, '.json');\n\t\t\tforeach ($files as $file) {\n\t\t\t\t$packagesObject = json_decode(file_get_contents($file));\n\t\t\t\t$flowPackages = array_merge($flowPackages, $this->filterFlowPackages($packagesObject->packages));\n\t\t\t}\n\t\t}\n\t\t$flowPackagesFile = FLOW_PATH_DATA . 'Packages/packages-typo3-flow.json';\n\t\tfile_put_contents($flowPackagesFile, json_encode($flowPackages));\n\t\t$this->checkForNewPackages($flowPackages);\n\t}", "public function setRepository($var)\n {\n GPBUtil::checkString($var, True);\n $this->repository = $var;\n\n return $this;\n }", "public function testGitLabRemoteRepositoryExternal(): void\n {\n $repo = new GitLabRemoteRepository('r/r', './', 'https://salsa.debian.org/');\n $this->assertEquals('https://salsa.debian.org/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "public function push($remote = '', $branch = '', $force = false)\n {\n if (empty($remote)) {\n $remote = isset($this->fork) ? 'fork' : 'origin';\n }\n if (empty($branch)) {\n $branch = $this->branch();\n }\n $flag = $force ? '--force ' : '';\n $this->git('push {flag}{remote} {branch}', ['remote' => $remote, 'branch' => $branch, 'flag' => $flag]);\n return $this;\n }", "public function testUpdateRefresh(): void\n {\n $fixturesSet = 'TUFTestFixtureSimple';\n $this->localRepo = $this->memoryStorageFromFixture($fixturesSet, 'tufclient/tufrepo/metadata/current');\n $this->testRepo = new TestRepo($fixturesSet);\n\n $this->assertClientRepoVersions(static::getFixtureClientStartVersions($fixturesSet));\n $updater = $this->getSystemInTest();\n // This refresh should succeed.\n $updater->refresh();\n // Put the server-side repo into an invalid state.\n $this->testRepo->removeRepoFile('timestamp.json');\n // The updater is already refreshed, so this will return early, and\n // there should be no changes to the client-side repo.\n $updater->refresh();\n $this->assertClientRepoVersions(static::getFixtureClientStartVersions($fixturesSet));\n // If we force a refresh, the invalid state of the server-side repo will\n // raise an exception.\n $this->expectException(RepoFileNotFound::class);\n $this->expectExceptionMessage('File timestamp.json not found.');\n $updater->refresh(true);\n }", "function runUpdate($repo)\n{\n $updNoodle = new Noodle();\n $updNoodle->noodleID = 17;\n $updNoodle->brand = 'FLAVOURS OF THE SUN';\n $updNoodle->flavour = 'COSMIC DUST';\n $updNoodle->instant = 1;\n $updNoodle->nationality = 'OUT OF THIS WORLD';\n $repo->update($updNoodle);\n}", "public function pull($args, $assocArgs = [])\n {\n /**\n * @var array $aliases\n * @var array $actions\n */\n extract($this->parseArgs($args, 1, self::DEFAULT_ACTIONS));\n\n if ($aliases[0] === '@local') {\n \\WP_CLI::error('Cannot pull from @local.');\n }\n\n $this->callActions($aliases[0], '@local', $actions, $assocArgs);\n }", "public function updateJobStatus($status, $additional_info=null, $datasource_id=null){\n $this->status = $status;\n $this->additional_info = $additional_info;\n $this->datasource_id = $datasource_id;\n return $this->submit();\n }" ]
[ "0.6380509", "0.6174998", "0.61604345", "0.61464447", "0.5803747", "0.56516814", "0.56359136", "0.5620762", "0.55611455", "0.5454606", "0.5413471", "0.5393883", "0.5391349", "0.52943695", "0.52776945", "0.52756375", "0.5228591", "0.5217752", "0.5196512", "0.51285505", "0.4971897", "0.49466223", "0.49320623", "0.4909792", "0.48746166", "0.48404437", "0.47700593", "0.47541666", "0.47323045", "0.47136214", "0.47048563", "0.4677457", "0.46539855", "0.46340334", "0.46233073", "0.46105537", "0.46000132", "0.4554855", "0.4468793", "0.4458749", "0.4435291", "0.43849018", "0.43800893", "0.43569627", "0.43434954", "0.431769", "0.43098783", "0.42835286", "0.42779574", "0.42773104", "0.42738834", "0.4271037", "0.42674297", "0.425876", "0.4257245", "0.42372096", "0.4213055", "0.42057", "0.41978794", "0.41880175", "0.41872245", "0.41847706", "0.4152457", "0.41423032", "0.41408512", "0.41403884", "0.41309008", "0.4128413", "0.41251528", "0.4124935", "0.41213188", "0.41174036", "0.41020587", "0.4093532", "0.4092774", "0.40862438", "0.40652472", "0.4063811", "0.40637118", "0.40366897", "0.40182754", "0.39874667", "0.3984463", "0.39754832", "0.39676318", "0.3965125", "0.395122", "0.3936514", "0.39306632", "0.3925007", "0.39067054", "0.39045852", "0.38841137", "0.38702476", "0.38610345", "0.38564518", "0.3854407", "0.38526064", "0.38514307", "0.3849537" ]
0.6444031
0
Updates the given repository's submodules.
public static function updateExternals($path) { if (!file_exists($path)) { throw new Exception( "Unable to update git repo $path. Path does not exist."); } if (!is_dir($path)) { throw new Exception( "Unable to update git repo $path. Path is not a directory."); } if (!self::isRepo($path)) { throw new Exception( "Unable to update git repo $path. Path is not a git repository."); } $origCwd = getcwd(); chdir($path); $updateCmd = sprintf(self::UPDATE_SUBMODULES_CMD); passthru($updateCmd); chdir($origCwd); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function git_update_submodules($path) {\n\t$status = GitUtil::updateExternals($path);\n}", "private function update_modules()\n\t{\n\t\tee()->db->select('module_name, module_version');\n\t\t$query = ee()->db->get('modules');\n\n\t\tforeach ($query->result() as $row)\n\t\t{\n\t\t\t$module = strtolower($row->module_name);\n\n\t\t\t// Only update first-party modules\n\t\t\tif ( ! in_array($module, $this->native_modules))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Send version to update class and let it do any required work\n\t\t\tif (in_array($module, $this->native_modules))\n\t\t\t{\n\t\t\t\t$path = EE_APPPATH.'/modules/'.$module.'/';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$path = PATH_THIRD.$module.'/';\n\t\t\t}\n\n\t\t\tif (file_exists($path.'upd.'.$module.'.php'))\n\t\t\t{\n\t\t\t\t$this->load->add_package_path($path);\n\n\t\t\t\t$class = ucfirst($module).'_upd';\n\n\t\t\t\tif ( ! class_exists($class))\n\t\t\t\t{\n\t\t\t\t\trequire $path.'upd.'.$module.'.php';\n\t\t\t\t}\n\n\t\t\t\t$UPD = new $class;\n\t\t\t\t$UPD->_ee_path = EE_APPPATH;\n\n\t\t\t\tif ($UPD->version > $row->module_version && method_exists($UPD, 'update') && $UPD->update($row->module_version) !== FALSE)\n\t\t\t\t{\n\t\t\t\t\tee()->db->update('modules', array('module_version' => $UPD->version), array('module_name' => ucfirst($module)));\n\t\t\t\t}\n\n\t\t\t\t$this->load->remove_package_path($path);\n\t\t\t}\n\t\t}\n\t}", "public function updateRepositories() {\n $projects = $this->loadProjects();\n if (!$projects)\n return;\n\n $this->m_authors = $this->loadAuthors();\n\n foreach ($projects as $project)\n $this->updateProject($project);\n }", "public function update(Request $request, $id)\n {\n $user = $this->check_user->getUserAuthenticated($request->token);\n \n $checkRole = $user->verifyRoleAuthorization($user->id);\n $checkPermission = $user->verifyPermissionAuthorization('submodule_update', ['self', 'all']);\n\n if (!$checkRole || !$checkPermission) {\n return response()->json(['message' => __('messages.no_permission'), 'status' => 'error'], 401);\n }\n\n try {\n\t\t $dataSubmodule = [\n 'name' => $request->name,\n 'description' => $request->description,\n 'id' => $request->module\n ];\n\t\t $validated = $this->validator($dataSubmodule);\n\n\t \tif ($validated->fails()) {\n $errors = $this->parseErrors($validated->errors());\n\t \t\treturn response()->json(['message' => $errors, 'status' => 'error'], 400);\n\t \t}\n\n\t\t\t$input = $dataSubmodule; \n\t \t$submodule = $this->submodules->find($id);\n\n if (!$submodule) {\n\t \t\treturn response()->json(['message' => __('messages.submodule_not_found'), 'status' => 'error'], 404);\n }\n \n $submodule->fill($input); \n \n $module = Module::find($request->module);\n $submodule->module()->dissociate();\n $submodule->module()->associate($module);\n $submodule->save();\n\t\t\tstoreLogActivity('submodule_update', $user->id);\n \treturn response()->json(['message' => __('messages.submodule_update_success'), 'status' => 'success'], 200); \n\n \t} catch (Exception $e) {\n return response()->json(['message' => __('messages.submodule_update_error'), 'status' => 'error']);\n \t}\n }", "function git_init_submodules($path) {\n\tGitUtil::initSubmodules($path);\n}", "public function updateModuleList()\n {\n if ($this->modulebase == \"\") {\n throw new \\InvalidArgumentException(\"Module base must not be empty!\");\n }\n\n $this->finder->directories()->in($this->modulebase)->depth('== 0');\n \n $modules = array();\n\n foreach ($this->finder as $file) {\n if (file_exists($file->getRealpath() . \"/routes.php\")) {\n $modules[] = $file->getFilename();\n }\n }\n\n if (is_writeable(dirname($this->storage))) {\n file_put_contents(\n $this->storage,\n json_encode($modules)\n );\n }\n\n return true;\n }", "function testUpdatePackageTree() {\n\t\t$packages = array('cake', 'model', 'datasource', 'dbo');\n\t\t$result = (bool) $this->ApiPackage->updatePackageTree($packages);\n\t\t$this->assertTrue($result);\n\n\t\t$result = $this->ApiPackage->findAllByParentId(4);\n\t\t$this->assertEqual(count($result), 2);\n\n\t\t$packages = array('cake', 'model', 'datasource', 'dbo');\n\t\t$result = (bool) $this->ApiPackage->updatePackageTree($packages);\n\t\t$this->assertTrue($result);\n\n\t\t$result = $this->ApiPackage->findAllBySlug('model');\n\t\t$this->assertEqual(count($result), 1, 'Too many model slugs');\n\t}", "private function _installSubextensions($parent)\n\t{\n\t\t$src = $parent->getParent()->getPath('source');\n\n\t\t$db = JFactory::getDbo();\n\n\t\t$status = new JObject();\n\t\t$status->modules = array();\n\t\t$status->plugins = array();\n\n\t\t// Modules installation\n\n\t\tif(count($this->installation_queue['modules'])) {\n\t\t\tforeach($this->installation_queue['modules'] as $folder => $modules) {\n\t\t\t\tif(count($modules))\n\t\t\t\t\tforeach($modules as $module => $modulePreferences)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Install the module\n\t\t\t\t\t\tif(empty($folder))\n\t\t\t\t\t\t\t$folder = 'site';\n\t\t\t\t\t\t$path = \"$src/modules/$folder/$module\";\n\t\t\t\t\t\tif(!is_dir($path))// if not dir\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$path = \"$src/modules/$folder/mod_$module\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!is_dir($path)) {\n\t\t\t\t\t\t\t$path = \"$src/modules/$module\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(!is_dir($path)) {\n\t\t\t\t\t\t\t$path = \"$src/modules/mod_$module\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!is_dir($path))\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t$fortest='';\n\t\t\t\t\t\t\t//continue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Was the module already installed?\n\t\t\t\t\t\t$sql = $db->getQuery(true)\n\t\t\t\t\t\t\t->select('COUNT(*)')\n\t\t\t\t\t\t\t->from('#__modules')\n\t\t\t\t\t\t\t->where($db->qn('module').' = '.$db->q('mod_'.$module));\n\t\t\t\t\t\t$db->setQuery($sql);\n\n\t\t\t\t\t\t$count = $db->loadResult();\n\t\t\t\t\t\t$installer = new JInstaller;\n\t\t\t\t\t\t$result = $installer->install($path);\n\t\t\t\t\t\t$status->modules[] = array(\n\t\t\t\t\t\t\t'name'=>$module,\n\t\t\t\t\t\t\t'client'=>$folder,\n\t\t\t\t\t\t\t'result'=>$result,\n\t\t\t\t\t\t\t'status'=>$modulePreferences[1]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t// Modify where it's published and its published state\n\t\t\t\t\t\tif(!$count) {\n\t\t\t\t\t\t\t// A. Position and state\n\t\t\t\t\t\t\tlist($modulePosition, $modulePublished) = $modulePreferences;\n\t\t\t\t\t\t\tif($modulePosition == 'cpanel') {\n\t\t\t\t\t\t\t\t$modulePosition = 'icon';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$sql = $db->getQuery(true)\n\t\t\t\t\t\t\t\t->update($db->qn('#__modules'))\n\t\t\t\t\t\t\t\t->set($db->qn('position').' = '.$db->q($modulePosition))\n\t\t\t\t\t\t\t\t->where($db->qn('module').' = '.$db->q('mod_'.$module));\n\t\t\t\t\t\t\tif($modulePublished) {\n\t\t\t\t\t\t\t\t$sql->set($db->qn('published').' = '.$db->q('1'));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$db->setQuery($sql);\n\t\t\t\t\t\t\t$db->query();\n\n\t\t\t\t\t\t\t// B. Change the ordering of back-end modules to 1 + max ordering\n\t\t\t\t\t\t\tif($folder == 'admin') {\n\t\t\t\t\t\t\t\t$query = $db->getQuery(true);\n\t\t\t\t\t\t\t\t$query->select('MAX('.$db->qn('ordering').')')\n\t\t\t\t\t\t\t\t\t->from($db->qn('#__modules'))\n\t\t\t\t\t\t\t\t\t->where($db->qn('position').'='.$db->q($modulePosition));\n\t\t\t\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t\t\t\t$position = $db->loadResult();\n\t\t\t\t\t\t\t\t$position++;\n\n\t\t\t\t\t\t\t\t$query = $db->getQuery(true);\n\t\t\t\t\t\t\t\t$query->update($db->qn('#__modules'))\n\t\t\t\t\t\t\t\t\t->set($db->qn('ordering').' = '.$db->q($position))\n\t\t\t\t\t\t\t\t\t->where($db->qn('module').' = '.$db->q('mod_'.$module));\n\t\t\t\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t\t\t\t$db->query();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// C. Link to all pages\n\t\t\t\t\t\t\t$query = $db->getQuery(true);\n\t\t\t\t\t\t\t$query->select('id')->from($db->qn('#__modules'))\n\t\t\t\t\t\t\t\t->where($db->qn('module').' = '.$db->q('mod_'.$module));\n\t\t\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t\t\t$moduleid = $db->loadResult();\n\n\t\t\t\t\t\t\t$query = $db->getQuery(true);\n\t\t\t\t\t\t\t$query->select('*')->from($db->qn('#__modules_menu'))\n\t\t\t\t\t\t\t\t->where($db->qn('moduleid').' = '.$db->q($moduleid));\n\t\t\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t\t\t$assignments = $db->loadObjectList();\n\t\t\t\t\t\t\t$isAssigned = !empty($assignments);\n\t\t\t\t\t\t\tif(!$isAssigned) {\n\t\t\t\t\t\t\t\t$o = (object)array(\n\t\t\t\t\t\t\t\t\t'moduleid'\t=> $moduleid,\n\t\t\t\t\t\t\t\t\t'menuid'\t=> 0\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t$db->insertObject('#__modules_menu', $o);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Plugins installation\n\t\tif(count($this->installation_queue['plugins'])) {\n\t\t\tforeach($this->installation_queue['plugins'] as $folder => $plugins) {\n\t\t\t\tif(count($plugins))\n\t\t\t\tforeach($plugins as $plugin => $published) {\n\t\t\t\t\t$path = \"$src/plugins/$folder/$plugin\";\n\t\t\t\t\tif(!is_dir($path)) {\n\t\t\t\t\t\t$path = \"$src/plugins/$folder/plg_$plugin\";\n\t\t\t\t\t}\n\t\t\t\t\tif(!is_dir($path)) {\n\t\t\t\t\t\t$path = \"$src/plugins/$plugin\";\n\t\t\t\t\t}\n\t\t\t\t\tif(!is_dir($path)) {\n\t\t\t\t\t\t$path = \"$src/plugins/plg_$plugin\";\n\t\t\t\t\t}\n\t\t\t\t\tif(!is_dir($path)) continue;\n\n\t\t\t\t\t// Was the plugin already installed?\n\t\t\t\t\t$query = $db->getQuery(true)\n\t\t\t\t\t\t->select('COUNT(*)')\n\t\t\t\t\t\t->from($db->qn('#__extensions'))\n\t\t\t\t\t\t->where('( '.($db->qn('name').' = '.$db->q($plugin)) .' OR '. ($db->qn('element').' = '.$db->q($plugin)) .' )')\n\t\t\t\t\t\t->where($db->qn('folder').' = '.$db->q($folder));\n\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t$count = $db->loadResult();\n\n\t\t\t\t\t$installer = new JInstaller;\n\t\t\t\t\t$result = $installer->install($path);\n\n\t\t\t\t\t$status->plugins[] = array('name'=>$plugin,'group'=>$folder, 'result'=>$result,'status'=>$published);\n\n\n\t\t\t\t\tif($published && !$count) {\n\t\t\t\t\t\t$query = $db->getQuery(true)\n\t\t\t\t\t\t\t->update($db->qn('#__extensions'))\n\t\t\t\t\t\t\t->set($db->qn('enabled').' = '.$db->q('1'))\n\t\t\t\t\t\t\t->where('( '.($db->qn('name').' = '.$db->q($plugin)) .' OR '. ($db->qn('element').' = '.$db->q($plugin)) .' )')\n\t\t\t\t\t\t\t->where($db->qn('folder').' = '.$db->q($folder));\n\t\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t\t$db->query();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// library installation\n\t\tif(!empty($this->installation_queue['libraries']) and count($this->installation_queue['libraries']))\n\t\t {\n\t\t\tforeach($this->installation_queue['libraries'] as $folder=>$status1)\n\t\t\t{\n\n\t\t\t\t\t$path = \"$src/libraries/$folder\";\n\n\t\t\t\t\t$query = $db->getQuery(true)\n\t\t\t\t\t\t->select('COUNT(*)')\n\t\t\t\t\t\t->from($db->qn('#__extensions'))\n\t\t\t\t\t\t->where('( '.($db->qn('name').' = '.$db->q($folder)) .' OR '. ($db->qn('element').' = '.$db->q($folder)) .' )')\n\t\t\t\t\t\t->where($db->qn('folder').' = '.$db->q($folder));\n\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t$count = $db->loadResult();\n\n\t\t\t\t\t$installer = new JInstaller;\n\t\t\t\t\t$result = $installer->install($path);\n\n\t\t\t\t\t$status->libraries[] = array('name'=>$folder,'group'=>$folder, 'result'=>$result,'status'=>$status1);\n\t\t\t\t\t//print\"<pre>\"; print_r($status->plugins); die;\n\n\t\t\t\t\tif($published && !$count) {\n\t\t\t\t\t\t$query = $db->getQuery(true)\n\t\t\t\t\t\t\t->update($db->qn('#__extensions'))\n\t\t\t\t\t\t\t->set($db->qn('enabled').' = '.$db->q('1'))\n\t\t\t\t\t\t\t->where('( '.($db->qn('name').' = '.$db->q($folder)) .' OR '. ($db->qn('element').' = '.$db->q($folder)) .' )')\n\t\t\t\t\t\t\t->where($db->qn('folder').' = '.$db->q($folder));\n\t\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t\t$db->query();\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t/*\n\t\t * 'applications'=>array(\n\t\t\t'easysocial'array(\n\t\t\t\t\t'quick2cartproducts'=>0,\n\t\t\t\t\t'quick2cartstores'=>0\n\n\t\t\t),\n\t\t * */\n\t\t//Application Installations\n\t\tif(file_exists(JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/foundry.php'))\n\t\t{\n\t\t\trequire_once( JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/foundry.php' );\n\t\t\t$installer = Foundry::get( 'Installer' );\n\t\t\t// The $path here refers to your application path\n\t\t\t$installer->load( $src.\"/plugins/easysocial/easysocial_broadcast\" );\n\t\t\t$plg_install=$installer->install();\n\t\t\t$status->app_install[] = array('name'=>'easysocial_broadcast','group'=>'easysocial_broadcast', 'result'=>$plg_install,'status'=>'1');\n\t\t}\n\n\t\treturn $status;\n\t}", "public function modules($like=array(),$options=array()){\n\t\t$action = array_shift($like);\n\t\tif(isset($options['server'])){\n\t\t\t$server = $options['server'];\n\t\t}else{\n\t\t\t$server = 'nthalk.com';\n\t\t}\n\t\tif($action == 'uninstall'){\n\t\t\t$module = array_shift($like);\n\t\t\t$module_dir = Framework::moduleInstalled($module);\n\t\t\tif(!$module_dir){\n\t\t\t\t$this->write(\"Module does not appear to be installed: $module\\n\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$this->write(\"Uninstalling: $module\\n\");\n\t\t\t\n\t\t\t$this->write(\"Running uninstall scripts...\\n\");\n\t\t\tif(method_exists($module,'uninstall')){\n\t\t\t\tif(!call_user_func(array($module,'uninstall'))||isset($options['force'])){\n\t\t\t\t\t$this->write(\"Uninstaller failed... Please inspect $module::uninstall() before completely removing or supply --force\\n\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->write(\"Removing submodule from app/.git cache...\\n\");\n\t\t\t$cmd = 'git rm --cached ' . $module_dir;\n\t\t\t//$this->write($cmd . \"\\n\");\n\t\t\t$cmd_p = popen($cmd,'r');\n\t\t\t$this->write(fread($cmd_p,10000). \"\\n\");\n\t\t\t\n\t\t\t$dir = SERVER_APP_DIR;\n\t\t\t$git_submodules_file = $dir .'/.gitmodules';\n\t\t\tif(file_exists($git_submodules_file)){\n\t\t\t\t$git_submodules = file_get_contents($git_submodules_file);\n\t\t\t\t$match = \"/\\[submodule.*$module\\\"\\]\\s+path.*\\s+url.*\\s?/\";\n\t\t\t\tif(preg_match($match,$git_submodules)){\n\t\t\t\t\t$git_submodules_new = preg_replace($match,'',$git_submodules);\n\t\t\t\t\t$git_submodules_new = preg_replace(\"/\\n+/\",\"\\n\",$git_submodules_new );\n\t\t\t\t\t$this->write(\"Removing submodule from submodules...\\n\");\n\t\t\t\t\t//$this->write($git_submodules_new . \"\\n\");\n\t\t\t\t\tfile_put_contents($git_submodules_file,$git_submodules_new);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$git_conf_file = $dir . '/.git/config';\n\t\t\tif(file_exists($git_conf_file)){\n\t\t\t\t$git_conf = file_get_contents($git_conf_file);\n\t\t\t\t$match = \"/\\[submodule.*$module\\\"\\](\\s+path.*|\\s+url.*)+?\\s?/\";\n\t\t\t\tif(preg_match($match,$git_conf)){\n\t\t\t\t\t$git_conf_new = preg_replace($match,'',$git_conf);\n\t\t\t\t\t$git_conf_new = preg_replace(\"/\\n+/\",\"\\n\",$git_conf_new);\n\t\t\t\t\t$this->write(\"Removing submodule from config...\\n\");\n\t\t\t\t\t//$this->write($git_conf_new . \"\\n\");\n\t\t\t\t\tfile_put_contents($git_conf_file,$git_conf_new);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->write(\"Removing submodule from file system...\\n\");\n\t\t\t$cmd = 'rm -rf ' . $module_dir;\n\t\t\t//$this->write($cmd . \"\\n\");\n\t\t\t$cmd_p = popen($cmd,'r');\n\t\t\t$this->write(fread($cmd_p,10000). \"\\n\");\n\t\t\t\n\t\t\t$this->write(\"Done. It is up to you to commit this change into your app repo...\\n\");\n\t\t\t\n\t\t}else if($action == 'list'){\n\t\t\t$this->write(\"Currently installed modules:\\n\\n\");\n\t\t\tforeach(Framework::moduleList(array_shift($like)) as $module){\n\t\t\t\t$this->write(\n\t\t\t\t\t' ' . $module . ' -' .$this->getDocumentation(new ReflectionClass($module))\n\t\t\t\t);\n\t\t\t}\n\t\t\t$this->write(\"\\n\");\n\t\t}else if($action =='list-remote'){\n\t\t\t$content = file_get_contents(\"http://$server/Packages\");\n\t\t\t$packages = json_decode($content);\n\t\t\tif(!is_array($packages)){\n\t\t\t\t$this->write('Error retrieving data from module server: '.$server.\"\\n\");\n\t\t\t}else{\n\t\t\t\tforeach($packages as $package){\n\t\t\t\t\t$this->write($package->name . \" - \" . $package->version . \"\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t}else if($action =='install'){\n\t\t\tif(realpath(getcwd()) !== SERVER_APP_DIR){\n\t\t\t\t$this->write(\"fatal: You must install modules from the root of your app dir ( \".SERVER_APP_DIR.\" )\\n\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t$content = file_get_contents(\"http://$server/Packages\");\n\t\t\t$packages = json_decode($content);\n\t\t\tif(!is_array($packages)){\n\t\t\t\t$this->write('Error retrieving data from module server: '.$server.\"\\n\");\n\t\t\t\texit -1;\n\t\t\t}else{\n\t\t\t\t$what = array_shift($like);\n\t\t\t}\n\t\t\tforeach($packages as $package){\n\t\t\t\tif($package->name == $what){\n\t\t\t\t\t// Define the dir\n\t\t\t\t\t$dir = SERVER_EXT_DIR;\n\t\t\t\t\tif(!file_exists($dir)){\n\t\t\t\t\t\t$dir_parts = explode('/',$dir);\n\t\t\t\t\t\t$curr_dir = '';\n\t\t\t\t\t\tdo{\n\t\t\t\t\t\t\t$curr_dir .= '/' . array_shift($dir_parts);\n\t\t\t\t\t\t\tif(!file_exists($curr_dir)){\n\t\t\t\t\t\t\t\tmkdir($curr_dir);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}while(!file_exists($dir));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// If app is git repo\n\t\t\t\t\t$app_is_git = file_exists(SERVER_APP_DIR.'/.git');\n\t\t\t\t\t// Install directory\n\t\t\t\t\t$dir .= '/modules/';\n\t\t\t\t\tif(!file_exists($dir)){\n\t\t\t\t\t\tmkdir($dir);\n\t\t\t\t\t}\n\t\t\t\t\t$dir .= $package->name;\n\t\t\t\t\t$dir = substr($dir,strlen(SERVER_APP_DIR)+1);\n\t\t\t\t\tif(isset($options['as-git-submodule'])){\n\t\t\t\t\t\tif(!$app_is_git){\n\t\t\t\t\t\t\t$this->write('fatal: app is not a git repo. Please run `git init` within '.SERVER_APP_DIR.\"\\n\");\n\t\t\t\t\t\t\texit -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$cmd = 'git submodule add ' . $package->git_url . ' ' .$dir;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$cmd = 'git clone --depth 0 ' . $package->git_url . ' ' . $dir;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this->write(\"Retrieving package $what...\\t\");\n\t\t\t\t\t$this->write(\"\\ncmd: $cmd\\n\");\n\t\t\t\t\t\n\t\t\t\t\tif(shell_exec($cmd)){\n\t\t\t\t\t\tif(!isset($options['as-git-repo'])&&!isset($options['as-git-submodule'])){\n\t\t\t\t\t\t\tif (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {\n\t\t\t\t\t\t exec( \"rd /s $dir/.git\" );\n\t\t\t\t\t\t }else{\n\t\t\t\t\t\t \tif(!$app_is_git){\n\t\t\t\t\t\t\t\t\t$this->write('warning: app is not a git repo. Installing modules this way may pollute the framework and prevent you from having your application as a standalone repository. Please run `git init` within app to avoid this warning.'.\"\\n\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t exec( \"rm -rf $dir/.git\" );\n\t\t\t\t\t\t }\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->write(\"[Success]\\n\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t// If the module has a configuration function, run that on install\n\t\t\t\t\t\tif(method_exists($what,'setup')){\n\t\t\t\t\t\t\tcall_user_func_array(array($what,'setup'),array($this->out_stream,$this->in_stream));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->write(\"Package installed!\\n\");\n\t\t\t\t\t\texit;\n\t\t\t\t\t}else{\n\t\t\t\t\t\texit -1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->write('Package: ' . json_encode($what) . ' not found.' . \"\\n\");\n\t\t}else{\n\t\t\t$this->write(\"Usage: nth action [ARGS] [[--option=setting]]\\n\\n\");\n\t\t\t$this->write($this->getDocumentation(new ReflectionMethod($this,__FUNCTION__),true));\n\t\t}\n\t}", "public function updateCommand() {\n\t\t$this->browser->setRequestEngine($this->browserRequestEngine);\n\t\t$flowPackages = array();\n\n\t\tforeach ($this->repositories as $baseUrl => $repository) {\n\t\t\t$domain = parse_url($repository, PHP_URL_HOST);\n\t\t\t#$baseUrl = dirname($repository) . '/';\n\t\t\t$basePath = FLOW_PATH_DATA . 'Packages/' . $domain;\n\n\t\t\tif (!is_dir(FLOW_PATH_DATA . 'Packages/')) {\n\t\t\t\tmkdir(FLOW_PATH_DATA . 'Packages/');\n\t\t\t}\n\n\t\t\tif (!is_dir(FLOW_PATH_DATA . 'Packages/' . $domain)) {\n\t\t\t\tmkdir(FLOW_PATH_DATA . 'Packages/' . $domain);\n\t\t\t}\n\n\t\t\t$response = $this->browser->request($repository);\n\t\t\t$packagesFile = $basePath . '/packages.json';\n\t\t\tfile_put_contents($packagesFile, $response->getContent());\n\t\t\t$packageList = json_decode($response->getContent());\n\n\t\t\tif (isset($packageList->includes)) {\n\t\t\t\t$includes = get_object_vars($packageList->includes);\n\t\t\t\tif (!empty($includes)) {\n\t\t\t\t\tforeach ($includes as $file => $meta) {\n\t\t\t\t\t\t$packagesFile = $basePath . '/' . $file;\n\t\t\t\t\t\tif (file_exists($packagesFile) && sha1_file($packagesFile) == $meta->sha1) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!is_dir(dirname(($packagesFile)))) {\n\t\t\t\t\t\t\t\\TYPO3\\Flow\\Utility\\Files::createDirectoryRecursively(dirname($packagesFile));\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t$response = $this->browser->request($baseUrl . $file);\n\t\t\t\t\t\t\tfile_put_contents($packagesFile, $response->getContent());\n\t\t\t\t\t\t} catch(\\Exception $e) {\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($packageList->providers)) {\n\t\t\t\t$providers = get_object_vars($packageList->providers);\n\t\t\t\tif (!empty($providers)) {\n\t\t\t\t\tforeach ($providers as $file => $meta) {\n\t\t\t\t\t\t$packagesFile = $basePath . '/' . $file;\n\t\t\t\t\t\tif (file_exists($packagesFile) && sha1_file($packagesFile) == $meta->sha1) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!is_dir(dirname(($packagesFile)))) {\n\t\t\t\t\t\t\t\\TYPO3\\Flow\\Utility\\Files::createDirectoryRecursively(dirname($packagesFile));\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t$response = $this->browser->request($baseUrl . $file);\n\t\t\t\t\t\t\tfile_put_contents($packagesFile, $response->getContent());\n\t\t\t\t\t\t} catch(\\Exception $e) {\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$files = \\TYPO3\\Flow\\Utility\\Files::readDirectoryRecursively($basePath, '.json');\n\t\t\tforeach ($files as $file) {\n\t\t\t\t$packagesObject = json_decode(file_get_contents($file));\n\t\t\t\t$flowPackages = array_merge($flowPackages, $this->filterFlowPackages($packagesObject->packages));\n\t\t\t}\n\t\t}\n\t\t$flowPackagesFile = FLOW_PATH_DATA . 'Packages/packages-typo3-flow.json';\n\t\tfile_put_contents($flowPackagesFile, json_encode($flowPackages));\n\t\t$this->checkForNewPackages($flowPackages);\n\t}", "public function actionUpdateFromModules($remove_all = 0)\n {\n $params = static::updateRoles($remove_all);\n\n return $this->render('updateFromModules', $params);\n }", "function loadSubModules()\n{\n $debug_prefix = debug_indent(\"Module->loadSubModules() {$this->ModuleID}:\");\n $submodule_elements = $this->_map->selectChildrenOfFirst('SubModules', null, null, true, true);\n if(count($submodule_elements) > 0){\n foreach($submodule_elements as $submodule_element){\n $submodule = $submodule_element->createObject($this->ModuleID);\n $subModuleID = $submodule_element->getAttr('moduleID', true);\n $this->SubModules[$subModuleID] = $submodule;\n print \"$debug_prefix Submodule $subModuleID parsed.\\n\";\n unset($submodule);\n }\n\n //special for best practices: add the IsBestPractice SummaryField\n if(isset($this->SubModules['bpc'])){\n $this->useBestPractices = true;\n $recordIDField = end($this->PKFields);\n\n $field_object = MakeObject(\n $this->ModuleID,\n 'IsBestPractice',\n 'SummaryField',\n array(\n 'name' => 'IsBestPractice',\n 'type' => 'tinyint',\n 'summaryFunction' => 'count',\n 'summaryField' => 'BestPracticeID',\n 'summaryKey' => 'RelatedRecordID',\n 'summaryModuleID' => 'bpc',\n 'localKey' => $recordIDField,\n 'phrase' => 'Is Best Practice|Whether the associated record is a best practice'\n )\n );\n//print \"best practice auto field\";\n//print_r($field_object);\n//die();\n $this->ModuleFields['IsBestPractice'] = $field_object;\n }\n\n //copies submodule conditions to summary fields\n foreach($this->ModuleFields as $fieldName => $field){\n if('summaryfield' == strtolower(get_class($field))){\n if(!$field->isGlobal){\n\n if(isset($this->SubModules[$field->summaryModuleID])){\n $subModule =& $this->SubModules[$field->summaryModuleID];\n if(count($subModule->conditions) > 0){\n //$field->conditions = $subModule->conditions;\n $field->conditions = array_merge($subModule->conditions, (array)$field->conditions);\n $this->ModuleFields[$fieldName] = $field;\n }\n unset($subModule);\n } else {\n trigger_error(\"The summaryfield '{$field->name}' requires a '{$field->summaryModuleID}' submodule.\", E_USER_ERROR);\n }\n }\n }\n }\n }\n debug_unindent();\n}", "function updateSubpageVersions() {\n try {\n if(DB::executeFirstCell(\"SELECT COUNT(*) AS count FROM \" . TABLE_PREFIX . \"modules WHERE name='notebooks'\")) {\n try {\n $pages_table = TABLE_PREFIX . 'notebook_pages';\n $page_versions_table = TABLE_PREFIX . 'notebook_page_versions';\n $content_backup_table = TABLE_PREFIX . 'content_backup';\n\n DB::beginWork('Updating subpage versions @ ' . __CLASS__);\n\n $rows = DB::execute(\"SELECT $page_versions_table.id, $page_versions_table.body FROM $pages_table, $page_versions_table WHERE $pages_table.id = $page_versions_table.notebook_page_id AND $pages_table.parent_type = 'NotebookPage'\");\n if($rows) {\n foreach($rows as $row) {\n DB::execute(\"INSERT INTO $content_backup_table (parent_type, parent_id, body) VALUES ('NotebookPageVersion', ?, ?)\", $row['id'], $row['body']);\n DB::execute(\"UPDATE $page_versions_table SET body = ? WHERE id = '$row[id]'\", $this->updateHtmlContent($row['body']));\n } // foreach\n } // if\n\n DB::commit('Subpage versions updated @ ' . __CLASS__);\n } catch(Exception $e) {\n DB::rollback('Failed to update subpage versions @ ' . __CLASS__);\n return $e->getMessage();\n } // try\n } // if\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }", "protected function utilGitPull()\n {\n foreach (File::directories(plugins_path()) as $authorDir) {\n foreach (File::directories($authorDir) as $pluginDir) {\n if (!File::isDirectory($pluginDir.'/.git')) {\n continue;\n }\n\n $exec = 'cd ' . $pluginDir . ' && ';\n $exec .= 'git pull 2>&1';\n echo 'Updating plugin: '. basename(dirname($pluginDir)) .'.'. basename($pluginDir) . PHP_EOL;\n echo shell_exec($exec);\n }\n }\n\n foreach (File::directories(themes_path()) as $themeDir) {\n if (!File::isDirectory($themeDir.'/.git')) {\n continue;\n }\n\n $exec = 'cd ' . $themeDir . ' && ';\n $exec .= 'git pull 2>&1';\n echo 'Updating theme: '. basename($themeDir) . PHP_EOL;\n echo shell_exec($exec);\n }\n }", "public static function initSubmodules($path) {\n\t\t$oldDir = getcwd();\n\t\tchdir($path);\n\t\tpassthru(self::INIT_SUBMODULES_CMD);\n\t\tchdir($oldDir);\n\t}", "public function uultra_reload_user_modules_membership()\r\n\t{\r\n\t\t$package_id = $_POST[\"package_id\"];\t\t\r\n\t\t$modules = $this->uultra_get_modules_for_membership($package_id);\t\t\t\r\n\t\t\r\n\t\t$html = '';\r\n\t\tforeach($modules as $key => $module)\r\n\t\t{\r\n\t\t\t$checked = '';\t\t\t\r\n\t\t\t\r\n\t\t\tif ($this->check_if_disallowed_array_membership($key, $package_id))\r\n\t\t\t{\r\n\t\t\t\t$checked = 'checked=\"checked\"';\r\n\t\t\t}\t\t\t\t\r\n\t\t\t\r\n\t\t\t$html .= '<li class=\"uultra-profile-widget rounded\" id=\"'.$key.'\"><input name=\"uultra-modules[]\" type=\"checkbox\" value=\"'.$key.'\" class=\"uultra-my-modules-checked\" '.$checked.'/><label for=\"checkbox1\"><span></span>'.$module[\"title\"].'</label></li>';\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\techo $html;\r\n\t\tdie();\r\n\t\t\r\n\t}", "function _versioncontrol_git_log_update_repository(&$repository) {\n $root = escapeshellcmd($repository['root']);\n $chdir_ok = @chdir($root); // Set working directory to root.\n if ($chdir_ok === FALSE) {\n return FALSE;\n }\n if ($repository['git_specific']['locked'] == TRUE) {\n drupal_set_message(t('This repository is locked, there is already a fetch in progress. If this is not the case, press the clear lock button.'), 'error');\n return FALSE;\n }\n db_query('UPDATE {versioncontrol_git_repositories}\n SET locked = 1 WHERE repo_id = %d', $repository['repo_id']);\n\n // Get the list of current branches from Git.\n $branch_list = _versioncontrol_git_log_get_branches();\n $add_branch_label = array(\n 'name' => '', //filled later\n 'type' => VERSIONCONTROL_OPERATION_BRANCH,\n 'action' => VERSIONCONTROL_ACTION_MODIFIED\n );\n $branches = array();\n foreach ($branch_list as $branch_name) {\n $add_branch_label['name'] = $branch_name;\n $label_ret = versioncontrol_ensure_label($repository, $add_branch_label);\n $branches[$branch_name] = $label_ret;\n }\n //jpetso and me (corni) came to the conclusion that we will not delete branches.\n // TODO: revisit this!\n // Record new commits.\n $constraints = array(\n 'vcs' => array('git'),\n 'repo_ids' => array($repository['repo_id']),\n 'types' => array(VERSIONCONTROL_OPERATION_COMMIT),\n 'branches' => array() // used in the loop\n );\n $branches_per_commit = array();\n $existing_revs = array();\n // Get the existing revisions from the cache.\n $cache_object = cache_get('versioncontrol_git_rev_cache');\n // Check wether the cache object exists or not.\n if (is_object($cache_object)) {\n $existing_revs = $cache_object->data;\n }\n // Get the list of current branches from Git.\n // Generate the range per branch with which git shall be called.\n foreach ($branches as $branch_name => $label) {\n if (is_object($cache_object)) {\n // We get all commits we have in this branch to not process them later.\n $constraints['branches'] = array($branch_name);\n $latest_commit_date = 0;\n $commit_op = versioncontrol_get_operations($constraints);\n $latest_commit = FALSE;\n foreach ($commit_op as $vc_op_id => $c_op) {\n if ($latest_commit_date < $c_op['date']) {\n $latest_commit = $c_op['revision'];\n $latest_commit_date = $c_op['date'];\n $existing_revs[$branch_name][$latest_commit] = TRUE;\n }\n }\n }\n // No way to free the damned mysql result!!\n unset($commit_op);\n\n $commits_in_branch = _versioncontrol_git_log_get_commits_in_branch($repository, escapeshellarg($branch_name));\n foreach ($commits_in_branch as $i => $commit) {\n if (!isset($existing_revs[$branch_name][$commit])) {\n if (!isset($branches_per_commit[$commit]) || !is_array($branches_per_commit[$commit])) {\n $branches_per_commit[$commit] = array($label);\n }\n else {\n $branches_per_commit[$commit][] = $label;\n }\n }\n }\n }\n // This uses an extra loop on purpose!\n // Process all commits on a per-branch base.\n foreach ($branches_per_commit as $revision => $branch) {\n // Update commits from Git.\n _versioncontrol_git_process_commits($repository, $revision, $branches_per_commit, $existing_revs);\n }\n // Check tags.\n $tags = _versioncontrol_git_log_get_tags(); //Now we have the current list of tags as array of strings.\n $constraints = array(\n 'vcs' => array('git'),\n 'repo_ids' => array($repository['repo_id']),\n 'types' => array(VERSIONCONTROL_OPERATION_TAG)\n );\n $existing_tag_ops = versioncontrol_get_operations($constraints);\n $existing_tags = array();\n foreach ($existing_tag_ops as $tag_op) {\n if (!in_array($tag_op['labels'][0]['name'], $existing_tags)) {\n $existing_tags[] = $tag_op['labels'][0]['name'];\n }\n }\n // Deleting tags is *not* supported. Read the manual if you want to know why...\n // Check for new tags.\n $new_tags = array_diff($tags, $existing_tags);\n if (!empty($new_tags)) {\n _versioncontrol_git_process_tags($repository, $new_tags);\n }\n\n // Update repository updated field. Displayed on administration interface for documentation purposes.\n $repository['git_specific']['updated'] = time();\n db_query('UPDATE {versioncontrol_git_repositories}\n SET updated = %d, locked = 0 WHERE repo_id = %d',\n $repository['git_specific']['updated'], $repository['repo_id']);\n\n // Write back the cache.\n cache_set('versioncontrol_git_rev_cache', $existing_revs);\n return TRUE;\n}", "public function Modules($modules){\r\n foreach($modules as $module ){\r\n $this->Module($module);\r\n }\r\n }", "function super_search_module_update()\n\t{\n\t\tif ( ! isset($_POST['run_update']) OR $_POST['run_update'] != 'y' )\n\t\t{\n\t\t\t$this->add_crumb(lang('update_super_search'));\n\t\t\t$this->cached_vars['form_url'] = $this->base . '&method=super_search_module_update';\n\t\t\treturn $this->ee_cp_view('update_module.html');\n\t\t}\n\n\t\trequire_once $this->addon_path.'upd.super_search.php';\n\n\t\t$U = new Super_search_upd();\n\n\t\tif ($U->update() !== TRUE)\n\t\t{\n\t\t\treturn ee()->functions->redirect($this->base . AMP . 'msg=update_failure');\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn ee()->functions->redirect($this->base . AMP . 'msg=update_successful');\n\t\t}\n\t}", "function update() {\n\t\t$CLI_url = escapeshellarg($this->URL);\n\n\t\t// Update LatestRev\n\t\tif($this->NeedsLatestRev) {\n\t\t\t$retVal = 0;\n\t\t\t$output = array();\n\t\t\texec(\"unset DYLD_LIBRARY_PATH && svn info --xml $CLI_url &> /dev/stdout\", $output, $retVal);\n\t\t\tif($retVal == 0 && preg_match(\"/\\<\\?xml/\", $output[0])) {\n\t\t\t\ttry {\n\t\t\t\t\t$info = new SimpleXMLElement(implode(\"\\n\", $output));\n\t\t\t\t\tif($info->entry->commit['revision']) {\n\t\t\t\t\t\t$this->LatestRevPacked = (string)$info->entry->commit['revision'];\n\t\t\t\t\t\t$this->LatestDatePacked = (string)$info->entry->commit->date;\n\t\t\t\t\t}\n\t\t\t\t} catch(Exception $e) {\n\t\t\t\t\tuser_error($e, E_USER_WARNING);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tuser_error(\"svn info failed \". $output, E_USER_WARNING);\n\t\t\t}\n\t\t}\n\n\t\t// Update ChildDirs\n\t\tif($this->NeedsChildDirs) {\n\t\t\t$retVal = 0;\n\t\t\t$output = array();\n\n\t\t\texec(\"unset DYLD_LIBRARY_PATH && svn ls --xml $CLI_url\", $output, $retVal);\n\t\t\tif($retVal == 0) {\n\t\t\t\t$subdirs = new SimpleXMLElement(implode(\"\\n\", $output));\n\t\t\t\t\n\t\t\t\tif($subdirs) {\n\t\t\t\t\t$subdirInfo = array();\n\t\t\t\t\tforeach($subdirs->xpath('//entry') as $entry) {\n\t\t\t\t\t\t$name = (string)$entry->name;\n\t\t\t\t\t\t$date = (string)$entry->commit->date;\n\t\t\t\t\t\t$rev = (string)$entry->commit['revision'];\n\t\t\t\t\t\n\t\t\t\t\t\t$subdirInfo[$name] = array('date' => $date, 'rev' => $rev);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this->ChildDirsPacked = serialize($subdirInfo);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tuser_error(\"svn info failed \". $output, E_USER_WARNING);\n\t\t\t}\n\t\t}\n\n\t\t$this->write();\n\t\t\n\t}", "public function updateRepositoryCount($extCount, $uid = 1)\n {\n $repository = $this->findByUid($uid);\n\n $repository->setLastUpdate(new \\DateTime());\n $repository->setExtensionCount((int)$extCount);\n\n $this->update($repository);\n }", "function gitUpdate()\n{\n \n $config = json_decode(file_get_contents(\"/app/config.json\"), true);\n\n $git = $config['git'];\n $remote = \"https://\" . $git['user'] . \":\" . $git['token'] . \"@github.com/\" . $git['git_dir'];\n exec(\"cd \" . $config['project_dir'] . \" && git init && git pull $remote \" . $git['branch']);\n exec(\"cd \" . $config['project_dir'] . \" && composer update\");\n}", "function drush_pm_updatestatus() {\n // We don't provide for other options here, so we supply an explicit path.\n drush_include_engine('update_info', 'drupal', NULL, DRUSH_BASE_PATH . '/commands/pm/update_info');\n\n // Get specific requests.\n $requests = pm_parse_arguments(func_get_args(), FALSE);\n\n // Get installed extensions and projects.\n $extensions = drush_get_extensions();\n $projects = drush_get_projects($extensions);\n\n // Parse out project name and version.\n $requests = pm_parse_project_version($requests, $projects);\n\n $update_info = _pm_get_update_info($projects);\n\n foreach ($extensions as $name => $extension) {\n // Add an item to $update_info for each enabled extension which was obtained\n // from cvs or git and its project is unknown (because of cvs_deploy or\n // git_deploy is not enabled).\n if (!isset($extension->info['project'])) {\n if ((isset($extension->vcs)) && ($extension->status)) {\n $update_info[$name] = array(\n 'name' => $name,\n 'label' => $extension->label,\n 'existing_version' => 'Unknown',\n 'status' => DRUSH_PM_REQUESTED_PROJECT_NOT_PACKAGED,\n 'status_msg' => dt('Project was not packaged by drupal.org but obtained from !vcs. You need to enable !vcs_deploy module', array('!vcs' => $extension->vcs)),\n );\n // The user may have requested to update a project matching this\n // extension. If it was by coincidence or error we don't mind as we've\n // already added an item to $update_info. Just clean up $requests.\n if (isset($requests[$name])) {\n unset($requests[$name]);\n }\n }\n }\n // Additionally if the extension name is distinct to the project name and\n // the user asked to update the extension, fix the request.\n elseif ((isset($requests[$name])) && ($extension->name != $extension->info['project'])) {\n $requests[$extension->info['project']] = $requests[$name];\n unset($requests[$name]);\n }\n }\n // If specific project updates were requested then remove releases for all\n // others.\n $requested = func_get_args();\n if (!empty($requested)) {\n foreach ($update_info as $name => $project) {\n if (!isset($requests[$name])) {\n unset($update_info[$name]);\n }\n }\n }\n // Add an item to $update_info for each request not present in $update_info.\n foreach ($requests as $name => $request) {\n if (!isset($update_info[$name])) {\n // Disabled projects.\n if ((isset($projects[$name])) && ($projects[$name]['status'] == 0)) {\n $update_info[$name] = array(\n 'name' => $name,\n 'label' => $projects[$name]['label'],\n 'existing_version' => $projects[$name]['version'],\n 'status' => DRUSH_PM_REQUESTED_PROJECT_NOT_UPDATEABLE,\n );\n unset($requests[$name]);\n }\n // At this point we are unable to find matching installed project.\n // It does not exist at all or it is misspelled,...\n else {\n $update_info[$name] = array(\n 'name' => $name,\n 'label' => $name,\n 'existing_version' => 'Unknown',\n 'status'=> DRUSH_PM_REQUESTED_PROJECT_NOT_FOUND,\n );\n }\n }\n }\n\n // If specific versions were requested, match the requested release.\n foreach ($requests as $name => $request) {\n if (!empty($request['version'])) {\n $release = pm_get_release($request, $update_info[$name]);\n if (!$release) {\n $update_info[$name]['status'] = DRUSH_PM_REQUESTED_VERSION_NOT_FOUND;\n }\n else if ($release['version'] == $update_info[$name]['existing_version']) {\n $update_info[$name]['status'] = DRUSH_PM_REQUESTED_CURRENT;\n }\n else {\n $update_info[$name]['status'] = DRUSH_PM_REQUESTED_UPDATE;\n }\n // Set the candidate version to the requested release.\n $update_info[$name]['candidate_version'] = $release['version'];\n }\n }\n // Process locks specified on the command line.\n $locked_list = drush_pm_update_lock($update_info, drush_get_option_list('lock'), drush_get_option_list('unlock'), drush_get_option('lock-message'));\n\n // Build project updatable messages, set candidate version and mark\n // 'updatable' in the project.\n foreach ($update_info as $key => $project) {\n switch($project['status']) {\n case DRUSH_PM_REQUESTED_UPDATE:\n $status = dt('Specified version available');\n $project['updateable'] = TRUE;\n break;\n case DRUSH_PM_REQUESTED_CURRENT:\n $status = dt('Specified version already installed');\n break;\n case DRUSH_PM_REQUESTED_PROJECT_NOT_PACKAGED:\n $status = $project['status_msg'];\n break;\n case DRUSH_PM_REQUESTED_VERSION_NOT_FOUND:\n $status = dt('Specified version not found');\n break;\n case DRUSH_PM_REQUESTED_PROJECT_NOT_FOUND:\n $status = dt('Specified project not found');\n break;\n case DRUSH_PM_REQUESTED_PROJECT_NOT_UPDATEABLE:\n $status = dt('Project has no enabled extensions and can\\'t be updated');\n break;\n default:\n // This can set $project['updateable'] and $project['candidate_version']\n $status = pm_update_filter($project);\n break;\n }\n\n if (isset($project['locked'])) {\n $status = $project['locked'] . \" ($status)\";\n }\n // Persist candidate_version in $update_info (plural).\n if (empty($project['candidate_version'])) {\n $update_info[$key]['candidate_version'] = $project['existing_version']; // Default to no change\n }\n else {\n $update_info[$key]['candidate_version'] = $project['candidate_version'];\n }\n $update_info[$key]['status_msg'] = $status;\n if (isset($project['updateable'])) {\n $update_info[$key]['updateable'] = $project['updateable'];\n }\n }\n\n // Only list projects that have updates available. Use pm-list if you want more info.\n $updateable = pm_project_filter($update_info, drush_get_option('security-only'));\n return $updateable;\n}", "function pm_update_packages($update_info, $tmpfile) {\n $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT');\n\n $print = '';\n $status = array();\n foreach($update_info as $project) {\n $print .= $project['title'] . \" [\" . $project['name'] . '-' . $project['candidate_version'] . \"], \";\n $status[$project['status']] = $project['status'];\n }\n // We print the list of the projects that need to be updated.\n if (isset($status[UPDATE_NOT_SECURE])) {\n if (isset($status[UPDATE_NOT_CURRENT])) {\n $title = (dt('Security and code updates will be made to the following projects:'));\n }\n else {\n $title = (dt('Security updates will be made to the following projects:'));\n }\n }\n else {\n $title = (dt('Code updates will be made to the following projects:'));\n }\n $print = \"$title \" . (substr($print, 0, strlen($print)-2));\n drush_print($print);\n file_put_contents($tmpfile, \"\\n\\n$print\\n\\n\", FILE_APPEND);\n\n // Print the release notes for projects to be updated.\n if (drush_get_option('notes', FALSE)) {\n drush_print('Obtaining release notes for above projects...');\n $requests = pm_parse_project_version(array_keys($update_info));\n release_info_print_releasenotes($requests, TRUE, $tmpfile);\n }\n\n // We print some warnings before the user confirms the update.\n drush_print();\n if (drush_get_option('no-backup', FALSE)) {\n drush_print(dt(\"Note: You have selected to not store backups.\"));\n }\n else {\n drush_print(dt(\"Note: A backup of your project will be stored to backups directory if it is not managed by a supported version control system.\"));\n drush_print(dt('Note: If you have made any modifications to any file that belongs to one of these projects, you will have to migrate those modifications after updating.'));\n }\n if(!drush_confirm(dt('Do you really want to continue with the update process?'))) {\n return drush_user_abort();\n }\n\n // Now we start the actual updating.\n foreach($update_info as $project) {\n if (empty($project['path'])) {\n return drush_set_error('DRUSH_PM_UPDATING_NO_PROJECT_PATH', dt('The !project project path is not available, perhaps the !type is enabled but has been deleted from disk.', array('!project' => $project['name'], '!type' => $project['project_type'])));\n }\n drush_log(dt('Starting to update !project code at !dir...', array('!project' => $project['title'], '!dir' => $project['path'])));\n // Define and check the full path to project directory and base (parent) directory.\n $project['full_project_path'] = $drupal_root . '/' . $project['path'];\n if (stripos($project['path'], $project['project_type']) === FALSE || !is_dir($project['full_project_path'])) {\n return drush_set_error('DRUSH_PM_UPDATING_PATH_NOT_FOUND', dt('The !project directory could not be found within the !types directory at !full_project_path, perhaps the project is enabled but has been deleted from disk.', array('!project' => $project['name'], '!type' => $project['project_type'], '!full_project_path' => $project['full_project_path'])));\n }\n if (!$version_control = drush_pm_include_version_control($project['full_project_path'])) {\n return FALSE;\n }\n $project['base_project_path'] = dirname($project['full_project_path']);\n // Check we have a version control system, and it clears its pre-flight.\n if (!$version_control->pre_update($project)) {\n return FALSE;\n }\n\n // Package handlers want the name of the directory in project_dir.\n // It may be different to the project name for pm-download.\n // Perhaps we want here filename($project['full_project_path']).\n $project['project_dir'] = $project['name'];\n\n // Run update on one project.\n if (pm_update_project($project, $version_control) === FALSE) {\n return FALSE;\n }\n pm_update_complete($project, $version_control);\n }\n\n return TRUE;\n}", "public function multiple_update_package()\n\t{\n\t\t$this->breadcrumbs->unshift(2, 'Service And Package', 'master/package');\n\t\t$this->breadcrumbs->unshift(3, 'Update Package', \"master/getpackage\");\n\n\t\t$this->page_title->push('Master', 'Update Package');\n\n\t\t$this->data = array(\n\t\t\t'title' => \"Update Package\",\n\t\t\t'breadcrumb' => $this->breadcrumbs->show(),\n\t\t\t'page_title' => $this->page_title->show(),\n\t\t\t'js' => $this->load->get_js_files(),\n\t\t\t'rooms' => $this->package->getRoom()\n\t\t);\n\t\t$this->template->view('multiple_update_package', $this->data);\n\t}", "function &getSubModules()\n{\n if(count($this->SubModules) == 0){\n $this->loadSubModules();\n }\n return $this->SubModules;\n}", "public function reload()\n {\n // Clear arrays\n $this->modules = [];\n $this->installedModules = [];\n $this->uninstalledModules = [];\n\n // Reload installation repository\n $this->installationRepository->reload();\n\n // Find all modules\n $found = [];\n\n foreach ($this->dirs as $dir)\n {\n $found = array_merge($found, glob($dir . '/' . ModuleContract::METAFILE));\n }\n\n // Create modules\n foreach ($found as $pathToMetaFile)\n {\n // Create module\n $module = $this->moduleFactory->createModuleInstance($pathToMetaFile);\n\n // Get module name\n $moduleName = $module->getName();\n\n // Do we already have this module with the same name ?\n if (isset($this->modules[$moduleName]))\n {\n throw new ModuleAlreadyExistsException(\"Module [$moduleName] already exists.\");\n continue;\n }\n\n // Add module to arrays\n $this->modules[$moduleName] = $module;\n\n if ($this->installationRepository->isInstalled($moduleName))\n {\n $this->installedModules[$moduleName] = $module;\n }\n else\n {\n $this->uninstalledModules[$moduleName] = $module;\n }\n }\n\n return $this;\n }", "public function updateRevisionAll()\n {\n foreach (get_class_methods(get_class($this)) as $method) {\n if (stripos($method, 'updateRevision') !== false && $method != __FUNCTION__) {\n $this->$method();\n }\n }\n }", "public function update(Group $root);", "function spyropress_builder_render_modules( $display_core = false ) {\n global $spyropress_builder;\n $sort = $spyropress_builder->modules->get_modules();\n \n if( empty( $sort ) ) return;\n \n $content = '';\n \n // Sorting\n usort( $sort, 'builder_module_name_sort' );\n $done = array();\n\n foreach ( $sort as $module ) {\n if ( $display_core && $module->is_core ) {\n $module_idbase = $module->id_base;\n if ( in_array( $module_idbase, $done, true ) )\n continue;\n\n $done[] = $module_idbase;\n $widget_obj = $module;\n $class = get_class( $widget_obj );\n\n /** Generate HTML **/\n $content .= sprintf( '\n <li class=\"module-item\">\n <a class=\"builder-module-insert\" href=\"#\" data-module-type=\"%1$s\">\n <span class=\"module-icon-widget\"></span>\n <span class=\"module-item-body\">\n <strong class=\"module-item-title\">%2$s</strong>\n <span class=\"module-item-description\">%3$s</span>\n </span>\n </a>\n </li>', $class, $widget_obj->name, esc_html( $widget_obj->widget_options['description'] )\n );\n }\n elseif ( ! $display_core && ! $module->is_core ) {\n $module_idbase = $module->id_base;\n if ( in_array( $module_idbase, $done, true ) )\n continue;\n\n $done[] = $module_idbase;\n $widget_obj = $module;\n $class = get_class( $widget_obj );\n\n /** Generate HTML **/\n $content .= sprintf( '\n <li class=\"module-item\">\n <a class=\"builder-module-insert\" href=\"#\" data-module-type=\"%1$s\">\n <span class=\"module-icon-widget\"></span>\n <span class=\"module-item-body\">\n <strong class=\"module-item-title\">%2$s</strong>\n <span class=\"module-item-description\">%3$s</span>\n </span>\n </a>\n </li>', $class, $widget_obj->name, esc_html( $widget_obj->widget_options['description'] )\n );\n }\n }\n\n echo tomato_html( $content );\n}", "public function update() {\n\t\t$webhook_secret = $this->config->item ( 'github_webhook_secret' );\n\t\t$client_id = $this->config->item ( 'github_client_id' );\n\t\t$client_secret = $this->config->item ( 'github_client_secret' );\n\t\t\n\t\tif (! isset ( $_SERVER ['HTTP_X_HUB_SIGNATURE'] )) {\n\t\t\tthrow new \\Exception ( \"HTTP header 'X-Hub-Signature' is missing.\" );\n\t\t} elseif (! extension_loaded ( 'hash' )) {\n\t\t\tthrow new \\Exception ( \"Missing 'hash' extension to check the secret code validity.\" );\n\t\t}\n\t\t\n\t\tlist ( $algo, $hash ) = explode ( '=', $_SERVER ['HTTP_X_HUB_SIGNATURE'], 2 ) + array (\n\t\t\t\t'',\n\t\t\t\t'' \n\t\t);\n\t\tif (! in_array ( $algo, hash_algos (), TRUE )) {\n\t\t\tthrow new \\Exception ( \"Hash algorithm '$algo' is not supported.\" );\n\t\t}\n\t\t$rawPost = file_get_contents ( 'php://input' );\n\t\tif ($hash !== hash_hmac ( $algo, $rawPost, $webhook_secret )) {\n\t\t\tthrow new \\Exception ( 'Hook secret does not match.' );\n\t\t}\n\t\t\n\t\t$url = \"https://api.github.com/users/UoLCompSoc/repos?per_page=10&client_id=\" . $client_id . \"&client_secret=\" . $client_secret;\n\t\t\n\t\t$decoded = json_decode ( $this->_getContent ( $url ) );\n\t\t\n\t\t$github_data = array ();\n\t\t\n\t\tforeach ( $decoded as $repo ) {\n\t\t\tif ($repo->fork === TRUE) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$collaborators = json_decode ( $this->_getContent ( $repo->contributors_url ) );\n\t\t\t$repo->collaborator_count = sizeof ( $collaborators );\n\t\t\t\n\t\t\tarray_push ( $github_data, $repo );\n\t\t}\n\t\t\n\t\t$filepath = APPPATH . 'cache/repocache.json';\n\t\t\n\t\tif (! write_file ( $filepath, json_encode ( $github_data ), 'w' )) {\n\t\t\tlog_message ( 'error', 'Cannot write to github cache file at ' . $filepath );\n\t\t}\n\t\t\n\t\t// $this->load->view ( 'admin' );\n\t}", "public function update($module = null)\n {\n $this->_bootstrap();\n Mage::app()->setUpdateMode(true);\n\n $resources = Mage::getConfig()->getNode('global/resources')->children();\n $afterApplyUpdates = array();\n foreach ($resources as $resName => $resource) {\n if (!$resource->setup) {\n continue;\n }\n if (!is_null($module) && $resource->setup->module != $module) {\n continue;\n }\n \n $className = 'Mage_Core_Model_Resource_Setup';\n if (isset($resource->setup->class)) {\n $className = $resource->setup->getClassName();\n }\n $this->_response->appendContent(\n \"Running {$className}->applyUpdates()\",\n array('color' => array('white'))\n );\n $setupClass = new $className($resName);\n $setupClass->applyUpdates();\n if ($setupClass->getCallAfterApplyAllUpdates()) {\n $afterApplyUpdates[] = $setupClass;\n }\n }\n\n foreach ($afterApplyUpdates as $setupClass) {\n $setupClass->afterApplyAllUpdates();\n }\n\n Mage::app()->setUpdateMode(false);\n $this->_response->appendContent(\n \"Core Resources updated successfully\",\n array('color' => array('green'))\n );\n }", "function updateSubpagesContent() {\n try {\n if(DB::executeFirstCell(\"SELECT COUNT(*) AS count FROM \" . TABLE_PREFIX . \"modules WHERE name='notebooks'\")) {\n try {\n $notebook_pages_table = TABLE_PREFIX . 'notebook_pages';\n $content_backup_table = TABLE_PREFIX . 'content_backup';\n\n DB::beginWork('Updating subpages @ ' . __CLASS__);\n\n $rows = DB::execute(\"SELECT id, body FROM $notebook_pages_table WHERE parent_type = 'NotebookPage' AND body != '' AND body IS NOT NULL\");\n if($rows) {\n foreach($rows as $row) {\n DB::execute(\"INSERT INTO $content_backup_table (parent_type, parent_id, body) VALUES ('NotebookPage', ?, ?)\", $row['id'], $row['body']);\n DB::execute(\"UPDATE $notebook_pages_table SET body = ? WHERE id = '$row[id]'\", $this->updateHtmlContent($row['body']));\n } // foreach\n } // if\n\n DB::commit('Subpages updated @ ' . __CLASS__);\n } catch(Exception $e) {\n DB::rollback('Failed to update subpages @ ' . __CLASS__);\n return $e->getMessage();\n } // try\n } // if\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }", "public function setModuleSubNavs($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::MESSAGE, \\Clarifai\\Api\\ModuleVersion\\ModuleSubNav::class);\n $this->module_sub_navs = $arr;\n\n return $this;\n }", "function runUpdate($repo)\n{\n $updNoodle = new Noodle();\n $updNoodle->noodleID = 17;\n $updNoodle->brand = 'FLAVOURS OF THE SUN';\n $updNoodle->flavour = 'COSMIC DUST';\n $updNoodle->instant = 1;\n $updNoodle->nationality = 'OUT OF THIS WORLD';\n $repo->update($updNoodle);\n}", "function updateSourceModule() {\n try {\n $commits_table = TABLE_PREFIX . 'source_commits';\n $paths_table = TABLE_PREFIX . 'source_paths';\n $repositories_table = TABLE_PREFIX . 'source_repositories';\n $project_objects_table = TABLE_PREFIX . 'project_objects';\n $source_users_table = TABLE_PREFIX . 'source_users';\n $activity_logs_table = TABLE_PREFIX . 'activity_logs';\n\n $engine = defined('DB_CAN_TRANSACT') && DB_CAN_TRANSACT ? 'InnoDB' : 'MyISAM';\n if(DB::executeFirstCell(\"SELECT COUNT(*) AS count FROM \" . TABLE_PREFIX . \"modules WHERE name='source'\")) {\n DB::execute(\"CREATE TABLE $commits_table (\n id int(10) unsigned NOT NULL AUTO_INCREMENT,\n name varchar(255) DEFAULT NULL,\n type varchar(25) DEFAULT NULL,\n revision_number int(11) unsigned DEFAULT '0',\n repository_id int(11) unsigned DEFAULT '0',\n message_title text,\n message_body text,\n authored_on datetime DEFAULT NULL,\n authored_by_name varchar(100) DEFAULT NULL,\n authored_by_email varchar(100) DEFAULT NULL,\n commited_on datetime DEFAULT NULL,\n commited_by_name varchar(100) DEFAULT NULL,\n commited_by_email varchar(100) DEFAULT NULL,\n diff text,\n PRIMARY KEY (id),\n KEY repository_id (repository_id),\n KEY commited_on (commited_on)\n ) ENGINE=$engine DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci\");\n\n DB::execute(\"CREATE TABLE $paths_table (\n id int(10) unsigned NOT NULL AUTO_INCREMENT,\n commit_id int(11) unsigned DEFAULT '0',\n is_dir tinyint(1) unsigned NOT NULL DEFAULT '0',\n path varchar(255) DEFAULT NULL,\n action varchar(1) DEFAULT NULL,\n PRIMARY KEY (id),\n KEY commit_id (commit_id)\n ) ENGINE=$engine DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci\");\n\n DB::execute(\"CREATE TABLE $repositories_table (\n id int(10) unsigned NOT NULL AUTO_INCREMENT,\n name varchar(255) DEFAULT NULL,\n type varchar(25) DEFAULT NULL,\n created_on datetime DEFAULT NULL,\n created_by_id int(10) unsigned DEFAULT '0',\n created_by_name varchar(100) DEFAULT NULL,\n created_by_email varchar(150) DEFAULT NULL,\n updated_on datetime DEFAULT NULL,\n updated_by_id int(10) unsigned DEFAULT '0',\n updated_by_name varchar(100) DEFAULT NULL,\n updated_by_email varchar(150) DEFAULT NULL,\n repository_path_url varchar(255) DEFAULT NULL,\n username varchar(255) DEFAULT NULL,\n password varchar(255) DEFAULT NULL,\n update_type int(3) DEFAULT '0',\n graph text,\n PRIMARY KEY (id)\n ) ENGINE=$engine DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci\");\n\n $repositories_link = array();\n $repositories = DB::execute(\"SELECT * FROM $project_objects_table WHERE type = 'Repository'\");\n if (is_foreachable($repositories)) {\n foreach ($repositories as $repository) {\n //insert new source repository\n DB::execute(\"INSERT INTO $repositories_table (name,type,created_on,created_by_id,created_by_name,created_by_email,updated_on,updated_by_id,updated_by_name,updated_by_email,\n repository_path_url,username,password,update_type,graph) VALUES (?, 'SvnRepository', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\",\n $repository['name'],\n $repository['created_on'],\n $repository['created_by_id'],\n $repository['created_by_name'],\n $repository['created_by_email'],\n $repository['updated_on'],\n $repository['updated_by_id'],\n $repository['updated_by_name'],\n $repository['updated_by_email'],\n $repository['text_field_1'],\n $repository['varchar_field_1'],\n $repository['varchar_field_2'],\n $repository['integer_field_2'],\n $repository['text_field_2']\n );\n\n // Update project object repository\n $last_insert_id = DB::lastInsertId();\n DB::execute(\"UPDATE $project_objects_table SET type = 'ProjectSourceRepository', parent_id = ? WHERE id = ?\", $last_insert_id, $repository['id']);\n\n // Update source user links\n DB::execute(\"UPDATE $source_users_table SET repository_id = ? WHERE repository_id = ?\", $last_insert_id, $repository['id']);\n } //foreach\n } //if\n\n\n if (extension_loaded('svn')) {\n $svn_type = 'extension';\n } elseif (extension_loaded('xml') && function_exists('xml_parser_create')) {\n $svn_type = 'exec';\n } else {\n $svn_type = 'none';\n } // if\n\n // Update configuration options\n DB::execute('INSERT INTO ' . TABLE_PREFIX . 'config_options (name, module, value) VALUES (?, ?, ?), (?, ?, ?)',\n 'source_svn_type', 'source', serialize($svn_type),\n 'source_mercurial_path', 'source', serialize('/usr/bin/')\n );\n } //if\n // Delete all commits from project object\n DB::execute(\"DELETE FROM $project_objects_table WHERE type = 'Commit'\");\n\n // Delete all activity logs\n DB::execute(\"DELETE FROM $activity_logs_table WHERE type = 'RepositoryUpdateActivityLog'\");\n\n //delete unnecessary configuration options\n DB::execute(\"DELETE FROM \" . TABLE_PREFIX . \"config_options WHERE name = 'source_svn_trust_server_cert' OR name = 'source_svn_use_output_redirect'\");\n\n } catch (Exception $e) {\n return $e->getMessage();\n } //try\n\n return true;\n }", "public function commitChanges(OutputInterface $output, $modules) {\n\t\t$this->log($output, 'Committing translations to git');\n\t\t\n\t\tforeach($modules as $module) {\n\t\t\t$repo = $module->getRepository();\n\n\t\t\t// Add all changes\n\t\t\t$jsPath = $module->getJSLangDirectory();\n\t\t\t$langPath = $module->getLangDirectory();\n\t\t\tforeach(array_merge((array)$jsPath, (array)$langPath) as $path) {\n\t\t\t\tif(is_dir($path)) {\n\t\t\t\t\t$repo->run(\"add\", array($path . \"/*\"));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Commit changes if any exist\n\t\t\t$status = $repo->run(\"status\");\n\t\t\tif(stripos($status, 'Changes to be committed:')) {\n\t\t\t\t$this->log($output, \"Comitting changes for module \" . $module->getName());\n\t\t\t\t$repo->run(\"commit\", array(\"-m\", \"Update translations\"));\n\t\t\t}\n\n\t\t\t// Do push if selected\n\t\t\tif($this->push) {\n\t\t\t\t$this->log($output, \"Pushing upstream for module \" . $module->getName());\n\t\t\t\t$repo->run(\"push\", array(\"origin\"));\n\t\t\t}\n\t\t}\n\t}", "function updateFirstLevelPageVersions() {\n try {\n if(DB::executeFirstCell(\"SELECT COUNT(*) AS count FROM \" . TABLE_PREFIX . \"modules WHERE name='notebooks'\")) {\n try {\n $pages_table = TABLE_PREFIX . 'notebook_pages';\n $page_versions_table = TABLE_PREFIX . 'notebook_page_versions';\n $content_backup_table = TABLE_PREFIX . 'content_backup';\n\n DB::beginWork('Updating first level notebook page versions @ ' . __CLASS__);\n\n $rows = DB::execute(\"SELECT $page_versions_table.id, $page_versions_table.body FROM $pages_table, $page_versions_table WHERE $pages_table.id = $page_versions_table.notebook_page_id AND $pages_table.parent_type = 'Notebook'\");\n if($rows) {\n foreach($rows as $row) {\n DB::execute(\"INSERT INTO $content_backup_table (parent_type, parent_id, body) VALUES ('NotebookPageVersion', ?, ?)\", $row['id'], $row['body']);\n DB::execute(\"UPDATE $page_versions_table SET body = ? WHERE id = '$row[id]'\", $this->updateHtmlContent($row['body']));\n } // foreach\n } // if\n\n DB::commit('First level notebook page versions updated @ ' . __CLASS__);\n } catch(Exception $e) {\n DB::rollback('Failed to update first level notebook page versions @ ' . __CLASS__);\n return $e->getMessage();\n } // try\n } // if\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }", "function _pm_update_core(&$project, $tmpfile) {\n $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT');\n\n drush_print(dt('Code updates will be made to drupal core.'));\n drush_print(dt(\"WARNING: Updating core will discard any modifications made to Drupal core files, most noteworthy among these are .htaccess and robots.txt. If you have made any modifications to these files, please back them up before updating so that you can re-create your modifications in the updated version of the file.\"));\n drush_print(dt(\"Note: Updating core can potentially break your site. It is NOT recommended to update production sites without prior testing.\"));\n drush_print();\n if (drush_get_option('notes', FALSE)) {\n drush_print('Obtaining release notes for above projects...');\n $requests = pm_parse_project_version(array('drupal'));\n release_info_print_releasenotes($requests, TRUE, $tmpfile);\n }\n if(!drush_confirm(dt('Do you really want to continue?'))) {\n drush_print(dt('Rolling back all changes. Run again with --no-core to update modules only.'));\n return drush_user_abort();\n }\n\n // We need write permission on $drupal_root.\n if (!is_writable($drupal_root)) {\n return drush_set_error('DRUSH_PATH_NO_WRITABLE', dt('Drupal root path is not writable.'));\n }\n\n // Create a directory 'core' if it does not already exist.\n $project['path'] = 'drupal-' . $project['candidate_version'];\n $project['full_project_path'] = $drupal_root . '/' . $project['path'];\n if (!is_dir($project['full_project_path'])) {\n drush_mkdir($project['full_project_path']);\n }\n\n // Create a list of directories to exclude from the update process.\n $skip_list = array('sites', $project['path']);\n // Add non-writable directories: we can't move them around.\n // We will also use $items_to_test later for $version_control check.\n $items_to_test = drush_scan_directory($drupal_root, '/.*/', array_merge(array('.', '..'), $skip_list), 0, FALSE, 'basename', 0, TRUE);\n foreach (array_keys($items_to_test) as $item) {\n if (is_dir($item) && !is_writable($item)) {\n $skip_list[] = $item;\n unset($items_to_test[$item]);\n }\n elseif (is_link($item)) {\n $skip_list[] = $item;\n unset($items_to_test[$item]);\n }\n }\n $project['skip_list'] = $skip_list;\n\n // Move all files and folders in $drupal_root to the new 'core' directory\n // except for the items in the skip list\n _pm_update_move_files($drupal_root, $project['full_project_path'], $project['skip_list']);\n\n // Set a context variable to indicate that rollback should reverse\n // the _pm_update_move_files above.\n drush_set_context('DRUSH_PM_DRUPAL_CORE', $project);\n\n if (!$version_control = drush_pm_include_version_control($project['full_project_path'])) {\n return FALSE;\n }\n\n $project['base_project_path'] = dirname($project['full_project_path']);\n // Check we have a version control system, and it clears its pre-flight.\n if (!$version_control->pre_update($project, $items_to_test)) {\n return FALSE;\n }\n\n // Package handlers want the project directory in project_dir.\n $project['project_dir'] = $project['path'];\n\n // Update core.\n if (pm_update_project($project, $version_control) === FALSE) {\n return FALSE;\n }\n\n // Take the updated files in the 'core' directory that have been updated,\n // and move all except for the items in the skip list back to\n // the drupal root\n _pm_update_move_files($project['full_project_path'], $drupal_root, $project['skip_list']);\n drush_delete_dir($project['full_project_path']);\n\n // Version control engines expect full_project_path to exist and be accurate.\n $project['full_project_path'] = $project['base_project_path'];\n\n // If there is a backup target, then find items\n // in the backup target that do not exist at the\n // drupal root. These are to be moved back.\n if (array_key_exists('backup_target', $project)) {\n _pm_update_move_files($project['backup_target'], $drupal_root, $project['skip_list'], FALSE);\n _pm_update_move_files($project['backup_target'] . '/profiles', $drupal_root . '/profiles', array('default'), FALSE);\n }\n\n pm_update_complete($project, $version_control);\n\n return TRUE;\n}", "public function actionChildUpdate() {\n $code = $_GET['code'];\n $provinceCode = $_GET['provinceCode'];\n $cityCode = $_GET['cityCode'];\n $ppkCode = $_GET['ppkCode'];\n $models = PackageAccount::model()->findAllByAttributes(array('package_code' => \"$code\"));\n if ($models) {\n foreach ($models as $model) {\n $model->province_code = $provinceCode;\n $model->city_code = $cityCode;\n $model->ppk_code = $ppkCode;\n $model->update();\n }\n }\n }", "public function fbc_module_update()\n\t{\n\t\tif ( ! isset($_POST['run_update']) OR $_POST['run_update'] != 'y')\n\t\t{\n\t\t\t$this->add_crumb(lang('update_fbc_module'));\n\t\t\t$this->cached_vars['form_url'] = $this->cached_vars['base_uri'] . '&method=fbc_module_update';\n\t\t\treturn $this->ee_cp_view('update_module.html');\n\t\t}\n\n\t\trequire_once $this->addon_path.'upd.fbc.php';\n\n\t\t$U = new Fbc_upd();\n\n\t\tif ($U->update() !== TRUE)\n\t\t{\n\t\t\treturn ee()->functions->redirect($this->base . AMP . 'msg=update_failure');\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn ee()->functions->redirect($this->base . AMP . 'msg=update_successful');\n\t\t}\n\t}", "public function setModules()\n\t{\n \t//Zend_Registry::set('modules', $modules->getList());\n\t}", "function dataUpdateAccessRights($p_id, $p_module_ids)\n {\n $result_update = false;\n \n $sql = 'UPDATE user_access SET ';\n $sql .= 'moduleids = ? ';\n $sql .= 'WHERE fkuserid = ? ';\n\n $paramtype = 'si';\n \n $paramdata = array(\n 'moduleids' => $p_module_ids,\n 'fkuserid' => $p_id\n );\n \n parent::stmtPrepare($sql); \n\n parent::stmtSetParamTypeString($paramtype);\n parent::stmtSetParamData($paramdata);\n parent::stmtBindParam();\n \n parent::stmtExecute();\n $result = parent::stmtGetTotalAffectedRows();\n \n $result_update = '1';\n\n parent::stmtReset(); \n parent::stmtClose(); \n \n return $result_update; \n }", "protected static function updateNodePackages()\n {\n static::updatePackages(...func_get_args());\n }", "public function setModules($modules);", "public function updated(Module $module)\n {\n //\n }", "function updateModules() {\n $modules_table = TABLE_PREFIX . 'modules';\n\n try {\n DB::execute(\"ALTER TABLE $modules_table ADD is_enabled tinyint(1) NOT NULL DEFAULT '0' AFTER position\");\n DB::execute(\"ALTER TABLE $modules_table DROP is_system\");\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }", "public function runModules() {\n foreach ($this->modules as $module) {\n $this->runModule($module);\n }\n }", "function update_module_specifics($db,$page_id=0,$module_info=0, $section_index)\r\n\t{\r\n\t\t$page_id = intval($page_id);\r\n\t\tif(!$this->isPageEditable($page_id) || !$page_id) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t//clear cache\r\n\t\tgeoCache::clearCache('modules');\r\n\t\t//clear page cache\r\n\t\tgeoCache::clearCache('pages');\r\n\t\tif (in_array($page_id,$this->extra_pages))\r\n\t\t{\r\n\t\t\t//this is an extra page, not a module\r\n\t\t\t$sql = \"UPDATE \".geoTables::pages_table.\" SET `admin_label` = ? WHERE `page_id` = $page_id\";\r\n\t\t\t\r\n\t\t\t$result = $this->db->Execute($sql, array($module_info[\"admin_label\"]));\r\n\t\t\tif (!$result) {\r\n\t\t\t\ttrigger_error('ERROR SQL: Sql: '.$sql.' error: '.$this->db->ErrorMsg());\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t$sql = \"SELECT * FROM \".geoTables::pages_languages_table;\r\n\t\t\t$languages = $this->db->GetAll($sql);\r\n\t\t\tif ($languages === false) {\r\n\t\t\t\ttrigger_error('ERROR SQL: Sql: '.$sql.' error: '.$this->db->ErrorMsg());\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tforeach ($languages as $lang) {\r\n\t\t\t\t$reg = new geoRegistry('extra_pages', \"$page_id:{$lang['language_id']}\");\r\n\t\t\t\t//do not encode when inserting to db, registry does it for us\r\n\t\t\t\t$extra_page_txt = trim($module_info['extra_page_text'.$lang['language_id']]);\r\n\t\t\t\tif ($reg->get('body_code') !== $extra_page_txt){\r\n\t\t\t\t\t//keep from re-saving if the text has not changed.\r\n\t\t\t\t\t$reg->set( 'body_code', $extra_page_txt);\r\n\t\t\t\t\t$reg->save();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn true; \r\n\t\t} else if (in_array($page_id,$this->title_mods)) {\r\n\t\t\t//this is a title module\r\n\t\t\t$sql = \"UPDATE \".geoTables::ad_configuration_table.\" SET `title_module_text` = ?\";\r\n\t\t\t$result = $this->db->Execute($sql, array(geoString::toDB($module_info[\"title_module_text\"])));\r\n\t\t\tif (!$result) {\r\n\t\t\t\ttrigger_error('ERROR SQL: Sql: '.$sql.' error: '.$this->db->ErrorMsg());\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\t$sql = \"UPDATE \".geoTables::pages_text_languages_table.\" SET text = ? WHERE `text_id` = 2462\";\r\n\t\t\tif ($this->debug_pages) echo $sql.\"<br>\\n\";\r\n\t\t\t$result = $this->db->Execute($sql, array(geoString::toDB($module_info[\"title_module_home_text\"])));\r\n\t\t\tif (!$result) {\r\n\t\t\t\ttrigger_error('ERROR SQL: Sql: '.$sql.' error: '.$this->db->ErrorMsg());\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t//this is a page, not a module\r\n\t\t\t$sql = \"UPDATE \".geoTables::pages_table.\" SET `admin_label` = ? WHERE `page_id` = $page_id\";\r\n\t\t\t\r\n\t\t\t$result = $this->db->Execute($sql, array($module_info[\"admin_label\"]));\r\n\t\t\tif (!$result) {\r\n\t\t\t\ttrigger_error('ERROR SQL: Sql: '.$sql.' error: '.$this->db->ErrorMsg());\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\treturn true;\r\n\t\t\t\r\n\t\t} else if (in_array($page_id,$this->cat_browse_options)) {\r\n\t\t\treturn $this->update_category_browse_options($page_id, $module_info);\r\n\t\t\t\r\n\t\t} else if ($page_id && $module_info) {\r\n\t\t\t//NOTE: logged in/out html specific stuff removed already.\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t//lets dynamically generate the sql query.\r\n\t\t\t$params = array();\r\n\t\t\t$set_vars = array();\r\n\t\t\t//list of fields not in the geodesic_pages database table.\r\n\t\t\t$skip_list = array ('flyer_maximum_image_width','flyer_maximum_image_height','sign_maximum_image_width','sign_maximum_image_height');\r\n\t\t\t//for fields where HTML is allowed, don't trim()\r\n\t\t\t$html_allowed = array('module_sub_category_nav_surrounding', 'module_sub_category_nav_prefix', 'module_sub_category_nav_separator');\r\n\t\t\tforeach ($module_info as $key => $value){\r\n\t\t\t\tif (!in_array($key, $skip_list)){\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(!in_array($key, $html_allowed)) {\r\n\t\t\t\t\t\t$value = trim($value);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$params[]=$value;\r\n\t\t\t\t\t$set_vars[]=\"`$key` = ?\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t//use the format 'update table_name set var_name1 = ?, var_name2 = ? where var_namex = ?' for the query, and then\r\n\t\t\t//pass execute an array of values. This way, we let sdo do input checking for us, and it might even\r\n\t\t\t//speed things up a bit. See sdo documentation for more info on using ? in queries.\r\n\t\t\t$sql = 'UPDATE '.geoTables::pages_table.' SET '.implode(',',$set_vars).' WHERE `page_id` = ?';\r\n\t\t\t$params[]=$page_id;\r\n\t\t\t\r\n\t\t\tif ($this->debug_pages){\r\n\t\t\t\techo $sql.\"<br>\\n params: <pre>\";\r\n\t\t\t\tvar_dump($params);\r\n\t\t\t\techo '</pre>';\r\n\t\t\t} \r\n\t\t\t//$params is the array we generated earlier that has all the values for the ?'s in the sql query.\r\n\t\t\t$result = $this->db->Execute($sql,$params);\r\n\t\t\tif (!$result)\r\n\t\t\t{\r\n\t\t\t\ttrigger_error('ERROR SQL: Sql: '.$sql.' error: '.$this->db->ErrorMsg());\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ($page_id == 70) {\r\n\t\t\t\t$sql = \"update \".$this->ad_configuration_table.\" set\r\n\t\t\t\t\tflyer_maximum_image_width = \".intval($module_info[\"flyer_maximum_image_width\"]).\",\r\n\t\t\t\t\tflyer_maximum_image_height = \".intval($module_info[\"flyer_maximum_image_height\"]);\r\n\t\t\t\t$result = $this->db->Execute($sql);\r\n\t\t\t\tif ($this->debug_pages) echo $sql.\"<br>\\n\";\r\n\t\t\t\tif (!$result)\r\n\t\t\t\t{\r\n\t\t\t\t\ttrigger_error('ERROR SQL: Sql: '.$sql.' error: '.$this->db->ErrorMsg());\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t} elseif ($page_id == 71) {\r\n\t\t\t\t$sql = \"update \".$this->ad_configuration_table.\" set\r\n\t\t\t\t\tsign_maximum_image_width = \".intval($module_info[\"sign_maximum_image_width\"]).\",\r\n\t\t\t\t\tsign_maximum_image_height = \".intval($module_info[\"sign_maximum_image_height\"]);\r\n\t\t\t\t$result = $this->db->Execute($sql);\r\n\t\t\t\tif (!$result) {\r\n\t\t\t\t\ttrigger_error('ERROR SQL: Sql: '.$sql.' error: '.$this->db->ErrorMsg());\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\t$this->error_message = $this->internal_error_message;\r\n\t\t\t//echo \"whatever\";\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function update_all_module_options($mod_name, $new_options) {\n if (is_array($new_options)) {\n $new_options = (object) $new_options;\n }\n $this->modules->$mod_name->options = $new_options;\n $this->$mod_name->module = $this->modules->$mod_name;\n return update_option($this->clientele_prefix . $mod_name . '_options', (array) $this->modules->$mod_name->options);\n }", "public function testModuleListChange() {\n // Set a value in the cache to prove caches are cleared.\n \\Drupal::service('cache.default')->set(__CLASS__, 'Test');\n\n // Ensure that modules are installed and uninstalled as expected prior to\n // running updates.\n $extension_config = $this->config('core.extension')->get();\n $this->assertArrayHasKey('page_cache', $extension_config['module']);\n $this->assertArrayNotHasKey('module_test', $extension_config['module']);\n\n $module_list = \\Drupal::moduleHandler()->getModuleList();\n $this->assertArrayHasKey('page_cache', $module_list);\n $this->assertArrayNotHasKey('module_test', $module_list);\n\n $namespaces = \\Drupal::getContainer()->getParameter('container.namespaces');\n $this->assertArrayHasKey('Drupal\\page_cache', $namespaces);\n $this->assertArrayNotHasKey('Drupal\\module_test', $namespaces);\n\n // Increment the schema version so that update_test_schema_update_8003()\n // runs.\n \\Drupal::state()->set('update_test_schema_version', 8003);\n $this->runUpdates();\n\n // Ensure that test running environment has been updated with the changes to\n // the module list.\n $extension_config = $this->config('core.extension')->get();\n $this->assertArrayNotHasKey('page_cache', $extension_config['module']);\n $this->assertArrayHasKey('module_test', $extension_config['module']);\n\n $module_list = \\Drupal::moduleHandler()->getModuleList();\n $this->assertArrayNotHasKey('page_cache', $module_list);\n $this->assertArrayHasKey('module_test', $module_list);\n\n $namespaces = \\Drupal::getContainer()->getParameter('container.namespaces');\n $this->assertArrayNotHasKey('Drupal\\page_cache', $namespaces);\n $this->assertArrayHasKey('Drupal\\module_test', $namespaces);\n\n // Ensure the test runners cache has been cleared.\n $this->assertFalse(\\Drupal::service('cache.default')->get(__CLASS__));\n }", "function module_upgrade () {\n \n // Make sure core is installed\n if (!module_core_installed()) {\n error_register('Please run the install script');\n return false;\n }\n foreach (module_list() as $module) {\n \n // Get current schema and code revisions\n $old_revision = module_get_schema_revision($module);\n $new_revision = module_get_code_revision($module);\n \n // Upgrade the module to the current revision\n $installer = $module . '_install';\n if (function_exists($installer)) {\n call_user_func($installer, $old_revision);\n }\n \n // Update the revision number in the database\n module_set_schema_revision($module, $new_revision);\n }\n return true;\n}", "public function gitCloneRepositories() {\n\t\t$count = 0;\n\n\t\t$packages = $this->Package->find('list');\n\t\tforeach ($packages as $id => $name) {\n\t\t\t$this->out(sprintf(__(\"* Downloading package %s\"), $name));\n\t\t\tif ($this->Package->setupRepository($id)); {\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\t\t$this->out(sprintf(__('* Downloaded %s of %s repositories'), $count, count($packages)));\n\t}", "public function update_extension(){}", "function upgrade_activity_modules($return) {\n\n global $CFG, $db;\n\n if (!$mods = get_list_of_plugins('mod') ) {\n error('No modules installed!');\n }\n\n $updated_modules = false;\n $strmodulesetup = get_string('modulesetup');\n\n foreach ($mods as $mod) {\n\n if ($mod == 'NEWMODULE') { // Someone has unzipped the template, ignore it\n continue;\n }\n\n $fullmod = $CFG->dirroot .'/mod/'. $mod;\n\n unset($module);\n\n if ( is_readable($fullmod .'/version.php')) {\n include_once($fullmod .'/version.php'); // defines $module with version etc\n } else {\n notify('Module '. $mod .': '. $fullmod .'/version.php was not readable');\n continue;\n }\n\n $oldupgrade = false;\n $newupgrade = false;\n if ( is_readable($fullmod .'/db/' . $CFG->dbtype . '.php')) {\n include_once($fullmod .'/db/' . $CFG->dbtype . '.php'); // defines old upgrading function\n $oldupgrade = true;\n }\n if ( is_readable($fullmod . '/db/upgrade.php')) {\n include_once($fullmod . '/db/upgrade.php'); // defines new upgrading function\n $newupgrade = true;\n }\n\n if (!isset($module)) {\n continue;\n }\n\n if (!empty($module->requires)) {\n if ($module->requires > $CFG->version) {\n $info = new object();\n $info->modulename = $mod;\n $info->moduleversion = $module->version;\n $info->currentmoodle = $CFG->version;\n $info->requiremoodle = $module->requires;\n if (!$updated_modules) {\n print_header($strmodulesetup, $strmodulesetup,\n build_navigation(array(array('name' => $strmodulesetup, 'link' => null, 'type' => 'misc'))), '',\n upgrade_get_javascript(), false, '&nbsp;', '&nbsp;');\n }\n upgrade_log_start();\n notify(get_string('modulerequirementsnotmet', 'error', $info));\n $updated_modules = true;\n continue;\n }\n }\n\n $module->name = $mod; // The name MUST match the directory\n\n include_once($fullmod.'/lib.php'); // defines upgrading and/or installing functions\n\n if ($currmodule = get_record('modules', 'name', $module->name)) {\n if ($currmodule->version == $module->version) {\n // do nothing\n } else if ($currmodule->version < $module->version) {\n /// If versions say that we need to upgrade but no upgrade files are available, notify and continue\n if (!$oldupgrade && !$newupgrade) {\n notify('Upgrade files ' . $mod . ': ' . $fullmod . '/db/' . $CFG->dbtype . '.php or ' .\n $fullmod . '/db/upgrade.php were not readable');\n continue;\n }\n if (!$updated_modules) {\n print_header($strmodulesetup, $strmodulesetup,\n build_navigation(array(array('name' => $strmodulesetup, 'link' => null, 'type' => 'misc'))), '',\n upgrade_get_javascript(), false, '&nbsp;', '&nbsp;');\n }\n upgrade_log_start();\n print_heading($module->name .' module needs upgrading');\n\n /// Run de old and new upgrade functions for the module\n $oldupgrade_function = $module->name . '_upgrade';\n $newupgrade_function = 'xmldb_' . $module->name . '_upgrade';\n\n /// First, the old function if exists\n $oldupgrade_status = true;\n if ($oldupgrade && function_exists($oldupgrade_function)) {\n $db->debug = true;\n $oldupgrade_status = $oldupgrade_function($currmodule->version, $module);\n if (!$oldupgrade_status) {\n notify ('Upgrade function ' . $oldupgrade_function .\n ' did not complete successfully.');\n }\n } else if ($oldupgrade) {\n notify ('Upgrade function ' . $oldupgrade_function . ' was not available in ' .\n $mod . ': ' . $fullmod . '/db/' . $CFG->dbtype . '.php');\n }\n\n /// Then, the new function if exists and the old one was ok\n $newupgrade_status = true;\n if ($newupgrade && function_exists($newupgrade_function) && $oldupgrade_status) {\n $db->debug = true;\n $newupgrade_status = $newupgrade_function($currmodule->version, $module);\n } else if ($newupgrade && $oldupgrade_status) {\n notify ('Upgrade function ' . $newupgrade_function . ' was not available in ' .\n $mod . ': ' . $fullmod . '/db/upgrade.php');\n }\n\n $db->debug=false;\n /// Now analyze upgrade results\n if ($oldupgrade_status && $newupgrade_status) { // No upgrading failed\n // OK so far, now update the modules record\n $module->id = $currmodule->id;\n if (! update_record('modules', $module)) {\n error('Could not update '. $module->name .' record in modules table!');\n }\n remove_dir($CFG->dataroot . '/cache', true); // flush cache\n notify(get_string('modulesuccess', '', $module->name), 'notifysuccess');\n echo '<hr />';\n } else {\n notify('Upgrading '. $module->name .' from '. $currmodule->version .' to '. $module->version .' FAILED!');\n }\n\n /// Update the capabilities table?\n if (!update_capabilities('mod/'.$module->name)) {\n error('Could not update '.$module->name.' capabilities!');\n }\n events_update_definition('mod/'.$module->name);\n\n $updated_modules = true;\n\n } else {\n upgrade_log_start();\n error('Version mismatch: '. $module->name .' can\\'t downgrade '. $currmodule->version .' -> '. $module->version .' !');\n }\n\n } else { // module not installed yet, so install it\n if (!$updated_modules) {\n print_header($strmodulesetup, $strmodulesetup,\n build_navigation(array(array('name' => $strmodulesetup, 'link' => null, 'type' => 'misc'))), '',\n upgrade_get_javascript(), false, '&nbsp;', '&nbsp;');\n }\n upgrade_log_start();\n print_heading($module->name);\n $updated_modules = true;\n $db->debug = true;\n @set_time_limit(0); // To allow slow databases to complete the long SQL\n\n /// Both old .sql files and new install.xml are supported\n /// but we priorize install.xml (XMLDB) if present\n if (file_exists($fullmod . '/db/install.xml')) {\n $status = install_from_xmldb_file($fullmod . '/db/install.xml'); //New method\n } else {\n $status = modify_database($fullmod .'/db/'. $CFG->dbtype .'.sql'); //Old method\n }\n\n $db->debug = false;\n\n /// Continue with the installation, roles and other stuff\n if ($status) {\n if ($module->id = insert_record('modules', $module)) {\n\n /// Capabilities\n if (!update_capabilities('mod/'.$module->name)) {\n error('Could not set up the capabilities for '.$module->name.'!');\n }\n\n /// Events\n events_update_definition('mod/'.$module->name);\n\n /// Run local install function if there is one\n $installfunction = $module->name.'_install';\n if (function_exists($installfunction)) {\n if (! $installfunction() ) {\n notify('Encountered a problem running install function for '.$module->name.'!');\n }\n }\n\n notify(get_string('modulesuccess', '', $module->name), 'notifysuccess');\n echo '<hr />';\n } else {\n error($module->name .' module could not be added to the module list!');\n }\n } else {\n error($module->name .' tables could NOT be set up successfully!');\n }\n }\n\n /// Check submodules of this module if necessary\n\n $submoduleupgrade = $module->name.'_upgrade_submodules';\n if (function_exists($submoduleupgrade)) {\n $submoduleupgrade();\n }\n\n\n /// Run any defaults or final code that is necessary for this module\n\n if ( is_readable($fullmod .'/defaults.php')) {\n // Insert default values for any important configuration variables\n unset($defaults);\n include($fullmod .'/defaults.php'); // include here means execute, not library include\n if (!empty($defaults)) {\n foreach ($defaults as $name => $value) {\n if (!isset($CFG->$name)) {\n set_config($name, $value);\n }\n }\n }\n }\n }\n\n upgrade_log_finish(); // finish logging if started\n\n if ($updated_modules) {\n print_continue($return);\n print_footer('none');\n die;\n }\n}", "function pcptab_civicrm_angularModules(&$angularModules) {\n_pcptab_civix_civicrm_angularModules($angularModules);\n}", "public function update($moduleId)\n {\n // Hack: for some broken modules using wall aliases\n Yii::setPathOfAlias('wall', Yii::app()->getModulePath());\n\n // Remove old module files\n Yii::app()->moduleManager->removeModuleFolder($moduleId);\n $this->install($moduleId);\n\n $module = Yii::app()->moduleManager->getModule($moduleId);\n $module->update();\n }", "private function _uninstallSubextensions($parent)\n\t{\n\t\tjimport('joomla.installer.installer');\n\n\t\t$db = JFactory::getDBO();\n\n\t\t$status = new JObject();\n\t\t$status->modules = array();\n\t\t$status->plugins = array();\n\n\t\t$src = $parent->getParent()->getPath('source');\n\n\t\t// Modules uninstallation\n\t\tif(count($this->uninstall_queue['modules'])) {\n\t\t\tforeach($this->uninstall_queue['modules'] as $folder => $modules) {\n\t\t\t\tif(count($modules)) foreach($modules as $module => $modulePreferences) {\n\t\t\t\t\t// Find the module ID\n\t\t\t\t\t$sql = $db->getQuery(true)\n\t\t\t\t\t\t->select($db->qn('extension_id'))\n\t\t\t\t\t\t->from($db->qn('#__extensions'))\n\t\t\t\t\t\t->where($db->qn('element').' = '.$db->q('mod_'.$module))\n\t\t\t\t\t\t->where($db->qn('type').' = '.$db->q('module'));\n\t\t\t\t\t$db->setQuery($sql);\n\t\t\t\t\t$id = $db->loadResult();\n\t\t\t\t\t// Uninstall the module\n\t\t\t\t\tif($id) {\n\t\t\t\t\t\t$installer = new JInstaller;\n\t\t\t\t\t\t$result = $installer->uninstall('module',$id,1);\n\t\t\t\t\t\t$status->modules[] = array(\n\t\t\t\t\t\t\t'name'=>'mod_'.$module,\n\t\t\t\t\t\t\t'client'=>$folder,\n\t\t\t\t\t\t\t'result'=>$result\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Plugins uninstallation\n\t\tif(count($this->uninstall_queue['plugins'])) {\n\t\t\tforeach($this->uninstall_queue['plugins'] as $folder => $plugins) {\n\t\t\t\tif(count($plugins)) foreach($plugins as $plugin => $published) {\n\t\t\t\t\t$sql = $db->getQuery(true)\n\t\t\t\t\t\t->select($db->qn('extension_id'))\n\t\t\t\t\t\t->from($db->qn('#__extensions'))\n\t\t\t\t\t\t->where($db->qn('type').' = '.$db->q('plugin'))\n\t\t\t\t\t\t->where($db->qn('element').' = '.$db->q($plugin))\n\t\t\t\t\t\t->where($db->qn('folder').' = '.$db->q($folder));\n\t\t\t\t\t$db->setQuery($sql);\n\n\t\t\t\t\t$id = $db->loadResult();\n\t\t\t\t\tif($id)\n\t\t\t\t\t{\n\t\t\t\t\t\t$installer = new JInstaller;\n\t\t\t\t\t\t$result = $installer->uninstall('plugin',$id);\n\t\t\t\t\t\t$status->plugins[] = array(\n\t\t\t\t\t\t\t'name'=>'plg_'.$plugin,\n\t\t\t\t\t\t\t'group'=>$folder,\n\t\t\t\t\t\t\t'result'=>$result\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $status;\n\t}", "public function uultra_reload_user_modules()\r\n\t{\r\n\t\t$modules = get_option('userultra_default_user_features');\t\t\r\n\t\t\r\n\t\t\r\n\t\t$html = '';\r\n\t\tforeach($modules as $key => $module)\r\n\t\t{\r\n\t\t\t$checked = '';\t\t\t\r\n\t\t\t\r\n\t\t\tif ($this->check_if_disallowed_array($key))\r\n\t\t\t{\r\n\t\t\t\t$checked = 'checked=\"checked\"';\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$html .= '<li class=\"uultra-profile-widget rounded\" id=\"'.$key.'\"><input name=\"uultra-modules[]\" type=\"checkbox\" value=\"'.$key.'\" class=\"uultra-my-modules-checked\" '.$checked.'/><label for=\"checkbox1\"><span></span>'.$module[\"title\"].'</label></li>';\r\n\t\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\techo $html;\r\n\t\tdie();\r\n\t\t\r\n\t}", "function contactcampaign_civicrm_angularModules(&$angularModules) {\n_contactcampaign_civix_civicrm_angularModules($angularModules);\n}", "public static function findRelatableModules($includeActivitiesSubmodules = true)\n {\n // first find all deployed modules that we might participate in a relationship\n $relatableModules = parent::findRelatableModules ( ) ;\n \n // now add in the undeployed modules - those in custom/modulebuilder\n // note that if a module exists in both deployed and undeployed forms, the subpanels from the undeployed form are used... \n\n require_once 'modules/ModuleBuilder/MB/ModuleBuilder.php' ;\n $mb = new ModuleBuilder ( ) ;\n $mb->getPackages () ;\n foreach ( $mb->getPackageList () as $packageName )\n {\n $package = $mb->packages [ $packageName ] ;\n foreach ( $package->modules as $module )\n {\n $relatableModules [ $package->key . \"_\" . $module->name ] = $module->getProvidedSubpanels () ;\n }\n }\n \n return $relatableModules ;\n \n }", "public function updateMigrateSplits() {\n // Reference: https://github.com/uiowa/uiowa/blob/15497457c6c34c3b49c5f4d5cda259a4e67982dc/blt/src/Blt/Plugin/Commands/GitCommands.php#L212-L222\n $root = $this->getConfigValue('repo.root');\n $finder = new Finder();\n\n // Get all the config split features.\n $split_files = $finder\n ->files()\n ->in(\"$root/docroot/sites/\")\n ->name('config_split.config_split.*.yml')\n ->sortByName();\n\n foreach ($split_files->getIterator() as $split_file) {\n if (file_exists($split_file)) {\n // This assumes the split is stored in module/name/config/split dir and\n // the finder context in() does not change.\n $host = dirname($split_file->getRelativePath(), 4);\n $module = basename(dirname($split_file->getRelativePath(), 2));\n $split = YamlMunge::parseFile($split_file->getPathname());\n $alias = Multisite::getIdentifier(\"https://$host\");\n $this->switchSiteContext($host);\n $this->updateSplit($split, $alias, $module);\n }\n }\n }", "public function updateModuleFile() {\n\t\t$module = Yii::app()->db->createCommand(\"SELECT * FROM {$this->_moduleTableName} WHERE enabled=1\")->queryAll();\n\n\t\tif(count($module) > 0) {\n\t\t\t$config = \"<?php \\n\";\n\t\t\t$config .= \"return array(\\n\\t'modules' => array(\\n\";\n\t\t\t$i = 1;\n\t\t\tforeach($module as $val) {\n\t\t\t\tif($i !== count($module))\n\t\t\t\t\t$config .= \"\\t\\t'\" . $val['name'] . \"',\\n\";\n\t\t\t\telse\n\t\t\t\t\t$config .= \"\\t\\t'\" . $val['name'] . \"'\\n\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$config .= \"\\t),\\n);\";\n\n\t\t}else {\n\t\t\t$config = \"<?php \\n\";\n\t\t\t$config .= \"return array(\\n\\t'modules' => array(\\n\";\n\t\t\t$config .= \"\\t),\\n);\";\n\t\t}\n\n\t\t$fileHandle = @fopen(Yii::getPathOfAlias('application.config').'/module_addon.php', 'w');\n\t\t@fwrite($fileHandle, $config, strlen($config));\n\t\t@fclose($fileHandle);\n\t}", "public function updateExtList() {}", "public function installModules()\n\t{\n\t$mainframe =& JFactory::getApplication();\n// \t$lang = JFactory::getLanguage(); \n// $languages = JLanguageHelper::getLanguages('lang_code');\n $db =& JFactory::getDBO();\n $query = $db->getQuery(true);\n $type = \"language\";\n $query->select('a.element');\n $query->from('#__extensions AS a');\n $type = $db->Quote($type);\n\t$query->where('(a.type = '.$type.')');\n\t$query->group('a.element');\n $db->setQuery($query);\n $langlist = $db->loadObjectList();\n \n echo 'Copy Administration Modules language(s) provided by <a href=\"https://opentranslators.transifex.com/projects/p/joomleague/\">Transifex</a><br>';\n\t\t$src=JPATH_ADMINISTRATOR.DS.'components'.DS.'com_joomleague'.DS.'modules';\n\t\t$dest=JPATH_ADMINISTRATOR.DS.'modules';\n\t\t$modules = JFolder::folders($src);\n\t\t\n \t\tforeach ( $langlist as $key )\n {\n echo 'Copy Administration Modules language( '.$key->element.' ) provided by <a href=\"https://opentranslators.transifex.com/projects/p/joomleague/\">Transifex</a><br>'; \n foreach ($modules as $module)\n\t\t{\n\t\tif ( JFolder::exists($src.DS.$module.DS.'language'.DS.$key->element) )\n\t\t{\n\t\t\tJFolder::copy($src.DS.$module.DS.'language'.DS.$key->element, JPATH_ADMINISTRATOR.DS.'language'.DS.$key->element, '', true);\n\t\techo ' - <span style=\"color:green\">'.JText::_('Success -> '.$module.' - '.$key->element).'</span><br />';\n }\n }\n\t\t}\n\n\t\t//echo ' - <span style=\"color:green\">'.JText::_('Success').'</span><br />';\n\t\techo 'Copy Administration Module(s)';\n\t\tJFolder::copy($src, $dest, '', true);\n\t\techo ' - <span style=\"color:green\">'.JText::_('Success').'</span><br />';\n//\t\techo 'Copy Site Module(s) language(s) provided by <a href=\"https://opentranslators.transifex.com/projects/p/joomleague/\">Transifex</a>';\n\t\t$src=JPATH_SITE.DS.'components'.DS.'com_joomleague'.DS.'modules';\n\t\t$dest=JPATH_SITE.DS.'modules';\n\t\t$modules = JFolder::folders($src);\n\t\t\n\t\tforeach ( $langlist as $key )\n {\n echo 'Copy Site Module(s) language( '.$key->element.' ) provided by <a href=\"https://opentranslators.transifex.com/projects/p/joomleague/\">Transifex</a><br>';\n foreach ($modules as $module)\n\t\t{\n\t\tif ( JFolder::exists($src.DS.$module.DS.'language'.DS.$key->element) )\n\t\t{\n\t\t\tJFolder::copy($src.DS.$module.DS.'language'.DS.$key->element, JPATH_SITE.DS.'language'.DS.$key->element, '', true);\n echo ' - <span style=\"color:green\">'.JText::_('Success -> '.$module.' - '.$key->element).'</span><br />';\n\t\t}\n }\n\t\t}\n\n\t\t//echo ' - <span style=\"color:green\">'.JText::_('Success').'</span><br />';\n\t\techo 'Copy Site Module(s)';\n\t\tJFolder::copy($src, $dest, '', true);\n\t\techo ' - <span style=\"color:green\">'.JText::_('Success').'</span><br />';\n \n /*\n $title = 'JL2 diddipoeler GitHub Commits Module';\n\t\t$tblModules = JTable::getInstance('module');\n\t\t$tblModules->load(array('title'=>$title));\n\t\t$tblModules->title\t\t\t= $title;\n\t\t$tblModules->module\t\t\t= 'mod_joomleague_github';\n\t\t$tblModules->position \t\t= 'cpanel';\n\t\t$tblModules->published \t\t= 1;\n\t\t$tblModules->client_id \t\t= 1;\n\t\t$tblModules->ordering \t\t= 1;\n\t\t$tblModules->access \t\t= 3;\n\t\t$tblModules->language \t\t= '*';\n\t\t$tblModules->publish_up\t\t= '2000-00-00 00:00:00';\n\t\t$tblModules->params \t\t= '{\"username\":\"diddipoeler\",\"repo\":\"joomleague-2-komplettpaket\",\"count\":15,\"relativeTime\":\"1\",\"layout\":\"_:default\",\"moduleclass_sfx\":\"\",\"cache\":\"1\",\"cache_time\":\"900\",\"cachemode\":\"static\"}';\n\n\t\tif (!$tblModules->store()) {\n\t\t\techo $tblModules->getError().'<br />';\n\t\t}\n\t\t$db = JFactory::getDBO();\n\t\t$query = 'INSERT INTO #__modules_menu (moduleid,menuid) VALUES ('.$tblModules->id.',0)';\n\t\t$db->setQuery($query);\n\t\tif (!$db->query())\n\t\t{\n\t\t\t//echo $db->getErrorMsg().'<br />';\n\t\t}\n\t\n\t\t// Initialise variables\n\t\t$conf = JFactory::getConfig();\n\t\t$dispatcher = JDispatcher::getInstance();\n\n\t\t$options = array(\n\t\t\t'defaultgroup' => ($tblModules->module) ? $tblModules->module : (isset($this->option) ? $this->option : JRequest::getCmd('option')),\n\t\t\t'cachebase' => ($tblModules->client_id) ? JPATH_ADMINISTRATOR . '/cache' : $conf->get('cache_path', JPATH_SITE . '/cache'));\n\n\t\t$cache = JCache::getInstance('callback', $options);\n\t\t$cache->clean();\n\n\t\t// Trigger the onContentCleanCache event.\n\t\t$dispatcher->trigger('onContentCleanCache', $options);\n */\n \n \n \n\t}", "public function store(Request $request)\n {\n $user = $this->check_user->getUserAuthenticated($request->token);\n \n $checkRole = $user->verifyRoleAuthorization($user->id);\n\n $checkPermission = $user->verifyPermissionAuthorization('submodule_create', ['self', 'all']);\n\n if (!$checkRole || !$checkPermission) {\n return response()->json(['message' => __('messages.no_permission'), 'status' => 'error'], 401);\n }\n\n if ($request->header('Accept-Language') != null) {\n if (in_array($request->header('Accept-Language'), Config::get('app.available_language'))) {\n app()->setLocale($request->header('Accept-Language'));\n }\n }\n\n try {\n\t\t $dataSubmodule = [\n 'name' => $request->name,\n 'description' => $request->description,\n 'id' => $request->module\n ];\n\t\t $validated = $this->validator($dataSubmodule);\n\n\t \tif ($validated->fails()) {\n $errors = $this->parseErrors($validated->errors());\n\t \t\treturn response()->json(['message' => $errors, 'status' => 'error'], 400);\n\t \t}\n\n\t\t\t$input = $dataSubmodule; \n\n $module = Module::find($request->module);\n $submodule = $this->submodules->create($input);\n $submodule->module()->associate($module);\n $submodule->save();\n\t\t\tstoreLogActivity('submodule_create', $user->id);\n \treturn response()->json(['message' => __('messages.submodule_create_success'), 'status' => 'success'], 200); \n\n \t} catch (Exception $e) {\n return response()->json(['message' => __('messages.submodule_create_error'), 'status' => 'error']);\n \t}\n }", "public function toggleModules() {\n if ($this->getConfig()->has('environment')) {\n $environment = $this->getConfigValue('environment');\n }\n\n if (isset($environment)) {\n // Enable modules.\n $enable_key = \"modules.$environment.enable\";\n $this->doToggleModules('pm-enable', $enable_key);\n\n // Uninstall modules.\n $disable_key = \"modules.$environment.uninstall\";\n $this->doToggleModules('pm-uninstall', $disable_key);\n }\n else {\n $this->say(\"Environment is unset. Skipping drupal:toggle:modules...\");\n }\n }", "public function update($parent)\n\t{\n\t\t$this->install($parent);\n\t}", "function agnosia_load_main_modules() {\r\n\r\n\tglobal $agnosia_main_modules;\r\n\r\n\tagnosia_load_modules( $agnosia_main_modules );\r\n\r\n}", "public function set_needed_repos(): void {}", "public function set_needed_repos(): void {}", "public function update()\n\t{\n\t\t$mytable = WikiRevision::$table;\n\t\t$buf = \"UPDATE $mytable SET \";\n\t\tfor ($i = 0; $i < count(WikiRevision::$fields); $i++) {\n\t\t\t$buf .= WikiRevision::$fields[$i] . \" = '\" . DBConnection::get()->handle()->real_escape_string($this->data[$fields[$i]]) . \"'\" . ($i == count(WikiRevision::$fields) - 1)?(', '):(' ');\n\t\t}\n\t\t$buf .= \"WHERE rev_id = \" . $data['rev_id'];\n\t\tDBConnection::get()->handle()->query($buf);\n\t}", "public function updateRepository($reset = true)\n\t{\n\t\t$this->command->info('Pulling changes');\n\t\t$tasks = array($this->scm->update());\n\n\t\t// Reset if requested\n\t\tif ($reset) {\n\t\t\tarray_unshift($tasks, $this->scm->reset());\n\t\t}\n\n\t\treturn $this->runForCurrentRelease($tasks);\n\t}", "private function getModules() {\n // @todo Only do a full rebuild of the module cache every 1 at the most\n $modules = system_rebuild_module_data();\n uasort($modules, 'system_sort_modules_by_info_name');\n\n $result = array();\n $keys_to_send = array('name', 'version', 'package', 'core', 'project');\n foreach ($modules as $module) {\n $info = array();\n $info['status'] = $module->status;\n foreach ($keys_to_send as $key) {\n $info[$key] = isset($module->info[$key]) ? $module->info[$key] : '';\n }\n $info['filename'] = $module->getPathname();\n if (empty($info['project']) && $module->origin == 'core') {\n $info['project'] = 'drupal';\n }\n\n // Determine which files belong to this module and hash them.\n $module_path = explode('/', $info['filename']);\n array_pop($module_path);\n\n // We really only care about this module if it is in 'sites' or in\n // 'modules' folder.\n // Otherwise it is covered by the hash of the distro's modules.\n if ($module_path[0] == 'sites' || $module_path[0] == 'modules') {\n $contrib_path = implode('/', $module_path);\n\n // Get a hash for this module's files. If we nest into another module,\n // we'll return. and that other module will be covered by it's entry in\n // the system table.\n //\n // !! At present we aren't going to do a per module hash, but rather a\n // per-project hash. The reason being that it is too hard to tell an\n // individual module apart from a project.\n list($info['module_data']['hashes'], $info['module_data']['fileinfo']) = self::generateHashesHelper($contrib_path);\n }\n else {\n $info['module_data']['hashes'] = array();\n $info['module_data']['fileinfo'] = array();\n }\n\n $result[] = $info;\n }\n return $result;\n }", "public function update(Update $request)\n {\n return ModuleService::update($request);\n }", "function rupdate() {\n\t\t$this->checkOnce();\n\t\t$deployPath = $this->getVersionPath();\n\t\t$branch = $this->branch ?: 'default';\n\t\t$remoteCmd = 'cd '.$deployPath.' && hg update -r '.$branch;\n\t\t$this->ssh_exec($remoteCmd);\n\t}", "public function updateAll()\n {\n $this->definition = array();\n \n $finder = \\sfFinder::type('dir')->maxdepth(0);\n \n foreach ($finder->in(\\sfConfig::get('sf_apps_dir')) as $app_dir) {\n foreach ($finder->in($app_dir . DIRECTORY_SEPARATOR . 'modules') as $module_dir) {\n foreach ($finder->type('file')->name('*.xml')->in($module_dir . DIRECTORY_SEPARATOR . 'config') as $widget_dir) {\n $this->retrieveAndUpdate(\n pathinfo($widget_dir, PATHINFO_FILENAME), \n pathinfo($module_dir, PATHINFO_FILENAME), \n pathinfo($app_dir, PATHINFO_FILENAME)\n );\n }\n }\n }\n \n return $this;\n }", "public function setModules($modules)\n {\n $this->modules = (array)$modules;\n }", "protected function _loopPluginUpdate($arr)\n\t{\n\t\tglobal $varsPreference;\n\t\tglobal $classEscape;\n\n\t\t$array = $varsPreference['jsonModule'];\n\n\t\tforeach ($array as $key => $value) {\n\t\t\t$strDir = $key;\n\t\t\t$strFile = ucwords($key);\n\t\t\t$path = PATH_BACK_CLASS_ELSE_PLUGIN . $strDir . '/' . $strFile . '.php';\n\t\t\tif (!file_exists($path)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\trequire_once($path);\n\t\t\t$strClass = 'Code_Else_Plugin_' . $strFile . '_' . $strFile;\n\t\t\t$classCall = new $strClass;\n\t\t\t$classCall->loop(array(\n\t\t\t\t'flagType' => 'accountStatus',\n\t\t\t\t'flagStatus' => 'updateModule',\n\t\t\t\t'varsModuleNew' => $arr['varsModuleNew'],\n\t\t\t\t'varsModulePast' => $arr['varsModulePast'],\n\t\t\t\t'arrId' => $arr['arrId'],\n\t\t\t));\n\t\t}\n\t}", "public function applyChanges($params, $context) {\n\t\t// Validate the RPC caller context.\n\t\t$this->validateMethodContext($context, [\n\t\t\t\"role\" => OMV_ROLE_ADMINISTRATOR\n\t\t]);\n\t\t// Validate the parameters of the RPC service method.\n\t\t$this->validateMethodParams($params, \"rpc.config.applychanges\");\n\t\t$moduleMngr = \\OMV\\Engine\\Module\\Manager::getInstance();\n\t\t$notifyDispatcher = \\OMV\\Engine\\Notify\\Dispatcher::getInstance();\n\t\t// Open the dirty modules file. Lock it to force all writers\n\t\t// to wait until this RPC has been finished.\n\t\t$jsonFile = new \\OMV\\Json\\File(\\OMV\\Environment::get(\n\t\t \"OMV_ENGINED_DIRTY_MODULES_FILE\"));\n\t\t$jsonFile->open(\"c+\");\n\t\t// Make sure we have a valid JSON file. Keep in mind that the file\n\t\t// is empty if it was created by the \\OMV\\Json\\File::open method.\n\t\tif ($jsonFile->isEmpty())\n\t\t\t$jsonFile->write([]);\n\t\t// Read the file content.\n\t\t$dirtyModules = $jsonFile->read();\n\t\t// Remove non-existing modules from list. It may happen that the\n\t\t// list contains entries from already deinstalled plugins.\n\t\t$removeDirtyModules = [];\n\t\t$modules = array_keys($moduleMngr->getModules());\n\t\tforeach ($dirtyModules as $dirtyModulek => $dirtyModulev) {\n\t\t\tif (!in_array($dirtyModulev, $modules))\n\t\t\t\t$removeDirtyModules[] = $dirtyModulev;\n\t\t}\n\t\tif (!empty($removeDirtyModules)) {\n\t\t\t// Remove module name from list of dirty modules. Note, the\n\t\t\t// array must be re-indexed.\n\t\t\t$dirtyModules = array_values(array_diff($dirtyModules,\n\t\t\t\t$removeDirtyModules));\n\t\t}\n\t\t// Get list of modules to be processed. If the parameter 'modules'\n\t\t// is empty, then process all registered modules.\n\t\t$modules = $params['modules'];\n\t\tif (empty($params['modules']))\n\t\t\t$modules = array_keys($moduleMngr->getModules());\n\t\t$processModules = [];\n\t\tforeach ($modules as $modulek => $modulev) {\n\t\t\t// Skip module if 'force' is disabled and module is not marked\n\t\t\t// as dirty.\n\t\t\tif (!in_array($modulev, $dirtyModules) &&\n\t\t\t\t(FALSE === $params['force'])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t// Get the module object and apply the configuration.\n\t\t\tif (is_null($inst = $moduleMngr->getModule($modulev))) {\n\t\t\t\tthrow new \\OMV\\Exception(\"Module '%s' not found.\",\n\t\t\t\t\t$modulev);\n\t\t\t}\n\t\t\t// Append module to list of modules that have to be processed.\n\t\t\t$processModules[$modulev] = $inst;\n\t\t\t// Remove module name from list of dirty modules. Note, the\n\t\t\t// array must be re-indexed.\n\t\t\t$dirtyModules = array_values(array_diff($dirtyModules,\n\t\t\t\t[$modulev]));\n\t\t}\n\t\t// Build the dependency list and deploy the configuration for the\n\t\t// specified modules.\n\t\t$tsort = new \\OMV\\Util\\TopologicalSort();\n\t\t$tsort->clean();\n\t\tforeach ($processModules as $name => $inst) {\n\t\t\t// Add the modules that need to be executed before the\n\t\t\t// given module.\n\t\t\t$afterNames = $inst->deployAfter();\n\t\t\tif (FALSE === $tsort->add($name, $afterNames)) {\n\t\t\t\tthrow new \\OMV\\Exception(\n\t\t\t\t\t\"Failed to add node (name=%s, dependencies=[%s]).\",\n\t\t\t\t\t$name, implode(\",\", $afterNames));\n\t\t\t}\n\t\t\t// Add the modules that need to be executed after the\n\t\t\t// given module.\n\t\t\t$beforeNames = $inst->deployBefore();\n\t\t\tforeach ($beforeNames as $beforeNamek => $beforeNamev) {\n\t\t\t\tif (FALSE === $tsort->add($beforeNamev, [$name])) {\n\t\t\t\t\tthrow new \\OMV\\Exception(\n\t\t\t\t\t\t\"Failed to add node (name=%s, dependencies=[%s]).\",\n\t\t\t\t\t\t$beforeNamev, $name);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tforeach ($tsort->sort() as $name) {\n\t\t\t$this->debug(\"Deploying configuration for module '%s'\", $name);\n\t\t\t$name = strtolower($name);\n\t\t\t$uri = \"org.openmediavault.module.service.%s.%s\";\n\t\t\t$processModules[$name]->preDeploy();\n\t\t\t$notifyDispatcher->notify(OMV_NOTIFY_EVENT,\n\t\t\t\tsprintf($uri, $name, \"predeploy\"));\n\t\t\t$processModules[$name]->deploy();\n\t\t\t$notifyDispatcher->notify(OMV_NOTIFY_EVENT,\n\t\t\t\tsprintf($uri, $name, \"deploy\"));\n\t\t\t$processModules[$name]->postDeploy();\n\t\t\t$notifyDispatcher->notify(OMV_NOTIFY_EVENT,\n\t\t\t\tsprintf($uri, $name, \"postdeploy\"));\n\t\t}\n\t\t// Reset list of dirty modules.\n\t\t$jsonFile->write($dirtyModules);\n\t\t$jsonFile->close();\n\t\t// Unlink all configuration revision files.\n\t\t$db = \\OMV\\Config\\Database::getInstance();\n\t\t$db->unlinkRevisions();\n\t}", "function git_update($path) {\n\t$status = GitUtil::update($path);\n}", "function drush_pm_updatecode() {\n // In --pipe mode, just run pm-updatestatus and exit.\n if (drush_get_context('DRUSH_PIPE')) {\n drush_set_option('strict', 0);\n return drush_invoke('pm-updatestatus');\n }\n // We don't provide for other options here, so we supply an explicit path.\n drush_include_engine('update_info', 'drupal', NULL, DRUSH_BASE_PATH . '/commands/pm/update_info');\n\n // Get specific requests.\n $requests = pm_parse_arguments(func_get_args(), FALSE);\n\n // Print report of modules to update, and record\n // result of that function in $update_info.\n $updatestatus_options = array();\n foreach (array('lock', 'unlock', 'lock-message', 'security-only') as $option) {\n $value = drush_get_option($option, FALSE);\n if ($value) {\n $updatestatus_options[$option] = $value;\n }\n }\n $backend_options = array(\n 'integrate' => FALSE,\n );\n $values = drush_invoke_process(\"@self\", 'pm-updatestatus', func_get_args(), $updatestatus_options, $backend_options);\n if (!is_array($values) || $values['error_status']) {\n return FALSE;\n }\n $updateable = $values['object'];\n drush_print($values['output']);\n $tmpfile = drush_tempnam('pm-updatecode.');\n\n $last = pm_update_last_check();\n drush_print(dt('Update information last refreshed: ') . ($last ? format_date($last) : dt('Never')));\n\n // Prevent update of core if --no-core was specified.\n if (isset($updateable['drupal']) && drush_get_option('no-core', FALSE)) {\n unset($updateable['drupal']);\n drush_print(dt('Skipping core update (--no-core specified).'));\n }\n\n // If there are any locked projects that were not requested, then remove them.\n foreach ($updateable as $name => $project) {\n if ((isset($project['locked'])) && (!isset($requests[$name]))) {\n unset($updateable[$name]);\n }\n }\n\n // Do no updates in simulated mode.\n if (drush_get_context('DRUSH_SIMULATE')) {\n return drush_log(dt('No action taken in simulated mode.'), 'ok');\n return TRUE;\n }\n\n $core_update_available = FALSE;\n if (isset($updateable['drupal'])) {\n $drupal_project = $updateable['drupal'];\n unset($updateable['drupal']);\n\n // At present we need to update drupal core after non-core projects\n // are updated.\n if (empty($updateable)) {\n return _pm_update_core($drupal_project, $tmpfile);\n }\n // If there are modules other than drupal core enabled, then update them\n // first.\n else {\n $core_update_available = TRUE;\n if ($drupal_project['status'] == UPDATE_NOT_SECURE) {\n drush_print(dt(\"NOTE: A security update for the Drupal core is available.\"));\n }\n else {\n drush_print(dt(\"NOTE: A code update for the Drupal core is available.\"));\n }\n drush_print(dt(\"Drupal core will be updated after all of the non-core projects are updated.\\n\"));\n }\n }\n\n // If there are no releases to update, then print a final\n // exit message.\n if (empty($updateable)) {\n if (drush_get_option('security-only')) {\n return drush_log(dt('No security updates available.'), 'ok');\n }\n else {\n return drush_log(dt('No code updates available.'), 'ok');\n }\n }\n\n // Offer to update to the identified releases.\n if (!pm_update_packages($updateable, $tmpfile)) {\n return FALSE;\n }\n\n // After projects are updated we can update core.\n if ($core_update_available) {\n drush_print();\n return _pm_update_core($drupal_project, $tmpfile);\n }\n}", "public function membershipsUpdated()\n {\n /**\n * [signal]\n *\n * IDF_Project::membershipsUpdated\n *\n * [sender]\n *\n * IDF_Project\n *\n * [description]\n *\n * This signal allows an application to update the some access\n * rights to a repository when the project memberships is\n * updated.\n *\n * [parameters]\n *\n * array('project' => $project)\n *\n */\n $params = array('project' => $this);\n Pluf_Signal::send('IDF_Project::membershipsUpdated',\n 'IDF_Project', $params);\n }", "public function update(){\n\t\t$modifications[] = new Modification();\n\t}", "function sitemgr_upgrade1_0_1_001()\n{\n\t$modules2nav_type = array('currentsection' => 1,'index' => 2,'index_block' => 3,'navigation' => 4,'sitetree' => 5,'toc' => 6,'toc_block' => 7);\n\n\t$db = clone($GLOBALS['egw_setup']->db);\n\t$db->set_app('sitemgr');\n\t$db2 = clone($db);\n\n\t// get the module_id of all navigation modules and remove the old modules\n\t$db->select('egw_sitemgr_modules','module_id,module_name',array('module_name' => array_keys($modules2nav_type)),__LINE__,__FILE__);\n\t$id2module = $old_modules = array();\n\twhile(($row = $db->row(true)))\n\t{\n\t\t$id2module[$row['module_id']] = $row['module_name'];\n\t\tif ($row['module_name'] != 'navigation')\n\t\t{\n\t\t\t$old_modules[] = $row['module_id'];\n\t\t}\n\t}\n\t$db->delete('egw_sitemgr_modules',array('module_id' => $old_modules),__LINE__,__FILE__);\n\n\t// check if navigation is already registered, if not register it\n\n\tif (!($navigation_id = array_search('navigation',$id2module)))\n\t{\n\t\tif (ereg('\\$this->description = lang\\(\\'([^'.\"\\n\".']*)\\'\\);',implode(\"\\n\",file(EGW_SERVER_ROOT.'/sitemgr/modules/class.module_navigation.inc.php')),$parts))\n\t\t{\n\t\t\t$description = str_replace(\"\\\\'\",\"'\",$parts[1]);\n\t\t}\n\t\t$db->insert('egw_sitemgr_modules',array(\n\t\t\t'module_name' => 'navigation',\n\t\t\t'module_description' => $description,\n\t\t),false,__LINE__,__FILE__);\n\t\t$navigation_id = $db->get_last_insert_id('egw_sitemgr_modules','module_id');\n\t}\n\t// add navigation to all contentareas, which allowed any for the old modules before and remove the old modules\n\t$db->select('egw_sitemgr_active_modules','DISTINCT cat_id,area',array('module_id' => $old_modules),__LINE__,__FILE__);\n\twhile (($row = $db->row(true)))\n\t{\n\t\t$row['module_id'] = $navigation_id;\n\t\t$db2->insert('egw_sitemgr_active_modules',array(),$row,__LINE__,__FILE__);\n\t}\n\t$db->delete('egw_sitemgr_active_modules',array('module_id' => $old_modules),__LINE__,__FILE__);\n\n\t// replace old modules in the blocks with the navigation module\n\t$db->select('egw_sitemgr_blocks','block_id,module_id',array('module_id' => array_keys($id2module)),__LINE__,__FILE__);\n\t$block_id2module_id = array();\n\twhile (($row = $db->row(true)))\n\t{\n\t\t$block_id2module_id[$row['block_id']] = $row['module_id'];\n\t}\n\t$db->select('egw_sitemgr_content','version_id,block_id,arguments',array('block_id' => array_keys($block_id2module_id)),__LINE__,__FILE__);\n\twhile (($row = $db->row(true)))\n\t{\n\t\t$arguments = unserialize($row['arguments']);\n\t\tif (!isset($arguments['nav_type']))\n\t\t{\n\t\t\t$version_id = $row['version_id'];\n\t\t\tunset($row['version_id']);\n\t\t\t$arguments['nav_type'] = $modules2nav_type[$id2module[$block_id2module_id[$row['block_id']]]];\n\t\t\t$row['arguments'] = serialize($arguments);\n\t\t\t$db2->update('egw_sitemgr_content',$row,array('version_id' => $version_id),__LINE__,__FILE__);\n\t\t}\n\t}\n\t$db->update('egw_sitemgr_blocks',array('module_id' => $navigation_id),array('module_id' => $old_modules),__LINE__,__FILE__);\n\n\t$GLOBALS['setup_info']['sitemgr']['currentver'] = '1.2';\n\treturn $GLOBALS['setup_info']['sitemgr']['currentver'];\n}", "public function updateModuleTracking( $event )\n {\n $eventArgs = $event->getArgs();\n\n $courseCode = isset( $eventArgs['courseCode'] ) ? $eventArgs['courseCode'] : null;\n $userId = isset( $eventArgs['userId'] ) ? (int)$eventArgs['userId'] : null;\n $type = isset( $eventArgs['type'] ) ? $eventArgs['type'] : \"update\";\n $date = isset( $eventArgs['date'] ) ? $eventArgs['date'] : date(\"Y-m-d H:i:s\");\n\n $scoreRaw = isset( $eventArgs['scoreRaw'] ) ? (int)$eventArgs['scoreRaw'] : 0;\n $scoreMin = isset( $eventArgs['scoreMin'] ) ? (int)$eventArgs['scoreMin'] : 0;\n $scoreMax = isset( $eventArgs['scoreMax'] ) ? (int)$eventArgs['scoreMax'] : 0;\n $sessionTime = isset( $eventArgs['sessionTime'] ) ? $eventArgs['sessionTime'] : '0000:00:00.00';\n $status = isset( $eventArgs['status'] ) ? $eventArgs['status'] : \"NOT ATTEMPTED\";\n\n $learnPathId = isset( $eventArgs['learnPathId'] ) ? (int)$eventArgs['learnPathId'] : null;\n $moduleId = isset( $eventArgs['moduleId'] ) ? (int)$eventArgs['moduleId'] : null;\n $learnPathModuleId = isset( $eventArgs['learnPathModuleId'] ) ? (int)$eventArgs['learnPathModuleId'] : null;\n $userModuleProgressId = isset( $eventArgs['userModuleProgressId'] ) ? (int)$eventArgs['userModuleProgressId'] : null;\n\n if(is_null( $learnPathId ) || is_null( $moduleId ) )\n {\n if( is_null( $learnPathModuleId ) && !is_null( $userModuleProgressId ) )\n {\n $learnPathModuleId = TrackingUtils::getLearnPathModuleIdFromUserModuleProgressId( $courseCode, $userModuleProgressId );\n }\n\n if( !is_null( $learnPathModuleId ) )\n {\n if( is_null( $learnPathId ) )\n {\n $learnPathId = TrackingUtils::getLearnPathIdFromRelLearnPathModuleId( $courseCode, $learnPathModuleId );\n }\n if(is_null( $moduleId ))\n {\n $moduleId = TrackingUtils::getModuleIdFromRelLearnPathModuleId( $courseCode, $learnPathModuleId );\n }\n }\n }\n\n if( !is_null( $courseCode ) && !is_null( $userId ) && !is_null( $learnPathId ) && !is_null( $moduleId ) )\n {\n $data = LearnPathTrackingListener::generateData( $learnPathId, $moduleId, $scoreRaw, $scoreMin, $scoreMax, $sessionTime, $status );\n if( $type == \"init\" )\n {\n $this->addNewLearnPathTracking( $courseCode, $userId, $date, $data, 'learnpath_tracking_init' );\n }\n else\n {\n $this->addNewLearnPathTracking( $courseCode, $userId, $date, $data, 'learnpath_tracking' );\n }\n }\n else\n {\n throw new Exception( \"Unable to generate a tracking event log due to invalid data\" );\n }\n }", "public function setRepositories() {\n }", "public function testInstalledIncompatibleModule() {\n $incompatible_modules_message = 'There are errors with some installed modules. Visit the status report page for more information.';\n $path = \\Drupal::getContainer()->getParameter('site.path') . \"/modules/changing_module\";\n mkdir($path, 0777, TRUE);\n $file_path = \"$path/changing_module.info.yml\";\n $info = [\n 'name' => 'Module that changes',\n 'type' => 'module',\n ];\n $compatible_info = $info + ['core_version_requirement' => '*'];\n\n file_put_contents($file_path, Yaml::encode($compatible_info));\n $edit = ['modules[changing_module][enable]' => 'changing_module'];\n $this->drupalGet('admin/modules');\n $this->submitForm($edit, 'Install');\n $this->assertSession()->pageTextContains('Module Module that changes has been enabled.');\n\n $incompatible_updates = [\n [\n 'core_version_requirement' => '^1',\n ],\n [\n 'core' => '8.x',\n ],\n ];\n foreach ($incompatible_updates as $incompatible_update) {\n $incompatible_info = $info + $incompatible_update;\n file_put_contents($file_path, Yaml::encode($incompatible_info));\n $this->drupalGet('admin/modules');\n $this->assertSession()->pageTextContains($incompatible_modules_message);\n\n file_put_contents($file_path, Yaml::encode($compatible_info));\n $this->drupalGet('admin/modules');\n $this->assertSession()->pageTextNotContains($incompatible_modules_message);\n }\n // Uninstall the module and ensure that incompatible modules message is not\n // displayed for modules that are not installed.\n $edit = ['uninstall[changing_module]' => 'changing_module'];\n $this->drupalGet('admin/modules/uninstall');\n $this->submitForm($edit, 'Uninstall');\n $this->submitForm([], 'Uninstall');\n $this->assertSession()->pageTextContains('The selected modules have been uninstalled.');\n foreach ($incompatible_updates as $incompatible_update) {\n $incompatible_info = $info + $incompatible_update;\n file_put_contents($file_path, Yaml::encode($incompatible_info));\n $this->drupalGet('admin/modules');\n $this->assertSession()->pageTextNotContains($incompatible_modules_message);\n }\n }", "public function update_attributes() {\n\t\t$packages = $this->Package->find('all', array(\n\t\t\t'contain' => array('Maintainer' => array('id', 'username')),\n\t\t\t'fields' => array('id', 'name'),\n\t\t\t'order' => array('Package.name ASC')\n\t\t));\n\n\t\t$count = 0;\n\t\tforeach ($packages as $package) {\n\t\t\tsleep(1);\n\t\t\tif ($this->Package->updateAttributes($package)) {\n\t\t\t\t$this->out(sprintf(__('* Updated %s'), $package['Package']['name']));\n\t\t\t\t$count++;\n\t\t\t} else {\n\t\t\t\t$this->out(sprintf(__('* Failed to update %s'), $package['Package']['name']));\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\t$p_count = count($packages);\n\t\t$this->out(sprintf(__('* Updated %s of %s packages'), $count, $p_count));\n\t}", "function update_do_one($module, $number, &$context) {\n // If updates for this module have been aborted\n // in a previous step, go no further.\n if (!empty($context['results'][$module]['#abort'])) {\n return;\n }\n\n $function = $module .'_update_'. $number;\n if (function_exists($function)) {\n $ret = $function($context['sandbox']);\n }\n\n if (isset($ret['#finished'])) {\n $context['finished'] = $ret['#finished'];\n unset($ret['#finished']);\n }\n\n if (!isset($context['results'][$module])) {\n $context['results'][$module] = array();\n }\n if (!isset($context['results'][$module][$number])) {\n $context['results'][$module][$number] = array();\n }\n $context['results'][$module][$number] = array_merge($context['results'][$module][$number], $ret);\n\n if (!empty($ret['#abort'])) {\n $context['results'][$module]['#abort'] = TRUE;\n }\n // Record the schema update if it was completed successfully.\n if ($context['finished'] == 1 && empty($context['results'][$module]['#abort'])) {\n drupal_set_installed_schema_version($module, $number);\n }\n\n $context['message'] = 'Updating '. check_plain($module) .' module';\n}", "protected static function updatePackages()\n {\n if (! file_exists(base_path('package.json'))) {\n return;\n }\n\n $packages = json_decode(file_get_contents(base_path('package.json')), true);\n\n $packages['devDependencies'] = static::updatePackageArray(\n $packages['devDependencies']\n );\n\n file_put_contents(\n base_path('package.json'),\n json_encode($packages, JSON_PRETTY_PRINT)\n );\n }", "function dashboard_admin_buildContent($data,$db) {\n\t//$url = 'http://localhost/proprietary/version/'; // base url for version \n\t$url = 'https://sitesense.org/dev/version/'; // base url for version \n\t// modules versions contact\n\t$statement = $db->prepare('getEnabledModules','admin_modules'); // modules don't register versions until they're enabled, so this function is borderline useless if you get every module\n\t$statement->execute();\n\t$modules = $statement->fetchAll();\n\t$moduleQuery = array();\n\tforeach($modules as $module){\n\t\tif(file_exists('modules/'.$module['name'].'/README.md')&&dashboard_parse_readme('modules/'.$module['name'].'/README.md')){\n\t\t\t$moduleQuery[$module['shortName']]=$module['version'];\n\t\t}\n\t}\n\t$statement=$db->prepare('getEnabledPlugins','plugins');\n\t$statement->execute();\n\twhile($fetch=$statement->fetch(PDO::FETCH_ASSOC)){\n\t\tif(file_exists('plugins/'.$module['name'].'/README.md')&&dashboard_parse_readme('modules/'.$module['name'].'/README.md')){\n\t\t\tif(file_exists('plugins/'.$fetch['name'].'/install.php')){\n\t\t\t\tcommon_include('plugins/'.$fetch['name'].'/install.php');\n\t\t\t}\n\t\t\tif(function_exists($fetch['name'].'_settings')){\n\t\t\t\t$settings=call_user_func($fetch['name'].'_settings');\n\t\t\t\tif(isset($settings['version'])){\n\t\t\t\t\t$moduleQuery[$fetch['name']]=$settings['version'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t$moduleQuery = http_build_query(array('modules'=>$moduleQuery));\n\t$moduleQuery = rawurldecode($moduleQuery);\n\t$moduleUrl = $url . 'modules?' . $moduleQuery;\n\tif(isset($data->version)){\n\t\t$moduleUrl .= '&core='.$data->version;\n\t}\n\t$ch = curl_init($moduleUrl);\n\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,true);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t$data->output['moduleUpdates'] = curl_exec($ch);\n\t$data->output['moduleUpdates'] = json_decode($data->output['moduleUpdates'],TRUE);\n\n\t// sitesense version contact\n $info['SiteSense Version'] = $data->version;\n\t$info['Server time']=strftime('%B %d, %Y, %I:%M:%S %p');\n\t$info['Server Signature']=$_SERVER['SERVER_SIGNATURE'];\n\t$info['Server Name']=$_SERVER['SERVER_NAME'];\n\t$info['Server Address']=$_SERVER['SERVER_ADDR'];\n\t$info['Gateway Interface']=$_SERVER['GATEWAY_INTERFACE'];\n\t$info['Server Protocol']=$_SERVER['SERVER_PROTOCOL'];\n\t$info['PHP Version']=phpversion().'</td></tr><tr><td colspan=\"2\">\n\t\t<img src=\"'.$_SERVER['PHP_SELF'].'?='.php_logo_guid().'\" alt=\"PHP Logo\" />';\n\t$info['Zend Version']=zend_version().'</td></tr><tr><td colspan=\"2\">\n\t\t<img src=\"'.$_SERVER['PHP_SELF'].'?='.zend_logo_guid().'\" alt=\"Zend Logo\" />';\n\t$info['Host OS']=PHP_OS;\n\t$data->output['secondSidebar']='\n\t<table class=\"sysInfo\">\n\t\t<caption>System Info</caption>\n\t\t';\n\tforeach ($info as $title => $value) {\n\t\tif (is_array($value)) {\n\t\t\t$data->output['secondSidebar'].='<tr>\n\t\t\t<th colspan=\"2\" class=\"section\">'.$title.'</th>';\n\t\t\tforeach ($value as $subTitle => $subValue) {\n\t\t\t\t$data->output['secondSidebar'].='<tr>\n\t\t\t<th>'.$subTitle.'</th>\n\t\t\t<td>'.$subValue.'</td>\n\t\t</tr>';\n\t\t\t}\n\t\t} else {\n\t\t\t$data->output['secondSidebar'].='<tr>\n\t\t\t<th>'.$title.'</th>\n\t\t\t<td>'.$value.'</td>\n\t\t</tr>';\n\t\t}\n\t}\n\t$data->output['secondSidebar'].='\n\t</table>';\n\t$data->output['pageTitle']='About This CMS -';\n\t//-----Call Home-----//\n\t$field = array(\n\t\t'version' => $data->version,\n\t\t'host' => $data->domainName . $data->linkRoot,\n\t\t'removeAttribution' => $data->settings['removeAttribution'],\n\t\t'serverName' => $info['Server Name'],\n\t\t'serverAddress' => $info['Server Address'],\n\t\t'gatewayInterface' => $info['Gateway Interface'],\n\t\t'serverProtocol' => $info['Server Protocol'],\n\t\t'phpVersion' => phpversion(),\n\t\t'zendVersion' => zend_version()\n\t);\n\t\n\t$ch = curl_init($url);\n\tcurl_setopt($ch,CURLOPT_POST,true);\n\tcurl_setopt($ch,CURLOPT_POSTFIELDS,$field);\n\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,true);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\n\t$data->output['result'] = curl_exec($ch);\n\t$data->output['result'] = json_decode($data->output['result'],TRUE);\n\n\t/* \n\t *\n\t * 0 = Attribution\n\t * 1 = Version\n\t**/\n\t// Update Attribution Setting In The DB\n\t$statement = $db->prepare('updateSettings','admin_settings');\n\t$statement->execute(array(\n\t\t':name' => 'removeAttribution',\n\t\t':value' => $data->output['result']['removeAttribution']\n\t));\n\t// Push Across All Languages...\n\tcommon_updateAcrossLanguageTables($data,$db,'settings',array('name'=>'removeAttribution'),array('value'=>$data->output['result']['removeAttribution']));\n\t\n}", "public function scanForUpdates() {\n\n $objManager = new class_module_packagemanager_manager();\n $arrVersions = $objManager->getArrLatestVersion();\n\n foreach($arrVersions as $strOneModule => $strOneVersion) {\n $objMetadata = $objManager->getPackage($strOneModule);\n if($objMetadata != null) {\n $objManager->updateAvailable($objManager->getPackageManagerForPath($objMetadata->getStrPath()), $strOneVersion);\n }\n }\n\n return $arrVersions;\n }", "public function updated(SubCategories $subCategories)\n {\n //\n }", "function rinstall() {\n\t\t$versionPath = $this->getVersionPath();\n//\t\tdebug($versionPath);\n\t\t/** @var Repo $repo */\n\t\tforeach ($this->repos as $repo) {\n\t\t\techo BR, '## ', $repo->path(), BR;\n\t\t\tif ($this->rexists($repo->path())) {\n\t\t\t\t$deployPath = $versionPath . '/' . $repo->path();\n\t\t\t\t$cmd = 'cd ' . $deployPath . ' && hg update -r ' . $repo->getHash();\n\t\t\t\t$this->ssh_exec($cmd);\n\t\t\t} else {\n\t\t\t\techo 'Error: '.$repo->path.' is not on the server. Maybe do rdeploy?', BR;\n\t\t\t}\n\t\t}\n\t}", "public function updateInternals(): int\n {\n $this->logManager->logMessage(lang('Revision.updateInternals'));\n\n try {\n return $this->upgrader->upgrade($this->config->rootPath);\n } catch (RevisionException $e) {\n $this->logManager->logMessage($e->getMessage(), 'error');\n\n return EXIT_ERROR;\n }\n }", "public function load_modules() {\n\t\tforeach ( $this->modules as $module_name ) {\n\t\t\t$module = $this->build( $module_name );\n\t\t\tif ( $module !== null ) {\n\t\t\t\t$module->init();\n\t\t\t}\n\t\t}\n\t}", "function update_module_option($mod_name, $key, $value) {\n $this->modules->$mod_name->options->$key = $value;\n $new_options = $this->modules->$mod_name->options;\n $result = update_option($this->clientele_prefix . $mod_name . '_options', (array) $new_options);\n $this->$mod_name->module = $this->modules->$mod_name;\n return $result;\n }", "public function update(StructureProjectRequest $request)\n {\n $level = ProjectStructure::findOrFail($request->id);\n $level->update($request->all());\n }", "public static function gitUpdate()\n {\n // The commands\n $commands = array(\n 'echo $PWD',\n 'whoami',\n 'git update-index --skip-worktree common/config/options.php',\n 'git reset --hard HEAD',\n 'git pull origin master',\n 'git status',\n 'git submodule sync',\n 'git submodule update',\n 'git submodule status',\n );\n // Run the commands for output\n $output = '';\n foreach ($commands as $command) {\n // Run it\n $tmp = shell_exec($command);\n // Output\n $output .= \"<span style=\\\"color: #6BE234;\\\">\\$</span> <span style=\\\"color: #729FCF;\\\">{$command}\\n</span>\";\n $output .= htmlentities(trim($tmp)) . \"\\n\";\n }\n return $output;\n }" ]
[ "0.78061587", "0.66783696", "0.6390542", "0.62719834", "0.5881708", "0.5810785", "0.5622145", "0.55818105", "0.5494828", "0.5488211", "0.53674996", "0.5318555", "0.52571756", "0.52282876", "0.51543033", "0.5151238", "0.5116333", "0.5109451", "0.51068336", "0.5104505", "0.50809515", "0.5059631", "0.50398153", "0.5002529", "0.49395606", "0.49377453", "0.49304488", "0.49300015", "0.49292156", "0.49039522", "0.48997977", "0.48389673", "0.48375422", "0.48291418", "0.4825955", "0.48212415", "0.4813567", "0.480977", "0.48086658", "0.48057154", "0.48033994", "0.4799506", "0.4797118", "0.4787462", "0.47824955", "0.47813004", "0.47783956", "0.4773011", "0.47719455", "0.47692868", "0.47530258", "0.47527295", "0.47217616", "0.47163752", "0.4712375", "0.4710109", "0.4709397", "0.47077397", "0.47066364", "0.4697966", "0.46927342", "0.46872756", "0.46780428", "0.46654913", "0.4664006", "0.46625128", "0.4655789", "0.46480414", "0.46462137", "0.46310776", "0.46310776", "0.4631041", "0.4629813", "0.46245563", "0.46228653", "0.46193457", "0.46191213", "0.46141902", "0.46112016", "0.460829", "0.4599227", "0.45922968", "0.45902386", "0.45876405", "0.45729354", "0.45646507", "0.45630988", "0.45534852", "0.45517096", "0.4551021", "0.4550618", "0.45440188", "0.45310524", "0.45294446", "0.4523883", "0.45092648", "0.4508013", "0.45042756", "0.45009515", "0.44976288" ]
0.53861505
10
Clone a git repository.
function git_clone($repo, $path, $initSubModules = false) { GitUtil::cloneRepo($repo, $path, $initSubModules); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function gitClone()\n\t{\n\t\t$repoURL = 'https://github.com/' . $this->getUserName() . '/' . $this->getProjectName() . '.git';\n\t\t$path = $this->getPath();\n\t\t$this->gitWrapper->clone($repoURL, $path);\n\t}", "public function cloneGitRepo($repo, $dir);", "public function cloneRepo($repo)\n {\n return $this->passthru('git', ['clone', '[email protected]:' . $repo]);\n }", "public function gitCloneRepositories() {\n\t\t$count = 0;\n\n\t\t$packages = $this->Package->find('list');\n\t\tforeach ($packages as $id => $name) {\n\t\t\t$this->out(sprintf(__(\"* Downloading package %s\"), $name));\n\t\t\tif ($this->Package->setupRepository($id)); {\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\t\t$this->out(sprintf(__('* Downloaded %s of %s repositories'), $count, count($packages)));\n\t}", "public function cloneRepository();", "public function cloneRepository($url, $directory = NULL, array $params = NULL)\n\t\t{\n\t\t\tif ($directory !== NULL && is_dir(\"$directory/.git\")) {\n\t\t\t\tthrow new GitException(\"Repo already exists in $directory.\");\n\t\t\t}\n\n\t\t\t$cwd = $this->runner->getCwd();\n\n\t\t\tif ($directory === NULL) {\n\t\t\t\t$directory = Helpers::extractRepositoryNameFromUrl($url);\n\t\t\t\t$directory = \"$cwd/$directory\";\n\n\t\t\t} elseif(!Helpers::isAbsolute($directory)) {\n\t\t\t\t$directory = \"$cwd/$directory\";\n\t\t\t}\n\n\t\t\tif ($params === NULL) {\n\t\t\t\t$params = '-q';\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t$this->run($cwd, [\n\t\t\t\t\t'clone',\n\t\t\t\t\t$params,\n\t\t\t\t\t'--end-of-options',\n\t\t\t\t\t$url,\n\t\t\t\t\t$directory\n\t\t\t\t]);\n\n\t\t\t} catch (GitException $e) {\n\t\t\t\t$stderr = '';\n\t\t\t\t$result = $e->getRunnerResult();\n\n\t\t\t\tif ($result !== NULL && $result->hasErrorOutput()) {\n\t\t\t\t\t$stderr = implode(PHP_EOL, $result->getErrorOutput());\n\t\t\t\t}\n\n\t\t\t\tthrow new GitException(\"Git clone failed (directory $directory).\" . ($stderr !== '' ? (\"\\n$stderr\") : ''));\n\t\t\t}\n\n\t\t\treturn $this->open($directory);\n\t\t}", "protected function cloneScmRepository()\n\t{\n\t\t// Get Git credentials\n\t\tif (!$this->rocketeer->hasCredentials() and !$this->rocketeer->usesSsh()) {\n\t\t\t$username = $this->command->ask('What is your SCM username ?');\n\t\t\t$password = $this->command->secret('And your password ?');\n\t\t\t$repository = $this->rocketeer->getRepository($username, $password);\n\t\t} else {\n\t\t\t$repository = $this->rocketeer->getRepository();\n\t\t}\n\n\t\t// Clone release\n\t\t$branch = $this->rocketeer->getRepositoryBranch();\n\t\treturn $this->cloneRepository($repository, $branch);\n\t}", "public static function cloneRepo($repo, $path, $initSubModules = false) {\n\t\t$cloneCmd = sprintf(self::CLONE_CMD_TMPL,\n\t\t\t$repo,\n\t\t\t$path);\n\t\tpassthru($cloneCmd);\n\n\t\tif ($initSubModules) {\n\t\t\tself::initSubmodules($path);\n\t\t}\n\t}", "function do_clone($key,$url,$path) {\n $cmd = \"ssh-agent bash -c 'ssh-add $key; git clone $url $path' 2>&1\";\n _log(\"Exec command: $cmd\\n\");\n return shell_exec($cmd);\n}", "protected function cloneRepoToTempDirectory(): void {\n\t\t$this->gitRepository->clone(\n\t\t\t$this->settings->getRepoUri(),\n\t\t\t$this->settings->getTempPath(),\n\t\t\t$this->settings->getRepoBranch()\n\t\t)->removeGitConfig( $this->settings->getTempPath() . '/.git' );\n\t}", "public function cloneRepository($destination = null)\n\t{\n\t\tif (!$destination) {\n\t\t\t$destination = $this->releasesManager->getCurrentReleasePath();\n\t\t}\n\n\t\t// Executing checkout\n\t\t$this->command->info('Cloning repository in \"' .$destination. '\"');\n\t\t$output = $this->scm->execute('checkout', $destination);\n\t\t$this->history[] = $output;\n\n\t\t// Cancel if failed and forget credentials\n\t\t$success = $this->checkStatus('Unable to clone the repository', $output) !== false;\n\t\tif (!$success) {\n\t\t\t$this->server->forgetValue('credentials');\n\n\t\t\treturn false;\n\t\t}\n\n\t\t// Deploy submodules\n\t\t$this->command->info('Initializing submodules if any');\n\t\t$this->runForCurrentRelease($this->scm->submodules());\n\n\t\treturn $success;\n\t}", "protected function freshClone($branch = false, $depth = false)\n {\n $fs = new Filesystem();\n if (is_dir($this->dir)) {\n $fs->remove($this->dir);\n }\n $fs->mkdir(dirname($this->dir));\n\n $branchTerm = $branch ? \"--branch=$branch \" : '';\n $depthTerm = $depth ? \"--depth=$depth \" : '';\n exec(\"git clone '{$this->url()}' $branchTerm$depthTerm'{$this->dir}' 2>/dev/null\", $output, $result);\n\n // Fail if we could not clone.\n if ($result) {\n $project = $this->projectWithOrg();\n throw new \\Exception(\"Could not clone $project: git failed with exit code $result\");\n }\n }", "public function clone_from($source) {\n\t\t\treturn $this->run(\"clone --local $source \".$this->repo_path);\n\t\t}", "public function init() {\n $git_wrapper = new \\GitWrapper\\GitWrapper();\n if (file_exists($this->directory)) {\n $this->git = $git_wrapper->workingCopy($this->directory);\n $this->git->checkout($this->branch);\n }\n else {\n $this->git = $git_wrapper->cloneRepository($this->getRepositoryURL(), $this->directory, ['branch' => $this->branch]);\n }\n }", "public function createGit()\n {\n if($GLOBALS['TL_CONFIG']['bx_git_path'])\n {\n $gitPath = TL_ROOT.$GLOBALS['TL_CONFIG']['bx_git_path'];\n }else{\n $gitPath = TL_ROOT.\"/\";\n }\n\n $git = new GitPhp\\GitRepository($gitPath);\n $git->init()->execute();\n \n //Set Remote\n $url = explode(\"://\", $GLOBALS['TL_CONFIG']['bx_git_host_url']);\n $git->remote()->setUrl('origin', $url[0].\"://\".$GLOBALS['TL_CONFIG']['bx_git_host_user'].\":\".$GLOBALS['TL_CONFIG']['bx_git_host_pass'].\"@\".$url[1]);\n }", "function rclone() {\n\t\t$this->checkOnce();\n\t\t$versionPath = $this->getVersionPath();\n\t\t$paths = $this->getMain()->getPaths();\n\t\t$default = $paths['default'];\n\t\t$remoteCmd = 'cd '.$versionPath.' && hg clone '.$default .' .';\n\t\t$this->ssh_exec($remoteCmd);\n\t}", "private function _fetchGitRepository($url, $ref = 'master')\n\t{\n\t\t// Create a Git repository object within the system tmp folder for the url.\n\t\t$root = sys_get_temp_dir() . md5($url);\n\n\t\t// If the folder doesn't exist attempt to create it.\n\t\tif (!is_dir($root))\n\t\t{\n\t\t\tmkdir($root, 0777, true);\n\t\t}\n\n\t\t// Instantiate the repository object.\n\t\t$repo = new PackagerGitRepository($root);\n\n\t\t// Only clone the repository if it doesn't exist.\n\t\tif (!$repo->exists())\n\t\t{\n\t\t\t$repo->create();\n\t\t}\n\n\t\t// Get a clean checkout of the branch/tag required.\n\t\t$repo->fetch()\n\t\t\t->branchCheckout($ref)\n\t\t\t->clean();\n\n\t\treturn $root;\n\t}", "public function cloneRepository(Server $server, Application $application)\n {\n try {\n $this->getUser();\n\n $server->exec(\n view('scripts.deployments.bitbucket-deployment', [\n 'application' => $application,\n 'access_token' => $this->sourceProvider->access_token\n ])->render()\n ); \n } catch (ClientException $e) {\n if ($e->getResponse()->getStatusCode() === 401) {\n if ($this->retries <= $this->maxRetries) {\n $this->retries = $this->retries + 1;\n $this->refreshToken();\n }\n }\n }\n }", "public static function &clone_remote($repo_path, $remote, $reference = null) {\n\t\t\treturn GitRepo::create_new($repo_path, $remote, true, $reference);\n\t\t}", "public function cloneAndConfig()\n {\n if (! is_dir($this->directory)) {\n try {\n $this->git->cloneRepository()->execute($this->repo_url);\n $this->git->remote()->add(\n $this->client_remote,\n $this->client_remote_url\n )->execute();\n\n $this->git->fetch()->execute($this->client_remote);\n\n if (! file_put_contents($this->config_file,\n $this->user_config, FILE_APPEND)) {\n $this->logger->error('Can\\'t write Git config file');\n }\n } catch (GitException $e) {\n $this->logger->error('Failed to clone or config Git repository. '\n . 'Error: ' . $e->getMessage());\n }\n }\n }", "public static function open($repo_path) {\n\t\t\treturn new GitRepo($repo_path);\n\t\t}", "public function create($remote = 'http://github.com/joomla/joomla-platform.git')\n\t{\n\t\t// Initialize variables.\n\t\t$out = array();\n\t\t$return = null;\n\n\t\t// We add the users repo to our remote list if it isn't already there\n\t\tif (!file_exists($this->_root . '/.git'))\n\t\t{\n\t\t\t// Execute the command.\n\t\t\texec('git clone -q ' . escapeshellarg($remote) . ' ' . escapeshellarg($this->_root), $out, $return);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new InvalidArgumentException('Repository already exists at ' . $this->_root . '.');\n\t\t}\n\n\t\t// Validate the response.\n\t\tif ($return !== 0)\n\t\t{\n\t\t\tthrow new RuntimeException(sprintf('The clone failed from remote %s with code %d and message %s.', $remote, $return, implode(\"\\n\", $out)));\n\t\t}\n\n\t\treturn $this;\n\t}", "public static function &create($repo_path, $source = null) {\n\t\t\treturn GitRepo::create_new($repo_path, $source);\n\t\t}", "public static function &create_new($repo_path, $source = null, $remote_source = false, $reference = null) {\n\t\t\tif (is_dir($repo_path) && file_exists($repo_path.\"/.git\") && is_dir($repo_path.\"/.git\")) {\n\t\t\t\tthrow new Exception('\"'.$repo_path.'\" is already a git repository');\n\t\t\t} else {\n\t\t\t\t$repo = new self($repo_path, true, false);\n\t\t\t\tif (is_string($source)) {\n\t\t\t\t\tif ($remote_source) {\n\t\t\t\t\t\tif (!is_dir($reference) || !is_dir($reference.'/.git')) {\n\t\t\t\t\t\t\tthrow new Exception('\"'.$reference.'\" is not a git repository. Cannot use as reference.');\n\t\t\t\t\t\t} else if (strlen($reference)) {\n\t\t\t\t\t\t\t$reference = realpath($reference);\n\t\t\t\t\t\t\t$reference = \"--reference $reference\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$repo->clone_remote($source, $reference);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$repo->clone_from($source);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$repo->run('init');\n\t\t\t\t}\n\t\t\t\treturn $repo;\n\t\t\t}\n\t\t}", "public function getGitCloneLocation()\n {\n return $this->gitCloneLocation;\n }", "private function syncRepository()\n {\n $cwd = '/tmp/'.$this->migrationId;\n (new ProcessBuilder(['mkdir']))->add('-p')->add($cwd)->getProcess()->mustRun();\n\n $cloneSourceCommandBuilder = new ProcessBuilder(['git', 'clone', $this->sourceProject->getSshUrlToRepo(), '.']);\n $cloneSourceCommandBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $addNewRemoteBuilder = new ProcessBuilder(['git', 'remote', 'add', 'new']);\n $addNewRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->add($this->targetProject->getSshUrlToRepo())\n ->getProcess()\n ->mustRun();\n\n $pushToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--all']);\n $pushToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $pushTagsToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--tags']);\n $pushTagsToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n }", "protected function setupGitRepo()\n {\n $td = $this->getTestDir();\n\n $this->fs->removeDirectory($td);\n $this->fs->ensureDirectoryExists($td);\n\n $currentWorkDir = getcwd();\n chdir($td);\n\n $result = $this->process->execute(\"git init -q\");\n if ($result > 0) {\n throw new \\RuntimeException(\n \"Could not init: \" . $this->process->getErrorOutput());\n }\n $result = file_put_contents('b', 'a');\n if (false === $result) {\n throw new \\RuntimeException(\"Could not save file.\");\n }\n $result = $this->process->execute(\"git add b && git commit -m 'commit b' -q\");\n if ($result > 0) {\n throw new \\RuntimeException(\n \"Could not init: \" . $this->process->getErrorOutput());\n }\n chdir($currentWorkDir);\n }", "public function testGitLabRemoteRepository(): void\n {\n $repo = new GitLabRemoteRepository('r/r', './');\n $this->assertEquals('https://gitlab.com/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "final private function __clone() {}", "final private function __clone() {}", "final private function __clone() {}", "final private function __clone() {}", "private function createRepository()\n {\n $this->output->write('Creating repository... ');\n\n try {\n $versionControlRepository = ($this->config->scm->type == 'gitlab') ?\n new VersionControlRepositoryGitLab($this->config) : new VersionControlRepositoryGitHub($this->config);\n $versionControlRepository->create($this->project);\n\n $this->output->writeln('<info>OK</info>');\n } catch (\\Exception $e) {\n $message = 'Error: '. $e->getMessage();\n $this->output->writeln('<error>'. $message .'</error>');\n throw new \\RuntimeException($message);\n }\n }", "protected function getRepository() {\n\t\tif ($this->_repository === null) {\n\t\t\t$this->_repository = new AGitRepository();\n\t\t\t$this->_repository->setPath($this->path,true,true);\n\t\t\t$this->assertTrue(file_exists($this->path));\n\t\t}\n\t\treturn $this->_repository;\n\t}", "public function cloneIfNecessary($branch = false, $depth = false)\n {\n // If the directory exists, we have already validated that it points\n // at the correct repository.\n if (!is_dir($this->dir)) {\n $this->freshClone($branch, $depth);\n }\n // Make sure that we are on 'master' (or the specified branch) and up-to-date.\n $branchTerm = $branch ?: 'master';\n exec(\"git -C '{$this->dir}' reset --hard 2>/dev/null\", $output, $result);\n exec(\"git -C '{$this->dir}' checkout $branchTerm 2>/dev/null\", $output, $result);\n exec(\"git -C '{$this->dir}' pull origin $branchTerm 2>/dev/null\", $output, $result);\n }", "public function clone_remote($source, $reference) {\n\t\t\treturn $this->run(\"clone $reference $source \".$this->repo_path);\n\t\t}", "public function clone_to($target) {\n\t\t\treturn $this->run(\"clone --local \".$this->repo_path.\" $target\");\n\t\t}", "public function createReference($repository) { \n if ( $repository->exists() ) {\n throw new GitBackendException('Repository already exists');\n } \n $path = $repository->getPath();\n //create git root if does not exist\n $this->createGitRoot();\n //create project dir if does not exists\n $this->createProjectRoot($repository);\n $path = $this->getGitRootPath().DIRECTORY_SEPARATOR.$path;\n mkdir($path, 0770, true);\n chdir($path);\n $this->getDriver()->init($bare=true);\n\n return $this->setUpRepository($repository);\n }", "final private function __clone() { }", "final private function __clone() { }", "public function getGitRepository(): string\n {\n return 'https://github.com/Sylius/Sylius.git';\n }", "public function __clone();", "public function __clone();", "public function setRepository($var)\n {\n GPBUtil::checkString($var, True);\n $this->repository = $var;\n\n return $this;\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() {}", "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() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "function do_clone_or_pull($key, $url, $path, $operation) {\n // Already a git repo there. Do a pull.\n if ((is_dir($path)) && (file_exists($path . \"/.git\"))) {\n\tif($operation==\"TAG\"){\n\t\treturn do_fetch($key,$url,$path);\n\t}\n\telse{\n\t\treturn do_pull($key,$url,$path);\n\t}\n }\n \n // Try a clone\n $out = do_clone($key,$url,$path);\n if (!is_dir($path)) {\n $out .= \"\\nClone appeared to fail.\\n\";\n }\n return $out;\n}", "protected function makeRepository()\n {\n if ($this->files->exists($path = $this->getRepositoryPath())) {\n return $this->error($this->className . ' already exists!');\n }\n $this->makeDirectory($path);\n $this->files->put($path, $this->compileRepositoryStub());\n $this->info('Repository created successfully.');\n }", "private function __clone()\r\n {}", "protected function pull()\n {\n $local_repo = $this->getLocalRepoPath();\n if (!is_dir($local_repo))\n {\n if(!mkdir($local_repo, 0777, true))\n {\n throw new Exception('Could not create directory '.$local_repo);\n }\n $this->execute('clone', array($this->getRemoteScmUrl(), $local_repo));\n }\n else\n {\n $cwd = getcwd();\n chdir($local_repo);\n $this->execute('pull', array(), array());\n chdir($cwd);\n }\n }", "protected function createRepository()\n {\n $repositoryOptions = [\n 'repository' => $this->info['repositoryName'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'parent',\n 'uploads',\n 'data',\n 'int',\n 'float',\n 'bool',\n ]);\n\n $this->call('engez:repository', array_merge($repositoryOptions, $options));\n }", "public static function getCloneUrl($module_name) {\n\n $module_path = conf::pathModules() . \"/$module_name\";\n if (!file_exists($module_path)) {\n common::echoStatus('NOTICE', 'y', \"module $module_name has no module source\");\n return false;\n }\n\n $command = \"cd $module_path && git config --get remote.origin.url\";\n $ret = common::execCommand($command, array('silence' => 1), 0);\n if ($ret == 0) {\n $git_url = shell_exec($command);\n return trim($git_url);\n }\n return false;\n }", "public function setGitCloneLocation($gitCloneLocation)\n {\n $this->gitCloneLocation = $gitCloneLocation;\n\n return $this;\n }", "final public function __clone() {}", "public function repository(string $targetPath, string $repoUrl): VcsRepository\n {\n if (preg_match(\"/^mock\\@(.*)$/\", $repoUrl, $matches)) {\n if (!DEV_MODE) {\n throw new InvalidArgumentException(\"Mock repositories '$repoUrl' are allowed only in dev-mode\");\n }\n return new MockVcsRepository($matches[1], $targetPath);\n }\n if (preg_match(\"/^(?<user>[a-z0-9_\\-]+)@(?<host>[a-z0-9\\-\\.]+)\\:(?<path>.*?)(\\?(?<params>.*))?$/\", $repoUrl, $matches)) {\n if (isset($matches[\"params\"])) {\n $opts = phore_parse_url($repoUrl);\n\n // Load the key from file\n $sshKeyFile = $opts->getQueryVal(\"ssh_priv_key_file\", null);\n if ($sshKeyFile !== null) {\n $this->sshPrivKey = phore_file($sshKeyFile)->get_contents();\n }\n\n // Load the key directly from parameter\n $sshKey = $opts->getQueryVal(\"ssh_priv_key\", null);\n if ($sshKey !== null) {\n $this->sshPrivKey = $sshKey;\n }\n }\n\n $url = $matches[\"user\"] . \"@\" . $matches[\"host\"] . \":{$matches[\"path\"]}\";\n\n return new SshGitRepository($url, $targetPath, $this->commitUserName, $this->commitEmail, $this->sshPrivKey);\n }\n if (preg_match(\"/^https.*$/\", $repoUrl)) {\n $opts = phore_parse_url($repoUrl);\n\n // Load the key from file\n $authUser = $opts->getQueryVal(\"auth_user\", null);\n if ($authUser !== null) {\n $this->gitUser = $opts->getQueryVal(\"auth_user\");\n }\n\n // Load the key directly from file\n $passFile = $opts->getQueryVal(\"auth_pass_file\", null);\n if ($passFile !== null) {\n $this->gitPassword = phore_file($passFile)->get_contents();\n }\n\n // Load the key directly from parameter\n $pass = $opts->getQueryVal(\"auth_pass\", null);\n if ($pass !== null) {\n $this->gitPassword = $pass;\n }\n\n $urlWithoutOpts = $opts->withQueryParams();\n\n return new HttpsGitRepository((string)$urlWithoutOpts, $targetPath, $this->commitUserName, $this->commitEmail, $this->gitUser,$this->gitPassword);\n }\n throw new InvalidArgumentException(\"Cannot determine repository type: $repoUrl\");\n }", "public function clone()\n {\n Az::debug($this->newName, 'cloning directories');\n $this->load(self::mode['clone']);\n\n $this->appCopy();\n\n // updating /service/ALL/App.php and\n // launch norms\n Az::$app->smart->service->serviceAdd($this->newName);\n\n Az::debug($this->newName, 'cloning DB & tables');\n $this->createDb();\n\n Az::debug($this->newName, 'excuting insert apply cmd');\n $this->insertCreateFunc();\n $this->insertCloneFolder();\n $this->insertApplyFunc();\n $this->fillDb();\n\n Az::debug($this->newName, 'excuting page run cmd');\n $this->callPageRunCmd();\n\n Az::debug($this->newName, 'adding domain name into hosts');\n $this->addDomainNameIntoHosts();\n\n Az::debug($this->newName, 'updating nginx');\n $this->updateNgnix(false);\n }", "function __clone()\n {\n\t\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() { }", "private function __clone() { }", "final private function __clone()\n {\n }", "final private function __clone()\n {\n }", "protected static function getGitWrapper() {\n\t\t$dir = self::getGitDir();\n\t\tif ( !self::$git ) {\n\t\t\tself::$git = new GitWrapper();\n\n\t\t\t$extDir = MediaWikiServices::getInstance()->getMainConfig()->get( \"ExtensionDirectory\" );\n\t\t\tself::$git->setEnvVar( \"PERL5LIB\", \"$extDir/MABS/lib/mediawiki-git-remote/lib:\"\n\t\t\t\t\t\t\t\t . \"$extDir/MABS/lib/mediawiki-git-remote/localcpan\" );\n\t\t\tself::$git->setEnvVar( \"GIT_EXEC_PATH\", \"$extDir/MABS/lib/mediawiki-git-remote:\"\n\t\t\t\t\t\t\t\t . \"/usr/lib/git-core\" );\n\t\t\tself::$git->setEnvVar( \"GIT_MW_DEBUG\", \"1\" );\n\t\t\tself::$git->setEnvVar( \"GIT_TRACE\", \"0\" );\n\t\t\tif ( !chdir( $dir ) ) {\n\t\t\t\tthrow new ErrorPageError( \"mabs-system-error\", \"mabs-no-chdir\", $dir );\n\t\t\t}\n\t\t}\n\t\treturn self::$git->workingCopy( $dir );\n\t}", "function __clone()\n {\n }", "function __clone()\n {\n }", "public function __clone() {}", "public function __clone() {}", "public function __clone() {}" ]
[ "0.8578521", "0.78792316", "0.73362905", "0.69668597", "0.6939361", "0.6843659", "0.66879785", "0.6475043", "0.6275234", "0.6263388", "0.62075794", "0.6189465", "0.61308616", "0.613023", "0.60807574", "0.6034997", "0.5917917", "0.5759873", "0.57526803", "0.5695389", "0.5635467", "0.55655175", "0.5463669", "0.54590833", "0.54404414", "0.53466606", "0.53061545", "0.5305298", "0.5252801", "0.5252801", "0.5252801", "0.5252801", "0.52520245", "0.52368164", "0.5231535", "0.5217674", "0.52145773", "0.52037275", "0.5187882", "0.5187882", "0.5175665", "0.51719093", "0.51719093", "0.51695037", "0.515224", "0.515224", "0.515224", "0.515224", "0.515224", "0.515224", "0.515224", "0.515224", "0.515224", "0.515224", "0.515224", "0.515224", "0.515224", "0.515224", "0.515224", "0.515224", "0.515224", "0.515224", "0.515224", "0.515224", "0.515224", "0.515224", "0.515224", "0.515224", "0.515224", "0.5130676", "0.5128958", "0.51211935", "0.5120058", "0.5089118", "0.507342", "0.50574183", "0.5049297", "0.50373113", "0.5034659", "0.5024431", "0.5017804", "0.50159925", "0.5015711", "0.5015711", "0.5015711", "0.5015711", "0.5015711", "0.5015711", "0.5015711", "0.5015711", "0.5015711", "0.5015711", "0.5015598", "0.5015598", "0.49998477", "0.49960557", "0.49960557", "0.4993006", "0.4993006", "0.4993006" ]
0.79512674
1
Export a git repository.
function git_export($path, $output, $prefix = null, $version = 'HEAD') { if ($prefix === null) { $prefix = basename($output); $output = dirname($output); } GitUtil::export($path, $output, $prefix, $version); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drush_cmi_config_export_git() {\n drush_cmi_config_export();\n drush_shell_exec_interactive('git add -p ' . config_get_config_directory('export'));\n}", "public function gitCloneRepositories() {\n\t\t$count = 0;\n\n\t\t$packages = $this->Package->find('list');\n\t\tforeach ($packages as $id => $name) {\n\t\t\t$this->out(sprintf(__(\"* Downloading package %s\"), $name));\n\t\t\tif ($this->Package->setupRepository($id)); {\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\t\t$this->out(sprintf(__('* Downloaded %s of %s repositories'), $count, count($packages)));\n\t}", "public function cloneGitRepo($repo, $dir);", "public function createGit()\n {\n if($GLOBALS['TL_CONFIG']['bx_git_path'])\n {\n $gitPath = TL_ROOT.$GLOBALS['TL_CONFIG']['bx_git_path'];\n }else{\n $gitPath = TL_ROOT.\"/\";\n }\n\n $git = new GitPhp\\GitRepository($gitPath);\n $git->init()->execute();\n \n //Set Remote\n $url = explode(\"://\", $GLOBALS['TL_CONFIG']['bx_git_host_url']);\n $git->remote()->setUrl('origin', $url[0].\"://\".$GLOBALS['TL_CONFIG']['bx_git_host_user'].\":\".$GLOBALS['TL_CONFIG']['bx_git_host_pass'].\"@\".$url[1]);\n }", "private function _fetchGitRepository($url, $ref = 'master')\n\t{\n\t\t// Create a Git repository object within the system tmp folder for the url.\n\t\t$root = sys_get_temp_dir() . md5($url);\n\n\t\t// If the folder doesn't exist attempt to create it.\n\t\tif (!is_dir($root))\n\t\t{\n\t\t\tmkdir($root, 0777, true);\n\t\t}\n\n\t\t// Instantiate the repository object.\n\t\t$repo = new PackagerGitRepository($root);\n\n\t\t// Only clone the repository if it doesn't exist.\n\t\tif (!$repo->exists())\n\t\t{\n\t\t\t$repo->create();\n\t\t}\n\n\t\t// Get a clean checkout of the branch/tag required.\n\t\t$repo->fetch()\n\t\t\t->branchCheckout($ref)\n\t\t\t->clean();\n\n\t\treturn $root;\n\t}", "function write_zip($repo) {\n $p = basename($repo);\n $proj = explode(\".\", $p);\n $proj = $proj[0];\n //TODO: clean this up\n exec(\"cd /tmp && git-clone $repo && rm -Rf /tmp/$proj && zip -r $proj.zip $proj && rm -Rf /tmp/$proj\");\n\n $filesize = filesize(\"/tmp/$proj.zip\");\n header(\"Pragma: public\"); // required\n header(\"Expires: 0\");\n header(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n header(\"Cache-Control: private\", false); // required for certain browsers\n header(\"Content-Transfer-Encoding: binary\");\n header(\"Content-Type: application/x-zip\");\n header(\"Content-Length: \" . $filesize);\n header(\"Content-Disposition: attachment; filename=\\\"$proj.zip\\\";\");\n echo file_get_contents(\"/tmp/$proj.zip\");\n die();\n}", "function git_clone($repo, $path, $initSubModules = false) {\n\tGitUtil::cloneRepo($repo, $path, $initSubModules);\n}", "protected function createRepository()\n {\n $repositoryOptions = [\n 'repository' => $this->info['repositoryName'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'parent',\n 'uploads',\n 'data',\n 'int',\n 'float',\n 'bool',\n ]);\n\n $this->call('engez:repository', array_merge($repositoryOptions, $options));\n }", "public function gitClone()\n\t{\n\t\t$repoURL = 'https://github.com/' . $this->getUserName() . '/' . $this->getProjectName() . '.git';\n\t\t$path = $this->getPath();\n\t\t$this->gitWrapper->clone($repoURL, $path);\n\t}", "public function cloneRepository();", "function write_plain($repos) {\n $repo = get_repo_path($_GET['p'], $repos);\n $hash = $_GET['h'];\n header(\"Content-Type: text/plain\");\n $str = system(\"GIT_DIR=$repo/.git git cat-file blob $hash\");\n echo $str;\n die();\n}", "public function github(){\n\n\t\t$user = '';\n\t\tif(isset($this->request->get['user'])){\n\t\t\t$user = $this->request->get['user'];\n\t\t}\n\t\t$repo = '';\n\t\tif(isset($this->request->get['repo'])){\n\t\t\t$repo = $this->request->get['repo'];\n\t\t}\n\t\t$branch = '';\n\t\tif(isset($this->request->get['branch'])){\n\t\t\t$branch = $this->request->get['branch'];\n\t\t}\n\t\tnew d_shopunity\\GitHub($user, $repo, str_replace(\"catalog/\", \"\", DIR_APPLICATION), $branch );\n\t}", "public function getGitRepository(): string\n {\n return 'https://github.com/Sylius/Sylius.git';\n }", "public function export(ExportcandidateRequest $request, candidateRepository $repository) {\n\n return $this->handleExport($request, $repository);\n }", "public function _archive_repo( $gitlab_path ) {\n\n\t\t[ 'group' => $group, 'name' => $project_name ] = $gitlab_path; // php 7.1 🚀\n\n\t\tif ( ! empty( $project_name ) ) {\n\n\t\t\tarchive_repo_by_id( rawurlencode( $group . '/' . $project_name ) );\n\n\t\t} else {\n\n\t\t\t$projects_data = get_projects( $gitlab_path );\n\n\t\t\tforeach ( $projects_data as $project ) {\n\n\t\t\t\t$this->_display_project_data( $project, 'Archiving' );\n\n\t\t\t\tarchive_repo_by_id( $project['id'] );\n\t\t\t}\n\t\t}\n\t}", "function prueba_git ()\r\n{\r\n\t/* Aqui estaria el codigo de la funcion */\r\n\r\n}", "public function store()\n {\n $validated = request()->validate([\n 'name' => ['required', 'regex:/^[A-Za-z0-9_]*$/']\n ]);\n\n $repository = new Repository();\n $repository->name = $validated['name'];\n\n chdir('D:\\repositories');\n// file_put_contents('conf/gitolite.conf', $lines);// insert gitolite.conf\n// shell_exec('git config user.email tarc@admin');\n// shell_exec('git config user.name TARC_Admin');\n// shell_exec('git add conf/gitolite.conf');\n// shell_exec('git commit -m '.Staff::where('user_id', Auth::user()->id)->first()->staff_id);\n// shell_exec('git pull');\n// shell_exec('git push');\n shell_exec('git clone '. config('gitolite.git_server_url') .':' . $repository->name);\n// $output = shell_exec('rm -rf '.escapeshellarg($repository->name));\n// dd($output);\n return redirect('repositories')->with('success', 'Your '.$repository->name . ' repository has been created.');;\n }", "public function testGitLabRemoteRepository(): void\n {\n $repo = new GitLabRemoteRepository('r/r', './');\n $this->assertEquals('https://gitlab.com/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "public function createReference($repository) { \n if ( $repository->exists() ) {\n throw new GitBackendException('Repository already exists');\n } \n $path = $repository->getPath();\n //create git root if does not exist\n $this->createGitRoot();\n //create project dir if does not exists\n $this->createProjectRoot($repository);\n $path = $this->getGitRootPath().DIRECTORY_SEPARATOR.$path;\n mkdir($path, 0770, true);\n chdir($path);\n $this->getDriver()->init($bare=true);\n\n return $this->setUpRepository($repository);\n }", "protected function svnExport($path) \n {\n $absolute_path = $this->absolutePath($path);\n\n $this->log('svn export: ' \n . shell_exec(\"svn export {$this->ullright_repo_url}/{$path} {$absolute_path}\"));\n }", "public function testGitHubRemoteRepository(): void\n {\n $repo = new GitHubRemoteRepository('r/r', './');\n $this->assertEquals('https://github.com/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "private function createRepository()\n {\n $this->output->write('Creating repository... ');\n\n try {\n $versionControlRepository = ($this->config->scm->type == 'gitlab') ?\n new VersionControlRepositoryGitLab($this->config) : new VersionControlRepositoryGitHub($this->config);\n $versionControlRepository->create($this->project);\n\n $this->output->writeln('<info>OK</info>');\n } catch (\\Exception $e) {\n $message = 'Error: '. $e->getMessage();\n $this->output->writeln('<error>'. $message .'</error>');\n throw new \\RuntimeException($message);\n }\n }", "public function repo($dir, $remote);", "public function pushRepository($dir, $target_project);", "public function export();", "public function export();", "public function export();", "public function export();", "public function export();", "protected function setupGitRepo()\n {\n $td = $this->getTestDir();\n\n $this->fs->removeDirectory($td);\n $this->fs->ensureDirectoryExists($td);\n\n $currentWorkDir = getcwd();\n chdir($td);\n\n $result = $this->process->execute(\"git init -q\");\n if ($result > 0) {\n throw new \\RuntimeException(\n \"Could not init: \" . $this->process->getErrorOutput());\n }\n $result = file_put_contents('b', 'a');\n if (false === $result) {\n throw new \\RuntimeException(\"Could not save file.\");\n }\n $result = $this->process->execute(\"git add b && git commit -m 'commit b' -q\");\n if ($result > 0) {\n throw new \\RuntimeException(\n \"Could not init: \" . $this->process->getErrorOutput());\n }\n chdir($currentWorkDir);\n }", "public function export(ExportUserRequest $request, UserRepository $repository) {\n\n return $this->handleExport($request, $repository);\n }", "function do_clone($key,$url,$path) {\n $cmd = \"ssh-agent bash -c 'ssh-add $key; git clone $url $path' 2>&1\";\n _log(\"Exec command: $cmd\\n\");\n return shell_exec($cmd);\n}", "function export( $id, $format, $back_url ) {\n\t\t\n\t}", "public function testGitLabRemoteRepositoryExternal(): void\n {\n $repo = new GitLabRemoteRepository('r/r', './', 'https://salsa.debian.org/');\n $this->assertEquals('https://salsa.debian.org/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "private function syncRepository()\n {\n $cwd = '/tmp/'.$this->migrationId;\n (new ProcessBuilder(['mkdir']))->add('-p')->add($cwd)->getProcess()->mustRun();\n\n $cloneSourceCommandBuilder = new ProcessBuilder(['git', 'clone', $this->sourceProject->getSshUrlToRepo(), '.']);\n $cloneSourceCommandBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $addNewRemoteBuilder = new ProcessBuilder(['git', 'remote', 'add', 'new']);\n $addNewRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->add($this->targetProject->getSshUrlToRepo())\n ->getProcess()\n ->mustRun();\n\n $pushToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--all']);\n $pushToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $pushTagsToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--tags']);\n $pushTagsToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n }", "public static function open($repo_path) {\n\t\t\treturn new GitRepo($repo_path);\n\t\t}", "protected function makeRepository()\n {\n if ($this->files->exists($path = $this->getRepositoryPath())) {\n return $this->error($this->className . ' already exists!');\n }\n $this->makeDirectory($path);\n $this->files->put($path, $this->compileRepositoryStub());\n $this->info('Repository created successfully.');\n }", "public function createExport();", "public function init() {\n $git_wrapper = new \\GitWrapper\\GitWrapper();\n if (file_exists($this->directory)) {\n $this->git = $git_wrapper->workingCopy($this->directory);\n $this->git->checkout($this->branch);\n }\n else {\n $this->git = $git_wrapper->cloneRepository($this->getRepositoryURL(), $this->directory, ['branch' => $this->branch]);\n }\n }", "public function git_directory_path() {\n\t\t\treturn ($this->bare) ? $this->repo_path : $this->repo_path.\"/.git\";\n\t\t}", "function devshop_project_create_step_git($form, $form_state) {\n $project = &$form_state['project'];\n \n drupal_add_js(drupal_get_path('module', 'devshop_projects') . '/inc/create/create.js');\n \n if ($project->verify_error) {\n $form['note'] = array(\n '#markup' => t('We were unable to connect to your git repository. Check the messages, edit your settings, and try again.'),\n '#prefix' => '<div class=\"alert alert-danger\">',\n '#suffix' => '</div>',\n );\n $form['error'] = array(\n '#markup' => $project->verify_error,\n );\n \n // Check for \"host key\"\n if (strpos($project->verify_error, 'Host key verification failed')) {\n $form['help'] = array(\n '#markup' => t('Looks like you need to authorize this host. SSH into the server as <code>aegir</code> user and run the command <code>git ls-remote !repo</code>. <hr />Add <code>StrictHostKeyChecking no</code> to your <code>~/.ssh/config</code> file to avoid this for all domains in the future.', array(\n '!repo' => $project->git_url,\n )),\n '#prefix' => '<div class=\"alert alert-warning\">',\n '#suffix' => '</div>',\n );\n }\n }\n \n if (empty($project->name)) {\n $form['title'] = array(\n '#type' => 'textfield',\n '#title' => t('Project Code Name'),\n '#required' => TRUE,\n '#suffix' => '<p>' . t('Choose a unique name for your project. Only letters and numbers are allowed.') . '</p>',\n '#size' => 40,\n '#maxlength' => 255,\n );\n }\n else {\n $form['title'] = array(\n '#type' => 'value',\n '#value' => $project->name,\n );\n $form['title_display'] = array(\n '#type' => 'item',\n '#title' => t('Project Code Name'),\n '#markup' => $project->name,\n );\n }\n \n $username = variable_get('aegir_user', 'aegir');\n \n $tips[] = t('Use the \"ssh\" url whenever possible. For example: <code>[email protected]:opendevshop/repo.git</code>');\n $tips[] = t('You can use a repository with a full Drupal stack committed, but using composer is recommended.');\n $tips[] = t('Use the !link project as a starting point for Composer based projects.', [\n '!link' => l(t('DevShop Composer Template'), 'https://github.com/opendevshop/devshop-composer-template'),\n ]);\n $tips[] = t('If a composer.json file is found in the root of the project, <code>composer install</code> will be run automatically.');\n $tips = theme('item_list', array('items' => $tips));\n \n $form['git_url'] = array(\n '#type' => 'textfield',\n '#required' => 1,\n '#title' => t('Git URL'),\n '#suffix' => '<p>' . t('Enter the Git URL for your project') . '</p>' . $tips,\n '#default_value' => $project->git_url,\n '#maxlength' => 1024,\n );\n\n//\n// // Project code path.\n// $form['code_path'] = array(\n// '#type' => variable_get('devshop_projects_allow_custom_code_path', FALSE) ? 'textfield' : 'value',\n// '#title' => t('Code path'),\n// '#description' => t('The absolute path on the filesystem that will be used to create all platforms within this project. There must not be a file or directory at this path.'),\n// '#required' => variable_get('devshop_projects_allow_custom_code_path', FALSE),\n// '#size' => 40,\n// '#default_value' => $project->code_path,\n// '#maxlength' => 255,\n// '#attributes' => array(\n// 'data-base_path' => variable_get('devshop_project_base_path', '/var/aegir/projects'),\n// ),\n// );\n//\n// // Project base url\n// $form['base_url'] = array(\n// '#type' => variable_get('devshop_projects_allow_custom_base_url', FALSE) ? 'textfield' : 'value',\n// '#title' => t('Base URL'),\n// '#description' => t('All sites will be under a subdomain of this domain.'),\n// '#required' => variable_get('devshop_projects_allow_custom_base_url', FALSE),\n// '#size' => 40,\n// '#default_value' => $project->base_url,\n// '#maxlength' => 255,\n// '#attributes' => array(\n// 'data-base_url' => devshop_projects_url($project->name, ''),\n// ),\n// );\n \n // Display helpful tips for connecting.\n $pubkey = variable_get('devshop_public_key', '');\n \n // If we don't yet have the server's public key saved as a variable...\n if (empty($pubkey)) {\n $output = t(\"This DevShop doesn't yet know your server's public SSH key. To import it, run the following command on your server as <code>aegir</code> user:\");\n $command = 'drush @hostmaster vset devshop_public_key \"$(cat ~/.ssh/id_rsa.pub)\" --yes';\n $output .= \"<div class='command'><input size='160' value='$command' onclick='this.select()' /></div>\";\n }\n else {\n // @TODO: Make this Translatable\n $output = <<<HTML\n <div class=\"empty-message\">If you haven't granted this server access to your Git repository, you should do so now using it's public SSH key.</div>\n <textarea id=\"rsa\" onclick='this.select()'>$pubkey</textarea>\nHTML;\n }\n \n // Add info about connecting to Repo\n $form['connect'] = array(\n '#type' => 'fieldset',\n '#title' => t('Repository Access'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n );\n $form['connect']['public_key'] = array(\n '#markup' => $output,\n );\n return $form;\n}", "public function export() {\n $folder = $this->config->get('oxygen.mod-import-export.path');\n if(!file_exists($folder)) {\n mkdir($folder);\n }\n $path = $folder . $this->environment;\n if(!file_exists($path)) {\n mkdir($path);\n }\n\n $this->exportStrategy->create($path);\n\n foreach($this->workers as $worker) {\n $files = $worker->export($this->output);\n foreach($files as $localPath => $path) {\n $this->output->writeln('Adding file: ' . $path);\n $this->exportStrategy->addFile($path, $localPath);\n }\n }\n\n $this->exportStrategy->commit();\n\n foreach($this->workers as $worker) {\n $worker->postExport($this->output);\n }\n }", "protected function getRepository() {\n\t\tif ($this->_repository === null) {\n\t\t\t$this->_repository = new AGitRepository();\n\t\t\t$this->_repository->setPath($this->path,true,true);\n\t\t\t$this->assertTrue(file_exists($this->path));\n\t\t}\n\t\treturn $this->_repository;\n\t}", "function cvs_add_repository($cvs_user, $cvs_pass, $cvs_project) {\r\n global $cvs_root, $cvs_cmd;\r\n\r\n $cvs_dir = $cvs_root.\"/\".$cvs_project;\r\n\r\n exec($cvs_cmd.\" -d \".$cvs_dir.\" init\");\r\n\r\n cvs_add_user($cvs_user, $cvs_pass, $cvs_project);\r\n}", "function saveRepo($name) {\n\tglobal $repos, $counter;\n\t$counter++;\n\tif(!array_key_exists($name, $repos)) {\n\t\t$repos[$name] = $name;\n\t\tfile_put_contents('repos.txt', implode(\"\\r\\n\",$repos));\n\t\t//echo sizeof($repos).\"/$counter\\n\";\n\t}\n}", "function html_desc($repo, $proj) {\n\n // Check if the git repo has a description file\n if(file_exists(\"$repo/.git/description\")){\n $desc = short_desc(file_get_contents(\"$repo/.git/description\"));\n }else{\n $desc = \"No description\";\n }\n $owner = get_file_owner($repo);\n $last = get_last($repo);\n $git_clone_url = 'http://'.$_SERVER['HTTP_HOST'].'/git/'.$proj;\n \n echo \"<table>\";\n echo \"<tr><td>description</td><td>$desc</td></tr>\";\n echo \"<tr><td>owner</td><td>$owner</td></tr>\";\n echo \"<tr><td>last change</td><td>$last</td></tr>\";\n echo \"<tr><td>URL</td><td>$git_clone_url</td></tr>\";\n echo \"</table>\";\n}", "public function cloneRepo($repo)\n {\n return $this->passthru('git', ['clone', '[email protected]:' . $repo]);\n }", "public function getRepository();", "function export()\n\t{\n\t\t$zip = $this->buildExportFile();\n\t\t\n\t ilUtil::deliverFile($zip, $this->object->getTitle().\".zip\", '', false, true);\n\t}", "public function repository()\n {\n return new Eadrax\\Repository\\Project\\Add;\n }", "public function index()\n {\n $output = shell_exec('ssh [email protected] info');\n return view('repositories.index', compact('output'));\n }", "protected function download($output, $type, $name, $version = 'master')\n {\n $url = 'https://github.com/' . $this->getRepo($type);\n $this->executeCommand(\"git clone --single-branch --branch $version $url $name\", getcwd(), $output);\n return $this;\n }", "function git_is_repo($path) {\n\treturn GitUtil::isRepo($path);\n}", "public function export(ExportUserPermissionRequest $request, UserPermissionRepository $repository) {\n\n return $this->handleExport($request, $repository);\n }", "function do_fetch($key,$url,$path) {\n $cmd = \"ssh-agent bash -c 'cd $path; ssh-add $key; git fetch' 2>&1\";\n _log(\"Exec command: $cmd\\n\");\n return shell_exec($cmd);\n}", "protected function cloneRepoToTempDirectory(): void {\n\t\t$this->gitRepository->clone(\n\t\t\t$this->settings->getRepoUri(),\n\t\t\t$this->settings->getTempPath(),\n\t\t\t$this->settings->getRepoBranch()\n\t\t)->removeGitConfig( $this->settings->getTempPath() . '/.git' );\n\t}", "public function testBitBucketRemoteRepository(): void\n {\n $repo = new BitBucketRemoteRepository('r/r', './');\n $this->assertEquals('https://bitbucket.org/r/r/src/v2/src/Project.php#Project.php-30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "public function create($repository);", "public function zipball($url, $bundle, $path)\n\t{\n\t\t$work = path('storage').'github/';\n\n\t\t// When installing a bundle from a Zip archive, we'll first clone\n\t\t// down the bundle zip into the bundles \"working\" directory so\n\t\t// we have a spot to do all of our bundle extraction work.\n\t\t$target = $work.'git-repo.zip';\n\n\t\tFile::put($target, $this->download($url));\n\n\t\t$zip = new \\ZipArchive;\n\n\t\t$zip->open($target);\n\n\t\t// Once we have the Zip archive, we can open it and extract it\n\t\t// into the working directory. By convention, we expect the\n\t\t// archive to contain one root directory with the bundle.\n\t\tmkdir($work.'zip');\n\n\t\t$zip->extractTo($work.'zip');\n\n\t\t$latest = File::latest($work.'zip')->getRealPath();\n\n\t\t@chmod($latest, 0777);\n\n\t\t// Once we have the latest modified directory, we should be\n\t\t// able to move its contents over into the bundles folder\n\t\t// so the bundle will be usable by the developer.\n\t\tFile::mvdir($latest, $path);\n\n\t\tFile::rmdir($work.'zip');\n\n\t\t$zip->close();\n\t\t//@unlink($target);\n\t}", "public function fetch($destDir)\n {\n shell_exec('rm -rf ' . $destDir);\n shell_exec('git clone --depth=1 ' . $this->extraArgs . ' ' . $this->url . ' ' . $destDir);\n }", "public function createRepo(string $repo = null)\n {\n $end = $this->getVendorType() === 'org'\n ? '/orgs/' . $this->getVendor() . '/repos'\n : '/user/repos';\n $res = $this->request('POST', $end, [\n 'name' => $this->getName(),\n 'description' => $this->getDescription(),\n ]);\n if (Helper::isResponseOk($res)) {\n echo \"\\ngit remote add origin [email protected]:{$this->getFullName()}.git\\n\";\n echo \"git push -u origin master\\n\";\n }\n\n return $res;\n }", "public function download(string $version): Archive\n {\n $meta = $this->get($version);\n $url = $meta['dist']['url'];\n\n $zip = $this->repository->download($url);\n \n $baseFolder = null;\n if (preg_match('/api.github.com/', $url)) {\n $baseFolder = str_replace('/', '-', $meta['name']) . '-' . substr($meta['dist']['reference'], 0, 7);\n }\n\n return new Archive($zip, ['baseFolder' => $baseFolder,'package' => $this->name, 'version' => $version]);\n }", "public function cloneAndConfig()\n {\n if (! is_dir($this->directory)) {\n try {\n $this->git->cloneRepository()->execute($this->repo_url);\n $this->git->remote()->add(\n $this->client_remote,\n $this->client_remote_url\n )->execute();\n\n $this->git->fetch()->execute($this->client_remote);\n\n if (! file_put_contents($this->config_file,\n $this->user_config, FILE_APPEND)) {\n $this->logger->error('Can\\'t write Git config file');\n }\n } catch (GitException $e) {\n $this->logger->error('Failed to clone or config Git repository. '\n . 'Error: ' . $e->getMessage());\n }\n }\n }", "public static function &create($repo_path, $source = null) {\n\t\t\treturn GitRepo::create_new($repo_path, $source);\n\t\t}", "public function setRepository($var)\n {\n GPBUtil::checkString($var, True);\n $this->repository = $var;\n\n return $this;\n }", "public function getRepo()\n {\n return $this->repo;\n }", "function cvs_delete_repository($cvs_project) {\r\n global $cvs_root;\r\n \r\n //We really don't want to delete the repository,\r\n //just erase the passwd file...\r\n\r\n $cvs_passwd_file = $cvs_root.\"/\".$cvs_project.\"/CVSROOT/passwd\";\r\n unlink( $cvs_passwd_file);\r\n\r\n $cvs_deleted_file = $cvs_root.\"/\".$cvs_project.\"/DELETED\";\r\n touch( $cvs_deleted_file);\r\n}", "function changeBranch(){\r\n\t\t// $gitpss = isset($_COOKIE['gitpss']) ? $_COOKIE['gitpss'] : '';\r\n\t\t// $repo = 'https://'.$gitusr.':'.$gitpss.'@github.com/nelsoft/nelsoft_inventory.git';\r\n\t\tchdir($_POST['path']);\r\n\t\texec('git clean -df');\r\n\t\texec('git checkout -- .');\r\n\t\t// exec('git fetch '.$repo);\r\n\t\texec('git checkout '.$_POST['branch'], $data);\r\n\t\t// exec('git pull '.$repo.' '.$_POST['branch'], $data);\r\n\r\n\t\t$return['version'] = '0.00';\r\n\t\t$return['version'] = getversion($_POST['path'], 'version');\t\r\n\t\t$return['data'] = $data;\r\n\r\n\t\tjdie($return);\r\n}", "public function git_repository()\n\t{\n\t\texec( 'cd ' . $this->theme_dir . '; git remote -v', $remotes );\n\n\t\tpreg_match( '#origin[\\s\\t][email protected]\\:([^\\.]+)#', $remotes[0], $matches );\n\n\t\t$remote = $matches[1];\n\n\t\treturn $remote;\n\t}", "function get_composer_content($commit, $filename) {\n\n return json_decode(shell_exec('git show ' . $commit . ':' . $filename));\n}", "protected function makeRepositoryInterface()\n {\n if ($this->files->exists($path = $this->getInterfacePath())) {\n return $this->error($this->classParts() . 'Interface already exists!');\n }\n $this->makeDirectory($path);\n $this->files->put($path, $this->compileInterfaceStub());\n $this->info('Repository Interface created successfully.');\n }", "protected function getRepository() {}", "abstract public function repository();", "public static function git_commit() {\r\n\t\tcheck_admin_referer('plugin-name-action_wpidenonce'); \r\n\t\tif ( !is_super_admin() )\r\n\t\t\twp_die('<p>'.__('You do not have sufficient permissions to edit templates for this site. SORRY').'</p>');\r\n\t\t\r\n error_reporting(E_ALL);\r\n ini_set(\"display_errors\", 1);\r\n \r\n require_once('git/autoload.php.dist');\r\n //use TQ\\Git\\Cli\\Binary;\r\n //use TQ\\Git\\Repository\\Repository;\r\n \r\n $root = apply_filters( 'wpide_filesystem_root', WP_CONTENT_DIR ) . \"/\"; \r\n \r\n //check repo path entered or die\r\n if ( !strlen($_POST['gitpath']) ) \r\n die(\"Error: Path to your git repository is required!\");\r\n \r\n \r\n $repo_path = $root . sanitize_text_field( $_POST['gitpath'] );\r\n $gitbinary = sanitize_text_field( stripslashes($_POST['gitbinary']) );\r\n \r\n if ( $gitbinary===\"I'll guess..\" ){ //the binary path\r\n \r\n $thebinary = TQ\\Git\\Cli\\Binary::locateBinary();\r\n $git = TQ\\Git\\Repository\\Repository::open($repo_path, new TQ\\Git\\Cli\\Binary( $thebinary ) );\r\n \r\n }else{\r\n \r\n $git = TQ\\Git\\Repository\\Repository::open($repo_path, new TQ\\Git\\Cli\\Binary( $_POST['gitbinary'] ) );\r\n \r\n }\r\n \r\n $files = array();\r\n foreach ($_POST['files'] as $file){\r\n $files[] = base64_decode( $file );\r\n }\r\n \r\n //get the current user to be used for the commit\r\n $current_user = wp_get_current_user();\r\n \r\n $git->add( $files );\r\n $git->commit( sanitize_text_field($_POST['gitmessage']) , $files, \"{$current_user->user_firstname} {$current_user->user_lastname} <{$current_user->user_email}>\");\r\n\r\n wpide::show_changed_files();\r\n \r\n\t\tdie(); // this is required to return a proper result\r\n\t}", "abstract public function getRepository();", "abstract public function getRepository();", "function export(){\n\t\t$this->db_tools->export();\n\t\t$this->db_tools->echo_export();\n\t}", "public abstract function getRepository();", "public function exportAction()\n {\n $helpers = $this->get(\"app.helpers\");\n $em = $this->getDoctrine()->getManager();\n\n $comparendos = $em->getRepository('JHWEBContravencionalBundle:CvCdoComparendo')->findAll();\n \n $response = array(\n 'status' => 'success',\n 'code' => 200,\n 'message' => \"lista de comparendos\",\n 'data' => $comparendos,\n );\n return $helpers->json($response);\n }", "public function export()\n {\n //\n }", "function drush_default_content_deploy_export($entity_type_id) {\n $entity_ids = drush_get_option('entity_id', '');\n $entity_bundles = drush_get_option('bundle', '');\n $skip_entities = drush_get_option('skip_entities', '');\n\n /** @var \\Drupal\\default_content_deploy\\Exporter $exporter */\n $exporter = \\Drupal::service('default_content_deploy.exporter');\n try {\n $count = $exporter->export($entity_type_id, $entity_bundles, $entity_ids, $skip_entities);\n drush_log(dt('Exported @count entities.', ['@count' => $count]), 'success');\n }\n catch (\\InvalidArgumentException $e) {\n drush_print($e->getMessage());\n drush_print(dt('List of available content entity types:'));\n drush_print(implode(', ', array_keys($exporter->getContentEntityTypes())));\n }\n}", "public function repository(): RepositoryContract;", "protected function initializeEmptyGitRepository(): string\n {\n try {\n $repoPath = sys_get_temp_dir()\n . '/CaptainHook/tests/repo-'\n . time() . '-' . bin2hex(random_bytes(4));\n } catch (Exception $exception) {\n TestCase::fail($exception->getMessage());\n }\n\n $gitConfigFile = $repoPath . '/.git/config';\n\n $this->filesystem()->mkdir($repoPath);\n\n $this->mustRunInShell(['git', 'init', '--initial-branch=main', $repoPath]);\n $this->mustRunInShell(['git', 'config', '--file', $gitConfigFile, 'user.name', 'Acceptance Tester']);\n $this->mustRunInShell(['git', 'config', '--file', $gitConfigFile, 'user.email', '[email protected]']);\n\n return $repoPath;\n }", "protected static function getGitWrapper() {\n\t\t$dir = self::getGitDir();\n\t\tif ( !self::$git ) {\n\t\t\tself::$git = new GitWrapper();\n\n\t\t\t$extDir = MediaWikiServices::getInstance()->getMainConfig()->get( \"ExtensionDirectory\" );\n\t\t\tself::$git->setEnvVar( \"PERL5LIB\", \"$extDir/MABS/lib/mediawiki-git-remote/lib:\"\n\t\t\t\t\t\t\t\t . \"$extDir/MABS/lib/mediawiki-git-remote/localcpan\" );\n\t\t\tself::$git->setEnvVar( \"GIT_EXEC_PATH\", \"$extDir/MABS/lib/mediawiki-git-remote:\"\n\t\t\t\t\t\t\t\t . \"/usr/lib/git-core\" );\n\t\t\tself::$git->setEnvVar( \"GIT_MW_DEBUG\", \"1\" );\n\t\t\tself::$git->setEnvVar( \"GIT_TRACE\", \"0\" );\n\t\t\tif ( !chdir( $dir ) ) {\n\t\t\t\tthrow new ErrorPageError( \"mabs-system-error\", \"mabs-no-chdir\", $dir );\n\t\t\t}\n\t\t}\n\t\treturn self::$git->workingCopy( $dir );\n\t}", "protected function execute(InputInterface $input, OutputInterface $output)\n {\n $url = \"https://github.com/teamdigitalde/sitepackage-v10/archive/master.zip\";\n $extDir = Environment::getPublicPath().'/typo3conf/ext/';\n $ch = curl_init();\n\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Downloade Zip-Archiv.');\n\n $f = fopen($extDir.'/master.zip', 'w+');\n $opt = [\n CURLOPT_URL => $url,\n CURLOPT_FILE => $f,\n CURLOPT_FOLLOWLOCATION => true,\n // CURLOPT_RETURNTRANSFER => true,\n CURLOPT_BINARYTRANSFER => true,\n CURLOPT_HEADER => false,\n CURLOPT_SSL_VERIFYHOST => false,\n CURLOPT_SSL_VERIFYPEER => false,\n ];\n curl_setopt_array($ch, $opt);\n $file = curl_exec($ch);\n\n curl_close($ch);\n fclose($f);\n\n $zip = new \\ZipArchive();\n $res = $zip->open($extDir.'/master.zip');\n if ($res === TRUE) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('File wurde gefunden und wird nun entzippt.');\n $zip->extractTo($extDir); // wohin soll es entpackt werden\n $zip->close();\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Zip-Archiv wurde nicht gefunden.');\n }\n\n // Sync sitepackages\n $test = $this->smartCopy($extDir.'sitepackage-v10-master/',$extDir.'sitepackage/');\n if($test == TRUE) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Hat synchonisiert');\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Hat nicht synchonisiert');\n return false;\n }\n\n // Remove Files and Sitepackage\n if(file_exists($extDir.'sitepackage/'.'index.php')) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Lösche die Datei Sitepackage -> index.php');\n unlink($extDir.'sitepackage/'.'index.php');\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Die Datei Sitepackage -> index.php konnte nicht gefunden werden.');\n }\n if(file_exists($extDir.'sitepackage/'.'kickstart.sql')) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Lösche die Datei Sitepackage -> kickstart.sql');\n unlink($extDir.'sitepackage/'.'kickstart.sql');\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Die Datei Sitepackage -> kickstart.sql konnte nicht gefunden werden.');\n }\n if(file_exists($extDir.'sitepackage/'.'.htaccess')) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Lösche die Datei Sitepackage -> .htaccess');\n unlink($extDir.'sitepackage/'.'.htaccess');\n } else {\n \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Die Datei Sitepackage -> .htaccess konnte nicht gefunden werden.');\n }\n if(file_exists($extDir.'sitepackage/'.'.editorconfig')) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Lösche die Datei Sitepackage -> .editorconfig');\n unlink($extDir.'sitepackage/'.'.editorconfig');\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Die Datei Sitepackage -> .editorconfig konnte nicht gefunden werden.');\n }\n if(file_exists($extDir.'sitepackage/'.'.gitignore')) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Lösche die Datei Sitepackage -> .gitignore');\n unlink($extDir.'sitepackage/'.'.gitignore');\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Die Datei Sitepackage -> .gitignore konnte nicht gefunden werden.');\n }\n if(is_dir($extDir.'sitepackage/Build')) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Lösche den Ordner Sitepackage -> Build');\n $this->rrmdir($extDir.'sitepackage/Build');\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Der Ordner Sitepackage -> Build konnte nicht gefunden werden.');\n }\n if(is_dir($extDir.'sitepackage/autoload')) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Lösche den Ordner Sitepackage -> Autoload');\n $this->rrmdir($extDir.'sitepackage/autoload');\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Der Ordner Sitepackage -> Autoload konnte nicht gefunden werden.');\n }\n if(is_dir($extDir.'sitepackage/sites')) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Lösche den Ordner Sitepackage -> Sites');\n $this->rrmdir($extDir.'sitepackage/sites');\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Der Ordner Sitepackage -> Sites konnte nicht gefunden werden.');\n }\n if(is_dir($extDir.'sitepackage-v10-master')) {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Lösche den Ordner Sitepackage -> Sitepackage-Master');\n $this->rrmdir($extDir.'sitepackage-v10-master');\n } else {\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Der Ordner Sitepackage-Master konnte nicht gefunden werden.');\n }\n if(file_exists($extDir.'master.zip')) {\n unlink($extDir.'master.zip');\n }\n// \\TYPO3\\CMS\\Extbase\\Utility\\DebuggerUtility::var_dump('Das Sitepackage wurde erfolgreich aktualisiert.');\n $io = new SymfonyStyle($input, $output);\n $io->title($this->getDescription());\n $io->write('Write something');\n return 0;\n }", "public function _create_single_repo( $gitlab_path, $include_values, $is_public, $gh_repo_name ) {\n\n\t\tif ( 'all' === $include_values || in_array( 'all', $include_values ) ) {\n\n\t\t\t$migrate_data = [ 'issues', 'wiki', 'pr', 'snippets' ];\n\n\t\t} else {\n\n\t\t\t$migrate_data = $include_values;\n\n\t\t}\n\n\t\t[ 'group' => $group, 'name' => $project_name ] = $gitlab_path; // php 7.1 🚀\n\n\t\t$projects_data = get_projects( $gitlab_path );\n\n\t\tforeach ( $projects_data as $project ) {\n\t\t\tif ( strtolower( $group ) === strtolower( $project['namespace']['full_path'] ) ) {\n\t\t\t\tif ( ! empty( get_param_value( '--yes' ) || ask_yes_no( $project['path_with_namespace'] ) ) ) {\n\t\t\t\t\t$this->_create_repositories( $project, $migrate_data, $is_public, $gh_repo_name );\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t}", "public static function svnExportFromUllright($path, $targetDir = null)\n {\n // Get ullright repo root path\n $infoXml = shell_exec('svn info --xml plugins/ullCorePlugin/');\n $infoArray = simplexml_load_string($infoXml);\n $root = $infoArray->entry->repository->root;\n \n // Calculate target path\n if (!$targetDir)\n {\n $targetDir = dirname($path);\n }\n \n $filename = basename($path);\n \n $cmd = 'svn export ' . $root . '/trunk/' . $path . \n ' ' . $targetDir . '/' . $filename;\n \n return shell_exec($cmd);\n }", "abstract protected function getGitCommand(): string;", "public function create($remote = 'http://github.com/joomla/joomla-platform.git')\n\t{\n\t\t// Initialize variables.\n\t\t$out = array();\n\t\t$return = null;\n\n\t\t// We add the users repo to our remote list if it isn't already there\n\t\tif (!file_exists($this->_root . '/.git'))\n\t\t{\n\t\t\t// Execute the command.\n\t\t\texec('git clone -q ' . escapeshellarg($remote) . ' ' . escapeshellarg($this->_root), $out, $return);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new InvalidArgumentException('Repository already exists at ' . $this->_root . '.');\n\t\t}\n\n\t\t// Validate the response.\n\t\tif ($return !== 0)\n\t\t{\n\t\t\tthrow new RuntimeException(sprintf('The clone failed from remote %s with code %d and message %s.', $remote, $return, implode(\"\\n\", $out)));\n\t\t}\n\n\t\treturn $this;\n\t}", "public function get_repo_data(){\n\n\t\t\treturn $this->get_repo();\n\n\t\t}", "public function gitPull() {\n $current_branch = exec('git rev-parse --abbrev-ref HEAD');\n\n $collection = $this->collectionBuilder();\n $collection->taskGitStack()\n ->pull()\n ->run();\n\n $name = $this->confirm(\"Run Composer Install?\");\n if ($name) {\n $this->composerInstall();\n }\n\n $name = $this->confirm(\"Run Config Import?\");\n if ($name) {\n $this->drushCim();\n }\n }", "function download_project(){\n $this->_HTML = false;\n if(isset($this->_url_params['project_id'])) $project_id = $this->_url_params['project_id'];\n else exit();\n \n /**\n * @var \\AWorDS\\App\\Models\\Project $project\n */\n $project = $this->set_model();;\n $logged_in = $project->login_check();\n if($logged_in){\n if((string) ((int) $project_id) == $project_id AND $project->verify($project_id)) {\n $file = $project->export($project_id, Constants::EXPORT_ALL);\n if ($file != null) {\n header('Content-Type: ' . $file['mime']);\n header('Content-Disposition: attachment; filename=\"' . $file['name'] . '\"');\n readfile($file['path']);\n } else $this->redirect(Config::WEB_DIRECTORY . 'projects');\n }else $this->redirect(Config::WEB_DIRECTORY . 'projects');\n }else $this->redirect();\n }", "public function cloneRepository(Server $server, Application $application)\n {\n try {\n $this->getUser();\n\n $server->exec(\n view('scripts.deployments.bitbucket-deployment', [\n 'application' => $application,\n 'access_token' => $this->sourceProvider->access_token\n ])->render()\n ); \n } catch (ClientException $e) {\n if ($e->getResponse()->getStatusCode() === 401) {\n if ($this->retries <= $this->maxRetries) {\n $this->retries = $this->retries + 1;\n $this->refreshToken();\n }\n }\n }\n }", "public function repository()\n {\n return Repository::i();\n }", "public function writeRevision()\n {\n $locRev = $this->git->localRevision();\n $temp = tempnam(sys_get_temp_dir(), 'gitRevision');\n\n file_put_contents($temp, $locRev);\n ftp_put($this->connection, $this->revisionFile, $temp, FTP_BINARY);\n unlink($temp);\n }", "protected static function getGitDir() {\n\t\tif ( !self::$gitDir ) {\n\t\t\t$conf = MediaWikiServices::getInstance()->getConfigFactory()->makeConfig( \"MABS\" );\n\t\t\tself::$gitDir = $conf->get( Config::REPO );\n\t\t}\n\t\treturn self::$gitDir;\n\t}", "public function export()\n {\n }", "private function get_repository_info() {\n if ( is_null( $this->github_response ) ) {\n $request_uri = sprintf( 'https://api.github.com/repos/%s/%s/releases', $this->username, $this->repository );\n\n $response = json_decode( wp_remote_retrieve_body( wp_remote_get( $request_uri ) ), true );\n if( is_array( $response ) ) {\n $response = current( $response );\n }\n $this->github_response = $response;\n }\n }", "public function getName()\n\t{\n\t\treturn 'git';\n\t}", "public function export($baseId);" ]
[ "0.6487203", "0.587284", "0.57490593", "0.57172847", "0.5669102", "0.5661655", "0.56557685", "0.56092596", "0.56021774", "0.5447175", "0.5383424", "0.5302148", "0.53012496", "0.529111", "0.52697265", "0.5154076", "0.51367396", "0.50754076", "0.50661576", "0.5041692", "0.5030542", "0.50285643", "0.5023216", "0.49835745", "0.49651533", "0.49651533", "0.49651533", "0.49651533", "0.49651533", "0.4959942", "0.49572492", "0.48892516", "0.4881587", "0.48812684", "0.4879436", "0.48256338", "0.48253518", "0.4820376", "0.4815357", "0.48148125", "0.4800733", "0.4794684", "0.479404", "0.4752913", "0.475238", "0.47511464", "0.47448352", "0.4728095", "0.4725479", "0.47188094", "0.47104207", "0.469375", "0.4691099", "0.46851045", "0.46731964", "0.46515673", "0.46294156", "0.46243137", "0.46129304", "0.4597963", "0.4591667", "0.45617953", "0.4547362", "0.45466936", "0.45385492", "0.45221844", "0.4507932", "0.45046502", "0.45041895", "0.449633", "0.44741184", "0.44728285", "0.44678736", "0.4467536", "0.44626647", "0.44626647", "0.44608667", "0.44545355", "0.44341275", "0.4432516", "0.44315696", "0.44304448", "0.44236884", "0.44231784", "0.44229698", "0.44175333", "0.4414351", "0.44123405", "0.44052786", "0.44004706", "0.4398532", "0.43839285", "0.43835425", "0.43817312", "0.43812093", "0.43753093", "0.43719783", "0.43658406", "0.43495244", "0.43486005" ]
0.6383873
1
Initialize any submodules for the repo at the given path.
function git_init_submodules($path) { GitUtil::initSubmodules($path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function initSubmodules($path) {\n\t\t$oldDir = getcwd();\n\t\tchdir($path);\n\t\tpassthru(self::INIT_SUBMODULES_CMD);\n\t\tchdir($oldDir);\n\t}", "public function load_modules() {\n\t\tforeach ( $this->modules as $module_name ) {\n\t\t\t$module = $this->build( $module_name );\n\t\t\tif ( $module !== null ) {\n\t\t\t\t$module->init();\n\t\t\t}\n\t\t}\n\t}", "static function loadModules($path) {\n // Prepare the iterator\n $core = new RecursiveDirectoryIterator($_SERVER['DOCUMENT_ROOT'] . $path);\n $iterator = new RecursiveIteratorIterator($core);\n $modules = new RegexIterator($iterator, '/^.+\\.php$/i', RecursiveRegexIterator::GET_MATCH);\n // Load all modules in the directory structure recursively\n foreach ($modules as $component => $filename) {\n require_once $component;\n }\n }", "function git_update_submodules($path) {\n\t$status = GitUtil::updateExternals($path);\n}", "protected function init()\n {\n $files = $this->fs->findFile('', 'init', 'php', true, true);\n\n if (!$files) {\n return;\n }\n\n $files = array_reverse($files);\n\n $di = $this->getDI();\n\n foreach ($files as $file) {\n include $file;\n }\n\n }", "public function init_repo() {\n\n\t\t\t// we don't need to maintain local repos for slim deploys\n\t\t\tif ( SLIM ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// if the repo is already initialised, we don't need to\n\t\t\tif ( is_dir( \"wpd-repos/{$this->config->repo[ 'name' ]}/.git\" ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// store the directory we're in right now, so we can come back\n\t\t\t$original_dir = getcwd();\n\n\t\t\t// switch the repo's directory\n\t\t\tchdir( \"wpd-repos/{$this->config->repo[ 'name' ]}\" );\n\n\t\t\t// initialise git\n\t\t\texec( 'git init' );\n\n\t\t\t// add the remote repo as a remote called origin\n\t\t\texec( \"git remote add origin \" . $this->config->repo[ 'git_url' ] );\n\n\t\t\t// switch back to the original directory\n\t\t\tchdir( $original_dir );\n\t\t}", "function git_clone($repo, $path, $initSubModules = false) {\n\tGitUtil::cloneRepo($repo, $path, $initSubModules);\n}", "public static function cloneRepo($repo, $path, $initSubModules = false) {\n\t\t$cloneCmd = sprintf(self::CLONE_CMD_TMPL,\n\t\t\t$repo,\n\t\t\t$path);\n\t\tpassthru($cloneCmd);\n\n\t\tif ($initSubModules) {\n\t\t\tself::initSubmodules($path);\n\t\t}\n\t}", "function __construct ($path)\n {\n $this->basepath = $path ;\n // pull the module and package names out of the path\n $this->moduleName = basename ( $path, \"/\" ) ; // just in case there are any trailing /\n $this->packageName = basename ( dirname ( dirname ( $path ) ) ) ; // simpler than explode :)\n require_once 'modules/ModuleBuilder/MB/ModuleBuilder.php' ;\n $mb = new ModuleBuilder ( ) ;\n $this->packageKey = $mb->getPackageKey ( $this->packageName ) ;\n \n $this->load () ;\n \n }", "final function __construct($path)\n\t{\n\t\t$this->path = $path;\n\t\t$this->mods = array();\n\t\t$this->init();\n\t}", "public function initExtensions(): void\n {\n $modules = $this->config->__toArray();\n\n if (empty($modules)) {\n return;\n }\n\n $templatesPaths = [];\n $langPaths = [];\n\n $extensionsDir = $this->extensionsConfig['path'];\n\n foreach ($modules as $index => $config) {\n if (!$config['enabled'] || isset($this->loadedExtensions[$index]['init'])) {\n continue;\n }\n\n $path = $extensionsDir . File::fillEndSep($config['dir']);\n\n\n if (!empty($config['paths']['locales'])) {\n $langPaths[] = $path . $config['paths']['locales'] . '/';\n }\n\n if (!empty($config['paths']['templates'])) {\n $templatesPaths[] = $path . $config['paths']['templates'] . '/';\n }\n\n $this->loadedExtensions[$index]['init'] = true;\n }\n\n // Add localization paths\n if (!empty($langPaths)) {\n /**\n * @var StorageInterface $langStorage\n */\n $langStorage = $this->di->get(Lang::class)->getStorage();\n foreach ($langPaths as $path) {\n $langStorage->addPath($path);\n }\n }\n\n // Add Templates paths\n if (!empty($templatesPaths)) {\n $templateStorage = $this->di->get(Storage::class);\n $paths = $templateStorage->getPaths();\n $mainPath = array_shift($paths);\n // main path\n $pathsResult = [];\n $pathsResult[] = $mainPath;\n $pathsResult = array_merge($pathsResult, $templatesPaths, $paths);\n $templateStorage->setPaths($pathsResult);\n }\n }", "public function init($path);", "public function init() {\n\t\t$this->getFrontController()->addModuleDirectory(APPLICATION_PATH . '/modules');\n\n\t\t// initialize navigation\n\t\t$this->_initNavigation();\n\t}", "public static function initModuleLoading(){\n\n\t}", "function module_init () {\n global $core_stylesheets;\n global $core_scripts;\n \n foreach (module_list() as $module) {\n $style_func = $module . '_stylesheets';\n if (function_exists($style_func)) {\n $stylesheets = call_user_func($style_func);\n foreach ($stylesheets as $sheet) {\n $core_stylesheets[] = \"include/$module/$sheet\";\n }\n }\n $style_func = $module . '_scripts';\n if (function_exists($style_func)) {\n $scripts = call_user_func($scripts_func);\n foreach ($scripts as $script) {\n $core_scripts[] = \"include/$module/$script\";\n }\n }\n }\n}", "public function init()\n {\n $this->gmodule = new Zfmodules_Model_GroupModules();\n $this->module = new Zfmodules_Model_Modules();\n }", "function xh_initModules()\r\n\t{\r\n\t}", "public function init_modules() {\n\t\t\t$this->dynamic_css = $this->get_core()->init_module( 'cherry-dynamic-css' );\n\n\t\t\tif ( is_admin() ) {\n\t\t\t\t$this->get_core()->init_module( 'cherry5-insert-shortcode', array() );\n\t\t\t}\n\t\t}", "protected function initGitignore() {\n $dirsWithGitignore = [\n ProjectTools::me()->getProjectDir(),\n ProjectTools::me()->getProjectDir() . '/www/',\n ];\n\n foreach ($dirsWithGitignore as $dir) {\n $this->rename('.gitignore.example', '.gitignore', $dir, TRUE);\n }\n }", "public function load() {\n $this->loadModules($this->dir['modules_core'], 'core');\n $this->loadModules($this->dir['modules_custom'], 'custom');\n $this->runModules();\n }", "public function init() {\n $git_wrapper = new \\GitWrapper\\GitWrapper();\n if (file_exists($this->directory)) {\n $this->git = $git_wrapper->workingCopy($this->directory);\n $this->git->checkout($this->branch);\n }\n else {\n $this->git = $git_wrapper->cloneRepository($this->getRepositoryURL(), $this->directory, ['branch' => $this->branch]);\n }\n }", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n Yii::import('cms_core.components.CmsModule');\n CmsModule::initCore($this); \n CmsModule::loadModule('cms_content');\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'cms_gallery.models.*',\n\t\t\t'cms_gallery.components.*',\n\t\t));\n\t}", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'user.models.*',\n\t\t\t'user.components.*',\n\t\t\t'application.modules.system.models.*',\n\t\t\t'application.modules.system.components.*',\n\t\t\t'application.modules.storage.models.*',\n\t\t\t'application.modules.storage.components.*'\n\t\t));\n\t}", "private function initRepositories(): void {\n $this->usersRepository = new UsersRepository();\n }", "function load_modules() {\n $module_folders = scandir(clientele_ROOT . '/modules/');\n foreach ($module_folders as $key => $folder) {\n $module_folders[$key] = clientele_ROOT. '/modules/'. $module_folders[$key] . '/' . $module_folders[$key] . '.class.php'; \n }\n $module_folders = apply_filters('clientele_module_folders', $module_folders);\n foreach ($module_folders as $module_folder) {\n if (file_exists($module_folder)) {\n require($module_folder);\n $file_name = basename($module_folder, '.class.php');\n $this->register_module($file_name);\n }\n }\n do_action('clientele_modules_loaded');\n }", "public static function init() {\n foreach (static::$dirs as $dir) {\n if($phpFiles = glob($dir . DIRECTORY_SEPARATOR . '*.php')) {\n foreach ($phpFiles as $phpFile) {\n $namespace = basename($phpFile, '.php');\n static::$config[$namespace] = require_once $phpFile;\n }\n }\n }\n }", "static function initialize($path)\n {\n self::register();\n self::addPath($path);\n }", "public static function updateExternals($path) {\n\t\tif (!file_exists($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path does not exist.\");\n\t\t}\n\n\t\tif (!is_dir($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path is not a directory.\");\n\t\t}\n\n\t\tif (!self::isRepo($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path is not a git repository.\");\n\t\t}\n\n\t\t$origCwd = getcwd();\n\t\tchdir($path);\n\n\t\t$updateCmd = sprintf(self::UPDATE_SUBMODULES_CMD);\n\t\tpassthru($updateCmd);\n\n\t\tchdir($origCwd);\n\t}", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n \n\t\t$this->setImport(array('my.models.*',));\n\t}", "public function loadModules()\n {\n foreach ($this->getListOfModules() as $module) {\n $this->loadViews($module);\n $this->loadRoutes($module);\n $this->loadMigrations($module);\n }\n }", "public function init_modules() {\n\n\t\tif ( wp_doing_ajax() ) {\n\t\t\t$this->maybe_load_module_on_ajax();\n\t\t} else {\n\t\t\t$this->maybe_load_module();\n\t\t}\n\t}", "public function _setupObjects()\n {\n if ((count ($this -> _mXoopsModules) == 0) && $handler = opendir (XOOPS_MODULE_PATH)) {\n while (($dir = readdir($handler)) !== false) {\n if (!in_array ($dir, $this -> _mExclusions, true) && is_dir(XOOPS_MODULE_PATH . '/' . $dir)) {\n $module =& $this->get($dir);\n if ($module !== false) {\n $this->_mXoopsModules[] =& $module;\n }\n unset($module);\n }\n }\n }\n }", "function init()\r\n {\r\n //Copy components to comps, so you can alter components properties\r\n //on init() methods\r\n $comps=$this->components->items;\r\n //Calls children's init recursively\r\n reset($comps);\r\n while (list($k,$v)=each($comps))\r\n {\r\n $v->init();\r\n }\r\n }", "public function init() {\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'music.models.*',\n\t\t\t'music.components.*',\n\t\t));\n\t}", "public function internalLoad(string $path)\n {\n // Scan path\n $scan = array_diff(scandir($path), array('.', '..', 'Core.php', 'Resources'));\n // Foreach found item\n foreach ($scan as $item) {\n // Check if item is a file\n if (substr($item, -4) == \".php\") {\n // Require file once\n require_once $path . '/' . $item;\n } else {\n // Rerun autoload on new folder\n $this->internalLoad($path . '/' . $item);\n }\n }\n }", "public static function run_init_scripts() {\n foreach (self::$_roots as $module_name => $root_path) {\n if (file_exists($fname =\n ($root_path . self::MODULE_BOOTSTRAP_FILE))) {\n include $fname;\n }\n }\n }", "public function loadModules();", "public function init()\n\t{\n\t\t$this->resolvePackagePath();\n\t\t$this->registerCoreScripts();\n\t\tparent::init();\n\t}", "public function init () {\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array( //'sitemap.models.*',\n\t\t 'sitemap.extensions.sitemap.*',\n\t\t));\n\t}", "public function init() {\n\t\t// you may place code here to customize the module or the application\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'common.components.*',\n\t\t));\n\t}", "public function __construct($repo_path = null, $create_new = false, $_init = true) {\n\t\t\tif (is_string($repo_path)) {\n\t\t\t\t$this->set_repo_path($repo_path, $create_new, $_init);\n\t\t\t}\n\t\t}", "public function init($module_name) {\n $buildmodule = \\Drupal::service('embedded_block_generator.setup_module');\n try {\n $path_name = preg_replace('@[^a-z0-9-]+@', '_', strtolower($module_name));\n $path = DRUPAL_ROOT . '/modules/custom/' . $path_name;\n if (\\Drupal::service('file_system')->prepareDirectory($path, FileSystemInterface::CREATE_DIRECTORY)) {\n $buildmodule->buildModuleFiles($module_name, $path);\n }\n $this->output()->writeln('Module ' . $module_name . ' Created successfully');\n }\n catch (Exception $e) {\n $this->output()->writeln($e->getMessage());\n }\n }", "public function init()\n {\n // TODO: initialize by config ordering\n foreach ($this->plugins as $name => $plugin) {\n $plugin->init();\n }\n }", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n parent::init();\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'info.models.*',\n\t\t\t'info.components.*',\n\t\t));\n\t}", "public function set_repo_path($repo_path, $create_new = false, $_init = true) {\n\t\t\tif (is_string($repo_path)) {\n\t\t\t\tif ($new_path = realpath($repo_path)) {\n\t\t\t\t\t$repo_path = $new_path;\n\t\t\t\t\tif (is_dir($repo_path)) {\n\t\t\t\t\t\t// Is this a work tree?\n\t\t\t\t\t\tif (file_exists($repo_path.\"/.git\") && is_dir($repo_path.\"/.git\")) {\n\t\t\t\t\t\t\t$this->repo_path = $repo_path;\n\t\t\t\t\t\t\t$this->bare = false;\n\n\t\t\t\t\t\t\tif (!is_writable($repo_path.\"/.git\")) {\n\t\t\t\t\t\t\t\t$user_info = posix_getpwuid(fileowner($repo_path.\"/.git\"));\n\t\t\t\t\t\t\t\t$file_owner = $user_info['name'];\n\t\t\t\t\t\t\t\t$this->command_prefix = 'sudo -u '.$file_owner.' ';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Is this a bare repo?\n\t\t\t\t\t\t} else if (is_file($repo_path.\"/config\")) {\n\t\t\t\t\t\t\t$parse_ini = parse_ini_file($repo_path.\"/config\");\n\t\t\t\t\t\t\tif ($parse_ini['bare']) {\n\t\t\t\t\t\t\t\t$this->repo_path = $repo_path;\n\t\t\t\t\t\t\t\t$this->bare = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($create_new) {\n\t\t\t\t\t\t\t\t$this->repo_path = $repo_path;\n\t\t\t\t\t\t\t\tif ($_init) {\n\t\t\t\t\t\t\t\t\t$this->run('init');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthrow new Exception('\"'.$repo_path.'\" is not a git repository');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception('\"'.$repo_path.'\" is not a directory');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ($create_new) {\n\t\t\t\t\t\tif ($parent = realpath(dirname($repo_path))) {\n\t\t\t\t\t\t\tmkdir($repo_path);\n\t\t\t\t\t\t\t$this->repo_path = $repo_path;\n\t\t\t\t\t\t\tif ($_init) $this->run('init');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new Exception('cannot create repository in non-existent directory');\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception('\"'.$repo_path.'\" does not exist');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'clinics.models.*',\n\t\t\t'clinics.components.*',\n\t\t));\n\t}", "public function init() {\n // you may place code here to customize the module or the application\n // import the module-level models and components\n $this->setImport(array(\n 'sys.models.*',\n 'product.models.*',\n 'sys.components.*',\n 'hr.models.*',\n ));\n }", "public function init() {\n if (!class_exists(TableBuilderManager::class)) {\n $loader = new ClassLoader();\n $loader->addPsr4('Drush\\\\dmt_structure_export\\\\', __DIR__ . '/src');\n $loader->register();\n }\n }", "private function setIncludes($repo)\n {\n #add other paths here .\n $proj_dir = dirname($repo);\n $current_path = getenv('PATH');\n ini_set('include_path',\n '.'\n . ':' . '/usr/local/lib/php'\n . ':' . '/usr/local/bin'\n\t\t\t. ':' . $repo . '/libmx'\n\t\t. ':' . $repo . '/src'\n\t\t. ':' . $repo . '/config'\n . ':' . $repo . '/public'\n # . ':' . $repo . '/public/scripts'\n . ':' . $current_path\n\n );\n }", "public function init()\r\n {\r\n $this->admin = Shopware()->Modules()->Admin();\r\n $this->basket = Shopware()->Modules()->Basket();\r\n $this->session = Shopware()->Session();\r\n $this->db = Shopware()->Db();\r\n $this->moduleManager = Shopware()->Modules();\r\n $this->eventManager = Shopware()->Events();\r\n }", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'admin.models.*',\n\t\t\t'admin.components.*',\n\t\t));\n\t}", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'forum.models.*',\n\t\t\t'forum.components.*',\n 'forum.controllers.*',\n\t\t));\n\t}", "public function __construct($template_path = null) \n {\n Benchmark::start('GridModule Loading');\n \n if($template_path) \n {\n $this->template_path = $template_path;\n }\n \n Kohana::log('debug', 'Grid :: Grid_Core Module loaded');\n \n }", "protected function _initModules()\n {\n $this->_config->setNode('global/models/ecocode_profiler/class', 'Ecocode_Profiler_Model');\n $this->_config->setNode('global/helpers/ecocode_profiler/class', 'Ecocode_Profiler_Helper');\n if (!$this->_config->loadModulesCache()) {\n $this->_config->loadModules();\n if ($this->_config->isLocalConfigLoaded() && !$this->_shouldSkipProcessModulesUpdates()) {\n Varien_Profiler::start('mage::app::init::apply_db_schema_updates');\n Mage_Core_Model_Resource_Setup::applyAllUpdates();\n Varien_Profiler::stop('mage::app::init::apply_db_schema_updates');\n }\n /* start */\n /* load development.xml for all modules if present */\n $this->_config->loadModulesConfiguration(['development.xml'], $this->_config);\n /* end */\n $this->_config->loadDb();\n $this->enableSymlinks();\n $this->_config->saveCache();\n }\n return $this;\n }", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t\t'admin.models.*',\n\t\t\t\t'admin.components.*',\n\t\t));\n\n\t}", "public function init_required_modules() {\n\t\t\t$required_modules = apply_filters( 'cherry_core_required_modules', array(\n\t\t\t\t'cherry-toolkit',\n\t\t\t\t'cherry-widget-factory',\n\t\t\t), $this );\n\n\t\t\tforeach ( $required_modules as $module ) {\n\n\t\t\t\tif ( ! array_key_exists( $module, $this->settings['modules'] ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$settings = $this->settings['modules'][ $module ];\n\t\t\t\t$args = ! empty( $settings['args'] ) ? $settings['args'] : array();\n\n\t\t\t\t$this->init_module( $module, $args );\n\t\t\t}\n\t\t}", "private function init(): void\n {\n // Load composer.json\n $this->composerJson = $this->loadJsonFile($this->composerJsonFilename);\n\n // Reconstitute the composer.lock filename\n $composerLockFilename = dirname($this->composerJsonFilename) .\n DIRECTORY_SEPARATOR .\n basename($this->composerJsonFilename, '.json') .\n '.lock';\n\n // Check if composer.lock file exists\n if (!file_exists($composerLockFilename)) {\n throw new ComposerException(\n sprintf('Project is not initialized with Composer, \"%s\" file doest not exists', $composerLockFilename)\n );\n }\n\n // Get JSON content of composer.json file\n if (($this->composerLock = json_decode(file_get_contents($composerLockFilename), true)) === false) {\n throw new ComposerException(\n sprintf('\"%s\" file of project is corrupted or not readable', $composerLockFilename)\n );\n }\n\n // Reindex packages\n $this->composerLock['packages'] = array_column($this->composerLock['packages'], null, 'name');\n\n // Load packages\n $this->packages = array_fill_keys(array_column($this->composerLock['packages'], 'name'), null);\n }", "public function set_needed_repos(): void {}", "public function set_needed_repos(): void {}", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'message.models.*',\n\t\t\t'message.components.*',\n 'message.forms.*',\n\t\t));\n\t}", "public static function init($path)\n {\n $path .= '/';\n if (!is_dir($path)) {\n mkdir($path);\n } elseif (is_dir($path . 'objects')) {\n return false;\n }\n\n mkdir($path . 'objects');\n mkdir($path . 'objects/info');\n mkdir($path . 'objects/pack');\n mkdir($path . 'refs');\n mkdir($path . 'refs/heads');\n mkdir($path . 'refs/tags');\n\n file_put_contents($path . 'HEAD', 'ref: refs/heads/master');\n\n return true;\n }", "private function _initialize(){\n\t\t\t//Root Folders\n\t\t\tDefined(\"SRC_PATH\") || Define('SRC_PATH', realpath(dirname(dirname(__file__))) . DS . 'src' . DS);\n\t\t\tDefined(\"DB_PATH\") || Define('DB_PATH', realpath(dirname(__file__)).DS.'database'.DS);\n\t\t\t//$dir = array_filter(glob('*'),'is_dir');\n\t\t\t//print_r($dir);\n\t\t\tspl_autoload_extensions('.php');\n\t\t\tspl_autoload_register(function ($class) {\n\t\t\t\t$parts = explode('\\\\', $class);\n\t\t\t\t$class = end($parts); \n\n\t\t\t\tif (file_exists(PROJECT_PATH.$this->_implementation.DS.$class.'.php'))\n\t\t\t\t\t\trequire_once PROJECT_PATH.$this->_implementation.DS.$class.'.php';\n\t\t\t\t\n //Impliments \n\t\t\t\t$folders = scandir(PROJECT_PATH . $this->_implementation);\n\t\t\t\t$remove = array('.', '..');\n\t\t\t\t$folders = array_diff($folders, $remove);\n\t\t\t\tif (!empty($folders)) {\n\t\t\t\t\t$folders = array_clean($folders);\n\t\t\t\t\tforeach ($folders as $folder) {\n\t\t\t\t\t\tif (file_exists(PROJECT_PATH.$this->_implementation.DS.$folder.DS.$class.'.php'))\n\t\t\t\t\t\t\trequire_once PROJECT_PATH.$this->_implementation.DS.$folder.DS.$class.'.php';\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//Initalize Plugins\n\t\t\t\t$folders = scandir(PROJECT_PATH . $this->_pluginPath);\n\t\t\t\t$remove = array('.', '..');\n\t\t\t\t$folders = array_diff($folders, $remove);\n\t\t\t\tif (!empty($folders)) {\n\t\t\t\t\t$folders = array_clean($folders);\n\t\t\t\t\tforeach ($folders as $folder) {\n\t\t\t\t\t\tif (file_exists(PROJECT_PATH.$this->_pluginPath.DS.$folder.DS.$class.'.php'))\n\t\t\t\t\t\t\trequire_once PROJECT_PATH.$this->_pluginPath.DS.$folder.DS.$class.'.php';\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\t//System vendor \n\t\t\t\t$folders = scandir(APP_PATH . $this->_systemVendor);\n\t\t\t\t$remove = array('.', '..');\n\t\t\t\t$folders = array_diff($folders, $remove);\n\t\t\t\tif (!empty($folders)) {\n\t\t\t\t\t$folders = array_clean($folders);\n\t\t\t\t\tforeach ($folders as $folder) {\n\t\t\t\t\t\tif (file_exists(APP_PATH.$this->_systemVendor.DS.$folder.DS.$class.'.php'))\n\t\t\t\t\t\t\trequire_once APP_PATH.$this->_systemVendor.DS.$folder.DS.$class.'.php';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//User Vendor\n\t\t\t\t$folders = scandir(PROJECT_PATH . $this->_userVendor);\n\t\t\t\t$remove = array('.', '..');\n\t\t\t\t$folders = array_diff($folders, $remove);\n\t\t\t\tif (!empty($folders)) {\n\t\t\t\t\t$folders = array_clean($folders);\n\t\t\t\t\tforeach ($folders as $folder) {\n\t\t\t\t\t\tif (file_exists(PROJECT_PATH.$this->_userVendor.DS.$folder.DS.$class.'.php'))\n\t\t\t\t\t\t\trequire_once PROJECT_PATH.$this->_userVendor.DS.$folder.DS.$class.'.php';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\tif (!empty($_SERVER['QUERY_STRING']))\n\t\t\t\t$this->_route = preg_replace('/^url=index.php&url=(.*)/', '$1', $_SERVER['QUERY_STRING']);\n\t\t\t\t\t\n\t\t\tif(utils\\Config::get('role/module_active') == 'YES'){\n\t\t\t\t//Create All Roles Tables \n\t\t\t\t$userTable = utils\\Config::get('webadmin/userTable');\n\t\t\t\t$userKey = utils\\Config::get('webadmin/userKey');\n\t\t\t\tif(isset($userTable) && isset($userKey)){\n\t\t\t\t\tif(\\orm\\Query::is_table($userTable)){\n\t\t\t\t\t\t$roleTables = new roles\\tables\\RoleTables($userTable,$userKey);\n\t\t\t\t\t\t$roleTables->addRoleTables();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n }", "public function initRepository(): void;", "protected function scanDir()\n {\n $this->moduleList = [];\n foreach ($this->getVendorList() as $vendorName) {\n $this->moduleList[$vendorName] = [];\n }\n\n $this->readModules();\n }", "public function loadModules()\n\t{\n\t\t$this->modulesToLoad = array_unique($this->modulesToLoad);\n\n\t\tif($this->doLoadAlwaysActivatedModules)\n\t\t{\n\t\t\t$this->modulesToLoad = array_merge($this->modulesToLoad, $this->moduleToAlwaysActivate);\n\t\t}\n\t\t\n\t\tforeach($this->modulesToLoad as $moduleName)\n\t\t{\n\t\t\tif(!$this->isModuleLoaded($moduleName))\n\t\t\t{\n\t\t\t\t$newModule = $this->loadModule($moduleName);\t\n\t\t\t\tif($this->doLoadModules\n\t\t\t\t\t&& $this->isModuleActivated($moduleName))\n\t\t\t\t{\n\t\t\t\t\t$this->addModuleObservers( $newModule );\n\t\t\t\t\t$this->addLoadedModule( $moduleName, $newModule);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'yiiauth.models.*',\n\t\t\t'yiiauth.components.*',\n\t\t));\n\t}", "public function setInitialPaths() {}", "public function init()\n {\n chdir($this->context['source_dir']);\n $this->loadConfig();\n $this->context['temp_dir'] = $this->cacheDir(\"upgrades/temp\");\n $this->context['extract_dir'] = $this->context['temp_dir'];\n $this->ensureDir($this->context['temp_dir']);\n $this->context['state_file'] = $this->cacheDir('upgrades/') . self::STATE_FILE;\n $this->context['upgrader_dir'] = dirname(__FILE__);\n $this->loadState();\n $this->context['backup_dir'] = $this->config['upload_dir'] . \"/upgrades/backup/\" . pathinfo(\n $this->context['zip'],\n PATHINFO_FILENAME\n ) . \"-restore\";\n if (isset($this->context['script_mask'])) {\n $this->script_mask &= $this->context['script_mask'];\n }\n if (isset($this->state['extract_dir'])) {\n $this->context['extract_dir'] = $this->state['extract_dir'];\n }\n if (empty($this->context['health_check_path'])) {\n $this->context['health_check_path'] =\n realpath($this->context['extract_dir']) . self::DEFAULT_HEALTHCHECK_PATH;\n }\n $this->context['case_insensitive_fs'] = $this->testFilesystemCaseInsensitive();\n $this->context['versionInfo'] = self::getVersion();\n\n $this->initialized = true;\n }", "private function init(): void\n {\n $this->initSuite();\n $cases = $this->getCaseNodes();\n foreach ($cases as $file => $nodeArray) {\n $this->initSuiteFromCases($nodeArray);\n }\n }", "protected function init() {\n if (!$this->configModule) {\n $this->configModule = $this->id;\n }\n $moduleData = $this->getModuleData();\n\n if ($moduleData['disabled']) {\n $this->moduleDisabled();\n }\n\n if (($this->getSiteVar('SECURE_REQUIRED', 0, Config::SUPRESS_ERRORS) || $moduleData['secure']) && \n (!isset($_SERVER['HTTPS']) || ($_SERVER['HTTPS'] !='on'))) { \n $this->secureModule();\n }\n \n if ($this->getSiteVar('AUTHENTICATION_ENABLED')) {\n includePackage('Authentication');\n if ($moduleData['protected']) {\n if (!$this->isLoggedIn()) {\n $this->unauthorizedAccess();\n }\n }\n \n if (!$this->evaluateACLS(self::ACL_USER)) {\n $this->unauthorizedAccess();\n }\n }\n }", "public function initialize(Bootstrap $bootstrap): void\n {\n $this->bootstrap = $bootstrap;\n $this->packageStatesConfiguration = $this->getCurrentPackageStates();\n $this->registerPackagesFromConfiguration($this->packageStatesConfiguration);\n /** @var PackageInterface $package */\n\n foreach ($this->packages as $package) {\n if ($package instanceof FlowPackageInterface) {\n $this->flowPackages[$package->getPackageKey()] = $package;\n }\n if (!$package instanceof BootablePackageInterface) {\n continue;\n }\n $package->boot($bootstrap);\n }\n }", "protected function initBundleDirectoryStructure(InputInterface $input, OutputInterface $output)\n {\n // Bootstrap SS so we can use module listing\n $frameworkPath = $this->container->getParameter('behat.silverstripe_extension.framework_path');\n $_GET['flush'] = 1;\n require_once $frameworkPath . '/core/Core.php';\n unset($_GET['flush']);\n\n $featuresPath = $input->getArgument('features');\n if(!$featuresPath) {\n throw new \\InvalidArgumentException('Please specify a module name (e.g. \"@mymodule\")');\n }\n\n // Can't use 'behat.paths.base' since that's locked at this point to base folder (not module)\n $pathSuffix = $this->container->getParameter('behat.silverstripe_extension.context.path_suffix');\n $currentModuleName = null;\n $modules = \\SS_ClassLoader::instance()->getManifest()->getModules();\n $currentModuleName = $this->container->getParameter('behat.silverstripe_extension.module');\n\n // get module from short notation if path starts from @\n if (preg_match('/^\\@([^\\/\\\\\\\\]+)(.*)$/', $featuresPath, $matches)) {\n $currentModuleName = $matches[1];\n // TODO Replace with proper module loader once AJShort's changes are merged into core\n if (!array_key_exists($currentModuleName, $modules)) {\n throw new \\InvalidArgumentException(sprintf('Module \"%s\" not found', $currentModuleName));\n }\n $currentModulePath = $modules[$currentModuleName];\n } \n\n if (!$currentModuleName) {\n throw new \\InvalidArgumentException('Can not find module to initialize suite.');\n }\n\n // TODO Retrieve from module definition once that's implemented\n if($input->getOption('namespace')) {\n $namespace = $input->getOption('namespace');\n } else {\n $namespace = ucfirst($currentModuleName);\n }\n $namespace .= '\\\\' . $this->container->getParameter('behat.silverstripe_extension.context.namespace_suffix');\n\n $featuresPath = rtrim($currentModulePath.DIRECTORY_SEPARATOR.$pathSuffix,DIRECTORY_SEPARATOR);\n $basePath = $this->container->getParameter('behat.paths.base').DIRECTORY_SEPARATOR;\n $bootstrapPath = $featuresPath.DIRECTORY_SEPARATOR.'bootstrap';\n $contextPath = $bootstrapPath.DIRECTORY_SEPARATOR.'Context';\n\n if (!is_dir($featuresPath)) {\n mkdir($featuresPath, 0777, true);\n mkdir($bootstrapPath, 0777, true);\n // touch($bootstrapPath.DIRECTORY_SEPARATOR.'_manifest_exclude');\n $output->writeln(\n '<info>+d</info> ' .\n str_replace($basePath, '', realpath($featuresPath)) .\n ' <comment>- place your *.feature files here</comment>'\n );\n }\n\n if (!is_dir($contextPath)) {\n mkdir($contextPath, 0777, true);\n\n $className = $this->container->getParameter('behat.context.class');\n file_put_contents(\n $contextPath . DIRECTORY_SEPARATOR . $className . '.php',\n strtr($this->getFeatureContextSkelet(), array(\n '%NAMESPACE%' => $namespace\n ))\n );\n\n $output->writeln(\n '<info>+f</info> ' .\n str_replace($basePath, '', realpath($contextPath)) . DIRECTORY_SEPARATOR .\n 'FeatureContext.php <comment>- place your feature related code here</comment>'\n );\n }\n }", "public function initialize() {\n\t\t//$files = glob( '*.php' );\n\t\t//\n\t\t//if( ! is_array( $files ) ) {\n\t\t//\t// Error when enumerating files, can't do anything about it at this point.\n\t\t//\treturn;\n\t\t//}\n\t\t//\n\t\t//foreach( $files as $file ) {\n\t\t//\trequire_once $file;\n\t\t//}\n\n\t\tif( apply_filters( 'toolset_is_m2m_enabled', false ) ) {\n\t\t\trequire_once TOOLSET_COMMON_PATH . '/inc/public_api/m2m.php';\n\t\t} else {\n\t\t\trequire_once TOOLSET_COMMON_PATH . '/inc/public_api/legacy_relationships.php';\n\t\t}\n\t}", "public function setModules()\n\t{\n \t//Zend_Registry::set('modules', $modules->getList());\n\t}", "public function load($path)\n {\n if (!is_dir($path)) {\n return false;\n }\n $modules = glob($path.DIRECTORY_SEPARATOR.'*', GLOB_ONLYDIR);\n\n foreach($modules as $name) {\n $module = new \\Arch\\Module($name);\n $this->set(dirname($name), $module);\n $module->loadConfig();\n }\n return true;\n }", "public static function init()\n {\n if (is_readable(__DIR__ . '/config/test.config.php')) {\n $testConfig = include __DIR__ . '/config/test.config.php';\n } else {\n $testConfig = include __DIR__ . '/config/test.config.php.dist';\n }\n \n $zf2ModulePaths = array();\n \n if (isset($testConfig['module_listener_options']['module_paths'])) {\n $modulePaths = $testConfig['module_listener_options']['module_paths'];\n foreach ($modulePaths as $modulePath) {\n if (($path = static::findParentPath($modulePath)) ) {\n $zf2ModulePaths[] = $path;\n }\n }\n }\n \n $zf2ModulePaths = implode(PATH_SEPARATOR, $zf2ModulePaths) . PATH_SEPARATOR;\n $zf2ModulePaths .= getenv('ZF2_MODULES_TEST_PATHS') ?: (defined('ZF2_MODULES_TEST_PATHS') ? ZF2_MODULES_TEST_PATHS : '');\n \n static::initAutoloader();\n \n // use ModuleManager to load this module and it's dependencies\n $baseConfig = array(\n 'module_listener_options' => array(\n 'module_paths' => explode(PATH_SEPARATOR, $zf2ModulePaths),\n ),\n );\n \n $config = ArrayUtils::merge($baseConfig, $testConfig);\n $serviceManager = new ServiceManager(new ServiceManagerConfig());\n $serviceManager->setService('ApplicationConfig', $config);\n $serviceManager->get('ModuleManager')->loadModules();\n \n static::$serviceManager = $serviceManager;\n static::$config = $config;\n }", "public function initialize()\n {\n if (file_exists($this->path.'init.php')) {\n require_once($this->path.'init.php');\n }\n }", "public function init() {\n\t\trequire(__DIR__ . '/../setup-scripts/createExplicitUsers.php');\n\t\trequire(__DIR__ . '/../setup-scripts/createExplicitGroups.php');\n\t\trequire(__DIR__ . '/../setup-scripts/createExplicitGroupsDifferentOU.php');\n\t\tparent::init();\n\t}", "protected function init()\n {\n if (in_array('users', Mongez::getStored('modules'))) {\n $this->isUserModuleExits = true;\n }\n\n $this->info('Preparing data...');\n $this->initController();\n $this->initModel();\n $this->initResource();\n $this->initRepository();\n $this->initData();\n }", "public function __construct()\n {\n $this->module_roots = Main::$module_roots;\n $this->load_supported_features();\n }", "public function init()\n\t{\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t\t'admin.models.*',\n\t\t\t'admin.components.*',\n\t\t));\n\n\t\t$this->_initBootstrap();\n\t\t$this->_initJsCss();\n\t}", "public function __construct()\n {\n // Store module path\n $this->module_path = dirname(__FILE__);\n }", "public function __construct()\n {\n // Store module path\n $this->module_path = dirname(__FILE__);\n }", "public function __construct()\n {\n // Store module path\n $this->module_path = dirname(__FILE__);\n }", "public function __construct()\n {\n // Store module path\n $this->module_path = dirname(__FILE__);\n }", "public function __construct()\n {\n // Store module path\n $this->module_path = dirname(__FILE__);\n }", "public function __construct()\n {\n // Store module path\n $this->module_path = dirname(__FILE__);\n }", "public function __construct($path, $config)\n\t{\n\t\tchdir($path);\n\t\trequire($config);\n\t}", "public function init()\n\t{\n\t\t$this->loader->init();\n\t\t$this->routing->init();\n\t}", "public function loadExtensions(): void\n {\n /**\n * @var ConfigStorageInterface $configStorage\n */\n $configStorage = $this->di->get(ConfigStorageInterface::class);\n $modules = $this->config->__toArray();\n\n if (empty($modules)) {\n return;\n }\n\n $autoLoadPaths = [];\n $autoLoadPathsPsr4 = [];\n $configPaths = [];\n\n $dependencyPaths = [];\n\n $extensionsDir = $this->extensionsConfig['path'];\n\n foreach ($modules as $index => $config) {\n if (!$config['enabled'] || isset($this->loadedExtensions[$index]['loaded'])) {\n continue;\n }\n\n $path = $extensionsDir . File::fillEndSep($config['dir']);\n\n if (!empty($config['paths']['src'])) {\n $autoLoadPaths[] = $path . $config['paths']['src'];\n }\n\n if (!empty($config['paths']['configs'])) {\n $configPaths[] = $path . $config['paths']['configs'] . '/';\n }\n\n if (!empty($config['paths']['dependency'])) {\n $dependencyPaths[] = $path . $config['paths']['dependency'];\n }\n\n /*\n * @todo implement extension locales and templates\n\n if (!empty($modCfg['autoloader-psr-4'])) {\n foreach ($modCfg['autoloader-psr-4'] as $ns =>$classPath) {\n $autoLoadPathsPsr4[$ns] = str_replace('./', $path, $classPath);\n }\n }\n\n */\n $this->loadedExtensions[$index]['load'] = true;\n }\n\n // Add autoloader paths\n if (!empty($autoLoadPaths)) {\n $autoloaderConfig = $configStorage->get('autoloader.php');\n $autoloaderCfg = $autoloaderConfig->__toArray();\n $newChain = $autoloaderCfg['priority'];\n\n foreach ($autoLoadPaths as $path) {\n $newChain[] = $path;\n }\n $currentAutoloadPaths = $this->autoloader->getRegisteredPaths();\n foreach ($currentAutoloadPaths as $path) {\n if (!in_array($path, $newChain, true)) {\n $newChain[] = $path;\n }\n }\n\n $autoloaderCfg['psr-4'] = array_merge($autoLoadPathsPsr4, $autoloaderCfg['psr-4']);\n $autoloaderCfg['paths'] = $newChain;\n\n // update autoloader paths\n $this->autoloader->setConfig(['paths' => $autoloaderCfg['paths'], 'psr-4' => $autoloaderCfg['psr-4']]);\n // update main configuration\n $autoloaderConfig->setData($autoloaderCfg);\n }\n // Add Config paths\n if (!empty($configPaths)) {\n $writePath = $configStorage->getWrite();\n $applyPath = $configStorage->getApplyTo();\n\n $paths = $configStorage->getPaths();\n $resultPaths = [];\n\n foreach ($paths as $path) {\n if ($path !== $writePath && $path !== $applyPath) {\n $resultPaths[] = $path;\n }\n }\n foreach ($configPaths as $path) {\n \\array_unshift($resultPaths, $path);\n }\n\n \\array_unshift($resultPaths, $applyPath);\n $resultPaths[] = $writePath;\n $configStorage->replacePaths($resultPaths);\n }\n // register dependencies\n if (!empty($dependencyPaths)) {\n foreach ($dependencyPaths as $file) {\n if ($this->di instanceof DependencyContainer || method_exists($this->di, 'bindArray')) {\n $this->di->bindArray(include $file);\n }\n }\n }\n }", "public function init()\n {\n $this->bases = new \\Doctrine\\Common\\Collections\\ArrayCollection();\n }", "protected function setUp(): void\n {\n parent::setUp();\n\n $this->modulePath = base_path('modules/Blog');\n $this->finder = $this->app['files'];\n $this->artisan('module:make', ['name' => ['Blog']]);\n }", "protected function pathInit(): void\n {\n [$path, $regExp] = $this->pathExtract();\n $this->path = null;\n\n if ($path) {\n $this->path = new Path($this->getDefaultRegex(), $path, $regExp);\n }\n }", "function maquetador_precarga_modulos( $path=\"./modulos\") {\n global $aEstado;\n $nlong = mb_strlen($path)+1;\n foreach ( glob (\"$path/*.php\") as $modulo ) { \n if ( mb_substr($modulo,-9) ==\"_load.php\" ) {\n $aEstado[\"modulos\"][mb_substr($modulo,$nlong,-9)]= false;\n include_once ( $modulo );\n } else {\n $aEstado[\"modulos\"][mb_substr($modulo,$nlong,-4)]= $modulo;\n }\n }\n}", "public function init()\n {\n $this->loadThemeComponent();\n $this->loadConfig();\n }", "protected function readModules()\n {\n foreach ($this->moduleList as $vendorName => &$modulesArray) {\n $directoryIterator = new \\DirectoryIterator(\n $this->getAppCodeAbsolutePath() . DIRECTORY_SEPARATOR . $vendorName\n );\n foreach ($directoryIterator as $element) {\n if ($element->isDir()\n && $this->isBaseNameValid($element->getBasename())\n ) {\n $modulesArray[] = $element->getBasename();\n }\n }\n }\n }", "public function init () {\n\t\t// you may place code here to customize the module or the application\n\n\t\t// import the module-level models and components\n\t\t$this->setImport(array(\n\t\t 'comments.models.*',\n\t\t 'comments.components.*'\n\t\t ));\n\t}", "public function registerModules()\n {\n $namespace = 'Serff\\Cms\\Modules';\n $reflector = new ReflectionClass(get_class($this));\n $modulePath = str_replace('Core/Providers/CmsServiceProvider.php', 'Modules/', $reflector->getFileName());\n\n $customModules = [];\n $modulePathCustom = app_path('Modules');\n $modulesNamespace = 'App\\Modules';\n\n $coreModules = $this->loader->find($namespace, $modulePath);\n if (\\File::exists($modulePathCustom)) {\n $customModules = $this->loader->find($modulesNamespace, $modulePathCustom);\n }\n app('Container')->setCoreModules($coreModules);\n app('Container')->setCustomModules($this->sanitizeCustomModules($customModules));\n \n $coreModules = array_merge($coreModules, $customModules);\n foreach ($coreModules as $class) {\n $this->loadModule($class);\n }\n }", "protected function initRepository()\n {\n $this->repository = new Repository([\n 'name' => 'vendor/name',\n 'description' => '✈️The package is a ThinkSNS+ package.',\n 'type' => 'library',\n 'license' => 'MIT',\n 'require' => [\n 'php' => '>=7.1.3',\n ],\n 'autoload' => [],\n 'config' => [\n 'sort-packages' => true,\n ],\n ]);\n }", "public function addModuleDirectory($path) {\r\n\t\t$path = realpath($path);\r\n\t\tif (!is_dir($path)) throw new Exception('module path err!');\r\n\t\t\r\n\t\t$dh = opendir($path);\r\n while (($file = readdir($dh)) !== false) {\r\n if ('.' == $file || '..' == $file || !is_dir($path . DIRECTORY_SEPARATOR. $file)) {\r\n \tcontinue;\r\n }\r\n $module = $file;\r\n\t\t\t$moduleDir = $path . DIRECTORY_SEPARATOR. $file . DIRECTORY_SEPARATOR . $this->getModuleControllerDirectoryName();\r\n\t\t\t$this->addControllerDirectory($moduleDir, $module);\r\n }\r\n closedir($dh);\r\n\r\n\t\treturn $this;\r\n\t}" ]
[ "0.82586163", "0.6352104", "0.6333686", "0.6127718", "0.597031", "0.59235466", "0.59083855", "0.5901166", "0.5899059", "0.5768716", "0.57487667", "0.57173336", "0.5625211", "0.5557827", "0.5544795", "0.5533338", "0.5514038", "0.5507386", "0.549787", "0.54797065", "0.54564035", "0.54308003", "0.5396318", "0.53781164", "0.53777254", "0.5368455", "0.5367977", "0.5348166", "0.534293", "0.5338049", "0.53139234", "0.52873695", "0.5283009", "0.5280905", "0.5229064", "0.52203834", "0.5219789", "0.5210978", "0.52079594", "0.52015847", "0.5197203", "0.5196582", "0.51773226", "0.5176533", "0.5165415", "0.51380444", "0.5131371", "0.51253355", "0.51045185", "0.5100346", "0.5087775", "0.50849104", "0.5070974", "0.506892", "0.5063863", "0.50385904", "0.5031434", "0.5016466", "0.5016466", "0.50141716", "0.4996761", "0.49829537", "0.4976351", "0.49722207", "0.49711558", "0.49652007", "0.4953106", "0.49467945", "0.49410376", "0.4937348", "0.49246317", "0.49233893", "0.49156454", "0.49069893", "0.48964596", "0.48919576", "0.48899806", "0.4888524", "0.48884058", "0.48792875", "0.48734185", "0.48716193", "0.48716193", "0.48716193", "0.48716193", "0.48716193", "0.48716193", "0.48712906", "0.48646277", "0.48617646", "0.48606652", "0.48530087", "0.48518878", "0.48485705", "0.48423833", "0.48328918", "0.48318428", "0.48274675", "0.48251662", "0.48185965" ]
0.85108614
0
Determine whether or not a given path is a git repository.
function git_is_repo($path) { return GitUtil::isRepo($path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function isRepo($path) {\n\t\t$dotGitPath = $path . DIRECTORY_SEPARATOR . '.git';\n\t\t$dotGitExists = file_exists($dotGitPath);\n\t\t$dotGitIsDir = is_dir($dotGitPath);\n\n\t\treturn $dotGitExists && $dotGitIsDir;\n\t}", "private function isGitObject(string $path): bool\n {\n // Non-bare Git repository.\n if (1 === preg_match('/.*\\/\\.git\\/objects\\/.+$/', $path)) {\n return true;\n }\n\n // Bare Git repository.\n preg_match('/(.*)\\/objects\\/.+$/', $path, $matches);\n\n if (isset($matches[1])) {\n return $this->gitDiscovery->isBareGitRepo($matches[1]);\n }\n\n return false;\n }", "public static function is_repo($var) {\n\t\t\treturn (get_class($var) == 'GitRepo');\n\t\t}", "private function isGitHook(string $path): bool\n {\n if (1 === preg_match('/.*\\/\\.git\\/hooks\\/.+$/', $path)) {\n return true;\n }\n\n // Bare Git repository.\n preg_match('/(.*)\\/hooks\\/.+$/', $path, $matches);\n\n if (isset($matches[1])) {\n return $this->gitDiscovery->isBareGitRepo($matches[1]);\n }\n\n return false;\n }", "function isGit($resource,$site) {\n\t\n //$error=[];\n //chdir(\"../../zone/\". $resource . \"/\" . $site);\n //exec('\"C:\\Program Files\\Git\\cmd\\git.exe\" rev-parse --verify master 2>&1', $output, $error[0]);\n //exec('\"C:\\Program Files\\Git\\cmd\\git.exe\" ls-remote -q --refs 2>&1', $output, $error[1]); \n\t$result = checkIsGit($resource,$site);\n\t\n if ($result == \"Y\")\n return TRUE;\n else \n return FALSE; \n}", "public static function isGitHubRepoUrl(string $url): bool\n {\n return preg_match(self::GH_REGEX, $url);\n }", "function git_is_clean($path) {\n\t$status = GitUtil::getStatus($path);\n\treturn count($status) === 0;\n}", "public function parse_git_url( $git_url ) {\n\n\t\t\t// no git url, no deploy\n\t\t\tif ( empty( $git_url ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$matches = array();\n\n\t\t\t// match regex against url\n\t\t\tpreg_match( self::GIT_URL_PATTERN, $git_url, $matches );\n\n\t\t\t// didn't match, git url is not proper, no deploy\n\t\t\tif ( empty( $matches ) || ! is_array( $matches ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// didn't get the name of repo from url, url is malformed, no deploy\n\t\t\tif ( ! isset( $matches[ 2 ] ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// first matches key has the domain name of remote,\n\t\t\t// useful for picking appropriate schema\n\t\t\t$this->repo[ 'remote_domain' ] = $matches[ 1 ];\n\n\t\t\t// name of the repo, used to create the appropriate directories\n\t\t\t$this->repo[ 'name' ] = $matches[ 2 ];\n\n\t\t\t// everything went well\n\t\t\treturn true;\n\t\t}", "abstract function is_org_repo_compliant();", "private function isRepo($method)\n {\n return substr($method, 4, 10) == 'Repository';\n }", "public static function exists($repo)\n {\n return !static::exec('git', ['ls-remote', '[email protected]:' . $repo], true);\n }", "public static function repoExists($repo)\n\t{\n\t\treturn file_exists(\\Config::get('repoPath').$repo);\n\t}", "protected function getRepository() {\n\t\tif ($this->_repository === null) {\n\t\t\t$this->_repository = new AGitRepository();\n\t\t\t$this->_repository->setPath($this->path,true,true);\n\t\t\t$this->assertTrue(file_exists($this->path));\n\t\t}\n\t\treturn $this->_repository;\n\t}", "public function validateGitPlatform() : bool\n {\n /** @var string */\n $bitbucketPath = '/bitbucket';\n\n try {\n $response = $this->httpClient->request(\n ExternalLibraryHttpClient::GET,\n $bitbucketPath\n );\n\n if (self::HTTP_OK !== $response->getStatusCode()) {\n $this->logger->warning('Failed to login Bitbucket.');\n\n return false;\n }\n } catch (ClientException $exception) {\n $this->logger->warning(\n sprintf(\n 'Failed to login Bitbucket. %s ',\n $exception->getMessage()\n )\n );\n\n return false;\n }\n\n return true;\n }", "public static function determineGit($arg, &$matches)\n {\n $reg0 = '#^\n (?:git|https|http|ssh|rsync|file?)(://|@).*?(/|\\:)\n (?P<package>[a-zA-Z0-9\\-_]+)\n (?:\n (?:\\.git|)\n (?:\\#(?P<reference>.*?)|)\n )?\n $#x';\n\n return self::match([$reg0], $arg, $matches);\n }", "public function isFileInGit($filename)\n\t{\n\t\ttry\n\t\t{\n\t\t\t$this->execute(['ls-files', '--error-unmatch', $filename]);\n\t\t}\n\t\tcatch (GitException $git_exception)\n\t\t{\n\t\t\tswitch ($git_exception->getCode())\n\t\t\t{\n\t\t\tcase 1:\n\t\t\t\t// The `git ls-files --error-unmatch` command didn't find the given file in git and has yelled an error\n\t\t\t\t// number 1. This exception can be considered normal. We can just report that the file is not in git and\n\t\t\t\t// continue the execution normally.\n\t\t\t\treturn false;\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// An unrecognised error has occurred. Rethrow the exception.\n\t\t\t\tthrow $git_exception;\n\t\t\t}\n\t\t}\n\t\t// As the command didn't give any error code when exiting, it's a sign for us to know that the file _does_ exist in git.\n\t\treturn true;\n\t}", "public function existsRepo($repo = null)\n {\n return static::exists($repo ?: $this->getFull_name());\n }", "public function git_directory_path() {\n\t\t\treturn ($this->bare) ? $this->repo_path : $this->repo_path.\"/.git\";\n\t\t}", "public function exists()\n\t{\n\t\t// If we don't have a configuration file for the repository it doesn't exist.\n\t\treturn file_exists($this->_root . '/.git/config');\n\t}", "public function hasRepository(string $className): bool;", "public function git_repository()\n\t{\n\t\texec( 'cd ' . $this->theme_dir . '; git remote -v', $remotes );\n\n\t\tpreg_match( '#origin[\\s\\t][email protected]\\:([^\\.]+)#', $remotes[0], $matches );\n\n\t\t$remote = $matches[1];\n\n\t\treturn $remote;\n\t}", "abstract protected function isValid(Repository $repository, string $file): bool;", "public function hasRepository(): bool;", "public function test_git() {\n\t\t\t$descriptorspec = array(\n\t\t\t\t1 => array('pipe', 'w'),\n\t\t\t\t2 => array('pipe', 'w'),\n\t\t\t);\n\t\t\t$pipes = [];\n\t\t\t$resource = proc_open(Git::get_bin(), $descriptorspec, $pipes);\n\n\t\t\t$stdout = stream_get_contents($pipes[1]);\n\t\t\t$stderr = stream_get_contents($pipes[2]);\n\t\t\tforeach ($pipes as $pipe) {\n\t\t\t\tfclose($pipe);\n\t\t\t}\n\n\t\t\t$status = trim(proc_close($resource));\n\t\t\treturn ($status != 127);\n\t\t}", "private function _fetchGitRepository($url, $ref = 'master')\n\t{\n\t\t// Create a Git repository object within the system tmp folder for the url.\n\t\t$root = sys_get_temp_dir() . md5($url);\n\n\t\t// If the folder doesn't exist attempt to create it.\n\t\tif (!is_dir($root))\n\t\t{\n\t\t\tmkdir($root, 0777, true);\n\t\t}\n\n\t\t// Instantiate the repository object.\n\t\t$repo = new PackagerGitRepository($root);\n\n\t\t// Only clone the repository if it doesn't exist.\n\t\tif (!$repo->exists())\n\t\t{\n\t\t\t$repo->create();\n\t\t}\n\n\t\t// Get a clean checkout of the branch/tag required.\n\t\t$repo->fetch()\n\t\t\t->branchCheckout($ref)\n\t\t\t->clean();\n\n\t\treturn $root;\n\t}", "public static function open($repo_path) {\n\t\t\treturn new GitRepo($repo_path);\n\t\t}", "public function hasRepository(string $repository) :bool\n {\n return array_key_exists($repository, $this->repositories);\n }", "function git_clone($repo, $path, $initSubModules = false) {\n\tGitUtil::cloneRepo($repo, $path, $initSubModules);\n}", "public function isARepository($class)\n {\n return is_subclass_of($class, 'PostIt\\Repositories\\EntityRepository');\n }", "public function hasRepository();", "protected function isRepositoryReadable()\n {\n return $this->getRepository() instanceof ReadableInterface;\n }", "public function getGitRepository(): string\n {\n return 'https://github.com/Sylius/Sylius.git';\n }", "function get_repo_path($proj, $repos) {\n\n foreach ($repos as $repo) {\n $path = basename($repo);\n if ($path == $proj)\n return $repo;\n }\n}", "public static function getStatus($path) {\n\t\tif (!file_exists($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to get git status of $path. Path does not exist.\");\n\t\t}\n\n\t\tif (!is_dir($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to get git status of $path. Path is not a directory.\");\n\t\t}\n\n\t\tif (!self::isRepo($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to get git status of $path. Path is not a git repository.\");\n\t\t}\n\n\t\t$origCwd = getcwd();\n\t\tchdir($path);\n\n\t\t$output = array();\n\t\texec(\"git status --porcelain\", $output);\n\t\tif (count($output) === 0) {\n\t\t\treturn $output;\n\t\t}\n\n\t\t$files = array();\n\t\tforeach ($output AS $status) {\n\t\t\t$flag = substr($status, 0, 2);\n\t\t\t$file = trim(substr($status, 2));\n\n\t\t\t$idx = null;\n\t\t\t$fileInfo = null;\n\t\t\tswitch ($flag) {\n\n\t\t\t\tcase ' M': // Modified, not updated\n\t\t\t\t$idx = 'changed';\n\t\t\t\t$fileInfo = $file;\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'A ': // New file\n\t\t\t\t$idx = 'new';\n\t\t\t\t$fileInfo = $file;\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'D ': // Deleted file\n\t\t\t\t$idx = 'removed';\n\t\t\t\t$fileInfo = $file;\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'M ': // Modified, updated\n\t\t\t\t$idx = 'modified';\n\t\t\t\t$fileInfo = $file;\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'R ': // Renamed\n\t\t\t\t$idx = 'moved';\n\t\t\t\t$fileInfo = array_map(function ($a) {\n\t\t\t\t\treturn trim($a);\n\t\t\t\t}, explode('->', $file));\n\t\t\t\tbreak;\n\n\t\t\t\tcase '??': // Untracked\n\t\t\t\t$idx = 'untracked';\n\t\t\t\t$fileInfo = $file;\n\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\tassert(\"false /*Unrecognized git status flag $flag*/\");\n\t\t\t}\n\n\t\t\tif ($idx !== null) {\n\t\t\t\tif (!isset($files[$idx])) {\n\t\t\t\t\t$files[$idx] = array();\n\t\t\t\t}\n\t\t\t\t$files[$idx][] = $fileInfo;\n\t\t\t}\n\t\t}\n\n\t\tchdir($origCwd);\n\n\t\treturn $files;\n\t}", "public static function init($path)\n {\n $path .= '/';\n if (!is_dir($path)) {\n mkdir($path);\n } elseif (is_dir($path . 'objects')) {\n return false;\n }\n\n mkdir($path . 'objects');\n mkdir($path . 'objects/info');\n mkdir($path . 'objects/pack');\n mkdir($path . 'refs');\n mkdir($path . 'refs/heads');\n mkdir($path . 'refs/tags');\n\n file_put_contents($path . 'HEAD', 'ref: refs/heads/master');\n\n return true;\n }", "public function hasRepository($className);", "public function testGitLabRemoteRepository(): void\n {\n $repo = new GitLabRemoteRepository('r/r', './');\n $this->assertEquals('https://gitlab.com/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "public function cloneGitRepo($repo, $dir);", "public function getGitDirectory() : string\n {\n return !empty($this->settings['git-directory'])\n ? dirname($this->path) . DIRECTORY_SEPARATOR . $this->settings['git-directory']\n : getcwd() . DIRECTORY_SEPARATOR . '.git';\n }", "public function set_repo_path($repo_path, $create_new = false, $_init = true) {\n\t\t\tif (is_string($repo_path)) {\n\t\t\t\tif ($new_path = realpath($repo_path)) {\n\t\t\t\t\t$repo_path = $new_path;\n\t\t\t\t\tif (is_dir($repo_path)) {\n\t\t\t\t\t\t// Is this a work tree?\n\t\t\t\t\t\tif (file_exists($repo_path.\"/.git\") && is_dir($repo_path.\"/.git\")) {\n\t\t\t\t\t\t\t$this->repo_path = $repo_path;\n\t\t\t\t\t\t\t$this->bare = false;\n\n\t\t\t\t\t\t\tif (!is_writable($repo_path.\"/.git\")) {\n\t\t\t\t\t\t\t\t$user_info = posix_getpwuid(fileowner($repo_path.\"/.git\"));\n\t\t\t\t\t\t\t\t$file_owner = $user_info['name'];\n\t\t\t\t\t\t\t\t$this->command_prefix = 'sudo -u '.$file_owner.' ';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Is this a bare repo?\n\t\t\t\t\t\t} else if (is_file($repo_path.\"/config\")) {\n\t\t\t\t\t\t\t$parse_ini = parse_ini_file($repo_path.\"/config\");\n\t\t\t\t\t\t\tif ($parse_ini['bare']) {\n\t\t\t\t\t\t\t\t$this->repo_path = $repo_path;\n\t\t\t\t\t\t\t\t$this->bare = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($create_new) {\n\t\t\t\t\t\t\t\t$this->repo_path = $repo_path;\n\t\t\t\t\t\t\t\tif ($_init) {\n\t\t\t\t\t\t\t\t\t$this->run('init');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthrow new Exception('\"'.$repo_path.'\" is not a git repository');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception('\"'.$repo_path.'\" is not a directory');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ($create_new) {\n\t\t\t\t\t\tif ($parent = realpath(dirname($repo_path))) {\n\t\t\t\t\t\t\tmkdir($repo_path);\n\t\t\t\t\t\t\t$this->repo_path = $repo_path;\n\t\t\t\t\t\t\tif ($_init) $this->run('init');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new Exception('cannot create repository in non-existent directory');\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception('\"'.$repo_path.'\" does not exist');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function testGitHubRemoteRepository(): void\n {\n $repo = new GitHubRemoteRepository('r/r', './');\n $this->assertEquals('https://github.com/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "public function repository(string $targetPath, string $repoUrl): VcsRepository\n {\n if (preg_match(\"/^mock\\@(.*)$/\", $repoUrl, $matches)) {\n if (!DEV_MODE) {\n throw new InvalidArgumentException(\"Mock repositories '$repoUrl' are allowed only in dev-mode\");\n }\n return new MockVcsRepository($matches[1], $targetPath);\n }\n if (preg_match(\"/^(?<user>[a-z0-9_\\-]+)@(?<host>[a-z0-9\\-\\.]+)\\:(?<path>.*?)(\\?(?<params>.*))?$/\", $repoUrl, $matches)) {\n if (isset($matches[\"params\"])) {\n $opts = phore_parse_url($repoUrl);\n\n // Load the key from file\n $sshKeyFile = $opts->getQueryVal(\"ssh_priv_key_file\", null);\n if ($sshKeyFile !== null) {\n $this->sshPrivKey = phore_file($sshKeyFile)->get_contents();\n }\n\n // Load the key directly from parameter\n $sshKey = $opts->getQueryVal(\"ssh_priv_key\", null);\n if ($sshKey !== null) {\n $this->sshPrivKey = $sshKey;\n }\n }\n\n $url = $matches[\"user\"] . \"@\" . $matches[\"host\"] . \":{$matches[\"path\"]}\";\n\n return new SshGitRepository($url, $targetPath, $this->commitUserName, $this->commitEmail, $this->sshPrivKey);\n }\n if (preg_match(\"/^https.*$/\", $repoUrl)) {\n $opts = phore_parse_url($repoUrl);\n\n // Load the key from file\n $authUser = $opts->getQueryVal(\"auth_user\", null);\n if ($authUser !== null) {\n $this->gitUser = $opts->getQueryVal(\"auth_user\");\n }\n\n // Load the key directly from file\n $passFile = $opts->getQueryVal(\"auth_pass_file\", null);\n if ($passFile !== null) {\n $this->gitPassword = phore_file($passFile)->get_contents();\n }\n\n // Load the key directly from parameter\n $pass = $opts->getQueryVal(\"auth_pass\", null);\n if ($pass !== null) {\n $this->gitPassword = $pass;\n }\n\n $urlWithoutOpts = $opts->withQueryParams();\n\n return new HttpsGitRepository((string)$urlWithoutOpts, $targetPath, $this->commitUserName, $this->commitEmail, $this->gitUser,$this->gitPassword);\n }\n throw new InvalidArgumentException(\"Cannot determine repository type: $repoUrl\");\n }", "function config_from_git($git_sources)\n{\n\tglobal $branch, $revision, $commit_url;\n\n\t// only run git stuff, if sources exist, are git and git cli is available\n\tif (@file_exists($git_sources.'/.git') && !exec(\"hash git 2>/dev/null\"))\n\t{\n\t\t$branch = trim(exec(\"cd $git_sources >/dev/null 2>&1 && git branch --no-color 2>/dev/null | sed -e '/^[^*]/d' -e \\\"s/* \\(.*\\)/\\\\1/\\\"\"));\n\t\t$revision = exec(\"cd $git_sources >/dev/null 2>&1 && git rev-parse --short HEAD &2>/dev/null\");\n\t\t$matches = null;\n\t\tif (empty($commit_url) &&\n\t\t\t($remote = exec(\"cd $git_sources >/dev/null 2>&1 && git remote -v &2>/dev/null\")) &&\n\t\t\tpreg_match('/([email protected]:|https:\\/\\/github.com\\/)(.*)\\.git/i', $remote, $matches))\n\t\t{\n\t\t\t$commit_url = 'https://github.com/'.$matches[2].'/commit/';\n\t\t}\n\t\t//error_log(__METHOD__.\"('$git_sources') branch='$branch', revision='$revision', commit_url='$commit_url'\");\n\t}\n\t// get revision from request\n\telseif (!empty($_REQUEST['revision']) && preg_match('/^[0-9a-f]+$/', $_REQUEST['revision']))\n\t{\n\t\t$revision = $_REQUEST['revision'];\n\t}\n}", "protected static function getGitDir() {\n\t\tif ( !self::$gitDir ) {\n\t\t\t$conf = MediaWikiServices::getInstance()->getConfigFactory()->makeConfig( \"MABS\" );\n\t\t\tself::$gitDir = $conf->get( Config::REPO );\n\t\t}\n\t\treturn self::$gitDir;\n\t}", "public static function isModulePath($path)\n {\n if (!static::isLibraryPath($path)) {\n return false;\n }\n\n // Check for _config\n if (!is_file(\"$path/_config.php\") && !is_dir(\"$path/_config\")) {\n return false;\n }\n\n // Skip ignored modules\n $name = basename($path);\n $ignore = array('mysite', 'assets', 'vendor');\n return !in_array($name, $ignore);\n }", "function do_clone_or_pull($key, $url, $path, $operation) {\n // Already a git repo there. Do a pull.\n if ((is_dir($path)) && (file_exists($path . \"/.git\"))) {\n\tif($operation==\"TAG\"){\n\t\treturn do_fetch($key,$url,$path);\n\t}\n\telse{\n\t\treturn do_pull($key,$url,$path);\n\t}\n }\n \n // Try a clone\n $out = do_clone($key,$url,$path);\n if (!is_dir($path)) {\n $out .= \"\\nClone appeared to fail.\\n\";\n }\n return $out;\n}", "function valid_folder($path){\r\n\t$ignore = array('.', '..', '.svn', 'CVS', 'cache', 'install', 'index.html', '.htaccess', '_images');\r\n\tif (isset($path)){\r\n\t\tif (!is_file($path) && !is_link($path) && !in_array(basename($path), $ignore)){\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "protected function initializeEmptyGitRepository(): string\n {\n try {\n $repoPath = sys_get_temp_dir()\n . '/CaptainHook/tests/repo-'\n . time() . '-' . bin2hex(random_bytes(4));\n } catch (Exception $exception) {\n TestCase::fail($exception->getMessage());\n }\n\n $gitConfigFile = $repoPath . '/.git/config';\n\n $this->filesystem()->mkdir($repoPath);\n\n $this->mustRunInShell(['git', 'init', '--initial-branch=main', $repoPath]);\n $this->mustRunInShell(['git', 'config', '--file', $gitConfigFile, 'user.name', 'Acceptance Tester']);\n $this->mustRunInShell(['git', 'config', '--file', $gitConfigFile, 'user.email', '[email protected]']);\n\n return $repoPath;\n }", "public function setRepository($var)\n {\n GPBUtil::checkString($var, True);\n $this->repository = $var;\n\n return $this;\n }", "public function isDirectory(string $path): bool;", "public function isDirectory(string $path): bool;", "function pkg_get_repo_name($path) {\n\t$repos = pkg_list_repos();\n\n\t$default = $repos[0]['name'];\n\tforeach ($repos as $repo) {\n\t\tif ($repo['path'] == $path) {\n\t\t\treturn $repo['name'];\n\t\t}\n\t\tif (isset($repo['default'])) {\n\t\t\t$default = $repo['name'];\n\t\t}\n\t}\n\n\t/* Default */\n\treturn $default;\n}", "public function isInstalled(InstalledRepositoryInterface $repo, PackageInterface $package)\n {\n return parent::isInstalled($repo, $package) && is_dir($this->getComponentPath());\n }", "public function testGitLabRemoteRepositoryExternal(): void\n {\n $repo = new GitLabRemoteRepository('r/r', './', 'https://salsa.debian.org/');\n $this->assertEquals('https://salsa.debian.org/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "protected function repositoryExists()\n {\n return retry(2, fn() => $this->migrator->repositoryExists(), 0, function ($e) {\n try {\n if ($e->getPrevious() instanceof SQLiteDatabaseDoesNotExistException) {\n return $this->createMissingSqliteDatabase($e->getPrevious()->path);\n }\n\n $connection = $this->migrator->resolveConnection($this->option('database'));\n\n if (\n $e->getPrevious() instanceof PDOException &&\n $e->getPrevious()->getCode() === 1049 &&\n $connection->getDriverName() === 'mysql') {\n return $this->createMissingMysqlDatabase($connection);\n }\n\n return false;\n } catch (Throwable) {\n return false;\n }\n });\n }", "public function getFromFullPath($full_path) {\n $repo = $this->getByRepositoryRootMatch('gitolite/repositories', $full_path);\n if (!$repo) {\n $repo = $this->getByRepositoryRootMatch('gitroot', $full_path);\n }\n return $repo;\n }", "function isPhoto($path) \n {\n $exploded = explode('.', $path);\n $ext = strtolower(end($exploded));\n // Define the photos extensions\n $photoExtensions = ['png', 'jpg', 'jpeg', 'gif', 'jfif', 'tif', 'webp'];\n // Check if this extension belongs to the extensions we defined\n if (in_array($ext, $photoExtensions)) {\n return true;\n }\n return false;\n }", "public function cloneRepo($repo)\n {\n return $this->passthru('git', ['clone', '[email protected]:' . $repo]);\n }", "private function _is_valid_dir($path)\n\t{\n\t\treturn (is_dir($path) || (is_link($path) && is_dir(readlink($path))));\n\t}", "abstract protected function getGitCommand(): string;", "function fn_check_path($path)\n{\n $real_path = realpath($path);\n\n return str_replace('\\\\', '/', $real_path) == $path ? true : false;\n}", "protected function isRepositoryDeletable()\n {\n return $this->getRepository() instanceof DeletableInterface;\n }", "public function createReference($repository) { \n if ( $repository->exists() ) {\n throw new GitBackendException('Repository already exists');\n } \n $path = $repository->getPath();\n //create git root if does not exist\n $this->createGitRoot();\n //create project dir if does not exists\n $this->createProjectRoot($repository);\n $path = $this->getGitRootPath().DIRECTORY_SEPARATOR.$path;\n mkdir($path, 0770, true);\n chdir($path);\n $this->getDriver()->init($bare=true);\n\n return $this->setUpRepository($repository);\n }", "public static function isWorld(string $path): bool;", "private function getRepositoryPath()\n {\n $vendorDirectory = $this->getVendorDirectory();\n\n // @CHECKME: Couldn't this code break if a custom `vendor-dir` is used?\n $parts = explode(DIRECTORY_SEPARATOR, $vendorDirectory);\n array_pop($parts); // Remove 'vendor'\n $path = implode(DIRECTORY_SEPARATOR, $parts);\n\n return $path;\n }", "public static function hasGithubSupport()\n {\n return static::enabled(static::github());\n }", "function isImage(string $path): bool\n{\n $ext = getExtension($path);\n return ($ext === \"jpg\" || $ext === \"jpeg\" || $ext === \"png\");\n}", "public function supports($path)\n {\n return is_string($path)\n && is_dir($this->findAbsolutePath($path));\n }", "function get_project_link($repo, $type = false) {\n $path = basename($repo);\n\n switch ($type) {\n case 'targz':\n return \"<a href=\\\"\" . sanitized_url() . \"p=$path&dl=targz\\\">.tar.gz</a>\";\n break;\n case 'zip':\n return \"<a href=\\\"\" . sanitized_url() . \"p=$path&dl=zip\\\">.zip</a>\";\n break;\n case false:\n return $path;\n break;\n }\n}", "function prueba_git ()\r\n{\r\n\t/* Aqui estaria el codigo de la funcion */\r\n\r\n}", "function plugin_initconfig_repository()\n{\n global $_CONF;\n\n $c = config::get_instance();\n if (!$c->group_exists('repository')) {\n $c->add('sg_main', NULL, 'subgroup', 0, 0, NULL, 0, true, 'repository');\n $c->add('fs_main', NULL, 'fieldset', 0, 0, NULL, 0, true, 'repository');\n $c->add('repository_moderated', 1,\n 'select', 0, 0, 0, 10, true, 'repository');\n $c->add('max_pluginpatch_upload', 2000000, \n 'text', 0, 0, 0, 60, true, 'repository'); // 2 MB\n }\n\n return true;\n}", "public function isMerging(): bool\n {\n foreach (['MERGE_MSG', 'MERGE_HEAD', 'MERGE_MODE'] as $fileName) {\n if (file_exists($this->dotGitDir . DIRECTORY_SEPARATOR . $fileName)) {\n return true;\n }\n }\n return false;\n }", "public function checkIsDirectory($path);", "protected function isRepositoryWritable()\n {\n return $this->getRepository() instanceof WritableInterface;\n }", "public function checkIsSymlink($path);", "public function getRepository() /*: string*/ {\n if ($this->repository === null) {\n throw new \\Exception(\"Repository is not initialized\");\n }\n return $this->repository;\n }", "private function isContributor($user, $repo)\n {\n $contributors = $this->getContributorsFromRepo($repo);\n\n foreach ($contributors as $contributor) {\n if ($contributor['login'] == $user) {\n return true;\n }\n }\n\n return false;\n }", "public static function pathExists($path) {\n return file_exists($path) || is_link($path);\n }", "protected function isRemoteFile($src)\n {\n return str_contains($src, 'http://') || str_contains($src, 'https://');\n }", "public static function cloneRepo($repo, $path, $initSubModules = false) {\n\t\t$cloneCmd = sprintf(self::CLONE_CMD_TMPL,\n\t\t\t$repo,\n\t\t\t$path);\n\t\tpassthru($cloneCmd);\n\n\t\tif ($initSubModules) {\n\t\t\tself::initSubmodules($path);\n\t\t}\n\t}", "private function _guess_dir_name($repo_url) {\n $repo_url = trim($repo_url);\n $repo_url = rtrim($repo_url, '/');\n\n $repo_url = explode(':', $repo_url);\n $dir = explode('/', array_pop($repo_url));\n $dir = array_pop($dir);\n\n $dir = preg_replace('/\\.git$/i', '', $dir);\n\n return array_pop($dir);\n }", "public function getName()\n\t{\n\t\treturn 'git';\n\t}", "public function createGit()\n {\n if($GLOBALS['TL_CONFIG']['bx_git_path'])\n {\n $gitPath = TL_ROOT.$GLOBALS['TL_CONFIG']['bx_git_path'];\n }else{\n $gitPath = TL_ROOT.\"/\";\n }\n\n $git = new GitPhp\\GitRepository($gitPath);\n $git->init()->execute();\n \n //Set Remote\n $url = explode(\"://\", $GLOBALS['TL_CONFIG']['bx_git_host_url']);\n $git->remote()->setUrl('origin', $url[0].\"://\".$GLOBALS['TL_CONFIG']['bx_git_host_user'].\":\".$GLOBALS['TL_CONFIG']['bx_git_host_pass'].\"@\".$url[1]);\n }", "public function isFile(string $path): bool;", "public function isFile(string $path): bool;", "public function isPath( string $path ): bool {\n\t\t\treturn (bool) @preg_match(\n\t\t\t\t'/^(.+)/([^/]+)$/',\n\t\t\t\t$path\n\t\t\t);\n\t\t}", "function is_local($src)\n\t{\n\t\t// prepend scheme to scheme-less URLs, to make parse_url work\n\t\tif (0 === strpos($src, '//')) {\n\t\t\t$src = 'http:' . $src;\n\t\t}\n\n\t\t$url = @parse_url($src);\n\t\t$blog_url = @parse_url(home_url());\n\t\tif (false === $url)\n\t\t\treturn false;\n\n\t\tif (isset($url['scheme']))\n\t\t{\n\t\t\t// this should be an absolute URL\n\t\t\t// @since 1.3.0 consider sub-domain external for now\n\t\t\tif (0 <> strcmp($url['host'], $blog_url['host']))\n\t\t\t\treturn false;\n\n\t\t\treturn true;\n\t\t}\n\t\telse // Probably a relative link\n\t\t\treturn true;\n\t}", "public static function isSaveRelativePath($path)\n {\n if (false === self::isRelativePath($path)) {\n return false;\n }\n\n $parts = explode('/', $path);\n $level = 0;\n foreach ($parts as $part) {\n if ('..' === $part) {\n --$level;\n if ($level < 0) {\n return false;\n }\n } elseif ('' !== $part) {\n ++$level;\n }\n }\n\n return true;\n }", "public function get_repo( $repo = '' ){\n\n\t\t\tif( empty( $repo ) )\n\t\t\t\t$repo = $this->repo;\n\n\t\t\treturn $this->get_github_data( 'repo', $repo );\n\n\t\t}", "function repo(string $repository): RepositoryInterface\n {\n static $repos = [];\n\n if (!empty($repos[$repository])) {\n return $repos[$repository];\n }\n\n $repositoryClass = config('mongez.repositories.' . $repository);\n\n if (!$repositoryClass) {\n throw new NotFoundRepositoryException(sprintf('Call to undefined repository: %s', $repository));\n }\n\n $repositoryClass = App::make($repositoryClass);\n\n return $repos[$repository] = $repositoryClass;\n }", "public function isReadable(string $path): bool;", "function is_image($path)\n{\n\t$a = getimagesize($path);\n\t$image_type = $a[2];\n\n\tif(in_array($image_type , array(IMAGETYPE_GIF , IMAGETYPE_JPEG ,IMAGETYPE_PNG , IMAGETYPE_BMP)))\n\t{\n\t\treturn true;\n\t}\n\treturn false;\n}", "function isFeature($branch)\n{\n return strpos($branch, \"origin/feature/\") !== false;\n}", "public function git_working_branch()\n\t{\n\t\texec( 'cd ' . $this->theme_dir . '; git status', $status );\n\t\t$status = $status[0];\n\n\t\treturn preg_replace( '/# On branch/', '', $status );\n\t}", "function is_image( string $path ):bool\r\n {\r\n $a = getimagesize($path);\r\n $image_type = $a[2];\r\n\r\n if( in_array( $image_type , array( IMAGETYPE_GIF , IMAGETYPE_JPEG ,IMAGETYPE_PNG , IMAGETYPE_BMP) ) )\r\n {\r\n return true;\r\n }\r\n return false;\r\n }", "public function getRepositories($paths)\n {\n $allRepositories = [];\n\n foreach ($paths as $path) {\n $repositories = $this->recurseDirectory($path);\n\n if (empty($repositories)) {\n throw new \\RuntimeException('There are no GIT repositories in '.$path);\n }\n\n $allRepositories = $allRepositories + $repositories;\n }\n\n $allRepositories = array_unique($allRepositories, SORT_REGULAR);\n uksort($allRepositories, function ($k1, $k2) {\n return strtolower($k2) < strtolower($k1);\n });\n\n return $allRepositories;\n }", "public function isFullPath( string $path ): bool {\n\t\t\treturn (bool) @preg_match(\n\t\t\t\t'/((\\/|\\\\|\\/\\/|https?:\\\\\\\\|https?:\\/\\/)[a-z0-9 _@\\-^!#$%&+={}.\\/\\\\\\[\\]]+)+\\.[a-z]+$/',\n\t\t\t\t$path\n\t\t\t);\n\t\t}", "public function moduleExists()\n {\n $location1 = $this->files->isDirectory(base_path('Modules/' . $this->module));\n $location2 = $this->files->isDirectory(base_path('vendor/typicms/' . mb_strtolower($this->module)));\n\n return $location1 || $location2;\n }", "public static function isRelativePath($string)\n {\n if ('' === $string) {\n return true;\n }\n\n return DIRECTORY_SEPARATOR !== substr($string, 0, 1);\n }", "protected function supportsBoris()\n\t{\n\t\treturn extension_loaded('readline') && extension_loaded('posix') && extension_loaded('pcntl');\n\t}" ]
[ "0.78555274", "0.78191644", "0.73434734", "0.7162551", "0.66075826", "0.6401121", "0.62702554", "0.6078952", "0.6072967", "0.60449463", "0.5931745", "0.5838702", "0.56848264", "0.56798214", "0.5584139", "0.55010897", "0.549318", "0.54878926", "0.5483722", "0.5470934", "0.53864765", "0.5371736", "0.53619915", "0.5356071", "0.53011954", "0.52900016", "0.5236426", "0.52283823", "0.5185107", "0.51478636", "0.5091019", "0.50749844", "0.506007", "0.50585747", "0.50549537", "0.50416005", "0.50276977", "0.5017209", "0.50113004", "0.5005981", "0.4953708", "0.49406436", "0.49175513", "0.49158582", "0.49051452", "0.4875953", "0.48700008", "0.48552564", "0.484196", "0.482572", "0.482572", "0.48224694", "0.48166472", "0.47792345", "0.47766793", "0.47745043", "0.47732136", "0.47573587", "0.47388893", "0.4725963", "0.46964967", "0.467462", "0.46505854", "0.4649331", "0.46436447", "0.46401727", "0.46396956", "0.4632915", "0.46255633", "0.46239597", "0.46181315", "0.46083447", "0.4598498", "0.45927346", "0.456375", "0.45630062", "0.4560116", "0.45489618", "0.45476353", "0.45430163", "0.45226988", "0.45046553", "0.44924477", "0.44700384", "0.44700384", "0.44662023", "0.44328123", "0.44314054", "0.44246992", "0.44239524", "0.44141555", "0.44108468", "0.44003975", "0.43989566", "0.43909678", "0.43829593", "0.43825647", "0.43659788", "0.4344981", "0.43437412" ]
0.8648549
0
Determine whether or not a given git repository is clean.
function git_is_clean($path) { $status = GitUtil::getStatus($path); return count($status) === 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function isClean()\n {\n return empty(static::command('git status -s'));\n }", "function git_is_repo($path) {\n\treturn GitUtil::isRepo($path);\n}", "public static function is_repo($var) {\n\t\t\treturn (get_class($var) == 'GitRepo');\n\t\t}", "abstract function is_org_repo_compliant();", "function isGit($resource,$site) {\n\t\n //$error=[];\n //chdir(\"../../zone/\". $resource . \"/\" . $site);\n //exec('\"C:\\Program Files\\Git\\cmd\\git.exe\" rev-parse --verify master 2>&1', $output, $error[0]);\n //exec('\"C:\\Program Files\\Git\\cmd\\git.exe\" ls-remote -q --refs 2>&1', $output, $error[1]); \n\t$result = checkIsGit($resource,$site);\n\t\n if ($result == \"Y\")\n return TRUE;\n else \n return FALSE; \n}", "private function isGitObject(string $path): bool\n {\n // Non-bare Git repository.\n if (1 === preg_match('/.*\\/\\.git\\/objects\\/.+$/', $path)) {\n return true;\n }\n\n // Bare Git repository.\n preg_match('/(.*)\\/objects\\/.+$/', $path, $matches);\n\n if (isset($matches[1])) {\n return $this->gitDiscovery->isBareGitRepo($matches[1]);\n }\n\n return false;\n }", "public static function exists($repo)\n {\n return !static::exec('git', ['ls-remote', '[email protected]:' . $repo], true);\n }", "public static function isRepo($path) {\n\t\t$dotGitPath = $path . DIRECTORY_SEPARATOR . '.git';\n\t\t$dotGitExists = file_exists($dotGitPath);\n\t\t$dotGitIsDir = is_dir($dotGitPath);\n\n\t\treturn $dotGitExists && $dotGitIsDir;\n\t}", "public function exists()\n\t{\n\t\t// If we don't have a configuration file for the repository it doesn't exist.\n\t\treturn file_exists($this->_root . '/.git/config');\n\t}", "public function validateGitPlatform() : bool\n {\n /** @var string */\n $bitbucketPath = '/bitbucket';\n\n try {\n $response = $this->httpClient->request(\n ExternalLibraryHttpClient::GET,\n $bitbucketPath\n );\n\n if (self::HTTP_OK !== $response->getStatusCode()) {\n $this->logger->warning('Failed to login Bitbucket.');\n\n return false;\n }\n } catch (ClientException $exception) {\n $this->logger->warning(\n sprintf(\n 'Failed to login Bitbucket. %s ',\n $exception->getMessage()\n )\n );\n\n return false;\n }\n\n return true;\n }", "public function hasRepository(): bool;", "public function stageIsDirty() : bool\n {\n $stage = $this\n ->runProcess(new Process('git status --porcelain'))\n ->getOutput()\n ;\n\n return !!trim($stage);\n }", "protected function isRepositoryDeletable()\n {\n return $this->getRepository() instanceof DeletableInterface;\n }", "abstract protected function isValid(Repository $repository, string $file): bool;", "public function isClean();", "public function stageIsClean() : bool\n {\n return !$this->stageIsDirty();\n }", "public static function repoExists($repo)\n\t{\n\t\treturn file_exists(\\Config::get('repoPath').$repo);\n\t}", "public function isFileInGit($filename)\n\t{\n\t\ttry\n\t\t{\n\t\t\t$this->execute(['ls-files', '--error-unmatch', $filename]);\n\t\t}\n\t\tcatch (GitException $git_exception)\n\t\t{\n\t\t\tswitch ($git_exception->getCode())\n\t\t\t{\n\t\t\tcase 1:\n\t\t\t\t// The `git ls-files --error-unmatch` command didn't find the given file in git and has yelled an error\n\t\t\t\t// number 1. This exception can be considered normal. We can just report that the file is not in git and\n\t\t\t\t// continue the execution normally.\n\t\t\t\treturn false;\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// An unrecognised error has occurred. Rethrow the exception.\n\t\t\t\tthrow $git_exception;\n\t\t\t}\n\t\t}\n\t\t// As the command didn't give any error code when exiting, it's a sign for us to know that the file _does_ exist in git.\n\t\treturn true;\n\t}", "public function test_git() {\n\t\t\t$descriptorspec = array(\n\t\t\t\t1 => array('pipe', 'w'),\n\t\t\t\t2 => array('pipe', 'w'),\n\t\t\t);\n\t\t\t$pipes = [];\n\t\t\t$resource = proc_open(Git::get_bin(), $descriptorspec, $pipes);\n\n\t\t\t$stdout = stream_get_contents($pipes[1]);\n\t\t\t$stderr = stream_get_contents($pipes[2]);\n\t\t\tforeach ($pipes as $pipe) {\n\t\t\t\tfclose($pipe);\n\t\t\t}\n\n\t\t\t$status = trim(proc_close($resource));\n\t\t\treturn ($status != 127);\n\t\t}", "public function clean()\n\t{\n\t\t// Initialize variables.\n\t\t$out = array();\n\t\t$return = null;\n\n\t\t// Execute the command.\n\t\t$wd = getcwd();\n\t\tchdir($this->_root);\n\t\texec('git clean -fd', $out, $return);\n\t\tchdir($wd);\n\n\t\t// Validate the response.\n\t\tif ($return !== 0)\n\t\t{\n\t\t\tthrow new RuntimeException(sprintf('Failure cleaning the repository with code %d and message %s.', $return, implode(\"\\n\", $out)));\n\t\t}\n\n\t\treturn $this;\n\t}", "public function parse_git_url( $git_url ) {\n\n\t\t\t// no git url, no deploy\n\t\t\tif ( empty( $git_url ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$matches = array();\n\n\t\t\t// match regex against url\n\t\t\tpreg_match( self::GIT_URL_PATTERN, $git_url, $matches );\n\n\t\t\t// didn't match, git url is not proper, no deploy\n\t\t\tif ( empty( $matches ) || ! is_array( $matches ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// didn't get the name of repo from url, url is malformed, no deploy\n\t\t\tif ( ! isset( $matches[ 2 ] ) ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// first matches key has the domain name of remote,\n\t\t\t// useful for picking appropriate schema\n\t\t\t$this->repo[ 'remote_domain' ] = $matches[ 1 ];\n\n\t\t\t// name of the repo, used to create the appropriate directories\n\t\t\t$this->repo[ 'name' ] = $matches[ 2 ];\n\n\t\t\t// everything went well\n\t\t\treturn true;\n\t\t}", "private function isRepo($method)\n {\n return substr($method, 4, 10) == 'Repository';\n }", "private function isGitHook(string $path): bool\n {\n if (1 === preg_match('/.*\\/\\.git\\/hooks\\/.+$/', $path)) {\n return true;\n }\n\n // Bare Git repository.\n preg_match('/(.*)\\/hooks\\/.+$/', $path, $matches);\n\n if (isset($matches[1])) {\n return $this->gitDiscovery->isBareGitRepo($matches[1]);\n }\n\n return false;\n }", "public function hasRepository(string $className): bool;", "public function checkRepoStructure() : void\n {\n\n if (!is_dir($this->backupDir) || !is_writable($this->backupDir)) {\n throw new RuntimeException(\n 'The temporary directory you have configured (' . $this->backupDir . ') is either non existant or not writable'\n );\n }\n\n if (!is_dir($this->backupRepository)) {\n $mr = @mkdir($this->backupRepository, 0755, true);\n if (!$mr) {\n throw new RuntimeException('Cannot create the Repository ' . $this->backupRepository);\n }\n }\n\n if (!is_writable($this->backupRepository)) {\n throw new RuntimeException('Cannot write to Repository ' . $this->backupRepository);\n }\n\n if (is_dir($this->backupDir . '/' . $this->backupFormat)) {\n $this->recursiveRemoveDirectory($this->backupDir . '/' . $this->backupFormat);\n }\n }", "public function existsRepo($repo = null)\n {\n return static::exists($repo ?: $this->getFull_name());\n }", "protected function initializeEmptyGitRepository(): string\n {\n try {\n $repoPath = sys_get_temp_dir()\n . '/CaptainHook/tests/repo-'\n . time() . '-' . bin2hex(random_bytes(4));\n } catch (Exception $exception) {\n TestCase::fail($exception->getMessage());\n }\n\n $gitConfigFile = $repoPath . '/.git/config';\n\n $this->filesystem()->mkdir($repoPath);\n\n $this->mustRunInShell(['git', 'init', '--initial-branch=main', $repoPath]);\n $this->mustRunInShell(['git', 'config', '--file', $gitConfigFile, 'user.name', 'Acceptance Tester']);\n $this->mustRunInShell(['git', 'config', '--file', $gitConfigFile, 'user.email', '[email protected]']);\n\n return $repoPath;\n }", "public function hasUncommittedChanges($directory)\n {\n $changes = $this->run($directory, \"git diff-index --name-only HEAD\");\n return !(ctype_space($changes) || $changes = '');\n }", "public function git_working_branch()\n\t{\n\t\texec( 'cd ' . $this->theme_dir . '; git status', $status );\n\t\t$status = $status[0];\n\n\t\treturn preg_replace( '/# On branch/', '', $status );\n\t}", "public function hasRepository();", "public function hasRepository(string $repository) :bool\n {\n return array_key_exists($repository, $this->repositories);\n }", "public function isTrue(IO $io, Repository $repository): bool\n {\n return $this->allFilesInHaystack($this->filesToWatch, $this->getStagedFiles($repository));\n }", "protected function isRepositoryWritable()\n {\n return $this->getRepository() instanceof WritableInterface;\n }", "public function hasConflicts() {\n if(!isset($this->hasConflicts)) {\n $repo = Repo::getById($this->repoId);\n $clone = $repo->getCloneRepo();\n $currentBranch = $clone->getActiveBranch();\n $conflicts = false;\n\n // First download the main repository references in the cloned repository\n $clone->fetch();\n\n // First update the two branches on the clone repository\n $clone->checkout($this->to);\n $clone->pull();\n\n $clone->fetch();\n $clone->checkout($this->from);\n $clone->pull();\n\n if($currentBranch !== $this->to) {\n $clone->checkout($this->to);\n }\n\n try {\n $clone->run('merge --no-commit --no-ff ' . $this->from);\n }\n catch(GitException $e) {\n $conflicts = true;\n }\n\n try {\n $clone->run('merge --abort');\n }\n catch(GitException $e) {}\n\n if($currentBranch !== $this->to) {\n $clone->checkout($currentBranch);\n }\n\n\n $this->hasConflicts = $conflicts;\n }\n\n return $this->hasConflicts;\n }", "public function check()\n {\n $composerJson = file_get_contents(APPLICATION_PATH . '/composer.json');\n\n $json = json_decode($composerJson);\n\n foreach($json->require as $dependency => $version)\n {\n $lowercaseVersion = strtolower($version);\n if($lowercaseVersion === 'dev-master' ||\n $lowercaseVersion === 'dev-develop' ||\n $lowercaseVersion === '*') {\n return FALSE;\n }\n }\n\n return TRUE;\n }", "private function saveUpdateRepos()\n {\n $success = false;\n\n // Get the repos from Github\n $result = $this->getPHPRepos();\n\n // If something was returned, save it\n if ($result) {\n $success = $this->saveRepos();\n }\n\n return $success;\n }", "public static function isGitHubRepoUrl(string $url): bool\n {\n return preg_match(self::GH_REGEX, $url);\n }", "protected function repositoryExists()\n {\n return retry(2, fn() => $this->migrator->repositoryExists(), 0, function ($e) {\n try {\n if ($e->getPrevious() instanceof SQLiteDatabaseDoesNotExistException) {\n return $this->createMissingSqliteDatabase($e->getPrevious()->path);\n }\n\n $connection = $this->migrator->resolveConnection($this->option('database'));\n\n if (\n $e->getPrevious() instanceof PDOException &&\n $e->getPrevious()->getCode() === 1049 &&\n $connection->getDriverName() === 'mysql') {\n return $this->createMissingMysqlDatabase($connection);\n }\n\n return false;\n } catch (Throwable) {\n return false;\n }\n });\n }", "protected function confirmCachedRepoHasCorrectRemote($emptyOk = false)\n {\n if (!file_exists($this->dir)) {\n return;\n }\n // Check to see if the remote origin is already set to our exact url\n $currentURL = exec(\"git -C {$this->dir} config --get remote.origin.url\", $output, $result);\n\n if ($currentURL == $this->url()) {\n return;\n }\n // If the API exists, try to repair the URL if the existing URL is close\n // (e.g. someone switched authentication tokens)\n if ($this->api) {\n if (($emptyOk && empty($currentURL)) || ($this->api->addTokenAuthentication($currentURL) == $this->url())) {\n static::setRemoteUrl($this->url(), $this->dir);\n return;\n }\n }\n\n // TODO: This error message is a potential credentials leak\n throw new \\Exception(\"Directory `{$this->dir}` exists and is a clone of `$currentURL` rather than `{$this->url()}`\");\n }", "public function isClean(array &$vars) : bool\n {\n $beforeCleanup = $vars;\n $this->cleanupVars($vars);\n // pe($vars);\n return $beforeCleanup == $vars;\n }", "function cvs_delete_repository($cvs_project) {\r\n global $cvs_root;\r\n \r\n //We really don't want to delete the repository,\r\n //just erase the passwd file...\r\n\r\n $cvs_passwd_file = $cvs_root.\"/\".$cvs_project.\"/CVSROOT/passwd\";\r\n unlink( $cvs_passwd_file);\r\n\r\n $cvs_deleted_file = $cvs_root.\"/\".$cvs_project.\"/DELETED\";\r\n touch( $cvs_deleted_file);\r\n}", "private static function has_dev_packages(): bool {\n\t\t$cmd = 'composer -d ' . escapeshellarg( self::$root_path ) . ' show -N';\n\t\t$all_packages = shell_exec( $cmd );\n\t\t$cmd = 'composer -d ' . escapeshellarg( self::$root_path ) . ' show -N --no-dev';\n\t\t$non_dev_packages = shell_exec( $cmd );\n\t\treturn $all_packages !== $non_dev_packages;\n\t}", "protected function isRepositoryReadable()\n {\n return $this->getRepository() instanceof ReadableInterface;\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 static function hasGithubSupport()\n {\n return static::enabled(static::github());\n }", "public function ensureStageIsClean() : Git\n {\n if ($this->stageIsDirty()) {\n throw new \\Exception('The Git Staging area has uncommitted files. Clean up your current branch, then try again.');\n }\n\n return $this;\n }", "private function checkFilesPresent() {\n $store = $this->dataStoreGet(array('platform'));\n $server = (!empty($store) && isset($store['platform'])) ? $store['platform']['php_quantum']['SERVER'] : \\Drupal::request()->server->all();\n $files_exist = FALSE;\n $files_to_remove = array('CHANGELOG.txt', 'COPYRIGHT.txt', 'INSTALL.mysql.txt', 'INSTALL.pgsql.txt', 'INSTALL.txt', 'LICENSE.txt',\n 'MAINTAINERS.txt', 'README.txt', 'UPGRADE.txt', 'PRESSFLOW.txt', 'install.php',\n );\n\n foreach ($files_to_remove as $file) {\n $path = $server['DOCUMENT_ROOT'] . base_path() . $file;\n if (file_exists($path)) {\n $files_exist = TRUE;\n }\n }\n\n return $files_exist ? 1 : 0;\n }", "public static function version()\n {\n if (! file_exists('.git')) {\n return '*no-git* (dirty)';\n }\n\n return preg_replace('/\\s+/', '', shell_exec('git describe --tag'));\n }", "function prueba_git ()\r\n{\r\n\t/* Aqui estaria el codigo de la funcion */\r\n\r\n}", "public function git_repository()\n\t{\n\t\texec( 'cd ' . $this->theme_dir . '; git remote -v', $remotes );\n\n\t\tpreg_match( '#origin[\\s\\t][email protected]\\:([^\\.]+)#', $remotes[0], $matches );\n\n\t\t$remote = $matches[1];\n\n\t\treturn $remote;\n\t}", "public function isFileModified($filename)\n\t{\n\t\ttry\n\t\t{\n\t\t\t$this->execute(['ls-files', '-m', '--error-unmatch', $filename]);\n\t\t}\n\t\tcatch (GitException $git_exception)\n\t\t{\n\t\t\tswitch ($git_exception->getCode())\n\t\t\t{\n\t\t\tcase 1:\n\t\t\t\t// The `git ls-files -m --error-unmatch` command didn't find the given file among modified files and has\n\t\t\t\t// yelled an error number 1. This exception can be considered normal. We can just report that the file is\n\t\t\t\t// not modified and continue the execution normally.\n\t\t\t\treturn false;\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t// An unrecognised error has occurred. Rethrow the exception.\n\t\t\t\tthrow $git_exception;\n\t\t\t}\n\t\t}\n\t\t// As the command didn't give any error code when exiting, it's a sign for us to know that the file is modified.\n\t\treturn true;\n\t}", "public function execute()\n {\n $cmd = 'rm -Rf \"%s\"';\n if (IS_WIN) {\n $cmd = 'rmdir /S /Q \"%s\"';\n }\n $this->phpci->executeCommand($cmd, $this->phpci->buildPath . 'composer.phar');\n $this->phpci->executeCommand($cmd, $this->phpci->buildPath . 'composer.lock');\n\n $success = true;\n \n foreach ($this->remove as $file) {\n $ok = $this->phpci->executeCommand($cmd, $this->phpci->buildPath . $file);\n\n if (!$ok) {\n $success = false;\n }\n }\n\n return $success;\n }", "public function hasRepository($className);", "protected function checkDiffs() {\n $status = $this->terminal->run($this->git->status());\n \n if (strpos($status, 'nothing to commit') === false)\n {\n \n $this->output->write('<info>Changes found</info>');\n $this->output->write(PHP_EOL);\n // Show diff\n $this->output->writeln($this->terminal->ignoreError()->run($this->git->diff())); \n \n $message = $this->dialog->ask(\n $this->output,\n '<question>You have uncommitted changes, please provide a commit message:</question> '\n );\n\n $this->terminal->run($this->git->add('-A .'));\n \n $this->terminal->ignoreError()->run($this->git->commit($message));\n \n } else {\n $this->output->write('<info>Ok</info>' . PHP_EOL);\n }\n }", "public static function hasGitlabSupport()\n {\n return static::enabled(static::gitlab());\n }", "public function git_directory_path() {\n\t\t\treturn ($this->bare) ? $this->repo_path : $this->repo_path.\"/.git\";\n\t\t}", "function cemhub_check_temporary_repository_files($set_message = TRUE) {\n $temp_files_path = cemhub_get_files_repository_path(TRUE);\n $checked_temporary_repository = file_prepare_directory($temp_files_path);\n\n if (empty($checked_temporary_repository) && $set_message) {\n $message = t('Temporary repository files @path does not exist or is not writable, please fix this.',\n array('@path' => $temp_files_path));\n drupal_set_message($message, 'warning');\n }\n\n return $checked_temporary_repository;\n}", "public function isMerging(): bool\n {\n foreach (['MERGE_MSG', 'MERGE_HEAD', 'MERGE_MODE'] as $fileName) {\n if (file_exists($this->dotGitDir . DIRECTORY_SEPARATOR . $fileName)) {\n return true;\n }\n }\n return false;\n }", "protected function getRepository() {\n\t\tif ($this->_repository === null) {\n\t\t\t$this->_repository = new AGitRepository();\n\t\t\t$this->_repository->setPath($this->path,true,true);\n\t\t\t$this->assertTrue(file_exists($this->path));\n\t\t}\n\t\treturn $this->_repository;\n\t}", "public function hasComposerFile()\n {\n return file_exists(sprintf('%s/composer.lock', $this->baseDirectory));\n }", "public function checkVcs()\n {\n // Cancel if not using any VCS\n if (mb_strtolower($this->config->getContextually('strategies.create-release')) !== 'clone') {\n return true;\n }\n\n $this->explainer->line('Checking presence of '.$this->vcs->getBinary());\n $results = $this->vcs->run('check');\n $this->toOutput($results);\n\n $isPresent = $this->status();\n if (!$isPresent) {\n $this->explainer->error($this->vcs->getBinary().' could not be found');\n }\n\n return $isPresent;\n }", "protected function needsToBeCleaned()\n {\n return boolval($this->cleanData);\n }", "public function ensureRepositoryExist()\r\n\t{\r\n\t\t$response = \"\";\r\n\t\t$isExist = $this->schema->tableExist($this->table);\r\n\t\tif ($isExist == 0) {\r\n\t\t\t$response .= $this->repository->createRepository();\r\n\t\t}\r\n\r\n\t\treturn $response;\r\n\t}", "public function isFullFledged(TokenInterface $token = null): bool;", "function is_dir_empty($diectory)\n {\n if (!is_dir($diectory)) return false;\n foreach (scandir($diectory) as $dir)\n {\n if (!in_array($dir, ['.','..','.json'])) return false;\n }\n return true;\n }", "public function deactivateRepo($name)\n {\n require_once('class/Class.WIFF.php');\n\n $wiff = WIFF::getInstance();\n\n $xml = $wiff->loadContextsDOMDocument();\n if ($xml === false) {\n $this->errorMessage = sprintf(\"Error loading 'contexts.xml': %s\", $wiff->errorMessage);\n return false;\n }\n\n $xpath = new DOMXPath($xml);\n // Check this repository exists\n $contextRepoList = $xpath->query(\"/contexts/context[@name='\" . $this->name . \"']/repositories/access[@use='\" . $name . \"']\");\n if ($contextRepoList->length == 1) {\n $xpath->query(\"/contexts/context[@name='\" . $this->name . \"']/repositories\")->item(0)->removeChild($contextRepoList->item(0));\n $ret = $wiff->commitDOMDocument($xml);\n if ($ret === false) {\n $this->errorMessage = sprintf(\"Error writing file '%s': %s\", $wiff->errorMessage);\n return false;\n }\n\n foreach ($this->repo as $repo) {\n if ($repo->name == $name) {\n unset($this->repo[array_search($repo, $this->repo)]);\n }\n }\n\n return true;\n } else {\n $this->errorMessage = sprintf(\"Could not find active repository '%s' in context '%s'.\", $name, $this->name);\n return false;\n }\n }", "public function has_no_active_dependencies(): bool;", "public function valid()\n \t{\n $handle = $this->getHandle(); \n while (!isset($handle->current) || $handle->current == '.' || $handle->current == '..') $handle->current = readdir($handle->resource);\n \n return $handle->current !== false;\n \t}", "public function isRoot(): bool\n {\n return empty($this->filePath);\n }", "public function isCurrentBranchUpToDate() {\n\t\treturn (\n\t\t\t$current_branch = $this->getCurrentBranch()\n\t\t\t&& 0 == $this->repository->getLog('HEAD..origin/' . $this->getCurrentBranch()->getName(), /*$path=*/null, /*$limit=*/1)->count()\n\t\t);\n\t}", "protected function bumperGitReady()\n {\n $task = 'Robot\\Task\\Git';\n if (!in_array($task, class_uses($this)) || !method_exists($this, 'taskGitRequirements')) {\n throw new RequiredTaskException('Bumper', $task);\n }\n\n return $this->taskGitRequirements()->clean()->run()->wasSuccessful();\n }", "public function testGitLabRemoteRepository(): void\n {\n $repo = new GitLabRemoteRepository('r/r', './');\n $this->assertEquals('https://gitlab.com/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "public function createReference($repository) { \n if ( $repository->exists() ) {\n throw new GitBackendException('Repository already exists');\n } \n $path = $repository->getPath();\n //create git root if does not exist\n $this->createGitRoot();\n //create project dir if does not exists\n $this->createProjectRoot($repository);\n $path = $this->getGitRootPath().DIRECTORY_SEPARATOR.$path;\n mkdir($path, 0770, true);\n chdir($path);\n $this->getDriver()->init($bare=true);\n\n return $this->setUpRepository($repository);\n }", "public function isDirty()\r\n\t{\r\n\t\treturn (count($this->changelog)>0) ? true : false;\r\n\t}", "protected function getAgainst()\n {\n ob_start();\n $result = shell_exec('git rev-parse --verify --quiet HEAD');\n ob_clean();\n // Check if we're on a semi-secret empty tree\n if ($result) {\n return 'HEAD';\n } else {\n // Initial commit: diff against an empty tree object\n return '4b825dc642cb6eb9a060e54bf8d69288fbee4904';\n }\n }", "public static function checkFileExistsnDelete(array $files)\n {\n $status = false;\n foreach($files as $key => $file)\n {\n if(Storage::exists($file))\n {\n $status = Storage::delete($file);\n }\n }\n\n return $status;\n }", "private function _fetchGitRepository($url, $ref = 'master')\n\t{\n\t\t// Create a Git repository object within the system tmp folder for the url.\n\t\t$root = sys_get_temp_dir() . md5($url);\n\n\t\t// If the folder doesn't exist attempt to create it.\n\t\tif (!is_dir($root))\n\t\t{\n\t\t\tmkdir($root, 0777, true);\n\t\t}\n\n\t\t// Instantiate the repository object.\n\t\t$repo = new PackagerGitRepository($root);\n\n\t\t// Only clone the repository if it doesn't exist.\n\t\tif (!$repo->exists())\n\t\t{\n\t\t\t$repo->create();\n\t\t}\n\n\t\t// Get a clean checkout of the branch/tag required.\n\t\t$repo->fetch()\n\t\t\t->branchCheckout($ref)\n\t\t\t->clean();\n\n\t\treturn $root;\n\t}", "public function is_vcs_checkout($context)\n {\n }", "public function clean($mode = \\Zend_Cache::CLEANING_MODE_ALL, array $tags = [])\n {\n if ($this->cachePath) {\n foreach (glob($this->cachePath . '/*') as $file) {\n if (is_file($file)) {\n unlink($file);\n }\n }\n return true;\n }\n return false;\n }", "public function isValid()\n {\n foreach ($this->repo as $repository) {\n /**\n * @var Repository $repository\n */\n $repository->needAuth();\n }\n }", "protected static function getGitDir() {\n\t\tif ( !self::$gitDir ) {\n\t\t\t$conf = MediaWikiServices::getInstance()->getConfigFactory()->makeConfig( \"MABS\" );\n\t\t\tself::$gitDir = $conf->get( Config::REPO );\n\t\t}\n\t\treturn self::$gitDir;\n\t}", "function clean() {\n return $this->_exec( \"reset --hard HEAD\" );\n }", "function syncIsDirty($sync)\n{\n // Clean the array\n $sync = array_filter($sync);\n\n // If empty = clean\n return !empty($sync);\n}", "public function isValid () {\n\treturn (is_dir($this->getPath())) ? true : false;\n }", "public function isAggregateRoot()\n {\n return $this->repositoryClassName !== null;\n }", "public function isAllowedBranch(){\r\n\t\t// checker\r\n\t\t$check = false;\r\n\t\t// check if the payload with ref exists\r\n\t\tif (isset($this->payload->ref) && strpos($this->payload->ref, GIT_BRANCH)) {\r\n\t\t\t$check = true;\r\n\t\t}\r\n\t\t// return the checker\r\n\t\treturn $check;\r\n\t}", "function cumple_dependencias()\n\t{\n\t\treturn count($this->get_dependencias_faltantes()) > 0;\n\t}", "public function isClean() {\n $set = new Collection($this->_data);\n $result = $set->reduce(function ($accumulated, $entity) {\n return $accumulated && !($entity->isDirty());\n }, TRUE);\n return $result;\n }", "public function hasDirectory(): bool;", "public function hasDirectory(): bool;", "function Clean()\n \t{\n\n\t\t\n\t\treturn TRUE;\n \t}", "private function has_final_mod($mods)\n {\n if (!$mods) return false;\n \n foreach ($mods as $mod)\n if ($mod->type === T_FINAL) \n return true;\n \n return false;\n }", "public function testPartialDirty()\n {\n copy(__DIR__ . '/functional_dirty/Test_new_commit.php', $this->folder_final . '/Test.php'); // make file dirty\n $cmd = 'git commit -a -m \"second commit\" --no-edit 2>&1';\n $err = exec($cmd, $out, $code);\n if ($code) {\n $this->fail(\"Failed to create commit: $err\");\n }\n\n $cmd = \"git branch new_branch 2>&1 && git checkout new_branch 2>&1\";\n exec($cmd, $out, $code);\n if ($code) {\n $this->fail(\"Failed to create new branch\");\n }\n copy(__DIR__ . '/functional_dirty/Test_after_commit.php', $this->folder_final . '/Test.php'); // make file dirty\n \n // formatter see differences\n $res = $this->callFormatter('check-git');\n $this->assertEquals(1, $res['code']);\n $this->assertStringMatchesFormat('Test.php issues:%a', $res['out']);\n\n // apply only to changed\n $res = $this->callFormatter('apply-git');\n $this->assertEquals(0, $res['code']);\n $this->assertStringMatchesFormat('Test.php formatted successfully%a', $res['out']);\n \n // re-check\n $res = $this->callFormatter('check-git');\n $this->assertEquals(0, $res['code']);\n $this->assertStringMatchesFormat('Test.php does not need formatting%a', $res['out']);\n \n // check for content equality (partially formatted)\n $this->assertFileEquals(__DIR__ . '/functional_dirty/Test_new_branch_formatted.php', $this->folder_final . '/Test.php');\n }", "public function isDirty(): bool;", "public function remove_from_svn( $reason ) {\n\t\tif ( ! defined( 'THEME_DROPBOX_PASSWORD' ) || ! THEME_DROPBOX_PASSWORD ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$svn_path = \"{$this->theme_slug}/{$this->theme->display( 'Version' )}\";\n\t\tif ( ! $this->theme_slug || ! $this->theme->display( 'Version' ) || strlen( $svn_path ) < 3 ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$import_msg = 'Removing theme %1$s - %2$s: %3$s';\n\t\t$import_msg = escapeshellarg( sprintf( $import_msg, $this->theme->display( 'Name' ), $this->theme->display( 'Version' ), $reason ) );\n\t\t$svn_path = escapeshellarg( \"https://themes.svn.wordpress.org/{$svn_path}\" );\n\t\t$password = escapeshellarg( THEME_DROPBOX_PASSWORD );\n\n\t\t$last_line = $this->exec_with_notify( self::SVN . \" --non-interactive --username themedropbox --password {$password} -m {$import_msg} rm {$svn_path}\" );\n\n\t\treturn (bool) preg_match( '/Committed revision (\\d+)\\./i', $last_line );\n\t}", "public function testCommit() {\n\t\t$repo = $this->getRepository();\n\t\t$repo->commit(\"test\"); // make sure there are no hidden changes\n\t\t$this->assertFalse($repo->commit(\"test\")); // no changes, should fail\n\t\t$files = $this->getFiles();\n\t\tforeach($files as $file) {\n\t\t\t$repo->add($this->path.\"/\".$file);\n\t\t\tfile_put_contents($this->path.\"/\".$file,uniqid());\n\t\t}\n\t\t$commitMessage = \"Test Commit: \".uniqid();\n\t\t$response = $repo->commit($commitMessage,true);\n\n\t\t$this->assertTrue(is_array($response));\n\t\tforeach($this->getFiles() as $file) {\n\t\t\t$this->assertTrue(isset($response[$file]));\n\t\t}\n\t}", "public function hasComposerFile(): bool\n {\n return false;\n }", "public static function determineGit($arg, &$matches)\n {\n $reg0 = '#^\n (?:git|https|http|ssh|rsync|file?)(://|@).*?(/|\\:)\n (?P<package>[a-zA-Z0-9\\-_]+)\n (?:\n (?:\\.git|)\n (?:\\#(?P<reference>.*?)|)\n )?\n $#x';\n\n return self::match([$reg0], $arg, $matches);\n }", "function _versioncontrol_git_log_update_repository(&$repository) {\n $root = escapeshellcmd($repository['root']);\n $chdir_ok = @chdir($root); // Set working directory to root.\n if ($chdir_ok === FALSE) {\n return FALSE;\n }\n if ($repository['git_specific']['locked'] == TRUE) {\n drupal_set_message(t('This repository is locked, there is already a fetch in progress. If this is not the case, press the clear lock button.'), 'error');\n return FALSE;\n }\n db_query('UPDATE {versioncontrol_git_repositories}\n SET locked = 1 WHERE repo_id = %d', $repository['repo_id']);\n\n // Get the list of current branches from Git.\n $branch_list = _versioncontrol_git_log_get_branches();\n $add_branch_label = array(\n 'name' => '', //filled later\n 'type' => VERSIONCONTROL_OPERATION_BRANCH,\n 'action' => VERSIONCONTROL_ACTION_MODIFIED\n );\n $branches = array();\n foreach ($branch_list as $branch_name) {\n $add_branch_label['name'] = $branch_name;\n $label_ret = versioncontrol_ensure_label($repository, $add_branch_label);\n $branches[$branch_name] = $label_ret;\n }\n //jpetso and me (corni) came to the conclusion that we will not delete branches.\n // TODO: revisit this!\n // Record new commits.\n $constraints = array(\n 'vcs' => array('git'),\n 'repo_ids' => array($repository['repo_id']),\n 'types' => array(VERSIONCONTROL_OPERATION_COMMIT),\n 'branches' => array() // used in the loop\n );\n $branches_per_commit = array();\n $existing_revs = array();\n // Get the existing revisions from the cache.\n $cache_object = cache_get('versioncontrol_git_rev_cache');\n // Check wether the cache object exists or not.\n if (is_object($cache_object)) {\n $existing_revs = $cache_object->data;\n }\n // Get the list of current branches from Git.\n // Generate the range per branch with which git shall be called.\n foreach ($branches as $branch_name => $label) {\n if (is_object($cache_object)) {\n // We get all commits we have in this branch to not process them later.\n $constraints['branches'] = array($branch_name);\n $latest_commit_date = 0;\n $commit_op = versioncontrol_get_operations($constraints);\n $latest_commit = FALSE;\n foreach ($commit_op as $vc_op_id => $c_op) {\n if ($latest_commit_date < $c_op['date']) {\n $latest_commit = $c_op['revision'];\n $latest_commit_date = $c_op['date'];\n $existing_revs[$branch_name][$latest_commit] = TRUE;\n }\n }\n }\n // No way to free the damned mysql result!!\n unset($commit_op);\n\n $commits_in_branch = _versioncontrol_git_log_get_commits_in_branch($repository, escapeshellarg($branch_name));\n foreach ($commits_in_branch as $i => $commit) {\n if (!isset($existing_revs[$branch_name][$commit])) {\n if (!isset($branches_per_commit[$commit]) || !is_array($branches_per_commit[$commit])) {\n $branches_per_commit[$commit] = array($label);\n }\n else {\n $branches_per_commit[$commit][] = $label;\n }\n }\n }\n }\n // This uses an extra loop on purpose!\n // Process all commits on a per-branch base.\n foreach ($branches_per_commit as $revision => $branch) {\n // Update commits from Git.\n _versioncontrol_git_process_commits($repository, $revision, $branches_per_commit, $existing_revs);\n }\n // Check tags.\n $tags = _versioncontrol_git_log_get_tags(); //Now we have the current list of tags as array of strings.\n $constraints = array(\n 'vcs' => array('git'),\n 'repo_ids' => array($repository['repo_id']),\n 'types' => array(VERSIONCONTROL_OPERATION_TAG)\n );\n $existing_tag_ops = versioncontrol_get_operations($constraints);\n $existing_tags = array();\n foreach ($existing_tag_ops as $tag_op) {\n if (!in_array($tag_op['labels'][0]['name'], $existing_tags)) {\n $existing_tags[] = $tag_op['labels'][0]['name'];\n }\n }\n // Deleting tags is *not* supported. Read the manual if you want to know why...\n // Check for new tags.\n $new_tags = array_diff($tags, $existing_tags);\n if (!empty($new_tags)) {\n _versioncontrol_git_process_tags($repository, $new_tags);\n }\n\n // Update repository updated field. Displayed on administration interface for documentation purposes.\n $repository['git_specific']['updated'] = time();\n db_query('UPDATE {versioncontrol_git_repositories}\n SET updated = %d, locked = 0 WHERE repo_id = %d',\n $repository['git_specific']['updated'], $repository['repo_id']);\n\n // Write back the cache.\n cache_set('versioncontrol_git_rev_cache', $existing_revs);\n return TRUE;\n}", "private static function _checkProjectVersion() {\n $composer_openfed = json_decode(file_get_contents('composer.openfed.json'), TRUE);\n $current_version = $composer_openfed['require']['openfed/openfed8'];\n preg_match('/(?:[\\d+\\.?]+[a-zA-Z0-9-]*)/', $current_version, $matches);\n // If current version is dev, we should ignore version check.\n if (strpos($current_version, 'dev') !== FALSE) {\n return FALSE;\n }\n\n return version_compare($matches[0], '10.0', '>=');\n }" ]
[ "0.7354931", "0.64854854", "0.6077937", "0.6058576", "0.6011798", "0.5966901", "0.57241297", "0.5722131", "0.5706511", "0.5610204", "0.55890906", "0.54955554", "0.54934967", "0.5435752", "0.53806317", "0.53009695", "0.5299914", "0.52395123", "0.5219888", "0.521423", "0.5207466", "0.5190261", "0.5160647", "0.5131007", "0.5078742", "0.50631833", "0.5036101", "0.50062853", "0.49844724", "0.4954342", "0.4953549", "0.49533692", "0.494914", "0.49352157", "0.49038196", "0.48814967", "0.48746222", "0.4846547", "0.48270962", "0.4820609", "0.47936675", "0.47844335", "0.47592014", "0.47392562", "0.47241014", "0.47032052", "0.46931037", "0.466331", "0.4630584", "0.4625696", "0.46251452", "0.4616961", "0.46150452", "0.46084183", "0.45741722", "0.45585024", "0.4555097", "0.45419365", "0.45391613", "0.45385695", "0.45377064", "0.45165837", "0.45135713", "0.45114952", "0.45012984", "0.44928336", "0.4490165", "0.44761533", "0.44618624", "0.44590124", "0.44586644", "0.4432123", "0.4414419", "0.44140536", "0.44070774", "0.43974525", "0.4394791", "0.43886936", "0.43876004", "0.43787083", "0.43712422", "0.4369722", "0.43648323", "0.4353153", "0.43511242", "0.4349453", "0.43454283", "0.43420666", "0.4324869", "0.4324869", "0.43209043", "0.43197846", "0.43169698", "0.43099242", "0.43077654", "0.43075952", "0.43074858", "0.43063718", "0.43012872", "0.4296187" ]
0.7517199
0
Create or move a lightweight tag
function git_move_tag($path, $tag, $version = 'HEAD') { GitUtil::moveTag($path, $tag, $version); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function addTagToPostInTheMiddle() {}", "public function moveTagFromEndToTheMiddle() {}", "public function insert(Tag $tag);", "private function createNewTag(object $tag) \n {\n if(Tag::find($tag->id)) return;\n\n $newTag = new Tag;\n \n $newTag->id = $tag->id;\n $newTag->name = $tag->name;\n $newTag->description = $tag->description;\n\n if(isset($tag->category->id)){\n\n $category = Category::firstOrCreate([\n 'id' => $tag->category->id,\n 'name' => $tag->category->name,\n 'description' => $tag->category->description,\n ]);\n\n $newTag->category()->associate($category->fresh());\n }\n\n $newTag->save();\n }", "function update_tag( $tag_id, $tag_name = null, $tag_color = null, $tag_bg = null ) {\n $tag = E_Tag::set_instance( $tag_id, $tag_name, $tag_color, $tag_bg );\n return $tag;\n}", "public function createTag()\n {\n return new Tag();\n }", "public function create()\n {\n $tag = new Tag();\n $this->vars['tag'] = $tag;\n $this->title = __('system.tag_add');\n $this->template = 'admin.tag';\n \n return $this->renderOutput();\n }", "function createTag($tag,$force=false,$msg=false){\n\t$default='tmp'.rand(0,99);\n\t$path='img/tags';\n\t$debug=isset($_GET['debug'])||(is_array($tag)&&$tag['debug']!='');\n\t$tid=substr(intToMd5(is_array($tag)?($tag['idTag']==''?$default:$tag['idTag']):$tag),-16);\n\t$tmpFile=$default;\n\tif($tid==$default){\n\t\t$force=true;\n\t\t$tid=$tmpFile;\n\t}\n\t$photo=$tid.'.jpg';\n\t$photom=$tid.'.m.jpg';\n\t$photopath=$path.'/'.$photo;\n\t$photompath=$path.'/'.$photom;\n\t$_path=LOCAL?RELPATH:FILESERVER;\n\t//Se busca la imagen de la tag\n\tif(!$force) $im=imagecreatefromany($_path.$photopath);\n\t//Si la imagen de la tag no existe,se crea\n\tif(!$im||$debug){\n\t\tif(!is_array($tag)) $tag=getTagData($tid);\n\t\t//Debugger\n\t\tif($debug){\n\t\t\t_imprimir($tag);\n\t\t\techo '<br/>fondo='.(strpos(' '.$tag['fondoTag'],'default')?RELPATH:$_path).'img/templates/'.$tag['fondoTag'];\n\t\t\techo '<br/>path='.$_path;\n\t\t\techo '<br/>photo='.$tag['photoOwner'];\n\t\t\techo '<br/>getUserPicture='.getUserPicture($tag['photoOwner']);\n\t\t}\n\t\tif($tag){\n\t\t\t$font=array(\n\t\t\t\tRELPATH.'fonts/trebuc.ttf',\n\t\t\t\tRELPATH.'fonts/trebucbd.ttf',\n\t\t\t\tRELPATH.'fonts/verdana.ttf',\n\t\t\t\tRELPATH.'fonts/verdanab.ttf'\n\t\t\t);\n\t\t\t//Se crea la imagen con el tamaño normal - 650 x 300.\n\t\t\t$im=imagecreatetruecolor(TAGWIDTH,TAGHEIGHT);\n\t\t\t//Crear algunos colores\n\t\t\t$blanco=imagecolorallocate($im,255,255,255);\n\t\t\t$negro=imagecolorallocate($im,0,0,0);\n\t\t\t//Fondo\n\t\t\t$imagen=(strpos(' '.$tag['fondoTag'],'default')?RELPATH:$_path).'img/templates/'.$tag['fondoTag'];\n\t\t\t$img=imagecreatefromany($imagen);\n\t\t\tif($img){\n\t\t\t\t$is=getimagesize($imagen);\n\t\t\t\t$dy=intval((TAGHEIGHT-$is[1])/2);\n\t\t\t\twhile($dy>0) $dy-=$is[1];\n\t\t\t\tdo{\n\t\t\t\t\t$dx=$is[0]>TAGWIDTH?intval((TAGWIDTH-$is[0])/2):0;\n\t\t\t\t\tdo{\n\t\t\t\t\t\timagecopy($im,$img,$dx,$dy,0,0,$is[0],$is[1]);\n\t\t\t\t\t\t$dx+=$is[0];\n\t\t\t\t\t}while($dx<TAGWIDTH);\n\t\t\t\t\t$dy+=$is[1];\n\t\t\t\t}while($dy<TAGHEIGHT);\n\t\t\t\timagedestroy($img);\n\t\t\t}\n\t\t\t//Bordes redondeados\n\t\t\t$cr=25;//radio de la curva\n\t\t\t$ce=array(1,1,1,1);//esquinas a redondear. (si,sd,ii,id). (tl,tr,bl,br).\n\t\t\t$mask=imagecreatetruecolor($cr*2+1,$cr*2+1);\n\t\t\timagealphablending($mask,false);\n\t\t\t//$maskcolor=imagecolorallocate($im,255,0,255);//color para remplazar por transparencia\n\t\t\t$maskcolor=imagecolorallocate($im,255,255,255);\n\t\t\t$transparent=imagecolorallocatealpha($im,0,0,0,127);\n\t\t\timagefilledrectangle($mask,0,0,$cr*2+1,$cr*2+1,$maskcolor);\n\t\t\timagefilledellipse($mask,$cr,$cr,$cr*2,$cr*2,$transparent);\n\t\t\t//Top-left corner-esquina superior izquierda\n\t\t\tif ($ce[0]){\n\t\t\t\t$cx=0;\n\t\t\t\t$cy=0;\n\t\t\t\t$dx=0;\n\t\t\t\t$dy=0;\n\t\t\t\timagecopy($im,$mask,$dx,$dy,$cx,$cy,$cr,$cr);\n\t\t\t}\n\t\t\t//Top-right corner - esquina superior derecha\n\t\t\tif ($ce[1]){\n\t\t\t\t$cx=$cr+1;\n\t\t\t\t$cy=0;\n\t\t\t\t$dx=TAGWIDTH-$cr;\n\t\t\t\t$dy=0;\n\t\t\t\timagecopy($im,$mask,$dx,$dy,$cx,$cy,$cr,$cr);\n\t\t\t}\n\t\t\t//Bottom-left corner - esquina inferior izquierda\n\t\t\tif ($ce[2]){\n\t\t\t\t$cx=0;\n\t\t\t\t$cy=$cr+1;\n\t\t\t\t$dx=0;\n\t\t\t\t$dy=TAGHEIGHT-$cr;\n\t\t\t\timagecopy($im,$mask,$dx,$dy,$cx,$cy,$cr,$cr);\n\t\t\t}\n\t\t\t//Bottom-right corner - esquina inferior derecha\n\t\t\tif ($ce[3]){\n\t\t\t\t$cx=$cr+1;\n\t\t\t\t$cy=$cr+1;\n\t\t\t\t$dx=TAGWIDTH-$cr;\n\t\t\t\t$dy=TAGHEIGHT-$cr;\n\t\t\t\timagecopy($im,$mask,$dx,$dy,$cx,$cy,$cr,$cr);\n\t\t\t}\n\t\t\timagedestroy($mask);\n\t\t\t/*\n\t\t\t//Transparencia en las esquinas (solo para png)\n\t\t\timagealphablending($im,false);\n\t\t\timagesavealpha($im,true);\n\t\t\t$transparent=imagecolorallocatealpha($im,255,0,255,127);\n\t\t\tfor($i=0;$i<TAGWIDTH;$i++)for($j=0;$j<TAGHEIGHT;$j++){\n\t\t\t\t$rgb=imagecolorat($im,$i,$j);\n\t\t\t\tif($rgb==16711935) imagesetpixel($im,$i,$j,$transparent);\n\t\t\t}\n\t\t\timagealphablending($im,true);\n\t\t\t/**/\n\t\t\t//Imagen de placa\n\t\t\t$imagen=RELPATH.'img/placaFondo.png';\n\t\t\t\t$img=imagecreatefromany($imagen);\n\t\t\t\tif($img){\n\t\t\t\t$is=getimagesize($imagen);\n\t\t\t\timagecopy($im,$img,0,0,0,0,$is[0],$is[1]);\n\t\t\t\timagedestroy($img);\n\t\t\t}\n\t\t\t//Imagen de usuario\n if($tag['idProduct'])\n $imagen=$_path.$tag['photoOwner'];\n else\n $imagen=$_path.getUserPicture($tag['photoOwner'],'img/users/default.png');\n\t\t\tif($debug) echo '<br/>'.$imagen;\n\t\t\t$img=imagecreatefromany($imagen);\n\t\t\tif($img){\n\t\t\t\t$is=getimagesize($imagen);\n\t\t\t\t$x=40;\n\t\t\t\t$y=215;\n\t\t\t\t//imagefilledrectangle($im,$x-1,$y-1,$x+60,$y+60,$blanco);//marco\n\t\t\t\timagecopyresampled($im,$img,$x,$y,0,0,60,60,$is[0],$is[1]);\n\t\t\t\timagedestroy($img);\n\t\t\t}\n\t\t\t//Textos de la tag.\n\t\t\t//texto1 y texto2 por su tamaño se les define un ancho maximo y pueden tener multiples lineas\n\t\t\t$luz\t=imagecolorhexallocatealpha($im,'#FFFFFF');\n\t\t\t$sombra\t=imagecolorhexallocatealpha($im,'#000000');\n\t\t\t//Tipos de fuentes. 0=normal,1=negrita\n\t\t\t//texto1 - Parte superior\n\t\t\t$fuente=$font[1];\n\t\t\t$texto=strclean($tag['texto']);\n\t\t\t$color=imagecolorhexallocate($im,$tag['color_code']);\n\t\t\t$size=15;\n\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto);\n\t\t\t$y=73;\n\t\t\t$mw=600;//max width - ancho maximo\n\t\t\t$tmp=explode(' ',$texto);\n\t\t\t$i=0;\n\t\t\tdo{\n\t\t\t\t$texto=$tmp[$i++];\n\t\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto);\n\t\t\t\twhile(count($tmp)>$i&&$txt[2]<$mw){\n\t\t\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto.' '.$tmp[$i]);\n\t\t\t\t\tif($txt[2]<$mw) $texto.=' '.$tmp[$i++];\n\t\t\t\t}\n\t\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto);\n\t\t\t\t$x=intval((TAGWIDTH-$txt[2])/2);\n\t\t\t\timagettftext($im,$size,0,$x+1,$y+1,$sombra,$fuente,$texto);\n\t\t\t\timagettftext($im,$size,0,$x-1,$y-1,$luz,$fuente,$texto);\n\t\t\t\timagettftext($im,$size,0,$x,$y,$color,$fuente,$texto);\n\t\t\t\t$y+=23;\n\t\t\t}while(count($tmp)>$i);\n\t\t\t//texto principal - Centro\n\t\t\t$fuente=$font[0];\n\t\t\t$texto=strtoupper(strclean($tag['code_number']));\n\t\t\t$color=imagecolorhexallocate($im,$tag['color_code2']);\n\t\t\t$size=45;\n\t\t\t$s=0;//separacion entre letras\n\t\t\t$len=strlen($texto);\n\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto);\n\t\t\t$x=intval((TAGWIDTH-$txt[2])/2);\n\t\t\t$y=165;\n\t\t\timagettftext($im,$size,0,$x+1,$y+1,$sombra,$fuente,$texto);\n\t\t\timagettftext($im,$size,0,$x-1,$y-1,$luz,$fuente,$texto);\n\t\t\timagettftext($im,$size,0,$x,$y,$color,$fuente,$texto);\n\t\t\t//nombre usuario\n\t\t\t$fuente=$font[1];\n\t\t\t$texto=strclean($tag['nameOwner']);\n\t\t\t$color=$blanco;\n\t\t\t$sombra=$negro;\n\t\t\t$size=15;\n\t\t\t$x=115;\n\t\t\t$y=223;\n\t\t\timagettftext($im,$size,0,$x+1,$y+1,$sombra,$fuente,$texto);\n\t\t\timagettftext($im,$size,0,$x,$y,$color,$fuente,$texto);\n\t\t\t//fecha\n\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto);\n\t\t\t$fuente=$font[0];\n\t\t\t$texto=date('d-M-Y H:i',$tag['date']);\n\t\t\t$size=8;\n\t\t\t$x+=$txt[2]+10;\n\t\t\timagettftext($im,$size,0,$x+1,$y+1,$sombra,$fuente,$texto);\n\t\t\timagettftext($im,$size,0,$x,$y,$color,$fuente,$texto);\n\n\t\t\t//texto2 - parte baja\n\t\t\t$fuente=$font[1];\n\t\t\t$texto=strclean($tag['texto2']);\n\t\t\t$color=imagecolorhexallocate($im,$tag['color_code3']);\n\t\t\t$size=10;\n\t\t\t$x=115;\n\t\t\t$y=241;\n\t\t\t$mw=430;//max width-ancho maximo\n\t\t\t$tmp=explode(' ',$texto);\n\t\t\t$i=0;\n\t\t\tdo{\n\t\t\t\t$texto=$tmp[$i++];\n\t\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto);\n\t\t\t\twhile(count($tmp)>$i&&$txt[2]<$mw){\n\t\t\t\t\t$txt=imagettfbbox($size,0,$fuente,$texto.' '.$tmp[$i]);\n\t\t\t\t\tif($txt[2]<$mw) $texto.=' '.$tmp[$i++];\n\t\t\t\t}\n\t\t\t\timagettftext($im,$size,0,$x+1,$y+1,$sombra,$fuente,$texto);\n\t\t\t\timagettftext($im,$size,0,$x-1,$y-1,$luz,$fuente,$texto);\n\t\t\t\timagettftext($im,$size,0,$x,$y,$color,$fuente,$texto);\n\t\t\t\t$y+=15;\n\t\t\t}while(count($tmp)>$i);\n\t\t}\n\t\t//subir el archivo al servidor\n\t\tif(!$debug){//si estamos en debug no se guarda\n\t\t\t$phototmp=RELPATH.$path.'/tmp'.rand().'.png';\n\t\t\timagepng($im,$phototmp);\n\t\t\tif (redimensionar($phototmp,RELPATH.$photopath,650)){\n\t\t\t\t@unlink($phototmp);\n\t\t\t\tuploadFTP($photo,'tags',RELPATH,1);\n\t\t\t\tif($msg) echo '<br/>guardada imagen '.$photo;\n\t\t\t}\n\t\t}\n\t}elseif($msg) echo '<br/>ya existe la imagen '.$photo;\n\t//FIN - creacion de la imagen de la tag\n\t//creamos la miniatura si no existe\n\tif(!fileExistsRemote($_path.$photompath)||$force){\n\t\tif(!$debug){//si estamos en debug no se guarda\n\t\t\t$phototmp=RELPATH.$path.'/'.$tmpFile.'.png';\n\t\t\timagepng($im,$phototmp);\n\t\t\tif (redimensionar($phototmp,RELPATH.$photompath,200)){\n\t\t\t\t@unlink($phototmp);\n\t\t\t\tuploadFTP($photom,'tags',RELPATH,1);\n\t\t\t\tif($msg) echo '<br/>guardada miniatura '.$photom;\n\t\t\t}\n\t\t}\n\t}\n\t$GLOBALS['cn']->query('UPDATE `tags` SET `img` =\"'.$tid.'\" WHERE `id` =\"'.$tag['id'].'\";');\n\treturn $tid;\n}", "function create_tag( $tag_name, $tag_color = null, $tag_bg = null ) {\n $tag = E_Tag::new_instance( $tag_name, $tag_color, $tag_bg );\n return $tag;\n}", "function doTagStuff(){}", "public function tagged( $tag );", "public function createTag()\n {\n $this->di->common->verifyAdmin();\n $form = new Form('tag-form', Models\\Tag::class);\n if ($this->di->request->getMethod() == 'POST') {\n if ($this->di->tag->createFromForm($form)) {\n $this->di->common->redirectMessage('admin/tag', 'Taggen <strong>' . htmlspecialchars($form->getModel()->name) . '</strong> har skapats.');\n }\n }\n \n return $this->di->common->renderMain('tag/edit', [\n 'tag' => $form->getModel(),\n 'update' => false,\n 'form' => $form\n ], 'Skapa tagg');\n }", "private function createTag($tag_name, $row) {\n // Check if we already have the tag in the destination.\n $result = \\Drupal::database()\n ->select('taxonomy_term_field_data', 't')\n ->fields('t', ['tid'])\n ->condition('t.vid', 'tags', '=')\n ->condition('t.name', $tag_name, '=')\n ->execute()\n ->fetchField();\n if ($result) {\n return $result;\n }\n // If we didn't have the tag already,\n // then create a new tag and return its id.\n $term = Term::create([\n 'name' => $tag_name,\n 'vid' => 'tags',\n ]);\n if ($term->save()) {\n return $term->id();\n }\n\n // If we didn't save for some reason, add a notice\n // to the migration, and return a null.\n $message = 'Taxonomy term failed to migrate. Missing term was: ' . $tag_name;\n $this->migration\n ->getIdMap()\n ->saveMessage(['nid' => $row->getSourceProperty('nid')], $message);\n return FALSE;\n }", "public function addTag(string $name, TagInterface $tag, string $placement = null);", "function addTag($line)\n{\n\t$elem = $this->parser->parseLine($line);\n\n\tif (isset($elem['after'])) {\n\t\t$this->elements = $this->insertAfter($this->elements, \n\t\t\tarray($elem['id'] => $elem), $elem['after']\n\t\t);\n\t}\n\telse {\n\t\t$this->elements[$elem['id']] = $elem;\n\t}\n}", "function create_tag($tag_id, $tip_id) {\n $rel_res = false;\n \n if (!$tag_id) {\n return null;\n }\n \n $sql = '\n INSERT INTO\n tags (id)\n VALUES\n (?)';\n \n // Note tag insert is always attempted, but may have no effect\n // if tag with $tag_id already exists\n $tag_res = $this->prep_and_exec($sql, [$tag_id]);\n \n if ($tag_res) {\n $rel_res = $this->associate_tag($tag_id, $tip_id);\n }\n \n return ($tag_res and $rel_res);\n }", "public function tagAs($objid, $tag);", "abstract protected function getTag() : Tag;", "private function makeNode(ISystemTag $tag) {\n\t\treturn new SystemTagNode($tag, $this->userSession->getUser(), $this->isAdmin(), $this->tagManager);\n\t}", "function add_tag($tag) {\n if (!is_object($tag)) {\n return false;\n }\n if (!isset($tag->name) or\n !isset($tag->value) or\n !isset($tag->ticketid) or\n isset($tag->id)){\n\n return false;\n }\n\n if (!insert_record('helpdesk_ticket_tag', $tag)) {\n return false;\n }\n\n // Lets make an update saying we added this tag.\n $dat = new stdClass;\n $dat->ticketid = $this->id;\n $dat->notes = get_string('tagaddedwithnameof', 'block_helpdesk') . $tag->name;\n $dat->status = HELPDESK_NATIVE_UPDATE_TAG;\n $dat->type = HELPDESK_UPDATE_TYPE_DETAILED;\n\n if(!$this->add_update($dat)) {\n notify(get_string('cantaddupdate', 'block_helpdesk'));\n }\n\n // Update modified time and refresh the ticket.\n $this->store();\n $this->fetch();\n return true;\n }", "public function inserirTag(Tag $tag){\n $this->tag[] = $tag;\n }", "static function GetOrCreateTag($tag){\n\t\tif(!strlen($tag)){ return null; }\n\n\t\t($out = Tag::FindByTag($tag)) ||\n\t\t($out = Tag::CreateNewRecord(array(\"tag\" => $tag)));\n\n\t\treturn $out;\n\t}", "public function undo_tag() {\n\t\t$version = $this->conf['common']['releasever'];\n\t\t$tag = str_replace( '$1', $version, $this->conf['common']['tagname'] );\n\n\t\tforeach ( $this->conf['extensions'] as $ext => $checkout ) {\n\t\t\tchdir( \"{$this->dir}/extensions/$ext\" );\n\t\t\t$cTag = escapeshellarg( $tag );\n\t\t\texec( \"git checkout master\" );\n\t\t\texec( \"git tag -d $cTag\" );\n\t\t\t$cTag = escapeshellarg( \":refs/tags/$tag\" );\n\t\t\texec( \"git push origin $cTag\" );\n\t\t}\n\t}", "function otag($tag=false, $class='', $style='', $id='', $extra='')\n\t{\n\t\tif($tag == false)\n\t\t{\n\t\t\t$tag = $this->default_tag['tag'];\n\t\t\t$class = $this->default_tag['class'];\n\t\t\t$style = $this->default_tag['style'];\n\t\t\t$extra = $this->default_tag['extra'];\n\t\t}\n\t\t$class = ($class != '' ? ' class=\"' . $class . '\"' : '');\n\t\t$style = ($style != '' ? ' style=\"' . $style . '\"' : '');\n\t\t$id = ($id != '' ? ' id=\"' . $id . '\"' : '');\n\t\t$extra = ($extra != '' ? ' ' . $extra : '');\n\t\tarray_push($this->closetags, $tag);\n\t\treturn $this->xecho('<' . $tag . $class . $style . $id . $extra . '>');\n\t}", "function add_tag($tag) {\n array_push($this->tags, $tag);\n }", "function open_tag($element, $attr){\n\t\n}", "function _tag_holding_add($name, $line)\n\t{\n\t\t$this->_tag_holding[] = array('name' => $name, 'line' => $line);\n\t}", "function convert_tag( &$obj )\n\t{\n\t\t// set default photo\n\t\t$obj->default_photo = $this->get_default_photo( $obj->id, 'tag' );\n\n\t\t// set default icon \n\t\t$obj->default_icon = $this->get_default_photo( $obj->id, 'tag-icon' );\n\n\t}", "public function createTag(string $tagName) : Tag {\n \n // Forsøg på XSS forhindres\n $tagName = htmlentities($tagName);\n \n // Tagget slås op i databasen \n $query = 'SELECT tag_id, tag_name FROM tags WHERE tag_name=?';\n if($stmt = $this->conn->prepare($query)) {\n $stmt->bind_param('s', $tagName);\n \n $stmt->execute();\n $stmt->bind_result($id, $name);\n $result = $stmt->fetch();\n $stmt->close();\n \n if(!$result) { \n // Tagget findes ikke\n if($stmt = $this->conn->prepare('INSERT INTO tags (tag_name) VALUES (?)')){\n $stmt->bind_param('s', $tagName);\n $stmt->execute();\n $stmt->close();\n $tagId = $this->conn->insert_id;\n \n $tag = new Tag($tagId, $tagName);\n return $tag; \n } else {\n die(\"Fejl: Kunne ikke indsætte tag i databasen.\");\n }\n } else {\n // Tagget findes\n $tag = new Tag($id, $name);\n return $tag; \n }\n \n } else {\n die(\"Fejl: Kunne ikke hente taginfo fra databasen.\");\n } \n }", "public function tag($name = null, $force = false) {\n\t\treturn $this->cmd('tag')->name($name)->force($force);\n\t}", "public function addNewTag($tagName) {\n $sql = \"INSERT INTO t_tags VALUES(?)\";\n $select = $this->con->prepare($sql);\n $select->bind_param(\"s\", $tagName);\n $select->execute();\n $select->close();\n }", "public static function add_tag($name) {\n global $wpdb;\n $data = array(\n 'name' => $name\n );\n\n // Si no se inserta nada, retornamos false\n if (!$wpdb->insert('XTB_TAGS', $data, array('%s'))) {\n return null;\n }\n\n return $wpdb->insert_id;\n //return true;\n }", "function tag($name='',$content='',$attrs='')\n{\n return \"<${name} ${attrs}>${content}</${name}>\";\n}", "public function attachTagToPostAtTheEnd() {}", "public function createTag()\n {\n $data = array();\n $data['actives'] = array('xhbd-contents');\n $data['action_controller'] = 'create_tag';\n return view('backend.tags.be_create_tag_view', compact('data'));\n }", "public function createTag($tag){\n\t\t$user = $this->getUser();\n\t\tif(!isset($user[\"id\"]))return false;\n\t\tif(is_array($tag)){\n\t\t\t$success = true;\n\t\t\tforeach($tag as $t){\n\t\t\t\tif(!$this->createTag($t)){\n\t\t\t\t\t$success = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $success;\n\t\t}else{\n\t\t\t$tags = $this->getTag($tag);\n\t\t\tif(isset($tags[\"tagid\"])){\n\t\t\t\treturn $tags[\"tagid\"];\n\t\t\t}\n\t\t\tif(strlen(trim($tag))<3)return false;\n\t\t\t$tag = strtolower($tag);\n\t\t\t$this->log(\"@\".$user[\"id\"].\" (\".$user[\"username\"].\") creates tag '\".$tag.\"'\");\n\t\t\t$query = Queries::createtag($tag);\n\t\t\treturn $this->query($query);\n\t\t}\n\t}", "public function create()\n {\n getAuthentication()->requireAuthentication();\n $tag = $_POST['tag'];\n unset($_POST['tag']);\n return $this->update($tag);\n }", "public function autoTag()\n {\n $tags = Tag::string2array($this->tags);\n \n if(isset($this->name) && !empty($this->name)) {\n $tags[] = $this->name;\n }\n \n $tags[] = $this->arena->name;\n $tags[] = $this->ltype->display_name;\n \n $this->tags = Tag::array2string(array_unique($tags));\n }", "function save_tag($edit = false)\n{\n global $xoopsConfig, $xoopsSecurity;\n\n $page = rmc_server_var($_POST, 'page', 1);\n\n if (!$xoopsSecurity->check()) {\n redirectMsg('tags.php?page=' . $page, __('Operation not allowed!', 'mywords'), 1);\n die();\n }\n\n $name = rmc_server_var($_POST, 'name', '');\n $short = rmc_server_var($_POST, 'short', '');\n\n if ('' == $name) {\n redirectMsg('tags.php?page=' . $page, __('You must provide a name!', 'mywords'), 1);\n die();\n }\n\n if ($edit) {\n $id = rmc_server_var($_POST, 'id', 0);\n if ($id <= 0) {\n redirectMsg('tags.php?page=' . $page, __('Tag id not provided!', 'mywords'), 1);\n die();\n }\n\n $tag = new MWTag($id);\n if ($tag->isNew()) {\n redirectMsg('tags.php?page=' . $page, __('Tag does not exists!', 'mywords'), 1);\n die();\n }\n } else {\n $tag = new MWTag();\n }\n\n if ('' == trim($short)) {\n $short = TextCleaner::sweetstring($name);\n } else {\n $short = TextCleaner::sweetstring($short);\n }\n\n // Check if tag exists\n $db = XoopsDatabaseFactory::getDatabaseConnection();\n if ($edit) {\n $sql = 'SELECT COUNT(*) FROM ' . $db->prefix('mod_mywords_tags') . \" WHERE (tag='$name' OR shortname='$short') AND id_tag<>$id\";\n } else {\n $sql = 'SELECT COUNT(*) FROM ' . $db->prefix('mod_mywords_tags') . \" WHERE tag='$name' OR shortname='$short'\";\n }\n\n list($num) = $db->fetchRow($db->query($sql));\n if ($num > 0) {\n redirectMsg('tags.php?page=' . $page, __('A tag with same name or same short name already exists!', 'mywords'), 1);\n die();\n }\n\n $tag->setVar('tag', $name);\n $tag->setVar('shortname', $short);\n if ($tag->save()) {\n redirectMsg('tags.php', __('Database updated successfully!', 'mywords'), 0);\n die();\n }\n redirectMsg('tags.php?page=' . $page, __('A problem occurs while trying to save tag.', 'mywords') . '<br>' . $tag->errors(), 1);\n die();\n}", "public function open($tag, $attributes = array())\n {\n $node = new self($tag, $attributes);\n\n $this->addChild($node);\n\n return $node;\n\n }", "function single_tag($name='', $attrs='')\n{\n return \"<${name} ${attrs} />\";\n}", "public function tag(): string;", "protected function make() {\n\n\t\tif ( ! is_null( $this->tag ) && isset( self::$aliases[ $this->tag ] ) ) {\n\t\t\t$this->set( 'key', self::$aliases[ $this->tag ] );\n\t\t}\n\n\t\t// Set Template\n\t\tif ( false !== $this->attributes['label'] ) {\n\t\t\t$template = 'shortcodes/metadata-label.php';\n\t\t} else {\n\t\t\t$template = 'shortcodes/metadata.php';\n\t\t}\n\n\t\t$this->template = new Template( $template );\n\t}", "protected function addTag($tagPos, $tagLen, $chr, $prio = 0)\n\t{\n\t\t$tag = $this->parser->addSelfClosingTag($this->config['tagName'], $tagPos, $tagLen, $prio);\n\t\t$tag->setAttribute($this->config['attrName'], $chr);\n\n\t\treturn $tag;\n\t}", "#[\\ReturnTypeWillChange]\n\tfunction addChild($name, $value = null, $namespace = null):CX {/** @var CX $r */\n\t\ttry {$r = parent::addChild($this->k($name), $value, $namespace);}\n\t\tcatch (Th $th) {df_error(\"Tag <{$name}>. Value: «{$value}». Error: «%s».\", df_xts($th));}\n\t\treturn $r;\n\t}", "private function addNode(Stack $stack, $label, $id, $tag = null)\n {\n $labels = ['RegistryObject', 'test', $label];\n if ($tag === null) {\n $tag = strtolower($id);\n }\n $labels = implode(\":\", $labels);\n $stack->push(\"MERGE (n:{$labels} {roId: {roId}, class: {class}, type: {type} }) RETURN n\",\n [\n 'roId' => $id,\n 'class' => $label,\n 'type' => $label\n ],\n $tag\n );\n return $stack;\n }", "public static function insert_tag_item($tagname, $image=null, $default_topic_id=0) {\n try {\n $new_tag_id = 0;\n \n $newtagname = '';\n #$tagname = eregi_replace(\" \", \"\", $tagname);\n $words = str_word_count($tagname, 1, \".\");\n foreach ($words as $word) {\n $newtagname .= $word;\n }\n $tagname = $newtagname;\n\n //Clean Tag Name\n $tagname = ADODB::dbclean(Tag::clean_tag($tagname));\n \n if ($tagname != '') {\n $db = ADODB::connect();\n \n //Check if tag exists first\n $tag = new Tbl_tag;\n $tag = Tbl_tag::get_tag($tagname);\n \n if (!isset($tag->tag_id)) {\n if (!$default_topic_id || $default_topic_id == 0) $default_topic_id = 'null';\n if (is_null($image)) {\n $query = \"INSERT INTO tbl_tag_item (tag, default_topic_id, topic_count) VALUES ('$tagname', $default_topic_id, 0)\";\n } else {\n $query = \"INSERT INTO tbl_tag_item (tag, default_topic_id, image, topic_count) VALUES ('$tagname', $default_topic_id, '$image', 0)\";\n }\n $rs = $db->Execute($query);\n $new_tag_id = $db->Insert_ID();\n } else {\n $new_tag_id = $tag->tag_id;\n }\n }\n return $new_tag_id;\n } catch (exception $e) {\n Info::exception_handler($e, __file__, get_class($this), __FUNCTION__, __LINE__);\n } \n }", "public function tag()\n\t{\n\t\t$crud = $this->generate_crud('blog_tags');\n\t\t$this->mPageTitle = 'Blog Tags';\n\t\t$this->render_crud();\n\t}", "public static function create(){\n\t\tglobal $current_user;\n\t\t$name \t= $_POST['name'];\n\t\tinsert('INSERT INTO tag (name, user_id)\n\t\t\t\tVALUES (\"' . $name . '\", ' . $current_user['id'] . ')');\n\t}", "public function addElement($tag = '')\n {\n $htmlTag = (\n is_object($tag) && $tag instanceof self ?\n $tag :\n new static($tag)\n );\n $htmlTag->top = $this->getTop();\n $htmlTag->parent = &$this;\n $this->content[] = $htmlTag;\n return $htmlTag;\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 }", "private function _addTags()\n {\n $metadata = $this->getRecordMetadata();\n $this->_record->addTags($metadata[self::TAGS]);\n }", "function tag_wrap($tag, $content = \"\", $class = NULL){\n\t$result = (is_block($tag)) ? \"\\r<\" : \"<\" ;\n\t$result .= $tag;\n\t$result .= (!empty($class)) ? ' class=\"'.$class.'\">' : '>' ;\n\t$result .= $content;\n\t$result .= (is_block($tag)) ? \"\\r</$tag>\\n\" : \"</$tag>\" ;\n\t\n\treturn $result;\n}", "protected function _initTag()\n {\n $tagId = (int)$this->getRequest()->getParam('tag_id', false);\n $storeId = (int)$this->getRequest()->getParam('store', false);\n $tag = $this->_objectManager->create(\\Magepow\\ProductTags\\Model\\Tag::class);\n if ($tagId) {\n $tag->load($tagId);\n }\n $coreRegistry = $this->_objectManager->get(\\Magento\\Framework\\Registry::class);\n $coreRegistry->register('tag', $tag);\n $coreRegistry->register('current_tag', $tag);\n $this->_objectManager->get(\\Magento\\Cms\\Model\\Wysiwyg\\Config::class)\n ->setStoreId($storeId);\n return $tag;\n }", "public function createTagFromContent() {\n\n\t\ttry {\n\n\t\t\t$content_id = Request::input('content_id');\n\n\t\t\tif (empty($content_id)) throw new \\Exception('Content ID is missing');\n\n\t\t\t$content = ConnectContent::findOrFail($content_id);\n\n\t\t\t$currentUser = \\Auth::User();\n\n\t\t\t$now = getCurrentMilisecondsTimestamp();\n\n\t\t\t$newTag = Tag::create([\n\t\t\t\t'tagger_id' \t\t\t=> $currentUser->id,\n\t\t\t\t'station_id'\t\t\t=> $currentUser->station_id,\n\t\t\t\t'content_type_id'\t\t=> $content->content_type_id,\n\t\t\t\t'tag_timestamp'\t\t\t=> $now,\n\t\t\t\t'who'\t\t\t\t\t=> $content->who,\n\t\t\t\t'what'\t\t\t\t\t=> $content->what,\n\t\t\t\t'adkey'\t\t\t\t\t=> $content->ad_key,\n\t\t\t\t'is_valid'\t\t\t\t=> 1,\n\t\t\t\t'insert_timestamp'\t\t=> $now,\n\t\t\t\t'insert_lag'\t\t\t=> 0,\n\t\t\t\t'connect_content_id'\t=> $content->id,\n\t\t\t\t'coverart_id'\t\t\t=> 0,\n\t\t\t\t'tag_duration'\t\t\t=> 0,\n\t\t\t\t'cart'\t\t\t\t\t=> \"\",\n\t\t\t\t'original_who'\t\t\t=> $content->who,\n\t\t\t\t'original_what'\t\t\t=> $content->what\n\t\t\t]);\n\n\t\t\treturn response()->json(array('code' => 0, 'msg' => 'Success', 'data' => array('tag_id_list' => implode(\", \", $content->tagIDListForContent()))));\n\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('code' => -1, 'msg' => $ex->getMessage()));\n\t\t}\n\t}", "private function record_tag($tag)\n {\n if (isset($this->tags[$tag . 'count'])) { //check for the existence of this tag type\n $this->tags[$tag . 'count']++;\n $this->tags[$tag . $this->tags[$tag . 'count']] = $this->indent_level; //and record the present indent level\n } else { //otherwise initialize this tag type\n $this->tags[$tag . 'count'] = 1;\n $this->tags[$tag . $this->tags[$tag . 'count']] = $this->indent_level; //and record the present indent level\n }\n $this->tags[$tag . $this->tags[$tag . 'count'] . 'parent'] = $this->tags['parent']; //set the parent (i.e. in the case of a div this.tags.div1parent)\n $this->tags['parent'] = $tag . $this->tags[$tag . 'count']; //and make this the current parent (i.e. in the case of a div 'div1')\n }", "public function addTag($tag) {\n $this->init(); //it would actually work without it\n\n if (!in_array($tag,$this->tags)) {\n $tag = trim($tag);\n\n $this->tags['new'][] = $tag;\n return true;\n }\n\n return false;\n }", "public static function ADMIN_ARCHIVE_CREATE_USER_TAG(){\n\t $SQL_String = \"INSERT INTO user_tags VALUES (NULL,:owner,:tag_term,NULL);\";\n\t return $SQL_String;\n\t}", "private function createNewTags(array $tags)\n {\n foreach ($tags as &$tag) {\n if (substr($tag, 0, 4) == 'new:') {\n $newTag = Tag::create(['name' => substr($tag, 4)]);\n $tag = $newTag->id;\n }\n }\n return $tags;\n }", "public static function create($tag, $id = null, $class = null)\r\n {\r\n return new Tag($tag, $id, $class);\r\n }", "public function testEditWithNewTag() {\n $this->markTestIncomplete('Not implemented yet.');\n }", "abstract protected function getObjectTag();", "public function testUpdateInvalidTag() {\n\t\t// Create a tag and try to update it without actually inserting it\n\t\t$tag = new Tag(null, $this->VALID_TAG_LABEL);\n\t\t$tag->update($this->getPDO());\n\t}", "public static function new_instance( $tag_name, $tag_color = null, $tag_bg = null ) {\n global $edb;\n\n $tag_name = _text( $tag_name, 32 );\n $tag_color = !empty($tag_color) ? _hexadec($tag_color) : 'ffffff';\n $tag_bg = !empty($tag_bg) ? _hexadec($tag_bg) : '777777';\n\n $edb->insert('tags', 'tag_name,tag_color,tag_bg', \"'$tag_name', '#$tag_color', '#$tag_bg'\" );\n }", "public function tag($tag) {\n $this->tag = $tag;\n }", "static function make_tag( $tagname, $attrs, $content = null ) {\n\t\tif( empty( $tagname ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$html = '<' . $tagname;\n\n\t\tforeach( $attrs as $attr => $val ) {\n\t\t\t$html .= ' ' . $attr . '=\"' . esc_attr( $val ) . '\"';\n\t\t}\n\n\t\t// Self-closing tag:\n\t\tif( !isset( $content ) ) {\n\t\t\t$html .= ' />';\n\t\t}\n\t\telse {\n\t\t\t$html .= '>';\n\n\t\t\tif( $content !== false ) {\n\t\t\t\t$html .= $content . '</' . $tagname . '>';\n\t\t\t}\n\t\t}\n\n\t\treturn $html;\n\t}", "protected function addTag($tag_name, $value = null)\n {\n $this->startElement($tag_name);\n\n if ($value !== null) {\n $this->writeRaw($value);\n }\n\n $this->endElement();\n }", "protected function setUp()\n\t{\n\t\tif (isset($this->configurator->tags[$this->tagName]))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Create tag\n\t\t$tag = $this->configurator->tags->add($this->tagName);\n\n\t\t// Create attribute\n\t\t$tag->attributes->add($this->attrName);\n\n\t\t// Create a template that replaces its content with the replacement chat\n\t\t$tag->template\n\t\t\t= '<xsl:value-of select=\"@' . htmlspecialchars($this->attrName) . '\"/>';\n\t}", "public static function createElement($tag = '')\n {\n self::$instance = new static($tag);\n return self::$instance;\n }", "private function pop_tag($tag) {\n if ($tag === 'header') $tag = 'h2';\n\n $opener = null;\n if (count($this->stack) > 0) {\n $opener = array_pop($this->stack);\n }\n if ($opener === null || $opener['@name'] !== $tag) throw $this->makeError(\"</\" . $tag . \"> occurred without a corresponding open tag.\");\n\n switch ($tag) {\n case 'comment':\n $this->comment_nest_level--;\n break;\n\n case 'enablebackticks':\n case 'disablebackticks':\n $this->backticks_for_inline_code_enabled = $opener['@name'] === 'enablebackticks';\n break;\n\n case 'bookmark':\n $uid = $opener['@uid'];\n $label = implode('', $this->active_text_listeners[$uid]);\n unset($this->active_text_listeners[$uid]);\n for ($i = count($this->bookmark_list) - 1; $i >= 0; --$i) {\n if ($this->bookmark_list[$i]['uid'] === $uid) {\n $this->bookmark_list[$i]['label'] = $label;\n }\n }\n break;\n\n case 'image':\n if (isset($opener['@url'])) {\n $url = trim($opener['@url']);\n $alt_text = trim($opener['alt']);\n if ($alt_text === '') {\n $t = explode('/', $url);\n $alt_text = htmlspecialchars($t[count($t) - 1]);\n }\n\n if (isset($opener['mouseover'])) {\n $opener['title'] = $opener['mouseover'];\n unset($opener['mouseover']);\n }\n\n $this->output('<img src=\"' . $url . '\" alt=\"' . $alt_text . '\"');\n foreach ($opener as $attr => $value) {\n if ($attr[0] !== '@' && $attr !== 'comment') {\n $this->output(' ' . $attr . '=\"' . $value . '\"');\n }\n }\n $this->output('/>');\n }\n break;\n\n case 'note':\n case 'warning':\n $this->output('</div>');\n break;\n\n case 'code':\n $syntax = isset($opener['language']) ? $opener['language'] : 'none';\n $classes = isset($opener['classes']) ? explode(',', str_replace(' ', ',', $opener['classes'])) : array(); // classes are trimmed and ignored if empty.\n $code = $opener['@code'];\n $html = (new BlakesHtmlSyntaxHighlighter($syntax))->highlight($code, $classes);\n\n $this->output('<div');\n foreach ($opener as $attr => $value) {\n if ($attr[0] !== '@' && $attr !== 'language' && $attr !== 'classes') {\n $this->output(' ' . $attr . '=\"' . $value . '\"');\n }\n }\n $this->output('>');\n\n $this->output($html);\n $this->output('</div>');\n\n break;\n\n case 'tableofcontents':\n break;\n\n default:\n $this->output('</' . $tag . '>');\n break;\n }\n }", "private function retrieve_tag($tag)\n {\n if (isset($this->tags[$tag . 'count'])) { //if the openener is not in the Object we ignore it\n $temp_parent = $this->tags['parent']; //check to see if it's a closable tag.\n while ($temp_parent) { //till we reach '' (the initial value);\n if ($tag . $this->tags[$tag . 'count'] === $temp_parent) { //if this is it use it\n break;\n }\n $temp_parent = isset($this->tags[$temp_parent . 'parent']) ? $this->tags[$temp_parent . 'parent'] : ''; //otherwise keep on climbing up the DOM Tree\n }\n if ($temp_parent) { //if we caught something\n $this->indent_level = $this->tags[$tag . $this->tags[$tag . 'count']]; //set the indent_level accordingly\n $this->tags['parent'] = $this->tags[$temp_parent . 'parent']; //and set the current parent\n }\n unset($this->tags[$tag . $this->tags[$tag . 'count'] . 'parent']); //delete the closed tags parent reference...\n unset($this->tags[$tag . $this->tags[$tag . 'count']]); //...and the tag itself\n if ($this->tags[$tag . 'count'] === 1) {\n unset($this->tags[$tag . 'count']);\n } else {\n $this->tags[$tag . 'count']--;\n }\n }\n }", "public function setTag($value)\n {\n return $this->set('Tag', $value);\n }", "public function setTag($value)\n {\n return $this->set('Tag', $value);\n }", "public function setTag($value)\n {\n return $this->set('Tag', $value);\n }", "public function setTag($value)\n {\n return $this->set('Tag', $value);\n }", "public function add_tag($tag, $message = null) {\n\t\t\tif ($message === null) {\n\t\t\t\t$message = $tag;\n\t\t\t}\n\t\t\treturn $this->run(\"tag -a $tag -m \" . escapeshellarg($message));\n\t\t}", "public function setTag($value)\n {\n return $this->set('Tag', $value);\n }", "abstract protected function doSaveTag(TagInterface $tag);", "public function removeTag(string $name);", "private function runTag()\n {\n $num = (int) $this->ask('How many records do you want to create for the tags table?');\n factory(Tag::class, $num)->create();\n }", "public function create($idArticulo,$idTag){\n\n $articulo = Article::find($idArticulo);\n $tag = Tag::find($idTag);\n $articulo->tags()->attach($tag);\n }", "public static function moveTag($repo, $tag, $version = 'HEAD') {\n\t\t$cmd = String(self::MOVE_TAG_CMD)->format([\n\t\t\t'tag' => $tag,\n\t\t\t'version' => $version\n\t\t]);\n\t\treturn self::doInDir($repo, $cmd);\n\t}", "private function addTag($tagName)\n\t{\n\t\tif (is_null($tagName) || $tagName == '') return;\n\n\t\t// return Builder\n $tag = Tag::where('tag', '=', $tagName)->first();\n\t\t\n\t\tif (is_object($tag))\n\t\t{\n\t\t\t// To increment count number to exists tag\n\t\t\tTagUtil::incrementCount($tagName, 1, $tag);\n\n\t\t\t// return collection object\n\t\t\t$tagPivot = $this->tags()->wherePivot('tag_id', '=', $tag->id)->get();\n\t\t\t\n\t if ($tagPivot->count() === 0)\n\t {\n\t\t\t\t// To attach a related item to taggable\n\t \t$this->tags()->attach($tag->id);\n\t }\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tag = new Tag(['tag' => $tagName]);\n\t\t\t\n\t\t\t$this->tags()->save($tag);\t\n\t\t}\n\t}", "function convertTag($tag, $direction = 'out') \n{\n\tif ($direction == 'out') \n\t{\n\t\t$tag = str_replace(' ', '_', $tag);\n\t} \n\telse \n\t{\n\t\t$tag = str_replace('_', ' ', $tag);\n\t}\n\treturn $tag;\n}", "function stag($tag=false, $class='', $style='', $id='', $extra='')\n\t{\n\t\tif($tag == false)\n\t\t{\n\t\t\t$tag = $this->default_tag['tag'];\n\t\t\t$class = $this->default_tag['class'];\n\t\t\t$style = $this->default_tag['style'];\n\t\t\t$extra = $this->default_tag['extra'];\n\t\t}\n\t\t$class = ($class != '' ? ' class=\"' . $class . '\"' : '');\n\t\t$style = ($style != '' ? ' style=\"' . $style . '\"' : '');\n\t\t$id = ($id != '' ? ' id=\"' . $id . '\"' : '');\n\t\t$extra = ($extra != '' ? ' ' . $extra : '');\n\t\treturn $this->xecho('<' . $tag . $class . $style . $id . $extra . ' />');\n\t}", "function insertTagToTalent($tagid) {\n\t\t$mysqli = $this->getConnection();\n\t\t$tagid = $mysqli->real_escape_string ( $tagid );\n\t\t$query = \"insert into talent_has_tag(talent_talentid,tag_tagid) values((SELECT talentid FROM talent ORDER BY talentid DESC limit 1),$tagid)\";\n\t\treturn $mysqli->query ( $query );\n\t}", "function TestCase_add_tag($case_id, $tag_name) {\n\t// Create call\n\t$call = new xmlrpcmsg('TestCase.add_tag', array(new xmlrpcval($case_id, \"int\"), new xmlrpcval($tag_name, \"string\")));\n\n\t// Do call and return value\n\treturn do_call($call);\n}", "function tag_book( $id, $tag ) {\r\n\treturn set_book_tags($id, $tag, true);\r\n}", "function associate_tag($tag_id, $tip_id) {\n $sql = '\n INSERT INTO\n tips_tags (tip_id, tag_id)\n VALUES\n (?, ?)';\n \n return $this->prep_and_exec($sql, [$tip_id, $tag_id]);\n }", "public function create()\n {\n $data['rightButton']['iconClass'] = 'fa fa-tags';\n $data['rightButton']['text'] = 'Tag List';\n $data['rightButton']['link'] = 'tags';\n\n return view(\"nptl-admin/common/tag/create\", $data);\n }", "function template_tag_handler( $id = \"\", $pos = \"\", $dload = \"\", $play = \"\", $list = \"\" ) {\n\t\t\t\n\t\t\t$this->putTag_runCount++;\n\t\t\tif ( $this->theSettings['disable_template_tag'] == \"true\" ) { return; }\n\t\t\t\n\t\t\tif ( !empty($id) && !is_numeric($id) ) {\n\t\t\t\t$this->external_call = true;\n\t\t\t\t$shortcodes_return = do_shortcode( $id );\n\t\t\t\t$this->external_call = false;\n\t\t\t}\n\t\t\techo $shortcodes_return;\n\t\t\treturn;\t\t\t\n\t\t}", "public function delete_tag($tag);", "public function testInsertInvalidTag() {\n\t\t// Create a tag with a non null tag id and watch it fail\n\t\t$tag = new Tag(BrewCrewTest::INVALID_KEY, $this->VALID_TAG_LABEL);\n\t\t$tag->insert($this->getPDO());\n\t}", "public function __construct()\n {\n $this->tag = new Tag;\n parent::__construct();\n }", "public function addTag($id){\n\t\t$crl = curl_init();\n\t\tcurl_setopt($crl, CURLOPT_URL, $this->buildTagUrl($id) );\n\t\tcurl_setopt($crl, CURLOPT_CUSTOMREQUEST, \"PUT\"); \n\t\tcurl_setopt($crl, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($crl, CURLOPT_HTTPHEADER, array( \n\t\t\t\t'Authorization: Bearer '.$this->getToken(), \n\t\t\t 'Content-Type: application/json',\n\t\t\t 'Accept: application/vnd.vimeo.*+json;version=3.4'\n\t\t\t) \n\t\t);\n\t\tcurl_setopt($crl, CURLOPT_SSL_VERIFYPEER, true); \n\t\t$result = curl_exec($crl);\n\t}", "protected function createNewTag($tags, $relation)\n {\n if($tags) {\n foreach( $tags as $val) {\n $tag = $this->tag->create([ 'nama' => $val ]);\n $relation->tag()->attach($tag);\n }\n }\n }", "function tf_html_tag($tag, $attr = null, $end = null)\r\n {\r\n $inner = array($tag);\r\n if (isset($attr)) {\r\n foreach ($attr as $k => $v) {\r\n if (is_numeric($k)) {\r\n $inner[] = sprintf('%s=\"%s\"', esc_attr($v), esc_attr($v));\r\n }\r\n else if ($v === true) {\r\n $inner[] = sprintf('%s=\"%s\"', esc_attr($k), esc_attr($k));\r\n }\r\n else if ($v === false) {\r\n # ignore\r\n }\r\n else {\r\n $inner[] = sprintf('%s=\"%s\"', esc_attr($k), esc_attr($v));\r\n }\r\n }\r\n }\r\n\r\n if ($end === true) {\r\n # close ELEMENT as HTML\r\n # <script></script>\r\n $body = '';\r\n $close = '</'.$tag.'>';\r\n }\r\n else if ($end === false) {\r\n # close ELEMENT as XML\r\n $inner[] = '/';\r\n $body = '';\r\n $close = '';\r\n }\r\n else {\r\n # if there is content close element, otherwise leave it open\r\n if (empty($end)) {\r\n $body = '';\r\n $close = '';\r\n }\r\n else {\r\n $body = strval($end);\r\n $close = '</'.$tag.'>';\r\n }\r\n }\r\n\r\n $open = '<'.implode(' ', $inner).'>';\r\n return $open.$body.$close;\r\n }", "public function add() {\n\t\t$this->display ( 'admin/tag/add.html' );\n\t}", "public function setTag(string $tag): HtmlElementInterface;", "public function addTag(Tag $tag)\n {\n throw new \\RuntimeException('Adding a tag on an ImageVariant is not supported.', 1371237593);\n }" ]
[ "0.634903", "0.62017304", "0.6077948", "0.60098857", "0.5902825", "0.58926165", "0.5891932", "0.588165", "0.58433825", "0.5805373", "0.57772696", "0.57124823", "0.5701118", "0.55803347", "0.55102646", "0.550986", "0.5491885", "0.5486803", "0.5479876", "0.5449306", "0.54321754", "0.5421993", "0.5416179", "0.54049903", "0.5403488", "0.5400529", "0.54005164", "0.53917855", "0.53805953", "0.53690434", "0.53366995", "0.53249806", "0.5273541", "0.5238562", "0.5229503", "0.52264947", "0.5224985", "0.5216089", "0.5206578", "0.5204606", "0.5199938", "0.5195216", "0.51882607", "0.51841867", "0.51821315", "0.5176735", "0.51745796", "0.5174538", "0.5165107", "0.51635545", "0.5161884", "0.51543677", "0.51484174", "0.51456654", "0.5145143", "0.514417", "0.514219", "0.51201344", "0.5118263", "0.51047796", "0.5103043", "0.50878614", "0.508043", "0.50795007", "0.5068282", "0.5064577", "0.5064447", "0.505828", "0.50570244", "0.50471354", "0.5039669", "0.5037768", "0.5037768", "0.5037768", "0.5037209", "0.5036754", "0.50366783", "0.50232524", "0.5016704", "0.50084335", "0.50053036", "0.4998683", "0.4990113", "0.49716654", "0.49649847", "0.4962189", "0.4959125", "0.49583048", "0.49513534", "0.49397185", "0.49330384", "0.4932919", "0.4923459", "0.49169642", "0.49146", "0.49043667", "0.4903534", "0.49000436", "0.4888681", "0.48855945" ]
0.5724585
11
Tag a git repository.
function git_tag($path, $tag, $version = 'HEAD') { return GitUtil::tag($path, $tag, null, $version); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setRepository($var)\n {\n GPBUtil::checkString($var, True);\n $this->repository = $var;\n\n return $this;\n }", "public function getGitTag()\n {\n return $this->runGitCommand('git describe --tags HEAD');\n }", "public function create($repository);", "public function main()\n {\n if (null === $this->getRepository()) {\n throw new BuildException('\"repository\" is required parameter');\n }\n $client = $this->getGitClient(false, $this->getRepository());\n $command = $client->getCommand('tag');\n $command\n ->setOption('-l')\n ->setOption('--sort', '-v:refname');\n $result = $command->execute();\n var_dump($result);\n }", "function _versioncontrol_git_get_tag_operations($repository, $tags) {\n $tag_ops = array();\n $tag_string = '';\n if (empty($tags)) {\n return array();\n }\n foreach ($tags as $tag) {\n $tag_string .= escapeshellarg(\"refs/tags/$tag\") .' ';\n }\n $format = \"%(objecttype)\\n%(objectname)\\n%(refname)\\n%(taggername) %(taggeremail)\\n%(taggerdate)\\n%(contents)\\nENDOFGITTAGOUTPUTMESAGEHERE\";\n $exec = \"git for-each-ref --format=\\\"$format\\\" $tag_string\";\n $logs_tag_msg = _versioncontrol_git_log_exec($exec);\n $exec = \"git show-ref -d $tag_string\";\n $logs_tag_commits = _versioncontrol_git_log_exec($exec);\n $tag_commits = array();\n foreach ($logs_tag_commits as $line) {\n if (substr($line, -3, 3) == '^{}') {\n $commit = substr($line, 0, 40);\n $tag = substr($line, 41);\n $tag = substr(substr($line, 41, strlen($tag) -3), 10);\n $tag_commits[$tag] = $commit;\n }\n }\n do {\n $ret = _versioncontrol_git_log_parse_tag_info($repository, $logs_tag_msg, $tag_commits);\n if ($ret !== FALSE) {\n $tag_ops[] = $ret;\n }\n }while ($ret !== FALSE);\n return $tag_ops;\n}", "public function setRepository($repository)\n {\n $this->repository = $repository;\n }", "function _versioncontrol_git_process_tags($repository, $new_tags) {\n $tag_ops = _versioncontrol_git_get_tag_operations($repository, $new_tags);\n foreach ($tag_ops as $tag_op) {\n $op_items = array();\n versioncontrol_insert_operation($tag_op, $op_items);\n $constraints = array(\n 'vcs' => array('git'),\n 'repo_ids' => array($repository['repo_id']),\n 'types' => array(VERSIONCONTROL_OPERATION_COMMIT),\n 'revisions' => array($tag_op['revision'])\n );\n $tag_commits = versioncontrol_get_operations($constraints);\n foreach ($tag_commits as $vc_op_id => $tag_commit_op) {\n $tag_commit_op['labels'][] = array(\n 'name' => $tag_op['labels'][0]['name'],\n 'action' => VERSIONCONTROL_ACTION_MODIFIED,\n 'type' => VERSIONCONTROL_OPERATION_TAG\n );\n versioncontrol_update_operation_labels($tag_commit_op, $tag_commit_op['labels']);\n }\n }\n}", "protected function getLatestTagUrl($repository, $default = 'master')\n {\n $file = @json_decode(@file_get_contents(\"https://api.github.com/repos/$repository/tags\", false,\n stream_context_create(['http' => ['header' => \"User-Agent: Vestibulum\\r\\n\"]])\n ));\n return sprintf(\"https://github.com/$repository/archive/%s.zip\", $file ? reset($file)->name : $default);\n }", "public function __construct(TagRepository $repo)\n {\n $this->repo = $repo;\n }", "public function createGit()\n {\n if($GLOBALS['TL_CONFIG']['bx_git_path'])\n {\n $gitPath = TL_ROOT.$GLOBALS['TL_CONFIG']['bx_git_path'];\n }else{\n $gitPath = TL_ROOT.\"/\";\n }\n\n $git = new GitPhp\\GitRepository($gitPath);\n $git->init()->execute();\n \n //Set Remote\n $url = explode(\"://\", $GLOBALS['TL_CONFIG']['bx_git_host_url']);\n $git->remote()->setUrl('origin', $url[0].\"://\".$GLOBALS['TL_CONFIG']['bx_git_host_user'].\":\".$GLOBALS['TL_CONFIG']['bx_git_host_pass'].\"@\".$url[1]);\n }", "function _versioncontrol_git_log_parse_tag_info($repository, &$logs, $tag_commits) {\n $line = next($logs); // Get op type\n if ($line === FALSE) {\n return FALSE;\n }\n if ($line == 'commit') {\n //let's get the author and the date from the tagged commit, better than nothing.\n $tagged_commit = next($logs); // Get the tagged commit\n $tag_name = substr(strrchr(next($logs), '/'), 1 ); // Get the name of the tag based on %(refname)\n next($logs); // Skip these two lines\n next($logs);\n // Get the tag/commit message\n $message = '';\n $i = 0;\n while (($line = next($logs)) !== FALSE) {\n if ($line == 'ENDOFGITTAGOUTPUTMESAGEHERE') {\n break;\n }\n if ($i == 1) {\n $message .= \"\\n\";\n }\n $message .= $line .\"\\n\";\n $i++;\n }\n $constraints = array(\n 'vcs' => array('git'),\n 'repo_ids' => array($repository['repo_id']),\n 'types' => array(VERSIONCONTROL_OPERATION_COMMIT),\n 'revisions' => array($tagged_commit)\n );\n $op = versioncontrol_get_operations($constraints);\n $op = array_pop($op);\n return array(\n 'type' => VERSIONCONTROL_OPERATION_TAG,\n 'repository' => $repository,\n 'date' => $op['date']+1, // We want to be displayed *after* the tagged commit.\n 'username' => $op['username'],\n 'message' => $message,\n 'revision' => $tagged_commit,\n 'labels' => array(\n 0 => array(\n 'name' => $tag_name,\n 'type' => VERSIONCONTROL_OPERATION_TAG,\n 'action' => VERSIONCONTROL_ACTION_ADDED\n )\n )\n );\n }\n $line = next($logs); // Skip op sha1\n $tag_name = substr(strrchr(next($logs), '/'), 1 ); // Get the name of the tag based on %(refname)\n $tagger = next($logs); // Get tagger\n $date = strtotime(next($logs)); // Get date\n // Get the tag message\n $message = '';\n $i = 0;\n while (($line = next($logs)) !== FALSE) {\n if ($line == 'ENDOFGITTAGOUTPUTMESAGEHERE') {\n break;\n }\n if ($i == 1) {\n $message .= \"\\n\";\n }\n $message .= $line .\"\\n\";\n $i++;\n }\n $tagged_commit = $tag_commits[$tag_name];\n // By now, we're done with the parsing, construct the op array\n return array(\n 'type' => VERSIONCONTROL_OPERATION_TAG,\n 'repository' => $repository,\n 'date' => $date,\n 'username' => $tagger,\n 'message' => $message,\n 'revision' => $tagged_commit,\n 'labels' => array(\n 0 => array(\n 'name' => $tag_name,\n 'type' => VERSIONCONTROL_OPERATION_TAG,\n 'action' => VERSIONCONTROL_ACTION_ADDED\n )\n )\n );\n}", "public function createReference($repository) { \n if ( $repository->exists() ) {\n throw new GitBackendException('Repository already exists');\n } \n $path = $repository->getPath();\n //create git root if does not exist\n $this->createGitRoot();\n //create project dir if does not exists\n $this->createProjectRoot($repository);\n $path = $this->getGitRootPath().DIRECTORY_SEPARATOR.$path;\n mkdir($path, 0770, true);\n chdir($path);\n $this->getDriver()->init($bare=true);\n\n return $this->setUpRepository($repository);\n }", "public function tagged( $tag );", "public function getGitRepository(): string\n {\n return 'https://github.com/Sylius/Sylius.git';\n }", "public function setUpRepository($repository) {\n $path = $this->getGitRootPath().DIRECTORY_SEPARATOR.$repository->getPath();\n $this->getDriver()->activateHook('post-update', $path);\n $this->deployPostReceive($path);\n $id = $this->getDao()->save($repository);\n $repository->setId($id);\n $this->setUpMailingHook($repository);\n $this->changeRepositoryAccess($repository);\n $this->setRepositoryPermissions($repository);\n return true;\n }", "function _versioncontrol_git_log_update_repository(&$repository) {\n $root = escapeshellcmd($repository['root']);\n $chdir_ok = @chdir($root); // Set working directory to root.\n if ($chdir_ok === FALSE) {\n return FALSE;\n }\n if ($repository['git_specific']['locked'] == TRUE) {\n drupal_set_message(t('This repository is locked, there is already a fetch in progress. If this is not the case, press the clear lock button.'), 'error');\n return FALSE;\n }\n db_query('UPDATE {versioncontrol_git_repositories}\n SET locked = 1 WHERE repo_id = %d', $repository['repo_id']);\n\n // Get the list of current branches from Git.\n $branch_list = _versioncontrol_git_log_get_branches();\n $add_branch_label = array(\n 'name' => '', //filled later\n 'type' => VERSIONCONTROL_OPERATION_BRANCH,\n 'action' => VERSIONCONTROL_ACTION_MODIFIED\n );\n $branches = array();\n foreach ($branch_list as $branch_name) {\n $add_branch_label['name'] = $branch_name;\n $label_ret = versioncontrol_ensure_label($repository, $add_branch_label);\n $branches[$branch_name] = $label_ret;\n }\n //jpetso and me (corni) came to the conclusion that we will not delete branches.\n // TODO: revisit this!\n // Record new commits.\n $constraints = array(\n 'vcs' => array('git'),\n 'repo_ids' => array($repository['repo_id']),\n 'types' => array(VERSIONCONTROL_OPERATION_COMMIT),\n 'branches' => array() // used in the loop\n );\n $branches_per_commit = array();\n $existing_revs = array();\n // Get the existing revisions from the cache.\n $cache_object = cache_get('versioncontrol_git_rev_cache');\n // Check wether the cache object exists or not.\n if (is_object($cache_object)) {\n $existing_revs = $cache_object->data;\n }\n // Get the list of current branches from Git.\n // Generate the range per branch with which git shall be called.\n foreach ($branches as $branch_name => $label) {\n if (is_object($cache_object)) {\n // We get all commits we have in this branch to not process them later.\n $constraints['branches'] = array($branch_name);\n $latest_commit_date = 0;\n $commit_op = versioncontrol_get_operations($constraints);\n $latest_commit = FALSE;\n foreach ($commit_op as $vc_op_id => $c_op) {\n if ($latest_commit_date < $c_op['date']) {\n $latest_commit = $c_op['revision'];\n $latest_commit_date = $c_op['date'];\n $existing_revs[$branch_name][$latest_commit] = TRUE;\n }\n }\n }\n // No way to free the damned mysql result!!\n unset($commit_op);\n\n $commits_in_branch = _versioncontrol_git_log_get_commits_in_branch($repository, escapeshellarg($branch_name));\n foreach ($commits_in_branch as $i => $commit) {\n if (!isset($existing_revs[$branch_name][$commit])) {\n if (!isset($branches_per_commit[$commit]) || !is_array($branches_per_commit[$commit])) {\n $branches_per_commit[$commit] = array($label);\n }\n else {\n $branches_per_commit[$commit][] = $label;\n }\n }\n }\n }\n // This uses an extra loop on purpose!\n // Process all commits on a per-branch base.\n foreach ($branches_per_commit as $revision => $branch) {\n // Update commits from Git.\n _versioncontrol_git_process_commits($repository, $revision, $branches_per_commit, $existing_revs);\n }\n // Check tags.\n $tags = _versioncontrol_git_log_get_tags(); //Now we have the current list of tags as array of strings.\n $constraints = array(\n 'vcs' => array('git'),\n 'repo_ids' => array($repository['repo_id']),\n 'types' => array(VERSIONCONTROL_OPERATION_TAG)\n );\n $existing_tag_ops = versioncontrol_get_operations($constraints);\n $existing_tags = array();\n foreach ($existing_tag_ops as $tag_op) {\n if (!in_array($tag_op['labels'][0]['name'], $existing_tags)) {\n $existing_tags[] = $tag_op['labels'][0]['name'];\n }\n }\n // Deleting tags is *not* supported. Read the manual if you want to know why...\n // Check for new tags.\n $new_tags = array_diff($tags, $existing_tags);\n if (!empty($new_tags)) {\n _versioncontrol_git_process_tags($repository, $new_tags);\n }\n\n // Update repository updated field. Displayed on administration interface for documentation purposes.\n $repository['git_specific']['updated'] = time();\n db_query('UPDATE {versioncontrol_git_repositories}\n SET updated = %d, locked = 0 WHERE repo_id = %d',\n $repository['git_specific']['updated'], $repository['repo_id']);\n\n // Write back the cache.\n cache_set('versioncontrol_git_rev_cache', $existing_revs);\n return TRUE;\n}", "public function undo_tag() {\n\t\t$version = $this->conf['common']['releasever'];\n\t\t$tag = str_replace( '$1', $version, $this->conf['common']['tagname'] );\n\n\t\tforeach ( $this->conf['extensions'] as $ext => $checkout ) {\n\t\t\tchdir( \"{$this->dir}/extensions/$ext\" );\n\t\t\t$cTag = escapeshellarg( $tag );\n\t\t\texec( \"git checkout master\" );\n\t\t\texec( \"git tag -d $cTag\" );\n\t\t\t$cTag = escapeshellarg( \":refs/tags/$tag\" );\n\t\t\texec( \"git push origin $cTag\" );\n\t\t}\n\t}", "abstract public function translate_short_repo_url($repo, $tag);", "private function oembed_github_repo ( $owner, $repository ) {\n\t\t$repo = $this->api->get_repo( $owner, $repository );\n\t\t$commits =$this->api->get_repo_commits( $owner, $repository );\n\n\t\t$response = new stdClass();\n\t\t$response->type = 'rich';\n\t\t$response->width = '10';\n\t\t$response->height = '10';\n\t\t$response->version = '1.0';\n\t\t$response->title = $repo->description;\n\n\t\t// @TODO This should all be templated\n\t\t$response->html = '<div class=\"github-embed github-embed-repository\">';\n\t\t$response->html .= '<p><a href=\"' . esc_attr( $repo->html_url ) . '\" target=\"_blank\"><strong>' . esc_html( $repo->description ) . '</strong></a><br/>';\n\t\t$response->html .= '<a href=\"' . esc_attr( $repo->html_url ) . '\" target=\"_blank\">' . esc_html( $repo->html_url ) . '</a><br/>';\n\t\t$response->html .= '<a href=\"' . esc_attr( $repo->html_url . '/network' ) . '\" target=\"_blank\">' . esc_html( number_format_i18n( $repo->forks_count ) ) . '</a> forks.<br/>';\n\t\t$response->html .= '<a href=\"' . esc_attr( $repo->html_url . '/stargazers' ) . '\" target=\"_blank\">' . esc_html( number_format_i18n( $repo->stargazers_count ) ) . '</a> stars.<br/>';\n\t\t$response->html .= '<a href=\"' . esc_attr( $repo->html_url . '/issues' ) . '\" target=\"_blank\">' . esc_html( number_format_i18n( $repo->open_issues_count ) ) . '</a> open issues.<br/>';\n\n\t\tif ( count( $commits ) ) {\n\t\t\t$cnt = 0;\n\t\t\t$response->html .= 'Recent commits:';\n\t\t\t$response->html .= '<ul class=\"github_commits\">';\n\t\t\tforeach ( $commits as $commit ) {\n\t\t\t\tif ( $cnt > 4 ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$response->html .= '<li class=\"github_commit\">';\n\t\t\t\t$response->html .= '<a href=\"https://github.com/' . $owner . '/' . $repository . '/commit/' . esc_attr( $commit->sha ) . '\" target=\"_blank\">' . esc_html( $commit->commit->message ) . '</a>, ';\n\t\t\t\t$response->html .= esc_html( $commit->commit->committer->name );\n\t\t\t\t$response->html .= '</li>';\n\t\t\t\t$cnt++;\n\t\t\t}\n\t\t\t$response->html .= '</ul>';\n\t\t}\n\t\t$response->html .= '</p>';\n\t\t$response->html .= '</div>';\n\t\theader( 'Content-Type: application/json' );\n\t\techo json_encode( $response );\n\t\tdie();\n\t}", "public static function is_repo($var) {\n\t\t\treturn (get_class($var) == 'GitRepo');\n\t\t}", "public function getName()\n\t{\n\t\treturn 'git';\n\t}", "public function repoLink(Repository $repo)\n {\n return $this->Html->link($repo->name, 'https://github.com/' . $repo->name);\n }", "public function createRepo(string $repo = null)\n {\n $end = $this->getVendorType() === 'org'\n ? '/orgs/' . $this->getVendor() . '/repos'\n : '/user/repos';\n $res = $this->request('POST', $end, [\n 'name' => $this->getName(),\n 'description' => $this->getDescription(),\n ]);\n if (Helper::isResponseOk($res)) {\n echo \"\\ngit remote add origin [email protected]:{$this->getFullName()}.git\\n\";\n echo \"git push -u origin master\\n\";\n }\n\n return $res;\n }", "protected function createRepository()\n {\n $repositoryOptions = [\n 'repository' => $this->info['repositoryName'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'parent',\n 'uploads',\n 'data',\n 'int',\n 'float',\n 'bool',\n ]);\n\n $this->call('engez:repository', array_merge($repositoryOptions, $options));\n }", "public function git_repository()\n\t{\n\t\texec( 'cd ' . $this->theme_dir . '; git remote -v', $remotes );\n\n\t\tpreg_match( '#origin[\\s\\t][email protected]\\:([^\\.]+)#', $remotes[0], $matches );\n\n\t\t$remote = $matches[1];\n\n\t\treturn $remote;\n\t}", "private function _fetchGitRepository($url, $ref = 'master')\n\t{\n\t\t// Create a Git repository object within the system tmp folder for the url.\n\t\t$root = sys_get_temp_dir() . md5($url);\n\n\t\t// If the folder doesn't exist attempt to create it.\n\t\tif (!is_dir($root))\n\t\t{\n\t\t\tmkdir($root, 0777, true);\n\t\t}\n\n\t\t// Instantiate the repository object.\n\t\t$repo = new PackagerGitRepository($root);\n\n\t\t// Only clone the repository if it doesn't exist.\n\t\tif (!$repo->exists())\n\t\t{\n\t\t\t$repo->create();\n\t\t}\n\n\t\t// Get a clean checkout of the branch/tag required.\n\t\t$repo->fetch()\n\t\t\t->branchCheckout($ref)\n\t\t\t->clean();\n\n\t\treturn $root;\n\t}", "function git_is_repo($path) {\n\treturn GitUtil::isRepo($path);\n}", "public function verify($tag)\n {\n $builder = $this->git->getProcessBuilder()\n ->add('tag')\n ->add('-v');\n\n if (!is_array($tag) && !($tag instanceof \\Traversable)) {\n $tag = [$tag];\n }\n\n foreach ($tag as $value) {\n $builder->add($value);\n }\n\n $this->git->run($builder->getProcess());\n }", "function git_move_tag($path, $tag, $version = 'HEAD') {\n\tGitUtil::moveTag($path, $tag, $version);\n}", "public function delete($tag)\n {\n $builder = $this->git->getProcessBuilder()\n ->add('tag')\n ->add('-d');\n\n if (!is_array($tag) && !($tag instanceof \\Traversable)) {\n $tag = [$tag];\n }\n\n foreach ($tag as $value) {\n $builder->add($value);\n }\n\n $this->git->run($builder->getProcess());\n }", "function _versioncontrol_git_log_get_tags() {\n //TODO: incorporate a --dereference and parse better, saves one git call for tags\n $logs = _versioncontrol_git_log_exec('git show-ref --tags'); // Query tags.\n $tags = _versioncontrol_git_log_parse_tags($logs); // Parse output.\n return $tags;\n}", "public function addFromRepository($name, $repository = 'default', array $vars = array())\n\t{\n\t\t// Load the Repository if necessary\n\t\tif (!($repository instanceof Repository))\n\t\t{\n\t\t\tif (!$this->repositories->exists($repository))\n\t\t\t{\n\t\t\t\tthrow new InvalidArgumentException(\"Repository '\" . $repository . \"' does not exist\");\n\t\t\t}\n\n\t\t\t$repository = $this->repositories->get($repository);\n\t\t}\n\n\t\t// Get the BBCode/tag config from the repository\n\t\t$config = $repository->get($name, $vars);\n\t\t$bbcodeName = $config['name'];\n\t\t$bbcode = $config['bbcode'];\n\t\t$tag = $config['tag'];\n\n\t\t// If the BBCode doesn't specify a tag name, it's the same as the BBCode\n\t\tif (!isset($bbcode->tagName))\n\t\t{\n\t\t\t$bbcode->tagName = $bbcodeName;\n\t\t}\n\n\t\tif ($this->collection->exists($bbcodeName))\n\t\t{\n\t\t\tthrow new RuntimeException(\"BBCode '\" . $bbcodeName . \"' already exists\");\n\t\t}\n\n\t\tif ($this->configurator->tags->exists($bbcode->tagName))\n\t\t{\n\t\t\tthrow new RuntimeException(\"Tag '\" . $bbcode->tagName . \"' already exists\");\n\t\t}\n\n\t\t// Add our BBCode then its tag\n\t\t$this->collection->add($bbcodeName, $bbcode);\n\t\t$this->configurator->tags->add($bbcode->tagName, $tag);\n\n\t\treturn $bbcode;\n\t}", "public static function open($repo_path) {\n\t\t\treturn new GitRepo($repo_path);\n\t\t}", "public function setRepository(EntityRepository $repository)\n {\n $this->repository = $repository;\n }", "public static function moveTag($repo, $tag, $version = 'HEAD') {\n\t\t$cmd = String(self::MOVE_TAG_CMD)->format([\n\t\t\t'tag' => $tag,\n\t\t\t'version' => $version\n\t\t]);\n\t\treturn self::doInDir($repo, $cmd);\n\t}", "public function cloneGitRepo($repo, $dir);", "protected function initRepository()\n {\n $this->repository = new Repository([\n 'name' => 'vendor/name',\n 'description' => '✈️The package is a ThinkSNS+ package.',\n 'type' => 'library',\n 'license' => 'MIT',\n 'require' => [\n 'php' => '>=7.1.3',\n ],\n 'autoload' => [],\n 'config' => [\n 'sort-packages' => true,\n ],\n ]);\n }", "public function markCommit($hash, $forthNumber = null, $tag = \"\") {\n $version = 'v'.$this->version($forthNumber, $tag);\n $this->repo->getReferences()->createTag($version, $hash);\n $this->repo->run('push', array('origin', $version));\n }", "public function pushRepository($dir, $target_project);", "public function gitCloneRepositories() {\n\t\t$count = 0;\n\n\t\t$packages = $this->Package->find('list');\n\t\tforeach ($packages as $id => $name) {\n\t\t\t$this->out(sprintf(__(\"* Downloading package %s\"), $name));\n\t\t\tif ($this->Package->setupRepository($id)); {\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\t\t$this->out(sprintf(__('* Downloaded %s of %s repositories'), $count, count($packages)));\n\t}", "public function tag($tag) {\n $this->tag = $tag;\n }", "public function open(Repository $repository, string $title, string $body, array $labels);", "private function createRepository()\n {\n $this->output->write('Creating repository... ');\n\n try {\n $versionControlRepository = ($this->config->scm->type == 'gitlab') ?\n new VersionControlRepositoryGitLab($this->config) : new VersionControlRepositoryGitHub($this->config);\n $versionControlRepository->create($this->project);\n\n $this->output->writeln('<info>OK</info>');\n } catch (\\Exception $e) {\n $message = 'Error: '. $e->getMessage();\n $this->output->writeln('<error>'. $message .'</error>');\n throw new \\RuntimeException($message);\n }\n }", "private function get_repository_info() {\n if ( is_null( $this->github_response ) ) {\n $request_uri = sprintf( 'https://api.github.com/repos/%s/%s/releases', $this->username, $this->repository );\n\n $response = json_decode( wp_remote_retrieve_body( wp_remote_get( $request_uri ) ), true );\n if( is_array( $response ) ) {\n $response = current( $response );\n }\n $this->github_response = $response;\n }\n }", "public function commit($vendor, $bundle) {\n $items = $this->repo->findBy(array(\n 'vendor' => $vendor,\n 'bundle' => $bundle,\n 'commit' => $this->translationManager->getCurrentCommit($vendor . $bundle)\n )\n );\n\n $commit = $this->translationManager->getCurrentCommit($vendor . $bundle);\n $this->log('Commiting ' . count($items) . ' translations...');\n $data = $this->serializeForCommit($items);\n $this->buildFilesToCommit($data, $vendor, $bundle);\n $workingDir = $this->gitDirectory . $vendor . $bundle;\n $branch = 'translations-' . $commit;\n chdir($workingDir);\n $this->log('git checkout ' . $branch);\n exec('git checkout ' . $branch);\n $this->log('git add .'); \n exec('git add .');\n $this->log('git commit -m \"translations from claroline.net\"');\n exec('git commit -m \"translations from claroline.net\"');\n $this->log('git push origin ' . $branch);\n exec('git push origin ' . $branch);\n }", "public function get_version_from_tag(){\n\n\t\t\t$tag = new stdClass;\n\n\t\t\t$repo = $this->get_repo();\n\n\t\t\tif( FALSE === $this->error )\n\t\t\t\t$ref = $this->get_ref( $repo->master_branch);\n\n\t\t\tif( FALSE === $this->error )\n\t\t\t\t$tag = $this->get_tag( $ref->object->sha );\n\t\t\telse\n\t\t\t\t$this->set_error( 'warning', __( 'Error while fetching version from tag', self::LANG ) );\n\n\t\t\treturn ( isset( $tag->tag ) && ! empty( $tag->tag ) ) ? $tag->tag : NULL;\n\n\t\t}", "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 tag(Request $request)\n {\n $id = $request->input('id');\n $tagId = $request->input('tag_id');\n $timestamp = $request->input('timestamp');\n\n $accessToken = $this->currentUser->pocket_access_token;\n\n $tag = $this->currentUser->tags()->findOrFail($tagId);\n\n $this->pocketClient->addTag($accessToken, $id, $tag->name);\n $this->currentUser->saveLastArticleTime($timestamp);\n }", "public function tags(TagRepositoryInterface $tagRepository)\n {\n $list = $tagRepository->get();\n $return = [];\n foreach ($list as $entry) {\n $return[] = $entry->tag;\n }\n\n return Response::json($return);\n\n }", "public function github(){\n\n\t\t$user = '';\n\t\tif(isset($this->request->get['user'])){\n\t\t\t$user = $this->request->get['user'];\n\t\t}\n\t\t$repo = '';\n\t\tif(isset($this->request->get['repo'])){\n\t\t\t$repo = $this->request->get['repo'];\n\t\t}\n\t\t$branch = '';\n\t\tif(isset($this->request->get['branch'])){\n\t\t\t$branch = $this->request->get['branch'];\n\t\t}\n\t\tnew d_shopunity\\GitHub($user, $repo, str_replace(\"catalog/\", \"\", DIR_APPLICATION), $branch );\n\t}", "public function setRepository(string $repository, $instance) :void\n {\n $this->repositories[$repository] = $instance;\n }", "private function addNode(Stack $stack, $label, $id, $tag = null)\n {\n $labels = ['RegistryObject', 'test', $label];\n if ($tag === null) {\n $tag = strtolower($id);\n }\n $labels = implode(\":\", $labels);\n $stack->push(\"MERGE (n:{$labels} {roId: {roId}, class: {class}, type: {type} }) RETURN n\",\n [\n 'roId' => $id,\n 'class' => $label,\n 'type' => $label\n ],\n $tag\n );\n return $stack;\n }", "public function tag(Request $request, $id)\n {\n\t\t//$request->tag_id\n\t\t\n \t$ctag = Roompicturetag::find($request->tag_id);\n \t$product = Product::find($id);\n \t$products = [];\n \t$products2 = [];\n\t\t\n \tif ($product->relative)\n \t\t$products = $product->relative->products;\n\t\t \n \tif ($product->relative)\n \t\t$products2 = $product->relative->products;\n\t\t \n\t\t\n \treturn response()->json([\n\t\t\t'html' => view('partials.product-tag-new', compact('product', 'ctag', 'products', 'products2'))->render(), \n\t\t\t'html2' => view('partials.product-tag-new2', compact('product', 'ctag', 'products', 'products2'))->render(), \n\t\t\t'p_id' => $id]);\n\n\t\tdie();\n\t}", "function devshop_project_create_step_git($form, $form_state) {\n $project = &$form_state['project'];\n \n drupal_add_js(drupal_get_path('module', 'devshop_projects') . '/inc/create/create.js');\n \n if ($project->verify_error) {\n $form['note'] = array(\n '#markup' => t('We were unable to connect to your git repository. Check the messages, edit your settings, and try again.'),\n '#prefix' => '<div class=\"alert alert-danger\">',\n '#suffix' => '</div>',\n );\n $form['error'] = array(\n '#markup' => $project->verify_error,\n );\n \n // Check for \"host key\"\n if (strpos($project->verify_error, 'Host key verification failed')) {\n $form['help'] = array(\n '#markup' => t('Looks like you need to authorize this host. SSH into the server as <code>aegir</code> user and run the command <code>git ls-remote !repo</code>. <hr />Add <code>StrictHostKeyChecking no</code> to your <code>~/.ssh/config</code> file to avoid this for all domains in the future.', array(\n '!repo' => $project->git_url,\n )),\n '#prefix' => '<div class=\"alert alert-warning\">',\n '#suffix' => '</div>',\n );\n }\n }\n \n if (empty($project->name)) {\n $form['title'] = array(\n '#type' => 'textfield',\n '#title' => t('Project Code Name'),\n '#required' => TRUE,\n '#suffix' => '<p>' . t('Choose a unique name for your project. Only letters and numbers are allowed.') . '</p>',\n '#size' => 40,\n '#maxlength' => 255,\n );\n }\n else {\n $form['title'] = array(\n '#type' => 'value',\n '#value' => $project->name,\n );\n $form['title_display'] = array(\n '#type' => 'item',\n '#title' => t('Project Code Name'),\n '#markup' => $project->name,\n );\n }\n \n $username = variable_get('aegir_user', 'aegir');\n \n $tips[] = t('Use the \"ssh\" url whenever possible. For example: <code>[email protected]:opendevshop/repo.git</code>');\n $tips[] = t('You can use a repository with a full Drupal stack committed, but using composer is recommended.');\n $tips[] = t('Use the !link project as a starting point for Composer based projects.', [\n '!link' => l(t('DevShop Composer Template'), 'https://github.com/opendevshop/devshop-composer-template'),\n ]);\n $tips[] = t('If a composer.json file is found in the root of the project, <code>composer install</code> will be run automatically.');\n $tips = theme('item_list', array('items' => $tips));\n \n $form['git_url'] = array(\n '#type' => 'textfield',\n '#required' => 1,\n '#title' => t('Git URL'),\n '#suffix' => '<p>' . t('Enter the Git URL for your project') . '</p>' . $tips,\n '#default_value' => $project->git_url,\n '#maxlength' => 1024,\n );\n\n//\n// // Project code path.\n// $form['code_path'] = array(\n// '#type' => variable_get('devshop_projects_allow_custom_code_path', FALSE) ? 'textfield' : 'value',\n// '#title' => t('Code path'),\n// '#description' => t('The absolute path on the filesystem that will be used to create all platforms within this project. There must not be a file or directory at this path.'),\n// '#required' => variable_get('devshop_projects_allow_custom_code_path', FALSE),\n// '#size' => 40,\n// '#default_value' => $project->code_path,\n// '#maxlength' => 255,\n// '#attributes' => array(\n// 'data-base_path' => variable_get('devshop_project_base_path', '/var/aegir/projects'),\n// ),\n// );\n//\n// // Project base url\n// $form['base_url'] = array(\n// '#type' => variable_get('devshop_projects_allow_custom_base_url', FALSE) ? 'textfield' : 'value',\n// '#title' => t('Base URL'),\n// '#description' => t('All sites will be under a subdomain of this domain.'),\n// '#required' => variable_get('devshop_projects_allow_custom_base_url', FALSE),\n// '#size' => 40,\n// '#default_value' => $project->base_url,\n// '#maxlength' => 255,\n// '#attributes' => array(\n// 'data-base_url' => devshop_projects_url($project->name, ''),\n// ),\n// );\n \n // Display helpful tips for connecting.\n $pubkey = variable_get('devshop_public_key', '');\n \n // If we don't yet have the server's public key saved as a variable...\n if (empty($pubkey)) {\n $output = t(\"This DevShop doesn't yet know your server's public SSH key. To import it, run the following command on your server as <code>aegir</code> user:\");\n $command = 'drush @hostmaster vset devshop_public_key \"$(cat ~/.ssh/id_rsa.pub)\" --yes';\n $output .= \"<div class='command'><input size='160' value='$command' onclick='this.select()' /></div>\";\n }\n else {\n // @TODO: Make this Translatable\n $output = <<<HTML\n <div class=\"empty-message\">If you haven't granted this server access to your Git repository, you should do so now using it's public SSH key.</div>\n <textarea id=\"rsa\" onclick='this.select()'>$pubkey</textarea>\nHTML;\n }\n \n // Add info about connecting to Repo\n $form['connect'] = array(\n '#type' => 'fieldset',\n '#title' => t('Repository Access'),\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n );\n $form['connect']['public_key'] = array(\n '#markup' => $output,\n );\n return $form;\n}", "public function createRepository(CreateRepository $repository)\n {\n /** @var RepositoryResponse $response */\n $response = $this->apiClient->createRepository(['body' => new RepositoryRequest($repository)]);\n\n return $response->getRepository();\n }", "public function tag(Deploy $deploy, Version $version);", "protected function registerTag()\n {\n $this->app->bind(\n 'Isern\\Storage\\Tag\\TagRepositoryInterface',\n 'Isern\\Storage\\Tag\\EloquentTagRepository'\n );\n }", "public static function &create($repo_path, $source = null) {\n\t\t\treturn GitRepo::create_new($repo_path, $source);\n\t\t}", "function tag_book( $id, $tag ) {\r\n\treturn set_book_tags($id, $tag, true);\r\n}", "function prueba_git ()\r\n{\r\n\t/* Aqui estaria el codigo de la funcion */\r\n\r\n}", "public function testGitLabRemoteRepository(): void\n {\n $repo = new GitLabRemoteRepository('r/r', './');\n $this->assertEquals('https://gitlab.com/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "protected function getRepository() {\n\t\tif ($this->_repository === null) {\n\t\t\t$this->_repository = new AGitRepository();\n\t\t\t$this->_repository->setPath($this->path,true,true);\n\t\t\t$this->assertTrue(file_exists($this->path));\n\t\t}\n\t\treturn $this->_repository;\n\t}", "public function actionCreate()\n\t{\n\t\t$model=new Repository;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Repository']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Repository'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('admin'));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function reposOwnerRepoTags(array $params): array\n {\n $owner = $params['owner'] ?? '';\n $repo = $params['repo'] ?? '';\n\n return $this->clientObj\n ->get()\n ->setPath($owner, $repo)\n ->get(API::REPOSITORIES['RRTags']);\n }", "public function repo($dir, $remote);", "public static function get_latest_version_on_github( $repository ) {\n\t\ttry {\n\t\t\t$response = json_decode( trim( Utils::get_remote_content( 'https://api.github.com/repos/' . $repository . '/tags' ) ), true );\n\n\t\t\tif ( ! is_array( $response ) || ! array_key_exists( '0', $response ) || ! array_key_exists( 'name', $response[0] ) ) {\n\t\t\t\tthrow new Exception( 'Latest version on GitHub cannot be found.' );\n\t\t\t}\n\n\t\t\treturn $response[0]['name'];\n\t\t} catch ( Exception $e ) {\n\t\t\tthrow new Exception( $e->getMessage() );\n\t\t}\n\t}", "public function getRevision(RepositoryEntry $repository, $branch);", "function plugin_initconfig_repository()\n{\n global $_CONF;\n\n $c = config::get_instance();\n if (!$c->group_exists('repository')) {\n $c->add('sg_main', NULL, 'subgroup', 0, 0, NULL, 0, true, 'repository');\n $c->add('fs_main', NULL, 'fieldset', 0, 0, NULL, 0, true, 'repository');\n $c->add('repository_moderated', 1,\n 'select', 0, 0, 0, 10, true, 'repository');\n $c->add('max_pluginpatch_upload', 2000000, \n 'text', 0, 0, 0, 60, true, 'repository'); // 2 MB\n }\n\n return true;\n}", "public function tagAs($objid, $tag);", "public function destroy(Repository $repository)\n {\n //\n }", "public function getRepo()\n {\n return $this->repo;\n }", "function repo(string $repository): RepositoryInterface\n {\n static $repos = [];\n\n if (!empty($repos[$repository])) {\n return $repos[$repository];\n }\n\n $repositoryClass = config('mongez.repositories.' . $repository);\n\n if (!$repositoryClass) {\n throw new NotFoundRepositoryException(sprintf('Call to undefined repository: %s', $repository));\n }\n\n $repositoryClass = App::make($repositoryClass);\n\n return $repos[$repository] = $repositoryClass;\n }", "public function lock($username, $repository, $id)\n {\n return $this->put('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/issues/'.$id.'/lock');\n }", "public function createTag(EntityManagerInterface $entityManager,TagsRepository $tagsRepository)\n {\n // J'utilise l'entité Tags, pour créer un nouvel article en bdd\n // une instance de l'entité Tags = un enregistrement d'article en bdd\n $tag = new Tags();\n\n // j'utilise les setters de l'entité Tags pour renseigner les valeurs des colonnes\n $tag->setTitle('Black Friday');\n $tag->setColor(\"black\");\n\n //Je sauvegarde les entitées crée\n $entityManager->persist($tag);\n\n // je récupère toutes les entités pré-sauvegardées et je les insère en BDD\n $entityManager->flush();\n\n return $this->redirectToRoute(\"admin_tags_list\");\n\n }", "public function tag( $slug ) {\n\t\t$data[\"tagInfo\"] = SM::getCache( 'tag_' . $slug, function () use ( $slug ) {\n\t\t\treturn Tag::with( \"blogs\" )\n\t\t\t ->where( \"slug\", $slug )\n\t\t\t ->where( 'status', 1 )\n\t\t\t ->first();\n\t\t} );\n\t\tif ( count( $data[\"tagInfo\"] ) > 0 ) {\n\t\t\t$page = \\request()->input( 'page', 0 );\n\t\t\t$key = 'tagBlogs_' . $data[\"tagInfo\"]->id . '_' . $page;\n\t\t\t$data[\"blogs\"] = SM::getCache( $key, function () use ( $data ) {\n\n\t\t\t\t$blog_posts_per_page = SM::smGetThemeOption(\n\t\t\t\t\t\"blog_posts_per_page\",\n\t\t\t\t\tconfig( \"constant.smFrontPagination\" )\n\t\t\t\t);\n\n\t\t\t\treturn $data[\"tagInfo\"]->blogs()\n\t\t\t\t ->where( \"status\", 1 )\n\t\t\t\t ->paginate( $blog_posts_per_page );\n\t\t\t}, [ 'tagBlogs' ] );\n\t\t\t$data['key'] = $key;\n\t\t\t$data['seo_title'] = $data['tagInfo']->seo_title;\n\t\t\t$data[\"meta_key\"] = $data[\"tagInfo\"]->meta_key;\n\t\t\t$data[\"meta_description\"] = $data[\"tagInfo\"]->meta_description;\n\t\t\t$data[\"image\"] = $data[\"tagInfo\"]->image != '' ? asset( SM::sm_get_the_src( $data[\"tagInfo\"]->image, 750, 560 ) ) : '';\n\n\t\t\treturn view( 'page.tag', $data );\n\t\t} else {\n\t\t\treturn abort( 404 );\n\t\t}\n\t}", "public function setGit($var)\n {\n GPBUtil::checkMessage($var, \\Grafeas\\V1\\GitSourceContext::class);\n $this->writeOneof(3, $var);\n\n return $this;\n }", "function write_plain($repos) {\n $repo = get_repo_path($_GET['p'], $repos);\n $hash = $_GET['h'];\n header(\"Content-Type: text/plain\");\n $str = system(\"GIT_DIR=$repo/.git git cat-file blob $hash\");\n echo $str;\n die();\n}", "public function attach( $repository ) {\r\n\t\tif ( $repository = self::getRepository( $repository ) ) {\r\n\t\t\tif ( $repository instanceof Taxonomy ) {\r\n\t\t\t\t$repository->attach( $this->name );\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function testSignedLog($repository)\n {\n $ref = new PushReference($repository, 'foo', self::INITIAL_COMMIT, self::SIGNED_COMMIT);\n $log = $ref->getLog()->getCommits();\n $this->assertCount(16, $log, '16 commits in log');\n $this->assertEquals('signed commit', $log[0]->getShortMessage(), 'Last commit is correct');\n }", "function html_desc($repo, $proj) {\n\n // Check if the git repo has a description file\n if(file_exists(\"$repo/.git/description\")){\n $desc = short_desc(file_get_contents(\"$repo/.git/description\"));\n }else{\n $desc = \"No description\";\n }\n $owner = get_file_owner($repo);\n $last = get_last($repo);\n $git_clone_url = 'http://'.$_SERVER['HTTP_HOST'].'/git/'.$proj;\n \n echo \"<table>\";\n echo \"<tr><td>description</td><td>$desc</td></tr>\";\n echo \"<tr><td>owner</td><td>$owner</td></tr>\";\n echo \"<tr><td>last change</td><td>$last</td></tr>\";\n echo \"<tr><td>URL</td><td>$git_clone_url</td></tr>\";\n echo \"</table>\";\n}", "public function getRepositoryName()\n {\n return $this->repositoryName;\n }", "public function gitClone()\n\t{\n\t\t$repoURL = 'https://github.com/' . $this->getUserName() . '/' . $this->getProjectName() . '.git';\n\t\t$path = $this->getPath();\n\t\t$this->gitWrapper->clone($repoURL, $path);\n\t}", "function add_tag($tag) {\n array_push($this->tags, $tag);\n }", "public function create($username, $repository, array $params)\n {\n if (!isset($params['name'])) {\n throw new MissingArgumentException('name');\n }\n if (!isset($params['color'])) {\n $params['color'] = 'FFFFFF';\n }\n\n return $this->post('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels', $params);\n }", "public function show(Repository $repository)\n {\n //\n }", "public function push(Commit $commit)\n {\n $repo = $commit->repo;\n\n $args = explode('/', $repo->name);\n\n $data = [\n 'state' => $this->getState($commit->status),\n 'description' => $commit->description(),\n 'target_url' => $this->url.'/'.$commit->id,\n 'context' => 'StyleCI',\n ];\n\n $this->factory->make($repo)->repos()->statuses()->create($args[0], $args[1], $commit->id, $data);\n }", "public function tag()\n\t{\n\t\t$crud = $this->generate_crud('blog_tags');\n\t\t$this->mPageTitle = 'Blog Tags';\n\t\t$this->render_crud();\n\t}", "public function imageTag($image, $repo, $tag = null, $force = false)\n {\n return $this->browser->post(\n $this->uri->expand(\n 'images/{image}/tag{?repo,tag,force}',\n array(\n 'image' => $image,\n 'repo' => $repo,\n 'tag' => $tag,\n 'force' => $this->boolArg($force)\n )\n )\n )->then(array($this->parser, 'expectEmpty'));\n }", "public function getGitVersion()\n {\n try {\n return $this->getGitTag();\n } catch (RuntimeException $exception) {\n try {\n return $this->getGitHash(true);\n } catch (RuntimeException $exception) {\n throw new RuntimeException(\n sprintf(\n 'The tag or commit hash could not be retrieved from \"%s\": %s',\n dirname($this->file),\n $exception->getMessage()\n ),\n 0,\n $exception\n );\n }\n }\n }", "public function get_tag( $sha ){\n\n\t\t\treturn $this->get_github_data( 'tag', $sha );\n\n\t\t}", "public function testGitHubRemoteRepository(): void\n {\n $repo = new GitHubRemoteRepository('r/r', './');\n $this->assertEquals('https://github.com/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "public static function version()\n {\n if (! file_exists('.git')) {\n return '*no-git* (dirty)';\n }\n\n return preg_replace('/\\s+/', '', shell_exec('git describe --tag'));\n }", "public function show($username, $repository, $label)\n {\n return $this->get('/repos/'.rawurlencode($username).'/'.rawurlencode($repository).'/labels/'.rawurlencode($label));\n }", "public function edit(Repository $repository)\n {\n //\n }", "public function repository($team, $repo)\n {\n return $this->getClient()->setApiVersion('2.0')->get(\n sprintf('/teams/%s/permissions/repositories/%s', $team, $repo)\n );\n }", "public function setRepo($user, $repo)\n {\n $this->apibase = \"https://api.github.com/repos/$user/$repo/\";\n }", "public function _archive_repo( $gitlab_path ) {\n\n\t\t[ 'group' => $group, 'name' => $project_name ] = $gitlab_path; // php 7.1 🚀\n\n\t\tif ( ! empty( $project_name ) ) {\n\n\t\t\tarchive_repo_by_id( rawurlencode( $group . '/' . $project_name ) );\n\n\t\t} else {\n\n\t\t\t$projects_data = get_projects( $gitlab_path );\n\n\t\t\tforeach ( $projects_data as $project ) {\n\n\t\t\t\t$this->_display_project_data( $project, 'Archiving' );\n\n\t\t\t\tarchive_repo_by_id( $project['id'] );\n\t\t\t}\n\t\t}\n\t}", "function do_clone_or_pull($key, $url, $path, $operation) {\n // Already a git repo there. Do a pull.\n if ((is_dir($path)) && (file_exists($path . \"/.git\"))) {\n\tif($operation==\"TAG\"){\n\t\treturn do_fetch($key,$url,$path);\n\t}\n\telse{\n\t\treturn do_pull($key,$url,$path);\n\t}\n }\n \n // Try a clone\n $out = do_clone($key,$url,$path);\n if (!is_dir($path)) {\n $out .= \"\\nClone appeared to fail.\\n\";\n }\n return $out;\n}", "public function addNewTag($tagName) {\n $sql = \"INSERT INTO t_tags VALUES(?)\";\n $select = $this->con->prepare($sql);\n $select->bind_param(\"s\", $tagName);\n $select->execute();\n $select->close();\n }", "public function getAllRepositories(Project $project) {\n $repositories = array();\n $repository_list = $this->dao->getProjectRepositoryList($project->getID(), false, false);\n foreach ($repository_list as $row) {\n $repository = new GitRepository();\n $this->dao->hydrateRepositoryObject($repository, $row);\n $repositories[] = $repository;\n }\n return $repositories;\n }" ]
[ "0.60580647", "0.5574278", "0.556409", "0.549926", "0.5496575", "0.5474676", "0.54705894", "0.5448116", "0.5447197", "0.53421164", "0.5339263", "0.53236586", "0.5240002", "0.52297854", "0.5228689", "0.52079755", "0.52000946", "0.5195025", "0.51823694", "0.51476246", "0.5138219", "0.51311636", "0.5115204", "0.51146436", "0.5088652", "0.5063177", "0.5058362", "0.50228274", "0.5021037", "0.4996897", "0.4950035", "0.49491543", "0.49464524", "0.49429345", "0.49277046", "0.49193755", "0.48995453", "0.4865372", "0.48633003", "0.4862457", "0.48609298", "0.48224473", "0.48192427", "0.4818132", "0.4812502", "0.47767058", "0.47728598", "0.47587332", "0.47513142", "0.47363806", "0.47307968", "0.47307786", "0.47139692", "0.47040704", "0.4696811", "0.46896493", "0.4680875", "0.465737", "0.46490693", "0.46484315", "0.46479136", "0.4634311", "0.46060348", "0.46040198", "0.45932943", "0.4586556", "0.45844236", "0.45828474", "0.45677295", "0.45673388", "0.45671418", "0.45531324", "0.45300165", "0.4521608", "0.45063972", "0.4503623", "0.45013332", "0.45011932", "0.44968414", "0.4479122", "0.44784442", "0.44586623", "0.44581175", "0.44567874", "0.44557443", "0.4454887", "0.4448007", "0.4439207", "0.44390655", "0.44336233", "0.44208792", "0.44187653", "0.44083816", "0.44079712", "0.4400987", "0.4400145", "0.43937388", "0.43931976", "0.43911546", "0.43869653" ]
0.6686038
0
Update the repo at the given path to the lastest source in remote 'origin' on branch 'master'.
function git_update($path) { $status = GitUtil::update($path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function update($path, $remote = 'origin', $branch = 'master') {\n\t\tif (!file_exists($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path does not exist.\");\n\t\t}\n\n\t\tif (!is_dir($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path is not a directory.\");\n\t\t}\n\n\t\tif (!self::isRepo($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path is not a git repository.\");\n\t\t}\n\n\t\t$origCwd = getcwd();\n\t\tchdir($path);\n\n\t\t$fetchCmd = sprintf(self::FETCH_CMD_TMPL, $remote);\n\t\tpassthru($fetchCmd);\n\n\t\t$mergeCmd = sprintf(self::MERGE_CMD_TMPL, $remote, $branch);\n\t\tpassthru($mergeCmd);\n\n\t\tchdir($origCwd);\n\t}", "function rpull() {\n\t\t$this->checkOnce();\n\t\t$versionPath = $this->getVersionPath();\n\t\t/** @var Repo $repo */\n\t\tforeach ($this->repos as $repo) {\n\t\t\techo BR, '## ', $repo->path, BR;\n\t\t\t$deployPath = $versionPath . '/' . $repo->path();\n\t\t\ttry {\n\t\t\t\t$exists = $this->rexists($deployPath);\n\t\t\t\tif ($exists) {\n\t\t\t\t\t$remoteCmd = 'cd ' . $deployPath . ' && hg pull';\n\t\t\t\t\t$this->ssh_exec($remoteCmd);\n\t\t\t\t} else {\n\t\t\t\t\techo TAB, '*** path ', $deployPath, ' does not exist', BR;\n\t\t\t\t}\n\t\t\t} catch (\\SystemCommandException $e) {\n\t\t\t\techo 'Error: '.$e, BR;\n\t\t\t}\n\t\t}\n\t}", "function gitUpdate()\n{\n \n $config = json_decode(file_get_contents(\"/app/config.json\"), true);\n\n $git = $config['git'];\n $remote = \"https://\" . $git['user'] . \":\" . $git['token'] . \"@github.com/\" . $git['git_dir'];\n exec(\"cd \" . $config['project_dir'] . \" && git init && git pull $remote \" . $git['branch']);\n exec(\"cd \" . $config['project_dir'] . \" && composer update\");\n}", "function rupdate() {\n\t\t$this->checkOnce();\n\t\t$deployPath = $this->getVersionPath();\n\t\t$branch = $this->branch ?: 'default';\n\t\t$remoteCmd = 'cd '.$deployPath.' && hg update -r '.$branch;\n\t\t$this->ssh_exec($remoteCmd);\n\t}", "protected function pull()\n {\n $local_repo = $this->getLocalRepoPath();\n if (!is_dir($local_repo))\n {\n if(!mkdir($local_repo, 0777, true))\n {\n throw new Exception('Could not create directory '.$local_repo);\n }\n $this->execute('clone', array($this->getRemoteScmUrl(), $local_repo));\n }\n else\n {\n $cwd = getcwd();\n chdir($local_repo);\n $this->execute('pull', array(), array());\n chdir($cwd);\n }\n }", "public function updateRepository() {\n $scheduledFile = __DIR__ . '/scheduled.txt';\n if (!file_exists($scheduledFile))\n return;\n\n $requested = file_get_contents($scheduledFile);\n if (!unlink($scheduledFile))\n return;\n\n if ((time() - intval(trim($requested))) > 600)\n return;\n\n $commands = [\n // Updates the local copy of the repository with the most recent remote changes.\n 'git fetch --all',\n\n // Resets the repository to the state the remote currently is in.\n 'git reset --hard origin/master',\n\n // Remove any left-over files that are not part of the checkout, and not in .gitignore.\n 'git clean -f -d',\n\n // Write the latest commit SHA to the VERSION file.\n 'git rev-parse HEAD > VERSION',\n ];\n\n $directory = realpath(__DIR__ . '/../../../');\n\n foreach ($commands as $command)\n Info(trim(shell_exec('cd ' . $directory . ' && ' . $command . ' 2>&1')));\n\n Info('AutoDeploy: Updated to revision ' . file_get_contents(__DIR__ . '/../../../VERSION') . '.');\n }", "function target_gitup()\n{\n\t// git remote add upstream git://github.com/<user>/<repo>.git\n\tsystem('git fetch upstream');\n\tsystem('git merge upstream/master');\n}", "public static function updateExternals($path) {\n\t\tif (!file_exists($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path does not exist.\");\n\t\t}\n\n\t\tif (!is_dir($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path is not a directory.\");\n\t\t}\n\n\t\tif (!self::isRepo($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path is not a git repository.\");\n\t\t}\n\n\t\t$origCwd = getcwd();\n\t\tchdir($path);\n\n\t\t$updateCmd = sprintf(self::UPDATE_SUBMODULES_CMD);\n\t\tpassthru($updateCmd);\n\n\t\tchdir($origCwd);\n\t}", "public function gitPull ()\n {\n\n $this->updates[ ] = Hallmark_Misc::shell ( 'git pull ' . Hallmark_Misc::removeQuotes ( Hallmark_Misc::args () ) );\n\n }", "function updateSourceBranching() {\n if ($this->isModuleInstalled('source')) {\n try {\n $source_commits_table = TABLE_PREFIX . 'source_commits';\n $commit_project_objects_table = TABLE_PREFIX . 'commit_project_objects';\n $source_repositories_table = TABLE_PREFIX . 'source_repositories';\n\n DB::execute(\"ALTER TABLE $source_commits_table ADD branch_name VARCHAR(255) DEFAULT '' AFTER commited_by_email\");\n DB::execute(\"ALTER TABLE $commit_project_objects_table ADD branch_name VARCHAR(255) DEFAULT '' AFTER revision\");\n\n // Add default branch for existing data\n\n DB::execute(\"UPDATE $source_commits_table SET branch_name = 'master' WHERE type = 'GitCommit'\");\n DB::execute(\"UPDATE $source_commits_table SET branch_name = 'default' WHERE type = 'MercurialCommit'\");\n\n $commit_project_objects = DB::execute(\"\n SELECT $commit_project_objects_table.id, $source_repositories_table.type\n FROM $commit_project_objects_table, $source_repositories_table\n WHERE $commit_project_objects_table.repository_id = $source_repositories_table.id\"\n );\n\n if (is_foreachable($commit_project_objects)) {\n foreach ($commit_project_objects as $commit_project_object) {\n if ($commit_project_object['type'] == 'GitRepository') {\n DB::execute(\"UPDATE $commit_project_objects_table SET branch_name = 'master' WHERE id = ?\", $commit_project_object['id']);\n } //if\n if ($commit_project_object['type'] == 'MercurialRepository') {\n DB::execute(\"UPDATE $commit_project_objects_table SET branch_name = 'default' WHERE id = ?\", $commit_project_object['id']);\n } //if\n } //foreach\n } //if\n\n DB::execute('INSERT INTO ' . TABLE_PREFIX . \"config_options (name, module, value) VALUES ('default_source_branch', 'source', 'N;')\");\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n } //if\n return true;\n }", "public function update($path = null)\n {\n $this->executeNpm(array('update'), $path);\n }", "public function repo($dir, $remote);", "protected function utilGitPull()\n {\n foreach (File::directories(plugins_path()) as $authorDir) {\n foreach (File::directories($authorDir) as $pluginDir) {\n if (!File::isDirectory($pluginDir.'/.git')) {\n continue;\n }\n\n $exec = 'cd ' . $pluginDir . ' && ';\n $exec .= 'git pull 2>&1';\n echo 'Updating plugin: '. basename(dirname($pluginDir)) .'.'. basename($pluginDir) . PHP_EOL;\n echo shell_exec($exec);\n }\n }\n\n foreach (File::directories(themes_path()) as $themeDir) {\n if (!File::isDirectory($themeDir.'/.git')) {\n continue;\n }\n\n $exec = 'cd ' . $themeDir . ' && ';\n $exec .= 'git pull 2>&1';\n echo 'Updating theme: '. basename($themeDir) . PHP_EOL;\n echo shell_exec($exec);\n }\n }", "public function gitPull() {\n $current_branch = exec('git rev-parse --abbrev-ref HEAD');\n\n $collection = $this->collectionBuilder();\n $collection->taskGitStack()\n ->pull()\n ->run();\n\n $name = $this->confirm(\"Run Composer Install?\");\n if ($name) {\n $this->composerInstall();\n }\n\n $name = $this->confirm(\"Run Config Import?\");\n if ($name) {\n $this->drushCim();\n }\n }", "private function githubSyncProcess()\n\t{\n\n\t\t// Delete any existing file.\n\t\tif(file_exists(e_TEMP.\"e107-master.zip\"))\n\t\t{\n\t\t\tunlink(e_TEMP.\"e107-master.zip\");\n\t\t}\n\n\t\t$result = e107::getFile()->getRemoteFile('https://codeload.github.com/e107inc/e107/zip/master', 'e107-master.zip', 'temp');\n\n\t\tif($result == false)\n\t\t{\n\t\t\te107::getMessage()->addError( DBLAN_118 );\n\t\t}\n\n\n\t\t$localfile = 'e107-master.zip';\n\n\t\tchmod(e_TEMP.$localfile, 0755);\n\t\trequire_once(e_HANDLER.\"pclzip.lib.php\");\n\n//\t$base = realpath(dirname(__FILE__));\n\n\n\t\t$newFolders = array(\n\t\t\t'e107-master/e107_admin/' => e_BASE.e107::getFolder('ADMIN'),\n\t\t\t'e107-master/e107_core/' => e_BASE.e107::getFolder('CORE'),\n\t\t\t'e107-master/e107_docs/' => e_BASE.e107::getFolder('DOCS'),\n\t\t\t'e107-master/e107_handlers/' => e_BASE.e107::getFolder('HANDLERS'),\n\t\t\t'e107-master/e107_images/' => e_BASE.e107::getFolder('IMAGES'),\n\t\t\t'e107-master/e107_languages/' => e_BASE.e107::getFolder('LANGUAGES'),\n\t\t\t'e107-master/e107_media/' => e_BASE.e107::getFolder('MEDIA'),\n\t\t\t'e107-master/e107_plugins/' => e_BASE.e107::getFolder('PLUGINS'),\n\t\t\t'e107-master/e107_system/' => e_BASE.e107::getFolder('SYSTEM'),\n\t\t\t'e107-master/e107_themes/' => e_BASE.e107::getFolder('THEMES'),\n\t\t\t'e107-master/e107_web/' => e_BASE.e107::getFolder('WEB'),\n\t\t\t'e107-master/' => e_BASE\n\t\t);\n\n\t\t$srch = array_keys($newFolders);\n\t\t$repl = array_values($newFolders);\n\n\t\t$archive \t= new PclZip(e_TEMP.$localfile);\n\t\t$unarc \t\t= ($fileList = $archive -> extract(PCLZIP_OPT_PATH, e_TEMP, PCLZIP_OPT_SET_CHMOD, 0755)); // Store in TEMP first.\n\n\t\t$error = array();\n\t\t$success = array();\n\t\t$skipped = array();\n//\tprint_a($unarc);\n\n\n\t\t$excludes = array('e107-master/','e107-master/install.php','e107-master/favicon.ico');\n\n\t\tforeach($unarc as $k=>$v)\n\t\t{\n\t\t\tif(in_array($v['stored_filename'],$excludes))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$oldPath = $v['filename'];\n\t\t\t$newPath = str_replace($srch,$repl, $v['stored_filename']);\n\n\t\t\t$message = e107::getParser()->lanVars(DBLAN_121, array('x'=>$oldPath, 'y'=>$newPath));\n\n\t\t\tif($v['folder'] ==1 && is_dir($newPath))\n\t\t\t{\n\t\t\t\t// $skipped[] = $newPath. \" (already exists)\";\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif(!rename($oldPath,$newPath))\n\t\t\t{\n\t\t\t\t$error[] = $message;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$success[] = $message;\n\t\t\t}\n\n\n\t\t\t//\techo $message.\"<br />\";\n\n\t\t}\n\n\t\tif(!empty($success))\n\t\t{\n\t\t\te107::getMessage()->addSuccess(print_a($success,true));\n\t\t}\n\n\t\tif(!empty($skipped))\n\t\t{\n\t\t\te107::getMessage()->setTitle(\"Skipped\",E_MESSAGE_INFO)->addInfo(print_a($skipped,true));\n\t\t}\n\n\t\tif(!empty($error))\n\t\t{\n\t\t\te107::getMessage()->addError(print_a($error,true));\n\t\t}\n\n\n\n\n\t\te107::getRender()->tablerender(DBLAN_10.SEP.DBLAN_112, e107::getMessage()->render());\n\n\t}", "public function pullRepo($branchName = null) {\n\n if(is_null($branchName)){\n // pull all branches\n \\Utils::gitCommand('pull --all');\n exec('git pull --all', $pullop);\n // fetch all brnaches\n \\Utils::gitCommand('fetch --all');\n// exec('git fetch --all', $pullop);\n }else{\n // checkout to the branch which we have to pull.\n// exec('git checkout ' . $branchName, $op);\n \\Utils::gitCommand('checkout ' . $branchName);\n $this->output('Checkout to ' . $branchName);\n // pull all branches\n \\Utils::gitCommand('pull --all');\n// exec('git pull --all', $pullop);\n // fetch all brnaches\n \\Utils::gitCommand('fetch --all');\n// exec('git fetch --all', $pullop);\n // reset all local files and make exact copy of remote\n \\Utils::gitCommand('reset --hard origin/' . $branchName);\n// exec('git reset --hard origin/' . $branchName, $pullop);\n /*\n * Go back to master.\n */\n if ($branchName !== 'master') {\n// exec('git checkout master');\n \\Utils::gitCommand('checkout master');\n }\n }\n }", "function rinstall() {\n\t\t$versionPath = $this->getVersionPath();\n//\t\tdebug($versionPath);\n\t\t/** @var Repo $repo */\n\t\tforeach ($this->repos as $repo) {\n\t\t\techo BR, '## ', $repo->path(), BR;\n\t\t\tif ($this->rexists($repo->path())) {\n\t\t\t\t$deployPath = $versionPath . '/' . $repo->path();\n\t\t\t\t$cmd = 'cd ' . $deployPath . ' && hg update -r ' . $repo->getHash();\n\t\t\t\t$this->ssh_exec($cmd);\n\t\t\t} else {\n\t\t\t\techo 'Error: '.$repo->path.' is not on the server. Maybe do rdeploy?', BR;\n\t\t\t}\n\t\t}\n\t}", "public function update() {\n\t\t$webhook_secret = $this->config->item ( 'github_webhook_secret' );\n\t\t$client_id = $this->config->item ( 'github_client_id' );\n\t\t$client_secret = $this->config->item ( 'github_client_secret' );\n\t\t\n\t\tif (! isset ( $_SERVER ['HTTP_X_HUB_SIGNATURE'] )) {\n\t\t\tthrow new \\Exception ( \"HTTP header 'X-Hub-Signature' is missing.\" );\n\t\t} elseif (! extension_loaded ( 'hash' )) {\n\t\t\tthrow new \\Exception ( \"Missing 'hash' extension to check the secret code validity.\" );\n\t\t}\n\t\t\n\t\tlist ( $algo, $hash ) = explode ( '=', $_SERVER ['HTTP_X_HUB_SIGNATURE'], 2 ) + array (\n\t\t\t\t'',\n\t\t\t\t'' \n\t\t);\n\t\tif (! in_array ( $algo, hash_algos (), TRUE )) {\n\t\t\tthrow new \\Exception ( \"Hash algorithm '$algo' is not supported.\" );\n\t\t}\n\t\t$rawPost = file_get_contents ( 'php://input' );\n\t\tif ($hash !== hash_hmac ( $algo, $rawPost, $webhook_secret )) {\n\t\t\tthrow new \\Exception ( 'Hook secret does not match.' );\n\t\t}\n\t\t\n\t\t$url = \"https://api.github.com/users/UoLCompSoc/repos?per_page=10&client_id=\" . $client_id . \"&client_secret=\" . $client_secret;\n\t\t\n\t\t$decoded = json_decode ( $this->_getContent ( $url ) );\n\t\t\n\t\t$github_data = array ();\n\t\t\n\t\tforeach ( $decoded as $repo ) {\n\t\t\tif ($repo->fork === TRUE) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$collaborators = json_decode ( $this->_getContent ( $repo->contributors_url ) );\n\t\t\t$repo->collaborator_count = sizeof ( $collaborators );\n\t\t\t\n\t\t\tarray_push ( $github_data, $repo );\n\t\t}\n\t\t\n\t\t$filepath = APPPATH . 'cache/repocache.json';\n\t\t\n\t\tif (! write_file ( $filepath, json_encode ( $github_data ), 'w' )) {\n\t\t\tlog_message ( 'error', 'Cannot write to github cache file at ' . $filepath );\n\t\t}\n\t\t\n\t\t// $this->load->view ( 'admin' );\n\t}", "function do_pull($key,$url,$path) {\n $cmd = \"ssh-agent bash -c 'cd $path; ssh-add $key; git reset --hard; git pull' 2>&1\";\n _log(\"Exec command: $cmd\\n\");\n return shell_exec($cmd);\n}", "function changeBranch(){\r\n\t\t// $gitpss = isset($_COOKIE['gitpss']) ? $_COOKIE['gitpss'] : '';\r\n\t\t// $repo = 'https://'.$gitusr.':'.$gitpss.'@github.com/nelsoft/nelsoft_inventory.git';\r\n\t\tchdir($_POST['path']);\r\n\t\texec('git clean -df');\r\n\t\texec('git checkout -- .');\r\n\t\t// exec('git fetch '.$repo);\r\n\t\texec('git checkout '.$_POST['branch'], $data);\r\n\t\t// exec('git pull '.$repo.' '.$_POST['branch'], $data);\r\n\r\n\t\t$return['version'] = '0.00';\r\n\t\t$return['version'] = getversion($_POST['path'], 'version');\t\r\n\t\t$return['data'] = $data;\r\n\r\n\t\tjdie($return);\r\n}", "public function updateRepository($reset = true)\n\t{\n\t\t$this->command->info('Pulling changes');\n\t\t$tasks = array($this->scm->update());\n\n\t\t// Reset if requested\n\t\tif ($reset) {\n\t\t\tarray_unshift($tasks, $this->scm->reset());\n\t\t}\n\n\t\treturn $this->runForCurrentRelease($tasks);\n\t}", "public function testGitHubRemoteRepository(): void\n {\n $repo = new GitHubRemoteRepository('r/r', './');\n $this->assertEquals('https://github.com/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "public function actionUpdate(): int\n {\n try {\n GithubCache::flush();\n\n $service = GithubService::getInstance();\n $service->saveCache();\n } catch (Exception $e) {\n throw $e;\n }\n\n return ExitCode::OK;\n }", "function upstreamupdate(array $args, array $assoc_args) {\n\n $path = 'code-upstream-updates';\n $data = array(\n // update database with latest schema\n 'updatedb' => (array_key_exists(\"updatedb\", $assoc_args)?$assoc_args['updatedb']:false),\n // default is to allow updates to parent repo to overwrite local\n 'xoption' => (array_key_exists(\"xoption\")) ? $assoc_args['updatedb'] : 'theirs',\n );\n //TODO: format output\n\n return $this->terminus_request(\"site\", $this->_siteInfo->site_uuid, $path, \"POST\", $data);\n }", "private function syncRepository()\n {\n $cwd = '/tmp/'.$this->migrationId;\n (new ProcessBuilder(['mkdir']))->add('-p')->add($cwd)->getProcess()->mustRun();\n\n $cloneSourceCommandBuilder = new ProcessBuilder(['git', 'clone', $this->sourceProject->getSshUrlToRepo(), '.']);\n $cloneSourceCommandBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $addNewRemoteBuilder = new ProcessBuilder(['git', 'remote', 'add', 'new']);\n $addNewRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->add($this->targetProject->getSshUrlToRepo())\n ->getProcess()\n ->mustRun();\n\n $pushToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--all']);\n $pushToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $pushTagsToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--tags']);\n $pushTagsToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n }", "public function update($path);", "public function testUpdateRefresh(): void\n {\n $fixturesSet = 'TUFTestFixtureSimple';\n $this->localRepo = $this->memoryStorageFromFixture($fixturesSet, 'tufclient/tufrepo/metadata/current');\n $this->testRepo = new TestRepo($fixturesSet);\n\n $this->assertClientRepoVersions(static::getFixtureClientStartVersions($fixturesSet));\n $updater = $this->getSystemInTest();\n // This refresh should succeed.\n $updater->refresh();\n // Put the server-side repo into an invalid state.\n $this->testRepo->removeRepoFile('timestamp.json');\n // The updater is already refreshed, so this will return early, and\n // there should be no changes to the client-side repo.\n $updater->refresh();\n $this->assertClientRepoVersions(static::getFixtureClientStartVersions($fixturesSet));\n // If we force a refresh, the invalid state of the server-side repo will\n // raise an exception.\n $this->expectException(RepoFileNotFound::class);\n $this->expectExceptionMessage('File timestamp.json not found.');\n $updater->refresh(true);\n }", "function do_clone_or_pull($key, $url, $path, $operation) {\n // Already a git repo there. Do a pull.\n if ((is_dir($path)) && (file_exists($path . \"/.git\"))) {\n\tif($operation==\"TAG\"){\n\t\treturn do_fetch($key,$url,$path);\n\t}\n\telse{\n\t\treturn do_pull($key,$url,$path);\n\t}\n }\n \n // Try a clone\n $out = do_clone($key,$url,$path);\n if (!is_dir($path)) {\n $out .= \"\\nClone appeared to fail.\\n\";\n }\n return $out;\n}", "protected function pullRepo()\n {\n assert(valid_num_args());\n\n $pull = new GitHubPullProcess($this->config, $this->env, $this->output);\n $pull->execute();\n }", "public function testBitBucketRemoteRepository(): void\n {\n $repo = new BitBucketRemoteRepository('r/r', './');\n $this->assertEquals('https://bitbucket.org/r/r/src/v2/src/Project.php#Project.php-30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "function pkg_switch_repo($repo_path, $repo_name) {\n\tglobal $g, $config;\n\n\tsafe_mkdir(\"/usr/local/etc/pkg/repos\");\n\t@unlink(\"/usr/local/etc/pkg/repos/{$g['product_name']}.conf\");\n\t$repo = \"{$repo_path}/{$g['product_name']}-repo-{$repo_name}.conf\";\n\t@symlink($repo, \"/usr/local/etc/pkg/repos/{$g['product_name']}.conf\");\n\n\t/* Do not fetch new settings, only setup the repo pkg.conf. */\n\tmwexec(\"/usr/local/sbin/{$g['product_name']}-repo-setup -U\");\n\n\t/* Update pfSense_version cache */\n\tmwexec_bg(\"/etc/rc.update_pkg_metadata now\");\n\treturn;\n}", "private static function git_origin(): ?string {\n\t\tif ( ! self::$root_path ) {\n\t\t\treturn null;\n\t\t}\n\t\t$cmd = 'git -C ' . escapeshellarg( self::$root_path ) . ' remote get-url origin';\n\t\t$response = exec( $cmd );\n\t\treturn $response ?: null;\n\t}", "function git_update_submodules($path) {\n\t$status = GitUtil::updateExternals($path);\n}", "public function pushRepository($dir, $target_project);", "public function updateRepositories() {\n $projects = $this->loadProjects();\n if (!$projects)\n return;\n\n $this->m_authors = $this->loadAuthors();\n\n foreach ($projects as $project)\n $this->updateProject($project);\n }", "public function fetch($destDir)\n {\n shell_exec('rm -rf ' . $destDir);\n shell_exec('git clone --depth=1 ' . $this->extraArgs . ' ' . $this->url . ' ' . $destDir);\n }", "public function init_repo() {\n\n\t\t\t// we don't need to maintain local repos for slim deploys\n\t\t\tif ( SLIM ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// if the repo is already initialised, we don't need to\n\t\t\tif ( is_dir( \"wpd-repos/{$this->config->repo[ 'name' ]}/.git\" ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// store the directory we're in right now, so we can come back\n\t\t\t$original_dir = getcwd();\n\n\t\t\t// switch the repo's directory\n\t\t\tchdir( \"wpd-repos/{$this->config->repo[ 'name' ]}\" );\n\n\t\t\t// initialise git\n\t\t\texec( 'git init' );\n\n\t\t\t// add the remote repo as a remote called origin\n\t\t\texec( \"git remote add origin \" . $this->config->repo[ 'git_url' ] );\n\n\t\t\t// switch back to the original directory\n\t\t\tchdir( $original_dir );\n\t\t}", "public function pull()\n {\n }", "public function git_repository()\n\t{\n\t\texec( 'cd ' . $this->theme_dir . '; git remote -v', $remotes );\n\n\t\tpreg_match( '#origin[\\s\\t][email protected]\\:([^\\.]+)#', $remotes[0], $matches );\n\n\t\t$remote = $matches[1];\n\n\t\treturn $remote;\n\t}", "function _versioncontrol_git_log_update_repository(&$repository) {\n $root = escapeshellcmd($repository['root']);\n $chdir_ok = @chdir($root); // Set working directory to root.\n if ($chdir_ok === FALSE) {\n return FALSE;\n }\n if ($repository['git_specific']['locked'] == TRUE) {\n drupal_set_message(t('This repository is locked, there is already a fetch in progress. If this is not the case, press the clear lock button.'), 'error');\n return FALSE;\n }\n db_query('UPDATE {versioncontrol_git_repositories}\n SET locked = 1 WHERE repo_id = %d', $repository['repo_id']);\n\n // Get the list of current branches from Git.\n $branch_list = _versioncontrol_git_log_get_branches();\n $add_branch_label = array(\n 'name' => '', //filled later\n 'type' => VERSIONCONTROL_OPERATION_BRANCH,\n 'action' => VERSIONCONTROL_ACTION_MODIFIED\n );\n $branches = array();\n foreach ($branch_list as $branch_name) {\n $add_branch_label['name'] = $branch_name;\n $label_ret = versioncontrol_ensure_label($repository, $add_branch_label);\n $branches[$branch_name] = $label_ret;\n }\n //jpetso and me (corni) came to the conclusion that we will not delete branches.\n // TODO: revisit this!\n // Record new commits.\n $constraints = array(\n 'vcs' => array('git'),\n 'repo_ids' => array($repository['repo_id']),\n 'types' => array(VERSIONCONTROL_OPERATION_COMMIT),\n 'branches' => array() // used in the loop\n );\n $branches_per_commit = array();\n $existing_revs = array();\n // Get the existing revisions from the cache.\n $cache_object = cache_get('versioncontrol_git_rev_cache');\n // Check wether the cache object exists or not.\n if (is_object($cache_object)) {\n $existing_revs = $cache_object->data;\n }\n // Get the list of current branches from Git.\n // Generate the range per branch with which git shall be called.\n foreach ($branches as $branch_name => $label) {\n if (is_object($cache_object)) {\n // We get all commits we have in this branch to not process them later.\n $constraints['branches'] = array($branch_name);\n $latest_commit_date = 0;\n $commit_op = versioncontrol_get_operations($constraints);\n $latest_commit = FALSE;\n foreach ($commit_op as $vc_op_id => $c_op) {\n if ($latest_commit_date < $c_op['date']) {\n $latest_commit = $c_op['revision'];\n $latest_commit_date = $c_op['date'];\n $existing_revs[$branch_name][$latest_commit] = TRUE;\n }\n }\n }\n // No way to free the damned mysql result!!\n unset($commit_op);\n\n $commits_in_branch = _versioncontrol_git_log_get_commits_in_branch($repository, escapeshellarg($branch_name));\n foreach ($commits_in_branch as $i => $commit) {\n if (!isset($existing_revs[$branch_name][$commit])) {\n if (!isset($branches_per_commit[$commit]) || !is_array($branches_per_commit[$commit])) {\n $branches_per_commit[$commit] = array($label);\n }\n else {\n $branches_per_commit[$commit][] = $label;\n }\n }\n }\n }\n // This uses an extra loop on purpose!\n // Process all commits on a per-branch base.\n foreach ($branches_per_commit as $revision => $branch) {\n // Update commits from Git.\n _versioncontrol_git_process_commits($repository, $revision, $branches_per_commit, $existing_revs);\n }\n // Check tags.\n $tags = _versioncontrol_git_log_get_tags(); //Now we have the current list of tags as array of strings.\n $constraints = array(\n 'vcs' => array('git'),\n 'repo_ids' => array($repository['repo_id']),\n 'types' => array(VERSIONCONTROL_OPERATION_TAG)\n );\n $existing_tag_ops = versioncontrol_get_operations($constraints);\n $existing_tags = array();\n foreach ($existing_tag_ops as $tag_op) {\n if (!in_array($tag_op['labels'][0]['name'], $existing_tags)) {\n $existing_tags[] = $tag_op['labels'][0]['name'];\n }\n }\n // Deleting tags is *not* supported. Read the manual if you want to know why...\n // Check for new tags.\n $new_tags = array_diff($tags, $existing_tags);\n if (!empty($new_tags)) {\n _versioncontrol_git_process_tags($repository, $new_tags);\n }\n\n // Update repository updated field. Displayed on administration interface for documentation purposes.\n $repository['git_specific']['updated'] = time();\n db_query('UPDATE {versioncontrol_git_repositories}\n SET updated = %d, locked = 0 WHERE repo_id = %d',\n $repository['git_specific']['updated'], $repository['repo_id']);\n\n // Write back the cache.\n cache_set('versioncontrol_git_rev_cache', $existing_revs);\n return TRUE;\n}", "public function executePull(){\r\n\t\t// set return array\r\n\t\t$return = array('pull_result' => '');\r\n\r\n\t\t// fetch data\r\n\t\t$jsonData = $this->getJsonData();\r\n\r\n\t\t//try executing\r\n\t\ttry {\r\n\t\t\t// check if git is still processing anything\r\n\t\t\tif ($this->isProcessing() === FALSE) {\r\n\t\t\t\t// set the process to active\r\n\t\t\t\t$this->setProcess();\r\n\r\n\t\t\t\t// execute pull command\r\n\t\t\t\t$return['pull_result'] = $this->executeCommand('cd ' . MAIN_DIR . ' && git reset --hard ' . GIT_BRANCH_REF . ' 2>&1');\r\n\r\n\t\t\t\t// handle the git result\r\n\t\t\t\t$this->handleGitResult($return);\r\n\r\n\t\t\t\t// refetch data\r\n\t\t\t\t$jsonData = $this->getJsonData();\r\n\r\n\t\t\t\t// decrement process\r\n\t\t\t\t$jsonData->status = 0;\r\n\t\t\t} else {\r\n\t\t\t\t$jsonData->status = isset($jsonData->status) ? 1 : 0;\r\n\t\t\t\t$return['pull_result'] = \"Max attempts (\" . MAX_ATTEMPTS . \") reached!\\n\";\r\n\t\t\t}\r\n\r\n\t\t\t// echo for hook window\r\n\t\t\techo \"PULL RETURN (\" . $this->attempts . \")\\n\";\r\n\t\t\techo $return['pull_result'];\r\n\r\n\t\t\t// overwrite file\r\n\t\t\t$this->overWriteFile($this->jsonFile, json_encode($jsonData));\r\n\r\n\t\t\t// renew json data from json file\r\n\t\t\t$jsonData = $this->getJsonData();\r\n\r\n\t\t\t// check jsondata\r\n\t\t\tif ($jsonData->status > 0 && $this->attempts < MAX_ATTEMPTS) {\r\n\t\t\t\t// execute again after 1 scond\r\n\t\t\t\tsleep(1);\r\n\t\t\t\t$this->attempts++;\r\n\t\t\t\t$this->executePull();\r\n\t\t\t\techo \"\\n\";\r\n\t\t\t} else if ($this->attempts >= MAX_ATTEMPTS) {\r\n\t\t\t\t$this->handleGitResult($return);\r\n\t\t\t} else {}\r\n\t\t} catch (Exception $e) {\r\n\t\t\t$jsonData->status = 0;\r\n\t\t\t$this->overWriteFile($this->jsonFile, json_encode($jsonData));\r\n\t\t}\r\n\t}", "private function importRepo( $repoName, $start = null, $cacheSize = 0 ) {\n\t\tglobal $wgCodeReviewImportBatchSize;\n\t\tstatic $adaptorReported = false;\n\n\t\t$repo = CodeRepository::newFromName( $repoName );\n\n\t\tif ( !$repo ) {\n\t\t\t$this->error( \"Invalid repo $repoName\" );\n\t\t\treturn;\n\t\t}\n\n\t\t$svn = SubversionAdaptor::newFromRepo( $repo->getPath() );\n\t\tif ( !$adaptorReported ) {\n\t\t\t$this->output( \"Using \" . get_class($svn). \" adaptor\\n\" );\n\t\t\t$adaptorReported = true;\n\t\t}\n\n\t\t$this->output( \"IMPORT FROM REPO: $repoName\\n\" );\n\t\t$lastStoredRev = $repo->getLastStoredRev();\n\t\t$this->output( \"Last stored revision: $lastStoredRev\\n\" );\n\n\t\t$chunkSize = $wgCodeReviewImportBatchSize;\n\n\t\t$startTime = microtime( true );\n\t\t$revCount = 0;\n\t\t$start = ( $start !== null ) ? intval( $start ) : $lastStoredRev + 1;\n\n\t\t/*\n\t\t * FIXME: when importing only a part of a repository, the given path\n\t\t * might not have been created with revision 1. For example, the\n\t\t * mediawiki '/trunk/phase3' got created with r1284.\n\t\t */\n\t\tif ( $start > ( $lastStoredRev + 1 ) ) {\n\t\t\t$this->error( \"Invalid starting point. r{$start} is beyond last stored revision: r\" . ($lastStoredRev + 1) );\n\t\t\treturn;\n\t\t}\n\n\t\t$this->output( \"Syncing from r$start to HEAD...\\n\" );\n\n\t\tif ( !$svn->canConnect() ) {\n\t\t\t$this->error( \"Unable to connect to repository.\" );\n\t\t\treturn;\n\t\t}\n\n\t\twhile ( true ) {\n\t\t\t$log = $svn->getLog( '', $start, $start + $chunkSize - 1 );\n\t\t\tif ( empty( $log ) ) {\n\t\t\t\t# Repo seems to give a blank when max rev is invalid, which\n\t\t\t\t# stops new revisions from being added. Try to avoid this\n\t\t\t\t# by trying less at a time from the last point.\n\t\t\t\tif ( $chunkSize <= 1 ) {\n\t\t\t\t\tbreak; // done!\n\t\t\t\t}\n\t\t\t\t$chunkSize = max( 1, floor( $chunkSize / 4 ) );\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\t$start += $chunkSize;\n\t\t\t}\n\t\t\tif ( !is_array( $log ) ) {\n\t\t\t\tvar_dump( $log ); // @TODO: cleanup :)\n\t\t\t\t$this->error( 'Log entry is not an array! See content above.', true );\n\t\t\t}\n\t\t\tforeach ( $log as $data ) {\n\t\t\t\t$revCount++;\n\t\t\t\t$delta = microtime( true ) - $startTime;\n\t\t\t\t$revSpeed = $revCount / $delta;\n\n\t\t\t\t$codeRev = CodeRevision::newFromSvn( $repo, $data );\n\t\t\t\t$codeRev->save();\n\n\t\t\t\t$this->output( sprintf( \"%d %s %s (%0.1f revs/sec)\\n\",\n\t\t\t\t\t$codeRev->getId(),\n\t\t\t\t\twfTimestamp( TS_DB, $codeRev->getTimestamp() ),\n\t\t\t\t\t$codeRev->getAuthor(),\n\t\t\t\t\t$revSpeed ) );\n\t\t\t}\n\t\t\twfWaitForSlaves( 5 );\n\t\t}\n\n\t\tif ( $cacheSize !== 0 ) {\n\t\t\t$dbw = wfGetDB( DB_MASTER );\n\t\t\t$options = array( 'ORDER BY' => 'cr_id DESC' );\n\n\t\t\tif ( $cacheSize == \"all\" ) {\n\t\t\t\t$this->output( \"Pre-caching all uncached diffs...\\n\" );\n\t\t\t} else {\n\t\t\t\tif ( $cacheSize == 1 ) {\n\t\t\t\t\t$this->output( \"Pre-caching the latest diff...\\n\" );\n\t\t\t\t} else {\n\t\t\t\t\t$this->output( \"Pre-caching the latest $cacheSize diffs...\\n\" );\n\t\t\t\t}\n\t\t\t\t$options['LIMIT'] = $cacheSize;\n\t\t\t}\n\n\t\t\t// Get all rows for this repository that don't already have a diff filled in.\n\t\t\t// This is LIMITed according to the $cacheSize setting, above, so only the\n\t\t\t// rows that we plan to pre-cache are returned.\n\t\t\t// TODO: This was optimised in order to skip rows that already have a diff,\n\t\t\t//\t\t which is mostly what is required, but there may be situations where\n\t\t\t//\t\t you want to re-calculate diffs (e.g. if $wgCodeReviewMaxDiffPaths\n\t\t\t//\t\t changes). If these situations arise we will either want to revert\n\t\t\t//\t\t this behaviour, or add a --force flag or something.\n\t\t\t$res = $dbw->select( 'code_rev', 'cr_id',\n\t\t\t\tarray( 'cr_repo_id' => $repo->getId(), 'cr_diff IS NULL OR cr_diff = \"\"' ),\n\t\t\t\t__METHOD__,\n\t\t\t\t$options\n\t\t\t);\n\t\t\tforeach ( $res as $row ) {\n\t\t\t\t$repo->getRevision( $row->cr_id );\n\t\t\t\t$diff = $repo->getDiff( $row->cr_id ); // trigger caching\n\t\t\t\t$msg = \"Diff r{$row->cr_id} \";\n\t\t\t\tif ( is_integer( $diff ) ) {\n\t\t\t\t\t$msg .= \"Skipped: \" . CodeRepository::getDiffErrorMessage( $diff );\n\t\t\t\t} else {\n\t\t\t\t\t$msg .= \"done\";\n\t\t\t\t}\n\t\t\t\t$this->output( $msg . \"\\n\" );\n\t\t\t}\n\t\t} else {\n\t\t\t$this->output( \"Pre-caching skipped.\\n\" );\n\t\t}\n\t\t$this->output( \"Done!\\n\" );\n\t}", "public function performPull($source);", "public function run()\n {\n passthru('cd ' . realpath($this->basedir) . ' && git pull origin master && curl -sS https://getcomposer.org/installer | php && php composer.phar install && git remote update && cd -');\n }", "public static function postUpdate(Event $event) {\n $composer = $event->getComposer();\n $io = $event->getIO();\n $executor = new ProcessExecutor($io);\n $command = 'git -C %s rev-parse --abbrev-ref HEAD';\n $branch_result = self::executeCommand($executor, $command, getcwd());\n $branch_name = trim($branch_result);\n $extra = $event->getComposer()->getPackage()->getExtra();\n\n if (isset($extra['drupal-env'])) { \n $drupal_env_extra = $extra['drupal-env'];\n foreach ($drupal_env_extra as $filename => $filename_mapping) {\n $file_path = self::getFilePath($event, $filename);\n if (!isset($filename_mapping[$branch_name])) {\n $io->write('<comment>DrupalEnv: no actions taken for branch '. trim($branch_name) . '</comment>');\n continue;\n }\n $source_filename = $filename_mapping[$branch_name];\n $source_filepath = self::getFilePath($event, $source_filename);\n if (!file_exists($file_path)) {\n $io->write('<error>Skipping file ' . $file_path . '. File does not exists.</error>');\n }\n else {\n if (!file_exists($source_filepath)) {\n $io->write('<error>Source file ' . $source_filename . ' does not exists. Skipping...</error>');\n }\n else {\n // Replace the destinatio file with the source file.\n if (!copy($source_filepath, $file_path)) {\n $io->write('<error>Cannot copy ' . $source_filename . ' to ' . $filepath . '</error>');\n }\n }\n }\n }\n }\n }", "function pull( $remote, $branch ) {\n return $this->_exec( \"pull {$remote} {$branch}\" );\n }", "public function refreshToken()\n {\n $client = new Client();\n\n try {\n $resp = $client->request('POST', 'https://bitbucket.org/site/oauth2/access_token', [\n 'auth' => [\n env('BITBUCKET_CLIENT_ID'),\n env('BITBUCKET_SECRET')\n ],\n 'form_params' => [\n 'grant_type' => 'refresh_token',\n \"refresh_token\" => $this->sourceProvider->refresh_token\n ]\n ]);\n\n $resp = json_decode($resp->getBody()->getContents());\n\n $this->sourceProvider->access_token = $resp->access_token;\n $this->sourceProvider->refresh_token = $resp->refresh_token;\n $this->sourceProvider->save();\n\n } catch (\\Exception $e) {\n \\Log::info($e);\n }\n }", "public function update($path, $contents, Config $config)\n {\n }", "public function update($path, $contents, Config $config)\n {\n }", "public function isCurrentBranchUpToDate() {\n\t\treturn (\n\t\t\t$current_branch = $this->getCurrentBranch()\n\t\t\t&& 0 == $this->repository->getLog('HEAD..origin/' . $this->getCurrentBranch()->getName(), /*$path=*/null, /*$limit=*/1)->count()\n\t\t);\n\t}", "function WebhookPullSubrepository(){\n \n $MagicWord=BlowfishEncrypt('Pull Subrepository From Github');\n if(\n isset($_GET[$MagicWord])\n ){\n $Path=dirname(__FILE__);\n $Path=str_replace('/core','',$Path);\n $Subrepository=BlowfishDecrypt($_GET[$MagicWord]);;\n $Path.=trim($Subrepository);\n \n echo '<p>Pulling Subrepository: '.$Path.'</p>';\n \n if(!is_dir($Path)){\n die('Path not found: '.$Path);\n }\n \n $Command = 'cd '.$Path.' && git reset --hard && git pull';\n echo '<p>'.$Command.'</p><pre>';\n echo shell_exec($Command);\n echo '</pre>';\n \n exit;\n }\n}", "function wplastfm_update($file, $src) {\r\n global $wplastfm_options;\r\n \r\n if (time()-$wplastfm_options['cache'] > @filemtime($file)) {\r\n $data = wplastfm_get_recenttracks($src);\r\n if (!empty($data)) {\r\n $handle = fopen($file, \"w\");\r\n fwrite($handle, $data);\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "public function testDestiny2PullFromPostmaster()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }", "function rclone() {\n\t\t$this->checkOnce();\n\t\t$versionPath = $this->getVersionPath();\n\t\t$paths = $this->getMain()->getPaths();\n\t\t$default = $paths['default'];\n\t\t$remoteCmd = 'cd '.$versionPath.' && hg clone '.$default .' .';\n\t\t$this->ssh_exec($remoteCmd);\n\t}", "function drush_acapi_update_file($path, $content) {\n $current = @file_get_contents($path);\n if ($current != $content) {\n file_put_contents($path, $content);\n drush_log(dt('Updated %path.', array('%path' => $path)), 'ok');\n return TRUE;\n }\n return FALSE;\n}", "protected function settleRepositoryIfNotExists()\n\t{\n\t\t$source = $this->pipelines->getSource();\n\n\t\tif( ! $this->files->exists($source))\n\t\t{\n\t\t\t$this->pipelines->settle();\n\t\t}\n\t}", "protected function pullEvent(){\n $result = shell_exec('cd '.$this->projectPath.' && git pull' );\n if($this->doctrineUpdate) {\n $result .= shell_exec('cd ' . $this->projectPath . ' && php -d bin/console doctrine:schema:update');\n }\n shell_exec('cd '.$this->projectPath.' && php -d memory_limit=1G bin/console cache:clear --env=prod');\n shell_exec('cd '.$this->projectPath.' && php -d memory_limit=1G bin/console cache:clear --env=dev');\n return $result;\n }", "function rpath($path = '') {\n\t\t$versionPath = $this->deployPath;\n\t\t$remoteCmd = 'cd '.$versionPath.' && ls -l '.$path;\n\t\t$this->ssh_exec($remoteCmd);\n\t}", "public function updateApp()\n\t{\t\t\n\t\t// Determine which branch to checkout\n\t\tif($this->instanceDev)\n\t\t{\n\t\t\t$this->branch = \"Development\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->branch = \"master\";\n\t\t}\n\n\t\t// Updated code to latest revision in repo\n\t\t$changes = shell_exec(\"git pull [email protected]:iamjoshua/scraper.git $this->branch\");\n\n\t\t// If new revision downloaded\n\t\tif(strpos($changes, \"Updating\") !== FALSE && !strpos($changes, \"error\"))\n\t\t{\n\t\t\t// Create a new bootstrap for new code\n\t\t\texec('php /home/ec2-user/scraper/router.php bootstrap &> /dev/null &');\n\n\t\t\t// Kill current bootstrap\n\t\t\texit('new code. restarting...');\n\t\t}\t\t\t\t\n\t}", "function get_last($repo) {\n $out = array();\n $date = exec(\"GIT_DIR=$repo/.git git rev-list --header --max-count=1 HEAD | grep -a committer | cut -f5-6 -d' '\", $out);\n return date(\"D n/j/y G:i\", intval($date));\n}", "private function saveUpdateRepos()\n {\n $success = false;\n\n // Get the repos from Github\n $result = $this->getPHPRepos();\n\n // If something was returned, save it\n if ($result) {\n $success = $this->saveRepos();\n }\n\n return $success;\n }", "public function fetch_from_repo($files, $post_id)\n {\n\n $inloop = -1;\n try\n {\n $post = get_post($post_id);\n $trans = 'scb_edd_repo_%1$s_' . $post_id . \"_\" . get_current_user_id();\n $meta = array();\n foreach ($files as $index => $file)\n {\n $inloop = $index;\n\n if (isset($file['repo']))\n {\n $repo_url = $this->translate_short_repo_url($file['repo'], $file['tag']);\n $ret = $this->save_remote_tag_url($file, $repo_url, $post);\n p_l($ret);\n\n $files[$index]['file'] = $ret['file'];\n $files[$index]['attachment_id'] = $ret['attachment_id'];\n $msg = 'Successfully fetched from repo:' . $file['repo'];\n $meta[$ret['attachment_id']]['url'] = $file['repo_url'];\n\n if ($this->get_setting('withhook'))\n {\n $ret_hook = $this->create_push_hook($meta[$ret['attachment_id']]['url']);\n if (!$ret_hook[0])\n {\n $msg .= \"Unable to Hook:\" . $ret_hook[1];\n $meta[$ret['attachment_id']]['hook_error'] = $ret_hook[1];\n }\n elseif (!$ret_hook[1])\n {\n $msg .= \" and hooked\";\n $meta[$ret['attachment_id']]['hook_error'] = '';\n }\n else\n {\n $msg .= \" \" . $ret_hook[1];\n $meta[$ret['attachment_id']]['hook_error'] = '';\n }\n }\n else\n {\n $msg .= \" no hook attached\";\n $meta[$ret['attachment_id']]['hook_error'] = '';\n\n }\n\n set_transient(sprintf($trans, 1), $msg, 45);\n\n }\n }\n if (count($meta))\n {\n update_post_meta($post_id, '_scb_edd_repo_url', $meta);\n }\n return $files;\n }\n catch (Exception $e)\n {\n if (isset($files[$inloop]))\n {\n $msg = \"Error while processing Repo(\" . $files[$inloop]['repo'] . \") : \" . $e->getMessage();\n }\n else\n {\n $msg = \"Unable to fetch From Repo : \" . $e->getMessage();\n }\n set_transient(sprintf($trans, 0), $msg, 45);\n\n unset($_POST['edd_download_meta_box_nonce']);\n wp_update_post(array(\"ID\" => $_REQUEST[\"post_ID\"], 'post_status' => 'draft'));\n return $files;\n\n }\n }", "public function updateSource() {\n if (!empty($this->imported)) {\n $data = $this->source->data;\n if (empty($data)) {\n $data = array();\n }\n foreach ($this->imported as $key) {\n $data[] = $key;\n }\n $this->source->data = $data;\n $this->source->last_updated = date('Y-m-d H:i:s', strtotime('now'));\n $this->source->save();\n $this->imported = array();\n }\n }", "function exn_wc_billplz_updater() {\n\tinclude_once 'updater/updater.php';\n\n\tif ( is_admin() ) { // note the use of is_admin() to double check that this is happening in the admin\n $repo = 'abdusfauzi/exn-wc-billplz';\n\n\t\t$config = array(\n\t\t\t'slug' => plugin_basename( __FILE__ ),\n\t\t\t'proper_folder_name' => 'exn-wc-billplz',\n\t\t\t'api_url' => 'https://api.github.com/repos/' . $repo,\n\t\t\t'raw_url' => 'https://raw.github.com/' . $repo . '/master',\n\t\t\t'github_url' => 'https://github.com/' . $repo,\n\t\t\t'zip_url' => 'https://github.com/' . $repo . '/archive/master.zip',\n\t\t\t'sslverify' => true,\n\t\t\t'requires' => '4.0',\n\t\t\t'tested' => '4.5.3',\n\t\t\t'readme' => 'README.md',\n\t\t\t'access_token' => '',\n\t\t);\n\n\t\tnew WP_GitHub_Updater( $config );\n\t}\n}", "public function cloneGitRepo($repo, $dir);", "public function gitClone()\n\t{\n\t\t$repoURL = 'https://github.com/' . $this->getUserName() . '/' . $this->getProjectName() . '.git';\n\t\t$path = $this->getPath();\n\t\t$this->gitWrapper->clone($repoURL, $path);\n\t}", "public function update(RepoRequest $request, Repo $repo)\n {\n $repo->fill($request->all());\n if (!$request->auto_deploy)\n {\n $repo->auto_deploy = 0;\n }\n $repo->save();\n\n return redirect()->back();\n }", "protected function composerUpdate()\n {\n $this->runCommand(['composer', 'update'], getcwd(), $this->output);\n }", "function git_clone($repo, $path, $initSubModules = false) {\n\tGitUtil::cloneRepo($repo, $path, $initSubModules);\n}", "public function testGitLabRemoteRepository(): void\n {\n $repo = new GitLabRemoteRepository('r/r', './');\n $this->assertEquals('https://gitlab.com/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "public function commitAndPush()\n {\n try {\n // Add files to git index, commit and push to client remote\n $this->git->add()->all()->execute();\n $this->git->commit()->message($this->commit_msg)->execute();\n $this->git->push()->execute($this->client_remote, $this->branch);\n } catch (GitException $e) {\n $this->logger->error('Failed to commit to Git repository. Error: '\n . $e->getMessage());\n }\n }", "private function restoreBranch() {\n $repository_api = $this->getRepositoryAPI();\n $repository_api->execxLocal(\n 'checkout %s',\n $this->oldBranch);\n if ($this->isGit) {\n $repository_api->execxLocal(\n 'submodule update --init --recursive');\n }\n echo phutil_console_format(\n \"Switched back to {$this->branchType} **%s**.\\n\",\n $this->oldBranch);\n }", "public function updateAction()\n {\n// $client = $init->getClient();\n// $init->updateFile($client);\n }", "protected function confirmCachedRepoHasCorrectRemote($emptyOk = false)\n {\n if (!file_exists($this->dir)) {\n return;\n }\n // Check to see if the remote origin is already set to our exact url\n $currentURL = exec(\"git -C {$this->dir} config --get remote.origin.url\", $output, $result);\n\n if ($currentURL == $this->url()) {\n return;\n }\n // If the API exists, try to repair the URL if the existing URL is close\n // (e.g. someone switched authentication tokens)\n if ($this->api) {\n if (($emptyOk && empty($currentURL)) || ($this->api->addTokenAuthentication($currentURL) == $this->url())) {\n static::setRemoteUrl($this->url(), $this->dir);\n return;\n }\n }\n\n // TODO: This error message is a potential credentials leak\n throw new \\Exception(\"Directory `{$this->dir}` exists and is a clone of `$currentURL` rather than `{$this->url()}`\");\n }", "function rcp($path = '.') {\n\t\t$this->setVerbose(true);\n\t\t$this->checkOnce();\n\t\t$remotePath = $this->getVersionPath();\n\t\t$pathLinux = str_replace('\\\\', '/', $path);\n\t\t$this->system('scp -r -i '.$this->id_rsa.' '.\n\t\t\tescapeshellarg($path). ' ' .\n\t\t\t$this->remoteUser.'@'.$this->liveServer.\n\t\t\t':'.$remotePath.'/'.$pathLinux);\n\t}", "public function reloadSource()\n {\n $this->sendCommand(static::RCMD_SRC_RELOAD);\n }", "function do_fetch($key,$url,$path) {\n $cmd = \"ssh-agent bash -c 'cd $path; ssh-add $key; git fetch' 2>&1\";\n _log(\"Exec command: $cmd\\n\");\n return shell_exec($cmd);\n}", "protected function pushFiles()\n {\n $branch = $this->getCurrenBranch();\n\n $dir = HOME.'/repos/'.$this->getRepoName().'/'.$branch.'/files/';\n\n if (!$this->getFilesystem()->exists($dir)) {\n $this->getFilesystem()->makeDirectory($dir);\n }\n\n foreach ($this->getAllFiles() as $file) {\n if (empty($file)) {\n continue;\n }\n\n $sourceDir = pathinfo($file, PATHINFO_DIRNAME);\n if (!$this->getFilesystem()->exists($dir.$sourceDir)) {\n $this->getFilesystem()->makeDirectory($dir.$sourceDir);\n }\n\n $source = $this->repository->getDirectory().'/'.$file;\n $this->getFilesystem()->copy($source, $dir.$file);\n }\n\n $this->sync($dir, $this->getConfig()->get('app.bucket'), $this->getRepoName().'/'.$branch.'/files');\n $this->getFilesystem()->deleteDirectory($dir);\n\n return $this->getRepoName().'/'.$branch.'/files';\n }", "function getLatestCommit() {\n global $update_type;\n $fp = fopen('./../../log.txt','a');\n fwrite($fp,\"\\nupdate type (getLatestCommit(): \".$update_type);\n fclose($fp);\n\t $context = stream_context_create(\n\t\tarray(\n\t\t \"http\" => array(\n\t\t\t\"header\" => \"User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36\"\n\t\t )\n\t\t)\n\t );\n\t $url = \"https://api.github.com/repos/tsnrp/navcon/commits/\".$update_type;\n\t $json = file_get_contents($url, false, $context);\n\t $arr = json_decode($json, true);\n\t $date = $arr[\"commit\"][\"committer\"][\"date\"];\n\t return $date;\n\t}", "public function cloneAndConfig()\n {\n if (! is_dir($this->directory)) {\n try {\n $this->git->cloneRepository()->execute($this->repo_url);\n $this->git->remote()->add(\n $this->client_remote,\n $this->client_remote_url\n )->execute();\n\n $this->git->fetch()->execute($this->client_remote);\n\n if (! file_put_contents($this->config_file,\n $this->user_config, FILE_APPEND)) {\n $this->logger->error('Can\\'t write Git config file');\n }\n } catch (GitException $e) {\n $this->logger->error('Failed to clone or config Git repository. '\n . 'Error: ' . $e->getMessage());\n }\n }\n }", "public function update(\n InstalledRepositoryInterface $repo,\n PackageInterface $initial,\n PackageInterface $target\n ) {\n parent::update($repo, $initial, $target);\n $this->pluginManager->removePlugin($initial);\n $this->pluginManager->addPlugin($target);\n $this->pluginManager->exportPlugins($this->filesystem);\n }", "public static function gitUpdate()\n {\n // The commands\n $commands = array(\n 'echo $PWD',\n 'whoami',\n 'git update-index --skip-worktree common/config/options.php',\n 'git reset --hard HEAD',\n 'git pull origin master',\n 'git status',\n 'git submodule sync',\n 'git submodule update',\n 'git submodule status',\n );\n // Run the commands for output\n $output = '';\n foreach ($commands as $command) {\n // Run it\n $tmp = shell_exec($command);\n // Output\n $output .= \"<span style=\\\"color: #6BE234;\\\">\\$</span> <span style=\\\"color: #729FCF;\\\">{$command}\\n</span>\";\n $output .= htmlentities(trim($tmp)) . \"\\n\";\n }\n return $output;\n }", "public function getRepos()\n {\n $success = true;\n\n // Check the DB to see if the repos already exist.\n $stmt = Db::$pdo->query(\"SELECT updated FROM config where item = 'lastRepoUpdate' LIMIT 1\");\n $logExists = $stmt->rowCount();\n $result = $stmt->fetch();\n\n // Use PHP time instead of MySQL so that we ensure the\n // timezone is consistent throughout the app.\n $nowDt = new \\DateTimeImmutable('now');\n $now = $nowDt->format('Y-m-d H:i:s');\n\n // If there is no log entry\n if (!$logExists) {\n\n // Update the repos\n $success = $this->saveUpdateRepos();\n if ($success) {\n // If they were saved properly,\n // insert a new entry for the time for the last repo update\n $stmt = Db::$pdo->prepare(\"INSERT INTO config\n (item, updated)\n VALUES ('lastRepoUpdate', :now )\");\n $stmt->bindParam(':now', $now);\n $stmt->execute();\n }\n\n } else { // There is a log entry\n\n // We're only going to update the repos every 15 min.\n // So lets check to see if they need to be updated.\n $lastUpdateDt = new \\DateTime($result['updated']);\n // go back 15 min\n $timeToUpdateDt = $nowDt->modify('-15 minutes');\n\n // Check to see if we need to update\n if ($lastUpdateDt < $timeToUpdateDt) {\n\n // Update the repos\n $success = $this->saveUpdateRepos();\n if ($success) {\n // If they were updated properly,\n // Update the time for the last repo update\n $stmt = Db::$pdo->prepare(\"UPDATE config\n SET updated = :now\n WHERE item = 'lastRepoUpdate' \");\n $stmt->bindParam(':now', $now);\n $stmt->execute();\n }\n }\n }\n\n // If there was a problem, return error\n if (!$success) {\n return [\n 'status' => 'error',\n 'message' => $this->error\n ];\n }\n\n // Get the total count from the db\n $stmt = Db::$pdo->prepare(\"SELECT amount FROM config\n WHERE item = 'totalRepos' LIMIT 1 \");\n $stmt->execute();\n\n $total = $stmt->fetch();\n $total = $total['amount'];\n\n\n // Get the repo info from the db\n $stmt = Db::$pdo->prepare(\"SELECT * FROM repos\");\n $stmt->execute();\n\n $items = $stmt->fetchAll();\n\n\n return [\n 'status' => 'success',\n 'total' => $total,\n 'items' => $items\n ];\n }", "public function pushConfig()\n {\n $cmds[] = 'push gitoliteorigin master';\n $this->runGitCommand($cmds);\n }", "public function update(\n InstalledRepositoryInterface $repo,\n PackageInterface $initial,\n PackageInterface $target\n ) {\n // do nothing\n $name = $target->getName();\n $this->io->write(\"\\n<comment>Skipping updating of {$name}...</comment>\\n\");\n }", "public function execute()\n {\n return $this->scm->runForCurrentRelease('rev-parse', ['--abbrev-ref','HEAD']);\n }", "public function fetch($remote = 'origin')\n\t{\n\t\t// Initialize variables.\n\t\t$out = array();\n\t\t$return = null;\n\n\t\t// Ensure that either the remote exists or is a valid URL.\n\t\tif (!filter_var($remote, FILTER_VALIDATE_URL) && !in_array($remote, $this->_getRemotes()))\n\t\t{\n\t\t\tthrow new InvalidArgumentException('No valid remote ' . $remote . ' exists.');\n\t\t}\n\n\t\t// Execute the command.\n\t\t$wd = getcwd();\n\t\tchdir($this->_root);\n\t\texec('git fetch -q ' . escapeshellarg($remote), $out, $return);\n\t\tchdir($wd);\n\n\t\t// Validate the response.\n\t\tif ($return !== 0)\n\t\t{\n\t\t\tthrow new RuntimeException(sprintf('The fetch failed from remote %s with code %d and message %s.', $remote, $return, implode(\"\\n\", $out)));\n\t\t}\n\n\t\treturn $this;\n\t}", "public function set_needed_repos(): void {}", "public function set_needed_repos(): void {}", "protected function commit($path,$target=null) {\n if(is_array($path) && is_null($target)) {\n foreach($path as $k => $v) {\n $this->commit($k,$v);\n }\n \n return;\n } elseif(!is_string($path) || !is_string($target)) {\n throw new \\InvalidArgumentException();\n }\n \n $fileStream = new \\qio\\File\\Stream($path);\n $fileReader = new \\qio\\File\\Reader($fileStream);\n if(!$fileStream->open()) {\n return;\n }\n \n $cacheData = $fileReader->readAll();\n $fileStream->close();\n\n if(!empty(trim($cacheData)))\n {\n $fileStream = new \\qio\\File\\Stream($target, \\qio\\Stream\\Mode::ReadWriteTruncate);\n $fileWriter = new \\qio\\File\\Writer($fileStream);\n if(!$fileStream->open()) {\n return;\n }\n \n $fileWriter->write($cacheData);\n $fileStream->close();\n }\n }", "public function testGitLabRemoteRepositoryExternal(): void\n {\n $repo = new GitLabRemoteRepository('r/r', './', 'https://salsa.debian.org/');\n $this->assertEquals('https://salsa.debian.org/r/r/blob/v2/src/Project.php#L30', $repo->getFileUrl('v2', 'src/Project.php', 30));\n $this->assertEquals('src/Project.php', $repo->getRelativePath('./src/Project.php'));\n $this->assertEquals('', $repo->getRelativePath('src/Project.php'));\n }", "public function Check() {\n\t\t/*\n\t\t$local = $this->getLocalVersion();\n\t\t$remote = $this->getRemoteVersion(\"check\", $local[0]['version']);\n\t\t\n\t\t$nightly = true;\n\t\t$archive = Common::getConstant('ARCHIVEURL', $this->archive);\n\t\t$latest = '';\n\t\t\n\t\tforeach ($remote as $tag) {\n\t\t\tif ($latest == '') {\n\t\t\t\t$latest = $tag[\"name\"];\n\t\t\t\t$archive = $tag[\"zipball_url\"];\n\t\t\t}\n\t\t\tif ($local[0]['version'] == $tag[\"commit\"][\"sha\"]) {\n\t\t\t\t$local[0]['version'] = $tag[\"name\"];\n\t\t\t\t$nightly = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$search = array(\"\\r\\n\", \"\\n\", \"\\r\");\n\t\t$replace = array(\" \", \" \", \" \");\n\t\t\n\t\t$message = '';\n\t\t$merge = '';\n\t\t$commits = json_decode(file_get_contents(Common::getConstant('COMMITURL', $this->commits)), true);\n\t\tforeach ($commits as $commit) {\n\t\t\tif ($local[0]['version'] != $commit[\"sha\"]) {\n\t\t\t\tif (strpos($commit[\"commit\"][\"message\"], \"Merge\") === false) {\n\t\t\t\t\t$message .= '- '.str_replace($search, $replace, $commit[\"commit\"][\"message\"]).'<br/>';\n\t\t\t\t} else {\n\t\t\t\t\t$merge .= '- '.str_replace($search, $replace, $commit[\"commit\"][\"message\"]).'<br/>';\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($message == '') {\n\t\t\t$message = $merge;\n\t\t}\n\t\t*/\n\t\t\n\t\t$archive = $this->archive;\n\t\t$current_version = self::VERSION;\n\t\t$nightly = false;\n\t\t$response = $this->getRemoteVersion(\"check\");\n\t\t\n\t\tif ( $response[\"name\"] > $current_version ) {\n\t\t\t\n\t\t\t$curl = curl_init();\n\t\t\tcurl_setopt($curl, CURLOPT_URL, $this->update_file);\n\t\t\t//curl_setopt($curl, CURLOPT_POSTFIELDS, \"\");\n\t\t\tcurl_setopt($curl, CURLOPT_HEADER, 0);\n\t\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\t\t\tcurl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); \n\t\t\tcurl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);\n\t\t\tcurl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13');\n\t\t\t$content = curl_exec($curl);\n\t\t\tcurl_close($curl);\n\t\t\t\n\t\t\tunlink( \"./update.php\" );\n\t\t\tfile_put_contents( \"./update.php\", $content );\n\t\t}\n\t\t\n\t\t\n\t\t//echo var_dump( $response );\n\t\t//return \"[\".formatJSEND(\"success\", array(\"currentversion\"=>$local[0]['version'],\"remoteversion\"=>$latest,\"message\"=>$message,\"archive\"=>$archive,\"nightly\"=>$nightly,\"name\"=>$local[0]['name'])).\"]\";\n\t\treturn \"[\".formatJSEND(\"success\", array(\"currentversion\"=>$current_version,\"remoteversion\"=>$response[\"name\"],\"message\"=>$response[\"message\"],\"archive\"=>$archive,\"nightly\"=>$nightly,\"name\"=>$response[\"commit\"][\"author_name\"])).\"]\";\n\t}", "protected function last_change() \n\t{\n\t\tif ( !is_null( $this->last_change ) )\n\t\t{\n\t\t\treturn $this->last_change;\n\t\t}\n\t\t\n\t\tforeach( $this->sources as $key => $file ) \n\t\t{\n\t\t\t$files[$key] = filemtime( $file );\n\t\t}\n\n\t\tsort( $files ); $files = array_reverse( $files );\n\n\t\treturn $this->last_change = $files[key($files)];\n\t}", "public function symlinkLatestBackup($path);", "public function load_repository(&$repo, $name) {\n // First determine if the class file exisits\n $path = @$repo['path'];\n $conf = array();\n\n if (file_exists($path . '/settings.php')) {\n // Override with repository specific data\n include($path . '/settings.php');\n }\n\n $repo = array_merge($conf, $repo);\n if (!isset($repos['data'])||!is_object($repo['data'])) $repo['data'] = $this->load_provider($repo, $path, $name);\n\n }", "private function getFileSha($path) {\n try {\n // Get SHA of default branch.\n if ($sha = $this->getSha($this->getDefaultBranch())) {\n // Get file SHA.\n $result = $this\n ->getClient()\n ->api('repo')\n ->contents()\n ->show($this->getRepoUser(), $this->getRepoName(), $path, $sha);\n\n return $result['sha'];\n }\n } catch (\\GitLab\\Exception\\RuntimeException $e) {\n throw new \\Exception($e->getMessage());\n }\n }", "abstract public function getRemoteFile($path, $ref = 'master');", "public function set_repo_path($repo_path, $create_new = false, $_init = true) {\n\t\t\tif (is_string($repo_path)) {\n\t\t\t\tif ($new_path = realpath($repo_path)) {\n\t\t\t\t\t$repo_path = $new_path;\n\t\t\t\t\tif (is_dir($repo_path)) {\n\t\t\t\t\t\t// Is this a work tree?\n\t\t\t\t\t\tif (file_exists($repo_path.\"/.git\") && is_dir($repo_path.\"/.git\")) {\n\t\t\t\t\t\t\t$this->repo_path = $repo_path;\n\t\t\t\t\t\t\t$this->bare = false;\n\n\t\t\t\t\t\t\tif (!is_writable($repo_path.\"/.git\")) {\n\t\t\t\t\t\t\t\t$user_info = posix_getpwuid(fileowner($repo_path.\"/.git\"));\n\t\t\t\t\t\t\t\t$file_owner = $user_info['name'];\n\t\t\t\t\t\t\t\t$this->command_prefix = 'sudo -u '.$file_owner.' ';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Is this a bare repo?\n\t\t\t\t\t\t} else if (is_file($repo_path.\"/config\")) {\n\t\t\t\t\t\t\t$parse_ini = parse_ini_file($repo_path.\"/config\");\n\t\t\t\t\t\t\tif ($parse_ini['bare']) {\n\t\t\t\t\t\t\t\t$this->repo_path = $repo_path;\n\t\t\t\t\t\t\t\t$this->bare = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif ($create_new) {\n\t\t\t\t\t\t\t\t$this->repo_path = $repo_path;\n\t\t\t\t\t\t\t\tif ($_init) {\n\t\t\t\t\t\t\t\t\t$this->run('init');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthrow new Exception('\"'.$repo_path.'\" is not a git repository');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception('\"'.$repo_path.'\" is not a directory');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ($create_new) {\n\t\t\t\t\t\tif ($parent = realpath(dirname($repo_path))) {\n\t\t\t\t\t\t\tmkdir($repo_path);\n\t\t\t\t\t\t\t$this->repo_path = $repo_path;\n\t\t\t\t\t\t\tif ($_init) $this->run('init');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthrow new Exception('cannot create repository in non-existent directory');\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Exception('\"'.$repo_path.'\" does not exist');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function set_path() {\n\t\t\t\n\t\t\t// pick up the path types\n\t\t\t$path_types = include_once(CONFIGPATH . 'path-types.php' );\n\n\t\t\t// get the base path for the deploy type\n\t\t\t$base_path = $path_types[ $this->repo[ 'type' ] ];\n\n\t\t\t// check if it is a valid path\n\t\t\t$this->is_path_valid( $base_path );\n\n\t\t\t// append the repositories name to get the final deploy path\n\t\t\t$this->repo[ 'path' ] = $base_path . '/' . $this->repo[ 'name' ];\n\t\t}", "public function update()\n\t{\n\t\t$parent = $this->projectService->getProject($this->projectid);\n\t\t$otherParent = null;\n\t\t// load the current state\n\t\t$current = $this->dbService->getById($this->id, 'Feature');\n\t\tif ($current->projectid != $this->projectid) {\n\t\t\t$otherParent = $this->projectService->getProject($current->projectid);\n\t\t}\n\t\t// $mostRecent = $this->versioningService->getMostRecentVersion($this);\n\t\tif ($this->isChanged(array('estimated', 'title', 'description', 'milestone', 'projectid'), $current)) {\n\t\t\tif ($otherParent) {\n\t\t\t\t$this->versioningService->createVersion($otherParent, 'featureupdate');\n\t\t\t}\n\n\t\t\tif ($parent) {\n\t\t\t\t$this->versioningService->createVersion($parent, 'featureupdate');\n\t\t\t}\n\n\t\t\t$this->versioningService->createVersion($current);\n\t\t}\n\t}" ]
[ "0.603045", "0.6028529", "0.5827696", "0.5796254", "0.5778401", "0.5763131", "0.5744453", "0.5693124", "0.5639715", "0.5480545", "0.54128385", "0.53621596", "0.52215326", "0.52076477", "0.5189084", "0.5146988", "0.51326084", "0.5106173", "0.5095776", "0.50299835", "0.49656415", "0.48911536", "0.48876703", "0.48853055", "0.48565218", "0.48556492", "0.4847602", "0.4829154", "0.4800721", "0.47790748", "0.4756784", "0.47471026", "0.47410458", "0.4728757", "0.47203398", "0.46747887", "0.46394148", "0.45993856", "0.45819867", "0.45757285", "0.4536974", "0.4534997", "0.4533283", "0.45288438", "0.44976628", "0.44807604", "0.4467694", "0.44524348", "0.44524348", "0.44415948", "0.44289118", "0.4428026", "0.44171554", "0.44085377", "0.43765023", "0.4373481", "0.4372713", "0.4371987", "0.43705067", "0.43527505", "0.4345585", "0.43391407", "0.4337231", "0.43348882", "0.43163344", "0.42993474", "0.42989612", "0.42871353", "0.42773163", "0.42756212", "0.42474562", "0.42461947", "0.42313617", "0.42298666", "0.42259812", "0.4218619", "0.42165846", "0.42100337", "0.42078272", "0.42046002", "0.42022732", "0.42021677", "0.4190976", "0.41903862", "0.41885453", "0.41872156", "0.41852954", "0.4182966", "0.4182966", "0.41813806", "0.41666538", "0.41566813", "0.4150766", "0.4141889", "0.41403502", "0.413057", "0.4115886", "0.4111161", "0.40983823", "0.40962493" ]
0.62043124
0
Update the specified git repo's submodule's.
function git_update_submodules($path) { $status = GitUtil::updateExternals($path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gitUpdate()\n{\n \n $config = json_decode(file_get_contents(\"/app/config.json\"), true);\n\n $git = $config['git'];\n $remote = \"https://\" . $git['user'] . \":\" . $git['token'] . \"@github.com/\" . $git['git_dir'];\n exec(\"cd \" . $config['project_dir'] . \" && git init && git pull $remote \" . $git['branch']);\n exec(\"cd \" . $config['project_dir'] . \" && composer update\");\n}", "protected function utilGitPull()\n {\n foreach (File::directories(plugins_path()) as $authorDir) {\n foreach (File::directories($authorDir) as $pluginDir) {\n if (!File::isDirectory($pluginDir.'/.git')) {\n continue;\n }\n\n $exec = 'cd ' . $pluginDir . ' && ';\n $exec .= 'git pull 2>&1';\n echo 'Updating plugin: '. basename(dirname($pluginDir)) .'.'. basename($pluginDir) . PHP_EOL;\n echo shell_exec($exec);\n }\n }\n\n foreach (File::directories(themes_path()) as $themeDir) {\n if (!File::isDirectory($themeDir.'/.git')) {\n continue;\n }\n\n $exec = 'cd ' . $themeDir . ' && ';\n $exec .= 'git pull 2>&1';\n echo 'Updating theme: '. basename($themeDir) . PHP_EOL;\n echo shell_exec($exec);\n }\n }", "public function updateRepositories() {\n $projects = $this->loadProjects();\n if (!$projects)\n return;\n\n $this->m_authors = $this->loadAuthors();\n\n foreach ($projects as $project)\n $this->updateProject($project);\n }", "public function update(Request $request, $id)\n {\n $user = $this->check_user->getUserAuthenticated($request->token);\n \n $checkRole = $user->verifyRoleAuthorization($user->id);\n $checkPermission = $user->verifyPermissionAuthorization('submodule_update', ['self', 'all']);\n\n if (!$checkRole || !$checkPermission) {\n return response()->json(['message' => __('messages.no_permission'), 'status' => 'error'], 401);\n }\n\n try {\n\t\t $dataSubmodule = [\n 'name' => $request->name,\n 'description' => $request->description,\n 'id' => $request->module\n ];\n\t\t $validated = $this->validator($dataSubmodule);\n\n\t \tif ($validated->fails()) {\n $errors = $this->parseErrors($validated->errors());\n\t \t\treturn response()->json(['message' => $errors, 'status' => 'error'], 400);\n\t \t}\n\n\t\t\t$input = $dataSubmodule; \n\t \t$submodule = $this->submodules->find($id);\n\n if (!$submodule) {\n\t \t\treturn response()->json(['message' => __('messages.submodule_not_found'), 'status' => 'error'], 404);\n }\n \n $submodule->fill($input); \n \n $module = Module::find($request->module);\n $submodule->module()->dissociate();\n $submodule->module()->associate($module);\n $submodule->save();\n\t\t\tstoreLogActivity('submodule_update', $user->id);\n \treturn response()->json(['message' => __('messages.submodule_update_success'), 'status' => 'success'], 200); \n\n \t} catch (Exception $e) {\n return response()->json(['message' => __('messages.submodule_update_error'), 'status' => 'error']);\n \t}\n }", "public static function updateExternals($path) {\n\t\tif (!file_exists($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path does not exist.\");\n\t\t}\n\n\t\tif (!is_dir($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path is not a directory.\");\n\t\t}\n\n\t\tif (!self::isRepo($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path is not a git repository.\");\n\t\t}\n\n\t\t$origCwd = getcwd();\n\t\tchdir($path);\n\n\t\t$updateCmd = sprintf(self::UPDATE_SUBMODULES_CMD);\n\t\tpassthru($updateCmd);\n\n\t\tchdir($origCwd);\n\t}", "function git_update($path) {\n\t$status = GitUtil::update($path);\n}", "function git_init_submodules($path) {\n\tGitUtil::initSubmodules($path);\n}", "private function update_modules()\n\t{\n\t\tee()->db->select('module_name, module_version');\n\t\t$query = ee()->db->get('modules');\n\n\t\tforeach ($query->result() as $row)\n\t\t{\n\t\t\t$module = strtolower($row->module_name);\n\n\t\t\t// Only update first-party modules\n\t\t\tif ( ! in_array($module, $this->native_modules))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Send version to update class and let it do any required work\n\t\t\tif (in_array($module, $this->native_modules))\n\t\t\t{\n\t\t\t\t$path = EE_APPPATH.'/modules/'.$module.'/';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$path = PATH_THIRD.$module.'/';\n\t\t\t}\n\n\t\t\tif (file_exists($path.'upd.'.$module.'.php'))\n\t\t\t{\n\t\t\t\t$this->load->add_package_path($path);\n\n\t\t\t\t$class = ucfirst($module).'_upd';\n\n\t\t\t\tif ( ! class_exists($class))\n\t\t\t\t{\n\t\t\t\t\trequire $path.'upd.'.$module.'.php';\n\t\t\t\t}\n\n\t\t\t\t$UPD = new $class;\n\t\t\t\t$UPD->_ee_path = EE_APPPATH;\n\n\t\t\t\tif ($UPD->version > $row->module_version && method_exists($UPD, 'update') && $UPD->update($row->module_version) !== FALSE)\n\t\t\t\t{\n\t\t\t\t\tee()->db->update('modules', array('module_version' => $UPD->version), array('module_name' => ucfirst($module)));\n\t\t\t\t}\n\n\t\t\t\t$this->load->remove_package_path($path);\n\t\t\t}\n\t\t}\n\t}", "public static function gitUpdate()\n {\n // The commands\n $commands = array(\n 'echo $PWD',\n 'whoami',\n 'git update-index --skip-worktree common/config/options.php',\n 'git reset --hard HEAD',\n 'git pull origin master',\n 'git status',\n 'git submodule sync',\n 'git submodule update',\n 'git submodule status',\n );\n // Run the commands for output\n $output = '';\n foreach ($commands as $command) {\n // Run it\n $tmp = shell_exec($command);\n // Output\n $output .= \"<span style=\\\"color: #6BE234;\\\">\\$</span> <span style=\\\"color: #729FCF;\\\">{$command}\\n</span>\";\n $output .= htmlentities(trim($tmp)) . \"\\n\";\n }\n return $output;\n }", "function update() {\n\t\t$CLI_url = escapeshellarg($this->URL);\n\n\t\t// Update LatestRev\n\t\tif($this->NeedsLatestRev) {\n\t\t\t$retVal = 0;\n\t\t\t$output = array();\n\t\t\texec(\"unset DYLD_LIBRARY_PATH && svn info --xml $CLI_url &> /dev/stdout\", $output, $retVal);\n\t\t\tif($retVal == 0 && preg_match(\"/\\<\\?xml/\", $output[0])) {\n\t\t\t\ttry {\n\t\t\t\t\t$info = new SimpleXMLElement(implode(\"\\n\", $output));\n\t\t\t\t\tif($info->entry->commit['revision']) {\n\t\t\t\t\t\t$this->LatestRevPacked = (string)$info->entry->commit['revision'];\n\t\t\t\t\t\t$this->LatestDatePacked = (string)$info->entry->commit->date;\n\t\t\t\t\t}\n\t\t\t\t} catch(Exception $e) {\n\t\t\t\t\tuser_error($e, E_USER_WARNING);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tuser_error(\"svn info failed \". $output, E_USER_WARNING);\n\t\t\t}\n\t\t}\n\n\t\t// Update ChildDirs\n\t\tif($this->NeedsChildDirs) {\n\t\t\t$retVal = 0;\n\t\t\t$output = array();\n\n\t\t\texec(\"unset DYLD_LIBRARY_PATH && svn ls --xml $CLI_url\", $output, $retVal);\n\t\t\tif($retVal == 0) {\n\t\t\t\t$subdirs = new SimpleXMLElement(implode(\"\\n\", $output));\n\t\t\t\t\n\t\t\t\tif($subdirs) {\n\t\t\t\t\t$subdirInfo = array();\n\t\t\t\t\tforeach($subdirs->xpath('//entry') as $entry) {\n\t\t\t\t\t\t$name = (string)$entry->name;\n\t\t\t\t\t\t$date = (string)$entry->commit->date;\n\t\t\t\t\t\t$rev = (string)$entry->commit['revision'];\n\t\t\t\t\t\n\t\t\t\t\t\t$subdirInfo[$name] = array('date' => $date, 'rev' => $rev);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this->ChildDirsPacked = serialize($subdirInfo);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tuser_error(\"svn info failed \". $output, E_USER_WARNING);\n\t\t\t}\n\t\t}\n\n\t\t$this->write();\n\t\t\n\t}", "function testUpdatePackageTree() {\n\t\t$packages = array('cake', 'model', 'datasource', 'dbo');\n\t\t$result = (bool) $this->ApiPackage->updatePackageTree($packages);\n\t\t$this->assertTrue($result);\n\n\t\t$result = $this->ApiPackage->findAllByParentId(4);\n\t\t$this->assertEqual(count($result), 2);\n\n\t\t$packages = array('cake', 'model', 'datasource', 'dbo');\n\t\t$result = (bool) $this->ApiPackage->updatePackageTree($packages);\n\t\t$this->assertTrue($result);\n\n\t\t$result = $this->ApiPackage->findAllBySlug('model');\n\t\t$this->assertEqual(count($result), 1, 'Too many model slugs');\n\t}", "function rupdate() {\n\t\t$this->checkOnce();\n\t\t$deployPath = $this->getVersionPath();\n\t\t$branch = $this->branch ?: 'default';\n\t\t$remoteCmd = 'cd '.$deployPath.' && hg update -r '.$branch;\n\t\t$this->ssh_exec($remoteCmd);\n\t}", "public function modules($like=array(),$options=array()){\n\t\t$action = array_shift($like);\n\t\tif(isset($options['server'])){\n\t\t\t$server = $options['server'];\n\t\t}else{\n\t\t\t$server = 'nthalk.com';\n\t\t}\n\t\tif($action == 'uninstall'){\n\t\t\t$module = array_shift($like);\n\t\t\t$module_dir = Framework::moduleInstalled($module);\n\t\t\tif(!$module_dir){\n\t\t\t\t$this->write(\"Module does not appear to be installed: $module\\n\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$this->write(\"Uninstalling: $module\\n\");\n\t\t\t\n\t\t\t$this->write(\"Running uninstall scripts...\\n\");\n\t\t\tif(method_exists($module,'uninstall')){\n\t\t\t\tif(!call_user_func(array($module,'uninstall'))||isset($options['force'])){\n\t\t\t\t\t$this->write(\"Uninstaller failed... Please inspect $module::uninstall() before completely removing or supply --force\\n\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->write(\"Removing submodule from app/.git cache...\\n\");\n\t\t\t$cmd = 'git rm --cached ' . $module_dir;\n\t\t\t//$this->write($cmd . \"\\n\");\n\t\t\t$cmd_p = popen($cmd,'r');\n\t\t\t$this->write(fread($cmd_p,10000). \"\\n\");\n\t\t\t\n\t\t\t$dir = SERVER_APP_DIR;\n\t\t\t$git_submodules_file = $dir .'/.gitmodules';\n\t\t\tif(file_exists($git_submodules_file)){\n\t\t\t\t$git_submodules = file_get_contents($git_submodules_file);\n\t\t\t\t$match = \"/\\[submodule.*$module\\\"\\]\\s+path.*\\s+url.*\\s?/\";\n\t\t\t\tif(preg_match($match,$git_submodules)){\n\t\t\t\t\t$git_submodules_new = preg_replace($match,'',$git_submodules);\n\t\t\t\t\t$git_submodules_new = preg_replace(\"/\\n+/\",\"\\n\",$git_submodules_new );\n\t\t\t\t\t$this->write(\"Removing submodule from submodules...\\n\");\n\t\t\t\t\t//$this->write($git_submodules_new . \"\\n\");\n\t\t\t\t\tfile_put_contents($git_submodules_file,$git_submodules_new);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$git_conf_file = $dir . '/.git/config';\n\t\t\tif(file_exists($git_conf_file)){\n\t\t\t\t$git_conf = file_get_contents($git_conf_file);\n\t\t\t\t$match = \"/\\[submodule.*$module\\\"\\](\\s+path.*|\\s+url.*)+?\\s?/\";\n\t\t\t\tif(preg_match($match,$git_conf)){\n\t\t\t\t\t$git_conf_new = preg_replace($match,'',$git_conf);\n\t\t\t\t\t$git_conf_new = preg_replace(\"/\\n+/\",\"\\n\",$git_conf_new);\n\t\t\t\t\t$this->write(\"Removing submodule from config...\\n\");\n\t\t\t\t\t//$this->write($git_conf_new . \"\\n\");\n\t\t\t\t\tfile_put_contents($git_conf_file,$git_conf_new);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->write(\"Removing submodule from file system...\\n\");\n\t\t\t$cmd = 'rm -rf ' . $module_dir;\n\t\t\t//$this->write($cmd . \"\\n\");\n\t\t\t$cmd_p = popen($cmd,'r');\n\t\t\t$this->write(fread($cmd_p,10000). \"\\n\");\n\t\t\t\n\t\t\t$this->write(\"Done. It is up to you to commit this change into your app repo...\\n\");\n\t\t\t\n\t\t}else if($action == 'list'){\n\t\t\t$this->write(\"Currently installed modules:\\n\\n\");\n\t\t\tforeach(Framework::moduleList(array_shift($like)) as $module){\n\t\t\t\t$this->write(\n\t\t\t\t\t' ' . $module . ' -' .$this->getDocumentation(new ReflectionClass($module))\n\t\t\t\t);\n\t\t\t}\n\t\t\t$this->write(\"\\n\");\n\t\t}else if($action =='list-remote'){\n\t\t\t$content = file_get_contents(\"http://$server/Packages\");\n\t\t\t$packages = json_decode($content);\n\t\t\tif(!is_array($packages)){\n\t\t\t\t$this->write('Error retrieving data from module server: '.$server.\"\\n\");\n\t\t\t}else{\n\t\t\t\tforeach($packages as $package){\n\t\t\t\t\t$this->write($package->name . \" - \" . $package->version . \"\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t}else if($action =='install'){\n\t\t\tif(realpath(getcwd()) !== SERVER_APP_DIR){\n\t\t\t\t$this->write(\"fatal: You must install modules from the root of your app dir ( \".SERVER_APP_DIR.\" )\\n\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t$content = file_get_contents(\"http://$server/Packages\");\n\t\t\t$packages = json_decode($content);\n\t\t\tif(!is_array($packages)){\n\t\t\t\t$this->write('Error retrieving data from module server: '.$server.\"\\n\");\n\t\t\t\texit -1;\n\t\t\t}else{\n\t\t\t\t$what = array_shift($like);\n\t\t\t}\n\t\t\tforeach($packages as $package){\n\t\t\t\tif($package->name == $what){\n\t\t\t\t\t// Define the dir\n\t\t\t\t\t$dir = SERVER_EXT_DIR;\n\t\t\t\t\tif(!file_exists($dir)){\n\t\t\t\t\t\t$dir_parts = explode('/',$dir);\n\t\t\t\t\t\t$curr_dir = '';\n\t\t\t\t\t\tdo{\n\t\t\t\t\t\t\t$curr_dir .= '/' . array_shift($dir_parts);\n\t\t\t\t\t\t\tif(!file_exists($curr_dir)){\n\t\t\t\t\t\t\t\tmkdir($curr_dir);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}while(!file_exists($dir));\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// If app is git repo\n\t\t\t\t\t$app_is_git = file_exists(SERVER_APP_DIR.'/.git');\n\t\t\t\t\t// Install directory\n\t\t\t\t\t$dir .= '/modules/';\n\t\t\t\t\tif(!file_exists($dir)){\n\t\t\t\t\t\tmkdir($dir);\n\t\t\t\t\t}\n\t\t\t\t\t$dir .= $package->name;\n\t\t\t\t\t$dir = substr($dir,strlen(SERVER_APP_DIR)+1);\n\t\t\t\t\tif(isset($options['as-git-submodule'])){\n\t\t\t\t\t\tif(!$app_is_git){\n\t\t\t\t\t\t\t$this->write('fatal: app is not a git repo. Please run `git init` within '.SERVER_APP_DIR.\"\\n\");\n\t\t\t\t\t\t\texit -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$cmd = 'git submodule add ' . $package->git_url . ' ' .$dir;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$cmd = 'git clone --depth 0 ' . $package->git_url . ' ' . $dir;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this->write(\"Retrieving package $what...\\t\");\n\t\t\t\t\t$this->write(\"\\ncmd: $cmd\\n\");\n\t\t\t\t\t\n\t\t\t\t\tif(shell_exec($cmd)){\n\t\t\t\t\t\tif(!isset($options['as-git-repo'])&&!isset($options['as-git-submodule'])){\n\t\t\t\t\t\t\tif (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') {\n\t\t\t\t\t\t exec( \"rd /s $dir/.git\" );\n\t\t\t\t\t\t }else{\n\t\t\t\t\t\t \tif(!$app_is_git){\n\t\t\t\t\t\t\t\t\t$this->write('warning: app is not a git repo. Installing modules this way may pollute the framework and prevent you from having your application as a standalone repository. Please run `git init` within app to avoid this warning.'.\"\\n\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t exec( \"rm -rf $dir/.git\" );\n\t\t\t\t\t\t }\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->write(\"[Success]\\n\");\n\t\t\t\t\t\t\n\t\t\t\t\t\t// If the module has a configuration function, run that on install\n\t\t\t\t\t\tif(method_exists($what,'setup')){\n\t\t\t\t\t\t\tcall_user_func_array(array($what,'setup'),array($this->out_stream,$this->in_stream));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->write(\"Package installed!\\n\");\n\t\t\t\t\t\texit;\n\t\t\t\t\t}else{\n\t\t\t\t\t\texit -1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$this->write('Package: ' . json_encode($what) . ' not found.' . \"\\n\");\n\t\t}else{\n\t\t\t$this->write(\"Usage: nth action [ARGS] [[--option=setting]]\\n\\n\");\n\t\t\t$this->write($this->getDocumentation(new ReflectionMethod($this,__FUNCTION__),true));\n\t\t}\n\t}", "public function gitCloneRepositories() {\n\t\t$count = 0;\n\n\t\t$packages = $this->Package->find('list');\n\t\tforeach ($packages as $id => $name) {\n\t\t\t$this->out(sprintf(__(\"* Downloading package %s\"), $name));\n\t\t\tif ($this->Package->setupRepository($id)); {\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\t\t$this->out(sprintf(__('* Downloaded %s of %s repositories'), $count, count($packages)));\n\t}", "public function update() {\n\t\t$webhook_secret = $this->config->item ( 'github_webhook_secret' );\n\t\t$client_id = $this->config->item ( 'github_client_id' );\n\t\t$client_secret = $this->config->item ( 'github_client_secret' );\n\t\t\n\t\tif (! isset ( $_SERVER ['HTTP_X_HUB_SIGNATURE'] )) {\n\t\t\tthrow new \\Exception ( \"HTTP header 'X-Hub-Signature' is missing.\" );\n\t\t} elseif (! extension_loaded ( 'hash' )) {\n\t\t\tthrow new \\Exception ( \"Missing 'hash' extension to check the secret code validity.\" );\n\t\t}\n\t\t\n\t\tlist ( $algo, $hash ) = explode ( '=', $_SERVER ['HTTP_X_HUB_SIGNATURE'], 2 ) + array (\n\t\t\t\t'',\n\t\t\t\t'' \n\t\t);\n\t\tif (! in_array ( $algo, hash_algos (), TRUE )) {\n\t\t\tthrow new \\Exception ( \"Hash algorithm '$algo' is not supported.\" );\n\t\t}\n\t\t$rawPost = file_get_contents ( 'php://input' );\n\t\tif ($hash !== hash_hmac ( $algo, $rawPost, $webhook_secret )) {\n\t\t\tthrow new \\Exception ( 'Hook secret does not match.' );\n\t\t}\n\t\t\n\t\t$url = \"https://api.github.com/users/UoLCompSoc/repos?per_page=10&client_id=\" . $client_id . \"&client_secret=\" . $client_secret;\n\t\t\n\t\t$decoded = json_decode ( $this->_getContent ( $url ) );\n\t\t\n\t\t$github_data = array ();\n\t\t\n\t\tforeach ( $decoded as $repo ) {\n\t\t\tif ($repo->fork === TRUE) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$collaborators = json_decode ( $this->_getContent ( $repo->contributors_url ) );\n\t\t\t$repo->collaborator_count = sizeof ( $collaborators );\n\t\t\t\n\t\t\tarray_push ( $github_data, $repo );\n\t\t}\n\t\t\n\t\t$filepath = APPPATH . 'cache/repocache.json';\n\t\t\n\t\tif (! write_file ( $filepath, json_encode ( $github_data ), 'w' )) {\n\t\t\tlog_message ( 'error', 'Cannot write to github cache file at ' . $filepath );\n\t\t}\n\t\t\n\t\t// $this->load->view ( 'admin' );\n\t}", "public function updateCommand() {\n\t\t$this->browser->setRequestEngine($this->browserRequestEngine);\n\t\t$flowPackages = array();\n\n\t\tforeach ($this->repositories as $baseUrl => $repository) {\n\t\t\t$domain = parse_url($repository, PHP_URL_HOST);\n\t\t\t#$baseUrl = dirname($repository) . '/';\n\t\t\t$basePath = FLOW_PATH_DATA . 'Packages/' . $domain;\n\n\t\t\tif (!is_dir(FLOW_PATH_DATA . 'Packages/')) {\n\t\t\t\tmkdir(FLOW_PATH_DATA . 'Packages/');\n\t\t\t}\n\n\t\t\tif (!is_dir(FLOW_PATH_DATA . 'Packages/' . $domain)) {\n\t\t\t\tmkdir(FLOW_PATH_DATA . 'Packages/' . $domain);\n\t\t\t}\n\n\t\t\t$response = $this->browser->request($repository);\n\t\t\t$packagesFile = $basePath . '/packages.json';\n\t\t\tfile_put_contents($packagesFile, $response->getContent());\n\t\t\t$packageList = json_decode($response->getContent());\n\n\t\t\tif (isset($packageList->includes)) {\n\t\t\t\t$includes = get_object_vars($packageList->includes);\n\t\t\t\tif (!empty($includes)) {\n\t\t\t\t\tforeach ($includes as $file => $meta) {\n\t\t\t\t\t\t$packagesFile = $basePath . '/' . $file;\n\t\t\t\t\t\tif (file_exists($packagesFile) && sha1_file($packagesFile) == $meta->sha1) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!is_dir(dirname(($packagesFile)))) {\n\t\t\t\t\t\t\t\\TYPO3\\Flow\\Utility\\Files::createDirectoryRecursively(dirname($packagesFile));\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t$response = $this->browser->request($baseUrl . $file);\n\t\t\t\t\t\t\tfile_put_contents($packagesFile, $response->getContent());\n\t\t\t\t\t\t} catch(\\Exception $e) {\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($packageList->providers)) {\n\t\t\t\t$providers = get_object_vars($packageList->providers);\n\t\t\t\tif (!empty($providers)) {\n\t\t\t\t\tforeach ($providers as $file => $meta) {\n\t\t\t\t\t\t$packagesFile = $basePath . '/' . $file;\n\t\t\t\t\t\tif (file_exists($packagesFile) && sha1_file($packagesFile) == $meta->sha1) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!is_dir(dirname(($packagesFile)))) {\n\t\t\t\t\t\t\t\\TYPO3\\Flow\\Utility\\Files::createDirectoryRecursively(dirname($packagesFile));\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t$response = $this->browser->request($baseUrl . $file);\n\t\t\t\t\t\t\tfile_put_contents($packagesFile, $response->getContent());\n\t\t\t\t\t\t} catch(\\Exception $e) {\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$files = \\TYPO3\\Flow\\Utility\\Files::readDirectoryRecursively($basePath, '.json');\n\t\t\tforeach ($files as $file) {\n\t\t\t\t$packagesObject = json_decode(file_get_contents($file));\n\t\t\t\t$flowPackages = array_merge($flowPackages, $this->filterFlowPackages($packagesObject->packages));\n\t\t\t}\n\t\t}\n\t\t$flowPackagesFile = FLOW_PATH_DATA . 'Packages/packages-typo3-flow.json';\n\t\tfile_put_contents($flowPackagesFile, json_encode($flowPackages));\n\t\t$this->checkForNewPackages($flowPackages);\n\t}", "function _versioncontrol_git_log_update_repository(&$repository) {\n $root = escapeshellcmd($repository['root']);\n $chdir_ok = @chdir($root); // Set working directory to root.\n if ($chdir_ok === FALSE) {\n return FALSE;\n }\n if ($repository['git_specific']['locked'] == TRUE) {\n drupal_set_message(t('This repository is locked, there is already a fetch in progress. If this is not the case, press the clear lock button.'), 'error');\n return FALSE;\n }\n db_query('UPDATE {versioncontrol_git_repositories}\n SET locked = 1 WHERE repo_id = %d', $repository['repo_id']);\n\n // Get the list of current branches from Git.\n $branch_list = _versioncontrol_git_log_get_branches();\n $add_branch_label = array(\n 'name' => '', //filled later\n 'type' => VERSIONCONTROL_OPERATION_BRANCH,\n 'action' => VERSIONCONTROL_ACTION_MODIFIED\n );\n $branches = array();\n foreach ($branch_list as $branch_name) {\n $add_branch_label['name'] = $branch_name;\n $label_ret = versioncontrol_ensure_label($repository, $add_branch_label);\n $branches[$branch_name] = $label_ret;\n }\n //jpetso and me (corni) came to the conclusion that we will not delete branches.\n // TODO: revisit this!\n // Record new commits.\n $constraints = array(\n 'vcs' => array('git'),\n 'repo_ids' => array($repository['repo_id']),\n 'types' => array(VERSIONCONTROL_OPERATION_COMMIT),\n 'branches' => array() // used in the loop\n );\n $branches_per_commit = array();\n $existing_revs = array();\n // Get the existing revisions from the cache.\n $cache_object = cache_get('versioncontrol_git_rev_cache');\n // Check wether the cache object exists or not.\n if (is_object($cache_object)) {\n $existing_revs = $cache_object->data;\n }\n // Get the list of current branches from Git.\n // Generate the range per branch with which git shall be called.\n foreach ($branches as $branch_name => $label) {\n if (is_object($cache_object)) {\n // We get all commits we have in this branch to not process them later.\n $constraints['branches'] = array($branch_name);\n $latest_commit_date = 0;\n $commit_op = versioncontrol_get_operations($constraints);\n $latest_commit = FALSE;\n foreach ($commit_op as $vc_op_id => $c_op) {\n if ($latest_commit_date < $c_op['date']) {\n $latest_commit = $c_op['revision'];\n $latest_commit_date = $c_op['date'];\n $existing_revs[$branch_name][$latest_commit] = TRUE;\n }\n }\n }\n // No way to free the damned mysql result!!\n unset($commit_op);\n\n $commits_in_branch = _versioncontrol_git_log_get_commits_in_branch($repository, escapeshellarg($branch_name));\n foreach ($commits_in_branch as $i => $commit) {\n if (!isset($existing_revs[$branch_name][$commit])) {\n if (!isset($branches_per_commit[$commit]) || !is_array($branches_per_commit[$commit])) {\n $branches_per_commit[$commit] = array($label);\n }\n else {\n $branches_per_commit[$commit][] = $label;\n }\n }\n }\n }\n // This uses an extra loop on purpose!\n // Process all commits on a per-branch base.\n foreach ($branches_per_commit as $revision => $branch) {\n // Update commits from Git.\n _versioncontrol_git_process_commits($repository, $revision, $branches_per_commit, $existing_revs);\n }\n // Check tags.\n $tags = _versioncontrol_git_log_get_tags(); //Now we have the current list of tags as array of strings.\n $constraints = array(\n 'vcs' => array('git'),\n 'repo_ids' => array($repository['repo_id']),\n 'types' => array(VERSIONCONTROL_OPERATION_TAG)\n );\n $existing_tag_ops = versioncontrol_get_operations($constraints);\n $existing_tags = array();\n foreach ($existing_tag_ops as $tag_op) {\n if (!in_array($tag_op['labels'][0]['name'], $existing_tags)) {\n $existing_tags[] = $tag_op['labels'][0]['name'];\n }\n }\n // Deleting tags is *not* supported. Read the manual if you want to know why...\n // Check for new tags.\n $new_tags = array_diff($tags, $existing_tags);\n if (!empty($new_tags)) {\n _versioncontrol_git_process_tags($repository, $new_tags);\n }\n\n // Update repository updated field. Displayed on administration interface for documentation purposes.\n $repository['git_specific']['updated'] = time();\n db_query('UPDATE {versioncontrol_git_repositories}\n SET updated = %d, locked = 0 WHERE repo_id = %d',\n $repository['git_specific']['updated'], $repository['repo_id']);\n\n // Write back the cache.\n cache_set('versioncontrol_git_rev_cache', $existing_revs);\n return TRUE;\n}", "function target_gitup()\n{\n\t// git remote add upstream git://github.com/<user>/<repo>.git\n\tsystem('git fetch upstream');\n\tsystem('git merge upstream/master');\n}", "public function fbc_module_update()\n\t{\n\t\tif ( ! isset($_POST['run_update']) OR $_POST['run_update'] != 'y')\n\t\t{\n\t\t\t$this->add_crumb(lang('update_fbc_module'));\n\t\t\t$this->cached_vars['form_url'] = $this->cached_vars['base_uri'] . '&method=fbc_module_update';\n\t\t\treturn $this->ee_cp_view('update_module.html');\n\t\t}\n\n\t\trequire_once $this->addon_path.'upd.fbc.php';\n\n\t\t$U = new Fbc_upd();\n\n\t\tif ($U->update() !== TRUE)\n\t\t{\n\t\t\treturn ee()->functions->redirect($this->base . AMP . 'msg=update_failure');\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn ee()->functions->redirect($this->base . AMP . 'msg=update_successful');\n\t\t}\n\t}", "public function updateRepository($reset = true)\n\t{\n\t\t$this->command->info('Pulling changes');\n\t\t$tasks = array($this->scm->update());\n\n\t\t// Reset if requested\n\t\tif ($reset) {\n\t\t\tarray_unshift($tasks, $this->scm->reset());\n\t\t}\n\n\t\treturn $this->runForCurrentRelease($tasks);\n\t}", "function WebhookPullSubrepository(){\n \n $MagicWord=BlowfishEncrypt('Pull Subrepository From Github');\n if(\n isset($_GET[$MagicWord])\n ){\n $Path=dirname(__FILE__);\n $Path=str_replace('/core','',$Path);\n $Subrepository=BlowfishDecrypt($_GET[$MagicWord]);;\n $Path.=trim($Subrepository);\n \n echo '<p>Pulling Subrepository: '.$Path.'</p>';\n \n if(!is_dir($Path)){\n die('Path not found: '.$Path);\n }\n \n $Command = 'cd '.$Path.' && git reset --hard && git pull';\n echo '<p>'.$Command.'</p><pre>';\n echo shell_exec($Command);\n echo '</pre>';\n \n exit;\n }\n}", "public function gitPull ()\n {\n\n $this->updates[ ] = Hallmark_Misc::shell ( 'git pull ' . Hallmark_Misc::removeQuotes ( Hallmark_Misc::args () ) );\n\n }", "function pm_update_packages($update_info, $tmpfile) {\n $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT');\n\n $print = '';\n $status = array();\n foreach($update_info as $project) {\n $print .= $project['title'] . \" [\" . $project['name'] . '-' . $project['candidate_version'] . \"], \";\n $status[$project['status']] = $project['status'];\n }\n // We print the list of the projects that need to be updated.\n if (isset($status[UPDATE_NOT_SECURE])) {\n if (isset($status[UPDATE_NOT_CURRENT])) {\n $title = (dt('Security and code updates will be made to the following projects:'));\n }\n else {\n $title = (dt('Security updates will be made to the following projects:'));\n }\n }\n else {\n $title = (dt('Code updates will be made to the following projects:'));\n }\n $print = \"$title \" . (substr($print, 0, strlen($print)-2));\n drush_print($print);\n file_put_contents($tmpfile, \"\\n\\n$print\\n\\n\", FILE_APPEND);\n\n // Print the release notes for projects to be updated.\n if (drush_get_option('notes', FALSE)) {\n drush_print('Obtaining release notes for above projects...');\n $requests = pm_parse_project_version(array_keys($update_info));\n release_info_print_releasenotes($requests, TRUE, $tmpfile);\n }\n\n // We print some warnings before the user confirms the update.\n drush_print();\n if (drush_get_option('no-backup', FALSE)) {\n drush_print(dt(\"Note: You have selected to not store backups.\"));\n }\n else {\n drush_print(dt(\"Note: A backup of your project will be stored to backups directory if it is not managed by a supported version control system.\"));\n drush_print(dt('Note: If you have made any modifications to any file that belongs to one of these projects, you will have to migrate those modifications after updating.'));\n }\n if(!drush_confirm(dt('Do you really want to continue with the update process?'))) {\n return drush_user_abort();\n }\n\n // Now we start the actual updating.\n foreach($update_info as $project) {\n if (empty($project['path'])) {\n return drush_set_error('DRUSH_PM_UPDATING_NO_PROJECT_PATH', dt('The !project project path is not available, perhaps the !type is enabled but has been deleted from disk.', array('!project' => $project['name'], '!type' => $project['project_type'])));\n }\n drush_log(dt('Starting to update !project code at !dir...', array('!project' => $project['title'], '!dir' => $project['path'])));\n // Define and check the full path to project directory and base (parent) directory.\n $project['full_project_path'] = $drupal_root . '/' . $project['path'];\n if (stripos($project['path'], $project['project_type']) === FALSE || !is_dir($project['full_project_path'])) {\n return drush_set_error('DRUSH_PM_UPDATING_PATH_NOT_FOUND', dt('The !project directory could not be found within the !types directory at !full_project_path, perhaps the project is enabled but has been deleted from disk.', array('!project' => $project['name'], '!type' => $project['project_type'], '!full_project_path' => $project['full_project_path'])));\n }\n if (!$version_control = drush_pm_include_version_control($project['full_project_path'])) {\n return FALSE;\n }\n $project['base_project_path'] = dirname($project['full_project_path']);\n // Check we have a version control system, and it clears its pre-flight.\n if (!$version_control->pre_update($project)) {\n return FALSE;\n }\n\n // Package handlers want the name of the directory in project_dir.\n // It may be different to the project name for pm-download.\n // Perhaps we want here filename($project['full_project_path']).\n $project['project_dir'] = $project['name'];\n\n // Run update on one project.\n if (pm_update_project($project, $version_control) === FALSE) {\n return FALSE;\n }\n pm_update_complete($project, $version_control);\n }\n\n return TRUE;\n}", "public function update($path = null)\n {\n $this->executeNpm(array('update'), $path);\n }", "public function set_needed_repos(): void {}", "public function set_needed_repos(): void {}", "public function update(Group $root);", "function runUpdate($repo)\n{\n $updNoodle = new Noodle();\n $updNoodle->noodleID = 17;\n $updNoodle->brand = 'FLAVOURS OF THE SUN';\n $updNoodle->flavour = 'COSMIC DUST';\n $updNoodle->instant = 1;\n $updNoodle->nationality = 'OUT OF THIS WORLD';\n $repo->update($updNoodle);\n}", "public function commitChanges(OutputInterface $output, $modules) {\n\t\t$this->log($output, 'Committing translations to git');\n\t\t\n\t\tforeach($modules as $module) {\n\t\t\t$repo = $module->getRepository();\n\n\t\t\t// Add all changes\n\t\t\t$jsPath = $module->getJSLangDirectory();\n\t\t\t$langPath = $module->getLangDirectory();\n\t\t\tforeach(array_merge((array)$jsPath, (array)$langPath) as $path) {\n\t\t\t\tif(is_dir($path)) {\n\t\t\t\t\t$repo->run(\"add\", array($path . \"/*\"));\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Commit changes if any exist\n\t\t\t$status = $repo->run(\"status\");\n\t\t\tif(stripos($status, 'Changes to be committed:')) {\n\t\t\t\t$this->log($output, \"Comitting changes for module \" . $module->getName());\n\t\t\t\t$repo->run(\"commit\", array(\"-m\", \"Update translations\"));\n\t\t\t}\n\n\t\t\t// Do push if selected\n\t\t\tif($this->push) {\n\t\t\t\t$this->log($output, \"Pushing upstream for module \" . $module->getName());\n\t\t\t\t$repo->run(\"push\", array(\"origin\"));\n\t\t\t}\n\t\t}\n\t}", "private function _installSubextensions($parent)\n\t{\n\t\t$src = $parent->getParent()->getPath('source');\n\n\t\t$db = JFactory::getDbo();\n\n\t\t$status = new JObject();\n\t\t$status->modules = array();\n\t\t$status->plugins = array();\n\n\t\t// Modules installation\n\n\t\tif(count($this->installation_queue['modules'])) {\n\t\t\tforeach($this->installation_queue['modules'] as $folder => $modules) {\n\t\t\t\tif(count($modules))\n\t\t\t\t\tforeach($modules as $module => $modulePreferences)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Install the module\n\t\t\t\t\t\tif(empty($folder))\n\t\t\t\t\t\t\t$folder = 'site';\n\t\t\t\t\t\t$path = \"$src/modules/$folder/$module\";\n\t\t\t\t\t\tif(!is_dir($path))// if not dir\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$path = \"$src/modules/$folder/mod_$module\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!is_dir($path)) {\n\t\t\t\t\t\t\t$path = \"$src/modules/$module\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(!is_dir($path)) {\n\t\t\t\t\t\t\t$path = \"$src/modules/mod_$module\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!is_dir($path))\n\t\t\t\t\t\t{\n\n\t\t\t\t\t\t\t$fortest='';\n\t\t\t\t\t\t\t//continue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Was the module already installed?\n\t\t\t\t\t\t$sql = $db->getQuery(true)\n\t\t\t\t\t\t\t->select('COUNT(*)')\n\t\t\t\t\t\t\t->from('#__modules')\n\t\t\t\t\t\t\t->where($db->qn('module').' = '.$db->q('mod_'.$module));\n\t\t\t\t\t\t$db->setQuery($sql);\n\n\t\t\t\t\t\t$count = $db->loadResult();\n\t\t\t\t\t\t$installer = new JInstaller;\n\t\t\t\t\t\t$result = $installer->install($path);\n\t\t\t\t\t\t$status->modules[] = array(\n\t\t\t\t\t\t\t'name'=>$module,\n\t\t\t\t\t\t\t'client'=>$folder,\n\t\t\t\t\t\t\t'result'=>$result,\n\t\t\t\t\t\t\t'status'=>$modulePreferences[1]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t// Modify where it's published and its published state\n\t\t\t\t\t\tif(!$count) {\n\t\t\t\t\t\t\t// A. Position and state\n\t\t\t\t\t\t\tlist($modulePosition, $modulePublished) = $modulePreferences;\n\t\t\t\t\t\t\tif($modulePosition == 'cpanel') {\n\t\t\t\t\t\t\t\t$modulePosition = 'icon';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$sql = $db->getQuery(true)\n\t\t\t\t\t\t\t\t->update($db->qn('#__modules'))\n\t\t\t\t\t\t\t\t->set($db->qn('position').' = '.$db->q($modulePosition))\n\t\t\t\t\t\t\t\t->where($db->qn('module').' = '.$db->q('mod_'.$module));\n\t\t\t\t\t\t\tif($modulePublished) {\n\t\t\t\t\t\t\t\t$sql->set($db->qn('published').' = '.$db->q('1'));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$db->setQuery($sql);\n\t\t\t\t\t\t\t$db->query();\n\n\t\t\t\t\t\t\t// B. Change the ordering of back-end modules to 1 + max ordering\n\t\t\t\t\t\t\tif($folder == 'admin') {\n\t\t\t\t\t\t\t\t$query = $db->getQuery(true);\n\t\t\t\t\t\t\t\t$query->select('MAX('.$db->qn('ordering').')')\n\t\t\t\t\t\t\t\t\t->from($db->qn('#__modules'))\n\t\t\t\t\t\t\t\t\t->where($db->qn('position').'='.$db->q($modulePosition));\n\t\t\t\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t\t\t\t$position = $db->loadResult();\n\t\t\t\t\t\t\t\t$position++;\n\n\t\t\t\t\t\t\t\t$query = $db->getQuery(true);\n\t\t\t\t\t\t\t\t$query->update($db->qn('#__modules'))\n\t\t\t\t\t\t\t\t\t->set($db->qn('ordering').' = '.$db->q($position))\n\t\t\t\t\t\t\t\t\t->where($db->qn('module').' = '.$db->q('mod_'.$module));\n\t\t\t\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t\t\t\t$db->query();\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// C. Link to all pages\n\t\t\t\t\t\t\t$query = $db->getQuery(true);\n\t\t\t\t\t\t\t$query->select('id')->from($db->qn('#__modules'))\n\t\t\t\t\t\t\t\t->where($db->qn('module').' = '.$db->q('mod_'.$module));\n\t\t\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t\t\t$moduleid = $db->loadResult();\n\n\t\t\t\t\t\t\t$query = $db->getQuery(true);\n\t\t\t\t\t\t\t$query->select('*')->from($db->qn('#__modules_menu'))\n\t\t\t\t\t\t\t\t->where($db->qn('moduleid').' = '.$db->q($moduleid));\n\t\t\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t\t\t$assignments = $db->loadObjectList();\n\t\t\t\t\t\t\t$isAssigned = !empty($assignments);\n\t\t\t\t\t\t\tif(!$isAssigned) {\n\t\t\t\t\t\t\t\t$o = (object)array(\n\t\t\t\t\t\t\t\t\t'moduleid'\t=> $moduleid,\n\t\t\t\t\t\t\t\t\t'menuid'\t=> 0\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t$db->insertObject('#__modules_menu', $o);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Plugins installation\n\t\tif(count($this->installation_queue['plugins'])) {\n\t\t\tforeach($this->installation_queue['plugins'] as $folder => $plugins) {\n\t\t\t\tif(count($plugins))\n\t\t\t\tforeach($plugins as $plugin => $published) {\n\t\t\t\t\t$path = \"$src/plugins/$folder/$plugin\";\n\t\t\t\t\tif(!is_dir($path)) {\n\t\t\t\t\t\t$path = \"$src/plugins/$folder/plg_$plugin\";\n\t\t\t\t\t}\n\t\t\t\t\tif(!is_dir($path)) {\n\t\t\t\t\t\t$path = \"$src/plugins/$plugin\";\n\t\t\t\t\t}\n\t\t\t\t\tif(!is_dir($path)) {\n\t\t\t\t\t\t$path = \"$src/plugins/plg_$plugin\";\n\t\t\t\t\t}\n\t\t\t\t\tif(!is_dir($path)) continue;\n\n\t\t\t\t\t// Was the plugin already installed?\n\t\t\t\t\t$query = $db->getQuery(true)\n\t\t\t\t\t\t->select('COUNT(*)')\n\t\t\t\t\t\t->from($db->qn('#__extensions'))\n\t\t\t\t\t\t->where('( '.($db->qn('name').' = '.$db->q($plugin)) .' OR '. ($db->qn('element').' = '.$db->q($plugin)) .' )')\n\t\t\t\t\t\t->where($db->qn('folder').' = '.$db->q($folder));\n\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t$count = $db->loadResult();\n\n\t\t\t\t\t$installer = new JInstaller;\n\t\t\t\t\t$result = $installer->install($path);\n\n\t\t\t\t\t$status->plugins[] = array('name'=>$plugin,'group'=>$folder, 'result'=>$result,'status'=>$published);\n\n\n\t\t\t\t\tif($published && !$count) {\n\t\t\t\t\t\t$query = $db->getQuery(true)\n\t\t\t\t\t\t\t->update($db->qn('#__extensions'))\n\t\t\t\t\t\t\t->set($db->qn('enabled').' = '.$db->q('1'))\n\t\t\t\t\t\t\t->where('( '.($db->qn('name').' = '.$db->q($plugin)) .' OR '. ($db->qn('element').' = '.$db->q($plugin)) .' )')\n\t\t\t\t\t\t\t->where($db->qn('folder').' = '.$db->q($folder));\n\t\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t\t$db->query();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// library installation\n\t\tif(!empty($this->installation_queue['libraries']) and count($this->installation_queue['libraries']))\n\t\t {\n\t\t\tforeach($this->installation_queue['libraries'] as $folder=>$status1)\n\t\t\t{\n\n\t\t\t\t\t$path = \"$src/libraries/$folder\";\n\n\t\t\t\t\t$query = $db->getQuery(true)\n\t\t\t\t\t\t->select('COUNT(*)')\n\t\t\t\t\t\t->from($db->qn('#__extensions'))\n\t\t\t\t\t\t->where('( '.($db->qn('name').' = '.$db->q($folder)) .' OR '. ($db->qn('element').' = '.$db->q($folder)) .' )')\n\t\t\t\t\t\t->where($db->qn('folder').' = '.$db->q($folder));\n\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t$count = $db->loadResult();\n\n\t\t\t\t\t$installer = new JInstaller;\n\t\t\t\t\t$result = $installer->install($path);\n\n\t\t\t\t\t$status->libraries[] = array('name'=>$folder,'group'=>$folder, 'result'=>$result,'status'=>$status1);\n\t\t\t\t\t//print\"<pre>\"; print_r($status->plugins); die;\n\n\t\t\t\t\tif($published && !$count) {\n\t\t\t\t\t\t$query = $db->getQuery(true)\n\t\t\t\t\t\t\t->update($db->qn('#__extensions'))\n\t\t\t\t\t\t\t->set($db->qn('enabled').' = '.$db->q('1'))\n\t\t\t\t\t\t\t->where('( '.($db->qn('name').' = '.$db->q($folder)) .' OR '. ($db->qn('element').' = '.$db->q($folder)) .' )')\n\t\t\t\t\t\t\t->where($db->qn('folder').' = '.$db->q($folder));\n\t\t\t\t\t\t$db->setQuery($query);\n\t\t\t\t\t\t$db->query();\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t/*\n\t\t * 'applications'=>array(\n\t\t\t'easysocial'array(\n\t\t\t\t\t'quick2cartproducts'=>0,\n\t\t\t\t\t'quick2cartstores'=>0\n\n\t\t\t),\n\t\t * */\n\t\t//Application Installations\n\t\tif(file_exists(JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/foundry.php'))\n\t\t{\n\t\t\trequire_once( JPATH_ADMINISTRATOR . '/components/com_easysocial/includes/foundry.php' );\n\t\t\t$installer = Foundry::get( 'Installer' );\n\t\t\t// The $path here refers to your application path\n\t\t\t$installer->load( $src.\"/plugins/easysocial/easysocial_broadcast\" );\n\t\t\t$plg_install=$installer->install();\n\t\t\t$status->app_install[] = array('name'=>'easysocial_broadcast','group'=>'easysocial_broadcast', 'result'=>$plg_install,'status'=>'1');\n\t\t}\n\n\t\treturn $status;\n\t}", "function rpull() {\n\t\t$this->checkOnce();\n\t\t$versionPath = $this->getVersionPath();\n\t\t/** @var Repo $repo */\n\t\tforeach ($this->repos as $repo) {\n\t\t\techo BR, '## ', $repo->path, BR;\n\t\t\t$deployPath = $versionPath . '/' . $repo->path();\n\t\t\ttry {\n\t\t\t\t$exists = $this->rexists($deployPath);\n\t\t\t\tif ($exists) {\n\t\t\t\t\t$remoteCmd = 'cd ' . $deployPath . ' && hg pull';\n\t\t\t\t\t$this->ssh_exec($remoteCmd);\n\t\t\t\t} else {\n\t\t\t\t\techo TAB, '*** path ', $deployPath, ' does not exist', BR;\n\t\t\t\t}\n\t\t\t} catch (\\SystemCommandException $e) {\n\t\t\t\techo 'Error: '.$e, BR;\n\t\t\t}\n\t\t}\n\t}", "function changeBranch(){\r\n\t\t// $gitpss = isset($_COOKIE['gitpss']) ? $_COOKIE['gitpss'] : '';\r\n\t\t// $repo = 'https://'.$gitusr.':'.$gitpss.'@github.com/nelsoft/nelsoft_inventory.git';\r\n\t\tchdir($_POST['path']);\r\n\t\texec('git clean -df');\r\n\t\texec('git checkout -- .');\r\n\t\t// exec('git fetch '.$repo);\r\n\t\texec('git checkout '.$_POST['branch'], $data);\r\n\t\t// exec('git pull '.$repo.' '.$_POST['branch'], $data);\r\n\r\n\t\t$return['version'] = '0.00';\r\n\t\t$return['version'] = getversion($_POST['path'], 'version');\t\r\n\t\t$return['data'] = $data;\r\n\r\n\t\tjdie($return);\r\n}", "function updateSourceBranching() {\n if ($this->isModuleInstalled('source')) {\n try {\n $source_commits_table = TABLE_PREFIX . 'source_commits';\n $commit_project_objects_table = TABLE_PREFIX . 'commit_project_objects';\n $source_repositories_table = TABLE_PREFIX . 'source_repositories';\n\n DB::execute(\"ALTER TABLE $source_commits_table ADD branch_name VARCHAR(255) DEFAULT '' AFTER commited_by_email\");\n DB::execute(\"ALTER TABLE $commit_project_objects_table ADD branch_name VARCHAR(255) DEFAULT '' AFTER revision\");\n\n // Add default branch for existing data\n\n DB::execute(\"UPDATE $source_commits_table SET branch_name = 'master' WHERE type = 'GitCommit'\");\n DB::execute(\"UPDATE $source_commits_table SET branch_name = 'default' WHERE type = 'MercurialCommit'\");\n\n $commit_project_objects = DB::execute(\"\n SELECT $commit_project_objects_table.id, $source_repositories_table.type\n FROM $commit_project_objects_table, $source_repositories_table\n WHERE $commit_project_objects_table.repository_id = $source_repositories_table.id\"\n );\n\n if (is_foreachable($commit_project_objects)) {\n foreach ($commit_project_objects as $commit_project_object) {\n if ($commit_project_object['type'] == 'GitRepository') {\n DB::execute(\"UPDATE $commit_project_objects_table SET branch_name = 'master' WHERE id = ?\", $commit_project_object['id']);\n } //if\n if ($commit_project_object['type'] == 'MercurialRepository') {\n DB::execute(\"UPDATE $commit_project_objects_table SET branch_name = 'default' WHERE id = ?\", $commit_project_object['id']);\n } //if\n } //foreach\n } //if\n\n DB::execute('INSERT INTO ' . TABLE_PREFIX . \"config_options (name, module, value) VALUES ('default_source_branch', 'source', 'N;')\");\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n } //if\n return true;\n }", "function upstreamupdate(array $args, array $assoc_args) {\n\n $path = 'code-upstream-updates';\n $data = array(\n // update database with latest schema\n 'updatedb' => (array_key_exists(\"updatedb\", $assoc_args)?$assoc_args['updatedb']:false),\n // default is to allow updates to parent repo to overwrite local\n 'xoption' => (array_key_exists(\"xoption\")) ? $assoc_args['updatedb'] : 'theirs',\n );\n //TODO: format output\n\n return $this->terminus_request(\"site\", $this->_siteInfo->site_uuid, $path, \"POST\", $data);\n }", "public function updateModuleList()\n {\n if ($this->modulebase == \"\") {\n throw new \\InvalidArgumentException(\"Module base must not be empty!\");\n }\n\n $this->finder->directories()->in($this->modulebase)->depth('== 0');\n \n $modules = array();\n\n foreach ($this->finder as $file) {\n if (file_exists($file->getRealpath() . \"/routes.php\")) {\n $modules[] = $file->getFilename();\n }\n }\n\n if (is_writeable(dirname($this->storage))) {\n file_put_contents(\n $this->storage,\n json_encode($modules)\n );\n }\n\n return true;\n }", "function update( $args, $assoc_args ) {\n\t\tself::run( 'core update', $args, $assoc_args );\n\t}", "function updateSourceModule() {\n try {\n $commits_table = TABLE_PREFIX . 'source_commits';\n $paths_table = TABLE_PREFIX . 'source_paths';\n $repositories_table = TABLE_PREFIX . 'source_repositories';\n $project_objects_table = TABLE_PREFIX . 'project_objects';\n $source_users_table = TABLE_PREFIX . 'source_users';\n $activity_logs_table = TABLE_PREFIX . 'activity_logs';\n\n $engine = defined('DB_CAN_TRANSACT') && DB_CAN_TRANSACT ? 'InnoDB' : 'MyISAM';\n if(DB::executeFirstCell(\"SELECT COUNT(*) AS count FROM \" . TABLE_PREFIX . \"modules WHERE name='source'\")) {\n DB::execute(\"CREATE TABLE $commits_table (\n id int(10) unsigned NOT NULL AUTO_INCREMENT,\n name varchar(255) DEFAULT NULL,\n type varchar(25) DEFAULT NULL,\n revision_number int(11) unsigned DEFAULT '0',\n repository_id int(11) unsigned DEFAULT '0',\n message_title text,\n message_body text,\n authored_on datetime DEFAULT NULL,\n authored_by_name varchar(100) DEFAULT NULL,\n authored_by_email varchar(100) DEFAULT NULL,\n commited_on datetime DEFAULT NULL,\n commited_by_name varchar(100) DEFAULT NULL,\n commited_by_email varchar(100) DEFAULT NULL,\n diff text,\n PRIMARY KEY (id),\n KEY repository_id (repository_id),\n KEY commited_on (commited_on)\n ) ENGINE=$engine DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci\");\n\n DB::execute(\"CREATE TABLE $paths_table (\n id int(10) unsigned NOT NULL AUTO_INCREMENT,\n commit_id int(11) unsigned DEFAULT '0',\n is_dir tinyint(1) unsigned NOT NULL DEFAULT '0',\n path varchar(255) DEFAULT NULL,\n action varchar(1) DEFAULT NULL,\n PRIMARY KEY (id),\n KEY commit_id (commit_id)\n ) ENGINE=$engine DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci\");\n\n DB::execute(\"CREATE TABLE $repositories_table (\n id int(10) unsigned NOT NULL AUTO_INCREMENT,\n name varchar(255) DEFAULT NULL,\n type varchar(25) DEFAULT NULL,\n created_on datetime DEFAULT NULL,\n created_by_id int(10) unsigned DEFAULT '0',\n created_by_name varchar(100) DEFAULT NULL,\n created_by_email varchar(150) DEFAULT NULL,\n updated_on datetime DEFAULT NULL,\n updated_by_id int(10) unsigned DEFAULT '0',\n updated_by_name varchar(100) DEFAULT NULL,\n updated_by_email varchar(150) DEFAULT NULL,\n repository_path_url varchar(255) DEFAULT NULL,\n username varchar(255) DEFAULT NULL,\n password varchar(255) DEFAULT NULL,\n update_type int(3) DEFAULT '0',\n graph text,\n PRIMARY KEY (id)\n ) ENGINE=$engine DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci\");\n\n $repositories_link = array();\n $repositories = DB::execute(\"SELECT * FROM $project_objects_table WHERE type = 'Repository'\");\n if (is_foreachable($repositories)) {\n foreach ($repositories as $repository) {\n //insert new source repository\n DB::execute(\"INSERT INTO $repositories_table (name,type,created_on,created_by_id,created_by_name,created_by_email,updated_on,updated_by_id,updated_by_name,updated_by_email,\n repository_path_url,username,password,update_type,graph) VALUES (?, 'SvnRepository', ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\",\n $repository['name'],\n $repository['created_on'],\n $repository['created_by_id'],\n $repository['created_by_name'],\n $repository['created_by_email'],\n $repository['updated_on'],\n $repository['updated_by_id'],\n $repository['updated_by_name'],\n $repository['updated_by_email'],\n $repository['text_field_1'],\n $repository['varchar_field_1'],\n $repository['varchar_field_2'],\n $repository['integer_field_2'],\n $repository['text_field_2']\n );\n\n // Update project object repository\n $last_insert_id = DB::lastInsertId();\n DB::execute(\"UPDATE $project_objects_table SET type = 'ProjectSourceRepository', parent_id = ? WHERE id = ?\", $last_insert_id, $repository['id']);\n\n // Update source user links\n DB::execute(\"UPDATE $source_users_table SET repository_id = ? WHERE repository_id = ?\", $last_insert_id, $repository['id']);\n } //foreach\n } //if\n\n\n if (extension_loaded('svn')) {\n $svn_type = 'extension';\n } elseif (extension_loaded('xml') && function_exists('xml_parser_create')) {\n $svn_type = 'exec';\n } else {\n $svn_type = 'none';\n } // if\n\n // Update configuration options\n DB::execute('INSERT INTO ' . TABLE_PREFIX . 'config_options (name, module, value) VALUES (?, ?, ?), (?, ?, ?)',\n 'source_svn_type', 'source', serialize($svn_type),\n 'source_mercurial_path', 'source', serialize('/usr/bin/')\n );\n } //if\n // Delete all commits from project object\n DB::execute(\"DELETE FROM $project_objects_table WHERE type = 'Commit'\");\n\n // Delete all activity logs\n DB::execute(\"DELETE FROM $activity_logs_table WHERE type = 'RepositoryUpdateActivityLog'\");\n\n //delete unnecessary configuration options\n DB::execute(\"DELETE FROM \" . TABLE_PREFIX . \"config_options WHERE name = 'source_svn_trust_server_cert' OR name = 'source_svn_use_output_redirect'\");\n\n } catch (Exception $e) {\n return $e->getMessage();\n } //try\n\n return true;\n }", "function _pm_update_core(&$project, $tmpfile) {\n $drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT');\n\n drush_print(dt('Code updates will be made to drupal core.'));\n drush_print(dt(\"WARNING: Updating core will discard any modifications made to Drupal core files, most noteworthy among these are .htaccess and robots.txt. If you have made any modifications to these files, please back them up before updating so that you can re-create your modifications in the updated version of the file.\"));\n drush_print(dt(\"Note: Updating core can potentially break your site. It is NOT recommended to update production sites without prior testing.\"));\n drush_print();\n if (drush_get_option('notes', FALSE)) {\n drush_print('Obtaining release notes for above projects...');\n $requests = pm_parse_project_version(array('drupal'));\n release_info_print_releasenotes($requests, TRUE, $tmpfile);\n }\n if(!drush_confirm(dt('Do you really want to continue?'))) {\n drush_print(dt('Rolling back all changes. Run again with --no-core to update modules only.'));\n return drush_user_abort();\n }\n\n // We need write permission on $drupal_root.\n if (!is_writable($drupal_root)) {\n return drush_set_error('DRUSH_PATH_NO_WRITABLE', dt('Drupal root path is not writable.'));\n }\n\n // Create a directory 'core' if it does not already exist.\n $project['path'] = 'drupal-' . $project['candidate_version'];\n $project['full_project_path'] = $drupal_root . '/' . $project['path'];\n if (!is_dir($project['full_project_path'])) {\n drush_mkdir($project['full_project_path']);\n }\n\n // Create a list of directories to exclude from the update process.\n $skip_list = array('sites', $project['path']);\n // Add non-writable directories: we can't move them around.\n // We will also use $items_to_test later for $version_control check.\n $items_to_test = drush_scan_directory($drupal_root, '/.*/', array_merge(array('.', '..'), $skip_list), 0, FALSE, 'basename', 0, TRUE);\n foreach (array_keys($items_to_test) as $item) {\n if (is_dir($item) && !is_writable($item)) {\n $skip_list[] = $item;\n unset($items_to_test[$item]);\n }\n elseif (is_link($item)) {\n $skip_list[] = $item;\n unset($items_to_test[$item]);\n }\n }\n $project['skip_list'] = $skip_list;\n\n // Move all files and folders in $drupal_root to the new 'core' directory\n // except for the items in the skip list\n _pm_update_move_files($drupal_root, $project['full_project_path'], $project['skip_list']);\n\n // Set a context variable to indicate that rollback should reverse\n // the _pm_update_move_files above.\n drush_set_context('DRUSH_PM_DRUPAL_CORE', $project);\n\n if (!$version_control = drush_pm_include_version_control($project['full_project_path'])) {\n return FALSE;\n }\n\n $project['base_project_path'] = dirname($project['full_project_path']);\n // Check we have a version control system, and it clears its pre-flight.\n if (!$version_control->pre_update($project, $items_to_test)) {\n return FALSE;\n }\n\n // Package handlers want the project directory in project_dir.\n $project['project_dir'] = $project['path'];\n\n // Update core.\n if (pm_update_project($project, $version_control) === FALSE) {\n return FALSE;\n }\n\n // Take the updated files in the 'core' directory that have been updated,\n // and move all except for the items in the skip list back to\n // the drupal root\n _pm_update_move_files($project['full_project_path'], $drupal_root, $project['skip_list']);\n drush_delete_dir($project['full_project_path']);\n\n // Version control engines expect full_project_path to exist and be accurate.\n $project['full_project_path'] = $project['base_project_path'];\n\n // If there is a backup target, then find items\n // in the backup target that do not exist at the\n // drupal root. These are to be moved back.\n if (array_key_exists('backup_target', $project)) {\n _pm_update_move_files($project['backup_target'], $drupal_root, $project['skip_list'], FALSE);\n _pm_update_move_files($project['backup_target'] . '/profiles', $drupal_root . '/profiles', array('default'), FALSE);\n }\n\n pm_update_complete($project, $version_control);\n\n return TRUE;\n}", "function drush_pm_updatestatus() {\n // We don't provide for other options here, so we supply an explicit path.\n drush_include_engine('update_info', 'drupal', NULL, DRUSH_BASE_PATH . '/commands/pm/update_info');\n\n // Get specific requests.\n $requests = pm_parse_arguments(func_get_args(), FALSE);\n\n // Get installed extensions and projects.\n $extensions = drush_get_extensions();\n $projects = drush_get_projects($extensions);\n\n // Parse out project name and version.\n $requests = pm_parse_project_version($requests, $projects);\n\n $update_info = _pm_get_update_info($projects);\n\n foreach ($extensions as $name => $extension) {\n // Add an item to $update_info for each enabled extension which was obtained\n // from cvs or git and its project is unknown (because of cvs_deploy or\n // git_deploy is not enabled).\n if (!isset($extension->info['project'])) {\n if ((isset($extension->vcs)) && ($extension->status)) {\n $update_info[$name] = array(\n 'name' => $name,\n 'label' => $extension->label,\n 'existing_version' => 'Unknown',\n 'status' => DRUSH_PM_REQUESTED_PROJECT_NOT_PACKAGED,\n 'status_msg' => dt('Project was not packaged by drupal.org but obtained from !vcs. You need to enable !vcs_deploy module', array('!vcs' => $extension->vcs)),\n );\n // The user may have requested to update a project matching this\n // extension. If it was by coincidence or error we don't mind as we've\n // already added an item to $update_info. Just clean up $requests.\n if (isset($requests[$name])) {\n unset($requests[$name]);\n }\n }\n }\n // Additionally if the extension name is distinct to the project name and\n // the user asked to update the extension, fix the request.\n elseif ((isset($requests[$name])) && ($extension->name != $extension->info['project'])) {\n $requests[$extension->info['project']] = $requests[$name];\n unset($requests[$name]);\n }\n }\n // If specific project updates were requested then remove releases for all\n // others.\n $requested = func_get_args();\n if (!empty($requested)) {\n foreach ($update_info as $name => $project) {\n if (!isset($requests[$name])) {\n unset($update_info[$name]);\n }\n }\n }\n // Add an item to $update_info for each request not present in $update_info.\n foreach ($requests as $name => $request) {\n if (!isset($update_info[$name])) {\n // Disabled projects.\n if ((isset($projects[$name])) && ($projects[$name]['status'] == 0)) {\n $update_info[$name] = array(\n 'name' => $name,\n 'label' => $projects[$name]['label'],\n 'existing_version' => $projects[$name]['version'],\n 'status' => DRUSH_PM_REQUESTED_PROJECT_NOT_UPDATEABLE,\n );\n unset($requests[$name]);\n }\n // At this point we are unable to find matching installed project.\n // It does not exist at all or it is misspelled,...\n else {\n $update_info[$name] = array(\n 'name' => $name,\n 'label' => $name,\n 'existing_version' => 'Unknown',\n 'status'=> DRUSH_PM_REQUESTED_PROJECT_NOT_FOUND,\n );\n }\n }\n }\n\n // If specific versions were requested, match the requested release.\n foreach ($requests as $name => $request) {\n if (!empty($request['version'])) {\n $release = pm_get_release($request, $update_info[$name]);\n if (!$release) {\n $update_info[$name]['status'] = DRUSH_PM_REQUESTED_VERSION_NOT_FOUND;\n }\n else if ($release['version'] == $update_info[$name]['existing_version']) {\n $update_info[$name]['status'] = DRUSH_PM_REQUESTED_CURRENT;\n }\n else {\n $update_info[$name]['status'] = DRUSH_PM_REQUESTED_UPDATE;\n }\n // Set the candidate version to the requested release.\n $update_info[$name]['candidate_version'] = $release['version'];\n }\n }\n // Process locks specified on the command line.\n $locked_list = drush_pm_update_lock($update_info, drush_get_option_list('lock'), drush_get_option_list('unlock'), drush_get_option('lock-message'));\n\n // Build project updatable messages, set candidate version and mark\n // 'updatable' in the project.\n foreach ($update_info as $key => $project) {\n switch($project['status']) {\n case DRUSH_PM_REQUESTED_UPDATE:\n $status = dt('Specified version available');\n $project['updateable'] = TRUE;\n break;\n case DRUSH_PM_REQUESTED_CURRENT:\n $status = dt('Specified version already installed');\n break;\n case DRUSH_PM_REQUESTED_PROJECT_NOT_PACKAGED:\n $status = $project['status_msg'];\n break;\n case DRUSH_PM_REQUESTED_VERSION_NOT_FOUND:\n $status = dt('Specified version not found');\n break;\n case DRUSH_PM_REQUESTED_PROJECT_NOT_FOUND:\n $status = dt('Specified project not found');\n break;\n case DRUSH_PM_REQUESTED_PROJECT_NOT_UPDATEABLE:\n $status = dt('Project has no enabled extensions and can\\'t be updated');\n break;\n default:\n // This can set $project['updateable'] and $project['candidate_version']\n $status = pm_update_filter($project);\n break;\n }\n\n if (isset($project['locked'])) {\n $status = $project['locked'] . \" ($status)\";\n }\n // Persist candidate_version in $update_info (plural).\n if (empty($project['candidate_version'])) {\n $update_info[$key]['candidate_version'] = $project['existing_version']; // Default to no change\n }\n else {\n $update_info[$key]['candidate_version'] = $project['candidate_version'];\n }\n $update_info[$key]['status_msg'] = $status;\n if (isset($project['updateable'])) {\n $update_info[$key]['updateable'] = $project['updateable'];\n }\n }\n\n // Only list projects that have updates available. Use pm-list if you want more info.\n $updateable = pm_project_filter($update_info, drush_get_option('security-only'));\n return $updateable;\n}", "function git_clone($repo, $path, $initSubModules = false) {\n\tGitUtil::cloneRepo($repo, $path, $initSubModules);\n}", "protected function composerUpdate()\n {\n $this->runCommand(['composer', 'update'], getcwd(), $this->output);\n }", "public function updateRepository() {\n $scheduledFile = __DIR__ . '/scheduled.txt';\n if (!file_exists($scheduledFile))\n return;\n\n $requested = file_get_contents($scheduledFile);\n if (!unlink($scheduledFile))\n return;\n\n if ((time() - intval(trim($requested))) > 600)\n return;\n\n $commands = [\n // Updates the local copy of the repository with the most recent remote changes.\n 'git fetch --all',\n\n // Resets the repository to the state the remote currently is in.\n 'git reset --hard origin/master',\n\n // Remove any left-over files that are not part of the checkout, and not in .gitignore.\n 'git clean -f -d',\n\n // Write the latest commit SHA to the VERSION file.\n 'git rev-parse HEAD > VERSION',\n ];\n\n $directory = realpath(__DIR__ . '/../../../');\n\n foreach ($commands as $command)\n Info(trim(shell_exec('cd ' . $directory . ' && ' . $command . ' 2>&1')));\n\n Info('AutoDeploy: Updated to revision ' . file_get_contents(__DIR__ . '/../../../VERSION') . '.');\n }", "function super_search_module_update()\n\t{\n\t\tif ( ! isset($_POST['run_update']) OR $_POST['run_update'] != 'y' )\n\t\t{\n\t\t\t$this->add_crumb(lang('update_super_search'));\n\t\t\t$this->cached_vars['form_url'] = $this->base . '&method=super_search_module_update';\n\t\t\treturn $this->ee_cp_view('update_module.html');\n\t\t}\n\n\t\trequire_once $this->addon_path.'upd.super_search.php';\n\n\t\t$U = new Super_search_upd();\n\n\t\tif ($U->update() !== TRUE)\n\t\t{\n\t\t\treturn ee()->functions->redirect($this->base . AMP . 'msg=update_failure');\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn ee()->functions->redirect($this->base . AMP . 'msg=update_successful');\n\t\t}\n\t}", "public static function initSubmodules($path) {\n\t\t$oldDir = getcwd();\n\t\tchdir($path);\n\t\tpassthru(self::INIT_SUBMODULES_CMD);\n\t\tchdir($oldDir);\n\t}", "function rinstall() {\n\t\t$versionPath = $this->getVersionPath();\n//\t\tdebug($versionPath);\n\t\t/** @var Repo $repo */\n\t\tforeach ($this->repos as $repo) {\n\t\t\techo BR, '## ', $repo->path(), BR;\n\t\t\tif ($this->rexists($repo->path())) {\n\t\t\t\t$deployPath = $versionPath . '/' . $repo->path();\n\t\t\t\t$cmd = 'cd ' . $deployPath . ' && hg update -r ' . $repo->getHash();\n\t\t\t\t$this->ssh_exec($cmd);\n\t\t\t} else {\n\t\t\t\techo 'Error: '.$repo->path.' is not on the server. Maybe do rdeploy?', BR;\n\t\t\t}\n\t\t}\n\t}", "public function actionChildUpdate() {\n $code = $_GET['code'];\n $provinceCode = $_GET['provinceCode'];\n $cityCode = $_GET['cityCode'];\n $ppkCode = $_GET['ppkCode'];\n $models = PackageAccount::model()->findAllByAttributes(array('package_code' => \"$code\"));\n if ($models) {\n foreach ($models as $model) {\n $model->province_code = $provinceCode;\n $model->city_code = $cityCode;\n $model->ppk_code = $ppkCode;\n $model->update();\n }\n }\n }", "public static function update($path, $remote = 'origin', $branch = 'master') {\n\t\tif (!file_exists($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path does not exist.\");\n\t\t}\n\n\t\tif (!is_dir($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path is not a directory.\");\n\t\t}\n\n\t\tif (!self::isRepo($path)) {\n\t\t\tthrow new Exception(\n\t\t\t\t\"Unable to update git repo $path. Path is not a git repository.\");\n\t\t}\n\n\t\t$origCwd = getcwd();\n\t\tchdir($path);\n\n\t\t$fetchCmd = sprintf(self::FETCH_CMD_TMPL, $remote);\n\t\tpassthru($fetchCmd);\n\n\t\t$mergeCmd = sprintf(self::MERGE_CMD_TMPL, $remote, $branch);\n\t\tpassthru($mergeCmd);\n\n\t\tchdir($origCwd);\n\t}", "public function updateGitHooks()\n {\n $tasks = [];\n $hooks = ['pre-commit'];\n \n foreach($hooks as $hook) {\n $tasks += $this->getAppendingTasks($hook);\n }\n\n return $this->collectionBuilder()->addTaskList($tasks);\n }", "public function gitPull() {\n $current_branch = exec('git rev-parse --abbrev-ref HEAD');\n\n $collection = $this->collectionBuilder();\n $collection->taskGitStack()\n ->pull()\n ->run();\n\n $name = $this->confirm(\"Run Composer Install?\");\n if ($name) {\n $this->composerInstall();\n }\n\n $name = $this->confirm(\"Run Config Import?\");\n if ($name) {\n $this->drushCim();\n }\n }", "public function update()\n\t{\n\t\t$mytable = WikiRevision::$table;\n\t\t$buf = \"UPDATE $mytable SET \";\n\t\tfor ($i = 0; $i < count(WikiRevision::$fields); $i++) {\n\t\t\t$buf .= WikiRevision::$fields[$i] . \" = '\" . DBConnection::get()->handle()->real_escape_string($this->data[$fields[$i]]) . \"'\" . ($i == count(WikiRevision::$fields) - 1)?(', '):(' ');\n\t\t}\n\t\t$buf .= \"WHERE rev_id = \" . $data['rev_id'];\n\t\tDBConnection::get()->handle()->query($buf);\n\t}", "function update_do_one($module, $number, &$context) {\n // If updates for this module have been aborted\n // in a previous step, go no further.\n if (!empty($context['results'][$module]['#abort'])) {\n return;\n }\n\n $function = $module .'_update_'. $number;\n if (function_exists($function)) {\n $ret = $function($context['sandbox']);\n }\n\n if (isset($ret['#finished'])) {\n $context['finished'] = $ret['#finished'];\n unset($ret['#finished']);\n }\n\n if (!isset($context['results'][$module])) {\n $context['results'][$module] = array();\n }\n if (!isset($context['results'][$module][$number])) {\n $context['results'][$module][$number] = array();\n }\n $context['results'][$module][$number] = array_merge($context['results'][$module][$number], $ret);\n\n if (!empty($ret['#abort'])) {\n $context['results'][$module]['#abort'] = TRUE;\n }\n // Record the schema update if it was completed successfully.\n if ($context['finished'] == 1 && empty($context['results'][$module]['#abort'])) {\n drupal_set_installed_schema_version($module, $number);\n }\n\n $context['message'] = 'Updating '. check_plain($module) .' module';\n}", "public function update($parent)\n\t{\n\t\t$this->install($parent);\n\t}", "function pm_update_project($project, $version_control) {\n // 1. If the version control engine is a proper vcs we need to remove project\n // files in order to not have orphan files after update.\n // 2. If the package-handler is cvs or git, it will remove upstream removed\n // files and no orphans will exist after update.\n // So, we must remove all files previous update if the directory is not a\n // working copy of cvs or git but we don't need to remove them if the version\n // control engine is backup, as it did already move the project out to the\n // backup directory.\n if (($version_control->engine != 'backup') && (drush_get_option('package-handler', 'wget') == 'wget')) {\n // Find and unlink all files but the ones in the vcs control directories.\n $skip_list = array('.', '..');\n $skip_list = array_merge($skip_list, drush_version_control_reserved_files());\n drush_scan_directory($project['full_project_path'], '/.*/', $skip_list, 'unlink', TRUE, 'filename', 0, TRUE);\n }\n\n // Add the project to a context so we can roll back if needed.\n $updated = drush_get_context('DRUSH_PM_UPDATED');\n $updated[] = $project;\n drush_set_context('DRUSH_PM_UPDATED', $updated);\n\n if (!package_handler_update_project($project, $project['releases'][$project['candidate_version']])) {\n return drush_set_error('DRUSH_PM_UPDATING_FAILED', dt('Updating project !project failed. Attempting to roll back to previously installed version.', array('!project' => $project['name'])));\n }\n\n // If the version control engine is a proper vcs we also need to remove\n // orphan directories.\n if (($version_control->engine != 'backup') && (drush_get_option('package-handler', 'wget') == 'wget')) {\n $files = drush_find_empty_directories($project['full_project_path'], $version_control->reserved_files());\n array_map('drush_delete_dir', $files);\n }\n\n return TRUE;\n}", "public function multiple_update_package()\n\t{\n\t\t$this->breadcrumbs->unshift(2, 'Service And Package', 'master/package');\n\t\t$this->breadcrumbs->unshift(3, 'Update Package', \"master/getpackage\");\n\n\t\t$this->page_title->push('Master', 'Update Package');\n\n\t\t$this->data = array(\n\t\t\t'title' => \"Update Package\",\n\t\t\t'breadcrumb' => $this->breadcrumbs->show(),\n\t\t\t'page_title' => $this->page_title->show(),\n\t\t\t'js' => $this->load->get_js_files(),\n\t\t\t'rooms' => $this->package->getRoom()\n\t\t);\n\t\t$this->template->view('multiple_update_package', $this->data);\n\t}", "public function updateRepositoryCount($extCount, $uid = 1)\n {\n $repository = $this->findByUid($uid);\n\n $repository->setLastUpdate(new \\DateTime());\n $repository->setExtensionCount((int)$extCount);\n\n $this->update($repository);\n }", "public function updated(Module $module)\n {\n //\n }", "protected function _loopPluginUpdate($arr)\n\t{\n\t\tglobal $varsPreference;\n\t\tglobal $classEscape;\n\n\t\t$array = $varsPreference['jsonModule'];\n\n\t\tforeach ($array as $key => $value) {\n\t\t\t$strDir = $key;\n\t\t\t$strFile = ucwords($key);\n\t\t\t$path = PATH_BACK_CLASS_ELSE_PLUGIN . $strDir . '/' . $strFile . '.php';\n\t\t\tif (!file_exists($path)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\trequire_once($path);\n\t\t\t$strClass = 'Code_Else_Plugin_' . $strFile . '_' . $strFile;\n\t\t\t$classCall = new $strClass;\n\t\t\t$classCall->loop(array(\n\t\t\t\t'flagType' => 'accountStatus',\n\t\t\t\t'flagStatus' => 'updateModule',\n\t\t\t\t'varsModuleNew' => $arr['varsModuleNew'],\n\t\t\t\t'varsModulePast' => $arr['varsModulePast'],\n\t\t\t\t'arrId' => $arr['arrId'],\n\t\t\t));\n\t\t}\n\t}", "public function update(Update $request)\n {\n return ModuleService::update($request);\n }", "public function update($module = null)\n {\n $this->_bootstrap();\n Mage::app()->setUpdateMode(true);\n\n $resources = Mage::getConfig()->getNode('global/resources')->children();\n $afterApplyUpdates = array();\n foreach ($resources as $resName => $resource) {\n if (!$resource->setup) {\n continue;\n }\n if (!is_null($module) && $resource->setup->module != $module) {\n continue;\n }\n \n $className = 'Mage_Core_Model_Resource_Setup';\n if (isset($resource->setup->class)) {\n $className = $resource->setup->getClassName();\n }\n $this->_response->appendContent(\n \"Running {$className}->applyUpdates()\",\n array('color' => array('white'))\n );\n $setupClass = new $className($resName);\n $setupClass->applyUpdates();\n if ($setupClass->getCallAfterApplyAllUpdates()) {\n $afterApplyUpdates[] = $setupClass;\n }\n }\n\n foreach ($afterApplyUpdates as $setupClass) {\n $setupClass->afterApplyAllUpdates();\n }\n\n Mage::app()->setUpdateMode(false);\n $this->_response->appendContent(\n \"Core Resources updated successfully\",\n array('color' => array('green'))\n );\n }", "function list_core_update($update)\n {\n }", "public function fixRepositoryUrls() {\n\t\t$update_count = 0;\n\n\t\t$packages = $this->Package->find('all', array(\n\t\t\t'contain' => array('Maintainer' => array('id', 'username')),\n\t\t\t'fields' => array('id', 'maintainer_id', 'name'),\n\t\t\t'order' => array('Package.id ASC')\n\t\t));\n\n\t\tforeach ($packages as $package) {\n\t\t\t$this->out(sprintf(\n\t\t\t\t__('Updating package id %s named %s'),\n\t\t\t\t$package['Package']['id'],\n\t\t\t\t$package['Package']['name']\n\t\t\t));\n\n\t\t\tif ($this->Package->fixRepositoryUrl($package)) $update_count++;\n\t\t}\n\n\t\t$this->out(sprintf(__('* Successfully updated %s out of %s package urls'), $update_count, count($packages)));\n\t\t$this->_stop();\n\t}", "function updateSubpageVersions() {\n try {\n if(DB::executeFirstCell(\"SELECT COUNT(*) AS count FROM \" . TABLE_PREFIX . \"modules WHERE name='notebooks'\")) {\n try {\n $pages_table = TABLE_PREFIX . 'notebook_pages';\n $page_versions_table = TABLE_PREFIX . 'notebook_page_versions';\n $content_backup_table = TABLE_PREFIX . 'content_backup';\n\n DB::beginWork('Updating subpage versions @ ' . __CLASS__);\n\n $rows = DB::execute(\"SELECT $page_versions_table.id, $page_versions_table.body FROM $pages_table, $page_versions_table WHERE $pages_table.id = $page_versions_table.notebook_page_id AND $pages_table.parent_type = 'NotebookPage'\");\n if($rows) {\n foreach($rows as $row) {\n DB::execute(\"INSERT INTO $content_backup_table (parent_type, parent_id, body) VALUES ('NotebookPageVersion', ?, ?)\", $row['id'], $row['body']);\n DB::execute(\"UPDATE $page_versions_table SET body = ? WHERE id = '$row[id]'\", $this->updateHtmlContent($row['body']));\n } // foreach\n } // if\n\n DB::commit('Subpage versions updated @ ' . __CLASS__);\n } catch(Exception $e) {\n DB::rollback('Failed to update subpage versions @ ' . __CLASS__);\n return $e->getMessage();\n } // try\n } // if\n } catch(Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }", "public function updateApp()\n\t{\t\t\n\t\t// Determine which branch to checkout\n\t\tif($this->instanceDev)\n\t\t{\n\t\t\t$this->branch = \"Development\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->branch = \"master\";\n\t\t}\n\n\t\t// Updated code to latest revision in repo\n\t\t$changes = shell_exec(\"git pull [email protected]:iamjoshua/scraper.git $this->branch\");\n\n\t\t// If new revision downloaded\n\t\tif(strpos($changes, \"Updating\") !== FALSE && !strpos($changes, \"error\"))\n\t\t{\n\t\t\t// Create a new bootstrap for new code\n\t\t\texec('php /home/ec2-user/scraper/router.php bootstrap &> /dev/null &');\n\n\t\t\t// Kill current bootstrap\n\t\t\texit('new code. restarting...');\n\t\t}\t\t\t\t\n\t}", "function update_module_option($mod_name, $key, $value) {\n $this->modules->$mod_name->options->$key = $value;\n $new_options = $this->modules->$mod_name->options;\n $result = update_option($this->clientele_prefix . $mod_name . '_options', (array) $new_options);\n $this->$mod_name->module = $this->modules->$mod_name;\n return $result;\n }", "function updates($details_obj,$project){\n\t\t$project->all_versions = $details_obj->project->all_versions;\n\t\t$project->testVersion = $details_obj->project->testVersion;\n\t\t$project->pomPath = $details_obj->project->pomPath;\n\t\tif ($project->pomPath==\"\"){\n\t\t\t$str_tmp_pom_path = \"\";\n\t\t}else{\n\t\t\t$str_tmp_pom_path = \"\\\\\".$project->pomPath;\n\t\t}\n\t\t$project->full_pomPath = $project->userProjectRoot.\"\\\\\".$project->gitName.$str_tmp_pom_path;\n\t\t$project->issue_tracker_product_name = $details_obj->project->issue_tracker_product_name;\n\t\t$project->issue_tracker_url = $details_obj->project->issue_tracker_url;\n\t\t$project->issue_tracker = $details_obj->project->issue_tracker;\n\t\t$project->path_online = $project->runingRoot.\"\\\\path.txt\";\n\t\t$project = update_project_list($project,\"start_offline\",true);\n\t\tupdate_project_details($project);\n\t\treturn $project;\t\t\n\t}", "public function update(StructureProjectRequest $request)\n {\n $level = ProjectStructure::findOrFail($request->id);\n $level->update($request->all());\n }", "function drush_pm_updatecode() {\n // In --pipe mode, just run pm-updatestatus and exit.\n if (drush_get_context('DRUSH_PIPE')) {\n drush_set_option('strict', 0);\n return drush_invoke('pm-updatestatus');\n }\n // We don't provide for other options here, so we supply an explicit path.\n drush_include_engine('update_info', 'drupal', NULL, DRUSH_BASE_PATH . '/commands/pm/update_info');\n\n // Get specific requests.\n $requests = pm_parse_arguments(func_get_args(), FALSE);\n\n // Print report of modules to update, and record\n // result of that function in $update_info.\n $updatestatus_options = array();\n foreach (array('lock', 'unlock', 'lock-message', 'security-only') as $option) {\n $value = drush_get_option($option, FALSE);\n if ($value) {\n $updatestatus_options[$option] = $value;\n }\n }\n $backend_options = array(\n 'integrate' => FALSE,\n );\n $values = drush_invoke_process(\"@self\", 'pm-updatestatus', func_get_args(), $updatestatus_options, $backend_options);\n if (!is_array($values) || $values['error_status']) {\n return FALSE;\n }\n $updateable = $values['object'];\n drush_print($values['output']);\n $tmpfile = drush_tempnam('pm-updatecode.');\n\n $last = pm_update_last_check();\n drush_print(dt('Update information last refreshed: ') . ($last ? format_date($last) : dt('Never')));\n\n // Prevent update of core if --no-core was specified.\n if (isset($updateable['drupal']) && drush_get_option('no-core', FALSE)) {\n unset($updateable['drupal']);\n drush_print(dt('Skipping core update (--no-core specified).'));\n }\n\n // If there are any locked projects that were not requested, then remove them.\n foreach ($updateable as $name => $project) {\n if ((isset($project['locked'])) && (!isset($requests[$name]))) {\n unset($updateable[$name]);\n }\n }\n\n // Do no updates in simulated mode.\n if (drush_get_context('DRUSH_SIMULATE')) {\n return drush_log(dt('No action taken in simulated mode.'), 'ok');\n return TRUE;\n }\n\n $core_update_available = FALSE;\n if (isset($updateable['drupal'])) {\n $drupal_project = $updateable['drupal'];\n unset($updateable['drupal']);\n\n // At present we need to update drupal core after non-core projects\n // are updated.\n if (empty($updateable)) {\n return _pm_update_core($drupal_project, $tmpfile);\n }\n // If there are modules other than drupal core enabled, then update them\n // first.\n else {\n $core_update_available = TRUE;\n if ($drupal_project['status'] == UPDATE_NOT_SECURE) {\n drush_print(dt(\"NOTE: A security update for the Drupal core is available.\"));\n }\n else {\n drush_print(dt(\"NOTE: A code update for the Drupal core is available.\"));\n }\n drush_print(dt(\"Drupal core will be updated after all of the non-core projects are updated.\\n\"));\n }\n }\n\n // If there are no releases to update, then print a final\n // exit message.\n if (empty($updateable)) {\n if (drush_get_option('security-only')) {\n return drush_log(dt('No security updates available.'), 'ok');\n }\n else {\n return drush_log(dt('No code updates available.'), 'ok');\n }\n }\n\n // Offer to update to the identified releases.\n if (!pm_update_packages($updateable, $tmpfile)) {\n return FALSE;\n }\n\n // After projects are updated we can update core.\n if ($core_update_available) {\n drush_print();\n return _pm_update_core($drupal_project, $tmpfile);\n }\n}", "public function update($parent)\n {\n }", "public function actionUpdate($id)\n\t{\n $model=$this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if(isset($_POST['Repository']))\n {\n $model->attributes=$_POST['Repository'];\n if($model->save())\n $this->redirect(array('admin'));\n }\n\n $this->render('update',array(\n 'model'=>$model,\n ));\n\t}", "public function update_extension(){}", "function loadSubModules()\n{\n $debug_prefix = debug_indent(\"Module->loadSubModules() {$this->ModuleID}:\");\n $submodule_elements = $this->_map->selectChildrenOfFirst('SubModules', null, null, true, true);\n if(count($submodule_elements) > 0){\n foreach($submodule_elements as $submodule_element){\n $submodule = $submodule_element->createObject($this->ModuleID);\n $subModuleID = $submodule_element->getAttr('moduleID', true);\n $this->SubModules[$subModuleID] = $submodule;\n print \"$debug_prefix Submodule $subModuleID parsed.\\n\";\n unset($submodule);\n }\n\n //special for best practices: add the IsBestPractice SummaryField\n if(isset($this->SubModules['bpc'])){\n $this->useBestPractices = true;\n $recordIDField = end($this->PKFields);\n\n $field_object = MakeObject(\n $this->ModuleID,\n 'IsBestPractice',\n 'SummaryField',\n array(\n 'name' => 'IsBestPractice',\n 'type' => 'tinyint',\n 'summaryFunction' => 'count',\n 'summaryField' => 'BestPracticeID',\n 'summaryKey' => 'RelatedRecordID',\n 'summaryModuleID' => 'bpc',\n 'localKey' => $recordIDField,\n 'phrase' => 'Is Best Practice|Whether the associated record is a best practice'\n )\n );\n//print \"best practice auto field\";\n//print_r($field_object);\n//die();\n $this->ModuleFields['IsBestPractice'] = $field_object;\n }\n\n //copies submodule conditions to summary fields\n foreach($this->ModuleFields as $fieldName => $field){\n if('summaryfield' == strtolower(get_class($field))){\n if(!$field->isGlobal){\n\n if(isset($this->SubModules[$field->summaryModuleID])){\n $subModule =& $this->SubModules[$field->summaryModuleID];\n if(count($subModule->conditions) > 0){\n //$field->conditions = $subModule->conditions;\n $field->conditions = array_merge($subModule->conditions, (array)$field->conditions);\n $this->ModuleFields[$fieldName] = $field;\n }\n unset($subModule);\n } else {\n trigger_error(\"The summaryfield '{$field->name}' requires a '{$field->summaryModuleID}' submodule.\", E_USER_ERROR);\n }\n }\n }\n }\n }\n debug_unindent();\n}", "public function actionUpdateFromModules($remove_all = 0)\n {\n $params = static::updateRoles($remove_all);\n\n return $this->render('updateFromModules', $params);\n }", "public function updateConfig()\n {\n $this->aframe_assets_url = $this->composer->getConfig()->get('aframe-url') ?? '/aframe';\n \n $composer_json = $this->getVendorDir() . DIRECTORY_SEPARATOR . 'mkungla' . DIRECTORY_SEPARATOR . 'aframe-php' . DIRECTORY_SEPARATOR . 'composer.json';\n \n if (file_exists($composer_json)) {\n $config = json_decode(file_get_contents($composer_json));\n $config->config->{'aframe-dir'} = $this->getPublicRoot();\n $config->config->{'aframe-url'} = $this->aframe_assets_url;\n $config->version = self::AFRAME_PHP_VERSION;\n file_put_contents($composer_json, json_encode($config, JSON_PRETTY_PRINT));\n }\n }", "abstract public function update(Project $project);", "function update($parent) \n\t{\n\t\t// $parent is the class calling this method\n\t\t$this->_createTable();\n\t\t$file_list = $this->_copyIncludeFiles();\n\t\t\n\t\tif( $file_list ) $msg .= \"<h3>成功複製更新檔案</h3><ul>{$file_list}</ul><br /><br />\" ;\n\t\t\n\t\techo '<p>' . '更新成功'. '</p>'.$msg;\n\t\t//JFolder::copy( JPATH_PLUGINS.DS.'system'.DS.'asikart_easyset' , JPATH_ROOT.DS.'easyset' , '' , true );\n\t}", "function _maybe_update_core()\n {\n }", "function pkg_update($force = false) {\n\tglobal $g;\n\n\treturn pkg_call(\"update\" . ($force ? \" -f\" : \"\"));\n}", "function update_all_module_options($mod_name, $new_options) {\n if (is_array($new_options)) {\n $new_options = (object) $new_options;\n }\n $this->modules->$mod_name->options = $new_options;\n $this->$mod_name->module = $this->modules->$mod_name;\n return update_option($this->clientele_prefix . $mod_name . '_options', (array) $this->modules->$mod_name->options);\n }", "function _update_do_one($module, $number, &$context) {\n // If updates for this module have been aborted\n // in a previous step, go no further.\n if (!empty($context['results'][$module]['#abort'])) {\n return;\n }\n\n $function = $module .'_update_'. $number;\n drush_log(\"Executing $function\", 'success');\n\n if (function_exists($function)) {\n $ret = $function($context['sandbox']);\n $context['results'][$module] = $ret;\n _drush_log_update_sql($ret);\n }\n\n if (isset($ret['#finished'])) {\n $context['finished'] = $ret['#finished'];\n unset($ret['#finished']);\n }\n\n if ($context['finished'] == 1 && empty($context['results'][$module]['#abort'])) {\n drupal_set_installed_schema_version($module, $number);\n }\n\n}", "public function update($parent)\n\t{\n\t$db = JFactory::getDBO();\n $result = $db->getTableFields( '#__joomleague_version_history' );\n //echo '<pre>'.print_r( $result, true ).'</pre><br>';\n \n if ( array_key_exists('version', $result['#__joomleague_version_history'] ) )\n {\n //echo 'vorhanden<br>';\n }\n else\n {\n //echo 'nicht vorhanden<br>';\n $query2 = \"ALTER TABLE `#__joomleague_version_history` ADD `version` VARCHAR(255) NOT NULL DEFAULT '' AFTER `text`;\";\n $db->setQuery($query2); \n if (!$db->query())\n\t\t\t\t{\n\t\t\t\t} else {\n\t\t\t\t\t//echo \"-> done !<br>\";\t\t\n\t\t\t\t}\n \n }\n\t\t?>\n\t\t<hr>\n\t\t<h1>JoomLeague Update</h1>\n\t\t<?php\n \n /*\n // eine tabelle mit allen spalten\n $query = \"SELECT ordinal_position\n FROM INFORMATION_SCHEMA.COLUMNS\n WHERE table_name = '#__joomleague_version_history'\n and column_name = 'version' \";\n $db->setQuery($query); \n $table_field = $db->loadResult();\n \n if ( !$table_field )\n {\n $query2 = \"ALTER TABLE `#__joomleague_version_history` ADD `version` VARCHAR(255) NOT NULL DEFAULT '' AFTER `text`;\";\n $db->setQuery($query2); \n if (!$db->query())\n\t\t\t\t{\n// \t\t\t\t\techo '-> '.JText::_('Failed').'! <br>';\n// \t\t\t\t\t$this->setError($db->getErrorMsg());\n// \t\t\t\t\techo $db->getErrorMsg();\n\t\t\t\t\t//return false;\n\t\t\t\t} else {\n\t\t\t\t\t//echo \"-> done !<br>\";\t\t\n\t\t\t\t}\n \n }\n */\n \n\t\tself::_install(true);\n\t}", "public function updateModuleTracking( $event )\n {\n $eventArgs = $event->getArgs();\n\n $courseCode = isset( $eventArgs['courseCode'] ) ? $eventArgs['courseCode'] : null;\n $userId = isset( $eventArgs['userId'] ) ? (int)$eventArgs['userId'] : null;\n $type = isset( $eventArgs['type'] ) ? $eventArgs['type'] : \"update\";\n $date = isset( $eventArgs['date'] ) ? $eventArgs['date'] : date(\"Y-m-d H:i:s\");\n\n $scoreRaw = isset( $eventArgs['scoreRaw'] ) ? (int)$eventArgs['scoreRaw'] : 0;\n $scoreMin = isset( $eventArgs['scoreMin'] ) ? (int)$eventArgs['scoreMin'] : 0;\n $scoreMax = isset( $eventArgs['scoreMax'] ) ? (int)$eventArgs['scoreMax'] : 0;\n $sessionTime = isset( $eventArgs['sessionTime'] ) ? $eventArgs['sessionTime'] : '0000:00:00.00';\n $status = isset( $eventArgs['status'] ) ? $eventArgs['status'] : \"NOT ATTEMPTED\";\n\n $learnPathId = isset( $eventArgs['learnPathId'] ) ? (int)$eventArgs['learnPathId'] : null;\n $moduleId = isset( $eventArgs['moduleId'] ) ? (int)$eventArgs['moduleId'] : null;\n $learnPathModuleId = isset( $eventArgs['learnPathModuleId'] ) ? (int)$eventArgs['learnPathModuleId'] : null;\n $userModuleProgressId = isset( $eventArgs['userModuleProgressId'] ) ? (int)$eventArgs['userModuleProgressId'] : null;\n\n if(is_null( $learnPathId ) || is_null( $moduleId ) )\n {\n if( is_null( $learnPathModuleId ) && !is_null( $userModuleProgressId ) )\n {\n $learnPathModuleId = TrackingUtils::getLearnPathModuleIdFromUserModuleProgressId( $courseCode, $userModuleProgressId );\n }\n\n if( !is_null( $learnPathModuleId ) )\n {\n if( is_null( $learnPathId ) )\n {\n $learnPathId = TrackingUtils::getLearnPathIdFromRelLearnPathModuleId( $courseCode, $learnPathModuleId );\n }\n if(is_null( $moduleId ))\n {\n $moduleId = TrackingUtils::getModuleIdFromRelLearnPathModuleId( $courseCode, $learnPathModuleId );\n }\n }\n }\n\n if( !is_null( $courseCode ) && !is_null( $userId ) && !is_null( $learnPathId ) && !is_null( $moduleId ) )\n {\n $data = LearnPathTrackingListener::generateData( $learnPathId, $moduleId, $scoreRaw, $scoreMin, $scoreMax, $sessionTime, $status );\n if( $type == \"init\" )\n {\n $this->addNewLearnPathTracking( $courseCode, $userId, $date, $data, 'learnpath_tracking_init' );\n }\n else\n {\n $this->addNewLearnPathTracking( $courseCode, $userId, $date, $data, 'learnpath_tracking' );\n }\n }\n else\n {\n throw new Exception( \"Unable to generate a tracking event log due to invalid data\" );\n }\n }", "protected static function updateNodePackages()\n {\n static::updatePackages(...func_get_args());\n }", "public function updateInternals(): int\n {\n $this->logManager->logMessage(lang('Revision.updateInternals'));\n\n try {\n return $this->upgrader->upgrade($this->config->rootPath);\n } catch (RevisionException $e) {\n $this->logManager->logMessage($e->getMessage(), 'error');\n\n return EXIT_ERROR;\n }\n }", "public function updateMigrateSplits() {\n // Reference: https://github.com/uiowa/uiowa/blob/15497457c6c34c3b49c5f4d5cda259a4e67982dc/blt/src/Blt/Plugin/Commands/GitCommands.php#L212-L222\n $root = $this->getConfigValue('repo.root');\n $finder = new Finder();\n\n // Get all the config split features.\n $split_files = $finder\n ->files()\n ->in(\"$root/docroot/sites/\")\n ->name('config_split.config_split.*.yml')\n ->sortByName();\n\n foreach ($split_files->getIterator() as $split_file) {\n if (file_exists($split_file)) {\n // This assumes the split is stored in module/name/config/split dir and\n // the finder context in() does not change.\n $host = dirname($split_file->getRelativePath(), 4);\n $module = basename(dirname($split_file->getRelativePath(), 2));\n $split = YamlMunge::parseFile($split_file->getPathname());\n $alias = Multisite::getIdentifier(\"https://$host\");\n $this->switchSiteContext($host);\n $this->updateSplit($split, $alias, $module);\n }\n }\n }", "public function actionUpdate(): int\n {\n try {\n GithubCache::flush();\n\n $service = GithubService::getInstance();\n $service->saveCache();\n } catch (Exception $e) {\n throw $e;\n }\n\n return ExitCode::OK;\n }", "public function update($parent)\n\t{\n\t}", "public function updateRevisionAll()\n {\n foreach (get_class_methods(get_class($this)) as $method) {\n if (stripos($method, 'updateRevision') !== false && $method != __FUNCTION__) {\n $this->$method();\n }\n }\n }", "protected static function updateComposer()\n {\n $packages = json_decode(file_get_contents(base_path('composer.json')), true);\n $packages['require'] = static::updateComposerArray($packages['require']);\n ksort($packages['require']);\n\n file_put_contents(\n base_path('composer.json'),\n json_encode($packages, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL\n );\n }", "public function testUpdate(): void { }", "public function testUpdateProject()\n {\n echo \"\\nTesting project update...\";\n $id = \"P5334183\";\n //echo \"\\n-----Is string:\".gettype ($id);\n $input = file_get_contents('prj_update.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/projects/\".$id.\"?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/projects/\".$id.\"?owner=wawong\";\n\n //echo \"\\nURL:\".$url;\n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_put($url,$data);\n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n \n }", "public function update(Structure $structure = null)\n {\n\n }", "public function updateModuleFile() {\n\t\t$module = Yii::app()->db->createCommand(\"SELECT * FROM {$this->_moduleTableName} WHERE enabled=1\")->queryAll();\n\n\t\tif(count($module) > 0) {\n\t\t\t$config = \"<?php \\n\";\n\t\t\t$config .= \"return array(\\n\\t'modules' => array(\\n\";\n\t\t\t$i = 1;\n\t\t\tforeach($module as $val) {\n\t\t\t\tif($i !== count($module))\n\t\t\t\t\t$config .= \"\\t\\t'\" . $val['name'] . \"',\\n\";\n\t\t\t\telse\n\t\t\t\t\t$config .= \"\\t\\t'\" . $val['name'] . \"'\\n\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t$config .= \"\\t),\\n);\";\n\n\t\t}else {\n\t\t\t$config = \"<?php \\n\";\n\t\t\t$config .= \"return array(\\n\\t'modules' => array(\\n\";\n\t\t\t$config .= \"\\t),\\n);\";\n\t\t}\n\n\t\t$fileHandle = @fopen(Yii::getPathOfAlias('application.config').'/module_addon.php', 'w');\n\t\t@fwrite($fileHandle, $config, strlen($config));\n\t\t@fclose($fileHandle);\n\t}", "function update( $parent ) {\n\t\techo '<p>' . JText::_('COM_MAPYANDEX_UPDATE_ to ' . $this->release) . '</p>';\n\t\t// You can have the backend jump directly to the newly updated component configuration page\n\t\t// $parent->getParent()->setRedirectURL('index.php?option=com_democompupdate');\n\t}", "public function update($current = '')\r\n {\r\n // Are they the same?\r\n if (version_compare($current, $this->version) >= 0) {\r\n return false;\r\n }\r\n\r\n // Two Digits? (needs to be 3)\r\n if (strlen($current) == 2) $current .= '0';\r\n\r\n $update_dir = PATH_THIRD.strtolower($this->module_name).'/updates/';\r\n\r\n // Does our folder exist?\r\n if (@is_dir($update_dir) === true) {\r\n // Loop over all files\r\n $files = @scandir($update_dir);\r\n\r\n if (is_array($files) == true) {\r\n foreach ($files as $file) {\r\n if (strpos($file, '.php') === false) continue;\r\n if (strpos($file, '_') === false) continue; // For legacy: XXX.php\r\n if ($file == '.' OR $file == '..' OR strtolower($file) == '.ds_store') continue;\r\n\r\n // Get the version number\r\n $ver = substr($file, 0, -4);\r\n $ver = str_replace('_', '.', $ver);\r\n\r\n // We only want greater ones\r\n if (version_compare($current, $ver) >= 0) continue;\r\n\r\n require $update_dir . $file;\r\n $class = 'TaggerUpdate_' . str_replace('.', '', $ver);\r\n $UPD = new $class();\r\n $UPD->update();\r\n }\r\n }\r\n }\r\n\r\n // Upgrade The Module\r\n $module = $module = ee('Model')->make('Module')->filter('module_name', ucfirst($this->module_name))->first();\r\n $module->module_version = $this->version;\r\n $module->save();\r\n\r\n return true;\r\n }", "private function syncRepository()\n {\n $cwd = '/tmp/'.$this->migrationId;\n (new ProcessBuilder(['mkdir']))->add('-p')->add($cwd)->getProcess()->mustRun();\n\n $cloneSourceCommandBuilder = new ProcessBuilder(['git', 'clone', $this->sourceProject->getSshUrlToRepo(), '.']);\n $cloneSourceCommandBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $addNewRemoteBuilder = new ProcessBuilder(['git', 'remote', 'add', 'new']);\n $addNewRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->add($this->targetProject->getSshUrlToRepo())\n ->getProcess()\n ->mustRun();\n\n $pushToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--all']);\n $pushToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n\n $pushTagsToRemoteBuilder = new ProcessBuilder(['git', 'push', 'new', '--tags']);\n $pushTagsToRemoteBuilder\n ->setWorkingDirectory($cwd)\n ->setTimeout(self::TIMEOUT)\n ->getProcess()\n ->mustRun();\n }", "public function update()\n\t{\n\t\t$parent = $this->projectService->getProject($this->projectid);\n\t\t$otherParent = null;\n\t\t// load the current state\n\t\t$current = $this->dbService->getById($this->id, 'Feature');\n\t\tif ($current->projectid != $this->projectid) {\n\t\t\t$otherParent = $this->projectService->getProject($current->projectid);\n\t\t}\n\t\t// $mostRecent = $this->versioningService->getMostRecentVersion($this);\n\t\tif ($this->isChanged(array('estimated', 'title', 'description', 'milestone', 'projectid'), $current)) {\n\t\t\tif ($otherParent) {\n\t\t\t\t$this->versioningService->createVersion($otherParent, 'featureupdate');\n\t\t\t}\n\n\t\t\tif ($parent) {\n\t\t\t\t$this->versioningService->createVersion($parent, 'featureupdate');\n\t\t\t}\n\n\t\t\t$this->versioningService->createVersion($current);\n\t\t}\n\t}", "function update( $revision = false ) {\n if( ! empty( $revision ) ) {\n $output = $this->_exec( \"checkout {$revision}\" );\n } else {\n $output = $this->_exec( 'checkout' );\n }\n return $output;\n }", "public function init_repo() {\n\n\t\t\t// we don't need to maintain local repos for slim deploys\n\t\t\tif ( SLIM ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// if the repo is already initialised, we don't need to\n\t\t\tif ( is_dir( \"wpd-repos/{$this->config->repo[ 'name' ]}/.git\" ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// store the directory we're in right now, so we can come back\n\t\t\t$original_dir = getcwd();\n\n\t\t\t// switch the repo's directory\n\t\t\tchdir( \"wpd-repos/{$this->config->repo[ 'name' ]}\" );\n\n\t\t\t// initialise git\n\t\t\texec( 'git init' );\n\n\t\t\t// add the remote repo as a remote called origin\n\t\t\texec( \"git remote add origin \" . $this->config->repo[ 'git_url' ] );\n\n\t\t\t// switch back to the original directory\n\t\t\tchdir( $original_dir );\n\t\t}", "public function update(){\n foreach (the()->project->languages as $lang){\n $field=\"url_$lang\";\n if($this->urlExists($this->$field,$lang)){\n $increment=1;\n $url=$this->$field.'-'.$increment;\n while($this->urlExists($url,$lang)){\n $increment++;\n $url=$this->$field.'-'.$increment;\n }\n $this->$field=$url;\n }\n $this->$field=strtolower($this->$field);\n $this->$field=pov()->utils->string->clean($this->$field,\"/\");\n }\n\n\n parent::update();\n\n }", "public function update( &$object );" ]
[ "0.6352754", "0.62736017", "0.62188935", "0.6126489", "0.61173105", "0.6097582", "0.59442025", "0.58423793", "0.57919323", "0.56713325", "0.5399237", "0.5386539", "0.5345828", "0.5247123", "0.5239834", "0.5188823", "0.5187624", "0.5172651", "0.5166288", "0.51377773", "0.5131772", "0.51078904", "0.5107167", "0.5086902", "0.50764215", "0.50764215", "0.50330925", "0.4997766", "0.49944785", "0.49906388", "0.49731112", "0.49678582", "0.4950982", "0.49493185", "0.49478382", "0.4941145", "0.49400192", "0.49338585", "0.4927971", "0.4918028", "0.49054462", "0.48948687", "0.4870547", "0.48615485", "0.48353562", "0.48089293", "0.47861734", "0.47691473", "0.476758", "0.4759771", "0.47547576", "0.47438958", "0.4730043", "0.47279084", "0.469611", "0.46779394", "0.46660048", "0.4654112", "0.4653464", "0.46345466", "0.46341023", "0.46333185", "0.46299717", "0.461672", "0.4611354", "0.4608259", "0.45934656", "0.45801035", "0.4570809", "0.45702162", "0.45666024", "0.45594466", "0.4555019", "0.45432767", "0.45265695", "0.45232314", "0.4518872", "0.45171696", "0.45154208", "0.4502702", "0.45024297", "0.44942394", "0.4488053", "0.44785994", "0.44719037", "0.44671208", "0.445841", "0.4456391", "0.44431922", "0.4441783", "0.44198945", "0.44091567", "0.44088045", "0.44020677", "0.43971097", "0.43943593", "0.4387542", "0.43866363", "0.43857712", "0.43798953" ]
0.80790377
0
HTTP Protocol defined status codes
static function send_http_status($code) { static $_status = array( // Informational 1xx 100 => 'Continue', 101 => 'Switching Protocols', // Success 2xx 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', 204 => 'No Content', 205 => 'Reset Content', 206 => 'Partial Content', // Redirection 3xx 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', // 1.1 303 => 'See Other', 304 => 'Not Modified', 305 => 'Use Proxy', // 306 is deprecated but reserved 307 => 'Temporary Redirect', // Client Error 4xx 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found', 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Timeout', 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed', 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Long', 415 => 'Unsupported Media Type', 416 => 'Requested Range Not Satisfiable', 417 => 'Expectation Failed', // Server Error 5xx 500 => 'Internal Server Error', 501 => 'Not Implemented', 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Timeout', 505 => 'HTTP Version Not Supported', 509 => 'Bandwidth Limit Exceeded' ); if(array_key_exists($code,$_status)) { header('HTTP/1.1 '.$code.' '.$_status[$code]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getStatusCode();", "function status($code) {\n $reason=@constant('self::HTTP_'.$code);\n if (PHP_SAPI!='cli')\n header($_SERVER['SERVER_PROTOCOL'].' '.$code.' '.$reason);\n return $reason;\n }", "public function getStatusCode();", "public function getStatusCode();", "public function getStatusCode();", "public function getStatusCode();", "public function getStatusCode();", "public function getStatusCode();", "public function getStatusCode();", "public function getStatusCode();", "public function getStatusCode();", "public function getStatusCode();", "function statusCode()\n {\n }", "function sendHttpStatus($code) \n {\n\t\tstatic $_status = array(\n\t\t\t// Informational 1xx\n\t\t\t100 => 'Continue',\n\t\t\t101 => 'Switching Protocols',\n\n\t\t\t// Success 2xx\n\t\t\t200 => 'OK',\n\t\t\t201 => 'Created',\n\t\t\t202 => 'Accepted',\n\t\t\t203 => 'Non-Authoritative Information',\n\t\t\t204 => 'No Content',\n\t\t\t205 => 'Reset Content',\n\t\t\t206 => 'Partial Content',\n\n\t\t\t// Redirection 3xx\n\t\t\t300 => 'Multiple Choices',\n\t\t\t301 => 'Moved Permanently',\n\t\t\t302 => 'Found', // 1.1\n\t\t\t303 => 'See Other',\n\t\t\t304 => 'Not Modified',\n\t\t\t305 => 'Use Proxy',\n\t\t\t// 306 is deprecated but reserved\n\t\t\t307 => 'Temporary Redirect',\n\n\t\t\t// Client Error 4xx\n\t\t\t400 => 'Bad Request',\n\t\t\t401 => 'Unauthorized',\n\t\t\t402 => 'Payment Required',\n\t\t\t403 => 'Forbidden',\n\t\t\t404 => 'Not Found',\n\t\t\t405 => 'Method Not Allowed',\n\t\t\t406 => 'Not Acceptable',\n\t\t\t407 => 'Proxy Authentication Required',\n\t\t\t408 => 'Request Timeout',\n\t\t\t409 => 'Conflict',\n\t\t\t410 => 'Gone',\n\t\t\t411 => 'Length Required',\n\t\t\t412 => 'Precondition Failed',\n\t\t\t413 => 'Request Entity Too Large',\n\t\t\t414 => 'Request-URI Too Long',\n\t\t\t415 => 'Unsupported Media Type',\n\t\t\t416 => 'Requested Range Not Satisfiable',\n\t\t\t417 => 'Expectation Failed',\n\n\t\t\t// Server Error 5xx\n\t\t\t500 => 'Internal Server Error',\n\t\t\t501 => 'Not Implemented',\n\t\t\t502 => 'Bad Gateway',\n\t\t\t503 => 'Service Unavailable',\n\t\t\t504 => 'Gateway Timeout',\n\t\t\t505 => 'HTTP Version Not Supported',\n\t\t\t509 => 'Bandwidth Limit Exceeded'\n\t\t);\n\t\tif(isset($_status[$code])) {\n\t\t\theader('HTTP/1.1 '.$code.' '.$_status[$code]);\n\t\t}\n\t}", "public static function getStatusCode(): int;", "public function getStatusCode() {}", "public function getStatusCode(): int;", "public function getStatusCode(): int;", "public function getStatusCode(): int;", "public function getStatusCode(): int;", "function http_status_code($code, $message = \"\") {\n\n if (!empty($code)) {\n\n switch ($code) {\n case 100: $text = 'Continue'; break;\n case 101: $text = 'Switching Protocols'; break;\n case 200: $text = 'OK'; break;\n case 201: $text = 'Created'; break;\n case 202: $text = 'Accepted'; break;\n case 203: $text = 'Non-Authoritative Information'; break;\n case 204: $text = 'No Content'; break;\n case 205: $text = 'Reset Content'; break;\n case 206: $text = 'Partial Content'; break;\n case 300: $text = 'Multiple Choices'; break;\n case 301: $text = 'Moved Permanently'; break;\n case 302: $text = 'Moved Temporarily'; break;\n case 303: $text = 'See Other'; break;\n case 304: $text = 'Not Modified'; break;\n case 305: $text = 'Use Proxy'; break;\n case 400: $text = 'Bad Request'; break;\n case 401: $text = 'Unauthorized'; break;\n case 402: $text = 'Payment Required'; break;\n case 403: $text = 'Forbidden'; break;\n case 404: $text = 'Not Found'; break;\n case 405: $text = 'Method Not Allowed'; break;\n case 406: $text = 'Not Acceptable'; break;\n case 407: $text = 'Proxy Authentication Required'; break;\n case 408: $text = 'Request Time-out'; break;\n case 409: $text = 'Conflict'; break;\n case 410: $text = 'Gone'; break;\n case 411: $text = 'Length Required'; break;\n case 412: $text = 'Precondition Failed'; break;\n case 413: $text = 'Request Entity Too Large'; break;\n case 414: $text = 'Request-URI Too Large'; break;\n case 415: $text = 'Unsupported Media Type'; break;\n case 500: $text = 'Internal Server Error'; break;\n case 501: $text = 'Not Implemented'; break;\n case 502: $text = 'Bad Gateway'; break;\n case 503: $text = 'Service Unavailable'; break;\n case 504: $text = 'Gateway Time-out'; break;\n case 505: $text = 'HTTP Version not supported'; break;\n default:\n exit('Unknown http status code \"' . htmlentities($code) . '\"');\n break;\n }\n\n $protocol = (isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0');\n \n // Append the content if not empty\n if (!empty($message)) $message = \" - \" . $message;\n\n header($protocol . ' ' . $code . ' ' . $text . \"$message\");\n\n $GLOBALS['http_status_code'] = $code;\n\n } else {\n\n $code = (isset($GLOBALS['http_status_code']) ? $GLOBALS['http_status_code'] : 200);\n\n }\n\n // We must kill the requisition\n die($code);\n }", "public function status_code()\n {\n }", "private function codes()\n {\n $a_http_status_codes = array(\n 100 => 'Continue', 102 => 'Processing',\n 200 => 'OK', 201 => 'Created', 202 => 'Accepted', 203 => 'Non-Authoritative Information', 204 => 'No Content',\n 205 => 'Reset Content', 206 => 'Partial Content', 207 => 'Multi-Status', 208 => 'Already Reported',\n 226 => 'IM Used', 300 => 'Multiple Choices', 301 => 'Moved Permanently', 302 => 'Found', 303 => 'See Other',\n 304 => 'Not Modified', 305 => 'Use Proxy', 307 => 'Temporary Redirect', 308 => 'Permanent Redirect',\n 400 => 'Bad Request', 401 => 'Unauthorized', 402 => 'Payment Required', 403 => 'Forbidden', 404 => 'Not Found',\n 405 => 'Method Not Allowed', 406 => 'Not Acceptable', 407 => 'Proxy Authentication Required', 408 => 'Request Timeout',\n 409 => 'Conflict', 410 => 'Gone', 411 => 'Length Required', 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large', 414 => 'Request-URI Too Long', 415 => 'Unsupported Media Type',\n 416 => 'Requested Range Not Satisfiable', 417 => 'Expectation Failed', 421 => 'Misdirected Request',\n 422 => 'Unprocessable Entity', 423 => 'Locked', 424 => 'Failed Dependency', 426 => 'Upgrade Required',\n 428 => 'Precondition Required', 429 => 'Too Many Requests', 431 => 'Request Header Fields Too Large',\n 451 => 'Unavailable For Legal Reasons', 500 => 'Internal Server Error', 501 => 'Not Implemented',\n 502 => 'Bad Gateway', 503 => 'Service Unavailable', 504 => 'Gateway Timeout', 505 => 'HTTP Version Not Supported',\n 506 => 'Variant Also Negotiates', 507 => 'Insufficient Storage', 508 => 'Loop Detected',\n 510 => 'Not Extended', 511 => 'Network Authentication Required'\n );\n return $a_http_status_codes;\n }", "protected static function statusCode($code=null) {\r\n\t\tstatic $current_status;\r\n\t\t\r\n\t\tif ($code) {\r\n $protocol = isset($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0';\r\n\t\t\t$current_status = $code;\r\n\t\t\theader($protocol. ' ' . static::$messages[$code]);\r\n\t\t}\r\n\t\treturn $current_status?:200;\r\n\t}", "public function getStatusCode()\n {\n }", "function getHttpCode();", "public function httpCode($code=null){\n\t\t// FIXME: this doesn't take care to differentiate which codes are\n\t\t// in HTTP/1.0 vs HTTP/1.1; should it?\n\t\t$phrases = array(\n\t\t\t100 => \"Continue\",\n\t\t\t101 => \"Switching Protocols\",\n\n\t\t\t200 => \"OK\",\n\t\t\t201 => \"Created\",\n\t\t\t202 => \"Accepted\",\n\t\t\t203 => \"Non-Authoritative Information\",\n\t\t\t204 => \"No Content\",\n\t\t\t205 => \"Reset Content\",\n\t\t\t206 => \"Partial Content\",\n\n\t\t\t300 => \"Multiple Choices\", // useful for disambiguation?\n\t\t\t301 => \"Moved Permanently\",\n\t\t\t302 => \"Found\",\n\t\t\t303 => \"See Other\",\n\t\t\t304 => \"Not Modified\",\n\t\t\t305 => \"Use Proxy\",\n\t\t\t307 => \"Temporary Redirect\",\n\n\t\t\t400 => \"Bad Request\",\n\t\t\t401 => \"Unauthorized\", // use when auth'ing will make a request valid\n\t\t\t403 => \"Forbidden\", // use when auth'ing won't make a difference\n\t\t\t404 => \"Not Found\",\n\t\t\t405 => \"Method Not Allowed\", // HTTP method, e.g. using GET when only POST is valid\n\t\t\t406 => \"Not Acceptable\",\n\t\t\t407 => \"Proxy Authentication Required\",\n\t\t\t408 => \"Request Timeout\",\n\t\t\t409 => \"Conflict\",\n\t\t\t410 => \"Gone\", // something existed but was intentionally removed\n\t\t\t411 => \"Length Required\",\n\t\t\t412 => \"Precondition Failed\",\n\t\t\t413 => \"Request Entity Too Large\",\n\t\t\t414 => \"Request-URI Too Long\",\n\t\t\t415 => \"Unsupported Media Type\",\n\t\t\t416 => \"Requested Range Not Satisfiable\",\n\t\t\t417 => \"Expectation Failed\",\n\n\t\t\t500 => \"Internal Server Error\",\n\t\t\t501 => \"Not Implemented\",\n\t\t\t502 => \"Bad Gateway\",\n\t\t\t503 => \"Service Unavailable\",\n\t\t\t504 => \"Gateway Timeout\",\n\t\t);\n\n\t\tif(!is_null($code)){\n\t\t\tif(!array_key_exists($code, $phrases)){\n\t\t\t\t$code = 404;\n\t\t\t}\n\t\t\theader(\"HTTP/1.1 $code {$phrases[$code]}\");\n\t\t\t$this->httpResponseCode = $code;\n\t\t}\n\n\t\treturn \"HTTP/1.1 $this->httpResponseCode {$phrases[$this->httpResponseCode]}\";\n\t}", "public function getHttpStatus(): int\n {\n\n return http_response_code();\n\n }", "function http_translate_code( $code ) {\n\t\t// Check the given parameters\n\t\tif( ! is_int( $code ) ) {\n\t\t\tthrow new \\InvalidArgumentException( 'Status is expected to be an integer.' );\n\t\t}\n\t\t// Return the string matching the given code.\n\t\tswitch( $code ) {\n\t\t\tcase 100: return 'Continue'; break;\n\t\t\tcase 101: return 'Switching Protocols'; break;\n\t\t\tcase 200: return 'OK'; break;\n\t\t\tcase 201: return 'Created'; break;\n\t\t\tcase 202: return 'Accepted'; break;\n\t\t\tcase 203: return 'Non-Authoritative Information'; break;\n\t\t\tcase 204: return 'No Content'; break;\n\t\t\tcase 205: return 'Reset Content'; break;\n\t\t\tcase 206: return 'Partial Content'; break;\n\t\t\tcase 300: return 'Multiple Choices'; break;\n\t\t\tcase 301: return 'Moved Permanently'; break;\n\t\t\tcase 302: return 'Moved Temporarily'; break;\n\t\t\tcase 303: return 'See Other'; break;\n\t\t\tcase 304: return 'Not Modified'; break;\n\t\t\tcase 305: return 'Use Proxy'; break;\n\t\t\tcase 400: return 'Bad Request'; break;\n\t\t\tcase 401: return 'Unauthorized'; break;\n\t\t\tcase 402: return 'Payment Required'; break;\n\t\t\tcase 403: return 'Forbidden'; break;\n\t\t\tcase 404: return 'Not Found'; break;\n\t\t\tcase 405: return 'Method Not Allowed'; break;\n\t\t\tcase 406: return 'Not Acceptable'; break;\n\t\t\tcase 407: return 'Proxy Authentication Required'; break;\n\t\t\tcase 408: return 'Request Time-out'; break;\n\t\t\tcase 409: return 'Conflict'; break;\n\t\t\tcase 410: return 'Gone'; break;\n\t\t\tcase 411: return 'Length Required'; break;\n\t\t\tcase 412: return 'Precondition Failed'; break;\n\t\t\tcase 413: return 'Request Entity Too Large'; break;\n\t\t\tcase 414: return 'Request-URI Too Large'; break;\n\t\t\tcase 415: return 'Unsupported Media Type'; break;\n\t\t\tcase 500: return 'Internal Server Error'; break;\n\t\t\tcase 501: return 'Not Implemented'; break;\n\t\t\tcase 502: return 'Bad Gateway'; break;\n\t\t\tcase 503: return 'Service Unavailable'; break;\n\t\t\tcase 504: return 'Gateway Time-out'; break;\n\t\t\tcase 505: return 'HTTP Version not supported'; break;\n\t\t}\n\t\t// Default is null\n\t\treturn null;\n\t}", "public function getResponseCode();", "public function getResponseCode();", "function getHttpStatus();", "function http_send_status($status) {}", "public function getStatusCode(){\n return $this->httpResponseCode;\n }", "public function status(int $code);", "public static function getStatus() {\n\t\treturn http_response_code();\n\t}", "public function getStatusCode(): int\n {\n return $this->code ;\n }", "function status_header($code = 200) {\n $message = [\n 200 => \"OK\",\n 404 => \"Page not found\",\n 302 => \"Moved temporarily\",\n 303 => \"Something something\",\n 500 => \"Server error\"\n ];\n header(\"HTTP/1.0 \".$code.\" \".$message[$code]);\n}", "private function _requestStatus($code) {\n $status = array( \n 200 => 'OK',\n 404 => 'Not Found', \n 405 => 'Method Not Allowed',\n 500 => 'Internal Server Error',\n \t); \n return ($status[$code])?$status[$code]:$status[500]; \n }", "function set_status_header($code = 200, $text = '') {\n $stati = array(\n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 203 => 'Non-Authoritative Information',\n 204 => 'No Content',\n 205 => 'Reset Content',\n 206 => 'Partial Content',\n\n 300 => 'Multiple Choices',\n 301 => 'Moved Permanently',\n 302 => 'Found',\n 304 => 'Not Modified',\n 305 => 'Use Proxy',\n 307 => 'Temporary Redirect',\n\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 403 => 'Forbidden',\n 404 => 'Not Found',\n 405 => 'Method Not Allowed',\n 406 => 'Not Acceptable',\n 407 => 'Proxy Authentication Required',\n 408 => 'Request Timeout',\n 409 => 'Conflict',\n 410 => 'Gone',\n 411 => 'Length Required',\n 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large',\n 414 => 'Request-URI Too Long',\n 415 => 'Unsupported Media Type',\n 416 => 'Requested Range Not Satisfiable',\n 417 => 'Expectation Failed',\n\n 500 => 'Internal Server Error',\n 501 => 'Not Implemented',\n 502 => 'Bad Gateway',\n 503 => 'Service Unavailable',\n 504 => 'Gateway Timeout',\n 505 => 'HTTP Version Not Supported'\n );\n\n if ($code == '' OR !is_numeric($code)) {\n show_error('Status codes must be numeric', 500);\n }\n\n if (isset($stati[$code]) AND $text == '') {\n $text = $stati[$code];\n }\n\n if ($text == '') {\n show_error('No status text available. Please check your status code number or supply your own message text.', 500);\n }\n\n $server_protocol = (isset($_SERVER['SERVER_PROTOCOL'])) ? $_SERVER['SERVER_PROTOCOL'] : FALSE;\n\n if (substr(php_sapi_name(), 0, 3) == 'cgi') {\n header(\"Status: {$code} {$text}\", TRUE);\n }\n elseif ($server_protocol == 'HTTP/1.1' OR $server_protocol == 'HTTP/1.0') {\n header($server_protocol . \" {$code} {$text}\", TRUE, $code);\n }\n else {\n header(\"HTTP/1.1 {$code} {$text}\", TRUE, $code);\n }\n}", "protected function getHttpResponseCodes() {\n return array (\n 100 => 'Continue',\n 101 => 'Switching Protocols',\n 102 => 'Processing',\n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 203 => 'Non-Authoritative Information',\n 204 => 'No Content',\n 205 => 'Reset Content',\n 206 => 'Partial Content',\n 207 => 'Multi-Status',\n 300 => 'Multiple Choices',\n 301 => 'Moved Permanently',\n 302 => 'Found',\n 303 => 'See Other',\n 304 => 'Not Modified',\n 305 => 'Use Proxy',\n 306 => 'Switch Proxy',\n 307 => 'Temporary Redirect',\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 402 => 'Payment Required',\n 403 => 'Forbidden',\n 404 => 'Not Found',\n 405 => 'Method Not Allowed',\n 406 => 'Not Acceptable',\n 407 => 'Proxy Authentication Required',\n 408 => 'Request Timeout',\n 409 => 'Conflict',\n 410 => 'Gone',\n 411 => 'Length Required',\n 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large',\n 414 => 'Request-URI Too Long',\n 415 => 'Unsupported Media Type',\n 416 => 'Requested Range Not Satisfiable',\n 417 => 'Expectation Failed',\n 418 => 'I\\'m a teapot',\n 422 => 'Unprocessable Entity',\n 423 => 'Locked',\n 424 => 'Failed Dependency',\n 425 => 'Unordered Collection',\n 426 => 'Upgrade Required',\n 449 => 'Retry With',\n 450 => 'Blocked by Windows Parental Controls',\n 500 => 'Internal Server Error',\n 501 => 'Not Implemented',\n 502 => 'Bad Gateway',\n 503 => 'Service Unavailable',\n 504 => 'Gateway Timeout',\n 505 => 'HTTP Version Not Supported',\n 506 => 'Variant Also Negotiates',\n 507 => 'Insufficient Storage',\n 509 => 'Bandwidth Limit Exceeded',\n 510 => 'Not Extended'\n );\n }", "private function _requestStatus($code) {\n $status = array( \n 200 => 'OK',\n 404 => 'Not Found', \n 405 => 'Method Not Allowed',\n 500 => 'Internal Server Error',\n ); \n return ($status[$code]) ? $status[$code] : $status[500]; \n }", "public function getHTTPStatusCode() { return $this->status; }", "private function __requestStatus( $code )\n {\n $status = array( \n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 402 => 'Request Limit Reached',\n 404 => 'Not Found', \n 405 => 'Method Not Allowed',\n 500 => 'Internal Server Error',\n ); \n return ( $status[$code] ) ? $status[$code] : $status[500]; \n }", "public function getResponseCode()\n {\n }", "function status_header($code) {\n\t$desc = get_status_header_desc($code);\n\tif (empty($desc)) return false;\n\t$protocol = $_SERVER['SERVER_PROTOCOL'];\n\tif('HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol) $protocol = 'HTTP/1.0';\n\t$status_header = \"$protocol $code $desc\";\n\treturn @header($status_header, true, $code);\n}", "public static function httpStatus($_code) {\n\t\tif (!defined('self::HTTP_'.$_code)) {\n\t\t\t// Invalid status code\n\t\t\tself::$global['CONTEXT']=$_code;\n\t\t\ttrigger_error(self::TEXT_HTTP);\n\t\t\treturn FALSE;\n\t\t}\n\t\t// Get description\n\t\t$_response=constant('self::HTTP_'.$_code);\n\t\t// Send raw HTTP header\n\t\tif (PHP_SAPI!='cli' && !self::$global['QUIET'] && !headers_sent())\n\t\t\theader('HTTP/1.1 '.$_code.' '.$_response);\n\t\treturn $_response;\n\t}", "public static function http_code( $code = null ) {\n\t\t// -- Check if a status code was defined\n\t\tif( $code !== null ) {\n\n\t\t\t// -- Get the proper HTTP status code\n\t\t\tswitch( $code ) {\n\t\t\t\tcase 100: $text = 'Continue'; break;\n\t\t\t\tcase 101: $text = 'Switching Protocols'; break;\n\t\t\t\tcase 200: $text = 'OK'; break;\n\t\t\t\tcase 201: $text = 'Created'; break;\n\t\t\t\tcase 202: $text = 'Accepted'; break;\n\t\t\t\tcase 203: $text = 'Non-Authoritative Information'; break;\n\t\t\t\tcase 204: $text = 'No Content'; break;\n\t\t\t\tcase 205: $text = 'Reset Content'; break;\n\t\t\t\tcase 206: $text = 'Partial Content'; break;\n\t\t\t\tcase 300: $text = 'Multiple Choices'; break;\n\t\t\t\tcase 301: $text = 'Moved Permanently'; break;\n\t\t\t\tcase 302: $text = 'Moved Temporarily'; break;\n\t\t\t\tcase 303: $text = 'See Other'; break;\n\t\t\t\tcase 304: $text = 'Not Modified'; break;\n\t\t\t\tcase 305: $text = 'Use Proxy'; break;\n\t\t\t\tcase 400: $text = 'Bad Request'; break;\n\t\t\t\tcase 401: $text = 'Unauthorized'; break;\n\t\t\t\tcase 402: $text = 'Payment Required'; break;\n\t\t\t\tcase 403: $text = 'Forbidden'; break;\n\t\t\t\tcase 404: $text = 'Not Found'; break;\n\t\t\t\tcase 405: $text = 'Method Not Allowed'; break;\n\t\t\t\tcase 406: $text = 'Not Acceptable'; break;\n\t\t\t\tcase 407: $text = 'Proxy Authentication Required'; break;\n\t\t\t\tcase 408: $text = 'Request Time-out'; break;\n\t\t\t\tcase 409: $text = 'Conflict'; break;\n\t\t\t\tcase 410: $text = 'Gone'; break;\n\t\t\t\tcase 411: $text = 'Length Required'; break;\n\t\t\t\tcase 412: $text = 'Precondition Failed'; break;\n\t\t\t\tcase 413: $text = 'Request Entity Too Large'; break;\n\t\t\t\tcase 414: $text = 'Request-URI Too Large'; break;\n\t\t\t\tcase 415: $text = 'Unsupported Media Type'; break;\n\t\t\t\tcase 500: $text = 'Internal Server Error'; break;\n\t\t\t\tcase 501: $text = 'Not Implemented'; break;\n\t\t\t\tcase 502: $text = 'Bad Gateway'; break;\n\t\t\t\tcase 503: $text = 'Service Unavailable'; break;\n\t\t\t\tcase 504: $text = 'Gateway Time-out'; break;\n\t\t\t\tcase 505: $text = 'HTTP Version not supported'; break;\n\t\t\t\tdefault:\n\t\t\t\t\texit( 'Unknown http status code \"' . htmlentities( $code ) . '\"' );\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$protocol = ( isset( $_SERVER[ 'SERVER_PROTOCOL' ] ) ? $_SERVER[ 'SERVER_PROTOCOL' ] : 'HTTP/1.0' );\n\n\t\t\theader($protocol . ' ' . $code . ' ' . $text);\n\n\t\t\t$GLOBALS[ 'http_response_code' ] = $code;\n\n\t\t} else {\n\t\t\t$code = ( isset( $GLOBALS[ 'http_response_code' ] ) ? $GLOBALS[ 'http_response_code' ] : 200 );\n\t\t}\n\n\t\treturn $code;\n\t}", "function setStatusCode($code);", "public function getStatusCode()\n {\n return static::STATUS_CODE;\n }", "function set_status_header(int $p_code = 200, string $p_text = '') {\n if (flcCommon::is_cli()) {\n return;\n }\n\n /* if (empty($p_code) or !is_numeric($p_code)) {\n $p_text = 'Status code must be numeric';\n $p_code = 500;\n }*/\n\n if (empty($p_text)) {\n is_int($p_code) or $p_code = (int)$p_code;\n\n if (isset(self::$status_codes[$p_code])) {\n $p_text = self::$status_codes[$p_code];\n } else {\n $p_text = '(null)';\n $p_code = 500;\n }\n }\n\n if (strpos(PHP_SAPI, 'cgi') === 0) {\n header('Status: '.$p_code.' '.$p_text, true);\n } else {\n header($this->get_protocol_version().' '.$p_code.' '.$p_text, true, $p_code);\n }\n }", "public function getStatusCode(): int\n {\n return match ($this->status) {\n ActionResponseStatus::CLIENT_ERROR => 400,\n ActionResponseStatus::CREATED => 201,\n ActionResponseStatus::SUCCESS => 200,\n ActionResponseStatus::DELETED => 204,\n ActionResponseStatus::NOT_FOUND => 404,\n ActionResponseStatus::PERISTENCE_ERROR => 409,\n default => 500,\n };\n }", "public function getStatusCode()\n {\n preg_match(\"/(\\d\\d\\d)/\", $this->_status, $matches);\n return isset($matches[1]) ? (int) $matches[1] : 0;\n }", "static function set_status_header($code = 200, $text = '')\n\t{\n\t\t$stati = array(\n\t\t\t\t\t\t200\t=> 'OK',\n\t\t\t\t\t\t201\t=> 'Created',\n\t\t\t\t\t\t202\t=> 'Accepted',\n\t\t\t\t\t\t203\t=> 'Non-Authoritative Information',\n\t\t\t\t\t\t204\t=> 'No Content',\n\t\t\t\t\t\t205\t=> 'Reset Content',\n\t\t\t\t\t\t206\t=> 'Partial Content',\n\n\t\t\t\t\t\t300\t=> 'Multiple Choices',\n\t\t\t\t\t\t301\t=> 'Moved Permanently',\n\t\t\t\t\t\t302\t=> 'Found',\n\t\t\t\t\t\t304\t=> 'Not Modified',\n\t\t\t\t\t\t305\t=> 'Use Proxy',\n\t\t\t\t\t\t307\t=> 'Temporary Redirect',\n\n\t\t\t\t\t\t400\t=> 'Bad Request',\n\t\t\t\t\t\t401\t=> 'Unauthorized',\n\t\t\t\t\t\t403\t=> 'Forbidden',\n\t\t\t\t\t\t404\t=> 'Not Found',\n\t\t\t\t\t\t405\t=> 'Method Not Allowed',\n\t\t\t\t\t\t406\t=> 'Not Acceptable',\n\t\t\t\t\t\t407\t=> 'Proxy Authentication Required',\n\t\t\t\t\t\t408\t=> 'Request Timeout',\n\t\t\t\t\t\t409\t=> 'Conflict',\n\t\t\t\t\t\t410\t=> 'Gone',\n\t\t\t\t\t\t411\t=> 'Length Required',\n\t\t\t\t\t\t412\t=> 'Precondition Failed',\n\t\t\t\t\t\t413\t=> 'Request Entity Too Large',\n\t\t\t\t\t\t414\t=> 'Request-URI Too Long',\n\t\t\t\t\t\t415\t=> 'Unsupported Media Type',\n\t\t\t\t\t\t416\t=> 'Requested Range Not Satisfiable',\n\t\t\t\t\t\t417\t=> 'Expectation Failed',\n\n\t\t\t\t\t\t500\t=> 'Internal Server Error',\n\t\t\t\t\t\t501\t=> 'Not Implemented',\n\t\t\t\t\t\t502\t=> 'Bad Gateway',\n\t\t\t\t\t\t503\t=> 'Service Unavailable',\n\t\t\t\t\t\t504\t=> 'Gateway Timeout',\n\t\t\t\t\t\t505\t=> 'HTTP Version Not Supported'\n\t\t\t\t\t);\n\n\t\tif ($code == '' OR ! is_numeric($code))\n\t\t{\n\t\t\tself::show_error('Status codes must be numeric', 500);\n\t\t}\n\n\t\tif (isset($stati[$code]) AND $text == '')\n\t\t{\t\t\t\t\n\t\t\t$text = $stati[$code];\n\t\t}\n\t\n\t\tif ($text == '')\n\t\t{\n\t\t\tself::show_error('No status text available. Please check your status code number or supply your own message text.', 500);\n\t\t}\n\t\n\t\t$server_protocol = (isset($_SERVER['SERVER_PROTOCOL'])) ? $_SERVER['SERVER_PROTOCOL'] : FALSE;\n\n\t\tif (substr(php_sapi_name(), 0, 3) == 'cgi')\n\t\t{\n\t\t\theader(\"Status: {$code} {$text}\", TRUE);\n\t\t}\n\t\telseif ($server_protocol == 'HTTP/1.1' OR $server_protocol == 'HTTP/1.0')\n\t\t{\n\t\t\theader($server_protocol.\" {$code} {$text}\", TRUE, $code);\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader(\"HTTP/1.1 {$code} {$text}\", TRUE, $code);\n\t\t}\n\t}", "function get_http_response_code()\n\t{\n\t\t//最后一个收到的HTTP代码\n\t\treturn curl_getinfo($this->ch, CURLINFO_HTTP_CODE);\n\t}", "public function getStatusCode()\n {\n \treturn $this->statusCode;\n }", "public function getStatusCode(): int\n {\n return $this->meta['status_code'];\n }", "public static function status(int $httpCode = null)\n {\n if ($httpCode === null) return self::$httpCode;\n self::$httpCode = $httpCode;\n }", "public function getStatusCode() {\n\t\treturn $this->status['code'];\n\t}", "public function get_status_code(): int {\n if (empty($this->status_code)) {\n throw new RuntimeException(\"HTTP Response is missing a status code\");\n }\n\n return $this->status_code;\n }", "public function getStatusCode()\n {\n // TODO: Implement getStatusCode() method.\n }", "public function getStatusCode()\n {\n return $this->statusCode ?: 200;\n }", "public function getHttpCode()\n {\n return $this->code;\n }", "function http_headers_get_response_code() {\n\t\treturn $this->http_response_code;\n\t}", "public function getStatusCode(): int\n {\n return $this->status;\n }", "function get_status_header_desc($code) {\n\t$codes_to_desc = array(\n\t\t\t100 => 'Continue',\n\t\t\t101 => 'Switching Protocols',\n\t\t\t102 => 'Processing',\n\n\t\t\t200 => 'OK',\n\t\t\t201 => 'Created',\n\t\t\t202 => 'Accepted',\n\t\t\t203 => 'Non-Authoritative Information',\n\t\t\t204 => 'No Content',\n\t\t\t205 => 'Reset Content',\n\t\t\t206 => 'Partial Content',\n\t\t\t207 => 'Multi-Status',\n\t\t\t226 => 'IM Used',\n\n\t\t\t300 => 'Multiple Choices',\n\t\t\t301 => 'Moved Permanently',\n\t\t\t302 => 'Found',\n\t\t\t303 => 'See Other',\n\t\t\t304 => 'Not Modified',\n\t\t\t305 => 'Use Proxy',\n\t\t\t306 => 'Reserved',\n\t\t\t307 => 'Temporary Redirect',\n\n\t\t\t400 => 'Bad Request',\n\t\t\t401 => 'Unauthorized',\n\t\t\t402 => 'Payment Required',\n\t\t\t403 => 'Forbidden',\n\t\t\t404 => 'Not Found',\n\t\t\t405 => 'Method Not Allowed',\n\t\t\t406 => 'Not Acceptable',\n\t\t\t407 => 'Proxy Authentication Required',\n\t\t\t408 => 'Request Timeout',\n\t\t\t409 => 'Conflict',\n\t\t\t410 => 'Gone',\n\t\t\t411 => 'Length Required',\n\t\t\t412 => 'Precondition Failed',\n\t\t\t413 => 'Request Entity Too Large',\n\t\t\t414 => 'Request-URI Too Long',\n\t\t\t415 => 'Unsupported Media Type',\n\t\t\t416 => 'Requested Range Not Satisfiable',\n\t\t\t417 => 'Expectation Failed',\n\t\t\t422 => 'Unprocessable Entity',\n\t\t\t423 => 'Locked',\n\t\t\t424 => 'Failed Dependency',\n\t\t\t426 => 'Upgrade Required',\n\n\t\t\t500 => 'Internal Server Error',\n\t\t\t501 => 'Not Implemented',\n\t\t\t502 => 'Bad Gateway',\n\t\t\t503 => 'Service Unavailable',\n\t\t\t504 => 'Gateway Timeout',\n\t\t\t505 => 'HTTP Version Not Supported',\n\t\t\t506 => 'Variant Also Negotiates',\n\t\t\t507 => 'Insufficient Storage',\n\t\t\t510 => 'Not Extended'\n\t);\n\t\n\tif(check_value($codes_to_desc[$code])) {\n\t\treturn $codes_to_desc[$code];\t\n\t}\n\t\n}", "public function getStatusCode()\r\n\t{\r\n\t\treturn $this->m_code;\r\n\t}", "public static function status($code=200,$msg=null,$return=false){\n\t\t\tif($msg===null)\n\t\t\t\tswitch($code){\n\t\t\t\t\t// 1xx Informational\n\t\t\t\t\tcase 100: $msg='HTTP/1.1 100 Continue'; break;\n\t\t\t\t\tcase 101: $msg='HTTP/1.1 101 Switching Protocols'; break;\n\t\t\t\t\tcase 102: $msg='HTTP/1.1 102 Processing'; break;\n\t\t\t\t\t// 2xx Success\n\t\t\t\t\tcase 200: $msg='HTTP/1.0 200 OK'; break;\n\t\t\t\t\tcase 201: $msg='HTTP/1.0 201 Created'; break;\n\t\t\t\t\tcase 202: $msg='HTTP/1.0 202 Acepted'; break;\n\t\t\t\t\tcase 203: $msg='HTTP/1.0 203 Non-Authoritative Information'; break;\n\t\t\t\t\tcase 204: $msg='HTTP/1.0 204 No Content'; break;\n\t\t\t\t\tcase 205: $msg='HTTP/1.0 205 Reset Content'; break;\n\t\t\t\t\tcase 206: $msg='HTTP/1.0 206 Partial Content'; break;\n\t\t\t\t\tcase 207: $msg='HTTP/1.0 207 Multi-Status'; break;\n\t\t\t\t\tcase 226: $msg='HTTP/1.0 226 IM Used'; break;\n\t\t\t\t\t// 3xx Redirection\n\t\t\t\t\tcase 300: $msg='HTTP/1.0 300 Multiple Choices'; break;\n\t\t\t\t\tcase 301: $msg='HTTP/1.0 301 Moved Permanently'; break;\n\t\t\t\t\tcase 302: $msg='HTTP/1.0 302 Found'; break;\n\t\t\t\t\tcase 303: $msg='HTTP/1.0 303 See Other'; break;\n\t\t\t\t\tcase 304: $msg='HTTP/1.0 304 Not Modified'; break;\n\t\t\t\t\tcase 305: $msg='HTTP/1.0 305 Use Proxy'; break;\n\t\t\t\t\tcase 306: $msg='HTTP/1.0 306 Switch Proxy'; break;\n\t\t\t\t\tcase 307: $msg='HTTP/1.0 307 Temporary Redirect'; break;\n\t\t\t\t\t// 4xx Client Error\n\t\t\t\t\tcase 400: $msg='HTTP/1.0 400 Bad Request'; break;\n\t\t\t\t\tcase 401: $msg='HTTP/1.0 401 Unauthorized'; break;\n\t\t\t\t\tcase 402: $msg='HTTP/1.0 402 Payment Required'; break;\n\t\t\t\t\tcase 403: $msg='HTTP/1.0 403 Forbidden'; break;\n\t\t\t\t\tcase 404: $msg='HTTP/1.0 404 Not Found'; break;\n\t\t\t\t\tcase 405: $msg='HTTP/1.0 405 Method Not Allowed'; break;\n\t\t\t\t\tcase 406: $msg='HTTP/1.0 406 Not Acceptable'; break;\n\t\t\t\t\tcase 407: $msg='HTTP/1.0 407 Proxy Authentication Required'; break;\n\t\t\t\t\tcase 408: $msg='HTTP/1.0 408 Request Timeout'; break;\n\t\t\t\t\tcase 409: $msg='HTTP/1.0 409 Conflict'; break;\n\t\t\t\t\tcase 410: $msg='HTTP/1.0 410 Gone'; break;\n\t\t\t\t\tcase 411: $msg='HTTP/1.0 411 Length Required'; break;\n\t\t\t\t\tcase 412: $msg='HTTP/1.0 412 Precondition Failed'; break;\n\t\t\t\t\tcase 413: $msg='HTTP/1.0 413 Request Entity Too Large'; break;\n\t\t\t\t\tcase 414: $msg='HTTP/1.0 414 Request-URI Too Long'; break;\n\t\t\t\t\tcase 415: $msg='HTTP/1.0 415 Unsupported Media Type'; break;\n\t\t\t\t\tcase 416: $msg='HTTP/1.0 416 Requested Range Not Satisfiable'; break;\n\t\t\t\t\tcase 417: $msg='HTTP/1.0 417 Expectation Failed'; break;\n\t\t\t\t\tcase 418: $msg='HTTP/1.0 418 I\\'m a teapot'; break;\n\t\t\t\t\tcase 422: $msg='HTTP/1.0 422 Unprocessable Entity'; break;\n\t\t\t\t\tcase 423: $msg='HTTP/1.0 423 Locked'; break;\n\t\t\t\t\tcase 424: $msg='HTTP/1.0 424 Failed Dependency'; break;\n\t\t\t\t\tcase 425: $msg='HTTP/1.0 425 Unordered Collection'; break;\n\t\t\t\t\tcase 426: $msg='HTTP/1.0 426 Upgrade Required'; break;\n\t\t\t\t\tcase 444: $msg='HTTP/1.0 444 No Response'; break;\n\t\t\t\t\tcase 449: $msg='HTTP/1.0 449 Retry With'; break;\n\t\t\t\t\tcase 450: $msg='HTTP/1.0 450 Blocked by Windows Parental Controls'; break;\n\t\t\t\t\tcase 499: $msg='HTTP/1.0 499 Client Closed Request'; break;\n\t\t\t\t\t// 5xx Server Error\n\t\t\t\t\tcase 500: $msg='HTTP/1.0 500 Internal Server Error'; break;\n\t\t\t\t\tcase 501: $msg='HTTP/1.0 501 Not Implemented'; break;\n\t\t\t\t\tcase 502: $msg='HTTP/1.0 502 Bad Gateway'; break;\n\t\t\t\t\tcase 503: $msg='HTTP/1.0 503 Service Unavailable'; break;\n\t\t\t\t\tcase 504: $msg='HTTP/1.0 504 Gateway Timeout'; break;\n\t\t\t\t\tcase 505: $msg='HTTP/1.0 505 HTTP Version Not Supported'; break;\n\t\t\t\t\tcase 506: $msg='HTTP/1.0 506 Variant Also Negotiates'; break;\n\t\t\t\t\tcase 507: $msg='HTTP/1.0 507 Insufficient Storage'; break;\n\t\t\t\t\tcase 509: $msg='HTTP/1.0 509 Bandwidth Limit Exceeded'; break;\n\t\t\t\t\tcase 510: $msg='HTTP/1.0 510 Not Extended'; break;\n\t\t\t\t\t// The default (?)\n\t\t\t\t\t$msg='HTTP/1.1 '.(int)$code.' Unknown';\n\t\t\t\t}\n\t\t\tif($return)return $msg;\n\t\t\tif(!headers_sent())header($msg,true,$code);\n\t\t\treturn !headers_sent();\n\t\t}", "public function getStatusCode(): int\n {\n return $this->statusCode;\n }", "public function getStatusCode(): int\n {\n return $this->statusCode;\n }", "public function getStatusCode(): int\n {\n return $this->statusCode;\n }", "public function getStatusCode(): int\n {\n return $this->statusCode;\n }", "public function getStatusCode(): int\n {\n return $this->statusCode;\n }", "public function getStatusCode(): int\r\n {\r\n return $this->_statusCode;\r\n }", "public function getStatusCode(): int\n {\n return (int) $this->response->getStatusCode();\n }", "function status($new = null)\n {\n static $code = 200;\n if ( ! empty($new) )\n ($code = $new) && hdrs('x-horus-status', 'a horus response', true, $new);\n return $code;\n }", "public function getStatusCode(): int\n {\n return $this->response->getStatusCode();\n }", "public function getStatusCode()\n {\n return \\http_response_code();\n }", "public function getHttpCode(): int\n {\n return $this->httpCode;\n }", "private function getStatusMessage(){\n\t\t$status = array(\n\t\t\t\t100 => 'Continue', \n\t\t\t\t101 => 'Switching Protocols', \n\t\t\t\t200 => 'OK',\n\t\t\t\t201 => 'Created', \n\t\t\t\t202 => 'Accepted', \n\t\t\t\t203 => 'Non-Authoritative Information', \n\t\t\t\t204 => 'No Content', \n\t\t\t\t205 => 'Reset Content', \n\t\t\t\t206 => 'Partial Content', \n\t\t\t\t300 => 'Multiple Choices', \n\t\t\t\t301 => 'Moved Permanently', \n\t\t\t\t302 => 'Found', \n\t\t\t\t303 => 'See Other', \n\t\t\t\t304 => 'Not Modified', \n\t\t\t\t305 => 'Use Proxy', \n\t\t\t\t306 => '(Unused)', \n\t\t\t\t307 => 'Temporary Redirect', \n\t\t\t\t400 => 'Bad Request', \n\t\t\t\t401 => 'Unauthorized', \n\t\t\t\t402 => 'Payment Required', \n\t\t\t\t403 => 'Forbidden', \n\t\t\t\t404 => 'Not Found', \n\t\t\t\t405 => 'Method Not Allowed', \n\t\t\t\t406 => 'Not Acceptable', \n\t\t\t\t407 => 'Proxy Authentication Required', \n\t\t\t\t408 => 'Request Timeout', \n\t\t\t\t409 => 'Conflict', \n\t\t\t\t410 => 'Gone', \n\t\t\t\t411 => 'Length Required', \n\t\t\t\t412 => 'Precondition Failed', \n\t\t\t\t413 => 'Request Entity Too Large', \n\t\t\t\t414 => 'Request-URI Too Long', \n\t\t\t\t415 => 'Unsupported Media Type', \n\t\t\t\t416 => 'Requested Range Not Satisfiable', \n\t\t\t\t417 => 'Expectation Failed', \n\t\t\t\t500 => 'Internal Server Error', \n\t\t\t\t501 => 'Not Implemented', \n\t\t\t\t502 => 'Bad Gateway', \n\t\t\t\t503 => 'Service Unavailable', \n\t\t\t\t504 => 'Gateway Timeout', \n\t\t\t\t505 => 'HTTP Version Not Supported');\n\t\treturn ($status[$this->_code]) ? $status[$this->_code] : $status[500];\n\t}", "public function getStatusCode() : int\n {\n return $this->statusCode;\n }", "public function getStatusCode() : int\n {\n return $this->statusCode;\n }", "private function _getStatusCodeMessage($status)\n{\n // via parse_ini_file()... however, this will suffice\n // for an example\n $codes = Array(\n 200 => 'OK',\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 402 => 'Payment Required',\n 403 => 'Forbidden',\n 404 => 'Not Found',\n 500 => 'Internal Server Error',\n\n 501 => 'Not Implemented',\n );\n return (isset($codes[$status])) ? $codes[$status] : '';\n}", "public function getStatusCode()\n {\n return $this->statusCode;\n }", "public function getResponseCode() {\n return nullInt($this->settings['status'], 200);\n }", "public function getStatusCode()\n {\n return isset($this->headers['statusCode']) ? $this->headers['statusCode']: 500;\n }", "public function getHttpStatusCode();", "public function getStatusCode(): int {\n\t\treturn $this->statusCode;\n\t}", "public function getStatusCode(): int {\n\t\treturn $this->statusCode;\n\t}", "public function getResponseHTTPCode()\n {\n return $this->httpCode;\n }", "public function getStatusCode() {\n\n return $this->result->status_code;\n }", "public function statusCode()\n {\n return $this->code;\n }", "function http_response_code($newcode = NULL)\n\t\t{\n\t\t\tstatic $code = 200;\n\t\t\tif($newcode !== NULL)\n\t\t\t{\n\t\t\t\theader('X-PHP-Response-Code: '.$newcode, true, $newcode);\n\t\t\t\tif(!headers_sent())\n\t\t\t\t\t$code = $newcode;\n\t\t\t}\n\t\t\treturn $code;\n\t }", "public function getStatusCode(): int\r\n {\r\n // TODO: Implement getStatusCode() method.\r\n return $this->statusCode;\r\n }", "public function getStatusCode() {\n return $this->getResponse()->statuscode;\n }", "function http_response_code($response_code = 0) { \r\n \r\n if($response_code)\r\n Pancake\\vars::$Pancake_request->answerCode = $response_code;\r\n return Pancake\\vars::$Pancake_request->answerCode;\r\n }", "public function testImportRawHttpResponseWithADifferentStatusCode()\n {\n $this->testImportingRawHttpResponseString(array('status' => 201));\n }", "public function _getStatusCodeMessage($status) {\n // via parse_ini_file()... however, this will suffice\n // for an example\n $codes = Array(\n 100 => 'Continue',\n 101 => 'Switching Protocols',\n 200 => 'OK',\n 201 => 'Created',\n 202 => 'Accepted',\n 203 => 'Non-Authoritative Information',\n 204 => 'No Content',\n 205 => 'Reset Content',\n 206 => 'Partial Content',\n 300 => 'Multiple Choices',\n 301 => 'Moved Permanently',\n 302 => 'Found',\n 303 => 'See Other',\n 304 => 'Not Modified',\n 305 => 'Use Proxy',\n 306 => '(Unused)',\n 307 => 'Temporary Redirect',\n 400 => 'Bad Request',\n 401 => 'Unauthorized',\n 402 => 'Payment Required',\n 403 => 'Forbidden',\n 404 => 'Oops! Something has gone wrong and the page you were looking for could not be found! Try the <a href=\"\" class=\"color-blue\">home page.</a>',\n 405 => 'Method Not Allowed',\n 406 => 'Not Acceptable',\n 407 => 'Proxy Authentication Required',\n 408 => 'Request Timeout',\n 409 => 'Conflict',\n 410 => 'Gone',\n 411 => 'Length Required',\n 412 => 'Precondition Failed',\n 413 => 'Request Entity Too Large',\n 414 => 'Request-URI Too Long',\n 415 => 'Unsupported Media Type',\n 416 => 'Requested Range Not Satisfiable',\n 417 => 'Expectation Failed',\n 500 => \"We're sorry because something went wrong, please try again!\",\n 501 => 'Not Implemented',\n 502 => 'Bad Gateway',\n 503 => 'Service Unavailable',\n 504 => 'Gateway Timeout',\n 505 => 'HTTP Version Not Supported',\n );\n return (isset($codes[$status])) ? $codes[$status] : 'Unknown Result';\n }", "public function getHttpCode()\r\n {\r\n return $this->http_code;\r\n }", "public function getCode()\n\t{\n\t\treturn (int)$this->statusCode;\n\t}" ]
[ "0.80333334", "0.7950692", "0.78298646", "0.78298646", "0.78298646", "0.78298646", "0.78298646", "0.78298646", "0.78298646", "0.78298646", "0.78298646", "0.78298646", "0.7758959", "0.7717988", "0.7671815", "0.7669618", "0.7667927", "0.7667927", "0.7667927", "0.7667927", "0.7617642", "0.7523816", "0.74787486", "0.74527746", "0.7425309", "0.7392302", "0.73846674", "0.7353478", "0.7347535", "0.73468536", "0.73468536", "0.73440766", "0.73160464", "0.73093766", "0.7306787", "0.7274404", "0.72691447", "0.72593796", "0.7245186", "0.72222525", "0.7207023", "0.7173293", "0.71723294", "0.71565586", "0.7121848", "0.7111604", "0.71109414", "0.7098273", "0.70920175", "0.7079875", "0.70242876", "0.70161057", "0.70113266", "0.7002951", "0.6973946", "0.695319", "0.69402814", "0.69396263", "0.69306684", "0.69290096", "0.6925854", "0.6904107", "0.68973255", "0.6895834", "0.68956196", "0.6894887", "0.68820137", "0.68819255", "0.6881528", "0.6881528", "0.6881528", "0.6881528", "0.6881528", "0.6871305", "0.68702483", "0.6869102", "0.6864641", "0.6861887", "0.6851399", "0.6847997", "0.6844231", "0.6844231", "0.6839341", "0.6836463", "0.68341166", "0.6833064", "0.683008", "0.68235844", "0.68235844", "0.6820353", "0.6815886", "0.68139124", "0.68045706", "0.68042696", "0.68016416", "0.6795825", "0.6786336", "0.6782236", "0.6775388", "0.6769153" ]
0.770462
14
Automatically pulls folders from the images/photography, displays
public function makePhotographyGallery() { $imagePath = 'images/photography'; $imageFiles = File::allFiles($imagePath); return view('pages/photography')->with(compact('imagePath', 'imageFiles')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show_images(){\n\t\t\t$dir = '../pictures/';\n\t\t\t//checks if is an actual directory, opens it and reads each and returns filename.ext\n\t\t\tif (is_dir($dir)) {\n\t\t\t if ($dh = opendir($dir)) {\n\t\t\t while (($file = readdir($dh)) !== false) {\n\t\t\t \tif( $file == '.' || $file == '..'){//readdir returns ., .. before actual filenames\n \t\tcontinue;//they are ignored\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//href value is to a include file showlarge.inc.php\n\t\t\t\t\t\techo \"<a href=?value=showlarge&value={$file}>\";\n\t\t\t\t\t\techo \"<img class = 'picture' src='{$dir}{$file}'></a>\";\n\t\t\t }\n\t\t\t closedir($dh);\n\t\t\t }\n\t\t\t}\n\t\t}", "function getImagesDirectory($limitImages=0) { \t\t \n if (is_dir($this->config['startingpoint'])) {\n \t\t $images = array(); \n \t\t $images = $this->getFiles($this->config['startingpoint']); \t\n // randomise and limit image items returned from images array\n // also useful to limit items in array to 1 item for use when no javascript in browser\n // if $limitImages=0 then this if statement is bypassed and all images in images array returned for processing\n if ($limitImages>0) {\n \t$images=$this->getSlicedRandomArray($images,0,$limitImages);\n }\n\n $content.= $this->beginGallery($this->cObj->data['uid'],$limitImages);\n\n // read the description from field in flexforms\n \t$caption = explode(\"\\n\",$this->config['text']);\n \n // add the images\n foreach ($images as $key=>$value) {\n $path = $this->config['startingpoint'].$value;\n \n // caption text\n $text =explode('|',$caption[$key]);\n \n // add element to slideshow\n $content.=$this->addImage(\n \t\t\t $path,\n $text[0], \n $text[1],\n $this->config['showThumbs'],\n $this->config['showLightbox'],\n $path,\n $limitImages\n );\n \n } # end foreach file\n \n \t\t $content.=$this->endGallery();\n \t\t} # end is_dir \n \t\treturn $content;\n }", "private function images()\n {\n return File::allFiles(public_path('img/gallery'));\n }", "function albums_site_show_images($album) {\n\tglobal $lang;\n\n\tif (!file_exists(ALBUMS_DIR.'/'.$album))\n\t\techo '<p>'.$lang['albums']['doesnt_exist'].'</p>';\n\n\telse {\n\t\t$images = albums_get_images($album);\n\t\tif ($images != FALSE) {\n\t\t\tforeach ($images as $image) {\n\t\t\t\t?>\n\t\t\t\t<div class=\"album\">\n\t\t\t\t\t<table>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<a href=\"<?php echo SITE_URL; ?>/data/modules/albums/albums_getimage.php?image=<?php echo $album; ?>/<?php echo $image['filename_image']; ?>\" rel=\"lytebox[album]\" title=\"<?php echo $image['title']; ?>\">\n\t\t\t\t\t\t\t\t\t<img src=\"<?php echo SITE_URL; ?>/data/modules/albums/albums_getimage.php?image=<?php echo $album; ?>/thumb/<?php echo $image['filename_image']; ?>\" alt=\"<?php echo $image['title']; ?>\" title=\"<?php echo $image['title']; ?>\" />\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<span class=\"albuminfo\"><?php echo $image['title']; ?></span>\n\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t<i><?php echo $image['info']; ?></i>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</div>\n\t\t\t<?php\n\t\t\t}\n\t\t\tunset($image);\n\t\t}\n\t}\n}", "function find_images_do_dir($theme, $subdir, $langs)\n{\n $full = (($theme == 'default' || $theme == 'admin') ? get_file_base() : get_custom_file_base()) . '/themes/' . filter_naughty($theme) . '/' . filter_naughty($subdir);\n $out = array();\n\n $_dir = @opendir($full);\n if ($_dir !== false) {\n while (false !== ($file = readdir($_dir))) {\n if ($file[0] != '.') {\n if (is_dir($full . $file)) {\n $out = array_merge($out, find_images_do_dir($theme, $subdir . $file . '/', $langs));\n } else {\n $ext = substr($file, -4);\n if (($ext == '.png') || ($ext == '.gif') || ($ext == '.jpg') || ($ext == 'jpeg')) {\n $_file = explode('.', $file);\n $_subdir = $subdir;\n foreach (array_keys($langs) as $lang) {\n $_subdir = str_replace('/' . $lang . '/', '/', $_subdir);\n }\n $_subdir = preg_replace('#(^|/)images(\\_custom)?/#', '', $_subdir);\n $out[$_subdir . $_file[0]] = cms_rawurlrecode('themes/' . rawurlencode($theme) . '/' . $subdir . rawurlencode($file));\n }\n }\n }\n }\n\n closedir($_dir);\n }\n\n return $out;\n}", "public function getImages()\n\t\t{\n\t\t\t$this->createDir();\n\t\t\t//sacamos la lista de ficheros de la carpeta photos\n\t\t\t$files = $this->getFileList();\n\t\t\t//array de salida\n\t\t\t$image_List = array();\n\t\t\t\n\t\t\t//recorremos el contenido de esa carpeta\n\t\t\tforeach($files as $file)\n\t\t\t{\n\t\t\t\t//tiene que ser jpg, gif o png para que muestre las imagenes y que no sea . o ..\n\t\t\t\tif($file!=\".\" && $file!=\"..\" && $this->validatePhoto($file))\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t//guardo en el array la lista de imagenes\n\t\t\t\t\tarray_push($image_List, $file);\n\t\t\t\t\t\n\t\t\t\t\t//miro si existe la imagen en el thumbs si no lo creo\n\t\t\t\t\tif(!$this->checkIfFileExistes($file))\n\t\t\t\t\t{\n\t\t\t\t\t\t//como NO existe la minituara la creamos\n\t\t\t\t\t\t$this->createThumb(\"$file\");\n\t\t\t\t\t}\n\t\t\t\t\t//mostramos la miniatura y al hacer clic mostramos original \n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\techo \"<a href='\".$this->ruta.\"/$file' target='_blank' ><img src='\".$this->rutaMini.\"/$file'/></a>\";\t\n\t\t\t\t}\t\t\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}", "public function actionIndex(){\r\n $q = Yii::app()->request->getParam('q'); \r\n $path = Picture::getBasePath();//.DIRECTORY_SEPARATOR.'article';\r\n if ($q) $path .= DIRECTORY_SEPARATOR.$q;\r\n \r\n if (isset($_FILES) && isset($_FILES['newimage'])){\r\n move_uploaded_file($_FILES['newimage']['tmp_name'], $path.DIRECTORY_SEPARATOR.$_FILES['newimage']['name']);\r\n }\r\n \r\n $parent = '';\r\n if ($q != ''){\r\n $qsplit = explode('/', $q);\r\n unset($qsplit[count($qsplit)-1]);\r\n $parent = implode('/', $qsplit);\r\n }\r\n \r\n $dirs = $files = $images = array();\r\n \r\n $objects = scandir($path);\r\n //print_r($objects); exit;\r\n\r\n foreach ($objects as $obj){\r\n $type = filetype($path.'/'.$obj);\r\n if ($type == 'dir'){\r\n $dirs[] = $obj;\r\n } elseif ($type == 'file') {\r\n $ext = strtolower(pathinfo($path.'/'.$obj, PATHINFO_EXTENSION));\r\n if (in_array($ext, array('jpeg', 'png', 'gif', 'jpg', 'bmp'))){\r\n $images[] = $obj;\r\n } else {\r\n $files[] = $obj;\r\n }\r\n }\r\n }\r\n \r\n $this->renderPartial('_catalog', array(\r\n 'path' => $path,\r\n 'dirs' => $dirs,\r\n 'images' => $images,\r\n 'files' => $files,\r\n 'q' => $q,\r\n 'parent' => $parent,\r\n ));\r\n }", "function getUserPhotos ($dir, $userName = '') {\r\n $filesArray = getFilesFromDir($dir);\r\n $outputPhotoBook = '';\r\n foreach ($filesArray as $fileName) {\r\n $outputPhotoBook .= '<div><img src=\"img/' . $userName . '/' . $fileName. '\"></div>';\r\n }\r\n return $outputPhotoBook;\r\n}", "public function presentation_images()\n\t\t{\n\t\t\t$this->is_login();\n\t\t\t$this->load->model('presentation_images_model', 'pim');\n\t\t\t$data['presentation_images'] = $this->pim->get_all();\n $data['presentation_act'] = $this->pim->get_link();\n\t\t\t$this->load->view('presentation_images-admin', $data);\n\t\t}", "public function browse_files()\n {\n // Scan file directory, render the images.\n if (is_dir($this->file_path)) {\n $files = preg_grep('/^([^.])/', scandir($this->file_path));\n return $files;\n }\n \n }", "public function index() {\n $images = Gallery::all();\n // $images = Gallery::all();\n require_once('views/gallery/index.php');\n }", "function get_pages_images_list() {\n\t$files = scandir(BASEPATH . \"/../public/images/pages\");\n\tarray_shift($files); // remove \".\"\n\tarray_shift($files); // remove \"..\"\n\treturn $files;\n}", "function displayImages($albumDir, $whichGallery, $displayMode) {\n\t\t// create var to store name of folder where album of galleries is located\n\t\t$album = $albumDir.'/';\n\t\t\n\t\t//store value of the current target directory\n\t\t$targetGallery = $whichGallery.'/'; //pulled from a function argument 1\n\t\t\n\t\t//set currently selected gallery's pathway\n\t\t$currentGalleryPath = $album.$targetGallery;\n\t\t\n\t\t$large = 'large/'; //large images for cover background images (1800+px)\n\t\t$medium = 'medium/'; //standard size (max = 1100w)\t\n\t\t$small = 'small/'; //thumbnail for lightbox styled gallery (max. - 200w)\n\t\t\n\t\t//store dir to be scanned for contents into an array variable\n\t\t$imageList = scandir($currentGalleryPath.$medium);\n\t\t\n\t\tif (file_exists($currentGalleryPath.$large) &&\n\t\t\tfile_exists($currentGalleryPath.$medium) &&\n\t\t\tfile_exists($currentGalleryPath.$small)\n\t\t\t\n\t\t) {\n\t\t\t\n\t\t\n\t\t//initiate an empty array for unwanted items\n\t\t$unwanted = array();\n\t\t//define acceptable filetypes found in key[2] of getimagesize\n\t\t$acceptable_arrays = array(1,2,3,6,9);\n\t\t//print_r(get_defined_constants());\n\t\t//this defines all constants on the page. Look for imagetype to build array from.\n\t\t\n\t\t//loop through $imageList to remove unwanted items\n\t\tforeach ($imageList as $filename) {\n\t\t\t//check to see if item starts with '.' or if is a directory\n\t\t\tif ((strpos($filename,'.') == 0) || is_dir($filename)) {\n\t\t\t\t//push item into unwanted array\n\t\t\t\tarray_push($unwanted, $filename);\t\n\t\t\t\t//compare current state of $imageList to current state of $unwanted and strip unwanted items from $imageList\n\t\t\t\t$imageList = array_diff($imageList, $unwanted);\n\t\t\t} else {\n\t\t\t\t//store the file info inside $size array using getimagesize\n\t\t\t\t$size = getimagesize($album.$targetGallery.$medium.$filename);\t\n\t\t\t\tif (!$size[2] || !in_array($size[2], $acceptable_arrays)) {\n\t\t\t\t\tarray_push($unwanted, $filename);\t\n\t\t\t\t\t$imageList = array_diff($imageList, $unwanted);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t?>\n\t\n\t\t<?php \n\t\t\t// ----- CREATE FILTERING ARRAYS TO BE USED LATER ----- //\n\t\t\t$fileExt = array('.jpg', '.jpeg', '.png', '.bmp', '.gif'); //for stripping extensions for alt text\n\t\t\t$characters = array('-', '_'); //stripping out special characters in filename for alt text\n\t\t\t\n\t\t\t//create $title of album to use for image gallery info below\n\t\t\t$title = ucwords(str_replace($characters,' ', $whichGallery));\n\t\t?>\n\t\t<?php switch ($displayMode) {\n\t\tcase 'img':\n\t\t\t//----- GRAB RANDOM IMAGE FOR IMG -----//\n\t\t\t\t//testing how array_rand() works ... returns numeric key integer\n\t\t\t\t//echo \"THIS IS THE RANDOM KEY PULLED: \";\n\t\t\t\t//$randomKey = array_rand($imageList);\n\t\t\t\t//$image = $imageList[$randomKey];\n\t\t\t\n\t\t\t//grab random image from $imageList\n\t\t\t$image = $imageList[array_rand($imageList)];\n\t\t\t\n\t\t\t//create alt text for image\n\t\t\t$alt = str_replace($fileExt, '', $image);\n\t\t\t$alt = ucwords(str_replace($characters, ' ', $alt));\n\t\t?>\n\t\t<p class=\"random-image\"><img src=\"<?php echo $currentGalleryPath.$medium.rawurlencode($image) ?>\" alt=\"<?php echo $alt ?>\"></p>\n\t\t<hr>\n\t\t<?php break; ?>\n\t\t<?php\n\t\tcase 'background':\n\t\t//----- GRAB RANDOM IMAGE FOR BACKGROUND -----//\n\t\t$image = $imageList[array_rand($imageList)]; ?>\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tbackground: url(<?php echo $currentGalleryPath.$large.rawurlencode($image) ?>) no-repeat center center;\t\n\t\t\t\t-webkit-background-size: cover;\n\t\t\t\t-moz-background-size: cover;\n\t\t\t\t-o-background-size: cover;\n\t\t\t\tbackground-size: cover;\n\t\t\t}\n\t\t</style>\n\t\t<?php break; ?>\n\t\t<?php\n\t\tcase 'lightbox':\n\t\t// ----- GENERATE THUMBNAIL GALLERY ----- //\n\t\t\n\t\t//call out globals for the lightbox switch case\n\t\tglobal $jquery, $lightbox;\n\t\t//test to see if jquery library has been called\n\t\tif (!isset($jquery)) {\n\t\t\techo '<script src=\"js/jquery-3.1.1.min.js\"></script>'.\"\\n\";\n\t\t\t$jquery = true;\n\t\t}\n\t\t//test to see if lightbox library has been called\n\t\tif (!isset($lightbox)) {\n\t\t\techo '<script src=\"js/lightbox.js\"></script>'.\"\\n\";\n\t\t\techo '<link href=\"css/lightbox.css\" rel=\"stylesheet\">'.\"\\n\";\n\t\t\t$lightbox = true;\n\t\t}\n\t\t?>\n\t\t<h2 class=\"gallery\"><?php echo $title; // announce the gallery?></h2>\n\t\t<ul class=\"gallery\">\n\t\t\t<?php\n\t\t\t\tforeach ($imageList as $image){ \n\t\t\t\t\t//create alt text for image\n\t\t\t\t\t$alt = str_replace($fileExt, '', $image);\n\t\t\t\t\t$alt = ucwords(str_replace($characters, ' ', $alt));\n\t\t\t?>\n\t\t\t\t<li>\n\t\t\t\t\t<a href=\"<?php echo $currentGalleryPath.$medium.rawurlencode($image); ?>\" title=\"<?php echo $alt; ?>\" data-lightbox=\"<?php echo $title; ?>\" >\n\t\t\t\t\t\t<img src=\"<?php echo $currentGalleryPath.$small.rawurlencode($image) ?>\" alt=\"<?php echo $alt; ?>\">\n\t\t\t\t\t</a>\n\t\t\t\t</li>\n\t\t\t<?php } break; ?>\n\t\t</ul>\n \n <?php \n\t\tcase 'slideshow':\n\t\t//call out globals for the lightbox switch case\n\t\t\tglobal $jquery, $slideshow;\n\t\t\t//test to see if jquery library has been called\n\t\t\tif (!isset($jquery)) {\n\t\t\t\techo '<script src=\"js/jquery-3.1.1.min.js\"></script>'.\"\\n\";\n\t\t\t\t$jquery = true;\n\t\t\t}\n\t\t\t//test to see if lightbox library has been called\n\t\t\tif (!isset($slideshow)) {\n\t\t\t\techo ' <script src=\"js/cycle2.min.js\"></script>'.\"\\n\";\n\t\t\t\techo '<link href=\"css/cycle2.css\" rel=\"stylesheet\">'.\"\\n\";\n\t\t\t\t$slideshow = true;\n\t\t\t}\n\t\t?> \n <div class=\"cycle-slideshow\" data-cycle-fx=fadeout data-cycle-speed=1500 Horz data-cycle-timeout=4000>\n <!-- empty element for overlay -->\n <div class=\"cycle-overlay\"></div>\n <?php foreach ($imageList as $image){ \n\t\t\t\t\t//create alt text for image\n\t\t\t\t\t$alt = str_replace($fileExt, '', $image);\n\t\t\t\t\t$alt = ucwords(str_replace($characters, ' ', $alt)); ?>\n <img src=\"<?php echo $currentGalleryPath.$medium.rawurlencode($image); ?>\" data-cycle-title=\"<?php echo $title; ?>\" data-cycle-desc=\"<?php echo $alt; ?>\">\n <?php } //end foreach ?>\n </div>\n<?php break; ?>\n\t\t<?php\n\t\t\n\t\t}//END SWITCH $displayMode\n\t\t} else {\n\t\t\t//print this to screen if the directories cannot be found.\n\t\t\techo \"<p>The selected gallery is not available.</p>\";\t\n\t\t}//END file_exists() FUNCTION\n\t}", "function recur_dir($path, $wpath, $dir)\n{\n global $gallery_id;\n $db = new nggdb_extended();\n\n $images = array();\n $children = array();\n $gal_created = 0;\n\n// Read directory config file\n $config = null;\n if(file_exists($path . '/galleryconf'))\n $config = config_parser($path . '/galleryconf');\n\n// Sort files by filename\n $files = array();\n\n $dhandle = opendir($path);\n while($file = readdir($dhandle))\n array_push($files, $file);\n\n natsort($files);\n\n// Loop over files, generate thumbs and add to gallery\n foreach($files as $file)\n {\n if(!($file === '.svn' || $file === '.' || $file === '..'))\n {\n // decend into directory\n if(is_dir($path .'/'. $file) && $file != 'thumbs')\n {\n print \"\\nEntering: $file\\n\";\n\n $child = recur_dir($path .'/'. $file, $wpath .'/'. $file, $file);\n array_push($children, $child);\n\n print \"\\nLeaving: $file\\n\";\n }\n // prosess images\n else if(preg_match(\"/(.JPG|.PNG|.GIF)/i\", $file))\n {\n if($gal_created == 0)\n {\n // Create gallery\n $db->add_gallery_gid($gallery_id, $dir, \"wp-content/$wpath\", '', 0, $previewpic = 0);\n\n if($config != null)\n {\n $body = $config['body']; \n if(strtolower($config['head']['position']) == 'after')\n $post = \"[nggallery id=$gallery_id]\\n<div style='clear: both;'></div>$body\";\n else\n $post = \"$body\\n[nggallery id=$gallery_id]\";\n }\n else\n $post = \"[nggallery id=$gallery_id]\";\n\n // Create gallary post\n wp_insert_post(array(\n 'post_title' => $dir,\n 'post_name' => $slug,\n 'comment_status' => 'gallery_page',\n 'post_type' => 'page',\n 'post_content' => $post,\n 'post_status' => 'publish',\n 'post_author' => 1));\n\n $gal_created = 1;\n }\n\n // create thumbs\n if(!file_exists(\"$path/thumbs\"))\n mkdir(\"$path/thumbs\");\n\n exec(\"convert -resize 180x180 \\\"$path/$file\\\" \\\"{$path}/thumbs/thumbs_$file\\\"\");\n\n // insert into db\n print \"Added file: $file\\n\";\n $id = $db->insert_image($gallery_id, $file, $file, \"\", 0);\n\n array_push($images, $id);\n }\n }\n }\n\n $return = array(\n 'Name' => $dir,\n 'Path' => $path,\n 'ID' => $gallery_id,\n 'Img' => $images,\n 'Children' => $children);\n\n if($gal_created == 1)\n $gallery_id ++;\n\n// Generate index gallary\n if($config != null && strtolower($config['head']['mode']) == 'index')\n {\n print \"\\n\\n-- making index --\\n\";\n\n $galleries = array();\n get_galleries($return, $galleries);\n\n // make album\n $album_galleries = array();\n\n foreach($galleries as $gallery)\n {\n array_push($album_galleries, $gallery['ID']);\n }\n\n $id = $db->add_album($config['head']['title'], $previewpic = 0, '',serialize($album_galleries) , $pageid = 0);\n\n $body = $config['body']; \n if(strtolower($config['head']['position']) == 'after')\n $post = \"[album id=$id template=compact]\\n<div style='clear: both;'></div>$body\";\n else\n $post = \"$body\\n[album id=$id template=compact]\";\n\n wp_insert_post(array(\n 'post_title' => $config['head']['title'],\n 'post_name' => $config['head']['title'],\n 'comment_status' => 'gallery_page',\n 'post_type' => 'page',\n 'post_content' => $post,\n 'post_status' => 'publish',\n 'post_author' => 1));\n }\n\n return $return;\n}", "function makesitesmages()\n\t{\n\n\t\tglobal $option, $mainframe;\n\n\t\t//First we'll nee access to the file system and we'll use the Joomla way to be all safe.\n\t\tjimport('joomla.filesystem.file');\n\t\t$uploads_path = JPATH_ROOT . DS . \"images\". DS .\"content\" . DS .\"arts_curriculum\". DS . \"masters\" ;\n\t\t$site_path = JPATH_ROOT . DS . \"images\". DS .\"content\" . DS .\"arts_curriculum\". DS . \"site\" ;\n\n\t\t// this is the width in px that we're telling GD to scale to, where's imagemagik when you need it.\n\t\t$new_w = 235;\n\t\t// where our source images live b/c GD needs to read them\n\t\t$cfg_fullsizepics_path = $uploads_path;\n\t\t//where we're sending them when we are done\n\t\t$cfg_thumb_path = $site_path;\n\t\t// we need one more path for this to work\n\t\t$filepath = $uploads_path ;\n\t\t// the directory\n\t\t$dir = dir($filepath);\n\n\t\t//check folders\n\t\t\t\n\t\twhile($entry=$dir->read()) {\n\t\t\t//check the files\n\t\t\tif($entry == \".\" || $entry == \"..\") {\n\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\t\n\t\t\t$fp = @fopen(\"$filepath/$entry\",\"r\");\n\n\t\t\t$photo_filename = \"$entry\";\n\n\t\t\t$image_stats = GetImageSize($cfg_fullsizepics_path.\"/\".$entry);\n\n\t\t\t$imagewidth = $image_stats[0];\n\n\t\t\t$imageheight = $image_stats[1];\n\n\t\t\t$img_type = $image_stats[2];\n\n\t\t\t$ratio = ($imagewidth / $new_w);\n\n\t\t\t$new_h = round($imageheight / $ratio);\n\n\t\t\tif (!file_exists($cfg_thumb_path.\"/\".$entry)) {\n\n\t\t\t\tif ($img_type==\"2\") {\n\n\t\t\t\t\t$src_img = imagecreatefromjpeg($cfg_fullsizepics_path.\"/\".$entry);\n\n\t\t\t\t\t$dst_img = imagecreatetruecolor($new_w,$new_h);\n\n\t\t\t\t\timagecopyresampled($dst_img,$src_img,0,0,0,0,$new_w,$new_h,imagesx($src_img),imagesy($src_img));\n\n\t\t\t\t\timagejpeg($dst_img, \"$cfg_thumb_path\".\"/$entry\", 100);\n\t\t\t\t\t\t\n\t\t\t\t\timagedestroy($dst_img);\n\n\t\t\t\t} elseif ($img_type==\"3\") {\n\n\t\t\t\t\t$src_img=ImageCreateFrompng($cfg_fullsizepics_path.\"/\".$entry);\n\t\t\t\t\t \n\t\t\t\t\t$dst_img=ImageCreateTrueColor($new_w,$new_h);\n\t\t\t\t\t\t\n\t\t\t\t\tImageCopyResampled($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),ImageSY($src_img));\n\n\t\t\t\t\tImagepng($dst_img, \"$cfg_thumb_path\".\"/$entry\",100);\n\n\t\t\t\t\timagedestroy($dst_img);\n\n\t\t\t\t} elseif ($img_type==\"1\") {\n\n\t\t\t\t\t$cfg_thumb_url=$cfg_fullsizepics_url;\n\n\t\t\t\t} \n\n\t\t\t}\n\n\n\t\t\t\t\n\t\t} //the files are now in the /images/content/sketchup/site directory\n\n\n\t\t//$this->setRedirect( 'index.php?option=' . $option.'&task=movesiteimages&controller=items', 'Site Images made' );\n\t\t$this->setRedirect( 'index.php?option=' . $option, 'Site Images made' );\n\t\n\t}", "public function listDirectoryPicturesAndApplyId() \n {\n if (is_dir($this->picturesFolder)){\n $this->files = scandir($this->picturesFolder);\n } else {\n echo 'No image directory';\n }\n \n $values = array();\n foreach ($this->files as $key => $var) {\n if (($var === '.') || ($var === '..') || (substr($var, -4, 1) !== '.')) {\n unset($this->files[$key]);\n } else {\n $id = $this->generateRandomKey();\n $values[] = array(\n 'id' => $id, \n 'picture' => $this->files[$key], \n 'qrcode' => $id . '-qrcode' . $this->outputFileExtension\n ); \n }\n }\n $this->files = $values;\n return (array) $this->files;\n }", "function listDir($user,$dir,$from,$to){\r\n\t$thumbDir=\"thumb/$user/\".$dir;\r\n\t$viewDir=\"view/$user/\".$dir;\r\n\t$imgDir=\"DATASET/$user/\".$dir;\r\n\tif(!file_exists($thumbDir))\r\n\t\t@mkdir($thumbDir);\r\n\tif(!file_exists($viewDir))\r\n\t\t@mkdir($viewDir);\r\n\t$items=array();\r\n\tif ($handle = opendir($imgDir)) {\r\n\t\t/* This is the correct way to loop over the directory. */\r\n\t\t$i=0;\r\n\t\t$prev=\"\";$next=\"\";\r\n\t\t$types=array(\"jpg\",\"jpeg\",\"png\",\"gif\");\r\n\t\twhile (false !== ($entry = readdir($handle))) {\r\n\t\t\t$filename=$imgDir.\"/\".$entry;\r\n\t\t\tif(is_dir($filename)) continue;\r\n\r\n\t\t\t$info = getimagesize($filename);\r\n\r\n\t\t\tdebug($filename);\r\n\t\t\t$pi=pathinfo($filename);\r\n\t\t\tif(!in_array(strtolower($pi['extension']),$types)) continue;\r\n\t\t\tif(isPic($info['2'])){\r\n\t\t\t\t$i++;\r\n\t\t\t\tif($i==$from) $prev=$entry;\r\n\t\t\t\tif($i<=$from) continue;\r\n\t\t\t\tif($i==$to+1) $next=$entry;\r\n\t\t\t\tif($i>$to) break;\r\n\r\n\t\t\t\t$width=$info['0'];\r\n\t\t\t\t$height=$info['1'];\r\n\t\t\t\t$size=$width*$height;\r\n\t\t\t\t$thumb=$filename;\r\n\r\n\t\t\t\t$n=1;\r\n\t\t\t\t$m=1;\r\n\t\t\t\tif($size>4000*4000) {$n=8;$m=3;}\r\n\t\t\t\telse if($size>3000*3000) {$n=7;$m=3;}\r\n\t\t\t\telse if($size>2000*2000) {$n=6;$m=2;}\r\n\t\t\t\telse if($size>1200*1200) {$n=5;$m=2;}\r\n\t\t\t\telse if($size>600*600) $n=2;\r\n\t\t\t\tif($height>=2.5*$width||$width>=2.5*$height) $n=$n/3>1?$n/3:1;\r\n\r\n\t\t\t\tif($n>1) {\r\n\t\t\t\t\t$thumb=$thumbDir.\"/\".$entry;\r\n\t\t\t\t\tdebug($thumb);\r\n\t\t\t\t\tif(!file_exists($thumb)) {\r\n\t\t\t\t\t\tinclude_once \"thumb.php\";\r\n\t\t\t\t\t\timg2thumb($filename,$thumb,$width/$n,$height/$n,0,0);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$view=$viewDir.\"/\".$entry;\r\n\t\t\t\tdebug($view);\r\n\t\t\t\tif(!file_exists($view)){\r\n\t\t\t\t\tif($m>1){\r\n\t\t\t\t\t\tinclude_once \"thumb.php\";\r\n\t\t\t\t\t\timg2thumb($filename,$view,$width/$m,$height/$m,0,0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse copy($filename,$view);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$item['id']=$i-1;//count its id in the folder\r\n\t\t\t\t$item['href']=$entry;\r\n\t\t\t\t$item['src']=$thumb; $item['width']=$info['0'];$item['height']=$info['1'];\r\n\t\t\t\t$items[]=$item;\r\n\t\t\t}\r\n\t\t}\r\n\t\tclosedir($handle);\r\n\r\n\t\tif(count($items)>0){\r\n\t\t\t//resolve the links\r\n\t\t\t$items[0]['prev']=$prev;\r\n\t\t\t$items[count($items)-1]['next']=$next;\r\n\t\t\tforeach($items as $i=> $item){\r\n\t\t\t\tif($i>0) {\r\n\t\t\t\t\t$items[$i-1]['next']=$items[$i]['href'];\r\n\t\t\t\t\t$items[$i]['prev']=$items[$i-1]['href'];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tdebug(\"desp:...\\n\");\r\n\t\t\tinclude_once \"desp.php\";\r\n\t\t\tgetDesp($user,$dir,$items);\r\n\t\t\tdebug($items);\r\n\t\t}\r\n\t}\r\n\treturn $items;\r\n}", "protected function buildFileAndDirectoryListing()\n {\n $collection = new Collection;\n $files = $this->scanFiles($this->currentDir);\n $thumbnails = $this->buildThumbnails($files);\n $directories = $this->scanDirectory($this->currentDir);\n\n if ($this->getRootDir() <> $this->currentDir) {\n $back_directory = implode('/', explode('/', $this->currentDir, -1));\n $item = [];\n $item['thumbnail'] = '';\n $item['filename'] = '...';\n $item['size'] = '';\n $item['type'] = 'back';\n $item['icon'] = 'fa-reply';\n $item['path'] = $this->currentDir;\n $item['url'] = '?folder=' . $back_directory;\n $item['delete'] = current_user()->can('media.delete');\n $item['select'] = current_user()->can('media.view');\n $collection->add($item);\n }\n\n foreach ($directories as $directory) {\n $directory_name = explode('/', $directory);\n $directory_name = array_pop($directory_name);\n\n $item = [];\n $item['thumbnail'] = '';\n $item['filename'] = $directory_name;\n $item['path'] = $directory;\n $item['size'] = '';\n $item['type'] = 'directory';\n $item['icon'] = 'fa-folder';\n $item['url'] = '?folder=' . $directory;\n $item['delete'] = current_user()->can('media.delete');\n $item['select'] = current_user()->can('media.view');\n\n $collection->add($item);\n }\n\n foreach ($files as $path) {\n $item = [];\n $parts = explode('/', $path);\n $filename = array_pop($parts);\n $size = Storage::size($path);\n $icon = file_ext_to_icon(File::extension($path));\n\n $item['type'] = 'file';\n $item['icon'] = $icon;\n $item['thumbnail'] = '';\n if (file_can_have_thumbnail($path)) {\n $item['type'] = 'image';\n $item['icon'] = 'fa-image';\n $item['thumbnail'] = $thumbnails[$path];\n }\n\n $item['filename'] = $filename;\n $item['size'] = $size;\n $item['url'] = Storage::url($path);\n $item['path'] = $path;\n $item['delete'] = current_user()->can('media.delete');\n $item['select'] = current_user()->can('media.view');\n $collection->add($item);\n }\n\n return $collection;\n }", "public function firstParty()\n {\n $images = [];\n\n foreach ((new Finder())->in($this->path)->directories()->sortByName() as $directory) {\n /* @var $directory \\Symfony\\Component\\Finder\\SplFileInfo */\n $images[] = new Image($this->getImageName($directory, $this->name), $directory->getRealPath());\n }\n\n return $images;\n }", "public function show($folder)\n {\n $root=public_path(config('larapages.media.folder')).Input::all()['folder'];\n $dir=opendir($root);\n $files=[];\n while($file=readdir($dir)) {\n if ($file[0]!='.' && $file!='imageresize.php' && !is_dir($root.'/'.$file)) {\n $files[]=$file;\n }\n }\n natcasesort($files);\n $return='';\n Carbon::setLocale('en');\n \n $preview=['jpg','png','gif','jpeg'];\n \n # Check if Safari version is 9 or higher so we can preview PDF thumbnails\n $ua=$_SERVER['HTTP_USER_AGENT'];\n $safari=strpos($ua, 'Safari') && !strpos($ua, 'Chrome');\n $p=strpos($ua, 'Version/');\n $safariVersion=substr($ua, $p+8, strpos($ua, '.', $p)-$p-8);\n if ($safariVersion>=9) $preview[]='pdf';\n \n foreach($files as $file) {\n $return.='<li>';\n $return.='<a target=\"_blank\" href=\"/'.$this->urlencodeFolder(config('larapages.media.folder'),1).$this->urlencodeFolder(Input::all()['folder'],1).'/'.$this->urlencodeFolder($file,1).'\">';\n $extension=strtolower(substr($file,strrpos($file,'.')+1));\n if (in_array($extension, $preview))\n $return.='<div style=\"background-image:url(\\'/'.$this->urlencodeFolder(config('larapages.media.folder')).$this->urlencodeFolder(Input::all()['folder']).'/'.$this->urlencodeFolder($file).'\\')\">';\n else\n $return.='<div>'.$extension;\n $return.='</div></a>';\n $size=filesize($root.'/'.$file);\n $time=filemtime($root.'/'.$file);\n $time=Carbon::createFromTimeStamp($time)->formatLocalized('%a %d %B %Y').' '.Carbon::createFromTimeStamp($time)->toTimeString(); #->diffForHumans();\n $return.='<span class=\"fileselect\"><input type=\"checkbox\" value=\"x\"></span>';\n $return.='<span class=\"title\">'.$file.'</span>';\n $return.='<span class=\"size\">'.$size.'</span>';\n $return.='<span class=\"time\">'.$time.'</span>';\n $return.='<span class=\"actions\"><a class=\"delete icondelete\"></a></span>';\n $return.='</li>';\n }\n return $return;\n }", "public function getImages(){\n $images =[];\n $files=[];\n $imageDir=opendir(IMAGES_DIR);\n while(false !==($file=readdir($imageDir))){\n // $imageDirから一行ずつ読み込んで,$fileに入れて行く そんでそれがfalseにならない限り回し続ける\n if($file === '.'||$file =='..'){\n // カレントディレクトリやルートディレクトリを飛ばして回す\n continue;\n }\n $files[]=$file;\n //thumnailは imagesdirに存在するのかな\n if(file_exists(THUMBNAIL_DIR.'/'.$file)){\n $images[]=basename(THUMBNAIL_DIR).'/'.$file;\n } else{\n $images[]=basename(IMAGES_DIR).'/'.$file;\n }\n }\n array_multisort($files,SORT_DESC,$images);\n // 逆向き順に$filesに入っているimagesをそr・せよ\n return $images;\n}", "public function GetAlbums()\n {\n if ($handle = opendir('albums')) {\n # Loop thrue all entries in the directory handle untill it reads boolean FALSE\n while (false !== ($entry = readdir($handle))) {\n # Check to not display root and return links\n if ($entry != \".\" && $entry != \"..\") {\n # Display entry link\n include \"../private_html/templates/albumCell.php\";\n }\n }\n closedir($handle);\n }\n }", "function albums_admin_show_images($album) {\n\tglobal $lang, $var1;\n\n\t$images = albums_get_images($album);\n\tif ($images == FALSE)\n\t\techo '<span class=\"kop4\">'.$lang['general']['nothing_yet'].'</span><br />';\n\n\telse {\n\t\tforeach ($images as $image) {\n\t\t\t?>\n\t\t\t\t<div class=\"menudiv\">\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<a href=\"<?php echo MODULE_DIR; ?>/albums_getimage.php?image=<?php echo $var1.'/'.$image['filename_image']; ?>\" target=\"_blank\">\n\t\t\t\t\t\t\t<img src=\"<?php echo MODULE_DIR; ?>/albums_getimage.php?image=<?php echo $var1; ?>/thumb/<?php echo $image['filename_image']; ?>\" title=\"<?php echo $image['title']; ?>\" alt=\"<?php echo $image['title']; ?>\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"title-page\">\n\t\t\t\t\t\t<span class=\"kop3\"><?php echo $image['title']; ?></span>\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t<span class=\"small\"><?php echo $image['info']; ?></span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<a href=\"?module=albums&amp;page=editimage&amp;var1=<?php echo $var1; ?>&amp;var2=<?php echo $image['seoname']; ?>\">\n\t\t\t\t\t\t\t<img src=\"data/image/edit.png\" title=\"<?php echo $lang['albums']['edit_image']; ?>\" alt=\"<?php echo $lang['albums']['edit_image']; ?>\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<a href=\"?module=albums&amp;page=imageup&amp;var1=<?php echo $var1; ?>&amp;var2=<?php echo $image['seoname']; ?>\">\n\t\t\t\t\t\t\t<img src=\"data/image/up.png\" title=\"<?php echo $lang['albums']['change_order']; ?>\" alt=\"<?php echo $lang['albums']['change_order']; ?>\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<a href=\"?module=albums&amp;page=imagedown&amp;var1=<?php echo $var1; ?>&amp;var2=<?php echo $image['seoname']; ?>\">\n\t\t\t\t\t\t\t<img src=\"data/image/down.png\" title=\"<?php echo $lang['albums']['change_order']; ?>\" alt=\"<?php echo $lang['albums']['change_order']; ?>\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<a href=\"?module=albums&amp;page=deleteimage&amp;var1=<?php echo $var1; ?>&amp;var2=<?php echo $image['seoname']; ?>\">\n\t\t\t\t\t\t\t<img src=\"data/image/delete_from_trash.png\" title=\"<?php echo $lang['albums']['delete_image']; ?>\" alt=\"<?php echo $lang['albums']['delete_image']; ?>\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\t\tunset($image);\n\t}\n}", "function get_arr_pics_from_folder( $img_folder, $img_folder_url, $thumb_width = 50, $thumb_height = 50 )\n\t{\n\t\t$arr_filenames = $filesnames =array();\n\t\tif(file_exists($img_folder))\n\t\t{\n\t\t\t$filesnames = scandir($img_folder);\n\t\t}\n\t\t$count = 0;\n\t\tforeach ( $filesnames as $name )\n\t\t{\n\t\t\t$count++;\n\t\t\tif ( $name != \".\" && $name != \"..\" && $name != \"_evocache\" && $this->isImage($img_folder.$name) ) //not the folder and other files\n\t\t\t{\n\t\t\t\t$arr_filenames[] = array( $img_folder_url.$name,\n\t\t\t\t\"<a href='\".$img_folder_url.$name.\"' target='blank'><img src='\".$img_folder_url.$name.\"' width=\".$thumb_width.\"px heigh=\".$thumb_height.\"px /></a>\" );\n\t\t\t}\n\t\t\tif ($count==30) break; // The max number of the images we want to show\n\t\t}\n\t\t$arr_filenames[] = array(\"none\",T_(\"Transparent\"));\n\t\treturn $arr_filenames;\n\t}", "private function prepareImageList() {\n\t\t\tforeach(scandir($this->templateDirectory) as $templateFileName) {\n\t\t\t\tif((strcmp($templateFileName, \".\") !== 0) && (strcmp($templateFileName, \"..\") !== 0)) {\n\t\t\t\t\t$this->imageList->addItem(new Image($this->templateDirectory, $templateFileName), $templateFileName);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function makePhotoshopGallery()\n {\n $imagePath = 'images/photoshop';\n $imageFiles = File::allFiles($imagePath);\n\n return view('pages/photoshop')->with(compact('imagePath', 'imageFiles'));\n }", "function images_add_folder($image_data_url,$folder_name)\r\n{\r\n\t \r\n\t\r\n\t foreach($image_data_url as $file)\r\n {\r\n //get image contents\r\n $image = file_get_contents($file);\r\n\t\t\t\t\t $f_name=explode (\"?\",$file);\r\n\t\t\t\t $image_url=explode('/',$f_name[0]);\r\n $only_name=$image_url[count($image_url)-1];\r\n //put image contents\r\n file_put_contents($folder_name.\"/\".$only_name, $image);\r\n\t\t\t }\r\n}", "function getAllImages() {\r\r\n\t$PView = new PView;\r\r\n\t$Template = new Template;\r\r\n\tglobal $tp;\r\r\n\t\r\r\n\t$pv_Appl = $PView -> getAppl();\r\r\n\t$ImageData = array();\r\r\n\t\r\r\n// prepare album-handling\r\r\n\tif ($pv_Appl[0] == \"album\"){\r\r\n\t\t$ImageCount = $PView -> getAlbumImageCount();\r\r\n\t\t$details = $PView->getPView_config(\"album_details\");\r\r\n\t\t$message = LAN_ALBUM_9;\r\r\n\t}\r\r\n// prepare category-handling\r\r\n\tif ($pv_Appl[0] == \"cat\"){\r\r\n\t\t$ImageCount = $PView -> getCatImageCount($pv_Appl[1]);\r\r\n\t\t$details = $PView->getPView_config(\"cat_details\");\r\r\n\t\t$message = LAN_GALLERY_12;\r\r\n\t}\t\r\r\n// prepare userimage-handling\r\r\n\tif ($pv_Appl[0] == \"user\"){\r\r\n\t\t$ImageCount = $PView -> getUserImageCount($pv_Appl[1]);\r\r\n\t\t$details = $PView->getPView_config(\"user_details\");\r\r\n\t\t$message = LAN_GALLERY_13;\r\r\n\t}\r\r\n\t\r\r\n\tglobal $applImages;\r\r\n\t$ImageData = $PView->sortApplImages($applImages);\r\r\n\t$showDetails = explode(\"|\",$details);\r\r\n\t\r\r\n\tif ($ImageCount) {\r\r\n\t\t$cols = 1;\r\r\n\t\t$pics = $PView -> getPView_config(\"pics_per_page\");\r\r\n\t\t$picCount = 0;\r\r\n\t\t$colwidth = 100/$cols;\r\r\n\t\tif ($_GET['page']) {\r\r\n\t\t\t$page = $_GET['page'];\r\r\n\t\t}\r\r\n\t\t$Pages = ceil($ImageCount/$pics);\r\r\n\t\tif (!$page or $page > $Pages) {\r\r\n\t\t\t$page = 1;\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\t\r\r\n\t\t$out_AllImages = \"<tr>\";\r\r\n\t\tforeach ($ImageData as $dataset) {\r\r\n\t\t\t//PERMISSION!!!\r\r\n\t\t\tif ($PView -> getPermission(\"image\",$dataset['imageId'],\"View\")) {\r\r\n\t\t\t\t// insert images line by line, observe pagelimit\r\r\n\t\t\t\tif ($colCount == $cols) {\r\r\n\t\t\t\t\t$out_AllImages.= \"</tr><tr>\";\r\r\n\t\t\t\t\t$colCount = 0;\r\r\n\t\t\t\t}\r\r\n\t\t\t\tif ($picCount >= ($page - 1) * $pics && $picCount < $page * $pics) {\r\r\n\t\t\t\t\t$thumb = $PView -> getResizePath($dataset['imageId']);\r\r\n\t\t\t\t\tif ($PView->getPView_config(\"seo_links\")){\r\r\n\t\t\t\t\t\t$seo = \"&amp;name=\".$dataset['name'];\r\r\n\t\t\t\t\t} else {\r\r\n\t\t\t\t\t\t$seo = \"\";\r\r\n\t\t\t\t\t}\t\r\r\n\t\t\t\t\tif ($PView->getPView_config(\"center_thumbs\")){\r\r\n\t\t\t\t\t\t$infoPos = \"left:30%;\";\r\r\n\t\t\t\t\t} else{\r\r\n\t\t\t\t\t\t$infoPos = \"left:10px;\";\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t\t$backgr = \"background:url(\".e_PLUGIN.\"pviewgallery/templates/\".$PView -> getPView_config(\"template\").\"/images/gt.png) repeat;\";\t\t\r\r\n\t\t\t\t\t\t\t\t\t\t\r\r\n\t\t\t\t\t$out_AllImages.= \"<td style='vertical-align:top;width:\".$colwidth.\"%; border: #b7b5b5 1px solid; padding:5px; \".$Template->getThumbPosition().\"'><div style='position:relative;'><div style='position:relative;'>\".$Template -> getImageLink($pv_Appl[0],$dataset,'resize','resize','pview_gal').\"</div>\";\r\r\n\t\t\t\t\t\r\r\n\t\t\t\t\t$out_AllImages.= \"<div style='position:absolute; bottom:10px; \".$infoPos.\" width:40%; border: 2px solid #b7b5b5; text-align:left; padding: 5px; \".$backgr.\"'>\";\r\r\n\t\t\t\t\tforeach($showDetails as $detail){\r\r\n\t\t\t\t\t\t\r\r\n\t\t\t\t\t\tswitch($detail){\r\r\n\t\t\t\t\t\t\tcase \"name\":\r\r\n\t\t\t\t\t\t\t$out_AllImages.= \"<span><b>\".$tp -> toHTML($dataset['name']).\"</b></span>\";\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"descr\":\r\r\n\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML($dataset['description']).\"</span>\";\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"user\":\r\r\n\t\t\t\t\t\t\t$userData = $PView->getUserData($dataset['uploaderUserId']);\r\r\n\t\t\t\t\t\t\t// LINK Abfrage: Link zur Anzeige aller Bilder des Users\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"details_link\")){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pviewgallery.php?user=\".$dataset['uploaderUserId'].\"'><span>\".$tp -> toHTML($userData['user_name']).\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML($userData['user_name']).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"cat\":\r\r\n\t\t\t\t\t\t\tif ($catData = $PView -> getCatData($dataset['cat'])){\r\r\n\t\t\t\t\t\t\t\t$catName = $catData['name'];\r\r\n\t\t\t\t\t\t\t} else {\r\r\n\t\t\t\t\t\t\t\t$catName = LAN_IMAGE_46;\r\r\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\r\r\n\t\t\t\t\t\t\t// LINK Abfrage: Link zur Anzeige aller Bilder der Kategorie\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"details_link\") && $dataset['cat']){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pviewgallery.php?cat=\".$dataset['cat'].\"'><span>\".LAN_IMAGE_45.\": \".$tp -> toHTML($catName).\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".LAN_IMAGE_45.\": \".$tp -> toHTML($catName).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"date\":\r\r\n\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML(date('d.m.Y',$dataset['uploadDate'])).\"</span>\";\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"gal\":\r\r\n\t\t\t\t\t\t\t$albumData = $PView->getAlbumData($dataset['albumId']);\r\r\n\t\t\t\t\t\t\t// LINK Abfrage: Link zur Anzeige der Galerie\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"details_link\")){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pviewgallery.php?gallery=\".$albumData['galleryId'].\"'><span>\".$tp -> toHTML($PView->getGalleryName($albumData['galleryId'])).\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML($PView->getGalleryName($albumData['galleryId'])).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"album\":\r\r\n\t\t\t\t\t\t\t// LINK Abfrage: Link zur Anzeige aller Bilder des albums\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"details_link\")){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pviewgallery.php?album=\".$dataset['albumId'].\"'><span>\".$tp -> toHTML($PView->getAlbumName($dataset['albumId'])).\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML($PView->getAlbumName($dataset['albumId'])).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"edit\":\r\r\n\t\t\t\t\t\t\t//PERMISSION!!!\r\r\n\t\t\t\t\t\t\tif ($PView -> getPermission(\"album\",$dataset['sendImage'],\"Edit\")) {\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pview_actions.php?image=\".$dataset['imageId'].\"&amp;action=edit'><span>\".LAN_IMAGE_2.\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"send\":\r\r\n\t\t\t\t\t\t\t//PERMISSION!!!\r\r\n\t\t\t\t\t\t\tif (($PView -> getPView_config(\"email\") && $dataset['sendImage']) OR (ADMIN && $PView -> getPView_config(\"admin_Mode\"))){\r\r\n\t\t\t\t\t\t\t\tif ($PView -> getPermission(\"config\",\"permEmail\",\"\")) {\r\r\n\t\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='\".e_BASE.\"email.php?plugin:pviewgallery.\".$dataset['imageId'].\"'><span>\".LAN_IMAGE_48_1.\"</span></a>\";\r\r\n\t\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"comm\":\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"Comments\")){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br /><span>\".LAN_IMAGE_4.\": \".$PView -> getCommentsCount($dataset['imageId']).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\r\r\n\t\t\t\t\t\t\tbreak;\t\r\r\n\t\t\t\t\t\t\tcase \"rating\":\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"Rating\")){\r\r\n\t\t\t\t\t\t\t\t$ratingData = $PView -> getRatingData($dataset['imageId']);\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br /><span>\".LAN_IMAGE_3.\": \".round($ratingData['value'],1).\" (\".$ratingData['count'].\")</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\t\r\r\n\t\t\t\t\t\t\tcase \"views\":\r\r\n\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".LAN_IMAGE_16.\": \".$tp -> toHTML($dataset['views']).\" \".LAN_IMAGE_17.\"</span>\";\r\r\n\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\r\n\t\t\t\t\t\t}\t\t\t\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t\t$out_AllImages.= \"</div></div></td>\";\t\t\r\r\n\t\t\t\t\t$colCount++;\r\r\n\t\t\t\t}\r\r\n\t\t\t\t$picCount++;\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\t\t// fill row with empty cells\r\r\n\t\twhile ($colCount < $cols) {\r\r\n\t\t\t$out_AllImages.= \"<td>&nbsp;</td>\";\r\r\n\t\t\t$colCount++;\r\r\n\t\t}\r\r\n\t\t$out_AllImages.= \"</tr>\";\r\r\n\t\treturn $out_AllImages;\r\r\n\t}\r\r\n\treturn \"<div style='padding:10px;'>\".$message.\"</div>\";\r\r\n}", "public function assetThumbnailListAction() {\n\t\t$parentFolder = $this->document->getElement ( \"parentFolder\" );\n\t\tif ($parentFolder) {\n\t\t\t$parentFolder = $parentFolder->getElement ();\n\t\t}\n\t\t\n\t\tif (! $parentFolder) {\n\t\t\t// default is the home folder\n\t\t\t$parentFolder = Asset::getById ( 1 );\n\t\t}\n\t\t\n\t\t// get all children of the parent\n\t\t$list = new \\Asset\\Listing ();\n\t\t$list->setCondition ( \"path like ?\", $parentFolder->getFullpath () . \"%\" );\n\t\t\n\t\t$this->view->list = $list;\n\t}", "function print_images()\n {\n $images = $this->service->imageList();\n $image_choice = 0;\n foreach ($images as $image) {\n printf(\"%d) %s: Image %s requires min. %dMB of RAM and %dGB of disk\\n\",\n $image_choice, $image->id, $image->name, $image->minRam,\n $image->minDisk);\n $image_choice += 1;\n }\n }", "function buildGallery ()\t{\n\t\t\t// Get the needed Information\n\t\t\t\n\t\t}", "private function getDirectories()\n {\n $this->load();\n\n $this->data['themeDirectory'] = 'catalog/view/theme/default/';\n $customizedFile = $this->data['themeDirectory'] . 'stylesheet/mundipagg/mundipagg_customized.css';\n\n if (file_exists($customizedFile)) {\n $this->data['customizedFile'] = $customizedFile;\n }\n }", "function ShowGallery($folder, $mask,$thumbWidth,$thumbHeight)\r\n{\r\n\t$images = ListFiles($folder, $mask);\r\n\t?>\r\n\t<div id=\"gallery\" class=\"ad-gallery\" >\r\n\t\t<div class=\"ad-image-wrapper\">\r\n\t\t</div>\r\n\t\t<div class=\"ad-controls\">\r\n\t\t</div>\r\n\t\t<div class=\"ad-nav\">\r\n\t\t\t<div class=\"ad-thumbs\">\r\n\t\t\t\t<ul class=\"ad-thumb-list\">\r\n\t\t\t\t<?php \r\n\t\t\t\t$counter = 0; // for the imageX class (image0,image1,...)\r\n\t\t\t\tforeach ($images as $image)\r\n\t\t\t\t{\r\n\t\t\t\t\t$alt = basename($image,substr($mask,1)); // cut the folder and extension (mask as a \"*\" at begining so without it) \r\n\t\t\t\t\t$alt = str_replace(\"_\", \" \", $alt); // alt is name without underscore\r\n\t\t\t\t\techo\t\"<li>\";\r\n\t\t\t\t\techo \t\t\"<a href='$image'>\";\r\n\t\t\t\t\techo \t\"<img src='$image' alt='$alt' class='image\".$counter.\"' style='width:\".$thumbWidth.\"px; height:\".$thumbHeight.\"px;'/>\";\r\n\t\t\t\t\techo \t\"</a>\";\r\n\t\t\t\t\techo \t\"</li>\";\t\t\t\t\r\n\t\t\t\t}\t// foreach close\r\n\t\t\t\t?>\r\n\t\t\t\t</ul>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</div>\r\n\t<?php \r\n}", "private function fetchImages() {\n\t\ttry {\n\t\t\t\n\t\t\t$images = $this->getParam('fetcher',true);\n\t\t\t$images = explode(chr(13), $images);\n\t\t\tif (sizeof($images > 0)) {\n\n\t\t\t\tif (sizeof($images)==1 && $images[0]=='') {\n\t\t\t\t\tthrow new VCDInvalidInputException('Invalid input!');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Check if the screenshots folder already exist\n\t\t\t\t$destFolder = VCDDB_BASE.DIRECTORY_SEPARATOR.ALBUMS.$this->itemObj->getID().DIRECTORY_SEPARATOR;\n\t\t\t\tif (!$this->itemObj->hasScreenshots()) {\n\t\t\t\t\tif (!fs_is_dir($destFolder)) {\n\t\t\t\t\t\tfs_mkdir($destFolder, 0755);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tforeach ($images as $image) {\n\t\t\t\t\tVCDUtils::grabImage(trim($image), false, $destFolder);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (!MovieServices::getScreenshots($this->itemObj->getID())) {\n\t\t\t\t\tMovieServices::markVcdWithScreenshots($this->itemObj->getID());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception $ex) {\n\t\t\tVCDException::display($ex,true);\n\t\t}\n\t}", "protected function fetchAllImages(){\n $this->fetchImagesInContent();\n $this->fetchFullTextImage();\n $this->fetchIntroImage();\n $this->fetchFirstImageInContent();\n }", "function display_image($picture) {\n return \"uploads\" . DS . $picture;\n}", "private function readImages()\r\n {\r\n if(file_exists($this->location) && is_readable($this->location))\r\n {\r\n $images = array();\r\n\r\n foreach(array_diff(scandir($this->location), array('.', '..')) as $file)\r\n {\r\n if($this->isValidImageType($file))\r\n {\r\n $type = strtolower(pathinfo($file, PATHINFO_EXTENSION));\r\n\r\n if(!in_array($type, $this->extensions))\r\n {\r\n $this->extensions[] = $type;\r\n }\r\n\r\n $images[] = new Image($this->location . '/' . $file);\r\n }\r\n }\r\n\r\n usort($images, function($a, $b) {\r\n return $a->getWidth() > $b->getWidth();\r\n });\r\n\r\n $this->images = $images;\r\n }\r\n }", "function avatar_gallery()\r\n\t{\r\n\t\tglobal $ibforums, $std, $print;\r\n\r\n\t\t$avatar_gallery = array();\r\n\t\t$av_categories = array(0 => array(\"root\", $ibforums->lang['av_root']));\r\n\r\n\t\t$av_cat_selected = preg_replace(\"/[^\\w\\s_\\-]/\", \"\", $ibforums->input['av_cat']);\r\n\t\t$av_cat_found = FALSE;\r\n\t\t$av_human_readable = \"\";\r\n\r\n\t\tif ($av_cat_selected == 'root')\r\n\t\t{\r\n\t\t\t$av_cat_selected = \"\";\r\n\t\t\t$av_human_readable = $ibforums->lang['av_root'];\r\n\t\t}\r\n\r\n\t\t//------------------------------------------\r\n\t\t// Get the avatar categories\r\n\t\t//------------------------------------------\r\n\r\n\t\t$dh = opendir($ibforums->vars['html_dir'] . 'avatars');\r\n\r\n\t\twhile ($file = readdir($dh))\r\n\t\t{\r\n\t\t\tif (is_dir($ibforums->vars['html_dir'] . 'avatars' . \"/\" . $file))\r\n\t\t\t{\r\n\t\t\t\tif ($file != \".\" && $file != \"..\")\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($file == $av_cat_selected)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$av_cat_found = TRUE;\r\n\t\t\t\t\t\t$av_human_readable = str_replace(\"_\", \" \", $file);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$av_categories[] = array($file, str_replace(\"_\", \" \", $file));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tclosedir($dh);\r\n\r\n\t\t//------------------------------------------\r\n\t\t// SORT IT OUT YOU MUPPET!!\r\n\t\t//------------------------------------------\r\n\r\n\t\tusort($av_categories, array('UserCP', 'sort_avatars'));\r\n\t\treset($av_categories);\r\n\r\n\t\t//------------------------------------------\r\n\t\t// Did we find the directory?\r\n\t\t//------------------------------------------\r\n\r\n\t\tif ($av_cat_selected)\r\n\t\t{\r\n\t\t\tif ($av_cat_found != TRUE)\r\n\t\t\t{\r\n\t\t\t\t$std->Error(array('LEVEL' => 1, 'MSG' => 'av_no_gallery'));\r\n\t\t\t}\r\n\r\n\t\t\t$av_cat_real = \"/\" . $av_cat_selected;\r\n\t\t}\r\n\r\n\t\t//------------------------------------------\r\n\t\t// Get the avatar images for this category\r\n\t\t//------------------------------------------\r\n\r\n\t\t$dh = opendir($ibforums->vars['html_dir'] . 'avatars' . $av_cat_real);\r\n\r\n\t\twhile ($file = readdir($dh))\r\n\t\t{\r\n\t\t\tif (!preg_match(\"/^..?$|^index|^\\.ds_store|^\\.htaccess/i\", $file))\r\n\t\t\t{\r\n\t\t\t\tif (is_file($ibforums->vars['html_dir'] . 'avatars' . $av_cat_real . \"/\" . $file))\r\n\t\t\t\t{\r\n\t\t\t\t\tif (preg_match(\"/\\.(gif|jpg|jpeg|png|swf)$/i\", $file))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$av_gall_images[] = $file;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//------------------------------------------\r\n\t\t// SORT IT OUT YOU PLONKER!!\r\n\t\t//------------------------------------------\r\n\r\n\t\tif (is_array($av_gall_images) and count($av_gall_images))\r\n\t\t{\r\n\t\t\tnatcasesort($av_gall_images);\r\n\t\t\treset($av_gall_images);\r\n\t\t}\r\n\r\n\t\t//------------------------------------------\r\n\t\t// Render drop down box..\r\n\t\t//------------------------------------------\r\n\r\n\t\t$av_gals = \"<select name='av_cat' class='forminput'>\\n\";\r\n\r\n\t\tforeach ($av_categories as $cat)\r\n\t\t{\r\n\t\t\t$av_gals .= \"<option value='\" . $cat[0] . \"'>\" . $cat[1] . \"</option>\\n\";\r\n\t\t}\r\n\r\n\t\t$av_gals .= \"</select>\\n\";\r\n\r\n\t\tclosedir($dh);\r\n\r\n\t\t$gal_cols = $ibforums->vars['av_gal_cols'] == \"\"\r\n\t\t\t? 5\r\n\t\t\t: $ibforums->vars['av_gal_cols'];\r\n\t\t$gal_rows = $ibforums->vars['av_gal_rows'] == \"\"\r\n\t\t\t? 3\r\n\t\t\t: $ibforums->vars['av_gal_rows'];\r\n\r\n\t\t$gal_found = count($av_gall_images);\r\n\r\n\t\t//------------------------------------------\r\n\t\t// Produce the avatar gallery sheet\r\n\t\t//------------------------------------------\r\n\r\n\t\t$this->output .= View::make(\r\n\t\t\t\"ucp.avatar_gallery_start_table\",\r\n\t\t\t[\r\n\t\t\t\t'title' => $av_human_readable,\r\n\t\t\t\t'av_gals' => $av_gals,\r\n\t\t\t\t'current_folder' => urlencode($av_cat_selected),\r\n\t\t\t\t'key' => $this->md5_check\r\n\t\t\t]\r\n\t\t);\r\n\r\n\t\t$c = 0;\r\n\r\n\t\tif (is_array($av_gall_images) and count($av_gall_images))\r\n\t\t{\r\n\t\t\tforeach ($av_gall_images as $img)\r\n\t\t\t{\r\n\t\t\t\t$c++;\r\n\r\n\t\t\t\tif ($c == 1)\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->output .= View::make(\"ucp.avatar_gallery_start_row\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$this->output .= View::make(\r\n\t\t\t\t\t\"ucp.avatar_gallery_cell_row\",\r\n\t\t\t\t\t[\r\n\t\t\t\t\t\t'img' => $av_cat_real . \"/\" . $img,\r\n\t\t\t\t\t\t'txt' => str_replace(\"_\", \" \", preg_replace(\"/^(.*)\\.\\w+$/\", \"\\\\1\", $img)),\r\n\t\t\t\t\t\t'form' => urlencode($img)\r\n\t\t\t\t\t]\r\n\t\t\t\t);\r\n\r\n\t\t\t\tif ($c == $gal_cols)\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->output .= View::make(\"ucp.avatar_gallery_end_row\");\r\n\r\n\t\t\t\t\t$c = 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ($c != $gal_cols)\r\n\t\t{\r\n\t\t\tfor ($i = $c; $i < $gal_cols; ++$i)\r\n\t\t\t{\r\n\t\t\t\t$this->output .= View::make(\"ucp.avatar_gallery_blank_row\");\r\n\t\t\t}\r\n\r\n\t\t\t$this->output .= View::make(\"ucp.avatar_gallery_end_row\");\r\n\t\t}\r\n\r\n\t\t$this->output .= View::make(\"ucp.avatar_gallery_end_table\");\r\n\r\n\t\t$this->page_title = $ibforums->lang['t_welcome'];\r\n\t\t$this->nav = array(\"<a href='\" . $this->base_url . \"act=UserCP&amp;CODE=00'>\" . $ibforums->lang['t_title'] . \"</a>\");\r\n\r\n\t}", "function gallery(){\n $str=\"\";\n $str.= \"<div class='gallery'>\";\n foreach (glob(\"*.{jpg,png,gif,JPG,jpeg}\",GLOB_BRACE) as $filename) {\n echo '<a data-fancybox=\"gallery\" href=\"'.$filename.'\"><img class=\"thumbnail\" src=\"'.$filename.'\"></a>';\n }\n $str.= \"</div>\";\n echo $str;\n}", "private function set_directory(){\n if(!is_dir($this->img_dir)) mkdir($this->img_dir);\n if(!is_dir($this->thumb_dir)) mkdir($this->thumb_dir);\n }", "public function getAllImages() {\n\t\t$returnArr = array();\n\n\t\tforeach (File::allFiles($this->imageFolder) as $file) {\n\t\t\t$fileName = $file->getRelativePathName();\n\n\t\t\t$returnArr[] = url() . '/uploads/images/'.$fileName;\n\t\t}\n\n\t\treturn $returnArr;\n\t}", "function thumbnails_begin($folderID) {\n\tglobal $mg2;\n\t$mg2->headline = ($folderID === 1)?\n\t\t\t\t\t\t $mg2->gallerytitle\n\t\t\t\t\t\t :\n\t\t\t\t\t\t $mg2->br2line($mg2->all_folders[$folderID][2]);\n\tinclude_once('skins/'.$mg2->activeskin.'/templates/gallery_header.php');\n}", "public function view_images()\n {\n $data['images'] = $this->Image_model->get_images();\n $this->load->view('student/index', $data);\n }", "private function makeImageList()\n\t{\n\t\t$images_dir = self::$locator->banner_images_dir($this->trip, $this->slug);\n\t\t$trip = $this->trip;\n\t\t$slug = $this->slug;\n\t\t/// This is a hack so that unit testing does not have to setup Locator\n\t\t/// for every test.\n\t\tif (! is_dir($images_dir)) {\n\t\t\treturn [];\n\t\t}\n\t\t$list = scandir($images_dir);\n\t\t$x = [];\n\t\tforeach ($list as $ent) {\n\t\t\tif (($ent != \".\") && ($ent != \"..\") && (substr($ent, 0, 1) != \".\")) {\n\t\t\t\t$tmp = new \\stdClass();\n\t\t\t\t$tmp->url = self::$locator->url_banner_image($trip, $slug, $ent);\n\t\t\t\t$tmp->path = self::$locator->banner_image_filepath($trip, $slug, $ent);\n\t\t\t\t$x[] = $tmp;\n\t\t\t}\n\t\t}\n\t\t$this->images_list = $x;\n\t}", "function getSlider_images()\n\t\t{\n\t\t\t$slider_images = $this->manage_content->getValue('slider_info','*');\n\t\t\tforeach($slider_images as $slider_image)\n\t\t\t{\n\t\t\t\tif($slider_image['slider_status'] == 1)\n\t\t\t\t{\n\t\t\t\t\techo '<a href=\"'.$slider_image[\"slider_link\"].'\"><img src=\"images/'.$slider_image[\"slider_image\"].'\" style=\"width:692px;height:210px;\"/></a>';\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function pushImages() \n\t{\n\t\tglobal $imageDir;\n\t\tglobal $studentImageDir;\t\t\n\t\tglobal $countImgs;\n\t\tglobal $countStudents;\n\t\t\n\t\t//Set up arrays of found images\n\t\t//This is being done ahead of the for statements since UNC's system\n\t\t//I think took the empty globs as FALSE instead of an empty array.\n\t\t$slideshow_pngs = glob($imageDir . \"*.png\");\n\t\t$slideshow_bigPNGs = glob($imageDir . \"*.PNG\");\n\t\t$slideshow_jpgs = glob($imageDir . \"*.jpg\");\n\t\t$slideshow_bigJPGs = glob($imageDir . \"*.JPG\");\n\t\t//global $fullImageDir;\n\n\t\t// Build top slideshow array\n\t\tif ($slideshow_pngs and !empty($slideshow_pngs))\n\t\t{\n\t\t\tforeach ($slideshow_pngs as $png) {\n\t\t\t\t//tempAr will be populated into the slideshow javascript\n\t\t\t\t//the first element is the thumbnail\n\t\t\t\t//the second element is the large image file\n\t\t\t\t//echo(\"tempAr = ['$png', '\" . substr_replace($png, $fullImageDir, 0, strlen($imageDir)) . \"'];\");\t\n\t\t\t\techo(\"tempAr = ['$png', '$png'];\");\t\t\t\n\t\t\t\techo(\"myImageArray.push(tempAr);\" );\n\t\t\t\t$countImgs += 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($slideshow_bigPNGs and !empty($slideshow_bigPNGs))\n\t\t{\t\t\n\t\t\tforeach ($slideshow_bigPNGs as $png) {\n\t\t\t\techo(\"tempAr = ['$png', '$png'];\");\t\t\t\t\t\n\t\t\t\techo(\"myImageArray.push(tempAr);\" );\n\t\t\t\t$countImgs += 1;\n\t\t\t}\t\n\t\t}\n\n\t\tif ($slideshow_jpgs and !empty($slideshow_jpgs))\n\t\t{\t\t\n\t\t\tforeach ($slideshow_jpgs as $jpg) {\n\t\t\t\techo(\"tempAr = ['$jpg', '$jpg'];\");\t\t\t\t\n\t\t\t\techo(\"myImageArray.push(tempAr);\" );\n\t\t\t\t$countImgs += 1;\n\t\t\t}\t\n\t\t}\n\n\t\tif ($slideshow_bigJPGs and !empty($slideshow_bigJPGs))\n\t\t{\t\t\n\t\t\tforeach ($slideshow_bigJPGs as $jpg) {\n\t\t\t\techo(\"tempAr = ['$jpg', '$jpg'];\");\t\t\t\t\n\t\t\t\techo(\"myImageArray.push(tempAr);\" );\n\t\t\t\t$countImgs += 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\techo(\"myImageArray.sort()\"); //sort our slideshow alphabetically\n\t\t\n\t}", "function deco_display_awkward_gallery(){\n\t\t//this loops the most recent featured items\n\t\t$items = deco_get_random_featured_items(10);\n\t\tif ($items!=null) \n\t\t{\n\t\tset_items_for_loop($items);\n\t\twhile(loop_items()):\n\t\n\t\t\t$index = 0; \n\t\t\twhile ($file = loop_files_for_item()):\n\t\t\t if ($file->hasThumbnail()):\n\t\t\t //this makes sure the loop grabs only the first image for the item \n\t\t\t if ($index == 0): \n\t\t\t //item_file('fullsize uri') broke in Omeka version 1.3, so I use getWebPath instead...\n\t\t \t echo '<div><img src=\"'.$file->getWebPath('fullsize').'\" alt=\"\" title=\"\"/>'; \n\t\t \t endif;\n\t\t\t endif; \n\t\t\tendwhile;\n\t\t\t\n\t\t\techo '<div class=\"showcase-caption\">';\n\t\t\techo /*Item Title and Link*/'<h3>'.link_to_item().'</h3>';\n\t\t\techo /*Item Description Excerpt*/'<p>'.item('Dublin Core', 'Description',array('snippet'=>190));\n\t\t\techo /*Link to Item*/ link_to_item(' ...more ').'</p></div></div>';\n\t\t\t\n\t\t\tendwhile; \n}else \n\t\t\t{\n \techo'<div><img src=\"'.uri('').'/themes/deco/images/emptyslideshow.png\" alt=\"Oops\" /><div class=\"showcase-caption\"><h3>UH OH!</h3><br/><p>There are no featured images right now. You should turn off \"Display Slideshow\" in the theme settings until you have some.</p></div></div>';\n \t\t}}", "public function index()\n {\n $imagesArray = glob(config('media.imagesPath').'*.*');\n if (count($imagesArray) > 0) {\n foreach ($imagesArray as $key => $image) {\n $imagesArray[$key] = substr($image, strlen(config('media.imagesPath')));\n }\n }\n\n return view('index', [\n 'imagesArray' => $imagesArray\n ]);\n }", "public function index()\n {\n $galleryImages = GalleryImage::with(['category.album'])->get();\n return view('admin_dashboard.gallery.image.index', compact(['galleryImages']));\n }", "function display_file($file) {\n\n return \"images\" . DS . $file;\n\n}", "public function main()\n {\n return $this->browseImages();\n }", "function galleries($title=\"Che_Guevara\",$page=\"1\")\n\t{\n\t //displays them\t \n\t \n\t $this->load->model('Articlesmodel');\n\t //load diretory to get all the images in a directory\n\t $this->load->helper('directory');\n\t $map = directory_map('../CodeIgniter/images', TRUE);\n\t //echo_array($map);\n\t $data['map']=$map;\n\t \n\t $this->Articlesmodel->article_name=\"../blog/$title\".'.dat';\n\t $data['content']=$this->Articlesmodel->get_article();\n\t //loads the parser filters\n\t $this->load->library('filterclass');\n\t //change wiki links and place into content\n\t $data['content']=$this->filterclass->wikitize($data['content']);\n\t $data['feature']=$this->filterclass->feature($data['content']);\n\t $data['keywords']=$this->filterclass->parseField('keywords',$data['content']);\n\t $data['title']=$this->filterclass->parseField('title',$data['content']);\n\t $data['feature_image']=$this->filterclass->parseField('feature-image',$data['content']);\n\t //let us get the list of articles in the directory\n\n\t $this->Articlesmodel->path='../blog/';\n\t $data['list']=$this->Articlesmodel->get_articles_list();\n\n\n\t //let us view what we got by sending data and choosing the view\n\t $this->load->view('directory_view',$data);\n \t}", "public function actionGalleryImages() {\n\n // # Cache result forever\n $cached = Cache::rememberForever( 'actionGalleryImages', function () {\n\n // # Conatiner init\n $container = [];\n\n // # Directory iterator\n $iterator = new \\DirectoryIterator( \"./images/gallery/images\" );\n\n // # Loop through files and dir\n foreach( $iterator as $item ) {\n\n // # Avoid dirs\n if( is_dir( $item ) ) {\n continue;\n }\n\n // # Get pathname\n $path = ltrim( $item->getPathname(), \".\" );\n $tmp[ 'src' ] = $path;\n $tmp[ 'thumb' ] = $path;\n $container[] = $tmp;\n }\n\n // # toJson\n return json_encode($container);\n });\n\n return response()->make( $cached );\n\n }", "function admin_showgal($real_path) {// global $get, $uri;\n\t/*$real_path = $path.'/'.$selection;\n\tif (isset($get['o'])) {\n\t\t$url = explode('/',$get['o']);\n\t\t$url1 = explode('|', $url[0]);\n\t\t$url2 = explode('|', $url[1]);\n\t\t$found = in_array('sl', $url1) ? true : false;\n\t\t$link = pre_seao($url1[0], $url2[0], false, true);\n\t\t$link = str_replace('ebookcms.php/', '', $link);\n\t\t$link = str_replace('ebookcms.php?', '?', $link);\n\t\t$add = !isset($get['sl']) ? pre_seao('sl', '1') : '';\n\t\tfor ($i=1; $i<count($url1); $i++) {\n\t\t\t$link .= pre_seao($url1[$i], $url2[$i]);\n\t\t\tif ($i==2 && !$found) {$link .= $add;}\n\t\t}\n\t}*/\n\techo '<div class=\"show_img\">';\n\tif (is_dir($real_path)) { $images = '';\n\t\t$handle = opendir($real_path);\n\t\t$extensions = array('.jpg', '.bmp', '.gif', '.png');\n\t\twhile (($file = readdir($handle)) == true) {\n\t\t\tif ($file != '.' && $file != '..' && $file != 'thumbs') {\n\t\t\t\tclearstatcache();\n\t\t\t\t$ext = strrchr($file, '.');\n\t\t\t\tif (in_array($ext, $extensions)) {\n\t\t\t\t\tif (file_exists($real_path.'/'.$file)) {\n\t\t\t\t\t\t$images = $images.'<li>\n\t\t\t\t\t\t\t<div class=\"si_img\">\n\t\t\t\t\t\t\t\t<img src=\"'.$real_path.'/'.$file.'\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</li>';\n\t\t\t\t\t }\n\t\t\t\t}\n\t\t\t}\n\t\t} closedir($handle);\n\t\tif (!empty($images)) {echo '<ul>'.$images.'</ul><br />';} else {echo t('no_image');}\n\t} else if (empty($selection)) {echo t('select_imgs');}\n\techo '</div>';\n\tif (!empty($images)) {return;}\n}", "private function loadImages(): void\n {\n if (count($this->images) == 1) {\n $this->addMeta('image', $this->images[0]);\n\n return;\n }\n\n foreach ($this->images as $number => $url) {\n $this->addMeta(\"image{$number}\", $url);\n }\n }", "public function getImagesFolder()\n {\n return defined(static::class . '::IMAGES') ? static::IMAGES : 'images';\n }", "function image_gallery_admin() {\r\n _image_check_settings();\r\n\r\n $tree = taxonomy_get_tree(_image_gallery_get_vid());\r\n if ($tree) {\r\n $header = array(t('Name'), t('Operations'));\r\n foreach ($tree as $term) {\r\n $rows[] = array(str_repeat(' -- ', $term->depth) . ' ' . l($term->name, \"image/tid/$term->tid\"), l(t('edit gallery'), \"admin/content/image/edit/$term->tid\"));\r\n }\r\n return theme('table', $header, $rows);\r\n }\r\n else {\r\n return t('No galleries available');\r\n }\r\n}", "function get_image_paths($base_url, $base_path)\n{\n $out = array();\n\n require_code('images');\n require_code('files');\n\n $handle = @opendir($base_path);\n if ($handle !== false) {\n while (false !== ($file = readdir($handle))) {\n if (!should_ignore_file($file, IGNORE_ACCESS_CONTROLLERS)) {\n $this_path = $base_path . $file;\n if (is_file($this_path)) {\n if (is_image($file)) {\n $this_url = cms_rawurlrecode($base_url . rawurlencode($file));\n $out[$this_path] = $this_url;\n }\n } elseif ((strlen($file) != 2) || (strtoupper($file) != $file)) {\n $out = array_merge($out, get_image_paths($base_url . $file . '/', $base_path . $file . '/'));\n }\n }\n }\n closedir($handle);\n }\n\n return $out;\n}", "function get_images() \t{\n \t\treturn $this->getImages();\n \t}", "public function index()\n {\n return view('admin.list.images', [\n 'pageImages' => Image::where('imageType', '=', 'page')->get(),\n 'backgroundImages' => Image::where('imageType', '=', 'background')->get()\n ]);\n }", "private function listFolderFiles($dir = 'images/')\n {\n echo '<ol>';\n foreach (new \\DirectoryIterator($dir) as $fileInfo) {\n if (!$fileInfo->isDot()) {\n echo '<li>' . $fileInfo->getFilename();\n if ($fileInfo->isDir()) {\n self::listFolderFiles($fileInfo->getPathname());\n }\n echo '</li>';\n }\n }\n echo '</ol>';\n }", "function admin_showimage($selection, $path, $options) { global $get, $uri;\n\t$real_path = $path.'/'.$selection;\n\tif (isset($get['o'])) {\n\t\t$url = explode('/',$get['o']);\n\t\t$url1 = explode('|', $url[0]);\n\t\t$url2 = explode('|', $url[1]);\n\t\t$found = in_array('sl', $url1) ? true : false;\n\t\t$link = pre_seao($url1[0], $url2[0], false, true);\n\t\t$link = str_replace('ebookcms.php/', '', $link);\n\t\t$link = str_replace('ebookcms.php?', '?', $link);\n\t\t$add = !isset($get['sl']) ? pre_seao('sl', '1') : '';\n\t\tfor ($i=1; $i<count($url1); $i++) {\n\t\t\t$link .= pre_seao($url1[$i], $url2[$i]);\n\t\t\tif ($i==2 && !$found) {$link .= $add;}\n\t\t}\n\t}\n\techo '<div class=\"show_img\">';\n\tif (!LOGGED && isAllowed('uplimg_access')) {echo t('not_allowed').'</div>'; exit;}\n\tif (is_dir($real_path)) { $images = '';\n\t\t$handle = opendir($real_path);\n\t\t$extensions = array('.jpg', '.bmp', '.gif', '.png');\n\t\twhile (($file = readdir($handle)) == true) {\n\t\t\tif ($file != '.' && $file != '..' && $file != 'thumbs') {\n\t\t\t\tclearstatcache();\n\t\t\t\t$ext = strrchr($file, '.');\n\t\t\t\tif (in_array($ext, $extensions)) {\n\t\t\t\t\tif (file_exists($real_path.'/thumbs/'.$file)) {\n\t\t\t\t\t\t$images = $images.'<li>\n\t\t\t\t\t\t\t<div class=\"si_title\">\n\t\t\t\t\t\t\t\t<h4>'.$file.'</h4>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"si_img\">\n\t\t\t\t\t\t\t\t<img src=\"'.$real_path.'/thumbs/'.$file.'\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"si_foot\">\n\t\t\t\t\t\t\t\t<p><a href=\"'.$link.'\" onClick=\"var r = confirm(\\''.t('delete_img').'?\\'); if (r) {deleteimage(\\''.$file.'\\',\\''.$real_path.'\\');}\" \n\t\t\t\t\t\t\t\t\ttarget=\"_self\">'.t('delete').'</a></p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</li>';\n\t\t\t\t\t} else {$images = $images.'<li>\n\t\t\t\t\t\t<div class=\"si_title\">\n\t\t\t\t\t\t\t<h4>'.$file.'</h4>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"si_img\">\n\t\t\t\t\t\t\t<img src=\"'.$real_path.'/'.$file.'\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"si_foot\">\n\t\t\t\t\t\t\t<p><a href=\"'.$link.'\" onClick=\"var r = confirm(\\''.t('delete_img').'?\\'); if (r) {deleteimage(\\''.$file.'\\',\\''.$real_path.'\\');}\" \n\t\t\t\t\t\t\t\t\ttarget=\"_self\">'.t('delete').'</a></p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</li>';}\n\t\t\t\t}\n\t\t\t}\n\t\t} closedir($handle);\n\t\tif (!empty($images)) {echo '<ul>'.$images.'</ul><br />';} else {echo t('no_image');}\n\t} else if (empty($selection)) {echo t('select_imgs');}\n\techo '</div>';\n\tif (!empty($images)) {return;}\n}", "function outputImages($collectionObject) {\r\n\t$results = $collectionObject->getArray();\r\n\r\n\tfor($i=0;$i<$collectionObject->getCount();$i++){\r\n\t\techo '<div class=\"col-md-3\">';\r\n\t\techo '<a href=\"single-image.php?id=' . $results[$i]->getImageID() . '\">';\r\n\t\techo '<img src=\"travel-images/square-medium/'. $results[$i]->getPath() . '\" title=\"\" class=\"thumbnail\" />';\r\n\t\techo '</a>';\r\n\t\techo \"</div>\";\r\n\t}\r\n}", "function getfoldercontent($folder, &$dir_array, &$pic_array, &$expic_array)\r\n{\r\n global $xoopsModuleConfig;\r\n\r\n $dir = opendir(XOOPS_ROOT_PATH.\"/modules/xcgal/\".$xoopsModuleConfig['fullpath'].$folder);\r\n while($file = readdir($dir)){\r\n if(is_dir(XOOPS_ROOT_PATH.\"/modules/xcgal/\".$xoopsModuleConfig['fullpath'].$folder.$file)) {\r\n if ($file != \".\" && $file != \"..\")\r\n $dir_array[] = $file;\r\n }\r\n if(is_file(XOOPS_ROOT_PATH.\"/modules/xcgal/\".$xoopsModuleConfig['fullpath'].$folder.$file)) {\r\n if(strncmp($file, $xoopsModuleConfig['thumb_pfx'], strlen($xoopsModuleConfig['thumb_pfx'])) != 0\r\n && strncmp($file, $xoopsModuleConfig['normal_pfx'], strlen($xoopsModuleConfig['normal_pfx'])) != 0)\r\n $pic_array[] = $file;\r\n }\r\n }\r\n closedir($dir);\r\n\r\n natcasesort($dir_array);\r\n natcasesort($pic_array);\r\n}", "public function imagesManager()\n\t{\n\t\t$images = array();\n\n\t\t// Grab all images in the directory\n\t\t$files = File::allFiles(public_path() . '/uploads');\n\n\t\tforeach ($files as $file) {\n\t\t\t// Ignore thumbnail image\n\t\t\tif (!strpos($file, 'thumb_')) {\n\t\t\t\t// Get the image extension\n\t\t\t\t$ext = '.' . pathinfo($file, PATHINFO_EXTENSION);\n\t\t\t\t// Get the directory path for the image\n\t\t\t\t$path = explode( \"/\", substr($file,strpos($file,\"/uploads\")));\n\t\t\t\t// Remove file name to get only directory name\n\t\t\t\tarray_pop($path);\n\n\t\t\t\t$image_path = implode(\"/\", $path);\n\n\t\t\t\t$images[] = array(\"thumb\" => $image_path .'/thumb_' . basename($file), \"image\" => $image_path .'/' . basename($file), \"title\" => basename($file, $ext), \"link\" => $image_path .'/' . basename($file));\n\t\t\t}\n\t\t}\n\n\t\treturn Response::json($images);\n\t}", "function _findimages(&$data){\n global $conf;\n $files = array();\n\n // http URLs are supposed to be media RSS feeds\n if(preg_match('/^https?:\\/\\//i',$data['ns'])){\n $files = $this->_loadRSS($data['ns']);\n $data['_single'] = false;\n }else{\n $dir = utf8_encodeFN(str_replace(':','/',$data['ns']));\n // all possible images for the given namespace (or a single image)\n if(is_file($conf['mediadir'].'/'.$dir)){\n require_once(DOKU_INC.'inc/JpegMeta.php');\n $files[] = array(\n 'id' => $data['ns'],\n 'isimg' => preg_match('/\\.(jpe?g|gif|png)$/',$dir),\n 'file' => basename($dir),\n 'mtime' => filemtime($conf['mediadir'].'/'.$dir),\n 'meta' => new JpegMeta($conf['mediadir'].'/'.$dir)\n );\n $data['_single'] = true;\n }else{\n $depth = $data['recursive'] ? 0 : 1;\n search($files,\n $conf['mediadir'],\n 'search_media',\n array('depth'=>$depth),\n $dir);\n $data['_single'] = false;\n }\n }\n\n // done, yet?\n $len = count($files);\n if(!$len) return $files;\n if($data['single']) return $files;\n\n // filter images\n for($i=0; $i<$len; $i++){\n if(!$files[$i]['isimg']){\n unset($files[$i]); // this is faster, because RE was done before\n }elseif($data['filter']){\n if(!preg_match($data['filter'],noNS($files[$i]['id']))) unset($files[$i]);\n }\n }\n if($len<1) return $files;\n\n // random?\n if($data['random']){\n shuffle($files);\n }else{\n // sort?\n if($data['sort'] == 'date'){\n usort($files,array($this,'_datesort'));\n }elseif($data['sort'] == 'mod'){\n usort($files,array($this,'_modsort'));\n }elseif($data['sort'] == 'title'){\n usort($files,array($this,'_titlesort'));\n }\n\n // reverse?\n if($data['reverse']) $files = array_reverse($files);\n }\n\n // limits and offsets?\n if($data['offset']) $files = array_slice($files,$data['offset']);\n if($data['limit']) $files = array_slice($files,0,$data['limit']);\n\n return $files;\n }", "public function display_gallery() {\n\n global $product;\n\n $gallery = \n wc_get_template(\n 'single-product/label-thumbnails.php',\n array(),\n FALSE,\n $this->plugin_path() . '/templates/' );\n\n }", "public static function printGallery() {\r\n\t\t$elts = Acid::mod('Photo')->dbList(array(array('active','=',1)),array('pos'=>'ASC'));\r\n\t\treturn Acid::tpl('pages/gallery.tpl',array('elts'=>$elts),Acid::mod('Photo'));\r\n\t}", "public function getDirectory()\n {\n return mfConfig::get('mf_sites_dir').\"/\".$this->getSiteName().\"/\".$this->getApplication().\"/view/pictures/\".$this->get('lang');\n }", "public function library()\n {\n $user = auth()->user();\n $email = $user->email;\n\n $images = [];\n $files_in_folder = \\File::files('images/' . $email);\n\n foreach ($files_in_folder as $path) {\n $images[] = pathinfo($path);\n }\n\n return view('library')->with('images', $images)->with('email', $email)->with('name', $user->name);\n }", "function getallpicindb(&$pic_array, $startdir)\r\n{\r\n global $xoopsDB;\r\n\r\n $sql = \"SELECT filepath, filename \".\r\n \"FROM \".$xoopsDB->prefix(\"xcgal_pictures\").\" \".\r\n \"WHERE filepath LIKE '$startdir%'\";\r\n $result = $xoopsDB->query($sql);\r\n while ($row = $xoopsDB->fetchArray($result)) {\r\n $pic_file = $row['filepath'].$row['filename'];\r\n $pic_array[$pic_file]=1;\r\n }\r\n $xoopsDB->freeRecordSet($result);\r\n}", "protected function combineImages() {}", "function _gallery($data){\n global $conf;\n global $lang;\n $ret = '';\n\n $files = $this->_findimages($data);\n\n //anything found?\n if(!count($files)){\n $ret .= '<div class=\"nothing\">'.$lang['nothingfound'].'</div>';\n return $ret;\n }\n\n // prepare alignment\n $align = '';\n $xalign = '';\n if($data['align'] == 1){\n $align = ' gallery_right';\n $xalign = ' align=\"right\"';\n }\n if($data['align'] == 2){\n $align = ' gallery_left';\n $xalign = ' align=\"left\"';\n }\n if($data['align'] == 3){\n $align = ' gallery_center';\n $xalign = ' align=\"center\"';\n }\n if(!$data['_single']){\n if(!$align) $align = ' gallery_center'; // center galleries on default\n if(!$xalign) $xalign = ' align=\"center\"';\n }\n\n $page = 0;\n\n // build gallery\n if($data['_single']){\n $ret .= $this->_image($files[0],$data);\n $ret .= $this->_showname($files[0],$data);\n $ret .= $this->_showtitle($files[0],$data);\n }elseif($data['cols'] > 0){ // format as table\n $close_pg = false;\n\n $i = 0;\n foreach($files as $img){\n\n // new page?\n if($data['paginate'] && ($i % $data['paginate'] == 0)){\n $ret .= '<div class=\"gallery_page gallery__'.$data['galid'].'\" id=\"gallery__'.$data['galid'].'_'.(++$page).'\">';\n $close_pg = true;\n }\n\n // new table?\n if($i == 0 || ($data['paginate'] && ($i % $data['paginate'] == 0))){\n $ret .= '<table>';\n\n }\n\n // new row?\n if($i % $data['cols'] == 0){\n $ret .= '<tr>';\n }\n\n // an image cell\n $ret .= '<td>';\n $ret .= $this->_image($img,$data);\n $ret .= $this->_showname($img,$data);\n $ret .= $this->_showtitle($img,$data);\n $ret .= '</td>';\n $i++;\n\n // done with this row? cloase it\n $close_tr = true;\n if($i % $data['cols'] == 0){\n $ret .= '</tr>';\n $close_tr = false;\n }\n\n // close current page and table\n if($data['paginate'] && ($i % $data['paginate'] == 0)){\n if ($close_tr){\n // add remaining empty cells\n while($i % $data['cols']){\n $ret .= '<td></td>';\n $i++;\n }\n $ret .= '</tr>';\n }\n $ret .= '</table>';\n $ret .= '</div>';\n $close_pg = false;\n }\n\n }\n\n if ($close_tr){\n // add remaining empty cells\n while($i % $data['cols']){\n $ret .= '<td></td>';\n $i++;\n }\n $ret .= '</tr>';\n }\n\n if(!$data['paginate']){\n $ret .= '</table>';\n }elseif ($close_pg){\n $ret .= '</table>';\n $ret .= '</div>';\n }\n }else{ // format as div sequence\n $i = 0;\n $close_pg = false;\n foreach($files as $img){\n\n if($data['paginate'] && ($i % $data['paginate'] == 0)){\n $ret .= '<div class=\"gallery_page gallery__'.$data['galid'].'\" id=\"gallery__'.$data['galid'].'_'.(++$page).'\">';\n $close_pg = true;\n }\n\n $ret .= '<div>';\n $ret .= $this->_image($img,$data);\n $ret .= $this->_showname($img,$data);\n $ret .= $this->_showtitle($img,$data);\n $ret .= '</div> ';\n\n $i++;\n\n if($data['paginate'] && ($i % $data['paginate'] == 0)){\n $ret .= '</div>';\n $close_pg = false;\n }\n }\n\n if($close_pg) $ret .= '</div>';\n\n $ret .= '<br style=\"clear:both\" />';\n }\n\n // pagination links\n $pgret = '';\n if($page){\n $pgret .= '<div class=\"gallery_pages\"><span>'.$this->getLang('pages').' </span>';\n for($j=1; $j<=$page; $j++){\n $pgret .= '<a href=\"#gallery__'.$data['galid'].'_'.$j.'\" class=\"gallery_pgsel button\">'.$j.'</a> ';\n }\n $pgret .= '</div>';\n }\n\n return '<div class=\"gallery'.$align.'\"'.$xalign.'>'.$pgret.$ret.'<div class=\"clearer\"></div></div>';\n }", "static function images($folder, $types = array('jpg', 'jpeg', 'gif', 'png', 'JPG', 'JPEG', 'GIF', 'PNG')) {\r\n\t\t$files\t= array();\r\n\t\t$images\t= array();\r\n\t\t\r\n\t\t//$dir = JPATH_BASE.'/'.$folder;\r\n\t\t$dir = JPATH_SITE.'/'.$folder;\r\n\t\t// check if directory exists\r\n\t\tif (is_dir($dir))\r\n\t\t{\r\n\t\t\tif ($handle = opendir($dir)) {\r\n\t\t\t\twhile (false !== ($file = readdir($handle))) {\r\n\t\t\t\t\tif ($file != '.' && $file != '..' && $file != 'CVS' && $file != 'index.html' ) {\r\n\t\t\t\t\t\t$files[] = $file;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tclosedir($handle);\r\n\t\t\tasort($files);\r\n\t\t\t$i = 0;\r\n\t\t\tforeach ($files as $img)\r\n\t\t\t{\r\n\t\t\t\tif (!is_dir($dir .'/'. $img))\r\n\t\t\t\t{\r\n\t\t\t\t\t$type = substr($img, strrpos($img, '.') + 1);\r\n\t\t\t\t\tif (in_array($type, $types)) {\r\n\t\t\t\t\t\t$images[$i]->name \t= $img;\r\n\t\t\t\t\t\t$images[$i]->folder\t= $folder;\r\n\t\t\t\t\t\t++$i;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $images;\r\n\t}", "function _initFiles()\r\n {\r\n if (array_key_exists($this->_mediaType, $this->mediaTypePaths)) {\r\n $strPath = $this->mediaTypePaths[$this->_mediaType][0].$this->_path;\r\n } else {\r\n $strPath = ASCMS_CONTENT_IMAGE_PATH.$this->_path;\r\n }\r\n\r\n $objDir = @opendir($strPath);\r\n\r\n $arrFiles = array();\r\n\r\n if ($objDir) {\r\n $path = array();\r\n if ( $this->_path !== \"/\"\r\n && preg_match('#(.*/).+[/]?$#', $this->_path, $path)) {\r\n array_push($this->_arrDirectories, array('name' => '..', 'path' => $path[1], 'icon' => $this->_iconPath.'Folder.png'));\r\n }\r\n\r\n $file = readdir($objDir);\r\n while ($file !== false) {\r\n// TODO: This match won't work for arbitrary thumbnail file names as they\r\n// may be created by the Image class!\r\n if ($file == '.' || $file == '..' || preg_match('/(?:\\.(?:thumb_thumbnail|thumb_medium|thumb_large)\\.[^.]+$)|(?:\\.thumb)$/i', $file) || $file == 'index.php') {\r\n $file = readdir($objDir);\r\n continue;\r\n }\r\n array_push($arrFiles, $file);\r\n $file = readdir($objDir);\r\n }\r\n closedir($objDir);\r\n\r\n sort($arrFiles, SORT_NATURAL | SORT_FLAG_CASE);\r\n\r\n foreach ($arrFiles as $file) {\r\n if (is_dir($strPath.$file)) {\r\n array_push($this->_arrDirectories, array('name' => $file, 'path' => $this->_path.$file, 'icon' => $this->_getIcon($strPath.$file)));\r\n } else {\r\n $filesize = @filesize($strPath.$file);\r\n if ($filesize > 0) {\r\n $filesize = round($filesize/1024);\r\n } else {\r\n $filesize = 0;\r\n }\r\n $arrDimensions = array(0 => 0, 1 => 0);\r\n if (\\Cx\\Core_Modules\\Media\\Controller\\MediaLibrary::_isImage($strPath.$file)) {\r\n $arrDimensions = @getimagesize($strPath.$file);\r\n }\r\n array_push($this->_arrFiles, array('name' => $file, 'path' => $this->_path.$file, 'size' => $filesize, 'icon' => $this->_getIcon($strPath.$file), 'width' => intval($arrDimensions[0]), 'height' => intval($arrDimensions[1])));\r\n }\r\n }\r\n }\r\n }", "public function getPageFolders();", "function __reimportPhotos(){\n\t\t$this->Asset->disablePermissionable();\n\t\t$this->Asset->recursive=0;\n\t\t$json = $this->Asset->find('all', array('fields'=>'json_src'));\n\t\t$json =Set::extract($json, '/Asset/json_src');\n\t\tforeach ($json as $row) {\n\t\t\t$imgSrc = json_decode($row);\n\t\t\t$src = \"Summer2009/\".basename($imgSrc->orig);\n\t\t\t$dest = $imgSrc->preview;\n\t\t\t$src_baseurl = Configure::read('path.local.preview');\n\t\t\t$dest_baseurl = Configure::read('stageroot.basepath');\n\t\t\t$shell_cmd[] =\"cp {$src_baseurl}/{$src} {$dest_baseurl}/{$dest}\";\n\t\t\t//\t\t\tmkdir(dirname(Configure::read('stageroot.basepath').\"/{$dest}\"), 0777, $recursive=true);\n\t\t\t//\t\t\tcopy( Configure::read('path.local.preview').\"/{$src}\", Configure::read('stageroot.basepath').\"/{$dest}\");\n\t\t}\n\t\tdebug($shell_cmd);\n\t}", "function getPhotosOfDir($dirName){\r\n\t\t$connectService = new ConnectionBDD();\r\n\t\t$connect = $connectService->connect();\r\n\t\t$r = mysql_query(\"select PATH_PHOTO,ID_PHOTO_TAG from PhotoTag where PATH_PHOTO like '\" . str_replace($this->directory,\"\",$dirName) . \"%'\");\r\n\t\t$tags = array();\r\n\t\tfor($i = 0 ; $i < mysql_num_rows($r) ; $i++){\r\n\t\t\t$path = mysql_result($r,$i,\"PATH_PHOTO\");\r\n\t\t\t$tags[substr($path,strrpos($path,\"/\")+1)] = mysql_result($r,$i,\"ID_PHOTO_TAG\");\r\n\t\t}\r\n\r\n\t\t$tab = array();\r\n\t\t$dir = opendir($dirName . \"/sd\");\r\n\t\t$i = 0;\r\n\t\t/* Parcourt les photos */\r\n\t\twhile( ($photo = readdir($dir))!=false){\r\n\t\t\tif($photo != \".\" && $photo!=\"..\" && strstr($photo,\".jpg\") == \".jpg\"){\r\n\t\t\t\t$data = new Data();\r\n\t\t\t\t$data->addInfo(\"name\",str_replace(\".jpg\",\"\",$photo));\r\n\t\t\t\t$size = getimagesize($dirName . \"/sd/\" . $photo);\r\n\t\t\t\t$data->addInfo(\"width\",$size[0]);\r\n $data->addInfo(\"height\",$size[1]);\r\n\t\t\t\tif(isset($tags[str_replace(\".jpg\",\"\",$photo)]) == true){\r\n\t\t\t\t\t$data->addInfo(\"tag\",$tags[str_replace(\".jpg\",\"\",$photo)]);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t$data->addInfo(\"tag\",-1);\r\n\t\t\t\t}\r\n\t\t\t\t$tab[++$i] = $data;\r\n\t\t\t}\r\n\t\t}\r\n\t\t/* Trie les photos par nom */\r\n\t\tfunction abc($a,$b){return strnatcasecmp($a->getInfo(\"name\"),$b->getInfo(\"name\"));}\r\n\t\tusort($tab,\"abc\");\r\n\r\n\t\t$connectService->close();\r\n\t\treturn $tab;\r\n\t}", "public function run()\n {\n $initials = array(\n ['url' => 'winners-chapel-owerri-0-1542948878.jpg'],\n ['url' => 'winners-chapel-owerri-1-1542948878.jpg'],\n ['url' => 'winners-chapel-owerri-2-1542948878.jpg']\n );\n \n foreach($initials as $i){\n Gallery::create($i);\n }\n }", "public function showList()\n\t{\n\t\t$images = array();\n\t\tif (Auth::user()->name == \"admin\") {\n\t\t\t$images = DB::table('images')->get();\n\t\t} else {\n\t\t\t$images = DB::table('images')\n\t\t\t\t->where('created_by', '=', Auth::user()->name)\n\t\t\t\t->get();\n\t\t}\n\n\t\treturn view('admincp.listImage', ['images' => $images]);\n\t}", "function getImageDifferentPlaces($limitImages=0) {\n \tif ($this->config['mode']=='DIRECTORY') {\n \t\t$content.=$this->getImagesDirectory($limitImages);\n \t} elseif ($this->config['mode']=='RECORDS') {\n \t\t$content.=$this->getImagesRecords($limitImages);\n } elseif ($this->config['mode']=='DAM') {\n \t\t$content.=$this->getImagesDam($limitImages);\n } elseif ($this->config['mode']=='DAMCAT') {\n \t\t$content.=$this->getImagesDamCat($limitImages);\n } \n \n // hook\n if (is_array($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rgsmoothgallery']['extraDifferentPlaces'])) {\n foreach($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rgsmoothgallery']['extraDifferentPlaces'] as $_classRef) {\n\t\t\t\t$_procObj = & t3lib_div::getUserObj($_classRef);\n\t\t\t\t$content = $_procObj->extraBeginGalleryProcessor($content, $limitImages,$this);\n }\n } \n \treturn $content;\n }", "function liste_images($dossier_images) // le dossier des images de l'article\n{\n\t$dossier = opendir($dossier_images);\n\t\n\t$images = array();\n\t\n\twhile (false !== ($image = readdir($dossier)) AND !in_array($image, array('0.jpg', '.', '..'))) { //toutes les images sans la principale de bandeau\n\t\t$images[] = $image;\n\t}\n\t\n\treturn $images;\n}", "function getSubfolders() ;", "function get_image_directory_list ($directory, $file=true) {\n $d = dir ($directory);\n $list = array();\n while ($entry = $d->read() ) {\n if ($file == true) { // We want a list of files, not directories\n $parts_array = explode ('.', $entry);\n $extension = $parts_array[1];\n // Don't add files or directories that we don't want\n if ($entry != '.' && $entry != '..' && $entry != '.htaccess' && $extension != 'php') {\n if (!is_dir ($directory . \"/\" . $entry) ) {\n $list[] = $entry;\n }\n }\n } else { // We want the directories and not the files\n if (is_dir ($directory . \"/\" . $entry) && $entry != '.' && $entry != '..') {\n $list[] = array ('id' => $entry,\n 'text' => $entry\n );\n }\n }\n }\n $d->close();\n return $list;\n}", "function getImages($hello) {\n\n\t$imagetypes = array(\"image/jpg\",\"image/jpeg\",\"image/png\");\n\t$dir = \"/assets/galleries/\".$hello.\"/images/\";\n\t$dir2 = \"/assets/galleries/\".$hello.\"/thumbs/\";\n\t$dir3 = \"/assets/galleries/\".$hello.\"/downloads/\";\n\n\t#array to hold return value\n\t$retval = array();\n\n\t#full server path to directory\n\t$fulldir = \"{$_SERVER['DOCUMENT_ROOT']}$dir2\"; \n\t$idir = \"{$_SERVER['DOCUMENT_ROOT']}$dir\"; \n\n\t$d = @dir($fulldir) or die(\"getImages: Failed opening directory $dir for reading\"); \n\twhile(false !== ($entry = $d->read())) { \n\t\t# skip hidden files \n\t\tif($entry[0] == \".\") continue; \n\n\t\t# check for image files \n\t\tif(in_array(mime_content_type(\"$fulldir$entry\"), $imagetypes)) { \n\t\t\t$retval[] = array( \"file\" => \"$dir$entry\", \n\t\t\t\"size\" => getimagesize(\"$fulldir$entry\"),\n\t\t\t\"name\" => \"$entry\",\n\t\t\t\"thumb\"=>\"$dir2$entry\",\n\t\t\t\"download\"=>\"$dir3$entry\",\n\t\t\t\"isize\" => getimagesize(\"$idir$entry\")\n\t\t\t); \n\t\t}\n\t}\n\t$d->close(); \n\treturn $retval;\n}", "public function getDirsCollection($path)\r\r\n {\r\r\n // Simple plugin fix provided by Tim Hengeveld - Lite Webdesigns - www.litewebdesigns.nl\r\r\n // Based on the idea of Clorne (http://www.magentocommerce.com/boards/member/9241/), as posted in this thread: http://www.magentocommerce.com/boards/viewthread/220720/P15/\r\r\n\r\r\n // These lines are removed to fix the displaying of folders in Wysiwyg editor when inserting an image.\r\r\n // Simply remove this extension once Magento has fixed this bug: http://www.magentocommerce.com/bug-tracking/issue?issue=11242\r\r\n /*$subDirectories = Mage::getModel('core/file_storage_directory_database')->getSubdirectories($path);\r\r\n\r\r\n foreach ($subDirectories as $directory) {\r\r\n $fullPath = rtrim($path, DS) . DS . $directory['name'];\r\r\n if (!file_exists($fullPath)) {\r\r\n mkdir($fullPath, 0777, true);\r\r\n }\r\r\n }*/\r\r\n\r\r\n $conditions = array('reg_exp' => array(), 'plain' => array());\r\r\n\r\r\n foreach ($this->getConfig()->dirs->exclude->children() as $dir) {\r\r\n $conditions[$dir->getAttribute('regexp') ? 'reg_exp' : 'plain'][(string) $dir] = true;\r\r\n }\r\r\n // \\\"include\\\" section takes precedence and can revoke directory exclusion\r\r\n foreach ($this->getConfig()->dirs->include->children() as $dir) {\r\r\n unset($conditions['regexp'][(string) $dir], $conditions['plain'][(string) $dir]);\r\r\n }\r\r\n\r\r\n $regExp = $conditions['reg_exp'] ? ('~' . implode('|', array_keys($conditions['reg_exp'])) . '~i') : null;\r\r\n $collection = $this->getCollection($path)\r\r\n ->setCollectDirs(true)\r\r\n ->setCollectFiles(false)\r\r\n ->setCollectRecursively(false);\r\r\n $storageRootLength = strlen($this->getHelper()->getStorageRoot());\r\r\n\r\r\n foreach ($collection as $key => $value) {\r\r\n $rootChildParts = explode(DIRECTORY_SEPARATOR, substr($value->getFilename(), $storageRootLength));\r\r\n\r\r\n if (array_key_exists($rootChildParts[0], $conditions['plain'])\r\r\n || ($regExp && preg_match($regExp, $value->getFilename()))) {\r\r\n $collection->removeItemByKey($key);\r\r\n }\r\r\n }\r\r\n\r\r\n return $collection;\r\r\n }", "static function getList()\n {\n $out = array();\n\n if ($dh = opendir(__DIR__ . '/../img/')) {\n while (($file = readdir($dh)) !== false) {\n if (substr($file, -4) === '.jpg') {\n $filename = substr($file, 0, -4);\n $out[$filename] = realpath(__DIR__ . '/../img/' . $file);\n }\n }\n\n closedir($dh);\n }\n\n return $out;\n }", "function recursiveDirectory($directory){\n foreach(glob(\"{$directory}/*\") as $file)\n {\n //echo \"recorriendo el FICHERO $file<br>\";\n\n if(is_dir($file)) {\n //echo \"directorio $directory fichero $file<br>\";\n anadirImagen($file);\n recursiveDirectory($file);\n } else {\n\n anadirImagen($file);\n\n }\n }\n anadirImagen($directory);\n $parent = dirname($directory);\n while (strcmp($parent, 'Repositorio') != 0) {\n anadirImagen($parent);\n $parent = dirname($parent);\n }\n}", "private function _prep_folders() \n\t{\n\t\t \n\t\t// Prep folders for Image selection\n\t\t// Load Files Module\n\t\t$this->load->library('files/files');\n\t\t$this->load->model('files/file_folders_m');\n\t\t \n\t\t// Set up the Dropdown Array for edit and create\n\t\t$folders = array(0 => lang('global:select-pick'));\n\t\t \n\t\t// Get All folders\n\t\t$tree = $this->file_folders_m->order_by('parent_id', 'ASC')->order_by('id', 'ASC')->get_all();\n\t\t \n\t\t// Build the Folder Tree\n\t\tforeach ($tree as $folder) \n\t\t{\n\t\t\t$id = $folder->id;\n\t\t\tif ($folder->parent_id != 0) \n\t\t\t{\n\t\t\t\t$folders[$id] = $folders[$folder->parent_id] . ' &raquo; ' . $folder->name;\n\t\t\t} \n\t\t\telse\n\t\t\t{\n\t\t\t\t$folders[$id] = $folder->name;\n\t\t\t}\n\t\t}\n\t\t \n\t\treturn $folders;\n\t\t \n\t}", "function gallery($id = null){\r\n\t\t$this->Album->id = $id;\r\n\t\t$album = $this->Album->read();\r\n\t\t$this->set('album',$album);\r\n\t\t$this->set('path',$this->Admin->siteVar('imagepath'));\r\n\t\t$this->set('baseurl',$this->Admin->siteVar('absoluteimgurl'));\r\n\t\t\r\n\t\t$this->render('gallery','ajax');\r\n\t}", "function tp_get_img_dir() {\n\t$file = new ElggFile();\n\t$file->setFilename('image/');\n\treturn $file->getFilenameOnFilestore();\n}", "function os_images($id = 0){\n\t\t$result = $this->Azure->getOSImages();\t\t\n\t\t$OSImageDetails = \"\";\n\t\tif(!empty($id)){\n\t\t\t$OSImageDetails = $this->Azure->getOSImageDetails($id);\n\t\t}\n\t\t$this->template->load(\"main\",\"osimages\",array(\"osimages\" => $result,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"osimagedetails\" => $OSImageDetails,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"selectedosimage\" => $id));\t\t\t\n\t}", "function retrieveAllAlbumsImages()\n\t{\n\t\tif(isset($_SESSION['txtStoreAllImages']))\n\t\t{\n\t\t\t$file = fopen($_SESSION['txtStoreAllImages'], \"r\") or exit(\"Unable to open file!\");\n\t\t\twhile(!feof($file))\n\t\t\t{\n\t\t\t\t$line = fgets($file). \"<br>\";\n\t\t\t\t$word_arr = explode(\" \", $line);\n\t\t\t\t$count = 1;\n\t\t\t\tforeach($word_arr as $word){\n\t\t\t\t\t\n\t\t\t\t\tif($count==2)\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\techo $word.\"\\n\"; // required output\n\t\t\t\t\t$count++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfclose($file);\n\t\t}\n\t}", "function outputImageList() {\n\t//if (!isset($_SESSION['imagesIndexed']) || $_SESSION['imagesIndexed'] != false || !isset($allImages)) {\n\t\t$dir = opendir(\"../images\"); $counter = 1;\n\t\tdo {\n\t\t\t$nextDir = readdir($dir);\n\t\t\tif ($nextDir != '.' && $nextDir != '..' && $nextDir !== false) {\n\t\t\t\tif (filetype($nextDir) != 'dir' && fileExtension($nextDir) != 'html' && fileExtension($nextDir) != 'txt' && fileExtension($nextDir) != 'php') {\n\t\t\t\t\t$allImages[] = htmlspecialchars($nextDir);\n\t\t\t\t}\n\t\t\t}\n\t\t} while ($nextDir !== false);\n\t\t\n\t\tfor ($i=0;$i<count($allImages); $i++) { $newImages[] = strtolower($allImages[$i]); }\n\t\t//echo 'Done,';\n\t\tarray_multisort($newImages, SORT_ASC, SORT_STRING, $allImages);\n\t//} else { /*$allImages = $_SESSION['allImages'];*/ unset($_SESSION['imagesIndexed']); } // Only re-index all files if the list is empty, in this case, $allImages must already be set\n\t\n\t//Print ImageList Table Header\n\t$ret = '<div>';\n\t\n\t$ret .= '<i>Total Images</i>: '.count($allImages).' <span id=\"imageListMsg\"></span><br><i>Listing</i> ';\n\t\n\t$_SESSION['imageSet'][0].\n\t\n\t\t$beginEntries = array();\n\t\tfor ($i=0;$i<count($allImages);$i+=$_SESSION['imageSet'][1]) { $beginEntries[] = $i; }\n\t\t$begins = '<select id=\"imageSetStart\" onchange=\"changeImageSet(this.value,'.(int)$_SESSION['imageSet'][1].')\">';\n\t\tfor ($i=0;$i<count($beginEntries);$i++) {\n\t\t\t$begins .= '<option value=\"'.$beginEntries[$i].'\" '.($_SESSION['imageSet'][0]==$beginEntries[$i]?'selected=\"\"':'').'>'.$beginEntries[$i].'</option>';\n\t\t}\n\t\t$begins .= '</select>';\n\t\t\n\t\t$setSizes = array(50,100,500,1000,2500,5000,10000);\n\t\t$ends = '<select id=\"imageSet\" onchange=\"changeImageSet('.(int)$_SESSION['imageSet'][0].',this.value)\">';\n\t\tfor($i=0;$i<count($setSizes);$i++) {\n\t\t\t$ends .= '<option value=\"'.$setSizes[$i].'\" '.($_SESSION['imageSet'][1]==$setSizes[$i]?'selected=\"\"':'').'>'.$setSizes[$i].'</option>';\n\t\t}\n\t\t$ends .= '</select>';\n\t\t\n\t\t$topbound = min($_SESSION['imageSet'][0]+$_SESSION['imageSet'][1],count($allImages));\n\t\n\t$ret .= $begins;\n\t\n\t$ret .= ' to '.$topbound.', <i>Show</i> '.$ends.\"\\r\\n\";\n\t\n\t$ret .= '<table class=\"imageTable\" width=\"100%\" align=\"left\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">';\n\t\n\t//Print each row/image for table\n\t\n\t//echo 'Outputting from '.$_SESSION['imageSet'][0].' to '.$topbound.'<br>';\n\t\n\tfor ($i=$_SESSION['imageSet'][0]; $i<$topbound; $i++){ // Original method outputting all data\n\t\t$ret .= '<tr id=\"ir_' . $allImages[$i] . '\"><td class=\"' . ($i%2?'I2':'I1') . '\"><input type=\"image\" src=\"images/edit.png\" onclick=\"iR(\\'' . $allImages[$i] . '\\');\" /></td><td id=\"hovRow_' . $allImages[$i] . '\"';\n\t\tif ($i % 2) { $ret .= ' style=\"background-color: #EEE;\" onmouseover=\"hoverOn2(this);\" onmouseout=\"hoverOff2(this);\"'; }\n\t\telse { $ret .= ' onmouseover=\"hoverOn(this);\" onmouseout=\"hoverOff(this);\"'; }\n\t\t$ret .= '><div id=\"vDiv_' . $allImages[$i] . '\" class=\"I\" onclick=\"iC(\\'' . $allImages[$i] . '\\');\">' . htmlentities($allImages[$i]) . '</div>'.\n\t\t'<div id=\"eDiv_' . $allImages[$i] . '\" style=\"float: left; display: none;\">'.\n\t\t'<input type=\"text\" size=\"30\" id=\"tBox_' . $allImages[$i] . '\" value=\"' . $allImages[$i] . '\" />'.\n\t\t'<input type=\"image\" src=\"images/check.png\" onclick=\"imageSavename(\\'' . $allImages[$i] . '\\');\" /></div>'.\n\t\t'</td><td' . ($i%2 ? ' style=\"background-color: #EEE;\"' : '') . '>'.\n\t\t'<input type=\"image\" src=\"images/delete.png\" onclick=\"imageDelete(\\'' . $allImages[$i] . '\\');\" /></td></tr>';\n\t} //End old format\n\t\n\t/* $ret .= '[^S}'; // New format\n\tfor ($i=$_SESSION['imageSet'][0]; $i<$topbound; $i++){\n\t\t$ret .= $allImages[$i].'[>}';\n\t}\n\t$ret .= '[^E}'; // End new format */\n\t\n\t$ret .= '</table>';\n\treturn $ret;\n}", "public function renderDirectories() {\r\n\t\t$treeData = array();\r\n\t\tlist($name, $id) = $this->resolveNameID();\r\n\t\t$htmlOptions = array(\r\n\t\t\t\"class\" => \"filetree\",\r\n\t\t\t\"id\" => $id.\"-directories\"\r\n\t\t);\r\n\t\t\r\n\t\tforeach((is_array($this->basePath) ? $this->basePath : array($this->basePath)) as $path) {\r\n\t\t\t$item = array(\r\n\t\t\t\t\"text\" => \"<span class='folder'>\".basename($path).\"</span>\",\r\n\t\t\t\t\"id\" => md5($path),\r\n\t\t\t\t\"children\" => $this->directoryTreeviewData($path),\r\n\t\t\t\t\"expanded\" => false,\r\n\t\t\t);\r\n\t\t\t$checkboxId = $this->getId().\"_\".$item['id'];\r\n\t\t\t$item['text'] = CHtml::tag(\r\n\t\t\t\t\t\t\"span\",\r\n\t\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\t\"class\" => \"folder\"\r\n\t\t\t\t\t\t),\r\n\t\t\t\t\t\t($this->multiple ? \r\n\t\t\t\t\t\t\tCHtml::activeCheckbox($this->model,$this->attribute.\"[\".$item['id'].\"]\",array(\"id\" => $checkboxId))\r\n\t\t\t\t\t\t\t:\r\n\t\t\t\t\t\t\tCHtml::activeRadioButton($this->model,$this->attribute,array(\"id\" => $checkboxId, \"value\" => $item['id']))\r\n\t\t\t\t\t\t).\r\n\t\t\t\t\t\tCHtml::label(basename($path),$checkboxId)\r\n\t\t\t\t\t);\r\n\t\t\t$treeData[] = $item;\r\n\t\t\t\r\n\t\t}\r\n\t\tob_start();\r\n\t\t$this->widget(\"CTreeView\",array(\r\n\t\t\t\"htmlOptions\" => $htmlOptions,\r\n\t\t\t\"data\" => $treeData\r\n\t\t));\r\n\t\t$html = ob_get_clean();\r\n\t\treturn $html;\r\n\t}", "public function index()\n {\n $images = Image::latest()->paginate(10);\n $tour = Tour::where(['is_active' => 1])->orderBy('id', 'desc')->get();\n $category = Category::where(['is_active' => 1])->orderBy('id', 'desc')->get();\n\n return view('admin.image.index', [\n 'data' => $images,\n 'tour' => $tour,\n 'category' => $category\n ]);\n }", "function _upgrade_422_find_genericons_files_in_folder($directory)\n {\n }", "function GetImages() {\n //Select folder to scan\n $handle = opendir(\"Images/Tea\");\n\n //Read all files and store names in array\n while ($image = readdir($handle)) {\n $images[] = $image;\n }\n\n closedir($handle);\n\n //Exclude all filenames where filename length < 3\n $imageArray = array();\n foreach ($images as $image) {\n if (strlen($image) > 2) {\n array_push($imageArray, $image);\n }\n }\n\n //Create <select><option> Values and return result\n $result = $this->CreateOptionValues($imageArray);\n return $result;\n }", "function albums_get_images($album) {\n\t$files = read_dir_contents(ALBUMS_DIR.'/'.$album, 'files');\n\tif (!$files)\n\t\treturn FALSE;\n\n\telseif ($files) {\n\t\tnatcasesort($files);\n\t\tforeach ($files as $file) {\n\t\t\t$parts = explode('.', $file);\n\t\t\tif (count($parts) == 4) {\n\t\t\t\tlist($number, $fdirname, $ext, $php) = $parts;\n\t\t\t\tinclude_once (ALBUMS_DIR.'/'.$album.'/'.$file);\n\t\t\t\t$images[] = array(\n\t\t\t\t\t'title' => $name,\n\t\t\t\t\t'info' => $info,\n\t\t\t\t\t'seoname' => $fdirname,\n\t\t\t\t\t'filename' => $file,\n\t\t\t\t\t'filename_image' => $fdirname.'.'.$ext\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tunset($file);\n\n\t\treturn $images;\n\t}\n}", "public function getMetaImageFolder()\n {\n if ($album = $this->getAlbum()) {\n return $album->getMetaImageFolder();\n }\n }" ]
[ "0.6659823", "0.6491537", "0.64074636", "0.6395947", "0.63080645", "0.629757", "0.6250472", "0.62104475", "0.6207039", "0.61955166", "0.6043571", "0.60123825", "0.6011875", "0.59988743", "0.5985933", "0.59707934", "0.59498215", "0.5928344", "0.59172195", "0.5908918", "0.59061164", "0.59002936", "0.58868414", "0.5885393", "0.58741075", "0.5869138", "0.5861351", "0.58522284", "0.5845344", "0.5844902", "0.58408433", "0.5836357", "0.5834132", "0.58280003", "0.5825877", "0.5821957", "0.5820554", "0.58192426", "0.58158356", "0.5813293", "0.58113784", "0.579611", "0.5795938", "0.579407", "0.57725066", "0.5770812", "0.57576746", "0.5756626", "0.57395184", "0.57359344", "0.5728817", "0.5721137", "0.5719287", "0.5709678", "0.570387", "0.57026684", "0.57005525", "0.5699925", "0.569399", "0.56908786", "0.56901723", "0.567249", "0.566846", "0.5666649", "0.566287", "0.5643825", "0.5632058", "0.56276053", "0.56223863", "0.5619028", "0.560982", "0.56092286", "0.56085044", "0.5608157", "0.5601074", "0.5598464", "0.55928415", "0.5577496", "0.5564783", "0.5563308", "0.55603373", "0.5559937", "0.5558691", "0.5542557", "0.554234", "0.5529515", "0.5526307", "0.5521004", "0.5514", "0.5513689", "0.55066067", "0.54871505", "0.54859394", "0.5483989", "0.54828984", "0.54767984", "0.5475745", "0.5474754", "0.5466277", "0.5462844" ]
0.61912936
10
Automatically pulls folders from the images/photoshop directory, displays
public function makePhotoshopGallery() { $imagePath = 'images/photoshop'; $imageFiles = File::allFiles($imagePath); return view('pages/photoshop')->with(compact('imagePath', 'imageFiles')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show_images(){\n\t\t\t$dir = '../pictures/';\n\t\t\t//checks if is an actual directory, opens it and reads each and returns filename.ext\n\t\t\tif (is_dir($dir)) {\n\t\t\t if ($dh = opendir($dir)) {\n\t\t\t while (($file = readdir($dh)) !== false) {\n\t\t\t \tif( $file == '.' || $file == '..'){//readdir returns ., .. before actual filenames\n \t\tcontinue;//they are ignored\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//href value is to a include file showlarge.inc.php\n\t\t\t\t\t\techo \"<a href=?value=showlarge&value={$file}>\";\n\t\t\t\t\t\techo \"<img class = 'picture' src='{$dir}{$file}'></a>\";\n\t\t\t }\n\t\t\t closedir($dh);\n\t\t\t }\n\t\t\t}\n\t\t}", "function albums_site_show_images($album) {\n\tglobal $lang;\n\n\tif (!file_exists(ALBUMS_DIR.'/'.$album))\n\t\techo '<p>'.$lang['albums']['doesnt_exist'].'</p>';\n\n\telse {\n\t\t$images = albums_get_images($album);\n\t\tif ($images != FALSE) {\n\t\t\tforeach ($images as $image) {\n\t\t\t\t?>\n\t\t\t\t<div class=\"album\">\n\t\t\t\t\t<table>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<a href=\"<?php echo SITE_URL; ?>/data/modules/albums/albums_getimage.php?image=<?php echo $album; ?>/<?php echo $image['filename_image']; ?>\" rel=\"lytebox[album]\" title=\"<?php echo $image['title']; ?>\">\n\t\t\t\t\t\t\t\t\t<img src=\"<?php echo SITE_URL; ?>/data/modules/albums/albums_getimage.php?image=<?php echo $album; ?>/thumb/<?php echo $image['filename_image']; ?>\" alt=\"<?php echo $image['title']; ?>\" title=\"<?php echo $image['title']; ?>\" />\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<span class=\"albuminfo\"><?php echo $image['title']; ?></span>\n\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t<i><?php echo $image['info']; ?></i>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</div>\n\t\t\t<?php\n\t\t\t}\n\t\t\tunset($image);\n\t\t}\n\t}\n}", "private function images()\n {\n return File::allFiles(public_path('img/gallery'));\n }", "public function actionIndex(){\r\n $q = Yii::app()->request->getParam('q'); \r\n $path = Picture::getBasePath();//.DIRECTORY_SEPARATOR.'article';\r\n if ($q) $path .= DIRECTORY_SEPARATOR.$q;\r\n \r\n if (isset($_FILES) && isset($_FILES['newimage'])){\r\n move_uploaded_file($_FILES['newimage']['tmp_name'], $path.DIRECTORY_SEPARATOR.$_FILES['newimage']['name']);\r\n }\r\n \r\n $parent = '';\r\n if ($q != ''){\r\n $qsplit = explode('/', $q);\r\n unset($qsplit[count($qsplit)-1]);\r\n $parent = implode('/', $qsplit);\r\n }\r\n \r\n $dirs = $files = $images = array();\r\n \r\n $objects = scandir($path);\r\n //print_r($objects); exit;\r\n\r\n foreach ($objects as $obj){\r\n $type = filetype($path.'/'.$obj);\r\n if ($type == 'dir'){\r\n $dirs[] = $obj;\r\n } elseif ($type == 'file') {\r\n $ext = strtolower(pathinfo($path.'/'.$obj, PATHINFO_EXTENSION));\r\n if (in_array($ext, array('jpeg', 'png', 'gif', 'jpg', 'bmp'))){\r\n $images[] = $obj;\r\n } else {\r\n $files[] = $obj;\r\n }\r\n }\r\n }\r\n \r\n $this->renderPartial('_catalog', array(\r\n 'path' => $path,\r\n 'dirs' => $dirs,\r\n 'images' => $images,\r\n 'files' => $files,\r\n 'q' => $q,\r\n 'parent' => $parent,\r\n ));\r\n }", "function getImagesDirectory($limitImages=0) { \t\t \n if (is_dir($this->config['startingpoint'])) {\n \t\t $images = array(); \n \t\t $images = $this->getFiles($this->config['startingpoint']); \t\n // randomise and limit image items returned from images array\n // also useful to limit items in array to 1 item for use when no javascript in browser\n // if $limitImages=0 then this if statement is bypassed and all images in images array returned for processing\n if ($limitImages>0) {\n \t$images=$this->getSlicedRandomArray($images,0,$limitImages);\n }\n\n $content.= $this->beginGallery($this->cObj->data['uid'],$limitImages);\n\n // read the description from field in flexforms\n \t$caption = explode(\"\\n\",$this->config['text']);\n \n // add the images\n foreach ($images as $key=>$value) {\n $path = $this->config['startingpoint'].$value;\n \n // caption text\n $text =explode('|',$caption[$key]);\n \n // add element to slideshow\n $content.=$this->addImage(\n \t\t\t $path,\n $text[0], \n $text[1],\n $this->config['showThumbs'],\n $this->config['showLightbox'],\n $path,\n $limitImages\n );\n \n } # end foreach file\n \n \t\t $content.=$this->endGallery();\n \t\t} # end is_dir \n \t\treturn $content;\n }", "public function getImages()\n\t\t{\n\t\t\t$this->createDir();\n\t\t\t//sacamos la lista de ficheros de la carpeta photos\n\t\t\t$files = $this->getFileList();\n\t\t\t//array de salida\n\t\t\t$image_List = array();\n\t\t\t\n\t\t\t//recorremos el contenido de esa carpeta\n\t\t\tforeach($files as $file)\n\t\t\t{\n\t\t\t\t//tiene que ser jpg, gif o png para que muestre las imagenes y que no sea . o ..\n\t\t\t\tif($file!=\".\" && $file!=\"..\" && $this->validatePhoto($file))\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t//guardo en el array la lista de imagenes\n\t\t\t\t\tarray_push($image_List, $file);\n\t\t\t\t\t\n\t\t\t\t\t//miro si existe la imagen en el thumbs si no lo creo\n\t\t\t\t\tif(!$this->checkIfFileExistes($file))\n\t\t\t\t\t{\n\t\t\t\t\t\t//como NO existe la minituara la creamos\n\t\t\t\t\t\t$this->createThumb(\"$file\");\n\t\t\t\t\t}\n\t\t\t\t\t//mostramos la miniatura y al hacer clic mostramos original \n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\techo \"<a href='\".$this->ruta.\"/$file' target='_blank' ><img src='\".$this->rutaMini.\"/$file'/></a>\";\t\n\t\t\t\t}\t\t\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}", "function find_images_do_dir($theme, $subdir, $langs)\n{\n $full = (($theme == 'default' || $theme == 'admin') ? get_file_base() : get_custom_file_base()) . '/themes/' . filter_naughty($theme) . '/' . filter_naughty($subdir);\n $out = array();\n\n $_dir = @opendir($full);\n if ($_dir !== false) {\n while (false !== ($file = readdir($_dir))) {\n if ($file[0] != '.') {\n if (is_dir($full . $file)) {\n $out = array_merge($out, find_images_do_dir($theme, $subdir . $file . '/', $langs));\n } else {\n $ext = substr($file, -4);\n if (($ext == '.png') || ($ext == '.gif') || ($ext == '.jpg') || ($ext == 'jpeg')) {\n $_file = explode('.', $file);\n $_subdir = $subdir;\n foreach (array_keys($langs) as $lang) {\n $_subdir = str_replace('/' . $lang . '/', '/', $_subdir);\n }\n $_subdir = preg_replace('#(^|/)images(\\_custom)?/#', '', $_subdir);\n $out[$_subdir . $_file[0]] = cms_rawurlrecode('themes/' . rawurlencode($theme) . '/' . $subdir . rawurlencode($file));\n }\n }\n }\n }\n\n closedir($_dir);\n }\n\n return $out;\n}", "public function presentation_images()\n\t\t{\n\t\t\t$this->is_login();\n\t\t\t$this->load->model('presentation_images_model', 'pim');\n\t\t\t$data['presentation_images'] = $this->pim->get_all();\n $data['presentation_act'] = $this->pim->get_link();\n\t\t\t$this->load->view('presentation_images-admin', $data);\n\t\t}", "function displayImages($albumDir, $whichGallery, $displayMode) {\n\t\t// create var to store name of folder where album of galleries is located\n\t\t$album = $albumDir.'/';\n\t\t\n\t\t//store value of the current target directory\n\t\t$targetGallery = $whichGallery.'/'; //pulled from a function argument 1\n\t\t\n\t\t//set currently selected gallery's pathway\n\t\t$currentGalleryPath = $album.$targetGallery;\n\t\t\n\t\t$large = 'large/'; //large images for cover background images (1800+px)\n\t\t$medium = 'medium/'; //standard size (max = 1100w)\t\n\t\t$small = 'small/'; //thumbnail for lightbox styled gallery (max. - 200w)\n\t\t\n\t\t//store dir to be scanned for contents into an array variable\n\t\t$imageList = scandir($currentGalleryPath.$medium);\n\t\t\n\t\tif (file_exists($currentGalleryPath.$large) &&\n\t\t\tfile_exists($currentGalleryPath.$medium) &&\n\t\t\tfile_exists($currentGalleryPath.$small)\n\t\t\t\n\t\t) {\n\t\t\t\n\t\t\n\t\t//initiate an empty array for unwanted items\n\t\t$unwanted = array();\n\t\t//define acceptable filetypes found in key[2] of getimagesize\n\t\t$acceptable_arrays = array(1,2,3,6,9);\n\t\t//print_r(get_defined_constants());\n\t\t//this defines all constants on the page. Look for imagetype to build array from.\n\t\t\n\t\t//loop through $imageList to remove unwanted items\n\t\tforeach ($imageList as $filename) {\n\t\t\t//check to see if item starts with '.' or if is a directory\n\t\t\tif ((strpos($filename,'.') == 0) || is_dir($filename)) {\n\t\t\t\t//push item into unwanted array\n\t\t\t\tarray_push($unwanted, $filename);\t\n\t\t\t\t//compare current state of $imageList to current state of $unwanted and strip unwanted items from $imageList\n\t\t\t\t$imageList = array_diff($imageList, $unwanted);\n\t\t\t} else {\n\t\t\t\t//store the file info inside $size array using getimagesize\n\t\t\t\t$size = getimagesize($album.$targetGallery.$medium.$filename);\t\n\t\t\t\tif (!$size[2] || !in_array($size[2], $acceptable_arrays)) {\n\t\t\t\t\tarray_push($unwanted, $filename);\t\n\t\t\t\t\t$imageList = array_diff($imageList, $unwanted);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t?>\n\t\n\t\t<?php \n\t\t\t// ----- CREATE FILTERING ARRAYS TO BE USED LATER ----- //\n\t\t\t$fileExt = array('.jpg', '.jpeg', '.png', '.bmp', '.gif'); //for stripping extensions for alt text\n\t\t\t$characters = array('-', '_'); //stripping out special characters in filename for alt text\n\t\t\t\n\t\t\t//create $title of album to use for image gallery info below\n\t\t\t$title = ucwords(str_replace($characters,' ', $whichGallery));\n\t\t?>\n\t\t<?php switch ($displayMode) {\n\t\tcase 'img':\n\t\t\t//----- GRAB RANDOM IMAGE FOR IMG -----//\n\t\t\t\t//testing how array_rand() works ... returns numeric key integer\n\t\t\t\t//echo \"THIS IS THE RANDOM KEY PULLED: \";\n\t\t\t\t//$randomKey = array_rand($imageList);\n\t\t\t\t//$image = $imageList[$randomKey];\n\t\t\t\n\t\t\t//grab random image from $imageList\n\t\t\t$image = $imageList[array_rand($imageList)];\n\t\t\t\n\t\t\t//create alt text for image\n\t\t\t$alt = str_replace($fileExt, '', $image);\n\t\t\t$alt = ucwords(str_replace($characters, ' ', $alt));\n\t\t?>\n\t\t<p class=\"random-image\"><img src=\"<?php echo $currentGalleryPath.$medium.rawurlencode($image) ?>\" alt=\"<?php echo $alt ?>\"></p>\n\t\t<hr>\n\t\t<?php break; ?>\n\t\t<?php\n\t\tcase 'background':\n\t\t//----- GRAB RANDOM IMAGE FOR BACKGROUND -----//\n\t\t$image = $imageList[array_rand($imageList)]; ?>\n\t\t<style>\n\t\t\tbody {\n\t\t\t\tbackground: url(<?php echo $currentGalleryPath.$large.rawurlencode($image) ?>) no-repeat center center;\t\n\t\t\t\t-webkit-background-size: cover;\n\t\t\t\t-moz-background-size: cover;\n\t\t\t\t-o-background-size: cover;\n\t\t\t\tbackground-size: cover;\n\t\t\t}\n\t\t</style>\n\t\t<?php break; ?>\n\t\t<?php\n\t\tcase 'lightbox':\n\t\t// ----- GENERATE THUMBNAIL GALLERY ----- //\n\t\t\n\t\t//call out globals for the lightbox switch case\n\t\tglobal $jquery, $lightbox;\n\t\t//test to see if jquery library has been called\n\t\tif (!isset($jquery)) {\n\t\t\techo '<script src=\"js/jquery-3.1.1.min.js\"></script>'.\"\\n\";\n\t\t\t$jquery = true;\n\t\t}\n\t\t//test to see if lightbox library has been called\n\t\tif (!isset($lightbox)) {\n\t\t\techo '<script src=\"js/lightbox.js\"></script>'.\"\\n\";\n\t\t\techo '<link href=\"css/lightbox.css\" rel=\"stylesheet\">'.\"\\n\";\n\t\t\t$lightbox = true;\n\t\t}\n\t\t?>\n\t\t<h2 class=\"gallery\"><?php echo $title; // announce the gallery?></h2>\n\t\t<ul class=\"gallery\">\n\t\t\t<?php\n\t\t\t\tforeach ($imageList as $image){ \n\t\t\t\t\t//create alt text for image\n\t\t\t\t\t$alt = str_replace($fileExt, '', $image);\n\t\t\t\t\t$alt = ucwords(str_replace($characters, ' ', $alt));\n\t\t\t?>\n\t\t\t\t<li>\n\t\t\t\t\t<a href=\"<?php echo $currentGalleryPath.$medium.rawurlencode($image); ?>\" title=\"<?php echo $alt; ?>\" data-lightbox=\"<?php echo $title; ?>\" >\n\t\t\t\t\t\t<img src=\"<?php echo $currentGalleryPath.$small.rawurlencode($image) ?>\" alt=\"<?php echo $alt; ?>\">\n\t\t\t\t\t</a>\n\t\t\t\t</li>\n\t\t\t<?php } break; ?>\n\t\t</ul>\n \n <?php \n\t\tcase 'slideshow':\n\t\t//call out globals for the lightbox switch case\n\t\t\tglobal $jquery, $slideshow;\n\t\t\t//test to see if jquery library has been called\n\t\t\tif (!isset($jquery)) {\n\t\t\t\techo '<script src=\"js/jquery-3.1.1.min.js\"></script>'.\"\\n\";\n\t\t\t\t$jquery = true;\n\t\t\t}\n\t\t\t//test to see if lightbox library has been called\n\t\t\tif (!isset($slideshow)) {\n\t\t\t\techo ' <script src=\"js/cycle2.min.js\"></script>'.\"\\n\";\n\t\t\t\techo '<link href=\"css/cycle2.css\" rel=\"stylesheet\">'.\"\\n\";\n\t\t\t\t$slideshow = true;\n\t\t\t}\n\t\t?> \n <div class=\"cycle-slideshow\" data-cycle-fx=fadeout data-cycle-speed=1500 Horz data-cycle-timeout=4000>\n <!-- empty element for overlay -->\n <div class=\"cycle-overlay\"></div>\n <?php foreach ($imageList as $image){ \n\t\t\t\t\t//create alt text for image\n\t\t\t\t\t$alt = str_replace($fileExt, '', $image);\n\t\t\t\t\t$alt = ucwords(str_replace($characters, ' ', $alt)); ?>\n <img src=\"<?php echo $currentGalleryPath.$medium.rawurlencode($image); ?>\" data-cycle-title=\"<?php echo $title; ?>\" data-cycle-desc=\"<?php echo $alt; ?>\">\n <?php } //end foreach ?>\n </div>\n<?php break; ?>\n\t\t<?php\n\t\t\n\t\t}//END SWITCH $displayMode\n\t\t} else {\n\t\t\t//print this to screen if the directories cannot be found.\n\t\t\techo \"<p>The selected gallery is not available.</p>\";\t\n\t\t}//END file_exists() FUNCTION\n\t}", "function getUserPhotos ($dir, $userName = '') {\r\n $filesArray = getFilesFromDir($dir);\r\n $outputPhotoBook = '';\r\n foreach ($filesArray as $fileName) {\r\n $outputPhotoBook .= '<div><img src=\"img/' . $userName . '/' . $fileName. '\"></div>';\r\n }\r\n return $outputPhotoBook;\r\n}", "function display_file($file) {\n\n return \"images\" . DS . $file;\n\n}", "public function listDirectoryPicturesAndApplyId() \n {\n if (is_dir($this->picturesFolder)){\n $this->files = scandir($this->picturesFolder);\n } else {\n echo 'No image directory';\n }\n \n $values = array();\n foreach ($this->files as $key => $var) {\n if (($var === '.') || ($var === '..') || (substr($var, -4, 1) !== '.')) {\n unset($this->files[$key]);\n } else {\n $id = $this->generateRandomKey();\n $values[] = array(\n 'id' => $id, \n 'picture' => $this->files[$key], \n 'qrcode' => $id . '-qrcode' . $this->outputFileExtension\n ); \n }\n }\n $this->files = $values;\n return (array) $this->files;\n }", "function albums_admin_show_images($album) {\n\tglobal $lang, $var1;\n\n\t$images = albums_get_images($album);\n\tif ($images == FALSE)\n\t\techo '<span class=\"kop4\">'.$lang['general']['nothing_yet'].'</span><br />';\n\n\telse {\n\t\tforeach ($images as $image) {\n\t\t\t?>\n\t\t\t\t<div class=\"menudiv\">\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<a href=\"<?php echo MODULE_DIR; ?>/albums_getimage.php?image=<?php echo $var1.'/'.$image['filename_image']; ?>\" target=\"_blank\">\n\t\t\t\t\t\t\t<img src=\"<?php echo MODULE_DIR; ?>/albums_getimage.php?image=<?php echo $var1; ?>/thumb/<?php echo $image['filename_image']; ?>\" title=\"<?php echo $image['title']; ?>\" alt=\"<?php echo $image['title']; ?>\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"title-page\">\n\t\t\t\t\t\t<span class=\"kop3\"><?php echo $image['title']; ?></span>\n\t\t\t\t\t\t<br />\n\t\t\t\t\t\t<span class=\"small\"><?php echo $image['info']; ?></span>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<a href=\"?module=albums&amp;page=editimage&amp;var1=<?php echo $var1; ?>&amp;var2=<?php echo $image['seoname']; ?>\">\n\t\t\t\t\t\t\t<img src=\"data/image/edit.png\" title=\"<?php echo $lang['albums']['edit_image']; ?>\" alt=\"<?php echo $lang['albums']['edit_image']; ?>\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<a href=\"?module=albums&amp;page=imageup&amp;var1=<?php echo $var1; ?>&amp;var2=<?php echo $image['seoname']; ?>\">\n\t\t\t\t\t\t\t<img src=\"data/image/up.png\" title=\"<?php echo $lang['albums']['change_order']; ?>\" alt=\"<?php echo $lang['albums']['change_order']; ?>\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<a href=\"?module=albums&amp;page=imagedown&amp;var1=<?php echo $var1; ?>&amp;var2=<?php echo $image['seoname']; ?>\">\n\t\t\t\t\t\t\t<img src=\"data/image/down.png\" title=\"<?php echo $lang['albums']['change_order']; ?>\" alt=\"<?php echo $lang['albums']['change_order']; ?>\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<a href=\"?module=albums&amp;page=deleteimage&amp;var1=<?php echo $var1; ?>&amp;var2=<?php echo $image['seoname']; ?>\">\n\t\t\t\t\t\t\t<img src=\"data/image/delete_from_trash.png\" title=\"<?php echo $lang['albums']['delete_image']; ?>\" alt=\"<?php echo $lang['albums']['delete_image']; ?>\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\t\tunset($image);\n\t}\n}", "public function browse_files()\n {\n // Scan file directory, render the images.\n if (is_dir($this->file_path)) {\n $files = preg_grep('/^([^.])/', scandir($this->file_path));\n return $files;\n }\n \n }", "function listDir($user,$dir,$from,$to){\r\n\t$thumbDir=\"thumb/$user/\".$dir;\r\n\t$viewDir=\"view/$user/\".$dir;\r\n\t$imgDir=\"DATASET/$user/\".$dir;\r\n\tif(!file_exists($thumbDir))\r\n\t\t@mkdir($thumbDir);\r\n\tif(!file_exists($viewDir))\r\n\t\t@mkdir($viewDir);\r\n\t$items=array();\r\n\tif ($handle = opendir($imgDir)) {\r\n\t\t/* This is the correct way to loop over the directory. */\r\n\t\t$i=0;\r\n\t\t$prev=\"\";$next=\"\";\r\n\t\t$types=array(\"jpg\",\"jpeg\",\"png\",\"gif\");\r\n\t\twhile (false !== ($entry = readdir($handle))) {\r\n\t\t\t$filename=$imgDir.\"/\".$entry;\r\n\t\t\tif(is_dir($filename)) continue;\r\n\r\n\t\t\t$info = getimagesize($filename);\r\n\r\n\t\t\tdebug($filename);\r\n\t\t\t$pi=pathinfo($filename);\r\n\t\t\tif(!in_array(strtolower($pi['extension']),$types)) continue;\r\n\t\t\tif(isPic($info['2'])){\r\n\t\t\t\t$i++;\r\n\t\t\t\tif($i==$from) $prev=$entry;\r\n\t\t\t\tif($i<=$from) continue;\r\n\t\t\t\tif($i==$to+1) $next=$entry;\r\n\t\t\t\tif($i>$to) break;\r\n\r\n\t\t\t\t$width=$info['0'];\r\n\t\t\t\t$height=$info['1'];\r\n\t\t\t\t$size=$width*$height;\r\n\t\t\t\t$thumb=$filename;\r\n\r\n\t\t\t\t$n=1;\r\n\t\t\t\t$m=1;\r\n\t\t\t\tif($size>4000*4000) {$n=8;$m=3;}\r\n\t\t\t\telse if($size>3000*3000) {$n=7;$m=3;}\r\n\t\t\t\telse if($size>2000*2000) {$n=6;$m=2;}\r\n\t\t\t\telse if($size>1200*1200) {$n=5;$m=2;}\r\n\t\t\t\telse if($size>600*600) $n=2;\r\n\t\t\t\tif($height>=2.5*$width||$width>=2.5*$height) $n=$n/3>1?$n/3:1;\r\n\r\n\t\t\t\tif($n>1) {\r\n\t\t\t\t\t$thumb=$thumbDir.\"/\".$entry;\r\n\t\t\t\t\tdebug($thumb);\r\n\t\t\t\t\tif(!file_exists($thumb)) {\r\n\t\t\t\t\t\tinclude_once \"thumb.php\";\r\n\t\t\t\t\t\timg2thumb($filename,$thumb,$width/$n,$height/$n,0,0);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$view=$viewDir.\"/\".$entry;\r\n\t\t\t\tdebug($view);\r\n\t\t\t\tif(!file_exists($view)){\r\n\t\t\t\t\tif($m>1){\r\n\t\t\t\t\t\tinclude_once \"thumb.php\";\r\n\t\t\t\t\t\timg2thumb($filename,$view,$width/$m,$height/$m,0,0);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse copy($filename,$view);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$item['id']=$i-1;//count its id in the folder\r\n\t\t\t\t$item['href']=$entry;\r\n\t\t\t\t$item['src']=$thumb; $item['width']=$info['0'];$item['height']=$info['1'];\r\n\t\t\t\t$items[]=$item;\r\n\t\t\t}\r\n\t\t}\r\n\t\tclosedir($handle);\r\n\r\n\t\tif(count($items)>0){\r\n\t\t\t//resolve the links\r\n\t\t\t$items[0]['prev']=$prev;\r\n\t\t\t$items[count($items)-1]['next']=$next;\r\n\t\t\tforeach($items as $i=> $item){\r\n\t\t\t\tif($i>0) {\r\n\t\t\t\t\t$items[$i-1]['next']=$items[$i]['href'];\r\n\t\t\t\t\t$items[$i]['prev']=$items[$i-1]['href'];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tdebug(\"desp:...\\n\");\r\n\t\t\tinclude_once \"desp.php\";\r\n\t\t\tgetDesp($user,$dir,$items);\r\n\t\t\tdebug($items);\r\n\t\t}\r\n\t}\r\n\treturn $items;\r\n}", "function get_arr_pics_from_folder( $img_folder, $img_folder_url, $thumb_width = 50, $thumb_height = 50 )\n\t{\n\t\t$arr_filenames = $filesnames =array();\n\t\tif(file_exists($img_folder))\n\t\t{\n\t\t\t$filesnames = scandir($img_folder);\n\t\t}\n\t\t$count = 0;\n\t\tforeach ( $filesnames as $name )\n\t\t{\n\t\t\t$count++;\n\t\t\tif ( $name != \".\" && $name != \"..\" && $name != \"_evocache\" && $this->isImage($img_folder.$name) ) //not the folder and other files\n\t\t\t{\n\t\t\t\t$arr_filenames[] = array( $img_folder_url.$name,\n\t\t\t\t\"<a href='\".$img_folder_url.$name.\"' target='blank'><img src='\".$img_folder_url.$name.\"' width=\".$thumb_width.\"px heigh=\".$thumb_height.\"px /></a>\" );\n\t\t\t}\n\t\t\tif ($count==30) break; // The max number of the images we want to show\n\t\t}\n\t\t$arr_filenames[] = array(\"none\",T_(\"Transparent\"));\n\t\treturn $arr_filenames;\n\t}", "function display_image($picture) {\n return \"uploads\" . DS . $picture;\n}", "public function makePhotographyGallery()\n {\n $imagePath = 'images/photography';\n $imageFiles = File::allFiles($imagePath);\n\n return view('pages/photography')->with(compact('imagePath', 'imageFiles'));\n }", "public function index()\n {\n $imagesArray = glob(config('media.imagesPath').'*.*');\n if (count($imagesArray) > 0) {\n foreach ($imagesArray as $key => $image) {\n $imagesArray[$key] = substr($image, strlen(config('media.imagesPath')));\n }\n }\n\n return view('index', [\n 'imagesArray' => $imagesArray\n ]);\n }", "public function assetThumbnailListAction() {\n\t\t$parentFolder = $this->document->getElement ( \"parentFolder\" );\n\t\tif ($parentFolder) {\n\t\t\t$parentFolder = $parentFolder->getElement ();\n\t\t}\n\t\t\n\t\tif (! $parentFolder) {\n\t\t\t// default is the home folder\n\t\t\t$parentFolder = Asset::getById ( 1 );\n\t\t}\n\t\t\n\t\t// get all children of the parent\n\t\t$list = new \\Asset\\Listing ();\n\t\t$list->setCondition ( \"path like ?\", $parentFolder->getFullpath () . \"%\" );\n\t\t\n\t\t$this->view->list = $list;\n\t}", "public function show($folder)\n {\n $root=public_path(config('larapages.media.folder')).Input::all()['folder'];\n $dir=opendir($root);\n $files=[];\n while($file=readdir($dir)) {\n if ($file[0]!='.' && $file!='imageresize.php' && !is_dir($root.'/'.$file)) {\n $files[]=$file;\n }\n }\n natcasesort($files);\n $return='';\n Carbon::setLocale('en');\n \n $preview=['jpg','png','gif','jpeg'];\n \n # Check if Safari version is 9 or higher so we can preview PDF thumbnails\n $ua=$_SERVER['HTTP_USER_AGENT'];\n $safari=strpos($ua, 'Safari') && !strpos($ua, 'Chrome');\n $p=strpos($ua, 'Version/');\n $safariVersion=substr($ua, $p+8, strpos($ua, '.', $p)-$p-8);\n if ($safariVersion>=9) $preview[]='pdf';\n \n foreach($files as $file) {\n $return.='<li>';\n $return.='<a target=\"_blank\" href=\"/'.$this->urlencodeFolder(config('larapages.media.folder'),1).$this->urlencodeFolder(Input::all()['folder'],1).'/'.$this->urlencodeFolder($file,1).'\">';\n $extension=strtolower(substr($file,strrpos($file,'.')+1));\n if (in_array($extension, $preview))\n $return.='<div style=\"background-image:url(\\'/'.$this->urlencodeFolder(config('larapages.media.folder')).$this->urlencodeFolder(Input::all()['folder']).'/'.$this->urlencodeFolder($file).'\\')\">';\n else\n $return.='<div>'.$extension;\n $return.='</div></a>';\n $size=filesize($root.'/'.$file);\n $time=filemtime($root.'/'.$file);\n $time=Carbon::createFromTimeStamp($time)->formatLocalized('%a %d %B %Y').' '.Carbon::createFromTimeStamp($time)->toTimeString(); #->diffForHumans();\n $return.='<span class=\"fileselect\"><input type=\"checkbox\" value=\"x\"></span>';\n $return.='<span class=\"title\">'.$file.'</span>';\n $return.='<span class=\"size\">'.$size.'</span>';\n $return.='<span class=\"time\">'.$time.'</span>';\n $return.='<span class=\"actions\"><a class=\"delete icondelete\"></a></span>';\n $return.='</li>';\n }\n return $return;\n }", "public function getImagesFolder()\n {\n return defined(static::class . '::IMAGES') ? static::IMAGES : 'images';\n }", "public function index() {\n $images = Gallery::all();\n // $images = Gallery::all();\n require_once('views/gallery/index.php');\n }", "function ShowGallery($folder, $mask,$thumbWidth,$thumbHeight)\r\n{\r\n\t$images = ListFiles($folder, $mask);\r\n\t?>\r\n\t<div id=\"gallery\" class=\"ad-gallery\" >\r\n\t\t<div class=\"ad-image-wrapper\">\r\n\t\t</div>\r\n\t\t<div class=\"ad-controls\">\r\n\t\t</div>\r\n\t\t<div class=\"ad-nav\">\r\n\t\t\t<div class=\"ad-thumbs\">\r\n\t\t\t\t<ul class=\"ad-thumb-list\">\r\n\t\t\t\t<?php \r\n\t\t\t\t$counter = 0; // for the imageX class (image0,image1,...)\r\n\t\t\t\tforeach ($images as $image)\r\n\t\t\t\t{\r\n\t\t\t\t\t$alt = basename($image,substr($mask,1)); // cut the folder and extension (mask as a \"*\" at begining so without it) \r\n\t\t\t\t\t$alt = str_replace(\"_\", \" \", $alt); // alt is name without underscore\r\n\t\t\t\t\techo\t\"<li>\";\r\n\t\t\t\t\techo \t\t\"<a href='$image'>\";\r\n\t\t\t\t\techo \t\"<img src='$image' alt='$alt' class='image\".$counter.\"' style='width:\".$thumbWidth.\"px; height:\".$thumbHeight.\"px;'/>\";\r\n\t\t\t\t\techo \t\"</a>\";\r\n\t\t\t\t\techo \t\"</li>\";\t\t\t\t\r\n\t\t\t\t}\t// foreach close\r\n\t\t\t\t?>\r\n\t\t\t\t</ul>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t</div>\r\n\t<?php \r\n}", "private function listFolderFiles($dir = 'images/')\n {\n echo '<ol>';\n foreach (new \\DirectoryIterator($dir) as $fileInfo) {\n if (!$fileInfo->isDot()) {\n echo '<li>' . $fileInfo->getFilename();\n if ($fileInfo->isDir()) {\n self::listFolderFiles($fileInfo->getPathname());\n }\n echo '</li>';\n }\n }\n echo '</ol>';\n }", "function print_images()\n {\n $images = $this->service->imageList();\n $image_choice = 0;\n foreach ($images as $image) {\n printf(\"%d) %s: Image %s requires min. %dMB of RAM and %dGB of disk\\n\",\n $image_choice, $image->id, $image->name, $image->minRam,\n $image->minDisk);\n $image_choice += 1;\n }\n }", "function makesitesmages()\n\t{\n\n\t\tglobal $option, $mainframe;\n\n\t\t//First we'll nee access to the file system and we'll use the Joomla way to be all safe.\n\t\tjimport('joomla.filesystem.file');\n\t\t$uploads_path = JPATH_ROOT . DS . \"images\". DS .\"content\" . DS .\"arts_curriculum\". DS . \"masters\" ;\n\t\t$site_path = JPATH_ROOT . DS . \"images\". DS .\"content\" . DS .\"arts_curriculum\". DS . \"site\" ;\n\n\t\t// this is the width in px that we're telling GD to scale to, where's imagemagik when you need it.\n\t\t$new_w = 235;\n\t\t// where our source images live b/c GD needs to read them\n\t\t$cfg_fullsizepics_path = $uploads_path;\n\t\t//where we're sending them when we are done\n\t\t$cfg_thumb_path = $site_path;\n\t\t// we need one more path for this to work\n\t\t$filepath = $uploads_path ;\n\t\t// the directory\n\t\t$dir = dir($filepath);\n\n\t\t//check folders\n\t\t\t\n\t\twhile($entry=$dir->read()) {\n\t\t\t//check the files\n\t\t\tif($entry == \".\" || $entry == \"..\") {\n\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\t\n\t\t\t$fp = @fopen(\"$filepath/$entry\",\"r\");\n\n\t\t\t$photo_filename = \"$entry\";\n\n\t\t\t$image_stats = GetImageSize($cfg_fullsizepics_path.\"/\".$entry);\n\n\t\t\t$imagewidth = $image_stats[0];\n\n\t\t\t$imageheight = $image_stats[1];\n\n\t\t\t$img_type = $image_stats[2];\n\n\t\t\t$ratio = ($imagewidth / $new_w);\n\n\t\t\t$new_h = round($imageheight / $ratio);\n\n\t\t\tif (!file_exists($cfg_thumb_path.\"/\".$entry)) {\n\n\t\t\t\tif ($img_type==\"2\") {\n\n\t\t\t\t\t$src_img = imagecreatefromjpeg($cfg_fullsizepics_path.\"/\".$entry);\n\n\t\t\t\t\t$dst_img = imagecreatetruecolor($new_w,$new_h);\n\n\t\t\t\t\timagecopyresampled($dst_img,$src_img,0,0,0,0,$new_w,$new_h,imagesx($src_img),imagesy($src_img));\n\n\t\t\t\t\timagejpeg($dst_img, \"$cfg_thumb_path\".\"/$entry\", 100);\n\t\t\t\t\t\t\n\t\t\t\t\timagedestroy($dst_img);\n\n\t\t\t\t} elseif ($img_type==\"3\") {\n\n\t\t\t\t\t$src_img=ImageCreateFrompng($cfg_fullsizepics_path.\"/\".$entry);\n\t\t\t\t\t \n\t\t\t\t\t$dst_img=ImageCreateTrueColor($new_w,$new_h);\n\t\t\t\t\t\t\n\t\t\t\t\tImageCopyResampled($dst_img,$src_img,0,0,0,0,$new_w,$new_h,ImageSX($src_img),ImageSY($src_img));\n\n\t\t\t\t\tImagepng($dst_img, \"$cfg_thumb_path\".\"/$entry\",100);\n\n\t\t\t\t\timagedestroy($dst_img);\n\n\t\t\t\t} elseif ($img_type==\"1\") {\n\n\t\t\t\t\t$cfg_thumb_url=$cfg_fullsizepics_url;\n\n\t\t\t\t} \n\n\t\t\t}\n\n\n\t\t\t\t\n\t\t} //the files are now in the /images/content/sketchup/site directory\n\n\n\t\t//$this->setRedirect( 'index.php?option=' . $option.'&task=movesiteimages&controller=items', 'Site Images made' );\n\t\t$this->setRedirect( 'index.php?option=' . $option, 'Site Images made' );\n\t\n\t}", "public function getImages(){\n $images =[];\n $files=[];\n $imageDir=opendir(IMAGES_DIR);\n while(false !==($file=readdir($imageDir))){\n // $imageDirから一行ずつ読み込んで,$fileに入れて行く そんでそれがfalseにならない限り回し続ける\n if($file === '.'||$file =='..'){\n // カレントディレクトリやルートディレクトリを飛ばして回す\n continue;\n }\n $files[]=$file;\n //thumnailは imagesdirに存在するのかな\n if(file_exists(THUMBNAIL_DIR.'/'.$file)){\n $images[]=basename(THUMBNAIL_DIR).'/'.$file;\n } else{\n $images[]=basename(IMAGES_DIR).'/'.$file;\n }\n }\n array_multisort($files,SORT_DESC,$images);\n // 逆向き順に$filesに入っているimagesをそr・せよ\n return $images;\n}", "public function GetAlbums()\n {\n if ($handle = opendir('albums')) {\n # Loop thrue all entries in the directory handle untill it reads boolean FALSE\n while (false !== ($entry = readdir($handle))) {\n # Check to not display root and return links\n if ($entry != \".\" && $entry != \"..\") {\n # Display entry link\n include \"../private_html/templates/albumCell.php\";\n }\n }\n closedir($handle);\n }\n }", "function getfoldercontent($folder, &$dir_array, &$pic_array, &$expic_array)\r\n{\r\n global $xoopsModuleConfig;\r\n\r\n $dir = opendir(XOOPS_ROOT_PATH.\"/modules/xcgal/\".$xoopsModuleConfig['fullpath'].$folder);\r\n while($file = readdir($dir)){\r\n if(is_dir(XOOPS_ROOT_PATH.\"/modules/xcgal/\".$xoopsModuleConfig['fullpath'].$folder.$file)) {\r\n if ($file != \".\" && $file != \"..\")\r\n $dir_array[] = $file;\r\n }\r\n if(is_file(XOOPS_ROOT_PATH.\"/modules/xcgal/\".$xoopsModuleConfig['fullpath'].$folder.$file)) {\r\n if(strncmp($file, $xoopsModuleConfig['thumb_pfx'], strlen($xoopsModuleConfig['thumb_pfx'])) != 0\r\n && strncmp($file, $xoopsModuleConfig['normal_pfx'], strlen($xoopsModuleConfig['normal_pfx'])) != 0)\r\n $pic_array[] = $file;\r\n }\r\n }\r\n closedir($dir);\r\n\r\n natcasesort($dir_array);\r\n natcasesort($pic_array);\r\n}", "function getallpicindb(&$pic_array, $startdir)\r\n{\r\n global $xoopsDB;\r\n\r\n $sql = \"SELECT filepath, filename \".\r\n \"FROM \".$xoopsDB->prefix(\"xcgal_pictures\").\" \".\r\n \"WHERE filepath LIKE '$startdir%'\";\r\n $result = $xoopsDB->query($sql);\r\n while ($row = $xoopsDB->fetchArray($result)) {\r\n $pic_file = $row['filepath'].$row['filename'];\r\n $pic_array[$pic_file]=1;\r\n }\r\n $xoopsDB->freeRecordSet($result);\r\n}", "function os_images($id = 0){\n\t\t$result = $this->Azure->getOSImages();\t\t\n\t\t$OSImageDetails = \"\";\n\t\tif(!empty($id)){\n\t\t\t$OSImageDetails = $this->Azure->getOSImageDetails($id);\n\t\t}\n\t\t$this->template->load(\"main\",\"osimages\",array(\"osimages\" => $result,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"osimagedetails\" => $OSImageDetails,\n\t\t\t\t\t\t\t\t\t\t\t\t\t \"selectedosimage\" => $id));\t\t\t\n\t}", "static function images($folder, $types = array('jpg', 'jpeg', 'gif', 'png', 'JPG', 'JPEG', 'GIF', 'PNG')) {\r\n\t\t$files\t= array();\r\n\t\t$images\t= array();\r\n\t\t\r\n\t\t//$dir = JPATH_BASE.'/'.$folder;\r\n\t\t$dir = JPATH_SITE.'/'.$folder;\r\n\t\t// check if directory exists\r\n\t\tif (is_dir($dir))\r\n\t\t{\r\n\t\t\tif ($handle = opendir($dir)) {\r\n\t\t\t\twhile (false !== ($file = readdir($handle))) {\r\n\t\t\t\t\tif ($file != '.' && $file != '..' && $file != 'CVS' && $file != 'index.html' ) {\r\n\t\t\t\t\t\t$files[] = $file;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tclosedir($handle);\r\n\t\t\tasort($files);\r\n\t\t\t$i = 0;\r\n\t\t\tforeach ($files as $img)\r\n\t\t\t{\r\n\t\t\t\tif (!is_dir($dir .'/'. $img))\r\n\t\t\t\t{\r\n\t\t\t\t\t$type = substr($img, strrpos($img, '.') + 1);\r\n\t\t\t\t\tif (in_array($type, $types)) {\r\n\t\t\t\t\t\t$images[$i]->name \t= $img;\r\n\t\t\t\t\t\t$images[$i]->folder\t= $folder;\r\n\t\t\t\t\t\t++$i;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $images;\r\n\t}", "function get_pages_images_list() {\n\t$files = scandir(BASEPATH . \"/../public/images/pages\");\n\tarray_shift($files); // remove \".\"\n\tarray_shift($files); // remove \"..\"\n\treturn $files;\n}", "function images_add_folder($image_data_url,$folder_name)\r\n{\r\n\t \r\n\t\r\n\t foreach($image_data_url as $file)\r\n {\r\n //get image contents\r\n $image = file_get_contents($file);\r\n\t\t\t\t\t $f_name=explode (\"?\",$file);\r\n\t\t\t\t $image_url=explode('/',$f_name[0]);\r\n $only_name=$image_url[count($image_url)-1];\r\n //put image contents\r\n file_put_contents($folder_name.\"/\".$only_name, $image);\r\n\t\t\t }\r\n}", "function recur_dir($path, $wpath, $dir)\n{\n global $gallery_id;\n $db = new nggdb_extended();\n\n $images = array();\n $children = array();\n $gal_created = 0;\n\n// Read directory config file\n $config = null;\n if(file_exists($path . '/galleryconf'))\n $config = config_parser($path . '/galleryconf');\n\n// Sort files by filename\n $files = array();\n\n $dhandle = opendir($path);\n while($file = readdir($dhandle))\n array_push($files, $file);\n\n natsort($files);\n\n// Loop over files, generate thumbs and add to gallery\n foreach($files as $file)\n {\n if(!($file === '.svn' || $file === '.' || $file === '..'))\n {\n // decend into directory\n if(is_dir($path .'/'. $file) && $file != 'thumbs')\n {\n print \"\\nEntering: $file\\n\";\n\n $child = recur_dir($path .'/'. $file, $wpath .'/'. $file, $file);\n array_push($children, $child);\n\n print \"\\nLeaving: $file\\n\";\n }\n // prosess images\n else if(preg_match(\"/(.JPG|.PNG|.GIF)/i\", $file))\n {\n if($gal_created == 0)\n {\n // Create gallery\n $db->add_gallery_gid($gallery_id, $dir, \"wp-content/$wpath\", '', 0, $previewpic = 0);\n\n if($config != null)\n {\n $body = $config['body']; \n if(strtolower($config['head']['position']) == 'after')\n $post = \"[nggallery id=$gallery_id]\\n<div style='clear: both;'></div>$body\";\n else\n $post = \"$body\\n[nggallery id=$gallery_id]\";\n }\n else\n $post = \"[nggallery id=$gallery_id]\";\n\n // Create gallary post\n wp_insert_post(array(\n 'post_title' => $dir,\n 'post_name' => $slug,\n 'comment_status' => 'gallery_page',\n 'post_type' => 'page',\n 'post_content' => $post,\n 'post_status' => 'publish',\n 'post_author' => 1));\n\n $gal_created = 1;\n }\n\n // create thumbs\n if(!file_exists(\"$path/thumbs\"))\n mkdir(\"$path/thumbs\");\n\n exec(\"convert -resize 180x180 \\\"$path/$file\\\" \\\"{$path}/thumbs/thumbs_$file\\\"\");\n\n // insert into db\n print \"Added file: $file\\n\";\n $id = $db->insert_image($gallery_id, $file, $file, \"\", 0);\n\n array_push($images, $id);\n }\n }\n }\n\n $return = array(\n 'Name' => $dir,\n 'Path' => $path,\n 'ID' => $gallery_id,\n 'Img' => $images,\n 'Children' => $children);\n\n if($gal_created == 1)\n $gallery_id ++;\n\n// Generate index gallary\n if($config != null && strtolower($config['head']['mode']) == 'index')\n {\n print \"\\n\\n-- making index --\\n\";\n\n $galleries = array();\n get_galleries($return, $galleries);\n\n // make album\n $album_galleries = array();\n\n foreach($galleries as $gallery)\n {\n array_push($album_galleries, $gallery['ID']);\n }\n\n $id = $db->add_album($config['head']['title'], $previewpic = 0, '',serialize($album_galleries) , $pageid = 0);\n\n $body = $config['body']; \n if(strtolower($config['head']['position']) == 'after')\n $post = \"[album id=$id template=compact]\\n<div style='clear: both;'></div>$body\";\n else\n $post = \"$body\\n[album id=$id template=compact]\";\n\n wp_insert_post(array(\n 'post_title' => $config['head']['title'],\n 'post_name' => $config['head']['title'],\n 'comment_status' => 'gallery_page',\n 'post_type' => 'page',\n 'post_content' => $post,\n 'post_status' => 'publish',\n 'post_author' => 1));\n }\n\n return $return;\n}", "function showJpgDirectory($path, $allowParent) {\n\n\t// Check folder exists\n\tif (!is_dir($path)) {\n\t\techo \"Unable to find directory!\";\n\t\treturn false;\n\t}\n\t\n // Try and open the directory\n\tif ($handle = opendir($path)) {\n\n\t\t// loop over the directory\n\t\twhile (false !== ($entry = readdir($handle))) {\n\t\t\n\t\t\tswitch(filetype($path.'/'.$entry)):\n\t\t\t\tcase \"file\":\n\t\t\t\t\t// Get the file extention\n\t\t\t\t\t$lastbullet = strrchr($entry,'.');\n\t\t\t\t\t$ext = strtolower(substr($lastbullet,1));\n\t\t\t\t\t\n\t\t\t\t\t// Only show JPG images\n\t\t\t\t\tif ($ext == \"jpg\") {\n\t\t\t\t\t\techo \"<img src='/rbwebdesigns/wiki/imagelib/$entry' class='libicon' />$entry<br/>\";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"dir\":\n if(!$allowParent && ($entry == \".\" || $entry == \"..\")) {\n // Don't display link as we don't want to go to higher dir \n } else {\n\t\t\t\t\t echo \"<a href='#' onclick='showDirectory($entry)'>$entry</a><br/>\";\n }\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\tendswitch;\n\t\t}\n\t\tclosedir($handle);\n\t}\n}", "function __reimportPhotos(){\n\t\t$this->Asset->disablePermissionable();\n\t\t$this->Asset->recursive=0;\n\t\t$json = $this->Asset->find('all', array('fields'=>'json_src'));\n\t\t$json =Set::extract($json, '/Asset/json_src');\n\t\tforeach ($json as $row) {\n\t\t\t$imgSrc = json_decode($row);\n\t\t\t$src = \"Summer2009/\".basename($imgSrc->orig);\n\t\t\t$dest = $imgSrc->preview;\n\t\t\t$src_baseurl = Configure::read('path.local.preview');\n\t\t\t$dest_baseurl = Configure::read('stageroot.basepath');\n\t\t\t$shell_cmd[] =\"cp {$src_baseurl}/{$src} {$dest_baseurl}/{$dest}\";\n\t\t\t//\t\t\tmkdir(dirname(Configure::read('stageroot.basepath').\"/{$dest}\"), 0777, $recursive=true);\n\t\t\t//\t\t\tcopy( Configure::read('path.local.preview').\"/{$src}\", Configure::read('stageroot.basepath').\"/{$dest}\");\n\t\t}\n\t\tdebug($shell_cmd);\n\t}", "function xcscandir($dir, &$expic_array)\r\n{\r\n static $dir_id = 0;\r\n static $count =0;\r\n static $pic_id=0;\r\n\r\n $pic_array = array();\r\n $dir_array = array();\r\n\r\n getfoldercontent($dir, $dir_array, $pic_array, $expic_array );\r\n\r\n if (count($pic_array) > 0){\r\n $dir_id_str=sprintf(\"d%04d\", $dir_id++);\r\n echo dirheader($dir, $dir_id_str);\r\n foreach ($pic_array as $picture) {\r\n $count++;\r\n $pic_id_str=sprintf(\"i%04d\", $pic_id++);\r\n echo picrow($dir.$picture, $pic_id_str, $dir_id_str );\r\n }\r\n }\r\n if (count($dir_array) > 0){\r\n foreach ($dir_array as $directory) {\r\n xcscandir($dir.$directory.'/', $expic_array);\r\n }\r\n }\r\n return $count;\r\n}", "function admin_showimage($selection, $path, $options) { global $get, $uri;\n\t$real_path = $path.'/'.$selection;\n\tif (isset($get['o'])) {\n\t\t$url = explode('/',$get['o']);\n\t\t$url1 = explode('|', $url[0]);\n\t\t$url2 = explode('|', $url[1]);\n\t\t$found = in_array('sl', $url1) ? true : false;\n\t\t$link = pre_seao($url1[0], $url2[0], false, true);\n\t\t$link = str_replace('ebookcms.php/', '', $link);\n\t\t$link = str_replace('ebookcms.php?', '?', $link);\n\t\t$add = !isset($get['sl']) ? pre_seao('sl', '1') : '';\n\t\tfor ($i=1; $i<count($url1); $i++) {\n\t\t\t$link .= pre_seao($url1[$i], $url2[$i]);\n\t\t\tif ($i==2 && !$found) {$link .= $add;}\n\t\t}\n\t}\n\techo '<div class=\"show_img\">';\n\tif (!LOGGED && isAllowed('uplimg_access')) {echo t('not_allowed').'</div>'; exit;}\n\tif (is_dir($real_path)) { $images = '';\n\t\t$handle = opendir($real_path);\n\t\t$extensions = array('.jpg', '.bmp', '.gif', '.png');\n\t\twhile (($file = readdir($handle)) == true) {\n\t\t\tif ($file != '.' && $file != '..' && $file != 'thumbs') {\n\t\t\t\tclearstatcache();\n\t\t\t\t$ext = strrchr($file, '.');\n\t\t\t\tif (in_array($ext, $extensions)) {\n\t\t\t\t\tif (file_exists($real_path.'/thumbs/'.$file)) {\n\t\t\t\t\t\t$images = $images.'<li>\n\t\t\t\t\t\t\t<div class=\"si_title\">\n\t\t\t\t\t\t\t\t<h4>'.$file.'</h4>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"si_img\">\n\t\t\t\t\t\t\t\t<img src=\"'.$real_path.'/thumbs/'.$file.'\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"si_foot\">\n\t\t\t\t\t\t\t\t<p><a href=\"'.$link.'\" onClick=\"var r = confirm(\\''.t('delete_img').'?\\'); if (r) {deleteimage(\\''.$file.'\\',\\''.$real_path.'\\');}\" \n\t\t\t\t\t\t\t\t\ttarget=\"_self\">'.t('delete').'</a></p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</li>';\n\t\t\t\t\t} else {$images = $images.'<li>\n\t\t\t\t\t\t<div class=\"si_title\">\n\t\t\t\t\t\t\t<h4>'.$file.'</h4>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"si_img\">\n\t\t\t\t\t\t\t<img src=\"'.$real_path.'/'.$file.'\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"si_foot\">\n\t\t\t\t\t\t\t<p><a href=\"'.$link.'\" onClick=\"var r = confirm(\\''.t('delete_img').'?\\'); if (r) {deleteimage(\\''.$file.'\\',\\''.$real_path.'\\');}\" \n\t\t\t\t\t\t\t\t\ttarget=\"_self\">'.t('delete').'</a></p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</li>';}\n\t\t\t\t}\n\t\t\t}\n\t\t} closedir($handle);\n\t\tif (!empty($images)) {echo '<ul>'.$images.'</ul><br />';} else {echo t('no_image');}\n\t} else if (empty($selection)) {echo t('select_imgs');}\n\techo '</div>';\n\tif (!empty($images)) {return;}\n}", "private function prepareImageList() {\n\t\t\tforeach(scandir($this->templateDirectory) as $templateFileName) {\n\t\t\t\tif((strcmp($templateFileName, \".\") !== 0) && (strcmp($templateFileName, \"..\") !== 0)) {\n\t\t\t\t\t$this->imageList->addItem(new Image($this->templateDirectory, $templateFileName), $templateFileName);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function createImgFolder(){\n\t\t\n\t\t$tdDate = date('Y-m-d');\n\t\t$dateArray = explode(\"-\",$tdDate);\n\t\tif (!file_exists(\"static/images/\".$dateArray['0'])){\n\t\t\tmkdir(\"static/images/\".$dateArray['0'], 0777);\n\t\t\t}\n\t\tif (!file_exists(\"static/images/\".$dateArray['0'].\"/\".$dateArray['1'])){\n\t\t\t\tmkdir(\"static/images/\".$dateArray['0'].\"/\".$dateArray['1'], 0777);\n\t\t\t}\n\t\tif (file_exists(\"static/images/\".$dateArray['0'].\"/\".$dateArray['1'])){\n\t\t\t\t\treturn \"images/\".$dateArray['0'].\"/\".$dateArray['1'];\n\t\t\t}\n\t\t\n\t}", "public function index()\n {\n $galleryImages = GalleryImage::with(['category.album'])->get();\n return view('admin_dashboard.gallery.image.index', compact(['galleryImages']));\n }", "private function readImages()\r\n {\r\n if(file_exists($this->location) && is_readable($this->location))\r\n {\r\n $images = array();\r\n\r\n foreach(array_diff(scandir($this->location), array('.', '..')) as $file)\r\n {\r\n if($this->isValidImageType($file))\r\n {\r\n $type = strtolower(pathinfo($file, PATHINFO_EXTENSION));\r\n\r\n if(!in_array($type, $this->extensions))\r\n {\r\n $this->extensions[] = $type;\r\n }\r\n\r\n $images[] = new Image($this->location . '/' . $file);\r\n }\r\n }\r\n\r\n usort($images, function($a, $b) {\r\n return $a->getWidth() > $b->getWidth();\r\n });\r\n\r\n $this->images = $images;\r\n }\r\n }", "function tp_get_img_dir() {\n\t$file = new ElggFile();\n\t$file->setFilename('image/');\n\treturn $file->getFilenameOnFilestore();\n}", "function _initFiles()\r\n {\r\n if (array_key_exists($this->_mediaType, $this->mediaTypePaths)) {\r\n $strPath = $this->mediaTypePaths[$this->_mediaType][0].$this->_path;\r\n } else {\r\n $strPath = ASCMS_CONTENT_IMAGE_PATH.$this->_path;\r\n }\r\n\r\n $objDir = @opendir($strPath);\r\n\r\n $arrFiles = array();\r\n\r\n if ($objDir) {\r\n $path = array();\r\n if ( $this->_path !== \"/\"\r\n && preg_match('#(.*/).+[/]?$#', $this->_path, $path)) {\r\n array_push($this->_arrDirectories, array('name' => '..', 'path' => $path[1], 'icon' => $this->_iconPath.'Folder.png'));\r\n }\r\n\r\n $file = readdir($objDir);\r\n while ($file !== false) {\r\n// TODO: This match won't work for arbitrary thumbnail file names as they\r\n// may be created by the Image class!\r\n if ($file == '.' || $file == '..' || preg_match('/(?:\\.(?:thumb_thumbnail|thumb_medium|thumb_large)\\.[^.]+$)|(?:\\.thumb)$/i', $file) || $file == 'index.php') {\r\n $file = readdir($objDir);\r\n continue;\r\n }\r\n array_push($arrFiles, $file);\r\n $file = readdir($objDir);\r\n }\r\n closedir($objDir);\r\n\r\n sort($arrFiles, SORT_NATURAL | SORT_FLAG_CASE);\r\n\r\n foreach ($arrFiles as $file) {\r\n if (is_dir($strPath.$file)) {\r\n array_push($this->_arrDirectories, array('name' => $file, 'path' => $this->_path.$file, 'icon' => $this->_getIcon($strPath.$file)));\r\n } else {\r\n $filesize = @filesize($strPath.$file);\r\n if ($filesize > 0) {\r\n $filesize = round($filesize/1024);\r\n } else {\r\n $filesize = 0;\r\n }\r\n $arrDimensions = array(0 => 0, 1 => 0);\r\n if (\\Cx\\Core_Modules\\Media\\Controller\\MediaLibrary::_isImage($strPath.$file)) {\r\n $arrDimensions = @getimagesize($strPath.$file);\r\n }\r\n array_push($this->_arrFiles, array('name' => $file, 'path' => $this->_path.$file, 'size' => $filesize, 'icon' => $this->_getIcon($strPath.$file), 'width' => intval($arrDimensions[0]), 'height' => intval($arrDimensions[1])));\r\n }\r\n }\r\n }\r\n }", "function import_osimages(){\n\t\techo $this->Azure->importOSImages();\n\t}", "public function firstParty()\n {\n $images = [];\n\n foreach ((new Finder())->in($this->path)->directories()->sortByName() as $directory) {\n /* @var $directory \\Symfony\\Component\\Finder\\SplFileInfo */\n $images[] = new Image($this->getImageName($directory, $this->name), $directory->getRealPath());\n }\n\n return $images;\n }", "public function main()\n {\n return $this->browseImages();\n }", "static function getImageFolder($package = '', $path = 'data/images/') {\n $path .= $package . '/';\n $folder = date('m') . '_' . date('Y');\n if (!is_dir($path . $folder)) {\n @mkdir($path . $folder);\n @mkdir($path . $folder . '/thumbs');\n }\n return $path . $folder;\n }", "function pushImages() \n\t{\n\t\tglobal $imageDir;\n\t\tglobal $studentImageDir;\t\t\n\t\tglobal $countImgs;\n\t\tglobal $countStudents;\n\t\t\n\t\t//Set up arrays of found images\n\t\t//This is being done ahead of the for statements since UNC's system\n\t\t//I think took the empty globs as FALSE instead of an empty array.\n\t\t$slideshow_pngs = glob($imageDir . \"*.png\");\n\t\t$slideshow_bigPNGs = glob($imageDir . \"*.PNG\");\n\t\t$slideshow_jpgs = glob($imageDir . \"*.jpg\");\n\t\t$slideshow_bigJPGs = glob($imageDir . \"*.JPG\");\n\t\t//global $fullImageDir;\n\n\t\t// Build top slideshow array\n\t\tif ($slideshow_pngs and !empty($slideshow_pngs))\n\t\t{\n\t\t\tforeach ($slideshow_pngs as $png) {\n\t\t\t\t//tempAr will be populated into the slideshow javascript\n\t\t\t\t//the first element is the thumbnail\n\t\t\t\t//the second element is the large image file\n\t\t\t\t//echo(\"tempAr = ['$png', '\" . substr_replace($png, $fullImageDir, 0, strlen($imageDir)) . \"'];\");\t\n\t\t\t\techo(\"tempAr = ['$png', '$png'];\");\t\t\t\n\t\t\t\techo(\"myImageArray.push(tempAr);\" );\n\t\t\t\t$countImgs += 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($slideshow_bigPNGs and !empty($slideshow_bigPNGs))\n\t\t{\t\t\n\t\t\tforeach ($slideshow_bigPNGs as $png) {\n\t\t\t\techo(\"tempAr = ['$png', '$png'];\");\t\t\t\t\t\n\t\t\t\techo(\"myImageArray.push(tempAr);\" );\n\t\t\t\t$countImgs += 1;\n\t\t\t}\t\n\t\t}\n\n\t\tif ($slideshow_jpgs and !empty($slideshow_jpgs))\n\t\t{\t\t\n\t\t\tforeach ($slideshow_jpgs as $jpg) {\n\t\t\t\techo(\"tempAr = ['$jpg', '$jpg'];\");\t\t\t\t\n\t\t\t\techo(\"myImageArray.push(tempAr);\" );\n\t\t\t\t$countImgs += 1;\n\t\t\t}\t\n\t\t}\n\n\t\tif ($slideshow_bigJPGs and !empty($slideshow_bigJPGs))\n\t\t{\t\t\n\t\t\tforeach ($slideshow_bigJPGs as $jpg) {\n\t\t\t\techo(\"tempAr = ['$jpg', '$jpg'];\");\t\t\t\t\n\t\t\t\techo(\"myImageArray.push(tempAr);\" );\n\t\t\t\t$countImgs += 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\techo(\"myImageArray.sort()\"); //sort our slideshow alphabetically\n\t\t\n\t}", "public function getAllImages() {\n\t\t$returnArr = array();\n\n\t\tforeach (File::allFiles($this->imageFolder) as $file) {\n\t\t\t$fileName = $file->getRelativePathName();\n\n\t\t\t$returnArr[] = url() . '/uploads/images/'.$fileName;\n\t\t}\n\n\t\treturn $returnArr;\n\t}", "private function set_directory(){\n if(!is_dir($this->img_dir)) mkdir($this->img_dir);\n if(!is_dir($this->thumb_dir)) mkdir($this->thumb_dir);\n }", "public function showList()\n\t{\n\t\t$images = array();\n\t\tif (Auth::user()->name == \"admin\") {\n\t\t\t$images = DB::table('images')->get();\n\t\t} else {\n\t\t\t$images = DB::table('images')\n\t\t\t\t->where('created_by', '=', Auth::user()->name)\n\t\t\t\t->get();\n\t\t}\n\n\t\treturn view('admincp.listImage', ['images' => $images]);\n\t}", "function getSlider_images()\n\t\t{\n\t\t\t$slider_images = $this->manage_content->getValue('slider_info','*');\n\t\t\tforeach($slider_images as $slider_image)\n\t\t\t{\n\t\t\t\tif($slider_image['slider_status'] == 1)\n\t\t\t\t{\n\t\t\t\t\techo '<a href=\"'.$slider_image[\"slider_link\"].'\"><img src=\"images/'.$slider_image[\"slider_image\"].'\" style=\"width:692px;height:210px;\"/></a>';\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function ListFiles($folder,$mask)\r\n{\t// $extension is like '*.png'\r\n\t$images = glob(\"\" . $folder . $mask);\r\n\treturn $images;\r\n}", "function outputImageList() {\n\t//if (!isset($_SESSION['imagesIndexed']) || $_SESSION['imagesIndexed'] != false || !isset($allImages)) {\n\t\t$dir = opendir(\"../images\"); $counter = 1;\n\t\tdo {\n\t\t\t$nextDir = readdir($dir);\n\t\t\tif ($nextDir != '.' && $nextDir != '..' && $nextDir !== false) {\n\t\t\t\tif (filetype($nextDir) != 'dir' && fileExtension($nextDir) != 'html' && fileExtension($nextDir) != 'txt' && fileExtension($nextDir) != 'php') {\n\t\t\t\t\t$allImages[] = htmlspecialchars($nextDir);\n\t\t\t\t}\n\t\t\t}\n\t\t} while ($nextDir !== false);\n\t\t\n\t\tfor ($i=0;$i<count($allImages); $i++) { $newImages[] = strtolower($allImages[$i]); }\n\t\t//echo 'Done,';\n\t\tarray_multisort($newImages, SORT_ASC, SORT_STRING, $allImages);\n\t//} else { /*$allImages = $_SESSION['allImages'];*/ unset($_SESSION['imagesIndexed']); } // Only re-index all files if the list is empty, in this case, $allImages must already be set\n\t\n\t//Print ImageList Table Header\n\t$ret = '<div>';\n\t\n\t$ret .= '<i>Total Images</i>: '.count($allImages).' <span id=\"imageListMsg\"></span><br><i>Listing</i> ';\n\t\n\t$_SESSION['imageSet'][0].\n\t\n\t\t$beginEntries = array();\n\t\tfor ($i=0;$i<count($allImages);$i+=$_SESSION['imageSet'][1]) { $beginEntries[] = $i; }\n\t\t$begins = '<select id=\"imageSetStart\" onchange=\"changeImageSet(this.value,'.(int)$_SESSION['imageSet'][1].')\">';\n\t\tfor ($i=0;$i<count($beginEntries);$i++) {\n\t\t\t$begins .= '<option value=\"'.$beginEntries[$i].'\" '.($_SESSION['imageSet'][0]==$beginEntries[$i]?'selected=\"\"':'').'>'.$beginEntries[$i].'</option>';\n\t\t}\n\t\t$begins .= '</select>';\n\t\t\n\t\t$setSizes = array(50,100,500,1000,2500,5000,10000);\n\t\t$ends = '<select id=\"imageSet\" onchange=\"changeImageSet('.(int)$_SESSION['imageSet'][0].',this.value)\">';\n\t\tfor($i=0;$i<count($setSizes);$i++) {\n\t\t\t$ends .= '<option value=\"'.$setSizes[$i].'\" '.($_SESSION['imageSet'][1]==$setSizes[$i]?'selected=\"\"':'').'>'.$setSizes[$i].'</option>';\n\t\t}\n\t\t$ends .= '</select>';\n\t\t\n\t\t$topbound = min($_SESSION['imageSet'][0]+$_SESSION['imageSet'][1],count($allImages));\n\t\n\t$ret .= $begins;\n\t\n\t$ret .= ' to '.$topbound.', <i>Show</i> '.$ends.\"\\r\\n\";\n\t\n\t$ret .= '<table class=\"imageTable\" width=\"100%\" align=\"left\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">';\n\t\n\t//Print each row/image for table\n\t\n\t//echo 'Outputting from '.$_SESSION['imageSet'][0].' to '.$topbound.'<br>';\n\t\n\tfor ($i=$_SESSION['imageSet'][0]; $i<$topbound; $i++){ // Original method outputting all data\n\t\t$ret .= '<tr id=\"ir_' . $allImages[$i] . '\"><td class=\"' . ($i%2?'I2':'I1') . '\"><input type=\"image\" src=\"images/edit.png\" onclick=\"iR(\\'' . $allImages[$i] . '\\');\" /></td><td id=\"hovRow_' . $allImages[$i] . '\"';\n\t\tif ($i % 2) { $ret .= ' style=\"background-color: #EEE;\" onmouseover=\"hoverOn2(this);\" onmouseout=\"hoverOff2(this);\"'; }\n\t\telse { $ret .= ' onmouseover=\"hoverOn(this);\" onmouseout=\"hoverOff(this);\"'; }\n\t\t$ret .= '><div id=\"vDiv_' . $allImages[$i] . '\" class=\"I\" onclick=\"iC(\\'' . $allImages[$i] . '\\');\">' . htmlentities($allImages[$i]) . '</div>'.\n\t\t'<div id=\"eDiv_' . $allImages[$i] . '\" style=\"float: left; display: none;\">'.\n\t\t'<input type=\"text\" size=\"30\" id=\"tBox_' . $allImages[$i] . '\" value=\"' . $allImages[$i] . '\" />'.\n\t\t'<input type=\"image\" src=\"images/check.png\" onclick=\"imageSavename(\\'' . $allImages[$i] . '\\');\" /></div>'.\n\t\t'</td><td' . ($i%2 ? ' style=\"background-color: #EEE;\"' : '') . '>'.\n\t\t'<input type=\"image\" src=\"images/delete.png\" onclick=\"imageDelete(\\'' . $allImages[$i] . '\\');\" /></td></tr>';\n\t} //End old format\n\t\n\t/* $ret .= '[^S}'; // New format\n\tfor ($i=$_SESSION['imageSet'][0]; $i<$topbound; $i++){\n\t\t$ret .= $allImages[$i].'[>}';\n\t}\n\t$ret .= '[^E}'; // End new format */\n\t\n\t$ret .= '</table>';\n\treturn $ret;\n}", "public function showOfficeImages()\n {\n $officeImages = $this->service->getOfficeImages();\n\n return view('admin.office.showimages',['officeImages' => $officeImages]);\n }", "function showFile($file){ \n\t$pathToRes = \"images/\";\t\t\t\t\t// directory to parse for image-resources     \n\t$splitedFile = split('[.]',$file);\t\t// divides the file into extension and filename \n\n\tif ($dh = opendir($pathToRes)) {\t\t// opens directory with image-resources \n\t\twhile (false !== ($files = readdir($dh))){ \n\t\t\tif ($files != \"..\" && $files != \".\") { \n\t\t\t\t$parts = split('[.]',$files); \n\t\t\t\t// the next step will compare all filenames from the images-resources with the extension of the passed file \n\t\t\t\tif ($parts[0] == $splitedFile[1]){\n\t\t\t\t\techo '<img src='.$pathToRes.\"/\".$files.' > '.$splitedFile[0].'<br>'; \n\t\t\t\t} \n\t\t\t} \n\t\t} \n\t    closedir($dh); \n\t} \n}", "public function view_images()\n {\n $data['images'] = $this->Image_model->get_images();\n $this->load->view('student/index', $data);\n }", "function thumbnails_begin($folderID) {\n\tglobal $mg2;\n\t$mg2->headline = ($folderID === 1)?\n\t\t\t\t\t\t $mg2->gallerytitle\n\t\t\t\t\t\t :\n\t\t\t\t\t\t $mg2->br2line($mg2->all_folders[$folderID][2]);\n\tinclude_once('skins/'.$mg2->activeskin.'/templates/gallery_header.php');\n}", "function gallery(){\n $str=\"\";\n $str.= \"<div class='gallery'>\";\n foreach (glob(\"*.{jpg,png,gif,JPG,jpeg}\",GLOB_BRACE) as $filename) {\n echo '<a data-fancybox=\"gallery\" href=\"'.$filename.'\"><img class=\"thumbnail\" src=\"'.$filename.'\"></a>';\n }\n $str.= \"</div>\";\n echo $str;\n}", "public static function printGallery() {\r\n\t\t$elts = Acid::mod('Photo')->dbList(array(array('active','=',1)),array('pos'=>'ASC'));\r\n\t\treturn Acid::tpl('pages/gallery.tpl',array('elts'=>$elts),Acid::mod('Photo'));\r\n\t}", "public function getImgs(){\n \n if ( is_null($this->getId()) ){\n return null;\n }\n\n $d = APPLICATION_PATH . '/../storage/category_pictures/' . $this->getId().'/';\n\n $pics = array();\n\n $dir = opendir($d);\n\n while($file = readdir($dir)){\n if ( $file != \".\" && $file != \"..\" && $file != \".svn\" && $file != \".DS_Store\" ) {\n $pics[] = '/../storage/category_pictures/' . $this->getId() . '/' . $file;\n }\n }\n\n return $pics;\n }", "function avatar_gallery()\r\n\t{\r\n\t\tglobal $ibforums, $std, $print;\r\n\r\n\t\t$avatar_gallery = array();\r\n\t\t$av_categories = array(0 => array(\"root\", $ibforums->lang['av_root']));\r\n\r\n\t\t$av_cat_selected = preg_replace(\"/[^\\w\\s_\\-]/\", \"\", $ibforums->input['av_cat']);\r\n\t\t$av_cat_found = FALSE;\r\n\t\t$av_human_readable = \"\";\r\n\r\n\t\tif ($av_cat_selected == 'root')\r\n\t\t{\r\n\t\t\t$av_cat_selected = \"\";\r\n\t\t\t$av_human_readable = $ibforums->lang['av_root'];\r\n\t\t}\r\n\r\n\t\t//------------------------------------------\r\n\t\t// Get the avatar categories\r\n\t\t//------------------------------------------\r\n\r\n\t\t$dh = opendir($ibforums->vars['html_dir'] . 'avatars');\r\n\r\n\t\twhile ($file = readdir($dh))\r\n\t\t{\r\n\t\t\tif (is_dir($ibforums->vars['html_dir'] . 'avatars' . \"/\" . $file))\r\n\t\t\t{\r\n\t\t\t\tif ($file != \".\" && $file != \"..\")\r\n\t\t\t\t{\r\n\t\t\t\t\tif ($file == $av_cat_selected)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$av_cat_found = TRUE;\r\n\t\t\t\t\t\t$av_human_readable = str_replace(\"_\", \" \", $file);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$av_categories[] = array($file, str_replace(\"_\", \" \", $file));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tclosedir($dh);\r\n\r\n\t\t//------------------------------------------\r\n\t\t// SORT IT OUT YOU MUPPET!!\r\n\t\t//------------------------------------------\r\n\r\n\t\tusort($av_categories, array('UserCP', 'sort_avatars'));\r\n\t\treset($av_categories);\r\n\r\n\t\t//------------------------------------------\r\n\t\t// Did we find the directory?\r\n\t\t//------------------------------------------\r\n\r\n\t\tif ($av_cat_selected)\r\n\t\t{\r\n\t\t\tif ($av_cat_found != TRUE)\r\n\t\t\t{\r\n\t\t\t\t$std->Error(array('LEVEL' => 1, 'MSG' => 'av_no_gallery'));\r\n\t\t\t}\r\n\r\n\t\t\t$av_cat_real = \"/\" . $av_cat_selected;\r\n\t\t}\r\n\r\n\t\t//------------------------------------------\r\n\t\t// Get the avatar images for this category\r\n\t\t//------------------------------------------\r\n\r\n\t\t$dh = opendir($ibforums->vars['html_dir'] . 'avatars' . $av_cat_real);\r\n\r\n\t\twhile ($file = readdir($dh))\r\n\t\t{\r\n\t\t\tif (!preg_match(\"/^..?$|^index|^\\.ds_store|^\\.htaccess/i\", $file))\r\n\t\t\t{\r\n\t\t\t\tif (is_file($ibforums->vars['html_dir'] . 'avatars' . $av_cat_real . \"/\" . $file))\r\n\t\t\t\t{\r\n\t\t\t\t\tif (preg_match(\"/\\.(gif|jpg|jpeg|png|swf)$/i\", $file))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$av_gall_images[] = $file;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//------------------------------------------\r\n\t\t// SORT IT OUT YOU PLONKER!!\r\n\t\t//------------------------------------------\r\n\r\n\t\tif (is_array($av_gall_images) and count($av_gall_images))\r\n\t\t{\r\n\t\t\tnatcasesort($av_gall_images);\r\n\t\t\treset($av_gall_images);\r\n\t\t}\r\n\r\n\t\t//------------------------------------------\r\n\t\t// Render drop down box..\r\n\t\t//------------------------------------------\r\n\r\n\t\t$av_gals = \"<select name='av_cat' class='forminput'>\\n\";\r\n\r\n\t\tforeach ($av_categories as $cat)\r\n\t\t{\r\n\t\t\t$av_gals .= \"<option value='\" . $cat[0] . \"'>\" . $cat[1] . \"</option>\\n\";\r\n\t\t}\r\n\r\n\t\t$av_gals .= \"</select>\\n\";\r\n\r\n\t\tclosedir($dh);\r\n\r\n\t\t$gal_cols = $ibforums->vars['av_gal_cols'] == \"\"\r\n\t\t\t? 5\r\n\t\t\t: $ibforums->vars['av_gal_cols'];\r\n\t\t$gal_rows = $ibforums->vars['av_gal_rows'] == \"\"\r\n\t\t\t? 3\r\n\t\t\t: $ibforums->vars['av_gal_rows'];\r\n\r\n\t\t$gal_found = count($av_gall_images);\r\n\r\n\t\t//------------------------------------------\r\n\t\t// Produce the avatar gallery sheet\r\n\t\t//------------------------------------------\r\n\r\n\t\t$this->output .= View::make(\r\n\t\t\t\"ucp.avatar_gallery_start_table\",\r\n\t\t\t[\r\n\t\t\t\t'title' => $av_human_readable,\r\n\t\t\t\t'av_gals' => $av_gals,\r\n\t\t\t\t'current_folder' => urlencode($av_cat_selected),\r\n\t\t\t\t'key' => $this->md5_check\r\n\t\t\t]\r\n\t\t);\r\n\r\n\t\t$c = 0;\r\n\r\n\t\tif (is_array($av_gall_images) and count($av_gall_images))\r\n\t\t{\r\n\t\t\tforeach ($av_gall_images as $img)\r\n\t\t\t{\r\n\t\t\t\t$c++;\r\n\r\n\t\t\t\tif ($c == 1)\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->output .= View::make(\"ucp.avatar_gallery_start_row\");\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$this->output .= View::make(\r\n\t\t\t\t\t\"ucp.avatar_gallery_cell_row\",\r\n\t\t\t\t\t[\r\n\t\t\t\t\t\t'img' => $av_cat_real . \"/\" . $img,\r\n\t\t\t\t\t\t'txt' => str_replace(\"_\", \" \", preg_replace(\"/^(.*)\\.\\w+$/\", \"\\\\1\", $img)),\r\n\t\t\t\t\t\t'form' => urlencode($img)\r\n\t\t\t\t\t]\r\n\t\t\t\t);\r\n\r\n\t\t\t\tif ($c == $gal_cols)\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->output .= View::make(\"ucp.avatar_gallery_end_row\");\r\n\r\n\t\t\t\t\t$c = 0;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ($c != $gal_cols)\r\n\t\t{\r\n\t\t\tfor ($i = $c; $i < $gal_cols; ++$i)\r\n\t\t\t{\r\n\t\t\t\t$this->output .= View::make(\"ucp.avatar_gallery_blank_row\");\r\n\t\t\t}\r\n\r\n\t\t\t$this->output .= View::make(\"ucp.avatar_gallery_end_row\");\r\n\t\t}\r\n\r\n\t\t$this->output .= View::make(\"ucp.avatar_gallery_end_table\");\r\n\r\n\t\t$this->page_title = $ibforums->lang['t_welcome'];\r\n\t\t$this->nav = array(\"<a href='\" . $this->base_url . \"act=UserCP&amp;CODE=00'>\" . $ibforums->lang['t_title'] . \"</a>\");\r\n\r\n\t}", "function deco_display_awkward_gallery(){\n\t\t//this loops the most recent featured items\n\t\t$items = deco_get_random_featured_items(10);\n\t\tif ($items!=null) \n\t\t{\n\t\tset_items_for_loop($items);\n\t\twhile(loop_items()):\n\t\n\t\t\t$index = 0; \n\t\t\twhile ($file = loop_files_for_item()):\n\t\t\t if ($file->hasThumbnail()):\n\t\t\t //this makes sure the loop grabs only the first image for the item \n\t\t\t if ($index == 0): \n\t\t\t //item_file('fullsize uri') broke in Omeka version 1.3, so I use getWebPath instead...\n\t\t \t echo '<div><img src=\"'.$file->getWebPath('fullsize').'\" alt=\"\" title=\"\"/>'; \n\t\t \t endif;\n\t\t\t endif; \n\t\t\tendwhile;\n\t\t\t\n\t\t\techo '<div class=\"showcase-caption\">';\n\t\t\techo /*Item Title and Link*/'<h3>'.link_to_item().'</h3>';\n\t\t\techo /*Item Description Excerpt*/'<p>'.item('Dublin Core', 'Description',array('snippet'=>190));\n\t\t\techo /*Link to Item*/ link_to_item(' ...more ').'</p></div></div>';\n\t\t\t\n\t\t\tendwhile; \n}else \n\t\t\t{\n \techo'<div><img src=\"'.uri('').'/themes/deco/images/emptyslideshow.png\" alt=\"Oops\" /><div class=\"showcase-caption\"><h3>UH OH!</h3><br/><p>There are no featured images right now. You should turn off \"Display Slideshow\" in the theme settings until you have some.</p></div></div>';\n \t\t}}", "public function index()\n {\n return view('admin.list.images', [\n 'pageImages' => Image::where('imageType', '=', 'page')->get(),\n 'backgroundImages' => Image::where('imageType', '=', 'background')->get()\n ]);\n }", "public function index()\n\t{\n $images = $this->repository->all();\n\n return view('images.index', compact('images'));\n\t}", "function movesiteimages()\n\t{\n\t\n\t\tglobal $option, $mainframe;\n\n\t\t//we'll need access to the file system and we'll use the Joomla way to be all safe.\n\t\tjimport('joomla.filesystem.file');\n\t\n\t\t// define where the images are and where we want to put them\n\n\t\t$searchpath = JPATH_ROOT . DS . \"images\". DS .\"content\" . DS .\"arts_curriculum\". DS . \"masters\" ;\n\t\t$destpath = JPATH_ROOT . DS . \"images\". DS .\"content\" . DS .\"arts_cirriculum\". DS . \"tmp\" ;\n\n\t\t//read all the image files and put them in an array.\n\t\t$img_files = JFolder::files($searchpath, '.*');\n\n\t\t//Now we need some stuff from the JFile:: class to move all files into the new folder\n\t\tforeach ($img_files as $file) {\n\t\t\tJFile::move($searchpath. DS . $file, $destpath . DS. $file);\n\t\t}\n\n\t\t$this->setRedirect( 'index.php?option=' . $option, 'All images have moved into the site folder' );\n\t\n\t}", "public function actionGalleryImages() {\n\n // # Cache result forever\n $cached = Cache::rememberForever( 'actionGalleryImages', function () {\n\n // # Conatiner init\n $container = [];\n\n // # Directory iterator\n $iterator = new \\DirectoryIterator( \"./images/gallery/images\" );\n\n // # Loop through files and dir\n foreach( $iterator as $item ) {\n\n // # Avoid dirs\n if( is_dir( $item ) ) {\n continue;\n }\n\n // # Get pathname\n $path = ltrim( $item->getPathname(), \".\" );\n $tmp[ 'src' ] = $path;\n $tmp[ 'thumb' ] = $path;\n $container[] = $tmp;\n }\n\n // # toJson\n return json_encode($container);\n });\n\n return response()->make( $cached );\n\n }", "function _upgrade_422_find_genericons_files_in_folder($directory)\n {\n }", "function admin_showgal($real_path) {// global $get, $uri;\n\t/*$real_path = $path.'/'.$selection;\n\tif (isset($get['o'])) {\n\t\t$url = explode('/',$get['o']);\n\t\t$url1 = explode('|', $url[0]);\n\t\t$url2 = explode('|', $url[1]);\n\t\t$found = in_array('sl', $url1) ? true : false;\n\t\t$link = pre_seao($url1[0], $url2[0], false, true);\n\t\t$link = str_replace('ebookcms.php/', '', $link);\n\t\t$link = str_replace('ebookcms.php?', '?', $link);\n\t\t$add = !isset($get['sl']) ? pre_seao('sl', '1') : '';\n\t\tfor ($i=1; $i<count($url1); $i++) {\n\t\t\t$link .= pre_seao($url1[$i], $url2[$i]);\n\t\t\tif ($i==2 && !$found) {$link .= $add;}\n\t\t}\n\t}*/\n\techo '<div class=\"show_img\">';\n\tif (is_dir($real_path)) { $images = '';\n\t\t$handle = opendir($real_path);\n\t\t$extensions = array('.jpg', '.bmp', '.gif', '.png');\n\t\twhile (($file = readdir($handle)) == true) {\n\t\t\tif ($file != '.' && $file != '..' && $file != 'thumbs') {\n\t\t\t\tclearstatcache();\n\t\t\t\t$ext = strrchr($file, '.');\n\t\t\t\tif (in_array($ext, $extensions)) {\n\t\t\t\t\tif (file_exists($real_path.'/'.$file)) {\n\t\t\t\t\t\t$images = $images.'<li>\n\t\t\t\t\t\t\t<div class=\"si_img\">\n\t\t\t\t\t\t\t\t<img src=\"'.$real_path.'/'.$file.'\" />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</li>';\n\t\t\t\t\t }\n\t\t\t\t}\n\t\t\t}\n\t\t} closedir($handle);\n\t\tif (!empty($images)) {echo '<ul>'.$images.'</ul><br />';} else {echo t('no_image');}\n\t} else if (empty($selection)) {echo t('select_imgs');}\n\techo '</div>';\n\tif (!empty($images)) {return;}\n}", "public function imagesAction()\n {\n $logedUser = $this->getServiceLocator()\n ->get('user')\n ->getUserSession();\n $permission = $this->getServiceLocator()\n ->get('permissions')\n ->havePermission($logedUser[\"idUser\"], $logedUser[\"idWebsite\"], $this->moduleId);\n if ($this->getServiceLocator()\n ->get('user')\n ->checkPermission($permission, \"edit\")) {\n \n \n if ($this->getServiceLocator()\n ->get('user')\n ->checkPermission($permission, \"edit\") || $logedUser[\"idCompany\"] == 1) {\n $request = $this->getRequest();\n }\n \n $images = $this->getImageTable()->fetchAll($logedUser[\"idWebsite\"]);\n $this->layout(\"layout/images.phtml\");\n return array(\n \"images\" => $images,\n \"idWebsite\" => $logedUser[\"idWebsite\"]\n );\n } else {\n return $this->redirect()->toRoute(\"noPermission\");\n }\n }", "function list_dir($chdir) {\r\n\t/* some globals, some cleaning */\r\n\tglobal $root, $prefix, $PHP_SELF, $SERVER_NAME, $showsize, $display, $excludedir, $excludefile;\r\n\tunset($sdirs);\r\n\tunset($sfiles);\r\n\tchdir($chdir);\r\n\t$self = basename($PHP_SELF);\r\n\r\n\t/* open current directory */\r\n\t$handle = opendir('.');\r\n\t/* read directory. If the item is a directory, place it in $sdirs, if it's a filetype we want\r\n\t * and not this file, put it in $sfiles */\r\n\twhile ($file = readdir($handle))\r\n\t{\r\n\t\tif(is_dir($file) && $file != \".\" && $file != \"..\" && !in_array($file, $excludedir))\r\n\t\t{ $sdirs[] = $file; }\r\n\t\telseif(is_file($file) && $file != \"$self\" && array_key_exists(get_extension($file), $display)\r\n\t\t\t&& !in_array($file, $excludefile))\r\n\t\t{ $sfiles[] = $file; }\r\n\t}\r\n\r\n\t/* count the slashes to determine how deep we're in the directory tree and how many\r\n\t * nice bars we need to add */\r\n\t$dir = getcwd();\r\n\t$dir1 = str_replace($root, \"\", $dir.\"/\");\r\n\t$count = substr_count($dir1, \"/\") + substr_count($dir1, \"\\\\\") - (substr_count($root, \"/\")-1);\r\n\r\n\t/* display directory names and recursively list all of them */\r\n\tif(isset($sdirs) && is_array($sdirs)) {\r\n\t\tsort($sdirs);\r\n\t\treset($sdirs);\r\n\r\n\t\tfor($y=0; $y<sizeof($sdirs); $y++) {\r\n\t\t\techo \"<tr><td>\";\r\n\t\t\tfor($z=1; $z<=$count; $z++)\r\n\t\t \t{ echo \"<img align=absmiddle src=comu/sitemap/vertical.gif>&nbsp;&nbsp;&nbsp;\"; }\r\n\t\t\tif((isset($sfiles) && is_array($sfiles)) || $y<sizeof($sdirs)-1)\r\n\t\t\t{ echo \"<img align=absmiddle src=comu/sitemap/verhor.gif>\"; }\r\n\t\t\telse\r\n\t\t\t{ echo \"<img align=absmiddle src=comu/sitemap/verhor1.gif>\"; }\r\n\t\t\techo \"<img align=absmiddle src=comu/sitemap/folder.gif> <a href=\\\"http://$SERVER_NAME$prefix/$dir1$sdirs[$y]\\\" target=\\\"_blank\\\" class=\\\"blau10b\\\">$sdirs[$y]</a>\";\r\n\t\t\tlist_dir($dir.\"/\".$sdirs[$y]);\r\n\t\t}\r\n\t}\r\n\r\n\tchdir($chdir);\r\n\r\n\t/* iterate through the array of files and display them */\r\n\tif(isset($sfiles) && is_array($sfiles)) {\r\n\t\tsort($sfiles);\r\n\t\treset($sfiles);\r\n\r\n\t\t$sizeof = sizeof($sfiles);\r\n\r\n\t\t/* what file types shall be displayed? */\r\n\t\tfor($y=0; $y<$sizeof; $y++) {\r\n\t\t\techo \"<tr><td>\";\r\n\t\t\tfor($z=1; $z<=$count; $z++)\r\n\t\t\t{ echo \"<img align=absmiddle src=comu/sitemap/vertical.gif>&nbsp;&nbsp;&nbsp;\"; }\r\n\t\t\tif($y == ($sizeof -1))\r\n\t\t\t{ echo \"<img align=absmiddle src=comu/sitemap/verhor1.gif>\"; }\r\n\t\t\telse\r\n\t\t\t{ echo \"<img align=absmiddle src=comu/sitemap/verhor.gif>\"; }\r\n\t\t\techo \"<img align=absmiddle src=comu/sitemap/\";\r\n\t\t\techo $display[get_extension($sfiles[$y])];\r\n\t\t\techo \"> \";\r\n\r\n\r\n\t\t\t\t$valorlink=\"$prefix/$dir1$sfiles[$y]\";\r\n\t\t\t\t//echo \"<a href=\\\"$valorlink\\\" class=\\\"blau10\\\" target=\\\"_blank\\\">$sfiles[$y]</a>\";\r\n\t\t\t\techo '<a href=\"#\" class=\"blau10\" onclick=\"OpenFile(\\''.$valorlink.'\\');return false;\">'.$sfiles[$y].'</a>';\r\n\r\n\t\t\t/*if (!isset($_GET['nocopy'])) {\r\n\t\t\t\t//per copiar link\r\n\t\t\t\techo \"<input type=hidden name=\\\"$dir1$sfiles[$y]\\\" id=\\\"$dir1$sfiles[$y]\\\" value=\\\"$valorlink\\\">\";\r\n\t\t\t\techo \"&nbsp;&nbsp;&nbsp;<a href=\\\"javascript:CopyClipboard('$dir1$sfiles[$y]')\\\" title=\\\"copiar el vincle al portapapers\\\">copiar vincle</a>\";\r\n\t\t\t\t//fi\r\n\t\t\t}*/\r\n\r\n\t\t\tif($showsize) {\r\n\t\t\t\t$fsize = @filesize($sfiles[$y])/1024;\r\n\t\t\t\tprintf(\" (%.2f kB)\", $fsize);\r\n\t\t\t}\r\n\t\t\techo \"</td></tr>\";\r\n\r\n\r\n\r\n\t\t}\r\n\t\techo \"<tr><td>\";\r\n\t\tfor($z=1; $z<=$count; $z++)\r\n\t\t{ echo \"<img align=absmiddle src=comu/sitemap/vertical.gif>&nbsp;&nbsp;&nbsp;\"; }\r\n\t\techo \"</td></tr>\\n\";\r\n\t}\r\n}", "static function getList()\n {\n $out = array();\n\n if ($dh = opendir(__DIR__ . '/../img/')) {\n while (($file = readdir($dh)) !== false) {\n if (substr($file, -4) === '.jpg') {\n $filename = substr($file, 0, -4);\n $out[$filename] = realpath(__DIR__ . '/../img/' . $file);\n }\n }\n\n closedir($dh);\n }\n\n return $out;\n }", "function getAllImages() {\r\r\n\t$PView = new PView;\r\r\n\t$Template = new Template;\r\r\n\tglobal $tp;\r\r\n\t\r\r\n\t$pv_Appl = $PView -> getAppl();\r\r\n\t$ImageData = array();\r\r\n\t\r\r\n// prepare album-handling\r\r\n\tif ($pv_Appl[0] == \"album\"){\r\r\n\t\t$ImageCount = $PView -> getAlbumImageCount();\r\r\n\t\t$details = $PView->getPView_config(\"album_details\");\r\r\n\t\t$message = LAN_ALBUM_9;\r\r\n\t}\r\r\n// prepare category-handling\r\r\n\tif ($pv_Appl[0] == \"cat\"){\r\r\n\t\t$ImageCount = $PView -> getCatImageCount($pv_Appl[1]);\r\r\n\t\t$details = $PView->getPView_config(\"cat_details\");\r\r\n\t\t$message = LAN_GALLERY_12;\r\r\n\t}\t\r\r\n// prepare userimage-handling\r\r\n\tif ($pv_Appl[0] == \"user\"){\r\r\n\t\t$ImageCount = $PView -> getUserImageCount($pv_Appl[1]);\r\r\n\t\t$details = $PView->getPView_config(\"user_details\");\r\r\n\t\t$message = LAN_GALLERY_13;\r\r\n\t}\r\r\n\t\r\r\n\tglobal $applImages;\r\r\n\t$ImageData = $PView->sortApplImages($applImages);\r\r\n\t$showDetails = explode(\"|\",$details);\r\r\n\t\r\r\n\tif ($ImageCount) {\r\r\n\t\t$cols = 1;\r\r\n\t\t$pics = $PView -> getPView_config(\"pics_per_page\");\r\r\n\t\t$picCount = 0;\r\r\n\t\t$colwidth = 100/$cols;\r\r\n\t\tif ($_GET['page']) {\r\r\n\t\t\t$page = $_GET['page'];\r\r\n\t\t}\r\r\n\t\t$Pages = ceil($ImageCount/$pics);\r\r\n\t\tif (!$page or $page > $Pages) {\r\r\n\t\t\t$page = 1;\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\t\r\r\n\t\t$out_AllImages = \"<tr>\";\r\r\n\t\tforeach ($ImageData as $dataset) {\r\r\n\t\t\t//PERMISSION!!!\r\r\n\t\t\tif ($PView -> getPermission(\"image\",$dataset['imageId'],\"View\")) {\r\r\n\t\t\t\t// insert images line by line, observe pagelimit\r\r\n\t\t\t\tif ($colCount == $cols) {\r\r\n\t\t\t\t\t$out_AllImages.= \"</tr><tr>\";\r\r\n\t\t\t\t\t$colCount = 0;\r\r\n\t\t\t\t}\r\r\n\t\t\t\tif ($picCount >= ($page - 1) * $pics && $picCount < $page * $pics) {\r\r\n\t\t\t\t\t$thumb = $PView -> getResizePath($dataset['imageId']);\r\r\n\t\t\t\t\tif ($PView->getPView_config(\"seo_links\")){\r\r\n\t\t\t\t\t\t$seo = \"&amp;name=\".$dataset['name'];\r\r\n\t\t\t\t\t} else {\r\r\n\t\t\t\t\t\t$seo = \"\";\r\r\n\t\t\t\t\t}\t\r\r\n\t\t\t\t\tif ($PView->getPView_config(\"center_thumbs\")){\r\r\n\t\t\t\t\t\t$infoPos = \"left:30%;\";\r\r\n\t\t\t\t\t} else{\r\r\n\t\t\t\t\t\t$infoPos = \"left:10px;\";\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t\t$backgr = \"background:url(\".e_PLUGIN.\"pviewgallery/templates/\".$PView -> getPView_config(\"template\").\"/images/gt.png) repeat;\";\t\t\r\r\n\t\t\t\t\t\t\t\t\t\t\r\r\n\t\t\t\t\t$out_AllImages.= \"<td style='vertical-align:top;width:\".$colwidth.\"%; border: #b7b5b5 1px solid; padding:5px; \".$Template->getThumbPosition().\"'><div style='position:relative;'><div style='position:relative;'>\".$Template -> getImageLink($pv_Appl[0],$dataset,'resize','resize','pview_gal').\"</div>\";\r\r\n\t\t\t\t\t\r\r\n\t\t\t\t\t$out_AllImages.= \"<div style='position:absolute; bottom:10px; \".$infoPos.\" width:40%; border: 2px solid #b7b5b5; text-align:left; padding: 5px; \".$backgr.\"'>\";\r\r\n\t\t\t\t\tforeach($showDetails as $detail){\r\r\n\t\t\t\t\t\t\r\r\n\t\t\t\t\t\tswitch($detail){\r\r\n\t\t\t\t\t\t\tcase \"name\":\r\r\n\t\t\t\t\t\t\t$out_AllImages.= \"<span><b>\".$tp -> toHTML($dataset['name']).\"</b></span>\";\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"descr\":\r\r\n\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML($dataset['description']).\"</span>\";\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"user\":\r\r\n\t\t\t\t\t\t\t$userData = $PView->getUserData($dataset['uploaderUserId']);\r\r\n\t\t\t\t\t\t\t// LINK Abfrage: Link zur Anzeige aller Bilder des Users\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"details_link\")){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pviewgallery.php?user=\".$dataset['uploaderUserId'].\"'><span>\".$tp -> toHTML($userData['user_name']).\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML($userData['user_name']).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"cat\":\r\r\n\t\t\t\t\t\t\tif ($catData = $PView -> getCatData($dataset['cat'])){\r\r\n\t\t\t\t\t\t\t\t$catName = $catData['name'];\r\r\n\t\t\t\t\t\t\t} else {\r\r\n\t\t\t\t\t\t\t\t$catName = LAN_IMAGE_46;\r\r\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\r\r\n\t\t\t\t\t\t\t// LINK Abfrage: Link zur Anzeige aller Bilder der Kategorie\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"details_link\") && $dataset['cat']){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pviewgallery.php?cat=\".$dataset['cat'].\"'><span>\".LAN_IMAGE_45.\": \".$tp -> toHTML($catName).\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".LAN_IMAGE_45.\": \".$tp -> toHTML($catName).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"date\":\r\r\n\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML(date('d.m.Y',$dataset['uploadDate'])).\"</span>\";\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"gal\":\r\r\n\t\t\t\t\t\t\t$albumData = $PView->getAlbumData($dataset['albumId']);\r\r\n\t\t\t\t\t\t\t// LINK Abfrage: Link zur Anzeige der Galerie\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"details_link\")){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pviewgallery.php?gallery=\".$albumData['galleryId'].\"'><span>\".$tp -> toHTML($PView->getGalleryName($albumData['galleryId'])).\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML($PView->getGalleryName($albumData['galleryId'])).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"album\":\r\r\n\t\t\t\t\t\t\t// LINK Abfrage: Link zur Anzeige aller Bilder des albums\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"details_link\")){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pviewgallery.php?album=\".$dataset['albumId'].\"'><span>\".$tp -> toHTML($PView->getAlbumName($dataset['albumId'])).\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}else{\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".$tp -> toHTML($PView->getAlbumName($dataset['albumId'])).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"edit\":\r\r\n\t\t\t\t\t\t\t//PERMISSION!!!\r\r\n\t\t\t\t\t\t\tif ($PView -> getPermission(\"album\",$dataset['sendImage'],\"Edit\")) {\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='pview_actions.php?image=\".$dataset['imageId'].\"&amp;action=edit'><span>\".LAN_IMAGE_2.\"</span></a>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"send\":\r\r\n\t\t\t\t\t\t\t//PERMISSION!!!\r\r\n\t\t\t\t\t\t\tif (($PView -> getPView_config(\"email\") && $dataset['sendImage']) OR (ADMIN && $PView -> getPView_config(\"admin_Mode\"))){\r\r\n\t\t\t\t\t\t\t\tif ($PView -> getPermission(\"config\",\"permEmail\",\"\")) {\r\r\n\t\t\t\t\t\t\t\t\t$out_AllImages.= \"<br/><a href='\".e_BASE.\"email.php?plugin:pviewgallery.\".$dataset['imageId'].\"'><span>\".LAN_IMAGE_48_1.\"</span></a>\";\r\r\n\t\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\r\r\n\t\t\t\t\t\t\tcase \"comm\":\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"Comments\")){\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br /><span>\".LAN_IMAGE_4.\": \".$PView -> getCommentsCount($dataset['imageId']).\"</span>\";\r\r\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\r\r\n\t\t\t\t\t\t\tbreak;\t\r\r\n\t\t\t\t\t\t\tcase \"rating\":\r\r\n\t\t\t\t\t\t\tif ($PView->getPView_config(\"Rating\")){\r\r\n\t\t\t\t\t\t\t\t$ratingData = $PView -> getRatingData($dataset['imageId']);\r\r\n\t\t\t\t\t\t\t\t$out_AllImages.= \"<br /><span>\".LAN_IMAGE_3.\": \".round($ratingData['value'],1).\" (\".$ratingData['count'].\")</span>\";\r\r\n\t\t\t\t\t\t\t}\r\r\n\t\t\t\t\t\t\tbreak;\t\r\r\n\t\t\t\t\t\t\tcase \"views\":\r\r\n\t\t\t\t\t\t\t$out_AllImages.= \"<br/><span>\".LAN_IMAGE_16.\": \".$tp -> toHTML($dataset['views']).\" \".LAN_IMAGE_17.\"</span>\";\r\r\n\t\t\t\t\t\t\tbreak;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\r\r\n\t\t\t\t\t\t}\t\t\t\r\r\n\t\t\t\t\t}\r\r\n\t\t\t\t\t$out_AllImages.= \"</div></div></td>\";\t\t\r\r\n\t\t\t\t\t$colCount++;\r\r\n\t\t\t\t}\r\r\n\t\t\t\t$picCount++;\r\r\n\t\t\t}\r\r\n\t\t}\r\r\n\t\t// fill row with empty cells\r\r\n\t\twhile ($colCount < $cols) {\r\r\n\t\t\t$out_AllImages.= \"<td>&nbsp;</td>\";\r\r\n\t\t\t$colCount++;\r\r\n\t\t}\r\r\n\t\t$out_AllImages.= \"</tr>\";\r\r\n\t\treturn $out_AllImages;\r\r\n\t}\r\r\n\treturn \"<div style='padding:10px;'>\".$message.\"</div>\";\r\r\n}", "function image_gallery_admin() {\r\n _image_check_settings();\r\n\r\n $tree = taxonomy_get_tree(_image_gallery_get_vid());\r\n if ($tree) {\r\n $header = array(t('Name'), t('Operations'));\r\n foreach ($tree as $term) {\r\n $rows[] = array(str_repeat(' -- ', $term->depth) . ' ' . l($term->name, \"image/tid/$term->tid\"), l(t('edit gallery'), \"admin/content/image/edit/$term->tid\"));\r\n }\r\n return theme('table', $header, $rows);\r\n }\r\n else {\r\n return t('No galleries available');\r\n }\r\n}", "private function fetchImages() {\n\t\ttry {\n\t\t\t\n\t\t\t$images = $this->getParam('fetcher',true);\n\t\t\t$images = explode(chr(13), $images);\n\t\t\tif (sizeof($images > 0)) {\n\n\t\t\t\tif (sizeof($images)==1 && $images[0]=='') {\n\t\t\t\t\tthrow new VCDInvalidInputException('Invalid input!');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Check if the screenshots folder already exist\n\t\t\t\t$destFolder = VCDDB_BASE.DIRECTORY_SEPARATOR.ALBUMS.$this->itemObj->getID().DIRECTORY_SEPARATOR;\n\t\t\t\tif (!$this->itemObj->hasScreenshots()) {\n\t\t\t\t\tif (!fs_is_dir($destFolder)) {\n\t\t\t\t\t\tfs_mkdir($destFolder, 0755);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tforeach ($images as $image) {\n\t\t\t\t\tVCDUtils::grabImage(trim($image), false, $destFolder);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif (!MovieServices::getScreenshots($this->itemObj->getID())) {\n\t\t\t\t\tMovieServices::markVcdWithScreenshots($this->itemObj->getID());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception $ex) {\n\t\t\tVCDException::display($ex,true);\n\t\t}\n\t}", "function liste_images($dossier_images) // le dossier des images de l'article\n{\n\t$dossier = opendir($dossier_images);\n\t\n\t$images = array();\n\t\n\twhile (false !== ($image = readdir($dossier)) AND !in_array($image, array('0.jpg', '.', '..'))) { //toutes les images sans la principale de bandeau\n\t\t$images[] = $image;\n\t}\n\t\n\treturn $images;\n}", "function get_image_paths($base_url, $base_path)\n{\n $out = array();\n\n require_code('images');\n require_code('files');\n\n $handle = @opendir($base_path);\n if ($handle !== false) {\n while (false !== ($file = readdir($handle))) {\n if (!should_ignore_file($file, IGNORE_ACCESS_CONTROLLERS)) {\n $this_path = $base_path . $file;\n if (is_file($this_path)) {\n if (is_image($file)) {\n $this_url = cms_rawurlrecode($base_url . rawurlencode($file));\n $out[$this_path] = $this_url;\n }\n } elseif ((strlen($file) != 2) || (strtoupper($file) != $file)) {\n $out = array_merge($out, get_image_paths($base_url . $file . '/', $base_path . $file . '/'));\n }\n }\n }\n closedir($handle);\n }\n\n return $out;\n}", "protected function findOverallImage()\n {\n $overallArr = array();\n // init overall image\n $overallImage = \"\";\n\n // run through overall directory and select the main overall image\n if ($handle = opendir($this->dynDir->getDir()\n . 'thumbnails/' . $this->folder . '/01_Overall/')) {\n while (false !== ($file = readdir($handle))) {\n if ($file != \".\" && $file != \"..\") {\n $pos = strpos($file, 'Overall.jpg');\n if ($pos !== false) {\n $overallArr[] = $file;\n }\n }\n }\n closedir($handle);\n }\n\n // set overall image\n $overallImage = preg_replace('/.jpg/', '', $overallArr[0]);\n\n return $overallImage;\n }", "static public function getImageRootPath() {\n\t\treturn Page::$base_images_path;\n\t}", "public function display_gallery() {\n\n global $product;\n\n $gallery = \n wc_get_template(\n 'single-product/label-thumbnails.php',\n array(),\n FALSE,\n $this->plugin_path() . '/templates/' );\n\n }", "protected function combineImages() {}", "public function index()\n\t{\n\t\t$images = Image::where('product', '=', 0)->get();\n\t\treturn view('galleries.index', compact('images'));\n\t}", "public function run()\n {\n $initials = array(\n ['url' => 'winners-chapel-owerri-0-1542948878.jpg'],\n ['url' => 'winners-chapel-owerri-1-1542948878.jpg'],\n ['url' => 'winners-chapel-owerri-2-1542948878.jpg']\n );\n \n foreach($initials as $i){\n Gallery::create($i);\n }\n }", "public function getDirectory()\n {\n return mfConfig::get('mf_sites_dir').\"/\".$this->getSiteName().\"/\".$this->getApplication().\"/view/pictures/\".$this->get('lang');\n }", "function getPhotosOfDir($dirName){\r\n\t\t$connectService = new ConnectionBDD();\r\n\t\t$connect = $connectService->connect();\r\n\t\t$r = mysql_query(\"select PATH_PHOTO,ID_PHOTO_TAG from PhotoTag where PATH_PHOTO like '\" . str_replace($this->directory,\"\",$dirName) . \"%'\");\r\n\t\t$tags = array();\r\n\t\tfor($i = 0 ; $i < mysql_num_rows($r) ; $i++){\r\n\t\t\t$path = mysql_result($r,$i,\"PATH_PHOTO\");\r\n\t\t\t$tags[substr($path,strrpos($path,\"/\")+1)] = mysql_result($r,$i,\"ID_PHOTO_TAG\");\r\n\t\t}\r\n\r\n\t\t$tab = array();\r\n\t\t$dir = opendir($dirName . \"/sd\");\r\n\t\t$i = 0;\r\n\t\t/* Parcourt les photos */\r\n\t\twhile( ($photo = readdir($dir))!=false){\r\n\t\t\tif($photo != \".\" && $photo!=\"..\" && strstr($photo,\".jpg\") == \".jpg\"){\r\n\t\t\t\t$data = new Data();\r\n\t\t\t\t$data->addInfo(\"name\",str_replace(\".jpg\",\"\",$photo));\r\n\t\t\t\t$size = getimagesize($dirName . \"/sd/\" . $photo);\r\n\t\t\t\t$data->addInfo(\"width\",$size[0]);\r\n $data->addInfo(\"height\",$size[1]);\r\n\t\t\t\tif(isset($tags[str_replace(\".jpg\",\"\",$photo)]) == true){\r\n\t\t\t\t\t$data->addInfo(\"tag\",$tags[str_replace(\".jpg\",\"\",$photo)]);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t$data->addInfo(\"tag\",-1);\r\n\t\t\t\t}\r\n\t\t\t\t$tab[++$i] = $data;\r\n\t\t\t}\r\n\t\t}\r\n\t\t/* Trie les photos par nom */\r\n\t\tfunction abc($a,$b){return strnatcasecmp($a->getInfo(\"name\"),$b->getInfo(\"name\"));}\r\n\t\tusort($tab,\"abc\");\r\n\r\n\t\t$connectService->close();\r\n\t\treturn $tab;\r\n\t}", "function imageMaint() {\n\t\n //$path = realpath(APPPATH).'/libraries/IMagick_Image.php';\n//require_once($path);\n////$path2 = realpath($_SERVER['DOCUMENT_ROOT']).'/images/';\n//$path2 = realpath($_SERVER['DOCUMENT_ROOT']).'/images/LL9138TR_frisbeeRed/';\n//$util = new ImageUtil();\n////$util->imageToDir($path2);\n////$util->cleanUp($path2);\n//$util->removeDir($path2);\n//print $util->log();\n//exit;\n }", "function create_gallery($dir) {\n echo '<div class=\"row\">';\n\n $num_files = glob($dir . \"*.{JPG,jpg,gif,png,bmp}\", GLOB_BRACE);\n $folder = opendir($dir);\n if ($num_files > 0) {\n while(false !== ($file = readdir($folder))) {\n $fullpath = $dir . $file;\n $fullpath_thumb = $dir . 'thumbnails/' . $file;\n $extension = strtolower(pathinfo($file, PATHINFO_EXTENSION));\n if($extension == 'jpg' || $extension == 'png' || $extension == 'gif' || $extension == 'bmp') {\n // insert thumbnail image as link which when clicked opens lightbox to full size version\n echo '<div class=\"hidden-xs col-sm-6 col-md-4 col-lg-3\">';\n echo '<a class=\"thumbnail\" rel=\"lightbox[group]\" href=\"' . $fullpath . '\">';\n echo '<img src=\"' . $fullpath_thumb . '\" class=\"img-responsive group1\"></a></div>';\n\n // disable lightbox on mobile\n echo '<div class=\"text-center col-xs-12 hidden-sm hidden-md hidden-lg hidden-xl\">';\n echo '<a class=\"thumbnail\" href=\"' . $fullpath . '\">';\n echo '<img src=\"' . $fullpath_thumb . '\" class=\"img-responsive\"></a></div>';\n }\n }\n } else {\n return \"<div><em>ERROR:</em> <span style='font-style:italic;'>No files found in specified folder, gallery not generated.</span></div>\";\n }\n closedir($folder);\n\n echo '</div>';\n}", "function getImages($hello) {\n\n\t$imagetypes = array(\"image/jpg\",\"image/jpeg\",\"image/png\");\n\t$dir = \"/assets/galleries/\".$hello.\"/images/\";\n\t$dir2 = \"/assets/galleries/\".$hello.\"/thumbs/\";\n\t$dir3 = \"/assets/galleries/\".$hello.\"/downloads/\";\n\n\t#array to hold return value\n\t$retval = array();\n\n\t#full server path to directory\n\t$fulldir = \"{$_SERVER['DOCUMENT_ROOT']}$dir2\"; \n\t$idir = \"{$_SERVER['DOCUMENT_ROOT']}$dir\"; \n\n\t$d = @dir($fulldir) or die(\"getImages: Failed opening directory $dir for reading\"); \n\twhile(false !== ($entry = $d->read())) { \n\t\t# skip hidden files \n\t\tif($entry[0] == \".\") continue; \n\n\t\t# check for image files \n\t\tif(in_array(mime_content_type(\"$fulldir$entry\"), $imagetypes)) { \n\t\t\t$retval[] = array( \"file\" => \"$dir$entry\", \n\t\t\t\"size\" => getimagesize(\"$fulldir$entry\"),\n\t\t\t\"name\" => \"$entry\",\n\t\t\t\"thumb\"=>\"$dir2$entry\",\n\t\t\t\"download\"=>\"$dir3$entry\",\n\t\t\t\"isize\" => getimagesize(\"$idir$entry\")\n\t\t\t); \n\t\t}\n\t}\n\t$d->close(); \n\treturn $retval;\n}", "function albums_get_images($album) {\n\t$files = read_dir_contents(ALBUMS_DIR.'/'.$album, 'files');\n\tif (!$files)\n\t\treturn FALSE;\n\n\telseif ($files) {\n\t\tnatcasesort($files);\n\t\tforeach ($files as $file) {\n\t\t\t$parts = explode('.', $file);\n\t\t\tif (count($parts) == 4) {\n\t\t\t\tlist($number, $fdirname, $ext, $php) = $parts;\n\t\t\t\tinclude_once (ALBUMS_DIR.'/'.$album.'/'.$file);\n\t\t\t\t$images[] = array(\n\t\t\t\t\t'title' => $name,\n\t\t\t\t\t'info' => $info,\n\t\t\t\t\t'seoname' => $fdirname,\n\t\t\t\t\t'filename' => $file,\n\t\t\t\t\t'filename_image' => $fdirname.'.'.$ext\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tunset($file);\n\n\t\treturn $images;\n\t}\n}", "public function get_shots($folder)\n\t{\n\t\t$url = base_url();\n\t\t$dir = \"./img/portfolio/$folder/\";\n\t\t$files1 = scandir($dir);\n\t\tunset($files1[0]);\n\t\tunset($files1[1]);\n\t\t$files = array();\n\t\tforeach ($files1 as $k => $name) {\n\t\t\tif ($name == \"Thumbs.db\") {\n\t\t\t\tunset($files1[$k]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$files[] = $url.\"img/portfolio/$folder/$name\";\n\t\t}\n\t\treturn $files;\n\t}", "public function index()\n {\n $images = Image::where('active','=','yes')->orderBy('id')->with('laptop')->get();\n return view('admin/image/index', compact('images'));\n }", "public function getImages($type=''){\n \n $imagetypes = array(\"image/png\",\"image/jpeg\", \"image/gif\");\n $dir = self::IMAGEPATH;\n\n // array to hold return value\n $retval = array();\n\n // add trailing slash if missing\n if(substr($dir, -1) != \"/\") $dir .= \"/\";\n\n // full server path to directory\n $fulldir = \"{$_SERVER['DOCUMENT_ROOT']}/$dir\";\n\n $d = @dir($fulldir) or die(\"getImages: Failed opening directory $dir for reading\");\n while(false !== ($entry = $d->read())) {\n // skip hidden files\n if($entry[0] == \".\") continue;\n\n \n // check for image files\n $f = escapeshellarg(\"$fulldir$entry\");\n \n \n \n if((!$type)||(strpos(' '.$entry, $type)))\n $retval[] = $entry;\n \n \n }\n $d->close();\n\n return $retval;\n }", "public static function createPhotoDirectory($pid)\n {\n jimport('joomla.filesystem.folder');\n jimport('joomla.filesystem.file');\n if (!JFolder::exists(JPATH_ROOT . '/images/osproperty/properties/' . $pid)) {\n JFolder::create(JPATH_ROOT . '/images/osproperty/properties/' . $pid);\n //copy index.html to this folder\n JFile::copy(JPATH_COMPONENT . DS . 'index.html', JPATH_ROOT . '/images/osproperty/properties/' . $pid . '/index.html');\n\t\t}\n\t\tif (!JFolder::exists(JPATH_ROOT . '/images/osproperty/properties/' . $pid . '/medium')) {\n\t\t\tJFolder::create(JPATH_ROOT . '/images/osproperty/properties/' . $pid . '/medium');\n\t\t\tJFile::copy(JPATH_COMPONENT . DS . 'index.html', JPATH_ROOT . '/images/osproperty/properties/' . $pid . '/medium/index.html');\n\t\t}\n\t\tif (!JFolder::exists(JPATH_ROOT . '/images/osproperty/properties/' . $pid . '/thumb')) {\n\t\t\tJFolder::create(JPATH_ROOT . '/images/osproperty/properties/' . $pid . '/thumb');\n\t\t\tJFile::copy(JPATH_COMPONENT . DS . 'index.html', JPATH_ROOT . '/images/osproperty/properties/' . $pid . '/thumb/index.html');\n\t\t}\n }", "function getImgPath($directory, $index) {\n\t\t\n\t\t$allData = scandir($directory);\n\t\t\n\t\t$imgName = \"img\".$index;\n\t\tforeach($allData as $file) {\n\t\t\t//we separate the file name from the extension\n\t\t\t$fileNameAndExtension = explode(\".\", $file);\n\t\t\t\n\t\t\tif($fileNameAndExtension[0] == $imgName) {\n\t\t\t\t$imgPath = $directory.$file;\n\t\t\t\treturn $imgPath;\n\t\t\t}\n\t\t}\n\t\treturn NULL;\n\t}", "private function makeImageList()\n\t{\n\t\t$images_dir = self::$locator->banner_images_dir($this->trip, $this->slug);\n\t\t$trip = $this->trip;\n\t\t$slug = $this->slug;\n\t\t/// This is a hack so that unit testing does not have to setup Locator\n\t\t/// for every test.\n\t\tif (! is_dir($images_dir)) {\n\t\t\treturn [];\n\t\t}\n\t\t$list = scandir($images_dir);\n\t\t$x = [];\n\t\tforeach ($list as $ent) {\n\t\t\tif (($ent != \".\") && ($ent != \"..\") && (substr($ent, 0, 1) != \".\")) {\n\t\t\t\t$tmp = new \\stdClass();\n\t\t\t\t$tmp->url = self::$locator->url_banner_image($trip, $slug, $ent);\n\t\t\t\t$tmp->path = self::$locator->banner_image_filepath($trip, $slug, $ent);\n\t\t\t\t$x[] = $tmp;\n\t\t\t}\n\t\t}\n\t\t$this->images_list = $x;\n\t}", "public function imagesManager()\n\t{\n\t\t$images = array();\n\n\t\t// Grab all images in the directory\n\t\t$files = File::allFiles(public_path() . '/uploads');\n\n\t\tforeach ($files as $file) {\n\t\t\t// Ignore thumbnail image\n\t\t\tif (!strpos($file, 'thumb_')) {\n\t\t\t\t// Get the image extension\n\t\t\t\t$ext = '.' . pathinfo($file, PATHINFO_EXTENSION);\n\t\t\t\t// Get the directory path for the image\n\t\t\t\t$path = explode( \"/\", substr($file,strpos($file,\"/uploads\")));\n\t\t\t\t// Remove file name to get only directory name\n\t\t\t\tarray_pop($path);\n\n\t\t\t\t$image_path = implode(\"/\", $path);\n\n\t\t\t\t$images[] = array(\"thumb\" => $image_path .'/thumb_' . basename($file), \"image\" => $image_path .'/' . basename($file), \"title\" => basename($file, $ext), \"link\" => $image_path .'/' . basename($file));\n\t\t\t}\n\t\t}\n\n\t\treturn Response::json($images);\n\t}", "private function getDirectories()\n {\n $this->load();\n\n $this->data['themeDirectory'] = 'catalog/view/theme/default/';\n $customizedFile = $this->data['themeDirectory'] . 'stylesheet/mundipagg/mundipagg_customized.css';\n\n if (file_exists($customizedFile)) {\n $this->data['customizedFile'] = $customizedFile;\n }\n }" ]
[ "0.68339556", "0.63162655", "0.6220864", "0.6165034", "0.61335194", "0.6132603", "0.61187065", "0.6037719", "0.6017631", "0.6001186", "0.5968343", "0.5960158", "0.5907326", "0.5893923", "0.5885956", "0.586137", "0.58436334", "0.58199733", "0.57960826", "0.57884043", "0.5786245", "0.57844424", "0.5775502", "0.57745737", "0.57606965", "0.5745269", "0.57322615", "0.5707057", "0.5703935", "0.5702729", "0.56879187", "0.56794065", "0.5670873", "0.5669151", "0.56651497", "0.5664102", "0.5646239", "0.5634264", "0.5628859", "0.56184375", "0.56157607", "0.56149", "0.5603788", "0.5602989", "0.5597548", "0.5597115", "0.55915606", "0.5586325", "0.5572768", "0.5558663", "0.554399", "0.5535988", "0.55341643", "0.55319715", "0.55270505", "0.5522027", "0.55143476", "0.5512523", "0.55092674", "0.5508442", "0.55078125", "0.5507073", "0.5501217", "0.5490934", "0.5489484", "0.5489159", "0.54729384", "0.5470751", "0.54693234", "0.54670477", "0.5463995", "0.5458309", "0.5456503", "0.5447719", "0.5447239", "0.54408324", "0.5432769", "0.54282385", "0.542734", "0.54136825", "0.54065216", "0.540579", "0.5385199", "0.5382844", "0.53722435", "0.53707355", "0.53697455", "0.53667045", "0.5356836", "0.53493655", "0.53417224", "0.5339719", "0.5339509", "0.5331809", "0.53272206", "0.53250396", "0.53115326", "0.53100324", "0.5309258", "0.53006274" ]
0.6547855
1
actionid: indexbystaf actiondesc: Display index of izin for staf
public function actionIndexByStaf(){ $searchModel = new PermohonanIzinSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); $pegawai = Pegawai::find()->where(['user_id' => Yii::$app->user->identity->user_id])->one(); $dataProvider->query->andWhere(['hrdx_pegawai.pegawai_id' => $pegawai->pegawai_id])->all(); return $this->render('indexByStaf',[ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getIndex() ;", "function get_index()\r\n\t{\r\n\r\n\t}", "function indexInfo( $table, $index, $fname = __METHOD__ );", "public function getIndex();", "public function getIndex();", "public function getIndex();", "abstract protected function getIndex();", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "function viewSIndex() {\n\t\tglobal $page;\n\t\tglobal $id;\n\t\t$this->vars[\"sindex\"] = stringOr($this->vars[\"sindex\"], $this->item[\"sindex\"][0]);\n\n\t\t$_ = '';\n\t\t$_ .= '<div class=\"ci33 init:form form:action:'.$page->url.'\" id=\"container:sindex\">';\n\t\t$_ .= '<div class=\"init:expandable id:sindex\">';\n\t\t$_ .= $this->head(\"sIndex\", \"2\");\n\t\t$_ .= '<fieldset>';\n\n\t\t$_ .= $this->p(\"Used as link alias to achieve search engine optimization. Only a-z and 0-9 allowed. And it must be unique - if already used it will be prepended a unique identifier.\", \"info\");\n\n\t\tif(Session::getLogin()->validatePage(\"sindex_update\")) {\n\t\t\t$_ .= $this->inputHidden(\"id\", $id);\n\t\t\t$_ .= $this->inputHidden(\"page_status\", \"sindex_update\");\n\t\t\t$_ .= $this->input(\"sindex\");\n\t\t\t$_ .= $this->smartButton($this->translate(\"Update\"), false, \"sindex_update\", \"fright\");\n\t\t}\n\t\telse {\n\t\t\t$_ .= $this->block($this->varnames[\"sindex\"], $this->vars[\"sindex\"]);\n\t\t}\n\n\t\t$_ .= '</fieldset>';\n\t\t$_ .= '</div>';\n\t\t$_ .= '</div>';\n\t\treturn $_;\n\t}", "function indexAction(){\n \t}", "abstract public function actionIndex();", "function putIndex(){\n\n }", "function putIndex(){\n\n }", "public function action_index()\n\t{\n\t}", "public function indexAction() {\r\n\t\t// TODO Auto-generated FinanceController::indexAction() default action\r\n\t}", "function indexAction(){\r\n }", "abstract function indexAction();", "public function _INDEX()\n\t{\n\t\t\n\t}", "public function action_index()\n {\n }", "public function buildIndex();", "public function actionIndex()\n {\n\t\techo \"=== Action index ===\";\n \n }", "public function getIndex()\n {\n // add stuff here\n }", "public function getIndex() {return $this->index;}", "abstract function index();", "abstract function index();", "abstract function index();", "public function getIndexStart();", "public function fullIndexAction() {}", "public function isIndex();", "public function actionIndex()\n {\n\t return $this->render('index');\n }", "public function index(){\r\n $this->display(index);\r\n }", "public function getSearchIndex();", "public function actionIndex()\n {}", "public function indexAction()\n {\n\n return parent::indexAction();\n\n\n }", "function admin_index()\n\t{\n\t \n\t}", "public function checkForIndex( $index, $table );", "public function getIndex() {\n \treturn $this->index;\n }", "public function actionIndex()\n\t{\n\t\techo 1 . \"\\n\\r\";\n\t}", "public static function _index()\n\t{\n\t\treturn self::$_index;\n\t}", "public function actionIndex() {}", "public function actionIndex() {}", "abstract public function doIndex($item);", "function define_indexes()\n {\n\t\tif( !isset($this->input['st']) )\n\t\t{\n\t\t\t$this->input['st'] = 0;\n\t\t}\n\t\t\n\t\tif( !isset($this->input['t']) )\n\t\t{\n\t\t\t$this->input['t'] = 0;\n\t\t}\n\t\t\n\t\tif( !isset($this->input['p']) )\n\t\t{\n\t\t\t$this->input['p'] = 0;\n\t\t}\n\t\t\n\t\tif( !isset($this->input['pid']) )\n\t\t{\n\t\t\t$this->input['pid'] = 0;\n\t\t}\n\t\t\n\t\tif( !isset($this->input['gopid']) )\n\t\t{\n\t\t\t$this->input['gopid'] = 0;\n\t\t}\n\t\t\n\t\tif( !isset($this->input['L']) )\n\t\t{\n\t\t\t$this->input['L'] = 0;\n\t\t}\n\t\t\n\t\tif( !isset($this->input['f']) )\n\t\t{\n\t\t\t$this->input['f'] = 0;\n\t\t}\n\t\t\n\t\tif( !isset($this->input['cal_id']) )\n\t\t{\n\t\t\t$this->input['cal_id'] = 0;\n\t\t}\n\t\t\n\t\tif( !isset($this->input['code']) )\n\t\t{\n\t\t\t$this->input['code'] = '';\n\t\t}\n\t\t\n\t\tif( !isset($this->input['CODE']) )\n\t\t{\n\t\t\t$this->input['CODE'] = '';\n\t\t}\n\t}", "public function index()\n\t{\n\t\t$data['result']=NULL;\n\t\t$data['show']=NULL;\n\t\t$this->setIndex($data);\n\t}", "public function indexAction() {\n\t\t// TODO Auto-generated AdminController::indexAction() default action\n\t}", "public function actionIzinByBaakIndex()\n {\n $searchModel = new IzinRuanganSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n $status_request = Yii::$app->request->get('status_request_id');\n if($status_request == 1 || $status_request == 2 || $status_request == 3 || $status_request == 4){\n $params['IzinRuanganSearch']['status_request_id'] = $status_request;\n }\n\n return $this->render('IzinByBaakIndex', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'status_request_id' => $status_request,\n ]);\n }", "public function takeIndex()\n\t\t{\n\t\t\t$this->csv->takeIndexCSV();\n\t\t\t$this->txt->takeIndexTXT();\n\t\t}", "public function actionIndex() {\n $this->actionTrenutniSpored();\n }", "public function key(){\n return $this->index;\n }", "public function indexAction ()\r\n {\r\n // TODO Auto-generated SearchController::indexAction() default action\r\n }", "function index() {\n \n }", "public function actionIndex()\r\n {\r\n \treturn $this->render('index');\r\n }", "public function indexAction() \n {\n \t\n }", "function _toIndex()\n {\n return '';\n }", "public function show($index)\n {\n // Todo\n }", "public function indexAction(){\r\n\t\t\t\r\n\t\t}", "public function indexAction(){\t\t\n\t}", "function index() \n\t{\n\t\t/* TODO: This logic can be optimized more */\n\t\t\n\t\t$datevalue2 = $this->_date;\n\t\t\t\t\n\t\tif($_GET['log_file'])\n\t\t\tdefine(\"log_file\", $_GET['log_file']);\n\t\t\n\t\tif($_GET['DEBUG'])\n\t\t\tdefine(\"DEBUG\", $_GET['DEBUG']);\n\t\t\n\t\t$this->log_info(log_file, \"CA [delist live index] process started\");\n\n\t\t$final_array = array ();\n\n\t\t/* Fetch the list of indexes with delist security request pending for today */\n\t\t$indxxs = $this->db->getResult ( \"select id,indxx_id from tbl_replace_runnindex_req where startdate='\" . $datevalue2 . \"' and adminapprove='1' and dbapprove='1'\", true );\n\t\t\n\t\tif (! empty ( $indxxs )) \n\t\t{\n\t\t\tforeach ( $indxxs as $indxx ) \n\t\t\t{\t\t\t\t\n\t\t\t\t$indxx_data = $this->db->getResult ( \"select * from tbl_indxx where id='\" . $indxx ['indxx_id'] . \"'\" );\n\t\t\t\tif (! empty ( $indxx_data ))\n\t\t\t\t\t$final_array [$indxx ['indxx_id']]['details'] = $indxx_data;\n\t\t\t\t\n\t\t\t\t$indxx_value = $this->db->getResult ( \"select * from tbl_indxx_value where indxx_id='\" . $indxx ['indxx_id'] . \"' order by date desc \", false, 1 );\n\t\t\t\tif (! empty ( $indxx_value )) \n\t\t\t\t{\n\t\t\t\t\t$final_array [$indxx ['indxx_id']]['index_value'] = $indxx_value;\n\t\t\t\t\t$datevalue = $indxx_value ['date'];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->log_error(log_file, \"datevalue not defined, next MYSQL query will fail\");\n\t\t\t\t\t$this->mail_exit(log_file, __FILE__, __LINE__);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$query = \"Select it.id, it.name, it.isin, it.ticker, it.curr, it.divcurr, it.sedol, it.cusip, it.countryname, \n\t\t\t\t\tfp.price as calcprice, fp.localprice, fp.currencyfactor, sh.share as calcshare from\n\t\t\t\t\ttbl_indxx_ticker it left join tbl_final_price fp on fp.isin=it.isin\n\t\t\t\t\tleft join tbl_share sh on sh.isin=it.isin where\n\t\t\t\t\tfp.date='\" .$datevalue. \"' and fp.indxx_id='\" .$indxx ['indxx_id'].\n\t\t\t\t\t\t\t\t\t\" and sh.indxx_id='\" .$indxx ['indxx_id']. \"and it.indxx_id='\" . $indxx ['indxx_id'];\n\t\t\t\t$indxxprices = $this->db->getResult ( $query, true );\t\t\t\t\n\t\t\t\t$final_array [$indxx ['indxx_id']]['olddata'] = $indxxprices;\n\t\t\t\t\n\t\t\t\t$oldsecurity = $this->db->getResult ( \"select security_id from tbl_replace_runnsecurity where req_id='\" . $indxx ['id'] . \"' and indxx_id='\" . $indxx ['indxx_id'] . \"' \", true );\t\t\t\t\n\t\t\t\t$final_array [$indxx ['indxx_id']]['replacesecurity'] = $oldsecurity;\n\n\t\t\t\t$newsecurities = $this->db->getResult ( \"select name, \tisin,ticker,curr,divcurr,sedol,cusip,countryname from tbl_runnsecurities_replaced where req_id='\" . $indxx ['id'] . \"' and indxx_id='\" . $indxx ['indxx_id'] . \"' \", true );\n\t\t\t\t\n\t\t\t\tif (! empty ( $newsecurities )) \n\t\t\t\t{\n\t\t\t\t\tforeach ( $newsecurities as $key => $security ) \n\t\t\t\t\t{\n\t\t\t\t\t\t$prices = $this->getSecurtyPrices ( $security ['isin'], $security ['curr'], $indxx_data ['curr'], $datevalue );\n\t\t\t\t\t\t$newsecurities [$key] ['calcprice'] = $prices ['calcprice'];\n\t\t\t\t\t\t$newsecurities [$key] ['localprice'] = $prices ['localprice'];\n\t\t\t\t\t\t$newsecurities [$key] ['currencyfactor'] = $prices ['currencyfactor'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$final_array [$indxx ['indxx_id']]['newsecurity'] = $newsecurities;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (! empty ( $final_array )) \n\t\t{\n\t\t\tforeach ( $final_array as $id => $indxx_array ) \n\t\t\t{\n\t\t\t\t$countnewSeurities = count ( $indxx_array ['newsecurity'] );\n\n\t\t\t\tif ($countnewSeurities) \n\t\t\t\t{\n\t\t\t\t\tif (! empty ( $indxx_array ['replacesecurity'] )) \n\t\t\t\t\t{\n\t\t\t\t\t\t$tempmarketcap = 0;\n\t\t\t\t\t\t$TempWeight = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t/* Replace securties */\n\t\t\t\t\t\tforeach ( $indxx_array ['replacesecurity'] as $replaceSecurity ) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ( $indxx_array ['olddata'] as $oldsecuritykey => $oldsecurity ) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ($oldsecurity ['id'] == $replaceSecurity ['security_id']) \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$tempmarketcap += $oldsecurity ['calcshare'] * $oldsecurity ['calcprice'];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$deleteSecurityQuery = 'Delete from tbl_indxx_ticker where id=\"' . $oldsecurity ['id'] . '\"';\n\t\t\t\t\t\t\t\t\t$this->db->query ( $deleteSecurityQuery );\n\n\t\t\t\t\t\t\t\t\t$deletepriceQuery = 'Delete from tbl_final_price where indxx_id=\"' . $id . '\" and isin =\"' . $oldsecurity ['isin'] . '\" and date =\"' . $indxx_array ['index_value'] ['date'] . '\" ';\n\t\t\t\t\t\t\t\t\t$this->db->query ( $deletepriceQuery );\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$deleteshareQuery = 'Delete from tbl_share where indxx_id=\"' . $id . '\" and isin =\"' . $oldsecurity ['isin'] . '\" ';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$this->db->query ( $deleteshareQuery );\n\t\t\t\t\t\t\t\t\tunset ( $final_array [$id] ['olddata'] [$oldsecuritykey] );\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\n\t\t\t\t\t\t/* Calculate new index parameters with replaced securities */\n\t\t\t\t\t\tif ($tempmarketcap)\n\t\t\t\t\t\t\t$TempWeight = $tempmarketcap / $countnewSeurities;\n\t\t\t\n\t\t\t\t\t\tif (! empty ( $indxx_array ['newsecurity'] )) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ( $indxx_array ['newsecurity'] as $newsecuritykey => $newsecurity ) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$share = $TempWeight / $newsecurity ['calcprice'];\n\t\t\t\t\t\t\t\t$final_array [$id] ['newsecurity'] [$newsecuritykey] ['calcshare'] = $share;\n\t\t\t\t\t\t\t\t$newsecurity ['calcshare'] = $share;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$final_array [$id] ['olddata'] [] = $newsecurity;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$insertTicker = 'Insert into tbl_indxx_ticker set name=\"' . $newsecurity ['name'] . '\", isin=\"' . $newsecurity ['isin'] . '\", ticker=\"' . $newsecurity ['ticker'] . '\", curr=\"' . $newsecurity ['curr'] . '\", divcurr=\"' . $newsecurity ['divcurr'] . '\",countryname=\"' . $newsecurity ['countryname'] . '\",cusip=\"' . $newsecurity ['cusip'] . '\",sedol=\"' . $newsecurity ['sedol'] . '\",indxx_id=\"' . $id . '\", status=\"1\",weight=\"0\"';\t\n\t\t\t\t\t\t\t\t$this->db->query ( $insertTicker );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$insertPrice = 'Insert into tbl_final_price set date=\"' . $indxx_array ['index_value'] ['date'] . '\", isin=\"' . $newsecurity ['isin'] . '\", localprice=\"' . $newsecurity ['localprice'] . '\", price=\"' . $newsecurity ['calcprice'] . '\", currencyfactor=\"' . $newsecurity ['currencyfactor'] . '\",indxx_id=\"' . $id . '\"';\n\t\t\t\t\t\t\t\t$this->db->query ( $insertPrice );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$insertshare = 'Insert into tbl_share set date=\"' . $indxx_array ['index_value'] ['date'] . '\", isin=\"' . $newsecurity ['isin'] . '\", share=\"' . $newsecurity ['calcshare'] . '\",indxx_id=\"' . $id . '\"';\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$this->db->query ( $insertshare );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t$this->log_info(log_file, \"CA [replace live index] process finished\");\n\t\t\n\t\t//$this->saveProcess ( 1 );\n\t\t$this->Redirect(\"index.php?module=calccapub&DEBUG=\" .DEBUG. \"&date=\" .$datevalue2. \"&log_file=\" . basename(log_file), \"\", \"\" );\n\t}", "public function _index(){\n\t $this->_list();\n\t}", "function getfactoryIndex()\n\t{\n\t\t$vendorQry = db(\"select * from factories where name = '$this->factory' limit 1\");\n\t\t$this->factoryIndex = $vendorQry[\"tableIndex\"];\n\t\treturn $vendorQry[\"tableIndex\"];\n\t}", "public function getHashIndex();", "public function actionIndex()\n {\n return $this->renderIndex();\n }", "public function actionIndex()\r\n {\r\n\t\treturn $this->render('index');\r\n }", "function isIndexed() ;", "public function actionIndex()\n {\n\t\t$idInstitucion = $_SESSION['instituciones'][0];\n\t\t\t\n\t\t//Muestra solo las sedes que tenga esa institucion\n\t\t$searchModel = new InfraestructuraEducativaBuscar();\n\t\t$dataProvider = $searchModel->search(Yii::$app->request->queryParams);\t\t\t\n\t\t$dataProvider->query->select \t(\"ie.*\");\n\t\t$dataProvider->query->from\t \t( 'infraestructura_educativa as ie, sedes as se');\n\t\t$dataProvider->query->andwhere\t( \" ie.id_sede = se.id\n\t\t\t\t\t\t\t\t\t\t\tAND se.id_instituciones = $idInstitucion\n\t\t\t\t\t\t\t\t\t\t\tAND ie.estado = 1\n\t\t\t\t\t\t\t\t\t\t\");\n\t\n\n\t\treturn $this->render('index', [\n\t\t\t'dataProvider' => $dataProvider,\n\t\t\t'searchModel' => $searchModel,\n\t\t\t'idInstitucion' => $idInstitucion,\n\t\t\t]);\n\t\t\n\n }", "public function actionIndex()\n {\n\n }", "public function indexAction()\n {}", "public function actionIndex()\n {\n return $this->render('index');\n }", "public function actionIndex()\n\t{\n\n\t\treturn $this->render(\"index\");\n\n\n\t}", "public function indexAction(){}", "function indexAction(){\n \n $this->_templateObj->loadTemplate();\n $this->_viewObj->title = \"<title>Tadmin - index/index </title>\";\n $this->_viewObj->render('index/index', true);\n\n }", "public function indexAction() {\n\n\t}", "public function indexAction()\n {\n $this->autofilterParameters = $this->autofilterParameters + $this->_autofilterExtraParameters;\n if (! isset($this->indexParameters['contentTitle'])) {\n $this->indexParameters['contentTitle'] = $this->getIndexTitle();\n }\n\n return parent::indexAction();\n }", "public function indexAction() {\n \n }", "public function indexAction() {}", "public function get_indexinglist(){\n \n \t\t$sql15=\"SELECT * FROM indexing\";\n\t $result15=mysqli_query($this->db,$sql15);\n\t while($indexinglist_data=mysqli_fetch_array($result15)){\n \n echo '<tr>\n \n <td> <img class=\"brand-img\" src=\"../edelweiss/upload/indexes/'.$indexinglist_data[\"index_logo\"].'\" alt=\"...\" style=\"width:120px;height:60px;\"></td>\n <td>'.$indexinglist_data[\"logo_description\"].'</td>\n <td>'.$indexinglist_data[\"link\"].'</td>\n <td class=\"text-center\">\n <a href=\"about_indexing.php?indexing_id='.$indexinglist_data[\"indexing_id\"].'\" title=\"Edit\"><i class=\"fa fa-edit\"></i></a>\n </td>\n <td class=\"text-center\">\n <a href=\"delete.php?delete_indexid='.$indexinglist_data[\"indexing_id\"].'\" title=\"Delete\"><i class=\"fa fa-trash-o\"></i></a>\n </td>\n </tr>';\n }\n return true;\n \t}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "function index() \n\t{\n\t\t/* TODO: This logic can be optimized more */\n\t\t\n\t\t$datevalue = $this->_date;\n\t\t\n\t\tif($_GET['log_file'])\n\t\t\tdefine(\"log_file\", $_GET['log_file']);\n\t\t\n\t\tif($_GET['DEBUG'])\n\t\t\tdefine(\"DEBUG\", $_GET['DEBUG']);\n\n\t\t$this->log_info(log_file, \"CA replaceindex process started\");\n\t\t\n\t\t$finalArray = array ();\n\t\t\n\t\t/* Fetch list of all upcoming indexes with today as the live date */\n\t\t$totalindxxs = $this->db->getResult ( \"select * from tbl_indxx_temp where status='1' and usersignoff='1' and dbusersignoff='1' and submitted='1' and finalsignoff='1' and dateStart='\" . $datevalue . \"' \", true );\n\t\t\n\t\tif (! empty ( $indexdata )) \n\t\t{\n\t\t\tforeach ( $indexdata as $k1 => $oldindxx ) \n\t\t\t{\n\t\t\t\t$finalArray [$k1] = $oldindxx;\n\t\t\t\t\n\t\t\t\t/* Fetch the list of securities for this index */\n\t\t\t\t$oldTickers = $this->db->getResult ( \"Select * from tbl_indxx_ticker_temp where indxx_id ='\" . $oldindxx ['id'] . \"'\", true );\n\t\t\t\t$finalArray [$k1] ['tickers'] = $oldTickers;\n\n\t\t\t\t/* Fetch shares for this index */\n\t\t\t\t$oldShares = $this->db->getResult ( \"Select * from tbl_share_temp where indxx_id ='\" . $oldindxx ['id'] . \"'\", true );\n\t\t\t\t$finalArray [$k1] ['shares'] = $oldShares;\n\n\t\t\t\t/* Fetch the index value */\n\t\t\t\t$oldindxxvalue = $this->db->getResult ( \"Select * from tbl_indxx_value_temp where indxx_id ='\" . $oldindxx ['id'] . \"' order by date desc \", false, 1 );\n\t\t\t\t$finalArray [$k1] ['oldindxxvalue'] = $oldindxxvalue;\n\t\t\t\t\n\t\t\t\t/* Fetch the currency converted prices of various securities for this index */\n\t\t\t\t$oldPrices = $this->db->getResult ( \"Select * from tbl_final_price_temp where indxx_id ='\" . $oldindxx ['id'] . \"' and date='\" . $oldindxxvalue ['date'] . \"'\", true );\n\t\t\t\t$finalArray [$k1] ['prices'] = $oldPrices;\n\t\t\t\t\n\t\t\t\t/* Check if this index is listed in the delist queue */\n\t\t\t\t$delistReq = $this->db->getResult ( \"Select * from tbl_delist_tempindex_req where indxx_id ='\" . $oldindxx ['id'] . \"'\", true );\n\t\t\t\t$delistArray = array ();\n\n\t\t\t\tif (! empty ( $delistReq )) \n\t\t\t\t{\n\t\t\t\t\tforeach ( $delistReq as $k2 => $delisting ) \n\t\t\t\t\t{\n\t\t\t\t\t\t$delistArray [$k2] = $delisting;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$delistSec = $this->db->getResult ( \"Select * from tbl_delist_tempsecurity where indxx_id ='\" . $delisting ['indxx_id'] . \"' and req_id='\" . $delisting ['id'] . \"'\", true );\n\t\t\t\t\t\t$delistArray [$k2] ['security'] = $delistSec;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$finalArray [$k1] ['delisting'] = $delistArray;\n\t\t\t\t\n\t\t\t\t// //Replace Security\n\t\t\t\t$replaceReq = $this->db->getResult ( \"Select * from tbl_replace_tempindex_req where indxx_id ='\" . $oldindxx ['id'] . \"'\", true );\n\n\t\t\t\t$replaceArray = array ();\n\t\t\t\tif (! empty ( $replaceReq )) \n\t\t\t\t{\n\t\t\t\t\tforeach ( $replaceReq as $k3 => $replacement ) \n\t\t\t\t\t{\n\t\t\t\t\t\t$replaceArray [$k3] = $replacement;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$replaceSec = $this->db->getResult ( \"Select * from tbl_replace_tempsecurity where indxx_id ='\" . $replacement ['indxx_id'] . \"' and req_id='\" . $replacement ['id'] . \"'\", true );\n\t\t\t\t\t\t$replaceArray [$k3] ['selectedsecurity'] = $replaceSec;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$replacedSec = $this->db->getResult ( \"Select * from tbl_tempsecurities_replaced where indxx_id ='\" . $replacement ['indxx_id'] . \"' and req_id='\" . $replacement ['id'] . \"'\", true );\n\t\t\t\t\t\t$replaceArray [$k3] ['replacedsecurity'] = $replacedSec;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$finalArray [$k1] ['replacement'] = $replaceArray;\n\t\t\t\t\n\t\t\t\t$oldAssignedUsers = $this->db->getResult ( \"Select * from tbl_assign_index_temp where indxx_id ='\" . $oldindxx ['id'] . \"'\", true );\n\t\t\t\t$finalArray [$k1] ['oldUsers'] = $oldAssignedUsers;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (! empty ( $finalArray )) \n\t\t{\n\t\t\t$textdata = $this->arr_to_csv ( $finalArray );\n\t\t\t$csv = '';\n\n\t\t\tforeach ( $textdata as $text )\n\t\t\t\t$csv .= $text . \"\\n\";\n\n\t\t\t$output_folder = \"../files/output/ca-index-backup/\";\n\t\t\tif (!file_exists($output_folder))\n\t\t\t\tmkdir($output_folder, 0777, true);\n\t\t\t\n\t\t\t$file = $output_folder. \"backup-upcomming-\" . $datevalue . \".txt\";\n\t\t\t$open = fopen ( $file, \"w+\" );\n\t\t\t\n\t\t\tif ($open) \n\t\t\t{\n\t\t\t\tif (fwrite ( $open, $csv )) \n\t\t\t\t{\n\t\t\t\t\tfclose ( $open );\n\t\t\t\t\t$this->log_info(log_file, \"File written = \" .$file);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->log_error(log_file, \"Unable to write file = \" .$file);\n\t\t\t\t\t$this->mail_exit(log_file, __FILE__, __LINE__);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->log_error(log_file, \"Unable to open file = \" .$file);\n\t\t\t\t$this->mail_exit(log_file, __FILE__, __LINE__);\n\t\t\t}\n\t\t\t\t\n\t\t\t/* Push each upcoming index, with today as live date, into the live index table list */\n\t\t\tforeach ( $finalArray as $skey => $newIndxx ) \n\t\t\t{\n\t\t\t\t$newIndexArray = array ();\n\t\t\t\t\n\t\t\t\t$checkindex = $this->db->getResult ( \"Select * from tbl_indxx where code ='\" . $newIndxx ['code'] . \"'\" );\n\t\t\t\t\n\t\t\t\tif (! empty ( $checkindex ))\n\t\t\t\t{\n\t\t\t\t\t/* TODO: Check with Deepak how this scenario can occur? It should not be in live in list */\n\t\t\t\t\t/* AMIT: case with rebalancing */\n\t\t\t\t\t$newIndexArray ['indexdetails'] = $checkindex;\t\t\t\t\t\n\t\t\t\t\t$this->db->query ( \"delete from tbl_indxx where code ='\" . $newIndxx ['code'] . \"'\" );\n\t\t\t\t\t\n\t\t\t\t\t$checktickers = $this->db->getResult ( \"Select * from tbl_indxx_ticker where indxx_id ='\" . $checkindex ['id'] . \"'\", true );\n\t\t\t\t\t$newIndexArray ['indexdetails'] ['tickers'] = $checktickers;\n\t\t\t\t\t$this->db->query ( \"delete from tbl_indxx_ticker where indxx_id ='\" . $checkindex ['id'] . \"'\" );\n\t\t\t\t\t\n\t\t\t\t\t$checkindexvalue = $this->db->getResult ( \"Select * from tbl_indxx_value where indxx_id ='\" . $checkindex ['id'] . \"' order by date desc\", false, 1 );\n\t\t\t\t\t$newIndexArray ['indexdetails'] ['indexvalue'] = $checkindexvalue;\t\t\t\t\t\n\t\t\t\t\t$this->db->query ( \"delete from tbl_indxx_value where indxx_id ='\" . $checkindex ['id'] . \"' and date='\" . $checkindexvalue ['date'] . \"'\" );\n\t\t\t\t\t\n\t\t\t\t\t$checkprice = $this->db->getResult ( \"Select * from tbl_final_price where indxx_id ='\" . $checkindex ['id'] . \"' and date='\" . $checkindexvalue ['date'] . \"'\", true );\n\t\t\t\t\t$newIndexArray ['indexdetails'] ['price'] = $checkprice;\n\t\t\t\t\t$this->db->query ( \"delete from tbl_final_price where indxx_id ='\" . $checkindex ['id'] . \"' and date='\" . $checkindexvalue ['date'] . \"'\" );\n\t\t\t\t\t\n\t\t\t\t\t$checkshares = $this->db->getResult ( \"Select * from tbl_share where indxx_id ='\" . $checkindex ['id'] . \"'\", true );\n\t\t\t\t\t$newIndexArray ['indexdetails'] ['shares'] = $checkshares;\n\t\t\t\t\t$this->db->query ( \"delete from tbl_share where indxx_id ='\" . $checkindex ['id'] . \"'\" );\n\t\t\t\t\t\n\t\t\t\t\t$checkdelistReq = $this->db->getResult ( \"Select * from tbl_delist_runnindex_req where indxx_id ='\" . $checkindex ['id'] . \"'\", true );\n\t\t\t\t\t\n\t\t\t\t\t$checkdelistArray = array ();\n\t\t\t\t\tif (! empty ( $checkdelistReq )) \n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ( $checkdelistReq as $kch => $checkdelisting ) \n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t$checkdelistSec = $this->db->getResult ( \"Select * from tbl_delist_runnsecurity where indxx_id ='\" . $checkdelisting ['indxx_id'] . \"' and req_id='\" . $checkdelisting ['id'] . \"'\", true );\n\t\t\t\t\t\t\t$checkdelistArray [$kch] = $checkdelisting;\n\t\t\t\t\t\t\t$checkdelistArray [$kch] ['security'] = $checkdelistSec;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->db->query ( \"delete from tbl_delist_runnsecurity where indxx_id ='\" . $checkdelisting ['indxx_id'] . \"' and req_id='\" . $checkdelisting ['id'] . \"'\" );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$newIndexArray ['indexdetails'] ['delisting'] = $checkdelistArray;\n\t\t\t\t\t\n\t\t\t\t\t$this->db->query ( \"delete from tbl_delist_runnindex_req where indxx_id ='\" . $checkindex ['id'] . \"'\" );\n\t\t\t\t\t\n\t\t\t\t\t$checkreplaceReq = $this->db->getResult ( \"Select * from tbl_replace_runnindex_req where indxx_id ='\" . $checkindex ['id'] . \"'\", true );\n\t\t\t\t\t$checkreplaceArray = array ();\n\n\t\t\t\t\tif (! empty ( $checkreplaceReq )) \n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ( $checkreplaceReq as $kchk => $checkreplacement ) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$checkreplaceSec = $this->db->getResult ( \"Select * from tbl_replace_runnsecurity where indxx_id ='\" . $checkreplacement ['indxx_id'] . \"' and req_id='\" . $checkreplacement ['id'] . \"'\", true );\n\t\t\t\t\t\t\t$checkreplaceArray [$kchk] = $checkreplacement;\n\t\t\t\t\t\t\t$checkreplaceArray [$kchk] ['selectedsecurity'] = $checkreplaceSec;\n\n\t\t\t\t\t\t\t$this->db->query ( \"delete from tbl_replace_runnsecurity where indxx_id ='\" . $checkreplacement ['indxx_id'] . \"' and req_id='\" . $checkreplacement ['id'] . \"'\" );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$checkreplacedSec = $this->db->getResult ( \"Select * from tbl_runnsecurities_replaced where indxx_id ='\" . $checkreplacement ['indxx_id'] . \"' and req_id='\" . $checkreplacement ['id'] . \"'\", true );\n\t\t\t\t\t\t\t$checkreplaceArray [$kchk] ['replacedsecurity'] = $checkreplacedSec;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this->db->query ( \"delete from tbl_runnsecurities_replaced where indxx_id ='\" . $checkreplacement ['indxx_id'] . \"' and req_id='\" . $checkreplacement ['id'] . \"'\" );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$newIndexArray ['indexdetails'] ['replacement'] = $checkreplaceArray;\n\t\t\t\t\t$this->db->query ( \"delete from tbl_replace_runnindex_req where indxx_id ='\" . $checkindex ['id'] . \"'\" );\n\t\t\t\t\t\n\t\t\t\t\t$checkusers = $this->db->getResult ( \"Select * from tbl_assign_index where indxx_id ='\" . $checkindex ['id'] . \"'\", true );\n\t\t\t\t\t$newIndexArray ['indexdetails'] ['users'] = $checkusers;\n\n\t\t\t\t\t$this->db->query ( \"delete from tbl_assign_index where indxx_id ='\" . $checkindex ['id'] . \"'\" );\n\t\t\t\t\t\n\t\t\t\t\tif (! empty ( $newIndexArray )) \n\t\t\t\t\t{\n\t\t\t\t\t\t$textdata = $this->arr_to_csv ( $newIndexArray );\n\t\t\t\t\t\t$csv = '';\n\n\t\t\t\t\t\tforeach ( $textdata as $text )\n\t\t\t\t\t\t\t$csv .= $text . \"\\n\";\n\n\t\t\t\t\t\t$file = $output_folder. \"backup-running-\" . $checkindex ['code'] . \"-\" . $datevalue . \".txt\";\n\t\t\t\t\t\t$open = fopen ( $file, \"w+\" );\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ($open) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (fwrite ( $open, $csv )) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tfclose ( $open );\n\t\t\t\t\t\t\t\t$this->info(\"File written for\" . $checkindex ['code']);\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$this->log_error(log_file, \"Unable to write file = \" .$file);\n\t\t\t\t\t\t\t\t$this->mail_exit(log_file, __FILE__, __LINE__);\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$this->log_error(log_file, \"Unable to open file = \" .$file);\n\t\t\t\t\t\t\t$this->mail_exit(log_file, __FILE__, __LINE__);\n\t\t\t\t\t\t}\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$insertIndexQuery = \"Insert into tbl_indxx set name='\" . mysql_real_escape_string ( $newIndxx ['name'] ) . \"',code='\" . mysql_real_escape_string ( $newIndxx ['code'] ) . \"',investmentammount='\" . mysql_real_escape_string ( $newIndxx ['investmentammount'] ) . \"',indexvalue='\" . mysql_real_escape_string ( $newIndxx ['indexvalue'] ) . \"',divisor='\" . ($newIndxx ['divisor']) . \"',type='\" . mysql_real_escape_string ( $newIndxx ['type'] ) . \"',cash_adjust='\" . mysql_real_escape_string ( $newIndxx ['cash_adjust'] ) . \"',curr='\" . mysql_real_escape_string ( $newIndxx ['curr'] ) . \"',status='\" . mysql_real_escape_string ( $newIndxx ['status'] ) . \"',dateAdded='\" . mysql_real_escape_string ( $newIndxx ['dateAdded'] ) . \"',lastupdated='\" . mysql_real_escape_string ( $newIndxx ['lastupdated'] ) . \"',dateStart='\" . mysql_real_escape_string ( $newIndxx ['dateStart'] ) . \"',usersignoff='\" . mysql_real_escape_string ( $newIndxx ['usersignoff'] ) . \"',dbusersignoff='\" . mysql_real_escape_string ( $newIndxx ['dbusersignoff'] ) . \"',submitted='\" . mysql_real_escape_string ( $newIndxx ['submitted'] ) . \"',finalsignoff='\" . mysql_real_escape_string ( $newIndxx ['finalsignoff'] ) . \"',runindex='\" . mysql_real_escape_string ( $newIndxx ['runindex'] ) . \"',addtype='\" . mysql_real_escape_string ( $newIndxx ['addtype'] ) . \"',zone='\" . mysql_real_escape_string ( $newIndxx ['zone'] ) . \"',client_id='\" . mysql_real_escape_string ( $newIndxx ['client_id'] ) . \"',display_currency='\" . mysql_real_escape_string ( $newIndxx ['display_currency'] ) . \"' ,ireturn='\" . mysql_real_escape_string ( $newIndxx ['ireturn'] ) . \"',div_type='\" . mysql_real_escape_string ( $newIndxx ['div_type'] ) . \"',currency_hedged='\" . mysql_real_escape_string ( $newIndxx ['currency_hedged'] ) . \"',priority='\" . mysql_real_escape_string ( $newIndxx ['priority'] ) . \"',divpvalue='\" . mysql_real_escape_string ( $newIndxx ['divpvalue'] ) . \"'\";\t\t\t\t\n\t\t\t\t$this->db->query ( $insertIndexQuery );\n\t\t\t\t\n\t\t\t\t$NewIndxxId = mysql_insert_id ();\n\n\t\t\t\t$this->db->query ( \"delete from tbl_indxx_temp where id='\" . $newIndxx ['id'] . \"'\" );\n\t\t\t\t\n\t\t\t\t$tickerTempArray = array ();\n\t\t\t\t\n\t\t\t\tif (! empty ( $newIndxx ['tickers'] )) \n\t\t\t\t{\n\t\t\t\t\tforeach ( $newIndxx ['tickers'] as $k4 => $newTickers ) \n\t\t\t\t\t{\n\t\t\t\t\t\t$insertTickerQuery = \"Insert into tbl_indxx_ticker set name='\" . mysql_real_escape_string ( $newTickers ['name'] ) . \"',isin='\" . mysql_real_escape_string ( $newTickers ['isin'] ) . \"',ticker='\" . mysql_real_escape_string ( $newTickers ['ticker'] ) . \"',weight='\" . mysql_real_escape_string ( $newTickers ['weight'] ) . \"',curr='\" . mysql_real_escape_string ( $newTickers ['curr'] ) . \"',divcurr='\" . mysql_real_escape_string ( $newTickers ['divcurr'] ) . \"',dateAdded='\" . mysql_real_escape_string ( $newTickers ['dateAdded'] ) . \"',status='\" . ($newTickers ['status']) . \"',sedol='\" . mysql_real_escape_string ( $newTickers ['sedol'] ) . \"',cusip='\" . mysql_real_escape_string ( $newTickers ['cusip'] ) . \"',countryname='\" . mysql_real_escape_string ( $newTickers ['countryname'] ) . \"', indxx_id='\" . $NewIndxxId . \"' \";\t\t\t\t\t\t\n\t\t\t\t\t\t$this->db->query ( $insertTickerQuery );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$tickerTempArray [$newTickers ['id']] = mysql_insert_id ();\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->db->query ( \"delete from tbl_indxx_ticker_temp where indxx_id='\" . $newIndxx ['id'] . \"'\" );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (! empty ( $newIndxx ['shares'] )) \n\t\t\t\t{\n\t\t\t\t\tforeach ( $newIndxx ['shares'] as $k4 => $newShares ) \n\t\t\t\t\t{\n\t\t\t\t\t\t$insertShareQuery = \"Insert into tbl_share set dateAdded='\" . $newShares ['dateAdded'] . \"',isin='\" . $newShares ['isin'] . \"',date='\" . $newShares ['date'] . \"',share='\" . $newShares ['share'] . \"', indxx_id='\" . $NewIndxxId . \"' \";\t\t\t\t\t\t\n\t\t\t\t\t\t$this->db->query ( $insertShareQuery );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->db->query ( \"delete from tbl_share_temp where indxx_id='\" . $newIndxx ['id'] . \"'\" );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (! empty ( $newIndxx ['oldUsers'] )) \n\t\t\t\t{\n\t\t\t\t\tforeach ( $newIndxx ['oldUsers'] as $k4 => $newUsers ) \n\t\t\t\t\t{\n\t\t\t\t\t\t$insertUserQuery = \"Insert into tbl_assign_index set dateAdded='\" . $newUsers ['dateAdded'] . \"',status='\" . $newUsers ['status'] . \"',user_id='\" . $newUsers ['user_id'] . \"',isAdmin='\" . $newUsers ['isAdmin'] . \"', indxx_id='\" . $NewIndxxId . \"' \";\t\t\t\t\t\t\n\t\t\t\t\t\t$this->db->query ( $insertUserQuery );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->db->query ( \"delete from tbl_assign_index_temp where indxx_id='\" . $newIndxx ['id'] . \"'\" );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (! empty ( $newIndxx ['prices'] )) \n\t\t\t\t{\n\t\t\t\t\tforeach ( $newIndxx ['prices'] as $k4 => $newPrices ) \n\t\t\t\t\t{\n\t\t\t\t\t\t$insertPriceQuery = \"Insert into tbl_final_price set dateAdded='\" . $newPrices ['dateAdded'] . \"',isin='\" . $newPrices ['isin'] . \"',date='\" . $newPrices ['date'] . \"',price='\" . $newPrices ['price'] . \"',currencyfactor='\" . $newPrices ['currencyfactor'] . \"', \tlocalprice='\" . $newPrices ['localprice'] . \"', indxx_id='\" . $NewIndxxId . \"' \";\t\t\t\t\t\t\n\t\t\t\t\t\t$this->db->query ( $insertPriceQuery );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->db->query ( \"delete from tbl_final_price_temp where indxx_id='\" . $newIndxx ['id'] . \"' and date='\" . $newPrices ['date'] . \"'\" );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (! empty ( $newIndxx ['oldindxxvalue'] )) {\n\t\t\t\t\t$insertOldindxxvalueQuery = \"Insert into tbl_indxx_value set dateAdded='\" . $newIndxx ['oldindxxvalue'] ['dateAdded'] . \"',market_value='\" . $newIndxx ['oldindxxvalue'] ['market_value'] . \"',indxx_value='\" . $newIndxx ['oldindxxvalue'] ['indxx_value'] . \"',date='\" . $newIndxx ['oldindxxvalue'] ['date'] . \"',olddivisor='\" . $newIndxx ['oldindxxvalue'] ['olddivisor'] . \"', \tnewdivisor='\" . $newIndxx ['oldindxxvalue'] ['newdivisor'] . \"', \tcode='\" . $newIndxx ['oldindxxvalue'] ['code'] . \"', indxx_id='\" . $NewIndxxId . \"' \";\n\t\t\t\t\t\n\t\t\t\t\t$this->db->query ( $insertOldindxxvalueQuery );\n\t\t\t\t\t\n\t\t\t\t\t$this->db->query ( \"delete from tbl_indxx_value_temp where indxx_id='\" . $newIndxx ['id'] . \"' and date='\" . $newIndxx ['oldindxxvalue'] ['date'] . \"'\" );\n\t\t\t\t}\n\t\t\t\t// //Delisting Insert to new\n\t\t\t\t\n\t\t\t\tif (! empty ( $newIndxx ['delisting'] )) {\n\t\t\t\t\tforeach ( $newIndxx ['delisting'] as $k5 => $newdelist ) {\n\t\t\t\t\t\t$insertDelistReqQuery = \"Insert into tbl_delist_runnindex_req set status='\" . $newdelist ['status'] . \"',dateAdded='\" . $newdelist ['dateAdded'] . \"',startdate='\" . $newdelist ['startdate'] . \"', \tadminapprove='\" . $newdelist ['adminapprove'] . \"',dbapprove='\" . $newdelist ['dbapprove'] . \"',user_id='\" . $newdelist ['user_id'] . \"', indxx_id='\" . $NewIndxxId . \"' \";\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->db->query ( $insertDelistReqQuery );\n\t\t\t\t\t\t$newdelistId = mysql_insert_id ();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (! empty ( $newdelist ['security'] )) {\n\t\t\t\t\t\t\tforeach ( $newdelist ['security'] as $newDelistSecurity ) {\n\t\t\t\t\t\t\t\t$insertDelistSecQuery = \"Insert into tbl_delist_runnsecurity set status='\" . $newDelistSecurity ['status'] . \"',dateAdded='\" . $newDelistSecurity ['dateAdded'] . \"',security_id='\" . $tickerTempArray [$newDelistSecurity ['security_id']] . \"',req_id='\" . $newdelistId . \"', indxx_id='\" . $NewIndxxId . \"' \";\n\t\t\t\t\t\t\t\t$this->db->query ( $insertDelistSecQuery );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$this->db->query ( \"delete from tbl_delist_tempsecurity where id='\" . $newDelistSecurity ['id'] . \"'\" );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->db->query ( \"delete from tbl_delist_tempindex_req where indxx_id='\" . $newIndxx ['id'] . \"' and id='\" . $newdelist ['id'] . \"'\" );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (! empty ( $newIndxx ['replacement'] )) {\n\t\t\t\t\tforeach ( $newIndxx ['replacement'] as $k6 => $newReplace ) {\n\t\t\t\t\t\t$insertReplaceReqQuery = \"Insert into tbl_replace_runnindex_req set status='\" . $newReplace ['status'] . \"',dateAdded='\" . $newReplace ['dateAdded'] . \"',startdate='\" . $newReplace ['startdate'] . \"', \tadminapprove='\" . $newReplace ['adminapprove'] . \"',dbapprove='\" . $newReplace ['dbapprove'] . \"',user_id='\" . $newReplace ['user_id'] . \"', indxx_id='\" . $NewIndxxId . \"' \";\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->db->query ( $insertReplaceReqQuery );\n\t\t\t\t\t\t$newReplaceId = mysql_insert_id ();\n\t\t\t\t\t\tif (! empty ( $newReplace ['selectedsecurity'] )) {\n\t\t\t\t\t\t\tforeach ( $newReplace ['selectedsecurity'] as $newReplaceSecurity ) {\n\t\t\t\t\t\t\t\t$insertReplaceSecQuery = \"Insert into tbl_replace_runnsecurity set status='\" . $newReplaceSecurity ['status'] . \"',dateAdded='\" . $newReplaceSecurity ['dateAdded'] . \"',security_id='\" . $tickerTempArray [$newReplaceSecurity ['security_id']] . \"',req_id='\" . $newReplaceId . \"', indxx_id='\" . $NewIndxxId . \"' \";\n\t\t\t\t\t\t\t\t$this->db->query ( $insertReplaceSecQuery );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$this->db->query ( \"delete from tbl_replace_tempsecurity where id='\" . $newReplaceSecurity ['id'] . \"'\" );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (! empty ( $newReplace ['replacedsecurity'] )) {\n\t\t\t\t\t\t\tforeach ( $newReplace ['replacedsecurity'] as $newReplacedSecurity ) {\n\t\t\t\t\t\t\t\t$insertReplacedQuery = \"Insert into tbl_runnsecurities_replaced set status='\" . $newReplaceSecurity ['status'] . \"',dateAdded='\" . $newReplaceSecurity ['dateAdded'] . \"',name='\" . mysql_real_escape_string ( $newReplacedSecurity ['name'] ) . \"',isin='\" . mysql_real_escape_string ( $newReplacedSecurity ['isin'] ) . \"',ticker='\" . mysql_real_escape_string ( $newReplacedSecurity ['ticker'] ) . \"',weight='\" . mysql_real_escape_string ( $newReplacedSecurity ['weight'] ) . \"',curr='\" . mysql_real_escape_string ( $newReplacedSecurity ['curr'] ) . \"',divcurr='\" . mysql_real_escape_string ( $newReplacedSecurity ['divcurr'] ) . \"',sedol='\" . mysql_real_escape_string ( $newReplacedSecurity ['sedol'] ) . \"',cusip='\" . mysql_real_escape_string ( $newReplacedSecurity ['cusip'] ) . \"',countryname='\" . mysql_real_escape_string ( $newReplacedSecurity ['countryname'] ) . \"',req_id='\" . $newReplaceId . \"', indxx_id='\" . $NewIndxxId . \"' \";\n\t\t\t\t\t\t\t\t$this->db->query ( $insertReplacedQuery );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$this->db->query ( \"delete from tbl_tempsecurities_replaced where id='\" . $newReplacedSecurity ['id'] . \"'\" );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$this->db->query ( \"delete from tbl_replace_tempindex_req where indxx_id='\" . $newIndxx ['id'] . \"' and id='\" . $newReplace ['id'] . \"'\" );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->log_info(log_file, \"CA replaceindex process finished\");\n\t\t\n\t\t//$this->saveProcess ( 1 );\n\t\t$this->Redirect(\"index.php?module=replacecash&DEBUG=\" .DEBUG. \"&date=\" .$datevalue. \"&log_file=\" . basename(log_file), \"\", \"\" );\n\t}", "public function actionIndex($p) { }", "public function actionIndex()\n\n {\n\n echo 'Index action has not used.';\n\n }", "public function index()\n {\n return $this->index;\n }", "public function actionIndex() {\n\t\treturn $this->render('index');\n\t}", "public function indexAction() {\r\n \r\n }" ]
[ "0.691029", "0.648763", "0.64596987", "0.6428501", "0.6428501", "0.6428501", "0.63521016", "0.6337705", "0.6337705", "0.6337705", "0.6337281", "0.6337281", "0.6337281", "0.6336929", "0.6336008", "0.6336008", "0.62443227", "0.61547697", "0.6122587", "0.61130774", "0.61130774", "0.60529566", "0.6051301", "0.6021591", "0.6000248", "0.5948409", "0.59115136", "0.5886731", "0.5865773", "0.586109", "0.5860842", "0.58079225", "0.58079225", "0.58079225", "0.57815444", "0.5773477", "0.5753854", "0.5740589", "0.5738055", "0.57377785", "0.57170093", "0.570287", "0.5682878", "0.56816113", "0.56808114", "0.5675705", "0.5668407", "0.56500125", "0.56500125", "0.56335956", "0.5622666", "0.5622642", "0.5620878", "0.56200075", "0.55775976", "0.5577135", "0.5561861", "0.5556207", "0.5551485", "0.55508184", "0.5543514", "0.55230784", "0.55139697", "0.5506089", "0.5493457", "0.54897684", "0.54803497", "0.5468932", "0.54597217", "0.5446888", "0.54467624", "0.5446615", "0.54442847", "0.5444105", "0.5442704", "0.5435113", "0.54348993", "0.5431887", "0.54281676", "0.54223615", "0.5409552", "0.54091185", "0.5406843", "0.54061705", "0.54052156", "0.54051745", "0.54051745", "0.54051745", "0.54051745", "0.54051745", "0.54051745", "0.54051745", "0.54051745", "0.54051745", "0.5400314", "0.53996664", "0.5397815", "0.5386085", "0.5385151", "0.5384312" ]
0.5637378
49
actionid: indexbyhrd actiondesc: Display index of izin for HRD
public function actionIndexByHrd(){ $searchModel = new PermohonanIzinSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('indexByHrd',[ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getIndex() ;", "public function getHashIndex();", "public function getSortIndex();", "abstract protected function getIndex();", "function get_index()\r\n\t{\r\n\r\n\t}", "public function getIndex();", "public function getIndex();", "public function getIndex();", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "protected function get_heat_index($tempF, $rh) {\n if ($tempF > 79 && $rh > 39) {\n $hiF = -42.379 + 2.04901523 * $tempF + 10.14333127 * $rh - 0.22475541 * $tempF * $rh;\n $hiF += -0.00683783 * pow($tempF, 2) - 0.05481717 * pow($rh, 2);\n $hiF += 0.00122874 * pow($tempF, 2) * $rh + 0.00085282 * $tempF * pow($rh, 2);\n $hiF += -0.00000199 * pow($tempF, 2) * pow($rh, 2);\n $hiF = round($hiF);\n $hiC = round(($hiF - 32) / 1.8);\n $this->wxInfo['ITEMS'][$this->tend]['HEATINDEXC'] = $hiC;\n $this->wxInfo['ITEMS'][$this->tend]['HEATINDEXF'] = $hiF;\n }\n }", "abstract function indexAction();", "function indexAction(){\n \t}", "public function key(){\n return $this->index;\n }", "abstract public function actionIndex();", "abstract public function doIndex($item);", "function indexAction(){\r\n }", "public function action_index()\n\t{\n\t}", "public function _INDEX()\n\t{\n\t\t\n\t}", "public static function zend_hash_index_find(HashTable $ht, int $h): Zval {\n }", "public function key()\n\t{\n\t\treturn $this->index;\n\t}", "public function key()\n\t{\n\t\treturn $this->index;\n\t}", "public function getSearchIndex();", "public static function _zend_hash_index_find(HashTable $ht, int $h): Zval {\n }", "function key()\n\t{\n\t\treturn $this->index;\n\t}", "public static function _index()\n\t{\n\t\treturn self::$_index;\n\t}", "function indexInfo( $table, $index, $fname = __METHOD__ );", "public function buildIndex();", "public function get_resource_index(){\n return $this->resource_index;\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t\n\t\t//不满足条件的删除/恢复\n\t\t$id = intval($this->getInput('id'));\n\t\t$opc = $this->getInput('opc');\n\t\t$fulfil = $this->getInput('fulfil');\n\t\tself::_rollBackData($id, $opc, $fulfil);\n\t\t\n\t\t\n\t\tif ($page < 1) $page = 1;\n\t\t$s = $this->getInput(array('title','status','start_time','end_time', 'gtype', 'ntype', 'btype'));\n\t\t$search = array();\n\t\t\n\t\tif ($s['title']) $search['title'] = array('LIKE',$s['title']);\n\t\tif ($s['status']) $search['status'] = $s['status'] - 1;\n\t\tif ($s['gtype']) $search['gtype'] = $s['gtype'];\n\t\tif ($s['start_time']) $search['start_time'][0] = array('>=', strtotime($s['start_time']));\n\t\tif ($s['end_time'] && $s['start_time']) $search['start_time'][1] = array('<=', strtotime($s['end_time']));\n\t\tif ($s['ntype']) $search['ntype'] = $s['ntype'];\n\t\tif ($s['btype']) $search['btype'] = $s['btype'];\n\t\t\n\t\tlist(, $groups) = Resource_Service_Pgroup::getAllPgroup();\n\t\t$groups = Common::resetKey($groups, 'id');\n\t\t$this->cookieParams();\n\t\tlist($total, $besttjs) = Client_Service_Besttj::getList($page, $this->perpage,$search);\n\t\t\n\t\t$besttj_ids = array();\n\t\tforeach($besttjs as $key=>$value){\n\t\t\t$bs = Client_Service_Besttj::getIdxBesttjByBesttjId($value['id']);\n\t\t\tforeach($bs as $k=>$v){\n\t\t\t\t$game_info = Resource_Service_Games::getGameAllInfo(array('id'=>$v['game_id']));\n\t\t\t\tif($game_info){\n\t\t\t\t\t$besttj_ids[$v['besttj_id']][] = $game_info['name'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->assign('besttjs', $besttjs);\n\t\t$this->assign('groups', $groups);\n\t\t$this->assign('search', $search);\n\t\t$this->assign('besttj_ids', $besttj_ids);\n\t\t$this->assign('total', $total);\n\t\t$this->assign('s', $s);\n\t\t$this->assign('ntype', $this->ntype);\n\t\t$this->assign('btype', $this->btype);\n\t\t$url = $this->actions['listUrl'].'/?' . http_build_query($s) . '&';\n\t\t$this->assign('pager', Common::getPages($total, $page, $this->perpage, $url));\n\t}", "public function action_index()\n {\n }", "public function key() {\n\t\t\treturn $this->index;\n\t\t}", "function _show_index($handler_id, &$data)\n {\n midcom_show_style('events-header');\n midcom_show_style('index-header');\n midcom_show_style('trips-header');\n foreach ($this->_trips as $trip) {\n if (! $this->_request_data['datamanager']->autoset_storage($trip))\n {\n debug_push_class(__CLASS__, __FUNCTION__);\n debug_add(\"The datamanager for trip {$trip->id} could not be initialized, skipping it.\");\n debug_print_r('Object was:', $trip);\n debug_pop();\n continue;\n }\n $this->_request_data['view_trip'] = $data['datamanager']->get_content_html();\n $this->_request_data['trip'] = $trip;\n midcom_show_style('trips-item');\n }\n midcom_show_style('trips-footer');\n midcom_show_style('meetings-header');\n foreach ($this->_meetings as $meeting) {\n if (! $this->_request_data['datamanager']->autoset_storage($meeting))\n {\n debug_push_class(__CLASS__, __FUNCTION__);\n debug_add(\"The datamanager for meeting {$meeting->id} could not be initialized, skipping it.\");\n debug_print_r('Object was:', $trip);\n debug_pop();\n continue;\n }\n $this->_request_data['view_meeting'] = $data['datamanager']->get_content_html();\n $this->_request_data['meeting'] = $meeting;\n midcom_show_style('meetings-item');\n }\n midcom_show_style('meetings-footer');\n midcom_show_style('index-footer');\n midcom_show_style('events-footer');\n }", "public function getAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Client_Service_Besttj::getBesttj(intval($id));\n\t\tif(!$info) $this->output(-1, '操作失败.');\n\t\t$this->output(0, '', $info);\n\t}", "public function actionViewByHrd($id){\n return $this->render('viewByHrd',[\n 'model' => $this->findModel($id),\n ]);\n }", "public function actionIndex()\n {\n\t\techo \"=== Action index ===\";\n \n }", "public function index($id)\n {\n //\n return \"这里是index:\".$id;\n }", "public function key(): int\n {\n return $this->index;\n }", "function calculateIDX(){\r\n\t\t$out=array(-1,-1,-1);\r\n\t\t$out[0]=number_format($this->_calcScoreIndex(),2,'.','');\r\n\t\t$out[1]=number_format($this->_calcCheckIndex(),2,'.','');\r\n\t\t// only sum up if both values are positive , else just scoreIDX\r\n\t\tif ($out[0]>0){\r\n\t\t\t$out[2]=$out[0];\r\n\t\t\tif ($out[1]>0){$out[2]=$out[2]+$out[1];}\r\n\t\t}\r\n\t\treturn $out;\r\n\t}", "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}", "public function index($chequeId)\n {\n //\n }", "public function indexAction()\n {\n\n return parent::indexAction();\n\n\n }", "function get_table_indexes($db, $table, $cnx='', $reload=false, $mode='mysql'){\n\tif($mode!=='mysql') exit('only mysql index mode developed');\n\tglobal $get_table_indexes, $dbTypeArray;\n\tif(!$cnx)$cnx=C_MASTER;\n\tif($get_table_indexes[$db][$table] && !$reload){\n\t\treturn $get_table_indexes[$db][$table];\n\t}else{\n\t\t$fl=__FILE__;\n\t\t$ln=__LINE__+1;\n\t\tob_start();\n\t\t$result=q(\"SHOW INDEXES FROM `$db`.`$table`\", $cnx, ERR_ECHO, O_DO_NOT_REMEDIATE);\n\t\t$err=ob_get_contents();\n\t\tob_end_clean();\n\t\tif($err)return false;\n\t\t\n\t\t$typeFlip = array_flip($dbTypeArray);\n\t\t$inCompound=false;\n\t\twhile($v=mysqli_fetch_array($result,MYSQLI_ASSOC)){\n\t\t\t$w++;\n\t\t\t@extract($v);\n\t\t\tif($buffer==$Key_name){\n\t\t\t\t//duplicate part of a key\n\t\t\t\tif(!$inCompound){\n\t\t\t\t\t$multiIdx[$Key_name][]=$singleIdx[count($singleIdx)-1];\n\t\t\t\t\tunset($singleIdx[count($singleIdx)-1]);\n\t\t\t\t\t//next two lines overcome \"bug\" in php: just cause I unset the highest element, this will not reset the next index assigned when I say $singleIdx[]=.. later on.\n\t\t\t\t\t$clr=$singleIdx;\n\t\t\t\t\t$singleIdx=$clr;\n\t\t\t\t}\n\t\t\t\t$multiIdx[$Key_name][]=$v;\n\t\t\t\t$inCompound=true;\n\t\t\t}else{\n\t\t\t\t$singleIdx[]=$v;\n\t\t\t\t$buffer=$Key_name;\n\t\t\t\t$inCompound=false;\n\t\t\t}\n\t\t}\n\t\t//set $singleIdx as assoc for reference\n\t\tif(count($singleIdx)){\n\t\t\tforeach($singleIdx as $v) $a[strtolower($v['Column_name'])]=$v;\n\t\t\t$singleIdx=$a;\n\t\t}\n\t\t//store compound keys as XML\n\t\tif($multiIdx){\n\t\t\t$compoundKey='';\n\t\t\tforeach($multiIdx as $n=>$v){\n\t\t\t\t$ci.='<compoundKey Key_name=\"'.$n.'\" Column_count=\"'.count($v).'\"';\n\t\t\t\t$i=0;\n\t\t\t\tforeach($v as $w){\n\t\t\t\t\t$i++;\n\t\t\t\t\tif($i==1)$ci.=' Non_unique=\"'.$w['Non_unique'].'\">'.\"\\n\";\n\t\t\t\t\t$ci.='<keyColumn Seq_in_index=\"'.$w['Seq_in_index'].'\" Column_name=\"'.$w['Column_name'].'\" Sub_part=\"'.$w['Sub_part'].'\" Comment=\"'.htmlentities($w['Comment']).'\">'.\"\\n\";\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$ci.='</compoundKey>';\n\t\t\t}\n\t\t}\n\t\t$get_table_indexes[$db][$table]=array('singleIdx'=>$singleIdx, 'multiIdx'=>$multiIdx, 'compoundXML'=>$ci);\n\t\treturn $get_table_indexes[$db][$table];\n\t}\n}", "public function indexPerLevelAction() {\n\n }", "public function fullIndexAction() {}", "public function actionIndex()\n {\n \t$query = Dict::find()->where(['parent_id'=>0]);\n \t\n \t$locals = LuLu::getPagedRows($query);\n \t \n \treturn $this->render('index', $locals);\n }", "public function actionIzinByBaakIndex()\n {\n $searchModel = new IzinRuanganSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n $status_request = Yii::$app->request->get('status_request_id');\n if($status_request == 1 || $status_request == 2 || $status_request == 3 || $status_request == 4){\n $params['IzinRuanganSearch']['status_request_id'] = $status_request;\n }\n\n return $this->render('IzinByBaakIndex', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'status_request_id' => $status_request,\n ]);\n }", "public function getIndexStart();", "function _handler_index($handler_id, $args, &$data)\n {\n $this->_request_data['name'] = \"fi.kilonkipinat.events\";\n\n $this->_update_breadcrumb_line($handler_id);\n\n $kisa_config = $this->_config->get('kisa');\n \n $_MIDCOM->set_pagetitle(\"{$this->_topic->extra}\");\n \n $qb_trips = fi_kilonkipinat_events_event_dba::new_query_builder();\n //$qb_trips->add_constraint('topic', '=', $this->_topic->id);\n $qb_trips->add_constraint('type', '>=', FI_KILONKIPINAT_EVENTS_EVENT_TYPE_GENERIC);\n $qb_trips->add_constraint('type', '<', FI_KILONKIPINAT_EVENTS_EVENT_TYPE_MEETING_GENERIC);\n if ($kisa_config == 0) {\n $qb_trips->add_constraint('kisa', '<=', FI_KILONKIPINAT_EVENTS_EVENT_KISA_BOTH);\n }\n elseif ($kisa_config == 1) {\n $qb_trips->add_constraint('kisa', '<', FI_KILONKIPINAT_EVENTS_EVENT_KISA_BOTH);\n }\n elseif ($kisa_config == 2) {\n $qb_trips->add_constraint('kisa', '>=', FI_KILONKIPINAT_EVENTS_EVENT_KISA_BOTH);\n }\n elseif ($kisa_config == 3) {\n $qb_trips->add_constraint('kisa', '>', FI_KILONKIPINAT_EVENTS_EVENT_KISA_BOTH);\n }\n $qb_trips->add_constraint('end', '>', date('Y-m-d H:i:s', time()));\n $qb_trips->add_order('start');\n if (!$_MIDGARD['user']) {\n $qb_trips->add_constraint('visibility', '=', FI_KILONKIPINAT_EVENTS_EVENT_VISIBILITY_PUBLIC);\n }\n $trips = $qb_trips->execute();\n\n $qb_meetings = fi_kilonkipinat_events_event_dba::new_query_builder();\n //$qb_meetings->add_constraint('topic', '=', $this->_topic->id);\n $qb_meetings->add_constraint('type', '>=', FI_KILONKIPINAT_EVENTS_EVENT_TYPE_MEETING_GENERIC);\n $qb_meetings->add_constraint('type', '<=', FI_KILONKIPINAT_EVENTS_EVENT_TYPE_MEETING_ANNUAL);\n if ($kisa_config == 0) {\n $qb_meetings->add_constraint('kisa', '<=', FI_KILONKIPINAT_EVENTS_EVENT_KISA_BOTH);\n }\n elseif ($kisa_config == 1) {\n $qb_meetings->add_constraint('kisa', '<', FI_KILONKIPINAT_EVENTS_EVENT_KISA_BOTH);\n }\n elseif ($kisa_config == 2) {\n $qb_meetings->add_constraint('kisa', '>=', FI_KILONKIPINAT_EVENTS_EVENT_KISA_BOTH);\n }\n elseif ($kisa_config == 3) {\n $qb_meetings->add_constraint('kisa', '>', FI_KILONKIPINAT_EVENTS_EVENT_KISA_BOTH);\n }\n $qb_meetings->add_constraint('end', '>', date('Y-m-d H:i:s', time()));\n $qb_meetings->add_order('start');\n if (!$_MIDGARD['user']) {\n $qb_meetings->add_constraint('visibility', '=', FI_KILONKIPINAT_EVENTS_EVENT_VISIBILITY_PUBLIC);\n }\n $meetings = $qb_meetings->execute();\n\n $this->_trips = $trips;\n $this->_meetings = $meetings;\n\n return true;\n }", "public function actionIndex($p) { }", "public function hook_query_index(&$query) {\n\t //Your code here\n\t \n\t }", "function isIndexed() ;", "public function key(): int\n {\n return $this->_index;\n }", "function index() \n\t{\n\t\t/* TODO: This logic can be optimized more */\n\t\t\n\t\t$datevalue2 = $this->_date;\n\t\t\t\t\n\t\tif($_GET['log_file'])\n\t\t\tdefine(\"log_file\", $_GET['log_file']);\n\t\t\n\t\tif($_GET['DEBUG'])\n\t\t\tdefine(\"DEBUG\", $_GET['DEBUG']);\n\t\t\n\t\t$this->log_info(log_file, \"CA [delist live index] process started\");\n\n\t\t$final_array = array ();\n\n\t\t/* Fetch the list of indexes with delist security request pending for today */\n\t\t$indxxs = $this->db->getResult ( \"select id,indxx_id from tbl_replace_runnindex_req where startdate='\" . $datevalue2 . \"' and adminapprove='1' and dbapprove='1'\", true );\n\t\t\n\t\tif (! empty ( $indxxs )) \n\t\t{\n\t\t\tforeach ( $indxxs as $indxx ) \n\t\t\t{\t\t\t\t\n\t\t\t\t$indxx_data = $this->db->getResult ( \"select * from tbl_indxx where id='\" . $indxx ['indxx_id'] . \"'\" );\n\t\t\t\tif (! empty ( $indxx_data ))\n\t\t\t\t\t$final_array [$indxx ['indxx_id']]['details'] = $indxx_data;\n\t\t\t\t\n\t\t\t\t$indxx_value = $this->db->getResult ( \"select * from tbl_indxx_value where indxx_id='\" . $indxx ['indxx_id'] . \"' order by date desc \", false, 1 );\n\t\t\t\tif (! empty ( $indxx_value )) \n\t\t\t\t{\n\t\t\t\t\t$final_array [$indxx ['indxx_id']]['index_value'] = $indxx_value;\n\t\t\t\t\t$datevalue = $indxx_value ['date'];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->log_error(log_file, \"datevalue not defined, next MYSQL query will fail\");\n\t\t\t\t\t$this->mail_exit(log_file, __FILE__, __LINE__);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$query = \"Select it.id, it.name, it.isin, it.ticker, it.curr, it.divcurr, it.sedol, it.cusip, it.countryname, \n\t\t\t\t\tfp.price as calcprice, fp.localprice, fp.currencyfactor, sh.share as calcshare from\n\t\t\t\t\ttbl_indxx_ticker it left join tbl_final_price fp on fp.isin=it.isin\n\t\t\t\t\tleft join tbl_share sh on sh.isin=it.isin where\n\t\t\t\t\tfp.date='\" .$datevalue. \"' and fp.indxx_id='\" .$indxx ['indxx_id'].\n\t\t\t\t\t\t\t\t\t\" and sh.indxx_id='\" .$indxx ['indxx_id']. \"and it.indxx_id='\" . $indxx ['indxx_id'];\n\t\t\t\t$indxxprices = $this->db->getResult ( $query, true );\t\t\t\t\n\t\t\t\t$final_array [$indxx ['indxx_id']]['olddata'] = $indxxprices;\n\t\t\t\t\n\t\t\t\t$oldsecurity = $this->db->getResult ( \"select security_id from tbl_replace_runnsecurity where req_id='\" . $indxx ['id'] . \"' and indxx_id='\" . $indxx ['indxx_id'] . \"' \", true );\t\t\t\t\n\t\t\t\t$final_array [$indxx ['indxx_id']]['replacesecurity'] = $oldsecurity;\n\n\t\t\t\t$newsecurities = $this->db->getResult ( \"select name, \tisin,ticker,curr,divcurr,sedol,cusip,countryname from tbl_runnsecurities_replaced where req_id='\" . $indxx ['id'] . \"' and indxx_id='\" . $indxx ['indxx_id'] . \"' \", true );\n\t\t\t\t\n\t\t\t\tif (! empty ( $newsecurities )) \n\t\t\t\t{\n\t\t\t\t\tforeach ( $newsecurities as $key => $security ) \n\t\t\t\t\t{\n\t\t\t\t\t\t$prices = $this->getSecurtyPrices ( $security ['isin'], $security ['curr'], $indxx_data ['curr'], $datevalue );\n\t\t\t\t\t\t$newsecurities [$key] ['calcprice'] = $prices ['calcprice'];\n\t\t\t\t\t\t$newsecurities [$key] ['localprice'] = $prices ['localprice'];\n\t\t\t\t\t\t$newsecurities [$key] ['currencyfactor'] = $prices ['currencyfactor'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$final_array [$indxx ['indxx_id']]['newsecurity'] = $newsecurities;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (! empty ( $final_array )) \n\t\t{\n\t\t\tforeach ( $final_array as $id => $indxx_array ) \n\t\t\t{\n\t\t\t\t$countnewSeurities = count ( $indxx_array ['newsecurity'] );\n\n\t\t\t\tif ($countnewSeurities) \n\t\t\t\t{\n\t\t\t\t\tif (! empty ( $indxx_array ['replacesecurity'] )) \n\t\t\t\t\t{\n\t\t\t\t\t\t$tempmarketcap = 0;\n\t\t\t\t\t\t$TempWeight = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t/* Replace securties */\n\t\t\t\t\t\tforeach ( $indxx_array ['replacesecurity'] as $replaceSecurity ) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ( $indxx_array ['olddata'] as $oldsecuritykey => $oldsecurity ) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ($oldsecurity ['id'] == $replaceSecurity ['security_id']) \n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$tempmarketcap += $oldsecurity ['calcshare'] * $oldsecurity ['calcprice'];\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$deleteSecurityQuery = 'Delete from tbl_indxx_ticker where id=\"' . $oldsecurity ['id'] . '\"';\n\t\t\t\t\t\t\t\t\t$this->db->query ( $deleteSecurityQuery );\n\n\t\t\t\t\t\t\t\t\t$deletepriceQuery = 'Delete from tbl_final_price where indxx_id=\"' . $id . '\" and isin =\"' . $oldsecurity ['isin'] . '\" and date =\"' . $indxx_array ['index_value'] ['date'] . '\" ';\n\t\t\t\t\t\t\t\t\t$this->db->query ( $deletepriceQuery );\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$deleteshareQuery = 'Delete from tbl_share where indxx_id=\"' . $id . '\" and isin =\"' . $oldsecurity ['isin'] . '\" ';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$this->db->query ( $deleteshareQuery );\n\t\t\t\t\t\t\t\t\tunset ( $final_array [$id] ['olddata'] [$oldsecuritykey] );\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\n\t\t\t\t\t\t/* Calculate new index parameters with replaced securities */\n\t\t\t\t\t\tif ($tempmarketcap)\n\t\t\t\t\t\t\t$TempWeight = $tempmarketcap / $countnewSeurities;\n\t\t\t\n\t\t\t\t\t\tif (! empty ( $indxx_array ['newsecurity'] )) \n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tforeach ( $indxx_array ['newsecurity'] as $newsecuritykey => $newsecurity ) \n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$share = $TempWeight / $newsecurity ['calcprice'];\n\t\t\t\t\t\t\t\t$final_array [$id] ['newsecurity'] [$newsecuritykey] ['calcshare'] = $share;\n\t\t\t\t\t\t\t\t$newsecurity ['calcshare'] = $share;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$final_array [$id] ['olddata'] [] = $newsecurity;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$insertTicker = 'Insert into tbl_indxx_ticker set name=\"' . $newsecurity ['name'] . '\", isin=\"' . $newsecurity ['isin'] . '\", ticker=\"' . $newsecurity ['ticker'] . '\", curr=\"' . $newsecurity ['curr'] . '\", divcurr=\"' . $newsecurity ['divcurr'] . '\",countryname=\"' . $newsecurity ['countryname'] . '\",cusip=\"' . $newsecurity ['cusip'] . '\",sedol=\"' . $newsecurity ['sedol'] . '\",indxx_id=\"' . $id . '\", status=\"1\",weight=\"0\"';\t\n\t\t\t\t\t\t\t\t$this->db->query ( $insertTicker );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$insertPrice = 'Insert into tbl_final_price set date=\"' . $indxx_array ['index_value'] ['date'] . '\", isin=\"' . $newsecurity ['isin'] . '\", localprice=\"' . $newsecurity ['localprice'] . '\", price=\"' . $newsecurity ['calcprice'] . '\", currencyfactor=\"' . $newsecurity ['currencyfactor'] . '\",indxx_id=\"' . $id . '\"';\n\t\t\t\t\t\t\t\t$this->db->query ( $insertPrice );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$insertshare = 'Insert into tbl_share set date=\"' . $indxx_array ['index_value'] ['date'] . '\", isin=\"' . $newsecurity ['isin'] . '\", share=\"' . $newsecurity ['calcshare'] . '\",indxx_id=\"' . $id . '\"';\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$this->db->query ( $insertshare );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t\t$this->log_info(log_file, \"CA [replace live index] process finished\");\n\t\t\n\t\t//$this->saveProcess ( 1 );\n\t\t$this->Redirect(\"index.php?module=calccapub&DEBUG=\" .DEBUG. \"&date=\" .$datevalue2. \"&log_file=\" . basename(log_file), \"\", \"\" );\n\t}", "public function indexAction() {\n\t\t// TODO Auto-generated AdminController::indexAction() default action\n\t}", "function _getsortby($idx) {\n\tswitch ((int)$idx) {\n\t\tcase 1:\t$idx = 6; break;\n\t\tcase 3:\t$idx = 2; break;\n\t\tcase 4:\t$idx = 3; break;\n\t\tcase 5:\t$idx = 12; break;\n\t\tcase 6:\t$idx = 8; break;\n\t\tcase 7:\t$idx = 9; break;\n\t\tcase 10:\t$idx = 4; break;\n\t\tcase 11:\t$idx = 5; break;\n\t\tdefault: $idx = 6;\n\t}\n\treturn $idx;\n}", "public function indexAction ()\r\n {\r\n // TODO Auto-generated SearchController::indexAction() default action\r\n }", "public function getIndex() {return $this->index;}", "public function index(StateDataTable $state)\n {\n return $state->render('admin.state.index');\n //\n }", "public function index(HRDatatable $datatable)\n {\n return $datatable->render('dashboard.admin.hr.index');\n }", "public function indexAction() {\r\n\t\t// TODO Auto-generated FinanceController::indexAction() default action\r\n\t}", "public function getIndex($name, $id) {\n foreach ($this->view->result as $item) {\n if ($item->$name == $id) {\n return $item->index;\n }\n }\n return FALSE;\n }", "public function indexAction ()\n\t{\n\t\t// TODO Auto-generated ReportController::indexAction() default action\n\t}", "public function actionOutputIndex()\n {\n\t\tset_time_limit(0);\n $searchModel = new AttendanceCheckinReportsSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\t\t\n\t\t\n\t\t$sort = Yii::$app->request->queryParams['sort']?Yii::$app->request->queryParams['sort']:'signdate';\n\t\t\n\t\tif($sort{0}==\"-\"){\n\t\t\t$orderBy = substr($sort,1).\" desc\";\n\t\t}else{\n\t\t\t$orderBy = \" {$sort} ASC\";\n\t\t}\n\t\t$result = $dataProvider->query->orderBy($orderBy)->asArray()->all();\n\t\t// var_dump($result);exit;\n $arr = [];\n $ic = 1; \n foreach($result as $r) {\n\t\t\t$r['signtime1'] = $r[\"signtime1\"]==\"0000-00-00 00:00:00\"?\"\":$r[\"signtime1\"];\n\t\t\t$r['signtime2'] = $r[\"signtime2\"]==\"0000-00-00 00:00:00\"?\"\":$r[\"signtime2\"];\n\t\t\t\n\t\t\t\n\t\t\t$r['signstatus'] = $r['signstatus_valid']?:$r['signstatus'];\n\t\t\t$r['latetime'] = $r['latetime']-$r['latetime_valid'];\n\t\t\t$r['overtime'] = $r['overtime_valid'];\n $arr[] = $r;\n }\n\t\t$header = [\n 'id' => 'ID',\n 'personnel_id' => '员工ID',\n 'employeeid' => '工号',\n 'username' => '员工姓名',\n 'signdate' => '签到日期',\n 'dayofweek' => '星期几',\n 'signtime1' => '上班签到',\n 'signtime2' => '下班签到',\n 'timediff' => '工作时长',\n 'signstatus' => '签到状态',\n 'latetime' => '迟到分钟',\n 'overtime' => '加班时长',\n 'memo' => '备注',\n ];\n\t\t$columns = array_keys($header);\n\t\t\n\t\t \n \\moonland\\phpexcel\\Excel::export([\n\t\t\t'isMultipleSheet' => true,\n\t\t\t'models' => [\n\t\t\t\t'考勤报表' => $arr, \n\t\t\t],\n\t\t\t'columns' => [\n\t\t\t\t'考勤报表' => $columns,\n\t\t\t], \n\t\t\t'headers' => [\n\t\t\t\t'考勤报表' => $header, \n\t\t\t],\n ]);\n }", "public function _index(){\n\t $this->_list();\n\t}", "abstract function index();", "abstract function index();", "abstract function index();", "public function indexAction()\n { \n if(!$this->_rParams->id) {\n // we want all items\n }\n }", "public function actionIndex()\n {}", "public function updateNameIndex($nameEntry, $icid, $ark, $entityType, $degree, $resources) {\n // First query to see if the name is already in the index. If so, then do an update. Else, this is an insert.\n $resultTest = $this->sdb->query(\"select * from name_index where ic_id = $1;\", array($icid));\n $check = array();\n while($row = $this->sdb->fetchRow($resultTest))\n {\n array_push($check, $row);\n }\n\n if (empty($check)) {\n // Doing an insert, since nothing found\n $result = $this->sdb->query(\"insert into name_index\n (ic_id, ark, entity_type, name_entry, name_entry_lower, degree, resources, timestamp) values\n ($1, $2, $3, $4, lower($4), $5, $6, now()) returning *;\",\n array($icid, $ark, $entityType, $nameEntry, $degree, $resources));\n $all = array();\n while($row = $this->sdb->fetchRow($result))\n {\n array_push($all, $row);\n }\n return $all;\n } else {\n // Doing an update, since ic_id was found\n $result = $this->sdb->query(\"update name_index set\n (ark, entity_type, name_entry, name_entry_lower, degree, resources, timestamp) =\n ($2, $3, $4, lower($4), $5, $6, now()) where ic_id = $1 returning *;\",\n array($icid, $ark, $entityType, $nameEntry, $degree, $resources));\n $all = array();\n while($row = $this->sdb->fetchRow($result))\n {\n array_push($all, $row);\n }\n return $all;\n }\n return false;\n }", "function putIndex(){\n\n }", "function putIndex(){\n\n }", "public function actionIndex($id)\n {\n $shop = new Shops();\n $shopModel = $shop->getShopById($id);\n $openingHours = new OpeningHours();\n $dataProvider = $openingHours->getShopOpeningHours($id);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n 'shopModel' => $shopModel,\n ]);\n }", "public function actionIndex()\n {\n\t return $this->render('index');\n }", "public function index($id)\n {\n }", "public function hook_query_index(&$query)\n\t{\n\t\t//Your code here\n\n\t}", "public function actionIndex() {}", "public function actionIndex() {}", "public function index($id)\n {\n\n \n //\n }", "function ss_hammerOID_pollers_indexes() {\n\n $return_arr = array();\n\t\t\n\t$rows = db_fetch_assoc(\"SELECT id FROM poller\");\n\n\n for ($i=0;($i<sizeof($rows));$i++) {\n $return_arr[$i] = $rows[$i]['id'];\n }\n\n return $return_arr;\n}", "public function actionIndex()\n\t{\n\t\techo 1 . \"\\n\\r\";\n\t}", "function admin_index()\n\t{\n\t \n\t}", "public function getIndex()\n {\n // add stuff here\n }", "public function indexAction() \n {\n \t\n }", "public function getIndex() \n\t{\n\t\treturn $this->idMenuItem;\n\t}", "public function getPaymentIndex();", "public function getIndexEnd();", "public function key() {\n\t\t$this->checkResultSet();\n\n\t\tif (! is_null($this->keyColumn)) {\n\t\t\t$row = $this->fetchRowAssoc($this->index, true);\n\t\t\treturn $row[$this->keyColumn];\n\t\t}\n\n\t\treturn $this->index;\n\t}", "public function index() {\n if ($this->_m_index !== null)\n return $this->_m_index;\n $this->_m_index = ($this->isIndexSeparate() ? $this->indexSeparate() : $this->indexInTag());\n return $this->_m_index;\n }", "public function takeIndex()\n\t\t{\n\t\t\t$this->csv->takeIndexCSV();\n\t\t\t$this->txt->takeIndexTXT();\n\t\t}", "public function getIndex() {\n \treturn $this->index;\n }", "public function index($id)\n {\n //\n\n }" ]
[ "0.5975102", "0.58702487", "0.5841442", "0.5593693", "0.5591032", "0.55571353", "0.55571353", "0.55571353", "0.54159963", "0.54159963", "0.54159963", "0.541532", "0.541532", "0.541532", "0.54145646", "0.54129547", "0.54129547", "0.53141147", "0.53008324", "0.5282296", "0.528048", "0.52690077", "0.52241594", "0.518206", "0.5167332", "0.5159325", "0.5155079", "0.5088307", "0.5088307", "0.50863165", "0.5074999", "0.507385", "0.5063012", "0.505242", "0.50335544", "0.5009911", "0.49982724", "0.4984303", "0.49676725", "0.4944145", "0.49392322", "0.4937549", "0.4928795", "0.492545", "0.4914317", "0.49097633", "0.49072605", "0.49067914", "0.48996887", "0.4894713", "0.4890317", "0.48894393", "0.48786387", "0.4868229", "0.48608422", "0.484392", "0.4842753", "0.48427147", "0.48350823", "0.48344892", "0.48334068", "0.48164353", "0.4815926", "0.4813668", "0.4813132", "0.4808239", "0.48070714", "0.48048732", "0.4802493", "0.4798862", "0.47893196", "0.47876596", "0.4781224", "0.4781224", "0.4781224", "0.47806585", "0.47677788", "0.47664237", "0.47653258", "0.47653258", "0.47630984", "0.47603858", "0.47541198", "0.4751558", "0.47402656", "0.47402656", "0.47384262", "0.47381094", "0.47370562", "0.47312647", "0.47165135", "0.47156745", "0.47084606", "0.47015327", "0.4700827", "0.46984127", "0.4689829", "0.46778476", "0.46774742", "0.46743864" ]
0.62461543
0
actionid: indexbyatasan actiondesc: Display index of izin for supervisor
public function actionIndexByAtasan(){ $atasanSearchModel = new AtasanIzinSearch(); $pegawai = Pegawai::find()->where(['user_id' => Yii::$app->user->identity->user_id])->one(); $atasanSearchModel->pegawai_id = $pegawai['pegawai_id']; $dataProvider = $atasanSearchModel->search(Yii::$app->request->queryParams); return $this->render('indexByAtasan',[ 'searchModel' => $atasanSearchModel, 'dataProvider' => $dataProvider, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getIndex() ;", "function indexAction(){\n \t}", "public function getIndex();", "public function getIndex();", "public function getIndex();", "abstract function indexAction();", "public function action_index()\n\t{\n\t\t// figure out what action to do... if we're called directly\n\t\t// actions in this class are called from the Profile menu, though.\n\t}", "abstract public function actionIndex();", "abstract protected function getIndex();", "abstract public function doIndex($item);", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function key(){\n return $this->index;\n }", "public function getIndex() {}", "public function getIndex() {}", "public function actionIndex()\n {\n\t\techo \"=== Action index ===\";\n \n }", "public function getIndex() \n\t{\n\t\treturn $this->idMenuItem;\n\t}", "function indexAction(){\r\n }", "public function indexAction()\n {\n\n return parent::indexAction();\n\n\n }", "public function getSortIndex();", "public function indexPerLevelAction() {\n\n }", "public function indexAction() {\n\t\t// TODO Auto-generated AdminController::indexAction() default action\n\t}", "function key()\n\t{\n\t\treturn $this->index;\n\t}", "public function action_index()\n\t{\n\t}", "function indexInfo( $table, $index, $fname = __METHOD__ );", "public function actionIndex($p) { }", "public function key()\n\t{\n\t\treturn $this->index;\n\t}", "public function key()\n\t{\n\t\treturn $this->index;\n\t}", "public function actionIzinByBaakIndex()\n {\n $searchModel = new IzinRuanganSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n $status_request = Yii::$app->request->get('status_request_id');\n if($status_request == 1 || $status_request == 2 || $status_request == 3 || $status_request == 4){\n $params['IzinRuanganSearch']['status_request_id'] = $status_request;\n }\n\n return $this->render('IzinByBaakIndex', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'status_request_id' => $status_request,\n ]);\n }", "public function action_index()\n {\n }", "function getIndex()\n {\n if (empty($this->code)) return NULL;\n return $this->code.'-'.$this->customer_id;\n }", "public function bulk_actions( $which = '' ) {\n\t\t//edd_log_views();\n\t}", "public function getPaymentIndex();", "public function action_index()\n\t{\n\t\t// Forward to message index, it's not like we know much more :P\n\t\t$this->action_messageindex();\n\t}", "public function actionIndex()\n\t{\n\t\techo 1 . \"\\n\\r\";\n\t}", "public function index($id)\n {\n //\n return \"这里是index:\".$id;\n }", "public function _INDEX()\n\t{\n\t\t\n\t}", "function putIndex(){\n\n }", "function putIndex(){\n\n }", "function get_index()\r\n\t{\r\n\r\n\t}", "public function actionIndex() {}", "public function actionIndex() {}", "public function key() {\n\t\t\treturn $this->index;\n\t\t}", "public function getIndexInfo()\n {\n return $this->__call(__FUNCTION__, func_get_args());\n }", "public function action_index()\n\t{\n\t\t// $this->action_subscriptions();\n\t}", "public function actionIndex()\n {}", "public function actions()\r\n {\r\n return array(\r\n 'index' => array(\r\n 'class' => \\nizsheanez\\jsonRpc\\Action::class,\r\n ),\r\n );\r\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n {\n return $this->_index(['user_id','=',$this->user()->id]);\n }", "public function actionIndex()\n {\n\t return $this->render('index');\n }", "public function admincp_index(){\n\t\tmodules::run('admincp/chk_perm',$this->session->userdata('ID_Module'),'r',0);\n\t\t$default_func = 'status';\n\t\t$default_sort = 'ASC';\n\t\t$data = array(\n\t\t\t'module'=>$this->module,\n\t\t\t'module_name'=>$this->session->userdata('Name_Module'),\n\t\t\t'default_func'=>$default_func,\n\t\t\t'default_sort'=>$default_sort\n\t\t);\n\t\t$this->template->write_view('content','index',$data);\n\t\t$this->template->render();\n\t}", "public function indexAction(){\r\n\t\t\t\r\n\t\t}", "public function getIndex() \n\t{\n\t\treturn $this->idMessage;\n\t}", "function admin_index()\n\t{\n\t \n\t}", "public function key(): int\n {\n return $this->index;\n }", "public function indexAction()\n {\n $ctrl = $this->dbController->find($this->checkControllerIdParam());\n $vCtrl = FALSE;\n $vAction = array();\n\n IF($ctrl->count() === 1) {\n $ctrlRow = new Admin_Model_DbRow_Controller($ctrl->current());\n\n FOREACH($this->dbAction->findActionByControllerId($ctrlRow->get('id')) AS $row) {\n $vAction[] = new Admin_Model_DbRow_Action($row);\n }\n\n $vCtrl = $ctrlRow;\n }\n \n $this->view->controller = $vCtrl;\n $this->view->actions = $vAction;\n }", "public function fullIndexAction() {}", "public function actionIndex() {\n $this->actionTrenutniSpored();\n }", "public function getHashIndex();", "public static function _index()\n\t{\n\t\treturn self::$_index;\n\t}", "function viewSIndex() {\n\t\tglobal $page;\n\t\tglobal $id;\n\t\t$this->vars[\"sindex\"] = stringOr($this->vars[\"sindex\"], $this->item[\"sindex\"][0]);\n\n\t\t$_ = '';\n\t\t$_ .= '<div class=\"ci33 init:form form:action:'.$page->url.'\" id=\"container:sindex\">';\n\t\t$_ .= '<div class=\"init:expandable id:sindex\">';\n\t\t$_ .= $this->head(\"sIndex\", \"2\");\n\t\t$_ .= '<fieldset>';\n\n\t\t$_ .= $this->p(\"Used as link alias to achieve search engine optimization. Only a-z and 0-9 allowed. And it must be unique - if already used it will be prepended a unique identifier.\", \"info\");\n\n\t\tif(Session::getLogin()->validatePage(\"sindex_update\")) {\n\t\t\t$_ .= $this->inputHidden(\"id\", $id);\n\t\t\t$_ .= $this->inputHidden(\"page_status\", \"sindex_update\");\n\t\t\t$_ .= $this->input(\"sindex\");\n\t\t\t$_ .= $this->smartButton($this->translate(\"Update\"), false, \"sindex_update\", \"fright\");\n\t\t}\n\t\telse {\n\t\t\t$_ .= $this->block($this->varnames[\"sindex\"], $this->vars[\"sindex\"]);\n\t\t}\n\n\t\t$_ .= '</fieldset>';\n\t\t$_ .= '</div>';\n\t\t$_ .= '</div>';\n\t\treturn $_;\n\t}", "public function indexAction(){}", "public function indexAction(){\t\t\n\t}", "public function indexAction()\n {\n\t\techo 'Module Admin IndexController indexAction';\n\t\t\n }", "public function indexAction() \n {\n \t\n }", "public function actionIndex()\n\n {\n\n echo 'Index action has not used.';\n\n }", "public function indexAction()\r\n {\r\n // Model\r\n $tourismOperDb = new Model_DbTable_TourismOperator;\r\n\r\n // Data\r\n // Tipe 6 = vito / overseas representatives\r\n $tourismOperQuery = \r\n $tourismOperDb->getAllWithDescById('6', $this->_languageId);\r\n\r\n // View\r\n $this->view->tourism = parent::setPaginator($tourismOperQuery);\r\n\r\n // id_page_overseas = 'representative(s)'\r\n $this->view->customName = $this->view->translate('id_page_overseas');\r\n }", "public function isIndex();", "public function index(StateDataTable $state)\n {\n return $state->render('admin.state.index');\n //\n }", "public function indexAction()\n { \n if(!$this->_rParams->id) {\n // we want all items\n }\n }", "public function key(): int\n {\n return $this->_index;\n }", "public function getIndex() \n\t{\n\t\treturn $this->idController;\n\t}", "function indexAction(){\n \n $this->_templateObj->loadTemplate();\n $this->_viewObj->title = \"<title>Tadmin - index/index </title>\";\n $this->_viewObj->render('index/index', true);\n\n }", "function admin_index($id = null){\r\n\t\t//Configure::write('debug',);\r\n\t\tif(!isset($this->params['named']['page'])){\r\n\t\t\t$this->Session->delete('AdminSearch');\r\n\t\t}\r\n\t\t$filters = array();\r\n\t\tif(!empty($this->data)){\r\n\t\t\t//pr($this->data);die;\r\n\t\t\t$this->Session->delete('AdminSearch');\r\n\t\t\tApp::import('Sanitize');\t\t\t\r\n\t\t\t$filters = array();\r\n\t\t\tif(isset($this->data['Message']['sender']) && $this->data['Message']['sender']!=''){\r\n\t\t\t\t$sender_id = Sanitize::escape($this->data['Message']['sender']);\r\n\t\t\t\t$this->Session->write('AdminSearch.sender_id', $sender_id);\t\r\n\t\t\t}\t\t\t\t\r\n\t\t\tif(isset($this->data['Message']['is_viewed']) && $this->data['Message']['is_viewed']!=''){\r\n\t\t\t\t$status = Sanitize::escape($this->data['Message']['is_viewed']);\r\n\t\t\t\t$this->Session->write('AdminSearch.is_viewed', $status);\t\r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\tif($this->Session->check('AdminSearch')){\r\n\t\t\t$keywords = $this->Session->read('AdminSearch');\t\t\r\n\t\t\tforeach($keywords as $key=>$values){\r\n\t\t\t\tif($key == 'is_viewed'){\r\n\t\t\t\t\t$filters[] = array('Message.'.$key =>$values);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t $filters[] = array('Message.'.$key.' LIKE'=>\"%\".$values.\"%\");\r\n\t\t\t\t} \r\n\t\t\t}\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t$filters[] = array('Message.receiver_id'=>$id);\r\n\t\r\n\t\t$this->paginate['Message'] = array(\r\n\t\t\t\t\t\t\t\t\t'limit'=>Configure::read('App.AdminPageLimit'), \r\n\t\t\t\t\t\t\t\t\t'order'=>array('Message.subject'=>'ASC'),\r\n\t\t\t\t\t\t\t\t\t'conditions'=>$filters\r\n\t\t\t\t\t\t\t\t\t);\r\n\t\t\r\n\t\t$data = $this->paginate('Message'); \r\n\t\t$this->set(compact('data'));\t \r\n\t\t$this->set('title_for_layout', __('Member Inbox', true));\t\t\r\n\t}", "public function index() {\n\t\t\t$this->Actionrole->Behaviors->attach( 'Occurences' );\n\n $querydata = $this->Actionrole->qdOccurencesExists(\n array(\n 'fields' => $this->Actionrole->fields(),\n 'order' => array( 'Actionrole.name ASC' )\n )\n );\n\n $this->paginate = $querydata;\n $actionroles = $this->paginate('Actionrole');\n\t\t\t$options = $this->_options();\n $this->set( compact('actionroles', 'options'));\n\t\t}", "public function getIndex()\n {\n // add stuff here\n }", "public function indexAction() {}", "public function indexAction() {}", "public function getIndex() {return $this->index;}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction() {}", "public function indexAction()\r\n {\r\n echo 'User admin index';\r\n }", "public function indexAction() \n\t\t{\n\t\t\t$this->requireUserType(array(CT_User::Directie));\n\t\t\t$this->lijstAction();\n\t\t}", "public function admincp_index(){\n\t\tpermission_force_check('r');\n\t\t$default_func = 'created';\n\t\t$default_sort = 'DESC';\n\t\t$data = array(\n\t\t\t'module'=>$this->module,\n\t\t\t'module_name'=>$this->session->userdata('Name_Module'),\n\t\t\t'default_func'=>$default_func,\n\t\t\t'default_sort'=>$default_sort\n\t\t);\n\t\t$this->template->write_view('content','BACKEND/index',$data);\n\t\t$this->template->render();\n\t}", "abstract public function index($item);", "public function singleIndexAction() {}", "public function actionIndex()\r\n {\r\n \treturn $this->render('index');\r\n }", "public function actionIndex()\n {\n \t$query = Dict::find()->where(['parent_id'=>0]);\n \t\n \t$locals = LuLu::getPagedRows($query);\n \t \n \treturn $this->render('index', $locals);\n }", "public function indexAction() {\n\t\t$this->_helper->redirector ( 'list', 'invoices', 'admin' );\n\t}" ]
[ "0.59713703", "0.5704445", "0.5646748", "0.5646748", "0.5646748", "0.56297004", "0.56200343", "0.5616682", "0.5600901", "0.5595002", "0.5569989", "0.5569989", "0.5569989", "0.5569738", "0.5569738", "0.5569738", "0.55689925", "0.55675757", "0.5567477", "0.5567477", "0.55635005", "0.55604416", "0.5559771", "0.542195", "0.54113096", "0.5390771", "0.5387868", "0.5364607", "0.5353052", "0.53512657", "0.534328", "0.5304844", "0.5304844", "0.5300406", "0.528004", "0.52642596", "0.5237357", "0.5225553", "0.5222561", "0.5221813", "0.5200542", "0.5200163", "0.51752794", "0.51752794", "0.5154437", "0.51414794", "0.51414794", "0.5134438", "0.51222134", "0.51210344", "0.51198274", "0.51076126", "0.5096076", "0.5093267", "0.5092421", "0.5089681", "0.50879157", "0.5079827", "0.5075207", "0.5070716", "0.50675416", "0.50636274", "0.50630206", "0.50545955", "0.50519556", "0.5045258", "0.5042746", "0.50418925", "0.5038494", "0.5036507", "0.5027686", "0.50255674", "0.5021759", "0.5014153", "0.50107366", "0.49964377", "0.4983892", "0.4983758", "0.49786812", "0.49782273", "0.49676794", "0.49589553", "0.49583843", "0.49581826", "0.4958169", "0.4958169", "0.4958169", "0.4958169", "0.4958169", "0.4958169", "0.4958169", "0.4958169", "0.4958169", "0.4954002", "0.4942922", "0.49428722", "0.49427935", "0.49312726", "0.4929185", "0.49254155", "0.49249074" ]
0.0
-1
actionid: indexbywr2 actiondesc: Display index of izin for vice rector 2
public function actionIndexByWr2(){ $searchModel = new PermohonanIzinSearch(); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('indexByWr2',[ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getIndex() ;", "abstract protected function getIndex();", "public function getSortIndex();", "public function getIndex();", "public function getIndex();", "public function getIndex();", "public function getNestedRightIndex();", "function isIndexed() ;", "abstract public function doIndex($item);", "function get_index()\r\n\t{\r\n\r\n\t}", "function calculateIDX(){\r\n\t\t$out=array(-1,-1,-1);\r\n\t\t$out[0]=number_format($this->_calcScoreIndex(),2,'.','');\r\n\t\t$out[1]=number_format($this->_calcCheckIndex(),2,'.','');\r\n\t\t// only sum up if both values are positive , else just scoreIDX\r\n\t\tif ($out[0]>0){\r\n\t\t\t$out[2]=$out[0];\r\n\t\t\tif ($out[1]>0){$out[2]=$out[2]+$out[1];}\r\n\t\t}\r\n\t\treturn $out;\r\n\t}", "public function getIndexEnd();", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function getIndex() {}", "public function thruIndex() {\n\t\treturn $this->thru > 0 ? $this->thru - 1 : 0;\n\t}", "function ST_indexR($ST_h, $ST_v, $ST_w) {\n\t$i = $ST_v[$ST_w];\n\t/* echo(\"<br> ST_indexR: i=$i\"); */\n\tif ($ST_h == 0) $ST_h = new ST_node($i);\n\t/* echo(\"<br> h->index: $ST_h->index, d: $ST_h->d, l: $ST_h->l, m: $ST_h->m, r: $ST_h->r \"); */\n\tif ($i == 0) {\n\t\tif ($ST_h->index == -1) $ST_h->index = $this->ST_N++;\n\t\t$this->ST_val = $ST_h->index;\n\t\treturn $ST_h;\n\t\t}\n\tif ($i < $ST_h->d) $ST_h->l = $this->ST_indexR($ST_h->l, $ST_v, $ST_w);\n\tif ($i == $ST_h->d) $ST_h->m = $this->ST_indexR($ST_h->m, $ST_v, $ST_w+1);\n\tif ($i > $ST_h->d) $ST_h->r = $this->ST_indexR($ST_h->r, $ST_v, $ST_w);\n\treturn $ST_h;\n\t}", "function indexAction(){\n \t}", "abstract function indexAction();", "public function indexSeparate() {\n if ($this->_m_indexSeparate !== null)\n return $this->_m_indexSeparate;\n if ($this->isIndexSeparate()) {\n $this->_m_indexSeparate = ($this->indexSeparateMinus() + 176);\n }\n return $this->_m_indexSeparate;\n }", "public function isIndex();", "function indexAction(){\r\n }", "public function getModelIndex();", "abstract public function actionIndex();", "function putIndex(){\n\n }", "function putIndex(){\n\n }", "private function _index_tags() {\n $s = $nix = $ix = self::$_ar_;\n $ids = $this->ids;\n foreach($this->tags as $id => $n) {\n if(!isset($ix[$n])) $ix[$n] = array();\n $ix[$n][$id] = $ids[$id];\n }\n foreach($ix as $n => $v) {\n foreach($v as $id => $e) $this->tags[$id] = $n;\n if(isset($nix[$n])) continue;\n $_n = strtolower($n);\n if(!isset($nix[$_n])) $nix[$_n] = $v;\n else {\n foreach($v as $id => $e) $nix[$_n][$id] = $e;\n $s[] = $_n;\n }\n }\n foreach($s as $_n) asort($nix[$_n]);\n return $this->tag_idx = $nix;\n }", "public function getHashIndex();", "public function func_refindex() {}", "public function fetch_for_index_right(){\n\n\t$return_right = array();\n\n\t\t$sql = $this->query(\"SELECT * FROM `add_images` WHERE `id` = 5\");\n\t\t$return_right = mysql_fetch_assoc($sql);\n\n\t\t\treturn $return_right;\n\t\n\t}", "public function getIndexStart();", "function get_index($i, $j, $blocks = 3, $elems = 3) {\n\t$bits = [\n\t\t($j % $elems), // across within block (across elems)\n\t\t((int) floor($j / $elems) * $blocks * $elems), // down within block (down elems)\n\t\t(($i % $blocks) * $elems), // across blocks\n\t\t((int) floor($i / $blocks) * $blocks * $elems * $elems), // down blocks\n ];\n\n\treturn array_sum($bits);\n}", "public function buildIndex();", "function _toIndex()\n {\n return '';\n }", "public function getStartIndex();", "function _getsortby($idx) {\n\tswitch ((int)$idx) {\n\t\tcase 1:\t$idx = 6; break;\n\t\tcase 3:\t$idx = 2; break;\n\t\tcase 4:\t$idx = 3; break;\n\t\tcase 5:\t$idx = 12; break;\n\t\tcase 6:\t$idx = 8; break;\n\t\tcase 7:\t$idx = 9; break;\n\t\tcase 10:\t$idx = 4; break;\n\t\tcase 11:\t$idx = 5; break;\n\t\tdefault: $idx = 6;\n\t}\n\treturn $idx;\n}", "public function isIndexed() {}", "public function isIndexed() {}", "public function isIndexed() {}", "public function indexSeparateMinus() { return $this->_m_indexSeparateMinus; }", "public function _INDEX()\n\t{\n\t\t\n\t}", "abstract public function getNextIndex();", "function indexInfo( $table, $index, $fname = __METHOD__ );", "public function key(){\n return $this->index;\n }", "public function restarIndice($index){\n return intval($index)-1;\n }", "public function action_index()\n\t{\n\t}", "function yy_r127(){\n $this->_retvalue = new Stmt\\Expr('INDEX', $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + 0]->minor);\n }", "function key()\n\t{\n\t\treturn $this->index;\n\t}", "public function indexInTag() {\n if ($this->_m_indexInTag !== null)\n return $this->_m_indexInTag;\n $this->_m_indexInTag = ($this->tag() - 32);\n return $this->_m_indexInTag;\n }", "function get(array &$grid, int $rowIndex, int $columnIndex): int {//tiene\n \n return $grid[$rowIndex][$columnIndex]; \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}", "public function getChildrenRelationIndex();", "public function action_index()\n {\n }", "public function getSearchIndex();", "function sortByIndex($a, $b) {\n\t\t return $a->zindex - $b->zindex;\n\t\t}", "public function actionIndex($p) { }", "public function getPaymentIndex();", "function mmrpg_action_sort_switch($info1, $info2){\n if ($info1['robot_position'] == 'active'){ return -1; }\n elseif ($info2['robot_position'] == 'active'){ return 1; }\n elseif ($info1['robot_key'] < $info2['robot_key']){ return -1; }\n elseif ($info1['robot_key'] > $info2['robot_key']){ return 1; }\n else { return 0; }\n }", "function SideNavIndex()\n {\n return 1;\n }", "function get_table_indexes($db, $table, $cnx='', $reload=false, $mode='mysql'){\n\tif($mode!=='mysql') exit('only mysql index mode developed');\n\tglobal $get_table_indexes, $dbTypeArray;\n\tif(!$cnx)$cnx=C_MASTER;\n\tif($get_table_indexes[$db][$table] && !$reload){\n\t\treturn $get_table_indexes[$db][$table];\n\t}else{\n\t\t$fl=__FILE__;\n\t\t$ln=__LINE__+1;\n\t\tob_start();\n\t\t$result=q(\"SHOW INDEXES FROM `$db`.`$table`\", $cnx, ERR_ECHO, O_DO_NOT_REMEDIATE);\n\t\t$err=ob_get_contents();\n\t\tob_end_clean();\n\t\tif($err)return false;\n\t\t\n\t\t$typeFlip = array_flip($dbTypeArray);\n\t\t$inCompound=false;\n\t\twhile($v=mysqli_fetch_array($result,MYSQLI_ASSOC)){\n\t\t\t$w++;\n\t\t\t@extract($v);\n\t\t\tif($buffer==$Key_name){\n\t\t\t\t//duplicate part of a key\n\t\t\t\tif(!$inCompound){\n\t\t\t\t\t$multiIdx[$Key_name][]=$singleIdx[count($singleIdx)-1];\n\t\t\t\t\tunset($singleIdx[count($singleIdx)-1]);\n\t\t\t\t\t//next two lines overcome \"bug\" in php: just cause I unset the highest element, this will not reset the next index assigned when I say $singleIdx[]=.. later on.\n\t\t\t\t\t$clr=$singleIdx;\n\t\t\t\t\t$singleIdx=$clr;\n\t\t\t\t}\n\t\t\t\t$multiIdx[$Key_name][]=$v;\n\t\t\t\t$inCompound=true;\n\t\t\t}else{\n\t\t\t\t$singleIdx[]=$v;\n\t\t\t\t$buffer=$Key_name;\n\t\t\t\t$inCompound=false;\n\t\t\t}\n\t\t}\n\t\t//set $singleIdx as assoc for reference\n\t\tif(count($singleIdx)){\n\t\t\tforeach($singleIdx as $v) $a[strtolower($v['Column_name'])]=$v;\n\t\t\t$singleIdx=$a;\n\t\t}\n\t\t//store compound keys as XML\n\t\tif($multiIdx){\n\t\t\t$compoundKey='';\n\t\t\tforeach($multiIdx as $n=>$v){\n\t\t\t\t$ci.='<compoundKey Key_name=\"'.$n.'\" Column_count=\"'.count($v).'\"';\n\t\t\t\t$i=0;\n\t\t\t\tforeach($v as $w){\n\t\t\t\t\t$i++;\n\t\t\t\t\tif($i==1)$ci.=' Non_unique=\"'.$w['Non_unique'].'\">'.\"\\n\";\n\t\t\t\t\t$ci.='<keyColumn Seq_in_index=\"'.$w['Seq_in_index'].'\" Column_name=\"'.$w['Column_name'].'\" Sub_part=\"'.$w['Sub_part'].'\" Comment=\"'.htmlentities($w['Comment']).'\">'.\"\\n\";\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$ci.='</compoundKey>';\n\t\t\t}\n\t\t}\n\t\t$get_table_indexes[$db][$table]=array('singleIdx'=>$singleIdx, 'multiIdx'=>$multiIdx, 'compoundXML'=>$ci);\n\t\treturn $get_table_indexes[$db][$table];\n\t}\n}", "public function index() {\n if ($this->_m_index !== null)\n return $this->_m_index;\n $this->_m_index = ($this->isIndexSeparate() ? $this->indexSeparate() : $this->indexInTag());\n return $this->_m_index;\n }", "public function indexPerLevelAction() {\n\n }", "function readItemIndex() {return $this->_itemindex;}", "public function getNestedLeftIndex();", "public function hook_row_index($column_index,&$column_value) {\t \n\t \t//Your code here\n\t }", "public function hook_row_index($column_index,&$column_value) {\t \n\t \t//Your code here\n\t }", "public function hook_row_index($column_index,&$column_value) {\t \n\t \t//Your code here\n\t }", "function &getTableIndexList($moduleID)\n{\n $mdb2 =& GetMDB2();\n $mdb2->loadModule('Manager');\n $mdb2->loadModule('Reverse', null, true);\n\n //get both table constraints and indexes\n static $indexes = array();\n\n if(!isset($indexes[$moduleID])){\n //unique indexes\n $temp_raw_indexes = $mdb2->manager->listTableConstraints($moduleID);\n mdb2ErrorCheck($temp_raw_indexes);\n $temp_indexes = array();\n foreach($temp_raw_indexes as $index_name){\n //if('PRIMARY' != $index_name){\n $temp_indexes[$index_name] = true;\n //}\n }\n\n //non-unique indexes\n $temp_raw_indexes = $mdb2->manager->listTableIndexes($moduleID);\n mdb2ErrorCheck($temp_raw_indexes);\n foreach($temp_raw_indexes as $index_name){\n $temp_indexes[$index_name] = false;\n }\n\n $indexes[$moduleID] = $temp_indexes;\n }\n\n return $indexes[$moduleID];\n}", "public function getInkList($index) {}", "function xstats_getShipOwnerIndexAtTurn( $gameId, $shipId, $turn ) {\n $query = \"SELECT ownerindex FROM skrupel_xstats_shipowner WHERE gameid=\".$gameId.\" AND shipid=\".$shipId.\" AND turn=\".$turn;\n $result = @mysql_query($query) or die(mysql_error());\n if( mysql_num_rows($result)>0 ) {\n $result = @mysql_fetch_array($result);\n return( $result['ownerindex']);\n }\n}", "function getIndex()\n {\n if (empty($this->code)) return NULL;\n return $this->code.'-'.$this->customer_id;\n }", "public function indexAction()\n {\n\n return parent::indexAction();\n\n\n }", "public function key()\n\t{\n\t\treturn $this->index;\n\t}", "public function key()\n\t{\n\t\treturn $this->index;\n\t}", "function get_status($column, $sub_column, $sub_columns) {\n $index = array_search($sub_column, $sub_columns);\n\r\n return ($column[$index]) ? 'ok icon-green' : 'remove icon-red';\n}", "public function SideNavIndex()\n {\n return 3;\n }", "function _idx_order( $pos )\n\t{\n\t\t$elements = array( \n\t\t\t\t\t\t\t'gallery_img_order_username',\n\t\t\t\t\t\t\t'gallery_img_order_date',\n\t\t\t\t\t\t\t'gallery_img_order_size',\n\t\t\t\t\t\t\t'gallery_img_order_comment', \n\t\t\t\t\t\t\t'gallery_img_order_view',\n\t\t\t\t\t\t\t'gallery_img_order_rating',\n\t\t\t\t\t\t);\n\n\t\tforeach( $elements as $element )\n\t\t{\n\t\t\tif( $this->ipsclass->vars[$element] == $pos )\n\t\t\t{\n\t\t\t\treturn $element;\n\t\t\t}\n\t\t}\n\t}", "function elementfinder($list1, $element){ \n $comparator=0; //container for the element at a particular index to be compared with the element to be found to be found\n $locator=0; \n $indexes=\"occuring at index(ices): \"; // gives the container for the number of timed the element was located\n $listlength=count($list1)-1; //efffective largest index of the given list\n \n for($i=0; $i<=$listlength;$i++){ //step through the list\n$comparator=$list1[$i]; //get the element at the current index\n/**if this element equals the element to be found, then upgrade the number of times the element has been found(that is the locator variable)and add the index it was found to the index variable */\nif($element==$comparator){\n $locator=$locator+1;\n $indexes=$indexes.$i. \" \";\n}\n }\n /** print out result and the given list operated upon */\n echo \"given the list: \"; print_r($list1); echo \"<br>\";\n echo $locator.\" matches found \";\n echo $indexes;\n return $locator;\n}", "function SprWymiar($macierz){\n\t\t\t$wymiar=1;\n\t\t\twhile(isset($macierz[$wymiar][1])){\n\t\t\t\t$wymiar++;\n\t\t\t}\n\t\t\treturn $wymiar-1; \n\t\t}", "public function takeIndex()\n\t\t{\n\t\t\t$this->csv->takeIndexCSV();\n\t\t\t$this->txt->takeIndexTXT();\n\t\t}", "function extractByIndex($p_index)\n {\n }", "public function getIndex($name, $id) {\n foreach ($this->view->result as $item) {\n if ($item->$name == $id) {\n return $item->index;\n }\n }\n return FALSE;\n }", "public function browseNameIndex($query, $position, $entityType, $icid)\n {\n $entityQuery = \"\";\n if ($entityType != null && $entityType != \"\") {\n // Do this for safety concerns with SQL injections...\n switch ($entityType) {\n case \"person\":\n $entityQuery = \"and entity_type = 'person'\";\n break;\n case \"corporateBody\":\n $entityQuery = \"and entity_type = 'corporateBody'\";\n break;\n case \"family\":\n $entityQuery = \"and entity_type = 'family'\";\n break;\n }\n }\n\n $result = null;\n\n if ($position == \"after\") {\n $queryStr = \"select * from (select * from name_index where (name_entry = $1 and ic_id >= $2) $entityQuery order by name_entry_lower, name_entry, ic_id asc limit 20) a union all (select * from name_index where name_entry > $1 $entityQuery order by name_entry_lower, name_entry, ic_id asc limit 20) order by name_entry, ic_id asc limit 20;\";\n $result = $this->sdb->query($queryStr, array($query, $icid));\n } else if ($position == \"before\") {\n if ($icid !== 0) {\n // query using the ICID as well\n $queryStr = \"select * from (select * from (select * from name_index where (name_entry = $1 and ic_id <= $2) $entityQuery order by name_entry_lower desc, name_entry desc, ic_id desc limit 20) a union all (select * from name_index where name_entry < $1 $entityQuery order by name_entry_lower desc, name_entry desc, ic_id desc limit 20) order by name_entry desc, ic_id desc limit 20) a order by name_entry asc, ic_id asc limit 20;\";\n $result = $this->sdb->query($queryStr, array($query, $icid));\n } else {\n // query without the ICID, since it is meaningless\n $queryStr = \"select * from (select * from name_index where name_entry_lower <= lower($1) $entityQuery order by name_entry_lower desc, ic_id desc limit 20) a order by name_entry, ic_id asc;\";\n $result = $this->sdb->query($queryStr, array($query));\n }\n } else {\n $queryStr =\n \"select * from (select * from name_index where name_entry_lower >= lower($1) $entityQuery order by name_entry_lower, ic_id asc limit 10) a union all (select * from name_index where name_entry_lower < lower($1) $entityQuery order by name_entry_lower desc, ic_id desc limit 10) order by name_entry, ic_id asc;\";\n\n $result = $this->sdb->query($queryStr, array($query));\n }\n\n\n $all = array();\n while($row = $this->sdb->fetchRow($result))\n {\n array_push($all, $row);\n }\n return $all;\n }", "abstract public function index($item);", "public function getElementSortOrder();", "public function actionIndex2()\r\n\t{\r\n\t\t// calling line :\r\n\t\t/*\r\n\t\thttp://www.k-m.ru/app2/index.php?r=backend/index&Table=Assortment&_dc=1401196798272&page=1&start=0&limit=20&filter[0][field]=price&filter[0][data][type]=numeric&filter[0][data][comparison]=lt&filter[0][data][value]=5&filter[0][field]=price&filter[0][data][type]=numeric&filter[0][data][comparison]=lt&filter[0][data][value]=56&filter[1][field]=size&filter[1][data][type]=list&filter[1][data][value]=medium,large\r\n\t\t*/\r\n// filter[0][operator]=OR&filter[0][field]=title&filter[0][data][type]=string&filter[0][data][value]=ela\r\n\t\t$ModelName = $_GET['Table'];\t\t\r\n\t/*\tif (!class_exists($ModelName, false)) \r\n\t\t\treturn json_encode(array('success'=> false , 'msg'=> Yii::t('general', 'There is no such class in the system')));*/\r\n\t\t\t\r\n\t\t$table_name = 'tarex_' . strtolower($ModelName);\r\n\t\t// collect request parameters\r\n\t\t$offset = isset($_REQUEST['start']) ? $_REQUEST['start'] : 0;\r\n\t\t$limit = isset($_REQUEST['limit']) ? $_REQUEST['limit'] : 50;\r\n\t\t$sort = isset($_REQUEST['sort']) ? $_REQUEST['sort'] : '';\r\n\t\t$dir = isset($_REQUEST['dir']) ? $_REQUEST['dir'] : 'ASC';\r\n\t\t$filters = isset($_REQUEST['filter']) ? $_REQUEST['filter'] : null;\r\n\t\t\r\n\t\t// GridFilters sends filters as an Array if not json encoded\r\n\t\tif (is_array($filters)) {\r\n\t\t\t$encoded = false;\r\n\t\t} else {\r\n\t\t\t$encoded = true;\r\n\t\t\t$filters = json_decode($filters);\r\n\t\t}\r\n\t\t\r\n\t\t$where = ' 0 = 0 ';\r\n\t\t$qs = '';\r\n\r\n\t\t// loop through filters sent by client\r\n\t\tif (is_array($filters)) {\r\n\t\t\tfor ($i=0;$i<count($filters);$i++){\r\n\t\t\t\t$filter = $filters[$i];\r\n\r\n\t\t\t\t// assign filter data (location depends if encoded or not)\r\n\t\t\t\tif ($encoded) {\r\n\t\t\t\t\t$field = $filter->field;\r\n\t\t\t\t\t$value = $filter->value;\r\n\t\t\t\t\t$compare = isset($filter->comparison) ? $filter->comparison : null;\r\n\t\t\t\t\t$filterType = $filter->type;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$field = $filter['field'];\r\n\t\t\t\t\t$value = $filter['data']['value'];\r\n\t\t\t\t\t$compare = isset($filter['data']['comparison']) ? $filter['data']['comparison'] : null;\r\n\t\t\t\t\t$filterType = $filter['data']['type'];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tswitch($filterType){\r\n\t\t\t\t\tcase 'string' : $qs .= \" AND \".$field.\" LIKE '%\".$value.\"%' \"; Break;\r\n\t\t\t\t\tcase 'list' :\r\n\t\t\t\t\t\tif (strstr($value,',')){\r\n\t\t\t\t\t\t\t$fi = explode(',',$value);\r\n\t\t\t\t\t\t\tfor ($q=0;$q<count($fi);$q++){\r\n\t\t\t\t\t\t\t\t$fi[$q] = \"'\".$fi[$q].\"'\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$value = implode(',',$fi);\r\n\t\t\t\t\t\t\t$qs .= \" AND \".$field.\" IN (\".$value.\")\";\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$qs .= \" AND \".$field.\" = '\".$value.\"'\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tBreak;\r\n\t\t\t\t\tcase 'boolean' : $qs .= \" AND \".$field.\" = \".($value); Break;\r\n\t\t\t\t\tcase 'numeric' :\r\n\t\t\t\t\t\tswitch ($compare) {\r\n\t\t\t\t\t\t\tcase 'eq' : $qs .= \" AND \".$field.\" = \".$value; Break;\r\n\t\t\t\t\t\t\tcase 'lt' : $qs .= \" AND \".$field.\" < \".$value; Break;\r\n\t\t\t\t\t\t\tcase 'gt' : $qs .= \" AND \".$field.\" > \".$value; Break;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tBreak;\r\n\t\t\t\t\tcase 'date' :\r\n\t\t\t\t\t\tswitch ($compare) {\r\n\t\t\t\t\t\t\tcase 'eq' : $qs .= \" AND \".$field.\" = '\".date('Y-m-d',strtotime($value)).\"'\"; Break;\r\n\t\t\t\t\t\t\tcase 'lt' : $qs .= \" AND \".$field.\" < '\".date('Y-m-d',strtotime($value)).\"'\"; Break;\r\n\t\t\t\t\t\t\tcase 'gt' : $qs .= \" AND \".$field.\" > '\".date('Y-m-d',strtotime($value)).\"'\"; Break;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\tBreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$where .= $qs;\r\n\t\t}\r\n\t\t\r\n\t\t$query = \"SELECT * FROM {$table_name} WHERE \" . $where;\r\n\t\t/// \"SELECT COUNT(id) FROM demo WHERE \".$where\r\n\t\t$sql = \"SELECT COUNT(*) FROM {$table_name} WHERE \" . $where;\r\n\t\theader('Content-type:text/html; charset=utf-8');\r\n\t\techo '$sql=', $sql, '<br>';\r\n\t\t$data_count = Yii::app()->db->createCommand($sql)->queryScalar();\r\n\t\t//$data_count = CActiveRecord::model($ModelName)->count($criteria);\r\n\t\techo '$sql count = ' , $data_count, '<br>';\r\n\t\t\r\n\t\t// добавление сортировки и ограничений на вывод\r\n\t\tif ($sort != \"\") {\r\n\t\t\t$query .= \" ORDER BY \".$sort.\" \".$dir;\r\n\t\t}\t\t\r\n\t\t//$query .= \" LIMIT \".$offset.\",\".$limit;\r\n\t\t\r\n\t\t//echo 'запрос с сортировкой и ограничением на вывод: $query = ', $query, '<br><br>'; // показ окончательного запроса\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t$criteria = new CDbCriteria;\t \r\n\t\t//$data_count = CActiveRecord::model($ModelName)->count($criteria); \r\n\t\t\r\n\t\t//$criteria->addCondition( $filter['']) \r\n\t\t//$criteria->select = array('id', 'oem', 'article', 'title', 'make');\r\n\t\t\r\n\t\t// добавляем параметры постраничного вывода\r\n\t\t\r\n\t\t/*\r\n\t\t$criteria->limit = $_GET['limit'] ? $_GET['limit'] : 20; //echo \"Limit = \", $_GET['limit'];\r\n\t\t$criteria->offset = $_GET['start'] ? $_GET['start'] : 0; \r\n\t\t*/\r\n\t\t\r\n\t\t//echo '$criteria = '; print_r($criteria->toArray()); echo '<br/>';\r\n\t\t//$data = CActiveRecord::model($ModelName)->findAll($criteria); \r\n\t\t$data = CActiveRecord::model($ModelName)->findAllBySql($query); \r\n\t\t\r\n\t//\tprint_r($data);\r\n\t\t\r\n\t\t//$table_name='yiiapp_'.$Table; \r\n\r\n\t\t//$variable = 'MainMenu'; \r\n\t\t//$TestData = $variable::model()->findAll(); // since 5.3\r\n\t\t\r\n\t\t/*\r\n\t\t$criteria=new CDbCriteria(array(\r\n\t\t'select'=>'t.*,count(j.*)',\r\n\t\t'join'=>'left join CountTbl j on condition',\r\n\t\t'order'=>'count(j.*)',\r\n\t\t))\r\n\r\n\t\t$criteria->condition='id=:id AND login=:login';\r\n\t\t$criteria->params=array(':id'=>5, ':login' => 'test'); // задаем параметры\r\n*/\r\n\t\t$new = array();\r\n\t foreach($data as $r) \r\n\t\t{\t\t \r\n\t\t\t/*$res['id']=$r['id'];\t\r\n\t\t\t$res['title']=$r['title'];\t\r\n\t\t\t$res['oem']=$r['oem'];\t\t\t\t\r\n\t\t\t$res['article']=$r['title'];\t\r\n\t\t\t$res['make']=$r['make'];\t*/\r\n\t\t\tforeach($r as $key => $value)\r\n\t\t\t{\r\n\t\t\t\t$res[$key] = $value;\r\n\t\t\t}\r\n\t\t\t$new[] = $res;\r\n\t\t} \r\n\t\t $result = array(\r\n\t\t\t'success'=>true,\r\n\t\t\t'data' => $new,\r\n\t\t\t'count' => $data_count //sizeof($new)\r\n\t\t );\r\n\t\t//echo 'TestData '.$TestData;\r\n\t\tprint_r(json_encode($result)); \r\n\t\t\r\n\t\t\r\n\t}", "static private function selectIndex($dataCodeWordsCount, $rectangular){\n if (($dataCodeWordsCount<1 || $dataCodeWordsCount>1558) && !$rectangular) return -1;\n if (($dataCodeWordsCount<1 || $dataCodeWordsCount>49) && $rectangular) return -1;\n \n $n = $rectangular ? 24 : 0;\n \n while (self::$dataCWCount[$n] < $dataCodeWordsCount) $n++;\n return $n;\n }", "function key() {\r\n return $this->i >= 0 ? $this->i : NULL;\r\n }", "function getIndicesImpact($list_agence) {\n\n global $dbHandler,$global_id_agence;\n $db = $dbHandler->openConnection();\n $DATA['general']['nombre_moyen_gs']=0;\n $DATA['clients']['pp'] = 0;\n $DATA['clients']['homme'] = 0;\n $DATA['clients']['femme'] = 0;\n $DATA['clients']['pm'] = 0;\n $DATA['clients']['gi'] = 0;\n $DATA['clients']['gs'] = 0;\n $DATA['clients']['total']=0;\n $DATA['epargnants']['pp'] = 0;\n $DATA['epargnants']['homme'] = 0;\n $DATA['epargnants']['femme'] = 0;\n $DATA['epargnants']['pm'] = 0;\n $DATA['epargnants']['gi'] = 0;\n $DATA['epargnants']['gs'] = 0;\n $DATA['epargnants']['total']=0;\n $DATA['emprunteurs']['pp'] = 0;\n $DATA['emprunteurs']['homme'] = 0;\n $DATA['emprunteurs']['femme'] = 0;\n $DATA['emprunteurs']['pm'] = 0;\n $DATA['emprunteurs']['gi'] = 0;\n $DATA['emprunteurs']['gs'] = 0;\n $DATA['general']['total_membre_empr_gi'] = 0;\n $DATA['general']['total_membre_empr_gs'] = 0;\n $DATA['general']['nombre_moyen_gi'] =0;\n $DATA['general']['nombre_moyen_gs'] =0;\n $DATA['general']['gi_nbre_membre'] =0;\n $DATA['general']['gs_nbre_membre'] =0;\n $DATA['general']['gs_nbre_hommes'] =0;\n $DATA['general']['gs_nbre_femmes'] =0;\n $nb_agence=0;\n foreach($list_agence as $key_id_ag =>$value) {\n //Parcours des agences\n setGlobalIdAgence($key_id_ag);\n $nb_agence++;\n // Nombre de clients\n $sql = \"SELECT statut_juridique, pp_sexe, count(id_client) FROM ad_cli WHERE id_ag=$global_id_agence AND etat = 2 GROUP BY statut_juridique, pp_sexe\";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n\n while ($row = $result->fetchrow(DB_FETCHMODE_ASSOC)) {\n if ($row['statut_juridique'] == 2) {\n $DATA['clients']['pm'] += $row['count'];\n }\n elseif ($row['statut_juridique'] == 3) {\n $DATA['clients']['gi'] += $row['count'];\n }\n elseif ($row['statut_juridique'] == 4) {\n $DATA['clients']['gs'] += $row['count'];\n }\n elseif ($row['pp_sexe'] == 1) {\n $DATA['clients']['homme'] += $row['count'];\n }\n elseif ($row['pp_sexe'] == 2) {\n $DATA['clients']['femme'] += $row['count'];\n }\n }\n\n $DATA['clients']['pp'] += $DATA['clients']['homme'] + $DATA['clients']['femme'];\n $DATA['clients']['total'] += $DATA['clients']['pp'] + $DATA['clients']['pm'] + $DATA['clients']['gi'] + $DATA['clients']['gs'];\n\n if ($DATA['clients']['pp'] == 0) {\n $DATA['clients']['pourcentage_homme'] = 0;\n $DATA['clients']['pourcentage_femme'] = 0;\n } else {\n $DATA['clients']['pourcentage_homme'] = $DATA['clients']['homme'] / $DATA['clients']['pp'];\n $DATA['clients']['pourcentage_femme'] = $DATA['clients']['femme'] / $DATA['clients']['pp'];\n }\n\n // Nombre d'épargnants\n $sql = \"SELECT statut_juridique, pp_sexe, count(id_client) FROM ad_cli WHERE id_ag=$global_id_agence AND (SELECT count(*) FROM ad_cpt WHERE id_ag=$global_id_agence AND id_client = id_titulaire AND id_prod <> 2 AND id_prod <> 3 AND solde <> 0) > 0 GROUP BY statut_juridique, pp_sexe\";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n\n while ($row = $result->fetchrow(DB_FETCHMODE_ASSOC)) {\n if ($row['statut_juridique'] == 2) {\n $DATA['epargnants']['pm'] += $row['count'];\n }\n elseif ($row['statut_juridique'] == 3) {\n $DATA['epargnants']['gi'] += $row['count'];\n }\n elseif ($row['statut_juridique'] == 4) {\n $DATA['epargnants']['gs'] += $row['count'];\n }\n elseif ($row['pp_sexe'] == 1) {\n $DATA['epargnants']['homme'] += $row['count'];\n }\n elseif ($row['pp_sexe'] == 2) {\n $DATA['epargnants']['femme'] += $row['count'];\n }\n }\n\n $DATA['epargnants']['pp'] += $DATA['epargnants']['homme'] + $DATA['epargnants']['femme'];\n $DATA['epargnants']['total'] += $DATA['epargnants']['pp'] + $DATA['epargnants']['pm'] + $DATA['epargnants']['gi'] + $DATA['epargnants']['gs'];\n\n if ($DATA['epargnants']['pp'] == 0) {\n $DATA['epargnants']['pourcentage_homme'] = 0;\n $DATA['epargnants']['pourcentage_femme'] = 0;\n } else {\n $DATA['epargnants']['pourcentage_homme'] = $DATA['epargnants']['homme'] / $DATA['epargnants']['pp'];\n $DATA['epargnants']['pourcentage_femme'] = $DATA['epargnants']['femme'] / $DATA['epargnants']['pp'];\n }\n\n\n // Nombre d'emprunteurs\n $sql = \"SELECT statut_juridique, pp_sexe, count(ad_cli.id_client) FROM ad_cli, ad_dcr WHERE ad_cli.id_ag=$global_id_agence AND ad_cli.id_ag=ad_dcr.id_ag AND ad_cli.id_client = ad_dcr.id_client AND (ad_dcr.etat = 5 OR ad_dcr.etat = 7 OR ad_dcr.etat = 13 OR ad_dcr.etat = 14 OR ad_dcr.etat = 15) GROUP BY statut_juridique, pp_sexe\";\n\n $result = $db->query($sql);\n if (DB :: isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n\n while ($row = $result->fetchrow(DB_FETCHMODE_ASSOC)) {\n if ($row['statut_juridique'] == 2) {\n $DATA['emprunteurs']['pm'] += $row['count'];\n }\n elseif ($row['statut_juridique'] == 3) {\n $DATA['emprunteurs']['gi'] += $row['count'];\n }\n elseif ($row['statut_juridique'] == 4) {\n $DATA['emprunteurs']['gs'] += $row['count'];\n }\n elseif ($row['pp_sexe'] == 1) {\n $DATA['emprunteurs']['homme'] += $row['count'];\n }\n elseif ($row['pp_sexe'] == 2) {\n $DATA['emprunteurs']['femme'] += $row['count'];\n }\n }\n\n $DATA['emprunteurs']['pp'] += $DATA['emprunteurs']['homme'] + $DATA['emprunteurs']['femme'];\n $DATA['emprunteurs']['total'] += $DATA['emprunteurs']['pp'] + $DATA['emprunteurs']['pm'] + $DATA['emprunteurs']['gi'] + $DATA['emprunteurs']['gs'];\n\n if ($DATA['emprunteurs']['pp'] == 0) {\n $DATA['emprunteurs']['pourcentage_homme'] = 0;\n $DATA['emprunteurs']['pourcentage_femme'] = 0;\n } else {\n $DATA['emprunteurs']['pourcentage_homme'] = $DATA['emprunteurs']['homme'] / $DATA['emprunteurs']['pp'];\n $DATA['emprunteurs']['pourcentage_femme'] = $DATA['emprunteurs']['femme'] / $DATA['emprunteurs']['pp'];\n }\n\n // Nombre total de membres emprunteurs par groupe informel\n $sql = \"SELECT SUM(ad_cli.gi_nbre_membr) FROM ad_cli, ad_dcr WHERE ad_cli.id_ag=$global_id_agence AND ad_cli.id_ag=ad_dcr.id_ag AND ad_cli.id_client = ad_dcr.id_client AND (ad_dcr.etat = 5 OR ad_dcr.etat = 7 OR ad_dcr.etat = 13 OR ad_dcr.etat = 14 OR ad_dcr.etat = 15) AND ad_cli.statut_juridique = 3\";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n $row = $result->fetchrow();\n $DATA['general']['total_membre_empr_gi'] += round($row[0]);\n\n // Nombre total de membres emprunteurs par groupe solidaire\n $sql = \"SELECT SUM(ad_cli.gi_nbre_membr) FROM ad_cli, ad_dcr WHERE ad_cli.id_ag=$global_id_agence AND ad_cli.id_ag=ad_dcr.id_ag AND ad_cli.id_client = ad_dcr.id_client AND (ad_dcr.etat = 5 OR ad_dcr.etat = 7 OR ad_dcr.etat = 13 OR ad_dcr.etat = 14 OR ad_dcr.etat = 15) AND ad_cli.statut_juridique = 4\";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n $row = $result->fetchrow();\n $DATA['general']['total_membre_empr_gs'] += round($row[0]);\n\n // Nombre total d'hommes groupe solidaire\n $sql = \"SELECT count(*) FROM ad_grp_sol,ad_cli where id_client=id_membre AND pp_sexe= 1 \";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n $row = $result->fetchrow();\n $DATA['general']['total_homme_gs'] = round($row[0]);\n // Nombre total de femmes groupe solidaire\n $sql = \"SELECT count(*) FROM ad_grp_sol,ad_cli where id_client=id_membre AND pp_sexe= 2 \";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n $row = $result->fetchrow();\n $DATA['general']['total_femme_gs'] = round($row[0]);\n\n // Nombre moyen de membres par groupe informel\n $sql = \"SELECT AVG(ad_cli.gi_nbre_membr) FROM ad_cli, ad_dcr WHERE ad_cli.id_ag=$global_id_agence AND ad_cli.id_ag=ad_dcr.id_ag AND ad_cli.id_client = ad_dcr.id_client AND (ad_dcr.etat = 5 OR ad_dcr.etat = 7 OR ad_dcr.etat = 13 OR ad_dcr.etat = 14 OR ad_dcr.etat = 15) AND ad_cli.statut_juridique = 3\";\n\n $result = $db->query($sql);\n if (DB::isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n $row = $result->fetchrow();\n $DATA['general']['nombre_moyen_gi'] += round($row[0]);\n\n // Nombre moyen de membres par groupe solidaire\n $sql = \"SELECT AVG(ad_cli.gi_nbre_membr) FROM ad_cli, ad_dcr WHERE ad_cli.id_ag=$global_id_agence AND ad_cli.id_ag=ad_dcr.id_ag AND ad_cli.id_client = ad_dcr.id_client AND (ad_dcr.etat = 5 OR ad_dcr.etat = 7 OR ad_dcr.etat = 13 OR ad_dcr.etat = 14 OR ad_dcr.etat = 15) AND ad_cli.statut_juridique = 4\";\n\n $result = $db->query($sql);\n if (DB :: isError($result)) {\n $dbHandler->closeConnection(false);\n signalErreur(__FILE__, __LINE__, __FUNCTION__);\n }\n $row = $result->fetchrow();\n $DATA['general']['nombre_moyen_gs'] += round($row[0]);\n }\n $DATA['general']['nombre_moyen_gi']=$DATA['general']['nombre_moyen_gi']/$nb_agence;\n $DATA['general']['nombre_moyen_gs']=$DATA['general']['nombre_moyen_gs']/$nb_agence;\n $dbHandler->closeConnection(true);\n return $DATA;\n}", "public function getIndex() {return $this->index;}", "function get_key($arr, $action, $param1, $param2){\n\t\tif(is_array($arr)){\n\t\t\tforeach($arr as $key => $row){\n\t\t\t\tif ($row->action == $action and\n\t\t\t\t\t$row->param1 == $param1 and\n\t\t\t\t\t$row->param2 == $param2)\n\t\t\t\t\treturn $key;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public static function getActionFunction()\n\t{\n\t\t$params = self::getAllURLParams();\n\t\t$pos = contrlPos + 1;\n\t\treturn (!empty($params[$pos])) ? $params[$pos] : 'index';\n\t}", "protected function buildCommandsIndex() {}", "function _compareActions($a,$b){\n\t\tif ( @$a['order'] < @$b['order'] ) return -1;\n\t\telse return 1;\n\t}" ]
[ "0.6722247", "0.60025424", "0.57566136", "0.5741942", "0.5741942", "0.5741942", "0.5549992", "0.5451458", "0.5359796", "0.5356476", "0.5354035", "0.5330779", "0.5241819", "0.5241819", "0.5241819", "0.5241622", "0.5241622", "0.5241622", "0.52409625", "0.52384824", "0.52384824", "0.5198611", "0.51613885", "0.51590353", "0.50967723", "0.5076241", "0.50718564", "0.50715303", "0.50183916", "0.5015693", "0.5014012", "0.5014012", "0.5004568", "0.5002269", "0.49962893", "0.49929273", "0.497164", "0.49632975", "0.4941499", "0.49348772", "0.49312842", "0.48737448", "0.48690826", "0.48688918", "0.48685986", "0.4851737", "0.48352307", "0.48304516", "0.48065147", "0.47941762", "0.476776", "0.4758352", "0.4757621", "0.47541016", "0.47482255", "0.4725462", "0.47025502", "0.47017673", "0.4694687", "0.46882182", "0.46811533", "0.46727496", "0.46709394", "0.46546617", "0.46544743", "0.4650851", "0.46435612", "0.46417785", "0.46343568", "0.46250743", "0.462411", "0.462411", "0.462411", "0.4620077", "0.46085662", "0.46038583", "0.45991376", "0.45779836", "0.45773596", "0.45773596", "0.45597303", "0.45440066", "0.4541775", "0.4540733", "0.45402896", "0.45369345", "0.45348173", "0.45328024", "0.45326665", "0.4532422", "0.4525061", "0.45222843", "0.45203155", "0.45169643", "0.4514297", "0.45132053", "0.451105", "0.45027447", "0.44878986", "0.4478532" ]
0.5449608
8
actionid: viewbystaf actiondesc: Display detail view of izin for staf
public function actionViewByStaf($id){ return $this->render('viewByStaf',[ 'model' => $this->findModel($id), ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function viewAction(){\r\n\t\t//$iUnitId = Sys_Publib_Library::_getItemAttrById($_SESSION['arr_all_staff'],$_SESSION['staff_id'],'unit_id');\r\n\t\t//Lay ID phong ban cua NSD dang nhap hien thoi\r\n\t\t$pUrl = $_SERVER['REQUEST_URI'];\r\n\t\t$objFunction =\tnew\tSys_Function_DocFunctions()\t;\r\n\t\t$objFilter = new Zend_Filter();\t\t\t\r\n\t\t// Tieu de man hinh danh sach\r\n\t\t$this->view->docInfo \t\t= \"THÔNG TIN VĂN BẢN\";\r\n\t\t$sDocumentId = $this->_request->getParam('hdn_object_id','');\r\n\t\t$sType\t\t = $this->_request->getParam('hdn_type','');\r\n\t\t//Lay cac hang so dung chung\r\n\t\t$arrConst = Sys_Init_Config::_setProjectPublicConst();\r\n\t\t$this->view->arrConst = $arrConst;\r\n\t\t// Tao doi tuong Zend_Filter\r\n\t\t$objFilter = new Zend_Filter();\r\n\t\t$ojbSysLib = new Sys_Library();\r\n\t\t$objFullTextSearch = new fulltextsearch_modFulltextsearch();\r\n\t\t//Lay thong tin trong danh muc\r\n\t\t$arrDocSingle = $objFullTextSearch->DocFullTextSearchDocGetSingle($sDocumentId, $sType);\t\t\t\r\n\t\t$this->view->arrDocSingle = $arrDocSingle;\r\n\t\t//Lay gia tri tim kiem tren form\r\n\t\t\t$sfullTextSearch \t= $this->_request->getParam('txtfullTextSearch','');\r\n\t\t\t$iYear\t \t\t\t= $this->_request->getParam('year','');\r\n\t\t\t$iCurrentPage\t\t= $this->_request->getParam('hdn_current_page',0);\t\r\n\t\t\tif ($iCurrentPage <= 1){\r\n\t\t\t\t$iCurrentPage = 1;\r\n\t\t\t}\r\n\t\t\t$iNumRowOnPage = $this->_request->getParam('cbo_nuber_record_page',0);\r\n\t\t\tif ($iNumRowOnPage == 0)\r\n\t\t\t\t$iNumRowOnPage = 15;\r\n\t\t\t$arrParaSet = array(\"trangHienThoi\"=>$iCurrentPage, \"soBanGhiTrenTrang\"=>$iNumRowOnPage,\"chuoiTimKiem\"=>$sfullTextSearch,\"Nam\"=>$iYear);\r\n\t\t\t$_SESSION['seArrParameter'] = $arrParaSet;\t\r\n\t\t\r\n\t}", "public function landShowingDetailAction(){\n\n\t\t\t\t$params = $this->getRequest()->getParams(); \n\t\t\t\t$db = $this->db;\n\t\t\t\t$secretkey = $this->secretkey;\n\n\t\t\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\";\n\t\t\t\t$farmer_code\t= isset($params['farmer_code'])?$params['farmer_code']:\"\";\n\t\t\t\t$land_id\t= isset($params['land_id'])?$params['land_id']:\"\";\n\t\t\t\t$mou_type_id\t= isset($params['mou_type_id'])?$params['mou_type_id']:\"\";\n\t\t\t\t$variety_id\t= isset($params['variety_id'])?$params['variety_id']:\"\";\n\t\t\t\t$category_id\t= isset($params['category_id'])?$params['category_id']:\"\";\n\t\t\t\t$lot_no\t= isset($params['lot_no'])?$params['lot_no']:\"\";\n\t\t\t\t$sowing_date\t= isset($params['sowing_date'])?$params['sowing_date']:\"\";\n\t\t\t\t$tcw_of_seed\t= isset($params['tcw_of_seed'])?$params['tcw_of_seed']:\"\";\n\t\t\t\t$sowing_depth\t= isset($params['sowing_depth'])?$params['sowing_depth']:\"\";\n //$sowing_depth_unit_id\t= isset($params['sowing_depth_unit_id'])?$params['sowing_depth_unit_id']:\"\";\n\t\t\t\t$sink_date_time\t= isset($params['sink_date_time'])?$params['sink_date_time']:\"\";\n\n\n\t\t\t\t$seed_rate_kg_per_acre\t= isset($params['seed_rate_kg_per_acre'])?$params['seed_rate_kg_per_acre']:\"\";\n\t\t\t\t$seed_rate_per_m2\t= isset($params['seed_rate_per_m2'])?$params['seed_rate_per_m2']:\"\";\n\t\t\t\t$sowing_type_id\t= isset($params['sowing_type_id'])?$params['sowing_type_id']:\"\";\n\t\t\t\t$sowing_moisture_source\t= isset($params['sowing_moisture_source'])?$params['sowing_moisture_source']:\"\";\n\t\t\t\t$row_to_row_diff\t= isset($params['row_to_row_diff'])?$params['row_to_row_diff']:\"\";\n // $row_to_row_diff_unit_id\t= isset($params['row_to_row_diff_unit_id'])?$params['row_to_row_diff_unit_id']:\"\";\n\n\t\t\t\t$error_code = 1;\n\t\t\t\t$succes = FALSE;\n\t\t\t\ttry{\n\t\t\t\t\t$db->beginTransaction();\n\t\t\t\t\tif($secretkey != $appkey){\n\t\t\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t\t\t}\t\n\t\t\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$user = new Application_Model_Users();\n\t\t\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t\t\t} \n\t\t\t\t\tif(!empty($alldata['DeviceID'])){\t\t\t\n\t\t\t\t\t\tif($alldata['DeviceID'] != $device_id){\n\t\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac'){\n\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t\t\t}\t\n\n\t\t\t\t\tif($alldata['App_Access_Status'] == 2){\n\t\t\t\t\t\t$error_code = 2;\n\t\t\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$farmerMaster = new Application_Model_Farmermasters();\n\t\t\t\t\t$allFarmerData = $farmerMaster->getFarmerDetailsByFarmerCode($farmer_code); \t\n\t\t\t\t\t$farmerID = $allFarmerData['id'];\n\t\t\t\t\t$farmerCode = $allFarmerData['FarmerCode'];\n\n\n\t\t\t\t\t$land_showing = array(); \n\t\t\t\t\t$land_showing['land_id'] = $land_id;\n\t\t\t\t\t$land_showing['mou_type_id'] = $mou_type_id;\n\t\t\t\t\t$land_showing['variety_id'] = $variety_id;\n\t\t\t\t\t$land_showing['category_id'] = $category_id;\n\t\t\t\t\t$land_showing['lot_no'] = $lot_no;\n\t\t\t\t\t$land_showing['tcw_of_seed'] = $tcw_of_seed;\n\t\t\t\t\t$land_showing['sowing_depth'] = $sowing_depth;\n\t\t\t\t\t$land_showing['sowing_date'] = $sowing_date;\n // $land_showing['sowing_depth_unit_id'] = $sowing_depth_unit_id;\n\t\t\t\t\t$land_showing['seed_rate_kg_per_acre'] = $seed_rate_kg_per_acre;\n\t\t\t\t\t$land_showing['seed_rate_per_m2'] = $seed_rate_per_m2;\n\t\t\t\t\t$land_showing['sowing_type_id'] = $sowing_type_id;\n\t\t\t\t\t$land_showing['sowing_moisture_source'] = $sowing_moisture_source;\n\t\t\t\t\t$land_showing['row_to_row_diff'] = $row_to_row_diff;\n // $land_showing['row_to_row_diff_unit_id'] = $row_to_row_diff_unit_id;\n\t\t\t\t\t$land_showing['farmer_code'] = $farmer_code;\n\t\t\t\t\t$land_showing['farmer_id'] = $farmerID;\n\t\t\t\t\t$land_showing['fe_code'] = $LoginID;\n\t\t\t\t\t$land_showing['sink_date_time'] = $sink_date_time;\n\t\t\t\t\t$land_showing['created'] = $this->currdate; \n\t\t\t\t\t$db->insert('logi_land_showing', $land_showing);\n\n\t\t\t\t\t$landdetailId = $db->lastInsertId();\n\n\t\t\t\t\t$db->commit();\n\t\t\t\t\t$succes = TRUE;\t \n\t\t\t\t}\n\n\t\t\t\tcatch(Exception $e){\n //Rollback transaction\n\t\t\t\t\t$db->rollBack();\n\t\t\t\t\t$error= $e->getMessage();\n\t\t\t\t}\n\n\t\t\t\tif($succes == TRUE ){\n\t\t\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Land Showing Detail Inserted successfully.', 'showing_id'=>$landdetailId));\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error));\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t}", "public function actionViewByHrdStaf($id){\n return $this->render('viewByHrdStaf',[\n 'model' => $this->findModel($id),\n ]);\n }", "public function show_detail($i_id=0)\r\n {}", "public function show_detail($i_id=0)\r\n {}", "public function viewAction()\r\n {\r\n $this->indexAction();\r\n }", "public function viewAction()\n {\n $id = $this->_getPrimaryId();\n $row = $this->_getRow($id);\n\n $this->view->row = $row;\n }", "public function detailAction() {\n\n //GET THE LIST ITEM\n $this->view->listDetail = Engine_Api::_()->getItem('list_listing',(int) $this->_getParam('id'));\n }", "public function metaDetailAction() {\n\n //ONLY LOGGED IN USER CAN ADD OVERVIEW\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n //GET VIEWER\n $viewer = Engine_Api::_()->user()->getViewer();\n\n //GET LISTING ID AND OBJECT\n $listing_id = $this->_getParam('listing_id');\n\n \n $this->view->sitereview = $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n Engine_Api::_()->core()->setSubject($sitereview); \n //GET LISTING TYPE ID\n $listingtype_id = $sitereview->listingtype_id;\n\n if(!Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\n $this->_helper->content\n ->setContentName(\"sitereview_dashboard_metadetails_listtype_$listingtype_id\")\n //->setNoRender()\n ->setEnabled();\n \n }\n \n Engine_Api::_()->sitereview()->setListingTypeInRegistry($listingtype_id);\n $listingType = Zend_Registry::get('listingtypeArray' . $listingtype_id);\n\n if (empty($listingType->metakeyword)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n if (!$sitereview->authorization()->isAllowed($viewer, 'edit_listtype_' . $listingtype_id)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n if (!Engine_Api::_()->authorization()->getPermission($viewer->level_id, 'sitereview_listing', \"metakeyword_listtype_$listingtype_id\")) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n //SELECTED TAB\n $this->view->TabActive = \"metadetails\";\n\n //SET FORM\n $this->view->form = $form = new Sitereview_Form_Metainfo();\n\n $tableOtherinfo = Engine_Api::_()->getDbTable('otherinfo', 'sitereview');\n\n //POPULATE FORM\n $value['keywords'] = $tableOtherinfo->getColumnValue($listing_id, 'keywords');\n\n $form->populate($value);\n\n //CHECK FORM VALIDATION\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n //GET FORM VALUES\n $values = $form->getValues();\n $tableOtherinfo->update(array('keywords' => $values['keywords']), array('listing_id = ?' => $listing_id));\n\n //SHOW SUCCESS MESSAGE\n $form->addNotice(Zend_Registry::get('Zend_Translate')->_('Your changes have been saved successfully.'));\n }\n }", "public function viewAclAction()\n {\n \tif($this->getRequest()->getParam('id')){\n \t\t$db = new Rsvacl_Model_DbTable_DbAcl();\n \t\t$acl_id = $this->getRequest()->getParam('id');\n \t\t$rs=$db->getAcl($acl_id);\n \t\t$this->view->rs=$rs;\n \t} \t \n \t\n }", "public function show(FakturReturBeliDetail $fakturReturBeliDetail)\n {\n //\n }", "public function viewAction() {\n // neu chua khoi tao\n // neu roi add them 1 phan tu vao sesion voi id va uenc da duoc tao\n $this->layout('layout/bags');\n $getuser = $this->forward()->dispatch('Admin\\Controller\\Index', array(\n 'action' => 'getuser'\n ));\n // var_dump($getuser);\n $this->layout()->getuser = $getuser;\n\n $id = $this->params()->fromRoute('id');\n $uenc = $this->params()->fromRoute('uenc');\n\n echo \"id :\";\n var_dump($id);\n echo \"</br>\";\n echo \"uenc :\";\n var_dump($uenc);\n die(\"view is update\");\n }", "protected function viewAction()\n {\n }", "public function view() {\n\n $this->db->where('VCIF', 'XYZ');\n $q = $this->db->get('STRUCTURE')->result();\n }", "public function actionView() {\n $this->active_menu = \"gpu2\";\n $this->open_class = \"factory\";\n $this->active_class = \"create\";\n $model = Itemstock::model()->findByPk(Yii::app()->request->getParam('id'));\n $this->render('view', array(\n 'model' => $model,\n ));\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function detail()\n {\n $vereinRepository = new VereinRepository();\n\n $view = new View('verein_detail');\n $view->heading = \"\";\n $view->verein = $vereinRepository->readById($_GET['id']);\n $view->title = $view->verein->name;\n $view->display();\n }", "public function oldviewAction() {\n\t\t$id = (int)$this->_request->getParam('id');\n\t\tPageTitle::setTitle($this->view, $this->_request, array($id));\n\t\t$debugdate = $this->_request->getParam('debugdate');\n\t\t$layout = trim($this->_request->getParam('layout',''));\n\t\t\n\t\t$taFinder = new TeachingActivities();\n\t\t$ta = $taFinder->getTa($id);\n\t\t\n\t\tif ($ta->isReleased() != true) {\n\t\t\tthrow new Exception(\"Teaching activity $id is not released yet.\");\n\t\t}\n\t\t\n\t\t$this->view->ta = $ta;\n\n\t\t$resourceError = false;\n\t\ttry {\n\t\t\t$resourceService = new MediabankResourceService();\n\t\t\t$resources = $resourceService->getResources($id, 'ta');\n\t\t\t$allowAddResources = $resourceService->allowAdd();\n\t\t} catch (Exception $ex) {\n\t\t\t$resourceError = true;\n\t\t\t$resources = array();\n\t\t\t$allowAddResources = false;\n\t\t}\n\t\t$this->view->allowAddResources = $allowAddResources;\n\t\t$this->view->resourceError = $resourceError;\n\t\t$this->view->resources = $resources;\n\t\t\n\t\t//Check if user is a staff\n\t\t$this->view->isStaffOrAbove = UserAcl::isStaffOrAbove();\n //Store ACL for each resource action which can be accessed by the current user\n //And allow/disallow those actions. \n\t\t$this->view->resourceAcl = ResourceAcl::accessAll(array('type'=>'ta','auto_id'=>$id));\n\n\t\t$this->view->revisions = $taFinder->getTaRevisions($ta->taid);\n\t\t$this->view->released_los = $ta->getLinkedLearningObjectiveWithStatus(Status::$RELEASED);\n\t\t$this->view->title = 'Teaching Activity - '.$ta->auto_id;\n\t\t\n\t\t$studentEvaluateService = new StudentEvaluateService();\n\t\t$this->view->taEvaluations = $studentEvaluateService->getEvaluationForTaId($id);\n\n\t\t$this->view->isMyTa = Utilities::isMyTa($ta);\n\t\t$this->view->debugdate = $debugdate;\n\n if(!empty($layout)) {\n switch($layout) {\n case 'pblview': \n $this->view->pblTaTypePrev = $this->_request->getParam('pblTaTypePrev','');\n $this->view->pblTaTypeNext = $this->_request->getParam('pblTaTypeNext','');\n $this->render('pblview');\n break;\n }\n }\n\t}", "public function detailAction(){\n\t\tinclude_once(System_Properties::ADMIN_MOD_PATH.'/models/bike/db_selBikeAd.php');\n\t\tinclude_once(System_Properties::ADMIN_MOD_PATH.'/models/bike/db_updBikeAds.php');\n\t\tinclude_once(System_Properties::ADMIN_MOD_PATH.'/models/bike/db_selBike2Ext.php');\n\t\tinclude_once(System_Properties::ADMIN_MOD_PATH.'/models/default/db_selVPic.php');\n\t\t$req = $this -> getRequest();\n\t\t$lang = $this -> lang;\n\t\t$p = $req -> getParams();\n\t\t\n\t\tif (isset($p['id'])){\t\t\t\n\t\t\t$bikeDetails = db_selBikeAd(array('bikeID' => $p['id']));\n\t\t\tif (($bikeDetails != false) && is_array($bikeDetails) && (count($bikeDetails) == 1)){\t\t\t\t\n\t\t\t\t$bikeDetails = $bikeDetails[0];\n\t\t\t\t\n\t\t\t\tif (is_array($this -> adminNS -> bikeAds) && isset($this -> adminNS -> bikeAds['bikeID'])\n\t\t\t\t\t&& ($this -> adminNS -> bikeAds['bikeID'] != $bikeDetails['bikeID'])){\n\t\t\t\t\t$this -> resetnsAction();\n\t\t\t\t}\n\t\t\t\t//Safe changes\n\t\t\t\tif (isset($p['bikeSafe'])){\n\t\t\t\t\t$p['bikeID'] = $bikeDetails['bikeID'];\n\t\t\t\t\t$p['bikeBrandID'] = $p['bikeBrand'];\n\t\t\t\t\t$p = $this -> updatebikeAction($p);\n\t\t\t\t\tif (isset($p['error'])){\n\t\t\t\t\t\t$this -> view -> error = $p['error'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$bikeDetails2 = db_selBikeAd(array('bikeID' => $p['id']));\n\t\t\t\t\t\tif (($bikeDetails2 != false) && is_array($bikeDetails2) && (count($bikeDetails2) == 1)){\n\t\t\t\t\t\t\t$bikeDetails = $bikeDetails2[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this -> view -> info = $lang['AINFO_4'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Delete advertisement\n\t\t\t\telse if (isset($p['bikeDel'])){\n\t\t\t\t\t$bikeAd = db_updBikeAds(array(System_Properties::SQL_WHERE => array('bikeID' => $bikeDetails['bikeID'])\n\t\t\t\t\t\t\t\t\t\t\t\t, System_Properties::SQL_SET => array('erased' => 1)\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\tif ($bikeAd != false){\n\t\t\t\t\t\t$this -> _forward('index');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Load all bike extra\n\t\t\t\t$this -> loadBikeExt();\n\t\t\t\t\n\t\t\t\t//Load bike extra\n\t\t\t\t$bikeExt = db_selBike2Ext(array('bikeID' => $bikeDetails['bikeID']));\n\t\t\t\tif (($bikeExt != false) && is_array($bikeExt) && (count($bikeExt) > 0)){\n\t\t\t\t\t$bikeDetails['bikeExt'] = array();\n\t\t\t\t\tforeach ($bikeExt as $key => $val){\n\t\t\t\t\t\tarray_push($bikeDetails['bikeExt'], $val['vextID']);\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Fetch all bike pics\n\t\t\t\tif (isset($this -> adminNS -> bikePhoto) && is_array($this -> adminNS -> bikePhoto)){\n\t\t\t\t\t$bikePhoto = $this -> adminNS -> bikePhoto;\n\t\t\t\t}\t\n\t\t\t\telse{\n\t\t\t\t\t$bikePhoto = db_selVPic(array(\t'vType' => System_Properties::BIKE_ABRV,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'vID' => $bikeDetails['bikeID']));\n\t\t\t\t\t$bikeDetails['bikePhoto'] = array();\n\t\t\t\t\tforeach($bikePhoto as $key => $kVal){\n\t\t\t\t\t\t$bikeDetails['bikePhoto'][$kVal['vPicID']] = $kVal;\n\t\t\t\t\t}\n\t\t\t\t\t$bikePhoto = $bikeDetails['bikePhoto'];\n\t\t\t\t}\n\t\t\t\t$bikeDetails['bikePhoto'] = $bikePhoto;\n\t\t\t\t\n\t\t\t\t//Load brands and models\t\t\t\t\n\t\t\t\t$this -> loadBikeModelsBrands(array('bikeBrand' => $bikeDetails['bikeBrandID']));\n\t\t\t\t//Load all possible bike extra\n\t\t\t\t$this -> loadBikeExt();\n\t\t\t\t$this -> loadBikeCat();\n\t\t\t\t$this -> view -> bike = $bikeDetails;\n\t\t\t\t\n\t\t\t\t$this -> adminNS -> bikeAds = $bikeDetails;\n\t\t\t\t$this -> adminNS -> bikePhoto = $bikePhoto;\n\t\t\t}else{\n\t\t\t\t$this -> indexAction();\n\t\t\t\t$this -> render('index');\n\t\t\t}\n\t\t}else{\n\t\t\t$this -> indexAction();\n\t\t\t$this -> render('index');\n\t\t}\n\t}", "public function show()\n {\n $data['title'] = 'Siswa';\n $id = $this->input->get('id');\n $this->load->model('Absen_m', 'absen');\n $kehadiran = $this->absen->hitung_kehadiran_siswa($id, 'hadir');\n $sakit = $this->absen->hitung_kehadiran_siswa($id, 'sakit');\n $izin = $this->absen->hitung_kehadiran_siswa($id, 'izin');\n // cegat apa bila id nya tdk di isi ato langsung akses ke link \n if ($id !== null) {\n //Ambil Semua data absensi taruh dalam satu varible \n $data['siswa'] = $this->siswa->get_siswa_byId($id)->result_array();\n $data['kehadiran'] = $kehadiran;\n $data['sakit'] = $sakit;\n $data['izin'] = $izin;\n\n $this->load->view('templates/header', $data);\n $this->load->view('templates/sidenav');\n $this->load->view('templates/navbar', $data);\n $this->load->view('siswa/show', $data);\n $this->load->view('templates/footer');\n } else {\n show_404();\n }\n }", "public function actionView()\n {\n \n }", "public function actionView() {\n $isFinal=false;\n if(isset($_GET['isFinal'])) {\n $isFinal=$_GET['isFinal'];\n }\n $this->render('view', array(\n 'model' => $this->loadModel(),\n 'isFinal'=>$isFinal\n ));\n }", "public function actionView($id){\n $userid=Yii::$app->user->identity->id;\n //$model = $this->findModel($id);\n $documents=MgfAttachements::find()->where(['organisation_id'=>$id])->all();\n $concepts=MgfConceptNote::find()->where(['organisation_id'=>$id])->all();\n $screening=MgfScreening::find()->where(['organisation_id'=>$id])->all(); \n $contacts=MgfContact::find()->joinWith('position')->where(['organisation_id'=>$id])->all(); \n $applicant=MgfApplicant::find()->where(['user_id'=>$userid])->one(); \n //$id=getOrganisationID(); \n return $this->render('view', ['model' => $this->findModel($id),'documents'=>$documents,'criteria'=>$screening,'concepts'=>$concepts,'contacts'=>$contacts,'applicant'=>$applicant]);\n }", "public function detail($id){\n \n $this->_estado->_setIdTableValue($id);\n $params['rsEstado'] = $this->_estado->getRecord();\n \\kerana\\View::showView($this->_current_module,'estado/detail',$params);\n \n }", "public function viewAction() {\n\t\t$id = $this->_getParam('id');\n\t\t$taFinder = new TeachingActivities();\n\t\t$ta = $taFinder->getTa($id);\n\t\t\n\t\t$latest_flag = ($this->_getParam('latest') == 'f') ? false : true;\n\t\t$latest_ta_id = $ta->latestReleasedVersionId();\n\t\tif ($latest_ta_id != $id && !UserAcl::isDomainAdminOrAbove() && $latest_flag) {\n\t\t\t$this->_redirect('/teachingactivity/view/id/'.$latest_ta_id);\n\t\t\treturn;\n\t\t}\n\t\t$this->view->debugdate = $this->_getParam('debugdate');\n\t\t$layout = $this->_getParam('layout', '');\n\n\t\tPageTitle::setTitle($this->view, $this->_request, array($id));\n\n\t\tif ($ta->isReleased() != true) {\n\t\t\tthrow new Exception(\"Teaching activity $id is not released yet.\");\n\t\t}\n\n\t\t$this->view->ta = $ta;\n\t\t$this->view->revisions = $taFinder->getTaRevisions($ta->taid);\n\t\t$this->view->released_los = $ta->getLinkedLearningObjectiveWithStatus(Status::$RELEASED);\n\t\t\n\t\t$this->view->showGenericEvaluation = EvaluateTaConst::showGenericEvaluation($ta->typeID);\n\t\t\n\t\tif(UserAcl::isAdmin() && $this->view->showGenericEvaluation === true) {\n \t\t$studentEvaluateService = new StudentEvaluateService();\n \t\t$this->view->taEvaluations = $studentEvaluateService->getEvaluationForTaId($id);\n \t\t$studentEvaluate = new StudentEvaluate();\n \t\t$this->view->taEvaluationAvg = $studentEvaluate->getRatingAvg('ta', $id);\n\t\t}\n\n\t\t$this->view->display_edit_links = UserAcl::isStaffOrAbove() && UserAcl::checkTaPermission($ta, UserAcl::$EDIT) === true && count($this->view->released_los) > 0;\n\t\t$this->view->resourceAcl = ResourceAcl::accessAll(array('type'=>'ta','auto_id'=>$id));\n\t\t$this->view->resources = $ta->resources;\n\t\t\n\t\t$this->view->pblTaTypePrev = '';\n\t\t$this->view->pblTaTypeNext = '';\n\t\t\n\t if(!empty($layout)) {\n switch($layout) {\n case 'pblview': \n $this->view->pblTaTypePrev = $this->_request->getParam('pblTaTypePrev','');\n $this->view->pblTaTypeNext = $this->_request->getParam('pblTaTypeNext','');\n //$this->render('pblview');\n break;\n }\n }\n\t\t$this->view->socialtools = StudentResourceService::showSocialTools();\n\t}", "public function actionView()\n {\n \t$id = isset($_REQUEST['id'])?$_REQUEST['id']:null;\n \t$model = $this->findModel($id);\n \t \n \treturn CommonUtils::json_success($model);\n }", "public function view()\n\t{\n\t\t// TODO Implement\t\n\t}", "public function landVisitDetailAction(){\n\n\t\t\t\t$params = $this->getRequest()->getParams(); \n\t\t\t\t$db = $this->db;\n\t\t\t\t$secretkey = $this->secretkey; \n\t\t\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\";\n\t\t\t\t$farmer_code\t= isset($params['farmer_code'])?$params['farmer_code']:\"\";\n\t\t\t\t$land_id\t= isset($params['land_id'])?$params['land_id']:\"\";\n\t\t\t\t$stage_id\t= isset($params['stage_id'])?$params['stage_id']:\"\";\n\t\t\t\t$disease_score\t= isset($params['disease_score'])?$params['disease_score']:\"\";\n\t\t\t\t$logging_score\t= isset($params['logging_score'])?$params['logging_score']:\"\";\n\t\t\t\t$presemption_of_insect\t= isset($params['presemption_of_insect'])?$params['presemption_of_insect']:\"\";\n\t\t\t\t$soil_moisture_id\t= isset($params['soil_moisture_id'])?$params['soil_moisture_id']:\"\";\n\t\t\t\t$quality_of_crop\t= isset($params['quality_of_crop'])?$params['quality_of_crop']:\"\";\n\t\t\t\t$sink_date_time \t= isset($params['sink_date_time'])?$params['sink_date_time']:\"\";\n\n\n\t\t\t\t$error_code = 1;\n\t\t\t\t$succes = FALSE; \n\t\t\t\ttry{\n\t\t\t\t\t$db->beginTransaction();\n\t\t\t\t\tif($secretkey != $appkey){\n\t\t\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t\t\t}\t\n\t\t\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$user = new Application_Model_Users();\n\t\t\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t\t\t} \n\t\t\t\t\tif(!empty($alldata['DeviceID'])){\t\t\t\n\t\t\t\t\t\tif($alldata['DeviceID'] != $device_id){\n\t\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac'){\n\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t\t\t}\t\n\n\t\t\t\t\tif($alldata['App_Access_Status'] == 2){\n\t\t\t\t\t\t$error_code = 2;\n\t\t\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$farmerMaster = new Application_Model_Farmermasters();\n\t\t\t\t\t$allFarmerData = $farmerMaster->getFarmerDetailsByFarmerCode($farmer_code); \t\n\t\t\t\t\t$farmerID = $allFarmerData['id'];\n\t\t\t\t\t$farmerCode = $allFarmerData['FarmerCode'];\n\n\n\t\t\t\t\tif(isset($_FILES['image']['tmp_name']) AND !empty($_FILES['image']['name'])){\n\t\t\t\t\t\t$tempName = $_FILES['image']['tmp_name'];\n\t\t\t\t\t\t$imageName = time().$_FILES['image']['name']; \n\t\t\t\t\t\t$uploads = 'uploads/visit_photograph/';\n\t\t\t\t\t\tif(!file_exists($uploads)){\n\t\t\t\t\t\t\tmkdir($uploads);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$pathComplete = $uploads.$imageName;\n\t\t\t\t\t\t@move_uploaded_file($tempName,$pathComplete);\n\n\t\t\t\t\t}\n\n\t\t\t\t\t$land_visit = array(); \n\n\t\t\t\t\t$land_visit['land_id'] = $land_id;\n\t\t\t\t\t$land_visit['stage_id'] = $stage_id;\n\t\t\t\t\t$land_visit['disease_score'] = $disease_score;\n\t\t\t\t\t$land_visit['logging_score'] = $logging_score;\n\t\t\t\t\t$land_visit['presemption_of_insect'] = $presemption_of_insect;\n\t\t\t\t\t$land_visit['soil_moisture_id'] = $soil_moisture_id;\n\t\t\t\t\t$land_visit['quality_of_crop'] = $quality_of_crop;\n\t\t\t\t\t$land_visit['image'] = $pathComplete;\n\t\t\t\t\t$land_visit['farmer_code'] = $farmer_code;\n\t\t\t\t\t$land_visit['farmer_id'] = $farmerID;\n\t\t\t\t\t$land_visit['fe_code'] = $LoginID;\n\t\t\t\t\t$land_visit['sink_date_time'] = $sink_date_time;\n\t\t\t\t\t$land_visit['created'] = $this->currdate; \n\t\t\t\t\t$db->insert('logi_land_visit', $land_visit);\n\n\t\t\t\t\t$landdetailId = $db->lastInsertId();\n\n\t\t\t\t\t$db->commit();\n\t\t\t\t\t$succes = TRUE;\t \n\t\t\t\t}\n\n\t\t\t\tcatch(Exception $e){\n //Rollback transaction\n\t\t\t\t\t$db->rollBack();\n\t\t\t\t\t$error= $e->getMessage();\n\t\t\t\t}\n\n\t\t\t\tif($succes == TRUE ){\n\t\t\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Land visit Detail Inserted successfully.', 'land_visit_id'=>$landdetailId));\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error));\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t}", "public function viewAction()\n {\t\n $auth = Zend_Auth::getInstance();\n \tif($auth->hasIdentity())\n {\n $loginUserId = $auth->getStorage()->read()->id;\n $businessunit_id = $auth->getStorage()->read()->businessunit_id;\n $department_id = $auth->getStorage()->read()->department_id; \n $loginuserRole = $auth->getStorage()->read()->emprole;\n $loginuserGroup = $auth->getStorage()->read()->group_id;\n }\n $id = $this->getRequest()->getParam('id');\n try\n {\n if($id != '')\n {\n\t\t\t $app_manager_model = new Default_Model_Appraisalmanager();\n\t\t\t\t$line_managers = array();\n\t\t\t\t$line_managers = $app_manager_model->getLineManagers($id,$loginUserId);\n\t\t\t\t$appraisal_init_model = new Default_Model_Appraisalinit();\n\t\t\t\t$appraisal_data = $appraisal_init_model->getappdata_forview($id);\n\t\t\t\t\n if(is_numeric($id) && $id>0 && $line_managers && !empty($appraisal_data))\n {\n\t\t\t\t\t$appraisal_data['process_status'] = '';\n if(!empty($appraisal_data))\n {\n \tif($appraisal_data['initialize_status'] == 1)\n \t{\n \t\tif($appraisal_data['enable_step'] == 1)\n \t\t\t$appraisal_data['process_status'] = 'Enabled to Managers';\n \t\tif($appraisal_data['enable_step'] == 2)\n \t\t\t$appraisal_data['process_status'] = 'Enabled to Employees';\t\n \t}\n \telse if($appraisal_data['initialize_status'] == 2)\n \t{\n \t\t$appraisal_data['process_status'] = 'Initialize Later';\n \t}else\n\t\t\t \t{\n\t\t\t \t $data['process_status'] = 'In progress';\t\n\t\t\t \t}\n }\n if($appraisal_data['status'] == 1) {\n \t $appraisal_data['status']=\"Open\";\n }else if($appraisal_data['status'] == 2) {\n \t $appraisal_data['status']=\"Closed\";\n }else {\n $appraisal_data['status']=\"Force Closed\";\n }\t\n if($appraisal_data['appraisal_ratings'] == 1) {\n \t $appraisal_data['appraisal_ratings']=\"1-5\";\n }else {\n $appraisal_data['appraisal_ratings']=\"1-10\";\n }\t\n if($appraisal_data['appraisal_mode'] == 'Quarterly'){\n\t\t\t\t\t\t $appraisal_data['appraisal_period']=\"Q\".$appraisal_data['appraisal_period'];\n }\n\t\t\t\t\t else if($appraisal_data['appraisal_mode'] == 'Half-yearly'){\n\t\t\t\t\t\t $appraisal_data['appraisal_period']= \"H\".$appraisal_data['appraisal_period'];\n\t\t\t\t\t }\n\t\t\t\t\t else {\n\t\t\t\t\t\t $appraisal_data['appraisal_period']=\"Yearly\";\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t if($appraisal_data['enable_step'] == 1) {\n \t $appraisal_data['enable_step']=\"Managers\";\n }else {\n $appraisal_data['enable_step']=\"Employees\";\n }\n\t\t\t\t\t $appraisal_data['managers_due_date'] = sapp_Global::change_date($appraisal_data['managers_due_date'],'view');\n $appraisal_data['employees_due_date'] = sapp_Global::change_date($appraisal_data['employees_due_date'],'view');\n $manager_groups = $app_manager_model->getManagergroups($id,$loginUserId);\n $view = $this->getHelper('ViewRenderer')->view;\n $view->previ_data = 'no'; \n $view->data = $appraisal_data;\n $text = $view->render('appraisalinit/view.phtml');\n $this->view->appraisal_id = $id;\n $this->view->manager_id = $loginUserId;\n $this->view->manager_groups = $manager_groups;\n $this->view->appraisal_data = $appraisal_data;\n $this->view->app_text = $text;\n $this->view->controllername = 'appraisalmanager';\n $this->view->id = $id;\n }\n else \n {\n $this->view->ermsg = 'nodata';\n }\n }\n else\n {\n $this->view->ermsg = 'nodata';\n }\n } \n catch (Exception $ex) \n {\n $this->view->ermsg = 'nodata';\n }\n }", "public function actionView($id)\n {\n $dis = (new Query());\n $dis ->select([ 'tf_lunas.status'])\n ->FROM('tf_lunas')\n ->andWhere('tf_lunas.id_tf_lunas=:id_a', array(':id_a'=>$id))\n ->limit(6);\n $command = $dis->createCommand();\n $dis = $command->queryAll();\n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'dis' => $dis,\n ]);\n }", "public function actionView() {}", "public function actionView() {}", "public function display($sort_by = 'alue_code', $sort_order = 'asc', $code_sel = '0', $filter = '') \r\n {\r\n if (($sort_by != $this->session->userdata('sort_by')) ||\r\n ($sort_order != $this->session->userdata('sort_order')) ||\r\n ($code_sel != $this->session->userdata('code_sel')) ||\r\n ($filter != $this->session->userdata('filter'))) {\r\n \r\n //Jos jokin tilamuuttuja muuttuu, poistetaan virheteksti näkyvistä\r\n if(isset($_SESSION['error'])){\r\n unset($_SESSION['error']);\r\n }\r\n }\r\n \r\n //Tallenna näytön uusi tila\r\n $territory_view_state_data = array(\r\n 'sort_by' => $sort_by,\r\n 'sort_order' => $sort_order,\r\n 'code_sel' => $code_sel,\r\n 'filter' => $filter\r\n );\r\n $this->session->set_userdata($territory_view_state_data);\r\n \r\n //Hakuparametrit näytölle\r\n $data['display_fields'] = array(\r\n 'alue_code'\t\t=> 'numero',\r\n 'alue_detail'\t=> 'alue_nimi',\r\n 'alue_location'\t=> 'lisätieto',\r\n 'alue_taloudet'\t=> 'koko',\r\n 'event_count'\t=> 'poisto'\r\n );\r\n \r\n //Hakuparametrit kantaan\r\n $data['database_fields'] = array(\r\n 'alue_code'\t\t=> 'numero',\r\n 'alue_detail'\t=> 'alue_nimi',\r\n 'alue_location'\t=> 'lisätieto',\r\n 'alue_taloudet'\t=> 'koko',\r\n 'event_count'\t=> 'määrä'\r\n );\r\n\r\n //Korjaa ääkköset takaisin\r\n $filter = urldecode($filter);\r\n \r\n //Hae tiedot\r\n $results = $this->Maintenance_model->search($data['database_fields'], $sort_by, $sort_order, $code_sel);\r\n //Tiedot näytölle sopiviksi\r\n $data['alueet'] = $this->create_displayrows($results);\r\n \r\n $data['num_results'] = $results['num_rows'];\r\n \r\n //Parameters back to view page\r\n $data['sort_by'] = $sort_by;\r\n $data['sort_order'] = $sort_order;\r\n $data['code_sel'] = $code_sel;\r\n $data['filter'] = $filter;\r\n \r\n //Hae aluekoodit\r\n $tresults = $this->Event_model->get_terr_codes();\r\n $data['territory_codes'] = $tresults['rows'];\r\n\r\n //Alusta tietorakenne undo/redo - toimintoa varten\r\n //Jos parametreja ei ole annettu, alusta tietorakenne\r\n $numargs = func_num_args();\r\n if ($numargs == 0) {\r\n /** Initialize **/\r\n $undo_redo_stack = new UndoRedoStack();\r\n \r\n //Poistetaan virheteksti näkyvistä\r\n if(isset($_SESSION['error'])){\r\n unset($_SESSION['error']);\r\n }\r\n } else {\r\n //Muuten\r\n if (!isset($_SESSION['undo_redo_terr_edit'])) {\r\n /** Initialize **/\r\n $undo_redo_stack = new UndoRedoStack();\r\n } else {\r\n /** UNSERIALIZE **/\r\n $undo_redo_stack = unserialize($_SESSION['undo_redo_terr_edit']);\r\n }\r\n }\r\n \r\n $data['can_undo'] = $undo_redo_stack->can_undo();\r\n $data['can_redo'] = $undo_redo_stack->can_redo();\r\n \r\n /** SERIALIZE **/\r\n $_SESSION['undo_redo_terr_edit'] = serialize($undo_redo_stack);\r\n \r\n $this->load->view('maintenance_view', $data);\r\n }", "public function oneto50kAction(){\r\n\tif($this->_getParam('id',false)){\r\n\t$gazetteers = new Osdata();\r\n\t$this->view->gazetteer = $gazetteers->getGazetteer($this->_getParam('id'));\t\r\n\t} else {\r\n\t\tthrow new Pas_Exception_Param($this->_missingParameter);\t\r\n\t}\r\n\t}", "public function view($rfp_id){\n\n $data['title'] = 'Admin View Request';\n $data['heading'] = 'View Request Page'; \n $data['rfp_id'] = decode($rfp_id);\n\n $data['record']=$this->Rfp_model->get_result('rfp',['id' => decode($rfp_id)],'1');\n // pr($data['record'],1);\n $data['subview'] = 'admin/rfp/view';\n $this->load->view('admin/layouts/layout_main', $data);\n }", "public function actionView($order_id, $item_id, $shipping_id)\n{\nreturn $this->render('view', [\n'model' => $this->findModel($order_id, $item_id, $shipping_id),\n]);\n}", "public function action_detail()\n\t{\n\t\t$this->template = View::forge('template-admin');\n\n $get = Input::get();\n\t\t$id = $get[\"id\"];\n\t\t$data[\"details\"] = Model_Event::find_by('id',$id);\n\t\t//return Response::forge(View::forge('event/detail',$data));\n\t\t$this->template->title = \"イベント詳細\";\n\t\t$this->template->content = View::forge('event/detail', $data);\n\t}", "public function overviewAction(){\n\t\t\t\t\t\t$this->redirectToIndex();\n\t\t\t\t\t if($this->_getParam ( 'actions' )==\"overview\"){\n\t\t\t\t\t $idOverview= $this->_getParam ( 'id' );\n\t\t\t\t\t $idUser = $this->_getParam ( 'userid' );\n\t\t\t\t\t\t\t$GetSelectViewCompanys = $this->GetModelOrganize->SelectOverViewEdit( $idOverview,$idUser );\n\t\t\t\t\t $this->view->SelectOnFormEdit = $GetSelectViewCompanys;\n\t\t\t\t\t \n\t\t\t\t\t }\n\t\t\t\t\t\t$id = $this->_getParam ( 'id' );\n $this->view->getIdView = $id;\n \n \n\t\t\t\t\t}", "public function view($id)\n\t{\n\t\n\t\t$this->is_allowed('amuco_details_request_office_view');\n if($this->input->get('popup')){\n\t\t\t$this->data['current_page'] = 'Modal';\n\t\t}else{\n\t\t\t$this->data['current_page'] = 'View';\n\t\t}\n\t\t$this->data['amuco_details_request_office'] = $this->model_amuco_details_request_office->join_avaiable()->filter_avaiable()->find($id);\n // var_dump($this->data['amuco_details_request_office']);\n\t\t$this->template->title('Amuco Details Request Office Detail');\n\t\t$this->render('backend/standart/administrator/amuco_details_request_office/amuco_details_request_office_view', $this->data);\n\t}", "function action_view()\n {\n $this->addStatusFields();\n return parent::action_view();\n }", "public function actionView($id)\n { \n return $this->findModel($id);\n \n }", "function index()\n {\n $this->_view_edit('view');\n }", "public function actionView($id) {\n $dateRange=$this->getDateRange();\n\t\tif(isset($_GET['stage']) && is_numeric($_GET['stage']))\n\t\t\t$viewStage = $_GET['stage'];\n\t\telse\n\t\t\t$viewStage = null;\n\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),'viewStage'=>$viewStage, 'dateRange'=>$dateRange,\n\t\t));\n\t}", "function show()\r\n {\r\n $script = 'module='.$this->module.'&display='.$this->display.'&start='.$this->start.'&sort='.$this->sort.'&fltr='.$this->fltr.'&fln='.$this->fln;\r\n $script = $_SERVER['PHP_SELF'].\"?$script\";\r\n\r\n if( !$this->sort ) $this->sort='id';\r\n\t\tif($this->sort=='result') $this->sort='`result` desc';\r\n //if( strstr( $this->sort, 'seria' ) )$this->sort = $this->sort.' desc';\r\n $q = \"SELECT * FROM \".TblModSearchResult.\" where 1 order by \".$this->sort.\"\";\r\n //if( $this->srch ) $q = $q.\" and (name LIKE '%$this->srch%' OR email LIKE '%$this->srch%')\";\r\n if( $this->fltr ) $q = $q.\" and $this->fltr\";\r\n $res = $this->Right->Query( $q, $this->user_id, $this->module );\r\n //echo '<br>$q='.$q.' $res='.$res.'$this->Right->result='.$this->Right->result.' $this->user_id='.$this->user_id;\r\n if( !$res )return false;\r\n $rows = $this->Right->db_GetNumRows();\r\n\r\n /* Write Form Header */\r\n $this->Form->WriteHeader( $script );\r\n\r\n /* Write Table Part */\r\n AdminHTML::TablePartH();\r\n\r\n /* Write Links on Pages */\r\n echo '<TR><TD COLSPAN=17>';\r\n $script1 = 'module='.$this->module.'&fltr='.$this->fltr;\r\n $script1 = $_SERVER['PHP_SELF'].\"?$script1\";\r\n\t\tif( !$this->display ) $this->display = 20;\r\n //$this->Form->WriteLinkPages( $script1, $rows, $this->display, $this->start, $this->sort );\r\n\t\t$this->Form->WriteLinkPages( $script1.'&fltr='.$this->fltr, $rows, $this->display, $this->start, $this->sort );\r\n\r\n echo '<TR><TD COLSPAN=5>';\r\n $this->Form->WriteTopPanel( $script );\r\n\r\n echo '<td colspan=5>';\r\n echo $this->Form->TextBox('srch', $this->srch, 25);\r\n echo '<input type=submit value='.$this->Msg->show_text('_BUTTON_SEARCH',TblSysTxt).'>';\r\n\r\n /*\r\n echo '<td><td><td><td><td colspan=2>';\r\n $this->Form->WriteSelectLangChange( $script, $this->fln);\r\n */\r\n\r\n $script2 = 'module='.$this->module.'&display='.$this->display.'&start='.$this->start.'&task=show&fltr='.$this->fltr;\r\n $script2 = $_SERVER['PHP_SELF'].\"?$script2\";\r\n ?>\r\n <TR>\r\n <td class=\"THead\">*</Th>\r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=id><?=$this->Msg->show_text('FLD_ID')?></A></Th>\r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=query><?=$this->Msg->show_text('FLD_QUERY')?></A></Th>\r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=ip><?=$this->Msg->show_text('FLD_IP')?></A></Th>\r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=date><?=$this->Msg->show_text('FLD_DATE')?></A></Th>\r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=time><?=$this->Msg->show_text('FLD_TIME')?></A></Th>\r\n \r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=result><?=$this->Msg->show_text('FLD_RESULT')?></A></Th>\r\n \r\n <?\r\n\r\n $up = 0;\r\n $down = 0;\r\n $a = $rows;\r\n $j = 0;\r\n $row_arr = NULL;\r\n for( $i = 0; $i < $rows; $i++ )\r\n {\r\n $row = $this->Right->db_FetchAssoc();\r\n if( $i >= $this->start && $i < ( $this->start+$this->display ) )\r\n {\r\n $row_arr[$j] = $row;\r\n $j = $j + 1;\r\n }\r\n }\r\n\r\n $style1 = 'TR1';\r\n $style2 = 'TR2';\r\n for( $i = 0; $i < count( $row_arr ); $i++ )\r\n {\r\n $row = $row_arr[$i];\r\n\r\n if ( (float)$i/2 == round( $i/2 ) )\r\n {\r\n echo '<TR CLASS=\"'.$style1.'\">';\r\n }\r\n else echo '<TR CLASS=\"'.$style2.'\">';\r\n\r\n echo '<TD>';\r\n $this->Form->CheckBox( \"id_del[]\", $row['id'] );\r\n\r\n echo '<TD>';\r\n $this->Form->Link( $script.\"&task=edit&id=\".$row['id'], stripslashes( $row['id'] ) );\r\n\r\n echo '<TD align=center>';\r\n if( trim( $row['query'] )!='' ) echo $row['query'];\r\n\r\n echo '<TD align=center>';\r\n if( trim( $row['ip'] )!='' ) echo $row['ip'];\r\n\r\n echo '<TD align=center>';\r\n if( trim( $row['date'] )!='' ) echo $row['date'];\r\n\r\n echo '<TD align=center>';\r\n if( trim( $row['time'] )!='' ) echo $row['time'];\r\n\r\n echo '<TD align=center>';\r\n if( trim($row['result'])!='' ) echo $row['result'];\r\n\r\n } //-- end for\r\n\r\n AdminHTML::TablePartF();\r\n $this->Form->WriteFooter();\r\n return true;\r\n\r\n \r\n}", "public function getsvinfoAction()\n {\n $uid = $this->uid;\n $fid = $this->_request->getParam('fid', null);\n\n $result1 = Hapyfish2_Island_Bll_SuperVisitor::getSuperVisitor($uid, $fid);\n\n // update by hdf add compound visitor\n $result2 = Hapyfish2_Island_Bll_CompoundSuperVisitor::getSuperVisitor($uid, $fid);\n $result['spVisitors'] = array_merge($result1['spVisitors'], $result2['spVisitors']); \n\n $this->echoResult($result);\n }", "public function indexAction()\n {\n \t\n \t$this->_helper->layout()->disableLayout();\n \t\n\t\t$this->params = $this->getRequest()->getParams();\n \n\t\t$this->view->params = $this->params;\n\t\t\n\t\tif(!isset($this->params['vizType']))\n\t\t{\n\t\t\t$this->view->vizType = 2;\n\t\t}\n\t\t\n\t\tif(isset($this->params['vizType']))\n\t\t{\n\t\t\t$this->view->vizType = $this->params['vizType'];\n\t\t}\n\n\t\tif(isset($this->params['vizEx']))\n\t\t{\n\t\t\t$this->view->vizEx = $this->params['vizEx'];\n\t\t}\n\n\t if(isset($this->params['vizQu']))\n\t\t{\n\t\t\t$this->view->vizQu = $this->params['vizQu'];\n\t\t}\n\t\t\n\t if(isset($this->params['vizVo']))\n\t\t{\n\t\t\t$this->view->vizVo = $this->params['vizVo'];\n\t\t}\n if(isset($this->params['vizMy']))\n\t\t{\n\t\t\t$this->view->vizMy = $this->params['vizMy'];\n\t\t}\n\t\t\n\t if(isset($this->params['vizCon']) && $this->params['vizCon']==1)\n\t\t{\n\t\t\t$this->view->vizCon = 1;\n\t\t} else {\n\t\t\t$this->view->vizCon = 0;\n\t\t}\n\t\t\n\t if(isset($this->params['conceptId']))\n\t\t{\n\t\t\t$this->view->conceptId = $this->params['conceptId'];\n\t\t} else {\n\t\t\t$this->view->conceptId = array();\n\t\t}\n\t if(isset($this->params['keyW']))\n\t\t{\n\t\t\t$this->view->keyW = $this->params['keyW'];\n\t\t} else {\n\t\t\t$this->view->keyW = \"\";\n\t\t}\n \tif(isset($this->params['valueAA']))\n\t\t{\n\t\t\t$this->view->valueAA = $this->params['valueAA'];\n\t\t} else {\n\t\t\t$this->view->valueAA = \"\";\n\t\t}\n \tif(isset($this->params['valueBB']))\n\t\t{\n\t\t\t$this->view->valueBB = $this->params['valueBB'];\n\t\t} else {\n\t\t\t$this->view->valueBB = \"1325350800\";\n\t\t}\n\t\t\n if(isset($this->params['vizDate']))\n\t\t{\n\t\t\t$this->view->vizDate = $this->params['vizDate'];\n\t\t} else {\n\t\t\t$this->view->vizDate = 0;\n\t\t}\n\t\t\n }", "public function view_estatement($seq_no)\n\t{\n\t\t$this->load->model('statement_header_model');\n\t\t// $this->load->library('m_pdf');\n\t\t$this->load->model('transactions_model');\n\t\t$statement = $this->statement_header_model->get_statement($seq_no);\n\t\t$start_date = $statement[0]->START_DATE;\n\t\t$end_date = $statement[0]->END_DATE;\n\t\t// return print $end_date;\n\t\t$internal_key = $statement[0]->INTERNAL_KEY;\n\t\t$data['statement'] = $statement[0];\n\n\t\t// return print_r($statement);\n\t\t$data['transactions'] = $this->transactions_model\n\t\t\t\t->get_trans_history($start_date,$end_date,$internal_key);\n\t\t\n\t\t$data['start_date'] = $this->formatDate($start_date);\n\t\t$data['end_date'] = $this->formatDate($end_date);\n\n\n\t\t// return print_r($data['transactions']);\n\t\treturn $this->render('transactions/view_statement3',$data);\n\t}", "public function showAction()\n {\n $this->setPageTitle(sprintf($this->_('Show %s'), $this->getTopic()));\n\n $model = $this->getModel();\n // NEAR FUTURE:\n // $this->addSnippet('ModelVerticalTableSnippet', 'model', $model, 'class', 'displayer');\n $repeater = $model->loadRepeatable();\n $table = $this->getShowTable();\n $table->setOnEmpty(sprintf($this->_('Unknown %s.'), $this->getTopic(1)));\n $table->setRepeater($repeater);\n $table->tfrow($this->createMenuLinks($this->menuShowIncludeLevel), array('class' => 'centerAlign'));\n\n if ($menuItem = $this->findAllowedMenuItem('edit')) {\n $table->tbody()->onclick = array('location.href=\\'', $menuItem->toHRefAttribute($this->getRequest()), '\\';');\n }\n\n $tableContainer = \\MUtil_Html::create('div', array('class' => 'table-container'), $table);\n $this->html[] = $tableContainer;\n }", "public function show()\n {\n $this->model->load('TacGia');\n $tacgia = $this->model->TacGia->findById($_GET['id']);\n $data = array(\n 'title' => 'show',\n 'tacgia' => $tacgia\n );\n\n // Load view\n $this->view->load('tacgias/show', $data);\n }", "public function viewdetailsAction()\n {\n $productId = $this->_getParam('product_id');\n $product = $this->_model->setId($productId);\n $this->view->product = $product->fetch(); \n \n }", "public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n DomainConst::KEY_ACTIONS => $this->listActionsCanAccess,\n ));\n }", "public function indexAction() {\n if (!Engine_Api::_()->core()->hasSubject('sitecrowdfunding_project'))\n return $this->setNoRender();\n $this->view->project = $project = Engine_Api::_()->core()->getSubject();\n //GET QUICK INFO DETAILS\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($project);\n if (Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\n $this->view->show_fields = $this->view->fieldValueLoop($project, $this->view->fieldStructure);\n }\n $params = $this->_getAllParams();\n $this->view->params = $params;\n if ($this->_getParam('loaded_by_ajax', false)) {\n $this->view->loaded_by_ajax = true;\n if ($this->_getParam('is_ajax_load', false)) {\n $this->view->is_ajax_load = true;\n $this->view->loaded_by_ajax = false;\n if (!$this->_getParam('onloadAdd', false))\n $this->getElement()->removeDecorator('Title');\n $this->getElement()->removeDecorator('Container');\n } else {\n return;\n }\n }\n\n $tableOtherinfo = Engine_Api::_()->getDbTable('otherinfo', 'sitecrowdfunding');\n $this->view->address = $address = $tableOtherinfo->getColumnValue($project->getIdentity(), 'contact_address');\n $this->view->phone = $phone = $tableOtherinfo->getColumnValue($project->getIdentity(), 'contact_phone');\n $this->view->email = $email = $tableOtherinfo->getColumnValue($project->getIdentity(), 'contact_email');\n\n\n $fundingDatas = Engine_Api::_()->getDbTable('externalfundings','sitecrowdfunding')->getExternalFundingAmount($project->getIdentity());\n //$this->view->totalFundingAmount = $fundingDatas['totalFundingAmount'];\n $this->view->total_backer_count = $fundingDatas['memberCount'] + $fundingDatas['orgCount'];\n\n $sitecrowdfundingSpecificationProject = Zend_Registry::isRegistered('sitecrowdfundingSpecificationProject') ? Zend_Registry::get('sitecrowdfundingSpecificationProject') : null;\n\n if (empty($sitecrowdfundingSpecificationProject))\n return $this->setNoRender();\n }", "public function faqdetailAction(){\n\n $this->view->faqquestion = $this->ModelObj->faqdetails();\n\n \n\n }", "public function actionView($id) {\n\n\n $staff_edu = StaffInfoEducation::findOne(['staff_id' => $id]);\n $other_info = StaffOtherInfo::findOne(['staff_id' => $id]);\n $staff_previous_employer = StaffPerviousEmployer::findAll(['staff_id' => $id]);\n $staff_family_details = \\common\\models\\StaffEnquiryFamilyDetails::findAll(['staff_id' => $id]);\n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'staff_edu' => $staff_edu,\n 'staff_other_info' => $other_info,\n 'staff_previous_employer' => $staff_previous_employer,\n 'staff_family_details' => $staff_family_details\n ]);\n }", "function view()\n\t{\n\t\tglobal $tree, $ilCtrl;\n\n\t\tinclude_once(\"classes/class.ilFrameTargetInfo.php\");\n\t\t\n\t\tif ($this->id > 0 && !$this->tree->isInTree($this->id))\n\t\t{\n\t\t\t$this->ctrl->setParameter($this, 'bmf_id', '');\n\t\t\t$this->ctrl->redirect($this);\n\t\t}\n\t\t\n\t\t$mtree = new ilTree($_SESSION[\"AccountId\"]);\n\t\t$mtree->setTableNames('bookmark_tree','bookmark_data');\n\n\t\t$objects = ilBookmarkFolder::getObjects($this->id);\n\n\t\t$s_mode = ($this->mode == \"tree\")\n\t\t\t\t? \"flat\"\n\t\t\t\t: \"tree\";\n\n//\t\t$this->tpl->setTreeFlatIcon($this->ctrl->getLinkTarget($this).\"&set_mode=\".$s_mode,\n//\t\t\t$s_mode);\n\n\t\tinclude_once 'Services/PersonalDesktop/classes/class.ilBookmarkAdministrationTableGUI.php';\n\t\t$table = new ilBookmarkAdministrationTableGUI($this);\n\t\t$table->setId('bookmark_adm_table');\n\t\t/*\n\t\t// return to parent folder\n\t\t// disabled\n\t\tif ($this->id != $mtree->readRootId() || $this->id ==\"\")\n\t\t{\n\t\t\t$ilCtrl->setParameter($this, \"bmf_id\", $mtree->getParentId($this->id));\n\t\t\t$objects = array_merge\n\t\t\t(\n\t\t\t\tarray\n\t\t\t\t(\n\t\t\t\t\tarray\n\t\t\t\t\t(\n\t\t\t\t\t\t\"title\" => \"..\",\n\t\t\t\t\t\t\"target\" => $ilCtrl->getLinkTarget($this),\n\t\t\t\t\t\t\"type\" => 'parent',\n\t\t\t\t\t\t\"obj_id\" => $mtree->getParentId($this->id),\n\t\t\t\t\t)\n\t\t\t\t),\n\t\t\t\t$objects\n\t\t\t);\n\t\t}\n\t\t*/\n\t\t$table->setData($objects);\n\t\t$this->tpl->setVariable(\"ADM_CONTENT\", $table->getHTML());\n\t}", "public function actionView($id){\n $orgid=getOrganisationID();\n $concept=MgfConceptNote::find()->where(['organisation_id'=>$orgid]);\n //$concept\n return $this->render('view', [\n 'model' => $this->findModel($id),\n ]);\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function actionView()\r\n {\r\n $this->_userAutehntication();\r\n /*\r\n * Check if id was submitted via GET method \r\n */\r\n if(!isset($_GET['id']))\r\n $this->_sendResponse(500, 'Error: Parameter <b>id</b> is missing' );\r\n\r\n switch($_GET['model'])\r\n {\r\n /* Find respective model */\r\n case 'posts': \r\n $model = Post::model()->findByPk($_GET['id']);\r\n break; \r\n default: \r\n $this->_sendResponse(501, sprintf('Mode <b>view</b> is not implemented for model <b>%s</b>',$_GET['model']) );\r\n exit; \r\n }\r\n if(is_null($model)) {\r\n $this->_sendResponse(404, 'No Post found with id '.$_GET['id']);\r\n } else {\r\n $this->_sendResponse(200, $this->_getEncodedData($_GET['model'], $model->attributes));\r\n }\r\n }", "public function show()\n {\n\t\t//$result = $a->selectAll();\n include(\"view/bureau.html\");\n }", "public function view(int $id)\r\n {\r\n }", "function ship_detail()\n\t\t{\n\t\t\t$id_kapal = $this->uri->segment(5);\n\t\t\t// echo $id_kapal;\n\t\t\t$data['ship'] = $this->ship_model->get_detail_ship($id_kapal);\n\t\t\t$data['detail_ship'] = $this->ship_model->get_ships_type($data['ship']['id_ship_type']);\n\t\t\t$template = \"vacantsea/template_detail\"; //memanggil template selain di dalam company\n\t\t\t$new_page = \"company/detail_company/ships/ships_detail\"; //halaman detail yang baru jika tidak menggunakan template detail company\n\t\t\t$this->directPageDetails(\"ships/ships_detail\",\"\",$data, $template, $new_page);\n\t\t}", "public function show_detail($i_id=0)\r\n {\r\n try\r\n {\r\n if(trim($i_id)!=\"\")\r\n {\r\n $info=$this->mod_rect->fetch_this(decrypt($i_id));\r\n\r\n if(!empty($info))\r\n {\r\n $temp=array();\r\n $temp[\"s_id\"]= encrypt($info[\"id\"]);////Index 0 must be the encrypted PK \r\n\t\t\t\t\t$temp[\"s_title\"]= trim($info[\"s_title\"]);\r\n\t\t\t\t\t$temp[\"s_description\"]= trim($info[\"s_description\"]);\r\n\t\t\t\t\t$temp[\"s_buyer\"]= trim($info[\"s_buyer_name\"]);\r\n\t\t\t\t\t$temp[\"s_category\"] = trim($info[\"s_category\"]);\r\n\t\t\t\t\t$temp[\"s_is_active\"]= trim($info[\"s_is_active\"]);\r\n\t\t\t\t\t$temp[\"dt_created_on\"]= trim($info[\"dt_entry_date\"]);\r\n\t\t\t\t\t$temp[\"dt_approved_on\"]= trim($info[\"dt_approval_date\"]);\r\n\t\t\t\t\t$temp[\"dt_expired_on\"]= trim($info[\"dt_expire_date\"]);\r\n\t\t\t\t\tpr($temp);\r\n\t\t\t\t\t$this->data[\"info\"]=$temp;\r\n unset($temp);\r\n }\r\n unset($info);\r\n }\r\n $this->add_css(\"css/admin/style.css\");///include main css\r\n $this->add_js(\"js/jquery/jquery-1.4.2.js\");///include main css\r\n $this->add_css(\"js/jquery/themes/ui-darkness/ui.all.css\");///include jquery css\r\n \r\n $this->render(\"comm_payment_report/show_detail\",TRUE);\r\n unset($i_id);\r\n }\r\n catch(Exception $err_obj)\r\n {\r\n show_error($err_obj->getMessage());\r\n } \r\n }", "public function show($id)\n {\n //$this->_DetailItem();\n }", "public function actionIndexByStaf(){\n $searchModel = new PermohonanIzinSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $pegawai = Pegawai::find()->where(['user_id' => Yii::$app->user->identity->user_id])->one();\n $dataProvider->query->andWhere(['hrdx_pegawai.pegawai_id' => $pegawai->pegawai_id])->all();\n\n return $this->render('indexByStaf',[\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexShowSet()\n {\n $navid = I('get.nav') ? I('get.nav') : 0;\n $pid = M('admin_nav')->where('id=' . $navid)->find()['pid'];\n $navpname = M('admin_nav')->where('id=' . $pid)->find()['name'];\n $navname = M('admin_nav')->where('id=' . $navid)->find()['name'];\n $re = M('category')->where('navid=' . $navid)->select();\n $arr = array();\n foreach ($re as $k => $v) {\n $arr[] = $v['id'];\n }\n $where['cateid'] = array('in', $arr);\n $where['status'] = 1;\n $data = M('ziliao')->where($where)->order('order_number')->select();\n $assign = array(\n 'data' => $data,\n 'navname' => $navname,\n 'navpname' => $navpname,\n );\n // var_dump($data);die;\n $this->assign($assign);\n $this->display();\n\n }", "public function topAction()\n {\n $this->view->title = 'FENS様検索エンジン管理システム|FENS';\n $this->render();\n }", "public function viewAction()\n {\n $this->loadLayout();\n $id = $this->getRequest()->getParam('id');\n $model = Mage::getModel('oggetto_oneclick/order')->load($id);\n Mage::register('order', $model);\n $this->renderLayout();\n }", "public function actionView($id)\n {\n $dispositivos = PrefacturaDispositivoFijoElectronico::find()->where('id_prefactura_electronica='.$id)->all();\n //$count_fijo = $dispositivos->count();\n // $pag_fijos = new Pagination([\n // 'defaultPageSize'=>10,\n // 'totalCount' => $dispositivos->count()\n // ]);\n // $disp_fijos = $dispositivos\n // ->offset($pag_fijos->offset)\n // ->limit($pag_fijos->limit)\n // ->all();\n\n $modelo=new PrefacturaDispositivoFijoElectronico();\n $variables=PrefacturaDispositivoVariableElectronico::find()->where('id_prefactura_electronica='.$id)->all();\n $monitoreos=PrefacturaMonitoreo::find()->where('id_prefactura_electronica='.$id)->all();\n\n\n if (isset($_POST['fecha_factura'])) {\n $model =PrefacturaElectronica::find()->where('id='.$id)->one();\n $model->setAttribute('numero_factura', $_POST['num_factura']);\n $model->setAttribute('fecha_factura', $_POST['fecha_factura']);\n\n $model->save();\n\n return $this->redirect(['view', 'id' => $id ]);\n }\n\n\n\n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'dispositivos' => $dispositivos/*$disp_fijos*/,\n 'pag_fijos'=>$pag_fijos,\n 'modelo'=>$modelo,\n 'variables'=>$variables,\n 'monitoreos'=>$monitoreos\n ]);\n }", "public function getAction()\n {\n \t$id = $this->getRequest()->getParam('id');\n\t\t$this->_objectMapper->find($id, $this->_object);\n $this->view->question = $this->_object;\n\t\t$this->view->isMarked = $this->_objectMapper->isMarked($id);\n }", "public function showAction() {}", "public function landIrrigationDetailAction(){\n\n\t\t\t\t$params = $this->getRequest()->getParams(); \n\t\t\t\t$db = $this->db;\n\t\t\t\t$secretkey = $this->secretkey; \n\t\t\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\";\n\t\t\t\t$farmer_code\t= isset($params['farmer_code'])?$params['farmer_code']:\"\";\n\t\t\t\t$land_id\t= isset($params['land_id'])?$params['land_id']:\"\";\n\t\t\t\t$irri_type_id \t= isset($params['irri_type_id'])?$params['irri_type_id']:\"\";\n\t\t\t\t$irri_no_id\t= isset($params['irri_no_id'])?$params['irri_no_id']:\"\";\n\t\t\t\t$stage_id\t= isset($params['stage_id'])?$params['stage_id']:\"\";\n\t\t\t\t$irri_date\t= isset($params['irri_date'])?$params['irri_date']:\"\";\n\t\t\t\t$days_after_sowing\t= isset($params['days_after_sowing'])?$params['days_after_sowing']:\"\"; \n\t\t\t\t$sink_date_time\t= isset($params['sink_date_time'])?$params['sink_date_time']:\"\";\n\n\n\t\t\t\t$error_code = 1;\n\t\t\t\t$succes = FALSE;\n\t\t\t\ttry{\n\t\t\t\t\t$db->beginTransaction();\n\t\t\t\t\tif($secretkey != $appkey){\n\t\t\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t\t\t}\t\n\t\t\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$user = new Application_Model_Users();\n\t\t\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t\t\t} \n\t\t\t\t\tif(!empty($alldata['DeviceID'])){\t\t\t\n\t\t\t\t\t\tif($alldata['DeviceID'] != $device_id){\n\t\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac'){\n\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t\t\t}\t\n\n\t\t\t\t\tif($alldata['App_Access_Status'] == 2){\n\t\t\t\t\t\t$error_code = 2;\n\t\t\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$farmerMaster = new Application_Model_Farmermasters();\n\t\t\t\t\t$allFarmerData = $farmerMaster->getFarmerDetailsByFarmerCode($farmer_code); \t\n\t\t\t\t\t$farmerID = $allFarmerData['id'];\n\t\t\t\t\t$farmerCode = $allFarmerData['FarmerCode'];\n\n\n\t\t\t\t\t$land_irrigation = array(); \n\t\t\t\t\t$land_irrigation['land_id'] = $land_id;\n\t\t\t\t\t$land_irrigation['irri_type_id'] = $irri_type_id;\n\t\t\t\t\t$land_irrigation['irri_no_id'] = $irri_no_id;\n\t\t\t\t\t$land_irrigation['stage_id'] = $stage_id;\n\t\t\t\t\t$land_irrigation['irri_date'] = $irri_date;\n\t\t\t\t\t$land_irrigation['days_after_sowing'] = $days_after_sowing;\n\t\t\t\t\t$land_irrigation['farmer_code'] = $farmer_code;\n\t\t\t\t\t$land_irrigation['farmer_id'] = $farmerID;\n\t\t\t\t\t$land_irrigation['fe_code'] = $LoginID;\n\t\t\t\t\t$land_irrigation['sink_date_time'] = $sink_date_time;\n\t\t\t\t\t$land_irrigation['created'] = $this->currdate; \n\t\t\t\t\t$db->insert('logi_land_irrigation', $land_irrigation);\n\n\t\t\t\t\t$landdetailId = $db->lastInsertId();\n\n\t\t\t\t\t$db->commit();\n\t\t\t\t\t$succes = TRUE;\t \n\t\t\t\t}\n\n\t\t\t\tcatch(Exception $e){\n //Rollback transaction\n\t\t\t\t\t$db->rollBack();\n\t\t\t\t\t$error= $e->getMessage();\n\t\t\t\t}\n\n\t\t\t\tif($succes == TRUE ){\n\t\t\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Land irrigation Detail Inserted successfully.', 'land_irrigation_id'=>$landdetailId));\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error));\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t}", "private function detailView($id)\n { \n $model = $this->findModel($id);\n \n $searchModel = new SearchInstructionDisposalDetail();\n $dataProvider = $searchModel->search(Yii::$app->request->post(), $id);\n \n Yii::$app->session->set('idInstWhTr', $model->id);\n \n return [\n 'model' => $model,\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ];\n }", "public function actionInvFalt()\n\t\t{\n\t\t\t$model=new Reports();\n\t\t\t$this->render('invFalt',array(\n\t\t\t\t'model'=>$model,\n\t\t\t));\n\t\t}", "public function actionPreview($id=1)\n {\n\n $estimates = Estimates::FindEstimateSql($id);\n // var_dump($estimates); die();\n return $this->render('preview', [\n 'id' => $id,\n 'estimates' => $estimates,\n ]);\n \n }", "public function actionView($id)\n {\n if (\\Yii::$app->user->can('administrador')) {\n $this->layout =\"main-admin\";\n Yii::$app->view->params['iconoAdministrador'] = 'fa fa-file-text';\n Yii::$app->view->params['tituloAdministrador'] = 'Factura de Gastos';\n Yii::$app->view->params['subTituloAdministrador'] = 'Lista de Factura de Gastos';\n Yii::$app->view->params['subTitulo2Administrador'] = 'Detalle de Factura de Gastos';\n Yii::$app->view->params['linkAdministrador'] = 'index';\n }\n else if (\\Yii::$app->user->can('usuario')){\n $this->layout =\"main-usuario\";\n Yii::$app->view->params['iconoAdministrador'] = 'fa fa-home';\n Yii::$app->view->params['tituloAdministrador'] = 'Apartamentos';\n Yii::$app->view->params['subTituloAdministrador'] = 'Lista de Apartamentos';\n Yii::$app->view->params['subTitulo2Administrador'] = 'Detalle de Apartamento';\n Yii::$app->view->params['linkAdministrador'] = 'apartamentos/index';\n }\n $model2 = FacturaGastosItems::find()->where(['factura_gastos_id_factura_gastos' => $id])->all();\n return $this->render('view', [\n 'model' => $this->findModel($id), 'model2' => $model2\n ]);\n }", "public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t\t'keyid'=>$id\n\t\t));\n\t}", "public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t\t'keyid'=>$id\n\t\t));\n\t}", "public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t\t'keyid'=>$id\n\t\t));\n\t}", "public function viewAction() {\n\t\t$role = new Role_Model_Role();\n\t\t$this->view->record = $role->findById($this->getRequest()->getParam('id'));\n\t}", "public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'\t\t=>$this->loadModel($id),\n\t\t\t'dokter'\t=>$this->loadModelDetailDokter($id),\n\t\t\t'perawat'\t=>$this->loadModelDetailPerawat($id),\n\t\t\t'obat'\t\t=>$this->loadModelDetailObat($id),\n\t\t\t'perawatan'\t=>$this->loadModelDetailPerawatan($id),\n\t\t));\n\t}", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "function main($action) {\n\t\t\t\n\t\t\t// da wir keine seite brauchen, setzen wir den start-view auf uns\n\t\t\t$this->set_start_view('admin_list');\n\t\t\t\n\t\t\t$this->action = $action;\n\t\t\t$this->vid = UTIL::get_post('vid');\n\t\t\t\n\t\t\tswitch(strtolower($action['event'])) \n\t\t\t{\n\t\t\t\tcase 'admin_list':\t$this->set_start_view('admin_list');\tbreak;\n\t\t\t\tcase 'open':\t\t$this->action_open();\t\t\t\t\tbreak;\n\t\t\t\tcase 'close':\t\t$this->action_close();\t\t\t\t\tbreak;\n\t\t\t\tcase 'add':\t\t\t$this->action_add();\t\t\t\t\tbreak;\n\t\t\t\tcase 'remove':\t\t$this->action_remove();\t\t\t\t\tbreak;\n\t\t\t\tcase 'clear':\t\t$this->action_clear();\t\t\t\t\tbreak;\n\t\t\t\tcase 'finish':\t\t$this->action_finish();\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t}", "public function viewAction()//23:15\n {\n\n }", "public function view() {\r\n\r\n\t}", "function view(){\n\t\t$sale_number = $this->uri->segment(3);\n\n\t\t$data['purchase'] = $this->m_sale->get_one($sale_number)->row_array();\n\t\t$data['purchdetail'] = $this->m_sale->get_detail($sale_number);\n\n\t\t$this->template->load('inv_template', 'orders/v_view_sale', $data);\n\t}", "public function indexAction(){\n $field_id = $this->_request->getParam('f');\n if ($field_id) {\n $_SESSION['Default']['field'] = $field_id;\n \n /**for groups view**/\n $user = Zend_Auth::getInstance()->getStorage()->read();\n $group_DB = new Application_Model_DbTable_Group();\n $groups = $group_DB->getAll( $user->ganID, $_SESSION['Default']['field']);\n if ($groups) {\n $this->view->groups = $groups;\n }\n\n /**for pop up**/ \n $plans_DB = new Application_Model_DbTable_Planing ();\n $goals_DB = new Application_Model_DbTable_Target ();\n $_groups = array();\n foreach($groups as $g) {\n $lastplan = $plans_DB->getLastPlan($g['groupID'], $_SESSION['Default']['field']);\n if ($lastplan) {\n $g['plan']= $lastplan['game_name'];\n $g['goal']= $goals_DB->getGoalName($lastplan['goal_id']);\n $_groups[] = $g;\n }\n }\n \n $this->view->groups_with_plans = $_groups;\n }\n }", "public function show(asesor $asesor)\n {\n //\n }", "function showCalloutAction() {\n\t\t@$id = DevblocksPlatform::importGPC($_REQUEST['id'],'string');\n\n\t\t$tpl = DevblocksPlatform::getTemplateService();\n\t\t$tpl->assign('path', $this->_TPL_PATH);\n\n\t\t$callouts = CerberusApplication::getTourCallouts();\n\t\t\n\t $callout = array();\n\t if(isset($callouts[$id]))\n\t $callout = $callouts[$id];\n\t\t\n\t $tpl->assign('callout',$callout);\n\t\t\n\t\t$tpl->cache_lifetime = \"0\";\n\t\t$tpl->display('tour/callout.tpl');\n\t}", "public function detailAction()\r\n {\r\n $typeId = $this->_getParam('citypeId');\r\n\r\n $citypeServiceGet = new Service_Citype_Get($this->translator, $this->logger, parent::getUserInformation()->getThemeId());\r\n $currentCiType = $citypeServiceGet->getCiType($typeId);\r\n\r\n if ($currentCiType[Db_CiType::PARENT_CI_TYPE_ID])\r\n $parent = $citypeServiceGet->getCiType($currentCiType[Db_CiType::PARENT_CI_TYPE_ID]);\r\n if ($currentCiType[Db_CiType::DEFAULT_PROJECT_ID])\r\n $defaultProject = $citypeServiceGet->getProject($currentCiType[Db_CiType::DEFAULT_PROJECT_ID]);\r\n if ($currentCiType[Db_CiType::DEFAULT_ATTRIBUTE_ID])\r\n $defaultAttribute = $citypeServiceGet->getAttribute($currentCiType[Db_CiType::DEFAULT_ATTRIBUTE_ID]);\r\n if ($currentCiType[Db_CiType::DEFAULT_SORT_ATTRIBUTE_ID])\r\n $defaultSortAttribute = $citypeServiceGet->getAttribute($currentCiType[Db_CiType::DEFAULT_SORT_ATTRIBUTE_ID]);\r\n\r\n $attributes = $citypeServiceGet->getAttributes($typeId);\r\n $relations = $citypeServiceGet->getRelations($typeId);\r\n\r\n $this->view->attributes = $attributes;\r\n $this->view->relations = $relations;\r\n $this->view->parent = $parent;\r\n $this->view->defaultProject = $defaultProject;\r\n $this->view->defaultAttribute = $defaultAttribute;\r\n $this->view->defaultSortAttribute = $defaultSortAttribute;\r\n //$this->view->iconPath = APPLICATION_PUBLIC.$path;\r\n $this->view->icon = $currentCiType[Db_CiType::ICON];\r\n $this->view->ciType = $currentCiType;\r\n }", "abstract protected function show();", "public function view_marksheet($display_id = null){\n if ($this->resultArchive_m->std_info($display_id)) {\n $data= [];\n $data['title'] = \"View Details\";\n $data['get_marksheet'] = 'resultArchive/details';\n $data['std_info'] = $this->resultArchive_m->std_info($display_id);\n // $data['get_info'] = $this->resultArchive_m->get_single_info($display_id);\n $data['get_waiver_sub'] = $this->resultArchive_m->get_waiver_sub($display_id);\n $data['get_waiver_display_id'] = $this->resultArchive_m->get_display_id($display_id);\n $data['dept_full_name'] =$this->resultArchive_m->get_dept($data['std_info']->std_dept);\n $data['point_table'] = $this->resultArchive_m->point_table($display_id);\n $data['get_earn_point'] = $this->resultArchive_m->get_earn_point($display_id, $null = 0);\n $data['per_sub_point'] = $this->resultArchive_m->per_sub_point_table($display_id);\n $this->load->view('dashboard_layout',$data);\n }else {\n redirect(base_url('resultArchive/resultArchive'));\n }\n }", "function action_listview() {\n\t\t$this->view = 'toplist';\n\t\t//$GLOBALS['log']->fatal('in controller');\n\t\t$this->bean = new REG_PatientListView();\n\t}", "public function applicationDetailAction() {\n $job_id = $this->_getParam('job_id');\n $this->view->applicationDetail = Engine_Api::_()->getItem('sitereview_job', $job_id);\n }", "public function actionView()\n {\n $id = Yii::app()->request->getParam('sid',0);\n $ret['response'] = array(\n 'code'=>0,\n 'msg'=>'ok'\n );\n $ret['data'] = array();\n\n if ($id) {\n $sql = \"select * from {{station_param}}\n where sn_key=\" . $id;\n $row = Yii::app()->bms->createCommand($sql)->queryRow();\n if ($row) {\n $ret['data'] = $row;\n }else{\n $ret['response'] = array(\n 'code'=>-1,\n 'msg'=>'没有该站参数!'\n );\n }\n }else{\n $ret['response'] = array(\n 'code'=>-1,\n 'msg'=>'没有该站参数!'\n );\n }\n echo json_encode($ret);\n\n }", "public function show($if)\n {\n //\n }", "public function actionView($id)\n {\n\n $search_dep = new DepositSearch();\n $search_dep->investor = $id;\n $deposit = $search_dep->search(Yii::$app->request->queryParams);\n \n $search_with = new WithdrawSearch();\n $search_with->investor = $id;\n $withdraw = $search_with->search(Yii::$app->request->queryParams);\n\n $search_pur = new PurchaseSearch();\n $search_pur->investor = $id;\n $purchase = $search_pur->search(Yii::$app->request->queryParams);\n\n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'deposit'=>$deposit,\n 'withdraw'=>$withdraw,\n 'purchase'=>$purchase,\n ]);\n }", "public function show()\n\t{\n\t\t\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view');\n\t}", "public function viewAction()\n {\n // Check front disable\n if ($this->config('disable_front')) {\n return $this->jumpToDenied(__('View information is disable'));\n }\n\n $page = $this->params('page', 1);\n $limit = Pi::config('list_limit', 'user');\n $offset = (int)($page - 1) * $limit;\n $uid = _get('uid');\n\n Pi::service('authentication')->requireLogin();\n\n // Get timeline\n $count = Pi::api('timeline', 'user')->getCount($uid);\n $timeline = Pi::api('timeline', 'user')->get($uid, $limit, $offset);\n\n // Get timeline meta list\n $timelineMetaList = Pi::api('timeline', 'user')->getList();\n\n // Set timeline meta\n foreach ($timeline as &$item) {\n if (!isset($timelineMetaList[$item['timeline']])) {\n continue;\n }\n $item['icon'] = $timelineMetaList[$item['timeline']]['icon'];\n $item['title'] = $timelineMetaList[$item['timeline']]['title'];\n }\n\n // Get user base info\n $user = Pi::api('user', 'user')->get(\n $uid,\n ['name', 'country', 'city', 'time_activated'],\n true,\n true\n );\n $user['name'] = isset($user['name']) ? $user['name'] : null;\n\n // Set paginator\n $paginatorOption = [\n 'count' => $count,\n 'limit' => $limit,\n 'page' => $page,\n 'controller' => 'home',\n 'action' => 'view',\n 'uid' => $uid,\n ];\n $paginator = $this->setPaginator($paginatorOption);\n\n $this->view()->assign([\n 'uid' => $uid,\n 'name' => 'homepage',\n 'timeline' => $timeline,\n 'paginator' => $paginator,\n 'user' => $user,\n ]);\n\n $this->view()->setTemplate('home-index');\n $this->view()->assign('view', true);\n $this->view()->headTitle(sprintf(__('%s activities'), $user['name']));\n $this->view()->headdescription(sprintf(__('View %s activities'), $user['name']), 'set');\n $this->view()->headkeywords($this->config('head_keywords'), 'set');\n }", "public function actionView($id)\n\t{\n $jobDetails = Yii::app()->db->createCommand()\n ->select('s.JOB_ID AS job_id,\n s.sf_username AS sf_username,\n s.job_name AS job_name,\n s.job_type AS job_type,\n s.job_status AS job_status,\n l.STATUS AS job_status_2,\n l.REPLAYDATE AS job_start,\n l.ENDDATE AS job_end,\n l.LOG_FIELD AS job_log')\n ->from('job_summary s')\n ->join('job_log l', 's.JOB_ID = l.ID_JOB')\n ->where(array('and','s.JOB_ID = '.$id)) \n ->queryRow();\n \n $transDetails = Yii::app()->db->createCommand()\n ->select('trans_summary.JOB_ID AS job_id,\n trans_summary.ID_BATCH AS trans_id,\n trans_summary.trans_name,\n trans_summary.sf_username,\n trans_summary.source,\n trans_summary.target,\n trans_log.STATUS,\n trans_log.LINES_INPUT,\n trans_log.LINES_OUTPUT,\n trans_log.LINES_REJECTED,\n trans_log.REPLAYDATE AS STARTDATE,\n trans_log.ENDDATE,\n trans_log.LOG_FIELD')\n ->from('trans_summary trans_summary')\n ->join('trans_log trans_log', 'trans_summary.ID_BATCH = trans_log.ID_BATCH')\n ->where(array('and','trans_summary.JOB_ID = '.$id))\n ->order('trans_log.REPLAYDATE ASC')\n ->queryAll();\n \n \n $this->render('view',array(\n\t\t\t'jobDetails'=>$jobDetails,\n 'transDetails'=>$transDetails,\n\t\t));\n\t}" ]
[ "0.68188107", "0.6797727", "0.677921", "0.65227747", "0.65227747", "0.6490528", "0.64677656", "0.64150864", "0.6393178", "0.63520163", "0.6351398", "0.631365", "0.6299754", "0.6286404", "0.62359726", "0.62010765", "0.6178616", "0.6175141", "0.6159682", "0.615695", "0.61183983", "0.6104177", "0.6100232", "0.60943955", "0.6063342", "0.6046311", "0.6043505", "0.60432386", "0.60404754", "0.6040228", "0.60302114", "0.60302114", "0.6018885", "0.6015433", "0.6002015", "0.59975153", "0.59961516", "0.59934723", "0.5978337", "0.59772736", "0.595657", "0.59529495", "0.59375554", "0.59294593", "0.5927706", "0.5922568", "0.5921057", "0.5910068", "0.5905986", "0.5899298", "0.5893995", "0.58891046", "0.58878636", "0.58873266", "0.5869255", "0.58599544", "0.58557415", "0.5844737", "0.5843348", "0.58356273", "0.5831194", "0.5830942", "0.5827864", "0.5825819", "0.58231705", "0.58221394", "0.58124083", "0.5807673", "0.5807497", "0.5804321", "0.5801111", "0.5794068", "0.5793475", "0.57909906", "0.57865536", "0.5783884", "0.5783884", "0.5783884", "0.577947", "0.5777616", "0.577508", "0.5772645", "0.5771592", "0.57643473", "0.57589424", "0.5757852", "0.57529", "0.57510453", "0.57491857", "0.57453346", "0.5744338", "0.5736344", "0.57360286", "0.57358176", "0.573375", "0.573096", "0.57296944", "0.5728203", "0.57256776", "0.57152855" ]
0.70173097
0
actionid: viewbyhrd actiondesc: Display detail view of izin for HRD
public function actionViewByHrd($id){ return $this->render('viewByHrd',[ 'model' => $this->findModel($id), ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionIndexByHrd(){\n $searchModel = new PermohonanIzinSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('indexByHrd',[\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionHtView($id)\n {\n ob_start();\n Yii::app()->theme='back';\n $rec=HtuseHome::model()->findByPk($id);\n\n $this->render('htview',array('view'=>$rec));\n\n }", "public function actionViewByHrdStaf($id){\n return $this->render('viewByHrdStaf',[\n 'model' => $this->findModel($id),\n ]);\n }", "public function viewAction()\n {\n $id = $this->_getPrimaryId();\n $row = $this->_getRow($id);\n\n $this->view->row = $row;\n }", "public function landShowingDetailAction(){\n\n\t\t\t\t$params = $this->getRequest()->getParams(); \n\t\t\t\t$db = $this->db;\n\t\t\t\t$secretkey = $this->secretkey;\n\n\t\t\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\";\n\t\t\t\t$farmer_code\t= isset($params['farmer_code'])?$params['farmer_code']:\"\";\n\t\t\t\t$land_id\t= isset($params['land_id'])?$params['land_id']:\"\";\n\t\t\t\t$mou_type_id\t= isset($params['mou_type_id'])?$params['mou_type_id']:\"\";\n\t\t\t\t$variety_id\t= isset($params['variety_id'])?$params['variety_id']:\"\";\n\t\t\t\t$category_id\t= isset($params['category_id'])?$params['category_id']:\"\";\n\t\t\t\t$lot_no\t= isset($params['lot_no'])?$params['lot_no']:\"\";\n\t\t\t\t$sowing_date\t= isset($params['sowing_date'])?$params['sowing_date']:\"\";\n\t\t\t\t$tcw_of_seed\t= isset($params['tcw_of_seed'])?$params['tcw_of_seed']:\"\";\n\t\t\t\t$sowing_depth\t= isset($params['sowing_depth'])?$params['sowing_depth']:\"\";\n //$sowing_depth_unit_id\t= isset($params['sowing_depth_unit_id'])?$params['sowing_depth_unit_id']:\"\";\n\t\t\t\t$sink_date_time\t= isset($params['sink_date_time'])?$params['sink_date_time']:\"\";\n\n\n\t\t\t\t$seed_rate_kg_per_acre\t= isset($params['seed_rate_kg_per_acre'])?$params['seed_rate_kg_per_acre']:\"\";\n\t\t\t\t$seed_rate_per_m2\t= isset($params['seed_rate_per_m2'])?$params['seed_rate_per_m2']:\"\";\n\t\t\t\t$sowing_type_id\t= isset($params['sowing_type_id'])?$params['sowing_type_id']:\"\";\n\t\t\t\t$sowing_moisture_source\t= isset($params['sowing_moisture_source'])?$params['sowing_moisture_source']:\"\";\n\t\t\t\t$row_to_row_diff\t= isset($params['row_to_row_diff'])?$params['row_to_row_diff']:\"\";\n // $row_to_row_diff_unit_id\t= isset($params['row_to_row_diff_unit_id'])?$params['row_to_row_diff_unit_id']:\"\";\n\n\t\t\t\t$error_code = 1;\n\t\t\t\t$succes = FALSE;\n\t\t\t\ttry{\n\t\t\t\t\t$db->beginTransaction();\n\t\t\t\t\tif($secretkey != $appkey){\n\t\t\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t\t\t}\t\n\t\t\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$user = new Application_Model_Users();\n\t\t\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t\t\t} \n\t\t\t\t\tif(!empty($alldata['DeviceID'])){\t\t\t\n\t\t\t\t\t\tif($alldata['DeviceID'] != $device_id){\n\t\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac'){\n\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t\t\t}\t\n\n\t\t\t\t\tif($alldata['App_Access_Status'] == 2){\n\t\t\t\t\t\t$error_code = 2;\n\t\t\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$farmerMaster = new Application_Model_Farmermasters();\n\t\t\t\t\t$allFarmerData = $farmerMaster->getFarmerDetailsByFarmerCode($farmer_code); \t\n\t\t\t\t\t$farmerID = $allFarmerData['id'];\n\t\t\t\t\t$farmerCode = $allFarmerData['FarmerCode'];\n\n\n\t\t\t\t\t$land_showing = array(); \n\t\t\t\t\t$land_showing['land_id'] = $land_id;\n\t\t\t\t\t$land_showing['mou_type_id'] = $mou_type_id;\n\t\t\t\t\t$land_showing['variety_id'] = $variety_id;\n\t\t\t\t\t$land_showing['category_id'] = $category_id;\n\t\t\t\t\t$land_showing['lot_no'] = $lot_no;\n\t\t\t\t\t$land_showing['tcw_of_seed'] = $tcw_of_seed;\n\t\t\t\t\t$land_showing['sowing_depth'] = $sowing_depth;\n\t\t\t\t\t$land_showing['sowing_date'] = $sowing_date;\n // $land_showing['sowing_depth_unit_id'] = $sowing_depth_unit_id;\n\t\t\t\t\t$land_showing['seed_rate_kg_per_acre'] = $seed_rate_kg_per_acre;\n\t\t\t\t\t$land_showing['seed_rate_per_m2'] = $seed_rate_per_m2;\n\t\t\t\t\t$land_showing['sowing_type_id'] = $sowing_type_id;\n\t\t\t\t\t$land_showing['sowing_moisture_source'] = $sowing_moisture_source;\n\t\t\t\t\t$land_showing['row_to_row_diff'] = $row_to_row_diff;\n // $land_showing['row_to_row_diff_unit_id'] = $row_to_row_diff_unit_id;\n\t\t\t\t\t$land_showing['farmer_code'] = $farmer_code;\n\t\t\t\t\t$land_showing['farmer_id'] = $farmerID;\n\t\t\t\t\t$land_showing['fe_code'] = $LoginID;\n\t\t\t\t\t$land_showing['sink_date_time'] = $sink_date_time;\n\t\t\t\t\t$land_showing['created'] = $this->currdate; \n\t\t\t\t\t$db->insert('logi_land_showing', $land_showing);\n\n\t\t\t\t\t$landdetailId = $db->lastInsertId();\n\n\t\t\t\t\t$db->commit();\n\t\t\t\t\t$succes = TRUE;\t \n\t\t\t\t}\n\n\t\t\t\tcatch(Exception $e){\n //Rollback transaction\n\t\t\t\t\t$db->rollBack();\n\t\t\t\t\t$error= $e->getMessage();\n\t\t\t\t}\n\n\t\t\t\tif($succes == TRUE ){\n\t\t\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Land Showing Detail Inserted successfully.', 'showing_id'=>$landdetailId));\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error));\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t}", "public function view($view_id) {\n\n\t\t$data = $this->load_module_info ();\n\n\t\t$data['upload_folder'] = $this->upload_folder;\n\n\t\t$where = array($this->table.'.'.$this->primary_key => decode_value($view_id), $this->table);\n\n\t\t$select_array = array ('*');\n\n\t\t\n\t\t$records = $this->Mydb->get_all_records ( $select_array, $this->table, $where, '', '', '', '', '', '' );\n\n\t\t$data ['result'] = $records[0];\n\n\t\t$this->load->view($this->folder.\"/\".$this->module.\"-view\",$data);\n\t}", "public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n DomainConst::KEY_ACTIONS => $this->listActionsCanAccess,\n ));\n }", "public function actionView($id)\n {\n $model = $this->findModel($id);\n\n if(!empty($model)){\n\n $adjustment_details = ImAdjustDetail::find()->where(['im_adjust_head_id'=> $model->id])->all();\n\n return $this->render('view', [\n 'model' => $model,\n 'adjustment_details' => $adjustment_details\n ]); \n }\n \n }", "public function view($rfp_id){\n\n $data['title'] = 'Admin View Request';\n $data['heading'] = 'View Request Page'; \n $data['rfp_id'] = decode($rfp_id);\n\n $data['record']=$this->Rfp_model->get_result('rfp',['id' => decode($rfp_id)],'1');\n // pr($data['record'],1);\n $data['subview'] = 'admin/rfp/view';\n $this->load->view('admin/layouts/layout_main', $data);\n }", "public function actionView($id)\n {\n\n $search_dep = new DepositSearch();\n $search_dep->investor = $id;\n $deposit = $search_dep->search(Yii::$app->request->queryParams);\n \n $search_with = new WithdrawSearch();\n $search_with->investor = $id;\n $withdraw = $search_with->search(Yii::$app->request->queryParams);\n\n $search_pur = new PurchaseSearch();\n $search_pur->investor = $id;\n $purchase = $search_pur->search(Yii::$app->request->queryParams);\n\n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'deposit'=>$deposit,\n 'withdraw'=>$withdraw,\n 'purchase'=>$purchase,\n ]);\n }", "public function landIrrigationDetailAction(){\n\n\t\t\t\t$params = $this->getRequest()->getParams(); \n\t\t\t\t$db = $this->db;\n\t\t\t\t$secretkey = $this->secretkey; \n\t\t\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\";\n\t\t\t\t$farmer_code\t= isset($params['farmer_code'])?$params['farmer_code']:\"\";\n\t\t\t\t$land_id\t= isset($params['land_id'])?$params['land_id']:\"\";\n\t\t\t\t$irri_type_id \t= isset($params['irri_type_id'])?$params['irri_type_id']:\"\";\n\t\t\t\t$irri_no_id\t= isset($params['irri_no_id'])?$params['irri_no_id']:\"\";\n\t\t\t\t$stage_id\t= isset($params['stage_id'])?$params['stage_id']:\"\";\n\t\t\t\t$irri_date\t= isset($params['irri_date'])?$params['irri_date']:\"\";\n\t\t\t\t$days_after_sowing\t= isset($params['days_after_sowing'])?$params['days_after_sowing']:\"\"; \n\t\t\t\t$sink_date_time\t= isset($params['sink_date_time'])?$params['sink_date_time']:\"\";\n\n\n\t\t\t\t$error_code = 1;\n\t\t\t\t$succes = FALSE;\n\t\t\t\ttry{\n\t\t\t\t\t$db->beginTransaction();\n\t\t\t\t\tif($secretkey != $appkey){\n\t\t\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t\t\t}\t\n\t\t\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$user = new Application_Model_Users();\n\t\t\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t\t\t} \n\t\t\t\t\tif(!empty($alldata['DeviceID'])){\t\t\t\n\t\t\t\t\t\tif($alldata['DeviceID'] != $device_id){\n\t\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac'){\n\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t\t\t}\t\n\n\t\t\t\t\tif($alldata['App_Access_Status'] == 2){\n\t\t\t\t\t\t$error_code = 2;\n\t\t\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$farmerMaster = new Application_Model_Farmermasters();\n\t\t\t\t\t$allFarmerData = $farmerMaster->getFarmerDetailsByFarmerCode($farmer_code); \t\n\t\t\t\t\t$farmerID = $allFarmerData['id'];\n\t\t\t\t\t$farmerCode = $allFarmerData['FarmerCode'];\n\n\n\t\t\t\t\t$land_irrigation = array(); \n\t\t\t\t\t$land_irrigation['land_id'] = $land_id;\n\t\t\t\t\t$land_irrigation['irri_type_id'] = $irri_type_id;\n\t\t\t\t\t$land_irrigation['irri_no_id'] = $irri_no_id;\n\t\t\t\t\t$land_irrigation['stage_id'] = $stage_id;\n\t\t\t\t\t$land_irrigation['irri_date'] = $irri_date;\n\t\t\t\t\t$land_irrigation['days_after_sowing'] = $days_after_sowing;\n\t\t\t\t\t$land_irrigation['farmer_code'] = $farmer_code;\n\t\t\t\t\t$land_irrigation['farmer_id'] = $farmerID;\n\t\t\t\t\t$land_irrigation['fe_code'] = $LoginID;\n\t\t\t\t\t$land_irrigation['sink_date_time'] = $sink_date_time;\n\t\t\t\t\t$land_irrigation['created'] = $this->currdate; \n\t\t\t\t\t$db->insert('logi_land_irrigation', $land_irrigation);\n\n\t\t\t\t\t$landdetailId = $db->lastInsertId();\n\n\t\t\t\t\t$db->commit();\n\t\t\t\t\t$succes = TRUE;\t \n\t\t\t\t}\n\n\t\t\t\tcatch(Exception $e){\n //Rollback transaction\n\t\t\t\t\t$db->rollBack();\n\t\t\t\t\t$error= $e->getMessage();\n\t\t\t\t}\n\n\t\t\t\tif($succes == TRUE ){\n\t\t\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Land irrigation Detail Inserted successfully.', 'land_irrigation_id'=>$landdetailId));\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error));\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t}", "public function oldviewAction() {\n\t\t$id = (int)$this->_request->getParam('id');\n\t\tPageTitle::setTitle($this->view, $this->_request, array($id));\n\t\t$debugdate = $this->_request->getParam('debugdate');\n\t\t$layout = trim($this->_request->getParam('layout',''));\n\t\t\n\t\t$taFinder = new TeachingActivities();\n\t\t$ta = $taFinder->getTa($id);\n\t\t\n\t\tif ($ta->isReleased() != true) {\n\t\t\tthrow new Exception(\"Teaching activity $id is not released yet.\");\n\t\t}\n\t\t\n\t\t$this->view->ta = $ta;\n\n\t\t$resourceError = false;\n\t\ttry {\n\t\t\t$resourceService = new MediabankResourceService();\n\t\t\t$resources = $resourceService->getResources($id, 'ta');\n\t\t\t$allowAddResources = $resourceService->allowAdd();\n\t\t} catch (Exception $ex) {\n\t\t\t$resourceError = true;\n\t\t\t$resources = array();\n\t\t\t$allowAddResources = false;\n\t\t}\n\t\t$this->view->allowAddResources = $allowAddResources;\n\t\t$this->view->resourceError = $resourceError;\n\t\t$this->view->resources = $resources;\n\t\t\n\t\t//Check if user is a staff\n\t\t$this->view->isStaffOrAbove = UserAcl::isStaffOrAbove();\n //Store ACL for each resource action which can be accessed by the current user\n //And allow/disallow those actions. \n\t\t$this->view->resourceAcl = ResourceAcl::accessAll(array('type'=>'ta','auto_id'=>$id));\n\n\t\t$this->view->revisions = $taFinder->getTaRevisions($ta->taid);\n\t\t$this->view->released_los = $ta->getLinkedLearningObjectiveWithStatus(Status::$RELEASED);\n\t\t$this->view->title = 'Teaching Activity - '.$ta->auto_id;\n\t\t\n\t\t$studentEvaluateService = new StudentEvaluateService();\n\t\t$this->view->taEvaluations = $studentEvaluateService->getEvaluationForTaId($id);\n\n\t\t$this->view->isMyTa = Utilities::isMyTa($ta);\n\t\t$this->view->debugdate = $debugdate;\n\n if(!empty($layout)) {\n switch($layout) {\n case 'pblview': \n $this->view->pblTaTypePrev = $this->_request->getParam('pblTaTypePrev','');\n $this->view->pblTaTypeNext = $this->_request->getParam('pblTaTypeNext','');\n $this->render('pblview');\n break;\n }\n }\n\t}", "public function view($id)\n\t{\n\t\n\t\t$this->is_allowed('amuco_details_request_office_view');\n if($this->input->get('popup')){\n\t\t\t$this->data['current_page'] = 'Modal';\n\t\t}else{\n\t\t\t$this->data['current_page'] = 'View';\n\t\t}\n\t\t$this->data['amuco_details_request_office'] = $this->model_amuco_details_request_office->join_avaiable()->filter_avaiable()->find($id);\n // var_dump($this->data['amuco_details_request_office']);\n\t\t$this->template->title('Amuco Details Request Office Detail');\n\t\t$this->render('backend/standart/administrator/amuco_details_request_office/amuco_details_request_office_view', $this->data);\n\t}", "public function viewAction()\r\n {\r\n $this->indexAction();\r\n }", "public function view($id)\n\t{\n\t\t$this->is_allowed('historis_terminal_view');\n\n\t\t$this->data['historis_terminal'] = $this->model_historis_terminal->join_avaiable()->filter_avaiable()->find($id);\n\n\t\t$this->template->title('Historis Terminal Detail');\n\t\t$this->render('backend/standart/administrator/historis_terminal/historis_terminal_view', $this->data);\n\t}", "public function officer_view($id = null)\n {\n if($this->Auth->user('level') != \"Officer\" && $this->Auth->user('level') != \"Admin\")\n $this->redirect(\n array('controller' => 'Users', 'action' => 'profilehub/' . $this->Auth->user('id')));\n \n $this->assignUserToView($id); //user\n \n $allRsvps = $this->Event->EventsUser->find('all', array(\n 'conditions' => array('user_id' => $id)\n ));\n \n //returns all events to the view\n $eventdata = $this->Event->find('all', \n array(\n 'order' => array('Event.time' => 'DESC')\n ));\n \n $this->set('rsvps', $allRsvps);\n \n $numOfEvents = 0;\n $numOfMisses = 0;\n $numOfHours = 0;\n \n //count number of events, hours, and missed events\n foreach($allRsvps as $rsvp):\n if($rsvp['EventsUser']['present'] == TRUE)\n {\n $numOfEvents++;\n foreach($eventdata as $event):\n if($event['Event']['id'] == $rsvp['EventsUser']['event_id'])\n $numOfHours += $event['Event']['hours'];\n endforeach;\n }\n else\n {\n foreach($eventdata as $event):\n if($event['Event']['id'] == $rsvp['EventsUser']['event_id'] && $event['Event']['closed'])\n $numOfMisses++;\n endforeach;\n } \n endforeach;\n \n $this->set('allRsvps', $allRsvps);\n $this->set('numOfEvents', $numOfEvents);\n $this->set('numOfHours', $numOfHours);\n $this->set('numOfMisses', $numOfMisses); \n $this->set('events', $eventdata);\n \n $this->layout = 'hero-ish';\n $this->Session->write('Page', 'Hub');\n }", "protected function viewAction()\n {\n }", "public function actionView($id) {\n $dateRange=$this->getDateRange();\n\t\tif(isset($_GET['stage']) && is_numeric($_GET['stage']))\n\t\t\t$viewStage = $_GET['stage'];\n\t\telse\n\t\t\t$viewStage = null;\n\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),'viewStage'=>$viewStage, 'dateRange'=>$dateRange,\n\t\t));\n\t}", "public function actionView($id)\n {\n $entry = AuditEntry::findOne($id);\n if ($entry) {\n return $this->render('view', ['entry' => $entry]);\n } else {\n throw new \\HttpInvalidParamException('Invalid request number specified');\n }\n\n $this->redirect(['index']);\n }", "public function actionView($id)\n {\n $dis = (new Query());\n $dis ->select([ 'tf_lunas.status'])\n ->FROM('tf_lunas')\n ->andWhere('tf_lunas.id_tf_lunas=:id_a', array(':id_a'=>$id))\n ->limit(6);\n $command = $dis->createCommand();\n $dis = $command->queryAll();\n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'dis' => $dis,\n ]);\n }", "public function actionView($id)\n {\n $rand_id = rand(1, 4);\n $user_agent = Yii::app()->db->createCommand()\n ->select('name')\n ->from('user_agent')\n ->where('id=:id', array(':id'=>$rand_id))\n ->queryRow();\n\n\n $result['id'] = $id;\n $result['sum'] = 10;\n $result['user_agent'] = $user_agent['name'];\n\n $result['percent'] = Yii::app()->params['percent'];\n $result['ip'] = Yii::app()->request->getUserHostAddress();\n\n $this->render('view',array(\n 'result'=>$result,\n ));\n }", "public function view(int $id)\r\n {\r\n }", "public function show_detail($i_id=0)\r\n {}", "public function show_detail($i_id=0)\r\n {}", "public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t\t'keyid'=>$id\n\t\t));\n\t}", "public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t\t'keyid'=>$id\n\t\t));\n\t}", "public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t\t'keyid'=>$id\n\t\t));\n\t}", "private function detailView($id)\n { \n $model = $this->findModel($id);\n \n $searchModel = new SearchInstructionDisposalDetail();\n $dataProvider = $searchModel->search(Yii::$app->request->post(), $id);\n \n Yii::$app->session->set('idInstWhTr', $model->id);\n \n return [\n 'model' => $model,\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ];\n }", "public function actionView($id)\n {\n\t$model = $this->findModel($id);\n\t$modelDistributor = $model->waiter0->distributor0;\n\n return $this->render('view', [\n 'model' => $model,\n\t 'modelDistributor' => $modelDistributor,\n ]);\n }", "public function view($entryid){\n\t\t$user = $this->getUser();\n\t\tif(!isset($user[\"id\"]))return false;\n\t\t$query = Queries::view($entryid, $user[\"id\"]);\n\t\treturn $this->query($query);\n\t}", "public function overviewAction(){\n\t\t\t\t\t\t$this->redirectToIndex();\n\t\t\t\t\t if($this->_getParam ( 'actions' )==\"overview\"){\n\t\t\t\t\t $idOverview= $this->_getParam ( 'id' );\n\t\t\t\t\t $idUser = $this->_getParam ( 'userid' );\n\t\t\t\t\t\t\t$GetSelectViewCompanys = $this->GetModelOrganize->SelectOverViewEdit( $idOverview,$idUser );\n\t\t\t\t\t $this->view->SelectOnFormEdit = $GetSelectViewCompanys;\n\t\t\t\t\t \n\t\t\t\t\t }\n\t\t\t\t\t\t$id = $this->_getParam ( 'id' );\n $this->view->getIdView = $id;\n \n \n\t\t\t\t\t}", "public function viewAction()\n {\t\n $auth = Zend_Auth::getInstance();\n \tif($auth->hasIdentity())\n {\n $loginUserId = $auth->getStorage()->read()->id;\n $businessunit_id = $auth->getStorage()->read()->businessunit_id;\n $department_id = $auth->getStorage()->read()->department_id; \n $loginuserRole = $auth->getStorage()->read()->emprole;\n $loginuserGroup = $auth->getStorage()->read()->group_id;\n }\n $id = $this->getRequest()->getParam('id');\n try\n {\n if($id != '')\n {\n\t\t\t $app_manager_model = new Default_Model_Appraisalmanager();\n\t\t\t\t$line_managers = array();\n\t\t\t\t$line_managers = $app_manager_model->getLineManagers($id,$loginUserId);\n\t\t\t\t$appraisal_init_model = new Default_Model_Appraisalinit();\n\t\t\t\t$appraisal_data = $appraisal_init_model->getappdata_forview($id);\n\t\t\t\t\n if(is_numeric($id) && $id>0 && $line_managers && !empty($appraisal_data))\n {\n\t\t\t\t\t$appraisal_data['process_status'] = '';\n if(!empty($appraisal_data))\n {\n \tif($appraisal_data['initialize_status'] == 1)\n \t{\n \t\tif($appraisal_data['enable_step'] == 1)\n \t\t\t$appraisal_data['process_status'] = 'Enabled to Managers';\n \t\tif($appraisal_data['enable_step'] == 2)\n \t\t\t$appraisal_data['process_status'] = 'Enabled to Employees';\t\n \t}\n \telse if($appraisal_data['initialize_status'] == 2)\n \t{\n \t\t$appraisal_data['process_status'] = 'Initialize Later';\n \t}else\n\t\t\t \t{\n\t\t\t \t $data['process_status'] = 'In progress';\t\n\t\t\t \t}\n }\n if($appraisal_data['status'] == 1) {\n \t $appraisal_data['status']=\"Open\";\n }else if($appraisal_data['status'] == 2) {\n \t $appraisal_data['status']=\"Closed\";\n }else {\n $appraisal_data['status']=\"Force Closed\";\n }\t\n if($appraisal_data['appraisal_ratings'] == 1) {\n \t $appraisal_data['appraisal_ratings']=\"1-5\";\n }else {\n $appraisal_data['appraisal_ratings']=\"1-10\";\n }\t\n if($appraisal_data['appraisal_mode'] == 'Quarterly'){\n\t\t\t\t\t\t $appraisal_data['appraisal_period']=\"Q\".$appraisal_data['appraisal_period'];\n }\n\t\t\t\t\t else if($appraisal_data['appraisal_mode'] == 'Half-yearly'){\n\t\t\t\t\t\t $appraisal_data['appraisal_period']= \"H\".$appraisal_data['appraisal_period'];\n\t\t\t\t\t }\n\t\t\t\t\t else {\n\t\t\t\t\t\t $appraisal_data['appraisal_period']=\"Yearly\";\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t if($appraisal_data['enable_step'] == 1) {\n \t $appraisal_data['enable_step']=\"Managers\";\n }else {\n $appraisal_data['enable_step']=\"Employees\";\n }\n\t\t\t\t\t $appraisal_data['managers_due_date'] = sapp_Global::change_date($appraisal_data['managers_due_date'],'view');\n $appraisal_data['employees_due_date'] = sapp_Global::change_date($appraisal_data['employees_due_date'],'view');\n $manager_groups = $app_manager_model->getManagergroups($id,$loginUserId);\n $view = $this->getHelper('ViewRenderer')->view;\n $view->previ_data = 'no'; \n $view->data = $appraisal_data;\n $text = $view->render('appraisalinit/view.phtml');\n $this->view->appraisal_id = $id;\n $this->view->manager_id = $loginUserId;\n $this->view->manager_groups = $manager_groups;\n $this->view->appraisal_data = $appraisal_data;\n $this->view->app_text = $text;\n $this->view->controllername = 'appraisalmanager';\n $this->view->id = $id;\n }\n else \n {\n $this->view->ermsg = 'nodata';\n }\n }\n else\n {\n $this->view->ermsg = 'nodata';\n }\n } \n catch (Exception $ex) \n {\n $this->view->ermsg = 'nodata';\n }\n }", "public function actionView($id)\n { \n return $this->findModel($id);\n \n }", "public function actionView($id)\n\t{\n $jobDetails = Yii::app()->db->createCommand()\n ->select('s.JOB_ID AS job_id,\n s.sf_username AS sf_username,\n s.job_name AS job_name,\n s.job_type AS job_type,\n s.job_status AS job_status,\n l.STATUS AS job_status_2,\n l.REPLAYDATE AS job_start,\n l.ENDDATE AS job_end,\n l.LOG_FIELD AS job_log')\n ->from('job_summary s')\n ->join('job_log l', 's.JOB_ID = l.ID_JOB')\n ->where(array('and','s.JOB_ID = '.$id)) \n ->queryRow();\n \n $transDetails = Yii::app()->db->createCommand()\n ->select('trans_summary.JOB_ID AS job_id,\n trans_summary.ID_BATCH AS trans_id,\n trans_summary.trans_name,\n trans_summary.sf_username,\n trans_summary.source,\n trans_summary.target,\n trans_log.STATUS,\n trans_log.LINES_INPUT,\n trans_log.LINES_OUTPUT,\n trans_log.LINES_REJECTED,\n trans_log.REPLAYDATE AS STARTDATE,\n trans_log.ENDDATE,\n trans_log.LOG_FIELD')\n ->from('trans_summary trans_summary')\n ->join('trans_log trans_log', 'trans_summary.ID_BATCH = trans_log.ID_BATCH')\n ->where(array('and','trans_summary.JOB_ID = '.$id))\n ->order('trans_log.REPLAYDATE ASC')\n ->queryAll();\n \n \n $this->render('view',array(\n\t\t\t'jobDetails'=>$jobDetails,\n 'transDetails'=>$transDetails,\n\t\t));\n\t}", "public function actionView($id)\n\t{\n\t\t$model=Cooperativepartner::model()->with('company')->findByPk($id);\n\t\t$model->fCooperativeCompanyID=empty($model->company->fCooperativeCompanyID)?'':$model->company->fCooperativeCompanyName;\n\t\t$model->fEducationalLevel=array_key_exists($model->fEducationalLevel,adminSettings::$EducationLevel)?adminSettings::$EducationLevel[$model->fEducationalLevel]:'';\n\t\t$model->fCreateDate=empty($model->fCreateDate)?'':date('Y-m-d',$model->fCreateDate);\n\t\t$model->fUpdateDate=empty($model->fUpdateDate)?'':date('Y-m-d',$model->fUpdateDate);\n\t\t$this->render('view',array(\n\t\t\t'model'=>$model,\n\t\t\t'keyid'=>$id\n\t\t));\n\t}", "function view( $id = NULL )\n {\n\tif ( !is_numeric( $id ) ) {\n\t $result = $this->_get( 'id' );\n\t $data = $this->page_settings( 'edit', $result, 'result', 'Edit', 'mdl_auth' );\n\t} else {\n\t $result = $this->get_where( $id );\n\t $data = $this->page_settings( 'edit', $result, 'result', 'Edit', 'mdl_auth' );\n\t}\n\n\t$this->templates->frontend( $data );\n }", "public function actionView($id)\n {\n $model=$this->findModel($id);\n $vehicleid=$model->vehicleid;\n $mods=$this->findModel($id);\n $mods->dept=Gongchu::getDeptNameById($model->dept);\n $mods->use_time=substr($model->use_time,0,-3);\n $mods->v_user=Gongchu::getUserNamesByIds($model->v_user);\n $mods->apply_ren=Gongchu::getUserNamesByIds($model->apply_ren);\n $mods->v_license=Vehicle::findOne($vehicleid)->v_license;\n if($model->dept_audit==0){//审批中 状态 不加审批时间 驳回理由\n $mods->dept_leader=Gongchu::getUserNamesByIds($model->dept_leader).'('.Gongchu::getStatusById($model->dept_audit).')';\n }else{\n $mods->dept_leader=Gongchu::getUserNamesByIds($model->dept_leader).'('.Gongchu::getStatusById($model->dept_audit).') '.$model->dept_reason.' '.substr($model->dept_audit_time,0,-3);\n }\n if($model->dept_audit==2){//如果科室领导驳回,则院领导直接显示名字即可\n $mods->branch_leader=Gongchu::getUserNamesByIds($model->branch_leader);\n }else{\n if($model->branch_audit==0){//审批中 状态 不加审批时间 驳回理由\n $mods->branch_leader=Gongchu::getUserNamesByIds($model->branch_leader).'('.Gongchu::getStatusById($model->branch_audit).')';\n }else{\n $mods->branch_leader=Gongchu::getUserNamesByIds($model->branch_leader).'('.Gongchu::getStatusById($model->branch_audit).') '.$model->branch_reason.' '.substr($model->branch_audit_time,0,-3);\n }\n }\n if($model->dept_leader==0){\n $mods->dept_leader=0;\n }\n return $this->render('view', [\n 'model' => $mods,\n ]);\n }", "public function viewAclAction()\n {\n \tif($this->getRequest()->getParam('id')){\n \t\t$db = new Rsvacl_Model_DbTable_DbAcl();\n \t\t$acl_id = $this->getRequest()->getParam('id');\n \t\t$rs=$db->getAcl($acl_id);\n \t\t$this->view->rs=$rs;\n \t} \t \n \t\n }", "public function actionView($id)\r\n\t{\r\n\t\t// sets global studyId for authoring\r\n \t\t$this->studyId = $id;\r\n\r\n\t\t$this->render('view',array(\r\n\t\t\t'model'=>$this->loadModel($id),\r\n\t\t));\r\n\t}", "public function _report_view()\n\t{\n\t\t$incident_id = Event::$data;\n\t\tif ($incident_id)\n\t\t{\n\t\t\t$actionable = ORM::factory('actionable')\n\t\t\t\t->where('incident_id', $incident_id)\n\t\t\t\t->find();\n\t\t\tif ($actionable->loaded)\n\t\t\t{\n\t\t\t\tif ($actionable->actionable)\n\t\t\t\t{\n\t\t\t\t\t$report = View::factory('actionable_report');\n\t\t\t\t\t$report->actionable = $actionable->actionable;\n\t\t\t\t\t$report->action_taken = $actionable->action_taken;\n\t\t\t\t\t$report->action_summary = $actionable->action_summary;\n\t\t\t\t\t$report->render(TRUE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function view_action()\n {\n $mode = get_param_string('mode', 'cns');\n $id = get_param_integer('id');\n\n if ($mode == 'cns') {\n $rows = $GLOBALS['FORUM_DB']->query_select('f_moderator_logs', array('l_reason AS reason', 'id', 'l_by AS member_id', 'l_date_and_time AS date_and_time', 'l_the_type AS the_type', 'l_param_a AS param_a', 'l_param_b AS param_b'), array('id' => $id), '', 1);\n } else {\n $rows = $GLOBALS['SITE_DB']->query_select('actionlogs', array('id', 'member_id', 'date_and_time', 'the_type', 'param_a', 'param_b', 'ip'), array('id' => $id), '', 1);\n }\n\n if (!array_key_exists(0, $rows)) {\n warn_exit(do_lang_tempcode('MISSING_RESOURCE'));\n }\n $row = $rows[0];\n\n $username = $GLOBALS['FORUM_DRIVER']->get_username($row['member_id']);\n if (is_null($username)) {\n $username = do_lang('UNKNOWN');\n }\n\n $type_str = do_lang($row['the_type'], $row['param_a'], $row['param_b'], null, null, false);\n if (is_null($type_str)) {\n $type_str = $row['the_type'];\n }\n\n $fields = array(\n 'USERNAME' => $GLOBALS['FORUM_DRIVER']->member_profile_hyperlink($row['member_id'], false, '', false),\n 'DATE_TIME' => get_timezoned_date($row['date_and_time']),\n 'ACTION' => $type_str,\n 'PARAMETER_A' => is_null($row['param_a']) ? '' : $row['param_a'],\n 'PARAMETER_B' => is_null($row['param_b']) ? '' : $row['param_b'],\n );\n\n if (array_key_exists('ip', $row)) {\n $fields['IP_ADDRESS'] = escape_html($row['ip']);\n }\n\n if (array_key_exists('reason', $row)) {\n $fields['REASON'] = escape_html($row['reason']);\n }\n\n if (addon_installed('securitylogging')) {\n if (array_key_exists('ip', $row)) {\n $banned_test_1 = ip_banned($row['ip'], true);\n $fields['IP_BANNED'] = (!$banned_test_1) ? do_lang_tempcode('NO') : do_lang_tempcode('YES');\n if ($row['ip'] != get_ip_address()) {\n $fields['IP_BANNED']->attach(do_template('ACTIONLOGS_TOGGLE_LINK', array('_GUID' => 'eff2890f2193ece32df8ec8ee48b252d', 'URL' => build_url(array('page' => 'admin_ip_ban', 'type' => 'toggle_ip_ban', 'id' => $row['ip'], 'redirect' => get_self_url(true)), get_module_zone('admin_ip_ban')))));\n }\n\n if ($row['ip'] != get_ip_address()) {\n if (get_option('stopforumspam_api_key') . get_option('tornevall_api_username') != '') {\n $fields['SYNDICATE_TO_STOPFORUMSPAM'] = do_template('ACTIONLOGS_TOGGLE_LINK', array(\n '_GUID' => '7d10045c6b3b48f256e2f8eb5535809c',\n 'LABEL' => do_lang_tempcode('PROCEED'),\n 'LONELY' => true,\n 'URL' => build_url(array('page' => 'admin_ip_ban', 'type' => 'syndicate_ip_ban', 'ip' => $row['ip'], 'member_id' => $row['member_id'], 'reason' => do_lang('BANNED_ADDRESSES'), 'redirect' => get_self_url(true)), get_module_zone('admin_ip_ban')),\n ));\n }\n }\n }\n\n if ((!is_guest($row['member_id'])) && ($row['member_id'] != get_member())) {\n $fields['SUBMITTER_BANNED'] = do_template('ACTIONLOGS_TOGGLE_LINK', array(\n '_GUID' => 'f79fb00ef35d89381371a67bc9c4d69b',\n 'LONELY' => true,\n 'URL' => build_url(array('page' => 'admin_ip_ban', 'type' => 'toggle_submitter_ban', 'id' => $row['member_id'], 'redirect' => get_self_url(true)), get_module_zone('admin_ip_ban')),\n ));\n } else {\n $banned_test_2 = $GLOBALS['SITE_DB']->query_select_value_if_there('usersubmitban_member', 'the_member', array('the_member' => $row['member_id']));\n $fields['SUBMITTER_BANNED'] = is_null($banned_test_2) ? do_lang_tempcode('NO') : do_lang_tempcode('YES');\n }\n\n if (((get_forum_type() == 'cns') && (!is_guest($row['member_id']))) && ($row['member_id'] != get_member())) {\n $fields['MEMBER_BANNED'] = do_template('ACTIONLOGS_TOGGLE_LINK', array(\n '_GUID' => '6b192ecfad1afc67bb8c2f1e744cc3b1',\n 'LONELY' => true,\n 'URL' => build_url(array('page' => 'admin_ip_ban', 'type' => 'toggle_member_ban', 'id' => $row['member_id'], 'redirect' => get_self_url(true)), get_module_zone('admin_ip_ban')),\n ));\n } else {\n $banned_test_3 = $GLOBALS['FORUM_DRIVER']->is_banned($row['member_id']);\n $fields['MEMBER_BANNED'] = $banned_test_3 ? do_lang_tempcode('YES') : do_lang_tempcode('NO');\n }\n }\n $fields['INVESTIGATE_USER'] = hyperlink(build_url(array('page' => 'admin_lookup', 'id' => (array_key_exists('ip', $row)) ? $row['ip'] : $row['member_id']), '_SELF'), do_lang_tempcode('PROCEED'), false, false);\n\n // Is there a revision here?\n require_code('revisions_engine_database');\n $revision_engine = new RevisionEngineDatabase($mode == 'cns');\n $revision = $revision_engine->find_revision_for_log($id);\n if (is_null($revision)) {\n require_code('revisions_engine_files');\n $revision_engine = new RevisionEngineFiles();\n $revision = $revision_engine->find_revision_for_log($id);\n }\n if (!is_null($revision)) {\n if (isset($revision['r_resource_type']) && isset($revision['r_resource_id'])) {\n require_code('content');\n list($content_title, , , , $content_url) = content_get_details($revision['r_resource_type'], $revision['r_resource_id']);\n if (empty($content_title)) {\n $content_title = $revision['r_original_title'];\n }\n if (!is_null($content_url)) {\n $fields['VIEW'] = hyperlink($content_url, $content_title, false, true);\n }\n }\n\n if (isset($revision['r_original_content_owner'])) {\n $fields['CONTENT_OWNER'] = $GLOBALS['FORUM_DRIVER']->member_profile_hyperlink($revision['r_original_content_owner']);\n }\n\n if (isset($revision['r_original_content_timestamp'])) {\n $fields['CONTENT_DATE_AND_TIME'] = get_timezoned_date($revision['r_original_content_timestamp']);\n }\n\n if (isset($revision['r_original_title'])) {\n if ($revision['r_original_title'] != '') {\n $fields['TITLE_PRIOR_TO_REVISION'] = $revision['r_original_title'];\n }\n }\n\n $fields['TEXT_PRIOR_TO_REVISION'] = with_whitespace($revision['r_original_text'], true);\n\n if (isset($revision['r_original_resource_fs_path'])) {\n $fields['RESOURCE_FS_PATH_PRIOR_TO_REVISION'] = $revision['r_original_resource_fs_path'];\n }\n\n if (isset($revision['r_original_resource_fs_record']) && strlen($revision['r_original_resource_fs_record']) < 1024 * 50/*50kb reasonable limit*/) {\n $fields['RESOURCE_FS_RECORD_PRIOR_TO_REVISION'] = with_whitespace($revision['r_original_resource_fs_record'], true);\n }\n\n if (has_privilege(get_member(), 'delete_revisions')) {\n $delete_url = build_url(array('page' => 'admin_revisions', 'type' => 'delete', 'id' => $revision['id'], 'revision_type' => $revision['revision_type'], 'redirect' => get_self_url(true)), get_module_zone('admin_revisions'));\n $delete = hyperlink($delete_url, do_lang_tempcode('DELETE'), false, false, do_lang_tempcode('DELETE_REVISION'), null, new Tempcode());\n $fields['DELETE_REVISION'] = $delete;\n }\n\n /*if (has_privilege(get_member(), 'undo_revisions')) {\n $undo_url = build_url(array('page' => 'admin_revisions', 'type' => 'undo', 'id' => $revision['id'], 'revision_type' => $revision['revision_type'], 'redirect' => get_self_url(true)), get_module_zone('admin_revisions'));\n $delete = hyperlink($delete_url, do_lang_tempcode('UNDO'), false, false, do_lang_tempcode('UNDO_REVISION'), null, new Tempcode());\n $fields['UNDO_REVISION'] = $delete;\n }*/\n }\n\n require_code('templates_map_table');\n return map_table_screen($this->title, $fields);\n }", "public function viewAction() {\n\t\t$id = $this->_getParam('id');\n\t\t$taFinder = new TeachingActivities();\n\t\t$ta = $taFinder->getTa($id);\n\t\t\n\t\t$latest_flag = ($this->_getParam('latest') == 'f') ? false : true;\n\t\t$latest_ta_id = $ta->latestReleasedVersionId();\n\t\tif ($latest_ta_id != $id && !UserAcl::isDomainAdminOrAbove() && $latest_flag) {\n\t\t\t$this->_redirect('/teachingactivity/view/id/'.$latest_ta_id);\n\t\t\treturn;\n\t\t}\n\t\t$this->view->debugdate = $this->_getParam('debugdate');\n\t\t$layout = $this->_getParam('layout', '');\n\n\t\tPageTitle::setTitle($this->view, $this->_request, array($id));\n\n\t\tif ($ta->isReleased() != true) {\n\t\t\tthrow new Exception(\"Teaching activity $id is not released yet.\");\n\t\t}\n\n\t\t$this->view->ta = $ta;\n\t\t$this->view->revisions = $taFinder->getTaRevisions($ta->taid);\n\t\t$this->view->released_los = $ta->getLinkedLearningObjectiveWithStatus(Status::$RELEASED);\n\t\t\n\t\t$this->view->showGenericEvaluation = EvaluateTaConst::showGenericEvaluation($ta->typeID);\n\t\t\n\t\tif(UserAcl::isAdmin() && $this->view->showGenericEvaluation === true) {\n \t\t$studentEvaluateService = new StudentEvaluateService();\n \t\t$this->view->taEvaluations = $studentEvaluateService->getEvaluationForTaId($id);\n \t\t$studentEvaluate = new StudentEvaluate();\n \t\t$this->view->taEvaluationAvg = $studentEvaluate->getRatingAvg('ta', $id);\n\t\t}\n\n\t\t$this->view->display_edit_links = UserAcl::isStaffOrAbove() && UserAcl::checkTaPermission($ta, UserAcl::$EDIT) === true && count($this->view->released_los) > 0;\n\t\t$this->view->resourceAcl = ResourceAcl::accessAll(array('type'=>'ta','auto_id'=>$id));\n\t\t$this->view->resources = $ta->resources;\n\t\t\n\t\t$this->view->pblTaTypePrev = '';\n\t\t$this->view->pblTaTypeNext = '';\n\t\t\n\t if(!empty($layout)) {\n switch($layout) {\n case 'pblview': \n $this->view->pblTaTypePrev = $this->_request->getParam('pblTaTypePrev','');\n $this->view->pblTaTypeNext = $this->_request->getParam('pblTaTypeNext','');\n //$this->render('pblview');\n break;\n }\n }\n\t\t$this->view->socialtools = StudentResourceService::showSocialTools();\n\t}", "public function actionView($id)\n {\n $model = $this->findModel($id);\n if ($model->acr_id != 0) {\n return $this->redirect(\\Yii::$app->urlManager->createUrl(self::$detailsPage). '&acr_id='.$id );\n }\n\n return $this->render('view', [\n 'model' => $this->findModel($id),\n ]);\n }", "public function viewAction()\n {\n $this->loadLayout();\n $id = $this->getRequest()->getParam('id');\n $model = Mage::getModel('oggetto_oneclick/order')->load($id);\n Mage::register('order', $model);\n $this->renderLayout();\n }", "public function officerHistoryView(){\n $this->view('auditor/officerHistoryView');\n \n $this->view->render(); // This is how load the view\n }", "public function _report_view()\n\t{\n\t\t$incident_id = Event::$data;\n\t\tif ($incident_id)\n\t\t{\n\t\t\t$actionable = ORM::factory('actionable')\n\t\t\t\t->where('incident_id', $incident_id)\n\t\t\t\t->find();\n\t\t\tif ($actionable->loaded)\n\t\t\t{\n\t\t\t\tif ($actionable->actionable)\n\t\t\t\t{\n\t\t\t\t\t$report = View::factory('actionable_report');\n\t\t\t\t\t$report->actionable = $actionable->actionable;\n\t\t\t\t\t$report->action_taken = $actionable->action_taken;\n\t\t\t\t\t$report->action_summary = $actionable->action_summary;\n\t\t\t\t\t$report->action_date = $actionable->action_date;\n\t\t\t\t\t$report->resolution_summary = $actionable->resolution_summary;\n\t\t\t\t\t$report->resolution_date = $actionable->resolution_date;\n\t\t\t\t\t$report->render(TRUE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function actionView($id)\n\t{\n $uid = Yii::app()->user->getId(); \n if($uid != 1){\n $value = ComSpry::getUnserilizedata($uid);\n if(empty($value) || !isset($value)){\n throw new CHttpException(403,'You are not authorized to perform this action.');\n }\n if(!in_array(37, $value)){\n throw new CHttpException(403,'You are not authorized to perform this action.');\n }\n }\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n \n\t}", "public function actionView($id)\n {\n $model = $this->findModel($id);\n\n $event = Yii::t('app', 'view record {id}', ['id' => $model->permission_id]);\n $bitacora = new Bitacora();\n $bitacora->register($event, 'actionView', MSG_INFO);\n\n return $this->render(ACTION_VIEW, [MODEL => $model]);\n }", "public function actionView($id)\n\t{\n\t\t$invoice = $this->loadModel($id);\n\t\t\n\t\tif(!(Yii::app()->user->roles == \"admin\") && ($invoice->waktu_penerbitan < Utilities::getTodayTimeStamp())) {\n\t\t\tthrow new CHttpException(403, \"Not Authorized\");\n\t\t}\n\t\t\n\t\tif(Yii::app()->user->roles == \"admin\") {\n\t\t\t$this->active = \"index\";\n\t\t} else {\n\t\t\t$this->active = \"today\";\n\t\t}\n\t\t\n\t\t$this->render('view',array(\n\t\t\t'invoice'=>$this->loadModel($id),\n\t\t));\n\t}", "public function doRestView($id)\n {\n $this->outputHelper(\n 'Record Retrieved Successfully', \n $this->loadOneModel($id),\n 1\n );\n\t}", "function client_view($id = null) {\n\t\t$this->admin_view($id);\n\t}", "public function show(HrmSkill $hrmSkill)\n {\n //\n }", "public function actionView($id) {\n\t\treturn $this->render ( 'view', [ \n\t\t\t\t'model' => $this->findModel ( $id ) \n\t\t] );\n\t}", "public function actionView($id) {\n\t\treturn $this->render ( 'view', [ \n\t\t\t\t'model' => $this->findModel ( $id ) \n\t\t] );\n\t}", "public function actionView($id)\n {\n\t\t $model = $this->findModel($id);\n\t\t \n\t\t Yii::$app->view->title = Yii::t('app', 'Detail').' : '.$model->id.' - '.Yii::t('app', Yii::$app->controller->module->params['title']);\n\t\t \n return $this->render('view', [\n 'model' => $model,\n ]);\n }", "public function actionView($id)\n {\n \n \n \n $model = Purchaserequisition::find()\n ->where(['No_'=> $id])\n ->with('requisitionlines')\n ->asArray()\n ->all();\n \n // print_r( $model['0']);\n // exit;\n return $this->render('view', [\n 'model' => $model['0'],\n \n ]);\n }", "public function viewAction() {\n\t\t$role = new Role_Model_Role();\n\t\t$this->view->record = $role->findById($this->getRequest()->getParam('id'));\n\t}", "public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'\t\t=>$this->loadModel($id),\n\t\t\t'dokter'\t=>$this->loadModelDetailDokter($id),\n\t\t\t'perawat'\t=>$this->loadModelDetailPerawat($id),\n\t\t\t'obat'\t\t=>$this->loadModelDetailObat($id),\n\t\t\t'perawatan'\t=>$this->loadModelDetailPerawatan($id),\n\t\t));\n\t}", "public function getAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Client_Service_Besttj::getBesttj(intval($id));\n\t\tif(!$info) $this->output(-1, '操作失败.');\n\t\t$this->output(0, '', $info);\n\t}", "public function actionCView($id){\n $search_dep = new DepositSearch();\n $search_dep->investor = $id;\n $deposit = $search_dep->search(Yii::$app->request->queryParams);\n\n $search_with = new WithdrawSearch();\n $search_with->investor = $id;\n $withdraw = $search_with->search(Yii::$app->request->queryParams);\n\n $search_pur = new PurchaseSearch();\n $search_pur->investor = $id;\n $purchase = $search_pur->search(Yii::$app->request->queryParams);\n\n $this->layout = 'c-main';\n\n return $this->render('c-view', [\n 'model' => $this->findModel($id),\n 'deposit'=>$deposit,\n 'withdraw'=>$withdraw,\n 'purchase'=>$purchase,\n ]);\n }", "public function view($id)\n {\n }", "public function landVisitDetailAction(){\n\n\t\t\t\t$params = $this->getRequest()->getParams(); \n\t\t\t\t$db = $this->db;\n\t\t\t\t$secretkey = $this->secretkey; \n\t\t\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\";\n\t\t\t\t$farmer_code\t= isset($params['farmer_code'])?$params['farmer_code']:\"\";\n\t\t\t\t$land_id\t= isset($params['land_id'])?$params['land_id']:\"\";\n\t\t\t\t$stage_id\t= isset($params['stage_id'])?$params['stage_id']:\"\";\n\t\t\t\t$disease_score\t= isset($params['disease_score'])?$params['disease_score']:\"\";\n\t\t\t\t$logging_score\t= isset($params['logging_score'])?$params['logging_score']:\"\";\n\t\t\t\t$presemption_of_insect\t= isset($params['presemption_of_insect'])?$params['presemption_of_insect']:\"\";\n\t\t\t\t$soil_moisture_id\t= isset($params['soil_moisture_id'])?$params['soil_moisture_id']:\"\";\n\t\t\t\t$quality_of_crop\t= isset($params['quality_of_crop'])?$params['quality_of_crop']:\"\";\n\t\t\t\t$sink_date_time \t= isset($params['sink_date_time'])?$params['sink_date_time']:\"\";\n\n\n\t\t\t\t$error_code = 1;\n\t\t\t\t$succes = FALSE; \n\t\t\t\ttry{\n\t\t\t\t\t$db->beginTransaction();\n\t\t\t\t\tif($secretkey != $appkey){\n\t\t\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t\t\t}\t\n\t\t\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$user = new Application_Model_Users();\n\t\t\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t\t\t} \n\t\t\t\t\tif(!empty($alldata['DeviceID'])){\t\t\t\n\t\t\t\t\t\tif($alldata['DeviceID'] != $device_id){\n\t\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac'){\n\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t\t\t}\t\n\n\t\t\t\t\tif($alldata['App_Access_Status'] == 2){\n\t\t\t\t\t\t$error_code = 2;\n\t\t\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$farmerMaster = new Application_Model_Farmermasters();\n\t\t\t\t\t$allFarmerData = $farmerMaster->getFarmerDetailsByFarmerCode($farmer_code); \t\n\t\t\t\t\t$farmerID = $allFarmerData['id'];\n\t\t\t\t\t$farmerCode = $allFarmerData['FarmerCode'];\n\n\n\t\t\t\t\tif(isset($_FILES['image']['tmp_name']) AND !empty($_FILES['image']['name'])){\n\t\t\t\t\t\t$tempName = $_FILES['image']['tmp_name'];\n\t\t\t\t\t\t$imageName = time().$_FILES['image']['name']; \n\t\t\t\t\t\t$uploads = 'uploads/visit_photograph/';\n\t\t\t\t\t\tif(!file_exists($uploads)){\n\t\t\t\t\t\t\tmkdir($uploads);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$pathComplete = $uploads.$imageName;\n\t\t\t\t\t\t@move_uploaded_file($tempName,$pathComplete);\n\n\t\t\t\t\t}\n\n\t\t\t\t\t$land_visit = array(); \n\n\t\t\t\t\t$land_visit['land_id'] = $land_id;\n\t\t\t\t\t$land_visit['stage_id'] = $stage_id;\n\t\t\t\t\t$land_visit['disease_score'] = $disease_score;\n\t\t\t\t\t$land_visit['logging_score'] = $logging_score;\n\t\t\t\t\t$land_visit['presemption_of_insect'] = $presemption_of_insect;\n\t\t\t\t\t$land_visit['soil_moisture_id'] = $soil_moisture_id;\n\t\t\t\t\t$land_visit['quality_of_crop'] = $quality_of_crop;\n\t\t\t\t\t$land_visit['image'] = $pathComplete;\n\t\t\t\t\t$land_visit['farmer_code'] = $farmer_code;\n\t\t\t\t\t$land_visit['farmer_id'] = $farmerID;\n\t\t\t\t\t$land_visit['fe_code'] = $LoginID;\n\t\t\t\t\t$land_visit['sink_date_time'] = $sink_date_time;\n\t\t\t\t\t$land_visit['created'] = $this->currdate; \n\t\t\t\t\t$db->insert('logi_land_visit', $land_visit);\n\n\t\t\t\t\t$landdetailId = $db->lastInsertId();\n\n\t\t\t\t\t$db->commit();\n\t\t\t\t\t$succes = TRUE;\t \n\t\t\t\t}\n\n\t\t\t\tcatch(Exception $e){\n //Rollback transaction\n\t\t\t\t\t$db->rollBack();\n\t\t\t\t\t$error= $e->getMessage();\n\t\t\t\t}\n\n\t\t\t\tif($succes == TRUE ){\n\t\t\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Land visit Detail Inserted successfully.', 'land_visit_id'=>$landdetailId));\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error));\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t}", "public function actionView($id = null)\n {\n// if($orderPart === null) {\n// throw new \\yii\\base\\UserException('Страница оформления заказа не найдена.', 400);\n// }\n\n $model = Serie::findOne(['id' => $id, 'is_publish' => 1]);\n if($model === null) {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n\n return $this->render('view', [\n 'model' => $model\n ]);\n }", "public function actionView($id)\n {\n \tif (\\Yii::$app->user->isGuest) {\n \t\treturn $this->redirect(Yii::$app->params['default']);\n \t}\n\t\t//supaya org non guest gabisa akses yg lain\n\t\t\n\t\t\n\t\t$jabatan=Yii::$app->user->identity->jabatan;\n\t\tif($jabatan=='Project Manager' || $jabatan=='Supervisor' || $jabatan=='Coordinator'){\n\t\t\treturn $this->redirect(Yii::$app->params['default'].'index.php/home');\n\t\t}\n\t\t\n return $this->render('view', [\n 'model' => $this->findModel($id),\n ]);\n }", "public function view($id) {\n }", "public function actionWhyView($id)\n {\n \tob_start();\n \tYii::app()->theme='back';\n \t$rec=WhyUsHome::model()->findByPk($id);\n \t$this->render('whyview',array('view'=>$rec));\n }", "public function viewAction()\n {\n // Check front disable\n if ($this->config('disable_front')) {\n return $this->jumpToDenied(__('View information is disable'));\n }\n\n $page = $this->params('page', 1);\n $limit = Pi::config('list_limit', 'user');\n $offset = (int)($page - 1) * $limit;\n $uid = _get('uid');\n\n Pi::service('authentication')->requireLogin();\n\n // Get timeline\n $count = Pi::api('timeline', 'user')->getCount($uid);\n $timeline = Pi::api('timeline', 'user')->get($uid, $limit, $offset);\n\n // Get timeline meta list\n $timelineMetaList = Pi::api('timeline', 'user')->getList();\n\n // Set timeline meta\n foreach ($timeline as &$item) {\n if (!isset($timelineMetaList[$item['timeline']])) {\n continue;\n }\n $item['icon'] = $timelineMetaList[$item['timeline']]['icon'];\n $item['title'] = $timelineMetaList[$item['timeline']]['title'];\n }\n\n // Get user base info\n $user = Pi::api('user', 'user')->get(\n $uid,\n ['name', 'country', 'city', 'time_activated'],\n true,\n true\n );\n $user['name'] = isset($user['name']) ? $user['name'] : null;\n\n // Set paginator\n $paginatorOption = [\n 'count' => $count,\n 'limit' => $limit,\n 'page' => $page,\n 'controller' => 'home',\n 'action' => 'view',\n 'uid' => $uid,\n ];\n $paginator = $this->setPaginator($paginatorOption);\n\n $this->view()->assign([\n 'uid' => $uid,\n 'name' => 'homepage',\n 'timeline' => $timeline,\n 'paginator' => $paginator,\n 'user' => $user,\n ]);\n\n $this->view()->setTemplate('home-index');\n $this->view()->assign('view', true);\n $this->view()->headTitle(sprintf(__('%s activities'), $user['name']));\n $this->view()->headdescription(sprintf(__('View %s activities'), $user['name']), 'set');\n $this->view()->headkeywords($this->config('head_keywords'), 'set');\n }", "public function actionView() {}", "public function actionView() {}", "public function actionView($id)\n\t{\n\n\t\tif(Yii::app()->user->isSuperAdmin){\n\t\t\t$this->layout = '//layouts/columnAdmin';\n\t\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t\t));\n\t\t}\n\t\telse{\n\t\t\t$this->render('exito',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t\t));\n\t\t}\n\t}", "public function actionView($id)\n {\n $model = $this->findModel($id);\n\n $viewModel = new Qrxq2017Enroll4View($model);\n\n return $this->render('view', [\n// 'model' => $this->findModel($id),\n 'model' => $viewModel\n ]);\n }", "function view_voucher($demand_id)\n {\n }", "public function actionView($id) {\r\n\t\treturn $this->render ( 'view', [ \r\n\t\t\t\t'model' => $this->findModel ( $id ) \r\n\t\t] );\r\n\t}", "public function actionView($id){\n $userid=Yii::$app->user->identity->id;\n //$model = $this->findModel($id);\n $documents=MgfAttachements::find()->where(['organisation_id'=>$id])->all();\n $concepts=MgfConceptNote::find()->where(['organisation_id'=>$id])->all();\n $screening=MgfScreening::find()->where(['organisation_id'=>$id])->all(); \n $contacts=MgfContact::find()->joinWith('position')->where(['organisation_id'=>$id])->all(); \n $applicant=MgfApplicant::find()->where(['user_id'=>$userid])->one(); \n //$id=getOrganisationID(); \n return $this->render('view', ['model' => $this->findModel($id),'documents'=>$documents,'criteria'=>$screening,'concepts'=>$concepts,'contacts'=>$contacts,'applicant'=>$applicant]);\n }", "public function actionView($id)\n {\n $paymentModelObj=new \\backend\\models\\BookingPaymentHistory();\n $paymentModel=$paymentModelObj->getPaymentHistory($id);\n // var_dump($paymentModel);die;\n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'paymentModel'=>$paymentModel\n ]);\n }", "public function actionView($id) {\n $id = base64_decode($id);\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }", "public function view($id=null)\n {\n $this->session_manager->validateJollofadmin(__METHOD__);\n\n //print(\"<pre>\".print_r($this->orderitem->getFashionOrdersByID($id,'admin'),true).\"</pre>\");die;\n $orderdetails = $this->orderitem->getFashionOrdersByID($id,'admin');\n if(!empty($orderdetails))\n {\n $data['orderinfo'] = $orderdetails;\n \n $data['pageheader'] = \"Order Full Details\";\n $data['breadCrumbs'] = '<li class=\"breadcrumb-item\"><a href=\"'.site_url(\"jollofadmin/orders\").'\">Orders</a></li> <li class=\"breadcrumb-item active\">Order Details</li>';\n $data['mainmenu'] = \"orders\";\n $data ['content_file']= 'order-list-detail';\n $this->load->view('jollof_admin/layout', $data);\n }\n else\n {\n redirect('jollofadmin/orders');\n }\n }", "public function actionView($id) {\n\n\n return $this->render('view', [\n 'model' => $this->findModel($id),\n ]);\n }", "public function actionView($id)\n {\n $searchModel = new Remito_adquisicion_renglones();\n $renglones = $searchModel->get_renglones($id);\n \n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'renglones' => $renglones,\n ]);\n }", "public function actionView($id)\n {\n //if(Yii::$app->user->identity->role == 4) {\n return $this->render('view', [\n 'model' => $this->findModel($id),\n ]);\n //}\n }", "public function actionHomeImageView($id)\n {\n \tob_start();\n \tYii::app()->theme='back';\n\n \t$rec=HomeImages::model()->findByPk($id);\n \t//echo \"<pre>\";print_r($rec);die;\n \t$this->render('homeimageview',array('view'=>$rec));\n\n }", "public function detail($id){\n \n $this->_estado->_setIdTableValue($id);\n $params['rsEstado'] = $this->_estado->getRecord();\n \\kerana\\View::showView($this->_current_module,'estado/detail',$params);\n \n }", "public function actionView($id)\n {\n $service = new OrgnizationService();\n $orgnizationId = $service->getOrgnizationIdByTreeNodeId($id);\n\n if ($orgnizationId != null) {\n $model = $this->findModel($orgnizationId);\n }\n else {\n $model = new FwOrgnization();\n }\n return $this->renderAjax('view', [\n 'model' => $model,\n ]);\n }", "public function detailAction() {\n\n //GET THE LIST ITEM\n $this->view->listDetail = Engine_Api::_()->getItem('list_listing',(int) $this->_getParam('id'));\n }", "public function view($id_accion){\r\n\t\t$stmt = $this->db->prepare(\"SELECT * FROM accion WHERE id_accion=?\");\r\n\t\t$stmt->execute(array($id_accion));\r\n\t\t$action = $stmt->fetch(PDO::FETCH_ASSOC);\r\n\r\n\t\tif($action != null) {\r\n\t\t\treturn new Action(\r\n\t\t\t$action[\"id_accion\"],\r\n\t\t\t$action[\"nombre\"]\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\treturn new Action();\r\n\t\t}\r\n\t}", "public function viewAction()//23:15\n {\n\n }", "public function detail()\n {\n $vereinRepository = new VereinRepository();\n\n $view = new View('verein_detail');\n $view->heading = \"\";\n $view->verein = $vereinRepository->readById($_GET['id']);\n $view->title = $view->verein->name;\n $view->display();\n }", "function show($view, $viewVars=null) {\r\n\t\t// TODO: db interaction should go into model\r\n\t\tglobal $wpdb;\r\n\r\n\t\tif (is_array($viewVars)) {\r\n\t\t\t$this->viewVars =& $viewVars;\r\n\t\t}\r\n/*\r\n\t\tif ('admin-edit' == $view) {\r\n\t\t\t$viewVars['action'] = empty($viewVars['eventId']) ? 'add' : 'edit';\r\n\t\t\t$this->viewVars['action'] = $viewVars['action'];\r\n\t\t}\r\n*/\t\t\r\n\t\t// TODO: make viewVars globally available?\r\n\r\n\t\t// TODO: make shure it is a valid view\r\n\t\t// TODO: look in theme folder!\r\n\t\t$template = 'views/uwr1results-'.$view.'.php';\r\n\t\t$rv = @require_once $template;\r\n\t}", "public function actionView($id) {\n if (User::userIsAllowedTo('Submit back to office report')) {\n return $this->render('view', [\n 'model' => $this->findModel($id),\n ]);\n } else {\n Yii::$app->session->setFlash('error', 'You are not authorised to perform that action.');\n return $this->redirect(['home/home']);\n }\n }", "public function actionView()\n {\n \n }", "public function listAction()\n\t{\n\t\t# 1. SETUP HEADER STUFF\n\t\t$dirs = Zend_Registry::get('dirs');\n\t\t// Attach spreadsheet for table\n\t\t$this->view->headLink()\n\t\t\t->prependStylesheet(\"{$dirs->styles}/sortable_tables.css\", \"screen, projection\");\n\t\t// Attach scripts for dynamic sorting of table\n\t\t$this->view->headScript()\n\t\t\t->prependFile(\"{$dirs->scripts}/sortable_tables.js\")\n\t\t\t->prependFile(\"{$dirs->scripts}/MochiKit/MochiKit.js\");\n\t\t\n\t\t# 2. GET ROWS\n\t\t// Get select field\n\t\t$db = Zend_Registry::get('db');\n\t\t$select = $db->select()\n\t\t\t->from(array('s' => \"studies\"),\n\t\t\t\tarray('id', 'date_of_entry', 'study', 'to_use', 'lower_age', 'upper_age', 'odd_even', 'gcal_calendar_id'))\n\t\t\t->joinLeft(array('r' => \"researchers\"),\n\t\t\t\t\"s.researcher_id = r.id\", array(\"researcher\"))\n\t\t\t->joinLeft(array('l' => \"labs\"),\n\t\t\t\t\"r.lab_id = l.id\", array(\"lab\"));\n\t\t// Check if want to display archived\n\t\t$viewArchive = $this->_getParam(\"view_archive\");\n\t\tswitch ($viewArchive) {\n\t\t\t// View only archived (to_use = 0)\n\t\t\tcase 1:\n\t\t\t\t$select->where(\"s.to_use = ?\", 0);\n\t\t\t\t$this->view->viewArchived = TRUE;\n\t\t\t\tbreak;\n\t\t\t// View only active (to_use = 1)\n\t\t\tcase 2:\n\t\t\t\t$select->where(\"s.to_use = ?\", 1);\n\t\t\t\t$this->view->viewActive = TRUE;\n\t\t\t\tbreak;\n\t\t\t// View all\n\t\t\tdefault:\n\t\t\t\t$this->view->viewAll = TRUE;\n\t\t\t\tbreak;\n\t\t}\n\t\t// Fetch and Save rows\n\t\t$rows = $db->fetchAll($select);\n\t\t$this->view->results = $rows;\n\t\t\n\t\t# 3. ID PADDING FOR SORTING\n\t\t// Get the id of the last row (assuming that they are in order of id)\n\t\t$tmpRows = $rows;\n\t\t$lastRow = array_pop($tmpRows);\n\t\t$lastId = $lastRow[\"id\"];\n\t\t// Get the length of id + padding length to have proper sorting\n\t\t$this->view->idPad = strlen($lastId);\n\t}", "public function actionView($id)\n\t{\n $student=Student::model()->findByPk($id);\n echo $student->personID;\n\t\t$this->render('view',array(\n\t\t\t'admission'=> Admission::model()->findByPk(array('studentID'=>$id,'sectionName'=>yii::app()->session['secName'],'batchName'=>yii::app()->session['batName'],'programmeCode'=>yii::app()->session['proCode'])),\n 'student'=> $student,\n 'person'=> Person::model()->findByPk($student->personID)\n\t\t));\n\t}", "public function actionView($id)\n\t{\n $model = $this->findModel($id);\n\n\t\t$this->view->title = Yii::t('app', 'Detail User Level: {name}', ['name' => $model->title->message]);\n\t\t$this->view->description = '';\n\t\t$this->view->keywords = '';\n\t\treturn $this->oRender('admin_view', [\n\t\t\t'model' => $model,\n\t\t\t'small' => false,\n\t\t]);\n\t}", "public function _actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }", "public function actionView($id) {\n\t\treturn $this->render('view', [\n 'model' => $this->findModel($id),\n ]);\t\n }", "public function view($id)\n\t{\n\t\t$this->is_allowed('amuco_credit_insurance_view');\n\n\t\t$this->data['amuco_credit_insurance'] = $this->model_amuco_credit_insurance->join_avaiable()->filter_avaiable()->find($id);\n\n\t\t$this->template->title('Amuco Credit Insurance Detail');\n\t\t$this->render('backend/standart/administrator/amuco_credit_insurance/amuco_credit_insurance_view', $this->data);\n\t}", "public function actionView($idOpr, $tglabsence, $ibadah)\n {\n return $this->render('view', [\n 'model' => $this->findModel($idOpr, $tglabsence, $ibadah),\n ]);\n }", "public function display(){\n\t\t$item_name = $this->pdh->get('item', 'name', array($this->url_id));\n\n\t\tif ( empty($item_name) ){\n\t\t\tmessage_die($this->user->lang('error_invalid_item_provided'));\n\t\t}\n\n\t\t#search for the gameid\n\t\t$game_id = $this->pdh->get('item', 'game_itemid', array($this->url_id));\n\n\t\t//Sort\n\t\t$sort\t\t\t= $this->in->get('sort');\n\n\t\t$item_ids = array();\n\t\tif ($game_id > 1){\n\t\t\t$item_ids = $this->pdh->get('item', 'ids_by_ingameid', array($game_id));\n\t\t}else{\n\t\t\t$item_ids = $this->pdh->get('item', 'ids_by_name', array($item_name));\n\t\t}\n\t\t$counter = sizeof($item_ids);\n\n\t\t//default now col\n\t\t$colspan = ($this->config->get('infotooltip_use')) ? 1 : 0 ;\n\n\t\t#Itemhistory Diagram\n\t\tif ($this->config->get('pk_itemhistory_dia')){\n\t\t\t$colspan++;\n\t\t}\n\n\t\t//Comments\n\t\t$comm_settings = array('attach_id'=>md5(stripslashes($item_name)), 'page'=>'items');\n\t\t$this->comments->SetVars($comm_settings);\n\t\t$COMMENT = ($this->config->get('pk_enable_comments') == 1) ? $this->comments->Show() : '';\n\n\t\t//init infotooltip\n\t\tinfotooltip_js();\n\n\t\t$hptt_page_settings\t\t= $this->pdh->get_page_settings('viewitem', 'hptt_viewitem_buyerslist');\n\t\t$hptt\t\t\t\t\t= $this->get_hptt($hptt_page_settings, $item_ids, $item_ids, array('%raid_link_url%' => 'viewraid.php', '%raid_link_url_suffix%' => ''), $this->url_id);\n\n\t\t//linechart data\n\t\tif($this->config->get('pk_itemhistory_dia')) {\n\t\t\t$a_items = array();\n\t\t\tforeach($item_ids as $item_id) {\n\t\t\t\t$a_items[] = array('name' => $this->time->date(\"Y-m-d H:i:s\", $this->pdh->get('item', 'date', array($item_id))), 'value' => $this->pdh->get('item', 'value', array($item_id)));\n\t\t\t}\n\t\t}\n\t\t$this->tpl->assign_vars(array(\n\t\t\t'ITEM_STATS'\t\t\t\t=> $this->pdh->get('item', 'itt_itemname', array($this->url_id, 0, 1)),\n\t\t\t'ITEM_CHART'\t\t\t\t=> ($this->config->get('pk_itemhistory_dia') && count($a_items) > 1) ? $this->jquery->LineChart('item_chart', $a_items, '', 200, 500, '', false, true, 'date') : '',\n\t\t\t'ITEM_MODEL'\t\t\t\t=> (isset($model3d)) ? $model3d : false,\n\t\t\t'COMMENT'\t\t\t\t\t=> $COMMENT,\n\n\t\t\t'SHOW_ITEMSTATS'\t\t\t=> ($this->config->get('infotooltip_use')) ? true : false,\n\t\t\t'SHOW_ITEMHISTORYA'\t\t\t=> ($this->config->get('pk_itemhistory_dia') == 1 ) ? true : false,\n\t\t\t'SHOW_COLSPAN'\t\t\t\t=> $colspan,\n\t\t\t'BUYERS_TABLE'\t\t\t\t=> $hptt->get_html_table($sort, '&amp;i='.$this->url_id, 0, 100, sprintf($this->user->lang('viewitem_footcount'), $counter)),\n\t\t\t'L_PURCHASE_HISTORY_FOR'\t=> sprintf($this->user->lang('purchase_history_for'), stripslashes($item_name)),\n\t\t));\n\n\t\t$this->core->set_vars(array(\n\t\t\t'page_title'\t\t=> sprintf($this->user->lang('viewitem_title'), stripslashes($item_name)),\n\t\t\t'template_file'\t\t=> 'viewitem.html',\n\t\t\t'display'\t\t\t=> true)\n\t\t);\n\t}", "function dialogue_get_view_actions() {\n return array('view');\n}", "public function actionView($id) {\n\t\t$query = WrkPagosEmpleados::find ()->where ( [ \n\t\t\t\t'id_empleado' => $id \n\t\t] );\n\t\t\n\t\t// add conditions that should always apply here\n\t\t\n\t\t$dataProvider = new ActiveDataProvider ( [ \n\t\t\t\t'query' => $query \n\t\t] );\n\t\t\n\t\treturn $this->render ( 'view', [ \n\t\t\t\t'model' => $this->findModel ( $id ),\n\t\t\t\t'dataProvider' => $dataProvider \n\t\t] );\n\t}" ]
[ "0.6496844", "0.6463363", "0.6437944", "0.6205542", "0.6136174", "0.59574425", "0.5919635", "0.5879459", "0.5867817", "0.586525", "0.58534", "0.58497083", "0.58210135", "0.58080417", "0.58035666", "0.5795394", "0.5783395", "0.5777988", "0.5768196", "0.5766399", "0.5765667", "0.57598525", "0.5752649", "0.5752649", "0.5750666", "0.5750666", "0.5750666", "0.5743513", "0.57405376", "0.5738235", "0.5737475", "0.5734164", "0.5719608", "0.5716516", "0.57060283", "0.5689219", "0.568687", "0.56801164", "0.5673801", "0.5665075", "0.5656102", "0.564302", "0.5638322", "0.56378317", "0.5630071", "0.56255734", "0.5618967", "0.56187564", "0.56058127", "0.56014615", "0.5594916", "0.5593937", "0.55936265", "0.55936265", "0.5573512", "0.5573155", "0.5569015", "0.5566381", "0.5563483", "0.5563456", "0.55631214", "0.5562184", "0.5560504", "0.55547047", "0.5543352", "0.55429274", "0.553762", "0.5537399", "0.5537399", "0.553714", "0.55319095", "0.5530697", "0.5528317", "0.55282784", "0.55261743", "0.5524209", "0.55217427", "0.5516495", "0.55158806", "0.5504911", "0.5504113", "0.54988706", "0.5497841", "0.54956996", "0.54947525", "0.5493398", "0.54911304", "0.5489727", "0.5482904", "0.54812044", "0.54810554", "0.5479997", "0.5479231", "0.5477939", "0.54771996", "0.54745096", "0.5471098", "0.54678607", "0.5467293", "0.5467238" ]
0.7299629
0
actionid: viewbyhrdstaf actiondesc: Display detail view of izin for HRDstaf
public function actionViewByHrdStaf($id){ return $this->render('viewByHrdStaf',[ 'model' => $this->findModel($id), ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function landShowingDetailAction(){\n\n\t\t\t\t$params = $this->getRequest()->getParams(); \n\t\t\t\t$db = $this->db;\n\t\t\t\t$secretkey = $this->secretkey;\n\n\t\t\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\";\n\t\t\t\t$farmer_code\t= isset($params['farmer_code'])?$params['farmer_code']:\"\";\n\t\t\t\t$land_id\t= isset($params['land_id'])?$params['land_id']:\"\";\n\t\t\t\t$mou_type_id\t= isset($params['mou_type_id'])?$params['mou_type_id']:\"\";\n\t\t\t\t$variety_id\t= isset($params['variety_id'])?$params['variety_id']:\"\";\n\t\t\t\t$category_id\t= isset($params['category_id'])?$params['category_id']:\"\";\n\t\t\t\t$lot_no\t= isset($params['lot_no'])?$params['lot_no']:\"\";\n\t\t\t\t$sowing_date\t= isset($params['sowing_date'])?$params['sowing_date']:\"\";\n\t\t\t\t$tcw_of_seed\t= isset($params['tcw_of_seed'])?$params['tcw_of_seed']:\"\";\n\t\t\t\t$sowing_depth\t= isset($params['sowing_depth'])?$params['sowing_depth']:\"\";\n //$sowing_depth_unit_id\t= isset($params['sowing_depth_unit_id'])?$params['sowing_depth_unit_id']:\"\";\n\t\t\t\t$sink_date_time\t= isset($params['sink_date_time'])?$params['sink_date_time']:\"\";\n\n\n\t\t\t\t$seed_rate_kg_per_acre\t= isset($params['seed_rate_kg_per_acre'])?$params['seed_rate_kg_per_acre']:\"\";\n\t\t\t\t$seed_rate_per_m2\t= isset($params['seed_rate_per_m2'])?$params['seed_rate_per_m2']:\"\";\n\t\t\t\t$sowing_type_id\t= isset($params['sowing_type_id'])?$params['sowing_type_id']:\"\";\n\t\t\t\t$sowing_moisture_source\t= isset($params['sowing_moisture_source'])?$params['sowing_moisture_source']:\"\";\n\t\t\t\t$row_to_row_diff\t= isset($params['row_to_row_diff'])?$params['row_to_row_diff']:\"\";\n // $row_to_row_diff_unit_id\t= isset($params['row_to_row_diff_unit_id'])?$params['row_to_row_diff_unit_id']:\"\";\n\n\t\t\t\t$error_code = 1;\n\t\t\t\t$succes = FALSE;\n\t\t\t\ttry{\n\t\t\t\t\t$db->beginTransaction();\n\t\t\t\t\tif($secretkey != $appkey){\n\t\t\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t\t\t}\t\n\t\t\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$user = new Application_Model_Users();\n\t\t\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t\t\t} \n\t\t\t\t\tif(!empty($alldata['DeviceID'])){\t\t\t\n\t\t\t\t\t\tif($alldata['DeviceID'] != $device_id){\n\t\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac'){\n\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t\t\t}\t\n\n\t\t\t\t\tif($alldata['App_Access_Status'] == 2){\n\t\t\t\t\t\t$error_code = 2;\n\t\t\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$farmerMaster = new Application_Model_Farmermasters();\n\t\t\t\t\t$allFarmerData = $farmerMaster->getFarmerDetailsByFarmerCode($farmer_code); \t\n\t\t\t\t\t$farmerID = $allFarmerData['id'];\n\t\t\t\t\t$farmerCode = $allFarmerData['FarmerCode'];\n\n\n\t\t\t\t\t$land_showing = array(); \n\t\t\t\t\t$land_showing['land_id'] = $land_id;\n\t\t\t\t\t$land_showing['mou_type_id'] = $mou_type_id;\n\t\t\t\t\t$land_showing['variety_id'] = $variety_id;\n\t\t\t\t\t$land_showing['category_id'] = $category_id;\n\t\t\t\t\t$land_showing['lot_no'] = $lot_no;\n\t\t\t\t\t$land_showing['tcw_of_seed'] = $tcw_of_seed;\n\t\t\t\t\t$land_showing['sowing_depth'] = $sowing_depth;\n\t\t\t\t\t$land_showing['sowing_date'] = $sowing_date;\n // $land_showing['sowing_depth_unit_id'] = $sowing_depth_unit_id;\n\t\t\t\t\t$land_showing['seed_rate_kg_per_acre'] = $seed_rate_kg_per_acre;\n\t\t\t\t\t$land_showing['seed_rate_per_m2'] = $seed_rate_per_m2;\n\t\t\t\t\t$land_showing['sowing_type_id'] = $sowing_type_id;\n\t\t\t\t\t$land_showing['sowing_moisture_source'] = $sowing_moisture_source;\n\t\t\t\t\t$land_showing['row_to_row_diff'] = $row_to_row_diff;\n // $land_showing['row_to_row_diff_unit_id'] = $row_to_row_diff_unit_id;\n\t\t\t\t\t$land_showing['farmer_code'] = $farmer_code;\n\t\t\t\t\t$land_showing['farmer_id'] = $farmerID;\n\t\t\t\t\t$land_showing['fe_code'] = $LoginID;\n\t\t\t\t\t$land_showing['sink_date_time'] = $sink_date_time;\n\t\t\t\t\t$land_showing['created'] = $this->currdate; \n\t\t\t\t\t$db->insert('logi_land_showing', $land_showing);\n\n\t\t\t\t\t$landdetailId = $db->lastInsertId();\n\n\t\t\t\t\t$db->commit();\n\t\t\t\t\t$succes = TRUE;\t \n\t\t\t\t}\n\n\t\t\t\tcatch(Exception $e){\n //Rollback transaction\n\t\t\t\t\t$db->rollBack();\n\t\t\t\t\t$error= $e->getMessage();\n\t\t\t\t}\n\n\t\t\t\tif($succes == TRUE ){\n\t\t\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Land Showing Detail Inserted successfully.', 'showing_id'=>$landdetailId));\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error));\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t}", "public function actionViewByHrd($id){\n return $this->render('viewByHrd',[\n 'model' => $this->findModel($id),\n ]);\n }", "public function actionViewByStaf($id){\n return $this->render('viewByStaf',[\n 'model' => $this->findModel($id),\n ]);\n }", "function viewAction(){\r\n\t\t//$iUnitId = Sys_Publib_Library::_getItemAttrById($_SESSION['arr_all_staff'],$_SESSION['staff_id'],'unit_id');\r\n\t\t//Lay ID phong ban cua NSD dang nhap hien thoi\r\n\t\t$pUrl = $_SERVER['REQUEST_URI'];\r\n\t\t$objFunction =\tnew\tSys_Function_DocFunctions()\t;\r\n\t\t$objFilter = new Zend_Filter();\t\t\t\r\n\t\t// Tieu de man hinh danh sach\r\n\t\t$this->view->docInfo \t\t= \"THÔNG TIN VĂN BẢN\";\r\n\t\t$sDocumentId = $this->_request->getParam('hdn_object_id','');\r\n\t\t$sType\t\t = $this->_request->getParam('hdn_type','');\r\n\t\t//Lay cac hang so dung chung\r\n\t\t$arrConst = Sys_Init_Config::_setProjectPublicConst();\r\n\t\t$this->view->arrConst = $arrConst;\r\n\t\t// Tao doi tuong Zend_Filter\r\n\t\t$objFilter = new Zend_Filter();\r\n\t\t$ojbSysLib = new Sys_Library();\r\n\t\t$objFullTextSearch = new fulltextsearch_modFulltextsearch();\r\n\t\t//Lay thong tin trong danh muc\r\n\t\t$arrDocSingle = $objFullTextSearch->DocFullTextSearchDocGetSingle($sDocumentId, $sType);\t\t\t\r\n\t\t$this->view->arrDocSingle = $arrDocSingle;\r\n\t\t//Lay gia tri tim kiem tren form\r\n\t\t\t$sfullTextSearch \t= $this->_request->getParam('txtfullTextSearch','');\r\n\t\t\t$iYear\t \t\t\t= $this->_request->getParam('year','');\r\n\t\t\t$iCurrentPage\t\t= $this->_request->getParam('hdn_current_page',0);\t\r\n\t\t\tif ($iCurrentPage <= 1){\r\n\t\t\t\t$iCurrentPage = 1;\r\n\t\t\t}\r\n\t\t\t$iNumRowOnPage = $this->_request->getParam('cbo_nuber_record_page',0);\r\n\t\t\tif ($iNumRowOnPage == 0)\r\n\t\t\t\t$iNumRowOnPage = 15;\r\n\t\t\t$arrParaSet = array(\"trangHienThoi\"=>$iCurrentPage, \"soBanGhiTrenTrang\"=>$iNumRowOnPage,\"chuoiTimKiem\"=>$sfullTextSearch,\"Nam\"=>$iYear);\r\n\t\t\t$_SESSION['seArrParameter'] = $arrParaSet;\t\r\n\t\t\r\n\t}", "public function view($rfp_id){\n\n $data['title'] = 'Admin View Request';\n $data['heading'] = 'View Request Page'; \n $data['rfp_id'] = decode($rfp_id);\n\n $data['record']=$this->Rfp_model->get_result('rfp',['id' => decode($rfp_id)],'1');\n // pr($data['record'],1);\n $data['subview'] = 'admin/rfp/view';\n $this->load->view('admin/layouts/layout_main', $data);\n }", "public function landVisitDetailAction(){\n\n\t\t\t\t$params = $this->getRequest()->getParams(); \n\t\t\t\t$db = $this->db;\n\t\t\t\t$secretkey = $this->secretkey; \n\t\t\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\";\n\t\t\t\t$farmer_code\t= isset($params['farmer_code'])?$params['farmer_code']:\"\";\n\t\t\t\t$land_id\t= isset($params['land_id'])?$params['land_id']:\"\";\n\t\t\t\t$stage_id\t= isset($params['stage_id'])?$params['stage_id']:\"\";\n\t\t\t\t$disease_score\t= isset($params['disease_score'])?$params['disease_score']:\"\";\n\t\t\t\t$logging_score\t= isset($params['logging_score'])?$params['logging_score']:\"\";\n\t\t\t\t$presemption_of_insect\t= isset($params['presemption_of_insect'])?$params['presemption_of_insect']:\"\";\n\t\t\t\t$soil_moisture_id\t= isset($params['soil_moisture_id'])?$params['soil_moisture_id']:\"\";\n\t\t\t\t$quality_of_crop\t= isset($params['quality_of_crop'])?$params['quality_of_crop']:\"\";\n\t\t\t\t$sink_date_time \t= isset($params['sink_date_time'])?$params['sink_date_time']:\"\";\n\n\n\t\t\t\t$error_code = 1;\n\t\t\t\t$succes = FALSE; \n\t\t\t\ttry{\n\t\t\t\t\t$db->beginTransaction();\n\t\t\t\t\tif($secretkey != $appkey){\n\t\t\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t\t\t}\t\n\t\t\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$user = new Application_Model_Users();\n\t\t\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t\t\t} \n\t\t\t\t\tif(!empty($alldata['DeviceID'])){\t\t\t\n\t\t\t\t\t\tif($alldata['DeviceID'] != $device_id){\n\t\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac'){\n\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t\t\t}\t\n\n\t\t\t\t\tif($alldata['App_Access_Status'] == 2){\n\t\t\t\t\t\t$error_code = 2;\n\t\t\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$farmerMaster = new Application_Model_Farmermasters();\n\t\t\t\t\t$allFarmerData = $farmerMaster->getFarmerDetailsByFarmerCode($farmer_code); \t\n\t\t\t\t\t$farmerID = $allFarmerData['id'];\n\t\t\t\t\t$farmerCode = $allFarmerData['FarmerCode'];\n\n\n\t\t\t\t\tif(isset($_FILES['image']['tmp_name']) AND !empty($_FILES['image']['name'])){\n\t\t\t\t\t\t$tempName = $_FILES['image']['tmp_name'];\n\t\t\t\t\t\t$imageName = time().$_FILES['image']['name']; \n\t\t\t\t\t\t$uploads = 'uploads/visit_photograph/';\n\t\t\t\t\t\tif(!file_exists($uploads)){\n\t\t\t\t\t\t\tmkdir($uploads);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$pathComplete = $uploads.$imageName;\n\t\t\t\t\t\t@move_uploaded_file($tempName,$pathComplete);\n\n\t\t\t\t\t}\n\n\t\t\t\t\t$land_visit = array(); \n\n\t\t\t\t\t$land_visit['land_id'] = $land_id;\n\t\t\t\t\t$land_visit['stage_id'] = $stage_id;\n\t\t\t\t\t$land_visit['disease_score'] = $disease_score;\n\t\t\t\t\t$land_visit['logging_score'] = $logging_score;\n\t\t\t\t\t$land_visit['presemption_of_insect'] = $presemption_of_insect;\n\t\t\t\t\t$land_visit['soil_moisture_id'] = $soil_moisture_id;\n\t\t\t\t\t$land_visit['quality_of_crop'] = $quality_of_crop;\n\t\t\t\t\t$land_visit['image'] = $pathComplete;\n\t\t\t\t\t$land_visit['farmer_code'] = $farmer_code;\n\t\t\t\t\t$land_visit['farmer_id'] = $farmerID;\n\t\t\t\t\t$land_visit['fe_code'] = $LoginID;\n\t\t\t\t\t$land_visit['sink_date_time'] = $sink_date_time;\n\t\t\t\t\t$land_visit['created'] = $this->currdate; \n\t\t\t\t\t$db->insert('logi_land_visit', $land_visit);\n\n\t\t\t\t\t$landdetailId = $db->lastInsertId();\n\n\t\t\t\t\t$db->commit();\n\t\t\t\t\t$succes = TRUE;\t \n\t\t\t\t}\n\n\t\t\t\tcatch(Exception $e){\n //Rollback transaction\n\t\t\t\t\t$db->rollBack();\n\t\t\t\t\t$error= $e->getMessage();\n\t\t\t\t}\n\n\t\t\t\tif($succes == TRUE ){\n\t\t\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Land visit Detail Inserted successfully.', 'land_visit_id'=>$landdetailId));\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error));\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t}", "public function viewAclAction()\n {\n \tif($this->getRequest()->getParam('id')){\n \t\t$db = new Rsvacl_Model_DbTable_DbAcl();\n \t\t$acl_id = $this->getRequest()->getParam('id');\n \t\t$rs=$db->getAcl($acl_id);\n \t\t$this->view->rs=$rs;\n \t} \t \n \t\n }", "public function viewAction()\n {\n $id = $this->_getPrimaryId();\n $row = $this->_getRow($id);\n\n $this->view->row = $row;\n }", "public function show_detail($i_id=0)\r\n {}", "public function show_detail($i_id=0)\r\n {}", "public function landIrrigationDetailAction(){\n\n\t\t\t\t$params = $this->getRequest()->getParams(); \n\t\t\t\t$db = $this->db;\n\t\t\t\t$secretkey = $this->secretkey; \n\t\t\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\";\n\t\t\t\t$farmer_code\t= isset($params['farmer_code'])?$params['farmer_code']:\"\";\n\t\t\t\t$land_id\t= isset($params['land_id'])?$params['land_id']:\"\";\n\t\t\t\t$irri_type_id \t= isset($params['irri_type_id'])?$params['irri_type_id']:\"\";\n\t\t\t\t$irri_no_id\t= isset($params['irri_no_id'])?$params['irri_no_id']:\"\";\n\t\t\t\t$stage_id\t= isset($params['stage_id'])?$params['stage_id']:\"\";\n\t\t\t\t$irri_date\t= isset($params['irri_date'])?$params['irri_date']:\"\";\n\t\t\t\t$days_after_sowing\t= isset($params['days_after_sowing'])?$params['days_after_sowing']:\"\"; \n\t\t\t\t$sink_date_time\t= isset($params['sink_date_time'])?$params['sink_date_time']:\"\";\n\n\n\t\t\t\t$error_code = 1;\n\t\t\t\t$succes = FALSE;\n\t\t\t\ttry{\n\t\t\t\t\t$db->beginTransaction();\n\t\t\t\t\tif($secretkey != $appkey){\n\t\t\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t\t\t}\t\n\t\t\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$user = new Application_Model_Users();\n\t\t\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t\t\t} \n\t\t\t\t\tif(!empty($alldata['DeviceID'])){\t\t\t\n\t\t\t\t\t\tif($alldata['DeviceID'] != $device_id){\n\t\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac'){\n\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t\t\t}\t\n\n\t\t\t\t\tif($alldata['App_Access_Status'] == 2){\n\t\t\t\t\t\t$error_code = 2;\n\t\t\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$farmerMaster = new Application_Model_Farmermasters();\n\t\t\t\t\t$allFarmerData = $farmerMaster->getFarmerDetailsByFarmerCode($farmer_code); \t\n\t\t\t\t\t$farmerID = $allFarmerData['id'];\n\t\t\t\t\t$farmerCode = $allFarmerData['FarmerCode'];\n\n\n\t\t\t\t\t$land_irrigation = array(); \n\t\t\t\t\t$land_irrigation['land_id'] = $land_id;\n\t\t\t\t\t$land_irrigation['irri_type_id'] = $irri_type_id;\n\t\t\t\t\t$land_irrigation['irri_no_id'] = $irri_no_id;\n\t\t\t\t\t$land_irrigation['stage_id'] = $stage_id;\n\t\t\t\t\t$land_irrigation['irri_date'] = $irri_date;\n\t\t\t\t\t$land_irrigation['days_after_sowing'] = $days_after_sowing;\n\t\t\t\t\t$land_irrigation['farmer_code'] = $farmer_code;\n\t\t\t\t\t$land_irrigation['farmer_id'] = $farmerID;\n\t\t\t\t\t$land_irrigation['fe_code'] = $LoginID;\n\t\t\t\t\t$land_irrigation['sink_date_time'] = $sink_date_time;\n\t\t\t\t\t$land_irrigation['created'] = $this->currdate; \n\t\t\t\t\t$db->insert('logi_land_irrigation', $land_irrigation);\n\n\t\t\t\t\t$landdetailId = $db->lastInsertId();\n\n\t\t\t\t\t$db->commit();\n\t\t\t\t\t$succes = TRUE;\t \n\t\t\t\t}\n\n\t\t\t\tcatch(Exception $e){\n //Rollback transaction\n\t\t\t\t\t$db->rollBack();\n\t\t\t\t\t$error= $e->getMessage();\n\t\t\t\t}\n\n\t\t\t\tif($succes == TRUE ){\n\t\t\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Land irrigation Detail Inserted successfully.', 'land_irrigation_id'=>$landdetailId));\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error));\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t}", "public function viewAction()\r\n {\r\n $this->indexAction();\r\n }", "public function view_action()\n {\n $mode = get_param_string('mode', 'cns');\n $id = get_param_integer('id');\n\n if ($mode == 'cns') {\n $rows = $GLOBALS['FORUM_DB']->query_select('f_moderator_logs', array('l_reason AS reason', 'id', 'l_by AS member_id', 'l_date_and_time AS date_and_time', 'l_the_type AS the_type', 'l_param_a AS param_a', 'l_param_b AS param_b'), array('id' => $id), '', 1);\n } else {\n $rows = $GLOBALS['SITE_DB']->query_select('actionlogs', array('id', 'member_id', 'date_and_time', 'the_type', 'param_a', 'param_b', 'ip'), array('id' => $id), '', 1);\n }\n\n if (!array_key_exists(0, $rows)) {\n warn_exit(do_lang_tempcode('MISSING_RESOURCE'));\n }\n $row = $rows[0];\n\n $username = $GLOBALS['FORUM_DRIVER']->get_username($row['member_id']);\n if (is_null($username)) {\n $username = do_lang('UNKNOWN');\n }\n\n $type_str = do_lang($row['the_type'], $row['param_a'], $row['param_b'], null, null, false);\n if (is_null($type_str)) {\n $type_str = $row['the_type'];\n }\n\n $fields = array(\n 'USERNAME' => $GLOBALS['FORUM_DRIVER']->member_profile_hyperlink($row['member_id'], false, '', false),\n 'DATE_TIME' => get_timezoned_date($row['date_and_time']),\n 'ACTION' => $type_str,\n 'PARAMETER_A' => is_null($row['param_a']) ? '' : $row['param_a'],\n 'PARAMETER_B' => is_null($row['param_b']) ? '' : $row['param_b'],\n );\n\n if (array_key_exists('ip', $row)) {\n $fields['IP_ADDRESS'] = escape_html($row['ip']);\n }\n\n if (array_key_exists('reason', $row)) {\n $fields['REASON'] = escape_html($row['reason']);\n }\n\n if (addon_installed('securitylogging')) {\n if (array_key_exists('ip', $row)) {\n $banned_test_1 = ip_banned($row['ip'], true);\n $fields['IP_BANNED'] = (!$banned_test_1) ? do_lang_tempcode('NO') : do_lang_tempcode('YES');\n if ($row['ip'] != get_ip_address()) {\n $fields['IP_BANNED']->attach(do_template('ACTIONLOGS_TOGGLE_LINK', array('_GUID' => 'eff2890f2193ece32df8ec8ee48b252d', 'URL' => build_url(array('page' => 'admin_ip_ban', 'type' => 'toggle_ip_ban', 'id' => $row['ip'], 'redirect' => get_self_url(true)), get_module_zone('admin_ip_ban')))));\n }\n\n if ($row['ip'] != get_ip_address()) {\n if (get_option('stopforumspam_api_key') . get_option('tornevall_api_username') != '') {\n $fields['SYNDICATE_TO_STOPFORUMSPAM'] = do_template('ACTIONLOGS_TOGGLE_LINK', array(\n '_GUID' => '7d10045c6b3b48f256e2f8eb5535809c',\n 'LABEL' => do_lang_tempcode('PROCEED'),\n 'LONELY' => true,\n 'URL' => build_url(array('page' => 'admin_ip_ban', 'type' => 'syndicate_ip_ban', 'ip' => $row['ip'], 'member_id' => $row['member_id'], 'reason' => do_lang('BANNED_ADDRESSES'), 'redirect' => get_self_url(true)), get_module_zone('admin_ip_ban')),\n ));\n }\n }\n }\n\n if ((!is_guest($row['member_id'])) && ($row['member_id'] != get_member())) {\n $fields['SUBMITTER_BANNED'] = do_template('ACTIONLOGS_TOGGLE_LINK', array(\n '_GUID' => 'f79fb00ef35d89381371a67bc9c4d69b',\n 'LONELY' => true,\n 'URL' => build_url(array('page' => 'admin_ip_ban', 'type' => 'toggle_submitter_ban', 'id' => $row['member_id'], 'redirect' => get_self_url(true)), get_module_zone('admin_ip_ban')),\n ));\n } else {\n $banned_test_2 = $GLOBALS['SITE_DB']->query_select_value_if_there('usersubmitban_member', 'the_member', array('the_member' => $row['member_id']));\n $fields['SUBMITTER_BANNED'] = is_null($banned_test_2) ? do_lang_tempcode('NO') : do_lang_tempcode('YES');\n }\n\n if (((get_forum_type() == 'cns') && (!is_guest($row['member_id']))) && ($row['member_id'] != get_member())) {\n $fields['MEMBER_BANNED'] = do_template('ACTIONLOGS_TOGGLE_LINK', array(\n '_GUID' => '6b192ecfad1afc67bb8c2f1e744cc3b1',\n 'LONELY' => true,\n 'URL' => build_url(array('page' => 'admin_ip_ban', 'type' => 'toggle_member_ban', 'id' => $row['member_id'], 'redirect' => get_self_url(true)), get_module_zone('admin_ip_ban')),\n ));\n } else {\n $banned_test_3 = $GLOBALS['FORUM_DRIVER']->is_banned($row['member_id']);\n $fields['MEMBER_BANNED'] = $banned_test_3 ? do_lang_tempcode('YES') : do_lang_tempcode('NO');\n }\n }\n $fields['INVESTIGATE_USER'] = hyperlink(build_url(array('page' => 'admin_lookup', 'id' => (array_key_exists('ip', $row)) ? $row['ip'] : $row['member_id']), '_SELF'), do_lang_tempcode('PROCEED'), false, false);\n\n // Is there a revision here?\n require_code('revisions_engine_database');\n $revision_engine = new RevisionEngineDatabase($mode == 'cns');\n $revision = $revision_engine->find_revision_for_log($id);\n if (is_null($revision)) {\n require_code('revisions_engine_files');\n $revision_engine = new RevisionEngineFiles();\n $revision = $revision_engine->find_revision_for_log($id);\n }\n if (!is_null($revision)) {\n if (isset($revision['r_resource_type']) && isset($revision['r_resource_id'])) {\n require_code('content');\n list($content_title, , , , $content_url) = content_get_details($revision['r_resource_type'], $revision['r_resource_id']);\n if (empty($content_title)) {\n $content_title = $revision['r_original_title'];\n }\n if (!is_null($content_url)) {\n $fields['VIEW'] = hyperlink($content_url, $content_title, false, true);\n }\n }\n\n if (isset($revision['r_original_content_owner'])) {\n $fields['CONTENT_OWNER'] = $GLOBALS['FORUM_DRIVER']->member_profile_hyperlink($revision['r_original_content_owner']);\n }\n\n if (isset($revision['r_original_content_timestamp'])) {\n $fields['CONTENT_DATE_AND_TIME'] = get_timezoned_date($revision['r_original_content_timestamp']);\n }\n\n if (isset($revision['r_original_title'])) {\n if ($revision['r_original_title'] != '') {\n $fields['TITLE_PRIOR_TO_REVISION'] = $revision['r_original_title'];\n }\n }\n\n $fields['TEXT_PRIOR_TO_REVISION'] = with_whitespace($revision['r_original_text'], true);\n\n if (isset($revision['r_original_resource_fs_path'])) {\n $fields['RESOURCE_FS_PATH_PRIOR_TO_REVISION'] = $revision['r_original_resource_fs_path'];\n }\n\n if (isset($revision['r_original_resource_fs_record']) && strlen($revision['r_original_resource_fs_record']) < 1024 * 50/*50kb reasonable limit*/) {\n $fields['RESOURCE_FS_RECORD_PRIOR_TO_REVISION'] = with_whitespace($revision['r_original_resource_fs_record'], true);\n }\n\n if (has_privilege(get_member(), 'delete_revisions')) {\n $delete_url = build_url(array('page' => 'admin_revisions', 'type' => 'delete', 'id' => $revision['id'], 'revision_type' => $revision['revision_type'], 'redirect' => get_self_url(true)), get_module_zone('admin_revisions'));\n $delete = hyperlink($delete_url, do_lang_tempcode('DELETE'), false, false, do_lang_tempcode('DELETE_REVISION'), null, new Tempcode());\n $fields['DELETE_REVISION'] = $delete;\n }\n\n /*if (has_privilege(get_member(), 'undo_revisions')) {\n $undo_url = build_url(array('page' => 'admin_revisions', 'type' => 'undo', 'id' => $revision['id'], 'revision_type' => $revision['revision_type'], 'redirect' => get_self_url(true)), get_module_zone('admin_revisions'));\n $delete = hyperlink($delete_url, do_lang_tempcode('UNDO'), false, false, do_lang_tempcode('UNDO_REVISION'), null, new Tempcode());\n $fields['UNDO_REVISION'] = $delete;\n }*/\n }\n\n require_code('templates_map_table');\n return map_table_screen($this->title, $fields);\n }", "public function oldviewAction() {\n\t\t$id = (int)$this->_request->getParam('id');\n\t\tPageTitle::setTitle($this->view, $this->_request, array($id));\n\t\t$debugdate = $this->_request->getParam('debugdate');\n\t\t$layout = trim($this->_request->getParam('layout',''));\n\t\t\n\t\t$taFinder = new TeachingActivities();\n\t\t$ta = $taFinder->getTa($id);\n\t\t\n\t\tif ($ta->isReleased() != true) {\n\t\t\tthrow new Exception(\"Teaching activity $id is not released yet.\");\n\t\t}\n\t\t\n\t\t$this->view->ta = $ta;\n\n\t\t$resourceError = false;\n\t\ttry {\n\t\t\t$resourceService = new MediabankResourceService();\n\t\t\t$resources = $resourceService->getResources($id, 'ta');\n\t\t\t$allowAddResources = $resourceService->allowAdd();\n\t\t} catch (Exception $ex) {\n\t\t\t$resourceError = true;\n\t\t\t$resources = array();\n\t\t\t$allowAddResources = false;\n\t\t}\n\t\t$this->view->allowAddResources = $allowAddResources;\n\t\t$this->view->resourceError = $resourceError;\n\t\t$this->view->resources = $resources;\n\t\t\n\t\t//Check if user is a staff\n\t\t$this->view->isStaffOrAbove = UserAcl::isStaffOrAbove();\n //Store ACL for each resource action which can be accessed by the current user\n //And allow/disallow those actions. \n\t\t$this->view->resourceAcl = ResourceAcl::accessAll(array('type'=>'ta','auto_id'=>$id));\n\n\t\t$this->view->revisions = $taFinder->getTaRevisions($ta->taid);\n\t\t$this->view->released_los = $ta->getLinkedLearningObjectiveWithStatus(Status::$RELEASED);\n\t\t$this->view->title = 'Teaching Activity - '.$ta->auto_id;\n\t\t\n\t\t$studentEvaluateService = new StudentEvaluateService();\n\t\t$this->view->taEvaluations = $studentEvaluateService->getEvaluationForTaId($id);\n\n\t\t$this->view->isMyTa = Utilities::isMyTa($ta);\n\t\t$this->view->debugdate = $debugdate;\n\n if(!empty($layout)) {\n switch($layout) {\n case 'pblview': \n $this->view->pblTaTypePrev = $this->_request->getParam('pblTaTypePrev','');\n $this->view->pblTaTypeNext = $this->_request->getParam('pblTaTypeNext','');\n $this->render('pblview');\n break;\n }\n }\n\t}", "protected function viewAction()\n {\n }", "public function viewAction()\n {\t\n $auth = Zend_Auth::getInstance();\n \tif($auth->hasIdentity())\n {\n $loginUserId = $auth->getStorage()->read()->id;\n $businessunit_id = $auth->getStorage()->read()->businessunit_id;\n $department_id = $auth->getStorage()->read()->department_id; \n $loginuserRole = $auth->getStorage()->read()->emprole;\n $loginuserGroup = $auth->getStorage()->read()->group_id;\n }\n $id = $this->getRequest()->getParam('id');\n try\n {\n if($id != '')\n {\n\t\t\t $app_manager_model = new Default_Model_Appraisalmanager();\n\t\t\t\t$line_managers = array();\n\t\t\t\t$line_managers = $app_manager_model->getLineManagers($id,$loginUserId);\n\t\t\t\t$appraisal_init_model = new Default_Model_Appraisalinit();\n\t\t\t\t$appraisal_data = $appraisal_init_model->getappdata_forview($id);\n\t\t\t\t\n if(is_numeric($id) && $id>0 && $line_managers && !empty($appraisal_data))\n {\n\t\t\t\t\t$appraisal_data['process_status'] = '';\n if(!empty($appraisal_data))\n {\n \tif($appraisal_data['initialize_status'] == 1)\n \t{\n \t\tif($appraisal_data['enable_step'] == 1)\n \t\t\t$appraisal_data['process_status'] = 'Enabled to Managers';\n \t\tif($appraisal_data['enable_step'] == 2)\n \t\t\t$appraisal_data['process_status'] = 'Enabled to Employees';\t\n \t}\n \telse if($appraisal_data['initialize_status'] == 2)\n \t{\n \t\t$appraisal_data['process_status'] = 'Initialize Later';\n \t}else\n\t\t\t \t{\n\t\t\t \t $data['process_status'] = 'In progress';\t\n\t\t\t \t}\n }\n if($appraisal_data['status'] == 1) {\n \t $appraisal_data['status']=\"Open\";\n }else if($appraisal_data['status'] == 2) {\n \t $appraisal_data['status']=\"Closed\";\n }else {\n $appraisal_data['status']=\"Force Closed\";\n }\t\n if($appraisal_data['appraisal_ratings'] == 1) {\n \t $appraisal_data['appraisal_ratings']=\"1-5\";\n }else {\n $appraisal_data['appraisal_ratings']=\"1-10\";\n }\t\n if($appraisal_data['appraisal_mode'] == 'Quarterly'){\n\t\t\t\t\t\t $appraisal_data['appraisal_period']=\"Q\".$appraisal_data['appraisal_period'];\n }\n\t\t\t\t\t else if($appraisal_data['appraisal_mode'] == 'Half-yearly'){\n\t\t\t\t\t\t $appraisal_data['appraisal_period']= \"H\".$appraisal_data['appraisal_period'];\n\t\t\t\t\t }\n\t\t\t\t\t else {\n\t\t\t\t\t\t $appraisal_data['appraisal_period']=\"Yearly\";\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t if($appraisal_data['enable_step'] == 1) {\n \t $appraisal_data['enable_step']=\"Managers\";\n }else {\n $appraisal_data['enable_step']=\"Employees\";\n }\n\t\t\t\t\t $appraisal_data['managers_due_date'] = sapp_Global::change_date($appraisal_data['managers_due_date'],'view');\n $appraisal_data['employees_due_date'] = sapp_Global::change_date($appraisal_data['employees_due_date'],'view');\n $manager_groups = $app_manager_model->getManagergroups($id,$loginUserId);\n $view = $this->getHelper('ViewRenderer')->view;\n $view->previ_data = 'no'; \n $view->data = $appraisal_data;\n $text = $view->render('appraisalinit/view.phtml');\n $this->view->appraisal_id = $id;\n $this->view->manager_id = $loginUserId;\n $this->view->manager_groups = $manager_groups;\n $this->view->appraisal_data = $appraisal_data;\n $this->view->app_text = $text;\n $this->view->controllername = 'appraisalmanager';\n $this->view->id = $id;\n }\n else \n {\n $this->view->ermsg = 'nodata';\n }\n }\n else\n {\n $this->view->ermsg = 'nodata';\n }\n } \n catch (Exception $ex) \n {\n $this->view->ermsg = 'nodata';\n }\n }", "public function actionView($id)\n {\n $dis = (new Query());\n $dis ->select([ 'tf_lunas.status'])\n ->FROM('tf_lunas')\n ->andWhere('tf_lunas.id_tf_lunas=:id_a', array(':id_a'=>$id))\n ->limit(6);\n $command = $dis->createCommand();\n $dis = $command->queryAll();\n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'dis' => $dis,\n ]);\n }", "public function actionIndexByHrd(){\n $searchModel = new PermohonanIzinSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('indexByHrd',[\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function display($sort_by = 'alue_code', $sort_order = 'asc', $code_sel = '0', $filter = '') \r\n {\r\n if (($sort_by != $this->session->userdata('sort_by')) ||\r\n ($sort_order != $this->session->userdata('sort_order')) ||\r\n ($code_sel != $this->session->userdata('code_sel')) ||\r\n ($filter != $this->session->userdata('filter'))) {\r\n \r\n //Jos jokin tilamuuttuja muuttuu, poistetaan virheteksti näkyvistä\r\n if(isset($_SESSION['error'])){\r\n unset($_SESSION['error']);\r\n }\r\n }\r\n \r\n //Tallenna näytön uusi tila\r\n $territory_view_state_data = array(\r\n 'sort_by' => $sort_by,\r\n 'sort_order' => $sort_order,\r\n 'code_sel' => $code_sel,\r\n 'filter' => $filter\r\n );\r\n $this->session->set_userdata($territory_view_state_data);\r\n \r\n //Hakuparametrit näytölle\r\n $data['display_fields'] = array(\r\n 'alue_code'\t\t=> 'numero',\r\n 'alue_detail'\t=> 'alue_nimi',\r\n 'alue_location'\t=> 'lisätieto',\r\n 'alue_taloudet'\t=> 'koko',\r\n 'event_count'\t=> 'poisto'\r\n );\r\n \r\n //Hakuparametrit kantaan\r\n $data['database_fields'] = array(\r\n 'alue_code'\t\t=> 'numero',\r\n 'alue_detail'\t=> 'alue_nimi',\r\n 'alue_location'\t=> 'lisätieto',\r\n 'alue_taloudet'\t=> 'koko',\r\n 'event_count'\t=> 'määrä'\r\n );\r\n\r\n //Korjaa ääkköset takaisin\r\n $filter = urldecode($filter);\r\n \r\n //Hae tiedot\r\n $results = $this->Maintenance_model->search($data['database_fields'], $sort_by, $sort_order, $code_sel);\r\n //Tiedot näytölle sopiviksi\r\n $data['alueet'] = $this->create_displayrows($results);\r\n \r\n $data['num_results'] = $results['num_rows'];\r\n \r\n //Parameters back to view page\r\n $data['sort_by'] = $sort_by;\r\n $data['sort_order'] = $sort_order;\r\n $data['code_sel'] = $code_sel;\r\n $data['filter'] = $filter;\r\n \r\n //Hae aluekoodit\r\n $tresults = $this->Event_model->get_terr_codes();\r\n $data['territory_codes'] = $tresults['rows'];\r\n\r\n //Alusta tietorakenne undo/redo - toimintoa varten\r\n //Jos parametreja ei ole annettu, alusta tietorakenne\r\n $numargs = func_num_args();\r\n if ($numargs == 0) {\r\n /** Initialize **/\r\n $undo_redo_stack = new UndoRedoStack();\r\n \r\n //Poistetaan virheteksti näkyvistä\r\n if(isset($_SESSION['error'])){\r\n unset($_SESSION['error']);\r\n }\r\n } else {\r\n //Muuten\r\n if (!isset($_SESSION['undo_redo_terr_edit'])) {\r\n /** Initialize **/\r\n $undo_redo_stack = new UndoRedoStack();\r\n } else {\r\n /** UNSERIALIZE **/\r\n $undo_redo_stack = unserialize($_SESSION['undo_redo_terr_edit']);\r\n }\r\n }\r\n \r\n $data['can_undo'] = $undo_redo_stack->can_undo();\r\n $data['can_redo'] = $undo_redo_stack->can_redo();\r\n \r\n /** SERIALIZE **/\r\n $_SESSION['undo_redo_terr_edit'] = serialize($undo_redo_stack);\r\n \r\n $this->load->view('maintenance_view', $data);\r\n }", "public function actionHtView($id)\n {\n ob_start();\n Yii::app()->theme='back';\n $rec=HtuseHome::model()->findByPk($id);\n\n $this->render('htview',array('view'=>$rec));\n\n }", "public function viewAction()//23:15\n {\n\n }", "public function detailAction() {\n\n //GET THE LIST ITEM\n $this->view->listDetail = Engine_Api::_()->getItem('list_listing',(int) $this->_getParam('id'));\n }", "public function view($id)\n\t{\n\t\n\t\t$this->is_allowed('amuco_details_request_office_view');\n if($this->input->get('popup')){\n\t\t\t$this->data['current_page'] = 'Modal';\n\t\t}else{\n\t\t\t$this->data['current_page'] = 'View';\n\t\t}\n\t\t$this->data['amuco_details_request_office'] = $this->model_amuco_details_request_office->join_avaiable()->filter_avaiable()->find($id);\n // var_dump($this->data['amuco_details_request_office']);\n\t\t$this->template->title('Amuco Details Request Office Detail');\n\t\t$this->render('backend/standart/administrator/amuco_details_request_office/amuco_details_request_office_view', $this->data);\n\t}", "public function metaDetailAction() {\n\n //ONLY LOGGED IN USER CAN ADD OVERVIEW\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n //GET VIEWER\n $viewer = Engine_Api::_()->user()->getViewer();\n\n //GET LISTING ID AND OBJECT\n $listing_id = $this->_getParam('listing_id');\n\n \n $this->view->sitereview = $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n Engine_Api::_()->core()->setSubject($sitereview); \n //GET LISTING TYPE ID\n $listingtype_id = $sitereview->listingtype_id;\n\n if(!Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\n $this->_helper->content\n ->setContentName(\"sitereview_dashboard_metadetails_listtype_$listingtype_id\")\n //->setNoRender()\n ->setEnabled();\n \n }\n \n Engine_Api::_()->sitereview()->setListingTypeInRegistry($listingtype_id);\n $listingType = Zend_Registry::get('listingtypeArray' . $listingtype_id);\n\n if (empty($listingType->metakeyword)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n if (!$sitereview->authorization()->isAllowed($viewer, 'edit_listtype_' . $listingtype_id)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n if (!Engine_Api::_()->authorization()->getPermission($viewer->level_id, 'sitereview_listing', \"metakeyword_listtype_$listingtype_id\")) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n //SELECTED TAB\n $this->view->TabActive = \"metadetails\";\n\n //SET FORM\n $this->view->form = $form = new Sitereview_Form_Metainfo();\n\n $tableOtherinfo = Engine_Api::_()->getDbTable('otherinfo', 'sitereview');\n\n //POPULATE FORM\n $value['keywords'] = $tableOtherinfo->getColumnValue($listing_id, 'keywords');\n\n $form->populate($value);\n\n //CHECK FORM VALIDATION\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n //GET FORM VALUES\n $values = $form->getValues();\n $tableOtherinfo->update(array('keywords' => $values['keywords']), array('listing_id = ?' => $listing_id));\n\n //SHOW SUCCESS MESSAGE\n $form->addNotice(Zend_Registry::get('Zend_Translate')->_('Your changes have been saved successfully.'));\n }\n }", "public function oneto50kAction(){\r\n\tif($this->_getParam('id',false)){\r\n\t$gazetteers = new Osdata();\r\n\t$this->view->gazetteer = $gazetteers->getGazetteer($this->_getParam('id'));\t\r\n\t} else {\r\n\t\tthrow new Pas_Exception_Param($this->_missingParameter);\t\r\n\t}\r\n\t}", "public function indexAction() {\r\n\t\t// set default filter (we use this to optimize the first call/rendering of the available 'sub-actions')\r\n\t\t$GLOBALS['BE_USER']->pushModuleData('tx_extracache_manager_startDateFilterForDbRecords', date('d.m.Y',strtotime(\"-10 day\")));\r\n\t\t$GLOBALS['BE_USER']->pushModuleData('tx_extracache_manager_stopDateFilterForDbRecords', NULL);\r\n\t\t$GLOBALS['BE_USER']->pushModuleData('tx_extracache_manager_searchPhraseForFiles', '---- SET FILTER! ----');\r\n\t\t$GLOBALS['BE_USER']->pushModuleData('tx_extracache_manager_searchPhraseForFolders', '---- SET FILTER! ----');\r\n\t\t$GLOBALS['BE_USER']->pushModuleData('tx_extracache_manager_searchPhraseForTablePages', '---- SET FILTER! ----');\r\n\t\t$GLOBALS['BE_USER']->pushModuleData('tx_extracache_manager_searchPhraseForTableStaticCache', '---- SET FILTER! ----');\r\n\r\n\t\ttry {\r\n\t\t\t$showDatabaseDetails = $this->getModuleData('tx_extracache_manager_showDatabaseDetails') === TRUE ? TRUE : FALSE;\r\n\t\t\t$showFilesDetails = $this->getModuleData('tx_extracache_manager_showFilesDetails') === TRUE ? TRUE : FALSE;\r\n\t\r\n\t\t\t$this->getView()->assign ( 'showDatabaseDetails', $showDatabaseDetails);\r\n\t\t\t$this->getView()->assign ( 'showFilesDetails', $showFilesDetails);\r\n\t\t\t$this->getView()->assign ( 'tableEventLog', $this->getCacheDatabaseEntryRepositoryForTableEventlog()->getFileTable () );\r\n\t\t\t$this->getView()->assign ( 'tableEventQueue', $this->getCacheDatabaseEntryRepositoryForTableEventqueue()->getFileTable () );\r\n\t\t\t$this->getView()->assign ( 'tablePages', $this->getCacheDatabaseEntryRepositoryForTablePages()->getFileTable () );\r\n\t\t\t$this->getView()->assign ( 'tableStaticCache', $this->getCacheDatabaseEntryRepositoryForTableStaticCache()->getFileTable () );\r\n\r\n\t\t\tif($showDatabaseDetails) {\r\n\t\t\t\t$this->getView()->assign ( 'countDatbaseEntrysForTableEventlog', $this->getCacheDatabaseEntryRepositoryForTableEventlog()->countAll () );\r\n\t\t\t\t$this->getView()->assign ( 'countDatbaseEntrysForTableEventqueue', $this->getCacheDatabaseEntryRepositoryForTableEventqueue()->countAll () );\r\n\t\t\t\t$this->getView()->assign ( 'countDatbaseEntrysForTablePages', $this->getCacheDatabaseEntryRepositoryForTablePages()->count ( 'tx_extracache_cleanerstrategies!=\\'\\' OR tx_extracache_events!=\\'\\'' ) );\r\n\t\t\t\t$this->getView()->assign ( 'countDatbaseEntrysForTableStaticCache', $this->getCacheDatabaseEntryRepositoryForTableStaticCache()->countAll () );\r\n\t\t\t}\r\n\t\t\tif($showFilesDetails) {\r\n\t\t\t\t$this->getView()->assign ( 'countFiles', $this->getCacheFileRepository()->countAll () );\r\n\t\t\t}\r\n\r\n\t\t\treturn $this->getView()->render ( 'index' );\r\n\t\t} catch (Exception $e) {\r\n\t\t\treturn $this->showErrorMessage($e);\r\n\t\t}\t\r\n\t}", "public function actionView($id) {\n $dateRange=$this->getDateRange();\n\t\tif(isset($_GET['stage']) && is_numeric($_GET['stage']))\n\t\t\t$viewStage = $_GET['stage'];\n\t\telse\n\t\t\t$viewStage = null;\n\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),'viewStage'=>$viewStage, 'dateRange'=>$dateRange,\n\t\t));\n\t}", "public function detail($id){\n \n $this->_estado->_setIdTableValue($id);\n $params['rsEstado'] = $this->_estado->getRecord();\n \\kerana\\View::showView($this->_current_module,'estado/detail',$params);\n \n }", "public function viewAction() {\n\t\t$id = $this->_getParam('id');\n\t\t$taFinder = new TeachingActivities();\n\t\t$ta = $taFinder->getTa($id);\n\t\t\n\t\t$latest_flag = ($this->_getParam('latest') == 'f') ? false : true;\n\t\t$latest_ta_id = $ta->latestReleasedVersionId();\n\t\tif ($latest_ta_id != $id && !UserAcl::isDomainAdminOrAbove() && $latest_flag) {\n\t\t\t$this->_redirect('/teachingactivity/view/id/'.$latest_ta_id);\n\t\t\treturn;\n\t\t}\n\t\t$this->view->debugdate = $this->_getParam('debugdate');\n\t\t$layout = $this->_getParam('layout', '');\n\n\t\tPageTitle::setTitle($this->view, $this->_request, array($id));\n\n\t\tif ($ta->isReleased() != true) {\n\t\t\tthrow new Exception(\"Teaching activity $id is not released yet.\");\n\t\t}\n\n\t\t$this->view->ta = $ta;\n\t\t$this->view->revisions = $taFinder->getTaRevisions($ta->taid);\n\t\t$this->view->released_los = $ta->getLinkedLearningObjectiveWithStatus(Status::$RELEASED);\n\t\t\n\t\t$this->view->showGenericEvaluation = EvaluateTaConst::showGenericEvaluation($ta->typeID);\n\t\t\n\t\tif(UserAcl::isAdmin() && $this->view->showGenericEvaluation === true) {\n \t\t$studentEvaluateService = new StudentEvaluateService();\n \t\t$this->view->taEvaluations = $studentEvaluateService->getEvaluationForTaId($id);\n \t\t$studentEvaluate = new StudentEvaluate();\n \t\t$this->view->taEvaluationAvg = $studentEvaluate->getRatingAvg('ta', $id);\n\t\t}\n\n\t\t$this->view->display_edit_links = UserAcl::isStaffOrAbove() && UserAcl::checkTaPermission($ta, UserAcl::$EDIT) === true && count($this->view->released_los) > 0;\n\t\t$this->view->resourceAcl = ResourceAcl::accessAll(array('type'=>'ta','auto_id'=>$id));\n\t\t$this->view->resources = $ta->resources;\n\t\t\n\t\t$this->view->pblTaTypePrev = '';\n\t\t$this->view->pblTaTypeNext = '';\n\t\t\n\t if(!empty($layout)) {\n switch($layout) {\n case 'pblview': \n $this->view->pblTaTypePrev = $this->_request->getParam('pblTaTypePrev','');\n $this->view->pblTaTypeNext = $this->_request->getParam('pblTaTypeNext','');\n //$this->render('pblview');\n break;\n }\n }\n\t\t$this->view->socialtools = StudentResourceService::showSocialTools();\n\t}", "public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n DomainConst::KEY_ACTIONS => $this->listActionsCanAccess,\n ));\n }", "public function view() {\n\n $this->db->where('VCIF', 'XYZ');\n $q = $this->db->get('STRUCTURE')->result();\n }", "public function detail()\n {\n $vereinRepository = new VereinRepository();\n\n $view = new View('verein_detail');\n $view->heading = \"\";\n $view->verein = $vereinRepository->readById($_GET['id']);\n $view->title = $view->verein->name;\n $view->display();\n }", "public function show(FakturReturBeliDetail $fakturReturBeliDetail)\n {\n //\n }", "public function actionView($id)\n { \n return $this->findModel($id);\n \n }", "function show()\r\n {\r\n $script = 'module='.$this->module.'&display='.$this->display.'&start='.$this->start.'&sort='.$this->sort.'&fltr='.$this->fltr.'&fln='.$this->fln;\r\n $script = $_SERVER['PHP_SELF'].\"?$script\";\r\n\r\n if( !$this->sort ) $this->sort='id';\r\n\t\tif($this->sort=='result') $this->sort='`result` desc';\r\n //if( strstr( $this->sort, 'seria' ) )$this->sort = $this->sort.' desc';\r\n $q = \"SELECT * FROM \".TblModSearchResult.\" where 1 order by \".$this->sort.\"\";\r\n //if( $this->srch ) $q = $q.\" and (name LIKE '%$this->srch%' OR email LIKE '%$this->srch%')\";\r\n if( $this->fltr ) $q = $q.\" and $this->fltr\";\r\n $res = $this->Right->Query( $q, $this->user_id, $this->module );\r\n //echo '<br>$q='.$q.' $res='.$res.'$this->Right->result='.$this->Right->result.' $this->user_id='.$this->user_id;\r\n if( !$res )return false;\r\n $rows = $this->Right->db_GetNumRows();\r\n\r\n /* Write Form Header */\r\n $this->Form->WriteHeader( $script );\r\n\r\n /* Write Table Part */\r\n AdminHTML::TablePartH();\r\n\r\n /* Write Links on Pages */\r\n echo '<TR><TD COLSPAN=17>';\r\n $script1 = 'module='.$this->module.'&fltr='.$this->fltr;\r\n $script1 = $_SERVER['PHP_SELF'].\"?$script1\";\r\n\t\tif( !$this->display ) $this->display = 20;\r\n //$this->Form->WriteLinkPages( $script1, $rows, $this->display, $this->start, $this->sort );\r\n\t\t$this->Form->WriteLinkPages( $script1.'&fltr='.$this->fltr, $rows, $this->display, $this->start, $this->sort );\r\n\r\n echo '<TR><TD COLSPAN=5>';\r\n $this->Form->WriteTopPanel( $script );\r\n\r\n echo '<td colspan=5>';\r\n echo $this->Form->TextBox('srch', $this->srch, 25);\r\n echo '<input type=submit value='.$this->Msg->show_text('_BUTTON_SEARCH',TblSysTxt).'>';\r\n\r\n /*\r\n echo '<td><td><td><td><td colspan=2>';\r\n $this->Form->WriteSelectLangChange( $script, $this->fln);\r\n */\r\n\r\n $script2 = 'module='.$this->module.'&display='.$this->display.'&start='.$this->start.'&task=show&fltr='.$this->fltr;\r\n $script2 = $_SERVER['PHP_SELF'].\"?$script2\";\r\n ?>\r\n <TR>\r\n <td class=\"THead\">*</Th>\r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=id><?=$this->Msg->show_text('FLD_ID')?></A></Th>\r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=query><?=$this->Msg->show_text('FLD_QUERY')?></A></Th>\r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=ip><?=$this->Msg->show_text('FLD_IP')?></A></Th>\r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=date><?=$this->Msg->show_text('FLD_DATE')?></A></Th>\r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=time><?=$this->Msg->show_text('FLD_TIME')?></A></Th>\r\n \r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=result><?=$this->Msg->show_text('FLD_RESULT')?></A></Th>\r\n \r\n <?\r\n\r\n $up = 0;\r\n $down = 0;\r\n $a = $rows;\r\n $j = 0;\r\n $row_arr = NULL;\r\n for( $i = 0; $i < $rows; $i++ )\r\n {\r\n $row = $this->Right->db_FetchAssoc();\r\n if( $i >= $this->start && $i < ( $this->start+$this->display ) )\r\n {\r\n $row_arr[$j] = $row;\r\n $j = $j + 1;\r\n }\r\n }\r\n\r\n $style1 = 'TR1';\r\n $style2 = 'TR2';\r\n for( $i = 0; $i < count( $row_arr ); $i++ )\r\n {\r\n $row = $row_arr[$i];\r\n\r\n if ( (float)$i/2 == round( $i/2 ) )\r\n {\r\n echo '<TR CLASS=\"'.$style1.'\">';\r\n }\r\n else echo '<TR CLASS=\"'.$style2.'\">';\r\n\r\n echo '<TD>';\r\n $this->Form->CheckBox( \"id_del[]\", $row['id'] );\r\n\r\n echo '<TD>';\r\n $this->Form->Link( $script.\"&task=edit&id=\".$row['id'], stripslashes( $row['id'] ) );\r\n\r\n echo '<TD align=center>';\r\n if( trim( $row['query'] )!='' ) echo $row['query'];\r\n\r\n echo '<TD align=center>';\r\n if( trim( $row['ip'] )!='' ) echo $row['ip'];\r\n\r\n echo '<TD align=center>';\r\n if( trim( $row['date'] )!='' ) echo $row['date'];\r\n\r\n echo '<TD align=center>';\r\n if( trim( $row['time'] )!='' ) echo $row['time'];\r\n\r\n echo '<TD align=center>';\r\n if( trim($row['result'])!='' ) echo $row['result'];\r\n\r\n } //-- end for\r\n\r\n AdminHTML::TablePartF();\r\n $this->Form->WriteFooter();\r\n return true;\r\n\r\n \r\n}", "public function actionView($id) {\n\n\n $staff_edu = StaffInfoEducation::findOne(['staff_id' => $id]);\n $other_info = StaffOtherInfo::findOne(['staff_id' => $id]);\n $staff_previous_employer = StaffPerviousEmployer::findAll(['staff_id' => $id]);\n $staff_family_details = \\common\\models\\StaffEnquiryFamilyDetails::findAll(['staff_id' => $id]);\n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'staff_edu' => $staff_edu,\n 'staff_other_info' => $other_info,\n 'staff_previous_employer' => $staff_previous_employer,\n 'staff_family_details' => $staff_family_details\n ]);\n }", "public function view(int $id)\r\n {\r\n }", "private function detailView($id)\n { \n $model = $this->findModel($id);\n \n $searchModel = new SearchInstructionDisposalDetail();\n $dataProvider = $searchModel->search(Yii::$app->request->post(), $id);\n \n Yii::$app->session->set('idInstWhTr', $model->id);\n \n return [\n 'model' => $model,\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ];\n }", "public function viewAction() {\n // neu chua khoi tao\n // neu roi add them 1 phan tu vao sesion voi id va uenc da duoc tao\n $this->layout('layout/bags');\n $getuser = $this->forward()->dispatch('Admin\\Controller\\Index', array(\n 'action' => 'getuser'\n ));\n // var_dump($getuser);\n $this->layout()->getuser = $getuser;\n\n $id = $this->params()->fromRoute('id');\n $uenc = $this->params()->fromRoute('uenc');\n\n echo \"id :\";\n var_dump($id);\n echo \"</br>\";\n echo \"uenc :\";\n var_dump($uenc);\n die(\"view is update\");\n }", "public function view($id_accion){\r\n\t\t$stmt = $this->db->prepare(\"SELECT * FROM accion WHERE id_accion=?\");\r\n\t\t$stmt->execute(array($id_accion));\r\n\t\t$action = $stmt->fetch(PDO::FETCH_ASSOC);\r\n\r\n\t\tif($action != null) {\r\n\t\t\treturn new Action(\r\n\t\t\t$action[\"id_accion\"],\r\n\t\t\t$action[\"nombre\"]\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\treturn new Action();\r\n\t\t}\r\n\t}", "public function actionView() {}", "public function actionView() {}", "public function actionView($id){\n $userid=Yii::$app->user->identity->id;\n //$model = $this->findModel($id);\n $documents=MgfAttachements::find()->where(['organisation_id'=>$id])->all();\n $concepts=MgfConceptNote::find()->where(['organisation_id'=>$id])->all();\n $screening=MgfScreening::find()->where(['organisation_id'=>$id])->all(); \n $contacts=MgfContact::find()->joinWith('position')->where(['organisation_id'=>$id])->all(); \n $applicant=MgfApplicant::find()->where(['user_id'=>$userid])->one(); \n //$id=getOrganisationID(); \n return $this->render('view', ['model' => $this->findModel($id),'documents'=>$documents,'criteria'=>$screening,'concepts'=>$concepts,'contacts'=>$contacts,'applicant'=>$applicant]);\n }", "public function frs(){\n\t\t$nim = $this->uri->segment(3);\n\t\t$data['data_frs'] = $this->m_aka->frs($nim);\n\t\t$data['data_mhs'] = $this->m_aka->frs_data_id($nim);\n\t\t$data['content']='mahasiswa/ch_frs';\n\t\t$this->load->view('content',$data);\n\t}", "public function overviewAction(){\n\t\t\t\t\t\t$this->redirectToIndex();\n\t\t\t\t\t if($this->_getParam ( 'actions' )==\"overview\"){\n\t\t\t\t\t $idOverview= $this->_getParam ( 'id' );\n\t\t\t\t\t $idUser = $this->_getParam ( 'userid' );\n\t\t\t\t\t\t\t$GetSelectViewCompanys = $this->GetModelOrganize->SelectOverViewEdit( $idOverview,$idUser );\n\t\t\t\t\t $this->view->SelectOnFormEdit = $GetSelectViewCompanys;\n\t\t\t\t\t \n\t\t\t\t\t }\n\t\t\t\t\t\t$id = $this->_getParam ( 'id' );\n $this->view->getIdView = $id;\n \n \n\t\t\t\t\t}", "public function actionView($id)\n {\n\n $search_dep = new DepositSearch();\n $search_dep->investor = $id;\n $deposit = $search_dep->search(Yii::$app->request->queryParams);\n \n $search_with = new WithdrawSearch();\n $search_with->investor = $id;\n $withdraw = $search_with->search(Yii::$app->request->queryParams);\n\n $search_pur = new PurchaseSearch();\n $search_pur->investor = $id;\n $purchase = $search_pur->search(Yii::$app->request->queryParams);\n\n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'deposit'=>$deposit,\n 'withdraw'=>$withdraw,\n 'purchase'=>$purchase,\n ]);\n }", "public function actionView()\n {\n \n }", "public function atutyAction() {\n\t\t\t$db = Zend_Registry::get('db');\n\t\t\t$id = (int)$this->getRequest()->getParam('id');\n\n\t\t\t$this->view->lista = $db->fetchAll($db->select()->from('inwestycje_atut')->order('sort ASC')->where('id_inwest = ?', $id));\n\t\t\t$this->view->inwestycja = $db->fetchRow($db->select()->from('inwestycje')->where('id = ?', $id));\n\t\t}", "public function getsvinfoAction()\n {\n $uid = $this->uid;\n $fid = $this->_request->getParam('fid', null);\n\n $result1 = Hapyfish2_Island_Bll_SuperVisitor::getSuperVisitor($uid, $fid);\n\n // update by hdf add compound visitor\n $result2 = Hapyfish2_Island_Bll_CompoundSuperVisitor::getSuperVisitor($uid, $fid);\n $result['spVisitors'] = array_merge($result1['spVisitors'], $result2['spVisitors']); \n\n $this->echoResult($result);\n }", "public function actionView($id)\n\t{\n $jobDetails = Yii::app()->db->createCommand()\n ->select('s.JOB_ID AS job_id,\n s.sf_username AS sf_username,\n s.job_name AS job_name,\n s.job_type AS job_type,\n s.job_status AS job_status,\n l.STATUS AS job_status_2,\n l.REPLAYDATE AS job_start,\n l.ENDDATE AS job_end,\n l.LOG_FIELD AS job_log')\n ->from('job_summary s')\n ->join('job_log l', 's.JOB_ID = l.ID_JOB')\n ->where(array('and','s.JOB_ID = '.$id)) \n ->queryRow();\n \n $transDetails = Yii::app()->db->createCommand()\n ->select('trans_summary.JOB_ID AS job_id,\n trans_summary.ID_BATCH AS trans_id,\n trans_summary.trans_name,\n trans_summary.sf_username,\n trans_summary.source,\n trans_summary.target,\n trans_log.STATUS,\n trans_log.LINES_INPUT,\n trans_log.LINES_OUTPUT,\n trans_log.LINES_REJECTED,\n trans_log.REPLAYDATE AS STARTDATE,\n trans_log.ENDDATE,\n trans_log.LOG_FIELD')\n ->from('trans_summary trans_summary')\n ->join('trans_log trans_log', 'trans_summary.ID_BATCH = trans_log.ID_BATCH')\n ->where(array('and','trans_summary.JOB_ID = '.$id))\n ->order('trans_log.REPLAYDATE ASC')\n ->queryAll();\n \n \n $this->render('view',array(\n\t\t\t'jobDetails'=>$jobDetails,\n 'transDetails'=>$transDetails,\n\t\t));\n\t}", "public function actionView($id)\n {\n if (\\Yii::$app->user->can('administrador')) {\n $this->layout =\"main-admin\";\n Yii::$app->view->params['iconoAdministrador'] = 'fa fa-file-text';\n Yii::$app->view->params['tituloAdministrador'] = 'Factura de Gastos';\n Yii::$app->view->params['subTituloAdministrador'] = 'Lista de Factura de Gastos';\n Yii::$app->view->params['subTitulo2Administrador'] = 'Detalle de Factura de Gastos';\n Yii::$app->view->params['linkAdministrador'] = 'index';\n }\n else if (\\Yii::$app->user->can('usuario')){\n $this->layout =\"main-usuario\";\n Yii::$app->view->params['iconoAdministrador'] = 'fa fa-home';\n Yii::$app->view->params['tituloAdministrador'] = 'Apartamentos';\n Yii::$app->view->params['subTituloAdministrador'] = 'Lista de Apartamentos';\n Yii::$app->view->params['subTitulo2Administrador'] = 'Detalle de Apartamento';\n Yii::$app->view->params['linkAdministrador'] = 'apartamentos/index';\n }\n $model2 = FacturaGastosItems::find()->where(['factura_gastos_id_factura_gastos' => $id])->all();\n return $this->render('view', [\n 'model' => $this->findModel($id), 'model2' => $model2\n ]);\n }", "public function getAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Client_Service_Besttj::getBesttj(intval($id));\n\t\tif(!$info) $this->output(-1, '操作失败.');\n\t\t$this->output(0, '', $info);\n\t}", "public function actionView() {\n $this->active_menu = \"gpu2\";\n $this->open_class = \"factory\";\n $this->active_class = \"create\";\n $model = Itemstock::model()->findByPk(Yii::app()->request->getParam('id'));\n $this->render('view', array(\n 'model' => $model,\n ));\n }", "public function detail($vacation_id) {}", "public function view_marksheet($display_id = null){\n if ($this->resultArchive_m->std_info($display_id)) {\n $data= [];\n $data['title'] = \"View Details\";\n $data['get_marksheet'] = 'resultArchive/details';\n $data['std_info'] = $this->resultArchive_m->std_info($display_id);\n // $data['get_info'] = $this->resultArchive_m->get_single_info($display_id);\n $data['get_waiver_sub'] = $this->resultArchive_m->get_waiver_sub($display_id);\n $data['get_waiver_display_id'] = $this->resultArchive_m->get_display_id($display_id);\n $data['dept_full_name'] =$this->resultArchive_m->get_dept($data['std_info']->std_dept);\n $data['point_table'] = $this->resultArchive_m->point_table($display_id);\n $data['get_earn_point'] = $this->resultArchive_m->get_earn_point($display_id, $null = 0);\n $data['per_sub_point'] = $this->resultArchive_m->per_sub_point_table($display_id);\n $this->load->view('dashboard_layout',$data);\n }else {\n redirect(base_url('resultArchive/resultArchive'));\n }\n }", "public function viewAction()\n {\n // Check front disable\n if ($this->config('disable_front')) {\n return $this->jumpToDenied(__('View information is disable'));\n }\n\n $page = $this->params('page', 1);\n $limit = Pi::config('list_limit', 'user');\n $offset = (int)($page - 1) * $limit;\n $uid = _get('uid');\n\n Pi::service('authentication')->requireLogin();\n\n // Get timeline\n $count = Pi::api('timeline', 'user')->getCount($uid);\n $timeline = Pi::api('timeline', 'user')->get($uid, $limit, $offset);\n\n // Get timeline meta list\n $timelineMetaList = Pi::api('timeline', 'user')->getList();\n\n // Set timeline meta\n foreach ($timeline as &$item) {\n if (!isset($timelineMetaList[$item['timeline']])) {\n continue;\n }\n $item['icon'] = $timelineMetaList[$item['timeline']]['icon'];\n $item['title'] = $timelineMetaList[$item['timeline']]['title'];\n }\n\n // Get user base info\n $user = Pi::api('user', 'user')->get(\n $uid,\n ['name', 'country', 'city', 'time_activated'],\n true,\n true\n );\n $user['name'] = isset($user['name']) ? $user['name'] : null;\n\n // Set paginator\n $paginatorOption = [\n 'count' => $count,\n 'limit' => $limit,\n 'page' => $page,\n 'controller' => 'home',\n 'action' => 'view',\n 'uid' => $uid,\n ];\n $paginator = $this->setPaginator($paginatorOption);\n\n $this->view()->assign([\n 'uid' => $uid,\n 'name' => 'homepage',\n 'timeline' => $timeline,\n 'paginator' => $paginator,\n 'user' => $user,\n ]);\n\n $this->view()->setTemplate('home-index');\n $this->view()->assign('view', true);\n $this->view()->headTitle(sprintf(__('%s activities'), $user['name']));\n $this->view()->headdescription(sprintf(__('View %s activities'), $user['name']), 'set');\n $this->view()->headkeywords($this->config('head_keywords'), 'set');\n }", "public function view($entryid){\n\t\t$user = $this->getUser();\n\t\tif(!isset($user[\"id\"]))return false;\n\t\t$query = Queries::view($entryid, $user[\"id\"]);\n\t\treturn $this->query($query);\n\t}", "public function actionView()\n {\n \t$id = isset($_REQUEST['id'])?$_REQUEST['id']:null;\n \t$model = $this->findModel($id);\n \t \n \treturn CommonUtils::json_success($model);\n }", "public function actionView($id)\n {\n $model=$this->findModel($id);\n $vehicleid=$model->vehicleid;\n $mods=$this->findModel($id);\n $mods->dept=Gongchu::getDeptNameById($model->dept);\n $mods->use_time=substr($model->use_time,0,-3);\n $mods->v_user=Gongchu::getUserNamesByIds($model->v_user);\n $mods->apply_ren=Gongchu::getUserNamesByIds($model->apply_ren);\n $mods->v_license=Vehicle::findOne($vehicleid)->v_license;\n if($model->dept_audit==0){//审批中 状态 不加审批时间 驳回理由\n $mods->dept_leader=Gongchu::getUserNamesByIds($model->dept_leader).'('.Gongchu::getStatusById($model->dept_audit).')';\n }else{\n $mods->dept_leader=Gongchu::getUserNamesByIds($model->dept_leader).'('.Gongchu::getStatusById($model->dept_audit).') '.$model->dept_reason.' '.substr($model->dept_audit_time,0,-3);\n }\n if($model->dept_audit==2){//如果科室领导驳回,则院领导直接显示名字即可\n $mods->branch_leader=Gongchu::getUserNamesByIds($model->branch_leader);\n }else{\n if($model->branch_audit==0){//审批中 状态 不加审批时间 驳回理由\n $mods->branch_leader=Gongchu::getUserNamesByIds($model->branch_leader).'('.Gongchu::getStatusById($model->branch_audit).')';\n }else{\n $mods->branch_leader=Gongchu::getUserNamesByIds($model->branch_leader).'('.Gongchu::getStatusById($model->branch_audit).') '.$model->branch_reason.' '.substr($model->branch_audit_time,0,-3);\n }\n }\n if($model->dept_leader==0){\n $mods->dept_leader=0;\n }\n return $this->render('view', [\n 'model' => $mods,\n ]);\n }", "public function actionView($id)\n {\n $model = $this->findModel($id);\n\n if(!empty($model)){\n\n $adjustment_details = ImAdjustDetail::find()->where(['im_adjust_head_id'=> $model->id])->all();\n\n return $this->render('view', [\n 'model' => $model,\n 'adjustment_details' => $adjustment_details\n ]); \n }\n \n }", "public function indexAction() {\n if (!Engine_Api::_()->core()->hasSubject('sitecrowdfunding_project'))\n return $this->setNoRender();\n $this->view->project = $project = Engine_Api::_()->core()->getSubject();\n //GET QUICK INFO DETAILS\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($project);\n if (Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\n $this->view->show_fields = $this->view->fieldValueLoop($project, $this->view->fieldStructure);\n }\n $params = $this->_getAllParams();\n $this->view->params = $params;\n if ($this->_getParam('loaded_by_ajax', false)) {\n $this->view->loaded_by_ajax = true;\n if ($this->_getParam('is_ajax_load', false)) {\n $this->view->is_ajax_load = true;\n $this->view->loaded_by_ajax = false;\n if (!$this->_getParam('onloadAdd', false))\n $this->getElement()->removeDecorator('Title');\n $this->getElement()->removeDecorator('Container');\n } else {\n return;\n }\n }\n\n $tableOtherinfo = Engine_Api::_()->getDbTable('otherinfo', 'sitecrowdfunding');\n $this->view->address = $address = $tableOtherinfo->getColumnValue($project->getIdentity(), 'contact_address');\n $this->view->phone = $phone = $tableOtherinfo->getColumnValue($project->getIdentity(), 'contact_phone');\n $this->view->email = $email = $tableOtherinfo->getColumnValue($project->getIdentity(), 'contact_email');\n\n\n $fundingDatas = Engine_Api::_()->getDbTable('externalfundings','sitecrowdfunding')->getExternalFundingAmount($project->getIdentity());\n //$this->view->totalFundingAmount = $fundingDatas['totalFundingAmount'];\n $this->view->total_backer_count = $fundingDatas['memberCount'] + $fundingDatas['orgCount'];\n\n $sitecrowdfundingSpecificationProject = Zend_Registry::isRegistered('sitecrowdfundingSpecificationProject') ? Zend_Registry::get('sitecrowdfundingSpecificationProject') : null;\n\n if (empty($sitecrowdfundingSpecificationProject))\n return $this->setNoRender();\n }", "public function action_detail()\n\t{\n\t\t$this->template = View::forge('template-admin');\n\n $get = Input::get();\n\t\t$id = $get[\"id\"];\n\t\t$data[\"details\"] = Model_Event::find_by('id',$id);\n\t\t//return Response::forge(View::forge('event/detail',$data));\n\t\t$this->template->title = \"イベント詳細\";\n\t\t$this->template->content = View::forge('event/detail', $data);\n\t}", "public function actionView($id)\n {\n $entry = AuditEntry::findOne($id);\n if ($entry) {\n return $this->render('view', ['entry' => $entry]);\n } else {\n throw new \\HttpInvalidParamException('Invalid request number specified');\n }\n\n $this->redirect(['index']);\n }", "public function dodajPlanAction() {\n\t\t\t$db = Zend_Registry::get('db');\n\t\t\t$id = (int)$this->getRequest()->getParam('id');\n\t\t\t$this->view->inwestycja = $db->fetchRow($db->select()->from('inwestycje')->where('id = ?', $id));\n\t\t\t$this->view->plan = $db->fetchRow($db->select()->from('inwestycje_plan')->where('id_inwest = ?', $id));\t\n\t\t}", "public function actionPreview($id=1)\n {\n\n $estimates = Estimates::FindEstimateSql($id);\n // var_dump($estimates); die();\n return $this->render('preview', [\n 'id' => $id,\n 'estimates' => $estimates,\n ]);\n \n }", "function action_view()\n {\n $this->addStatusFields();\n return parent::action_view();\n }", "public function actionView() {\n $isFinal=false;\n if(isset($_GET['isFinal'])) {\n $isFinal=$_GET['isFinal'];\n }\n $this->render('view', array(\n 'model' => $this->loadModel(),\n 'isFinal'=>$isFinal\n ));\n }", "public function actionInvFalt()\n\t\t{\n\t\t\t$model=new Reports();\n\t\t\t$this->render('invFalt',array(\n\t\t\t\t'model'=>$model,\n\t\t\t));\n\t\t}", "public function view($id)\n {\n $CommonController = new CommonController;\n\t\t$access = $CommonController->checkFunctionPermission($this->permision,$this->className,'read');\n\t\tif(empty($access)){\n\t\t\tSession::flash('error', trans('common.permissionNot')); \n\t return Redirect::to('cms/dashboard');\n\t\t}\n\t\t\n $data['results'] = $this->getById($id);\n \n \n $data['title'] = $this->title;\n $data['className'] = $this->className;\n return view('Cms/Family/familyView',$data); \n }", "public function show($id, HAsistenciaR $hAsistenciaR)\n\t{\n\t\t$hAsistenciaR=$hAsistenciaR->find($id);\n\t\treturn view('hAsistenciaRs.show', compact('hAsistenciaR'));\n\t}", "public function indexAction() {\n $db = $this->getDB();\n \n #load the first few employees\n $sql = 'select * from employees limit 100';\n $stmt = $db->prepare($sql);\n $stmt->execute();\n \n \n #create a new View\n $view = new \\view\\federal_employees($this->_action, $stmt->fetchAll(\\PDO::FETCH_ASSOC));\n \n }", "public function _report_view()\n\t{\n\t\t$incident_id = Event::$data;\n\t\tif ($incident_id)\n\t\t{\n\t\t\t$actionable = ORM::factory('actionable')\n\t\t\t\t->where('incident_id', $incident_id)\n\t\t\t\t->find();\n\t\t\tif ($actionable->loaded)\n\t\t\t{\n\t\t\t\tif ($actionable->actionable)\n\t\t\t\t{\n\t\t\t\t\t$report = View::factory('actionable_report');\n\t\t\t\t\t$report->actionable = $actionable->actionable;\n\t\t\t\t\t$report->action_taken = $actionable->action_taken;\n\t\t\t\t\t$report->action_summary = $actionable->action_summary;\n\t\t\t\t\t$report->render(TRUE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function view($id)\n {\n }", "public function actionView()\r\n {\r\n $this->_userAutehntication();\r\n /*\r\n * Check if id was submitted via GET method \r\n */\r\n if(!isset($_GET['id']))\r\n $this->_sendResponse(500, 'Error: Parameter <b>id</b> is missing' );\r\n\r\n switch($_GET['model'])\r\n {\r\n /* Find respective model */\r\n case 'posts': \r\n $model = Post::model()->findByPk($_GET['id']);\r\n break; \r\n default: \r\n $this->_sendResponse(501, sprintf('Mode <b>view</b> is not implemented for model <b>%s</b>',$_GET['model']) );\r\n exit; \r\n }\r\n if(is_null($model)) {\r\n $this->_sendResponse(404, 'No Post found with id '.$_GET['id']);\r\n } else {\r\n $this->_sendResponse(200, $this->_getEncodedData($_GET['model'], $model->attributes));\r\n }\r\n }", "public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t\t'keyid'=>$id\n\t\t));\n\t}", "public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t\t'keyid'=>$id\n\t\t));\n\t}", "public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t\t'keyid'=>$id\n\t\t));\n\t}", "public function viewUserAction()\n {\n \tif($this->getRequest()->getParam('id')){\n \t\t$db = new RsvAcl_Model_DbTable_DbUser();\n \t\t$user_id = $this->getRequest()->getParam('id');\n \t\t$rs=$db->getUser($user_id);\n \t\t//print_r($rs); exit;\n \t\t$this->view->rs=$rs;\n \t} \t \n \t\n }", "public function actionView($id)\n {\n $this->checkPrivilege();\n $model = $this->findModel($id);\n $searchModel = new RekapitulasiBahanSearch();\n $dataProvider = $searchModel->search(\\Yii::$app->request->queryParams, $model->id);\n // var_dump(\\Yii::$app->request->queryParams);die();\n return $this->render('view', [\n 'model' => $model,\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function view_advance($id,$st_id){\n\t\t// set the page title\t\t\n\t\t$this->set('title_for_layout', 'Advance Request - Approve/Reject - Finance - My PDCA');\n\t\tif(!empty($id) && intval($id) && !empty($st_id) && intval($st_id)){\n\t\t\t// authorize user before action\n\t\t\t$ret_value = $this->auth_action($id,$st_id, 1);\n\t\t\tif($ret_value == 'pass' || $ret_value == 'view_only'){\t\n\t\t\t\t$data = $this->FinAdvApprove->find('first', array('conditions' => array('FinAdvStatus.app_users_id' => $this->Session->read('USER.Login.id'), 'FinAdvApprove.id' => $id), 'fields' => array('FinAdvApprove.id', 'FinAdvApprove.purpose', 'FinAdvApprove.req_date','FinAdvApprove.amount','FinAdvApprove.description','Home.first_name','Home.last_name','FinAdvStatus.remarks','TskCustomer.company_name')));\t\t\n\t\t\t\t$this->set('adv_data', $data);\n\t\t\t\t// get leaders remarks\n\t\t\t\t$this->get_adv_remarks($id);\n\t\t\t\t// for view mode\n\t\t\t\tif($ret_value == 'view_only'){\t\t\t\t\t\n\t\t\t\t\t$this->set('VIEW_ONLY', 1);\n\t\t\t\t}\n\t\t\t}else if($ret_value == 'fail'){ \n\t\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert-error\">&times;</button>Invalid Entry', 'default', array('class' => 'alert alert-error'));\t\n\t\t\t\t$this->redirect('/finadvapprove/');\t\n\t\t\t}else{\n\t\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert-error\">&times;</button>Record Deleted: '.$ret_value , 'default', array('class' => 'alert alert-error'));\t\n\t\t\t\t$this->redirect('/finadvapprove/');\t\n\t\t\t}\n\t\t}else{\n\t\t\t$this->Session->setFlash('<button type=\"button\" class=\"close\" data-dismiss=\"alert-error\">&times;</button>Invalid Entry', 'default', array('class' => 'alert alert-error'));\t\t\n\t\t\t$this->redirect('/finadvapprove/');\t\n\t\t}\n\t\t\n\t\t\n\t}", "public function getAction()\n\t {\n\t\t\t$params = $this->_getAllParams();\n\t\t\t\n\t\t\t$friends_json = $this->getRequest()->getParam('friends');\n\t\t\t\n\t\t\t$recordsModel = new Model_Record(); \n\t\t \t$record = $recordsModel->fetchFacebookFriends($friends);\n\t\t\n\t\t\tif ($record == null){\n\t\t\t\t$this->result_code = '0';\n\t\t\t\t$this->result_action = 'Not Found';\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->result_code = '1';\n\t\t\t\t$this->result_action = 'View Record';\n\t\t\t}\n\t\t\t$this->view->entry = $record;\n\t\t}", "public function actionView($id)\n\t{\n $uid = Yii::app()->user->getId(); \n if($uid != 1){\n $value = ComSpry::getUnserilizedata($uid);\n if(empty($value) || !isset($value)){\n throw new CHttpException(403,'You are not authorized to perform this action.');\n }\n if(!in_array(37, $value)){\n throw new CHttpException(403,'You are not authorized to perform this action.');\n }\n }\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n \n\t}", "public function view()\n\t{\n\t\t// TODO Implement\t\n\t}", "public function view($id=null)\n {\n $this->session_manager->validateJollofadmin(__METHOD__);\n\n //print(\"<pre>\".print_r($this->orderitem->getFashionOrdersByID($id,'admin'),true).\"</pre>\");die;\n $orderdetails = $this->orderitem->getFashionOrdersByID($id,'admin');\n if(!empty($orderdetails))\n {\n $data['orderinfo'] = $orderdetails;\n \n $data['pageheader'] = \"Order Full Details\";\n $data['breadCrumbs'] = '<li class=\"breadcrumb-item\"><a href=\"'.site_url(\"jollofadmin/orders\").'\">Orders</a></li> <li class=\"breadcrumb-item active\">Order Details</li>';\n $data['mainmenu'] = \"orders\";\n $data ['content_file']= 'order-list-detail';\n $this->load->view('jollof_admin/layout', $data);\n }\n else\n {\n redirect('jollofadmin/orders');\n }\n }", "public function show_detail($i_id=0)\r\n {\r\n try\r\n {\r\n if(trim($i_id)!=\"\")\r\n {\r\n $info=$this->mod_rect->fetch_this(decrypt($i_id));\r\n\r\n if(!empty($info))\r\n {\r\n $temp=array();\r\n $temp[\"s_id\"]= encrypt($info[\"id\"]);////Index 0 must be the encrypted PK \r\n\t\t\t\t\t$temp[\"s_title\"]= trim($info[\"s_title\"]);\r\n\t\t\t\t\t$temp[\"s_description\"]= trim($info[\"s_description\"]);\r\n\t\t\t\t\t$temp[\"s_buyer\"]= trim($info[\"s_buyer_name\"]);\r\n\t\t\t\t\t$temp[\"s_category\"] = trim($info[\"s_category\"]);\r\n\t\t\t\t\t$temp[\"s_is_active\"]= trim($info[\"s_is_active\"]);\r\n\t\t\t\t\t$temp[\"dt_created_on\"]= trim($info[\"dt_entry_date\"]);\r\n\t\t\t\t\t$temp[\"dt_approved_on\"]= trim($info[\"dt_approval_date\"]);\r\n\t\t\t\t\t$temp[\"dt_expired_on\"]= trim($info[\"dt_expire_date\"]);\r\n\t\t\t\t\tpr($temp);\r\n\t\t\t\t\t$this->data[\"info\"]=$temp;\r\n unset($temp);\r\n }\r\n unset($info);\r\n }\r\n $this->add_css(\"css/admin/style.css\");///include main css\r\n $this->add_js(\"js/jquery/jquery-1.4.2.js\");///include main css\r\n $this->add_css(\"js/jquery/themes/ui-darkness/ui.all.css\");///include jquery css\r\n \r\n $this->render(\"comm_payment_report/show_detail\",TRUE);\r\n unset($i_id);\r\n }\r\n catch(Exception $err_obj)\r\n {\r\n show_error($err_obj->getMessage());\r\n } \r\n }", "public function actionView($id)\n {\n $model = $this->findModel($id);\n\n $event = Yii::t('app', 'view record {id}', ['id' => $model->permission_id]);\n $bitacora = new Bitacora();\n $bitacora->register($event, 'actionView', MSG_INFO);\n\n return $this->render(ACTION_VIEW, [MODEL => $model]);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "function topdesk_view($name = '')\n\t{\n\t\t$params['lookup'] = 'naam';\n\t\t$params['lookupValue'] = $name;\n\t\tredirect(conf('topdesk_server').\"/tas/secure/hardware?\".http_build_query($params));\n\t}", "public function _report_view()\n\t{\n\t\t$incident_id = Event::$data;\n\t\tif ($incident_id)\n\t\t{\n\t\t\t$actionable = ORM::factory('actionable')\n\t\t\t\t->where('incident_id', $incident_id)\n\t\t\t\t->find();\n\t\t\tif ($actionable->loaded)\n\t\t\t{\n\t\t\t\tif ($actionable->actionable)\n\t\t\t\t{\n\t\t\t\t\t$report = View::factory('actionable_report');\n\t\t\t\t\t$report->actionable = $actionable->actionable;\n\t\t\t\t\t$report->action_taken = $actionable->action_taken;\n\t\t\t\t\t$report->action_summary = $actionable->action_summary;\n\t\t\t\t\t$report->action_date = $actionable->action_date;\n\t\t\t\t\t$report->resolution_summary = $actionable->resolution_summary;\n\t\t\t\t\t$report->resolution_date = $actionable->resolution_date;\n\t\t\t\t\t$report->render(TRUE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function overviewAction(){\n \t$analytics = new Pas_Analytics_Gateway($this->_ID, $this->_pword);\n \t$analytics->setProfile(25726058);\n \t$timeframe = new Pas_Analytics_Timespan(); \n $timeframe->setTimespan($this->_getParam('timespan'));\n \t$dates = $timeframe->getDates();\n \t$analytics->setStart($dates['start']);\n \t$analytics->setEnd($dates['end']);\n \t$analytics->setMetrics(\n array(\n Zend_Gdata_Analytics_DataQuery::METRIC_VISITORS,\n Zend_Gdata_Analytics_DataQuery::METRIC_PAGEVIEWS,\n Zend_Gdata_Analytics_DataQuery::METRIC_UNIQUE_PAGEVIEWS,\n Zend_Gdata_Analytics_DataQuery::METRIC_AVG_TIME_ON_PAGE,\n Zend_Gdata_Analytics_DataQuery::METRIC_ENTRANCES,\n Zend_Gdata_Analytics_DataQuery::METRIC_EXITS,\n Zend_Gdata_Analytics_DataQuery::METRIC_BOUNCES\n \t\t));\n \t$analytics->setDimensions(\n array(\n Zend_Gdata_Analytics_DataQuery::DIMENSION_PAGE_TITLE,\n Zend_Gdata_Analytics_DataQuery::DIMENSION_PAGE_PATH,\t\t\n \t\t));\n \tif(is_null($this->_getParam('filter'))){\n \t$analytics->setFilters(\n array(\n Zend_Gdata_Analytics_DataQuery::DIMENSION_PAGE_PATH \n . Zend_Gdata_Analytics_DataQuery::REGULAR_NOT . 'forum'\n\t ));\n\t } else {\n \t$analytics->setFilters(\n array(\n Zend_Gdata_Analytics_DataQuery::DIMENSION_PAGE_PATH \n . Zend_Gdata_Analytics_DataQuery::REGULAR . '/'\n . $this->_getParam('filter')\n\t ));\n\t }\n \t$analytics->setMax(20);\n \t$analytics->setSort(Zend_Gdata_Analytics_DataQuery::METRIC_VISITORS);\n \t$analytics->setSortDirection(true);\n \t$analytics->setStartIndex($this->getStart());\n \t$this->view->results = $analytics->getData();\n $paginator = Zend_Paginator::factory((int)$analytics->getTotal());\n $paginator->setCurrentPageNumber((int)$this->getPage())\n\t\t\t->setItemCountPerPage((int)self::MAX_RESULTS);\n $this->view->paginator = $paginator;\n }", "public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'\t\t=>$this->loadModel($id),\n\t\t\t'dokter'\t=>$this->loadModelDetailDokter($id),\n\t\t\t'perawat'\t=>$this->loadModelDetailPerawat($id),\n\t\t\t'obat'\t\t=>$this->loadModelDetailObat($id),\n\t\t\t'perawatan'\t=>$this->loadModelDetailPerawatan($id),\n\t\t));\n\t}", "public function show()\n {\n $data['title'] = 'Siswa';\n $id = $this->input->get('id');\n $this->load->model('Absen_m', 'absen');\n $kehadiran = $this->absen->hitung_kehadiran_siswa($id, 'hadir');\n $sakit = $this->absen->hitung_kehadiran_siswa($id, 'sakit');\n $izin = $this->absen->hitung_kehadiran_siswa($id, 'izin');\n // cegat apa bila id nya tdk di isi ato langsung akses ke link \n if ($id !== null) {\n //Ambil Semua data absensi taruh dalam satu varible \n $data['siswa'] = $this->siswa->get_siswa_byId($id)->result_array();\n $data['kehadiran'] = $kehadiran;\n $data['sakit'] = $sakit;\n $data['izin'] = $izin;\n\n $this->load->view('templates/header', $data);\n $this->load->view('templates/sidenav');\n $this->load->view('templates/navbar', $data);\n $this->load->view('siswa/show', $data);\n $this->load->view('templates/footer');\n } else {\n show_404();\n }\n }", "public function view($view_id) {\n\n\t\t$data = $this->load_module_info ();\n\n\t\t$data['upload_folder'] = $this->upload_folder;\n\n\t\t$where = array($this->table.'.'.$this->primary_key => decode_value($view_id), $this->table);\n\n\t\t$select_array = array ('*');\n\n\t\t\n\t\t$records = $this->Mydb->get_all_records ( $select_array, $this->table, $where, '', '', '', '', '', '' );\n\n\t\t$data ['result'] = $records[0];\n\n\t\t$this->load->view($this->folder.\"/\".$this->module.\"-view\",$data);\n\t}", "public function viewIdf()\n {\n $doc = 144;\n $df = df::all();\n\n return view ('admin.idf')->with([\n 'doc' => $doc,\n 'df' => $df\n ]);\n\n // $break = 0;\n // foreach ($df as $key => $value) {\n // if($break == 1891) break;{\n // $df = $value->df;\n // $idf = log($d/$df);\n // if($idf != 0) {\n // echo round($idf, 4).'<br>';\n // }\n // }\n // $break++;\n // }\n }", "public function actionView($id)\n {\n $role = Yii::$app->user->identity->roleName();\n\n if ($role == \"Sekretariat\") {\n $model = ActivityDaily::find()->where(['id'=>$id])->one();\n $budget = ActivityDailyBudgetSecretariat::find()->where(['activity_id'=>$model->id])->one();\n $baru = SecretariatBudget::find()->where(['id'=>$budget->secretariat_budget_id])->one();\n $reject = ActivityDailyReject::find()->where(['activity_id'=>$model->id])->orderBy(['id'=>SORT_DESC])->one();\n $range = $model->date_start . ' to ' . $model->date_end;\n $range_start = $model->date_start;\n $range_end = $model->date_end;\n $oldDP = $budget->budget_value_dp;\n $oldBudget = $baru->secretariat_budget_value;\n\n } else if ($role == \"Seksi\") {\n $model = ActivityDaily::find()->where(['id'=>$id])->one();\n $budget = ActivityDailyBudgetSection::find()->where(['activity_id'=>$model->id])->one();\n $baru = SectionBudget::find()->where(['id'=>$budget->section_budget_id])->one();\n $reject = ActivityDailyReject::find()->where(['activity_id'=>$model->id])->orderBy(['id'=>SORT_DESC])->one();\n $range = $model->date_start . ' to ' . $model->date_end;\n $range_start = $model->date_start;\n $range_end = $model->date_end;\n $oldDP = $budget->budget_value_dp;\n $oldBudget = $baru->section_budget_value;\n\n }\n\n \n return $this->render('view', [\n 'model' => $model,\n 'budget' => $budget,\n 'baru' => $baru,\n 'range' => $range,\n 'range_start' => $range_start,\n 'range_end' => $range_end,\n 'reject' => $reject\n ]);\n\n\n\n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'budget' => $budget,\n 'awal' => $awal,\n 'baru' => $baru,\n ]);\n }", "function view( $id = NULL )\n {\n\tif ( !is_numeric( $id ) ) {\n\t $result = $this->_get( 'id' );\n\t $data = $this->page_settings( 'edit', $result, 'result', 'Edit', 'mdl_auth' );\n\t} else {\n\t $result = $this->get_where( $id );\n\t $data = $this->page_settings( 'edit', $result, 'result', 'Edit', 'mdl_auth' );\n\t}\n\n\t$this->templates->frontend( $data );\n }", "public function view($id) {\n }", "public function indexAction()\n {\n \t\n \t$this->_helper->layout()->disableLayout();\n \t\n\t\t$this->params = $this->getRequest()->getParams();\n \n\t\t$this->view->params = $this->params;\n\t\t\n\t\tif(!isset($this->params['vizType']))\n\t\t{\n\t\t\t$this->view->vizType = 2;\n\t\t}\n\t\t\n\t\tif(isset($this->params['vizType']))\n\t\t{\n\t\t\t$this->view->vizType = $this->params['vizType'];\n\t\t}\n\n\t\tif(isset($this->params['vizEx']))\n\t\t{\n\t\t\t$this->view->vizEx = $this->params['vizEx'];\n\t\t}\n\n\t if(isset($this->params['vizQu']))\n\t\t{\n\t\t\t$this->view->vizQu = $this->params['vizQu'];\n\t\t}\n\t\t\n\t if(isset($this->params['vizVo']))\n\t\t{\n\t\t\t$this->view->vizVo = $this->params['vizVo'];\n\t\t}\n if(isset($this->params['vizMy']))\n\t\t{\n\t\t\t$this->view->vizMy = $this->params['vizMy'];\n\t\t}\n\t\t\n\t if(isset($this->params['vizCon']) && $this->params['vizCon']==1)\n\t\t{\n\t\t\t$this->view->vizCon = 1;\n\t\t} else {\n\t\t\t$this->view->vizCon = 0;\n\t\t}\n\t\t\n\t if(isset($this->params['conceptId']))\n\t\t{\n\t\t\t$this->view->conceptId = $this->params['conceptId'];\n\t\t} else {\n\t\t\t$this->view->conceptId = array();\n\t\t}\n\t if(isset($this->params['keyW']))\n\t\t{\n\t\t\t$this->view->keyW = $this->params['keyW'];\n\t\t} else {\n\t\t\t$this->view->keyW = \"\";\n\t\t}\n \tif(isset($this->params['valueAA']))\n\t\t{\n\t\t\t$this->view->valueAA = $this->params['valueAA'];\n\t\t} else {\n\t\t\t$this->view->valueAA = \"\";\n\t\t}\n \tif(isset($this->params['valueBB']))\n\t\t{\n\t\t\t$this->view->valueBB = $this->params['valueBB'];\n\t\t} else {\n\t\t\t$this->view->valueBB = \"1325350800\";\n\t\t}\n\t\t\n if(isset($this->params['vizDate']))\n\t\t{\n\t\t\t$this->view->vizDate = $this->params['vizDate'];\n\t\t} else {\n\t\t\t$this->view->vizDate = 0;\n\t\t}\n\t\t\n }", "function member_farm_page(){\r\n // Check sign in\r\n $this->gnc_authen->redirect_if_not_sign_in();\r\n \r\n // Get data\r\n $member_id = $this->session->userdata('member_id');\r\n \r\n // Get farms\r\n $where_assoc = array();\r\n $where_assoc['farm_member_id'] = $member_id;\r\n $where_assoc['farm_status_id'] = $this->Status->status_normal_id;\r\n \r\n $farms = $this->Farm->get_filter('*', $where_assoc, null, null, null, null, 'object', array('use_view' => TRUE));\r\n \r\n // Set view data\r\n $data = array();\r\n $data['farms'] = $farms;\r\n \r\n // Load view\r\n $this->load->view('main/manageFarm', $data);\r\n \r\n }", "public function actionView($id)\n {\n $dispositivos = PrefacturaDispositivoFijoElectronico::find()->where('id_prefactura_electronica='.$id)->all();\n //$count_fijo = $dispositivos->count();\n // $pag_fijos = new Pagination([\n // 'defaultPageSize'=>10,\n // 'totalCount' => $dispositivos->count()\n // ]);\n // $disp_fijos = $dispositivos\n // ->offset($pag_fijos->offset)\n // ->limit($pag_fijos->limit)\n // ->all();\n\n $modelo=new PrefacturaDispositivoFijoElectronico();\n $variables=PrefacturaDispositivoVariableElectronico::find()->where('id_prefactura_electronica='.$id)->all();\n $monitoreos=PrefacturaMonitoreo::find()->where('id_prefactura_electronica='.$id)->all();\n\n\n if (isset($_POST['fecha_factura'])) {\n $model =PrefacturaElectronica::find()->where('id='.$id)->one();\n $model->setAttribute('numero_factura', $_POST['num_factura']);\n $model->setAttribute('fecha_factura', $_POST['fecha_factura']);\n\n $model->save();\n\n return $this->redirect(['view', 'id' => $id ]);\n }\n\n\n\n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'dispositivos' => $dispositivos/*$disp_fijos*/,\n 'pag_fijos'=>$pag_fijos,\n 'modelo'=>$modelo,\n 'variables'=>$variables,\n 'monitoreos'=>$monitoreos\n ]);\n }" ]
[ "0.6809829", "0.6633601", "0.6407932", "0.6267323", "0.6240988", "0.6205663", "0.61514306", "0.6147583", "0.61270475", "0.61270475", "0.6112112", "0.6107416", "0.60584515", "0.6033962", "0.60305643", "0.60281557", "0.6024982", "0.5951128", "0.589618", "0.58877134", "0.58874136", "0.5878248", "0.5874678", "0.58513737", "0.58491766", "0.5847309", "0.5845411", "0.58224106", "0.5821434", "0.5801285", "0.57877564", "0.5784255", "0.5783092", "0.57785034", "0.5777732", "0.5774792", "0.57736325", "0.5771167", "0.5758904", "0.5758858", "0.57520527", "0.57520527", "0.5742912", "0.5732821", "0.5732603", "0.57182884", "0.5716092", "0.57092494", "0.57007086", "0.5698505", "0.56946427", "0.5668689", "0.5656911", "0.56564295", "0.56359035", "0.56233585", "0.5614674", "0.56128764", "0.5609648", "0.5599449", "0.5590739", "0.55883396", "0.55847317", "0.5582635", "0.5581317", "0.5577601", "0.5576736", "0.5571414", "0.55620146", "0.55583894", "0.555329", "0.5552957", "0.554752", "0.55470896", "0.5541811", "0.5541811", "0.5541811", "0.55415916", "0.5540266", "0.55373645", "0.5537237", "0.553673", "0.55328107", "0.55328107", "0.5532007", "0.5531659", "0.55314195", "0.5528057", "0.5524603", "0.5524557", "0.5522811", "0.55208987", "0.5519242", "0.5519045", "0.55181056", "0.55162585", "0.5516008", "0.5514011", "0.5508205", "0.55060995" ]
0.7101994
0
actionid: viewbyatasan actiondesc: Display detail view of izin for supervisor
public function actionViewByAtasan($id){ $atasanSearchModel = new AtasanIzinSearch(); $pegawai = Pegawai::find()->where(['user_id' => Yii::$app->user->identity->user_id])->one(); $atasanSearchModel->pegawai_id = $pegawai['pegawai_id']; $model = $atasanSearchModel->search(Yii::$app->request->queryParams)->query->where(['cist_atasan_izin.permohonan_izin_id' => $id])->one(); return $this->render('viewByAtasan',[ 'model' => $model, ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function viewAction()\n {\n $id = $this->_getPrimaryId();\n $row = $this->_getRow($id);\n\n $this->view->row = $row;\n }", "public function show_detail($i_id=0)\r\n {}", "public function show_detail($i_id=0)\r\n {}", "public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n DomainConst::KEY_ACTIONS => $this->listActionsCanAccess,\n ));\n }", "public function overviewAction(){\n\t\t\t\t\t\t$this->redirectToIndex();\n\t\t\t\t\t if($this->_getParam ( 'actions' )==\"overview\"){\n\t\t\t\t\t $idOverview= $this->_getParam ( 'id' );\n\t\t\t\t\t $idUser = $this->_getParam ( 'userid' );\n\t\t\t\t\t\t\t$GetSelectViewCompanys = $this->GetModelOrganize->SelectOverViewEdit( $idOverview,$idUser );\n\t\t\t\t\t $this->view->SelectOnFormEdit = $GetSelectViewCompanys;\n\t\t\t\t\t \n\t\t\t\t\t }\n\t\t\t\t\t\t$id = $this->_getParam ( 'id' );\n $this->view->getIdView = $id;\n \n \n\t\t\t\t\t}", "public function viewAclAction()\n {\n \tif($this->getRequest()->getParam('id')){\n \t\t$db = new Rsvacl_Model_DbTable_DbAcl();\n \t\t$acl_id = $this->getRequest()->getParam('id');\n \t\t$rs=$db->getAcl($acl_id);\n \t\t$this->view->rs=$rs;\n \t} \t \n \t\n }", "public function viewAction()\r\n {\r\n $this->indexAction();\r\n }", "public function viewAction() {\n // neu chua khoi tao\n // neu roi add them 1 phan tu vao sesion voi id va uenc da duoc tao\n $this->layout('layout/bags');\n $getuser = $this->forward()->dispatch('Admin\\Controller\\Index', array(\n 'action' => 'getuser'\n ));\n // var_dump($getuser);\n $this->layout()->getuser = $getuser;\n\n $id = $this->params()->fromRoute('id');\n $uenc = $this->params()->fromRoute('uenc');\n\n echo \"id :\";\n var_dump($id);\n echo \"</br>\";\n echo \"uenc :\";\n var_dump($uenc);\n die(\"view is update\");\n }", "public function viewAction()\n {\t\n $auth = Zend_Auth::getInstance();\n \tif($auth->hasIdentity())\n {\n $loginUserId = $auth->getStorage()->read()->id;\n $businessunit_id = $auth->getStorage()->read()->businessunit_id;\n $department_id = $auth->getStorage()->read()->department_id; \n $loginuserRole = $auth->getStorage()->read()->emprole;\n $loginuserGroup = $auth->getStorage()->read()->group_id;\n }\n $id = $this->getRequest()->getParam('id');\n try\n {\n if($id != '')\n {\n\t\t\t $app_manager_model = new Default_Model_Appraisalmanager();\n\t\t\t\t$line_managers = array();\n\t\t\t\t$line_managers = $app_manager_model->getLineManagers($id,$loginUserId);\n\t\t\t\t$appraisal_init_model = new Default_Model_Appraisalinit();\n\t\t\t\t$appraisal_data = $appraisal_init_model->getappdata_forview($id);\n\t\t\t\t\n if(is_numeric($id) && $id>0 && $line_managers && !empty($appraisal_data))\n {\n\t\t\t\t\t$appraisal_data['process_status'] = '';\n if(!empty($appraisal_data))\n {\n \tif($appraisal_data['initialize_status'] == 1)\n \t{\n \t\tif($appraisal_data['enable_step'] == 1)\n \t\t\t$appraisal_data['process_status'] = 'Enabled to Managers';\n \t\tif($appraisal_data['enable_step'] == 2)\n \t\t\t$appraisal_data['process_status'] = 'Enabled to Employees';\t\n \t}\n \telse if($appraisal_data['initialize_status'] == 2)\n \t{\n \t\t$appraisal_data['process_status'] = 'Initialize Later';\n \t}else\n\t\t\t \t{\n\t\t\t \t $data['process_status'] = 'In progress';\t\n\t\t\t \t}\n }\n if($appraisal_data['status'] == 1) {\n \t $appraisal_data['status']=\"Open\";\n }else if($appraisal_data['status'] == 2) {\n \t $appraisal_data['status']=\"Closed\";\n }else {\n $appraisal_data['status']=\"Force Closed\";\n }\t\n if($appraisal_data['appraisal_ratings'] == 1) {\n \t $appraisal_data['appraisal_ratings']=\"1-5\";\n }else {\n $appraisal_data['appraisal_ratings']=\"1-10\";\n }\t\n if($appraisal_data['appraisal_mode'] == 'Quarterly'){\n\t\t\t\t\t\t $appraisal_data['appraisal_period']=\"Q\".$appraisal_data['appraisal_period'];\n }\n\t\t\t\t\t else if($appraisal_data['appraisal_mode'] == 'Half-yearly'){\n\t\t\t\t\t\t $appraisal_data['appraisal_period']= \"H\".$appraisal_data['appraisal_period'];\n\t\t\t\t\t }\n\t\t\t\t\t else {\n\t\t\t\t\t\t $appraisal_data['appraisal_period']=\"Yearly\";\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t if($appraisal_data['enable_step'] == 1) {\n \t $appraisal_data['enable_step']=\"Managers\";\n }else {\n $appraisal_data['enable_step']=\"Employees\";\n }\n\t\t\t\t\t $appraisal_data['managers_due_date'] = sapp_Global::change_date($appraisal_data['managers_due_date'],'view');\n $appraisal_data['employees_due_date'] = sapp_Global::change_date($appraisal_data['employees_due_date'],'view');\n $manager_groups = $app_manager_model->getManagergroups($id,$loginUserId);\n $view = $this->getHelper('ViewRenderer')->view;\n $view->previ_data = 'no'; \n $view->data = $appraisal_data;\n $text = $view->render('appraisalinit/view.phtml');\n $this->view->appraisal_id = $id;\n $this->view->manager_id = $loginUserId;\n $this->view->manager_groups = $manager_groups;\n $this->view->appraisal_data = $appraisal_data;\n $this->view->app_text = $text;\n $this->view->controllername = 'appraisalmanager';\n $this->view->id = $id;\n }\n else \n {\n $this->view->ermsg = 'nodata';\n }\n }\n else\n {\n $this->view->ermsg = 'nodata';\n }\n } \n catch (Exception $ex) \n {\n $this->view->ermsg = 'nodata';\n }\n }", "public function actionView($id)\n\t{\n\n\t\tif(Yii::app()->user->isSuperAdmin){\n\t\t\t$this->layout = '//layouts/columnAdmin';\n\t\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t\t));\n\t\t}\n\t\telse{\n\t\t\t$this->render('exito',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t\t));\n\t\t}\n\t}", "public function viewAction()\n {\n // Check front disable\n if ($this->config('disable_front')) {\n return $this->jumpToDenied(__('View information is disable'));\n }\n\n $page = $this->params('page', 1);\n $limit = Pi::config('list_limit', 'user');\n $offset = (int)($page - 1) * $limit;\n $uid = _get('uid');\n\n Pi::service('authentication')->requireLogin();\n\n // Get timeline\n $count = Pi::api('timeline', 'user')->getCount($uid);\n $timeline = Pi::api('timeline', 'user')->get($uid, $limit, $offset);\n\n // Get timeline meta list\n $timelineMetaList = Pi::api('timeline', 'user')->getList();\n\n // Set timeline meta\n foreach ($timeline as &$item) {\n if (!isset($timelineMetaList[$item['timeline']])) {\n continue;\n }\n $item['icon'] = $timelineMetaList[$item['timeline']]['icon'];\n $item['title'] = $timelineMetaList[$item['timeline']]['title'];\n }\n\n // Get user base info\n $user = Pi::api('user', 'user')->get(\n $uid,\n ['name', 'country', 'city', 'time_activated'],\n true,\n true\n );\n $user['name'] = isset($user['name']) ? $user['name'] : null;\n\n // Set paginator\n $paginatorOption = [\n 'count' => $count,\n 'limit' => $limit,\n 'page' => $page,\n 'controller' => 'home',\n 'action' => 'view',\n 'uid' => $uid,\n ];\n $paginator = $this->setPaginator($paginatorOption);\n\n $this->view()->assign([\n 'uid' => $uid,\n 'name' => 'homepage',\n 'timeline' => $timeline,\n 'paginator' => $paginator,\n 'user' => $user,\n ]);\n\n $this->view()->setTemplate('home-index');\n $this->view()->assign('view', true);\n $this->view()->headTitle(sprintf(__('%s activities'), $user['name']));\n $this->view()->headdescription(sprintf(__('View %s activities'), $user['name']), 'set');\n $this->view()->headkeywords($this->config('head_keywords'), 'set');\n }", "protected function viewAction()\n {\n }", "public function actionView($id)\n\t{\n $student=Student::model()->findByPk($id);\n echo $student->personID;\n\t\t$this->render('view',array(\n\t\t\t'admission'=> Admission::model()->findByPk(array('studentID'=>$id,'sectionName'=>yii::app()->session['secName'],'batchName'=>yii::app()->session['batName'],'programmeCode'=>yii::app()->session['proCode'])),\n 'student'=> $student,\n 'person'=> Person::model()->findByPk($student->personID)\n\t\t));\n\t}", "public function oldviewAction() {\n\t\t$id = (int)$this->_request->getParam('id');\n\t\tPageTitle::setTitle($this->view, $this->_request, array($id));\n\t\t$debugdate = $this->_request->getParam('debugdate');\n\t\t$layout = trim($this->_request->getParam('layout',''));\n\t\t\n\t\t$taFinder = new TeachingActivities();\n\t\t$ta = $taFinder->getTa($id);\n\t\t\n\t\tif ($ta->isReleased() != true) {\n\t\t\tthrow new Exception(\"Teaching activity $id is not released yet.\");\n\t\t}\n\t\t\n\t\t$this->view->ta = $ta;\n\n\t\t$resourceError = false;\n\t\ttry {\n\t\t\t$resourceService = new MediabankResourceService();\n\t\t\t$resources = $resourceService->getResources($id, 'ta');\n\t\t\t$allowAddResources = $resourceService->allowAdd();\n\t\t} catch (Exception $ex) {\n\t\t\t$resourceError = true;\n\t\t\t$resources = array();\n\t\t\t$allowAddResources = false;\n\t\t}\n\t\t$this->view->allowAddResources = $allowAddResources;\n\t\t$this->view->resourceError = $resourceError;\n\t\t$this->view->resources = $resources;\n\t\t\n\t\t//Check if user is a staff\n\t\t$this->view->isStaffOrAbove = UserAcl::isStaffOrAbove();\n //Store ACL for each resource action which can be accessed by the current user\n //And allow/disallow those actions. \n\t\t$this->view->resourceAcl = ResourceAcl::accessAll(array('type'=>'ta','auto_id'=>$id));\n\n\t\t$this->view->revisions = $taFinder->getTaRevisions($ta->taid);\n\t\t$this->view->released_los = $ta->getLinkedLearningObjectiveWithStatus(Status::$RELEASED);\n\t\t$this->view->title = 'Teaching Activity - '.$ta->auto_id;\n\t\t\n\t\t$studentEvaluateService = new StudentEvaluateService();\n\t\t$this->view->taEvaluations = $studentEvaluateService->getEvaluationForTaId($id);\n\n\t\t$this->view->isMyTa = Utilities::isMyTa($ta);\n\t\t$this->view->debugdate = $debugdate;\n\n if(!empty($layout)) {\n switch($layout) {\n case 'pblview': \n $this->view->pblTaTypePrev = $this->_request->getParam('pblTaTypePrev','');\n $this->view->pblTaTypeNext = $this->_request->getParam('pblTaTypeNext','');\n $this->render('pblview');\n break;\n }\n }\n\t}", "public function view_action()\n {\n $mode = get_param_string('mode', 'cns');\n $id = get_param_integer('id');\n\n if ($mode == 'cns') {\n $rows = $GLOBALS['FORUM_DB']->query_select('f_moderator_logs', array('l_reason AS reason', 'id', 'l_by AS member_id', 'l_date_and_time AS date_and_time', 'l_the_type AS the_type', 'l_param_a AS param_a', 'l_param_b AS param_b'), array('id' => $id), '', 1);\n } else {\n $rows = $GLOBALS['SITE_DB']->query_select('actionlogs', array('id', 'member_id', 'date_and_time', 'the_type', 'param_a', 'param_b', 'ip'), array('id' => $id), '', 1);\n }\n\n if (!array_key_exists(0, $rows)) {\n warn_exit(do_lang_tempcode('MISSING_RESOURCE'));\n }\n $row = $rows[0];\n\n $username = $GLOBALS['FORUM_DRIVER']->get_username($row['member_id']);\n if (is_null($username)) {\n $username = do_lang('UNKNOWN');\n }\n\n $type_str = do_lang($row['the_type'], $row['param_a'], $row['param_b'], null, null, false);\n if (is_null($type_str)) {\n $type_str = $row['the_type'];\n }\n\n $fields = array(\n 'USERNAME' => $GLOBALS['FORUM_DRIVER']->member_profile_hyperlink($row['member_id'], false, '', false),\n 'DATE_TIME' => get_timezoned_date($row['date_and_time']),\n 'ACTION' => $type_str,\n 'PARAMETER_A' => is_null($row['param_a']) ? '' : $row['param_a'],\n 'PARAMETER_B' => is_null($row['param_b']) ? '' : $row['param_b'],\n );\n\n if (array_key_exists('ip', $row)) {\n $fields['IP_ADDRESS'] = escape_html($row['ip']);\n }\n\n if (array_key_exists('reason', $row)) {\n $fields['REASON'] = escape_html($row['reason']);\n }\n\n if (addon_installed('securitylogging')) {\n if (array_key_exists('ip', $row)) {\n $banned_test_1 = ip_banned($row['ip'], true);\n $fields['IP_BANNED'] = (!$banned_test_1) ? do_lang_tempcode('NO') : do_lang_tempcode('YES');\n if ($row['ip'] != get_ip_address()) {\n $fields['IP_BANNED']->attach(do_template('ACTIONLOGS_TOGGLE_LINK', array('_GUID' => 'eff2890f2193ece32df8ec8ee48b252d', 'URL' => build_url(array('page' => 'admin_ip_ban', 'type' => 'toggle_ip_ban', 'id' => $row['ip'], 'redirect' => get_self_url(true)), get_module_zone('admin_ip_ban')))));\n }\n\n if ($row['ip'] != get_ip_address()) {\n if (get_option('stopforumspam_api_key') . get_option('tornevall_api_username') != '') {\n $fields['SYNDICATE_TO_STOPFORUMSPAM'] = do_template('ACTIONLOGS_TOGGLE_LINK', array(\n '_GUID' => '7d10045c6b3b48f256e2f8eb5535809c',\n 'LABEL' => do_lang_tempcode('PROCEED'),\n 'LONELY' => true,\n 'URL' => build_url(array('page' => 'admin_ip_ban', 'type' => 'syndicate_ip_ban', 'ip' => $row['ip'], 'member_id' => $row['member_id'], 'reason' => do_lang('BANNED_ADDRESSES'), 'redirect' => get_self_url(true)), get_module_zone('admin_ip_ban')),\n ));\n }\n }\n }\n\n if ((!is_guest($row['member_id'])) && ($row['member_id'] != get_member())) {\n $fields['SUBMITTER_BANNED'] = do_template('ACTIONLOGS_TOGGLE_LINK', array(\n '_GUID' => 'f79fb00ef35d89381371a67bc9c4d69b',\n 'LONELY' => true,\n 'URL' => build_url(array('page' => 'admin_ip_ban', 'type' => 'toggle_submitter_ban', 'id' => $row['member_id'], 'redirect' => get_self_url(true)), get_module_zone('admin_ip_ban')),\n ));\n } else {\n $banned_test_2 = $GLOBALS['SITE_DB']->query_select_value_if_there('usersubmitban_member', 'the_member', array('the_member' => $row['member_id']));\n $fields['SUBMITTER_BANNED'] = is_null($banned_test_2) ? do_lang_tempcode('NO') : do_lang_tempcode('YES');\n }\n\n if (((get_forum_type() == 'cns') && (!is_guest($row['member_id']))) && ($row['member_id'] != get_member())) {\n $fields['MEMBER_BANNED'] = do_template('ACTIONLOGS_TOGGLE_LINK', array(\n '_GUID' => '6b192ecfad1afc67bb8c2f1e744cc3b1',\n 'LONELY' => true,\n 'URL' => build_url(array('page' => 'admin_ip_ban', 'type' => 'toggle_member_ban', 'id' => $row['member_id'], 'redirect' => get_self_url(true)), get_module_zone('admin_ip_ban')),\n ));\n } else {\n $banned_test_3 = $GLOBALS['FORUM_DRIVER']->is_banned($row['member_id']);\n $fields['MEMBER_BANNED'] = $banned_test_3 ? do_lang_tempcode('YES') : do_lang_tempcode('NO');\n }\n }\n $fields['INVESTIGATE_USER'] = hyperlink(build_url(array('page' => 'admin_lookup', 'id' => (array_key_exists('ip', $row)) ? $row['ip'] : $row['member_id']), '_SELF'), do_lang_tempcode('PROCEED'), false, false);\n\n // Is there a revision here?\n require_code('revisions_engine_database');\n $revision_engine = new RevisionEngineDatabase($mode == 'cns');\n $revision = $revision_engine->find_revision_for_log($id);\n if (is_null($revision)) {\n require_code('revisions_engine_files');\n $revision_engine = new RevisionEngineFiles();\n $revision = $revision_engine->find_revision_for_log($id);\n }\n if (!is_null($revision)) {\n if (isset($revision['r_resource_type']) && isset($revision['r_resource_id'])) {\n require_code('content');\n list($content_title, , , , $content_url) = content_get_details($revision['r_resource_type'], $revision['r_resource_id']);\n if (empty($content_title)) {\n $content_title = $revision['r_original_title'];\n }\n if (!is_null($content_url)) {\n $fields['VIEW'] = hyperlink($content_url, $content_title, false, true);\n }\n }\n\n if (isset($revision['r_original_content_owner'])) {\n $fields['CONTENT_OWNER'] = $GLOBALS['FORUM_DRIVER']->member_profile_hyperlink($revision['r_original_content_owner']);\n }\n\n if (isset($revision['r_original_content_timestamp'])) {\n $fields['CONTENT_DATE_AND_TIME'] = get_timezoned_date($revision['r_original_content_timestamp']);\n }\n\n if (isset($revision['r_original_title'])) {\n if ($revision['r_original_title'] != '') {\n $fields['TITLE_PRIOR_TO_REVISION'] = $revision['r_original_title'];\n }\n }\n\n $fields['TEXT_PRIOR_TO_REVISION'] = with_whitespace($revision['r_original_text'], true);\n\n if (isset($revision['r_original_resource_fs_path'])) {\n $fields['RESOURCE_FS_PATH_PRIOR_TO_REVISION'] = $revision['r_original_resource_fs_path'];\n }\n\n if (isset($revision['r_original_resource_fs_record']) && strlen($revision['r_original_resource_fs_record']) < 1024 * 50/*50kb reasonable limit*/) {\n $fields['RESOURCE_FS_RECORD_PRIOR_TO_REVISION'] = with_whitespace($revision['r_original_resource_fs_record'], true);\n }\n\n if (has_privilege(get_member(), 'delete_revisions')) {\n $delete_url = build_url(array('page' => 'admin_revisions', 'type' => 'delete', 'id' => $revision['id'], 'revision_type' => $revision['revision_type'], 'redirect' => get_self_url(true)), get_module_zone('admin_revisions'));\n $delete = hyperlink($delete_url, do_lang_tempcode('DELETE'), false, false, do_lang_tempcode('DELETE_REVISION'), null, new Tempcode());\n $fields['DELETE_REVISION'] = $delete;\n }\n\n /*if (has_privilege(get_member(), 'undo_revisions')) {\n $undo_url = build_url(array('page' => 'admin_revisions', 'type' => 'undo', 'id' => $revision['id'], 'revision_type' => $revision['revision_type'], 'redirect' => get_self_url(true)), get_module_zone('admin_revisions'));\n $delete = hyperlink($delete_url, do_lang_tempcode('UNDO'), false, false, do_lang_tempcode('UNDO_REVISION'), null, new Tempcode());\n $fields['UNDO_REVISION'] = $delete;\n }*/\n }\n\n require_code('templates_map_table');\n return map_table_screen($this->title, $fields);\n }", "function index()\n {\n $this->_view_edit('view');\n }", "public function detail($vacation_id) {}", "public function actionView($id)\n\t{\n\t\t$arriendo = Arriendo::model()->findByPk($id);\n\t\t$this->render('admin', array('arriendo'=>$arriendo));\n\t}", "public function view(int $id)\r\n {\r\n }", "public function viewAction() {\n\t\t$role = new Role_Model_Role();\n\t\t$this->view->record = $role->findById($this->getRequest()->getParam('id'));\n\t}", "public function actionView($id)\n {\n $model = $this->findModel($id);\n\n $event = Yii::t('app', 'view record {id}', ['id' => $model->permission_id]);\n $bitacora = new Bitacora();\n $bitacora->register($event, 'actionView', MSG_INFO);\n\n return $this->render(ACTION_VIEW, [MODEL => $model]);\n }", "public function detail()\n {\n $vereinRepository = new VereinRepository();\n\n $view = new View('verein_detail');\n $view->heading = \"\";\n $view->verein = $vereinRepository->readById($_GET['id']);\n $view->title = $view->verein->name;\n $view->display();\n }", "public function actionView($id)\n\t{\n\t\t$this->allowUser(SUPERADMINISTRATOR);\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}", "public function view($id)\n\t{\n\t\n\t\t$this->is_allowed('amuco_details_request_office_view');\n if($this->input->get('popup')){\n\t\t\t$this->data['current_page'] = 'Modal';\n\t\t}else{\n\t\t\t$this->data['current_page'] = 'View';\n\t\t}\n\t\t$this->data['amuco_details_request_office'] = $this->model_amuco_details_request_office->join_avaiable()->filter_avaiable()->find($id);\n // var_dump($this->data['amuco_details_request_office']);\n\t\t$this->template->title('Amuco Details Request Office Detail');\n\t\t$this->render('backend/standart/administrator/amuco_details_request_office/amuco_details_request_office_view', $this->data);\n\t}", "public function viewactionsAction(){\n\t\t$moduleId = $this->getRequest()->getParam('moduleId');\n\t\t$moduleObj = new Modules_Model_Modules();\n\t\t$moduleItem = $moduleObj->findById($moduleId);\n\t\t\n\t\t$controllerId = $this->getRequest()->getParam('controllerId');\n\t\t$controllerObj = new Modules_Model_Controllers();\n\t\t$controllerItem = $controllerObj->findById($controllerId);\n\n\t\t$permObj = new Permission_Model_Permission();\n\t\t$permObj->setModuleId( $moduleId );\n\t\t$permObj->setControllerId( $controllerId );\n\n\t\t$this->view->module = $moduleItem;\n\t\t$this->view->controller = $controllerItem;\n\t\t$this->view->records = $permObj->fetchActionsByControllerModule();\n\t}", "public function actionView($id)\n {\n \tif (\\Yii::$app->user->isGuest) {\n \t\treturn $this->redirect(Yii::$app->params['default']);\n \t}\n\t\t//supaya org non guest gabisa akses yg lain\n\t\t\n\t\t\n\t\t$jabatan=Yii::$app->user->identity->jabatan;\n\t\tif($jabatan=='Project Manager' || $jabatan=='Supervisor' || $jabatan=='Coordinator'){\n\t\t\treturn $this->redirect(Yii::$app->params['default'].'index.php/home');\n\t\t}\n\t\t\n return $this->render('view', [\n 'model' => $this->findModel($id),\n ]);\n }", "public function detail($id){\n \n $this->_estado->_setIdTableValue($id);\n $params['rsEstado'] = $this->_estado->getRecord();\n \\kerana\\View::showView($this->_current_module,'estado/detail',$params);\n \n }", "function superadmin_view($id=NULL) {\n\t\t$this->set('meta_title','User Group Details');\n\t\t$this->id= (int)$id;\n\t\tif(!$this->id) {\n\t\t\t$this->Session->setFlash('Invalid admin user id.');\n\t\t\t$this->redirect(array('controller'=>'roles','action' => \"index\")); \n\t\t}\n\t\t$this->set('data',$this->Role->read('',$id));\n\t}", "function go_supervisor_view($mode=\"EDIT\") {\n\n\tif(!has_user_permission(__FUNCTION__)) return; \n\n\tglobal $ROW, $TEMPLATE;\n\tLOG_MSG('INFO',\"go_supervisor_view(): START ROW=\".print_r($ROW,true));\n\n\t// Don't load for add mode or when reloading the form\n\tif ( $mode != \"ADD\" && (!isset($ROW[0]) || get_arg($ROW[0],'STATUS') !== 'RELOAD') ) {\n\n\t\t// Get the Supervisor ID\n\t\t$supervisor_id=get_arg($_GET,\"supervisor_id\");\n\n\t\t// Validate the ID\n\t\tif (\n\t\t\t!validate(\"Supervisor Id\",$supervisor_id,1,11,\"int\")\n\t\t) { \n\t\t\tLOG_MSG('ERROR',\"go_supervisor_view(): Invalid Supervisor ID [$supervisor_id]!\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Get from DB\n\t\t$ROW=db_supervisor_select($supervisor_id);\n\t\tif ( $ROW[0]['STATUS'] != \"OK\" ) {\n\t\t\tadd_msg(\"ERROR\",\"There was an error loading the Supervisor. Please try again later. <br/>\");\n\t\t\treturn;\n\t\t}\n\t\t// No rows found\n\t\tif ( $ROW[0]['NROWS'] == 0 ) {\n\t\t\tadd_msg(\"ERROR\",\"No Supervisors found! <br />Click on <strong>Add Supervisor</strong> to create a one.<br /><br />\"); \n\t\t\treturn;\n\t\t}\n\t}\n\n\t$disabled=\"\";\n\t// Setup display parameters\n\tswitch($mode) {\n\t\tcase \"ADD\":\n\t\t\t\t$_do=\"add\";\n\t\t\t\tbreak;\n\t\tcase \"EDIT\":\n\t\t\t\t$_do=\"save\";\n\t\t\t\tbreak;\n\t\tcase \"DELETE\":\n\t\t\t\t$_do=\"remove\";\n\t\t\t\t$disabled=\"disabled\";\n\t\t\t\tbreak;\n\t\tcase \"VIEW\":\n\t\tdefault:\n\t\t\t\t$disabled=\"disabled\";\n\t\t\t\tbreak;\n\t}\n\n\tif ( isset( $TEMPLATE ) ) { $template=$TEMPLATE; } else { $template=TEMPLATE_DIR.\"record.html\"; } \n\tinclude($template); \n\n\tLOG_MSG('INFO',\"go_supervisor_view(): END\");\n}", "public function actionView()\n {\n \n }", "public function actionView() {}", "public function actionView() {}", "public function viewUserAction()\n {\n \tif($this->getRequest()->getParam('id')){\n \t\t$db = new RsvAcl_Model_DbTable_DbUser();\n \t\t$user_id = $this->getRequest()->getParam('id');\n \t\t$rs=$db->getUser($user_id);\n \t\t//print_r($rs); exit;\n \t\t$this->view->rs=$rs;\n \t} \t \n \t\n }", "public function detailAction() {\n\n //GET THE LIST ITEM\n $this->view->listDetail = Engine_Api::_()->getItem('list_listing',(int) $this->_getParam('id'));\n }", "function aspirelists_get_view_actions() {\n return array('view', 'view all');\n}", "public function viewAction($id) {\n\n return Parent::render($this->templateName,dirname(__DIR__) . '/views/category/views.tpl.php', $id);\n\n\n\n\n }", "public function actionView($id)\n { \n return $this->findModel($id);\n \n }", "public function atutyAction() {\n\t\t\t$db = Zend_Registry::get('db');\n\t\t\t$id = (int)$this->getRequest()->getParam('id');\n\n\t\t\t$this->view->lista = $db->fetchAll($db->select()->from('inwestycje_atut')->order('sort ASC')->where('id_inwest = ?', $id));\n\t\t\t$this->view->inwestycja = $db->fetchRow($db->select()->from('inwestycje')->where('id = ?', $id));\n\t\t}", "public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t\t'keyid'=>$id\n\t\t));\n\t}", "public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t\t'keyid'=>$id\n\t\t));\n\t}", "public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t\t'keyid'=>$id\n\t\t));\n\t}", "public function actionView($id)\n {\n $dis = (new Query());\n $dis ->select([ 'tf_lunas.status'])\n ->FROM('tf_lunas')\n ->andWhere('tf_lunas.id_tf_lunas=:id_a', array(':id_a'=>$id))\n ->limit(6);\n $command = $dis->createCommand();\n $dis = $command->queryAll();\n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'dis' => $dis,\n ]);\n }", "public function view($id)\n {\n }", "public function actionView($id)\r\n\t{\r\n\t\t// sets global studyId for authoring\r\n \t\t$this->studyId = $id;\r\n\r\n\t\t$this->render('view',array(\r\n\t\t\t'model'=>$this->loadModel($id),\r\n\t\t));\r\n\t}", "public function view($id) {\n }", "function action_view()\n {\n $this->addStatusFields();\n return parent::action_view();\n }", "public function metaDetailAction() {\n\n //ONLY LOGGED IN USER CAN ADD OVERVIEW\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n //GET VIEWER\n $viewer = Engine_Api::_()->user()->getViewer();\n\n //GET LISTING ID AND OBJECT\n $listing_id = $this->_getParam('listing_id');\n\n \n $this->view->sitereview = $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n Engine_Api::_()->core()->setSubject($sitereview); \n //GET LISTING TYPE ID\n $listingtype_id = $sitereview->listingtype_id;\n\n if(!Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\n $this->_helper->content\n ->setContentName(\"sitereview_dashboard_metadetails_listtype_$listingtype_id\")\n //->setNoRender()\n ->setEnabled();\n \n }\n \n Engine_Api::_()->sitereview()->setListingTypeInRegistry($listingtype_id);\n $listingType = Zend_Registry::get('listingtypeArray' . $listingtype_id);\n\n if (empty($listingType->metakeyword)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n if (!$sitereview->authorization()->isAllowed($viewer, 'edit_listtype_' . $listingtype_id)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n if (!Engine_Api::_()->authorization()->getPermission($viewer->level_id, 'sitereview_listing', \"metakeyword_listtype_$listingtype_id\")) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n //SELECTED TAB\n $this->view->TabActive = \"metadetails\";\n\n //SET FORM\n $this->view->form = $form = new Sitereview_Form_Metainfo();\n\n $tableOtherinfo = Engine_Api::_()->getDbTable('otherinfo', 'sitereview');\n\n //POPULATE FORM\n $value['keywords'] = $tableOtherinfo->getColumnValue($listing_id, 'keywords');\n\n $form->populate($value);\n\n //CHECK FORM VALIDATION\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n //GET FORM VALUES\n $values = $form->getValues();\n $tableOtherinfo->update(array('keywords' => $values['keywords']), array('listing_id = ?' => $listing_id));\n\n //SHOW SUCCESS MESSAGE\n $form->addNotice(Zend_Registry::get('Zend_Translate')->_('Your changes have been saved successfully.'));\n }\n }", "public function getAction()\n {\n \t$id = $this->getRequest()->getParam('id');\n\t\t$this->_objectMapper->find($id, $this->_object);\n $this->view->question = $this->_object;\n\t\t$this->view->isMarked = $this->_objectMapper->isMarked($id);\n }", "function action_listview() {\n\t\t$this->view = 'toplist';\n\t\t//$GLOBALS['log']->fatal('in controller');\n\t\t$this->bean = new REG_PatientListView();\n\t}", "function client_view($id = null) {\n\t\t$this->admin_view($id);\n\t}", "public function actionViewByHrdStaf($id){\n return $this->render('viewByHrdStaf',[\n 'model' => $this->findModel($id),\n ]);\n }", "public function view_user($id)\n {\n\n\n }", "public function actionView($id)\n\t{\n\t\t$invoice = $this->loadModel($id);\n\t\t\n\t\tif(!(Yii::app()->user->roles == \"admin\") && ($invoice->waktu_penerbitan < Utilities::getTodayTimeStamp())) {\n\t\t\tthrow new CHttpException(403, \"Not Authorized\");\n\t\t}\n\t\t\n\t\tif(Yii::app()->user->roles == \"admin\") {\n\t\t\t$this->active = \"index\";\n\t\t} else {\n\t\t\t$this->active = \"today\";\n\t\t}\n\t\t\n\t\t$this->render('view',array(\n\t\t\t'invoice'=>$this->loadModel($id),\n\t\t));\n\t}", "public function indexAction()\r\n {\r\n // Model\r\n $tourismOperDb = new Model_DbTable_TourismOperator;\r\n\r\n // Data\r\n // Tipe 6 = vito / overseas representatives\r\n $tourismOperQuery = \r\n $tourismOperDb->getAllWithDescById('6', $this->_languageId);\r\n\r\n // View\r\n $this->view->tourism = parent::setPaginator($tourismOperQuery);\r\n\r\n // id_page_overseas = 'representative(s)'\r\n $this->view->customName = $this->view->translate('id_page_overseas');\r\n }", "public function actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'\t\t=>$this->loadModel($id),\n\t\t\t'dokter'\t=>$this->loadModelDetailDokter($id),\n\t\t\t'perawat'\t=>$this->loadModelDetailPerawat($id),\n\t\t\t'obat'\t\t=>$this->loadModelDetailObat($id),\n\t\t\t'perawatan'\t=>$this->loadModelDetailPerawatan($id),\n\t\t));\n\t}", "public function actionView($id)\r\n {\r\n// var_dump($id);exit();\r\n return $this->render('view', [\r\n 'model' => $this->findModel($id),\r\n 'menus' => $this->_getMenus(),\r\n ]);\r\n }", "public function actionView($id)\n\t{\n\t\t$this->allowUser(EDITOR);\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}", "public function actionViewByStaf($id){\n return $this->render('viewByStaf',[\n 'model' => $this->findModel($id),\n ]);\n }", "public function show(Insumo $insumo)\n {\n //\n }", "function main($action) {\n\t\t\t\n\t\t\t// da wir keine seite brauchen, setzen wir den start-view auf uns\n\t\t\t$this->set_start_view('admin_list');\n\t\t\t\n\t\t\t$this->action = $action;\n\t\t\t$this->vid = UTIL::get_post('vid');\n\t\t\t\n\t\t\tswitch(strtolower($action['event'])) \n\t\t\t{\n\t\t\t\tcase 'admin_list':\t$this->set_start_view('admin_list');\tbreak;\n\t\t\t\tcase 'open':\t\t$this->action_open();\t\t\t\t\tbreak;\n\t\t\t\tcase 'close':\t\t$this->action_close();\t\t\t\t\tbreak;\n\t\t\t\tcase 'add':\t\t\t$this->action_add();\t\t\t\t\tbreak;\n\t\t\t\tcase 'remove':\t\t$this->action_remove();\t\t\t\t\tbreak;\n\t\t\t\tcase 'clear':\t\t$this->action_clear();\t\t\t\t\tbreak;\n\t\t\t\tcase 'finish':\t\t$this->action_finish();\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t}", "public function actionView($id)\n {\n return $this->render('view', [\n 'model' => $this->findModel($id),\n \t\t'vipList' => $this->findVipList(),\n \t\t'vipBlogList'=>$this->findVipBlogList(),\n \t\t'yesNoList' => SysParameterType::getSysParametersById(SysParameterType::YES_NO),\n ]);\n }", "public function actionView($id)\n\t{\n $uid = Yii::app()->user->getId(); \n if($uid != 1){\n $value = ComSpry::getUnserilizedata($uid);\n if(empty($value) || !isset($value)){\n throw new CHttpException(403,'You are not authorized to perform this action.');\n }\n if(!in_array(37, $value)){\n throw new CHttpException(403,'You are not authorized to perform this action.');\n }\n }\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n \n\t}", "public function actionView($id) {\n\t\t$query = WrkPagosEmpleados::find ()->where ( [ \n\t\t\t\t'id_empleado' => $id \n\t\t] );\n\t\t\n\t\t// add conditions that should always apply here\n\t\t\n\t\t$dataProvider = new ActiveDataProvider ( [ \n\t\t\t\t'query' => $query \n\t\t] );\n\t\t\n\t\treturn $this->render ( 'view', [ \n\t\t\t\t'model' => $this->findModel ( $id ),\n\t\t\t\t'dataProvider' => $dataProvider \n\t\t] );\n\t}", "public function actionView($id) {\n\t\treturn $this->render ( 'view', [ \n\t\t\t\t'model' => $this->findModel ( $id ) \n\t\t] );\n\t}", "public function actionView($id) {\n\t\treturn $this->render ( 'view', [ \n\t\t\t\t'model' => $this->findModel ( $id ) \n\t\t] );\n\t}", "public function viewAction()//23:15\n {\n\n }", "public function viewAction() {\n\t\t$id = $this->_getParam('id');\n\t\t$taFinder = new TeachingActivities();\n\t\t$ta = $taFinder->getTa($id);\n\t\t\n\t\t$latest_flag = ($this->_getParam('latest') == 'f') ? false : true;\n\t\t$latest_ta_id = $ta->latestReleasedVersionId();\n\t\tif ($latest_ta_id != $id && !UserAcl::isDomainAdminOrAbove() && $latest_flag) {\n\t\t\t$this->_redirect('/teachingactivity/view/id/'.$latest_ta_id);\n\t\t\treturn;\n\t\t}\n\t\t$this->view->debugdate = $this->_getParam('debugdate');\n\t\t$layout = $this->_getParam('layout', '');\n\n\t\tPageTitle::setTitle($this->view, $this->_request, array($id));\n\n\t\tif ($ta->isReleased() != true) {\n\t\t\tthrow new Exception(\"Teaching activity $id is not released yet.\");\n\t\t}\n\n\t\t$this->view->ta = $ta;\n\t\t$this->view->revisions = $taFinder->getTaRevisions($ta->taid);\n\t\t$this->view->released_los = $ta->getLinkedLearningObjectiveWithStatus(Status::$RELEASED);\n\t\t\n\t\t$this->view->showGenericEvaluation = EvaluateTaConst::showGenericEvaluation($ta->typeID);\n\t\t\n\t\tif(UserAcl::isAdmin() && $this->view->showGenericEvaluation === true) {\n \t\t$studentEvaluateService = new StudentEvaluateService();\n \t\t$this->view->taEvaluations = $studentEvaluateService->getEvaluationForTaId($id);\n \t\t$studentEvaluate = new StudentEvaluate();\n \t\t$this->view->taEvaluationAvg = $studentEvaluate->getRatingAvg('ta', $id);\n\t\t}\n\n\t\t$this->view->display_edit_links = UserAcl::isStaffOrAbove() && UserAcl::checkTaPermission($ta, UserAcl::$EDIT) === true && count($this->view->released_los) > 0;\n\t\t$this->view->resourceAcl = ResourceAcl::accessAll(array('type'=>'ta','auto_id'=>$id));\n\t\t$this->view->resources = $ta->resources;\n\t\t\n\t\t$this->view->pblTaTypePrev = '';\n\t\t$this->view->pblTaTypeNext = '';\n\t\t\n\t if(!empty($layout)) {\n switch($layout) {\n case 'pblview': \n $this->view->pblTaTypePrev = $this->_request->getParam('pblTaTypePrev','');\n $this->view->pblTaTypeNext = $this->_request->getParam('pblTaTypeNext','');\n //$this->render('pblview');\n break;\n }\n }\n\t\t$this->view->socialtools = StudentResourceService::showSocialTools();\n\t}", "public function actionView($id)\n\t{\n $model = $this->findModel($id);\n\n\t\t$this->view->title = Yii::t('app', 'Detail User Level: {name}', ['name' => $model->title->message]);\n\t\t$this->view->description = '';\n\t\t$this->view->keywords = '';\n\t\treturn $this->oRender('admin_view', [\n\t\t\t'model' => $model,\n\t\t\t'small' => false,\n\t\t]);\n\t}", "public function actionView($id)\n {\n\t$model = $this->findModel($id);\n\t$modelDistributor = $model->waiter0->distributor0;\n\n return $this->render('view', [\n 'model' => $model,\n\t 'modelDistributor' => $modelDistributor,\n ]);\n }", "public function actionView($id)\n\t{\n $this->layout='admin';\n \n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}", "public function actionView($id)\n\t{\n\t\t$user = User::model()->find('username=?',array(Yii::app()->user->name));\n\t\t$type_ID = $user->user_type_ID;\n\t\t$role_ID = $user->role_ID;\n\t\tif($type_ID == \"1\" || $type_ID==\"3\" || $role_ID =\"2\" || $role_ID = \"5\"){\n\t\t\t$this->render('view',array(\n\t\t\t\t'model'=>$this->loadModel($id),\n\t\t\t\t));\n\t\t}else{\n\t\t\t\n\t\t\techo \"<script>alert('Sie sind nicht berechtigt, diese Aktion durchzuführen')</script>\";\n\t\t}\n\t}", "function omn_superadmin_overview_page() {\n\n\tif( isset($_REQUEST['action']) ) {\n $action = $_REQUEST['action'];\n } else {\n $action = 'default';\n }\n \n switch( $action ) {\n case 'add':\n \tomn_superadmin_overview_page_add();\n \tbreak;\n case 'delete-notification':\n \tomn_delete_notification( $_GET['user'], $_GET['message'] );\n \tomn_superadmin_overview_page_default();\n \tbreak;\n case 'expire-message':\n \tomn_delete_notifications( $_GET['id'] );\n \tomn_superadmin_overview_page_default();\n \tbreak;\n case 'delete-message':\n \tomn_delete_message( $_GET['id'] );\n \tomn_superadmin_overview_page_default();\n \tbreak;\n default:\n \tomn_superadmin_overview_page_default();\n \tbreak;\n }\n}", "public function actionView($id)\n {\n \n $action = AduanAction::find()->where(['aduan_id' => $id])->all();\n $actionCreate = new AduanAction();\n $aduan = $this->findModel($id);\n\t\t$aduan->scenario = 'admin_update';\n \n if ($actionCreate->load(Yii::$app->request->post()) && $aduan->load(Yii::$app->request->post())) {\n $post = $actionCreate->load(Yii::$app->request->post());\n $actionCreate->aduan_id = $id;\n $actionCreate->created_at = new Expression('NOW()'); \n $actionCreate->created_by = Yii::$app->user->identity->id;\n\t\t\t$actionCreate->progress_id = $aduan->progress_id;\n\t\t\t\n if($actionCreate->save() and $aduan->save()){\n\t\t\t\tif($actionCreate->progress_id == 90){\n\t\t\t\t\t$actionCreate->sendActionEmail();\n\t\t\t\t}\n\t\t\t\tif($actionCreate->progress_id == 70){\n\t\t\t\t\t$actionCreate->sendClarificationEmail();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tYii::$app->session->addFlash('success', \"Data Updated\");\n\t\t\t\treturn $this->refresh();\n\t\t\t}else{\n\t\t\t\t$actionCreate->flashError();\n\t\t\t\t$aduan->flashError();\n\t\t\t}\n \n }\n\n return $this->render('view', [\n 'model' => $aduan,\n 'action' => $action,\n 'actionCreate' => $actionCreate,\n\n ]);\n }", "public function actionView($id) {\n $dateRange=$this->getDateRange();\n\t\tif(isset($_GET['stage']) && is_numeric($_GET['stage']))\n\t\t\t$viewStage = $_GET['stage'];\n\t\telse\n\t\t\t$viewStage = null;\n\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),'viewStage'=>$viewStage, 'dateRange'=>$dateRange,\n\t\t));\n\t}", "public function landShowingDetailAction(){\n\n\t\t\t\t$params = $this->getRequest()->getParams(); \n\t\t\t\t$db = $this->db;\n\t\t\t\t$secretkey = $this->secretkey;\n\n\t\t\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\";\n\t\t\t\t$farmer_code\t= isset($params['farmer_code'])?$params['farmer_code']:\"\";\n\t\t\t\t$land_id\t= isset($params['land_id'])?$params['land_id']:\"\";\n\t\t\t\t$mou_type_id\t= isset($params['mou_type_id'])?$params['mou_type_id']:\"\";\n\t\t\t\t$variety_id\t= isset($params['variety_id'])?$params['variety_id']:\"\";\n\t\t\t\t$category_id\t= isset($params['category_id'])?$params['category_id']:\"\";\n\t\t\t\t$lot_no\t= isset($params['lot_no'])?$params['lot_no']:\"\";\n\t\t\t\t$sowing_date\t= isset($params['sowing_date'])?$params['sowing_date']:\"\";\n\t\t\t\t$tcw_of_seed\t= isset($params['tcw_of_seed'])?$params['tcw_of_seed']:\"\";\n\t\t\t\t$sowing_depth\t= isset($params['sowing_depth'])?$params['sowing_depth']:\"\";\n //$sowing_depth_unit_id\t= isset($params['sowing_depth_unit_id'])?$params['sowing_depth_unit_id']:\"\";\n\t\t\t\t$sink_date_time\t= isset($params['sink_date_time'])?$params['sink_date_time']:\"\";\n\n\n\t\t\t\t$seed_rate_kg_per_acre\t= isset($params['seed_rate_kg_per_acre'])?$params['seed_rate_kg_per_acre']:\"\";\n\t\t\t\t$seed_rate_per_m2\t= isset($params['seed_rate_per_m2'])?$params['seed_rate_per_m2']:\"\";\n\t\t\t\t$sowing_type_id\t= isset($params['sowing_type_id'])?$params['sowing_type_id']:\"\";\n\t\t\t\t$sowing_moisture_source\t= isset($params['sowing_moisture_source'])?$params['sowing_moisture_source']:\"\";\n\t\t\t\t$row_to_row_diff\t= isset($params['row_to_row_diff'])?$params['row_to_row_diff']:\"\";\n // $row_to_row_diff_unit_id\t= isset($params['row_to_row_diff_unit_id'])?$params['row_to_row_diff_unit_id']:\"\";\n\n\t\t\t\t$error_code = 1;\n\t\t\t\t$succes = FALSE;\n\t\t\t\ttry{\n\t\t\t\t\t$db->beginTransaction();\n\t\t\t\t\tif($secretkey != $appkey){\n\t\t\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t\t\t}\t\n\t\t\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$user = new Application_Model_Users();\n\t\t\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t\t\t} \n\t\t\t\t\tif(!empty($alldata['DeviceID'])){\t\t\t\n\t\t\t\t\t\tif($alldata['DeviceID'] != $device_id){\n\t\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac'){\n\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t\t\t}\t\n\n\t\t\t\t\tif($alldata['App_Access_Status'] == 2){\n\t\t\t\t\t\t$error_code = 2;\n\t\t\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$farmerMaster = new Application_Model_Farmermasters();\n\t\t\t\t\t$allFarmerData = $farmerMaster->getFarmerDetailsByFarmerCode($farmer_code); \t\n\t\t\t\t\t$farmerID = $allFarmerData['id'];\n\t\t\t\t\t$farmerCode = $allFarmerData['FarmerCode'];\n\n\n\t\t\t\t\t$land_showing = array(); \n\t\t\t\t\t$land_showing['land_id'] = $land_id;\n\t\t\t\t\t$land_showing['mou_type_id'] = $mou_type_id;\n\t\t\t\t\t$land_showing['variety_id'] = $variety_id;\n\t\t\t\t\t$land_showing['category_id'] = $category_id;\n\t\t\t\t\t$land_showing['lot_no'] = $lot_no;\n\t\t\t\t\t$land_showing['tcw_of_seed'] = $tcw_of_seed;\n\t\t\t\t\t$land_showing['sowing_depth'] = $sowing_depth;\n\t\t\t\t\t$land_showing['sowing_date'] = $sowing_date;\n // $land_showing['sowing_depth_unit_id'] = $sowing_depth_unit_id;\n\t\t\t\t\t$land_showing['seed_rate_kg_per_acre'] = $seed_rate_kg_per_acre;\n\t\t\t\t\t$land_showing['seed_rate_per_m2'] = $seed_rate_per_m2;\n\t\t\t\t\t$land_showing['sowing_type_id'] = $sowing_type_id;\n\t\t\t\t\t$land_showing['sowing_moisture_source'] = $sowing_moisture_source;\n\t\t\t\t\t$land_showing['row_to_row_diff'] = $row_to_row_diff;\n // $land_showing['row_to_row_diff_unit_id'] = $row_to_row_diff_unit_id;\n\t\t\t\t\t$land_showing['farmer_code'] = $farmer_code;\n\t\t\t\t\t$land_showing['farmer_id'] = $farmerID;\n\t\t\t\t\t$land_showing['fe_code'] = $LoginID;\n\t\t\t\t\t$land_showing['sink_date_time'] = $sink_date_time;\n\t\t\t\t\t$land_showing['created'] = $this->currdate; \n\t\t\t\t\t$db->insert('logi_land_showing', $land_showing);\n\n\t\t\t\t\t$landdetailId = $db->lastInsertId();\n\n\t\t\t\t\t$db->commit();\n\t\t\t\t\t$succes = TRUE;\t \n\t\t\t\t}\n\n\t\t\t\tcatch(Exception $e){\n //Rollback transaction\n\t\t\t\t\t$db->rollBack();\n\t\t\t\t\t$error= $e->getMessage();\n\t\t\t\t}\n\n\t\t\t\tif($succes == TRUE ){\n\t\t\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Land Showing Detail Inserted successfully.', 'showing_id'=>$landdetailId));\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error));\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t}", "public function show_detail($i_id=0)\r\n {\r\n try\r\n {\r\n if(trim($i_id)!=\"\")\r\n {\r\n $info=$this->mod_rect->fetch_this(decrypt($i_id));\r\n\r\n if(!empty($info))\r\n {\r\n $temp=array();\r\n $temp[\"s_id\"]= encrypt($info[\"id\"]);////Index 0 must be the encrypted PK \r\n\t\t\t\t\t$temp[\"s_title\"]= trim($info[\"s_title\"]);\r\n\t\t\t\t\t$temp[\"s_description\"]= trim($info[\"s_description\"]);\r\n\t\t\t\t\t$temp[\"s_buyer\"]= trim($info[\"s_buyer_name\"]);\r\n\t\t\t\t\t$temp[\"s_category\"] = trim($info[\"s_category\"]);\r\n\t\t\t\t\t$temp[\"s_is_active\"]= trim($info[\"s_is_active\"]);\r\n\t\t\t\t\t$temp[\"dt_created_on\"]= trim($info[\"dt_entry_date\"]);\r\n\t\t\t\t\t$temp[\"dt_approved_on\"]= trim($info[\"dt_approval_date\"]);\r\n\t\t\t\t\t$temp[\"dt_expired_on\"]= trim($info[\"dt_expire_date\"]);\r\n\t\t\t\t\tpr($temp);\r\n\t\t\t\t\t$this->data[\"info\"]=$temp;\r\n unset($temp);\r\n }\r\n unset($info);\r\n }\r\n $this->add_css(\"css/admin/style.css\");///include main css\r\n $this->add_js(\"js/jquery/jquery-1.4.2.js\");///include main css\r\n $this->add_css(\"js/jquery/themes/ui-darkness/ui.all.css\");///include jquery css\r\n \r\n $this->render(\"comm_payment_report/show_detail\",TRUE);\r\n unset($i_id);\r\n }\r\n catch(Exception $err_obj)\r\n {\r\n show_error($err_obj->getMessage());\r\n } \r\n }", "public function actionView($id)\n\t{\n\t\t//$this->layout='//layouts/column2';\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),'manajemen'=>'manajemen',\n\t\t));\n\t}", "public function actionView($id)\n {\n $model=$this->findModel($id);\n $tahunAjaran = TahunAjaran::findOne(['status'=>1]);\n $kelas= RelasiKelasSiswa::findOne(['uid_data_siswa'=> $model->uid_siswa, 'uid_tahun_ajaran'=>$tahunAjaran->uid_thn_ajaran]);\n $kelas= $kelas->uidKelas->nama_kelas;\n if(\\Yii::$app->user->can('superUser')){\n $attributes=[\n\n 'nis_siswa',\n 'nisn_siswa',\n 'nik_siswa',\n 'nama_siswa',\n 'jenis_kelamin_siswa',\n 'tempat_lahir_siswa',\n 'tanggal_lahir_siswa',\n [\n 'attribute'=>'kelas',\n 'value'=>$kelas,\n ],\n 'hobi_siswa',\n 'cita_cita_siswa',\n 'alamat_domisili',\n 'jarak_rumah_kesekolah',\n 'no_telp_orangtua',\n 'nama_ayah',\n 'nama_ibu',\n 'alamat_lengkap_orang_tua',\n\n ];\n }\n else{\n $attributes=[\n\n 'nis_siswa',\n 'nisn_siswa',\n 'nik_siswa',\n 'nama_siswa',\n 'jenis_kelamin_siswa',\n 'tempat_lahir_siswa',\n 'tanggal_lahir_siswa',\n [\n 'attribute'=>'kelas',\n 'value'=>$kelas,\n ],\n 'hobi_siswa',\n 'cita_cita_siswa',\n 'alamat_domisili',\n 'jarak_rumah_kesekolah',\n 'no_telp_orangtua',\n 'nama_ayah',\n 'nama_ibu',\n 'alamat_lengkap_orang_tua',\n\n ];\n }\n\n return $this->render('view', [\n 'model' => $model,\n 'attributes'=> $attributes,\n 'kelas'=> $kelas,\n ]);\n }", "public function ViewAction()\r\n\t{\r\n\t\t$this->View->author = $this->Author->select();\r\n\t}", "public function show($id)\n {\n //$this->_DetailItem();\n }", "public function actionView($id) {\n\n\n return $this->render('view', [\n 'model' => $this->findModel($id),\n ]);\n }", "public function index()\n\t{\n\t\t$this->view($this->user_id);\n\t}", "public function actionView()\n\t{\n\t\t$this->render('view');\n\t}", "function View($id)\r\n\t\t{\r\n\t\t\t$this->data[$this->name] = $this->controller_model->Get($id);\r\n\t\t}", "public function view($id)\n\t{\n\t\t$this->is_allowed('amuco_customer_request_view');\n\n\t\t$this->data['amuco_customer_request'] = $this->model_amuco_customer_request->join_avaiable()->filter_avaiable()->find($id);\n\t\t$this->data['amuco_details_customers_requests'] = $this->model_amuco_details_customers_request->get($id,'customer_request_id');\n\t\t$this->data['amuco_details_customers_request_counts'] = $this->model_amuco_details_customers_request->count_all('','');\n\t\t$this->data['current_page'] = 'view'; \n\t\t$this->template->title('Amuco Customer Request Detail');\n\t\t$this->render('backend/standart/administrator/amuco_customer_request/amuco_customer_request_view', $this->data);\n\t}", "function view( $id = NULL )\n {\n\tif ( !is_numeric( $id ) ) {\n\t $result = $this->_get( 'id' );\n\t $data = $this->page_settings( 'edit', $result, 'result', 'Edit', 'mdl_auth' );\n\t} else {\n\t $result = $this->get_where( $id );\n\t $data = $this->page_settings( 'edit', $result, 'result', 'Edit', 'mdl_auth' );\n\t}\n\n\t$this->templates->frontend( $data );\n }", "public function _actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n ));\n }", "public function actionView($id)\n {\n $userModel = new User();\n $is_admin = $userModel->getGroupUsers();\n $is_select = 0;\n if($is_admin['is_select'] == 1) {\n $is_select = 1;\n }\n $info_arr = $this->getOrderInfo($id);\n $order_record_arr = OrderRecord::getOrderRecord($id);\n return $this->render('view', [\n 'order_record_arr' => $order_record_arr,\n 'model' => $info_arr['model'],\n 'data_arr' => $info_arr['data_arr'],\n 'spu_arr' => $info_arr['spu_arr'],\n 'order_info' => $info_arr['order_info'],\n ]);\n }", "public function view($rfp_id){\n\n $data['title'] = 'Admin View Request';\n $data['heading'] = 'View Request Page'; \n $data['rfp_id'] = decode($rfp_id);\n\n $data['record']=$this->Rfp_model->get_result('rfp',['id' => decode($rfp_id)],'1');\n // pr($data['record'],1);\n $data['subview'] = 'admin/rfp/view';\n $this->load->view('admin/layouts/layout_main', $data);\n }", "public function actionView($id)\n {\n if (\\Yii::$app->user->can('administrador')) {\n $this->layout =\"main-admin\";\n Yii::$app->view->params['iconoAdministrador'] = 'fa fa-file-text';\n Yii::$app->view->params['tituloAdministrador'] = 'Factura de Gastos';\n Yii::$app->view->params['subTituloAdministrador'] = 'Lista de Factura de Gastos';\n Yii::$app->view->params['subTitulo2Administrador'] = 'Detalle de Factura de Gastos';\n Yii::$app->view->params['linkAdministrador'] = 'index';\n }\n else if (\\Yii::$app->user->can('usuario')){\n $this->layout =\"main-usuario\";\n Yii::$app->view->params['iconoAdministrador'] = 'fa fa-home';\n Yii::$app->view->params['tituloAdministrador'] = 'Apartamentos';\n Yii::$app->view->params['subTituloAdministrador'] = 'Lista de Apartamentos';\n Yii::$app->view->params['subTitulo2Administrador'] = 'Detalle de Apartamento';\n Yii::$app->view->params['linkAdministrador'] = 'apartamentos/index';\n }\n $model2 = FacturaGastosItems::find()->where(['factura_gastos_id_factura_gastos' => $id])->all();\n return $this->render('view', [\n 'model' => $this->findModel($id), 'model2' => $model2\n ]);\n }", "function viewAction(){\r\n\t\t//$iUnitId = Sys_Publib_Library::_getItemAttrById($_SESSION['arr_all_staff'],$_SESSION['staff_id'],'unit_id');\r\n\t\t//Lay ID phong ban cua NSD dang nhap hien thoi\r\n\t\t$pUrl = $_SERVER['REQUEST_URI'];\r\n\t\t$objFunction =\tnew\tSys_Function_DocFunctions()\t;\r\n\t\t$objFilter = new Zend_Filter();\t\t\t\r\n\t\t// Tieu de man hinh danh sach\r\n\t\t$this->view->docInfo \t\t= \"THÔNG TIN VĂN BẢN\";\r\n\t\t$sDocumentId = $this->_request->getParam('hdn_object_id','');\r\n\t\t$sType\t\t = $this->_request->getParam('hdn_type','');\r\n\t\t//Lay cac hang so dung chung\r\n\t\t$arrConst = Sys_Init_Config::_setProjectPublicConst();\r\n\t\t$this->view->arrConst = $arrConst;\r\n\t\t// Tao doi tuong Zend_Filter\r\n\t\t$objFilter = new Zend_Filter();\r\n\t\t$ojbSysLib = new Sys_Library();\r\n\t\t$objFullTextSearch = new fulltextsearch_modFulltextsearch();\r\n\t\t//Lay thong tin trong danh muc\r\n\t\t$arrDocSingle = $objFullTextSearch->DocFullTextSearchDocGetSingle($sDocumentId, $sType);\t\t\t\r\n\t\t$this->view->arrDocSingle = $arrDocSingle;\r\n\t\t//Lay gia tri tim kiem tren form\r\n\t\t\t$sfullTextSearch \t= $this->_request->getParam('txtfullTextSearch','');\r\n\t\t\t$iYear\t \t\t\t= $this->_request->getParam('year','');\r\n\t\t\t$iCurrentPage\t\t= $this->_request->getParam('hdn_current_page',0);\t\r\n\t\t\tif ($iCurrentPage <= 1){\r\n\t\t\t\t$iCurrentPage = 1;\r\n\t\t\t}\r\n\t\t\t$iNumRowOnPage = $this->_request->getParam('cbo_nuber_record_page',0);\r\n\t\t\tif ($iNumRowOnPage == 0)\r\n\t\t\t\t$iNumRowOnPage = 15;\r\n\t\t\t$arrParaSet = array(\"trangHienThoi\"=>$iCurrentPage, \"soBanGhiTrenTrang\"=>$iNumRowOnPage,\"chuoiTimKiem\"=>$sfullTextSearch,\"Nam\"=>$iYear);\r\n\t\t\t$_SESSION['seArrParameter'] = $arrParaSet;\t\r\n\t\t\r\n\t}", "function questionnaire_get_view_actions() {\n return array('view', 'view all');\n}", "public function actionView($id)\n {\n //if(Yii::$app->user->identity->role == 4) {\n return $this->render('view', [\n 'model' => $this->findModel($id),\n ]);\n //}\n }", "public function view($id=0)\n\t{\t\n\t\tset_data($this->Users_model->getUserById($id));\n\t\t$data['title'] = 'Admin Detail : TDMA';\n\t\t$data['view'] = 'company/users/users_view';\n\t\t$this->load->view('company/layout', $data);\n\t}", "public function actionView($id)\n\t{\n $jobDetails = Yii::app()->db->createCommand()\n ->select('s.JOB_ID AS job_id,\n s.sf_username AS sf_username,\n s.job_name AS job_name,\n s.job_type AS job_type,\n s.job_status AS job_status,\n l.STATUS AS job_status_2,\n l.REPLAYDATE AS job_start,\n l.ENDDATE AS job_end,\n l.LOG_FIELD AS job_log')\n ->from('job_summary s')\n ->join('job_log l', 's.JOB_ID = l.ID_JOB')\n ->where(array('and','s.JOB_ID = '.$id)) \n ->queryRow();\n \n $transDetails = Yii::app()->db->createCommand()\n ->select('trans_summary.JOB_ID AS job_id,\n trans_summary.ID_BATCH AS trans_id,\n trans_summary.trans_name,\n trans_summary.sf_username,\n trans_summary.source,\n trans_summary.target,\n trans_log.STATUS,\n trans_log.LINES_INPUT,\n trans_log.LINES_OUTPUT,\n trans_log.LINES_REJECTED,\n trans_log.REPLAYDATE AS STARTDATE,\n trans_log.ENDDATE,\n trans_log.LOG_FIELD')\n ->from('trans_summary trans_summary')\n ->join('trans_log trans_log', 'trans_summary.ID_BATCH = trans_log.ID_BATCH')\n ->where(array('and','trans_summary.JOB_ID = '.$id))\n ->order('trans_log.REPLAYDATE ASC')\n ->queryAll();\n \n \n $this->render('view',array(\n\t\t\t'jobDetails'=>$jobDetails,\n 'transDetails'=>$transDetails,\n\t\t));\n\t}", "public function actionView($id) {\n // SELECT * FROM `order` WHERE `customer_id` = 123\n // $orders - это массив объектов Order\n // if (empty($vacation)) throw new \\yii\\web\\HttpException(404, 'К сожалению такой вакансии не найдено.');\n\n $parent_page = Skills::findOne($id);\n $cases = Cases::find()->where(['skillid'=>$id])->andWhere(['use'=>'1'])->all();\n\n// $cases = $parent_page->cases;\n\n return $this->render('view', compact('cases', 'parent_page'));\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 view($id)\n\t{\n\t\t$this->is_allowed('amuco_credit_insurance_view');\n\n\t\t$this->data['amuco_credit_insurance'] = $this->model_amuco_credit_insurance->join_avaiable()->filter_avaiable()->find($id);\n\n\t\t$this->template->title('Amuco Credit Insurance Detail');\n\t\t$this->render('backend/standart/administrator/amuco_credit_insurance/amuco_credit_insurance_view', $this->data);\n\t}", "public function show($tname)\n {\n // $view = Auth::user()->id ;\n \n \n }", "public function actionView($id) {\r\n\t\treturn $this->render ( 'view', [ \r\n\t\t\t\t'model' => $this->findModel ( $id ) \r\n\t\t] );\r\n\t}" ]
[ "0.651425", "0.64819115", "0.64819115", "0.63897204", "0.6389075", "0.6379945", "0.6315924", "0.6311764", "0.6282817", "0.6218573", "0.61994886", "0.6194985", "0.61815697", "0.61741424", "0.61729044", "0.6131478", "0.6124524", "0.61228323", "0.61208165", "0.611781", "0.61053354", "0.60921675", "0.60897946", "0.608721", "0.60778207", "0.602439", "0.6015653", "0.6014485", "0.60100925", "0.6008751", "0.60069734", "0.60069734", "0.5993034", "0.59839", "0.5980418", "0.59789616", "0.5975887", "0.59613496", "0.5953206", "0.5953206", "0.5953206", "0.59531534", "0.59471875", "0.5919829", "0.5919411", "0.59142655", "0.5904797", "0.5894767", "0.5887069", "0.5881485", "0.58768046", "0.5875124", "0.5860457", "0.58566964", "0.58553", "0.5853245", "0.58522856", "0.58436924", "0.5838763", "0.58365303", "0.5830384", "0.5826318", "0.58215916", "0.5821004", "0.5821004", "0.58205706", "0.581016", "0.58078855", "0.5800475", "0.5798012", "0.5793945", "0.5793214", "0.5786482", "0.57853764", "0.57822394", "0.57761604", "0.5775623", "0.57752156", "0.57744056", "0.57698137", "0.57692116", "0.5769107", "0.576469", "0.5764549", "0.57624066", "0.5761687", "0.5760256", "0.57535195", "0.5749835", "0.5747703", "0.5746713", "0.5745759", "0.5743488", "0.5743464", "0.574182", "0.5737751", "0.57351166", "0.5733951", "0.57332265", "0.5726989" ]
0.59048975
46
actionid: viewbywr2 actiondesc: Display detail view of izin for Vice Rector 2
public function actionViewByWr2($id){ return $this->render('viewByWr2',[ 'model' => $this->findModel($id), ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function viewAction(){\r\n\t\t//$iUnitId = Sys_Publib_Library::_getItemAttrById($_SESSION['arr_all_staff'],$_SESSION['staff_id'],'unit_id');\r\n\t\t//Lay ID phong ban cua NSD dang nhap hien thoi\r\n\t\t$pUrl = $_SERVER['REQUEST_URI'];\r\n\t\t$objFunction =\tnew\tSys_Function_DocFunctions()\t;\r\n\t\t$objFilter = new Zend_Filter();\t\t\t\r\n\t\t// Tieu de man hinh danh sach\r\n\t\t$this->view->docInfo \t\t= \"THÔNG TIN VĂN BẢN\";\r\n\t\t$sDocumentId = $this->_request->getParam('hdn_object_id','');\r\n\t\t$sType\t\t = $this->_request->getParam('hdn_type','');\r\n\t\t//Lay cac hang so dung chung\r\n\t\t$arrConst = Sys_Init_Config::_setProjectPublicConst();\r\n\t\t$this->view->arrConst = $arrConst;\r\n\t\t// Tao doi tuong Zend_Filter\r\n\t\t$objFilter = new Zend_Filter();\r\n\t\t$ojbSysLib = new Sys_Library();\r\n\t\t$objFullTextSearch = new fulltextsearch_modFulltextsearch();\r\n\t\t//Lay thong tin trong danh muc\r\n\t\t$arrDocSingle = $objFullTextSearch->DocFullTextSearchDocGetSingle($sDocumentId, $sType);\t\t\t\r\n\t\t$this->view->arrDocSingle = $arrDocSingle;\r\n\t\t//Lay gia tri tim kiem tren form\r\n\t\t\t$sfullTextSearch \t= $this->_request->getParam('txtfullTextSearch','');\r\n\t\t\t$iYear\t \t\t\t= $this->_request->getParam('year','');\r\n\t\t\t$iCurrentPage\t\t= $this->_request->getParam('hdn_current_page',0);\t\r\n\t\t\tif ($iCurrentPage <= 1){\r\n\t\t\t\t$iCurrentPage = 1;\r\n\t\t\t}\r\n\t\t\t$iNumRowOnPage = $this->_request->getParam('cbo_nuber_record_page',0);\r\n\t\t\tif ($iNumRowOnPage == 0)\r\n\t\t\t\t$iNumRowOnPage = 15;\r\n\t\t\t$arrParaSet = array(\"trangHienThoi\"=>$iCurrentPage, \"soBanGhiTrenTrang\"=>$iNumRowOnPage,\"chuoiTimKiem\"=>$sfullTextSearch,\"Nam\"=>$iYear);\r\n\t\t\t$_SESSION['seArrParameter'] = $arrParaSet;\t\r\n\t\t\r\n\t}", "public function landShowingDetailAction(){\n\n\t\t\t\t$params = $this->getRequest()->getParams(); \n\t\t\t\t$db = $this->db;\n\t\t\t\t$secretkey = $this->secretkey;\n\n\t\t\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\";\n\t\t\t\t$farmer_code\t= isset($params['farmer_code'])?$params['farmer_code']:\"\";\n\t\t\t\t$land_id\t= isset($params['land_id'])?$params['land_id']:\"\";\n\t\t\t\t$mou_type_id\t= isset($params['mou_type_id'])?$params['mou_type_id']:\"\";\n\t\t\t\t$variety_id\t= isset($params['variety_id'])?$params['variety_id']:\"\";\n\t\t\t\t$category_id\t= isset($params['category_id'])?$params['category_id']:\"\";\n\t\t\t\t$lot_no\t= isset($params['lot_no'])?$params['lot_no']:\"\";\n\t\t\t\t$sowing_date\t= isset($params['sowing_date'])?$params['sowing_date']:\"\";\n\t\t\t\t$tcw_of_seed\t= isset($params['tcw_of_seed'])?$params['tcw_of_seed']:\"\";\n\t\t\t\t$sowing_depth\t= isset($params['sowing_depth'])?$params['sowing_depth']:\"\";\n //$sowing_depth_unit_id\t= isset($params['sowing_depth_unit_id'])?$params['sowing_depth_unit_id']:\"\";\n\t\t\t\t$sink_date_time\t= isset($params['sink_date_time'])?$params['sink_date_time']:\"\";\n\n\n\t\t\t\t$seed_rate_kg_per_acre\t= isset($params['seed_rate_kg_per_acre'])?$params['seed_rate_kg_per_acre']:\"\";\n\t\t\t\t$seed_rate_per_m2\t= isset($params['seed_rate_per_m2'])?$params['seed_rate_per_m2']:\"\";\n\t\t\t\t$sowing_type_id\t= isset($params['sowing_type_id'])?$params['sowing_type_id']:\"\";\n\t\t\t\t$sowing_moisture_source\t= isset($params['sowing_moisture_source'])?$params['sowing_moisture_source']:\"\";\n\t\t\t\t$row_to_row_diff\t= isset($params['row_to_row_diff'])?$params['row_to_row_diff']:\"\";\n // $row_to_row_diff_unit_id\t= isset($params['row_to_row_diff_unit_id'])?$params['row_to_row_diff_unit_id']:\"\";\n\n\t\t\t\t$error_code = 1;\n\t\t\t\t$succes = FALSE;\n\t\t\t\ttry{\n\t\t\t\t\t$db->beginTransaction();\n\t\t\t\t\tif($secretkey != $appkey){\n\t\t\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t\t\t}\t\n\t\t\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$user = new Application_Model_Users();\n\t\t\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t\t\t} \n\t\t\t\t\tif(!empty($alldata['DeviceID'])){\t\t\t\n\t\t\t\t\t\tif($alldata['DeviceID'] != $device_id){\n\t\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac'){\n\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t\t\t}\t\n\n\t\t\t\t\tif($alldata['App_Access_Status'] == 2){\n\t\t\t\t\t\t$error_code = 2;\n\t\t\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$farmerMaster = new Application_Model_Farmermasters();\n\t\t\t\t\t$allFarmerData = $farmerMaster->getFarmerDetailsByFarmerCode($farmer_code); \t\n\t\t\t\t\t$farmerID = $allFarmerData['id'];\n\t\t\t\t\t$farmerCode = $allFarmerData['FarmerCode'];\n\n\n\t\t\t\t\t$land_showing = array(); \n\t\t\t\t\t$land_showing['land_id'] = $land_id;\n\t\t\t\t\t$land_showing['mou_type_id'] = $mou_type_id;\n\t\t\t\t\t$land_showing['variety_id'] = $variety_id;\n\t\t\t\t\t$land_showing['category_id'] = $category_id;\n\t\t\t\t\t$land_showing['lot_no'] = $lot_no;\n\t\t\t\t\t$land_showing['tcw_of_seed'] = $tcw_of_seed;\n\t\t\t\t\t$land_showing['sowing_depth'] = $sowing_depth;\n\t\t\t\t\t$land_showing['sowing_date'] = $sowing_date;\n // $land_showing['sowing_depth_unit_id'] = $sowing_depth_unit_id;\n\t\t\t\t\t$land_showing['seed_rate_kg_per_acre'] = $seed_rate_kg_per_acre;\n\t\t\t\t\t$land_showing['seed_rate_per_m2'] = $seed_rate_per_m2;\n\t\t\t\t\t$land_showing['sowing_type_id'] = $sowing_type_id;\n\t\t\t\t\t$land_showing['sowing_moisture_source'] = $sowing_moisture_source;\n\t\t\t\t\t$land_showing['row_to_row_diff'] = $row_to_row_diff;\n // $land_showing['row_to_row_diff_unit_id'] = $row_to_row_diff_unit_id;\n\t\t\t\t\t$land_showing['farmer_code'] = $farmer_code;\n\t\t\t\t\t$land_showing['farmer_id'] = $farmerID;\n\t\t\t\t\t$land_showing['fe_code'] = $LoginID;\n\t\t\t\t\t$land_showing['sink_date_time'] = $sink_date_time;\n\t\t\t\t\t$land_showing['created'] = $this->currdate; \n\t\t\t\t\t$db->insert('logi_land_showing', $land_showing);\n\n\t\t\t\t\t$landdetailId = $db->lastInsertId();\n\n\t\t\t\t\t$db->commit();\n\t\t\t\t\t$succes = TRUE;\t \n\t\t\t\t}\n\n\t\t\t\tcatch(Exception $e){\n //Rollback transaction\n\t\t\t\t\t$db->rollBack();\n\t\t\t\t\t$error= $e->getMessage();\n\t\t\t\t}\n\n\t\t\t\tif($succes == TRUE ){\n\t\t\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Land Showing Detail Inserted successfully.', 'showing_id'=>$landdetailId));\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error));\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t}", "public function actionIndexByWr2(){\n $searchModel = new PermohonanIzinSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('indexByWr2',[\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "function showApprentice() {\n\t\t\t\t\t$apprentice = Apprentice::find_by_name(params(0));\n\t\t\t\t\t\n\t\t\t\t\t$editForm = new h2o('views/editApprentice.html');\n\t\t\t\t\techo $editForm->render(compact('apprentice'));\n\t\t\t\t}", "public function viewAction() {\n\t\t$role = new Role_Model_Role();\n\t\t$this->view->record = $role->findById($this->getRequest()->getParam('id'));\n\t}", "public function show_detail($i_id=0)\r\n {}", "public function show_detail($i_id=0)\r\n {}", "public function detailAction(){\n\t\tinclude_once(System_Properties::ADMIN_MOD_PATH.'/models/bike/db_selBikeAd.php');\n\t\tinclude_once(System_Properties::ADMIN_MOD_PATH.'/models/bike/db_updBikeAds.php');\n\t\tinclude_once(System_Properties::ADMIN_MOD_PATH.'/models/bike/db_selBike2Ext.php');\n\t\tinclude_once(System_Properties::ADMIN_MOD_PATH.'/models/default/db_selVPic.php');\n\t\t$req = $this -> getRequest();\n\t\t$lang = $this -> lang;\n\t\t$p = $req -> getParams();\n\t\t\n\t\tif (isset($p['id'])){\t\t\t\n\t\t\t$bikeDetails = db_selBikeAd(array('bikeID' => $p['id']));\n\t\t\tif (($bikeDetails != false) && is_array($bikeDetails) && (count($bikeDetails) == 1)){\t\t\t\t\n\t\t\t\t$bikeDetails = $bikeDetails[0];\n\t\t\t\t\n\t\t\t\tif (is_array($this -> adminNS -> bikeAds) && isset($this -> adminNS -> bikeAds['bikeID'])\n\t\t\t\t\t&& ($this -> adminNS -> bikeAds['bikeID'] != $bikeDetails['bikeID'])){\n\t\t\t\t\t$this -> resetnsAction();\n\t\t\t\t}\n\t\t\t\t//Safe changes\n\t\t\t\tif (isset($p['bikeSafe'])){\n\t\t\t\t\t$p['bikeID'] = $bikeDetails['bikeID'];\n\t\t\t\t\t$p['bikeBrandID'] = $p['bikeBrand'];\n\t\t\t\t\t$p = $this -> updatebikeAction($p);\n\t\t\t\t\tif (isset($p['error'])){\n\t\t\t\t\t\t$this -> view -> error = $p['error'];\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$bikeDetails2 = db_selBikeAd(array('bikeID' => $p['id']));\n\t\t\t\t\t\tif (($bikeDetails2 != false) && is_array($bikeDetails2) && (count($bikeDetails2) == 1)){\n\t\t\t\t\t\t\t$bikeDetails = $bikeDetails2[0];\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this -> view -> info = $lang['AINFO_4'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Delete advertisement\n\t\t\t\telse if (isset($p['bikeDel'])){\n\t\t\t\t\t$bikeAd = db_updBikeAds(array(System_Properties::SQL_WHERE => array('bikeID' => $bikeDetails['bikeID'])\n\t\t\t\t\t\t\t\t\t\t\t\t, System_Properties::SQL_SET => array('erased' => 1)\n\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\tif ($bikeAd != false){\n\t\t\t\t\t\t$this -> _forward('index');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//Load all bike extra\n\t\t\t\t$this -> loadBikeExt();\n\t\t\t\t\n\t\t\t\t//Load bike extra\n\t\t\t\t$bikeExt = db_selBike2Ext(array('bikeID' => $bikeDetails['bikeID']));\n\t\t\t\tif (($bikeExt != false) && is_array($bikeExt) && (count($bikeExt) > 0)){\n\t\t\t\t\t$bikeDetails['bikeExt'] = array();\n\t\t\t\t\tforeach ($bikeExt as $key => $val){\n\t\t\t\t\t\tarray_push($bikeDetails['bikeExt'], $val['vextID']);\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Fetch all bike pics\n\t\t\t\tif (isset($this -> adminNS -> bikePhoto) && is_array($this -> adminNS -> bikePhoto)){\n\t\t\t\t\t$bikePhoto = $this -> adminNS -> bikePhoto;\n\t\t\t\t}\t\n\t\t\t\telse{\n\t\t\t\t\t$bikePhoto = db_selVPic(array(\t'vType' => System_Properties::BIKE_ABRV,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'vID' => $bikeDetails['bikeID']));\n\t\t\t\t\t$bikeDetails['bikePhoto'] = array();\n\t\t\t\t\tforeach($bikePhoto as $key => $kVal){\n\t\t\t\t\t\t$bikeDetails['bikePhoto'][$kVal['vPicID']] = $kVal;\n\t\t\t\t\t}\n\t\t\t\t\t$bikePhoto = $bikeDetails['bikePhoto'];\n\t\t\t\t}\n\t\t\t\t$bikeDetails['bikePhoto'] = $bikePhoto;\n\t\t\t\t\n\t\t\t\t//Load brands and models\t\t\t\t\n\t\t\t\t$this -> loadBikeModelsBrands(array('bikeBrand' => $bikeDetails['bikeBrandID']));\n\t\t\t\t//Load all possible bike extra\n\t\t\t\t$this -> loadBikeExt();\n\t\t\t\t$this -> loadBikeCat();\n\t\t\t\t$this -> view -> bike = $bikeDetails;\n\t\t\t\t\n\t\t\t\t$this -> adminNS -> bikeAds = $bikeDetails;\n\t\t\t\t$this -> adminNS -> bikePhoto = $bikePhoto;\n\t\t\t}else{\n\t\t\t\t$this -> indexAction();\n\t\t\t\t$this -> render('index');\n\t\t\t}\n\t\t}else{\n\t\t\t$this -> indexAction();\n\t\t\t$this -> render('index');\n\t\t}\n\t}", "function turnitintooltwo_get_view_actions() {\n return array('view');\n}", "public function actionView()\n {\n \n }", "public function actionsurveydetails()\n {\n $model = new Troubleticket;\n $this->LoginCheck();\n $module = \"HelpDesk\";\n $urlquerystring = $_SERVER['QUERY_STRING'];\n $paraArr = explode(\"/\", $urlquerystring);\n $ticketId = $paraArr['2'];\n $storedata = $model->findById($module, $ticketId);\n\n $picklist_damagestatus = $model->getpickList('damagestatus');\n $this->render('surveydetails', array('model' => $model,\n 'result' => $storedata,\n 'damagestatus' => $picklist_damagestatus)\n );\n }", "function rptIndividualClientAction(){\r\n// \t$this->view->staff_list = $db->getAllIndividual();\r\n// \t$key = new Application_Model_DbTable_DbKeycode();\r\n// \t$this->view->data=$key->getKeyCodeMiniInv(TRUE);\r\n }", "public function viewAction() {\n // neu chua khoi tao\n // neu roi add them 1 phan tu vao sesion voi id va uenc da duoc tao\n $this->layout('layout/bags');\n $getuser = $this->forward()->dispatch('Admin\\Controller\\Index', array(\n 'action' => 'getuser'\n ));\n // var_dump($getuser);\n $this->layout()->getuser = $getuser;\n\n $id = $this->params()->fromRoute('id');\n $uenc = $this->params()->fromRoute('uenc');\n\n echo \"id :\";\n var_dump($id);\n echo \"</br>\";\n echo \"uenc :\";\n var_dump($uenc);\n die(\"view is update\");\n }", "public function actionView($id){\n $userid=Yii::$app->user->identity->id;\n //$model = $this->findModel($id);\n $documents=MgfAttachements::find()->where(['organisation_id'=>$id])->all();\n $concepts=MgfConceptNote::find()->where(['organisation_id'=>$id])->all();\n $screening=MgfScreening::find()->where(['organisation_id'=>$id])->all(); \n $contacts=MgfContact::find()->joinWith('position')->where(['organisation_id'=>$id])->all(); \n $applicant=MgfApplicant::find()->where(['user_id'=>$userid])->one(); \n //$id=getOrganisationID(); \n return $this->render('view', ['model' => $this->findModel($id),'documents'=>$documents,'criteria'=>$screening,'concepts'=>$concepts,'contacts'=>$contacts,'applicant'=>$applicant]);\n }", "public function detail()\n {\n $vereinRepository = new VereinRepository();\n\n $view = new View('verein_detail');\n $view->heading = \"\";\n $view->verein = $vereinRepository->readById($_GET['id']);\n $view->title = $view->verein->name;\n $view->display();\n }", "public function landIrrigationDetailAction(){\n\n\t\t\t\t$params = $this->getRequest()->getParams(); \n\t\t\t\t$db = $this->db;\n\t\t\t\t$secretkey = $this->secretkey; \n\t\t\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\";\n\t\t\t\t$farmer_code\t= isset($params['farmer_code'])?$params['farmer_code']:\"\";\n\t\t\t\t$land_id\t= isset($params['land_id'])?$params['land_id']:\"\";\n\t\t\t\t$irri_type_id \t= isset($params['irri_type_id'])?$params['irri_type_id']:\"\";\n\t\t\t\t$irri_no_id\t= isset($params['irri_no_id'])?$params['irri_no_id']:\"\";\n\t\t\t\t$stage_id\t= isset($params['stage_id'])?$params['stage_id']:\"\";\n\t\t\t\t$irri_date\t= isset($params['irri_date'])?$params['irri_date']:\"\";\n\t\t\t\t$days_after_sowing\t= isset($params['days_after_sowing'])?$params['days_after_sowing']:\"\"; \n\t\t\t\t$sink_date_time\t= isset($params['sink_date_time'])?$params['sink_date_time']:\"\";\n\n\n\t\t\t\t$error_code = 1;\n\t\t\t\t$succes = FALSE;\n\t\t\t\ttry{\n\t\t\t\t\t$db->beginTransaction();\n\t\t\t\t\tif($secretkey != $appkey){\n\t\t\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t\t\t}\t\n\t\t\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$user = new Application_Model_Users();\n\t\t\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t\t\t} \n\t\t\t\t\tif(!empty($alldata['DeviceID'])){\t\t\t\n\t\t\t\t\t\tif($alldata['DeviceID'] != $device_id){\n\t\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac'){\n\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t\t\t}\t\n\n\t\t\t\t\tif($alldata['App_Access_Status'] == 2){\n\t\t\t\t\t\t$error_code = 2;\n\t\t\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$farmerMaster = new Application_Model_Farmermasters();\n\t\t\t\t\t$allFarmerData = $farmerMaster->getFarmerDetailsByFarmerCode($farmer_code); \t\n\t\t\t\t\t$farmerID = $allFarmerData['id'];\n\t\t\t\t\t$farmerCode = $allFarmerData['FarmerCode'];\n\n\n\t\t\t\t\t$land_irrigation = array(); \n\t\t\t\t\t$land_irrigation['land_id'] = $land_id;\n\t\t\t\t\t$land_irrigation['irri_type_id'] = $irri_type_id;\n\t\t\t\t\t$land_irrigation['irri_no_id'] = $irri_no_id;\n\t\t\t\t\t$land_irrigation['stage_id'] = $stage_id;\n\t\t\t\t\t$land_irrigation['irri_date'] = $irri_date;\n\t\t\t\t\t$land_irrigation['days_after_sowing'] = $days_after_sowing;\n\t\t\t\t\t$land_irrigation['farmer_code'] = $farmer_code;\n\t\t\t\t\t$land_irrigation['farmer_id'] = $farmerID;\n\t\t\t\t\t$land_irrigation['fe_code'] = $LoginID;\n\t\t\t\t\t$land_irrigation['sink_date_time'] = $sink_date_time;\n\t\t\t\t\t$land_irrigation['created'] = $this->currdate; \n\t\t\t\t\t$db->insert('logi_land_irrigation', $land_irrigation);\n\n\t\t\t\t\t$landdetailId = $db->lastInsertId();\n\n\t\t\t\t\t$db->commit();\n\t\t\t\t\t$succes = TRUE;\t \n\t\t\t\t}\n\n\t\t\t\tcatch(Exception $e){\n //Rollback transaction\n\t\t\t\t\t$db->rollBack();\n\t\t\t\t\t$error= $e->getMessage();\n\t\t\t\t}\n\n\t\t\t\tif($succes == TRUE ){\n\t\t\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Land irrigation Detail Inserted successfully.', 'land_irrigation_id'=>$landdetailId));\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error));\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t}", "public function view($id)\n\t{\n\t\n\t\t$this->is_allowed('amuco_details_request_office_view');\n if($this->input->get('popup')){\n\t\t\t$this->data['current_page'] = 'Modal';\n\t\t}else{\n\t\t\t$this->data['current_page'] = 'View';\n\t\t}\n\t\t$this->data['amuco_details_request_office'] = $this->model_amuco_details_request_office->join_avaiable()->filter_avaiable()->find($id);\n // var_dump($this->data['amuco_details_request_office']);\n\t\t$this->template->title('Amuco Details Request Office Detail');\n\t\t$this->render('backend/standart/administrator/amuco_details_request_office/amuco_details_request_office_view', $this->data);\n\t}", "public function metaDetailAction() {\n\n //ONLY LOGGED IN USER CAN ADD OVERVIEW\n if (!$this->_helper->requireUser()->isValid())\n return;\n\n //GET VIEWER\n $viewer = Engine_Api::_()->user()->getViewer();\n\n //GET LISTING ID AND OBJECT\n $listing_id = $this->_getParam('listing_id');\n\n \n $this->view->sitereview = $sitereview = Engine_Api::_()->getItem('sitereview_listing', $listing_id);\n Engine_Api::_()->core()->setSubject($sitereview); \n //GET LISTING TYPE ID\n $listingtype_id = $sitereview->listingtype_id;\n\n if(!Engine_API::_()->seaocore()->checkSitemobileMode('fullsite-mode')) {\n $this->_helper->content\n ->setContentName(\"sitereview_dashboard_metadetails_listtype_$listingtype_id\")\n //->setNoRender()\n ->setEnabled();\n \n }\n \n Engine_Api::_()->sitereview()->setListingTypeInRegistry($listingtype_id);\n $listingType = Zend_Registry::get('listingtypeArray' . $listingtype_id);\n\n if (empty($listingType->metakeyword)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n if (!$sitereview->authorization()->isAllowed($viewer, 'edit_listtype_' . $listingtype_id)) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n if (!Engine_Api::_()->authorization()->getPermission($viewer->level_id, 'sitereview_listing', \"metakeyword_listtype_$listingtype_id\")) {\n return $this->_forward('requireauth', 'error', 'core');\n }\n\n //SELECTED TAB\n $this->view->TabActive = \"metadetails\";\n\n //SET FORM\n $this->view->form = $form = new Sitereview_Form_Metainfo();\n\n $tableOtherinfo = Engine_Api::_()->getDbTable('otherinfo', 'sitereview');\n\n //POPULATE FORM\n $value['keywords'] = $tableOtherinfo->getColumnValue($listing_id, 'keywords');\n\n $form->populate($value);\n\n //CHECK FORM VALIDATION\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\n //GET FORM VALUES\n $values = $form->getValues();\n $tableOtherinfo->update(array('keywords' => $values['keywords']), array('listing_id = ?' => $listing_id));\n\n //SHOW SUCCESS MESSAGE\n $form->addNotice(Zend_Registry::get('Zend_Translate')->_('Your changes have been saved successfully.'));\n }\n }", "public function actionView() {}", "public function actionView() {}", "protected function viewAction()\n {\n }", "public function actionView($id, $ime)\n {\n if(Yii::$app->user->can('ucitelj')){\n $ocene = Ocena::find()\n ->select('*')\n ->join('JOIN','predmet','ocena.id_predmet = predmet.id_predmet')\n ->join('JOIN','ucenik','ocena.id_ucenik = ucenik.id_ucenik')\n ->where(['ucenik.id_ucenik' => $id])\n ->all();\n return $this->render('view', [\n 'ocene' => $ocene,\n 'ime' => $ime\n ]);\n } else if(Yii::$app->user->isGuest){\n $this->redirect(['../site/login']);\n } else {\n throw new ForbiddenHttpException('Nemate pravo pristupa ovoj stranici');\n }\n }", "public function imageViewerDetailAction() {\r\n $this->view->photo_id = $photo_id = $this->getRequest()->getParam('photo_id', '0');\r\n $this->view->chanel_id = $chanel_id = $this->getRequest()->getParam('chanel_id', '0');\r\n $this->view->viewer = $viewer = Engine_Api::_()->user()->getViewer();\r\n\t\t$this->view->params = array();\r\n // initialize extra next previous params\r\n $extraParamsNext = $extraParamsPrevious = array();\r\n if ($this->getRequest()->getParam('limit') != '' && !is_null($this->getRequest()->getParam('limit'))) {\r\n $extraParamsNext['limit'] = $this->getRequest()->getParam('limit') + 1;\r\n $extraParamsPrevious['limit'] = $this->getRequest()->getParam('limit') - 1;\r\n }\r\n $this->view->extraParamsNext = $extraParamsNext;\r\n $this->view->extraParamsPrevious = $extraParamsPrevious;\r\n $this->view->photo = $photo = Engine_Api::_()->getItem('sesvideo_chanelphoto', $photo_id);\r\n $this->view->chanel = $chanel = Engine_Api::_()->getItem('sesvideo_chanel', $chanel_id);\r\n if (!$photo->authorization()->isAllowed($viewer, 'view')) {\r\n $imagePrivateURL = Engine_Api::_()->getApi('settings', 'core')->getSetting('sesalbum.private.photo', 1);\r\n if (!is_file($imagePrivateURL))\r\n $imagePrivateURL = 'application/modules/Sesalbum/externals/images/private-photo.jpg';\r\n $this->view->imagePrivateURL = $imagePrivateURL;\r\n }\r\n $this->view->canComment = $chanel->authorization()->isAllowed($viewer, 'comment');\r\n // send extra params to view for extra URL parameters\r\n // get next photo URL\r\n $this->view->nextPhoto = Engine_Api::_()->sesvideo()->nextPhoto($photo, $extraParamsNext);\r\n // get previous photo URL\r\n $this->view->previousPhoto = Engine_Api::_()->sesvideo()->previousPhoto($photo, $extraParamsPrevious);\r\n if (!$viewer || !$viewer->getIdentity() || $chanel->owner_id != $viewer->getIdentity()) {\r\n $photo->view_count = new Zend_Db_Expr('view_count + 1');\r\n $photo->save();\r\n }\r\n $this->view->canEdit = $canEdit = $photo->authorization()->isAllowed($viewer, 'edit');\r\n $this->view->canDelete = $canDelete = $photo->authorization()->isAllowed($viewer, 'delete');\r\n\r\n $getmodule = Engine_Api::_()->getDbTable('modules', 'core')->getModule('core');\r\n if (!empty($getmodule->version) && version_compare($getmodule->version, '4.8.6') < 0)\r\n $this->view->toArray = true;\r\n else\r\n $this->view->toArray = false;\r\n if ($viewer->getIdentity() == 0)\r\n $level = Engine_Api::_()->getDbtable('levels', 'authorization')->getPublicLevel()->level_id;\r\n else\r\n $level = $viewer;\r\n $type = Engine_Api::_()->authorization()->getPermission($level, 'album', 'imageviewer');\r\n if ($type == 0)\r\n $this->renderScript('chanel/image-viewer-detail-basic.tpl');\r\n else\r\n $this->renderScript('chanel/image-viewer-detail-advance.tpl');\r\n }", "public function view($rfp_id){\n\n $data['title'] = 'Admin View Request';\n $data['heading'] = 'View Request Page'; \n $data['rfp_id'] = decode($rfp_id);\n\n $data['record']=$this->Rfp_model->get_result('rfp',['id' => decode($rfp_id)],'1');\n // pr($data['record'],1);\n $data['subview'] = 'admin/rfp/view';\n $this->load->view('admin/layouts/layout_main', $data);\n }", "public function actionView($id)\n {\n $model = $this->findModel($id);\n\n $relatorio = $model->relatorioItems;\n \n $query = new \\yii\\db\\Query();\n\n $query = \\app\\models\\Relatorio_item::find()->where(['relatorio_id' => $id]);\n\n $provider1 = new \\yii\\data\\ActiveDataProvider([\n 'query' => $query,\n ]);\n $query = new \\yii\\db\\Query();\n\n $query = \\app\\models\\Aluno::find()->where(['aluno_id' => $id])->where(['Turma_id' => $id]);\n\n $provider2 = new \\yii\\data\\ActiveDataProvider([\n 'query' => $query,\n ]);\n \n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'provider1' => $provider1,\n 'provider2' => $provider2,\n \n\n ]);\n }", "public function showAction() {\n $model = new Application_Model_Compromisso();\n //busco o id que eu quero ver\n $comp = $model->find($this->_getParam('id'));\n //crio uma view para o id referente;\n $this->view->assign(\"compromisso\", $comp);\n }", "public function viewdetailsAction()\n {\n $productId = $this->_getParam('product_id');\n $product = $this->_model->setId($productId);\n $this->view->product = $product->fetch(); \n \n }", "public function actionView($id)\n { \n return $this->findModel($id);\n \n }", "function tampil_detail(){\n\n\t\t$id_pengiriman\t =\t$this->uri->segment(3);\n\t\t$data['record'] =\t$this->M_pengiriman->detail($id_pengiriman)->result();\n\t\t$data['record2'] =\t$this->M_pengiriman->detail($id_pengiriman)->row_array();\n\t\t$this->template->content->view('Pengiriman/Detail',$data);\n\t\t$this->template->publish();\n\n\t}", "public function overviewAction(){\n\t\t\t\t\t\t$this->redirectToIndex();\n\t\t\t\t\t if($this->_getParam ( 'actions' )==\"overview\"){\n\t\t\t\t\t $idOverview= $this->_getParam ( 'id' );\n\t\t\t\t\t $idUser = $this->_getParam ( 'userid' );\n\t\t\t\t\t\t\t$GetSelectViewCompanys = $this->GetModelOrganize->SelectOverViewEdit( $idOverview,$idUser );\n\t\t\t\t\t $this->view->SelectOnFormEdit = $GetSelectViewCompanys;\n\t\t\t\t\t \n\t\t\t\t\t }\n\t\t\t\t\t\t$id = $this->_getParam ( 'id' );\n $this->view->getIdView = $id;\n \n \n\t\t\t\t\t}", "public function detailAction() {\n\n //GET THE LIST ITEM\n $this->view->listDetail = Engine_Api::_()->getItem('list_listing',(int) $this->_getParam('id'));\n }", "public function actionView($id)\n {\n $model=$this->findModel($id);\n $vehicleid=$model->vehicleid;\n $mods=$this->findModel($id);\n $mods->dept=Gongchu::getDeptNameById($model->dept);\n $mods->use_time=substr($model->use_time,0,-3);\n $mods->v_user=Gongchu::getUserNamesByIds($model->v_user);\n $mods->apply_ren=Gongchu::getUserNamesByIds($model->apply_ren);\n $mods->v_license=Vehicle::findOne($vehicleid)->v_license;\n if($model->dept_audit==0){//审批中 状态 不加审批时间 驳回理由\n $mods->dept_leader=Gongchu::getUserNamesByIds($model->dept_leader).'('.Gongchu::getStatusById($model->dept_audit).')';\n }else{\n $mods->dept_leader=Gongchu::getUserNamesByIds($model->dept_leader).'('.Gongchu::getStatusById($model->dept_audit).') '.$model->dept_reason.' '.substr($model->dept_audit_time,0,-3);\n }\n if($model->dept_audit==2){//如果科室领导驳回,则院领导直接显示名字即可\n $mods->branch_leader=Gongchu::getUserNamesByIds($model->branch_leader);\n }else{\n if($model->branch_audit==0){//审批中 状态 不加审批时间 驳回理由\n $mods->branch_leader=Gongchu::getUserNamesByIds($model->branch_leader).'('.Gongchu::getStatusById($model->branch_audit).')';\n }else{\n $mods->branch_leader=Gongchu::getUserNamesByIds($model->branch_leader).'('.Gongchu::getStatusById($model->branch_audit).') '.$model->branch_reason.' '.substr($model->branch_audit_time,0,-3);\n }\n }\n if($model->dept_leader==0){\n $mods->dept_leader=0;\n }\n return $this->render('view', [\n 'model' => $mods,\n ]);\n }", "public function indexAction2() {\n\t $method = \"w92UxLIRNTl','H8A8xQ9gJ5b','ibHR9NQ0bKL','DiXDJRmPwfh','yJSLjbC9Gnr','vDnxlrIQWUo','krVqq8Vk5Kw\";\n\t $request = $this->getRequest();\n\t \n\t //$title_method = new DashboardCHAI();\n\t //$title_method = $title_method->fetchTitleMethod($method);\n\t \n\t $helper = new Helper2();\n\t $title_date = $helper->fetchTitleDate();\n\t \n\t $this->view->assign('title_date', $title_method[commodity_name].', '. $title_date[month_name].' '. $title_date[year]);\n\t \n\t $cln_data = new DashboardCHAI();\n\t $pfp_data = new DashboardCHAI();\n\t $pfso_data = new DashboardCHAI();\n\t $cs_data = new DashboardCHAI();\n\t \n \n\t // geo selection includes \"--choose--\" or no selection\n \n /* TP:\n * Mind the !isset(...) part \n */\n\t if( ( isset($_POST[\"region_c_id\"] ) && $_POST[\"region_c_id\"][0] == \"\" ) ||\n\t ( isset($_POST[\"district_id\"] ) && $_POST[\"district_id\"][0] == \"\" ) ||\n\t ( isset($_POST[\"province_id\"] ) && $_POST[\"province_id\"][0] == \"\" ) ||\n\t (!isset($_POST[\"region_c_id\"] ) && !isset($_POST[\"district_id\"] ) && !isset($_POST[\"province_id\"] ) ) ){\n\t \n //get national numbers from refresh\n\t $cln_details = $cln_data->fetchDashboardData('national_consumption_by_method');\n\t $pfp_details = $pfp_data->fetchDashboardData('national_percent_facilities_providing');\n\t $pfso_details = $pfso_data->fetchDashboardData('national_percent_facilities_stock_out');\n\t $cs_details = $cs_data->fetchDashboardData('national_coverage_summary');\n\t }\n\t \n\t if(count($cln_details) > 0 && count($pfp_details) > 0 && count($pfso_details) > 0 && isset($cs_details[last_date])) { //got all\n //echo 'inside if stmt'; exit;\n\t $this->view->assign('national_consumption_by_method', $cln_details);\n\t $this->view->assign('national_percent_facilities_providing', $pfp_details);\n\t $this->view->assign('national_percent_facilities_stock_out', $pfso_details);\n\t \n $cs_calc = $this->coverageCalculations($cs_details);\n $this->view->assign('cs_fp_facility_count',$cs_calc['cs_fp_facility_count']);\n\t $this->view->assign('cs_larc_facility_count',$cs_calc['cs_larc_facility_count']);\n\t $this->view->assign('cs_fp_consumption_facility_count',$cs_calc['cs_fp_consumption_facility_count']);\n\t $this->view->assign('cs_larc_consumption_facility_count',$cs_calc['cs_larc_consumption_facility_count']);\n $this->view->assign('cs_fp_stock_out_facility_count',$cs_calc['cs_fp_stock_out_facility_count']);\n $this->view->assign('cs_larc_stock_out_facility_count',$cs_calc['cs_larc_stock_out_facility_count']);\n $this->view->assign('cs_date',$cs_calc['cs_date']);\n\t \n\t } else {\n //echo 'inside else stmt'; exit;\n\t $where = ' 1=1 ';\n\t \n\t if( isset($_POST[\"region_c_id\"]) ){ // CHAINigeria LGA\n //echo 'inside region_c_id stmt'; exit;\n\t $where = $where.' and f.location_id in (';\n\t foreach ($_POST['region_c_id'] as $i => $value){\n\t $geo = explode('_',$value);\n\t $where = $where.$geo[2].', ';\n\t }\n\t $where = $where.') ';\n\t $group = new Zend_Db_Expr('L1_location_name, CNO_external_id');\n\t $useName = 'L1_location_name'; \n\t \n } else if( isset($_POST['district_id']) ){ // CHAINigeria state\n //echo 'inside district_id stmt'; exit;\n\t $where = $where.' and l2.id in (';\n\t foreach ($_POST['district_id'] as $i => $value){\n\t $geo = explode('_',$value);\n\t $where = $where.$geo[1].', ';\n\t }\n\t $where = $where.') ';\n\t $group = new Zend_Db_Expr('L2_location_name, CNO_external_id');\n\t $useName = 'L2_location_name';\n\t \n\t } else if( isset($_POST['province_id']) ){ //province_id is a Trainsmart internal name, represents hightest CHAINigeria level = GPZ\n //echo 'inside province_id stmt'; exit;\n\t $where = $where.' and l2.parent_id in (';\n\t foreach ($_POST['province_id'] as $i => $value){\n\t $geo = explode('_',$value);\n\t $where = $where.$geo[0].', ';\n\t }\n\t $where = $where.') ';\n\t $group = new Zend_Db_Expr('L3_location_name, CNO_external_id');\n\t $useName = 'L3_location_name';\n\t } else { // no geo selection\n //echo 'inside inner else stmt'; exit;\n\t $group = 'CNO_external_id';\n\t $useName = 'C_date';\n\t $location = 'National';\n\t }\n\t \n\t $where = str_replace(', )', ')', $where);\n\t $whereClause = new Zend_Db_Expr($where);\n\t \n\t //$amc_details = $amc_data->fetchAMCDetails($whereClause);\n\t \n\t //file_put_contents('c:\\wamp\\logs\\php_debug.log', 'dash996Action >'.PHP_EOL, FILE_APPEND | LOCK_EX);\tob_start();\n\t //var_dump('amc_details= ', $amc_details, 'END');\n\t //$toss = ob_get_clean(); file_put_contents('c:\\wamp\\logs\\php_debug.log', $toss .PHP_EOL, FILE_APPEND | LOCK_EX);\n\t \n\t // $method is external_id and must be single quoted, likely meant to be int but had to convert table id to external_id\n\t if( \"'$method'\" != '' ) $where = $where . ' and cno.external_id in ( '.\"'$method'\".' )';\n\t \n //echo 'about to call CLNDetails'; exit;\n /* TP:\n * this is for the consumption by method chart\n */\n\t $cln_details = $cln_data->fetchCLNDetails('location', $id, $where, $group, $useName);\n\t \n\t //any FP\n\t //$where = \" 1=1 and cno.external_id in ( 'w92UxLIRNTl', 'H8A8xQ9gJ5b', 'ibHR9NQ0bKL', 'DiXDJRmPwfh', 'yJSLjbC9Gnr', 'vDnxlrIQWUo', 'krVqq8Vk5Kw') and c.consumption > 0 \";\n //$where = \" 1=1 AND c.consumption > 0\";\n\t //$pfp_any_details = $pfp_data->fetchPFPDetails( );\n\t \n\t //larc\n\t //$where = \" 1=1 and cno.external_id in ( 'DiXDJRmPwfh', 'yJSLjbC9Gnr') and c.consumption > 0 \";\n\t //$pfp_larc_details = $pfp_data->fetchPFPDetails( $where,'', '', 'larctrained' );\n \n\t //file_put_contents('c:\\wamp\\logs\\php_debug.log', 'indexAction >'.PHP_EOL, FILE_APPEND | LOCK_EX);\tob_start();\n\t //var_dump('$pfp_any_details= ', $pfp_any_details, 'END');\n\t ////var_dump('$pfp_larc_details= ', $pfp_larc_details, 'END');\n\t //$toss = ob_get_clean(); file_put_contents('c:\\wamp\\logs\\php_debug.log', $toss .PHP_EOL, FILE_APPEND | LOCK_EX);\n\t \n //TP: Percent Facilities Providing FP/LARC\n $pfp_details = $pfp_data->fetchPFPDetails();\n //var_dump($pfp_details); exit;\n \n foreach($pfp_details as $i => $row ){\n\t //$national_percent_facilities_providing[] = array('month' => $row['month'], 'year' => $row['year'], 'fp_percent' => $row['percent'], 'larc_percent' => $pfp_larc_details[$i]['percent'] );\n $national_percent_facilities_providing[] = array('month' => $row['month'], 'year' => $row['year'], 'fp_percent' => $row['fp_percent'], 'larc_percent' => $row['larc_percent'] );\n\t }\n \n// foreach ($national_percent_facilities_providing as $row){\n// echo \"month: \" . $row['month'] . ' ' .\n// \"year: \" . $row['year'] . ' ' .\n// \"fp_percent: \" . $row['fp_percent'] . ' ' .\n// \"larc_percent: \" . $row['larc_percent'] . ' ' .\n// \"percent: \" . $row['percent'] . \"<br/>\";\n// }\n// exit;\n \n \n //TP: STOCK OUTS\n\t //$where = \" 1=1 and (cno.external_id in ( 'DiXDJRmPwfh') and c.stock_out = 'Y') or (cno.external_id in ( 'JyiR2cQ6DZT') and c.consumption = 1) \";\n\t $pfso_details = $pfso_data->fetchPFSODetails( $where );\n\n\t $total = 0;\n\t \n\t \n\t \n\t //file_put_contents('c:\\wamp\\logs\\php_debug.log', 'indexAction >'.PHP_EOL, FILE_APPEND | LOCK_EX);\tob_start();\n\t //var_dump('$pfso_details= ', $pfso_details, 'END');\n\t //var_dump('$method= ', $method, 'END');\n\t //var_dump('$national_percent_facilities_providing= ', $national_percent_facilities_providing, 'END');\n\t //$toss = ob_get_clean(); file_put_contents('c:\\wamp\\logs\\php_debug.log', $toss .PHP_EOL, FILE_APPEND | LOCK_EX);\n\t \n\t foreach($pfso_details as $i => $row ){\n\t $national_percent_facilities_stock_out[] = array('month' => $row['month'], 'year' => $row['year'], 'implant_percent' => $row['implant_percent'], 'seven_days_percent' => $row['seven_days_percent'] );\n\t }\n\t //var_dump($national_percent_facilities_stock_out); exit;\n \n \n\t foreach($cln_details as $i => $row ){\n\t \n\t if ( $location != 'National' ) {\n\t switch($useName){\n\t case 'L1_location_name' :\n\t $location = $row['L1_location_name'];\n\t break;\n\t case 'L2_location_name' :\n\t $location = $row['L2_location_name'];\n\t break;\n\t case 'L3_location_name' :\n\t $location = $row['L3_location_name'];\n\t break;\n\t }\n\t }\n\t \n\t $locationNames = $locationNames ? $locationNames.', '.$location : $locationNames.$location;\n\t \n\t // remove single quotes and explode method\n\t $bad_chars = array(\"'\");\n\t $method = str_replace($bad_chars, \"\", $method);\n\t $methods = array( explode(',', $method) );\n\t \n\t // lookup commodity_names\n\t $title_method = new DashboardCHAI(); \n\t $CNO[] = array ($title_method->fetchTitleMethod($methods[0][0]));\n $CNO[] = array ($title_method->fetchTitleMethod($methods[0][1]));\n $CNO[] = array ($title_method->fetchTitleMethod($methods[0][2]));\n $CNO[] = array ($title_method->fetchTitleMethod($methods[0][3]));\n $CNO[] = array ($title_method->fetchTitleMethod($methods[0][4]));\n $CNO[] = array ($title_method->fetchTitleMethod($methods[0][5]));\n $CNO[] = array ($title_method->fetchTitleMethod($methods[0][6]));\n\t \n $national_consumption_by_method[] =array('method' => $CNO[0][0]['commodity_name'], 'consumption' => $row['consumption1'] );\n $national_consumption_by_method[] =array('method' => $CNO[1][0]['commodity_name'], 'consumption' => $row['consumption2'] );\n $national_consumption_by_method[] =array('method' => $CNO[2][0]['commodity_name'], 'consumption' => $row['consumption3'] );\n $national_consumption_by_method[] =array('method' => $CNO[3][0]['commodity_name'], 'consumption' => $row['consumption4'] );\n $national_consumption_by_method[] =array('method' => $CNO[4][0]['commodity_name'], 'consumption' => $row['consumption5'] );\n $national_consumption_by_method[] =array('method' => $CNO[5][0]['commodity_name'], 'consumption' => $row['consumption6'] );\n $national_consumption_by_method[] =array('method' => $CNO[6][0]['commodity_name'], 'consumption' => $row['consumption7'] );\n\n //file_put_contents('c:\\wamp\\logs\\php_debug.log', 'dash996Action >'.PHP_EOL, FILE_APPEND | LOCK_EX);\tob_start();\n //var_dump('$methods= ', $methods, 'END');\n //var_dump('$CNO= ', $CNO, 'END');\n //var_dump('$consumption_by_method= ', $consumption_by_method, 'END');\n //$toss = ob_get_clean(); file_put_contents('c:\\wamp\\logs\\php_debug.log', $toss .PHP_EOL, FILE_APPEND | LOCK_EX);\n \t \n\t $total = $total + $consumption_by_geo[$i]['consumption'];\n\t \n\t } // foreach cln\n\t \n\t if (is_null($national_consumption_by_method)) {\n\t $consumption_by_geo[] = array('location' => 'No Data', 'consumption' => 0 );\n\t }\n\t \n\t if ($total == 0) {\n\t $total_consumption[] = array('location' => 'No Data', 'consumption' => 0 );\n\t } else {\n\t $total_consumption[] = array('location' => $locationNames, 'consumption' => $total );\n\t }\n\t \n\t \n \n \n\t $cs_data = new DashboardCHAI();\n\t // specify date by \"2014-12-01\" or leave empty to get data for the last month\n\t $cs_details = $cs_data->fetchCSDetails(null);\n \n $cs_calc = $this->coverageCalculations($cs_details);\n \n $this->view->assign('cs_fp_facility_count',$cs_calc['cs_fp_facility_count']);\n\t $this->view->assign('cs_larc_facility_count',$cs_calc['cs_larc_facility_count']);\n\t $this->view->assign('cs_fp_consumption_facility_count',$cs_calc['cs_fp_consumption_facility_count']);\n\t $this->view->assign('cs_larc_consumption_facility_count',$cs_calc['cs_larc_consumption_facility_count']);\n $this->view->assign('cs_fp_stock_out_facility_count',$cs_calc['cs_fp_stock_out_facility_count']);\n $this->view->assign('cs_larc_stock_out_facility_count',$cs_calc['cs_larc_stock_out_facility_count']);\n $this->view->assign('cs_date',$cs_calc['cs_date']); \n //var_dump($cs_calc); exit;\n \n\t \n\t //file_put_contents('c:\\wamp\\logs\\php_debug.log', 'dash9bAction >'.PHP_EOL, FILE_APPEND | LOCK_EX);\tob_start();\n\t //var_dump('$cs_details= ', $cs_details, 'END');\n\t //var_dump('$method= ', $method, 'END');\n\t //$toss = ob_get_clean(); file_put_contents('c:\\wamp\\logs\\php_debug.log', $toss .PHP_EOL, FILE_APPEND | LOCK_EX);\n\t \t \n\t \n\t $this->view->assign('national_consumption_by_method', $national_consumption_by_method);\n\t $this->view->assign('national_percent_facilities_providing', $national_percent_facilities_providing);\n\t $this->view->assign('national_percent_facilities_stock_out', $national_percent_facilities_stock_out);\n\t \n\t if ($location == 'National') {\n\t $cln_details = $cln_data->insertDashboardData($national_consumption_by_method, 'national_consumption_by_method');\n\t $pfp_details = $pfp_data->insertDashboardData($national_percent_facilities_providing, 'national_percent_facilities_providing');\n\t $pfso_details = $pfso_data->insertDashboardData($national_percent_facilities_stock_out, 'national_percent_facilities_stock_out');\n\t $cs_details = $cs_data->insertDashboardData($cs_details, 'national_coverage_summary');\n\t }\n\t \n\t } // else\n\t \n\t $this->viewAssignEscaped ('locations', Location::getAll(1));\n\t}", "public function actionView($id)\n {\n $model = $this->getModel($id);\n $verify = $this->getVerify($id,$model['credit_type']);//審核信息\n $crmcertf = $this->getCrmCertf($model['cust_id']);\n $newnName1 = $crmcertf['bs_license'];\n $newnName1 = substr($newnName1, 2, 6);\n// $newnName1 = str_replace('-', '', $newnName1);\n $newnName2 = $crmcertf['tx_reg'];\n $newnName2 = substr($newnName2, 2, 6);\n// $newnName2 = str_replace('-', '', $newnName2);\n $newnName3 = $crmcertf['qlf_certf'];\n $newnName3 = substr($newnName3, 2, 6);\n// dumpE($crmcertf);\n return $this->render('view',[\n 'id'=>$id,\n 'model'=>$model,\n 'verify'=>$verify,\n 'crmcertf' => $crmcertf,\n 'newnName1' => $newnName1,\n 'newnName2' => $newnName2,\n 'newnName3' => $newnName3,\n ]);\n }", "public function landVisitDetailAction(){\n\n\t\t\t\t$params = $this->getRequest()->getParams(); \n\t\t\t\t$db = $this->db;\n\t\t\t\t$secretkey = $this->secretkey; \n\t\t\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\";\n\t\t\t\t$farmer_code\t= isset($params['farmer_code'])?$params['farmer_code']:\"\";\n\t\t\t\t$land_id\t= isset($params['land_id'])?$params['land_id']:\"\";\n\t\t\t\t$stage_id\t= isset($params['stage_id'])?$params['stage_id']:\"\";\n\t\t\t\t$disease_score\t= isset($params['disease_score'])?$params['disease_score']:\"\";\n\t\t\t\t$logging_score\t= isset($params['logging_score'])?$params['logging_score']:\"\";\n\t\t\t\t$presemption_of_insect\t= isset($params['presemption_of_insect'])?$params['presemption_of_insect']:\"\";\n\t\t\t\t$soil_moisture_id\t= isset($params['soil_moisture_id'])?$params['soil_moisture_id']:\"\";\n\t\t\t\t$quality_of_crop\t= isset($params['quality_of_crop'])?$params['quality_of_crop']:\"\";\n\t\t\t\t$sink_date_time \t= isset($params['sink_date_time'])?$params['sink_date_time']:\"\";\n\n\n\t\t\t\t$error_code = 1;\n\t\t\t\t$succes = FALSE; \n\t\t\t\ttry{\n\t\t\t\t\t$db->beginTransaction();\n\t\t\t\t\tif($secretkey != $appkey){\n\t\t\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t\t\t}\t\n\t\t\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$user = new Application_Model_Users();\n\t\t\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t\t\t} \n\t\t\t\t\tif(!empty($alldata['DeviceID'])){\t\t\t\n\t\t\t\t\t\tif($alldata['DeviceID'] != $device_id){\n\t\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac'){\n\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t\t\t}\t\n\n\t\t\t\t\tif($alldata['App_Access_Status'] == 2){\n\t\t\t\t\t\t$error_code = 2;\n\t\t\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$farmerMaster = new Application_Model_Farmermasters();\n\t\t\t\t\t$allFarmerData = $farmerMaster->getFarmerDetailsByFarmerCode($farmer_code); \t\n\t\t\t\t\t$farmerID = $allFarmerData['id'];\n\t\t\t\t\t$farmerCode = $allFarmerData['FarmerCode'];\n\n\n\t\t\t\t\tif(isset($_FILES['image']['tmp_name']) AND !empty($_FILES['image']['name'])){\n\t\t\t\t\t\t$tempName = $_FILES['image']['tmp_name'];\n\t\t\t\t\t\t$imageName = time().$_FILES['image']['name']; \n\t\t\t\t\t\t$uploads = 'uploads/visit_photograph/';\n\t\t\t\t\t\tif(!file_exists($uploads)){\n\t\t\t\t\t\t\tmkdir($uploads);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$pathComplete = $uploads.$imageName;\n\t\t\t\t\t\t@move_uploaded_file($tempName,$pathComplete);\n\n\t\t\t\t\t}\n\n\t\t\t\t\t$land_visit = array(); \n\n\t\t\t\t\t$land_visit['land_id'] = $land_id;\n\t\t\t\t\t$land_visit['stage_id'] = $stage_id;\n\t\t\t\t\t$land_visit['disease_score'] = $disease_score;\n\t\t\t\t\t$land_visit['logging_score'] = $logging_score;\n\t\t\t\t\t$land_visit['presemption_of_insect'] = $presemption_of_insect;\n\t\t\t\t\t$land_visit['soil_moisture_id'] = $soil_moisture_id;\n\t\t\t\t\t$land_visit['quality_of_crop'] = $quality_of_crop;\n\t\t\t\t\t$land_visit['image'] = $pathComplete;\n\t\t\t\t\t$land_visit['farmer_code'] = $farmer_code;\n\t\t\t\t\t$land_visit['farmer_id'] = $farmerID;\n\t\t\t\t\t$land_visit['fe_code'] = $LoginID;\n\t\t\t\t\t$land_visit['sink_date_time'] = $sink_date_time;\n\t\t\t\t\t$land_visit['created'] = $this->currdate; \n\t\t\t\t\t$db->insert('logi_land_visit', $land_visit);\n\n\t\t\t\t\t$landdetailId = $db->lastInsertId();\n\n\t\t\t\t\t$db->commit();\n\t\t\t\t\t$succes = TRUE;\t \n\t\t\t\t}\n\n\t\t\t\tcatch(Exception $e){\n //Rollback transaction\n\t\t\t\t\t$db->rollBack();\n\t\t\t\t\t$error= $e->getMessage();\n\t\t\t\t}\n\n\t\t\t\tif($succes == TRUE ){\n\t\t\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Land visit Detail Inserted successfully.', 'land_visit_id'=>$landdetailId));\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error));\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t}", "public function viewAclAction()\n {\n \tif($this->getRequest()->getParam('id')){\n \t\t$db = new Rsvacl_Model_DbTable_DbAcl();\n \t\t$acl_id = $this->getRequest()->getParam('id');\n \t\t$rs=$db->getAcl($acl_id);\n \t\t$this->view->rs=$rs;\n \t} \t \n \t\n }", "public function actionView($id)\n\t{\n\t\t$model=Cooperativepartner::model()->with('company')->findByPk($id);\n\t\t$model->fCooperativeCompanyID=empty($model->company->fCooperativeCompanyID)?'':$model->company->fCooperativeCompanyName;\n\t\t$model->fEducationalLevel=array_key_exists($model->fEducationalLevel,adminSettings::$EducationLevel)?adminSettings::$EducationLevel[$model->fEducationalLevel]:'';\n\t\t$model->fCreateDate=empty($model->fCreateDate)?'':date('Y-m-d',$model->fCreateDate);\n\t\t$model->fUpdateDate=empty($model->fUpdateDate)?'':date('Y-m-d',$model->fUpdateDate);\n\t\t$this->render('view',array(\n\t\t\t'model'=>$model,\n\t\t\t'keyid'=>$id\n\t\t));\n\t}", "public function actionView($id)\n {\n $model =$this->findModel($id);\n $c_titulo = Coleccion::find()->select(['col_titulo'])->where(['col_id' => $model->col_id])->one();\n\n if(Detallearchivoatributoex::find()->where(['arc_id'=> $id])->count() != 0)\n {\n //Se crea un array para el modelo de coleccion-pais\n $detalleAE = Detallearchivoatributoex::find()->where(['arc_id'=> $id])->all();\n }else{\n //Se crea un array para el modelo de coleccion-pais\n $detalleAE = 0;\n }\n\n\n return $this->render('view', [\n 'model' => $model,\n 'c_titulo'=>$c_titulo,\n 'detalleAE' => $detalleAE,\n ]);\n }", "public function view() {\n\n $this->db->where('VCIF', 'XYZ');\n $q = $this->db->get('STRUCTURE')->result();\n }", "public function actionView($id)\n {\n if (\\Yii::$app->user->can('administrador')) {\n $this->layout =\"main-admin\";\n Yii::$app->view->params['iconoAdministrador'] = 'fa fa-file-text';\n Yii::$app->view->params['tituloAdministrador'] = 'Factura de Gastos';\n Yii::$app->view->params['subTituloAdministrador'] = 'Lista de Factura de Gastos';\n Yii::$app->view->params['subTitulo2Administrador'] = 'Detalle de Factura de Gastos';\n Yii::$app->view->params['linkAdministrador'] = 'index';\n }\n else if (\\Yii::$app->user->can('usuario')){\n $this->layout =\"main-usuario\";\n Yii::$app->view->params['iconoAdministrador'] = 'fa fa-home';\n Yii::$app->view->params['tituloAdministrador'] = 'Apartamentos';\n Yii::$app->view->params['subTituloAdministrador'] = 'Lista de Apartamentos';\n Yii::$app->view->params['subTitulo2Administrador'] = 'Detalle de Apartamento';\n Yii::$app->view->params['linkAdministrador'] = 'apartamentos/index';\n }\n $model2 = FacturaGastosItems::find()->where(['factura_gastos_id_factura_gastos' => $id])->all();\n return $this->render('view', [\n 'model' => $this->findModel($id), 'model2' => $model2\n ]);\n }", "public function actionView($id) {\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n DomainConst::KEY_ACTIONS => $this->listActionsCanAccess,\n ));\n }", "public function viewAction()\r\n {\r\n $this->indexAction();\r\n }", "public function actionView($id)\n\t{\n\t\t$user = User::model()->find('username=?',array(Yii::app()->user->name));\n\t\t$type_ID = $user->user_type_ID;\n\t\t$role_ID = $user->role_ID;\n\t\tif($type_ID == \"1\" || $type_ID==\"3\" || $role_ID =\"2\" || $role_ID = \"5\"){\n\t\t\t$this->render('view',array(\n\t\t\t\t'model'=>$this->loadModel($id),\n\t\t\t\t));\n\t\t}else{\n\t\t\t\n\t\t\techo \"<script>alert('Sie sind nicht berechtigt, diese Aktion durchzuführen')</script>\";\n\t\t}\n\t}", "public function actionView()\n {\n \t$id = isset($_REQUEST['id'])?$_REQUEST['id']:null;\n \t$model = $this->findModel($id);\n \t \n \treturn CommonUtils::json_success($model);\n }", "public function actionView($id_curso_disponible_servidor_publico)\n{\n$this->render('view',array(\n'cursoDisponibleServidorPublico'=>$this->loadModel($id_curso_disponible_servidor_publico),\n));\n}", "public function actionDetail($page = 1)\n {\n // check w9 to review\n if (!isset($_SESSION['w9_to_review']) || count($_SESSION['w9_to_review']) == 0) {\n Yii::app()->user->setFlash('success', \"Please choose vendors to review!\");\n $this->redirect('/w9');\n }\n\n $page = intval($page);\n $num_pages = count($_SESSION['w9_to_review']);\n if ($page <= 0) {\n $page = 1;\n } else if ($page > $num_pages) {\n $page = $num_pages;\n }\n\n $comId = $_SESSION['w9_to_review'][$page];\n\n //get company info\n $company = Companies::model()->with('adreses', 'client')->findByPk($comId);\n $client = $company->client;\n $adress = $company->adreses[0];\n\n $condition = UsersClientList::getClientAdminCondition($client->Client_ID);\n $clientAdmins = UsersClientList::model()->find($condition);\n\n // get company client admin's info\n $adminPerson = '';\n if ($clientAdmins) {\n $clientAdmin = Users::model()->with('person')->findByPk($clientAdmins->User_ID);\n $adminPerson = $clientAdmin->person;\n }\n\n // get last company w9 document\n $lastDocument = W9::getCompanyW9Doc($client->Client_ID);\n\n if ($lastDocument === null) {\n Yii::app()->user->setFlash('success', \"Please choose vendors to review!\");\n $this->redirect('/w9');\n die;\n }\n\n // get last document's file\n $condition = new CDbCriteria();\n $condition->select = 'Mime_Type';\n $condition->condition = \"Document_ID='\" . $lastDocument->Document_ID . \"'\";\n $file = Images::model()->find($condition);\n\n // get w9 row\n $w9 = W9::getCompanyW9($client->Client_ID);\n\n //get old w9s with documents\n $lastDocument2 = null;\n $file2 = null;\n $lastDocument3 = null;\n $file3 = null;\n\n $lastDocument2 = W9::getCompanyW9Doc($client->Client_ID, 2);\n if ($lastDocument2) {\n $condition->condition = \"Document_ID='\" . $lastDocument2->Document_ID . \"'\";\n $file2 = Images::model()->find($condition);\n }\n\n $lastDocument3 = W9::getCompanyW9Doc($client->Client_ID, 3);\n if ($lastDocument3) {\n $condition->condition = \"Document_ID='\" . $lastDocument3->Document_ID . \"'\";\n $file3 = Images::model()->find($condition);\n }\n\n // get notes\n $notes = Notes::model()->getCompanyClientsNotes($comId);\n\n $companiesToShareW9 = Companies::getCompaniesToShareW9();\n\n $this->render('detail', array(\n 'page' => $page,\n 'num_pages' => $num_pages,\n 'company' => $company,\n 'adress' => $adress,\n 'client' => $client,\n 'adminPerson' => $adminPerson,\n 'lastDocument' => $lastDocument,\n 'w9' => $w9,\n 'notes' => $notes,\n 'file' => $file,\n 'companiesToShareW9' => $companiesToShareW9,\n 'lastDocument2' => $lastDocument2,\n 'file2' => $file2,\n 'lastDocument3' => $lastDocument3,\n 'file3' => $file3,\n ));\n }", "public function actionView($id)\n\t{\n\t\t//$this->layout='//layouts/column2';\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),'manajemen'=>'manajemen',\n\t\t));\n\t}", "public function actionView($id)\n\t{\n $student=Student::model()->findByPk($id);\n echo $student->personID;\n\t\t$this->render('view',array(\n\t\t\t'admission'=> Admission::model()->findByPk(array('studentID'=>$id,'sectionName'=>yii::app()->session['secName'],'batchName'=>yii::app()->session['batName'],'programmeCode'=>yii::app()->session['proCode'])),\n 'student'=> $student,\n 'person'=> Person::model()->findByPk($student->personID)\n\t\t));\n\t}", "public function view_agent()\n\t{\n\t\tif($this->uri->segment(\"3\") != \"\" && $this->uri->segment(\"3\") == \"MOO\")\n\t\t{\n\t\t\t$id = $this->uri->segment(\"4\");\n\t\t\t$data['agent_view']=$this->db->get_where('agent_detail',array('id'=>$id))->row();\n\n\t\t\n\n\t\t\t$this->load->view('agent_view',$data);\n\t\t}\n\t\telse if($this->input->post()) //post from index function view file.\n\t\t{\n\t\t\t$id=$this->input->post('agent_view_id');\n\t\t\t$data['agent_view']=$this->db->get_where('agent_detail',array('id'=>$id))->row();\n\n\t\t\n\n\t\t\t$this->load->view('agent_view',$data);\n\t\t}\n\t\telse // error give when direct hit url.\n\t\t{\n\t\t\t$data[\"heading\"] = \"Please Try Agian\";\n\t\t\t$data[\"message\"] = \"<a href='\".base_url().\"index.php/Dashboard' >GO TO HOME</a>\";\n\t\t\t$this->load->view('errors/html/error_404',$data);\n\t\t}\n\n\t}", "public function actionView($id)\n\t{\n $uid = Yii::app()->user->getId(); \n if($uid != 1){\n $value = ComSpry::getUnserilizedata($uid);\n if(empty($value) || !isset($value)){\n throw new CHttpException(403,'You are not authorized to perform this action.');\n }\n if(!in_array(37, $value)){\n throw new CHttpException(403,'You are not authorized to perform this action.');\n }\n }\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n \n\t}", "public function actionView($id)\n {\n \n \n \n $model = Purchaserequisition::find()\n ->where(['No_'=> $id])\n ->with('requisitionlines')\n ->asArray()\n ->all();\n \n // print_r( $model['0']);\n // exit;\n return $this->render('view', [\n 'model' => $model['0'],\n \n ]);\n }", "public function actionView($id)\n {\n $OpcSearchModel = new DescNetworkSearch();\n $OpcDataProvider = $OpcSearchModel->searchId(Yii::$app->request->queryParams, $id);\n $MscSearchModel = new MscSearch();\n $MscDataProvider = $MscSearchModel->searchId(Yii::$app->request->queryParams, $id);\n $BcuidSearchModel = new BcuIdSearch();\n $BcuidDataProvider = $BcuidSearchModel->searchId(Yii::$app->request->queryParams, $id);\n $RncSearchModel = new RncReferenceSearch();\n $RncDataProvider = $RncSearchModel->searchId(Yii::$app->request->queryParams, $id);\n $TVSearchModel = new TrunkVoipSearch();\n $TVDataProvider = $TVSearchModel->searchId(Yii::$app->request->queryParams, $id);\n $msrnSearchModel = new MsrnProposedlistSearch();\n $BscSearchModel = new BscSearch();\n $BscDataProvider = $BscSearchModel->searchId(Yii::$app->request->queryParams, $id);\n\n $model = $this->findModel($id);\n $msrn = null;\n if ($model->msrn !== null)\n $msrn = $model->msrn->New_MSRN;\n\n $dataprovider = null;\n $flag = null;\n $mscmodel = null;\n \n\n if ($BcuidDataProvider->totalCount > 0)\n {\n $dataprovider = $BcuidDataProvider;\n $flag = 'BCU ID List';\n }\n\n else if ($MscDataProvider->totalCount > 0)\n {\n $dataprovider = $MscDataProvider;\n $flag = 'MSC Pool Specification';\n $mscmodel = Msc::findOne($id);\n }\n\n return $this->render('view', [\n 'model' => $model,\n 'msrn' => $msrn,\n 'OpcDataProvider' => $OpcDataProvider,\n 'dataProvider' => $dataprovider,\n 'flag' => $flag,\n 'mscmodel' => $mscmodel,\n 'TVDataProvider' => $TVDataProvider,\n 'BscDataProvider' => $BscDataProvider,\n 'RncDataProvider' => $RncDataProvider,\n ]);\n\n }", "public function ViewAction()\r\n\t{\r\n\t\t$this->View->author = $this->Author->select();\r\n\t}", "public function viewactionsAction(){\n\t\t$moduleId = $this->getRequest()->getParam('moduleId');\n\t\t$moduleObj = new Modules_Model_Modules();\n\t\t$moduleItem = $moduleObj->findById($moduleId);\n\t\t\n\t\t$controllerId = $this->getRequest()->getParam('controllerId');\n\t\t$controllerObj = new Modules_Model_Controllers();\n\t\t$controllerItem = $controllerObj->findById($controllerId);\n\n\t\t$permObj = new Permission_Model_Permission();\n\t\t$permObj->setModuleId( $moduleId );\n\t\t$permObj->setControllerId( $controllerId );\n\n\t\t$this->view->module = $moduleItem;\n\t\t$this->view->controller = $controllerItem;\n\t\t$this->view->records = $permObj->fetchActionsByControllerModule();\n\t}", "function viewdetails($id){\n\t\t\n\t\t//echo \"hi\"; die; \n\t\t\n\t\tif($id){\n\t\t\t$rs = $this->ModelContactus->getSingle($id);\n\t\t\t//pr($rs);\n\t\t\t//$row = $rs->fields;\n\t\t\tif(is_array($rs))\n\t\t\t{\n\t\t\t\tforeach($rs as $key => $val)\n\t\t\t\t{\n\t\t\t\t\tif(!is_numeric($key))\n\t\t\t\t\t{\n\t\t\t\t\t\t$data[$key] = $val;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$data['succmsg'] = $this->nsession->userdata('succmsg');\n\t\t\t$data['errmsg'] = $this->nsession->userdata('errmsg');\n\t\t\t$this->nsession->set_userdata('succmsg', \"\");\n\t\t\t$this->nsession->set_userdata('errmsg', \"\");\n\t\t\t$elements = array();\n\t\t\t$elements['menu'] = 'menu/index';\n\t\t\t$elements['topmenu'] = 'menu/topmenu';\n\t\t\t$elements['main'] = 'contactus/view_details';\n\t\t\t$element_data['menu'] = $data;//array();\n\t\t\t$element_data['main'] = $data;\n\t\t\t$this->layout->setLayout('layout_main_view');\n\t\t\t$this->layout->multiple_view($elements,$element_data);\n\t\t}\n\n\t}", "function view($id1)\r\n {\r\n // $ID = $this->uri->segment(3);\r\n $ID = $id1;\r\n // get data\r\n $this->data['result'] = $this->chat_model->get_with_join('chat_id,chat.admin_id, admin.first_name as admin_name,chat.driver_id,driver.last_name as driver_name,massage,driver.status,read', $ID,TRUE,1,0);\r\n \r\n $this->data['sub_view'] = 'admin/chat_view';\r\n // load view\r\n $this->load->view('admin/_layout_modal',$this->data);\r\n }", "public function disabilitydetailsviewAction()\r\n\t{\r\n\t if(defined('EMPTABCONFIGS'))\r\n\t\t{\r\n\t\t $empOrganizationTabs = explode(\",\",EMPTABCONFIGS);\r\n\t\t\tif(in_array('disabilitydetails',$empOrganizationTabs))\r\n\t\t\t{\r\n\t\t\t\t$tabName = \"disability\";\r\n\t\t\t\t$employeeData =array();\r\n\t\t\t\t$objName=\"mydetails\";\r\n\t\t\t\t$editPrivilege=\"\";\r\n\t\t\t\t$auth = Zend_Auth::getInstance();\r\n\t\t\t if($auth->hasIdentity())\r\n\t\t\t {\r\n\t\t\t\t\t$loginUserId = $auth->getStorage()->read()->id;\r\n\t\t\t\t}\r\n\t\t\t\t$id = $loginUserId;\r\n\t\t\t\t$empDisabilitydetailsform = new Default_Form_Disabilitydetails();\r\n\t\t\t\t$empDisabilitydetailsModel = new Default_Model_Disabilitydetails();\r\n\t\t\t\t$employeeModal = new Default_Model_Employee();\r\n\t\t\t\t\r\n\t\t\t\t$empDisabilitydetailsform->removeElement(\"submit\");\r\n\t\t\t\t$elements = $empDisabilitydetailsform->getElements();\r\n\t\t\t\tif(count($elements)>0)\r\n\t\t\t\t{\r\n\t\t\t\t\tforeach($elements as $key=>$element)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(($key!=\"Cancel\")&&($key!=\"Edit\")&&($key!=\"Delete\")&&($key!=\"Attachments\")){\r\n\t\t\t\t\t\t$element->setAttrib(\"disabled\", \"disabled\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$empdata = $employeeModal->getsingleEmployeeData($id);\r\n\t\t\t\tif($empdata == 'norows')\r\n\t\t\t\t{\r\n\t\t\t\t $this->view->rowexist = \"norows\";\r\n\t\t\t\t $this->view->empdata = \"\";\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{ \r\n\t\t\t\t\t$this->view->rowexist = \"rows\";\r\n\t\t\t\t\tif(!empty($empdata))\r\n\t\t\t\t\t{ \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif($id)\r\n\t\t\t\t\t\t{\t\r\n\t\t\t\t\t\t\t$data = $empDisabilitydetailsModel->getempDisabilitydetails($id);\r\n\t\t\t\t\t\t\tif(!empty($data))\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$empDisabilitydetailsform->setDefault(\"id\",$data[0][\"id\"]);\r\n\t\t\t\t\t\t\t\t$empDisabilitydetailsform->setDefault(\"disability_name\",$data[0][\"disability_name\"]);\r\n\t\t\t\t\t\t\t\t$empDisabilitydetailsform->setDefault(\"disability_type\",$data[0][\"disability_type\"]);\r\n\t\t\t\t\t\t\t\t$empDisabilitydetailsform->setDefault(\"disability_description\",$data[0][\"disability_description\"]);\r\n\t\t\t\t\t\t\t\t$empDisabilitydetailsform->setDefault(\"other_disability_type\",$data[0][\"other_disability_type\"]);\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$empDisabilitydetailsform->setAttrib('action',BASE_URL.'mydetails/disability');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$this->view->form = $empDisabilitydetailsform;\r\n\t\t\t\t\t\t\t$this->view->id = $id;\r\n\t\t\t\t\t\t\t$this->view->data=$data;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->view->empdata = $empdata;\r\n\t\t\t\t\t$this->view->controllername=$objName;\r\n\t\t\t\t\t$this->view->actionname='disability';\r\n\t\t\t\t\t$this->view->editPrivilege = $this->mydetailsobjPrivileges;\r\n\t\t\t\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\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 $this->_redirect('error');\r\n\t\t }\r\n }\r\n else\r\n\t\t{\r\n\t\t \t$this->_redirect('error');\r\n\t\t}\t\t\r\n\t}", "public function actionView($id)\n {\n \t$fromcompany = false;\n \tif(isset($_GET['fromcompany']) && intval($_GET['fromcompany']) > 0)\n \t{\n \t\t$fromcompany = $_GET['fromcompany'];\n \t}\n \t \n return $this->render('view', [\n 'model' \t\t=> $this->findModel($id),\n 'fromcompany' \t=> $fromcompany,\n ]);\n }", "public function view_action()\n {\n $mode = get_param_string('mode', 'cns');\n $id = get_param_integer('id');\n\n if ($mode == 'cns') {\n $rows = $GLOBALS['FORUM_DB']->query_select('f_moderator_logs', array('l_reason AS reason', 'id', 'l_by AS member_id', 'l_date_and_time AS date_and_time', 'l_the_type AS the_type', 'l_param_a AS param_a', 'l_param_b AS param_b'), array('id' => $id), '', 1);\n } else {\n $rows = $GLOBALS['SITE_DB']->query_select('actionlogs', array('id', 'member_id', 'date_and_time', 'the_type', 'param_a', 'param_b', 'ip'), array('id' => $id), '', 1);\n }\n\n if (!array_key_exists(0, $rows)) {\n warn_exit(do_lang_tempcode('MISSING_RESOURCE'));\n }\n $row = $rows[0];\n\n $username = $GLOBALS['FORUM_DRIVER']->get_username($row['member_id']);\n if (is_null($username)) {\n $username = do_lang('UNKNOWN');\n }\n\n $type_str = do_lang($row['the_type'], $row['param_a'], $row['param_b'], null, null, false);\n if (is_null($type_str)) {\n $type_str = $row['the_type'];\n }\n\n $fields = array(\n 'USERNAME' => $GLOBALS['FORUM_DRIVER']->member_profile_hyperlink($row['member_id'], false, '', false),\n 'DATE_TIME' => get_timezoned_date($row['date_and_time']),\n 'ACTION' => $type_str,\n 'PARAMETER_A' => is_null($row['param_a']) ? '' : $row['param_a'],\n 'PARAMETER_B' => is_null($row['param_b']) ? '' : $row['param_b'],\n );\n\n if (array_key_exists('ip', $row)) {\n $fields['IP_ADDRESS'] = escape_html($row['ip']);\n }\n\n if (array_key_exists('reason', $row)) {\n $fields['REASON'] = escape_html($row['reason']);\n }\n\n if (addon_installed('securitylogging')) {\n if (array_key_exists('ip', $row)) {\n $banned_test_1 = ip_banned($row['ip'], true);\n $fields['IP_BANNED'] = (!$banned_test_1) ? do_lang_tempcode('NO') : do_lang_tempcode('YES');\n if ($row['ip'] != get_ip_address()) {\n $fields['IP_BANNED']->attach(do_template('ACTIONLOGS_TOGGLE_LINK', array('_GUID' => 'eff2890f2193ece32df8ec8ee48b252d', 'URL' => build_url(array('page' => 'admin_ip_ban', 'type' => 'toggle_ip_ban', 'id' => $row['ip'], 'redirect' => get_self_url(true)), get_module_zone('admin_ip_ban')))));\n }\n\n if ($row['ip'] != get_ip_address()) {\n if (get_option('stopforumspam_api_key') . get_option('tornevall_api_username') != '') {\n $fields['SYNDICATE_TO_STOPFORUMSPAM'] = do_template('ACTIONLOGS_TOGGLE_LINK', array(\n '_GUID' => '7d10045c6b3b48f256e2f8eb5535809c',\n 'LABEL' => do_lang_tempcode('PROCEED'),\n 'LONELY' => true,\n 'URL' => build_url(array('page' => 'admin_ip_ban', 'type' => 'syndicate_ip_ban', 'ip' => $row['ip'], 'member_id' => $row['member_id'], 'reason' => do_lang('BANNED_ADDRESSES'), 'redirect' => get_self_url(true)), get_module_zone('admin_ip_ban')),\n ));\n }\n }\n }\n\n if ((!is_guest($row['member_id'])) && ($row['member_id'] != get_member())) {\n $fields['SUBMITTER_BANNED'] = do_template('ACTIONLOGS_TOGGLE_LINK', array(\n '_GUID' => 'f79fb00ef35d89381371a67bc9c4d69b',\n 'LONELY' => true,\n 'URL' => build_url(array('page' => 'admin_ip_ban', 'type' => 'toggle_submitter_ban', 'id' => $row['member_id'], 'redirect' => get_self_url(true)), get_module_zone('admin_ip_ban')),\n ));\n } else {\n $banned_test_2 = $GLOBALS['SITE_DB']->query_select_value_if_there('usersubmitban_member', 'the_member', array('the_member' => $row['member_id']));\n $fields['SUBMITTER_BANNED'] = is_null($banned_test_2) ? do_lang_tempcode('NO') : do_lang_tempcode('YES');\n }\n\n if (((get_forum_type() == 'cns') && (!is_guest($row['member_id']))) && ($row['member_id'] != get_member())) {\n $fields['MEMBER_BANNED'] = do_template('ACTIONLOGS_TOGGLE_LINK', array(\n '_GUID' => '6b192ecfad1afc67bb8c2f1e744cc3b1',\n 'LONELY' => true,\n 'URL' => build_url(array('page' => 'admin_ip_ban', 'type' => 'toggle_member_ban', 'id' => $row['member_id'], 'redirect' => get_self_url(true)), get_module_zone('admin_ip_ban')),\n ));\n } else {\n $banned_test_3 = $GLOBALS['FORUM_DRIVER']->is_banned($row['member_id']);\n $fields['MEMBER_BANNED'] = $banned_test_3 ? do_lang_tempcode('YES') : do_lang_tempcode('NO');\n }\n }\n $fields['INVESTIGATE_USER'] = hyperlink(build_url(array('page' => 'admin_lookup', 'id' => (array_key_exists('ip', $row)) ? $row['ip'] : $row['member_id']), '_SELF'), do_lang_tempcode('PROCEED'), false, false);\n\n // Is there a revision here?\n require_code('revisions_engine_database');\n $revision_engine = new RevisionEngineDatabase($mode == 'cns');\n $revision = $revision_engine->find_revision_for_log($id);\n if (is_null($revision)) {\n require_code('revisions_engine_files');\n $revision_engine = new RevisionEngineFiles();\n $revision = $revision_engine->find_revision_for_log($id);\n }\n if (!is_null($revision)) {\n if (isset($revision['r_resource_type']) && isset($revision['r_resource_id'])) {\n require_code('content');\n list($content_title, , , , $content_url) = content_get_details($revision['r_resource_type'], $revision['r_resource_id']);\n if (empty($content_title)) {\n $content_title = $revision['r_original_title'];\n }\n if (!is_null($content_url)) {\n $fields['VIEW'] = hyperlink($content_url, $content_title, false, true);\n }\n }\n\n if (isset($revision['r_original_content_owner'])) {\n $fields['CONTENT_OWNER'] = $GLOBALS['FORUM_DRIVER']->member_profile_hyperlink($revision['r_original_content_owner']);\n }\n\n if (isset($revision['r_original_content_timestamp'])) {\n $fields['CONTENT_DATE_AND_TIME'] = get_timezoned_date($revision['r_original_content_timestamp']);\n }\n\n if (isset($revision['r_original_title'])) {\n if ($revision['r_original_title'] != '') {\n $fields['TITLE_PRIOR_TO_REVISION'] = $revision['r_original_title'];\n }\n }\n\n $fields['TEXT_PRIOR_TO_REVISION'] = with_whitespace($revision['r_original_text'], true);\n\n if (isset($revision['r_original_resource_fs_path'])) {\n $fields['RESOURCE_FS_PATH_PRIOR_TO_REVISION'] = $revision['r_original_resource_fs_path'];\n }\n\n if (isset($revision['r_original_resource_fs_record']) && strlen($revision['r_original_resource_fs_record']) < 1024 * 50/*50kb reasonable limit*/) {\n $fields['RESOURCE_FS_RECORD_PRIOR_TO_REVISION'] = with_whitespace($revision['r_original_resource_fs_record'], true);\n }\n\n if (has_privilege(get_member(), 'delete_revisions')) {\n $delete_url = build_url(array('page' => 'admin_revisions', 'type' => 'delete', 'id' => $revision['id'], 'revision_type' => $revision['revision_type'], 'redirect' => get_self_url(true)), get_module_zone('admin_revisions'));\n $delete = hyperlink($delete_url, do_lang_tempcode('DELETE'), false, false, do_lang_tempcode('DELETE_REVISION'), null, new Tempcode());\n $fields['DELETE_REVISION'] = $delete;\n }\n\n /*if (has_privilege(get_member(), 'undo_revisions')) {\n $undo_url = build_url(array('page' => 'admin_revisions', 'type' => 'undo', 'id' => $revision['id'], 'revision_type' => $revision['revision_type'], 'redirect' => get_self_url(true)), get_module_zone('admin_revisions'));\n $delete = hyperlink($delete_url, do_lang_tempcode('UNDO'), false, false, do_lang_tempcode('UNDO_REVISION'), null, new Tempcode());\n $fields['UNDO_REVISION'] = $delete;\n }*/\n }\n\n require_code('templates_map_table');\n return map_table_screen($this->title, $fields);\n }", "public function view($id_accion){\r\n\t\t$stmt = $this->db->prepare(\"SELECT * FROM accion WHERE id_accion=?\");\r\n\t\t$stmt->execute(array($id_accion));\r\n\t\t$action = $stmt->fetch(PDO::FETCH_ASSOC);\r\n\r\n\t\tif($action != null) {\r\n\t\t\treturn new Action(\r\n\t\t\t$action[\"id_accion\"],\r\n\t\t\t$action[\"nombre\"]\r\n\t\t\t);\r\n\t\t} else {\r\n\t\t\treturn new Action();\r\n\t\t}\r\n\t}", "function view($id1)\r\n {\r\n // $ID = $this->uri->segment(3);\r\n $ID = $id1;\r\n // get data\r\n $this->data['result'] = $this->fuel_refill_model->get_with_join('fuel_refill_id,driver.first_name AS driver_name,register_no,fuel_center.name AS fuel_center_name,fuel_refill.note,date,liter,fuel_unit_price,reciept_img,fuel_refill.vehicle_id', $ID,TRUE,1,0);\r\n \r\n $this->data['sub_view'] = 'driver/fuel_refill_view';\r\n // load view\r\n $this->load->view('driver/_layout_modal',$this->data);\r\n }", "public function actionView($id){\n $orgid=getOrganisationID();\n $concept=MgfConceptNote::find()->where(['organisation_id'=>$orgid]);\n //$concept\n return $this->render('view', [\n 'model' => $this->findModel($id),\n ]);\n }", "public function viewAction()//23:15\n {\n\n }", "public function actionView($id)\n {\n \tif (\\Yii::$app->user->isGuest) {\n \t\treturn $this->redirect(Yii::$app->params['default']);\n \t}\n\t\t//supaya org non guest gabisa akses yg lain\n\t\t\n\t\t\n\t\t$jabatan=Yii::$app->user->identity->jabatan;\n\t\tif($jabatan=='Project Manager' || $jabatan=='Supervisor' || $jabatan=='Coordinator'){\n\t\t\treturn $this->redirect(Yii::$app->params['default'].'index.php/home');\n\t\t}\n\t\t\n return $this->render('view', [\n 'model' => $this->findModel($id),\n ]);\n }", "public function viewAction()\n {\n $id = $this->_getPrimaryId();\n $row = $this->_getRow($id);\n\n $this->view->row = $row;\n }", "function aspirelists_get_view_actions() {\n return array('view', 'view all');\n}", "public function detailAction()\r\n {\r\n $typeId = $this->_getParam('citypeId');\r\n\r\n $citypeServiceGet = new Service_Citype_Get($this->translator, $this->logger, parent::getUserInformation()->getThemeId());\r\n $currentCiType = $citypeServiceGet->getCiType($typeId);\r\n\r\n if ($currentCiType[Db_CiType::PARENT_CI_TYPE_ID])\r\n $parent = $citypeServiceGet->getCiType($currentCiType[Db_CiType::PARENT_CI_TYPE_ID]);\r\n if ($currentCiType[Db_CiType::DEFAULT_PROJECT_ID])\r\n $defaultProject = $citypeServiceGet->getProject($currentCiType[Db_CiType::DEFAULT_PROJECT_ID]);\r\n if ($currentCiType[Db_CiType::DEFAULT_ATTRIBUTE_ID])\r\n $defaultAttribute = $citypeServiceGet->getAttribute($currentCiType[Db_CiType::DEFAULT_ATTRIBUTE_ID]);\r\n if ($currentCiType[Db_CiType::DEFAULT_SORT_ATTRIBUTE_ID])\r\n $defaultSortAttribute = $citypeServiceGet->getAttribute($currentCiType[Db_CiType::DEFAULT_SORT_ATTRIBUTE_ID]);\r\n\r\n $attributes = $citypeServiceGet->getAttributes($typeId);\r\n $relations = $citypeServiceGet->getRelations($typeId);\r\n\r\n $this->view->attributes = $attributes;\r\n $this->view->relations = $relations;\r\n $this->view->parent = $parent;\r\n $this->view->defaultProject = $defaultProject;\r\n $this->view->defaultAttribute = $defaultAttribute;\r\n $this->view->defaultSortAttribute = $defaultSortAttribute;\r\n //$this->view->iconPath = APPLICATION_PUBLIC.$path;\r\n $this->view->icon = $currentCiType[Db_CiType::ICON];\r\n $this->view->ciType = $currentCiType;\r\n }", "public function edit($id)\n {\n $kasus2 = Kasus2::findOrFail($id);\n $rw = Rw::all();\n return view('kasus2.edit',compact('kasus2','rw'));\n }", "public function actionView()\n\t{\n $model = $this->loadModel();\n //如果不是已阅的,要更改阅读状态\n if(!$model->tag->rt_read){\n $tagModel = Residencetag::model()->findByAttributes(array(\"rt_rbiid\"=>$model->rbi_id));\n $tagModel->rt_read = 1;\n $tagModel->update();\n }\n\t\t$this->render('view',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function Index2()\n {\n $user=DB::table('user')->get();\n\t\t$customer=DB::table('customer')->get();\n\t\t$categories=DB::table('categories')->get();\n\t\t$product=DB::table('product')->get();\n $sales = DB::table('sales')->get();\n $sales_detail = DB::table('sales_detail')->get();\n\t\treturn view('Transaksi/sales_detail/sales_detail',['sales'=>$sales, 'sales_detail'=>$sales_detail]);\n }", "public function actionView($id)\n\t{\n\t\t$arriendo = Arriendo::model()->findByPk($id);\n\t\t$this->render('admin', array('arriendo'=>$arriendo));\n\t}", "function view2($expense_id=-1)\n\t{\n\t\t// echo \"<pre>\";print_r($data);die;\n\t\t$this->load->view(\"expenses/form2\");\n\t}", "public function actionView($id) {\n // SELECT * FROM `order` WHERE `customer_id` = 123\n // $orders - это массив объектов Order\n // if (empty($vacation)) throw new \\yii\\web\\HttpException(404, 'К сожалению такой вакансии не найдено.');\n\n $parent_page = Skills::findOne($id);\n $cases = Cases::find()->where(['skillid'=>$id])->andWhere(['use'=>'1'])->all();\n\n// $cases = $parent_page->cases;\n\n return $this->render('view', compact('cases', 'parent_page'));\n }", "public function actionView($id)\n {\n //if(Yii::$app->user->identity->role == 4) {\n return $this->render('view', [\n 'model' => $this->findModel($id),\n ]);\n //}\n }", "public function actionIndex() {\n// 'Interview', array(\n// 'criteria' => array(\n// 'with' => 'idOffice',\n// 'order' => 't.id_office, t.order, t.id desc'\n// ),\n// )\n// );\n// \n $model = new Interview('search');\n $offices = Office::model()->findAll();\n if(isset($_GET['Interview']))\n {\n $model->attributes = $_GET['Interview']; \n }\n \n $this->render('index', array('model' => $model, 'offices' => $offices)); \n }", "public function view($id)\n {\n\t\t$CommonController = new CommonController;\n\t\t$access = $CommonController->checkFunctionPermission($this->permision,$this->className,'read');\n\t\tif(empty($access)){\n\t\t\tSession::flash('error', trans('common.permissionNot')); \n\t return Redirect::to('cms/dashboard');\n\t\t}\n\t\t\n\t\t$data['results'] = $this->getById($id);\n\t\t\n\t $data['title'] = $this->title;\n\t\t$data['className'] = $this->className;\n return view('Cms/Rsmanager/rsmanagerView',$data); \n }", "function indexAction()\n {\n \t$id=(int)$this->_request->getParam('id');\n \t//Get parameters\n\t\t$config = Zend_Registry::get('config');\n\t\t$parameter = $this->getRequest()->getParams();\n\t\t$limit = $parameter[\"limit\"];\n\t\t$page = $parameter[\"page\"];\n\t\t$search = $parameter[\"search\"];\n\t\t$filter_object = $parameter[\"filter_object\"];\n\n\t\t//Refinde parameters\n\t\tif($limit==0 || $limit==\"\")$limit=$config->limit;\n\t\tif($page==0 || $page==\"\")$page=1;\n\t\tif($filter_object==0 || $filter_object==\"\") $filter_object=0;\n\n\t\t//Define model\n\t\t$this->customers = new CustomersModel();\n\n\t\t//assign value for search action\n\t\t$this->customers->_search = $search;\n\n\t\t//Get data for view\n\t\t$rowcount = $this->customers->Count();\n\t\tif($rowcount<=$limit) $page=1;\n\t\t$this->view->data = $this->customers->SelectAll(($page-1)*$limit,$limit,\"ID\");\n\n\t\t//View detail\n\t\t$this->view->title = \"Cá nhân - Đơn vị\";\n\t\t$this->view->subtitle = \"Danh sách\";\n\t\t$this->view->limit = $limit;\n\t\t$this->view->search = $search;\n\t\t$this->view->page = $page;\n\t\t$this->view->filter_object=$filter_object;\n\t\t// Lấy dữ liệu phụ\n $this->view->showPage = QLVBDHCommon::Paginator($rowcount,5,$limit,\"frmListCustomers\",$page) ;\n\t\t//Enable button\n\t\tQLVBDHButton::EnableDelete(\"/qtht/customers/delete\");\n\t\tQLVBDHButton::EnableAddNew(\"/qtht/customers/input\");\n\t}", "function index()\r\n\t{\r\n\t\t$this->load->model('admin/Interviews_Model');\r\n\t\t$this->load->model('admin/Trailors_Model');\r\n\t\t$trailors_data=$this->Trailors_Model->get_trailor_fulldetails($id=\"\",$limit=20,$order='desc');\r\n\t\t$interview_data1=$this->Interviews_Model->get_interview_fulldetails($id=\"\",$limit=20,$order='desc');\r\n\t\t//get breaking news\r\n\t\t$this->load->model('admin/Filmnews_Model');\r\n\t\t$breaking_news=$this->Filmnews_Model->get_breaking_news();\r\n\t\t//wallpaper categeoreis for jumpto menu\r\n\t\t$this->load->helper('common_functions');\r\n\t\t$table=array('0' =>'wallpaper_categeory',\r\n\t\t '1' =>'gallery_categeory');\r\n\t\t$jumpto = jumpto($table);\r\n\t\t$data = array('title'\t=>\t'Maa Screen',\r\n\t\t\t\t\t 'jquery' => FALSE, \t\r\n\t\t 'jumpto'=> $jumpto\r\n\t\t);\r\n\t\t$this->load->view('review_view',$data);\r\n\t}", "public function viewUserAction()\n {\n \tif($this->getRequest()->getParam('id')){\n \t\t$db = new RsvAcl_Model_DbTable_DbUser();\n \t\t$user_id = $this->getRequest()->getParam('id');\n \t\t$rs=$db->getUser($user_id);\n \t\t//print_r($rs); exit;\n \t\t$this->view->rs=$rs;\n \t} \t \n \t\n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Browser_Service_Recsite::getRecsite(intval($id));\t\t\n\t\t$this->assign('info', $info);\n\t\t$this->assign('models', $this->models);\n\t\t$this->assign('types', $this->types);\n\t}", "function actionView() {\n\t\t$this->getInputManager()->setLookupGlobals(utilityInputManager::LOOKUPGLOBALS_GET);\n\t\t$this->getInputManager()->addFilter('newslettertri', utilityInputFilter::filterInt());\n\t\t$data = $this->getInputManager()->doFilter();\n\t\t$oUser = $this->getRequest()->getSession()->getUser();\n\t\t$this->setSearchOptionFromRequestData($data, 'newslettertri');\n\t\tparent::actionView();\n\t}", "public function actionView($id)\n\t{\n //Capturar el modelo y modificarlo\n $modelo = $this->loadModel($id);\n $modelo->idArtProveedor = $this->getProveedorName($modelo->idArtProveedor);\n\t\t$this->render('view',array(\n\t\t\t'model'=>$modelo,\n\t\t));\n\t}", "function index()\n {\n $this->_view_edit('view');\n }", "public function actionView($id)\n {\n $dis = (new Query());\n $dis ->select([ 'tf_lunas.status'])\n ->FROM('tf_lunas')\n ->andWhere('tf_lunas.id_tf_lunas=:id_a', array(':id_a'=>$id))\n ->limit(6);\n $command = $dis->createCommand();\n $dis = $command->queryAll();\n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'dis' => $dis,\n ]);\n }", "function action_listview() {\n\t\t$this->view = 'toplist';\n\t\t//$GLOBALS['log']->fatal('in controller');\n\t\t$this->bean = new REG_PatientListView();\n\t}", "public function actionView($id)\n { \n $query = new Query;\n $query ->select(['ars_booking.id','ars_booking.book_status', 'ars_booking.book_date','ars_accommodation.acc_title','ars_user.user_name','ars_user.user_phone','ars_user.user_email','lookup_role.role']) \n ->from('ars_booking')\n ->leftJoin('ars_accommodation', 'ars_accommodation.id = ars_booking.acc_id')\n ->leftJoin('ars_user', 'ars_user.id = ars_booking.user_id')\n ->leftJoin('lookup_role', 'lookup_role.id = ars_user.role')\n ->where(['ars_booking.id'=>$id]);\n\n $command = $query->createCommand();\n $model = $command->queryAll();\n return $this->render('view', [\n 'model' => $model,\n ]);\n }", "public function actionView($order_id, $item_id, $shipping_id)\n{\nreturn $this->render('view', [\n'model' => $this->findModel($order_id, $item_id, $shipping_id),\n]);\n}", "function show()\r\n {\r\n $script = 'module='.$this->module.'&display='.$this->display.'&start='.$this->start.'&sort='.$this->sort.'&fltr='.$this->fltr.'&fln='.$this->fln;\r\n $script = $_SERVER['PHP_SELF'].\"?$script\";\r\n\r\n if( !$this->sort ) $this->sort='id';\r\n\t\tif($this->sort=='result') $this->sort='`result` desc';\r\n //if( strstr( $this->sort, 'seria' ) )$this->sort = $this->sort.' desc';\r\n $q = \"SELECT * FROM \".TblModSearchResult.\" where 1 order by \".$this->sort.\"\";\r\n //if( $this->srch ) $q = $q.\" and (name LIKE '%$this->srch%' OR email LIKE '%$this->srch%')\";\r\n if( $this->fltr ) $q = $q.\" and $this->fltr\";\r\n $res = $this->Right->Query( $q, $this->user_id, $this->module );\r\n //echo '<br>$q='.$q.' $res='.$res.'$this->Right->result='.$this->Right->result.' $this->user_id='.$this->user_id;\r\n if( !$res )return false;\r\n $rows = $this->Right->db_GetNumRows();\r\n\r\n /* Write Form Header */\r\n $this->Form->WriteHeader( $script );\r\n\r\n /* Write Table Part */\r\n AdminHTML::TablePartH();\r\n\r\n /* Write Links on Pages */\r\n echo '<TR><TD COLSPAN=17>';\r\n $script1 = 'module='.$this->module.'&fltr='.$this->fltr;\r\n $script1 = $_SERVER['PHP_SELF'].\"?$script1\";\r\n\t\tif( !$this->display ) $this->display = 20;\r\n //$this->Form->WriteLinkPages( $script1, $rows, $this->display, $this->start, $this->sort );\r\n\t\t$this->Form->WriteLinkPages( $script1.'&fltr='.$this->fltr, $rows, $this->display, $this->start, $this->sort );\r\n\r\n echo '<TR><TD COLSPAN=5>';\r\n $this->Form->WriteTopPanel( $script );\r\n\r\n echo '<td colspan=5>';\r\n echo $this->Form->TextBox('srch', $this->srch, 25);\r\n echo '<input type=submit value='.$this->Msg->show_text('_BUTTON_SEARCH',TblSysTxt).'>';\r\n\r\n /*\r\n echo '<td><td><td><td><td colspan=2>';\r\n $this->Form->WriteSelectLangChange( $script, $this->fln);\r\n */\r\n\r\n $script2 = 'module='.$this->module.'&display='.$this->display.'&start='.$this->start.'&task=show&fltr='.$this->fltr;\r\n $script2 = $_SERVER['PHP_SELF'].\"?$script2\";\r\n ?>\r\n <TR>\r\n <td class=\"THead\">*</Th>\r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=id><?=$this->Msg->show_text('FLD_ID')?></A></Th>\r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=query><?=$this->Msg->show_text('FLD_QUERY')?></A></Th>\r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=ip><?=$this->Msg->show_text('FLD_IP')?></A></Th>\r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=date><?=$this->Msg->show_text('FLD_DATE')?></A></Th>\r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=time><?=$this->Msg->show_text('FLD_TIME')?></A></Th>\r\n \r\n <td class=\"THead\"><A HREF=<?=$script2?>&sort=result><?=$this->Msg->show_text('FLD_RESULT')?></A></Th>\r\n \r\n <?\r\n\r\n $up = 0;\r\n $down = 0;\r\n $a = $rows;\r\n $j = 0;\r\n $row_arr = NULL;\r\n for( $i = 0; $i < $rows; $i++ )\r\n {\r\n $row = $this->Right->db_FetchAssoc();\r\n if( $i >= $this->start && $i < ( $this->start+$this->display ) )\r\n {\r\n $row_arr[$j] = $row;\r\n $j = $j + 1;\r\n }\r\n }\r\n\r\n $style1 = 'TR1';\r\n $style2 = 'TR2';\r\n for( $i = 0; $i < count( $row_arr ); $i++ )\r\n {\r\n $row = $row_arr[$i];\r\n\r\n if ( (float)$i/2 == round( $i/2 ) )\r\n {\r\n echo '<TR CLASS=\"'.$style1.'\">';\r\n }\r\n else echo '<TR CLASS=\"'.$style2.'\">';\r\n\r\n echo '<TD>';\r\n $this->Form->CheckBox( \"id_del[]\", $row['id'] );\r\n\r\n echo '<TD>';\r\n $this->Form->Link( $script.\"&task=edit&id=\".$row['id'], stripslashes( $row['id'] ) );\r\n\r\n echo '<TD align=center>';\r\n if( trim( $row['query'] )!='' ) echo $row['query'];\r\n\r\n echo '<TD align=center>';\r\n if( trim( $row['ip'] )!='' ) echo $row['ip'];\r\n\r\n echo '<TD align=center>';\r\n if( trim( $row['date'] )!='' ) echo $row['date'];\r\n\r\n echo '<TD align=center>';\r\n if( trim( $row['time'] )!='' ) echo $row['time'];\r\n\r\n echo '<TD align=center>';\r\n if( trim($row['result'])!='' ) echo $row['result'];\r\n\r\n } //-- end for\r\n\r\n AdminHTML::TablePartF();\r\n $this->Form->WriteFooter();\r\n return true;\r\n\r\n \r\n}", "public function oldviewAction() {\n\t\t$id = (int)$this->_request->getParam('id');\n\t\tPageTitle::setTitle($this->view, $this->_request, array($id));\n\t\t$debugdate = $this->_request->getParam('debugdate');\n\t\t$layout = trim($this->_request->getParam('layout',''));\n\t\t\n\t\t$taFinder = new TeachingActivities();\n\t\t$ta = $taFinder->getTa($id);\n\t\t\n\t\tif ($ta->isReleased() != true) {\n\t\t\tthrow new Exception(\"Teaching activity $id is not released yet.\");\n\t\t}\n\t\t\n\t\t$this->view->ta = $ta;\n\n\t\t$resourceError = false;\n\t\ttry {\n\t\t\t$resourceService = new MediabankResourceService();\n\t\t\t$resources = $resourceService->getResources($id, 'ta');\n\t\t\t$allowAddResources = $resourceService->allowAdd();\n\t\t} catch (Exception $ex) {\n\t\t\t$resourceError = true;\n\t\t\t$resources = array();\n\t\t\t$allowAddResources = false;\n\t\t}\n\t\t$this->view->allowAddResources = $allowAddResources;\n\t\t$this->view->resourceError = $resourceError;\n\t\t$this->view->resources = $resources;\n\t\t\n\t\t//Check if user is a staff\n\t\t$this->view->isStaffOrAbove = UserAcl::isStaffOrAbove();\n //Store ACL for each resource action which can be accessed by the current user\n //And allow/disallow those actions. \n\t\t$this->view->resourceAcl = ResourceAcl::accessAll(array('type'=>'ta','auto_id'=>$id));\n\n\t\t$this->view->revisions = $taFinder->getTaRevisions($ta->taid);\n\t\t$this->view->released_los = $ta->getLinkedLearningObjectiveWithStatus(Status::$RELEASED);\n\t\t$this->view->title = 'Teaching Activity - '.$ta->auto_id;\n\t\t\n\t\t$studentEvaluateService = new StudentEvaluateService();\n\t\t$this->view->taEvaluations = $studentEvaluateService->getEvaluationForTaId($id);\n\n\t\t$this->view->isMyTa = Utilities::isMyTa($ta);\n\t\t$this->view->debugdate = $debugdate;\n\n if(!empty($layout)) {\n switch($layout) {\n case 'pblview': \n $this->view->pblTaTypePrev = $this->_request->getParam('pblTaTypePrev','');\n $this->view->pblTaTypeNext = $this->_request->getParam('pblTaTypeNext','');\n $this->render('pblview');\n break;\n }\n }\n\t}", "public function index2Action()\n {\n $em = $this->getDoctrine()->getManager();\n\n $livres = $em->getRepository('BibliothequeBundle:livre')->findAll();\n $emprunt = $em->getRepository('BibliothequeBundle:emprunt')->findAll();\n\n return $this->render('livre/index2.html.twig', array(\n 'livres' => $livres,\n 'emprunt' => $emprunt\n\n ));\n }", "public function detail($id){\n \n $this->_contratante->_setIdTableValue($id);\n $params['rsContratante'] = $this->_contratante->getRecord();\n \\kerana\\View::showView($this->_current_module,'contratante/detail',$params);\n \n }", "public function indexAction() {\n \n //GET NAVIGATION\n $this->view->navigationStore = Engine_Api::_()->getApi('menus', 'core')\n ->getNavigation('sitestore_admin_main', array(), 'sitestore_admin_main_sitestoreoffer'); \n\n //CREATE NAVIGATION TABS\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')->getNavigation('sitestoreoffer_admin_main', array(), 'sitestoreoffer_admin_main_manage');\n\n //FORM GENERATION\n $this->view->formFilter = $formFilter = new Sitestoreoffer_Form_Admin_Manage_Filter();\n\n //FETCH OFFER DATAS\n $tableUser = Engine_Api::_()->getItemTable('user')->info('name');\n $tableSitestore = Engine_Api::_()->getItemTable('sitestore_store')->info('name');\n $table = Engine_Api::_()->getDbtable('offers', 'sitestoreoffer');\n $rName = $table->info('name');\n $select = $table->select()\n ->setIntegrityCheck(false)\n ->from($rName)\n ->joinLeft($tableUser, \"$rName.owner_id = $tableUser.user_id\", 'username')\n ->joinLeft($tableSitestore, \"$rName.store_id = $tableSitestore.store_id\", 'title AS sitestore_title');\n $values = array();\n if ($formFilter->isValid($this->_getAllParams())) {\n $values = $formFilter->getValues();\n }\n\n foreach ($values as $key => $value) {\n if (null === $value) {\n unset($values[$key]);\n }\n }\n if (isset($_POST['search'])) {\n if (!empty($_POST['owner'])) {\n $this->view->owner = $_POST['owner'];\n $select->where($tableUser . '.username LIKE ?', '%' . $_POST['owner'] . '%');\n }\n if (!empty($_POST['title'])) {\n $this->view->title = $_POST['title'];\n $select->where($rName . '.title LIKE ?', '%' . $_POST['title'] . '%');\n }\n if (!empty($_POST['sitestore_title'])) {\n $this->view->sitestore_title = $_POST['sitestore_title'];\n $select->where($tableSitestore . '.title LIKE ?', '%' . $_POST['sitestore_title'] . '%');\n }\n if (!empty($_POST['hotoffer'])) {\n $this->view->hotoffer = $_POST['hotoffer'];\n $_POST['hotoffer']--;\n $select->where($rName . '.hotoffer = ? ', $_POST['hotoffer']);\n }\n \n if (!empty($_POST['coupon_code'])) {\n $this->view->coupon_code = $_POST['coupon_code'];\n $select->where($rName . '.coupon_code LIKE ?', '%' . $_POST['coupon_code'] . '%');\n }\n }\n $values = array_merge(array(\n 'order' => 'offer_id',\n 'order_direction' => 'DESC',\n ), $values);\n\n $this->view->assign($values);\n $select->order((!empty($values['order']) ? $values['order'] : 'offer_id' ) . ' ' . (!empty($values['order_direction']) ? $values['order_direction'] : 'DESC' ));\n include APPLICATION_PATH . '/application/modules/Sitestore/controllers/license/license2.php';\n }", "public function show(retiro $retiro)\n {\n //\n }", "public function actionView($id)\n {\n $searchModel = new YxStaffImgSearch();\n $searchModel2 = new YxStaffImgSearch();\n $model = $this->findModel($id);\n $staff_id = $model->staff_id;\n #资格证书查询参数\n $queryParams = Yii::$app->request->queryParams;\n $queryParams['YxStaffImgSearch'] = ['staff_id' => $staff_id];\n $queryParams['YxStaffImgSearch'] = array_merge($queryParams['YxStaffImgSearch'], ['verify_state' => 3]);\n $dataProvider = $searchModel->search($queryParams);\n\n\n return $this->render('view', [\n 'model' => $model,\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function stronyAction() {\n\t\t\t$db = Zend_Registry::get('db');\n\n\t\t\t$id = (int)$this->getRequest()->getParam('id');\n\t\t\t$this->view->inwestycja = $db->fetchRow($db->select()->from('inwestycje')->where('id = ?', $id));\n\t\t\t$this->view->strony = $db->fetchAll($db->select()->from('inwestycje_strony')->where('id_inwest =?', $id)->order('sort ASC'));\n\t\t}", "function viewrec($recid)\r\n{\r\n\t$res = sql_select();\r\n \t$count = sql_getrecordcount();\r\n \tmysqli_data_seek($res, $recid);\r\n \t$row = mysqli_fetch_assoc($res);\r\n\t$customercode = $row[\"comp_id\"];\r\n\t$field=\"comp_id\";\r\n\t//echo \"View : OutletCode :\".$customercode;\r\n \tshowrecnav(\"view\", $recid, $count);\r\n?>\r\n\t<br>\r\n<?php\r\n\tshowrow($row, $recid); \r\n\t\r\n\t\r\n?>\r\n\t<br>\r\n\r\n\t<hr size=\"1\" noshade>\r\n\t<table class=\"bd\" border=\"0\" cellspacing=\"1\" cellpadding=\"4\">\r\n\t\t<tr>\r\n\t\t\t<td><input type=\"button\" name=\"btnEdit\" value=\"Edit Record\" onClick=\"javascript:LoadDiv('<?php echo CENTER_DIV ?>','company/company.php?status=true&a=edit&filter=<?php echo $customercode ?>&filter_field=<?php echo $field ?>')\"></td>\r\n\t\t</tr>\r\n\t</table>\r\n\t<?php\r\n \t\tmysqli_free_result($res);\r\n\t}", "public function actionViewByHrd($id){\n return $this->render('viewByHrd',[\n 'model' => $this->findModel($id),\n ]);\n }", "public function actionView($id){\n \n $workout = TrainingEntry::model()->findByPk($id);\n $user = User::model()->findByPk($workout->id_user); //vyhladanie autora treningu\n \n $friendship = null;\n $coach_cooperation = null;\n if($workout != null){\n if(!Yii::app()->user->isGuest){ //kontrola ci su priatelia, alebo sportovec<=>trener\n if(($friendship = Sparring::model()->find('id_user='.Yii::app()->user->id.' and status = 2'))==null){\n if(($coach_cooperation = CoachCooperation::model()->find('id_coach = '.Yii::app()->user->id.\n ' and id_athlete = '.$user->id.' and status = 1'))!=null){ \n }\n }\n }\n\n if($coach_cooperation != null){\n $sharedworkouts = TrainingEntry::model()->findAll('id_user='.$user->id.' and id != '.$workout->id.' order by date DESC limit 6');\n $sqlStatement = 'select c.*, u.fullname, u.profile_picture, u.gender, u.username from `comment` c \n left join `user` u on c.id_user = u.id where c.id_trainingentry ='.$workout->id.' order by c.date DESC limit 5';\n \n $allComments = $this->executeStringQuery($sqlStatement);\n \n $activity_array = Activity::model()->findAll(array('index'=>'id'));\n $comment = new Comment(); \n $comment->id_trainingentry = $workout->id;\n\n $this->render('view',\n array(\n 'workout'=>$workout,\n 'sharedworkouts'=>$sharedworkouts,\n 'activity_array'=>$activity_array,\n 'user'=>$user,\n 'comment'=>$comment,\n 'allComments'=>array_reverse($allComments),\n ));\n }\n elseif(((Yii::app()->user->isGuest || $friendship == null) && $workout->id_visibility != 1)){ //nemaju pravo trening nie je public\n $this->render('denied');\n }\n else {\n if((Yii::app()->user->isGuest || $friendship == null) && $workout->id_visibility == 1){ //trening je public a zobrazime aj dalsie autorove public treningy\n $sharedworkouts = TrainingEntry::model()->findAll('id_user='.$user->id.' and id_visibility = 1 and id != '.$workout->id.' order by date DESC limit 6');\n \n $sqlStatement = 'select c.*, u.fullname, u.profile_picture, u.gender, u.username from `comment` c \n left join `user` u on c.id_user = u.id where c.id_visibility = 1 and \n c.id_trainingentry ='.$workout->id.' order by c.date DESC limit 5';\n }\n else{\n $sharedworkouts = TrainingEntry::model()->findAll('id_user='.$user->id.' and id_visibility != 3 and id != '.$workout->id.' order by date DESC limit 6');\n \n $sqlStatement = 'select c.*, u.fullname, u.profile_picture, u.gender, u.username from `comment` c \n left join `user` u on c.id_user = u.id where (c.id_visibility !=3 and \n c.id_trainingentry = '.$workout->id.') or (c.id_visibility = 3 and id_user = '.Yii::app()->user->id.\n ' and c.id_trainingentry = '.$workout->id.') order by c.date DESC limit 5';\n if(Yii::app()->user->id == $user->id){ ///Prezeram si vlastny trening a mozem vidiet vsetky komenty\n $sqlStatement = 'select c.*, u.fullname, u.profile_picture, u.gender, u.username from `comment` c \n left join `user` u on c.id_user = u.id where c.id_trainingentry ='.$workout->id.' order by c.date DESC limit 5';\n }\n }\n $allComments = $this->executeStringQuery($sqlStatement);\n \n $activity_array = Activity::model()->findAll(array('index'=>'id'));\n $comment = new Comment(); \n $comment->id_trainingentry = $workout->id;\n\n $this->render('view',\n array(\n 'workout'=>$workout,\n 'sharedworkouts'=>$sharedworkouts,\n 'activity_array'=>$activity_array,\n 'user'=>$user,\n 'comment'=>$comment,\n 'allComments'=>array_reverse($allComments),\n ));\n }\n }\n else{\n $this->render('denied');\n }\n }", "public function show_detail($i_id=0)\r\n {\r\n try\r\n {\r\n if(trim($i_id)!=\"\")\r\n {\r\n $info=$this->mod_rect->fetch_this(decrypt($i_id));\r\n\r\n if(!empty($info))\r\n {\r\n $temp=array();\r\n $temp[\"s_id\"]= encrypt($info[\"id\"]);////Index 0 must be the encrypted PK \r\n\t\t\t\t\t$temp[\"s_title\"]= trim($info[\"s_title\"]);\r\n\t\t\t\t\t$temp[\"s_description\"]= trim($info[\"s_description\"]);\r\n\t\t\t\t\t$temp[\"s_buyer\"]= trim($info[\"s_buyer_name\"]);\r\n\t\t\t\t\t$temp[\"s_category\"] = trim($info[\"s_category\"]);\r\n\t\t\t\t\t$temp[\"s_is_active\"]= trim($info[\"s_is_active\"]);\r\n\t\t\t\t\t$temp[\"dt_created_on\"]= trim($info[\"dt_entry_date\"]);\r\n\t\t\t\t\t$temp[\"dt_approved_on\"]= trim($info[\"dt_approval_date\"]);\r\n\t\t\t\t\t$temp[\"dt_expired_on\"]= trim($info[\"dt_expire_date\"]);\r\n\t\t\t\t\tpr($temp);\r\n\t\t\t\t\t$this->data[\"info\"]=$temp;\r\n unset($temp);\r\n }\r\n unset($info);\r\n }\r\n $this->add_css(\"css/admin/style.css\");///include main css\r\n $this->add_js(\"js/jquery/jquery-1.4.2.js\");///include main css\r\n $this->add_css(\"js/jquery/themes/ui-darkness/ui.all.css\");///include jquery css\r\n \r\n $this->render(\"comm_payment_report/show_detail\",TRUE);\r\n unset($i_id);\r\n }\r\n catch(Exception $err_obj)\r\n {\r\n show_error($err_obj->getMessage());\r\n } \r\n }", "public function show($id)\n {\n $rapport = \\App\\Fabrication\\Rapport::find($id);\n if ($rapport != null) {\n if ($rapport->Zone == 'Z03') {\n if ($rapport->Etat == 'N'||(Auth::check() && Auth::user()->role == \"Chef Controle\")) {\n $defauts = \\App\\Visuel\\Defauts::where('Zone', '=', 'Z03')->get();\n $operations = \\App\\Visuel\\Operations::where('Zone', '=', 'Z03')->get();\n $details= DB::select('Select p.\"Nom\",d.\"Did\",d.\"Epaisseur\",d.\"Diametre\" from \"projet\" p join \"detailprojet\" d \n on p.\"Pid\"=d.\"Pid\" where p.\"Etat\"!=\\'C\\'');\n return view('RX1.RX1',\n ['rapport' => $rapport,\n 'rx1' => $rapport->rx1,\n 'details' => $details,\n 'arrets' => $rapport->arrets,\n 'defauts' => $defauts,\n 'operations' => $operations]);\n } elseif ($rapport->Etat == 'C') {\n return redirect(route('rapports_RX1.index'));\n }\n\n } else {\n return redirect(route('rapports_RX1.index'));\n }\n } else {\n return redirect(route('rapports_RX1.index'));\n }\n\n }" ]
[ "0.6378575", "0.63543147", "0.6303527", "0.626343", "0.62405634", "0.6164748", "0.6164748", "0.61529726", "0.60646427", "0.60126746", "0.59798884", "0.5977606", "0.59773314", "0.5975971", "0.5942107", "0.5936228", "0.5933144", "0.5933069", "0.59268993", "0.59268993", "0.5923289", "0.5908383", "0.59075296", "0.5906618", "0.5871935", "0.58690655", "0.58665013", "0.5861099", "0.58502305", "0.58458674", "0.5829328", "0.58233887", "0.5812747", "0.58116174", "0.5807209", "0.5806276", "0.5803967", "0.57988775", "0.5795012", "0.5790416", "0.57730925", "0.5772294", "0.5737361", "0.5732227", "0.57308745", "0.5730136", "0.57229555", "0.5718184", "0.57159305", "0.5711628", "0.57068664", "0.5699426", "0.5698968", "0.56974196", "0.56885207", "0.56861925", "0.5683744", "0.568151", "0.5678446", "0.5676753", "0.5669191", "0.566556", "0.56647676", "0.5658491", "0.56418747", "0.5641717", "0.56408393", "0.56316596", "0.5614496", "0.5614331", "0.5613366", "0.5613026", "0.561121", "0.56103677", "0.5608407", "0.5604088", "0.5603613", "0.56030715", "0.55995846", "0.559388", "0.5589834", "0.5588157", "0.55869806", "0.55853146", "0.5585025", "0.55838525", "0.55793506", "0.5574508", "0.5572032", "0.5563459", "0.55622923", "0.55586565", "0.5558091", "0.5558022", "0.5550337", "0.55488485", "0.5545176", "0.5542451", "0.55416906", "0.5541665" ]
0.695657
0
Add a new PermohonanIzin model. If creation is successful, the browser will be redirected to the 'view' page.
public function actionAddByStaf() { $model = new PermohonanIzin(); $inst_api = new InstApiModel(); $pegawai = Pegawai::find()->where(['user_id' => Yii::$app->user->identity->user_id])->one(); $jabatanByPegawai = $inst_api->getJabatanByPegawaiId($pegawai->pegawai_id); $model_atasan = array(); foreach($jabatanByPegawai as $data){ $model_atasan[] = $inst_api->getAtasanByJabatan($data->struktur_jabatan_id); } $atasan_nama = array(); foreach($model_atasan as $data) { if($data != NULL) $atasan_nama[] = $inst_api->getPejabatByJabatan($data->struktur_jabatan_id); } $atasan = array(); foreach($atasan_nama as $data) { foreach($data as $dat){ $atasan[] = $dat['pegawai_id']; } } $namaAtasan = array(); foreach($atasan as $data){ $namaAtasan[] = Pegawai::find()->where(['pegawai_id' => $data])->one(); } if ($model->load(Yii::$app->request->post())) { // $kategori = $model->kategori_id; $model->pegawai_id = $pegawai['pegawai_id']; //Handling File // if($kategori == 1) { // $model->file = UploadedFile::getInstance($model, 'file'); // if ($model->file != null) { // $model->file->saveAs('uploads/' . $model->file->baseName . '.' . $model->file->extension); // $model->file_surat = 'uploads/' . $model->file->baseName . '.' . $model->file->extension; // } // else if ($model->file == null) { // \Yii::$app->messenger->addErrorFlash("Harap melampirkan surat keterangan sakit!"); // return $this->render('addByStaf', [ // 'model' => $model, // 'namaAtasan' => $namaAtasan, // ]); // } // } if ($model->atasan_id == null) { \Yii::$app->messenger->addErrorFlash("Harap memilih atasan anda!"); return $this->redirect(\Yii::$app->request->referrer); } $result = \Yii::$app->fileManager->saveUploadedFiles(); if(isset($result)){ if($result->status == 'success'){ $model->kode_file_surat = $result->fileinfo[0]->id; $model->file_surat = $result->fileinfo[0]->name; } } // Handling Status $modelStatus = new StatusIzin(); if ($modelStatus->save()) { $model->status_izin_id = $modelStatus->status_izin_id; if ($model->save()) { $modelStatus->permohonan_izin_id = $model->permohonan_izin_id; $modelStatus->save(); //Handling Atasan if($model->atasan_id != NULL){ foreach($model->atasan_id as $data){ $atasan_model = new AtasanIzin(); $atasan_model->permohonan_izin_id = $model->permohonan_izin_id; $atasan_model->pegawai_id = $data; //$atasan_model->nama = $data; $atasan_model->save(); } } return $this->redirect(['view-by-staf', 'id' => $model->permohonan_izin_id]); } else { return $this->redirect(\Yii::$app->request->referrer); } } } else { return $this->render('addByStaf', [ 'model' => $model, 'namaAtasan' => $namaAtasan, ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function actionCreate()\n {\n $model = new Persyaratan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_persyaratan]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new JenisPelayanan();\n\n if ($model->load(Yii::$app->request->post()) && $model->simpan()) {\n return $this->redirect(['view', 'id' => $model->id_halaman]);\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new MaklumatPelajarPenjaga();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new InmueblePorcentajePropietario();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index' ,'id' => $model->inmueble_id]);\n } else {\n $model->inmueble_id=Yii::$app->request->get('id');\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\r\n {\r\n $model = new Pelanggaran();\r\n $trans = Yii::$app->db->beginTransaction();\r\n\r\n if ($model->loadAll(Yii::$app->request->post()) && $model->save()) {\r\n $check = $this->checkDetailPoint($model, 'create');\r\n \r\n if( isset($check['failed']) ){\r\n $trans->rollBack();\r\n Yii::$app->session->setFlash('error', $check['failed'] );\r\n return $this->redirect(['index']);\r\n }\r\n\r\n $trans->commit();\r\n Yii::$app->session->setFlash('success','Pelanggaran berhasil ditambahkan.');\r\n return $this->redirect(['index']);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function actionNew()\n {\n $model = new Pekerjaan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success','Berhasil Menambahkan Pekerjaan Baru');\n return $this->redirect(['/admin/user/index']);\n }\n\n return $this->render('form', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n\t{\n //if(!Yii::app()->user->checkAccess(Params::DEFAULT_CREATE)){throw new CHttpException(401,Yii::t('mds','You are prohibited to access this page. Contact Super Administrator'));}\n\t\t$model=new PPJadwaldokterM;\n $listHari = array( 'Senin'=> 'Senin',\n 'Selasa'=> 'Selasa',\n 'Rabu'=> 'Rabu',\n 'Kamis'=> 'Kamis',\n 'Jumat'=> 'Jumat',\n 'Sabtu'=> 'Sabtu',\n 'Minggu'=> 'Minggu',\n );\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t\n\n\t\tif(isset($_POST['PPJadwaldokterM']))\n\t\t{\n\t\t\t$model->attributes=$_POST['PPJadwaldokterM'];\n\t\t\t$model->jadwaldokter_buka = $model->jadwaldokter_mulai.' S/d '.$model->jadwaldokter_tutup;\n\t\t\tif($model->save()){\n Yii::app()->user->setFlash('success', '<strong>Berhasil!</strong> Data berhasil disimpan.');\n\t\t\t\t$this->redirect(array('admin','id'=>$model->jadwaldokter_id,'sukses'=>1));\n }\n\t\t}\n\n\t\t$this->render($this->path_view.'create',array(\n\t\t\t'model'=>$model,\n 'listHari'=>$listHari\n\t\t));\n\t}", "public function actionCreate()\n {\n //if(!Yii::app()->user->checkAccess(Params::DEFAULT_CREATE)){throw new CHttpException(401,Yii::t('mds','You are prohibited to access this page. Contact Super Administrator'));}\n $model=new RJAsuhankeperawatanT;\n\n // Uncomment the following line if AJAX validation is needed\n \n\n if(isset($_POST['RJAsuhankeperawatanT']))\n {\n \n if($model->save()){\n Yii::app()->user->setFlash('success', '<strong>Berhasil!</strong> Data berhasil disimpan.');\n $this->redirect(array('view','id'=>$model->asuhankeperawatan_id));\n }\n }\n\n $this->render('create',array(\n 'model'=>$model,\n ));\n }", "public function actionCreate()\n {\n $model = new HasilKonsultasi();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_hasil_konsultasi]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n\t{\n //if(!Yii::app()->user->checkAccess(Params::DEFAULT_CREATE)){throw new CHttpException(401,Yii::t('mds','You are prohibited to access this page. Contact Super Administrator'));}\n\t\t$model=new RKInfoPasienLamaV;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t\n\n\t\tif(isset($_POST['RKInfoPasienLamaV']))\n\t\t{\n\t\t\t$model->attributes=$_POST['RKInfoPasienLamaV'];\n\t\t\tif($model->save()){\n Yii::app()->user->setFlash('success', '<strong>Berhasil!</strong> Data berhasil disimpan.');\n\t\t\t\t$this->redirect(array('view','id'=>$model->pendaftaran_id));\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 actionCreate()\n {\n $model = new Pembelian();\n\n if ($model->load(Yii::$app->request->post())) {\n $transaction = Yii::$app->db->beginTransaction();\n try {\n $model->jenis_ppn = 'NON-PPN';\n \n $model->listPembelian = Yii::$app->request->post('ItemPembelian', []);\n if (($model->save())) {\n $transaction->commit();\n return $this->redirect(['index']);\n }\n } catch (\\Exception $ecx) {\n $transaction->rollBack();\n throw $ecx;\n }\n return $this->render('create', [\n 'model' => $model,\n ]);\n return $this->redirect(['index']);\n } else {\n $model->tanggal = date(\"Y-m-d\");\n return $this->render('create', [\n 'model' => $model,\n ]);\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 actionCreate()\n {\n //if(!Yii::app()->user->checkAccess(Params::DEFAULT_CREATE)){throw new CHttpException(401,Yii::t('mds','You are prohibited to access this page. Contact Super Administrator'));}\n $model=new SAAsuhankeperawatanT;\n\n // Uncomment the following line if AJAX validation is needed\n \n\n if(isset($_POST['SAAsuhankeperawatanT']))\n {\n \n if($model->save()){\n Yii::app()->user->setFlash('success', '<strong>Berhasil!</strong> Data berhasil disimpan.');\n $this->redirect(array('view','id'=>$model->asuhankeperawatan_id));\n }\n }\n\n $this->render('create',array(\n 'model'=>$model,\n ));\n }", "public function actionCreate()\n {\n $model = new Uprawnienia();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'konto_id' => $model->konto_id, 'podkategoria_id' => $model->podkategoria_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n\t{\n\t\t$this->layout='//layouts/column2';\n\t\t$model=new RekruitmenMaba;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['RekruitmenMaba']))\n\t\t{\n\t\t\t$model->attributes=$_POST['RekruitmenMaba'];\n\t\t\tif($model->save()){\n\t\t\t\tif($model->lampiran){\n\n\t\t\t\t}\n\t\t\t\t$this->redirect(array('view','id'=>$model->id_rmaba));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,'manajemen'=>'manajemen',\n\t\t));\n\t}", "public function actionCreate()\n\t{\n\t\t//if(!Yii::app()->user->checkAccess(Params::DEFAULT_CREATE)){throw new CHttpException(401,Yii::t('mds','You are prohibited to access this page. Contact Super Administrator'));}\n\t\t$model=new PPDokrekammedisM;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t\n\n\t\tif(isset($_POST['PPDokrekammedisM']))\n\t\t{\n\t\t\t$model->attributes=$_POST['PPDokrekammedisM'];\n\t\t\tif($model->save()){\n\t\t\t\tYii::app()->user->setFlash('success', '<strong>Berhasil!</strong> Data berhasil disimpan.');\n\t\t\t\t$this->redirect(array('admin','id'=>$model->dokrekammedis_id));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new TaPeriode();\n $pemda = \\common\\models\\TaPemdaUmum::find()->where('ID = (SELECT(MAX(ID)) FROM ta_pemda_umum)')->one();\n $model->ID_Tahun = (\\common\\models\\TaPeriode::find()->select('MAX(ID_Tahun) AS ID_Tahun')->one()['ID_Tahun']) + 1;\n $model->Kd_Prov = $pemda->Kd_Prov;\n $model->Kd_Kab_Kota = $pemda->Kd_Kab_Kota;\n //var_dump($model);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'ID_Tahun' => $model->ID_Tahun, 'Kd_Prov' => $model->Kd_Prov, 'Kd_Kab_Kota' => $model->Kd_Kab_Kota]);\n } else {\n return $this->renderAjax('create', [\n 'model' => $model,\n ]);\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 actionIzinByMahasiswaAdd()\n {\n $model = new IzinRuangan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['izin-by-mahasiswa-view', 'id' => $model->izin_ruangan_id]);\n } else {\n return $this->render('IzinByMahasiswaAdd', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\t$model=new Pago;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Pago']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Pago'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\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 actionCreate()\n {\n $model = new Peticiones();\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 actionCreate()\n {\n $model = new TaKegiatan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'Tahun' => $model->Tahun, 'Kd_Urusan' => $model->Kd_Urusan, 'Kd_Bidang' => $model->Kd_Bidang, 'Kd_Prog' => $model->Kd_Prog, 'Kd_Keg' => $model->Kd_Keg, 'Kd_Unit' => $model->Kd_Unit, 'Kd_Sub' => $model->Kd_Sub]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n\n $model = new Baocaokiemtra();\n $nguoinopthue = new Nguoinopthue();\n $quyetdinhkiemtra = new Quyetdinhkiemtra();\n $truongdoankiemtra = new Truongdoankiemtra();\n $lichsunopsaukiemtra = new Lichsunopsaukiemtra();\n $quyetdinhxuly = new Quyetdinhxuly();\n $datevalidation = new DateValidation();\n $lichsunopquyhoanthue = new Lichsunopquyhoanthue();\n\n if ($model->load(Yii::$app->request->post())) {\n $nguoinopthue->load(Yii::$app->request->post());\n $quyetdinhkiemtra->load(Yii::$app->request->post());\n $quyetdinhxuly->load(Yii::$app->request->post());\n $truongdoankiemtra->load(Yii::$app->request->post());\n $lichsunopsaukiemtra->load(Yii::$app->request->post());\n $lichsunopquyhoanthue->load(Yii::$app->request->post());\n $datevalidation->load(Yii::$app->request->post());\n\n if ($truongdoankiemtra->truongDoan) {\n $temp = Truongdoankiemtra::find()->where(['=', 'truongDoan', $truongdoankiemtra->truongDoan])->one();\n if (!$temp) {\n $truongdoankiemtra->save();\n $quyetdinhkiemtra->truongDoanId = $truongdoankiemtra->id;\n } else {\n $quyetdinhkiemtra->truongDoanId = $temp->id;\n }\n }\n\n $quyetdinhkiemtra->ngayQdKiemTra = $this->convertDatetime($datevalidation->ngayQdKiemTra);\n $quyetdinhkiemtra->ngayCongBoQdkt = $this->convertDatetime($datevalidation->ngayCongBoQdkt);\n $quyetdinhkiemtra->ngayTrinhVbTamDungKt = $this->convertDatetime($datevalidation->ngayTrinhVbTamDungKt);\n $quyetdinhkiemtra->ghiChu4 = $quyetdinhkiemtra->nienDoKiemTra;\n $quyetdinhkiemtra->ngayTao = date('Y-m-d 00:00:00', time() + 3600 * 7);\n $quyetdinhkiemtra->save();\n\n if ($datevalidation->soQdxl) {\n $quyetdinhxuly->soQdXuLy = $datevalidation->soQdxl;\n $quyetdinhxuly->ngayQdXuLy = $this->convertDatetime($datevalidation->ngayQdXuLy);\n $quyetdinhxuly->ngayTao = date('Y-m-d 00:00:00', time() + 3600 * 7);\n $quyetdinhxuly->save();\n }\n\n $model->soQdktId = $quyetdinhkiemtra->id;\n $model->soQdXuLyId = $quyetdinhxuly->id;\n\n $model->mst = $nguoinopthue->maSoThue;\n $model->ngayKyBbkt = $this->convertDatetime($datevalidation->ngayKyBbkt);\n\n if ($model->loaiKhuVucId == 0) {\n $model->loaiKhuVucId = null;\n }\n if ($model->loaiNdktId == 0) {\n $model->loaiNdktId = null;\n }\n if ($model->loaiQuyMoId == 0) {\n $model->loaiQuyMoId = null;\n }\n\n $model->save();\n\n $lichsunopsaukiemtra->soQdktId = $model->id;\n $lichsunopsaukiemtra->save();\n\n if ($model->soQdXuLyId) {\n preg_match('/^[0-9]{4}-[0-9]{4}$/', $quyetdinhkiemtra->nienDoKiemTra, $matches);\n\n if (count($matches)) {\n\n $baocaobaohiemxahoi = new Baocaobaohiemxahoi();\n\n $baocaobaohiemxahoi->soQdxlId = $quyetdinhxuly->id;\n $baocaobaohiemxahoi->mst = $nguoinopthue->maSoThue;\n $baocaobaohiemxahoi->truongDoan = $truongdoankiemtra->truongDoan;\n $baocaobaohiemxahoi->save();\n\n $year = explode('-', $quyetdinhkiemtra->nienDoKiemTra);\n\n for ($i = $year[0]; $i <= $year[1]; $i++) {\n $baocaobaohiemxahoitheonam = new Baocaobaohiemxahoitheonam();\n\n $baocaobaohiemxahoitheonam->mst = $nguoinopthue->maSoThue;\n $baocaobaohiemxahoitheonam->soQdxlId = $quyetdinhxuly->id;\n\n $baocaobaohiemxahoitheonam->bhxhId = $baocaobaohiemxahoi->id;\n $baocaobaohiemxahoitheonam->namKtbhxh = $i;\n\n $baocaobaohiemxahoitheonam->ghiChu3 = Nguoinopthue::findOne($nguoinopthue->maSoThue)->maSoThue;\n $baocaobaohiemxahoitheonam->ghiChu4 = $quyetdinhxuly->soQdXuLy;\n\n $baocaobaohiemxahoitheonam->save();\n\n }\n }\n\n }\n\n if ($model->loaiNdktId == 14 || $model->loaiNdktId == 15) {\n\n $sotheodoisauhoanthue = new Sotheodoisauhoanthue();\n\n $sotheodoisauhoanthue->truocHoanSauHoan = $model->loaiNdktId == 14 ? 0 : 1;\n\n $sotheodoisauhoanthue->mst = $model->mst;\n $sotheodoisauhoanthue->soQdKtId = $model->soQdktId;\n\n $quyetdinhxuphat = new Quyetdinhxuphat();\n if ($model->soQdXuLyId) {\n $quyetdinhxuphat->soQdXuPhat = $quyetdinhxuly->soQdXuLy;\n $quyetdinhxuphat->ngayQdXuPhat = $quyetdinhxuly->ngayQdXuLy;\n\n $sotheodoisauhoanthue->soQdXuPhatId = $quyetdinhxuphat->id;\n }\n\n $sotheodoisauhoanthue->chiTietHanhViViPham = $model->hanhViViPham;\n\n $sotheodoisauhoanthue->save();\n\n $lichsunopquyhoanthue = new Lichsunopquyhoanthue();\n $lichsunopquyhoanthue->soTheoDoiId = $sotheodoisauhoanthue->id;\n $lichsunopquyhoanthue->daNopThueThuHoi = $lichsunopsaukiemtra->daNopPhatSinhTruyHoan;\n $lichsunopquyhoanthue->daNopTienPhatViPham = $lichsunopsaukiemtra->daNopTienPhat;\n $lichsunopquyhoanthue->thoiDiemNop = date(\"Y-m-d H:i:s\", time() + 3600 * 7);\n\n $lichsunopquyhoanthue->save();\n }\n\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'nguoinopthue' => $nguoinopthue,\n 'quyetdinhkiemtra' => $quyetdinhkiemtra,\n 'truongdoankiemtra' => $truongdoankiemtra,\n 'quyetdinhxuly' => $quyetdinhxuly,\n 'lichsunopsaukiemtra' => $lichsunopsaukiemtra,\n 'datevalidation' => $datevalidation\n ]);\n }\n\n }", "public function actionCreate()\n {\n if(\\Yii::$app->user->can('gerenciamento-cadastros-basicos')){\n $model = new Pessoa();\n $alerta = \"Pessoa já cadastrada\";\n \n \n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n\n $validacpf = Pessoa::find()->where(['cpf' => $model->cpf])->one();\n if($validacpf == true){\n return $this->redirect(['create',\n 'model' => $model, 'alerta' => $alerta\n ]);\n }else{\n\n $model->save();\n return $this->redirect(['view', 'id' => $model->id]);\n }\n \n }else{\n return $this->render('create', [\n 'model' => $model, \n ]);\n }\n }else {\n throw new \\yii\\web\\ForbiddenHttpException('Você não está autorizado a realizar essa ação.');\n }\n \n }", "public function actionCreate()\n {\n $model = new EnglishNanorep();\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 actionCreate()\n {\n $model = new Talabalar();\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 actionCreate() {\n $model = new Foro();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new AktaBadan();\n\n if ($model->load(Yii::$app->request->post())) {\n $model->register = $this->generateRegister(\"register\");\n $model->save();\n return $this->redirect(['view', 'id' => $model->id, 'akta_badan_jenis_id' => $model->akta_badan_jenis_id]);\n } else {\n $not = Notaris::find()->where(['id'=>Yii::$app->user->identity->notaris_id])->one();\n $kelurahan = Kelurahan::find()->where(['id'=>$not->kelurahan_id])->one();\n $kecamatan = Kecamatan::find()->where(['id'=>$kelurahan->kecamatan])->one();\n $kabupaten = Kabupaten::find()->where(['id'=>$kecamatan->kabupaten])->one();\n\n //$model->kelurahan_id = $kelurahan->id;\n //$model->kecamatan_id = $kelurahan->kecamatan_id;\n $model->kabupaten_id = $kecamatan->kabupaten_id;\n $model->provinsi_id = $kabupaten->provinsi_id;\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $this->autorizaUsuario();\n $model = new Palestrante();\n\n if ($model->load(Yii::$app->request->post())) {\n if($model->save()){\n $this->mensagens('success', 'Palestrante Cadastrado', 'Palestrante foi Cadastrado com Sucesso');\n }else{\n $this->mensagens('danger', 'Palestrante Não Cadastrado', 'Houve um erro ao adicionar o Palestrante');\n }\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new SasaranEs4();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save()){\n flash('success','Data Sasaran Eselon IV Berhasil Disimpan');\n return $this->redirect(['index']);\n }\n \n flash('error','Data Sasaran Eselon IV Gagal Disimpan');\n \n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Nomina();\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 actionCreate()\n\t{\n\t\t$model=new Barangmasuk;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Barangmasuk']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Barangmasuk'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "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 actionCreate()\n {\n $model = new MintaData();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function create()\n {\n if(!session()->get('id'))\n {\n session()->setFlashdata('message', 'Silahkan login terlebih dahulu!');\n return redirect()->to(base_url('login'));\n }\n\n helper(['form']);\n\n $penghunis = new PenghunisModel();\n\n $data = array(\n 'title' => 'Tambah Data Paket',\n 'penghuni' => $penghunis->findAll(),\n );\n echo view('backend/paket/create', $data);\n }", "public function actionCreate()\n {\n $model = new Amphur();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->amphurId]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function add()\n\t{\t\n\t\t//Carrega o Model Categorias\t\t\t\n\t\t$this->load->model('CategoriasModel', 'Categorias');\n\t\n\t\t$data['categorias'] = $this->Categorias->getCategorias();\t\n\n\t\t// Editando texto do titulo do header\n\t\t$data['pagecfg']['Title'] = \"Adicionar Pessoa\";\t\t\n\n\t\t// Alterando o Estado da View Para Adicionar Pessoa\n\t\t$data['pagecfg']['viewState'] = \"Adicionar Pessoa\";\n\t\t$data['pagecfg']['btnState'] = \"Adicionar\";\n\t\t$data['pagecfg']['inputState'] = \"enable\";\n\t\t$data['pagecfg']['actionState'] = \"/ListarPessoas/salvar\";\n\t\t\n\t\t//Carrega a View\n\t\t$this->load->view('templates/header', $data);\n\t\t$this->load->view('PessoaView', $data);\n\t\t$this->load->view('templates/footer', $data);\n\t}", "public function actionCreate() {\n $model = new TabellePlattform();\n\n if ($model->loadAll(Yii::$app->request->post())) {\n if ($model->saveAll()) {\n// $this->success = 2; // 2->insert erfolgreich\n \n// $model = $this->findModel($model->id);\n// $model->setIsNewRecord(false);\n \n return $this->redirect(['update','id'=>$model->id,'mySuccess' => 2]);\n// return $this->render('update', [\n// 'model' => $model,\n// ]);\n// $this->redirect(\\Yii::$app->urlManager->createUrl(\"test/show\"));\n } else {\n $this->success = -1; // -1->insert Fehler\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Takwim();\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 actionCreate()\n\t{\n //if(!Yii::app()->user->checkAccess(Params::DEFAULT_CREATE)){throw new CHttpException(401,Yii::t('mds','You are prohibited to access this page. Contact Super Administrator'));}\n\t\t$model=new RKPengirimanrmT;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t\n\n\t\tif(isset($_POST['RKPengirimanrmT']))\n\t\t{\n\t\t\t$model->attributes=$_POST['RKPengirimanrmT'];\n\t\t\tif($model->save()){\n Yii::app()->user->setFlash('success', '<strong>Berhasil!</strong> Data berhasil disimpan.');\n\t\t\t\t$this->redirect(array('view','id'=>$model->pengirimanrm_id));\n }\n\t\t}\n\n\t\t$this->render($this->path_view.'create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new DetailKompensasiDanBenefitBulanan();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'Id_KomBen' => $model->Id_KomBen, 'Id_Karyawan' => $model->Id_Karyawan]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Produksi();\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 actionCreate()\n {\n $model = new Bilancio();\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 actionCreate()\n {\n // var_dump(1);\n $request = Yii::$app->request;\n $model['tintuc'] = new TinTuc();\n $model['loaitin']= DmLoaitin::find()->orderBy('ten_loai')->all();\n \n if ($request->isPost && $model['tintuc']->load($request->post()) && $model['tintuc']->validate()) {\n // $model['tintuc']->taikhoan_id= Yii::$app->user->id;\n // dd($model['tintuc']);\n $model['tintuc']->save();\n\n return $this->redirect(['view', 'id' => $model['tintuc']->id_tintuc]);\n }\n return $this->render('create', [\n 'model' => $model,\n 'const' => $this->const,\n 'categories' => $this->getCategories(),\n ]);\n \n }", "public function actionCreate()\n {\n $model = new TbDadosmes();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Planilla_entrega();\n $model->scenario = 'create';\n if ($model->load(Yii::$app->request->post())) {\n \n if ($model->validate() ){ \n \n \n $connection = \\Yii::$app->db;\n $transaction = $connection->beginTransaction();\n\n try {\n //Se guarda encabezado de la PLanilla\n $model->PE_PROCESADO = 0;\n if ($model->save()){\n $this->guardar_renglones($model);\n \n }else{\n $mensaje = \"\"; \n foreach ($model->getFirstErrors() as $key => $value) {\n $mensaje .= \"$value \\\\n\\\\r\";\n }\n \n throw new ErrorException($mensaje);\n }\n\n $this->verificar_pedido_completo($model->PE_NUMVALE);\n\n $transaction->commit();\n Yii::$app->getSession()->setFlash('exito_deposito_central', 'Planilla de entrega creada con éxito.');\n return $this->redirect(['view', 'id' => $model->PE_NROREM]);\n \n }\n catch (\\Exception $e) {\n $transaction->rollBack();\n \n Yii::$app->getSession()->setFlash('error_deposito_central', $e->getMessage());\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n \n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function add()\n {\n $data = [\n 'NamaMusyrif' => $this->input->post('nama_musyrif'),\n 'Email' => $this->input->post('email'),\n 'NoHp' => $this->input->post('no_hp'),\n ];\n $this->Musyrif_M->addMusyrif($data);\n $this->session->set_flashdata('pesan', 'Berhasil ditambahkan!');\n redirect('musyrif');\n }", "public function actionCreate()\n {\n $model = new ProvCompras();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n $this->layout=\"main\";\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate() {\n\t\t$request = Yii::app()->request;\n $form = new PersonaForm(\"new\");\n if($request->isPostRequest) {\n $form->attributes = $request->getPost('PersonaForm');\n if($form->validate()) {\n PersonaManager::savePersona($form);\n Yii::app()->user->setFlash('general-success', \"$form->nombre $form->apellido ha sido creado.\");\n $this->redirect('admin');\n }\n }\n $this->render('create', array('model'=>$form));\n }", "public function actionCreate() {\n\t\t$model = new Proyecto;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t$this -> performAjaxValidation($model);\n\n\t\tif (isset($_POST['Proyecto'])) {\n\t\t\t$model -> attributes = $_POST['Proyecto'];\n\t\t\t$model -> Usuario_id = Yii::app() -> user -> id;\n\t\t\tif ($model -> save())\n\t\t\t\t$this -> redirect(array('view', 'id' => $model -> id));\n\t\t}\n\n\t\t$this -> render('create', array('model' => $model, ));\n\t}", "function insert(){\n //Declarar variables para recibir los datos del formuario nuevo\n $nombre=$_POST['nombre'];\n $apellido=$_POST['apellido'];\n $telefono=$_POST['telefono'];\n\n $this->model->insert(['nombre'=>$nombre,'apellido'=>$apellido,'telefono'=>$telefono]);\n $this->index();\n }", "public function actionCreate()\n {\n $model = new Ocorrencia();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\t$this->updateOcorrenciaQueixa($_POST['Ocorrencia']['idQueixas'], $model->id);\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Lahan();\n\n if($model->load(Yii::$app->request->post())){\n $request = Yii::$app->request;\n if(empty($request->post('Lahan')['keldes'])) {\n if(empty($request->post('Lahan')['kec'])) {\n if(empty($request->post('Lahan')['kotakab'])) {\n $model->lokasi_kode = $request->post('Lahan')['provinsi'];\n } else {\n $model->lokasi_kode = $request->post('Lahan')['kotakab'];\n }\n } else {\n $model->lokasi_kode = $request->post('Lahan')['kec'];\n }\n if($model->save(false)){\n return $this->redirect(['view', 'id' => $model->id]);\n }\n } else {\n $model->lokasi_kode = $request->post('Lahan')['keldes'];\n if($model->save(false)){\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n\n // if ($model->load(Yii::$app->request->post()) && $model->save()) {\n // return $this->redirect(['view', 'id' => $model->id]);\n // } else {\n // return $this->render('create', [\n // 'model' => $model,\n // ]);\n // }\n }", "public function actionCreate()\n {\n $model = new Programador();\n //Yii::$app->request->post() wrapper de Yii para obtener datos seguros enviados por POST\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 }", "function add()\n { \n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n\t\t\t\t'kode_penyakit' => $this->input->post('kode_penyakit'),\n\t\t\t\t'id_gejala' => $this->input->post('id_gejala'),\n\t\t\t\t'mb' => $this->input->post('mb'),\n\t\t\t\t'md' => $this->input->post('md'),\n );\n \n $pengetahuan_id = $this->Pengetahuan_model->add_pengetahuan($params);\n redirect('pengetahuan/index');\n }\n else\n { \n $data['_view'] = 'pengetahuan/add';\n $this->load->view('layouts/main',$data);\n }\n }", "public function actionCreate()\n {\n\n $id_usuario_actual=\\Yii::$app->user->id;\n $buscaConcursante = Concursante::find()->where(['id' => $id_usuario_actual])->one();\n\n $request = Yii::$app->request;\n $id_postulacion = $request->get('id_postulacion');\n\n $buscaPostulacion = Postulacion::find()->where(['and',['id_postulacion' => $id_postulacion],['id_concursante' => $buscaConcursante->id_concursante]])->one();\n\n if($buscaPostulacion != null){\n\n $model = new Tablapresupuesto();\n\n if ($model->load(Yii::$app->request->post())) {\n $cantidad = (float) preg_replace('/[^0-9.]/', '', $model->cantidad);\n $precioUni = (float) preg_replace('/[^0-9.]/', '', $model->precioUnitario);\n $total = $cantidad * $precioUni;\n $model->costoTotal = $total.'';\n if($model->save()){\n return $this->redirect(['/site/section4', 'id_postulacion' => $id_postulacion]);\n }else{\n return $this->renderAjax('create', [\n 'model' => $model,\n ]);\n }\n } else {\n return $this->renderAjax('create', [\n 'model' => $model,\n ]);\n }\n\n }else{\n throw new NotFoundHttpException('La página solicitada no existe.');\n }\n\n }", "public function actionCreate()\n {\n $model = new Avisa_rotina();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Admin();\n\n /*if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->a_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }*/\n \n if (Yii::$app->request->post() && $model->validate()) {\n return $this->redirect(['view', 'id' => $model->a_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n\n\n }", "public function actionCreate()\r\n {\r\n $model = new HariTidakEfektif();\r\n\r\n if ($model->loadAll(Yii::$app->request->post())) {\r\n\r\n if( $this->checkDate($model->tanggal_awal, $model->tanggal_akhir) ){\r\n if( $this->validDate($model) ){\r\n $model->save();\r\n Yii::$app->session->setFlash('success', \"Hari tidak efektif berhasil ditambahkan.\");\r\n return $this->redirect(['view', 'id' => $model->id_hari_tidak_efektif]);\r\n }else{\r\n Yii::$app->session->setFlash('error', \"Tanggal akhir tidak boleh lebih kecil dari tanggal awal.\");\r\n }\r\n }else{\r\n Yii::$app->session->setFlash('error', 'Tanggal yang anda input telah tersedia, didata lain.');\r\n }\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function actionCreate() {\n $model = new Barang();\n\n if ($model->load(Yii::$app->request->post())) {\n\n $model->stok = 0;\n\n if ($model->save()) {\n if (Url::previous('b-create')) {\n $var = Url::previous('b-create');\n Yii::$app->session->remove('b-create');\n Yii::$app->getSession()->setFlash(\n 'success', 'Berhasil menambahkan barang : <b>' . $model->nama\n );\n return $this->redirect($var);\n } else {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\r\n {\r\n $model = new Apresentacao();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['index', 'id' => $model->idapresentacao]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "public function actionCreate()\n {\n $model = new Aduan();\n $modelAction = new AduanAction();\n\t\t\n if ($model->load(Yii::$app->request->post())) {\n $model->progress_id = 30;\n $model->created_at = new Expression('NOW()'); \n\t\t\t$model->updated_at = new Expression('NOW()'); \n\t\t\t$random = Yii::$app->security->generateRandomString();\n\t\t\t$model->token = $random;\n\t\t\t$code = rand(1000,9999);\n\t\t\t$model->email_code = $code;\n\t\t\tif($model->save()){\n\t\t\t\tYii::$app->session->addFlash('success', \"Aduan telah berjaya dihantar.\");\n\t\t\t\tif(!$model->upload()){\n\t\t\t\t\tYii::$app->session->addFlash('error', \"Fail lampiran gagal dimuatnaik\");\n\t\t\t\t}\n\t\t\t\treturn $this->redirect(['index']);\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$model->flashError();\n\t\t\t}\n \n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new PerfilUsuario();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "function add()\n {\n $data = array(\n 'judul' => $this->input->post('judul'),\n 'deskripsi' => $this->input->post('deskripsi'),\n 'tanggal' => $this->input->post('tanggal'),\n 'kesimpulan' => $this->input->post('kesimpulan'),\n );\n $this->RapatModel->insert($data);\n redirect(\"Rapat/lists\");\n }", "public function actionCreate()\n\t{\n //if (Yii::app()->user->checkAccess('AgendaCitasCedi_SolicitudCitaEntregaMercancia_Crear')) {\n $model=new SolicitudCitaEntregaMercancia;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['SolicitudCitaEntregaMercancia']))\n\t\t{\n\t\t\t$model->attributes=$_POST['SolicitudCitaEntregaMercancia'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->IdNumeroSolicitud));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t)); /*} else {\n $this->render('//site/error', array(\n 'code' => '101',\n 'message' => Yii::app()->params ['accessError']\n ));\n }*/\n\t\t\n\t}", "public function actionCreate()\n\t{\n\t\t//\n\t\t// if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n\t\t// try {\n\t\t// $model->save();\n\t\t// Yii::$app->session->setFlash('alert', [\n\t\t// 'body' => Yii::$app->params['create-success'],\n\t\t// 'class' => 'bg-success',\n\t\t// ]);\n\t\t// } catch (\\yii\\db\\Exception $exception) {\n\t\tYii::$app->session->setFlash('alert', [\n\t\t\t'body' => Yii::$app->params['create-danger'],\n\t\t\t'class' => 'bg-danger',\n\t\t]);\n\n\t\t// }\n\t\treturn $this->redirect(['index']);\n\t\t// }\n\n\t\t// return $this->render('create', [\n\t\t// 'model' => $model,\n\t\t// ]);\n\t}", "public function actionCreate($praktek_id)\n {\n $model = new PraktekMahasiswa();\n $model->praktek_id = $praktek_id;\n\n $angkatan = Angkatan::find()->all();\n $angkatan = ArrayHelper::map($angkatan,'id','tahun');\n array_unshift($angkatan,'Semua');\n\n $list_mahasiswa = PraktekMahasiswa::find()->where(['praktek_id'=>$praktek_id])->all();\n $list_mahasiswa = ArrayHelper::map($list_mahasiswa,'mahasiswa_id','mahasiswa_id');\n\n $searchModel = new MahasiswaSearch();\n $queryParams = Yii::$app->request->queryParams;\n if(isset($queryParams['MahasiswaSearch']['angkatan']) && $queryParams['MahasiswaSearch']['angkatan'] == 0)\n unset($queryParams['MahasiswaSearch']['angkatan']);\n $queryParams['MahasiswaSearch']['not_in_mahasiswa_id'] = $list_mahasiswa;\n $dataProvider = $searchModel->search($queryParams);\n if ($model->load(Yii::$app->request->post())){\n // && $model->save()) {\n $post = Yii::$app->request->post();\n foreach($post['mahasiswa'] as $mahasiswa)\n {\n $m = new PraktekMahasiswa;\n $m->praktek_id = $praktek_id;\n $m->mahasiswa_id = $mahasiswa;\n $m->save();\n }\n return $this->redirect(['index', 'PraktekMahasiswaSearch[praktek_id]' => $praktek_id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'angkatan' => $angkatan,\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function actionCreate()\n {\n $model = new Detallecarrito();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'codProducto' => $model->codProducto, 'idCarrito' => $model->idCarrito]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new Data();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->no]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\t$model=new Materia;\n\n\t\tif(isset($_POST['Materia']))\n\t\t{\n\t\t\t\n\t\t\t$model->attributes=$_POST['Materia'];\n\t\t\t$r = Materia::model()->find(\"cod_materia='\".$model->cod_materia.\"'\");\n\t\t\t\n\t\t\tif ($model->cod_materia == null)\t{ //Si el codigo de la materia es nulo \n\t\t\t\tYii::app()->user->setFlash('error', \"El código de la asignatura es obligatorio \");\n\t\t\t}\n\t\t\telse{\n\t\t\t\n\t\t\t if($r){ // Valida si el codigo ya fue usado por otra materia\n\t\t\t\t\tYii::app()->user->setFlash('error', \"Ya existe una Asignatura con el codigo \".$model->cod_materia);\n\t\t\t//\t\terror_log('codigo de materia repetido ');\t\n\t\t\t }else{\t\t\t\n\t\t\t\t\t$cod_p = false; // El codigo padre viene vacio \n\t\t\t\n\t\t\t\t\tif ($model->cod_materia_padre != null){\n\t\t\t\t\t\t$cod_p = true;\n\t\t\t\t\t\t$var = $model->cod_materia_padre;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$x = Materia::model()->find(\"cod_materia='\".$model->cod_materia_padre.\"'\");\n\t\t\t\t//\t\terror_log('el codigo padre viene con valor');\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(!$x && $cod_p == true){ //Viene un codigo y el codigo no existe \n\t\t\t\t\t\t\tYii::app()->user->setFlash('error', \"El código de la Asignatura a relacionar no existe.\");\n\t\t\t\n\t\t\t\t\t\t}else if ($cod_p && $x) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($model->save()){\n\t\t\t\t\t//\t\t\terror_log('GUARDO LA MATERIA');\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t} // Si el codigo a relacionar viene nulo debe guardar \n\t\t\t\t\t\t\t\terror_log('agregar hijos');\n\t\t\t\t\t\t\t\t$cli = new MiCliente();\n\t\t\t\t\t\t\t\t$res = $cli->padres_materia($var);\n\t\t\t\t\t\t//\t\terror_log('codigo a buscar '.$var);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\terror_log($res);\n\t\t\t\t\t\t\t\tif($res){\n\t\t\t\t\t\t\t\t\t$res_js=json_decode($res);\n\t\t\t\t\t\t\t\t\tforeach( $res_js as $itb){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$sql = Yii::app()->db->createCommand()->insert('relacion_materia',array('id_materia_hija'=>$model->id_materia,'id_materia_padre'=>$itb->id_materia_padre));\t\t\t\n\t\t\t\t\t\t\t\t\t\t$sql = Yii::app()->db->createCommand()->insert('relacion_materia',array('id_materia_hija'=>$model->id_materia,'id_materia_padre'=>$itb->id_materia_hija));\t\t\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//\t\terror_log('SALI del for');\n\t\t\t\t\n\t\t\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$sql = Yii::app()->db->createCommand()->insert('relacion_materia',array('id_materia_hija'=>$model->id_materia,'id_materia_padre'=>$x->id_materia));\n\t\t\t\t\t\t\t\t//\terror_log('No trajo informacion');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//error_log('ahora guardar materia');\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$this->redirect(array('view','id'=>$model->id_materia));\n\t\t\t\t\t\t\t} else {\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\tif($model->save()) // Si el codigo a relacionar viene nulo debe guardar \n\t\t\t\t\t\t\t\t\t$this->redirect(array('view','id'=>$model->id_materia));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t}// fin del segundo else. El codigo de la materia ya esta siendo usado \t\n\t\t} // fin del primer else \n\t} //fin del isset\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function create()\n {\n $prodis = Prodi::all();\n return view('mahasiswa.addMaha',['prodis'=>$prodis]);\n }", "public function actionCreate()\n {\n $model = new Admin();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "function add()\n { \n if(isset($_POST) && count($_POST) > 0) \n { \n $params = array(\n\t\t\t\t'ID_TRAKSAKSI' => $this->input->post('ID_TRAKSAKSI'),\n\t\t\t\t'STATUS' => $this->input->post('STATUS'),\n\t\t\t\t'TGL_BAYAR' => $this->input->post('TGL_BAYAR'),\n );\n \n $pembayaran_id = $this->Pembayaran_model->add_pembayaran($params);\n redirect('pembayaran/index');\n }\n else\n { \n $data['_view'] = 'pembayaran/add';\n $this->load->view('layouts/main',$data);\n }\n }", "public function actionCreate()\n {\n $model = new SkepPenetapanBcf15();\n //detail yang sudah konek idnya\n $searchModeldet = new \\backend\\modules\\penarikan\\models\\Bcf15Search(['status_bcf15'=>5, 'skep_penetapan_bcf15_id'=>'0']);\n $dataProviderdet = $searchModeldet->search(Yii::$app->request->queryParams);\n \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'searchModeldet' => $searchModeldet,\n 'dataProviderdet' => $dataProviderdet,\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\t$model=new Alumno;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t$this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Alumno']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Alumno'];\n\n\t\t\tif($model->save()){\n\t\t\t\t$model->con_semestre=Yii::app()->db->createCommand('select con_semestre from convocatoria where con_estado=1')->queryScalar();\n\t\t\t\t$model->save();\n\t\t\t\t\n\t\t\t\t//unir con cruge\n\t\t\t\t$values = array(\n\t\t\t\t 'username' => $model->al_rut,\n\t\t\t\t 'email' => $model->al_email,\n\t\t\t\t);\n\t\t\t\t$usuario = Yii::app()->user->um->createNewUser($values,$model->al_clave);\n\t\t\t\t\n\t\t\t\tYii::app()->user->um->changePassword($usuario,$model->al_clave);\n\n\t if(Yii::app()->user->um->save($usuario)){\n\n\t \t\t// echo \"Usuario creado: id=\".$usuario->primaryKey;\n\t\t \t\n\t\t \t// asignar el rol alumno\n\t\t \t$rbac = Yii::app()->user->rbac;\n \t$authitemName = 'alumno';\n \t$userId = $usuario->primaryKey;\n \t$rbac->assign($authitemName, $userId);\n\t\t\t\t\t//fin-asignar el rol alumno\n\t }\n\t else{\n\t $errores = CHtml::errorSummary($usuario);\n\t echo \"no se pudo crear el usuario: \".$errores;\n\t }\n\t\t\t\t//fin_unir con cruge\n\n\t $this->redirect(array('view','id'=>$model->al_rut));\n\t\t\t}\n\t\t\t\t\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n\t\t{\n\t\t\tif (Yii::app()->request->isAjaxRequest) {\n\t\t\t\t$modelTopografi = new Topografi;\n\n\t\t\t\tif ($_POST) {\n\t\t\t\t\t$modelTopografi['datar']=$_POST['datar'];\n\t\t\t\t\t$modelTopografi['bergelombang']=$_POST['bergelombang'];\n\t\t\t\t\t$modelTopografi['curam']=$_POST['curam'];\n\t\t\t\t\t$modelTopografi['sgtcuram']=$_POST['sgtcuram'];\n\t\t\t\t\t$modelTopografi['tinggidpl']=$_POST['tinggidpl'];\n\t\t\t\t\t$modelTopografi->save();\n\t\t\t\t}\n\n\t\t\t\t$this->render('create');\n\t\t\t}\n\t\t}", "public function actionCreate()\n {\n///\n$nombre=Yii::$app->user->identity->username;\n$connection = \\Yii::$app->db;\n$db = $connection->createCommand(\"INSERT INTO auditoria (id, user, modelo, accion, fechahora) VALUES (NULL, '$nombre', 'PropiedadDet', 'Crear', NOW());\")->execute();\n///\n\n $model = new PropiedadDet();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n// return $this->redirect(['view', 'id' => $model->id_propiedad_det]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n\t{\n\t\t$model=new Indicadores;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Indicadores']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Indicadores'];\n\t\t\tif($model->save()){\n\t\t\t\tYii::app()->user->setFlash(\"success\",\"EL indicador de ha guardado de manera correcta\");\n\t\t\t\t// agregar valores segun los periodos existentes\n\t\t\t\t$this->nuevosValores($model->id);\n\n\t\t\t\t$this->redirect(array('index','id'=>$model->id));\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new Inventorier();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->codebien]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n {\n $model = new DetailPkl();\n\n $userid = Yii::$app->user->identity->id;\n $mahasiswa = VwmahasiswaProdi::find()\n ->where(['user_id' => $userid])\n ->one();\n\n $listPkl = PengajuanPkl::find()\n ->where(['mhs_id' => $mahasiswa->mhsid])\n ->orderBy(['id' => SORT_DESC])\n ->one();\n\n $mitra = MitraPkl::find()\n ->where(['id' => $listPkl->mitra_id])\n ->one();\n\n if ($model->load(Yii::$app->request->post())) {\n $laporan = UploadedFile::getInstance($model, 'laporan');\n if (!is_null($laporan)) {\n $model->laporan = $laporan->name;\n // $ext = end((explode(\".\", $laporan->name)));\n // generate a unique file name to prevent duplicate filenames\n // $model->image_web_filename = Yii::$app->security->generateRandomString() . \".{$ext}\";\n // the path to save file, you can set an uploadPath\n // in Yii::$app->params (as used in example below) \n Yii::$app->params['uploadPath'] = Yii::$app->basePath . '/web/uploads/file-laporan/';\n $path = Yii::$app->params['uploadPath'] . $model->laporan;\n $laporan->saveAs($path);\n }\n $model->pkl_id = $listPkl->id;\n $model->dosen_id = $listPkl->dosen_id;\n $model->created_at = date('d-M-Y');\n $model->updated_at = date('d-M-Y');\n if ($model->save()) {\n return $this->redirect(['/pkl/detail-pkl']);\n } else {\n var_dump($model->getErrors());\n die();\n }\n }\n return $this->render('create', [\n 'model' => $model,\n 'userid' => $userid,\n 'mahasiswa' => $mahasiswa,\n 'listPkl' => $listPkl,\n 'mitra' => $mitra,\n ]);\n }", "public function actionCreate() {\n \n $model = new Pago;\n $transaction=$model->dbConnection->beginTransaction();\n try\n {\n \n //Cargo datos en Pagos\n\n $recibo = $this->loadModelRecibo($_GET['id']);\n $importe = $recibo->importePendiente;\n \n if (isset($_GET['id'])) {\n $model->attributes = $_GET['id'];\n $model->idRecibo = $recibo->idRecibo;\n $model->fecha = date('Y-m-d H:i:s');\n $model->importe = $recibo->importePendiente;\n $model->idUsuario = Yii::app()->user->id;\n $model->idMedioPago = 1;\n \n \n if ($model->save()) {\n \n // Modifico Recibos actualizando datos\n\n $recibo->importePendiente = 0;\n $recibo->fechaCobroCompleto = $model->fecha;\n \n // Modifico la Cuenta con los saldos\n\n $recibo->idCuenta0->saldo = $recibo->idCuenta0->saldo - $importe;\n $recibo->save();\n \n $transaction->commit();\n \n Yii::app()->user->setFlash('success',\"El pago fue registrado.\");\n $this->redirect(array('view', 'id' => $model->idPago));\n }\n $transaction->rollback();\n }\n \n $this->render('update', array('model' => $model,));\n \n } \n catch(Exception $e)\n {\n $transaction->rollback();\n \n throw $e;\n }\n \n }", "public function actionCreate()\n\t{\n\t\t$model=new Productos;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Productos']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Productos'];\n $model->precioUnitario=str_replace(\",\",\"\",$model->precioUnitario);\n\t\t\t$model->precioUnitario=str_replace(\"$\",\"\",$model->precioUnitario); \n\t\t\tif($model->save())\n {\n $objBitacora = new Bitacora();\n $objBitacora->setMovimiento('CREAR','Productos','',$model->id,'',4);\n Yii::app()->user->setFlash('success',Yii::t('app','Item successfully added'));\n $this->redirect(array('admin'));\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 actionCreate()\n\t{\n\t\t$model=new Imparte;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Imparte']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Imparte'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->imp_id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\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}", "public function actionCreate() {\r\n $model = new Fltr();\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('create', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }", "function add()\n { \n $this->load->library('form_validation');\n\n\t\t$this->form_validation->set_rules('prodi_nama','Prodi Nama','required');\n\t\t$this->form_validation->set_rules('prodi_akreditasi','Prodi Akreditasi','required');\n\t\t\n\t\tif($this->form_validation->run()) \n { \n $params = array(\n\t\t\t\t'prodi_akreditasi' => $this->input->post('prodi_akreditasi'),\n\t\t\t\t'prodi_nama' => $this->input->post('prodi_nama'),\n );\n \n $prodi_id = $this->Prodi_model->add_prodi($params);\n redirect('prodi/index');\n }\n else\n {\n\t\t\t$this->load->model('Akreditasi_model');\n\t\t\t$data['all_akreditasi'] = $this->Akreditasi_model->get_all_akreditasi();\n \n $data['_view'] = 'prodi/add';\n $this->load->view('layouts/main',$data);\n }\n }", "public function actionCreate()\n {\n $this->setModelByConditions();\n\n if (Yii::$app->request->isPost &&\n $this->model->load(Yii::$app->request->post()) &&\n $this->setAdditionAttributes() &&\n $this->model->save()) {\n\n if ($this->viewCreated) {\n $redirectParams = [\n $this->urlPrefix.'view',\n 'id' => $this->model->getId(),\n ];\n } else {\n $redirectParams = [\n $this->urlPrefix.'index',\n ];\n }\n\n return $this->redirect($redirectParams);\n }\n\n return $this->render('create',\n ArrayHelper::merge(\n [\n 'model' => $this->model,\n ],\n $this->getAdditionFields()\n )\n );\n }", "public function actionCreate()\n\t{\n\t\t$model = $this->loadModel();\n\n\t\tif(isset($_POST[get_class($model)]))\n\t\t{\n $model = $this->_prepareModel($model);\n if (Yii::app()->getRequest()->isAjaxRequest) {\n if($model->save())\n echo json_encode($model);\n else\n echo json_encode(array('modelName' => get_class($model),'errors' => $model->getErrors()));\n\n Yii::app()->end();\n }\n\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}", "public function actionCreate()\n {\n $model = new HorarioEstudiante();\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 addAction(){\n\t\t\t$emp = new Empresa();\n\t\t\t//cargamos el objeto mediantes los metodos setters\n\t\t\t$emp->id = '0';\n\t\t\t$emp->nombre_empresa = $this->getPostParam(\"nombre_empresa\");\n\t\t\t$emp->nit = $this->getPostParam(\"nit\");\n\t\t\t$emp->direccion = $this->getPostParam(\"direccion\");\n\t\t\t$emp->logo = $this->getPostParam(\"imagen\");\n\t\t\t$emp->regimen_id = $this->getPostParam(\"regimen_id\");\n\t\t\t\t\t\t\t\t\n\t\t\tif($emp->save()){\n\t\t\t\tFlash::success(\"Se insertó correctamente el registro\");\n\t\t\t\tprint(\"<script>document.location.replace(\".core::getInstancePath().\"'empresa/mostrar/$emp->id');</script>\");\n\t\t\t}else{\n\t\t\t\tFlash::error(\"Error: No se pudo insertar registro\");\t\n\t\t\t}\n\t\t\t\t\t\n\t }", "public function create()\n {\n $model = new Keranjang;\n //list_barang dipakai untuk menampilkan \n //pilihan semua barang pada form\n $list_barang = Barang::all(); //select & barang\n return view('keranjang.create', compact(\n 'model', 'list_barang'\n ));\n }", "public function actionCreate() {\n $model = new Aviso;\n if (isset($_POST['Aviso'])) {\n $model->attributes = $_POST['Aviso'];\n #$nombre = $model->titulo;\n $fecha = Aviso::model()->getFechaRegistro();\n $model->fecha_publicacion = $fecha->readColumn(0);\n $adjuntos = $_FILES;\n $temp=$adjuntos['adjunto']['tmp_name'];\n if ($model->save()) {\n if (count($adjuntos['adjunto']['name']) > 0) { \n $this->guardarAdjuntos($adjuntos['adjunto']['name'], $model,$temp);\n }\n $this->redirect(array('view', 'id' => $model->id));\n }\n }\n $this->render('create', array(\n 'model' => $model,\n ));\n }", "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\n function actionCreate()\n {\n $model = new Phforum();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }", "public function actionCreate()\n\t{\n\n\t\t\t$catPuesto = new CatPuesto();\n\n // Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($catPuesto);\n\n\t\tif(isset($_POST['CatPuesto']))\n\t\t{\n\t\t\t$catPuesto->attributes=$_POST['CatPuesto'];\n\n\n $catPuesto->fecha_creacion = date('Y-m-d h:i:s');\n $catPuesto->persona_creacion = Yii::app()->user->id;\n $catPuesto->fecha_modificacion = date('Y-m-d h:i:s');\n $catPuesto->persona_modificacion = Yii::app()->user->id;\n $catPuesto->activo = 1;\n\n\n if($catPuesto->save())\n\t\t\t\t$this->redirect(array('index','id_cat_puesto'=>$catPuesto->id_cat_puesto));\n \t\t}\n\n\t\t$this->render('create',array(\n'catPuesto'=>$catPuesto,\n\t\t));\n\t}", "public function crear()\n {\n\n try{\n $model = new \\App\\Models\\Pasientes();\n\n foreach ($_POST as $campo => $val){\n $model->$campo = $val;\n }\n\n $model::insert($model);\n $this->historico();\n\n }catch(\\Exception $e){\n\n $this->formularioCreacion(['_error' => $e]);\n\n }\n\n }", "public function actionCreate()\n {\n $model = new MaterialesServicios();\n //Desplegables\n $unidad_medida = UnidadMedida::find()->all();\n $presentacion = Presentacion::find()->all();\n //autocompletar\n $sub_especfica = PartidaSubEspecifica::find()\n ->select(['nombre as value', 'id as id'])\n ->asArray()\n ->all();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'sub_especfica' => $sub_especfica,\n 'unidad_medida' => $unidad_medida,\n 'presentacion' => $presentacion\n ]);\n }\n }", "public function actionCreate()\n {\n $us = Usuarios::find()->where(['id' => Yii::$app->user->id])->one();\n if ($us->rol !== 'C' && $us->rol !== 'V') {\n return $this->goHome();\n }\n $model = new Uniformes();\n\n $model->colegio_id = $us->colegio_id;\n if ($model->load(Yii::$app->request->post())) {\n $model->foto = UploadedFile::getInstance($model, 'foto');\n if ($model->save() && $model->upload()) {\n if ($us->rol === 'V') {\n return $this->redirect(['index']);\n }\n return $this->redirect(['index']);\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function actionCreate()\n {\n $model = new Proses1();\n $detile = new DetileProses1();\n\t\t$listKeluarBarang = $model->getListBarangKeluar();\n $listBarangKeluarMentah = $model->getListBarangKeluarMentah();\n\n if ($model->load(Yii::$app->request->post()) && $detile->load(Yii::$app->request->post())) {\n\n if($model->save(false)){\n $detile->tanggal = $model->tanggal;\n $detile->id_proses_1 = $model->id;\n $detile->keterangan = $model->keterangan;\n if($detile->save(false)){\n Yii::$app->session->setFlash('success', 'Proses berhasil ditambahkan');\n return $this->redirect('index');\n }else{\n Yii::$app->session->setFlash('danger', 'Gagal Menambahkan data kedalam Detile Proses1');\n return $this->redirect('index');\n }\n }else{\n Yii::$app->session->setFlash('danger', 'Gagal Menambahkan kedalam Proses1');\n return $this->redirect('index');\n }\n\t\t\t\n } else {\n return $this->renderAjax('create', [\n 'model' => $model,\n\t\t\t\t'listKeluarBarang'=>$listKeluarBarang,\n 'listBarangKeluarMentah'=>$listBarangKeluarMentah,\n 'detile'=>$detile\n ]);\n }\n }" ]
[ "0.7429417", "0.7268633", "0.72557503", "0.71904683", "0.71101326", "0.70590776", "0.7030122", "0.7014982", "0.69985616", "0.6988041", "0.69830704", "0.6953336", "0.6943081", "0.692837", "0.69234306", "0.69146234", "0.6914444", "0.6904922", "0.69031626", "0.6896199", "0.68822265", "0.6842645", "0.68253994", "0.6824381", "0.67986906", "0.6783532", "0.6765991", "0.6726822", "0.67156863", "0.67142797", "0.67072743", "0.6703922", "0.6701127", "0.6692508", "0.6686996", "0.66763467", "0.6668982", "0.66613084", "0.6657604", "0.66446024", "0.6616901", "0.6597217", "0.65914905", "0.65886974", "0.6574735", "0.65738887", "0.6551698", "0.6541111", "0.6532707", "0.6531274", "0.65281326", "0.65270513", "0.6525938", "0.6516407", "0.65113324", "0.65052396", "0.6494869", "0.64897287", "0.64895606", "0.64850163", "0.64839387", "0.64823353", "0.6471741", "0.64588875", "0.6437792", "0.64135903", "0.6407412", "0.64021504", "0.6402026", "0.639745", "0.63911724", "0.63885903", "0.63802046", "0.6364761", "0.6363748", "0.63621134", "0.63566303", "0.63562214", "0.63544494", "0.6354103", "0.63447654", "0.6339775", "0.6339482", "0.6334198", "0.6333654", "0.63335365", "0.6328545", "0.63259983", "0.6325156", "0.6323061", "0.6321681", "0.63208646", "0.6313421", "0.63051784", "0.6300814", "0.6298595", "0.6292375", "0.6288648", "0.6282741", "0.627586" ]
0.6454486
64
actionid: acceptbyhrd actiondesc: Accepting the izin by HRD
public function actionAcceptByHrd($id){ $model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all(); foreach ($model as $m) { $m->status_by_hrd = 6; } if($m->save()){ \Yii::$app->messenger->addSuccessFlash("Permohonan Izin telah di-accept oleh HRD"); return $this->redirect(['index-by-hrd']); } else { return $this->render('viewByHrd', [ 'model'=>$model ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function invi_accept() {\n if(isset($_GET['room_id'], $_GET['user_id'], $_GET['invi_id'])) {\n $data = $this->mod_user->md_acceptInvi($_GET['room_id'], $_GET['user_id'], $_GET['invi_id']);\n } else {\n die();\n }\n }", "public function handleAcceptInvite($iid) {\n\t\tCourseListModel::acceptInvite($iid);\n\t\t$this->redirect('this');\n\t}", "public function accept();", "public function accept($reward_id) {\n\n $user_id = $this->Auth->user('user_id');\n $reward = $this->Reward->acceptPendingReward($reward_id, $user_id);\n\n if (!empty($reward)) {\n\n // broadcast & refresh user's inventory\n $this->loadModel('User');\n $server = $this->User->getCurrentServer($user_id);\n\n if ($server) {\n $this->ServerUtility->broadcastRewardReceive($server, $user_id, $reward['Reward']);\n }\n }\n\n $this->loadItems();\n $this->loadModel('User');\n\n $this->User->id = $user_id;\n $credit = $this->User->field('credit');\n\n $this->set(array(\n 'credit' => $credit,\n 'userItems' => $this->User->getItems($user_id)\n ));\n\n $this->render('/Items/browse_inventory.inc');\n }", "public function requestAcceptAction() {\r\n $notification = $this->_getParam('notification', 0);\r\n\t\t$is_suggestionExist = Engine_Api::_()->getItem('user', $notification->object_id);\r\n\t\tif( empty($is_suggestionExist) ) {\r\n\t\t\t// If user are not exist then we are deleting the \"User Request\" which loggden user are gettig.\r\n\t\t\tEngine_Api::_()->getDbtable('notifications', 'activity')->delete(array('notification_id = ?' => $notification->notification_id));\r\n\t\t\t$this->_helper->redirector->gotoRoute(array('route' => 'default'));\r\n\t\t}else {\r\n\t\t\t$this->view->notification = $notification;\r\n\t\t}\r\n }", "public function GetAccept ();", "public function acceptAction($id)\n\t{\n\t\t$answer = $this->answers->find($id);\n\t\t$answer->save([\n\t\t\t'accepted' => 1,\t\n\t\t]);\n\t\t$this->addUserScore(1, $this->session->get('userId'));\n\t\t$this->addUserScore(10, $answer->idUser);\n\t\t$this->activities->logActivity('accepted' , $answer->id, $answer->idUser, $answer->idQuestion);\n\t\t$this->response->redirect($this->request->getLastUrl() . '#answerreply' . $answer->id);\n\t}", "public function accept(){\n \n }", "public function actionAccept()\n {\n if (!$this->isAdmin()) {\n $this->getApp()->action403();\n }\n\n $request = $this->getApp()->getRequest();\n $id = $request->paramsNamed()->get('id');\n $model = $this->findModel($id);\n if (!$model) {\n $this->getApp()->action404();\n }\n\n $status = $request->paramsGet()->get('status', 1);\n $model->status = $status;\n $model->save(false);\n\n return $this->back();\n }", "function acceptChallenge($data) {\n $ChallengeData = createChallengeDataObj();\n $acceptStatus = $ChallengeData->acceptChallenge($data);\n if($acceptStatus) {\n return array(\"acceptStatus\" => true);\n }else {\n return array(\"acceptStatus\" => false);\n }\n }", "protected function accepted()\n {\n $this->response = $this->response->withStatus(202);\n $this->jsonBody($this->payload->getOutput());\n }", "public function acceptOfferAction()\r\n {\r\n $this->checkSession();\r\n $offerId = $this->Request()->getParam(\"offerId\");\r\n\r\n // updating status of Offer\r\n $offer = Shopware()->Models()->find('Shopware\\CustomModels\\Offer\\Offer',$offerId);\r\n $offer->setStatus(4);\r\n try {\r\n Shopware()->Models()->persist($offer);\r\n Shopware()->Models()->flush();\r\n } catch(Exception $e) {\r\n }\r\n\r\n $this->redirect(array(\r\n 'module' => 'frontend',\r\n 'controller' => 'sKUZOOffer',\r\n 'action' => 'offers'\r\n ));\r\n\r\n }", "public function\n\tWillHandlerAcceptRequest(Nether\\Avenue\\RouteHandler $H):\n\tBool {\n\n\t\t$Class = $H->GetClass();\n\n\t\t// if the handler class does not have the query method then assume\n\t\t// that it will handle it.\n\t\tif(!method_exists($Class,'WillHandleRequest'))\n\t\treturn TRUE;\n\n\t\treturn (Bool)call_user_func_array(\n\t\t\t[$Class,'WillHandleRequest'],\n\t\t\t[ $this, $H ]\n\t\t);\n\t}", "public function actionAccept($id)\n {\n /*get cavity record*/\n $modelFound = $this->findModel($id);\n $userCreatorId = 1;\n if(User::find()->where(['username' => $modelFound->created_by_user])->exists()){\n /* @var $userModel User */\n $userModel = User::find()->where(['username' => $modelFound->created_by_user])->one();\n $userCreatorId = $userModel->id;\n }\n /*create property record*/\n $propertyRecord = new PropertyRecord();\n $propertyRecord->postcode = $modelFound->address_postcode_cavity_installation;\n $propertyRecord->address1 = $modelFound->address1_cavity_installation;\n $propertyRecord->address2 = $modelFound->address2_cavity_installation;\n $propertyRecord->address3 = $modelFound->address3_cavity_installation;\n $propertyRecord->town = $modelFound->address_town_cavity_installation;\n $propertyRecord->country = $modelFound->address_country_cavity_installation;\n $propertyRecord->installer = $modelFound->CWI_installer;\n $propertyRecord->created_by = $userCreatorId ;\n $propertyRecord->status = 'Accepted on System';\n /* CWI information */\n $propertyRecord->date_of_cwi = $modelFound->CWI_installation_date;\n $propertyRecord->installer = $modelFound->CWI_installer;\n $propertyRecord->product_installed = $modelFound->construction_type;\n $propertyRecord->save(false);\n\n /* Property Note*/\n $propertyNote = new PropertyNotes();\n $propertyNote->content = $modelFound->further_notes;\n $propertyNote->created_by = $userCreatorId;\n $propertyNote->note_type = PropertyNotes::NOTE_TYPE_INFO;\n $propertyNote->property_id = $propertyRecord->id;\n $propertyNote->save(false);\n\n /*create owner */\n $owner = new Owner();\n $owner->title = $modelFound->title;\n $owner->firstname = $modelFound->firstname;\n $owner->lastname = $modelFound->lastname;\n $owner->address1 = $modelFound->address1_cavity_installation;\n $owner->address2 = $modelFound->address2_cavity_installation;\n $owner->address3 = $modelFound->address3_cavity_installation;\n $owner->postalcode = $modelFound->address_postcode_cavity_installation;\n $owner->town = $modelFound->address_town_cavity_installation;\n $owner->country = \"United Kingdom\";\n $owner->email_address = $modelFound->email_address;\n if ($modelFound->second_application_telephone) {\n $owner->phone_number = $modelFound->telephone_number.' , '.$modelFound->second_application_mobile_landline;\n } else {\n $owner->phone_number = $modelFound->telephone_number;\n }\n $owner->phone_number = $modelFound->telephone_number;\n $owner->date_of_birth = $modelFound->birthday;\n $owner->save(false);\n\n $owner2 = new Owner();\n $owner2->title = $modelFound->second_application_title;\n $owner2->firstname = $modelFound->second_application_firstname;\n $owner2->lastname = $modelFound->second_application_lastname;\n $owner2->address1 = $modelFound->address1_cavity_installation;\n $owner2->address2 = $modelFound->address2_cavity_installation;\n $owner2->address3 = $modelFound->address3_cavity_installation;\n $owner2->date_of_birth = $modelFound->second_application_birthday;\n if (isset($modelFound->second_application_mobile_landline)) {\n $owner2->phone_number = $modelFound->second_application_telephone.','.$modelFound->second_application_mobile_landline;\n } else {\n $owner2->phone_number = $modelFound->second_application_telephone;\n }\n $owner2->email_address = $modelFound->second_application_email_address;\n $owner2->save(false);\n\n $propertOwner = new PropertyOwner();\n $propertOwner->owner_id = $owner->id;\n $propertOwner->property_id = $propertyRecord->id;\n $propertOwner->save(false);\n\n $propertOwner2 = new PropertyOwner();\n $propertOwner2->owner_id = $owner2->id;\n $propertOwner2->property_id = $propertyRecord->id;\n $propertOwner2->save(false);\n\n\n /*import the images and documents*/\n $supportingDocuments = $modelFound->getSupportingDocuments()->all();\n foreach ($supportingDocuments as $currentSupportingDocuments) {\n /* @var $currentSupportingDocuments CavitySupportingDocument */\n\n /*if current document has type supporting_document_images */\n if ($currentSupportingDocuments->type === 'supporting_document_images') {\n /*save to property document */\n $copyFrom = Yii::getAlias('@supporting_document_path') . DIRECTORY_SEPARATOR.$currentSupportingDocuments->document_name;\n $finalUploadName = Yii::getAlias('@upload_document_path') . DIRECTORY_SEPARATOR.$currentSupportingDocuments->document_name;\n if (isset($currentSupportingDocuments->document_name) && !empty($currentSupportingDocuments->document_name) && file_exists($copyFrom)) {\n copy($copyFrom, $finalUploadName);\n }\n $propertyDocument = new PropertyDocuments();\n $propertyDocument->property_id = $propertyRecord->id;\n $propertyDocument->document_description = $currentSupportingDocuments->document_description;\n $propertyDocument->document_name = $currentSupportingDocuments->document_name;\n $propertyDocument->save(false);\n } else {\n /*save it to pre appraisal images */\n $preAppraisalImage = new PropertyPreAppraisalImages();\n $copyFrom = Yii::getAlias('@supporting_document_path') . DIRECTORY_SEPARATOR.$currentSupportingDocuments->document_name;\n $finalUploadName = Yii::getAlias('@upload_image_path') . DIRECTORY_SEPARATOR.$currentSupportingDocuments->document_name;\n if (isset($currentSupportingDocuments->document_name) && !empty($currentSupportingDocuments->document_name) && file_exists($copyFrom)) {\n copy($copyFrom, $finalUploadName);\n }\n $preAppraisalImage->property_id = $propertyRecord->id;\n $preAppraisalImage->image_name = $currentSupportingDocuments->document_name;\n $preAppraisalImage->image_description = $currentSupportingDocuments->document_description;\n $preAppraisalImage->save(false);\n }\n $questionairePropertyRecord = new QuestionairePropertyRecord();\n $questionairePropertyRecord->cavity_form_id = $modelFound->id;\n $questionairePropertyRecord->property_record_id = $propertyRecord->id;\n $questionairePropertyRecord->save(false);\n }\n return $this->redirect(Url::to(['/record/update', 'id' => $propertyRecord->id]));\n }", "public function accept_action($user_id)\n {\n if (!OrganizerSettings::get()->locked && !OrganizerGroup::findGroup($user_id)->hasMaxTeamSize()) {\n OrganizerInvite::accept($user_id);\n }\n\n // Remove existing invites\n OrganizerInvite::cancel($user_id, User::findCurrent()->id);\n $this->redirect('show/index');\n }", "public function doRedirectAccept() {\n\t\t\theader(\"Location: ../../accept.php?\".http_build_query($_REQUEST));\n\t\t\texit;\n\t\t}", "public function accept($actor) {\n $arr = [\n \"type\" => \"Accept\",\n \"object\" => $this->activity_array,\n \"actor\" => $this->obj\n ];\n $accept = new Activity();\n $accept->fill($arr);\n // post new activity to the outbox\n return $accept; \n }", "public function acceptInvitation()\n\t{\n\t\t$id = $this->request->data['id'];\n\t\t$room_name = $this->request->data['roomName'];\n\t\t$invite['MeetingUser']['id'] = $id;\n\t\t//set status 1 as accepted\n\t\t$invite['MeetingUser']['is_accept'] = 1;\n\t\t$invite['MeetingUser']['is_read'] = 1;\n\t\t$invite['MeetingUser']['is_attend'] = 0;\n\t\t//set notification\n\t\t$oldCount1 = $this->Session->read('oldMeetingCount');\n\t\tif ($oldCount1>0) {\n\t\t\t$newCount1 = $oldCount1-1;\n\t\t\t$this->Session->write('oldMeetingCount',$newCount1);\n\t\t}\n\t\tif($this->MeetingUser->save($invite))\n\t\t\techo \"1\";\n\t\telse\n\t\t\techo \"0\";\n\t\texit;\n\t}", "public function testApproveSuccessForHr() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES,\n\t\t\t'prefix' => 'hr'\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$url = '/hr/deferred/approve/3';\n\t\t$this->testAction($url, $opt);\n\t\t$this->checkFlashMessage(__('The deferred save has been %s.', __('approved')));\n\t\t$result = $this->Controller->Deferred->find('list', ['recursive' => -1]);\n\t\t$expected = [\n\t\t\t1 => '1',\n\t\t\t2 => '2',\n\t\t\t4 => '4',\n\t\t\t5 => '5',\n\t\t];\n\t\t$this->assertData($expected, $result);\n\t}", "public function actionInHf($id = 0)\n {\n $theTour = Product::find()\n ->with([\n 'days',\n 'updatedBy',\n 'bookings',\n 'bookings.createdBy',\n ])\n ->where(['id'=>$id, 'op_status'=>'op'])\n ->asArray()\n ->one();\n\n if (!$theTour) {\n throw new HttpException(404, 'Tour not found.');\n }\n\n $theTourOld = Tour::find()\n ->where(['ct_id'=>$id, 'status'=>'on'])\n ->asArray()\n ->one();\n\n if (!$theTourOld) {\n throw new HttpException(404, 'Tour not found.');\n }\n\n // Tour guide list\n $sql = 'select guide_user_id, guide_name from at_tour_guides where tour_id=:tour_id AND parent_id=0 limit 100';\n $tourguideList = Yii::$app->db->createCommand($sql, [':tour_id'=>$theTour['id']])->queryAll();\n\n // Tour driver list\n $sql = 'select driver_user_id, driver_name from at_tour_drivers where tour_id=:tour_id AND parent_id=0 limit 100';\n $driverList = Yii::$app->db->createCommand($sql, [':tour_id'=>$theTour['id']])->queryAll();\n\n // Payer list\n $sql = 'select payer from cpt where tour_id=:tour_id group by payer order by payer limit 100';\n $payerList = Yii::$app->db->createCommand($sql, [':tour_id'=>$theTourOld['id']])->queryAll();\n\n $theForm = new TourInHdForm;\n $theForm->days = '1-'.$theTour['day_count'];\n $theForm->payer = 'Hướng dẫn MB 1';\n $theForm->language = Yii::$app->language;\n\n if ($theForm->load(Yii::$app->request->post()) && $theForm->validate()) {\n if (empty($theForm->options)) {\n $theForm->options = [];\n }\n $sql = 'SELECT *,\n IF (via_company_id=0, \"\", (SELECT name FROM at_companies c WHERE c.id=via_company_id LIMIT 1)) AS via_company_name,\n IF (by_company_id=0, \"\", (SELECT name FROM at_companies c WHERE c.id=by_company_id LIMIT 1)) AS by_company_name,\n IF (venue_id=0, \"\", (SELECT name FROM venues v WHERE v.id=venue_id LIMIT 1)) AS venue_name,\n 1\n FROM cpt WHERE (latest=dvtour_id OR latest=0) AND tour_id=:tour_id ORDER BY dvtour_day, dvtour_name, updated_at';\n $theCptx = Yii::$app->db->createCommand($sql, [':tour_id'=>$theTourOld['id']])->queryAll();\n\n // Get exchange rates\n $xRates = [\n 'USD'=>22295,\n 'VND'=>1,\n ];\n $sql = 'SELECT rate FROM at_xrates WHERE currency2=\"VND\" AND currency1=\"USD\" AND rate_dt<=\"'.$theTour['day_from'].'\" ORDER BY rate_dt DESC LIMIT 1';\n $theXRate = Yii::$app->db->createCommand($sql)->queryScalar();\n if ($theXRate) {\n $xRates['USD'] = $theXRate;\n }\n\n return $this->render('tours_in-hd_ok', [\n 'theTour'=>$theTour,\n 'theTourOld'=>$theTourOld,\n 'theForm'=>$theForm,\n 'tourguideList'=>$tourguideList,\n 'driverList'=>$driverList,\n 'payerList'=>$payerList,\n 'theCptx'=>$theCptx,\n 'xRates'=>$xRates,\n ]);\n }\n\n return $this->render('tours_in-hd', [\n 'theTour'=>$theTour,\n 'theTourOld'=>$theTourOld,\n 'theForm'=>$theForm,\n 'tourguideList'=>$tourguideList,\n 'driverList'=>$driverList,\n 'payerList'=>$payerList,\n ]);\n }", "public function accept_frnd_req($frnd_id) {\n $userid = $this->session->userdata('logged_in')['id'];\n $data = array(\n 'user_approved' => 1,\n 'active' => 1,\n 'req_accepted' => date('Y-m-d H:i:s')\n );\n $this->Friendsmodel->accept_frnd_req($frnd_id, $userid, $data);\n $data1 = array(\n 'resourse_approved' => 1,\n 'active' => 1,\n 'req_accepted' => date('Y-m-d H:i:s')\n );\n $this->Friendsmodel->accept_frnd_req($userid, $frnd_id, $data1);\n add_notification($frnd_id, $userid,'has accepted your friend request');\n }", "public function actionRejectByHrd($id){\n $model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all();\n\n foreach ($model as $m) {\n $m->status_by_hrd = 4;\n $m->status_by_atasan = 4;\n $m->status_by_wr2 = 4;\n }\n\n if($m->save()){\n \\Yii::$app->messenger->addErrorFlash(\"Permohonan Izin telah di-reject oleh HRD\");\n return $this->redirect(['index-by-hrd']);\n } else {\n return $this->render('viewByHrd', [\n 'model'=>$model\n ]);\n }\n }", "public function accept($id)\n {\n $interview = Interview::findOrFail($id);\n\n $interview->update([\n 'status' => 'accepted'\n ]);\n }", "public function accept($answer_id=0)\n\t{\n\t\tif (!$answer_id)\n\t\t{\n\t\t\t$this->addError(Lang::txt('No answer ID provided.'));\n\t\t\treturn false;\n\t\t}\n\n\t\t// Load the answer\n\t\t$answer = Response::oneOrFail($answer_id);\n\n\t\t// Mark it at the chosen one\n\t\t$answer->set('state', 1);\n\t\tif (!$answer->save())\n\t\t{\n\t\t\t$this->addError($answer->getError());\n\t\t\treturn false;\n\t\t}\n\n\t\t// Mark the question as answered\n\t\t$this->set('state', 1);\n\n\t\t// If banking is enabled\n\t\tif ($this->config('banking'))\n\t\t{\n\t\t\t// Accepted answer is same person as question submitter?\n\t\t\tif ($this->get('created_by') == $answer->get('created_by'))\n\t\t\t{\n\t\t\t\t$reward = Transaction::getAmount('answers', 'hold', $this->get('id'));\n\n\t\t\t\t// Remove hold\n\t\t\t\tTransaction::deleteRecords('answers', 'hold', $this->get('id'));\n\n\t\t\t\t// Make credit adjustment\n\t\t\t\t$BTL_Q = new Teller(User::get('id'));\n\t\t\t\t$BTL_Q->credit_adjustment($BTL_Q->credit_summary() - $reward);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$db = App::get('db');\n\n\t\t\t\t// Calculate and distribute earned points\n\t\t\t\t$AE = new Economy($db);\n\t\t\t\t$AE->distribute_points(\n\t\t\t\t\t$this->get('id'),\n\t\t\t\t\t$this->get('created_by'),\n\t\t\t\t\t$answer->get('created_by'),\n\t\t\t\t\t'closure'\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Set the reward value\n\t\t\t$this->set('reward', 0);\n\t\t}\n\n\t\t// Save changes\n\t\treturn $this->save();\n\t}", "public function acceptInvitation($id){\n\n $invite = Invitation::find($id);\n $invite->is_accepted = true;\n $invite->save();\n return redirect()->back();\n }", "public function acceptAction() {\n\n //CHECK AUTH\n if( !$this->_helper->requireUser()->isValid() ) return;\n\n $viewer = Engine_Api::_()->user()->getViewer();\n\n //GET THE SITEPAGE ID FROM THE URL\n $page_id = $this->_getParam('page_id');\n $sitepage = Engine_Api::_()->getItem('sitepage_page', $page_id);\n \n //MAKE FORM\n $this->view->form = $form = new Sitepagemember_Form_Member();\n $form->setTitle('Accept Page Invitation');\n $form->setDescription('Would you like to accept page invitation for this page?');\n $form->submit->setLabel('Accept Page Invitation');\n\n //PROCESS FORM\n if( !$this->getRequest()->isPost() ) {\n $this->view->status = false;\n $this->view->error = true;\n $this->view->message = Zend_Registry::get('Zend_Translate')->_('Invalid Method');\n return;\n }\n\n if( !$form->isValid($this->getRequest()->getPost()) ) {\n $this->view->status = false;\n $this->view->error = true;\n $this->view->message = Zend_Registry::get('Zend_Translate')->_('Invalid Data');\n return;\n }\n\n\t\t//SET THE REQUEST AS HANDLED\n\t\t$notification = Engine_Api::_()->getDbtable('notifications', 'activity')->getNotificationByObjectAndType($viewer, $sitepage, 'sitepagemember_invite');\n\t\tif( $notification ) {\n\t\t\t$notification->mitigated = true;\n\t\t\t$notification->save();\n\t\t}\n\n\t\t//GET VALUE FROM THE FORM.\n\t\t$values = $this->getRequest()->getPost();\n\t\t\n\t\t//ADD ACTIVITY\n\t\t$action = Engine_Api::_()->getDbtable('actions', 'activity')->addActivity($viewer, $sitepage, 'sitepage_join');\n\t\tif ( $action ) {\n Engine_Api::_()->getDbtable('actions', 'activity')->attachActivity( $action , $sitepage ) ;\n }\n\t\tEngine_Api::_()->getApi('subCore', 'sitepage')->deleteFeedStream($action,true);\n\t\tEngine_Api::_()->getDbtable('membership', 'sitepage')->update(array('active'=> '1', 'user_approved' => '1'), array('resource_id =?' => $page_id, 'user_id =?' => $viewer->getIdentity()));\n\t\t\n\t\t//MEMBER COUNT INCREASE WHEN MEMBER JOIN THE PAGE.\n\t\t$sitepage->member_count++;\n\t\t$sitepage->save();\n\t\t\n $this->view->status = true;\n $this->view->error = false;\n\n $message = Zend_Registry::get('Zend_Translate')->_('You have accepted the invite to the page %s');\n $message = sprintf($message, $sitepage->__toString());\n $this->view->message = $message;\n\n if( null === $this->_helper->contextSwitch->getCurrentContext() ) {\n return $this->_forwardCustom('success', 'utility', 'core', array(\n 'messages' => array($message),\n 'layout' => 'default-simple',\n 'parentRefresh' => true,\n ));\n }\n }", "public function doAcceptTransfer($iClient = 0, $iAccount = 0, $fromDate = null, $toDate = null, $iOperation = 0) {\n if ($iOperation == 0) {\n $this->redirect('ctransaction/showTransferList/', 'Nebyla zvolena operace', 3);\n }\n $oOperation = $this->moperation->getById($iOperation);\n $oOperation->state = 1;\n $oOperation->employee = $_SESSION['user_id'];\n $oOperation->update();\n $this->redirect('ctransaction/showTransferList/'.$iClient.'/'.$iAccount.'/'.$fromDate.'/'.$toDate, 'Převod byl schválen', 1);\n }", "function acceptInvite($invite_id,$user_id,$status)\n\t\t{\t\n\t\t\t$where_cond = array(\"status\"=>$status);\n\t\t\t$this->db->where('id',$invite_id);\n\t\t\tif($this->db->update('da_invite_hygiene_investigation',$where_cond))\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\t\n\t\t}", "public function actioninvokingThisEscrow(){\n $model = new Escrow;\n $escrow_id = $_POST['escrow_id'];\n $reason_for_invocation = $_POST['reason_for_invocation'];\n $accepted_escrow_invocation_terms= $_POST['terms_and_conditions'];\n $escrow_number = $_POST['escrow_number'];\n \n if($model->isThisEscrowInvokable($escrow_id )){\n \n if($model->isTheInvocationOfThisEscrowASuccess($escrow_id,$reason_for_invocation,$accepted_escrow_invocation_terms)){\n $msg = \"This is to ackonwledge your invocation of an escrow, number '$escrow_number'. We will be engaging with you subsequently until all disagreements are resolved. Sorry for the inconvenience\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n )\n );\n }else{\n $msg = \"Your attempt to invoke this escrow, number '$escrow_number'was not successful. Its likely it had previously being invoked or the escrow cannot be invoked. Please contact customer care for assistance\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg,\n )\n );\n }\n }else{\n $msg = \"This escrow cannot be invoked as it appears the escrow is yet to be accepted. Please contact customer care for clarification\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg,\n )\n );\n }\n \n \n \n }", "public function reqCHash() {}", "public function doExecute( ipsRegistry $registry )\r\n\t{\r\n\t\tif($this->request['request_method'] == 'post')\r\n\t\t{\r\n\t\t\tif(!marketRegistry::hasPluginPermission('use'))\r\n\t\t\t{\r\n\t\t\t\t$this->registry->getClass('output')->showError('no_permission');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(!isset($this->caches['ibm_bank_starter'][$this->request['starter_id']]))\r\n\t\t\t{\r\n\t\t\t\t$this->registry->getClass('output')->showError('no_permission');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->registry->getClass('class_localization')->loadLanguageFile( array( 'bank_bank' ) );\r\n\t\t\t\r\n\t\t\t$fee = numbers::round(numbers::multiply($this->caches['ibm_bank_starter'][$this->request['starter_id']]['s_interest_time'],$this->memberData['market_deduct']));\r\n\t\t\tif(numbers::compare($fee, $this->memberData[$this->settings['market_members_field']]) > 0)\r\n\t\t\t{\r\n\t\t\t\t$this->registry->getClass('output')->showError('not_enough_money');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(!$this->request['accountName'])\r\n\t\t\t{\r\n\t\t\t\t$this->registry->getClass('output')->showError('must_need_account_name');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$settings = unserialize($this->caches['market_plugin'][$this->request['plugin']]['plugin_config']);\r\n\t\t\tif($settings['max_account'])\r\n\t\t\t{\r\n\t\t\t\t$count = $this->DB->buildAndFetch(array('select'=>'COUNT(*) as total','from'=>'market_bank_accounts','where'=>\"a_mem_id=\".$this->memberData['member_id']));\r\n\t\t\t\t\r\n\t\t\t\tif($count['total'] >= $settings['max_account'])\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->registry->getClass('output')->showError('too_many_accounts');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$account = array();\r\n\t\t\t\r\n\t\t\t$account['a_random'] = numbers::multiply(1000000,(float)microtime());\r\n\t\t\t$account['a_mem_id'] = $this->memberData['member_id'];\r\n\t\t\t$account['a_name'] = $this->request['accountName'];\r\n\t\t\t$account['a_open'] = IPS_UNIX_TIME_NOW;\r\n\t\t\t$account['balance'] = 0;\r\n\t\t\t$account['a_interest_time'] = $this->caches['ibm_bank_starter'][$this->request['starter_id']]['s_interest_time'];\r\n\t\t\t$account['a_last_interest'] = IPS_UNIX_TIME_NOW - IPS_UNIX_TIME_NOW % 60;\r\n\t\t\t$account['interest_rate'] = $this->caches['ibm_bank_starter'][$this->request['starter_id']]['s_interest_rate'];\r\n\t\t\t$account['a_deposit_fee'] = $this->caches['ibm_bank_starter'][$this->request['starter_id']]['s_deposit_fee'];\r\n\t\t\t$account['a_withdraw_fee'] = $this->caches['ibm_bank_starter'][$this->request['starter_id']]['s_withdraw_fee'];\r\n\t\t\t$account['a_delete_fee'] = numbers::round(numbers::multiply($this->caches['ibm_bank_starter'][$this->request['starter_id']]['delete_fee'],$this->memberData['market_deduct']));\r\n\t\t\t\r\n\t\t\t$this->DB->insert('market_bank_accounts',$account);\r\n\t\t\t$account['account_id'] = $this->DB->getInsertId();\r\n\t\t\t$this->DB->update('members',array(\r\n\t\t\t\t\t\t\t\t\t\t\t\t$this->settings['market_members_field'] => numbers::subtract($this->memberData[$this->settings['market_members_field']], $fee),\r\n\t\t\t),\"member_id=\".$this->memberData['member_id']);\r\n\t\t\t\r\n\t\t\tbankPluginFunctions::logTransaction(bankPluginFunctions::getBankAccountID($account),'create',0,0,$fee);\r\n\t\t\t\r\n\t\t\t$this->registry->getClass('output')->redirectScreen( $this->lang->words['account_created'], $this->settings['base_url_with_app'] . \"plugin=\".$this->request['plugin'] . \"&amp;action=manage&amp;account_id=\" . $account['account_id'] );\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(!marketRegistry::hasPluginPermission('view'))\r\n\t\t\t{\r\n\t\t\t\t$this->registry->getClass('output')->showError('no_permission');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->registry->getClass('class_localization')->loadLanguageFile( array( 'bank_bank' ) );\r\n\t\t\t\r\n\t\t\t$this->request['account_id'] = intval($this->request['account_id']);\r\n\t\t\t\r\n\t\t\t$content = $this->registry->getClass('output')->getTemplate('ibm_plugin_bank')->listBankAccoutStarters($this->caches['ibm_bank_starter']);\r\n\t\t\t\r\n\t\t\t$template = $this->registry->getClass('output')->getTemplate('ibmarket')->ibmarketHTMLWrapper($content);\r\n\t\t\t\r\n\t\t\t$this->registry->getClass('output')->setTitle( $this->settings['market_name'] );\r\n\t\t\t$this->registry->getClass('output')->addContent( $template );\r\n\t\t\t\r\n\t\t\t$this->registry->getClass('output')->sendOutput();\r\n\t\t}\r\n\t}", "public function actionIndexByHrd(){\n $searchModel = new PermohonanIzinSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('indexByHrd',[\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function acceptInvite($inviterID) {\n\t\t$conditions = array();\n\t\t$conditions['user_one_id'] = $inviterID;\n\t\t$conditions['user_two_id'] = $this->id;\n\n\t\t$success = ConnectionFactory::updateTableRowAbsoluteBasic(\"agencies\", array('accepted'=>1), $conditions);\n\n\t\tif ($success) {\n\t\t\treturn ConnectionFactory::updateTableRowsRelativeOnIDs(\"users\", array('agency_size'=>1),\n\t\t\t\tarray($this->id, $inviterID));\n\t\t}\n\t}", "public function handleRequest() {\n // Make sure the action parameter exists\n $this->requireParam('action');\n\n // Call the correct handler based on the action\n switch($this->requestBody['action']) {\n\n case 'checkoutLocker':\n $this->handleCheckoutLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'remindLocker':\n $this->handleRemindLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'returnLocker':\n $this->handleReturnLocker();\n\t\t\t\tbreak;\n\n default:\n $this->respond(new Response(Response::BAD_REQUEST, 'Invalid action on Locker resource'));\n }\n }", "public function akismet_submit_ham( $key, $data ) {\n\t\t$new_data = $this->dwqa_prepare_data($data);\n\t\t$request = '';\n\n\t\t\tforeach($new_data as $kData => $vData){\n\t\t\t\tif($request == ''){\n\t\t\t\t\t$request .= $kData.'='.urlencode($vData);\n\t\t\t\t}else{\n\t\t\t\t\t$request .= '&'.$kData.'='.urlencode($vData);\n\t\t\t\t}\n\t\t\t}\n\t\t$host = $http_host = $key.'.rest.akismet.com';\n\t\t$path = '/1.1/submit-ham';\n\t\t$port = $this->port;\n\t\t$akismet_ua = $this->akismet_ua;\n\t\t$content_length = strlen( $request );\n\t\t$http_request = \"POST $path HTTP/1.0\\r\\n\";\n\t\t$http_request .= \"Host: $host\\r\\n\";\n\t\t$http_request .= \"Content-Type: application/x-www-form-urlencoded\\r\\n\";\n\t\t$http_request .= \"Content-Length: {$content_length}\\r\\n\";\n\t\t$http_request .= \"User-Agent: {$akismet_ua}\\r\\n\";\n\t\t$http_request .= \"\\r\\n\";\n\t\t$http_request .= $request;\n\t\t$response = '';\n\t\tif( false != ( $fs = @fsockopen( 'ssl://' . $http_host, $port, $errno, $errstr, 10 ) ) ) {\n\t\t\t \n\t\t\tfwrite( $fs, $http_request );\n\t\t \n\t\t\twhile ( !feof( $fs ) )\n\t\t\t\t$response .= fgets( $fs, 1160 ); // One TCP-IP packet\n\t\t\tfclose( $fs );\n\t\t\t \n\t\t\t$response = explode( \"\\r\\n\\r\\n\", $response, 2 );\n\t\t}\n\t\t \n\t\tif ( 'Thanks for making the web a better place.' == $response[1] )\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public function actionVypisHistorieAukce($id = null) \n {\n if (!$this->user->isAllowed('drazba','vypisHistorie'))\n throw new Nette\\Application\\ForbiddenRequestException(); \n }", "public function testApproveValidIdGetForHrAndAdmin() {\n\t\t$this->setExpectedException('MethodNotAllowedException');\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES => 'hr',\n\t\t\tUSER_ROLE_USER | USER_ROLE_ADMIN => 'admin',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'GET',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'approve',\n\t\t\t\t'4',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t}\n\t}", "public function testApproveEmptyIdForHrAndAdmin() {\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES => 'hr',\n\t\t\tUSER_ROLE_USER | USER_ROLE_ADMIN => 'admin',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'approve',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkFlashMessage(__('Invalid ID for deferred save'));\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "function acceptJob($postData)\n\t\t{\n\t\t\t//get the bid information\n\t\t\t$bid_details = $this->manageContent->getValue_where('bid_info','*','bid_id',$postData['bid']);\n\t\t\t\n\t\t\t//get the project details on which bid is made\n\t\t\t$project_details = $this->manageContent->getValue_where(\"project_info\",\"*\",\"project_id\",$bid_details[0]['project_id']);\n\t\t\t\n\t\t\t//get award info of this job\n\t\t\t$award_info = $this->manageContent->getValue_where(\"award_info\",\"*\",\"project_id\",$bid_details[0]['project_id']);\n\t\t\t\n\t\t\t//check for the valid contractor\n\t\t\tif( $_SESSION['user_id'] == $bid_details[0]['user_id'] && !empty($project_details) )\n\t\t\t{\n\t\t\t\t//update the accept flag\n\t\t\t\t$update_1 = $this->manageContent->updateValueWhere(\"award_info\",\"is_accepted\",1,\"bid_id\",$postData['bid']);\n\t\t\t\t$update_2 = $this->manageContent->updateValueWhere(\"award_info\",\"result_date\",date('Y-m-d g:i:s'),\"bid_id\",$postData['bid']);\n\t\t\t\t\n\t\t\t\t//create a work room for the job\n\t\t\t\tif( $update_1 == 1 && $update_2 == 1 )\n\t\t\t\t{\n\t\t\t\t\t//create the variables\n\t\t\t\t\t$workroom_id = uniqid('wkrm');\n\t\t\t\t\t$project_id = $bid_details[0]['project_id'];\n\t\t\t\t\t$employer_id = $project_details[0]['user_id'];\n\t\t\t\t\t$contractor_id = $bid_details[0]['user_id'];\n\t\t\t\t\t$date = date('Y-m-d');\n\t\t\t\t\t$time = date('h:i:s');\n\t\t\t\t\t\n\t\t\t\t\t//insert the values\n\t\t\t\t\t$column_name = array(\"workroom_id\", \"project_id\", \"bid_id\", \"emp_user_id\", \"con_user_id\", \"date\", \"time\", \"job_status\");\n\t\t\t\t\t$column_value = array($workroom_id, $project_id, $postData['bid'], $employer_id, $contractor_id, $date, $time,1);\n\t\t\t\t\t$insert = $this->manageContent->insertValue(\"workroom_info\",$column_name,$column_value);\n\t\t\t\t\tif($insert == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t//get contractor details\n\t\t\t\t\t\t$con_details = $this->manageContent->getValue_where('user_info', '*', 'user_id', $bid_details[0]['user_id']);\n\t\t\t\t\t\t//getting employer details\n\t\t\t\t\t\t$emp_details = $this->getEmailIdFromUserId($project_details[0]['user_id']);\n\t\t\t\t\t\t//sending mail to employer\n\t\t\t\t\t\t$this->mailSent->mailForAcceptingJob($emp_details[0], $emp_details[1], $con_details[0]['name'], $project_details[0]['title']);\n\t\t\t\t\t\t\n\t\t\t\t\t\techo 'Successfully Awarded';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo 'Please try again.';\n\t\t\t}\n\t\t}", "public function accept( Request $request, $id ) {\n\t\treturn ( new TripController() )->accept( $request, $id );\n\t}", "public function execute(AgaviRequestDataHolder $rd)\n\t{\n $query = $rd->getParameter('query');\n $start = $rd->getParameter('start', '0');\n $this->setAttribute('form', $this->getForm());\n if (is_null($query)) {\n return 'Input';\n }\n $appliance = $this->getContext()->getModel('Appliance', 'Appliance');\n $response = $appliance->query('*'.$query.'*', $start);\n $this->setAttribute('appliances', $response);\n\t\treturn 'Success';\n\t}", "public function actionAcceptByAtasan($id, $redback=null){\n $model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all();\n\n foreach ($model as $m) {\n $m->status_by_atasan = 6;\n $m->status_by_wr2 = 1;\n }\n\n if($m->save()){\n \\Yii::$app->messenger->addSuccessFlash(\"Permohonan Izin telah di-accept oleh Atasan\");\n if(is_null($redback))\n return $this->redirect(['index-by-atasan']);\n else\n return $this->redirect(Yii::$app->request->referrer);\n } else {\n return $this->render('viewByAtasan', [\n 'model'=>$model\n ]);\n }\n }", "public function apiAuthV1TeachingClassTeacherInvitationTeachingClassTeacherInvitationIdAcceptPost()\n {\n $this->apiAuthV1TeachingClassTeacherInvitationTeachingClassTeacherInvitationIdAcceptPostWithHttpInfo();\n }", "public function acceptInviteRequest()\n {\n $validations = ['isRoleUser', 'issetInvitation'];\n $request = Validations::manageValidations($validations);\n if ($request != false) {\n if ($request->accept == 1) {\n $query = \"UPDATE activities_users SET invite = 0 WHERE user_id = $request->authUserId and activity_id = $request->activity_id\";\n } else {\n $query = \"DELETE FROM activities_users WHERE user_id = $request->authUserId and activity_id = $request->activity_id\";\n }\n return $this->connection->nonQueryId($query);\n }\n return 'invalid data';\n }", "public function testApproveInvalidIdForHrAndAdmin() {\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES => 'hr',\n\t\t\tUSER_ROLE_USER | USER_ROLE_ADMIN => 'admin',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'approve',\n\t\t\t\t'1000',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkFlashMessage(__('Invalid ID for deferred save'));\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "public function actionViewByHrd($id){\n return $this->render('viewByHrd',[\n 'model' => $this->findModel($id),\n ]);\n }", "public function testIndexGroupActionPostSuccessForHr() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES,\n\t\t\t'prefix' => 'hr',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'data' => [\n\t\t\t\t'FilterGroup' => [\n\t\t\t\t\t'action' => GROUP_ACTION_DEFERRED_SAVE_DELETE,\n\t\t\t\t],\n\t\t\t\t'FilterData' => [\n\t\t\t\t\t[\n\t\t\t\t\t\t'Deferred' => [\n\t\t\t\t\t\t\t'id' => ['1', '2']\n\t\t\t\t\t\t]\n\t\t\t\t\t]\n\t\t\t\t]\n\t\t\t],\n\t\t\t'method' => 'POST',\n\t\t\t'return' => 'result',\n\t\t];\n\t\t$result = $this->testAction('/hr/deferred/index', $opt);\n\t\t$this->checkFlashMessage(__('Selected tasks has been processed.'));\n\n\t\t$result = $this->Controller->Deferred->find('list', ['recursive' => -1]);\n\t\t$expected = [\n\t\t\t3 => '3',\n\t\t\t4 => '4',\n\t\t\t5 => '5',\n\t\t];\n\t\t$this->assertData($expected, $result);\n\t}", "public function feVisitReportAction(){\n\n\t\t\t\t$params = $this->getRequest()->getParams(); \n\t\t\t\t$db = $this->db;\n\t\t\t\t$secretkey = $this->secretkey; \n\t\t\t\t$appkey\t= isset($params['appkey'])?$params['appkey']:\"\";\n\t\t\t\t$LoginID\t= isset($params['LoginID'])?$params['LoginID']:\"\";\n\t\t\t\t$device_id\t= isset($params['device_id'])?$params['device_id']:\"\";\n\t\t\t\t$farmer_code\t= isset($params['farmer_code'])?$params['farmer_code']:\"\";\n\t\t\t\t$comment\t= isset($params['comment'])?$params['comment']:\"\";\n\t\t\t\t$sink_date_time \t= isset($params['sink_date_time'])?$params['sink_date_time']:\"\";\n\n\n\t\t\t\t$error_code = 1;\n\t\t\t\t$succes = FALSE; \n\t\t\t\ttry{\n\t\t\t\t\t$db->beginTransaction();\n\t\t\t\t\tif($secretkey != $appkey){\n\t\t\t\t\t\tthrow new Exception(\"Invalid request.\");\n\t\t\t\t\t}\t\n\t\t\t\t\tif(!$LoginID || !$device_id){\n\t\t\t\t\t\tthrow new Exception(\"Required parameter missing.\");\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$user = new Application_Model_Users();\n\t\t\t\t\t$alldata = $user->getUserDataByLoginId($LoginID);\n\t\t\t\t\tif(!empty($alldata['LoginID']) != $LoginID){\n\t\t\t\t\t\tthrow new Exception('Invalid login id.');\n\t\t\t\t\t} \n\t\t\t\t\tif(!empty($alldata['DeviceID'])){\t\t\t\n\t\t\t\t\t\tif($alldata['DeviceID'] != $device_id){\n\t\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\t\tthrow new Exception('You are not athorized for this device.');\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\tif(strtolower($alldata['StaffStatus']) != 'ac'){\n\t\t\t\t\t\t$error_code = 3;\n\t\t\t\t\t\tthrow new Exception('Your account is not active.');\n\t\t\t\t\t}\t\n\n\t\t\t\t\tif($alldata['App_Access_Status'] == 2){\n\t\t\t\t\t\t$error_code = 2;\n\t\t\t\t\t\tthrow new Exception('This account deactivated by admin.');\n\t\t\t\t\t}\n\n\t\t\t\t\t$farmerMaster = new Application_Model_Farmermasters();\n\t\t\t\t\t$allFarmerData = $farmerMaster->getFarmerDetailsByFarmerCode($farmer_code); \t\n\t\t\t\t\t$farmerID = $allFarmerData['id'];\n\t\t\t\t\t$farmerCode = $allFarmerData['FarmerCode'];\n\n\n\t\t\t\t\t$fe_report = array(); \n\n\t\t\t\t\t$fe_report['comment'] = $comment;\n\n\t\t\t\t\t$fe_report['farmer_code'] = $farmer_code;\n\t\t\t\t\t$fe_report['farmer_id'] = $farmerID;\n\t\t\t\t\t$fe_report['fe_code'] = $LoginID;\n\t\t\t\t\t$fe_report['sink_date_time'] = $sink_date_time;\n\t\t\t\t\t$fe_report['created'] = $this->currdate; \n\t\t\t\t\t$db->insert('logi_fevisit_report', $fe_report);\n\n\t\t\t\t\t$landdetailId = $db->lastInsertId();\n\n\t\t\t\t\t$db->commit();\n\t\t\t\t\t$succes = TRUE;\t \n\t\t\t\t}\n\n\t\t\t\tcatch(Exception $e){\n //Rollback transaction\n\t\t\t\t\t$db->rollBack();\n\t\t\t\t\t$error= $e->getMessage();\n\t\t\t\t}\n\n\t\t\t\tif($succes == TRUE ){\n\t\t\t\t\techo json_encode(array(\"error_code\"=>'0', 'response_string'=>'Fe report Detail Inserted successfully.', 'fe_report_id'=>$landdetailId));\n\t\t\t\t\texit;\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\t\t\t\t\techo json_encode(array(\"error_code\"=>$error_code, 'response_string'=>$error));\n\t\t\t\t\texit;\n\t\t\t\t}\n\n\t\t\t}", "public function accept_invoice()\n\t{\n\t\tif ($_SERVER['REQUEST_METHOD'] === 'POST') {\n\t\t\tif (isset($_POST)) {\n\t\t\t\t$id = base64_decode($_POST['id']);\n\t\t\t\t// print_r($id);\n\t\t\t\t$tableName = 'master_invoice';\n\t\t\t\t$timestamp = date(\"Y-m-d H:i:s\");\n\t\t\t\tif (isset($id)) {\n\t\t\t\t\t$status = array('send_status' => ACCEPT);\n\t\t\t\t\t$condition = array('id' => $id);\n\t\t\t\t\t$result = $this->CustomModel->selectAllFromWhere($tableName, $condition); // Checking row into the data base\n\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t'invoice_number' => $result[0]['invoice_number'],\n\t\t\t\t\t\t'item_code' => $result[0]['product_code'],\n\t\t\t\t\t\t'invoice_date' => $result[0]['doi'],\n\t\t\t\t\t\t'item_description' => $result[0]['product_description'],\n\t\t\t\t\t\t'qty' => $result[0]['product_qty'],\n\t\t\t\t\t\t'closing_stock' => $result[0]['product_qty'],\n\t\t\t\t\t\t'amount' => $result[0]['product_amount'],\n\t\t\t\t\t\t'rate' => $result[0]['product_rate'],\n\t\t\t\t\t\t'update_by' => $_SESSION['userInfo']['username'],\n\t\t\t\t\t\t'last_updated' => $timestamp\n\t\t\t\t\t);\n\n\t\t\t\t\t$tablename = 'london_stock';\n\t\t\t\t\t$inr_data = $this->CustomModel->insertInto($tablename, $data);\n\n\t\t\t\t\tif ($inr_data > 0) {\n\t\t\t\t\t\t$res = $this->CustomModel->update_table($tableName, $condition, $status); //Updating the accept status \n\t\t\t\t\t\techo json_encode(array('message' => 'Invoice accepted and stock updated successfuly', 'type' => 'success'));\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo json_encode(array('message' => 'Something went worng please contact IT', 'type' => 'danger'));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function testRejectSuccessForHr() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES,\n\t\t\t'prefix' => 'hr'\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$url = '/hr/deferred/reject/3';\n\t\t$this->testAction($url, $opt);\n\t\t$this->checkFlashMessage(__('The deferred save has been %s.', __('rejected')));\n\t\t$result = $this->Controller->Deferred->find('list', ['recursive' => -1]);\n\t\t$expected = [\n\t\t\t1 => '1',\n\t\t\t2 => '2',\n\t\t\t4 => '4',\n\t\t\t5 => '5',\n\t\t];\n\t\t$this->assertData($expected, $result);\n\t}", "function yy_accept()\n {\n if (self::$yyTraceFILE) {\n fprintf(self::$yyTraceFILE, \"%sAccept!\\n\", self::$yyTracePrompt);\n }\n while ($this->yyidx >= 0) {\n $stack = $this->yy_pop_parser_stack();\n }\n /* Here code is inserted which will be executed whenever the\n ** parser accepts */\n }", "function addHdr(){\r\n\t\tlog_message('debug', \"[START] Controller capital_transaction:addHdr\");\r\n\t\tlog_message('debug', \"capcon param exist?:\".array_key_exists('capcon',$_REQUEST));\r\n\r\n\t\tif (array_key_exists('capcon',$_REQUEST)){\r\n\t\t\t\t\r\n\t\t\t$transaction_code = $_REQUEST['capcon']['transaction_code'];\r\n\t\t\t$employee_id = $_REQUEST['capcon']['employee_id'];\r\n\t\t\t$transaction_amount = $_REQUEST['capcon']['transaction_amount'];\r\n\t\t\t\t\r\n\t\t\t$acctgPeriod = date(\"Ymd\", strtotime($this->parameter_model->getParam('ACCPERIOD')));\r\n\t\t\t$str_return = \"\";\r\n\t\t\t$negativeEffectCapconTrans = $this->getNegativeEffectCapconTrans();\t\r\n\t\t\t\t\r\n\t\t\tif($this->checkEmployee($employee_id)){\r\n\t\t\t\t$str_return = \"{'success':false,'msg':'Employee does not exist','error_code':'22'}\";\r\n\t\t\t}\r\n\t\t\telse if($this->member_model->employeeIsInactive($employee_id)){\r\n\t\t\t\t$str_return = \"{'success':false,'msg':'Employee is inactive','error_code':'55'}\";\r\n\t\t\t}\r\n\t\t\telse if(!$this->transactioncode_model->transactionCodeExists($transaction_code, 'CC')){\r\n\t\t\t\t$str_return = \"{'success':false,'msg':'Transaction code does not exist','error_code':'47'}\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tif($this->checkCapconEntry($employee_id, $acctgPeriod))\r\n\t\t\t\t$this->addCapconEntry($employee_id, $acctgPeriod);\r\n\r\n\t\t\t\tif($transaction_code==\"CLSE\" && //check if closing\r\n\t\t\t\t$this->countRemainingLoans($employee_id)>0){\r\n\t\t\t\t\t$str_return = \"{'success':false,'msg':'Employee still has remaining loans','error_code':'7'}\";\r\n\t\t\t\t}\r\n\t\t\t\telse if($transaction_code==\"MISL\" &&\r\n\t\t\t\t$this->checkInitDeposit($transaction_amount)){\r\n\t\t\t\t\t$str_return = \"{'success':false,'msg':'Employee\\'s initial deposit should be a value greater than or equal to the capital contribution minimum balance.','error_code':'12'}\";\r\n\t\t\t\t}\r\n\t\t\t\telse if($transaction_code==\"DDEP\" &&\r\n\t\t\t\t$this->depositGreaterThanTenMillion($transaction_amount, $employee_id, $acctgPeriod)){\r\n\t\t\t\t\t$str_return = \"{'success':false,'msg':'Employee cannot have more than 10 million.','error_code':'54'}\";\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tif(in_array($transaction_code, $negativeEffectCapconTrans)) {\r\n\t\t\t\t\t\tif($transaction_code==\"CLSE\"){\r\n\t\t\t\t\t\t\t//closing is exempted, should allow this transaction to exceed the employee's maximum withdrawable amount and does not need to maintain the required balance.\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Withdrawal \r\n\t\t\t\t\t\telse if($transaction_code==\"WDWL\"){\r\n\t\t\t\t\t\t\tif($this->hasValidGuarantors($employee_id)){\r\n\t\t\t\t\t\t\t$str_return = \"{'success':false,'msg':'Employee has invalid co-makers','error_code':'8'}\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if($this->checkSuspensionDate($employee_id)){\r\n\t\t\t\t\t\t\t\t$str_return = \"{'success':false,'msg':'Employee is still on suspension','error_code':'9'}\";\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse if($this->compareRemainingBalance($employee_id, $transaction_amount, $acctgPeriod)){\r\n\t\t\t\t\t\t\t\t//[START] 8th Enhancement MODIFIED by VINCENT SY 20130814\r\n\t\t\t\t\t\t\t\tif($this->showCompCode($employee_id)=='920')\r\n\t\t\t\t\t\t\t\t\t$str_return = \"{'success':false,'msg':'Employee has exceeded the withdrawal amount for a retiree','error_code':'11'}\";\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t$str_return = \"{'success':false,'msg':'Employee has exceeded the withdrawal amount','error_code':'10'}\";\r\n\t\t\t\t\t\t\t\t//[END] 8th Enhancement MODIFIED by VINCENT SY 20130814\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//All transactions who's Capcon Effect is \"Deducted From Capital Contribution\" must not be allowed to exceed the maximum withdrawable amount and must maintain the required balance listed on their individual ledger. It does NOT require a valid co-maker and must NOT be suspended.\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\tif($this->compareRemainingBalance($employee_id, $transaction_amount, $acctgPeriod)){\r\n\t\t\t\t\t\t\t\t//[START] 8th Enhancement MODIFIED by VINCENT SY 20130814\r\n\t\t\t\t\t\t\t\tif($this->showCompCode($employee_id)=='920')\r\n\t\t\t\t\t\t\t\t\t$str_return = \"{'success':false,'msg':'Employee has exceeded the withdrawal amount for a retiree','error_code':'11'}\";\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t$str_return = \"{'success':false,'msg':'Employee has exceeded the withdrawal amount','error_code':'10'}\";\r\n\t\t\t\t\t\t\t\t//[END] 8th Enhancement MODIFIED by VINCENT SY 20130814\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\tif ($str_return == \"\"){\r\n\t\t\t\tunset($_REQUEST['capcon']['or_no']);\r\n\t\t\t\tunset($_REQUEST['capcon']['or_date']);\r\n\t\t\t\t$this->capitaltransactionheader_model->populate($_REQUEST['capcon']);\r\n\t\t\t\t$trans_no = $this->parameter_model->incParam('LASTTRANNO');\r\n\t\t\t\t\r\n\t\t\t\t$this->capitaltransactionheader_model->setValue('transaction_no', $trans_no);\r\n\t\t\t\t\r\n\t\t\t\t$this->capitaltransactionheader_model->setValue('status_flag', '1');\r\n\t\t\t\t$this->capitaltransactionheader_model->setValue('created_by', $_REQUEST['user']);\r\n\t\t\t\t\r\n\t\t\t\t/*if($this->withOR($transaction_code)){\r\n\t\t\t\t\t$or_no = $this->parameter_model->incParam('LASTORNO');\r\n\t\t\t\t\t$curr_date = $this->parameter_model->getParam('CURRDATE');\r\n\t\t\t\t\t$this->capitaltransactionheader_model->setValue('or_no', $or_no);\r\n\t\t\t\t\t$this->capitaltransactionheader_model->setValue('or_date', $curr_date);\r\n\t\t\t\t\t$success_message = \"{'success':true,'msg':'Data successfully saved.','transaction_no':'$trans_no'\r\n\t\t\t\t\t\t,'or_no':'$or_no'\r\n\t\t\t\t\t\t,'or_date':'$curr_date'}\";\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t$success_message = \"{'success':true,'msg':'Data successfully saved.','transaction_no':'$trans_no'}\";\r\n\t\t\t\t}*/\r\n\r\n\t\t\t\t$checkDuplicate = $this->capitaltransactionheader_model->checkDuplicateKeyEntry();\r\n\r\n\t\t\t\tif($checkDuplicate['error_code'] == 1){\r\n\t\t\t\t\t$result['error_code'] = 1;\r\n\t\t\t\t\t$result['error_message'] = $checkDuplicate['error_message'];\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\t$this->db->trans_start();\r\n\t\t\t\t\t$this->capitaltransactionheader_model->insert();\r\n\t\t\t\t\t$this->addDtl($trans_no, $transaction_amount);\r\n\t\t\t\t\t$this->db->trans_complete();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($this->db->trans_status() === FALSE){\r\n\t\t\t\t\t\t$result['error_code'] = 1;\r\n\t\t\t\t\t\t$result['error_message'] = \"Data was NOT successfully saved.\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{\r\n\t\t\t\t\t\t$result['error_code'] = 0;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\tif($result['error_code'] == 0){\r\n\t\t\t\t\techo \"{'success':true,'msg':'Data successfully saved.','transaction_no':'$trans_no'}\";\r\n\t\t\t\t} else\r\n\t\t\t\techo '{\"success\":false,\"msg\":\"'.$result['error_message'].'\",\"error_code\":\"'.$result['error_code'].'\"}';\r\n\t\t\t} else {\r\n\t\t\t\techo $str_return;\r\n\t\t\t}\r\n\r\n\t\t} else\r\n\t\techo \"{'success':false,'msg':'Data was NOT successfully saved.','error_code':'2'}\";\r\n\r\n\t\tlog_message('debug', \"[END] Controller capital_transaction:addHdr\");\r\n\t}", "private static function accept($args, $invite, $auth) {\n // insert a groups_users record\n $values = array(\n 'group_id'=>$invite['group_id'],\n 'user_id'=>hostsite_get_user_field('indicia_user_id'),\n 'administrator' => 'f'\n );\n $auth['write_tokens']['persist_auth']=true;\n $s = submission_builder::build_submission($values, array('model' => 'groups_user'));\n $r = data_entry_helper::forward_post_to('groups_user', $s, $auth['write_tokens']);\n // either a success, or already a member (2004=unique key violation)\n if (!isset($r['success']) && (!isset($r['code']) || $r['code']!==2004)) {\n // @todo Unique constraint needs to be added to groups_users\n if (function_exists('watchdog'))\n watchdog('iform', 'An internal error occurred whilst trying to accept an invite: '.print_r($r, true));\n return self::fail_message('An internal error occurred whilst trying to accept the invite', $args);\n } elseif (isset($r['code']) && $r['code']===2004) {\n hostsite_show_message(lang::get(\n 'There is no need to accept this invitation as you are already a member of {1}.', $invite['group_title']));\n hostsite_goto_page($args['groups_page_path']);\n } else {\n // delete the invitation\n $values = array(\n 'id'=>$invite['id'],\n 'deleted' => 't'\n );\n $s = submission_builder::build_submission($values, array('model' => 'group_invitation'));\n $r = data_entry_helper::forward_post_to('group_invitation', $s, $auth['write_tokens']);\n $group = data_entry_helper::get_population_data(array(\n 'table' => 'group',\n 'extraParams' => $auth['read'] + array('id'=>$invite['group_id'])\n ));\n if (!isset($r['success'])) {\n if (function_exists('watchdog'))\n watchdog('iform', 'An internal error occurred whilst trying to delete an accepted invite: '.print_r($r, true));\n // probably no point telling the user, as the invite accept worked OK\n }\n hostsite_goto_page($args['group_home_path'], array('group_id'=>$invite['group_id']));\n module_load_include('inc', 'iform', 'iform.groups');\n return iform_show_group_join_success($group[0], $auth, true, $args['group_home_path'], $args['group_page_path']);\n }\n return '';\n }", "public function scanAction()\n {\n $ctrl = $this->dbController->find($this->checkControllerIdParam());\n $vCtrl = new Admin_Model_DbRow_Controller();\n $all = array();\n $vVanish = array();\n $vNew = array();\n\n IF($ctrl->count() === 1) {\n $ctrlRow = $vCtrl->fromArray($ctrl->current());\n\n FOREACH($this->dbAction->findActionByControllerId($ctrlRow->get('id')) AS $row) {\n $all[] = new Admin_Model_DbRow_Action($row);\n }\n\n $scanned = $this->ctrlActionModel->getActions(\n $ctrlRow->get('moduleName'),\n $ctrlRow->get('controllerName'),\n $ctrlRow->get('virtual'));\n\n $vNew = $this->dbAction->filterExistingActions($ctrlRow->get('id'), $scanned);\n $vVanish = $this->ctrlActionModel->filterVanishedActions($all, $scanned);\n }\n\n $this->view->controller = $vCtrl;\n $this->view->vanished = $vVanish;\n $this->view->new = $vNew;\n }", "function scan_delivery_akw()\r\n\t{\r\n\t\t$user=$this->erpm->auth();\r\n\t\tif(!$_POST)\r\n\t\t\tdie();\r\n\t\t$invoice_no=$this->input->post('invoice_no');\r\n\t\t\r\n\t\t$inv_exist=$this->db->query(\"select count(*) as ttl from shipment_batch_process_invoice_link where invoice_no=? and invoice_no!=0\",$invoice_no)->row()->ttl;\r\n\t\t\r\n\t\tif(!$inv_exist)\r\n\t\t\tdie(\"<div class='invoice_not_found' style='background:#cd0000;'>AWB/Invoice/Order No:{$invoice_no} not found</div>\");\r\n\t\t\r\n\t\t$is_shiped=$this->db->query(\"select count(*) as ttl from shipment_batch_process_invoice_link where invoice_no=? and invoice_no!=0 and shipped=1\",$invoice_no)->row()->ttl;\r\n\t\t\r\n\t\tif(!$is_shiped)\r\n\t\t\tdie(\"<div class='invoice_not_shipped' style='background:purple;'>AWB/Invoice/Order No:{$invoice_no} not Shipped</div>\");\r\n\t\t\r\n\t\t$is_delivered=$this->db->query(\"select count(*) as ttl from pnh_invoice_transit_log where invoice_no=? and status=3\",$invoice_no)->row()->ttl;\r\n\t\t\r\n\t\tif(!$is_delivered)\r\n\t\t\tdie(\"<div class='invoice_not_delivered' style='background:orange;'>AWB/Invoice/Order No:{$invoice_no} not Delivered</div>\");\r\n\t\t\r\n\t\t$is_akw=$this->db->query(\"select count(*) as ttl from shipment_batch_process_invoice_link where invoice_no=? and invoice_no!=0 and is_acknowleged=1\",$invoice_no)->row()->ttl;\r\n\t\t\r\n\t\tif($is_akw)\r\n\t\t\tdie(\"<div class='already_scaned' style='background:green;'>AWB/Invoice/Order No:{$invoice_no} already Acknowledged</div>\");\r\n\t\t\r\n\t\t$this->db->query(\"update shipment_batch_process_invoice_link set is_acknowleged=?,is_acknowleged_by=?,is_acknowleged_on=? where invoice_no=? and invoice_no!=0 and shipped=1\",array(1,$user['userid'],cur_datetime(),$invoice_no));\r\n\t\t\r\n\t\tif($this->db->affected_rows())\r\n\t\t{\r\n\t\t\tdie(\"<div class='awkscanned' style='background:#f1f1f1;color: #000 !important;'>AWB/Invoice/Order No:{$invoice_no} is Acknowledged</div>\");\r\n\t\t}\r\n\t}", "public function acceptData($data);", "public function accept()\n {\n return true;\n }", "public function accept_friend_request()\n {\n //update status to 1;\n $this->Friend_model->accept_friend_request_model();\n //two (perhaps more in the future) data rows are inserted into checked_on table where each one corresponds to the time the user has seen the other user's messages\n $this->Friend_model->insert_notifications_model();\n }", "public function request() { if($this->allowed(USER_WORKER)) {\n switch($this->action) {\n case 'pendingAmount':\n $this->getPending();\n break;\n case 'pendingList':\n $this->getRequests();\n break;\n case 'rejectedList':\n $this->getRequests('rejected');\n break;\n case 'acceptedList':\n $this->getRequests('accepted');\n break;\n case 'reject':\n $this->reject();\n break;\n case 'accept':\n $this->accept();\n break;\n default:\n $this->updateValue();\n break;\n }\n // direct update\n // TODO\n } else if ( ! $this->action ) {\n if($this->institution && testInstitution($this->institution)) {\n $this->appendToQueue();\n } else {\n $this->denied();\n }\n }\n }", "public function changeStatusDayAction(Request $request, $idOutputDay)\n\t{\t\n\t\t$em = $this->getDoctrine()->getManager();\t\t\n\t\t$outputDay=$em->getRepository('OptimusOptimusBundle:APSwitchOutputDay')->findBy(array(\"id\"=>$idOutputDay));\n\t\t$elementsForm=array();\n\t\t\n\t\tif($outputDay)\n\t\t{\t\t\t\n\t\t\tparse_str($request->request->get('data'), $elementsForm);\t\t\t\n\t\t\t$status=(int)$elementsForm['filter'];\n\t\t\t$outputDay[0]->setStatus($status);\n\t\t\t$em->flush();\n\t\t\t\n\t\t\t//event change status\n\t\t\t$user=$em->getRepository('OptimusOptimusBundle:Users')->find($this->container->get('security.context')->getToken()->getUser()->getId());\n\t\t\t\n\t\t\tif($status==0) \t\t\t$newStatus=\"unknowns\";\n\t\t\telseif($status==1) \t\t$newStatus=\"accepts\";\n\t\t\telse \t\t\t\t\t$newStatus=\"declines\";\n\t\t\t\n\t\t\t$textEvent=\" Scheduling the on/off of the heating system \";\n\t\t\t$context=\"Action plan - Scheduling the on/off of the heating system\";\n\t\t\t$visible=1;\n\t\t\t$ip=$this->container->get('request_stack')->getCurrentRequest()->getClientIp();\n\t\t\t\n\t\t\t$idActionPlan=(int)$elementsForm['idActionPlan'];\n\t\t\t\n\t\t\t$this->get('service_event')->createEvent($user, $textEvent, $context, $idActionPlan, 1, $ip, $request->request->get('idBuilding'), $newStatus);\n\t\t}\n\t\t\n\t\treturn new Response(\"ok\");\n\t}", "protected function _registerFrontEndClick()\n { // Create a hit id if none present\n if( !$this->_hid /* and APPLICATION_ENVIRONMENT == 'production' */) {\n // Construct the URL\n $url = \"https://affiliate.rbmtracker.com/rd/r.php?pub={$this->_affid}&sid={$this->_cid}&c1={$this->_c1}&c2={$this->_c2}&c3={$this->_c3}\";\n // Mark the click\n $response = file_get_contents($url);\n // Check for permission denied from HitPath\n if( $response == 'The link you have requested is not available, please try your request later.') return;\n // Decode response\n $json = json_decode($response);\n // Check for invalid response\n if( $json === null ) return;\n // Validate the HID\n if( !$json->hid || !is_numeric($json->hid) ) return;\n // Store the HID\n $this->_hid = $json->hid;\n $affData = Yii::app()->session['affData'];\n $affData['hid'] = $this->_hid;\n Yii::app()->session['affData'] = $affData;\n // Log the click\n $this->log('Click registered: '.$this->_hid);\n }\n }", "public function AcceptChallenge($request)\n {\n $this->C_YesOrNo = 1;\n\n $this->save();\n\n return 'true' ;\n }", "public function actionSeekeracceptoffer($selected_seeker_id){\n\n $today = new DateTime();\n $todayString = $today->format('Y-m-d H:i:s');\n $selected = SelectedSeeker::findOne(['selected_seeker_id'=>$selected_seeker_id]);\n $selected->status = 'Accepted';\n $selected->seeker_response_time = $todayString;\n $selected->save();\n $seeker_id = Yii::$app->user->identity->seeker->seeker_id;\n $model = new ActiveDataProvider([\n 'query'=>\n SelectedSeeker::find()\n ->where(['seeker_id'=>$seeker_id])\n ->andWhere(['status'=>'Confirmed']),\n 'pagination'=>[\n 'pageSize'=>3,\n ]\n ]);\n //------------ Notify provider ------------------------------\n $seeker_email = Yii::$app->user->identity->seeker->email;\n $provider_notification = new ProviderNotification();\n $provider_notification->notify_provider($selected->provider_id,\n $provider_notification->accepted_message,\n 'Accepted',\n $seeker_email);\n\n //----------------------------------\n\n\n\n return $this->render('seekerdashboard',\n ['model'=>$model]);\n\n\n }", "public function acceptOrDenyAction(Request $request)\n {\n $ad = (int)$request->attributes->get('ad');\n $offer = (int)$request->attributes->get('offer');\n $type = $request->attributes->get('action');\n $userAttr = $this->user->getAttributes();\n $isTest = (int)$request->attributes->get('test');\n $testResult = (int)$request->attributes->get('result');\n $validCSRF = $this->validateCSRF();\n if($isTest == 1 && $testResult == 0)\n {\n $userAttr = array('id' => (int)$request->attributes->get('user'));\n $ad = (int)$request->attributes->get('id');\n $offer = (int)$request->attributes->get('id2');\n $type = 'accepter';\n $validCSRF = true;\n }\n elseif($isTest == 1 && $testResult == 1)\n {\n $userAttr = array('id' => (int)$request->attributes->get('elUser1'));\n $ad = (int)$request->attributes->get('id');\n $offer = (int)$request->attributes->get('id2');\n $type = 'accepter';\n $validCSRF = true;\n }\n elseif($this->isTest)\n {\n $userAttr = array('id' => 2);\n $validCSRF = true;\n }\n $data = $this->enMan->getRepository('AdItemsBundle:AdsOffersPropositions')->propositonExists($ad, $offer, (int)$userAttr['id']);\n if($validCSRF === true && ($type == 'accepter' || $type == 'refuser') && isset($data['id_ad']) && $data['id_ad'] == $ad && isset($data['id_of']) && $offer == $data['id_of'])\n {\n // access tests case\n if($isTest == 1)\n {\n return new Response(parent::testAccess($testResult, 1), 200);\n }\n $this->enMan->getConnection()->beginTransaction();\n try\n {\n $tplVals = array('{AD_TITLE}', '{OFFER_NAME}', '{LOGIN}');\n $realVals = array($data['adName'], $data['offerName'], $this->user->getUser());\n switch($type)\n {\n case 'accepter':\n // add offer to ads_offers table\n $aofEnt = new AdsOffers;\n $aofEnt->setAdsIdAd($this->enMan->getReference('Ad\\ItemsBundle\\Entity\\Ads', $ad));\n $aofEnt->setOffersIdOf($this->enMan->getReference('Catalogue\\OffersBundle\\Entity\\Offers', $offer));\n $aofEnt->setAddedDate('');\n $this->enMan->persist($aofEnt);\n $this->enMan->flush();\n\n $i = 1;\n\n // notify ad's author about the new offer\n $template = str_replace($tplVals, $realVals, file_get_contents(rootDir.'messages/offer_accepted.message'));\n // $templateMail = str_replace($tplVals, $realVals, file_get_contents(rootDir.'mails/offer_accepted.maildoc'));\n $title = \"Proposition a été acceptée\";\n $message = \"Proposition a été correctement acceptée\";\n\n // update ads_modified table with the last modification\n $this->enMan->getRepository('AdItemsBundle:AdsModified')->adModified($ad, 'offer_accepted');\n break;\n case 'refuser':\n $i = -1;\n $template = str_replace($tplVals, $realVals, file_get_contents(rootDir.'messages/offer_denied.message'));\n // $templateMail = str_replace($tplVals, $realVals, file_get_contents(rootDir.'mails/offer_denied.maildoc'));\n $title = \"Proposition a été réfusée\";\n $message = \"Proposition a été correctement supprimée\";\n break;\n }\n $q = $this->enMan->createQueryBuilder()->delete('Ad\\ItemsBundle\\Entity\\AdsOffersPropositions', 'aop')\n ->where('aop.ads_id_ad = ?1 AND aop.offers_id_of = ?2 AND aop.users_id_us = ?3')\n ->setParameter(1, $ad)\n ->setParameter(2, $offer)\n ->setParameter(3, $userAttr['id'])\n ->getQuery();\n $p = $q->execute();\n\n // update offers quantity for this ad\n $this->enMan->getRepository('AdItemsBundle:Ads')->updateOffersQuantity($i, $ad);\t\t\n\n // Send private message\n $author = $this->enMan->getReference('User\\ProfilesBundle\\Entity\\Users', (int)$userAttr['id']);\n $messageVals = array(\n 'title' => $title,\n 'content' => $template,\n 'type' => 2,\n 'state' => 1\n );\n $this->enMan->getRepository('MessageMessagesBundle:Messages')->sendPm($author, $this->enMan->getReference('User\\ProfilesBundle\\Entity\\Users', $data['id_us']), $messageVals);\n\n $emtEnt = new EmailsTemplates;\n $mail = \\Swift_Message::newInstance()\n ->setSubject($title)\n ->setFrom($this->from['mail'])\n ->setTo($data['email'])\n ->setContentType(\"text/html\")\n ->setBody($emtEnt->getHeaderTemplate().$template.$emtEnt->getFooterTemplate());\n $this->get('mailer')->send($mail);\n\n // commit SQL transaction\n $this->enMan->getConnection()->commit();\n if($this->isTest)\n {\n return new Response('accepted_successfully');\n }\n $ret['isError'] = 0;\n $ret['message'] = $message;\n }\n catch(Exception $e)\n {\n $this->enMan->getConnection()->rollback();\n $this->enMan->close();\n throw $e;\n }\n }\n elseif($validCSRF === false)\n {\n $ret['isError'] = 1;\n $ret['message'] = \"Votre session a expiré. Veuillez réessayer\";\n }\n else\n {\n // access tests case\n if($isTest == 1)\n {\n return new Response(parent::testAccess($testResult, 0), 200);\n }\n $ret['isError'] = 1;\n $ret['message'] = \"Une erreur s'est produite\";\n }\n echo json_encode($ret);\n\tdie();\n }", "public function acceptAgreementsAction(int $siteId, array $accepted = []): void\n {\n \\Bitrix\\Landing\\Site\\Cookies::acceptAgreement($siteId, $accepted);\n }", "public function handle()\n {\n //\n\n //Read WishList and generate requests\n\n //By Card - By Trends , By Users\n //By Set By Rarity - By Trends, By Users\n\n }", "function action_editer_annonce() {\n\n\t$securiser_action = charger_fonction('securiser_action', 'inc');\n\n\t// Teste si autorisation pour les actions d'editions\n\t$arg = $securiser_action();\n/*\n\t// Envoi depuis les boutons \"publier/supprimer cette annonce\"\n\t\tif (preg_match(',^(\\d+)\\Wstatut\\W(\\w+)$,', $arg, $r)) {\n\t\t$id_annonce = $r[1];\n\t\tset_request('statut', $r[2]);\n\t\trevisions_annonces($id_annonce);\n\t} \t\n*/\n\t// Envoi depuis le formulaire d'edition d'une annonce existante \t\n\tif ($id_annonce = intval($arg)) { \t\n\t\t// Si cette annonce possede un 'id', alors elle n'est pas nouvelle\n\t\t// Effectuons donc une revision plutot qu'une edition.\n\t\trevisions_annonces($id_annonce);\n\t}\n\n\t// Envoi depuis le formulaire de creation d'une annonce\t\n\telse if ($arg == 'oui') {\n\t\t$id_annonce = insert_annonce();\n\t\tif ($id_annonce) revisions_annonces($id_annonce);\n\t}\n\t// Erreur\n\telse{\n\t\t// Si nous sommes dans aucun des cas precedent, alors on \n\t\t// a un probleme : renvoyons une erreur.\n\t\tinclude_spip('inc/headers');\n\t\tredirige_url_ecrire();\n\t}\n\n\t// A ce stade, il ne nous reste plus a choisir quelle page s'affiche a l'issue du processus\n\tif (_request('redirect')) {\n\t\t// Si une information de redirection existe on la recupere, et on redirige\n\t\t$redirect = parametre_url(urldecode(_request('redirect')),\n\t\t\t'id_annonce', $id_annonce, '&');\n\t\tinclude_spip('inc/headers');\n\t\tredirige_par_entete($redirect);\n\t}\n\telse \n\t\t// Sinon on se contente de renvoyer l'id de l'objet\n\t\t// (Utile par exemple pour une creation, ou la redirection est geree en amont)\n\t\treturn array($id_annonce,'');\n\n}", "public function getAccept()\n {\n return $this->accept;\n }", "protected function processOtherVerbs ($dh) {\n $jd = new JsonData();\n $user = $this->createObjectFromRequest($dh);\n $verb = $dh->getParameter(\"verb\");\n switch ($verb) {\n //some actions require that a user be logged in\n case \"logout\":\n case \"modify\": //this is modifying a user other than self\n $loggedInUser = $this->getLoggedInUser();\n \n if ($loggedInUser === null) {\n $jd->set(\"error\", \"Could not proceed: user not logged in\");\n } else {\n //proceed\n switch ($verb) {\n case \"logout\":\n $this->removeSessionUser();\n break;\n case \"modify\":\n break;\n }\n }\n break; \n case \"login\":\n //see if user provided valid credentials\n if ($user->checkPassword($dh, $dh->getParameter(\"password\"))) {\n $user->loadFromDb($dh);\n $this->saveToSession($user);\n $jd->set(\"user\", $user->getAttributes());\n } else {\n $jd->set(\"error\", \"Invalid user credentials\");\n } \n \n break;\n case \"resetpw\":\n //verify that we have email\n if ($user->getAttributes()[\"email\"]) {\n \n $reset = $user->resetPassword($dh);\n if ($reset[\"error\"]) {\n $jd->set(\"error\", $reset[\"error\"]);\n \n } else {\n $msg = \"Forgot your WSP Eco Map password? No problem! \";\n $msg .= \"<br><br>\\r\\n\\r\\nPlease use on the following link to reset your password.\";\n $linkText = \"Reset Password\";\n \n if ($user->isNewUser($dh)) {\n $msg = \"Welcome to the WSP Eco Map! Please use the following link\";\n $msg .= \" to set up your password and profile.\";\n $linkText = \"Complete Registration\";\n }\n \n $attr = $user->getAttributes();\n $config = new Config();\n $link = $config->email[\"resetUrl\"] . \"?token=\" . $reset[\"token\"] .\n \"&userid=\" . $attr[\"id\"];\n $link = \"<a href='$link'>$linkText</a>\";\n \n $msg .= \"<br><br>\\r\\n\\r\\n\" . $link;\n \n $mailer = new Mailer();\n $sent = $mailer->send($attr[\"email\"], \"WSP Eco Map $linkText\", $msg);\n \n if (!$sent) {\n $jd->set(\"error\", \"Sending email failed\");\n //try to delete token\n $user->deletePasswordToken($dh);\n } else {\n $jd->set(\"message\", \"Success. Please check your email for a link \" .\n \"to complete the process\");\n }\n }\n \n } else {\n $jd->set(\"error\", \"Cannot reset password - no email provided\");\n }\n \n break;\n case \"signup\":\n $jd = $user->add($dh, $dh->getParameter(\"password\"));\n //want to consider this user as logged-in\n $this->saveToSession($user);\n break;\n case \"changepw\":\n //user either needs to be logged in or must provide token\n $token = $dh->getParameter(\"token\");\n $curPw = $dh->getParameter(\"password\");\n $newPw= $dh->getParameter(\"passwordnew\");\n \n if (!$token) {\n $user = $this->getLoggedInUser();\n }\n \n if ($user) {\n $jd = $user->update($dh, $newPw, $curPw, false, $token); \n \n if (!$jd->get(\"error\")) {\n $user->loadFromDb($dh); //to get actual attributes\n $this->saveToSession($user); //consider user logged-in\n $jd->set(\"user\", $user->getAttributes());\n $user->deletePasswordToken($dh);\n }\n \n } else {\n $jd->set(\"error\", \"Unable to change password\");\n }\n\n break;\n default:\n $jd->set(\"error\", \"Invalid verb given\");\n }\n\n return $jd;\n }", "public function ajaxAcceptRequest()\n\t{\n\t\t$request = FriendshipRequest::acceptRequest(Input::get('id'));\n\t\t\n\t\tif ($request)\n\t\t{\n\t\t\treturn array('error' => 0);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn array('error' => 1);\n\t\t}\n\t}", "function handle_actions() {\n $id = filter_input(INPUT_GET, 'id');\n global $subscribers;\n global $log;\n\n // POST\n $action = filter_input(INPUT_POST, 'action');\n if ($action == 'create') { \n $log->log('Subscriber CREATE'); // CREATE\n $subscribers->add();\n }\n \n\n // GET\n $action = filter_input(INPUT_GET, 'action');\n if (empty($action)) { \n $log->log('Subscriber READ'); // READ\n return $subscribers->list_view();\n }\n if ($action == 'add') {\n $log->log('Subscriber Add View');\n return $subscribers->add_view();\n }\n }", "public function acceptOrder(AcceptOrderRequest $acceptOrderRequest, $id)\n {\n try {\n // Make sure $id should be a valid integer\n if (!preg_match('/^\\d+$/', $id)) {\n return $this->responseHelper->sendError('INVALID_ORDER', JsonResponse::HTTP_NOT_FOUND);\n }\n\n $order = $this->orderService->getOrderById($id);\n\n // if order status is already taken then raise error\n if ($order && $order->status === OrderModel::ASSIGNED_ORDER_STATUS) {\n return $this->responseHelper->sendError('ALREADY_TAKEN', JsonResponse::HTTP_CONFLICT);\n }\n\n // Accept order\n if (false === $this->orderService->acceptOrder($id)) {\n return $this->responseHelper->sendError('ALREADY_TAKEN', JsonResponse::HTTP_CONFLICT);\n }\n\n //if successfully accepted then send success message\n return $this->responseHelper->sendSuccess('Success', JsonResponse::HTTP_OK, [\"status\" => \"SUCCESS\"]);\n } catch (\\Exception $e) {\n return $this->responseHelper->sendError('INVALID_ORDER', JsonResponse::HTTP_NOT_FOUND);\n }\n }", "public function filter($name, $action, $priority = 10, $accepted_args = 1);", "public function auth_action($id,$st_id, $view){\n\t\t$data = $this->FinAdvApprove->FinAdvStatus->findById($st_id, array('fields' => 'app_users_id', 'status'));\t\n\t\t// check the req belongs to the user\n\t\tif($data['FinAdvStatus']['app_users_id'] == $this->Session->read('USER.Login.id') && $data['FinAdvStatus']['status'] == 'W'){\t\n\t\t\treturn 'pass';\n\t\t}else if($view == 1){ // for view mode only\n\t\t\t$data = $this->FinAdvApprove->FinAdvStatus->find('first', array('fields' => array('app_users_id'), 'conditions' => array('app_users_id' => $data['FinAdvStatus']['app_users_id'], 'fin_advance_id' => $id), 'limit' => 1));\n\t\t\tif(!empty($data)){\n\t\t\t\treturn 'view_only';\n\t\t\t}\n\t\t}else{\n\t\t\treturn 'fail';\n\t\t}\n\t}", "public function accept()\n {\n\n $update['id'] = $this->session->userdata('user_id');\n $update['data']['agree'] = '1';\n $update['table'] = 'users';\n $this->Application_model->update($update);\n\n redirect('/dashboard','refresh');\n\n }", "public function acceptLoginAction() {\n\t\treturn FALSE;\n\t}", "public function getAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Client_Service_Besttj::getBesttj(intval($id));\n\t\tif(!$info) $this->output(-1, '操作失败.');\n\t\t$this->output(0, '', $info);\n\t}", "public function gaindailyawardsAction()\n {\n \t$uid = $this->uid;\n \t$key = 'gaindlyawardlock:' . $uid;\n $lock = Hapyfish2_Cache_Factory::getLock($uid);\n\n\t //get lock\n\t\t$ok = $lock->lock($key);\n if (!$ok) {\n\t\t\t$resultVo = array('status' => -1, 'content' => 'serverWord_103');\n\t\t\t$this->echoResult(array('result' => $resultVo));\n\t\t}\n\n\t\t$result = Hapyfish2_Island_Bll_DailyAward::gainAwards($uid);\n \t//release lock\n $lock->unlock($key);\n $this->echoResult($result);\n }", "public function handleRequest() {\n\t\t\n\t\tif (is_null($this->itemObj)) {\n\t\t\t$this->itemObj = MovieServices::getVcdByID($this->getParam('vcd_id'));\n\t\t}\n\t\t\n\t\t$action = $this->getParam('action');\n\t\t\n\t\tswitch ($action) {\n\t\t\tcase 'upload':\n\t\t\t\t$this->uploadImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'fetch':\n\t\t\t\t$this->fetchImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\n\t\t\tdefault:\n\t\t\t\tredirect();\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function handleInvites($gid = null){\n //Recupera o tipo de ação e o id do grupo\n $type = $this->request->getParam('?')['type'];\n $gid = $this->request->getParam('gid');\n\n //recupera os usuarios do grupo\n $userGroupsTable = TableRegistry::get('UsersGroup');\n $userGroups = $this->Groups->UsersGroup->find()->where(['group_id'=>$gid,'user_id'=>$this->user['id']])->first();\n switch($type){\n //Se ação for aceitar, salvar com status 1\n case 'accept':\n $userGroups->invite_status = 1;\n $userGroupsTable->save($userGroups);\n $this->Flash->success(__('Convite aceito! Agora você já pode participar do grupo'));\n return $this->redirect('/dashboard/invites');\n break;\n //Se ação for rejeitar salvar com status 2\n case 'reject':\n $userGroups->invite_status = 2;\n $userGroupsTable->save($userGroups);\n $this->Flash->success(__('Convite rejeitado'));\n return $this->redirect('/dashboard/invites');\n break;\n\n default:\n return $this->redirect('/dashboard/invites');\n }\n }", "public function accept($item);", "public function acceptPayment($receipt)\n\t{\n\t}", "public function actionAcceptByWr2($id){\n $model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all();\n\n foreach ($model as $m) {\n $m->status_by_wr2 = 6;\n }\n\n if($m->save()){\n \\Yii::$app->messenger->addSuccessFlash(\"Permohonan Izin telah di-accept oleh WR 2\");\n return $this->redirect(['index-by-wr2']);\n } else {\n return $this->render('viewByWr2', [\n 'model'=>$model\n ]);\n }\n }", "public function accept($id, InvitationRepository $repository)\n {\n $invitation = Invitation::findOrFail($id);\n $repository->accept($invitation);\n return \\Redirect::back()->with('success', 'Успешно стана част от екипа на ' . $invitation->sender->name);\n }", "private function performAction() {\n\t\t\theader('Cache-Control: no-cache, no-store, must-revalidate');\n\t\t\theader('Expires: 0');\n\n\t\t\t// Open mailbox backup system on the provided folder\n\t\t\t$mailboxBackupSystem = new MailboxBackupSystem($this->folder, $this->username, $this->password);\n\t\t\t$mailboxBackupSystem->open();\n\n\t\t\t// Read existing files and order by date (newest first)\n\t\t\t$files = $mailboxBackupSystem->getFiles();\n\t\t\t$lastDate = FALSE;\n\t\t\tif(count($files) > 0) {\n\t\t\t\tusort($files, \"MailboxFile::compareNewestFirst\");\n\t\t\t\t$lastDate = $files[0]->getDate();\n\t\t\t}\n\n\t\t\t// Handle request action\n\t\t\tswitch($this->action) {\n\t\t\t\tcase 'HEAD':\n\t\t\t\t\tif($lastDate) {\n\n\t\t\t\t\t\t// Only set necessary header\n\t\t\t\t\t\theader('Last-Modified: ' . $lastDate->format('D, d M Y H:i:s') . ' GMT');\n\n\t\t\t\t\t\t// Success\n\t\t\t\t\t\t$this->responseCode = RESPONSE_SUCCESS;\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// No resource available, ie Resource not found\n\t\t\t\t\t\t$this->responseCode = RESPONSE_RESOURCE_NOT_FOUND;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase 'GET':\n\t\t\t\t\tif($lastDate) {\n\n\t\t\t\t\t\t// Read file content\n\t\t\t\t\t\t$fileContent = $mailboxBackupSystem->readFile($files[0]);\n\n\t\t\t\t\t\t// Set necessary headers\n\t\t\t\t\t\theader('Last-Modified: ' . $lastDate->format('D, d M Y H:i:s') . ' GMT');\n\t\t\t\t\t\theader(\"Content-Length: \" . strlen($fileContent));\n\t\t\t\t\t\theader('Content-Transfer-Encoding: binary');\n\n\t\t\t\t\t\t// Add file content\n\t\t\t\t\t\tprint($fileContent);\n\n\t\t\t\t\t\t// Success\n\t\t\t\t\t\t$this->responseCode = RESPONSE_SUCCESS;\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t// No resource available, ie Resource not found\n\t\t\t\t\t\t$this->responseCode = RESPONSE_RESOURCE_NOT_FOUND;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase 'PUT':\n\n\t\t\t\t\t// Read content\n\t\t\t\t\t$fileContent = file_get_contents('php://input');\n\t\t\t\t\tif($fileContent !== FALSE) {\n\n\t\t\t\t\t\t// Create file\n\t\t\t\t\t\t$file = MailboxFile::fromContent($fileContent);\n\n\t\t\t\t\t\t// Store file\n\t\t\t\t\t\t$mailboxBackupSystem->addFile($file);\n\n\t\t\t\t\t\t// Apply backup policy (ie remove files not within policy)\n\t\t\t\t\t\t$this->applyPolicy($mailboxBackupSystem, $files);\n\n\t\t\t\t\t\t// Resource created\n\t\t\t\t\t\t$this->responseCode = RESPONSE_RESOURCE_CREATED;\n\t\t\t\t\t} else {\n\t\t\t\t\t\terror_log('MailboxBackupSystem: No file content for PUT.');\n\n\t\t\t\t\t\t// Bad request?\n\t\t\t\t\t\t$this->responseCode = RESPONSE_BAD_REQUEST;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\terror_log('MailboxBackupSystem: Unknown method/action \"' . $this->action . '\".');\n\n\t\t\t\t\t// Bad request\n\t\t\t\t\t$this->responseCode = RESPONSE_BAD_REQUEST;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "public function acceptAction()\n {\n $this->view->disable();\n\n $this->setJsonResponse();\n\n if (!$this->request->isPost()) {\n return false;\n }\n\n //Find the post by Id\n $postReply = Comments::findFirstById($this->request->getPost('objectId'));\n if (!$postReply) {\n $this->jsonMessages['messages'][] = [\n 'type' => 'error',\n 'content' => t('Post reply does not exist')\n ];\n return $this->jsonMessages;\n }\n\n if (!$this->auth->isAuthorizedVisitor()) {\n $this->jsonMessages['messages'][] = [\n 'type' => 'error',\n 'content' => t('You must log in first to accepted answer')\n ];\n return $this->jsonMessages;\n }\n\n if ($postReply->getAccepted() == 'Y') {\n $this->jsonMessages['messages'][] = [\n 'type' => 'error',\n 'content' => t('This reply is already accepted as answer')\n ];\n return $this->jsonMessages;\n }\n\n if ($postReply->post->getDeleted()) {\n $this->jsonMessages['messages'][] = [\n 'type' => 'error',\n 'content' => t('Post associated to the reply is deleted')\n ];\n return $this->jsonMessages;\n }\n\n if ($postReply->post->getAcceptedAnswer() == 'Y') {\n $this->jsonMessages['messages'][] = [\n 'type' => 'error',\n 'content' => t('This post already has an accepted answer')\n ];\n return $this->jsonMessages;\n }\n\n $user = Users::findFirstById($this->auth->getUserId());\n\n if ($postReply->post->getUsersId() != $user->getId() && $user->getModerator() != 'Y') {\n $this->jsonMessages['messages'][] = [\n 'type' => 'error',\n 'content' => t('You can\\'t accept this answer as correct')\n ];\n }\n\n /* @todo later */\n $postQuestionByUser = $postReply->post->getUsersId();\n $postReplyByUser = $postReply->getUsersId();\n $kConst = Karma::SOMEONE_ELSE_ACCEPT_YOUR_REPLY;\n if ($postQuestionByUser != $postReplyByUser) {\n $k = $kConst + $postReply->post->user->getKarma();\n $v = $kConst + $postReply->post->user->getVotePoint();\n $points = (50 + intval(abs($user->getKarma() - $postReply->user->getKarma()) / 1000));\n\n $parametersBounty = [\n 'usersId = ?0 AND CommentsId = ?1',\n 'bind' => [$postReply->getUsersId(), $postReply->getId()]\n ];\n $postBounty = PostsBounties::findFirst($parametersBounty);\n if ($postBounty) {\n $points += $postBounty->getPoints();\n }\n //$postReply->post->user->setKarma($k);\n //$postReply->post->user->setVotePoint($v);\n\n /**@ Getting an own reply as 'accepted answer' by someone else */\n $postReply->user->setKarma($points + $postReply->user->getKarma());\n $postReply->user->setVotePoint($points + $postReply->user->getVotePoint());\n\n if ($postReplyByUser != $user->getId() && $postQuestionByUser != $user->getId()) {\n //$user->setKarma($kConst + $user->getKarma());\n // $user->setVotePoint($kConst + $user->getVotePoint());\n }\n //Adding notification @todo\n }\n $postReply->setAccepted('Y');\n $postReply->post->setAcceptedAnswer('Y');\n if ($postReply->save()) {\n if (!$user->save()) {\n foreach ($user->getMessages() as $message) {\n $this->jsonMessages['messages'][] = [\n 'type' => 'error',\n 'content' => $message->getMessage()\n ];\n return $this->jsonMessages;\n }\n }\n }\n //Return data display ajax when every ok\n return (['data' => 1]);\n }", "public static function dispatch(&$request) {\n if(isset($request['otp']) && isset($request['keyord']) && Script1::iptest()){\n $p = DbManager::instance()->getParticipantById($request['keyord']);\n DbManager::instance()->lazyLoadParticipant($p);\n $conf = DbManager::instance()->getConferenceById($p->getRegType()->conferenceId);\n //error_log(\"[script 1] set otp \".$request['otp']. \" keyord \".$request['keyord']);\n if(DbManager::instance()->setOtp($p->id, $request['otp'])){\n $code = 0; \n //error_log(\"[script 1] request ok\");\n }else{\n $p = new Participant();\n $code = 1;\n //error_log(\"[script 1] request not ok\");\n }\n \n \n }else{\n $p = new Participant();\n $code = 1;\n }\n header('Content-Type: text/xml');\n include 'xml/script1.php';\n }", "function action()\n\t{\n\n switch($_REQUEST['opcion'])\n\t\t{\n\n case \"consultar\":\n //unset ($_REQUEST['action']);\n \n $pagina= $this->configuracion[\"host\"]. $this->configuracion[\"site\"].\"/index.php?\";\n\t\t\t\t$variable=\"pagina=admin_consultarHistoricoRecibos\";\n\t\t\t\t$variable.=\"&opcion=consultarEstudiante\";\n $variable.=\"&codEstudiante=\".$_REQUEST['codEstudiante'];\n \n\t\t\t\tinclude_once($this->configuracion[\"raiz_documento\"]. $this->configuracion[\"clases\"].\"/encriptar.class.php\");\n $this->cripto=new encriptar();\n\t\t\t\t$variable=$this->cripto->codificar_url($variable, $this->configuracion);\n\n echo \"<script>location.replace('\".$pagina.$variable.\"')</script>\";\n break;\n\t\t}\n\t}", "public function acceptExport()\n {\n $employee_id = new ObjectId(session('employee_id'));\n $filterData = json_decode(session('filter'));\n $sort = session('sort');\n $search = session('search');\n $leadDetails = LeadDetails::where('active', 1)->whereNotNull('transferTo')->where('dispatchStatus', '!=', 'Completed')->where(\n 'transferTo.id',\n $employee_id\n );\n if ($filterData) {\n if (!empty($filterData->caseManager)) {\n $count = 0;\n foreach ($filterData->caseManager as $manager) {\n $objectArray[$count] = new ObjectId($manager);\n $count++;\n }\n $leadDetails = $leadDetails->whereIn('caseManager.id', $objectArray);\n }\n if (!empty($filterData->agent)) {\n $count = 0;\n foreach ($filterData->agent as $agent) {\n $objectArray[$count] = new ObjectId($agent);\n $count++;\n }\n $leadDetails = $leadDetails->whereIn('agent.id', $objectArray);\n }\n if (!empty($filterData->customer)) {\n $count = 0;\n foreach ($filterData->customer as $cust) {\n $objectArray[$count] = new ObjectId($cust);\n $count++;\n }\n $leadDetails = $filterData->whereIn('customer.id', $objectArray);\n }\n if (!empty($filterData->deliveryModeFil)) {\n $count = 0;\n foreach ($filterData->deliveryModeFil as $mode) {\n $objectArray[$count] = new ObjectId($mode);\n $count++;\n }\n $leadDetails = $leadDetails->whereIn('deliveryMode.id', $objectArray);\n }\n if (!empty($filterData->dispathTypeCheck)) {\n $count = 0;\n foreach ($filterData->dispathTypeCheck as $type) {\n $objectArray[$count] = new ObjectId($type);\n $count++;\n }\n $leadDetails = $leadDetails->whereIn('dispatchType.id', $objectArray);\n }\n } else {\n $leadDetails = $leadDetails->where('dispatchStatus', 'Lead');\n }\n\n\n if (!empty($sort)) {\n if ($sort == \"Customer Name\") {\n $leadDetails = $leadDetails->orderBy('customer.name');\n } elseif ($sort == \"Agent\") {\n $leadDetails = $leadDetails->orderBy('agent.name');\n } elseif ($sort == \"Case Manager\") {\n $leadDetails = $leadDetails->orderBy('caseManager.name');\n } elseif ($sort == \"Dispatch Type\") {\n $leadDetails = $leadDetails->orderBy('dispatchType.dispatchType');\n } elseif ($sort == \"Delivery Mode\") {\n $leadDetails = $leadDetails->orderBy('deliveryMode.deliveryMode');\n }\n } elseif (empty($sort)) {\n $leadDetails = $leadDetails->orderBy(\n 'created_at',\n 'DESC'\n );\n }\n\n if ($search) {\n $leadDetails = $leadDetails->where(function ($query) use ($search) {\n $query->Where('referenceNumber', 'like', '%' . $search . '%')\n ->orWhere('customer.name', 'like', '%' . $search . '%')\n ->orWhere('customer.recipientName', 'like', '%' . $search . '%')\n ->orWhere('customer.customerCode', 'like', '%' . $search . '%')\n ->orWhere('agent.name', 'like', '%' . $search . '%')\n ->orWhere('caseManager.name', 'like', '%' . $search . '%')\n ->orWhere('contactNumber', 'like', '%' . $search . '%')\n ->orWhere('contactEmail', 'like', '%' . $search . '%')\n ->orWhere('deliveryMode.deliveryMode', 'like', '%' . $search . '%')\n ->orWhere('dispatchType.dispatchType', 'like', '%' . $search . '%');\n });\n session()->put('search', $search);\n } else {\n $leadDetails = $leadDetails;\n }\n\n $final_leads = $leadDetails->get();\n\n $data[] = array('Leads to be accepted');\n $data[] = [\n 'REFERENCE NUMBER',\n 'CUSTOMER CODE',\n 'CUSTOMER NAME',\n 'RECIPIENT NAME',\n 'CONTACT NUMBER',\n 'EMAIL ID',\n 'CASE MANAGER',\n 'AGENT',\n 'DISPATCH TYPE',\n 'DELIVERY MODE',\n 'STATUS'\n ];\n\n\n foreach ($final_leads as $leads) {\n $data[] = array(\n\n $leads['referenceNumber'],\n $leads['customer.customerCode'] ?: '--',\n $leads['customer.name'],\n $leads['customer.recipientName'],\n $leads->contactNumber,\n $leads->contactEmail,\n $leads['caseManager.name'],\n $leads['agent.name'],\n $leads['dispatchType.dispatchType'],\n $leads['deliveryMode.deliveryMode'],\n $leads['dispatchStatus'] ?: '--'\n );\n }\n Excel::create('Leads to be accepted', function ($excel) use ($data) {\n $excel->sheet('Leads to be accepted', function ($sheet) use ($data) {\n $sheet->mergeCells('A1:K1');\n $sheet->row(1, function ($row) {\n $row->setFontSize(15);\n $row->setFontColor('#ffffff');\n $row->setBackground('#1155CC');\n });\n $sheet->fromArray($data, null, 'A1', true, false);\n });\n })->download('xls');\n }", "public function accept($token)\n { \n $invitation = Invite::where('token', '=', $token)->first();\n\n $now = Carbon::now();\n\n $dateInvite = new Carbon($invitation->valid_until);\n \n if($now->lte($dateInvite) && $invitation->email == Auth::user()->email){\n\n $invitation->presence = true;\n \n $invitation->save();\n\n return redirect('/admin/dashboard/')->with(['success' => 'Invitation successfully accepted']);\n\n }else{\n return redirect('/admin/dashboard/')->withErrors(['Inconsistent data']);\n }\n\n }", "public function handle (Actiontaken $event)\n {\n\n try {\n\n if ($event->actionname == 'accepted') {\n $this->accept ($event->classlearner);\n } elseif ($event->actionname == 'rejected') {\n $this->reject ($event->classlearner);\n }\n } catch (Exception $exception) {\n Storage::disk ('local')->append ('handleEnrollRequestederor.txt', $exception);\n\n\n }\n }", "public function serveRequest()\n {\n $msg = $this->connection->read();\n if (!$msg) return;\n $this->connection->acknowledge($msg);\n \n $replyMsg = $this->act($msg);\n\n // write correlation id\n $replyMsg->setHeader(\"correlation-id\", $msg->getId());\n\n $this->connection->send($msg->getReplyTo(), $replyMsg);\t\t\n }", "function acceptInvite($invite_id,$user_id,$status)\n\t\t{\n\t\t\t\n\t\t\t$where_cond = array(\"status\"=>$status);\n\t\t\t$this->db->where('id',$invite_id);\n\t\t\tif($this->db->update('da_invite_milking_machine_cleaning',$where_cond))\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}", "function assign_plan_patient_ehs(){\n\n\t\t\tif( $this->value('plan_id') != \"\" && $this->value('patient_id') != \"\" ){\n\n\t\t\t\theader(\"location:index.php?action=choose_patient_ehs&act=plan_customize&plan_id={$this->value('plan_id')}\");\n\n\t\t\t}\n\n\t\t\tinclude(\"template/therapistEhs/therapistArray.php\");\n\n\t\t\t$replace['header'] = $this->build_template($this->get_template(\"header\"));\n\n\t\t\t$replace['sidebar'] = $this->sidebar();\n\n\t\t\t$replace['act'] = $this->value('act');\n\n\t\t\t$replace['plan_id'] = $this->value('plan_id');\n\n\t\t\t$replace['plan_title'] = strtoupper($this->get_field($this->value('plan_id'), $this->config['table']['plan'], \"plan_name\"));\n\n\t\t\t$query_string = array(\n\n\t\t\t\t'plan_id' => $this->value('plan_id')\n\n\t\t\t);\n\n\t\t\t$replace['assign_plan_patient_head'] = $this->build_template($this->get_template(\"assign_plan_patient_head\"),$this->table_heading($assignPatientHead,\"u.name_last\",$query_string));\n\n\t\t\t$privateKey = $this->config['private_key'];\n $sort = \" AES_DECRYPT(UNHEX(u.name_last),'{$privateKey}') \";\n\n\t\t\tif( $this->value('sort') != \"\"){\n\n\t\t\t\tif( $this->value('sort') == 'u.name_last' ){\n $sort = \"AES_DECRYPT(UNHEX(u.name_last),'{$privateKey}')\";\n }\n else\n $sort = $this->value('sort');\n\n\t\t\t}\n\n\t\t\t$order = \" asc \";\n\n\t\t\tif($this->value('order') != \"\"){\n\n\t\t\t\t$order = $this->value('order');\n\n\t\t\t}\n\n\t\t\t$where = \"\";\n\n\t\t\tif($this->value('search') != \"\" ){\n $privateKey = $this->config['private_key'];\n\t\t\t\t$where = \" and ( CAST(AES_DECRYPT(UNHEX(u.name_last),'{$privateKey}') AS CHAR) like '%{$this->value('search')}%' or CAST(AES_DECRYPT(UNHEX(u.name_first),'{$privateKey}') AS CHAR) like '%{$this->value('search')}%') \";\n\n\t\t\t}\n $privateKey = $this->config['private_key'];\n\t\t\t$query = \" select \n AES_DECRYPT(UNHEX(u.name_title),'{$privateKey}') as name_title, \n AES_DECRYPT(UNHEX(u.name_first),'{$privateKey}') as name_first,\n AES_DECRYPT(UNHEX(u.name_last),'{$privateKey}') as name_last, \n tp.patient_id from therapist_patient tp\n\t\t\t\t\t\tinner join user u on u.user_id = tp.patient_id \n\t\t\t\t\t\tand u.usertype_id = '1' and ( u.status = '1' or u.user_id in (select u_id from program_user where p_status = '1' ) )\n\t\t\t\t\t\twhere tp.therapist_id = '{$this->userInfo('user_id')}' and \n u.user_id in \n (\n select user_id from clinic_user \n where clinic_id = '{$this->clinicInfo('clinic_id',$this->userInfo('user_id'))}'\n ) \n {$where} order by {$sort} {$order} \";\n\n\t\t\t\n\n\t\t\t$link = $this->pagination($rows = 0,$query,$this->value('action'),$this->value('search'),'');\t\t\t\t\n\n\t\t\t$replace['link'] = $link['nav'];\n\n\t\t\t$result = $link['result'];\t\t\t\t\t\t\t\t \t\n\n\t\t\tif(is_resource($result)){\n\n\t\t\t\twhile($row = $this->fetch_array($result)){\n\n\t\t\t\t\t$row['style'] = ($c++%2)?\"line1\":\"line2\";\n\n\t\t\t\t\t$row['actionOption'] = $this->build_select_option($assignPatientOption);\n\n\t\t\t\t\t$replace['assign_plan_patient_record'] .= $this->build_template($this->get_template(\"assign_plan_patient_record\"),$row);\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t$nav_bar = array(\n\n\t\t\t\t\t\t\t\t'patient' => ($this->value('plan_id') != \"\")?'<a href=\"index.php?action=assign_plan_patient&plan_id='.$this->value(\"plan_id\").'\"><img src=\"images/03_patient_red.gif\" /></a>':'<img src=\"images/03_patient_red.gif\" />',\n\n\t\t\t\t\t\t\t\t'assign' => ($this->value('plan_id') != \"\")?'<a href=\"index.php?action=createNewPlan&act=plan_edit&plan_id='.$this->value(\"plan_id\").'\"><img src=\"images/04_assign_gray.gif\" /></a>':'<img src=\"images/04_assign_gray.gif\" />',\n\n\t\t\t\t\t\t);\n\n\t\t\tif(is_array($nav_bar)){\n\n\t\t\t\t$replace = $replace + $nav_bar;\n\n\t\t\t}\n\n\t\t\t\n\n\t\t\t$replace['type'] = \"\";\n\n\t\t\t$temp = $replace['act'];\n\n\t\t\t$replace['back_url'] = \"\";\n\n\t\t\tif($_SESSION['type'] == \"treatment_plan\"){\n\n\t\t\t\t$replace['type'] = 'treatment_plan';\n\n\t\t\t\t// Build Back button Url\n\n\t\t\t\t\t$replace['act'] = \"plan_edit\";\n\n\t\t\t\t\t$replace['action'] = \"customize_articles\";\n\n\t\t\t\t\t$backUrl = array('action','patient_id','plan_id','type','act');\n\n\t\t\t\t\t$replace['back_url'] = \"<img src='images/btn-back.jpg' value='Back' onClick=\\\"window.location='\".$this->buildBackUrl($backUrl,$replace).\"'\\\" />\";\n\n\t\t\t\t// End of build Back button Url\n\n\t\t\t}\n\n\t\t\tif($_SESSION['type'] == \"finish\"){\n\n\t\t\t\t$replace['type'] = 'finish';\n\n\t\t\t\t// Build Back button Url\n\n\t\t\t\t\t$temp = $replace['act'];\n\n\t\t\t\t\t$replace['act'] = \"plan_edit\";\n\n\t\t\t\t\t$replace['action'] = \"customize_articles\";\n\n\t\t\t\t\t$backUrl = array('action','plan_id','type','act');\n\n\t\t\t\t\t$replace['back_url'] = \"<img src='images/btn-back.jpg' value='Back' onClick='window.location='\".$this->buildBackUrl($backUrl,$replace).\"' />\";\n\n\t\t\t\t// End of build Back button Url\n\n\t\t\t}\n\n\t\t\t\n\n\t\t\t$replace['act'] = $temp;\n\n\t\t\t$replace['body'] = $this->build_template($this->get_template(\"assign_plan_patient\"),$replace);\n\n\t\t\t$replace['browser_title'] = \"Tx Xchange: Assign Plan to Patient\";\n $replace['get_satisfaction'] = $this->get_satisfaction(); \n\t\t\t$this->output = $this->build_template($this->get_template(\"main\"),$replace);\n\n\t\t}", "public function actionCreate($task_id, $pass = 0) {\n $this->layout = '@app/views/layouts/main';\n $model = new DemandAcceptance();\n $deliveryModel = $this->findDeliveryModel($task_id);\n $model->loadDefaultValues();\n $model->demand_task_id = $task_id;\n if($model->demandTask->create_by == \\Yii::$app->user->id){\n if(!($model->demandTask->getIsStatusAcceptance() || $model->demandTask->getIsStatusAcceptanceing() || $model->demandTask->getIsStatusAppealing()))\n throw new NotAcceptableHttpException('该任务状态为'.$model->demandTask->getStatusName().'!');\n }else {\n throw new NotAcceptableHttpException('无权限操作!');\n } \n \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n $this->saveDemandAcceptanceData($model, Yii::$app->request->post());\n DemandAction::getInstance()->DemandCreateAcceptance($model);\n return $this->redirect(['task/view', 'id' => $model->demand_task_id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'pass' => $pass,\n 'deliveryModel' => $deliveryModel,\n 'detect' => new MobileDetect(),\n 'workitemType' => DemandTool::getInstance()->getDemandWorkitemTypeData($model->demand_task_id),\n 'workitem' => DemandTool::getInstance()->getDemandWorkitemData($model->demand_task_id),\n 'delivery' => DemandTool::getInstance()->getDemandDeliveryData($model->demand_task_id, $deliveryModel->id),\n 'percentage' => $this->getWorkitemTypePercentage($model->demand_task_id, $deliveryModel->id),\n ]);\n }\n }", "function Visit(IVisitorAcceptor $acceptor);", "public function inviteAction()\n\t{\n\t\t$user = new Default_Model_User();\n\t\t$resultRow = $user->getUserByEmail($this->loggedEmail);\n\t\t\n\t\t$loggedHandle = $resultRow->handle;\n\t\t$loggedId = $resultRow->id;\n\t\t\n\t\t$handle = $this->_request->getParam('handle');\n\t\t$resultRow = $user->getUserByHandle($handle);\n\t\t$handleId = $resultRow->id;\n\n\t\t$invite = new Default_Model_Invitation();\n\t\tif($invite->createInvitation($loggedId, $handleId)){\n\t\t\t$this->view->success = 1;\n\t\t} else{\n\t\t\t$this->view->success = 0;\n\t\t}\n\t}", "public function acceptFR($id)\n {\n $data = array(\n 'status' => 'friend',\n 'modified' => $this->today,\n );\n $this->db->where(\"(`user_id` =\". $id.\" AND `friend_id` =\".$this->session->Auth['id'].\")\");\n $this->db->or_where(\"(`user_id` =\".$this->session->Auth['id'].\" AND `friend_id` = \".$id.\")\");\n if($this->db->update('relationship',$data)){\n return true;\n } else{\n return false;\n }\n }", "function virustotalscan_admin_tools_action_handler(&$actions)\r\n{\r\n\t$actions['virustotalscan'] = array('active' => 'virustotalscan', 'file' => 'virustotalscan');\r\n}", "function fb_authorize_action() {\n\n if (!empty($_POST) && wp_verify_nonce($_POST['afap_fb_authorize_nonce'], 'afap_fb_authorize_action')) {\n\n include('inc/cores/fb-authorization.php');\n\n } else {\n\n die('No script kiddies please');\n\n }\n\n }" ]
[ "0.5739237", "0.5457175", "0.5310477", "0.5254878", "0.52076644", "0.5197656", "0.5173066", "0.5154822", "0.5132776", "0.50738585", "0.4907356", "0.4789465", "0.47849464", "0.4780551", "0.47659594", "0.4756391", "0.4738949", "0.473533", "0.47332546", "0.47159582", "0.47017986", "0.46594292", "0.46519208", "0.46465737", "0.46254444", "0.4622457", "0.46184027", "0.46062607", "0.45545948", "0.4552041", "0.45509538", "0.4550255", "0.45398146", "0.45385805", "0.45076716", "0.44985715", "0.44825995", "0.4470613", "0.44540986", "0.44477832", "0.44184414", "0.44009268", "0.43999618", "0.4384304", "0.43759787", "0.4373926", "0.4368577", "0.4365667", "0.43561947", "0.4354265", "0.4348672", "0.43424642", "0.43407935", "0.4333421", "0.43268836", "0.43266556", "0.4326156", "0.43227842", "0.43204343", "0.43052256", "0.42999655", "0.42976013", "0.42805344", "0.42740732", "0.4270938", "0.42619646", "0.4256674", "0.42423058", "0.42400107", "0.42358053", "0.42283422", "0.4225106", "0.4209319", "0.42091295", "0.42041814", "0.42013", "0.41957507", "0.41940713", "0.41930363", "0.4190607", "0.41850582", "0.41846752", "0.4179347", "0.4172264", "0.41709775", "0.4168707", "0.41610458", "0.4160207", "0.4156686", "0.41560632", "0.4154522", "0.41522938", "0.41503865", "0.41461924", "0.41455537", "0.41324246", "0.41272825", "0.4122124", "0.41204372", "0.4117546" ]
0.6320747
0
actionid: acceptbyatasan actiondesc: Accepting the izin by Supervisor
public function actionAcceptByAtasan($id, $redback=null){ $model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all(); foreach ($model as $m) { $m->status_by_atasan = 6; $m->status_by_wr2 = 1; } if($m->save()){ \Yii::$app->messenger->addSuccessFlash("Permohonan Izin telah di-accept oleh Atasan"); if(is_null($redback)) return $this->redirect(['index-by-atasan']); else return $this->redirect(Yii::$app->request->referrer); } else { return $this->render('viewByAtasan', [ 'model'=>$model ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function invi_accept() {\n if(isset($_GET['room_id'], $_GET['user_id'], $_GET['invi_id'])) {\n $data = $this->mod_user->md_acceptInvi($_GET['room_id'], $_GET['user_id'], $_GET['invi_id']);\n } else {\n die();\n }\n }", "public function requestAcceptAction() {\r\n $notification = $this->_getParam('notification', 0);\r\n\t\t$is_suggestionExist = Engine_Api::_()->getItem('user', $notification->object_id);\r\n\t\tif( empty($is_suggestionExist) ) {\r\n\t\t\t// If user are not exist then we are deleting the \"User Request\" which loggden user are gettig.\r\n\t\t\tEngine_Api::_()->getDbtable('notifications', 'activity')->delete(array('notification_id = ?' => $notification->notification_id));\r\n\t\t\t$this->_helper->redirector->gotoRoute(array('route' => 'default'));\r\n\t\t}else {\r\n\t\t\t$this->view->notification = $notification;\r\n\t\t}\r\n }", "public function accept(){\n \n }", "public function accept();", "public function accept($actor) {\n $arr = [\n \"type\" => \"Accept\",\n \"object\" => $this->activity_array,\n \"actor\" => $this->obj\n ];\n $accept = new Activity();\n $accept->fill($arr);\n // post new activity to the outbox\n return $accept; \n }", "public function acceptAction() {\n\n //CHECK AUTH\n if( !$this->_helper->requireUser()->isValid() ) return;\n\n $viewer = Engine_Api::_()->user()->getViewer();\n\n //GET THE SITEPAGE ID FROM THE URL\n $page_id = $this->_getParam('page_id');\n $sitepage = Engine_Api::_()->getItem('sitepage_page', $page_id);\n \n //MAKE FORM\n $this->view->form = $form = new Sitepagemember_Form_Member();\n $form->setTitle('Accept Page Invitation');\n $form->setDescription('Would you like to accept page invitation for this page?');\n $form->submit->setLabel('Accept Page Invitation');\n\n //PROCESS FORM\n if( !$this->getRequest()->isPost() ) {\n $this->view->status = false;\n $this->view->error = true;\n $this->view->message = Zend_Registry::get('Zend_Translate')->_('Invalid Method');\n return;\n }\n\n if( !$form->isValid($this->getRequest()->getPost()) ) {\n $this->view->status = false;\n $this->view->error = true;\n $this->view->message = Zend_Registry::get('Zend_Translate')->_('Invalid Data');\n return;\n }\n\n\t\t//SET THE REQUEST AS HANDLED\n\t\t$notification = Engine_Api::_()->getDbtable('notifications', 'activity')->getNotificationByObjectAndType($viewer, $sitepage, 'sitepagemember_invite');\n\t\tif( $notification ) {\n\t\t\t$notification->mitigated = true;\n\t\t\t$notification->save();\n\t\t}\n\n\t\t//GET VALUE FROM THE FORM.\n\t\t$values = $this->getRequest()->getPost();\n\t\t\n\t\t//ADD ACTIVITY\n\t\t$action = Engine_Api::_()->getDbtable('actions', 'activity')->addActivity($viewer, $sitepage, 'sitepage_join');\n\t\tif ( $action ) {\n Engine_Api::_()->getDbtable('actions', 'activity')->attachActivity( $action , $sitepage ) ;\n }\n\t\tEngine_Api::_()->getApi('subCore', 'sitepage')->deleteFeedStream($action,true);\n\t\tEngine_Api::_()->getDbtable('membership', 'sitepage')->update(array('active'=> '1', 'user_approved' => '1'), array('resource_id =?' => $page_id, 'user_id =?' => $viewer->getIdentity()));\n\t\t\n\t\t//MEMBER COUNT INCREASE WHEN MEMBER JOIN THE PAGE.\n\t\t$sitepage->member_count++;\n\t\t$sitepage->save();\n\t\t\n $this->view->status = true;\n $this->view->error = false;\n\n $message = Zend_Registry::get('Zend_Translate')->_('You have accepted the invite to the page %s');\n $message = sprintf($message, $sitepage->__toString());\n $this->view->message = $message;\n\n if( null === $this->_helper->contextSwitch->getCurrentContext() ) {\n return $this->_forwardCustom('success', 'utility', 'core', array(\n 'messages' => array($message),\n 'layout' => 'default-simple',\n 'parentRefresh' => true,\n ));\n }\n }", "public function GetAccept ();", "public function actionAccept()\n {\n if (!$this->isAdmin()) {\n $this->getApp()->action403();\n }\n\n $request = $this->getApp()->getRequest();\n $id = $request->paramsNamed()->get('id');\n $model = $this->findModel($id);\n if (!$model) {\n $this->getApp()->action404();\n }\n\n $status = $request->paramsGet()->get('status', 1);\n $model->status = $status;\n $model->save(false);\n\n return $this->back();\n }", "public function acceptInvitation()\n\t{\n\t\t$id = $this->request->data['id'];\n\t\t$room_name = $this->request->data['roomName'];\n\t\t$invite['MeetingUser']['id'] = $id;\n\t\t//set status 1 as accepted\n\t\t$invite['MeetingUser']['is_accept'] = 1;\n\t\t$invite['MeetingUser']['is_read'] = 1;\n\t\t$invite['MeetingUser']['is_attend'] = 0;\n\t\t//set notification\n\t\t$oldCount1 = $this->Session->read('oldMeetingCount');\n\t\tif ($oldCount1>0) {\n\t\t\t$newCount1 = $oldCount1-1;\n\t\t\t$this->Session->write('oldMeetingCount',$newCount1);\n\t\t}\n\t\tif($this->MeetingUser->save($invite))\n\t\t\techo \"1\";\n\t\telse\n\t\t\techo \"0\";\n\t\texit;\n\t}", "public function accept_action($user_id)\n {\n if (!OrganizerSettings::get()->locked && !OrganizerGroup::findGroup($user_id)->hasMaxTeamSize()) {\n OrganizerInvite::accept($user_id);\n }\n\n // Remove existing invites\n OrganizerInvite::cancel($user_id, User::findCurrent()->id);\n $this->redirect('show/index');\n }", "public function handleAcceptInvite($iid) {\n\t\tCourseListModel::acceptInvite($iid);\n\t\t$this->redirect('this');\n\t}", "public function handleInvites($gid = null){\n //Recupera o tipo de ação e o id do grupo\n $type = $this->request->getParam('?')['type'];\n $gid = $this->request->getParam('gid');\n\n //recupera os usuarios do grupo\n $userGroupsTable = TableRegistry::get('UsersGroup');\n $userGroups = $this->Groups->UsersGroup->find()->where(['group_id'=>$gid,'user_id'=>$this->user['id']])->first();\n switch($type){\n //Se ação for aceitar, salvar com status 1\n case 'accept':\n $userGroups->invite_status = 1;\n $userGroupsTable->save($userGroups);\n $this->Flash->success(__('Convite aceito! Agora você já pode participar do grupo'));\n return $this->redirect('/dashboard/invites');\n break;\n //Se ação for rejeitar salvar com status 2\n case 'reject':\n $userGroups->invite_status = 2;\n $userGroupsTable->save($userGroups);\n $this->Flash->success(__('Convite rejeitado'));\n return $this->redirect('/dashboard/invites');\n break;\n\n default:\n return $this->redirect('/dashboard/invites');\n }\n }", "public function accept_friend_request()\n {\n //update status to 1;\n $this->Friend_model->accept_friend_request_model();\n //two (perhaps more in the future) data rows are inserted into checked_on table where each one corresponds to the time the user has seen the other user's messages\n $this->Friend_model->insert_notifications_model();\n }", "function acceptVisitor(Visitee $visitee_in, Visitor $visitor_in) {\n $visitee_in->accept($visitor_in);\n}", "public function doAcceptTransfer($iClient = 0, $iAccount = 0, $fromDate = null, $toDate = null, $iOperation = 0) {\n if ($iOperation == 0) {\n $this->redirect('ctransaction/showTransferList/', 'Nebyla zvolena operace', 3);\n }\n $oOperation = $this->moperation->getById($iOperation);\n $oOperation->state = 1;\n $oOperation->employee = $_SESSION['user_id'];\n $oOperation->update();\n $this->redirect('ctransaction/showTransferList/'.$iClient.'/'.$iAccount.'/'.$fromDate.'/'.$toDate, 'Převod byl schválen', 1);\n }", "function acceptInvite($invite_id,$user_id,$status)\n\t\t{\t\n\t\t\t$where_cond = array(\"status\"=>$status);\n\t\t\t$this->db->where('id',$invite_id);\n\t\t\tif($this->db->update('da_invite_hygiene_investigation',$where_cond))\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\t\n\t\t}", "function yy_accept()\n {\n if (self::$yyTraceFILE) {\n fprintf(self::$yyTraceFILE, \"%sAccept!\\n\", self::$yyTracePrompt);\n }\n while ($this->yyidx >= 0) {\n $stack = $this->yy_pop_parser_stack();\n }\n /* Here code is inserted which will be executed whenever the\n ** parser accepts */\n }", "public function accept()\n {\n return true;\n }", "public function exec () {\r\n\t\t$a = isset($_GET['action']) ? $_GET['action'] : 'capa';\r\n\t\tswitch ($a) {\r\n\t\t\tcase 'capa':\r\n\t\t\t\t$this->capa();\r\n\t\t\tbreak;\r\n\t\t\tcase 'adicionar':\r\n\t\t\t\t$this->adicionar();\r\n\t\t\tbreak;\r\n\t\t\tcase 'alterar':\r\n\t\t\t\t$this->alterar();\r\n\t\t\tbreak;\r\n\t\t\tcase 'detalhar':\r\n\t\t\t\t$this->detalhar();\r\n\t\t\tbreak;\r\n\t\t\tcase 'excluir':\r\n\t\t\t\t$this->excluir();\r\n\t\t\tbreak;\r\n\t\t\tcase 'sair':\r\n\t\t\t\t$this->sair();\r\n\t\t\tbreak;\r\n\t\t} \r\n\t}", "public function inativarregistroAction()\n\t{\n\n\t}", "public function acceptInviteRequest()\n {\n $validations = ['isRoleUser', 'issetInvitation'];\n $request = Validations::manageValidations($validations);\n if ($request != false) {\n if ($request->accept == 1) {\n $query = \"UPDATE activities_users SET invite = 0 WHERE user_id = $request->authUserId and activity_id = $request->activity_id\";\n } else {\n $query = \"DELETE FROM activities_users WHERE user_id = $request->authUserId and activity_id = $request->activity_id\";\n }\n return $this->connection->nonQueryId($query);\n }\n return 'invalid data';\n }", "function Visit(IVisitorAcceptor $acceptor);", "public function acceptData($data);", "private function approve() {\n\n }", "public function accept($reward_id) {\n\n $user_id = $this->Auth->user('user_id');\n $reward = $this->Reward->acceptPendingReward($reward_id, $user_id);\n\n if (!empty($reward)) {\n\n // broadcast & refresh user's inventory\n $this->loadModel('User');\n $server = $this->User->getCurrentServer($user_id);\n\n if ($server) {\n $this->ServerUtility->broadcastRewardReceive($server, $user_id, $reward['Reward']);\n }\n }\n\n $this->loadItems();\n $this->loadModel('User');\n\n $this->User->id = $user_id;\n $credit = $this->User->field('credit');\n\n $this->set(array(\n 'credit' => $credit,\n 'userItems' => $this->User->getItems($user_id)\n ));\n\n $this->render('/Items/browse_inventory.inc');\n }", "public function acceptPayment(Mage_Payment_Model_Info $payment)\n {\n parent::acceptPayment($payment);\n Mage::getSingleton('postfinancecheckout_payment/service_deliveryIndication')->markAsSuitable($payment);\n return true;\n }", "public function acceptAction($id)\n\t{\n\t\t$answer = $this->answers->find($id);\n\t\t$answer->save([\n\t\t\t'accepted' => 1,\t\n\t\t]);\n\t\t$this->addUserScore(1, $this->session->get('userId'));\n\t\t$this->addUserScore(10, $answer->idUser);\n\t\t$this->activities->logActivity('accepted' , $answer->id, $answer->idUser, $answer->idQuestion);\n\t\t$this->response->redirect($this->request->getLastUrl() . '#answerreply' . $answer->id);\n\t}", "protected function doAccept(\\XLite\\Model\\Payment\\BackendTransaction $transaction)\n {\n return $this->doSecondary($transaction, 'accept');\n }", "public function actionAccept($id)\n {\n /*get cavity record*/\n $modelFound = $this->findModel($id);\n $userCreatorId = 1;\n if(User::find()->where(['username' => $modelFound->created_by_user])->exists()){\n /* @var $userModel User */\n $userModel = User::find()->where(['username' => $modelFound->created_by_user])->one();\n $userCreatorId = $userModel->id;\n }\n /*create property record*/\n $propertyRecord = new PropertyRecord();\n $propertyRecord->postcode = $modelFound->address_postcode_cavity_installation;\n $propertyRecord->address1 = $modelFound->address1_cavity_installation;\n $propertyRecord->address2 = $modelFound->address2_cavity_installation;\n $propertyRecord->address3 = $modelFound->address3_cavity_installation;\n $propertyRecord->town = $modelFound->address_town_cavity_installation;\n $propertyRecord->country = $modelFound->address_country_cavity_installation;\n $propertyRecord->installer = $modelFound->CWI_installer;\n $propertyRecord->created_by = $userCreatorId ;\n $propertyRecord->status = 'Accepted on System';\n /* CWI information */\n $propertyRecord->date_of_cwi = $modelFound->CWI_installation_date;\n $propertyRecord->installer = $modelFound->CWI_installer;\n $propertyRecord->product_installed = $modelFound->construction_type;\n $propertyRecord->save(false);\n\n /* Property Note*/\n $propertyNote = new PropertyNotes();\n $propertyNote->content = $modelFound->further_notes;\n $propertyNote->created_by = $userCreatorId;\n $propertyNote->note_type = PropertyNotes::NOTE_TYPE_INFO;\n $propertyNote->property_id = $propertyRecord->id;\n $propertyNote->save(false);\n\n /*create owner */\n $owner = new Owner();\n $owner->title = $modelFound->title;\n $owner->firstname = $modelFound->firstname;\n $owner->lastname = $modelFound->lastname;\n $owner->address1 = $modelFound->address1_cavity_installation;\n $owner->address2 = $modelFound->address2_cavity_installation;\n $owner->address3 = $modelFound->address3_cavity_installation;\n $owner->postalcode = $modelFound->address_postcode_cavity_installation;\n $owner->town = $modelFound->address_town_cavity_installation;\n $owner->country = \"United Kingdom\";\n $owner->email_address = $modelFound->email_address;\n if ($modelFound->second_application_telephone) {\n $owner->phone_number = $modelFound->telephone_number.' , '.$modelFound->second_application_mobile_landline;\n } else {\n $owner->phone_number = $modelFound->telephone_number;\n }\n $owner->phone_number = $modelFound->telephone_number;\n $owner->date_of_birth = $modelFound->birthday;\n $owner->save(false);\n\n $owner2 = new Owner();\n $owner2->title = $modelFound->second_application_title;\n $owner2->firstname = $modelFound->second_application_firstname;\n $owner2->lastname = $modelFound->second_application_lastname;\n $owner2->address1 = $modelFound->address1_cavity_installation;\n $owner2->address2 = $modelFound->address2_cavity_installation;\n $owner2->address3 = $modelFound->address3_cavity_installation;\n $owner2->date_of_birth = $modelFound->second_application_birthday;\n if (isset($modelFound->second_application_mobile_landline)) {\n $owner2->phone_number = $modelFound->second_application_telephone.','.$modelFound->second_application_mobile_landline;\n } else {\n $owner2->phone_number = $modelFound->second_application_telephone;\n }\n $owner2->email_address = $modelFound->second_application_email_address;\n $owner2->save(false);\n\n $propertOwner = new PropertyOwner();\n $propertOwner->owner_id = $owner->id;\n $propertOwner->property_id = $propertyRecord->id;\n $propertOwner->save(false);\n\n $propertOwner2 = new PropertyOwner();\n $propertOwner2->owner_id = $owner2->id;\n $propertOwner2->property_id = $propertyRecord->id;\n $propertOwner2->save(false);\n\n\n /*import the images and documents*/\n $supportingDocuments = $modelFound->getSupportingDocuments()->all();\n foreach ($supportingDocuments as $currentSupportingDocuments) {\n /* @var $currentSupportingDocuments CavitySupportingDocument */\n\n /*if current document has type supporting_document_images */\n if ($currentSupportingDocuments->type === 'supporting_document_images') {\n /*save to property document */\n $copyFrom = Yii::getAlias('@supporting_document_path') . DIRECTORY_SEPARATOR.$currentSupportingDocuments->document_name;\n $finalUploadName = Yii::getAlias('@upload_document_path') . DIRECTORY_SEPARATOR.$currentSupportingDocuments->document_name;\n if (isset($currentSupportingDocuments->document_name) && !empty($currentSupportingDocuments->document_name) && file_exists($copyFrom)) {\n copy($copyFrom, $finalUploadName);\n }\n $propertyDocument = new PropertyDocuments();\n $propertyDocument->property_id = $propertyRecord->id;\n $propertyDocument->document_description = $currentSupportingDocuments->document_description;\n $propertyDocument->document_name = $currentSupportingDocuments->document_name;\n $propertyDocument->save(false);\n } else {\n /*save it to pre appraisal images */\n $preAppraisalImage = new PropertyPreAppraisalImages();\n $copyFrom = Yii::getAlias('@supporting_document_path') . DIRECTORY_SEPARATOR.$currentSupportingDocuments->document_name;\n $finalUploadName = Yii::getAlias('@upload_image_path') . DIRECTORY_SEPARATOR.$currentSupportingDocuments->document_name;\n if (isset($currentSupportingDocuments->document_name) && !empty($currentSupportingDocuments->document_name) && file_exists($copyFrom)) {\n copy($copyFrom, $finalUploadName);\n }\n $preAppraisalImage->property_id = $propertyRecord->id;\n $preAppraisalImage->image_name = $currentSupportingDocuments->document_name;\n $preAppraisalImage->image_description = $currentSupportingDocuments->document_description;\n $preAppraisalImage->save(false);\n }\n $questionairePropertyRecord = new QuestionairePropertyRecord();\n $questionairePropertyRecord->cavity_form_id = $modelFound->id;\n $questionairePropertyRecord->property_record_id = $propertyRecord->id;\n $questionairePropertyRecord->save(false);\n }\n return $this->redirect(Url::to(['/record/update', 'id' => $propertyRecord->id]));\n }", "public function doExecute( ipsRegistry $registry )\r\n\t{\r\n\t\tif($this->request['request_method'] == 'post')\r\n\t\t{\r\n\t\t\tif(!marketRegistry::hasPluginPermission('use'))\r\n\t\t\t{\r\n\t\t\t\t$this->registry->getClass('output')->showError('no_permission');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(!isset($this->caches['ibm_bank_starter'][$this->request['starter_id']]))\r\n\t\t\t{\r\n\t\t\t\t$this->registry->getClass('output')->showError('no_permission');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->registry->getClass('class_localization')->loadLanguageFile( array( 'bank_bank' ) );\r\n\t\t\t\r\n\t\t\t$fee = numbers::round(numbers::multiply($this->caches['ibm_bank_starter'][$this->request['starter_id']]['s_interest_time'],$this->memberData['market_deduct']));\r\n\t\t\tif(numbers::compare($fee, $this->memberData[$this->settings['market_members_field']]) > 0)\r\n\t\t\t{\r\n\t\t\t\t$this->registry->getClass('output')->showError('not_enough_money');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(!$this->request['accountName'])\r\n\t\t\t{\r\n\t\t\t\t$this->registry->getClass('output')->showError('must_need_account_name');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$settings = unserialize($this->caches['market_plugin'][$this->request['plugin']]['plugin_config']);\r\n\t\t\tif($settings['max_account'])\r\n\t\t\t{\r\n\t\t\t\t$count = $this->DB->buildAndFetch(array('select'=>'COUNT(*) as total','from'=>'market_bank_accounts','where'=>\"a_mem_id=\".$this->memberData['member_id']));\r\n\t\t\t\t\r\n\t\t\t\tif($count['total'] >= $settings['max_account'])\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->registry->getClass('output')->showError('too_many_accounts');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$account = array();\r\n\t\t\t\r\n\t\t\t$account['a_random'] = numbers::multiply(1000000,(float)microtime());\r\n\t\t\t$account['a_mem_id'] = $this->memberData['member_id'];\r\n\t\t\t$account['a_name'] = $this->request['accountName'];\r\n\t\t\t$account['a_open'] = IPS_UNIX_TIME_NOW;\r\n\t\t\t$account['balance'] = 0;\r\n\t\t\t$account['a_interest_time'] = $this->caches['ibm_bank_starter'][$this->request['starter_id']]['s_interest_time'];\r\n\t\t\t$account['a_last_interest'] = IPS_UNIX_TIME_NOW - IPS_UNIX_TIME_NOW % 60;\r\n\t\t\t$account['interest_rate'] = $this->caches['ibm_bank_starter'][$this->request['starter_id']]['s_interest_rate'];\r\n\t\t\t$account['a_deposit_fee'] = $this->caches['ibm_bank_starter'][$this->request['starter_id']]['s_deposit_fee'];\r\n\t\t\t$account['a_withdraw_fee'] = $this->caches['ibm_bank_starter'][$this->request['starter_id']]['s_withdraw_fee'];\r\n\t\t\t$account['a_delete_fee'] = numbers::round(numbers::multiply($this->caches['ibm_bank_starter'][$this->request['starter_id']]['delete_fee'],$this->memberData['market_deduct']));\r\n\t\t\t\r\n\t\t\t$this->DB->insert('market_bank_accounts',$account);\r\n\t\t\t$account['account_id'] = $this->DB->getInsertId();\r\n\t\t\t$this->DB->update('members',array(\r\n\t\t\t\t\t\t\t\t\t\t\t\t$this->settings['market_members_field'] => numbers::subtract($this->memberData[$this->settings['market_members_field']], $fee),\r\n\t\t\t),\"member_id=\".$this->memberData['member_id']);\r\n\t\t\t\r\n\t\t\tbankPluginFunctions::logTransaction(bankPluginFunctions::getBankAccountID($account),'create',0,0,$fee);\r\n\t\t\t\r\n\t\t\t$this->registry->getClass('output')->redirectScreen( $this->lang->words['account_created'], $this->settings['base_url_with_app'] . \"plugin=\".$this->request['plugin'] . \"&amp;action=manage&amp;account_id=\" . $account['account_id'] );\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(!marketRegistry::hasPluginPermission('view'))\r\n\t\t\t{\r\n\t\t\t\t$this->registry->getClass('output')->showError('no_permission');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$this->registry->getClass('class_localization')->loadLanguageFile( array( 'bank_bank' ) );\r\n\t\t\t\r\n\t\t\t$this->request['account_id'] = intval($this->request['account_id']);\r\n\t\t\t\r\n\t\t\t$content = $this->registry->getClass('output')->getTemplate('ibm_plugin_bank')->listBankAccoutStarters($this->caches['ibm_bank_starter']);\r\n\t\t\t\r\n\t\t\t$template = $this->registry->getClass('output')->getTemplate('ibmarket')->ibmarketHTMLWrapper($content);\r\n\t\t\t\r\n\t\t\t$this->registry->getClass('output')->setTitle( $this->settings['market_name'] );\r\n\t\t\t$this->registry->getClass('output')->addContent( $template );\r\n\t\t\t\r\n\t\t\t$this->registry->getClass('output')->sendOutput();\r\n\t\t}\r\n\t}", "public function accept_invoice()\n\t{\n\t\tif ($_SERVER['REQUEST_METHOD'] === 'POST') {\n\t\t\tif (isset($_POST)) {\n\t\t\t\t$id = base64_decode($_POST['id']);\n\t\t\t\t// print_r($id);\n\t\t\t\t$tableName = 'master_invoice';\n\t\t\t\t$timestamp = date(\"Y-m-d H:i:s\");\n\t\t\t\tif (isset($id)) {\n\t\t\t\t\t$status = array('send_status' => ACCEPT);\n\t\t\t\t\t$condition = array('id' => $id);\n\t\t\t\t\t$result = $this->CustomModel->selectAllFromWhere($tableName, $condition); // Checking row into the data base\n\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t'invoice_number' => $result[0]['invoice_number'],\n\t\t\t\t\t\t'item_code' => $result[0]['product_code'],\n\t\t\t\t\t\t'invoice_date' => $result[0]['doi'],\n\t\t\t\t\t\t'item_description' => $result[0]['product_description'],\n\t\t\t\t\t\t'qty' => $result[0]['product_qty'],\n\t\t\t\t\t\t'closing_stock' => $result[0]['product_qty'],\n\t\t\t\t\t\t'amount' => $result[0]['product_amount'],\n\t\t\t\t\t\t'rate' => $result[0]['product_rate'],\n\t\t\t\t\t\t'update_by' => $_SESSION['userInfo']['username'],\n\t\t\t\t\t\t'last_updated' => $timestamp\n\t\t\t\t\t);\n\n\t\t\t\t\t$tablename = 'london_stock';\n\t\t\t\t\t$inr_data = $this->CustomModel->insertInto($tablename, $data);\n\n\t\t\t\t\tif ($inr_data > 0) {\n\t\t\t\t\t\t$res = $this->CustomModel->update_table($tableName, $condition, $status); //Updating the accept status \n\t\t\t\t\t\techo json_encode(array('message' => 'Invoice accepted and stock updated successfuly', 'type' => 'success'));\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo json_encode(array('message' => 'Something went worng please contact IT', 'type' => 'danger'));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function acceptInvitation($id){\n\n $invite = Invitation::find($id);\n $invite->is_accepted = true;\n $invite->save();\n return redirect()->back();\n }", "public function acceptOfferAction()\r\n {\r\n $this->checkSession();\r\n $offerId = $this->Request()->getParam(\"offerId\");\r\n\r\n // updating status of Offer\r\n $offer = Shopware()->Models()->find('Shopware\\CustomModels\\Offer\\Offer',$offerId);\r\n $offer->setStatus(4);\r\n try {\r\n Shopware()->Models()->persist($offer);\r\n Shopware()->Models()->flush();\r\n } catch(Exception $e) {\r\n }\r\n\r\n $this->redirect(array(\r\n 'module' => 'frontend',\r\n 'controller' => 'sKUZOOffer',\r\n 'action' => 'offers'\r\n ));\r\n\r\n }", "function action_editer_annonce() {\n\n\t$securiser_action = charger_fonction('securiser_action', 'inc');\n\n\t// Teste si autorisation pour les actions d'editions\n\t$arg = $securiser_action();\n/*\n\t// Envoi depuis les boutons \"publier/supprimer cette annonce\"\n\t\tif (preg_match(',^(\\d+)\\Wstatut\\W(\\w+)$,', $arg, $r)) {\n\t\t$id_annonce = $r[1];\n\t\tset_request('statut', $r[2]);\n\t\trevisions_annonces($id_annonce);\n\t} \t\n*/\n\t// Envoi depuis le formulaire d'edition d'une annonce existante \t\n\tif ($id_annonce = intval($arg)) { \t\n\t\t// Si cette annonce possede un 'id', alors elle n'est pas nouvelle\n\t\t// Effectuons donc une revision plutot qu'une edition.\n\t\trevisions_annonces($id_annonce);\n\t}\n\n\t// Envoi depuis le formulaire de creation d'une annonce\t\n\telse if ($arg == 'oui') {\n\t\t$id_annonce = insert_annonce();\n\t\tif ($id_annonce) revisions_annonces($id_annonce);\n\t}\n\t// Erreur\n\telse{\n\t\t// Si nous sommes dans aucun des cas precedent, alors on \n\t\t// a un probleme : renvoyons une erreur.\n\t\tinclude_spip('inc/headers');\n\t\tredirige_url_ecrire();\n\t}\n\n\t// A ce stade, il ne nous reste plus a choisir quelle page s'affiche a l'issue du processus\n\tif (_request('redirect')) {\n\t\t// Si une information de redirection existe on la recupere, et on redirige\n\t\t$redirect = parametre_url(urldecode(_request('redirect')),\n\t\t\t'id_annonce', $id_annonce, '&');\n\t\tinclude_spip('inc/headers');\n\t\tredirige_par_entete($redirect);\n\t}\n\telse \n\t\t// Sinon on se contente de renvoyer l'id de l'objet\n\t\t// (Utile par exemple pour une creation, ou la redirection est geree en amont)\n\t\treturn array($id_annonce,'');\n\n}", "private static function accept($args, $invite, $auth) {\n // insert a groups_users record\n $values = array(\n 'group_id'=>$invite['group_id'],\n 'user_id'=>hostsite_get_user_field('indicia_user_id'),\n 'administrator' => 'f'\n );\n $auth['write_tokens']['persist_auth']=true;\n $s = submission_builder::build_submission($values, array('model' => 'groups_user'));\n $r = data_entry_helper::forward_post_to('groups_user', $s, $auth['write_tokens']);\n // either a success, or already a member (2004=unique key violation)\n if (!isset($r['success']) && (!isset($r['code']) || $r['code']!==2004)) {\n // @todo Unique constraint needs to be added to groups_users\n if (function_exists('watchdog'))\n watchdog('iform', 'An internal error occurred whilst trying to accept an invite: '.print_r($r, true));\n return self::fail_message('An internal error occurred whilst trying to accept the invite', $args);\n } elseif (isset($r['code']) && $r['code']===2004) {\n hostsite_show_message(lang::get(\n 'There is no need to accept this invitation as you are already a member of {1}.', $invite['group_title']));\n hostsite_goto_page($args['groups_page_path']);\n } else {\n // delete the invitation\n $values = array(\n 'id'=>$invite['id'],\n 'deleted' => 't'\n );\n $s = submission_builder::build_submission($values, array('model' => 'group_invitation'));\n $r = data_entry_helper::forward_post_to('group_invitation', $s, $auth['write_tokens']);\n $group = data_entry_helper::get_population_data(array(\n 'table' => 'group',\n 'extraParams' => $auth['read'] + array('id'=>$invite['group_id'])\n ));\n if (!isset($r['success'])) {\n if (function_exists('watchdog'))\n watchdog('iform', 'An internal error occurred whilst trying to delete an accepted invite: '.print_r($r, true));\n // probably no point telling the user, as the invite accept worked OK\n }\n hostsite_goto_page($args['group_home_path'], array('group_id'=>$invite['group_id']));\n module_load_include('inc', 'iform', 'iform.groups');\n return iform_show_group_join_success($group[0], $auth, true, $args['group_home_path'], $args['group_page_path']);\n }\n return '';\n }", "public function actionAccept($confirmation) {\n\n\t\tUser::confirmEmail($confirmation);\n\t}", "public function setsubscribableAction()\n {\n \n }", "public function accept_all()\n {\n $ids = $_POST['ids'];\n foreach ($ids as $id) {\n $accepted = EventMobile::find($id);\n $accepted->update(['event_status_id' => 2]);\n $accepted->save();\n //Notify Each event owner\n $event_owner = $accepted->user;\n if ($event_owner) {\n $notification_message['en'] = 'YOUR EVENT IS APPROVED';\n $notification_message['ar'] = 'تم الموافقة على الحدث';\n $notification = $this->NotifcationService->save_notification($notification_message, 3, 4, $accepted->id, $event_owner->id);\n $this->NotifcationService->PushToSingleUser($event_owner, $notification);\n }\n //get users have this event in their interests\n $this->NotifcationService->EventInterestsPush($accepted);\n }\n\n }", "public function accept($item);", "public function request() { if($this->allowed(USER_WORKER)) {\n switch($this->action) {\n case 'pendingAmount':\n $this->getPending();\n break;\n case 'pendingList':\n $this->getRequests();\n break;\n case 'rejectedList':\n $this->getRequests('rejected');\n break;\n case 'acceptedList':\n $this->getRequests('accepted');\n break;\n case 'reject':\n $this->reject();\n break;\n case 'accept':\n $this->accept();\n break;\n default:\n $this->updateValue();\n break;\n }\n // direct update\n // TODO\n } else if ( ! $this->action ) {\n if($this->institution && testInstitution($this->institution)) {\n $this->appendToQueue();\n } else {\n $this->denied();\n }\n }\n }", "public function process()\n {\n Phpfox::isUser(true);\n /**\n * LOCK this feature\n *\n if($iId = $this->request()->get('id'))\n {\n $aInvite = Phpfox::getService('customprofiles')->getInviteAnonymousMessage($iId);\n if(isset($aInvite['invite_id']) && Phpfox::getUserId() == $aInvite['invite_user_id'])\n {\n if (Phpfox::isModule('notification'))\n {\n $type_id = 'customprofiles_anonymousconfirm';\n Phpfox::getService('customprofiles.process')->addNotification($type_id, $aInvite['feed_id'], $aInvite['invite_user_id'],$aInvite['user_id']); \n Phpfox::getService('customprofiles.process')->removeInviteAnonymousMessage($iId); \n }\n }\n } \n **/\n \n $this->url()->send('');\n }", "public function approveInvitation() {\n $this->autoRender = false;\n $communityId = $this->request->data['communityId'];\n $community = $this->Community->findById($communityId);\n if (!empty($community)) {\n $userId = $this->Auth->user('id');\n $this->CommunityMember->approve($communityId, $userId);\n\t\t\t//Community follow data\n\t\t\t$followCommunityData = array(\n\t\t\t\t'type' => FollowingPage::COMMUNITY_TYPE,\n\t\t\t\t'page_id' => $communityId,\n\t\t\t\t'user_id' => $userId,\n\t\t\t\t'notification' => FollowingPage::NOTIFICATION_ON\n\t\t\t);\n\t\t\t$this->FollowingPage->followPage($followCommunityData);\n\t\t\t\n $this->Session->setFlash(__('You are now a member of this community.'), 'success');\n } else {\n $this->Session->setFlash(__($this->invalidMessage), 'error');\n }\n }", "public function accept()\n {\n $url = URIResource::Make($this->path, array($this->id));\n $data = new DataPacket(array(\"state\" => CALL_STATES::active));\n $id = Locator::Find($this->client->post($url, $data->get()));\n $data->add(\"id\", $id);\n\n return Constructor::Make($this, $data->get());\n }", "function acceptInvite($invite_id,$user_id,$status)\n\t\t{\n\t\t\t\n\t\t\t$where_cond = array(\"status\"=>$status);\n\t\t\t$this->db->where('id',$invite_id);\n\t\t\tif($this->db->update('da_invite_milking_machine_cleaning',$where_cond))\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}", "public function ajaxAcceptRequest()\n\t{\n\t\t$request = FriendshipRequest::acceptRequest(Input::get('id'));\n\t\t\n\t\tif ($request)\n\t\t{\n\t\t\treturn array('error' => 0);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn array('error' => 1);\n\t\t}\n\t}", "function virustotalscan_admin_tools_action_handler(&$actions)\r\n{\r\n\t$actions['virustotalscan'] = array('active' => 'virustotalscan', 'file' => 'virustotalscan');\r\n}", "function acceptChallenge($data) {\n $ChallengeData = createChallengeDataObj();\n $acceptStatus = $ChallengeData->acceptChallenge($data);\n if($acceptStatus) {\n return array(\"acceptStatus\" => true);\n }else {\n return array(\"acceptStatus\" => false);\n }\n }", "public function approve_advertiser(Request $request)\n {\n\n }", "public function doAdminAccept($id)\n {\n return $this->where([\n \"id_pengaduan\" => $id,\n \"tipe\" => $this->type\n ])->update([\n \"disetujui_admin\" => 1\n ]);\n }", "public function acceptPayment($receipt)\n\t{\n\t}", "public function acceptPayment(Mage_Payment_Model_Info $payment)\n {\n// parent::acceptPayment($payment);\n //Note: $_canReviewPayment is set to false, but we are overriding\n // the parent method that checks for this property.\n // This is because we do not want to give a Merchant possibility\n // to manually accept or deny payment in Magento admin - order page.\n return true; // Will make the payment model approve the payment.\n }", "public function accept()\n {\n\n $update['id'] = $this->session->userdata('user_id');\n $update['data']['agree'] = '1';\n $update['table'] = 'users';\n $this->Application_model->update($update);\n\n redirect('/dashboard','refresh');\n\n }", "function approve(){\n\t\t$points= $this->ref('currently_requested_to_id')->get('points_available');\n\t\tif($points < 3000)\n\t\t\t$this->api->js()->univ()->errorMessage(\"Not suficcient points available, [ $points ]\")->execute();\n\t\t// Send point to the requester and less from your self ... \n\n\t\t$purchaser= $this->add('Model_MemberAll')->addCondition(\"id\",$this['request_from_id'])->tryLoadAny();\n\t\t$purchaser['points_available'] = $purchaser['points_available'] + 3000;\n\t\t$purchaser->save();\n\n\t\t$seller=$this->add('Model_MemberAll')->addCondition(\"id\",$this['currently_requested_to_id'])->tryLoadAny();\n\t\t$seller['points_available'] = $seller['points_available'] - 3000;\n\t\t$seller->save();\n\n\t\tif($this->api->auth->model->id == 1)\n\t\t\t$this['status']='Approved By Admin';\n\t\telse\n\t\t\t$this['status']='Approved';\n\n\t\t$this->save();\n\n\n\t}", "public function acceptLoginAction() {\n\t\treturn FALSE;\n\t}", "public function scanAction()\n {\n $ctrl = $this->dbController->find($this->checkControllerIdParam());\n $vCtrl = new Admin_Model_DbRow_Controller();\n $all = array();\n $vVanish = array();\n $vNew = array();\n\n IF($ctrl->count() === 1) {\n $ctrlRow = $vCtrl->fromArray($ctrl->current());\n\n FOREACH($this->dbAction->findActionByControllerId($ctrlRow->get('id')) AS $row) {\n $all[] = new Admin_Model_DbRow_Action($row);\n }\n\n $scanned = $this->ctrlActionModel->getActions(\n $ctrlRow->get('moduleName'),\n $ctrlRow->get('controllerName'),\n $ctrlRow->get('virtual'));\n\n $vNew = $this->dbAction->filterExistingActions($ctrlRow->get('id'), $scanned);\n $vVanish = $this->ctrlActionModel->filterVanishedActions($all, $scanned);\n }\n\n $this->view->controller = $vCtrl;\n $this->view->vanished = $vVanish;\n $this->view->new = $vNew;\n }", "public function accountantApproved( $id );", "public function acceptOrDenyAction(Request $request)\n {\n $ad = (int)$request->attributes->get('ad');\n $offer = (int)$request->attributes->get('offer');\n $type = $request->attributes->get('action');\n $userAttr = $this->user->getAttributes();\n $isTest = (int)$request->attributes->get('test');\n $testResult = (int)$request->attributes->get('result');\n $validCSRF = $this->validateCSRF();\n if($isTest == 1 && $testResult == 0)\n {\n $userAttr = array('id' => (int)$request->attributes->get('user'));\n $ad = (int)$request->attributes->get('id');\n $offer = (int)$request->attributes->get('id2');\n $type = 'accepter';\n $validCSRF = true;\n }\n elseif($isTest == 1 && $testResult == 1)\n {\n $userAttr = array('id' => (int)$request->attributes->get('elUser1'));\n $ad = (int)$request->attributes->get('id');\n $offer = (int)$request->attributes->get('id2');\n $type = 'accepter';\n $validCSRF = true;\n }\n elseif($this->isTest)\n {\n $userAttr = array('id' => 2);\n $validCSRF = true;\n }\n $data = $this->enMan->getRepository('AdItemsBundle:AdsOffersPropositions')->propositonExists($ad, $offer, (int)$userAttr['id']);\n if($validCSRF === true && ($type == 'accepter' || $type == 'refuser') && isset($data['id_ad']) && $data['id_ad'] == $ad && isset($data['id_of']) && $offer == $data['id_of'])\n {\n // access tests case\n if($isTest == 1)\n {\n return new Response(parent::testAccess($testResult, 1), 200);\n }\n $this->enMan->getConnection()->beginTransaction();\n try\n {\n $tplVals = array('{AD_TITLE}', '{OFFER_NAME}', '{LOGIN}');\n $realVals = array($data['adName'], $data['offerName'], $this->user->getUser());\n switch($type)\n {\n case 'accepter':\n // add offer to ads_offers table\n $aofEnt = new AdsOffers;\n $aofEnt->setAdsIdAd($this->enMan->getReference('Ad\\ItemsBundle\\Entity\\Ads', $ad));\n $aofEnt->setOffersIdOf($this->enMan->getReference('Catalogue\\OffersBundle\\Entity\\Offers', $offer));\n $aofEnt->setAddedDate('');\n $this->enMan->persist($aofEnt);\n $this->enMan->flush();\n\n $i = 1;\n\n // notify ad's author about the new offer\n $template = str_replace($tplVals, $realVals, file_get_contents(rootDir.'messages/offer_accepted.message'));\n // $templateMail = str_replace($tplVals, $realVals, file_get_contents(rootDir.'mails/offer_accepted.maildoc'));\n $title = \"Proposition a été acceptée\";\n $message = \"Proposition a été correctement acceptée\";\n\n // update ads_modified table with the last modification\n $this->enMan->getRepository('AdItemsBundle:AdsModified')->adModified($ad, 'offer_accepted');\n break;\n case 'refuser':\n $i = -1;\n $template = str_replace($tplVals, $realVals, file_get_contents(rootDir.'messages/offer_denied.message'));\n // $templateMail = str_replace($tplVals, $realVals, file_get_contents(rootDir.'mails/offer_denied.maildoc'));\n $title = \"Proposition a été réfusée\";\n $message = \"Proposition a été correctement supprimée\";\n break;\n }\n $q = $this->enMan->createQueryBuilder()->delete('Ad\\ItemsBundle\\Entity\\AdsOffersPropositions', 'aop')\n ->where('aop.ads_id_ad = ?1 AND aop.offers_id_of = ?2 AND aop.users_id_us = ?3')\n ->setParameter(1, $ad)\n ->setParameter(2, $offer)\n ->setParameter(3, $userAttr['id'])\n ->getQuery();\n $p = $q->execute();\n\n // update offers quantity for this ad\n $this->enMan->getRepository('AdItemsBundle:Ads')->updateOffersQuantity($i, $ad);\t\t\n\n // Send private message\n $author = $this->enMan->getReference('User\\ProfilesBundle\\Entity\\Users', (int)$userAttr['id']);\n $messageVals = array(\n 'title' => $title,\n 'content' => $template,\n 'type' => 2,\n 'state' => 1\n );\n $this->enMan->getRepository('MessageMessagesBundle:Messages')->sendPm($author, $this->enMan->getReference('User\\ProfilesBundle\\Entity\\Users', $data['id_us']), $messageVals);\n\n $emtEnt = new EmailsTemplates;\n $mail = \\Swift_Message::newInstance()\n ->setSubject($title)\n ->setFrom($this->from['mail'])\n ->setTo($data['email'])\n ->setContentType(\"text/html\")\n ->setBody($emtEnt->getHeaderTemplate().$template.$emtEnt->getFooterTemplate());\n $this->get('mailer')->send($mail);\n\n // commit SQL transaction\n $this->enMan->getConnection()->commit();\n if($this->isTest)\n {\n return new Response('accepted_successfully');\n }\n $ret['isError'] = 0;\n $ret['message'] = $message;\n }\n catch(Exception $e)\n {\n $this->enMan->getConnection()->rollback();\n $this->enMan->close();\n throw $e;\n }\n }\n elseif($validCSRF === false)\n {\n $ret['isError'] = 1;\n $ret['message'] = \"Votre session a expiré. Veuillez réessayer\";\n }\n else\n {\n // access tests case\n if($isTest == 1)\n {\n return new Response(parent::testAccess($testResult, 0), 200);\n }\n $ret['isError'] = 1;\n $ret['message'] = \"Une erreur s'est produite\";\n }\n echo json_encode($ret);\n\tdie();\n }", "public function invites();", "protected function accepted()\n {\n $this->response = $this->response->withStatus(202);\n $this->jsonBody($this->payload->getOutput());\n }", "public function executeAction() {\r\n\t\t\r\n\t}", "function accept($data,$type=NULL){\n if(is_object($data) and get_class($data)===get_class($this)) return TRUE;\n if(is_null($type)) $type = $this->get_type($data,FALSE,FALSE);\n else if(is_int($type)) $type = def(self::$types,$type,'null');\n $acc = def($this->accept,$type,0);\n if($acc<2) return $acc==1;\n $mth = 'check_' . $type;\n return $this->$mth($data);\n }", "public function accept($token)\n { \n $invitation = Invite::where('token', '=', $token)->first();\n\n $now = Carbon::now();\n\n $dateInvite = new Carbon($invitation->valid_until);\n \n if($now->lte($dateInvite) && $invitation->email == Auth::user()->email){\n\n $invitation->presence = true;\n \n $invitation->save();\n\n return redirect('/admin/dashboard/')->with(['success' => 'Invitation successfully accepted']);\n\n }else{\n return redirect('/admin/dashboard/')->withErrors(['Inconsistent data']);\n }\n\n }", "private function btn_approve_reject(){\n\n // Skip the unduly cases\n if ($not_my_case = (VM::outOfScope()\n\t\t\t|| !$this->isWritable() \n\t\t\t|| ($this->rec['v_type'] == VISIT_OUT_OF_SCOPE) \n\t\t\t|| !in_array($this->doing,array('lists','budget',)) \n\t\t\t)){\n $this->dbg('not my case? '.($not_my_case ? 'YES' : 'NO'));\n return array('','');\n }\n\n // The event is endorsed (i.e. changes are locked), show only pending applicants and return\n if(0) if (VM::isEventEndorsed() || ($this->rec['v_end'] < time())){\n\tif (False){ // ? Strange... To be changed?\n\t $reply = array('');\n\t if ($this->fnc_beslut) $reply[] = $this->highlights['fnc'][$this->fnc_beslut]['i'];\n\t else $reply[] = '';\n\t if (stripos(serialize($reply),'send mail') !== False) b_debug::var_dump('fnc_beslut',$this->fnc_beslut,date('Y-m-d',$this->rec['v_end']),$reply);\n\t if (stripos(serialize($reply),'send mail') !== False) b_debug::internalError();\n\t}else{ \n\t $reply = array('','');\n\t}\n\t// $t = $reply; array_unshift($t,2,$this->rec['v_id']); $this->dbg($t,True);\n\treturn $reply;\n }\n\n bTiming()->cpu(__function__);\n\n // \n // See what should we do, depends on the visit status \n //\n $reply = array('','');\n $v_status = bForm_vm_Visit::_getStatus($this->rec,$check_clashes=True);\n switch($v_status){\n \n case STATUS_CLASH:\n break;\n\n case STATUS_NO: \n $this->rec['_a_name'] = $this->rec['_o_name'] = '';\n switch ($this->rec['v_type']){\n case VISIT_TYPE_RENT:\n case VISIT_OUT_OF_SCOPE:\n\tbreak;\n\t\n case VISIT_TYPE_OTHER:\n case VISIT_TYPE_COLLABORATION:\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$reply = (VM::hasRightTo('approve_guest_invitation',$this->v)\n\t\t ? array('','') \n\t\t : array('',$this->say('Ni')));\n\tbreak;\n\t\n case VISIT_TYPE_PROGRAM: \n\t$reply = (VM::hasRightTo('approve_registrant_application')\n\t\t ? array('',$this->say('NY'))\n\t\t : array('',$this->say('Ni')));\n }\n break;\n \n case STATUS_PENDING:\n if (@$this->rec['_a_name'] !== LODGING_OA_TXT) $this->rec['_a_name'] = $this->rec['_o_name'] = '';\n switch ($this->rec['v_type']){\n case VISIT_TYPE_RENT: // auto-accept the rents\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$this->v->setStatus(STATUS_YES);\n\t$this->v->setPolicy(VM_V_welcomeMailSent,True,False,True);\n\t$this->rec['v_status'] = STATUS_YES;\n\tbreak;\n\t\n case VISIT_OUT_OF_SCOPE:\n\tbreak 2;\n\t\n case VISIT_TYPE_OTHER:\n case VISIT_TYPE_COLLABORATION:\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$reply = (VM::hasRightTo('approve_guest_invitation',$this->v)\n\t\t ? array('','') \n\t\t : array('',$this->say('Pi')));\n\tbreak;\n\t\n case VISIT_TYPE_PROGRAM: \n\t$reply = (VM::hasRightTo('approve_registrant_application')\n\t\t ? array($this->say('Y'),\n\t\t\t $this->say('N'))\n\t\t : array('',$this->say('Pi')));\n\tbreak;\n\t\n default:\n\tb_debug::internalError('?? v_type=\"'.$this->rec['v_type'].'\"');\n }\n break;\n \n case STATUS_YES:\n switch ($this->rec['v_type']){\n case VISIT_OUT_OF_SCOPE:\n\tbreak;\n\n case VISIT_TYPE_RENT:\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$this->v->setPolicy(VM_V_welcomeMailSent,True,False,True);\n\t$this->rec['v_policy'] = $this->v->getValue('v_policy',1,1);\n\tbreak;\n\n case VISIT_TYPE_OTHER:\n case VISIT_TYPE_COLLABORATION:\n\tif (!$this->v) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$reply = (VM::hasRightTo('approve_guest_invitation',$this->v)\n\t\t ? array('','') \n\t\t : array('',$this->say('Yi')));\n\tbreak;\n\t\n case VISIT_TYPE_PROGRAM: \n\t$reply = (VM::hasRightTo('approve_registrant_application')\n\t\t ? array('',$this->say('YN'))\n\t\t : array('',$this->say('Yi')));\n\tbreak;\n }\n }\n bTiming()->cpu();\n // $t = $reply; array_unshift($t,3,$this->rec['v_id']); $this->dbg($t,True);\n return $reply;\n }", "public function acceptInvite($inviterID) {\n\t\t$conditions = array();\n\t\t$conditions['user_one_id'] = $inviterID;\n\t\t$conditions['user_two_id'] = $this->id;\n\n\t\t$success = ConnectionFactory::updateTableRowAbsoluteBasic(\"agencies\", array('accepted'=>1), $conditions);\n\n\t\tif ($success) {\n\t\t\treturn ConnectionFactory::updateTableRowsRelativeOnIDs(\"users\", array('agency_size'=>1),\n\t\t\t\tarray($this->id, $inviterID));\n\t\t}\n\t}", "function indexAction() {\n \t$server = implode('.', explode('.', $_SERVER['SERVER_ADDR'], -1));\n \t$remote = implode('.', explode('.', $_SERVER['REMOTE_ADDR'], -1));\n \t\n try {\n \t$this->authenticateAction('add');\n \tif ($this->auth->getIdentity()->role == 'bidder') {\n \t\t\t$this->_helper->layout->setlayout('bid');\n \t}\n } catch (Metis_Auth_Exception $e) {\n \t$e->failed();\n \treturn;\n }\n }", "public function acceptFriendRequest(User $user) {\n\n // Grab the friend requests where the id = the user id\n // then grab that user and update the pivot (table)\n // and update array to accepted = true (or = 1)\n $this->friendRequests()->where('id', $user->id)\n ->first()->pivot->update(['accepted' => true]);\n }", "public function sendAction() {\n\t\t$this->certificateAction(TRUE);\n\t\t$this->groupAction(TRUE);\n\t\t$this->statAction(TRUE);\n\t}", "public function front_action() {\n\n\t\tif ( $this->is_request_to_forget() ) {\n\t\t\t$this->process_request_to_forget();\n\t\t}\n\n\t\tif ( $this->is_request_confirmation() ) {\n\t\t\t$this->process_confirm_request();\n\t\t}\n\t}", "public function SetAccept (array $accept = []);", "public function authorizeAction();", "public function doRedirectAccept() {\n\t\t\theader(\"Location: ../../accept.php?\".http_build_query($_REQUEST));\n\t\t\texit;\n\t\t}", "public function accept(Loan $loan)\n {\n // if ($loan->isApproved()) {\n $loan->fill(['status' => Loan::ACCEPTED]);\n\n if ($loan->update()) {\n return response()->json(['message' => 'Loan status was updated'], 200);\n }\n // }\n\n // return response()->json(['message' => 'Loan is not approved'], 200);\n }", "function acceptServRequest(){\n $serv_ID=$this->uri->segment(3);\n $data['result']=$this->deliveryAndPickupModel->acceptRequest($serv_ID);\n $this->load->view('deliveryAndPickupView/customerInfo', $data);\n }", "function handle_actions() {\n $id = filter_input(INPUT_GET, 'id');\n global $subscribers;\n global $log;\n\n // POST\n $action = filter_input(INPUT_POST, 'action');\n if ($action == 'create') { \n $log->log('Subscriber CREATE'); // CREATE\n $subscribers->add();\n }\n \n\n // GET\n $action = filter_input(INPUT_GET, 'action');\n if (empty($action)) { \n $log->log('Subscriber READ'); // READ\n return $subscribers->list_view();\n }\n if ($action == 'add') {\n $log->log('Subscriber Add View');\n return $subscribers->add_view();\n }\n }", "public function accepted(Request $request)\n {\n $booking = Booking::findOrFail($request->id);\n $booking->status = 4;\n $booking->note = $request->message_admin;\n $booking->save();\n\n event(new BookingWasChanged($booking));\n $user = $booking->user;\n $manager = $booking->room->house->manager->user;\n $user->notify(new BookingNotification($booking));\n $manager->notify(new BookingNotification($booking));\n\n $info = [\n 'id' => $request->id,\n 'status' => 2\n ];\n // self::statusUpdate($info);\n $user = $booking->user()->first();\n $user->notify(new BookingUpdateUser($booking));\n\n return redirect()->back()->with('accepted_success','Se realizo el cambio');\n }", "function action()\n\t{\n\n switch($_REQUEST['opcion'])\n\t\t{\n\n case \"consultar\":\n //unset ($_REQUEST['action']);\n \n $pagina= $this->configuracion[\"host\"]. $this->configuracion[\"site\"].\"/index.php?\";\n\t\t\t\t$variable=\"pagina=admin_consultarHistoricoRecibos\";\n\t\t\t\t$variable.=\"&opcion=consultarEstudiante\";\n $variable.=\"&codEstudiante=\".$_REQUEST['codEstudiante'];\n \n\t\t\t\tinclude_once($this->configuracion[\"raiz_documento\"]. $this->configuracion[\"clases\"].\"/encriptar.class.php\");\n $this->cripto=new encriptar();\n\t\t\t\t$variable=$this->cripto->codificar_url($variable, $this->configuracion);\n\n echo \"<script>location.replace('\".$pagina.$variable.\"')</script>\";\n break;\n\t\t}\n\t}", "protected function executeAction() {}", "protected function executeAction() {}", "protected function executeAction() {}", "protected function executeAction() {}", "public function accept($id)\n {\n $interview = Interview::findOrFail($id);\n\n $interview->update([\n 'status' => 'accepted'\n ]);\n }", "public function accept($token)\n\t{\n \t$vendor = new Vendor();\n\t\treturn $vendor->AcceptAppointments($token,true);\n\t}", "public function acceptPayment(\\Magento\\Payment\\Model\\InfoInterface $payment)\n {\n parent::acceptPayment($payment);\n $response = $this->_remoteXml->releasePayment($payment, []);\n if (!isset($response) || !$response) {\n throw new \\Magento\\Framework\\Exception\\LocalizedException(__('The accept payment action failed'));\n }\n $fields = $response->toArray();\n if ($fields['RESULT'] != '00') {\n throw new \\Magento\\Framework\\Exception\\LocalizedException(\n __(\n 'The accept payment action failed. Gateway Response - Error ' . $fields['RESULT'] .\n ': ' . $fields['MESSAGE']\n )\n );\n }\n $payment->setTransactionId($fields['PASREF'])\n ->setParentTransactionId($payment->getAdditionalInformation('PASREF'))\n ->setTransactionAdditionalInfo(\\Magento\\Sales\\Model\\Order\\Payment\\Transaction::RAW_DETAILS, $fields);\n\n return $this;\n }", "public function acceptAction()\n {\n $this->view->disable();\n\n $this->setJsonResponse();\n\n if (!$this->request->isPost()) {\n return false;\n }\n\n //Find the post by Id\n $postReply = Comments::findFirstById($this->request->getPost('objectId'));\n if (!$postReply) {\n $this->jsonMessages['messages'][] = [\n 'type' => 'error',\n 'content' => t('Post reply does not exist')\n ];\n return $this->jsonMessages;\n }\n\n if (!$this->auth->isAuthorizedVisitor()) {\n $this->jsonMessages['messages'][] = [\n 'type' => 'error',\n 'content' => t('You must log in first to accepted answer')\n ];\n return $this->jsonMessages;\n }\n\n if ($postReply->getAccepted() == 'Y') {\n $this->jsonMessages['messages'][] = [\n 'type' => 'error',\n 'content' => t('This reply is already accepted as answer')\n ];\n return $this->jsonMessages;\n }\n\n if ($postReply->post->getDeleted()) {\n $this->jsonMessages['messages'][] = [\n 'type' => 'error',\n 'content' => t('Post associated to the reply is deleted')\n ];\n return $this->jsonMessages;\n }\n\n if ($postReply->post->getAcceptedAnswer() == 'Y') {\n $this->jsonMessages['messages'][] = [\n 'type' => 'error',\n 'content' => t('This post already has an accepted answer')\n ];\n return $this->jsonMessages;\n }\n\n $user = Users::findFirstById($this->auth->getUserId());\n\n if ($postReply->post->getUsersId() != $user->getId() && $user->getModerator() != 'Y') {\n $this->jsonMessages['messages'][] = [\n 'type' => 'error',\n 'content' => t('You can\\'t accept this answer as correct')\n ];\n }\n\n /* @todo later */\n $postQuestionByUser = $postReply->post->getUsersId();\n $postReplyByUser = $postReply->getUsersId();\n $kConst = Karma::SOMEONE_ELSE_ACCEPT_YOUR_REPLY;\n if ($postQuestionByUser != $postReplyByUser) {\n $k = $kConst + $postReply->post->user->getKarma();\n $v = $kConst + $postReply->post->user->getVotePoint();\n $points = (50 + intval(abs($user->getKarma() - $postReply->user->getKarma()) / 1000));\n\n $parametersBounty = [\n 'usersId = ?0 AND CommentsId = ?1',\n 'bind' => [$postReply->getUsersId(), $postReply->getId()]\n ];\n $postBounty = PostsBounties::findFirst($parametersBounty);\n if ($postBounty) {\n $points += $postBounty->getPoints();\n }\n //$postReply->post->user->setKarma($k);\n //$postReply->post->user->setVotePoint($v);\n\n /**@ Getting an own reply as 'accepted answer' by someone else */\n $postReply->user->setKarma($points + $postReply->user->getKarma());\n $postReply->user->setVotePoint($points + $postReply->user->getVotePoint());\n\n if ($postReplyByUser != $user->getId() && $postQuestionByUser != $user->getId()) {\n //$user->setKarma($kConst + $user->getKarma());\n // $user->setVotePoint($kConst + $user->getVotePoint());\n }\n //Adding notification @todo\n }\n $postReply->setAccepted('Y');\n $postReply->post->setAcceptedAnswer('Y');\n if ($postReply->save()) {\n if (!$user->save()) {\n foreach ($user->getMessages() as $message) {\n $this->jsonMessages['messages'][] = [\n 'type' => 'error',\n 'content' => $message->getMessage()\n ];\n return $this->jsonMessages;\n }\n }\n }\n //Return data display ajax when every ok\n return (['data' => 1]);\n }", "public function act() {\n\t}", "public function indexAction()\n {\n if (!$this->getRequest()->isPost()) {\n return;\n }\n\n try {\n $data = $this->getRequest()->getPost();\n Mage::getModel('payssion/notify')->handleNotify($data);\n } catch (Exception $e) {\n Mage::logException($e);\n\t\t\theader(\"HTTP/1.1 406 Not Acceptable\");\n\t\t\texit;\n }\n }", "public function accept()\n {\n\n if($this->user['menteer_type']==37 && $this->user['is_matched'] > 0 && $this->user['match_status']=='pending') {\n\n // mentor update\n $update_user = array(\n 'id' => $this->session->userdata('user_id'),\n 'data' => array('match_status' => 'active','match_status_stamp' => date('y-m-d H:i:s')),\n 'table' => 'users'\n );\n $this->Application_model->update($update_user);\n\n // mentee update\n $update_user = array(\n 'id' => $this->user['is_matched'],\n 'data' => array('match_status' => 'active','match_status_stamp' => date('y-m-d H:i:s')),\n 'table' => 'users'\n );\n $this->Application_model->update($update_user);\n\n $mentee = $this->Application_model->get(array('table'=>'users','id'=>$this->user['is_matched']));\n\n // notify mentee about the accept\n\n $data = array();\n $data['first_name'] = $this->user['first_name'];\n $data['last_name'] = $this->user['last_name'];\n\n $message = $this->load->view('/chooser/email/accept', $data, true);\n $this->email->clear();\n $this->email->from($this->config->item('admin_email', 'ion_auth'), $this->config->item('site_title', 'ion_auth'));\n $this->email->to($mentee['email']);\n $this->email->subject('Mentor has accepted');\n $this->email->message($message);\n\n $result = $this->email->send(); // @todo handle false send result\n\n $this->session->set_flashdata('message', '<div class=\"alert alert-success\">The Mentee has been notified about the acceptance.</div>');\n redirect('/dashboard');\n\n }else{\n\n redirect('/dashboard');\n\n }\n\n }", "public function actionAcceptByHrd($id){\n $model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all();\n\n foreach ($model as $m) {\n $m->status_by_hrd = 6;\n }\n\n if($m->save()){\n \\Yii::$app->messenger->addSuccessFlash(\"Permohonan Izin telah di-accept oleh HRD\");\n return $this->redirect(['index-by-hrd']);\n } else {\n return $this->render('viewByHrd', [\n 'model'=>$model\n ]);\n }\n }", "protected function executeAction() {\n \n }", "public function approve($id)\n\t{\n\t\t$user = User::findOrFail($id);\n\t\tAuth::user()->requestOf()->sync([$user->id => ['status' => 'Accepted']], false);\n\t\treturn response()->json(['Request Accepted!']);\n\t}", "public function invoke()\n {\n /** @var Request $request */\n $request = $this->bootstrap->getActiveRequestHandler()->getHttpRequest();\n $this->floodMitigationService->registerAccess($request->getClientIpAddress());\n\n return true;\n }", "public function approve($id){\n\n return 'hi';\n }", "public function EstudianteInscripcion_post() {\n\t\t$estudiante = $this->input->post(\"txtEstudianteID\");\n\t\t$seminario = $this->input->post(\"txtSeminarioID\");\n\t\n\n\t\t//mandar los input a arreglo y campos de la bd\n\t\t$data = array(\n\t\t\t'estudianteID' => $estudiante ,\n\t\t\t'seminarioID' => $seminario ,\n\t\t\t\n\t\t );\n\n if($this->EstudianteModel->EstudianteInscripcion($data))\n $this->response(array('status' => 'exito'));\n else \n $this->response(array('status' => 'fallo'));\n }", "public function acceptAgreementsAction(int $siteId, array $accepted = []): void\n {\n \\Bitrix\\Landing\\Site\\Cookies::acceptAgreement($siteId, $accepted);\n }", "public function accept_frnd_req($frnd_id) {\n $userid = $this->session->userdata('logged_in')['id'];\n $data = array(\n 'user_approved' => 1,\n 'active' => 1,\n 'req_accepted' => date('Y-m-d H:i:s')\n );\n $this->Friendsmodel->accept_frnd_req($frnd_id, $userid, $data);\n $data1 = array(\n 'resourse_approved' => 1,\n 'active' => 1,\n 'req_accepted' => date('Y-m-d H:i:s')\n );\n $this->Friendsmodel->accept_frnd_req($userid, $frnd_id, $data1);\n add_notification($frnd_id, $userid,'has accepted your friend request');\n }", "public function approve_submission(Request $request)\n {\n }", "public function approveAndEarmark() {\n // Check if user has enough money available on card to pay for amount on authorization request.\n // Assumption: it's enough to check if the available balance is no greater than the amount that has been authorized.\n if ($this->card->availableBalance() > $this->authorizationRequest->getAuthorizedAmount()) {\n // Approve request.\n $this->authorizationRequest->approve();\n // Earmark the amount in the authorization request on the card.\n $this->card->earmark($this->authorizationRequest);\n } else {\n throw new Exception(\"User does not have enough money available on their card.\");\n }\n }", "public function test_user_can_accept_their_invites()\n {\n $user = factory(User::class, 1)->create()->first();\n factory(Box::class, 3)->create();\n\n $invite = Invite::create([\n 'email' => $user->email,\n 'box_id' => 1, //Box doesn't matter\n 'role' => 'coach',\n 'token' => 'fake_token'\n ]);\n\n Invite::create([\n 'email' => $user->email,\n 'box_id' => 2,\n 'role' => 'owner',\n 'token' => 'fake_token'\n ]);\n\n Invite::create([\n 'email' => $user->email,\n 'box_id' => 3,\n 'role' => 'admin',\n 'token' => 'fake_token'\n ]);\n\n $this->actingAs($user);\n\n $response = $this->post(route('frontend.invites.accept', $invite));\n\n $response->assertStatus(200);\n\n $invites = $user->invites();\n\n $this->assertEquals(2, $invites->count());\n\n }", "function forApprovingSigAction(Request $request) {\n $this->getSecurityService()->checkSecurity('ROLE_SEIP_SIG_ARRANGEMENT_PROGRAM_LIST_FOR');\n\n $method = 'createPaginatorByAssignedForApproving';\n $route = 'pequiven_seip_arrangementprogram_for_approving';\n $template = 'forReviewingApproving.html';\n return $this->getSummaryResponse($request, $method, $route, $template);\n }", "public function accept( Request $request, $id ) {\n\t\treturn ( new TripController() )->accept( $request, $id );\n\t}" ]
[ "0.6427269", "0.63377273", "0.6179217", "0.583394", "0.57907575", "0.57703716", "0.5669693", "0.56302804", "0.5559456", "0.55447423", "0.55291826", "0.52905566", "0.5283288", "0.52785623", "0.52546877", "0.5239182", "0.52171403", "0.5212052", "0.520718", "0.51797134", "0.51626843", "0.514806", "0.51278687", "0.51222426", "0.5107431", "0.5102648", "0.5082505", "0.50758916", "0.5073594", "0.50632566", "0.5042792", "0.503967", "0.5008956", "0.5007896", "0.49728626", "0.4972797", "0.4964674", "0.49612972", "0.49593547", "0.49395195", "0.49361384", "0.4926347", "0.4920329", "0.49147174", "0.49021408", "0.48970068", "0.4893087", "0.48902082", "0.48811677", "0.48735034", "0.48732635", "0.48637933", "0.48561636", "0.48530793", "0.48484614", "0.48481908", "0.48471108", "0.48468408", "0.48454797", "0.48447865", "0.4827004", "0.48237514", "0.4820313", "0.47466153", "0.4727509", "0.4714714", "0.47105455", "0.47037348", "0.4702189", "0.46824253", "0.4674636", "0.46715477", "0.46672663", "0.46656874", "0.4662973", "0.46593344", "0.4658857", "0.4658857", "0.4658857", "0.46578133", "0.46572104", "0.46556216", "0.4655548", "0.46535492", "0.46463954", "0.46460778", "0.4645571", "0.4642664", "0.46358275", "0.46338353", "0.46311927", "0.4622922", "0.4614949", "0.4612821", "0.460761", "0.46045208", "0.45819244", "0.4581858", "0.4579964", "0.4578778" ]
0.5391419
11
actionid: acceptbywr2 actiondesc: Accepting the izin by Vice Rector2
public function actionAcceptByWr2($id){ $model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all(); foreach ($model as $m) { $m->status_by_wr2 = 6; } if($m->save()){ \Yii::$app->messenger->addSuccessFlash("Permohonan Izin telah di-accept oleh WR 2"); return $this->redirect(['index-by-wr2']); } else { return $this->render('viewByWr2', [ 'model'=>$model ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function invi_accept() {\n if(isset($_GET['room_id'], $_GET['user_id'], $_GET['invi_id'])) {\n $data = $this->mod_user->md_acceptInvi($_GET['room_id'], $_GET['user_id'], $_GET['invi_id']);\n } else {\n die();\n }\n }", "public function acceptAction() {\n\n //CHECK AUTH\n if( !$this->_helper->requireUser()->isValid() ) return;\n\n $viewer = Engine_Api::_()->user()->getViewer();\n\n //GET THE SITEPAGE ID FROM THE URL\n $page_id = $this->_getParam('page_id');\n $sitepage = Engine_Api::_()->getItem('sitepage_page', $page_id);\n \n //MAKE FORM\n $this->view->form = $form = new Sitepagemember_Form_Member();\n $form->setTitle('Accept Page Invitation');\n $form->setDescription('Would you like to accept page invitation for this page?');\n $form->submit->setLabel('Accept Page Invitation');\n\n //PROCESS FORM\n if( !$this->getRequest()->isPost() ) {\n $this->view->status = false;\n $this->view->error = true;\n $this->view->message = Zend_Registry::get('Zend_Translate')->_('Invalid Method');\n return;\n }\n\n if( !$form->isValid($this->getRequest()->getPost()) ) {\n $this->view->status = false;\n $this->view->error = true;\n $this->view->message = Zend_Registry::get('Zend_Translate')->_('Invalid Data');\n return;\n }\n\n\t\t//SET THE REQUEST AS HANDLED\n\t\t$notification = Engine_Api::_()->getDbtable('notifications', 'activity')->getNotificationByObjectAndType($viewer, $sitepage, 'sitepagemember_invite');\n\t\tif( $notification ) {\n\t\t\t$notification->mitigated = true;\n\t\t\t$notification->save();\n\t\t}\n\n\t\t//GET VALUE FROM THE FORM.\n\t\t$values = $this->getRequest()->getPost();\n\t\t\n\t\t//ADD ACTIVITY\n\t\t$action = Engine_Api::_()->getDbtable('actions', 'activity')->addActivity($viewer, $sitepage, 'sitepage_join');\n\t\tif ( $action ) {\n Engine_Api::_()->getDbtable('actions', 'activity')->attachActivity( $action , $sitepage ) ;\n }\n\t\tEngine_Api::_()->getApi('subCore', 'sitepage')->deleteFeedStream($action,true);\n\t\tEngine_Api::_()->getDbtable('membership', 'sitepage')->update(array('active'=> '1', 'user_approved' => '1'), array('resource_id =?' => $page_id, 'user_id =?' => $viewer->getIdentity()));\n\t\t\n\t\t//MEMBER COUNT INCREASE WHEN MEMBER JOIN THE PAGE.\n\t\t$sitepage->member_count++;\n\t\t$sitepage->save();\n\t\t\n $this->view->status = true;\n $this->view->error = false;\n\n $message = Zend_Registry::get('Zend_Translate')->_('You have accepted the invite to the page %s');\n $message = sprintf($message, $sitepage->__toString());\n $this->view->message = $message;\n\n if( null === $this->_helper->contextSwitch->getCurrentContext() ) {\n return $this->_forwardCustom('success', 'utility', 'core', array(\n 'messages' => array($message),\n 'layout' => 'default-simple',\n 'parentRefresh' => true,\n ));\n }\n }", "public function actionAccept($id)\n {\n /*get cavity record*/\n $modelFound = $this->findModel($id);\n $userCreatorId = 1;\n if(User::find()->where(['username' => $modelFound->created_by_user])->exists()){\n /* @var $userModel User */\n $userModel = User::find()->where(['username' => $modelFound->created_by_user])->one();\n $userCreatorId = $userModel->id;\n }\n /*create property record*/\n $propertyRecord = new PropertyRecord();\n $propertyRecord->postcode = $modelFound->address_postcode_cavity_installation;\n $propertyRecord->address1 = $modelFound->address1_cavity_installation;\n $propertyRecord->address2 = $modelFound->address2_cavity_installation;\n $propertyRecord->address3 = $modelFound->address3_cavity_installation;\n $propertyRecord->town = $modelFound->address_town_cavity_installation;\n $propertyRecord->country = $modelFound->address_country_cavity_installation;\n $propertyRecord->installer = $modelFound->CWI_installer;\n $propertyRecord->created_by = $userCreatorId ;\n $propertyRecord->status = 'Accepted on System';\n /* CWI information */\n $propertyRecord->date_of_cwi = $modelFound->CWI_installation_date;\n $propertyRecord->installer = $modelFound->CWI_installer;\n $propertyRecord->product_installed = $modelFound->construction_type;\n $propertyRecord->save(false);\n\n /* Property Note*/\n $propertyNote = new PropertyNotes();\n $propertyNote->content = $modelFound->further_notes;\n $propertyNote->created_by = $userCreatorId;\n $propertyNote->note_type = PropertyNotes::NOTE_TYPE_INFO;\n $propertyNote->property_id = $propertyRecord->id;\n $propertyNote->save(false);\n\n /*create owner */\n $owner = new Owner();\n $owner->title = $modelFound->title;\n $owner->firstname = $modelFound->firstname;\n $owner->lastname = $modelFound->lastname;\n $owner->address1 = $modelFound->address1_cavity_installation;\n $owner->address2 = $modelFound->address2_cavity_installation;\n $owner->address3 = $modelFound->address3_cavity_installation;\n $owner->postalcode = $modelFound->address_postcode_cavity_installation;\n $owner->town = $modelFound->address_town_cavity_installation;\n $owner->country = \"United Kingdom\";\n $owner->email_address = $modelFound->email_address;\n if ($modelFound->second_application_telephone) {\n $owner->phone_number = $modelFound->telephone_number.' , '.$modelFound->second_application_mobile_landline;\n } else {\n $owner->phone_number = $modelFound->telephone_number;\n }\n $owner->phone_number = $modelFound->telephone_number;\n $owner->date_of_birth = $modelFound->birthday;\n $owner->save(false);\n\n $owner2 = new Owner();\n $owner2->title = $modelFound->second_application_title;\n $owner2->firstname = $modelFound->second_application_firstname;\n $owner2->lastname = $modelFound->second_application_lastname;\n $owner2->address1 = $modelFound->address1_cavity_installation;\n $owner2->address2 = $modelFound->address2_cavity_installation;\n $owner2->address3 = $modelFound->address3_cavity_installation;\n $owner2->date_of_birth = $modelFound->second_application_birthday;\n if (isset($modelFound->second_application_mobile_landline)) {\n $owner2->phone_number = $modelFound->second_application_telephone.','.$modelFound->second_application_mobile_landline;\n } else {\n $owner2->phone_number = $modelFound->second_application_telephone;\n }\n $owner2->email_address = $modelFound->second_application_email_address;\n $owner2->save(false);\n\n $propertOwner = new PropertyOwner();\n $propertOwner->owner_id = $owner->id;\n $propertOwner->property_id = $propertyRecord->id;\n $propertOwner->save(false);\n\n $propertOwner2 = new PropertyOwner();\n $propertOwner2->owner_id = $owner2->id;\n $propertOwner2->property_id = $propertyRecord->id;\n $propertOwner2->save(false);\n\n\n /*import the images and documents*/\n $supportingDocuments = $modelFound->getSupportingDocuments()->all();\n foreach ($supportingDocuments as $currentSupportingDocuments) {\n /* @var $currentSupportingDocuments CavitySupportingDocument */\n\n /*if current document has type supporting_document_images */\n if ($currentSupportingDocuments->type === 'supporting_document_images') {\n /*save to property document */\n $copyFrom = Yii::getAlias('@supporting_document_path') . DIRECTORY_SEPARATOR.$currentSupportingDocuments->document_name;\n $finalUploadName = Yii::getAlias('@upload_document_path') . DIRECTORY_SEPARATOR.$currentSupportingDocuments->document_name;\n if (isset($currentSupportingDocuments->document_name) && !empty($currentSupportingDocuments->document_name) && file_exists($copyFrom)) {\n copy($copyFrom, $finalUploadName);\n }\n $propertyDocument = new PropertyDocuments();\n $propertyDocument->property_id = $propertyRecord->id;\n $propertyDocument->document_description = $currentSupportingDocuments->document_description;\n $propertyDocument->document_name = $currentSupportingDocuments->document_name;\n $propertyDocument->save(false);\n } else {\n /*save it to pre appraisal images */\n $preAppraisalImage = new PropertyPreAppraisalImages();\n $copyFrom = Yii::getAlias('@supporting_document_path') . DIRECTORY_SEPARATOR.$currentSupportingDocuments->document_name;\n $finalUploadName = Yii::getAlias('@upload_image_path') . DIRECTORY_SEPARATOR.$currentSupportingDocuments->document_name;\n if (isset($currentSupportingDocuments->document_name) && !empty($currentSupportingDocuments->document_name) && file_exists($copyFrom)) {\n copy($copyFrom, $finalUploadName);\n }\n $preAppraisalImage->property_id = $propertyRecord->id;\n $preAppraisalImage->image_name = $currentSupportingDocuments->document_name;\n $preAppraisalImage->image_description = $currentSupportingDocuments->document_description;\n $preAppraisalImage->save(false);\n }\n $questionairePropertyRecord = new QuestionairePropertyRecord();\n $questionairePropertyRecord->cavity_form_id = $modelFound->id;\n $questionairePropertyRecord->property_record_id = $propertyRecord->id;\n $questionairePropertyRecord->save(false);\n }\n return $this->redirect(Url::to(['/record/update', 'id' => $propertyRecord->id]));\n }", "public function actionAccept()\n {\n if (!$this->isAdmin()) {\n $this->getApp()->action403();\n }\n\n $request = $this->getApp()->getRequest();\n $id = $request->paramsNamed()->get('id');\n $model = $this->findModel($id);\n if (!$model) {\n $this->getApp()->action404();\n }\n\n $status = $request->paramsGet()->get('status', 1);\n $model->status = $status;\n $model->save(false);\n\n return $this->back();\n }", "public function requestAcceptAction() {\r\n $notification = $this->_getParam('notification', 0);\r\n\t\t$is_suggestionExist = Engine_Api::_()->getItem('user', $notification->object_id);\r\n\t\tif( empty($is_suggestionExist) ) {\r\n\t\t\t// If user are not exist then we are deleting the \"User Request\" which loggden user are gettig.\r\n\t\t\tEngine_Api::_()->getDbtable('notifications', 'activity')->delete(array('notification_id = ?' => $notification->notification_id));\r\n\t\t\t$this->_helper->redirector->gotoRoute(array('route' => 'default'));\r\n\t\t}else {\r\n\t\t\t$this->view->notification = $notification;\r\n\t\t}\r\n }", "public function GetAccept ();", "public function accept(){\n \n }", "public function handleAcceptInvite($iid) {\n\t\tCourseListModel::acceptInvite($iid);\n\t\t$this->redirect('this');\n\t}", "public function accept($actor) {\n $arr = [\n \"type\" => \"Accept\",\n \"object\" => $this->activity_array,\n \"actor\" => $this->obj\n ];\n $accept = new Activity();\n $accept->fill($arr);\n // post new activity to the outbox\n return $accept; \n }", "public function acceptOfferAction()\r\n {\r\n $this->checkSession();\r\n $offerId = $this->Request()->getParam(\"offerId\");\r\n\r\n // updating status of Offer\r\n $offer = Shopware()->Models()->find('Shopware\\CustomModels\\Offer\\Offer',$offerId);\r\n $offer->setStatus(4);\r\n try {\r\n Shopware()->Models()->persist($offer);\r\n Shopware()->Models()->flush();\r\n } catch(Exception $e) {\r\n }\r\n\r\n $this->redirect(array(\r\n 'module' => 'frontend',\r\n 'controller' => 'sKUZOOffer',\r\n 'action' => 'offers'\r\n ));\r\n\r\n }", "public function acceptAction($id)\n\t{\n\t\t$answer = $this->answers->find($id);\n\t\t$answer->save([\n\t\t\t'accepted' => 1,\t\n\t\t]);\n\t\t$this->addUserScore(1, $this->session->get('userId'));\n\t\t$this->addUserScore(10, $answer->idUser);\n\t\t$this->activities->logActivity('accepted' , $answer->id, $answer->idUser, $answer->idQuestion);\n\t\t$this->response->redirect($this->request->getLastUrl() . '#answerreply' . $answer->id);\n\t}", "public function acceptInvitation($id){\n\n $invite = Invitation::find($id);\n $invite->is_accepted = true;\n $invite->save();\n return redirect()->back();\n }", "public function accept();", "public function acceptInvitation()\n\t{\n\t\t$id = $this->request->data['id'];\n\t\t$room_name = $this->request->data['roomName'];\n\t\t$invite['MeetingUser']['id'] = $id;\n\t\t//set status 1 as accepted\n\t\t$invite['MeetingUser']['is_accept'] = 1;\n\t\t$invite['MeetingUser']['is_read'] = 1;\n\t\t$invite['MeetingUser']['is_attend'] = 0;\n\t\t//set notification\n\t\t$oldCount1 = $this->Session->read('oldMeetingCount');\n\t\tif ($oldCount1>0) {\n\t\t\t$newCount1 = $oldCount1-1;\n\t\t\t$this->Session->write('oldMeetingCount',$newCount1);\n\t\t}\n\t\tif($this->MeetingUser->save($invite))\n\t\t\techo \"1\";\n\t\telse\n\t\t\techo \"0\";\n\t\texit;\n\t}", "public function accept_friend_request()\n {\n //update status to 1;\n $this->Friend_model->accept_friend_request_model();\n //two (perhaps more in the future) data rows are inserted into checked_on table where each one corresponds to the time the user has seen the other user's messages\n $this->Friend_model->insert_notifications_model();\n }", "public function accept_opportunity(){\n \ttry {\n\t \t$userid= $this->session->userdata('uid');\n $json = file_get_contents(\"php://input\");\n $data = json_decode($json);\n $given_data = array();\n $given_data['userid'] = $userid;\n $given_data['opp_owner']= $data->opportuniy;\n $given_data['opp_id'] = $data->opportuniy_id;\n $given_data['lead_cust_id'] = $data->lead_cust_id;\n $given_data['sell_type'] = $data->sell_type;\n $given_data['opportunity_stage'] = $data->opportunity_stage;\n $given_data['cycle_id']= $data->cycle_id;\n $given_data['mapping_id'] = uniqid(rand());\n // get if its the first stage\n // if yes, accept both stage and ownership\n // if no, accept any of two\n\n //$is_first_stage = $this->opp_sales->is_first_stage($given_data['opportunity_stage']);\n\n if($given_data['opp_owner']=='ownership'){\n \t echo $this->accept_opp_ownership($given_data);\n } else if($given_data['opp_owner']=='stage') {\n \t echo $this->accept_opp_stage($given_data);\n }\n /*if ($is_first_stage == true) {\n \t$own_accept = $this->accept_opp_ownership($given_data);\n \t$stg_accept = $this->accept_opp_stage($given_data);\n \tif ($own_accept == 1 && $stg_accept == 1) {\n \t\techo 1;\n \t}\n } else {\n\t if($given_data['opp_owner']=='ownership'){\n\t \techo $this->accept_opp_ownership($given_data);\n\t } else if($given_data['opp_owner']=='stage') {\n\t \techo $this->accept_opp_stage($given_data);\n\t }\n }*/\n } catch (LConnectApplicationException $e) {\n \t\techo $this->exceptionThrower($e);\n \t}\n }", "public function accept_invoice()\n\t{\n\t\tif ($_SERVER['REQUEST_METHOD'] === 'POST') {\n\t\t\tif (isset($_POST)) {\n\t\t\t\t$id = base64_decode($_POST['id']);\n\t\t\t\t// print_r($id);\n\t\t\t\t$tableName = 'master_invoice';\n\t\t\t\t$timestamp = date(\"Y-m-d H:i:s\");\n\t\t\t\tif (isset($id)) {\n\t\t\t\t\t$status = array('send_status' => ACCEPT);\n\t\t\t\t\t$condition = array('id' => $id);\n\t\t\t\t\t$result = $this->CustomModel->selectAllFromWhere($tableName, $condition); // Checking row into the data base\n\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t'invoice_number' => $result[0]['invoice_number'],\n\t\t\t\t\t\t'item_code' => $result[0]['product_code'],\n\t\t\t\t\t\t'invoice_date' => $result[0]['doi'],\n\t\t\t\t\t\t'item_description' => $result[0]['product_description'],\n\t\t\t\t\t\t'qty' => $result[0]['product_qty'],\n\t\t\t\t\t\t'closing_stock' => $result[0]['product_qty'],\n\t\t\t\t\t\t'amount' => $result[0]['product_amount'],\n\t\t\t\t\t\t'rate' => $result[0]['product_rate'],\n\t\t\t\t\t\t'update_by' => $_SESSION['userInfo']['username'],\n\t\t\t\t\t\t'last_updated' => $timestamp\n\t\t\t\t\t);\n\n\t\t\t\t\t$tablename = 'london_stock';\n\t\t\t\t\t$inr_data = $this->CustomModel->insertInto($tablename, $data);\n\n\t\t\t\t\tif ($inr_data > 0) {\n\t\t\t\t\t\t$res = $this->CustomModel->update_table($tableName, $condition, $status); //Updating the accept status \n\t\t\t\t\t\techo json_encode(array('message' => 'Invoice accepted and stock updated successfuly', 'type' => 'success'));\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo json_encode(array('message' => 'Something went worng please contact IT', 'type' => 'danger'));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function accept($reward_id) {\n\n $user_id = $this->Auth->user('user_id');\n $reward = $this->Reward->acceptPendingReward($reward_id, $user_id);\n\n if (!empty($reward)) {\n\n // broadcast & refresh user's inventory\n $this->loadModel('User');\n $server = $this->User->getCurrentServer($user_id);\n\n if ($server) {\n $this->ServerUtility->broadcastRewardReceive($server, $user_id, $reward['Reward']);\n }\n }\n\n $this->loadItems();\n $this->loadModel('User');\n\n $this->User->id = $user_id;\n $credit = $this->User->field('credit');\n\n $this->set(array(\n 'credit' => $credit,\n 'userItems' => $this->User->getItems($user_id)\n ));\n\n $this->render('/Items/browse_inventory.inc');\n }", "public function accept()\n {\n\n $update['id'] = $this->session->userdata('user_id');\n $update['data']['agree'] = '1';\n $update['table'] = 'users';\n $this->Application_model->update($update);\n\n redirect('/dashboard','refresh');\n\n }", "function acceptInvite($invite_id,$user_id,$status)\n\t\t{\t\n\t\t\t$where_cond = array(\"status\"=>$status);\n\t\t\t$this->db->where('id',$invite_id);\n\t\t\tif($this->db->update('da_invite_hygiene_investigation',$where_cond))\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\t\n\t\t}", "public static function acceptRequest($userId1, $userId2 = null)\n {\n\n /*if($userID2 == null)\n $userID2 = self::getLoggedInUser()->id;\n\n $friends = Friends::where('user_that_sent_request', $userID1)->where('user_that_accepted_request', $userID2)->where('accepted', '0')->count();\n\n if($friends == 1)\n {\n\n $request = Friends::where('user_that_sent_request', $userID1)->where('user_that_accepted_request', $userID2)->where('accepted', '0')->get();\n $request = $request[0];\n $request->accepted = 1;\n $request->save();\n\n }*/\n\n if(!Friends::isRequested($userId1, $userId2))\n return;\n\n $request = Friends::request($userId1, $userId2)->first();\n\n $request->setStatus(1);\n\n $request->save();\n\n }", "public function accept()\n {\n\n if($this->user['menteer_type']==37 && $this->user['is_matched'] > 0 && $this->user['match_status']=='pending') {\n\n // mentor update\n $update_user = array(\n 'id' => $this->session->userdata('user_id'),\n 'data' => array('match_status' => 'active','match_status_stamp' => date('y-m-d H:i:s')),\n 'table' => 'users'\n );\n $this->Application_model->update($update_user);\n\n // mentee update\n $update_user = array(\n 'id' => $this->user['is_matched'],\n 'data' => array('match_status' => 'active','match_status_stamp' => date('y-m-d H:i:s')),\n 'table' => 'users'\n );\n $this->Application_model->update($update_user);\n\n $mentee = $this->Application_model->get(array('table'=>'users','id'=>$this->user['is_matched']));\n\n // notify mentee about the accept\n\n $data = array();\n $data['first_name'] = $this->user['first_name'];\n $data['last_name'] = $this->user['last_name'];\n\n $message = $this->load->view('/chooser/email/accept', $data, true);\n $this->email->clear();\n $this->email->from($this->config->item('admin_email', 'ion_auth'), $this->config->item('site_title', 'ion_auth'));\n $this->email->to($mentee['email']);\n $this->email->subject('Mentor has accepted');\n $this->email->message($message);\n\n $result = $this->email->send(); // @todo handle false send result\n\n $this->session->set_flashdata('message', '<div class=\"alert alert-success\">The Mentee has been notified about the acceptance.</div>');\n redirect('/dashboard');\n\n }else{\n\n redirect('/dashboard');\n\n }\n\n }", "public function accept_action($user_id)\n {\n if (!OrganizerSettings::get()->locked && !OrganizerGroup::findGroup($user_id)->hasMaxTeamSize()) {\n OrganizerInvite::accept($user_id);\n }\n\n // Remove existing invites\n OrganizerInvite::cancel($user_id, User::findCurrent()->id);\n $this->redirect('show/index');\n }", "public function actionAcceptByHrd($id){\n $model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all();\n\n foreach ($model as $m) {\n $m->status_by_hrd = 6;\n }\n\n if($m->save()){\n \\Yii::$app->messenger->addSuccessFlash(\"Permohonan Izin telah di-accept oleh HRD\");\n return $this->redirect(['index-by-hrd']);\n } else {\n return $this->render('viewByHrd', [\n 'model'=>$model\n ]);\n }\n }", "public function acceptInviteRequest()\n {\n $validations = ['isRoleUser', 'issetInvitation'];\n $request = Validations::manageValidations($validations);\n if ($request != false) {\n if ($request->accept == 1) {\n $query = \"UPDATE activities_users SET invite = 0 WHERE user_id = $request->authUserId and activity_id = $request->activity_id\";\n } else {\n $query = \"DELETE FROM activities_users WHERE user_id = $request->authUserId and activity_id = $request->activity_id\";\n }\n return $this->connection->nonQueryId($query);\n }\n return 'invalid data';\n }", "public function acceptOrDenyAction(Request $request)\n {\n $ad = (int)$request->attributes->get('ad');\n $offer = (int)$request->attributes->get('offer');\n $type = $request->attributes->get('action');\n $userAttr = $this->user->getAttributes();\n $isTest = (int)$request->attributes->get('test');\n $testResult = (int)$request->attributes->get('result');\n $validCSRF = $this->validateCSRF();\n if($isTest == 1 && $testResult == 0)\n {\n $userAttr = array('id' => (int)$request->attributes->get('user'));\n $ad = (int)$request->attributes->get('id');\n $offer = (int)$request->attributes->get('id2');\n $type = 'accepter';\n $validCSRF = true;\n }\n elseif($isTest == 1 && $testResult == 1)\n {\n $userAttr = array('id' => (int)$request->attributes->get('elUser1'));\n $ad = (int)$request->attributes->get('id');\n $offer = (int)$request->attributes->get('id2');\n $type = 'accepter';\n $validCSRF = true;\n }\n elseif($this->isTest)\n {\n $userAttr = array('id' => 2);\n $validCSRF = true;\n }\n $data = $this->enMan->getRepository('AdItemsBundle:AdsOffersPropositions')->propositonExists($ad, $offer, (int)$userAttr['id']);\n if($validCSRF === true && ($type == 'accepter' || $type == 'refuser') && isset($data['id_ad']) && $data['id_ad'] == $ad && isset($data['id_of']) && $offer == $data['id_of'])\n {\n // access tests case\n if($isTest == 1)\n {\n return new Response(parent::testAccess($testResult, 1), 200);\n }\n $this->enMan->getConnection()->beginTransaction();\n try\n {\n $tplVals = array('{AD_TITLE}', '{OFFER_NAME}', '{LOGIN}');\n $realVals = array($data['adName'], $data['offerName'], $this->user->getUser());\n switch($type)\n {\n case 'accepter':\n // add offer to ads_offers table\n $aofEnt = new AdsOffers;\n $aofEnt->setAdsIdAd($this->enMan->getReference('Ad\\ItemsBundle\\Entity\\Ads', $ad));\n $aofEnt->setOffersIdOf($this->enMan->getReference('Catalogue\\OffersBundle\\Entity\\Offers', $offer));\n $aofEnt->setAddedDate('');\n $this->enMan->persist($aofEnt);\n $this->enMan->flush();\n\n $i = 1;\n\n // notify ad's author about the new offer\n $template = str_replace($tplVals, $realVals, file_get_contents(rootDir.'messages/offer_accepted.message'));\n // $templateMail = str_replace($tplVals, $realVals, file_get_contents(rootDir.'mails/offer_accepted.maildoc'));\n $title = \"Proposition a été acceptée\";\n $message = \"Proposition a été correctement acceptée\";\n\n // update ads_modified table with the last modification\n $this->enMan->getRepository('AdItemsBundle:AdsModified')->adModified($ad, 'offer_accepted');\n break;\n case 'refuser':\n $i = -1;\n $template = str_replace($tplVals, $realVals, file_get_contents(rootDir.'messages/offer_denied.message'));\n // $templateMail = str_replace($tplVals, $realVals, file_get_contents(rootDir.'mails/offer_denied.maildoc'));\n $title = \"Proposition a été réfusée\";\n $message = \"Proposition a été correctement supprimée\";\n break;\n }\n $q = $this->enMan->createQueryBuilder()->delete('Ad\\ItemsBundle\\Entity\\AdsOffersPropositions', 'aop')\n ->where('aop.ads_id_ad = ?1 AND aop.offers_id_of = ?2 AND aop.users_id_us = ?3')\n ->setParameter(1, $ad)\n ->setParameter(2, $offer)\n ->setParameter(3, $userAttr['id'])\n ->getQuery();\n $p = $q->execute();\n\n // update offers quantity for this ad\n $this->enMan->getRepository('AdItemsBundle:Ads')->updateOffersQuantity($i, $ad);\t\t\n\n // Send private message\n $author = $this->enMan->getReference('User\\ProfilesBundle\\Entity\\Users', (int)$userAttr['id']);\n $messageVals = array(\n 'title' => $title,\n 'content' => $template,\n 'type' => 2,\n 'state' => 1\n );\n $this->enMan->getRepository('MessageMessagesBundle:Messages')->sendPm($author, $this->enMan->getReference('User\\ProfilesBundle\\Entity\\Users', $data['id_us']), $messageVals);\n\n $emtEnt = new EmailsTemplates;\n $mail = \\Swift_Message::newInstance()\n ->setSubject($title)\n ->setFrom($this->from['mail'])\n ->setTo($data['email'])\n ->setContentType(\"text/html\")\n ->setBody($emtEnt->getHeaderTemplate().$template.$emtEnt->getFooterTemplate());\n $this->get('mailer')->send($mail);\n\n // commit SQL transaction\n $this->enMan->getConnection()->commit();\n if($this->isTest)\n {\n return new Response('accepted_successfully');\n }\n $ret['isError'] = 0;\n $ret['message'] = $message;\n }\n catch(Exception $e)\n {\n $this->enMan->getConnection()->rollback();\n $this->enMan->close();\n throw $e;\n }\n }\n elseif($validCSRF === false)\n {\n $ret['isError'] = 1;\n $ret['message'] = \"Votre session a expiré. Veuillez réessayer\";\n }\n else\n {\n // access tests case\n if($isTest == 1)\n {\n return new Response(parent::testAccess($testResult, 0), 200);\n }\n $ret['isError'] = 1;\n $ret['message'] = \"Une erreur s'est produite\";\n }\n echo json_encode($ret);\n\tdie();\n }", "public function accept_frnd_req($frnd_id) {\n $userid = $this->session->userdata('logged_in')['id'];\n $data = array(\n 'user_approved' => 1,\n 'active' => 1,\n 'req_accepted' => date('Y-m-d H:i:s')\n );\n $this->Friendsmodel->accept_frnd_req($frnd_id, $userid, $data);\n $data1 = array(\n 'resourse_approved' => 1,\n 'active' => 1,\n 'req_accepted' => date('Y-m-d H:i:s')\n );\n $this->Friendsmodel->accept_frnd_req($userid, $frnd_id, $data1);\n add_notification($frnd_id, $userid,'has accepted your friend request');\n }", "public function doRedirectAccept() {\n\t\t\theader(\"Location: ../../accept.php?\".http_build_query($_REQUEST));\n\t\t\texit;\n\t\t}", "public function accept($token)\n { \n $invitation = Invite::where('token', '=', $token)->first();\n\n $now = Carbon::now();\n\n $dateInvite = new Carbon($invitation->valid_until);\n \n if($now->lte($dateInvite) && $invitation->email == Auth::user()->email){\n\n $invitation->presence = true;\n \n $invitation->save();\n\n return redirect('/admin/dashboard/')->with(['success' => 'Invitation successfully accepted']);\n\n }else{\n return redirect('/admin/dashboard/')->withErrors(['Inconsistent data']);\n }\n\n }", "public function authorizeAction();", "function acceptServRequest(){\n $serv_ID=$this->uri->segment(3);\n $data['result']=$this->deliveryAndPickupModel->acceptRequest($serv_ID);\n $this->load->view('deliveryAndPickupView/customerInfo', $data);\n }", "public function acceptUserConfirmRequest() {\n extract($_GET);\n $gender = $this->session->userdata('key_gender');\n $encodedkey = $this->session->userdata('PariKey_session');\n $key = base64_decode($encodedkey);\n $keyarr = explode('|', $key);\n $sessionUser_id = $keyarr[2];\n $result = $this->Searchbyprofileid_model->acceptUserConfirmRequest($profile_user_id, $sessionUser_id, $gender);\n// print_r($result);\n// die();\n if ($result == 200) {\n echo 200;\n } else {\n echo 500;\n }\n }", "function acceptChallenge($data) {\n $ChallengeData = createChallengeDataObj();\n $acceptStatus = $ChallengeData->acceptChallenge($data);\n if($acceptStatus) {\n return array(\"acceptStatus\" => true);\n }else {\n return array(\"acceptStatus\" => false);\n }\n }", "public function editAction() {\n\n //ONLY LOGGED IN USER CAN CREATE\n if (!$this->_helper->requireUser()->isValid())\n $this->respondWithError('unauthorized');\n\n\n $wishlist_id = $this->_getParam('wishlist_id');\n if (isset($wishlist_id) && !empty($wishlist_id)) {\n $subject = $wishlist = Engine_Api::_()->getItem('sitereview_wishlist', $wishlist_id);\n Engine_Api::_()->core()->setSubject($wishlist);\n } else {\n $this->respondWithError('no_record');\n }\n\n //GET VIEWER INFORMATION\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n $level_id = $viewer->level_id;\n\n\n if ($level_id != 1 && $wishlist->owner_id != $viewer_id) {\n $this->respondWithError('unauthorized');\n }\n //GET USER DIARIES\n $wishlistTable = Engine_Api::_()->getDbtable('wishlists', 'sitereview');\n $wishlistDatas = $wishlistTable->userWishlists($viewer);\n //PRIVACY WORK\n $auth = Engine_Api::_()->authorization()->context;\n $roles = array('owner', 'owner_member', 'owner_member_member', 'owner_network', 'registered', 'everyone');\n $perms = array();\n foreach ($roles as $roleString) {\n $role = $roleString;\n if ($auth->isAllowed($wishlist, $role, 'view')) {\n $perms['auth_view'] = $roleString;\n }\n }\n //FORM GENERATION\n if ($this->getRequest()->isGet()) {\n $formValues = $wishlist->toArray();\n $formValues = array_merge($formValues, $perms);\n\n if (isset($formValues['body']) && !empty($formValues['body']))\n $formValues['body'] = strip_tags($formValues['body']);\n\n\n $this->respondWithSuccess(array(\n 'form' => Engine_Api::_()->getApi('Siteapi_Core', 'sitereview')->getCreateWishlistForm(),\n 'formValues' => $formValues\n ));\n }\n\n //FORM VALIDATION\n else if ($this->getRequest()->isPut() || $this->getRequest()->isPost()) {\n\n $db = Engine_Api::_()->getItemTable('sitereview_listing')->getAdapter();\n $db->beginTransaction();\n try {\n $values = array();\n $getForm = Engine_Api::_()->getApi('Siteapi_Core', 'sitereview')->getCreateWishlistForm();\n foreach ($getForm as $element) {\n\n if (isset($_REQUEST[$element['name']]))\n $values[$element['name']] = $_REQUEST[$element['name']];\n }\n if (empty($values['title'])) {\n $validationMessage = \"title is required\";\n $this->respondWithValidationError('validation_fail', $validationMessage);\n }\n\n $wishlist->setFromArray($values)->save();\n $db->commit();\n\n //PRIVACTY WORK\n $auth = Engine_Api::_()->authorization()->context;\n $roles = array('owner', 'owner_member', 'owner_member_member', 'owner_network', 'registered', 'everyone');\n\n if (empty($values['auth_view'])) {\n $values['auth_view'] = 'owner';\n }\n\n $viewMax = array_search($values['auth_view'], $roles);\n foreach ($roles as $i => $role) {\n $auth->setAllowed($wishlist, $role, 'view', ($i <= $viewMax));\n }\n $db->commit();\n // Change request method POST to GET\n $this->successResponseNoContent('no_content', true);\n } catch (Exception $e) {\n $db->rollBack();\n throw $e;\n }\n }\n }", "public function actioncheckPlanMot()\n\t{\n\t $valores=OperaCodep::getEp();\n $codigobarco=$valores['barco'];\n $codofi=$valores['ofic'];\n //var_dump($codigobarco);var_dump($codofi);die();\n if(!is_null($codigobarco)){\n $model=new OperaPlanes('search_por_mot');\n\t\t$model->unsetAttributes(); // clear any default values\n\t\tif(isset($_GET['OperaPlanes']))\n\t\t\t$model->attributes=$_GET['OperaPlanes'];\n\n\t\t$this->render('admin_por_mot',array(\n\t\t\t'model'=>$model,'codep'=>$codigobarco,'codof'=>$codofi\n\t\t));\n }else{\n $this->render('reject',array(\n\t\t\t'model'=>$model,\n\t\t)); \n }\n \n\t}", "public function acceptPayment($receipt)\n\t{\n\t}", "public function actionAcceptByAtasan($id, $redback=null){\n $model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all();\n\n foreach ($model as $m) {\n $m->status_by_atasan = 6;\n $m->status_by_wr2 = 1;\n }\n\n if($m->save()){\n \\Yii::$app->messenger->addSuccessFlash(\"Permohonan Izin telah di-accept oleh Atasan\");\n if(is_null($redback))\n return $this->redirect(['index-by-atasan']);\n else\n return $this->redirect(Yii::$app->request->referrer);\n } else {\n return $this->render('viewByAtasan', [\n 'model'=>$model\n ]);\n }\n }", "public function acceptInvite($inviterID) {\n\t\t$conditions = array();\n\t\t$conditions['user_one_id'] = $inviterID;\n\t\t$conditions['user_two_id'] = $this->id;\n\n\t\t$success = ConnectionFactory::updateTableRowAbsoluteBasic(\"agencies\", array('accepted'=>1), $conditions);\n\n\t\tif ($success) {\n\t\t\treturn ConnectionFactory::updateTableRowsRelativeOnIDs(\"users\", array('agency_size'=>1),\n\t\t\t\tarray($this->id, $inviterID));\n\t\t}\n\t}", "function action_editer_annonce() {\n\n\t$securiser_action = charger_fonction('securiser_action', 'inc');\n\n\t// Teste si autorisation pour les actions d'editions\n\t$arg = $securiser_action();\n/*\n\t// Envoi depuis les boutons \"publier/supprimer cette annonce\"\n\t\tif (preg_match(',^(\\d+)\\Wstatut\\W(\\w+)$,', $arg, $r)) {\n\t\t$id_annonce = $r[1];\n\t\tset_request('statut', $r[2]);\n\t\trevisions_annonces($id_annonce);\n\t} \t\n*/\n\t// Envoi depuis le formulaire d'edition d'une annonce existante \t\n\tif ($id_annonce = intval($arg)) { \t\n\t\t// Si cette annonce possede un 'id', alors elle n'est pas nouvelle\n\t\t// Effectuons donc une revision plutot qu'une edition.\n\t\trevisions_annonces($id_annonce);\n\t}\n\n\t// Envoi depuis le formulaire de creation d'une annonce\t\n\telse if ($arg == 'oui') {\n\t\t$id_annonce = insert_annonce();\n\t\tif ($id_annonce) revisions_annonces($id_annonce);\n\t}\n\t// Erreur\n\telse{\n\t\t// Si nous sommes dans aucun des cas precedent, alors on \n\t\t// a un probleme : renvoyons une erreur.\n\t\tinclude_spip('inc/headers');\n\t\tredirige_url_ecrire();\n\t}\n\n\t// A ce stade, il ne nous reste plus a choisir quelle page s'affiche a l'issue du processus\n\tif (_request('redirect')) {\n\t\t// Si une information de redirection existe on la recupere, et on redirige\n\t\t$redirect = parametre_url(urldecode(_request('redirect')),\n\t\t\t'id_annonce', $id_annonce, '&');\n\t\tinclude_spip('inc/headers');\n\t\tredirige_par_entete($redirect);\n\t}\n\telse \n\t\t// Sinon on se contente de renvoyer l'id de l'objet\n\t\t// (Utile par exemple pour une creation, ou la redirection est geree en amont)\n\t\treturn array($id_annonce,'');\n\n}", "public function actionRejectByWr2($id){\n $model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all();\n\n foreach ($model as $m) {\n $m->status_by_wr2 = 4;\n }\n\n if($m->save()){\n \\Yii::$app->messenger->addErrorFlash(\"Permohonan Izin telah di-reject oleh WR 2\");\n return $this->redirect(['index-by-wr2']);\n } else {\n return $this->render('viewByWr2', [\n 'model'=>$model\n ]);\n }\n }", "public function actionWificonnect()\n { \n \t$mcode = Yii::$app->request->post('mcode');\n \t\n \tif(MyWifi::CrewTypeBool($mcode)) {\n \t\t//船员\n \t\t$type = 2;\n \t\t$sql =' SELECT crew_id as member_id,crew_code as member_code,cn_name,smart_card_number, passport_number, crew_password as member_password ,\n\t\t\t\t\tcrew_email as member_email,mobile_number,money as member_money,crew_credit as member_credit,sign,overdraft_limit,curr_overdraft_amount\n\t\t\t\t\tFROM vcos_wifi_crew WHERE crew_code=\\''.$mcode.'\\' ';\n \t\t$membership = Yii::$app->mdb->createCommand($sql)->queryOne();\n \t}else {\n \t\t//会员\n \t\t$type = 1;\n \t\t$member = Member::find ()->select ( [\n \t\t\t\t'sign',\n \t\t] )->where ( [\n \t\t\t\t'member_code' => $mcode\n \t\t] )->one ();\n \t\t$sign = $member['sign'];\n \t\t$membership = MemberService::getMemberbysign($sign);\n \t}\n \t\n //先查看comst 中有没有这个用户\n $find_res = MyCurl::FindUser($membership['passport_number']);\n $find_res = json_decode($find_res,true);\n if($find_res['success']!==false){\n \t//查流量\n \t$check_out_json = MyCurl::CheckFlow($membership['passport_number']);\n \t$check_out_array = json_decode($check_out_json,true);\n \t$arr = explode(\"<br>\", $check_out_array['data']['feeInfo']);\n \t\n \t//剔除不必要的字符\n \t$wifi_online_in_flow = str_replace('MB','',explode(\": \",$arr[5])[1]);\n \t$wifi_online_out_flow = str_replace('MB','',explode(\": \",$arr[6])[1]);\n \t$wifi_online_total_flow = str_replace('MB','',explode(\": \",$arr[7])[1]);\n \t\n \t//初始化用户流量\n \tCruiseLineService::getRunInitStatus($type, $membership['passport_number']);\n \t\n \t//连接网络\n \t$username = $membership['passport_number'];\n \t$sql = \"SELECT * FROM vcos_comst_wifi WHERE username ='$username'\";\n \t$password = Yii::$app->db->createCommand($sql)->queryOne()['password'];\n \t \n \t$online_json = MyCurl::Connect($membership['passport_number'],$password);\n \t\n \t$online_arr = json_decode($online_json,true);\n \tif($online_arr['success']){\n \t\t//write login log to db\n \t\tMyWifi::WriteWifiLoginLogToDB($membership,$wifi_online_in_flow,$wifi_online_out_flow,$wifi_online_total_flow);\n \t\techo $online_json;\n \t}else{\n \t\techo '{\"success\":false,\"Info\":\"'.$online_json.'\"}';\n \t}\n \t\n }else{\n \techo '{\"success\":false,\"Info\":\"请先购买流量包\"}';\n } \n }", "public function doAcceptTransfer($iClient = 0, $iAccount = 0, $fromDate = null, $toDate = null, $iOperation = 0) {\n if ($iOperation == 0) {\n $this->redirect('ctransaction/showTransferList/', 'Nebyla zvolena operace', 3);\n }\n $oOperation = $this->moperation->getById($iOperation);\n $oOperation->state = 1;\n $oOperation->employee = $_SESSION['user_id'];\n $oOperation->update();\n $this->redirect('ctransaction/showTransferList/'.$iClient.'/'.$iAccount.'/'.$fromDate.'/'.$toDate, 'Převod byl schválen', 1);\n }", "private function btn_approve_reject(){\n\n // Skip the unduly cases\n if ($not_my_case = (VM::outOfScope()\n\t\t\t|| !$this->isWritable() \n\t\t\t|| ($this->rec['v_type'] == VISIT_OUT_OF_SCOPE) \n\t\t\t|| !in_array($this->doing,array('lists','budget',)) \n\t\t\t)){\n $this->dbg('not my case? '.($not_my_case ? 'YES' : 'NO'));\n return array('','');\n }\n\n // The event is endorsed (i.e. changes are locked), show only pending applicants and return\n if(0) if (VM::isEventEndorsed() || ($this->rec['v_end'] < time())){\n\tif (False){ // ? Strange... To be changed?\n\t $reply = array('');\n\t if ($this->fnc_beslut) $reply[] = $this->highlights['fnc'][$this->fnc_beslut]['i'];\n\t else $reply[] = '';\n\t if (stripos(serialize($reply),'send mail') !== False) b_debug::var_dump('fnc_beslut',$this->fnc_beslut,date('Y-m-d',$this->rec['v_end']),$reply);\n\t if (stripos(serialize($reply),'send mail') !== False) b_debug::internalError();\n\t}else{ \n\t $reply = array('','');\n\t}\n\t// $t = $reply; array_unshift($t,2,$this->rec['v_id']); $this->dbg($t,True);\n\treturn $reply;\n }\n\n bTiming()->cpu(__function__);\n\n // \n // See what should we do, depends on the visit status \n //\n $reply = array('','');\n $v_status = bForm_vm_Visit::_getStatus($this->rec,$check_clashes=True);\n switch($v_status){\n \n case STATUS_CLASH:\n break;\n\n case STATUS_NO: \n $this->rec['_a_name'] = $this->rec['_o_name'] = '';\n switch ($this->rec['v_type']){\n case VISIT_TYPE_RENT:\n case VISIT_OUT_OF_SCOPE:\n\tbreak;\n\t\n case VISIT_TYPE_OTHER:\n case VISIT_TYPE_COLLABORATION:\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$reply = (VM::hasRightTo('approve_guest_invitation',$this->v)\n\t\t ? array('','') \n\t\t : array('',$this->say('Ni')));\n\tbreak;\n\t\n case VISIT_TYPE_PROGRAM: \n\t$reply = (VM::hasRightTo('approve_registrant_application')\n\t\t ? array('',$this->say('NY'))\n\t\t : array('',$this->say('Ni')));\n }\n break;\n \n case STATUS_PENDING:\n if (@$this->rec['_a_name'] !== LODGING_OA_TXT) $this->rec['_a_name'] = $this->rec['_o_name'] = '';\n switch ($this->rec['v_type']){\n case VISIT_TYPE_RENT: // auto-accept the rents\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$this->v->setStatus(STATUS_YES);\n\t$this->v->setPolicy(VM_V_welcomeMailSent,True,False,True);\n\t$this->rec['v_status'] = STATUS_YES;\n\tbreak;\n\t\n case VISIT_OUT_OF_SCOPE:\n\tbreak 2;\n\t\n case VISIT_TYPE_OTHER:\n case VISIT_TYPE_COLLABORATION:\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$reply = (VM::hasRightTo('approve_guest_invitation',$this->v)\n\t\t ? array('','') \n\t\t : array('',$this->say('Pi')));\n\tbreak;\n\t\n case VISIT_TYPE_PROGRAM: \n\t$reply = (VM::hasRightTo('approve_registrant_application')\n\t\t ? array($this->say('Y'),\n\t\t\t $this->say('N'))\n\t\t : array('',$this->say('Pi')));\n\tbreak;\n\t\n default:\n\tb_debug::internalError('?? v_type=\"'.$this->rec['v_type'].'\"');\n }\n break;\n \n case STATUS_YES:\n switch ($this->rec['v_type']){\n case VISIT_OUT_OF_SCOPE:\n\tbreak;\n\n case VISIT_TYPE_RENT:\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$this->v->setPolicy(VM_V_welcomeMailSent,True,False,True);\n\t$this->rec['v_policy'] = $this->v->getValue('v_policy',1,1);\n\tbreak;\n\n case VISIT_TYPE_OTHER:\n case VISIT_TYPE_COLLABORATION:\n\tif (!$this->v) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$reply = (VM::hasRightTo('approve_guest_invitation',$this->v)\n\t\t ? array('','') \n\t\t : array('',$this->say('Yi')));\n\tbreak;\n\t\n case VISIT_TYPE_PROGRAM: \n\t$reply = (VM::hasRightTo('approve_registrant_application')\n\t\t ? array('',$this->say('YN'))\n\t\t : array('',$this->say('Yi')));\n\tbreak;\n }\n }\n bTiming()->cpu();\n // $t = $reply; array_unshift($t,3,$this->rec['v_id']); $this->dbg($t,True);\n return $reply;\n }", "abstract public function authorize();", "abstract public function authorize();", "public function createAction() {\n //ONLY LOGGED IN USER CAN CREATE\n if (!$this->_helper->requireUser()->isValid())\n $this->respondWithError('unauthorized');\n\n //GET VIEWER INFORMATION\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n\n //FORM GENERATION\n if ($this->getRequest()->isGet()) {\n $response = Engine_Api::_()->getApi('Siteapi_Core', 'Sitereview')->getCreateWishlistForm();\n $this->respondWithSuccess($response, true);\n } else if ($this->getRequest()->isPost()) {\n\n //GET DIARY TABLE\n $wishlistTable = Engine_Api::_()->getItemTable('sitereview_wishlist');\n $db = $wishlistTable->getAdapter();\n $db->beginTransaction();\n\n try {\n //GET FORM VALUES\n $values = $this->_getAllParams();\n if (empty($values['title'])) {\n $this->respondWithValidationError('validation_fail', 'Please complete this field - it is required.');\n }\n $values['owner_id'] = $viewer->getIdentity();\n\n //CREATE DIARY\n $wishlist = $wishlistTable->createRow();\n $wishlist->setFromArray($values);\n $wishlist->save();\n\n //PRIVACY WORK\n $auth = Engine_Api::_()->authorization()->context;\n $roles = array('owner', 'owner_member', 'owner_member_member', 'owner_network', 'registered', 'everyone');\n\n if (empty($values['auth_view'])) {\n $values['auth_view'] = 'owner';\n }\n $viewMax = array_search($values['auth_view'], $roles);\n\n foreach ($roles as $i => $role) {\n $auth->setAllowed($wishlist, $role, 'view', ($i <= $viewMax));\n }\n $db->commit();\n // Change request method POST to GET\n $this->setRequestMethod();\n $this->_forward('profile', 'wishlist', 'sitereview', array(\n 'wishlist_id' => $wishlist->getIdentity()\n ));\n } catch (Exception $e) {\n $db->rollback();\n throw $e;\n }\n }\n }", "public function inativarregistroAction()\n\t{\n\n\t}", "public function accept($id)\n {\n $interview = Interview::findOrFail($id);\n\n $interview->update([\n 'status' => 'accepted'\n ]);\n }", "function acceptInvite($invite_id,$user_id,$status)\n\t\t{\n\t\t\t\n\t\t\t$where_cond = array(\"status\"=>$status);\n\t\t\t$this->db->where('id',$invite_id);\n\t\t\tif($this->db->update('da_invite_milking_machine_cleaning',$where_cond))\n\t\t\t{\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}", "public function acceptAction()\n {\n $this->view->disable();\n\n $this->setJsonResponse();\n\n if (!$this->request->isPost()) {\n return false;\n }\n\n //Find the post by Id\n $postReply = Comments::findFirstById($this->request->getPost('objectId'));\n if (!$postReply) {\n $this->jsonMessages['messages'][] = [\n 'type' => 'error',\n 'content' => t('Post reply does not exist')\n ];\n return $this->jsonMessages;\n }\n\n if (!$this->auth->isAuthorizedVisitor()) {\n $this->jsonMessages['messages'][] = [\n 'type' => 'error',\n 'content' => t('You must log in first to accepted answer')\n ];\n return $this->jsonMessages;\n }\n\n if ($postReply->getAccepted() == 'Y') {\n $this->jsonMessages['messages'][] = [\n 'type' => 'error',\n 'content' => t('This reply is already accepted as answer')\n ];\n return $this->jsonMessages;\n }\n\n if ($postReply->post->getDeleted()) {\n $this->jsonMessages['messages'][] = [\n 'type' => 'error',\n 'content' => t('Post associated to the reply is deleted')\n ];\n return $this->jsonMessages;\n }\n\n if ($postReply->post->getAcceptedAnswer() == 'Y') {\n $this->jsonMessages['messages'][] = [\n 'type' => 'error',\n 'content' => t('This post already has an accepted answer')\n ];\n return $this->jsonMessages;\n }\n\n $user = Users::findFirstById($this->auth->getUserId());\n\n if ($postReply->post->getUsersId() != $user->getId() && $user->getModerator() != 'Y') {\n $this->jsonMessages['messages'][] = [\n 'type' => 'error',\n 'content' => t('You can\\'t accept this answer as correct')\n ];\n }\n\n /* @todo later */\n $postQuestionByUser = $postReply->post->getUsersId();\n $postReplyByUser = $postReply->getUsersId();\n $kConst = Karma::SOMEONE_ELSE_ACCEPT_YOUR_REPLY;\n if ($postQuestionByUser != $postReplyByUser) {\n $k = $kConst + $postReply->post->user->getKarma();\n $v = $kConst + $postReply->post->user->getVotePoint();\n $points = (50 + intval(abs($user->getKarma() - $postReply->user->getKarma()) / 1000));\n\n $parametersBounty = [\n 'usersId = ?0 AND CommentsId = ?1',\n 'bind' => [$postReply->getUsersId(), $postReply->getId()]\n ];\n $postBounty = PostsBounties::findFirst($parametersBounty);\n if ($postBounty) {\n $points += $postBounty->getPoints();\n }\n //$postReply->post->user->setKarma($k);\n //$postReply->post->user->setVotePoint($v);\n\n /**@ Getting an own reply as 'accepted answer' by someone else */\n $postReply->user->setKarma($points + $postReply->user->getKarma());\n $postReply->user->setVotePoint($points + $postReply->user->getVotePoint());\n\n if ($postReplyByUser != $user->getId() && $postQuestionByUser != $user->getId()) {\n //$user->setKarma($kConst + $user->getKarma());\n // $user->setVotePoint($kConst + $user->getVotePoint());\n }\n //Adding notification @todo\n }\n $postReply->setAccepted('Y');\n $postReply->post->setAcceptedAnswer('Y');\n if ($postReply->save()) {\n if (!$user->save()) {\n foreach ($user->getMessages() as $message) {\n $this->jsonMessages['messages'][] = [\n 'type' => 'error',\n 'content' => $message->getMessage()\n ];\n return $this->jsonMessages;\n }\n }\n }\n //Return data display ajax when every ok\n return (['data' => 1]);\n }", "function authorise() {\n\t\tif ( ! isset($_SESSION['oauth2_params'])) {\n\t\t\tthrow new Exception('Missing auth parameters');\n\t\t}\n\n\t\t$params = unserialize($_SESSION['oauth2_params']);\n\n\t\t// TODO L('ME')\n\t\t// Check the user is signed in\n\t\tif ( ! isset($params['user_id']) ) {\n\t\t\t// $app->redirect('/oauth.php/signin');\n\t\t\tURI::redirect('!oauth/provider2/signin');\n\t\t}\n\n\t\t// 可配置自动授权\n\t\t$client_id = $params['client_id'];\n\t\tforeach (Config::get('oauth.consumers') as $consumer) {\n\t\t\tif ( $consumer['key'] == $client_id && $consumer['auto_authorise'] ) {\n\n\t\t\t\t$authCode = $this->server->newAuthoriseRequest('user', $params['user_id'], $params);\n\n\t\t\t\t$redirect_uri = OAuth2\\Util\\RedirectUri::make($params['redirect_uri'], array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'code' => $authCode,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'state'\t=> $params['state']\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ));\n\t\t\t\tURI::redirect($redirect_uri);\n\t\t\t}\n\t\t}\n\n\t\t// 否则需手动授权\n\t\t// If the user approves the client then generate an authoriztion code\n\t\tif (isset($_POST['approve'])) { // TODO fix this auto authorise\n\n\t\t\t$authCode = $this->server->newAuthoriseRequest('user', $params['user_id'], $params);\n\n\t\t\t// Generate the redirect URI\n\t\t\t$redirect_uri = OAuth2\\Util\\RedirectUri::make($params['redirect_uri'], array(\n\t\t\t\t\t\t\t\t\t\t\t\t 'code' => $authCode,\n\t\t\t\t\t\t\t\t\t\t\t\t 'state'\t=> $params['state']\n\t\t\t\t\t\t\t\t\t\t\t\t ));\n\t\t\tURI::redirect($redirect_uri);\n\t\t}\n\t\t// The user denied the request so send them back to the client with an error\n\t\telseif (isset($_POST['deny']))\n\t\t{\n\t\t\t// echo '<p>The user denied the request and so would be redirected back to the client...</p>';\n\t\t\t$redirect_uri = OAuth2\\Util\\RedirectUri::make($params['redirect_uri'], array(\n\t\t\t\t\t\t\t\t\t\t\t\t 'error' => 'access_denied',\n\t\t\t\t\t\t\t\t\t\t\t\t // 'error_message' => $this->server::getExceptionMessage('access_denied'),\n\t\t\t\t\t\t\t\t\t\t\t\t 'error_message' => \\OAuth2\\AuthServer::getExceptionMessage('access_denied'),\n\t\t\t\t\t\t\t\t\t\t\t\t 'state'\t=> $params['state']\n\t\t\t\t\t\t\t\t\t\t\t\t ));\n\t\t\tURI::redirect($redirect_uri);\n\t\t}\n\t\telse {\n\t// GET\n\t?>\n\n\t<h1>Authorise <?php echo $params['client_details']['name']; ?></h1>\n\n\t<p>\n\t\tThe application <strong><?php echo $params['client_details']['name']; ?></strong> would like permission to access your:\n\t</p>\n\n\t<ul>\n\t\t<?php foreach ($params['scopes'] as $scope): ?>\n\t\t\t<li>\n\t\t\t\t<?php echo $scope['name']; ?>\n\t\t\t</li>\n\t\t<?php endforeach; ?>\n\t</ul>\n\n\t<p>\n\t\t<form method=\"post\" style=\"display:inline\">\n\t\t\t<input type=\"submit\" name=\"approve\" id=\"approve\" value=\"Approve\">\n\t\t</form>\n\n\t\t<form method=\"post\" style=\"display:inline\">\n\t\t\t<input type=\"submit\" name=\"deny\" id=\"deny\" value=\"Deny\">\n\t\t</form>\n\t</p>\n\n\t<?php\n\t\t // TODO 由于此处是自定义 view, 输出完就 die 以防 layout view 污染\n\t\t die;\n\n\t\t }\n\t}", "public function invites();", "public function approveInvitation() {\n $this->autoRender = false;\n $communityId = $this->request->data['communityId'];\n $community = $this->Community->findById($communityId);\n if (!empty($community)) {\n $userId = $this->Auth->user('id');\n $this->CommunityMember->approve($communityId, $userId);\n\t\t\t//Community follow data\n\t\t\t$followCommunityData = array(\n\t\t\t\t'type' => FollowingPage::COMMUNITY_TYPE,\n\t\t\t\t'page_id' => $communityId,\n\t\t\t\t'user_id' => $userId,\n\t\t\t\t'notification' => FollowingPage::NOTIFICATION_ON\n\t\t\t);\n\t\t\t$this->FollowingPage->followPage($followCommunityData);\n\t\t\t\n $this->Session->setFlash(__('You are now a member of this community.'), 'success');\n } else {\n $this->Session->setFlash(__($this->invalidMessage), 'error');\n }\n }", "function rejectServRequest(){\n $serv_ID=$this->uri->segment(3);\n echo $this->router->fetch_method();\n if ($this->deliveryAndPickupModel->rejectRequest($serv_ID)) {\n echo \"<script>alert('Successfully rejected');window.location.href='\".site_url('page/rider').\"';</script>\";\n }\n else\n {\n echo \"<script>alert('Something when wrong');window.location.href='\".site_url('page/rider').\"';</script>\";\n }\n\n\t}", "public function actioninvokingThisEscrow(){\n $model = new Escrow;\n $escrow_id = $_POST['escrow_id'];\n $reason_for_invocation = $_POST['reason_for_invocation'];\n $accepted_escrow_invocation_terms= $_POST['terms_and_conditions'];\n $escrow_number = $_POST['escrow_number'];\n \n if($model->isThisEscrowInvokable($escrow_id )){\n \n if($model->isTheInvocationOfThisEscrowASuccess($escrow_id,$reason_for_invocation,$accepted_escrow_invocation_terms)){\n $msg = \"This is to ackonwledge your invocation of an escrow, number '$escrow_number'. We will be engaging with you subsequently until all disagreements are resolved. Sorry for the inconvenience\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n )\n );\n }else{\n $msg = \"Your attempt to invoke this escrow, number '$escrow_number'was not successful. Its likely it had previously being invoked or the escrow cannot be invoked. Please contact customer care for assistance\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg,\n )\n );\n }\n }else{\n $msg = \"This escrow cannot be invoked as it appears the escrow is yet to be accepted. Please contact customer care for clarification\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg,\n )\n );\n }\n \n \n \n }", "public function videoApprovalAction()\n\t{\n\t\t$userSession\t= new Container('fo_user');\n\t\t$request\t\t= $this->getRequest();\n\t\t\n\t\tif(isset($userSession->userSession['_id']) && trim($userSession->userSession['_id']) != '') {\n\t\t\tif($request->isPost()) {\n\t\t\t\t$formData\t= $request->getPost();\n\t\t\t\tif(isset($formData['option']) && isset($formData['mediaId']) && ($formData['option'] == '1' && $formData['mediaId'] != '')) {\n\t\t\t\t\t$userData\t= $this->getMediaUser($formData['mediaId']);\n\t\t\t\t\t$this->approveVideo((string)$userSession->userSession['_id'], $formData['mediaId'], 1);\n\t\t\t\t\t\n\t\t\t\t\t//\tRegistration Mail has to be sent\n\t\t\t\t\t$emailaddress\t= '[email protected]';\n\t\t\t\t\t$link\t\t= DOMAINPATH.'/video/'.base64_encode($formData['mediaId']);\n\t\t\t\t\t$subject\t= 'Snapstate - Video Approval';\n\t\t\t\t\t$message\t= '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n\t\t\t\t\t\t\t\t\t<html xmlns=\"http://www.w3.org/1999/xhtml\">\n\t\t\t\t\t\t\t\t\t<head>\n\t\t\t\t\t\t\t\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n\t\t\t\t\t\t\t\t\t<title>Congratulations</title>\n\t\t\t\t\t\t\t\t\t</head>\n\t\t\t\t\t\t\t\t\t<body>\n\t\t\t\t\t\t\t\t\t<table width=\"650\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"margin:40px auto; background:#fff;\">\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"border:1px solid #DEDEDE;\">\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td style=\"padding:10px;\"><img src=\"'.DOMAINPATH.'/Front/img/mail/logo.png\" width=\"136\" height=\"36\" /></td>\n\t\t\t\t\t\t\t\t\t <td align=\"right\" style=\"padding-right:10px;\" class=\"txt1\"><a href=\"#\">'.ADMIN_EMAIL.'</a></td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td colspan=\"2\" style=\"background:#DEDEDE;font-size:12px; height:25px;\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td style=\"padding-left:10px; color:#535353\">'.date('F, Y').'</td> \n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t </table></td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td style=\"padding:10px;\"><img src=\"'.DOMAINPATH.'/Front/img/mail/banner.png\" width=\"634\" height=\"215\" /></td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td></td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"padding:0px 20px;\">\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td style=\"text-align: justify; line-height:18px;color:#1868AE;\">Hello '.ucwords($userData['user_firstname']).' '.ucwords($userData['user_lastname']).', </td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td style=\"text-align: center; line-height:28px; padding-bottom:10px; padding-top: 10px; font-size:20px; color:#1868AE\"><span class=\"quotes\">“</span> Congratulations! Your video has been approved. <span class=\"quotes\">”</span></td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td style=\"color: #147EC2;font-size: 14px;font-weight: normal;padding: 10px 0;\">Please click the link below to view your video:</td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td style=\"text-align: justify; line-height:18px; padding-bottom:10px\"><a href=\"'.$link.'\" title=\"Please click the link below to view your video\">'.$link.'</a></td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td style=\"text-align: justify; line-height:18px; padding-bottom:10px;padding-top:10px;\">Thanks,</td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td style=\"text-align: justify; line-height:18px; padding-bottom:10px;\">The Snapstate Team.</td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t </table></td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td class=\"txt2\" style=\"padding:10px 0;border:1px solid #DEDEDE; text-align:center;font-size: 11px; background:url('.DOMAINPATH.'/Front/img/mail/footer-bg.png) no-repeat; color:#fff;\">© Copyright '.date('Y').' SnapState.com. All rights reserved. </td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t</body>\n\t\t\t\t\t\t\t\t\t</html>';\n\t\t\t\t\t$headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n\t\t\t\t\t$headers .= 'Content-type: text/html; charset=utf-8' . \"\\r\\n\";\n\t\t\t\t\t$headers .= 'From: Snapstate.com <[email protected]>' . \"\\r\\n\";\n\t\t\t\t\t$to\t\t= 'To: ' . $userData['user_email'] . \"\\r\\n\";\n\t\t\t\t\t$headersMessage\t= $headers . $to;\n\t\t\t\t\t\n\t\t\t\t\tif(MAILER) {\n\t\t\t\t\t\t//mail('', $subject, $message, $headersMessage);\t\n\t\t\t\t\t\t//\tSMTP Settings\n\t\t\t\t\t\t$mail = new PHPMailer();\n\t\t\t\t\t\t$mail->IsSMTP();\n\t\t\t\t\t\t$mail->SMTPDebug\t= 1;\n\t\t\t\t\t\t$mail->SMTPAuth\t\t= true;\n\t\t\t\t\t\t$mail->SMTPSecure\t= 'ssl';\n\t\t\t\t\t\t$mail->Host\t\t\t= \"smtp.gmail.com\";\n\t\t\t\t\t\t$mail->Port\t\t\t= 465;\n\t\t\t\t\t\t$mail->IsHTML(true);\n\t\t\t\t\t\t$mail->Username\t\t= SMTP_USERNAME_DEMO;\n\t\t\t\t\t\t$mail->Password\t\t= SMTP_PASSWORD_DEMO;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$mail->SetFrom(\"[email protected]\");\n\t\t\t\t\t\t$mail->Subject\t= $subject;\n\t\t\t\t\t\t$mail->Body\t\t= $message;\n\t\t\t\t\t\t$mail->AddAddress($userData['user_email']);\n\t\t\t\t\t\t$mail->Send();\n\t\t\t\t\t}\n\t\t\t\t\techo '1';\n\t\t\t\t} else if(isset($formData['option']) && isset($formData['mediaId']) && ($formData['option'] == '2' && $formData['mediaId'] != '')) {\n\t\t\t\t\t$this->approveVideo((string)$userSession->userSession['_id'], $formData['mediaId'], 3);\n\t\t\t\t\t$userData\t= $this->getMediaUser($formData['mediaId']);\n\t\t\t\t\tif(isset($formData['flag']) && trim($formData['flag']) != '') {\n\t\t\t\t\t\t$this->updateFlag($formData['mediaId'], (string)$userSession->userSession['_id'], $formData['flag']);\n\t\t\t\t\t}\n\t\t\t\t\t//\tRegistration Mail has to be sent\n\t\t\t\t\t$emailaddress\t= '[email protected]';\n\t\t\t\t\t$link\t\t= DOMAINPATH.'/video/'.base64_encode($formData['mediaId']);\n\t\t\t\t\t$subject\t= 'Snapstate - Video Disapproval';\n\t\t\t\t\t$message\t= '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n\t\t\t\t\t\t\t\t\t<html xmlns=\"http://www.w3.org/1999/xhtml\">\n\t\t\t\t\t\t\t\t\t<head>\n\t\t\t\t\t\t\t\t\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n\t\t\t\t\t\t\t\t\t<title>Congratulations</title>\n\t\t\t\t\t\t\t\t\t</head>\n\t\t\t\t\t\t\t\t\t<body>\n\t\t\t\t\t\t\t\t\t<table width=\"650\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"margin:40px auto; background:#fff;\">\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"border:1px solid #DEDEDE;\">\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td style=\"padding:10px;\"><img src=\"'.DOMAINPATH.'/Front/img/mail/logo.png\" width=\"136\" height=\"36\" /></td>\n\t\t\t\t\t\t\t\t\t <td align=\"right\" style=\"padding-right:10px;\" class=\"txt1\"><a href=\"#\">'.ADMIN_EMAIL.'</a></td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td colspan=\"2\" style=\"background:#DEDEDE;font-size:12px; height:25px;\"><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td style=\"padding-left:10px; color:#535353\">'.date('F, Y').'</td> \n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t </table></td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td style=\"padding:10px;\"><img src=\"'.DOMAINPATH.'/Front/img/mail/banner.png\" width=\"634\" height=\"215\" /></td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td></td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td><table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"padding:0px 20px;\">\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td style=\"text-align: justify; line-height:18px;color:#1868AE;\">Hello '.ucwords($userData['user_firstname']).' '.ucwords($userData['user_lastname']).', </td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td style=\"text-align: center; line-height:28px; padding-bottom:10px; padding-top: 10px; font-size:20px; color:#1868AE\"><span class=\"quotes\">“</span> Congratulations! Your video has been disapproved. <span class=\"quotes\">”</span></td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td style=\"text-align: justify; line-height:18px; padding-bottom:10px;padding-top:10px;\">Thanks,</td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td style=\"text-align: justify; line-height:18px; padding-bottom:10px;\">The Snapstate Team.</td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t </table></td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t\t\t <td class=\"txt2\" style=\"padding:10px 0;border:1px solid #DEDEDE; text-align:center;font-size: 11px; background:url('.DOMAINPATH.'/Front/img/mail/footer-bg.png) no-repeat; color:#fff;\">© Copyright '.date('Y').' SnapState.com. All rights reserved. </td>\n\t\t\t\t\t\t\t\t\t </tr>\n\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t</body>\n\t\t\t\t\t\t\t\t\t</html>';\n\t\t\t\t\t$headers = 'MIME-Version: 1.0' . \"\\r\\n\";\n\t\t\t\t\t$headers .= 'Content-type: text/html; charset=utf-8' . \"\\r\\n\";\n\t\t\t\t\t$headers .= 'From: Snapstate.com <[email protected]>' . \"\\r\\n\";\n\t\t\t\t\t$to\t\t= 'To: ' . $userData['user_email'] . \"\\r\\n\";\n\t\t\t\t\t$headersMessage\t= $headers . $to;\n\t\t\t\t\t\n\t\t\t\t\tif(MAILER) {\n\t\t\t\t\t\t//mail('', $subject, $message, $headersMessage);\t\n\t\t\t\t\t\t//\tSMTP Settings\n\t\t\t\t\t\t$mail = new PHPMailer();\n\t\t\t\t\t\t$mail->IsSMTP();\n\t\t\t\t\t\t$mail->SMTPDebug\t= 1;\n\t\t\t\t\t\t$mail->SMTPAuth\t\t= true;\n\t\t\t\t\t\t$mail->SMTPSecure\t= 'ssl';\n\t\t\t\t\t\t$mail->Host\t\t\t= \"smtp.gmail.com\";\n\t\t\t\t\t\t$mail->Port\t\t\t= 465;\n\t\t\t\t\t\t$mail->IsHTML(true);\n\t\t\t\t\t\t$mail->Username\t\t= SMTP_USERNAME_DEMO;\n\t\t\t\t\t\t$mail->Password\t\t= SMTP_PASSWORD_DEMO;\n\t\t\t\t\t\t\n\t\t\t\t\t\t$mail->SetFrom(\"[email protected]\");\n\t\t\t\t\t\t$mail->Subject\t= $subject;\n\t\t\t\t\t\t$mail->Body\t\t= $message;\n\t\t\t\t\t\t$mail->AddAddress($userData['user_email']);\n\t\t\t\t\t\t$mail->Send();\n\t\t\t\t\t}\n\t\t\t\t\techo '2';\n\t\t\t\t} else {\n\t\t\t\t\techo \"-1\";\t//\timproper data\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\techo \"-1\";\t//\timproper data\n\t\t\t}\n\t\t} else {\n\t\t\techo \"0\";\t//\tuser session is in-active\n\t\t}\n\t\treturn $this->getResponse();\n\t}", "public function ajaxAcceptRequest()\n\t{\n\t\t$request = FriendshipRequest::acceptRequest(Input::get('id'));\n\t\t\n\t\tif ($request)\n\t\t{\n\t\t\treturn array('error' => 0);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn array('error' => 1);\n\t\t}\n\t}", "public function handleInvites($gid = null){\n //Recupera o tipo de ação e o id do grupo\n $type = $this->request->getParam('?')['type'];\n $gid = $this->request->getParam('gid');\n\n //recupera os usuarios do grupo\n $userGroupsTable = TableRegistry::get('UsersGroup');\n $userGroups = $this->Groups->UsersGroup->find()->where(['group_id'=>$gid,'user_id'=>$this->user['id']])->first();\n switch($type){\n //Se ação for aceitar, salvar com status 1\n case 'accept':\n $userGroups->invite_status = 1;\n $userGroupsTable->save($userGroups);\n $this->Flash->success(__('Convite aceito! Agora você já pode participar do grupo'));\n return $this->redirect('/dashboard/invites');\n break;\n //Se ação for rejeitar salvar com status 2\n case 'reject':\n $userGroups->invite_status = 2;\n $userGroupsTable->save($userGroups);\n $this->Flash->success(__('Convite rejeitado'));\n return $this->redirect('/dashboard/invites');\n break;\n\n default:\n return $this->redirect('/dashboard/invites');\n }\n }", "public function acceptPayment($invoice)\n {\n $order = Order::with(['payment'])->where('invoice', $invoice)->first();\n //UBAH STATUS DI TABLE PAYMENTS MELALUI ORDER YANG TERKAIT\n $order->payment()->update(['status' => 1]);\n //UBAH STATUS ORDER MENJADI PROSES\n $order->update(['status' => 2]);\n //REDIRECT KE HALAMAN YANG SAMA.\n return redirect(route('orders.view', $order->invoice));\n }", "public function optInAction()\n {\n\n $tokenYes = preg_replace('/[^a-zA-Z0-9]/', '', ($this->request->hasArgument('token_yes') ? $this->request->getArgument('token_yes') : ''));\n $tokenNo = preg_replace('/[^a-zA-Z0-9]/', '', ($this->request->hasArgument('token_no') ? $this->request->getArgument('token_no') : ''));\n $userSha1 = preg_replace('/[^a-zA-Z0-9]/', '', $this->request->getArgument('user'));\n\n /** @var \\RKW\\RkwRegistration\\Tools\\Registration $register */\n $register = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('RKW\\\\RkwRegistration\\\\Tools\\\\Registration');\n $check = $register->checkTokens($tokenYes, $tokenNo, $userSha1, $this->request, $data);\n\n // set hash value for changing subscriptions without login\n $hash = '';\n if ($check == 1) {\n\n $this->addFlashMessage(\n \\TYPO3\\CMS\\Extbase\\Utility\\LocalizationUtility::translate(\n 'subscriptionController.message.subscriptionSaved',\n 'rkw_newsletter'\n )\n );\n\n if (\n ($data['frontendUser'])\n && ($frontendUser = $data['frontendUser'])\n && ($frontendUser instanceof \\RKW\\RkwRegistration\\Domain\\Model\\FrontendUser)\n && ($frontendUser = $this->frontendUserRepository->findByIdentifier($frontendUser->getUid()))\n ) {\n /** @var \\RKW\\RkwNewsletter\\Domain\\Model\\FrontendUser $frontendUser */\n if (!$frontendUser->getTxRkwnewsletterHash()) {\n $hash = sha1($frontendUser->getUid() . $frontendUser->getEmail() . rand());\n $frontendUser->setTxRkwnewsletterHash($hash);\n $this->frontendUserRepository->update($frontendUser);\n\n } else {\n $hash = $frontendUser->getTxRkwnewsletterHash();\n }\n }\n\n\n } elseif ($check == 2) {\n\n $this->addFlashMessage(\n \\TYPO3\\CMS\\Extbase\\Utility\\LocalizationUtility::translate(\n 'subscriptionController.message.subscriptionCanceled',\n 'rkw_newsletter'\n )\n );\n\n if (\n ($data['frontendUser'])\n && ($frontendUser = $data['frontendUser'])\n && ($frontendUser instanceof \\RKW\\RkwRegistration\\Domain\\Model\\FrontendUser)\n && ($frontendUser = $this->frontendUserRepository->findByIdentifier($frontendUser->getUid()))\n ) {\n /** @var \\RKW\\RkwNewsletter\\Domain\\Model\\FrontendUser $frontendUser */\n $hash = $frontendUser->getTxRkwnewsletterHash();\n }\n\n } else {\n\n $this->addFlashMessage(\n \\TYPO3\\CMS\\Extbase\\Utility\\LocalizationUtility::translate(\n 'subscriptionController.error.subscriptionError',\n 'rkw_newsletter'\n ),\n '',\n \\TYPO3\\CMS\\Core\\Messaging\\AbstractMessage::ERROR\n );\n }\n\n $this->redirect('message', null, null, array('hash' => $hash));\n //===\n }", "public function acceptLoginAction() {\n\t\treturn FALSE;\n\t}", "function action()\n\t{\n\n switch($_REQUEST['opcion'])\n\t\t{\n\n case \"consultar\":\n //unset ($_REQUEST['action']);\n \n $pagina= $this->configuracion[\"host\"]. $this->configuracion[\"site\"].\"/index.php?\";\n\t\t\t\t$variable=\"pagina=admin_consultarHistoricoRecibos\";\n\t\t\t\t$variable.=\"&opcion=consultarEstudiante\";\n $variable.=\"&codEstudiante=\".$_REQUEST['codEstudiante'];\n \n\t\t\t\tinclude_once($this->configuracion[\"raiz_documento\"]. $this->configuracion[\"clases\"].\"/encriptar.class.php\");\n $this->cripto=new encriptar();\n\t\t\t\t$variable=$this->cripto->codificar_url($variable, $this->configuracion);\n\n echo \"<script>location.replace('\".$pagina.$variable.\"')</script>\";\n break;\n\t\t}\n\t}", "public function acceptFR($id)\n {\n $data = array(\n 'status' => 'friend',\n 'modified' => $this->today,\n );\n $this->db->where(\"(`user_id` =\". $id.\" AND `friend_id` =\".$this->session->Auth['id'].\")\");\n $this->db->or_where(\"(`user_id` =\".$this->session->Auth['id'].\" AND `friend_id` = \".$id.\")\");\n if($this->db->update('relationship',$data)){\n return true;\n } else{\n return false;\n }\n }", "private function insert2Action(){\n\t\t$p = $this -> filterRecvParam($this -> getRequest() -> getParams());\n\t\t$this -> actParam = $p;\n\t\t//Forward only if an error occurs\n\t\tif(isset($p['error'])){\t\t\n\t\t\t//$this -> loadBikeModelsBrands();\n\t\t\t$this -> view -> error = $p['error'];\n\t\t\t//$this -> render('insert1');\n\t\t\t//$this -> _forward('insert', null, null, array('error' => $error));\n\t\t\t$this -> insert1Action();\n\t\t}\t\t\n\t\telse{\t\t\t\n\t\t\t//Set session namespace\n\t\t\t$this -> loadBikeCat();\n\t\t\t$this -> adminNS -> bikeAds = $p;\t\t\t\n\t\t\t$this -> view -> bike = $p;\n\t\t\t//$this -> view -> bikePhoto = $this -> bikeNS -> bikePhoto;\n\t\t\t\n\t\t\t$this -> render('insert2');\t\n\t\t}\t\n\t}", "public function process_interac_response()\n\t{\n\t\t$idebit_merchantdata = strtolower(ee()->input->get_post('IDEBIT_MERCHDATA'));\n\t\tif($idebit_merchantdata)\n\t\t{\n\t\t\t$transaction = ee()->db->select('store_notify_url')->from('store_beanstream_interac')->where('interac_merchant_data', $idebit_merchantdata)->get();\n\t\t\tif($transaction->num_rows() == 1)\n\t\t\t{\n\t\t\t\t$_POST['funded'] = $_GET['funded'];\n\t\t\t\t$url = $transaction->row('store_notify_url').'&'.http_build_query($_POST);\n\t\t\t\tee()->functions->redirect($url);\n\t\t\t}\n\t\t}\n\t}", "public function inviteAction()\n\t{\n\t\t$user = new Default_Model_User();\n\t\t$resultRow = $user->getUserByEmail($this->loggedEmail);\n\t\t\n\t\t$loggedHandle = $resultRow->handle;\n\t\t$loggedId = $resultRow->id;\n\t\t\n\t\t$handle = $this->_request->getParam('handle');\n\t\t$resultRow = $user->getUserByHandle($handle);\n\t\t$handleId = $resultRow->id;\n\n\t\t$invite = new Default_Model_Invitation();\n\t\tif($invite->createInvitation($loggedId, $handleId)){\n\t\t\t$this->view->success = 1;\n\t\t} else{\n\t\t\t$this->view->success = 0;\n\t\t}\n\t}", "private function approve() {\n\n }", "public function indexAction2() {\n\t $method = \"w92UxLIRNTl','H8A8xQ9gJ5b','ibHR9NQ0bKL','DiXDJRmPwfh','yJSLjbC9Gnr','vDnxlrIQWUo','krVqq8Vk5Kw\";\n\t $request = $this->getRequest();\n\t \n\t //$title_method = new DashboardCHAI();\n\t //$title_method = $title_method->fetchTitleMethod($method);\n\t \n\t $helper = new Helper2();\n\t $title_date = $helper->fetchTitleDate();\n\t \n\t $this->view->assign('title_date', $title_method[commodity_name].', '. $title_date[month_name].' '. $title_date[year]);\n\t \n\t $cln_data = new DashboardCHAI();\n\t $pfp_data = new DashboardCHAI();\n\t $pfso_data = new DashboardCHAI();\n\t $cs_data = new DashboardCHAI();\n\t \n \n\t // geo selection includes \"--choose--\" or no selection\n \n /* TP:\n * Mind the !isset(...) part \n */\n\t if( ( isset($_POST[\"region_c_id\"] ) && $_POST[\"region_c_id\"][0] == \"\" ) ||\n\t ( isset($_POST[\"district_id\"] ) && $_POST[\"district_id\"][0] == \"\" ) ||\n\t ( isset($_POST[\"province_id\"] ) && $_POST[\"province_id\"][0] == \"\" ) ||\n\t (!isset($_POST[\"region_c_id\"] ) && !isset($_POST[\"district_id\"] ) && !isset($_POST[\"province_id\"] ) ) ){\n\t \n //get national numbers from refresh\n\t $cln_details = $cln_data->fetchDashboardData('national_consumption_by_method');\n\t $pfp_details = $pfp_data->fetchDashboardData('national_percent_facilities_providing');\n\t $pfso_details = $pfso_data->fetchDashboardData('national_percent_facilities_stock_out');\n\t $cs_details = $cs_data->fetchDashboardData('national_coverage_summary');\n\t }\n\t \n\t if(count($cln_details) > 0 && count($pfp_details) > 0 && count($pfso_details) > 0 && isset($cs_details[last_date])) { //got all\n //echo 'inside if stmt'; exit;\n\t $this->view->assign('national_consumption_by_method', $cln_details);\n\t $this->view->assign('national_percent_facilities_providing', $pfp_details);\n\t $this->view->assign('national_percent_facilities_stock_out', $pfso_details);\n\t \n $cs_calc = $this->coverageCalculations($cs_details);\n $this->view->assign('cs_fp_facility_count',$cs_calc['cs_fp_facility_count']);\n\t $this->view->assign('cs_larc_facility_count',$cs_calc['cs_larc_facility_count']);\n\t $this->view->assign('cs_fp_consumption_facility_count',$cs_calc['cs_fp_consumption_facility_count']);\n\t $this->view->assign('cs_larc_consumption_facility_count',$cs_calc['cs_larc_consumption_facility_count']);\n $this->view->assign('cs_fp_stock_out_facility_count',$cs_calc['cs_fp_stock_out_facility_count']);\n $this->view->assign('cs_larc_stock_out_facility_count',$cs_calc['cs_larc_stock_out_facility_count']);\n $this->view->assign('cs_date',$cs_calc['cs_date']);\n\t \n\t } else {\n //echo 'inside else stmt'; exit;\n\t $where = ' 1=1 ';\n\t \n\t if( isset($_POST[\"region_c_id\"]) ){ // CHAINigeria LGA\n //echo 'inside region_c_id stmt'; exit;\n\t $where = $where.' and f.location_id in (';\n\t foreach ($_POST['region_c_id'] as $i => $value){\n\t $geo = explode('_',$value);\n\t $where = $where.$geo[2].', ';\n\t }\n\t $where = $where.') ';\n\t $group = new Zend_Db_Expr('L1_location_name, CNO_external_id');\n\t $useName = 'L1_location_name'; \n\t \n } else if( isset($_POST['district_id']) ){ // CHAINigeria state\n //echo 'inside district_id stmt'; exit;\n\t $where = $where.' and l2.id in (';\n\t foreach ($_POST['district_id'] as $i => $value){\n\t $geo = explode('_',$value);\n\t $where = $where.$geo[1].', ';\n\t }\n\t $where = $where.') ';\n\t $group = new Zend_Db_Expr('L2_location_name, CNO_external_id');\n\t $useName = 'L2_location_name';\n\t \n\t } else if( isset($_POST['province_id']) ){ //province_id is a Trainsmart internal name, represents hightest CHAINigeria level = GPZ\n //echo 'inside province_id stmt'; exit;\n\t $where = $where.' and l2.parent_id in (';\n\t foreach ($_POST['province_id'] as $i => $value){\n\t $geo = explode('_',$value);\n\t $where = $where.$geo[0].', ';\n\t }\n\t $where = $where.') ';\n\t $group = new Zend_Db_Expr('L3_location_name, CNO_external_id');\n\t $useName = 'L3_location_name';\n\t } else { // no geo selection\n //echo 'inside inner else stmt'; exit;\n\t $group = 'CNO_external_id';\n\t $useName = 'C_date';\n\t $location = 'National';\n\t }\n\t \n\t $where = str_replace(', )', ')', $where);\n\t $whereClause = new Zend_Db_Expr($where);\n\t \n\t //$amc_details = $amc_data->fetchAMCDetails($whereClause);\n\t \n\t //file_put_contents('c:\\wamp\\logs\\php_debug.log', 'dash996Action >'.PHP_EOL, FILE_APPEND | LOCK_EX);\tob_start();\n\t //var_dump('amc_details= ', $amc_details, 'END');\n\t //$toss = ob_get_clean(); file_put_contents('c:\\wamp\\logs\\php_debug.log', $toss .PHP_EOL, FILE_APPEND | LOCK_EX);\n\t \n\t // $method is external_id and must be single quoted, likely meant to be int but had to convert table id to external_id\n\t if( \"'$method'\" != '' ) $where = $where . ' and cno.external_id in ( '.\"'$method'\".' )';\n\t \n //echo 'about to call CLNDetails'; exit;\n /* TP:\n * this is for the consumption by method chart\n */\n\t $cln_details = $cln_data->fetchCLNDetails('location', $id, $where, $group, $useName);\n\t \n\t //any FP\n\t //$where = \" 1=1 and cno.external_id in ( 'w92UxLIRNTl', 'H8A8xQ9gJ5b', 'ibHR9NQ0bKL', 'DiXDJRmPwfh', 'yJSLjbC9Gnr', 'vDnxlrIQWUo', 'krVqq8Vk5Kw') and c.consumption > 0 \";\n //$where = \" 1=1 AND c.consumption > 0\";\n\t //$pfp_any_details = $pfp_data->fetchPFPDetails( );\n\t \n\t //larc\n\t //$where = \" 1=1 and cno.external_id in ( 'DiXDJRmPwfh', 'yJSLjbC9Gnr') and c.consumption > 0 \";\n\t //$pfp_larc_details = $pfp_data->fetchPFPDetails( $where,'', '', 'larctrained' );\n \n\t //file_put_contents('c:\\wamp\\logs\\php_debug.log', 'indexAction >'.PHP_EOL, FILE_APPEND | LOCK_EX);\tob_start();\n\t //var_dump('$pfp_any_details= ', $pfp_any_details, 'END');\n\t ////var_dump('$pfp_larc_details= ', $pfp_larc_details, 'END');\n\t //$toss = ob_get_clean(); file_put_contents('c:\\wamp\\logs\\php_debug.log', $toss .PHP_EOL, FILE_APPEND | LOCK_EX);\n\t \n //TP: Percent Facilities Providing FP/LARC\n $pfp_details = $pfp_data->fetchPFPDetails();\n //var_dump($pfp_details); exit;\n \n foreach($pfp_details as $i => $row ){\n\t //$national_percent_facilities_providing[] = array('month' => $row['month'], 'year' => $row['year'], 'fp_percent' => $row['percent'], 'larc_percent' => $pfp_larc_details[$i]['percent'] );\n $national_percent_facilities_providing[] = array('month' => $row['month'], 'year' => $row['year'], 'fp_percent' => $row['fp_percent'], 'larc_percent' => $row['larc_percent'] );\n\t }\n \n// foreach ($national_percent_facilities_providing as $row){\n// echo \"month: \" . $row['month'] . ' ' .\n// \"year: \" . $row['year'] . ' ' .\n// \"fp_percent: \" . $row['fp_percent'] . ' ' .\n// \"larc_percent: \" . $row['larc_percent'] . ' ' .\n// \"percent: \" . $row['percent'] . \"<br/>\";\n// }\n// exit;\n \n \n //TP: STOCK OUTS\n\t //$where = \" 1=1 and (cno.external_id in ( 'DiXDJRmPwfh') and c.stock_out = 'Y') or (cno.external_id in ( 'JyiR2cQ6DZT') and c.consumption = 1) \";\n\t $pfso_details = $pfso_data->fetchPFSODetails( $where );\n\n\t $total = 0;\n\t \n\t \n\t \n\t //file_put_contents('c:\\wamp\\logs\\php_debug.log', 'indexAction >'.PHP_EOL, FILE_APPEND | LOCK_EX);\tob_start();\n\t //var_dump('$pfso_details= ', $pfso_details, 'END');\n\t //var_dump('$method= ', $method, 'END');\n\t //var_dump('$national_percent_facilities_providing= ', $national_percent_facilities_providing, 'END');\n\t //$toss = ob_get_clean(); file_put_contents('c:\\wamp\\logs\\php_debug.log', $toss .PHP_EOL, FILE_APPEND | LOCK_EX);\n\t \n\t foreach($pfso_details as $i => $row ){\n\t $national_percent_facilities_stock_out[] = array('month' => $row['month'], 'year' => $row['year'], 'implant_percent' => $row['implant_percent'], 'seven_days_percent' => $row['seven_days_percent'] );\n\t }\n\t //var_dump($national_percent_facilities_stock_out); exit;\n \n \n\t foreach($cln_details as $i => $row ){\n\t \n\t if ( $location != 'National' ) {\n\t switch($useName){\n\t case 'L1_location_name' :\n\t $location = $row['L1_location_name'];\n\t break;\n\t case 'L2_location_name' :\n\t $location = $row['L2_location_name'];\n\t break;\n\t case 'L3_location_name' :\n\t $location = $row['L3_location_name'];\n\t break;\n\t }\n\t }\n\t \n\t $locationNames = $locationNames ? $locationNames.', '.$location : $locationNames.$location;\n\t \n\t // remove single quotes and explode method\n\t $bad_chars = array(\"'\");\n\t $method = str_replace($bad_chars, \"\", $method);\n\t $methods = array( explode(',', $method) );\n\t \n\t // lookup commodity_names\n\t $title_method = new DashboardCHAI(); \n\t $CNO[] = array ($title_method->fetchTitleMethod($methods[0][0]));\n $CNO[] = array ($title_method->fetchTitleMethod($methods[0][1]));\n $CNO[] = array ($title_method->fetchTitleMethod($methods[0][2]));\n $CNO[] = array ($title_method->fetchTitleMethod($methods[0][3]));\n $CNO[] = array ($title_method->fetchTitleMethod($methods[0][4]));\n $CNO[] = array ($title_method->fetchTitleMethod($methods[0][5]));\n $CNO[] = array ($title_method->fetchTitleMethod($methods[0][6]));\n\t \n $national_consumption_by_method[] =array('method' => $CNO[0][0]['commodity_name'], 'consumption' => $row['consumption1'] );\n $national_consumption_by_method[] =array('method' => $CNO[1][0]['commodity_name'], 'consumption' => $row['consumption2'] );\n $national_consumption_by_method[] =array('method' => $CNO[2][0]['commodity_name'], 'consumption' => $row['consumption3'] );\n $national_consumption_by_method[] =array('method' => $CNO[3][0]['commodity_name'], 'consumption' => $row['consumption4'] );\n $national_consumption_by_method[] =array('method' => $CNO[4][0]['commodity_name'], 'consumption' => $row['consumption5'] );\n $national_consumption_by_method[] =array('method' => $CNO[5][0]['commodity_name'], 'consumption' => $row['consumption6'] );\n $national_consumption_by_method[] =array('method' => $CNO[6][0]['commodity_name'], 'consumption' => $row['consumption7'] );\n\n //file_put_contents('c:\\wamp\\logs\\php_debug.log', 'dash996Action >'.PHP_EOL, FILE_APPEND | LOCK_EX);\tob_start();\n //var_dump('$methods= ', $methods, 'END');\n //var_dump('$CNO= ', $CNO, 'END');\n //var_dump('$consumption_by_method= ', $consumption_by_method, 'END');\n //$toss = ob_get_clean(); file_put_contents('c:\\wamp\\logs\\php_debug.log', $toss .PHP_EOL, FILE_APPEND | LOCK_EX);\n \t \n\t $total = $total + $consumption_by_geo[$i]['consumption'];\n\t \n\t } // foreach cln\n\t \n\t if (is_null($national_consumption_by_method)) {\n\t $consumption_by_geo[] = array('location' => 'No Data', 'consumption' => 0 );\n\t }\n\t \n\t if ($total == 0) {\n\t $total_consumption[] = array('location' => 'No Data', 'consumption' => 0 );\n\t } else {\n\t $total_consumption[] = array('location' => $locationNames, 'consumption' => $total );\n\t }\n\t \n\t \n \n \n\t $cs_data = new DashboardCHAI();\n\t // specify date by \"2014-12-01\" or leave empty to get data for the last month\n\t $cs_details = $cs_data->fetchCSDetails(null);\n \n $cs_calc = $this->coverageCalculations($cs_details);\n \n $this->view->assign('cs_fp_facility_count',$cs_calc['cs_fp_facility_count']);\n\t $this->view->assign('cs_larc_facility_count',$cs_calc['cs_larc_facility_count']);\n\t $this->view->assign('cs_fp_consumption_facility_count',$cs_calc['cs_fp_consumption_facility_count']);\n\t $this->view->assign('cs_larc_consumption_facility_count',$cs_calc['cs_larc_consumption_facility_count']);\n $this->view->assign('cs_fp_stock_out_facility_count',$cs_calc['cs_fp_stock_out_facility_count']);\n $this->view->assign('cs_larc_stock_out_facility_count',$cs_calc['cs_larc_stock_out_facility_count']);\n $this->view->assign('cs_date',$cs_calc['cs_date']); \n //var_dump($cs_calc); exit;\n \n\t \n\t //file_put_contents('c:\\wamp\\logs\\php_debug.log', 'dash9bAction >'.PHP_EOL, FILE_APPEND | LOCK_EX);\tob_start();\n\t //var_dump('$cs_details= ', $cs_details, 'END');\n\t //var_dump('$method= ', $method, 'END');\n\t //$toss = ob_get_clean(); file_put_contents('c:\\wamp\\logs\\php_debug.log', $toss .PHP_EOL, FILE_APPEND | LOCK_EX);\n\t \t \n\t \n\t $this->view->assign('national_consumption_by_method', $national_consumption_by_method);\n\t $this->view->assign('national_percent_facilities_providing', $national_percent_facilities_providing);\n\t $this->view->assign('national_percent_facilities_stock_out', $national_percent_facilities_stock_out);\n\t \n\t if ($location == 'National') {\n\t $cln_details = $cln_data->insertDashboardData($national_consumption_by_method, 'national_consumption_by_method');\n\t $pfp_details = $pfp_data->insertDashboardData($national_percent_facilities_providing, 'national_percent_facilities_providing');\n\t $pfso_details = $pfso_data->insertDashboardData($national_percent_facilities_stock_out, 'national_percent_facilities_stock_out');\n\t $cs_details = $cs_data->insertDashboardData($cs_details, 'national_coverage_summary');\n\t }\n\t \n\t } // else\n\t \n\t $this->viewAssignEscaped ('locations', Location::getAll(1));\n\t}", "public function compareAction() {}", "function fb_authorize_action() {\n\n if (!empty($_POST) && wp_verify_nonce($_POST['afap_fb_authorize_nonce'], 'afap_fb_authorize_action')) {\n\n include('inc/cores/fb-authorization.php');\n\n } else {\n\n die('No script kiddies please');\n\n }\n\n }", "public function selectWinnerAction(){\n\t\t$infosParticipation = [\n\t\t\t'id_competition' => $this->competition->getId_competition(),\n\t\t\t'id_user' => $_POST['id_user']\n\t\t];\n\t\t$participation = new participate($infosParticipation);\n\t\t$participationManager = new participateManager();\n\t\t$result = $participationManager->getParticipationByIds($participation);\n\t\tif($result!=NULL && $this->competition!=NULL){\n\t\t\t$competitionManager = new competitionManager();\n\t\t\t$competition = $competitionManager->getCompetitionById($this->competition->getId_competition());\n\t\t\t$competition->setId_winner($result->getId_user());\n\t\t\t$competition->setActive(2);\n\t\t\t$competitionManager->updateCompetition($competition);\n\n\t\t\t$this->checkWinner();\n\t\t\t\n\t\t}\n\t}", "public function rejectAction() {\n\n //CHECK AUTH\n if( !$this->_helper->requireUser()->isValid() ) return;\n\n //PROCESS\n $viewer = Engine_Api::_()->user()->getViewer();\n \n //GET THE SITEPAGE ID FROM THE URL\n $page_id = $this->_getParam('page_id');\n $sitepage = Engine_Api::_()->getItem('sitepage_page', $page_id);\n\n //MAKE FORM\n $this->view->form = $form = new Sitepagemember_Form_Member();\n $form->setTitle('Reject Page Invitation');\n $form->setDescription('Would you like to reject the invitation for this page?');\n $form->submit->setLabel('Reject Page Invitation');\n \n //PROCESS FORM\n if( !$this->getRequest()->isPost() ) {\n $this->view->status = false;\n $this->view->error = true;\n $this->view->message = Zend_Registry::get('Zend_Translate')->_('Invalid Method');\n return;\n }\n\n if( !$form->isValid($this->getRequest()->getPost()) ) {\n $this->view->status = false;\n $this->view->error = true;\n $this->view->message = Zend_Registry::get('Zend_Translate')->_('Invalid Data');\n return;\n }\n\n\t\tif (!empty($page_id)) {\n\t\t\n\t\t\t//DELETE THE RESULT FORM THE TABLE.\n\t\t\tEngine_Api::_()->getDbtable('membership', 'sitepage')->delete(array('resource_id =?' => $page_id, 'user_id =?' => $viewer->getIdentity()));\n\t\t}\n\t\t\n $this->view->status = true;\n $this->view->error = false;\n $message = Zend_Registry::get('Zend_Translate')->_('You have ignored the invite to the page %s');\n $message = sprintf($message, $sitepage->__toString());\n $this->view->message = $message;\n\n if( null === $this->_helper->contextSwitch->getCurrentContext() ) {\n return $this->_forwardCustom('success', 'utility', 'core', array(\n 'messages' => array($message),\n 'layout' => 'default-simple',\n \n 'parentRefresh' => true,\n ));\n }\n }", "function scan_delivery_akw()\r\n\t{\r\n\t\t$user=$this->erpm->auth();\r\n\t\tif(!$_POST)\r\n\t\t\tdie();\r\n\t\t$invoice_no=$this->input->post('invoice_no');\r\n\t\t\r\n\t\t$inv_exist=$this->db->query(\"select count(*) as ttl from shipment_batch_process_invoice_link where invoice_no=? and invoice_no!=0\",$invoice_no)->row()->ttl;\r\n\t\t\r\n\t\tif(!$inv_exist)\r\n\t\t\tdie(\"<div class='invoice_not_found' style='background:#cd0000;'>AWB/Invoice/Order No:{$invoice_no} not found</div>\");\r\n\t\t\r\n\t\t$is_shiped=$this->db->query(\"select count(*) as ttl from shipment_batch_process_invoice_link where invoice_no=? and invoice_no!=0 and shipped=1\",$invoice_no)->row()->ttl;\r\n\t\t\r\n\t\tif(!$is_shiped)\r\n\t\t\tdie(\"<div class='invoice_not_shipped' style='background:purple;'>AWB/Invoice/Order No:{$invoice_no} not Shipped</div>\");\r\n\t\t\r\n\t\t$is_delivered=$this->db->query(\"select count(*) as ttl from pnh_invoice_transit_log where invoice_no=? and status=3\",$invoice_no)->row()->ttl;\r\n\t\t\r\n\t\tif(!$is_delivered)\r\n\t\t\tdie(\"<div class='invoice_not_delivered' style='background:orange;'>AWB/Invoice/Order No:{$invoice_no} not Delivered</div>\");\r\n\t\t\r\n\t\t$is_akw=$this->db->query(\"select count(*) as ttl from shipment_batch_process_invoice_link where invoice_no=? and invoice_no!=0 and is_acknowleged=1\",$invoice_no)->row()->ttl;\r\n\t\t\r\n\t\tif($is_akw)\r\n\t\t\tdie(\"<div class='already_scaned' style='background:green;'>AWB/Invoice/Order No:{$invoice_no} already Acknowledged</div>\");\r\n\t\t\r\n\t\t$this->db->query(\"update shipment_batch_process_invoice_link set is_acknowleged=?,is_acknowleged_by=?,is_acknowleged_on=? where invoice_no=? and invoice_no!=0 and shipped=1\",array(1,$user['userid'],cur_datetime(),$invoice_no));\r\n\t\t\r\n\t\tif($this->db->affected_rows())\r\n\t\t{\r\n\t\t\tdie(\"<div class='awkscanned' style='background:#f1f1f1;color: #000 !important;'>AWB/Invoice/Order No:{$invoice_no} is Acknowledged</div>\");\r\n\t\t}\r\n\t}", "function agreeFriendHandler() {\n global $inputs;\n\n $res = getOne('SELECT * FROM member_friend_apply WHERE id = ?',[$inputs['id']]);\n\n insert('member_friend',[\n 'member_id' => getLogin()['mid'],\n 'friend_id' => $res['member_id']\n ]);\n\n insert('member_friend',[\n 'member_id' => $res['member_id'],\n 'friend_id' =>getLogin()['mid']\n ]);\n\n $sql = \"DELETE FROM `member_friend_apply` WHERE id = \" . $inputs['id'];\n execSql($sql);\n\n formatOutput(true, 'option success');\n}", "public function otherAction() {\n\t}", "public function authorized(){\n if ($reply = parent::authorized()){\n $reply = ($this->getRank() > RANK_vm_registrant) || VM::hasRightTo('request_visits');\n }\n $this->getTitle();\n $this->dbg($reply);\n return $reply;\n }", "public function confirmThirdPartyPaymentRequestAction()\n {\n // $server = new Zend_Soap_Server(null, array('uri' => 'http://api.nexva.com/test/confirm-third-party-payment-request'));\n \n $server = new TestSoapServer(null, array('uri' => 'http://api.nexva.com/test/confirm-third-party-payment-request'));\n \t\n \t// set SOAP service class\n \t$server->setClass('Uganda_Soap_Functions');\n \n $server->setEncoding('UTF-8');\n //$server->setReturnResponse(false);\n\n \t// handle request\n \t$server->handle();\n\n }", "public function doInterest() {\n\n\t\t\t$this->interest->RenderinterestFrom();\n\n\t\t\t$Name = $this->getInterstName();\n\t\t\t$Email = $this->getInterstEmail();\n\t\t\t$Message = $this->getInterstMsg();\n\n\t\t\tif ($this->didPressSend() == true) {\n\n\t\t\t\tif ($this->validation->InterestFormValidation($this->getInterstName(),$this->getInterstEmail(),$this->getInterstMsg()) === true) {\n\t\t\t\t\t\t//Parameters sends to mail function.\n\t\t\t\t\t\t$messages = \"Namn:\\r\\n\" .$Name.\"\\r\\nEpost:\\r\\n\". $Email.\"\\r\\nMeddelandet:\\r\\n\".$Message;\n\t\t\t\t\t\t$headers = \"From:\".$Email.\"\\r\\n\";\n\t\t\t \t\t$headers .= \"Reply-To:\" .$Email;\n\t\t\t \t\t$headers .= \"MIME-Version: 1.0\\r\\n\";\n\t\t\t \t\t$headers .= \"Content-type: text/plain; charset=utf-8\\r\\n\";\n\n\n\t\t\t\t\t\t$this->emailInterest->EmailInterest($messages,$headers);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn $this->interest->interestFrom($this->validation->InterestFormValidation($this->getInterstName(),$this->getInterstEmail(),$this->getInterstMsg()));\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function scanAction()\n {\n $ctrl = $this->dbController->find($this->checkControllerIdParam());\n $vCtrl = new Admin_Model_DbRow_Controller();\n $all = array();\n $vVanish = array();\n $vNew = array();\n\n IF($ctrl->count() === 1) {\n $ctrlRow = $vCtrl->fromArray($ctrl->current());\n\n FOREACH($this->dbAction->findActionByControllerId($ctrlRow->get('id')) AS $row) {\n $all[] = new Admin_Model_DbRow_Action($row);\n }\n\n $scanned = $this->ctrlActionModel->getActions(\n $ctrlRow->get('moduleName'),\n $ctrlRow->get('controllerName'),\n $ctrlRow->get('virtual'));\n\n $vNew = $this->dbAction->filterExistingActions($ctrlRow->get('id'), $scanned);\n $vVanish = $this->ctrlActionModel->filterVanishedActions($all, $scanned);\n }\n\n $this->view->controller = $vCtrl;\n $this->view->vanished = $vVanish;\n $this->view->new = $vNew;\n }", "public function actionAccept($confirmation) {\n\n\t\tUser::confirmEmail($confirmation);\n\t}", "private function accept_opp_ownership($given_data) {\n $opp_ownership= $this->opp_sales->opp_owner($given_data['opp_id']);\n $opp_status= $opp_ownership[0]->owner_status;\n $repotmgr=$this->opp_sales->getrepmgr($given_data['userid']);\n //if($opp_status=='1'){\n $data1= array(\n 'owner_id'=>$given_data['userid'],\n 'oppowner'=>$given_data['userid'],\n 'owner_status'=>2\n );\n $data2= array(\n 'mapping_id' => uniqid(rand()),\n 'opportunity_id' => $given_data['opp_id'],\n 'lead_cust_id' => $given_data['lead_cust_id'],\n 'from_user_id' => $given_data['userid'],\n 'to_user_id' => $given_data['userid'],\n 'cycle_id' => $given_data['cycle_id'],\n 'stage_id' =>$given_data['opportunity_stage'],\n 'module' => 'sales',\n 'sell_type' => $given_data['sell_type'],\n 'timestamp' => date('Y-m-d H:i:s'),\n 'action' => 'ownership accepted',\n 'state' => '1'\n );\n\n $insertArray1=array();\n\n //---------------- notification code----------------------------------\n $get_fromuser= $this->opp_sales->get_from_userid1($given_data['opp_id'],$given_data['userid']);\n //to user---- is the one who is to be notified.\n // from user---- is the one who performs action\n $dt = date('ymdHis');\n $notify_id= uniqid($dt);\n $remarks=\"accept of opp from executive module \";\n $getusername=$this->opp_mgr->getusernamae($get_fromuser);\n $getusername1=$this->opp_mgr->getusernamae($given_data['userid']);\n \t\t$data21= array(\n \t\t\t'notificationID' =>$notify_id,\n \t\t\t'notificationShortText'=>'Opportunity Ownership Accepted',\n \t\t\t'notificationText' =>'Opportunity Ownership Accepted by '.$getusername1.' given by '.$getusername,\n \t\t\t'from_user'=>$given_data['userid'],\n \t\t\t'to_user'=>$get_fromuser,\n \t\t\t'action_details'=>'Opportunity',\n \t\t\t'notificationTimestamp'=>$dt,\n \t\t\t'read_state'=>0,\n \t\t\t'remarks'=>$remarks,\n \t\t\t'show_status'=>0\n \t\t);\n //array_push($insertArray1, $data2);\n if($get_fromuser!=\"\"){\n $get_fromuser= $this->opp_sales->rej_opp_notification($data21);\n }\n\n //---------------------------------------------------------end -----------------\n\n $update = $this->opp_sales->accept_opp($given_data['opp_id'],$data1);\n $update2 = $this->opp_sales->update_transaction($given_data['opp_id']);\n $update1 = $this->opp_sales->insert_transaction($data2);\n if($update==true && $update1==true && $update2==true){\n return 1;\n }\n // }\n }", "private function accept_opp_stage($given_data)\t{\n \t$opp_stage= $this->opp_sales->stage_owner($given_data['opp_id']);\n $opp_status= $opp_stage[0]->stage_owner_status;\n $opp_value=$opp_stage[0]->opportunity_value;\n $stage_manager_owner_id=$opp_stage[0]->stage_manager_owner_id;\n\n //if($opp_status=='1' || $opp_status=='0'){\n $repotmgr=$this->opp_sales->getrepmgr($given_data['userid']);\n if($opp_value=='onlyexe'){\n $data1= array(\n 'stage_owner_id'=>$given_data['userid'],\n 'stage_owner_status'=>2,\n 'stage_manager_owner_id'=>$repotmgr\n );\n }else{\n $data1= array(\n 'stage_owner_id'=>$given_data['userid'],\n 'stage_owner_status'=>2\n );\n\n }\n if($opp_value=='onlyexe'){\n $data2= array(\n 'mapping_id'=> uniqid(rand()),\n 'opportunity_id'=>$given_data['opp_id'],\n 'lead_cust_id'=> $given_data['lead_cust_id'],\n 'from_user_id'=> $repotmgr,\n 'to_user_id'=> $given_data['userid'],\n 'cycle_id'=> $given_data['cycle_id'],\n 'stage_id'=>$given_data['opportunity_stage'],\n 'module'=> 'sales',\n 'sell_type'=> $given_data['sell_type'],\n 'timestamp'=> date('Y-m-d H:i:s'),\n 'action' => 'stage accepted',\n 'state' => '1'\n );\n }else{\n $data2= array(\n 'mapping_id'=> uniqid(rand()),\n 'opportunity_id'=>$given_data['opp_id'],\n 'lead_cust_id'=> $given_data['lead_cust_id'],\n 'from_user_id'=> $given_data['userid'],\n 'to_user_id'=> $given_data['userid'],\n 'cycle_id'=> $given_data['cycle_id'],\n 'stage_id'=>$given_data['opportunity_stage'],\n 'module'=> 'sales',\n 'sell_type'=> $given_data['sell_type'],\n 'timestamp'=> date('Y-m-d H:i:s'),\n 'action' => 'stage accepted',\n 'state' => '1'\n );\n\n }\n $update = $this->opp_sales->accept_opp($given_data['opp_id'],$data1);\n $update2 = $this->opp_sales->update_stage_transaction($given_data['opp_id']);\n $update1 = $this->opp_sales->insert_transaction($data2);\n\n //---------------- notification code----------------------------------\n $get_fromuser= $this->opp_sales->get_from_userid1($given_data['opp_id'],$given_data['userid']);\n //to user---- is the one who is to be notified.\n // from user---- is the one who performs action\n $dt = date('ymdHis');\n $notify_id= uniqid($dt);\n $remarks=\"accept of opp from executive module \";\n $getusername=$this->opp_mgr->getusernamae($get_fromuser);\n $getusername1=$this->opp_mgr->getusernamae($given_data['userid']);\n \t\t$data21= array(\n \t\t\t'notificationID' =>$notify_id,\n \t\t\t'notificationShortText'=>'Opportunity Stage Accepted',\n \t\t\t'notificationText' =>'Opportunity Stage Accepted by '.$getusername1.' given by '.$getusername,\n \t\t\t'from_user'=>$given_data['userid'],\n \t\t\t'to_user'=>$get_fromuser,\n \t\t\t'action_details'=>'Opportunity',\n \t\t\t'notificationTimestamp'=>$dt,\n \t\t\t'read_state'=>0,\n \t\t\t'remarks'=>$remarks,\n \t\t\t'show_status'=>0\n \t\t);\n //array_push($insertArray1, $data2);\n if($get_fromuser!=\"\"){\n $get_fromuser= $this->opp_sales->rej_opp_notification($data21);\n }\n\n //---------------------------------------------------------end -----------------\n\n if($update==true && $update1==true && $update2==true){\n return 1;\n }\n //}\n }", "public function accept($token)\n\t{\n \t$vendor = new Vendor();\n\t\treturn $vendor->AcceptAppointments($token,true);\n\t}", "function handle_actions() {\n $id = filter_input(INPUT_GET, 'id');\n global $subscribers;\n global $log;\n\n // POST\n $action = filter_input(INPUT_POST, 'action');\n if ($action == 'create') { \n $log->log('Subscriber CREATE'); // CREATE\n $subscribers->add();\n }\n \n\n // GET\n $action = filter_input(INPUT_GET, 'action');\n if (empty($action)) { \n $log->log('Subscriber READ'); // READ\n return $subscribers->list_view();\n }\n if ($action == 'add') {\n $log->log('Subscriber Add View');\n return $subscribers->add_view();\n }\n }", "public function acceptFromPoAction()\r\n {\r\n $request = $this->getRequest();\r\n if ($request->getHeader('Referer') == null) {\r\n return $this->redirect()->toRoute('access_denied');\r\n }\r\n\r\n $id = (int) $this->params()->fromQuery('target_id');\r\n $token = $this->params()->fromQuery('token');\r\n\r\n /**@var \\Application\\Repository\\FinVendorInvoiceRepository $res ;*/\r\n $res = $this->doctrineEM->getRepository('Application\\Entity\\FinVendorInvoice');\r\n $rows_tmp = $res->getAPInvoiceTmp($id, $token);\r\n\r\n if ($rows_tmp !== null) {\r\n\r\n /**@var \\Application\\Entity\\FinVendorInvoice $target ;*/\r\n $target = null;\r\n\r\n if (count($rows_tmp) > 0) {\r\n $row_1 = $rows_tmp[0];\r\n if ($row_1 instanceof FinVendorInvoiceRowTmp) {\r\n $target = $row_1->getInvoice();\r\n }\r\n\r\n if ($target == null) {\r\n return $this->redirect()->toRoute('access_denied');\r\n }\r\n\r\n $n = 0;\r\n foreach ($rows_tmp as $r) {\r\n\r\n /**@var \\Application\\Entity\\FinVendorInvoiceRowTmp $r ;*/\r\n\r\n $n ++;\r\n $ap_row = new FinVendorInvoiceRow();\r\n $ap_row->setIsActive(1);\r\n $ap_row->setRowNumber($n);\r\n $ap_row->setRowIndentifer($target->getSysNumber() . \"-$n\");\r\n\r\n $ap_row->setCurrentState($target->getCurrentState());\r\n $ap_row->setInvoice($target);\r\n $ap_row->setPoRow($r->getPoRow());\r\n $ap_row->setPrRow($r->getPrRow());\r\n $ap_row->setItem($r->getItem());\r\n\r\n $ap_row->setQuantity($r->getQuantity());\r\n $ap_row->setUnit($r->getUnit());\r\n $ap_row->setUnitPrice($r->getUnitPrice());\r\n\r\n $netAmount = $r->getQuantity() * $r->getUnitPrice();\r\n\r\n $taxRate = (int) $r->getTaxRate();\r\n $ap_row->setTaxRate($taxRate);\r\n\r\n $taxAmount = $netAmount * $taxRate;\r\n $grossAmount = $netAmount + $taxAmount;\r\n\r\n $ap_row->setNetAmount($netAmount);\r\n $ap_row->setGrossAmount($grossAmount);\r\n\r\n $u = $this->doctrineEM->getRepository('Application\\Entity\\MlaUsers')->findOneBy(array(\r\n \"email\" => $this->identity()\r\n ));\r\n\r\n $ap_row->setCreatedBy($u);\r\n $ap_row->setCreatedOn(new \\DateTime());\r\n $ap_row->setToken(Rand::getString(10, \\Application\\Model\\Constants::CHAR_LIST, true) . \"_\" . Rand::getString(21, \\Application\\Model\\Constants::CHAR_LIST, true));\r\n $ap_row->setRemarks($r->getRemarks());\r\n\r\n $this->doctrineEM->persist($ap_row);\r\n\r\n $r->setCurrentState(\"ACCEPTED\");\r\n $r->setIsActive(0);\r\n $this->doctrineEM->persist($r);\r\n\r\n $gr_entity = new NmtInventoryTrx();\r\n $gr_entity->setVendor($target->getVendor());\r\n $gr_entity->setFlow('IN');\r\n $gr_entity->setInvoiceRow($ap_row);\r\n $gr_entity->setItem($r->getItem());\r\n $gr_entity->setPrRow($r->getPrRow());\r\n $gr_entity->setQuantity($r->getQuantity());\r\n $gr_entity->setVendorItemCode($r->getVendorItemCode());\r\n $gr_entity->setVendorItemUnit($r->getUnit());\r\n $gr_entity->setVendorUnitPrice($r->getUnitPrice());\r\n $gr_entity->setTrxDate($target->getGrDate());\r\n $gr_entity->setCurrency($target->getCurrency());\r\n $gr_entity->setRemarks(\"GR of Invoice \" . $target->getInvoiceNo());\r\n $gr_entity->setWh($target->getWarehouse());\r\n $gr_entity->setCreatedBy($u);\r\n $gr_entity->setCreatedOn(new \\DateTime());\r\n $gr_entity->setToken(Rand::getString(10, \\Application\\Model\\Constants::CHAR_LIST, true) . \"_\" . Rand::getString(21, \\Application\\Model\\Constants::CHAR_LIST, true));\r\n $gr_entity->setChecksum(Rand::getString(32, \\Application\\Model\\Constants::CHAR_LIST, true));\r\n\r\n $gr_entity->setTaxRate($r->getTaxRate());\r\n\r\n $gr_entity->setCurrentState($target->getCurrentState());\r\n\r\n if ($target->getCurrentState() == \"finalInvoice\") {\r\n $gr_entity->setIsActive(1);\r\n } else {\r\n $gr_entity->setIsActive(0);\r\n }\r\n\r\n $this->doctrineEM->persist($gr_entity);\r\n $this->doctrineEM->flush();\r\n }\r\n }\r\n\r\n $this->doctrineEM->flush();\r\n\r\n /*\r\n * $redirectUrl = \"/finance/v-invoice/copy-from-po1?token=\" . $target>getToken() . \"&entity_id=\" . $entity->getId();\r\n */\r\n $redirectUrl = \"/finance/v-invoice/list\";\r\n return $this->redirect()->toUrl($redirectUrl);\r\n\r\n /*\r\n * return new ViewModel(array(\r\n * 'target' => $target,\r\n * ));\r\n */\r\n }\r\n return $this->redirect()->toRoute('access_denied');\r\n }", "public function cercaAvanzata(){\n if(($_SERVER['REQUEST_METHOD']==\"POST\")){\n $view = new VRisultati();\n $filtri = $view->recuperaFiltri(); //filtri inseriti dall'utente\n $pm = FPersistentManager::getInstance();\n $ricette = $pm->ricercaTramiteFiltri($filtri);\n if($ricette!=null){\n $msg = \"\";\n } else {\n $msg = \"Non ci sono ricette che soddisfano questi parametri\";\n }\n $view->mostraRisultati($ricette, $msg);\n\n }\n else{\n header('HTTP/1.1 405 Method Not Allowed');\n header('Allow: POST');\n }\n\n }", "public function followAction() {\n $this->validateRequestMethod('POST');\n// Set the translations for zend library.\n if (!Zend_Registry::isRegistered('Zend_Translate'))\n Engine_Api::_()->getApi('Core', 'siteapi')->setTranslate();\n\n Engine_Api::_()->getApi('Core', 'siteapi')->setView();\n\n //ONLY LOGGED IN USER CAN CREATE\n if (!$this->_helper->requireUser()->isValid())\n $this->respondWithError('unauthorized');\n\n\n $wishlist_id = $this->_getParam('wishlist_id');\n if (isset($wishlist_id) && !empty($wishlist_id)) {\n $subject = $wishlist = Engine_Api::_()->getItem('sitereview_wishlist', $wishlist_id);\n Engine_Api::_()->core()->setSubject($wishlist);\n } else {\n $this->respondWithError('no_record');\n }\n\n //GET VIEWER INFORMATION\n $viewer = Engine_Api::_()->user()->getViewer();\n $viewer_id = $viewer->getIdentity();\n\n //GET THE VALUE OF RESOURCE ID AND TYPE \n $resource_id = $wishlist_id;\n $resource_type = 'sitereview_wishlist';\n\n $isFollow = $wishlist->follows()->isFollow($viewer);\n $follow_id = empty($isFollow) ? 0 : 1;\n\n //GET FOLLOW TABLE\n $followTable = Engine_Api::_()->getDbTable('follows', 'seaocore');\n $follow_name = $followTable->info('name');\n\n //GET OBJECT\n $resource = Engine_Api::_()->getItem($resource_type, $resource_id);\n if (empty($follow_id)) {\n\n //CHECKING IF USER HAS MAKING DUPLICATE ENTRY OF LIKING AN APPLICATION.\n $follow_id_temp = $resource->follows()->isFollow($viewer);\n if (empty($follow_id_temp)) {\n\n if (!empty($resource)) {\n $follow_id = $followTable->addFollow($resource, $viewer);\n if ($viewer_id != $resource->getOwner()->getIdentity() && $resource->getOwner()->getIdentity()) {\n //ADD NOTIFICATION\n try {\n Engine_Api::_()->getDbtable('notifications', 'activity')->addNotification($resource->getOwner(), $viewer, $resource, 'follow_' . $resource_type, array());\n } catch (Exception $ex) {\n \n }\n if ($resource_type != 'siteevent_event') {\n //ADD ACTIVITY FEED\n $activityApi = Engine_Api::_()->getDbtable('actions', 'activity');\n if ($resource_type != 'sitepage_page' || $resource_type != 'sitebusiness_business' || $resource_type != 'sitegroup_group' || $resource_type != 'sitestore_store') {\n $action = $activityApi->addActivity($viewer, $resource, 'follow_' . $resource_type, '', array(\n 'owner' => $resource->getOwner()->getGuid(),\n ));\n } else {\n $action = $activityApi->addActivity($viewer, $resource, 'follow_' . $resource_type);\n }\n\n if (!empty($action))\n $activityApi->attachActivity($action, $resource);\n }\n }\n }\n }\n } else {\n if (!empty($resource)) {\n $followTable->removeFollow($resource, $viewer);\n\n if ($viewer_id != $resource->getOwner()->getIdentity()) {\n //DELETE NOTIFICATION\n $notification = Engine_Api::_()->getDbtable('notifications', 'activity')->getNotificationByObjectAndType($resource->getOwner(), $resource, 'follow_' . $resource_type);\n if ($notification) {\n $notification->delete();\n }\n\n //DELETE ACTIVITY FEED\n $action_id = Engine_Api::_()->getDbtable('actions', 'activity')\n ->select()\n ->from('engine4_activity_actions', 'action_id')\n ->where('type = ?', \"follow_$resource_type\")\n ->where('subject_id = ?', $viewer_id)\n ->where('subject_type = ?', 'user')\n ->where('object_type = ?', $resource_type)\n ->where('object_id = ?', $resource->getIdentity())\n ->query()\n ->fetchColumn();\n\n if (!empty($action_id)) {\n $activity = Engine_Api::_()->getItem('activity_action', $action_id);\n if (!empty($activity)) {\n $activity->delete();\n }\n }\n }\n }\n }\n\n $this->successResponseNoContent('no_content', true);\n }", "public function accept($item);", "public function test_user_can_accept_their_invites()\n {\n $user = factory(User::class, 1)->create()->first();\n factory(Box::class, 3)->create();\n\n $invite = Invite::create([\n 'email' => $user->email,\n 'box_id' => 1, //Box doesn't matter\n 'role' => 'coach',\n 'token' => 'fake_token'\n ]);\n\n Invite::create([\n 'email' => $user->email,\n 'box_id' => 2,\n 'role' => 'owner',\n 'token' => 'fake_token'\n ]);\n\n Invite::create([\n 'email' => $user->email,\n 'box_id' => 3,\n 'role' => 'admin',\n 'token' => 'fake_token'\n ]);\n\n $this->actingAs($user);\n\n $response = $this->post(route('frontend.invites.accept', $invite));\n\n $response->assertStatus(200);\n\n $invites = $user->invites();\n\n $this->assertEquals(2, $invites->count());\n\n }", "public function accept_request() {\n // Only send request if there's no existed relation between the two users\n $existed_relation_status = $this->bidirectional_relation_exists();\n \n if($existed_relation_status === \"P\") {\n /* \n Here w passed P as argument to update method to tell to update record with:\n from=$this->from\n to=$this->to\n status=\"P\"\n and change it to be like :\n from=$this->from\n to=$this->to\n status=\"F\"\n */\n\n // Update the current direction record\n $this->status = \"F\";\n $this->update(\"P\");\n\n // Add the other direction record\n $other_end = new UserRelation();\n $other_end->set_data(array(\n 'from'=>$this->to,\n 'to'=>$this->from,\n 'status'=>\"F\",\n 'since'=>date(\"Y/m/d h:i:s\")\n ));\n $other_end->add();\n\n return true;\n }\n\n return false;\n }", "abstract public function url_authorize();", "public function inviteAction()\n {\n $config = $this->getServiceLocator()->get('config');\n $config = $config['connectors'];\n\n $newspaperId = $this->params()->fromRoute('newspaperId', false);\n $ids = $this->params()->fromQuery('to', false);\n $requestId = $this->params()->fromQuery('request', false);\n\n /* @var $tagRepo \\Doctrine\\ORM\\EntityRepository */\n $newspaperRepo = $this->EmPlugin()->getEntityManager()->getRepository('Common\\Entity\\Newspaper');\n $newspaper = $newspaperRepo->findOneById($newspaperId);\n\n if (!$newspaper) {\n $this->flashMessenger()->addErrorMessage('Oeps, er ging iets verkeerd.');\n return $this->redirect()->toRoute('root');\n }\n\n if ($requestId && $ids) {\n foreach ($ids as $id) {\n $connectorRepo = $this->EmPlugin()->getEntityManager()->getRepository('Common\\Entity\\Connector');\n $connector = $connectorRepo->findOneBy(array(\n 'type' => Connector::FEED_TYPE_FACEBOOK,\n 'uniqueId' => $id,\n 'requestId' => $requestId,\n 'newspaper' => $newspaper->getId(),\n ));\n\n if (!$connector) {\n $connector = new Connector();\n $connector->setNewspaper($newspaper)\n ->setType(Connector::FEED_TYPE_FACEBOOK)\n ->setUniqueId($id)\n ->setRequestId($requestId)\n ->setActive(false);\n $this->EmPlugin()->getEntityManager()->persist($connector);\n $this->EmPlugin()->getEntityManager()->flush();\n }\n }\n\n return $this->redirect()->toRoute('user/wildcard', \n array(\n 'action' => 'done'\n ), array(), false\n );\n }\n\n return array(\n 'config' => $config,\n 'newspaper' => $newspaper\n );\n }", "protected function accepted()\n {\n $this->response = $this->response->withStatus(202);\n $this->jsonBody($this->payload->getOutput());\n }", "function yy_accept()\n {\n if (self::$yyTraceFILE) {\n fprintf(self::$yyTraceFILE, \"%sAccept!\\n\", self::$yyTracePrompt);\n }\n while ($this->yyidx >= 0) {\n $stack = $this->yy_pop_parser_stack();\n }\n /* Here code is inserted which will be executed whenever the\n ** parser accepts */\n }", "public function productcompareaddAction() {\n // neu chua khoi tao\n // neu roi add them 1 phan tu vao sesion voi id va uenc da duoc tao\n $this->layout('layout/bags');\n $getuser = $this->forward()->dispatch('Admin\\Controller\\Index', array(\n 'action' => 'getuser'\n ));\n // var_dump($getuser);\n $this->layout()->getuser = $getuser;\n\n $id = $this->params()->fromRoute('id');\n $uenc = $this->params()->fromRoute('uenc');\n\n echo \"id :\";\n var_dump($id);\n echo \"</br>\";\n echo \"uenc :\";\n var_dump($uenc);\n }", "public function change_seller_request(){\r\n\t\tif ($this->checkLogin('A') == ''){\r\n\t\t\tredirect('admin');\r\n\t\t}else {\r\n\t\t\t$mode = $this->uri->segment(4,0);\r\n\t\t\t$user_id = $this->uri->segment(5,0);\r\n\t\t\t$status = ($mode == '0')?'Rejected':'Approved';\r\n\t\t\t$newdata = array('status' => $status);\r\n\t\t\t\r\n\t\t\t$condition = array('id' => $user_id);\r\n\t\t\t$this->seller_model->update_details(STORE_CLAIMS,$newdata,$condition);\r\n\t\t\t$this->setErrorMessage('success','Claim Request '.$status.' Successfully');\r\n\t\t\tredirect('admin/seller/display_seller_requests');\r\n\t\t}\r\n\t}", "function invite()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tlogout_invalid_user($this);\n\t\t\n\t\t# user has submitted the invitation\n\t\tif(!empty($_POST)){\n\t\t\t$response = $this->_tender->invite($_POST);\n\t\t\t$msg = (!empty($response) && $response['boolean'])? 'The Invitation for Bids/Quotations has been sent.' :'ERROR: The Invitation for Bids/Quotations could not be sent.';\n\t\t\t\n\t\t\t$this->native_session->set('__msg',$msg);\n\t\t}\n\t\telse if(!empty($data['a'])){\n\t\t\t$data['msg'] = $this->native_session->get('__msg');\n\t\t\t$data['area'] = 'refresh_list_msg';\n\t\t\t$this->load->view('addons/basic_addons', $data);\n\t\t}\n\t\telse {\n\t\t\t$data['tender'] = $this->_tender->details($data['d']);\n\t\t\t$data['invited'] = $this->_tender->invitations($data['d']);\n\t\t\t$this->load->view('tenders/invite', $data);\n\t\t}\n\t}", "public function allowAction()\n\t{\trequire_once( 'form.inc' );\n\n\t\tif( $this->_getParam('user') )\n\t\t{\tif( $this->db->allowRefund($this->_getParam('user')) )\n\t\t\t{\n\t\t\t}else\n\t\t\t{\n\t\t\t}\n\t\t}\n\n\t\t// Calculate the number for the past term\n\t\t$term = (date('Y') - 1900) * 10 + floor((date('m') - 1) / 4) * 4 + 1;\n\t\tif( $term % 10 == 1 )\n\t\t{\t$term -= 2;\n\t\t}else\n\t\t{\t$term -= 4;\n\t\t}\n\n\t\t// Add list of people who already have been enabled\n\t\t$this->view->user_allowed = implode( \", \", $this->db->getRefunds('REGULAR', $term));\n\n\t\t// Add list of users who got their refunds last term\n\t\t$this->view->user_options = $this->db->getRefunds('RECEIVED', $term);\n\t}", "public function actionInactivarCodigoPresupuestario()\r\n {\r\n\r\n $idCodigo = yii::$app->request->get('value');\r\n $_SESSION['idCodigo'] = $idCodigo; \r\n\r\n $inactivar = self::beginSave(\"inactivar\", 0);\r\n\r\n if($inactivar == true){\r\n return MensajeController::actionMensaje(200);\r\n }else{\r\n return MensajeController::actionMensaje(920);\r\n } \r\n\r\n }", "function onAction_agent_trojan()\n {\n $bAskPasscode = true;\n $code = false;\n\n $this->set('ask_passcode', false);\n\n if (isset($_POST['passcode']))\n {\n $code = $_POST['passcode'];\n }\n else if (isset($_GET['passcode']))\n {\n $code = $_GET['passcode'];\n }\n\n if ($code === PASSCODE_TROJAN)\n {\n $bAskPasscode = false;\n }\n\n if ($bAskPasscode === true)\n {\n // no passcode set or wrong, so must ask user\n $this->m_bRender = true;\n $this->set('ask_passcode', true);\n }\n else\n {\n // do some actions...\n\n // finally... redirect to main page\n $this->redirect('/');\n }\n }" ]
[ "0.7187119", "0.6100319", "0.60615253", "0.59057015", "0.5810766", "0.57556725", "0.57522696", "0.5577939", "0.5527407", "0.54940474", "0.5476214", "0.54071695", "0.5388103", "0.5370138", "0.5369711", "0.5364064", "0.5304792", "0.52655905", "0.5226043", "0.5216448", "0.52159953", "0.5189949", "0.5187196", "0.5186569", "0.517876", "0.51646864", "0.5154256", "0.5152338", "0.5138586", "0.51383847", "0.51308054", "0.5119587", "0.5096821", "0.50743186", "0.50643635", "0.5030961", "0.50202525", "0.50201744", "0.5004733", "0.49885336", "0.49569103", "0.49511442", "0.49297577", "0.49224326", "0.49224326", "0.49217746", "0.49151108", "0.49052936", "0.48971158", "0.489066", "0.48878577", "0.48809215", "0.4879567", "0.4874562", "0.48731518", "0.48709455", "0.48667607", "0.48665395", "0.48601", "0.48572", "0.48567358", "0.48535898", "0.48524523", "0.48499623", "0.4836747", "0.48185825", "0.48150054", "0.48127338", "0.48024574", "0.4802022", "0.4787559", "0.47789708", "0.47726923", "0.47676578", "0.47528663", "0.47463506", "0.4740974", "0.4740832", "0.4739815", "0.47378004", "0.4732027", "0.47291648", "0.4717099", "0.47142154", "0.47141808", "0.47126397", "0.47092316", "0.47012442", "0.47006243", "0.46984598", "0.46947744", "0.46912408", "0.46904346", "0.46864843", "0.46785682", "0.4678559", "0.46723112", "0.46683726", "0.46671584", "0.46660373" ]
0.62114716
1
actionid: rejectbyhrd actiondesc: Rejecting the izin by HRD
public function actionRejectByHrd($id){ $model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all(); foreach ($model as $m) { $m->status_by_hrd = 4; $m->status_by_atasan = 4; $m->status_by_wr2 = 4; } if($m->save()){ \Yii::$app->messenger->addErrorFlash("Permohonan Izin telah di-reject oleh HRD"); return $this->redirect(['index-by-hrd']); } else { return $this->render('viewByHrd', [ 'model'=>$model ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function rejectAction()\n\t{\trequire_once( 'form.inc' );\n\n\t\tif( $this->_getParam('user') && $this->_getParam('user_reason') )\n\t\t{\t// TODO: validate and write entry to database\n\t\t\t// TODO: add success message to view\n\t\t\tif( $this->db->rejectRefund( $this->_getParam('user'), $this->_getParam('user_reason') ) )\n\t\t\t{\n\t\t\t}else\n\t\t\t{\n\t\t\t}\n\t\t}\n\n\t\t// TODO: If the refunds period has closed, parse request logs against refund list, update rejected users\n\t\t$this->view->user_options = $this->db->getRefunds('REQUESTED');\n\t}", "public function testRejectSuccessForHr() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES,\n\t\t\t'prefix' => 'hr'\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$url = '/hr/deferred/reject/3';\n\t\t$this->testAction($url, $opt);\n\t\t$this->checkFlashMessage(__('The deferred save has been %s.', __('rejected')));\n\t\t$result = $this->Controller->Deferred->find('list', ['recursive' => -1]);\n\t\t$expected = [\n\t\t\t1 => '1',\n\t\t\t2 => '2',\n\t\t\t4 => '4',\n\t\t\t5 => '5',\n\t\t];\n\t\t$this->assertData($expected, $result);\n\t}", "public function reject() {\n }", "public function testRejectInvalidIdForHrAndAdmin() {\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES => 'hr',\n\t\t\tUSER_ROLE_USER | USER_ROLE_ADMIN => 'admin',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'reject',\n\t\t\t\t'1000',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkFlashMessage(__('Invalid ID for deferred save'));\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "function rejectAction(Request $request) {\n $resource = $this->findOr404($request);\n $arrangementProgramManager = $this->getArrangementProgramManager();\n\n if (!$arrangementProgramManager->isAllowToApprove($resource)) {\n throw $this->createAccessDeniedHttpException();\n }\n $observation = $request->get('observation');\n if (empty($observation)) {\n $this->flashHelper->setFlash('error', 'error_observation');\n } else {\n $resource->setStatus(ArrangementProgram::STATUS_REJECTED);\n $this->addObservation($resource, $observation);\n\n $user = $this->getUser();\n $details = $resource->getDetails();\n $details\n ->setRejectedBy($user)\n ->setRejectedDate(new DateTime());\n\n $this->domainManager->dispatchEvent('pre_rejected', new ResourceEvent($resource));\n\n $this->domainManager->update($resource);\n $this->flashHelper->setFlash('success', 'rejected');\n\n $this->domainManager->dispatchEvent('post_rejected', new ResourceEvent($resource));\n }\n return $this->redirectHandler->redirectTo($resource);\n }", "function reject_dispute(){\n\t\t$disputeId = $this->uri->segment(4);\n\n\t\t$condition = array('id' => $disputeId);\n\n\t\t$data = array('status' =>'Reject');\n\t\t\n\t\t$this->review_model->update_details(DISPUTE,$data,$condition);\n\n\n\t\t$this->setErrorMessage('success','Dispute rejected successfully');\n\t\tredirect('admin/dispute/display_dispute_list');\n\n\t}", "public function testRejectDenyNotHrAndAdmin() {\n\t\t$this->setExpectedException('MissingActionException');\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER => '',\n\t\t\tUSER_ROLE_USER | USER_ROLE_SECRETARY => 'secret',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'reject',\n\t\t\t\t'3',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkIsNotAuthorized();\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "public function reject()\n {\n return $this->setStatus(self::STATUS_REJECTED);\n }", "public function do_reject(Request $request, $id){\n\n\n $leave = Leave::find($id);\n\n if(auth::id() == $leave->supervisor_id){\n\n $leave->supervisor_action = 2;\n $leave->current_position = 0;\n $leave->leave_status = 2;\n $leave->leave_message = \"Rejected by Supervisor\";\n $leave->reject_comment = $request->comment;\n $leave->rejected_by = Auth::id();\n\n $leave->save();\n\n\n\n $action = WorkflowAction::create([\n\n 'type' => 'leave',\n 'user_id' =>Auth::id(),\n 'post_id' => $id,\n 'status' => 'rejected',\n 'comments' => 'Rejected by Supervisor',\n 'position' => 'Supervisor',\n 'sent_to' => 162\n\n ]);\n\n /////////////////////////////////////////////send notification to users\n $toHr1 = User::find(162);\n $toHr2 = User::find(168);\n $torequester = User::find($leave->user_id);\n $toreliever = User::find($leave->reliever_id);\n\n /*auth()->user()->notify(new LeaveNotification($leave));\n $toHr1->notify(new LeaveNotification($leave));\n $toHr2->notify(new LeaveNotification($leave));\n $torequester->notify(new LeaveNotification($leave));*/\n\n\n $message_requester = \"Your \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been declined by \".User::find($leave->supervisor_id)->display_name.\". - \".$request->comment.\"\";\n\n $message_suppervisor = \" You have rejected \".User::find($leave->user_id)->display_name.\"\n \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application. Comment: \".$request->comment.\"\";\n\n $message_reliever = \"\".User::find($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been rejected by \".User::find($leave->supervisor_id)->display_name.\". Comment: \".$request->comment.\"\";\n\n /*$message_hr = \" \".User::find(auth::id())->display_name.\" needs your approval for\n \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave application.\";*/\n\n //send notification to users\n auth()->user()->notify(new LeaveNotification($leave,$message_suppervisor));\n /*$toHr1->notify(new LeaveNotification($leave,$message_hr));\n $toHr2->notify(new LeaveNotification($leave,$message_hr));*/\n $torequester->notify(new LeaveNotification($leave,$message_requester));\n $toreliever->notify(new LeaveNotification($leave,$message_reliever));\n\n // fire leavePublished event after post is successfully added to database\n\n\n //sending email staff\n $link = route('leave.show', ['id' => $leave->id]);\n $title = \"Your Leave Request\";\n $button_title = \"Click to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->user_id)->display_name.\"\",\"\".User::find( $leave->user_id)->user_email.\"\",$message_requester,$link,$title,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n //sending email reliever\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->reliever_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->user_email.\"\",$message_reliever,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n //sending email manager\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to Approve / Decline\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->supervisor_id)->user_email.\"\",$message_suppervisor,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n\n //end of send email\n\n\n\n\n\n // event(new leavePublished($post));\n\n return response()->json(['result'=>'1','message'=> \"You have rejected \".User::find\n ($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) leave application. \"]);\n\n } elseif((auth::id() == '162') || (auth::id() == '168') || (auth::id() == '182')) {\n\n\n $leave->hr_action = 2;\n $leave->current_position = 4;\n $leave->leave_status = 4;\n $leave->leave_message = \"Rejected by HR\";\n $leave->reject_comment = $request->comment;\n $leave->rejected_by = Auth::id();\n\n $leave->save();\n\n\n\n $action = WorkflowAction::create([\n\n 'type' => 'leave',\n 'user_id' =>Auth::id(),\n 'post_id' => $id,\n 'status' => 'rejected',\n 'comments' => 'Rejected by HR',\n 'position' => 'HR',\n 'sent_to' => 162\n\n ]);\n\n\n\n //send notification to users\n $toHr1 = User::find(162);\n $toHr2 = User::find(168);\n $torequester = User::find($leave->user_id);\n $toreliever = User::find($leave->reliever_id);\n $tosupervisor = User::find($leave->supervisor_id);\n\n /*auth()->user()->notify(new LeaveNotification($leave));\n $toHr1->notify(new LeaveNotification($leave));\n $toHr2->notify(new LeaveNotification($leave));\n $torequester->notify(new LeaveNotification($leave));*/\n\n\n $message_requester = \"Your \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been declined by \".User::find(auth::id())->display_name.\". (HR). Comment - \".$request->comment.\"\";\n\n $message_suppervisor = \"\".User::find($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been declined by \".User::find(auth::id())->display_name.\" (HR). Comment - \".$request->comment.\"\";\n\n $message_reliever = \"\".User::find($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been declined by \".User::find(auth::id())->display_name.\" (HR). Comment - \".$request->comment.\"\";\n\n $message_hr = \" \".User::find(auth::id())->display_name.\" declined \".User::find($leave->user_id)->display_name.\"\n \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application. Comment - \".$request->comment.\"\";\n\n //send notification to users\n //auth()->user()->notify(new LeaveNotification($leave,$message_suppervisor));\n $toHr1->notify(new LeaveNotification($leave,$message_hr));\n $toHr2->notify(new LeaveNotification($leave,$message_hr));\n $torequester->notify(new LeaveNotification($leave,$message_requester));\n $toreliever->notify(new LeaveNotification($leave,$message_reliever));\n $tosupervisor->notify(new LeaveNotification($leave,$message_suppervisor));\n\n // fire leavePublished event after post is successfully added to database\n // event(new leavePublished($post));\n\n // fire leavePublished event after post is successfully added to database\n // event(new leavePublished($post));\n\n //sending email staff\n $link = route('leave.show', ['id' => $leave->id]);\n $title = \"Your Leave Request\";\n $button_title = \"Click to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->user_id)->display_name.\"\",\"\".User::find( $leave->user_id)->user_email.\"\",$message_requester,$link,$title,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n //sending email reliever\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->reliever_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->user_email.\"\",$message_reliever,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n //sending email manager\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to Approve / Decline\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->supervisor_id)->user_email.\"\",$message_suppervisor,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n //sending email HR\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to Approve / Decline \";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $hr_email = \"[email protected]\";\n $this->send_email(\"HR\",$hr_email,$message_hr,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n\n\n\n return response()->json(['result'=>'1','message'=> \"You have rejected \".User::find\n ($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) leave application. \"]);\n\n }else{\n\n return response()->json(['result'=>'0','message'=> \"You are not authorized\"]);\n\n }\n\n\n\n\n\n }", "public function reject() {\n\t\t$query = array(\n\t\t\t'group' => $this->group->createReference(),\n\t\t\t'invitee' => $this->candidate->createReference(),\n\t\t);\n\t\t$invite = EpicDb_Mongo::db('invitation')->fetchOne($query);\n\t\tif($invite) $invite->delete();\n\t\t// Reject this application\n\t\t$this->status = \"rejected\";\n\t\t$this->save();\n\t}", "public function reject($id)\n {\n $interview = Interview::findOrFail($id);\n\n $interview->update([\n 'status' => 'rejected'\n ]);\n }", "function rejectServRequest(){\n $serv_ID=$this->uri->segment(3);\n echo $this->router->fetch_method();\n if ($this->deliveryAndPickupModel->rejectRequest($serv_ID)) {\n echo \"<script>alert('Successfully rejected');window.location.href='\".site_url('page/rider').\"';</script>\";\n }\n else\n {\n echo \"<script>alert('Something when wrong');window.location.href='\".site_url('page/rider').\"';</script>\";\n }\n\n\t}", "public function reject()\n {\n $this->channel->basic_reject(\n $this->tag(),\n true\n );\n }", "public function reject( $id ) {\n\t\treturn ( new TripController() )->destroy( $id );\n\t}", "public function discard($id) {\n $data = array(\n \"status\" => \"discarded\"\n );\n $this->db->where(\"id\", $id);\n $this->db->update(\"violations\", $data);\n }", "public function testRejectEmptyIdForHrAndAdmin() {\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES => 'hr',\n\t\t\tUSER_ROLE_USER | USER_ROLE_ADMIN => 'admin',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'reject',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkFlashMessage(__('Invalid ID for deferred save'));\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "public function rejectInvitation()\n\t{\n\t\t$id = $this->request->data['id'];\n\t\t$invite['MeetingUser']['id'] = $id;\n\t\t//set status 1 as accepted\n\t\t$invite['MeetingUser']['is_accept'] = 2;\n\t\t$invite['MeetingUser']['is_read'] = 1;\n\t\t$invite['MeetingUser']['is_attend'] = 0;\n\t\t//set notification\n\t\t$oldCount1 = $this->Session->read('oldMeetingCount');\n\t\tif ($oldCount1>0) {\n\t\t\t$newCount1 = $oldCount1-1;\n\t\t\t$this->Session->write('oldMeetingCount',$newCount1);\n\t\t}\n\t\tif($this->MeetingUser->save($invite))\n\t\t\techo \"1\";\n\t\telse\n\t\t\techo \"0\";\n\t\texit;\n\t}", "public function reject()\n {\n if ($this->withdrawal->status == Withdrawal::STATUS_CREATED) {\n // update withdrawal model\n $this->withdrawal->status = Withdrawal::STATUS_REJECTED;\n $this->withdrawal->save();\n // create a credit transaction on user account to return funds\n $accountService = new AccountService($this->withdrawal->account);\n $accountService->transaction($this->withdrawal, $this->withdrawal->amount);\n }\n }", "public function getRejected();", "public function rejected()\n {\n $this->setStatus(self::STATUS_REJECTED);\n }", "public function testApproveInvalidIdForHrAndAdmin() {\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES => 'hr',\n\t\t\tUSER_ROLE_USER | USER_ROLE_ADMIN => 'admin',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'approve',\n\t\t\t\t'1000',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkFlashMessage(__('Invalid ID for deferred save'));\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "public function reject($id)\n {\n //Mengambil session admin\n $id_user = $this->session->userdata('id_user');\n\n //Melakukan update data ticket dengan mengubah status ticket menjadi 0, data ditampung ke dalam array '$data' yang nanti akan diupdate dengan query\n $data = array(\n 'status' => 0,\n 'last_update'=> date(\"Y-m-d H:i:s\")\n );\n\n //Melakukan insert data tracking ticket bahwa ticket di-reject oleh admin, data tracking ke dalam array '$datatracking' yang nanti akan di-insert dengan query\n $datatracking = array(\n 'id_ticket' => $id,\n 'tanggal' => date(\"Y-m-d H:i:s\"),\n 'status' => \"Ticket Rejected\",\n 'deskripsi' => \"\",\n 'id_user' => $id_user\n );\n\n //Query untuk melakukan update data ticket sesuai dengan array '$data' ke tabel ticket\n $this->db->where('id_ticket', $id);\n $this->db->update('ticket', $data);\n\n //Query untuk melakukan insert data tracking ticket sesuai dengan array '$datatracking' ke tabel tracking\n $this->db->insert('tracking', $datatracking);\n }", "private function rejectOrder($order){\r\n $this->log('Rejecting order #'.$order->get_order_number());\r\n $this->addOrderNote($order, 'La orden fue rechazada por Flow');\r\n $order->update_status('failed');\r\n }", "public function reject_invoice()\n\t{\n\t\tif ($_SERVER['REQUEST_METHOD'] === 'POST') {\n\t\t\tif (isset($_POST)) {\n\t\t\t\t$id = base64_decode($_POST['id']);\n\t\t\t\t$remark = validateInput($_POST['reason']);\n\t\t\t\tif ($remark != '' && $remark != null) {\n\t\t\t\t\t$tableName = 'master_invoice';\n\t\t\t\t\t$condition = array('send_status' => SENT, 'id' => $id);\n\t\t\t\t\t$result = $this->CustomModel->selectAllFromWhere($tableName, $condition);\n\t\t\t\t\tif ($result > 0) {\n\t\t\t\t\t\t$data = array('send_status' => REJECTED, 'reject_reason' => $remark);\n\t\t\t\t\t\t$res = $this->CustomModel->update_table($tableName, $condition, $data);\n\t\t\t\t\t\tif ($res > 0) {\n\t\t\t\t\t\t\techo $response = json_encode(array('message' => 'Success! Invoices rejected', 'type' => 'success'), true);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo $response = json_encode(array('message' => 'Error! Opps... Contact IT', 'type' => 'error'), true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\techo $response = json_encode(array('message' => 'Error! Reject reason is required..', 'type' => 'danger'), true);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\techo $response = json_encode(array('message' => 'Error! Opps... Something went wrong, contact IT', 'type' => 'danger'), true);\n\t\t\t}\n\t\t}\n\t}", "function reject( $booking_ids ){\n\t\treturn $this->set_status(2, $booking_ids);\n\t}", "public function handleDeclineInvite($iid) {\n\t\tCourseListModel::declineInvite($iid);\n\t\t$this->redirect('this');\n\t}", "public function rejectR(Request $request, $id)\n {\n //\n $data = rider::where('Rider_ID', $id)->get();\n $reason = $request->Reason;\n DB::select(\"UPDATE riders set Reason = '$reason' , Rider_Status = 'REJECTED' where Rider_ID = ?\",[$id]);\n $data = DB::select(\"SELECT * FROM riders WHERE Rider_Status = 'PENDING'\");\n $message = \"Rider registration rejected.\";\n echo \"<script type='text/javascript'>alert('$message');</script>\";\n return view('ManageAccount.RegistrationListInterface', compact(\"data\"));\n \n \n }", "private static function reject($args, $invite, $auth) {\n $values = array(\n 'id'=>$invite['id'],\n 'deleted' => 't'\n );\n $s = submission_builder::build_submission($values, array('model' => 'group_invitation'));\n $r = data_entry_helper::forward_post_to('group_invitation', $s, $auth['write_tokens']);\n hostsite_show_message(lang::get(\"OK, thanks anyway. We've removed your invitation to join this group.\"));\n hostsite_goto_page($args['groups_page_path']);\n return '';\n }", "public function reject_complaint($id)\n {\n $output['token'] = $this->security->get_csrf_hash();\n header('Content-Type: application/json');\n $output['response'] = $this->database->_update_to_table('tbl_reports', array('status' => 2), array('id' => $id));\n $output = html_escape($this->security->xss_clean($output));\n exit(json_encode($output));\n }", "public function reject($taskid)\n {\n\t\t$task = task::find($taskid);\n\t\t\t\t\t\t\n\t\t$task->completed = 2; // to changes task status as rejected\n\t\t$task->isCommited = 0; // to reset committed flag\n $task->save();\n\t\t\n $users = task::find($taskid)->students->first()->user;\t// to get user details who belongs task\n\t\t\n\t\t$info = [\n\t\t\t'email' => $users->email,\n\t\t\t'name' => $users->name,\n\t\t\t'subject' => 'Task Reject',\n\t\t\t];\n\t\t$data = ['taskName' => $task->name]; // to send name of task in mail view\n\t\t// to sent mail to user whose task is rejected\n\t\tMail::send('mail_template.notifyTaskReject', $data, function ($message) use ($info) {\n\t\t\t$message->to($info['email'], $info['name'])\n\t\t\t->subject($info['subject']);\n\t\t});\n\t\techo \"Task Rejected and Rejection Email has been sent\";\n }", "public function actionAcceptByHrd($id){\n $model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all();\n\n foreach ($model as $m) {\n $m->status_by_hrd = 6;\n }\n\n if($m->save()){\n \\Yii::$app->messenger->addSuccessFlash(\"Permohonan Izin telah di-accept oleh HRD\");\n return $this->redirect(['index-by-hrd']);\n } else {\n return $this->render('viewByHrd', [\n 'model'=>$model\n ]);\n }\n }", "public function reject( int $tender_id )\n {\n $tender = Tender::findOrFail($tender_id);\n $canceledStatus = CanceledStatus::first();\n\n $tender->status()->associate(TenderCanceledStatus::first());\n $tender->application->status()->associate($canceledStatus);\n $tender->tenderRefresh->status()->associate($canceledStatus);\n $tender->push();\n\n return $this->resource(\n $tender->refresh()\n );\n\n }", "public function reject()\n {\n $url = URIResource::Make($this->path, array($this->id));\n $data = new DataPacket(array(\"state\" => CALL_STATES::rejected));\n $this->client->post($url, $data->get());\n\n return Constructor::Make($this, $data->get());\n }", "public static function reject(){\n if(ModelBenevole::isOrga($_SESSION['login'], $_GET['IDFestival'])){\n ModelBenevole::reject($_GET['IDBenevole'], $_GET['IDFestival']); //appel au modèle pour gerer la BD\n $controller = 'benevole';\n $view = 'demandesorga';\n $pagetitle = 'Liste des demandes Organisateur';\n require_once (File::build_path(array('view','view.php'))); //\"redirige\" vers la vue\n }else{\n $controller = 'benevole';\n $view = 'error';\n $pagetitle = 'Vous n\\'avez pas les droits ';\n }\n }", "public function rejectTimesheet() {\n $id = request('timesheetId');\n $notes = request('notes');\n Timesheet::find($id)->update([\n 'status'=>'rejected',\n 'notes'=>$notes\n ]);\n return back();\n }", "public function createRejected($reason);", "public function reject()\n {\n $type = $this->input->get('type');\n $id = $this->input->get('id');\n\n $this->model_review->reject($type, $id);\n\n redirect($_SERVER['HTTP_REFERER']);\n }", "public static function reject($id)\n {\n return Order::where('id',$id)\n ->update(['status'=>'CANCELLED']);\n }", "public function cancelMyReserved($id);", "public static function reject() {\n return new Reject('Not match Atom in []');\n }", "public function testRejectValidIdGetForHrAndAdmin() {\n\t\t$this->setExpectedException('MethodNotAllowedException');\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES => 'hr',\n\t\t\tUSER_ROLE_USER | USER_ROLE_ADMIN => 'admin',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'GET',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'reject',\n\t\t\t\t'4',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t}\n\t}", "function getReject(){\n //check for the requested invitation available or not\n // $get_invite_id=$this->validateInvitationSecret();\n $invitation=MedicalGroupInvitation::find('all',array('conditions' => array('(user_id=? or email=?) and secret=? and active=1',$this->user_id,$this->email,$this->secret)));\n \n if(!empty($invitation)){\n foreach($invitation as $inv){\n $inv->status=\"REJECTED\";\n $inv->active=0;\n $inv->updated_on=time();\n $inv->save();\n }\n return TRUE;\n }\n else{\n return FALSE;\n }\n }", "public function reject_opportunity() {\n\t\tif($this->session->userdata('uid')){\n\t\t $user_id = $this->session->userdata('uid');\n\t\t $json = file_get_contents(\"php://input\");\n\t\t $data=json_decode($json);\n\n\t\t $op_id = $data->opportuniy_id;\n\t\t $stage_id = $data->stage_id;\n\t\t $opp_reject = $data->opp_reject;\n\t\t $remarks = $data->remarks;\n\t\t $status=array();\n\n\t\t $get_fromuser = \"\";\n\t\t $is_first_stage = $this->opp_sales->is_first_stage($stage_id);\n\n\t\t if ($is_first_stage == true) {\n\n\t\t \tif($opp_reject[0] == 'Ownership')\n\t\t \t{\n\t\t\t $check_assign= $this->opp_sales->assign_count($op_id);\n\t\t\t if($check_assign==true)\n\t\t\t {\n\t\t\t $status[0]=1;\n\t\t\t }\n\n\t\t\t //---------------- notification code----------------------------------\n\t\t $get_fromuser= $this->opp_sales->get_from_userid($op_id);\n\t\t //to user---- is the one who is to be notified.\n\t\t // from user---- is the one who performs action\n\t\t $dt = date('ymdHis');\n\t\t $notify_id= uniqid($dt);\n\t\t $remarks=\"reject of opp from executive module\";\n\t\t $getusername=$this->opp_mgr->getusernamae($get_fromuser);\n\t\t $getusername1=$this->opp_mgr->getusernamae($user_id);\n\t\t \t\t$data2= array(\n\t\t \t\t\t'notificationID' =>$notify_id,\n\t\t \t\t\t'notificationShortText'=>'Opportunity Rejected',\n\t\t \t\t\t'notificationText' =>'Opportunity Rejected by '.$getusername1.' given by '.$getusername ,\n\t\t \t\t\t'from_user'=>$user_id,\n\t\t \t\t\t'to_user'=>$get_fromuser,\n\t\t \t\t\t'action_details'=>'Opportunity',\n\t\t \t\t\t'notificationTimestamp'=>$dt,\n\t\t \t\t\t'read_state'=>0,\n\t\t \t\t\t'remarks'=>$remarks,\n\t\t \t\t);\n\n\t\t \t\tif($get_fromuser!=\"\"){\n \t\t$get_fromuser= $this->opp_sales->rej_opp_notification($data2);\n \t\t\t }\n\t\t \t}\n if($opp_reject[1] == 'Stage_Ownership')\n\t\t \t{\n\n\t\t\t\t\t\t$check_assign_stage= $this->opp_sales->assign_count_stage($op_id);\n\t\t\t\t\t\tif($check_assign_stage==true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$status[1]=1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//---------------- notification code----------------------------------\n\t\t\t\t\t\t$get_fromuser= $this->opp_sales->get_from_userid($op_id);\n\t\t\t\t\t\t//to user---- is the one who is to be notified.\n\t\t\t\t\t\t// from user---- is the one who performs action\n\t\t\t\t\t\t$dt = date('ymdHis');\n\t\t\t\t\t\t$notify_id= uniqid($dt);\n\t\t\t\t\t\t$remarks=\"reject of opp from executive module\";\n\t\t\t\t\t\t$getusername=$this->opp_mgr->getusernamae($get_fromuser);\n\t\t\t\t\t\t$getusername1=$this->opp_mgr->getusernamae($user_id);\n\t\t\t\t\t\t$data2= array(\n\t\t\t\t\t\t'notificationID' =>$notify_id,\n\t\t\t\t\t\t'notificationShortText'=>'Opportunity Stage Rejected',\n\t\t\t\t\t\t'notificationText' =>'Opportunity Stage Rejected by '.$getusername1.' given by '.$getusername ,\n\t\t\t\t\t\t'from_user'=>$user_id,\n\t\t\t\t\t\t'to_user'=>$get_fromuser,\n\t\t\t\t\t\t'action_details'=>'Opportunity',\n\t\t\t\t\t\t'notificationTimestamp'=>$dt,\n\t\t\t\t\t\t'read_state'=>0,\n\t\t\t\t\t\t'remarks'=>$remarks,\n\t\t\t\t\t\t);\n\t\t \t}\n\n\t\t \tif($get_fromuser!=\"\"){\n $get_fromuser= $this->opp_sales->rej_opp_notification($data2);\n \t\t}\n\n\n\t\t }\n\t\t else {\n\t\t \t$check_state= $this->opp_sales->check_state($op_id,$opp_reject);\n\t\t\t if(isset($check_state['Ownership'])){\n\t\t\t $check_assign= $this->opp_sales->assign_count($op_id);\n\t\t\t if($check_assign==true){\n\t\t\t $status[0]=1;\n\t\t\t }\n\n\t\t\t\t //---------------- notification code----------------------------------\n\t\t $get_fromuser= $this->opp_sales->get_from_userid($op_id);\n\t\t //to user---- is the one who is to be notified.\n\t\t // from user---- is the one who performs action\n\t\t $dt = date('ymdHis');\n\t\t $notify_id= uniqid($dt);\n\t\t $remarks=\"reject of opp from executive module\";\n\t\t $getusername=$this->opp_mgr->getusernamae($get_fromuser);\n\t\t $getusername1=$this->opp_mgr->getusernamae($user_id);\n\t\t \t\t$data2= array(\n\t\t \t\t\t'notificationID' =>$notify_id,\n\t\t \t\t\t'notificationShortText'=>'Opportunity Rejected',\n\t\t \t\t\t'notificationText' =>'Opportunity Rejected by '.$getusername1.' given by '.$getusername ,\n\t\t \t\t\t'from_user'=>$user_id,\n\t\t \t\t\t'to_user'=>$get_fromuser,\n\t\t \t\t\t'action_details'=>'Opportunity',\n\t\t \t\t\t'notificationTimestamp'=>$dt,\n\t\t \t\t\t'read_state'=>0,\n\t\t \t\t\t'remarks'=>$remarks,\n\t\t \t\t);\n\n\t\t \t\tif($get_fromuser!=\"\"){\n \t\t$get_fromuser= $this->opp_sales->rej_opp_notification($data2);\n \t\t\t }\n\n\t\t\t }\n\t\t\t if(isset($check_state['Stage_Ownership'])){\n\t\t\t\t\t$check_assign_stage= $this->opp_sales->assign_count_stage($op_id);\n\t\t\t\t\tif($check_assign_stage==true){\n\t\t\t $status[1]=1;\n\t\t\t }\n\n\t \t\t //---------------- notification code----------------------------------\n\t\t $get_fromuser= $this->opp_sales->get_from_userid($op_id);\n\t\t //to user---- is the one who is to be notified.\n\t\t // from user---- is the one who performs action\n\t\t $dt = date('ymdHis');\n\t\t $notify_id= uniqid($dt);\n\t\t $remarks=\"reject of opp from executive module\";\n\t\t $getusername=$this->opp_mgr->getusernamae($get_fromuser);\n\t\t $getusername1=$this->opp_mgr->getusernamae($user_id);\n\t\t \t\t$data2= array(\n\t\t \t\t\t'notificationID' =>$notify_id,\n\t\t \t\t\t'notificationShortText'=>'Opportunity Stage Rejected',\n\t\t \t\t\t'notificationText' =>'Opportunity Stage Rejected by '.$getusername1.' given by '.$getusername ,\n\t\t \t\t\t'from_user'=>$user_id,\n\t\t \t\t\t'to_user'=>$get_fromuser,\n\t\t \t\t\t'action_details'=>'Opportunity',\n\t\t \t\t\t'notificationTimestamp'=>$dt,\n\t\t \t\t\t'read_state'=>0,\n\t\t \t\t\t'remarks'=>$remarks,\n\t\t \t\t);\n\n\t\t\t\t\tif($get_fromuser!=\"\"){\n\t\t\t\t\t\t$get_fromuser= $this->opp_sales->rej_opp_notification($data2);\n\t\t\t\t\t}\n\t\t\t }\n\t\t }\n\n //---------------------------------------------------------end -----------------\n\t\t echo json_encode($status);\n\n\t\t} else {\n\t\t\tredirect('indexController');\n\t\t}\n\t}", "public function reject(callable $c);", "public function rejectInvitation($id){\n\n $invite = Invitation::find($id);\n $invite->delete();\n return redirect()->back();\n }", "public function ajaxDeclineRequest()\n\t{\n\t\t$request = FriendshipRequest::declineRequest(Input::get('id'));\n\t\treturn array('error' => 0);\n\t}", "public function actionRejectByAtasan($id, $redback=null){\n $model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all();\n\n foreach ($model as $m) {\n $m->status_by_atasan = 4;\n $m->status_by_wr2 = 4;\n }\n\n if($m->save()){\n \\Yii::$app->messenger->addSuccessFlash(\"Permohonan Izin telah di-reject oleh Atasan\");\n if(is_null($redback))\n return $this->redirect(['index-by-atasan']);\n else\n return $this->redirect(Yii::$app->request->referrer);\n } else {\n return $this->render('viewByAtasan', [\n 'model'=>$model\n ]);\n }\n }", "function declineJob($postData)\n\t\t{\n\t\t\t//update the accept flag\n\t\t\t$update_1 = $this->manageContent->updateValueWhere(\"award_info\",\"is_declined\",1,\"bid_id\",$postData['bid']);\n\t\t\t$update_2 = $this->manageContent->updateValueWhere(\"award_info\",\"result_date\",date('Y-m-d g:i:s'),\"bid_id\",$postData['bid']);\n\t\t\t\n\t\t\tif( $update_1 == 1 && $update_2 == 1 )\n\t\t\t{\n\t\t\t\t//get the bid information\n\t\t\t\t$bid_details = $this->manageContent->getValue_where('bid_info','*','bid_id',$postData['bid']);\n\t\t\t\t\n\t\t\t\t//get the project details on which bid is made\n\t\t\t\t$project_details = $this->manageContent->getValue_where(\"project_info\",\"*\",\"project_id\",$bid_details[0]['project_id']);\n\t\t\t\t\n\t\t\t\t//get contractor details\n\t\t\t\t$con_details = $this->manageContent->getValue_where('user_info', '*', 'user_id', $bid_details[0]['user_id']);\n\t\t\t\t//getting employer details\n\t\t\t\t$emp_details = $this->getEmailIdFromUserId($project_details[0]['user_id']);\n\t\t\t\t//sending mail to employer\n\t\t\t\t$this->mailSent->mailForDecliningJob($emp_details[0], $emp_details[1], $con_details[0]['name'], $project_details[0]['title']);\n\t\t\t\t\n\t\t\t\techo \"Successfully declined.\";\n\t\t\t}\n\t\t}", "public function destroy(HDpriority $hDpriority)\n {\n $finance_bank = FinanceBank:: find($id);;\n $finance_bank->delete();\n return redirect()->back()->with('successMSG', 'عملیات حذف اطلاعات با موفقیت انجام شد.');\n }", "public function reject($requests) {\n foreach ($requests as $teacher_id) {\n $this->deleteFromRequest($teacher_id);\n }\n}", "function rejectRecord(){ \n\n // No need to read the list of participants when processing those tabs\n if ($this->current_tab_does_not_need_applicants()) return True;\n\n $reply = False;\n $dbg_text = '';\n if (is_object($this->b_tabs)){\n $active_tab_index = $this->b_tabs->active_tab();\n $tabs = array_values($this->tabs_toShow);\n $reply = (strpos($tabs[$active_tab_index],'bList') !== False);\n $dbg_text = 'b_Tabs';\n }\n\n $this->v = Null;\n if (!$reply && empty($this->av)) switch ($this->doing){\n\t\n case '2excel':\n\tif (bForm_vm_Visit::_getStatus($this->rec) != STATUS_YES) return True;\n case 'photos':\n\tif (bForm_vm_Visit::_getStatus($this->rec) == STATUS_NO) return True;\n case 'budget':\n case 'myguests':\n case 'budget_byProjects':\n\tbreak;\n\t\n case 'lists':\n\tif (bForm_vm_Visit::_getStatus($this->rec) == STATUS_NO){\n\t if (VM_organizer_here && VM::$e->isEventEndorsed()){\n\t $dbg_text = $this->rec['av_firstname'].' '.$this->rec['av_lastname'].' - After the approval do not show the refused applicants to the organizers';\n\t $reply = True;\n\t }\n\t}\n case 'show_mails_exchange':\n\tif (!cnf_dev && $this->rec['v_type'] === VISIT_TYPE_RENT){\n\t $dbg_text = 'VISIT_TYPE_RENT... to be completed';\n\t $reply = True;\n\t}elseif (empty(VM::$e)){\n\t // Visits outside conferences/programs\n\t if (!VM_administrator_here && ($this->rec['v_host_avid'] != @bAuth::$av->ID)){\n\t $dbg_text = 'not my visit';\n\t $reply = True;\n\t }else{\n\t // Guarantee the correct value of status&policy in the snapshot record\n\t if (empty($this->rec['v_status'])){\n\t $this->v = loader::getInstance_new('bForm_vm_Visit',$this->rec['v_id'],'fatal');\n\t $this->rec['v_status'] = $this->v->getStatus();\n\t $this->rec['v_policy'] = $this->v->getValue('v_policy',True);\n\t }\n\t }\n\t}\n }\n if ($reply) $this->dbg($dbg_text);\n return $reply;\n }", "public function actionPrihodit($id = null) \n {\n \t// vyhod nepovoleny pristup, pokud uzivatel nema prava zajemce a pokud jemu pridelene id_nemovitosti se neshoduje s id nemovitosti\n if (!$this->user->isAllowed('drazba','prihodit') || ($id != $this->user->identity->id_nemovitost))\n throw new Nette\\Application\\ForbiddenRequestException(); \n }", "public function handleRejectEvent(object $message): void;", "public function reject($id)\n {\n //\n $data = rider::where('Rider_ID', $id)->get();\n return view('ManageAccount.RejectRegistrationInterface', compact(\"data\"));\n }", "public function rejectInvitation() {\n\t\t$this->autoRender = false;\n\t\t$communityId = $this->request->data['communityId'];\n\t\t$community = $this->Community->findById($communityId);\n\t\tif (!empty($community)) {\n\t\t\t$userId = $this->Auth->user('id');\n\t\t\t$this->CommunityMember->reject($communityId, $userId);\n\t\t\t//Community unfollow data\n\t\t\t$followCommunityData = array(\n\t\t\t\t'type' => FollowingPage::COMMUNITY_TYPE,\n\t\t\t\t'page_id' => $communityId,\n\t\t\t\t'user_id' => $userId\n\t\t\t);\n\t\t\t$this->FollowingPage->unFollowPage($followCommunityData);\n\t\t\t$this->Session->setFlash(__('The invitation has been rejected.'), 'success');\n\t\t} else {\n\t\t\t$this->Session->setFlash(__($this->invalidMessage), 'error');\n\t\t}\n\t}", "private function btn_approve_reject(){\n\n // Skip the unduly cases\n if ($not_my_case = (VM::outOfScope()\n\t\t\t|| !$this->isWritable() \n\t\t\t|| ($this->rec['v_type'] == VISIT_OUT_OF_SCOPE) \n\t\t\t|| !in_array($this->doing,array('lists','budget',)) \n\t\t\t)){\n $this->dbg('not my case? '.($not_my_case ? 'YES' : 'NO'));\n return array('','');\n }\n\n // The event is endorsed (i.e. changes are locked), show only pending applicants and return\n if(0) if (VM::isEventEndorsed() || ($this->rec['v_end'] < time())){\n\tif (False){ // ? Strange... To be changed?\n\t $reply = array('');\n\t if ($this->fnc_beslut) $reply[] = $this->highlights['fnc'][$this->fnc_beslut]['i'];\n\t else $reply[] = '';\n\t if (stripos(serialize($reply),'send mail') !== False) b_debug::var_dump('fnc_beslut',$this->fnc_beslut,date('Y-m-d',$this->rec['v_end']),$reply);\n\t if (stripos(serialize($reply),'send mail') !== False) b_debug::internalError();\n\t}else{ \n\t $reply = array('','');\n\t}\n\t// $t = $reply; array_unshift($t,2,$this->rec['v_id']); $this->dbg($t,True);\n\treturn $reply;\n }\n\n bTiming()->cpu(__function__);\n\n // \n // See what should we do, depends on the visit status \n //\n $reply = array('','');\n $v_status = bForm_vm_Visit::_getStatus($this->rec,$check_clashes=True);\n switch($v_status){\n \n case STATUS_CLASH:\n break;\n\n case STATUS_NO: \n $this->rec['_a_name'] = $this->rec['_o_name'] = '';\n switch ($this->rec['v_type']){\n case VISIT_TYPE_RENT:\n case VISIT_OUT_OF_SCOPE:\n\tbreak;\n\t\n case VISIT_TYPE_OTHER:\n case VISIT_TYPE_COLLABORATION:\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$reply = (VM::hasRightTo('approve_guest_invitation',$this->v)\n\t\t ? array('','') \n\t\t : array('',$this->say('Ni')));\n\tbreak;\n\t\n case VISIT_TYPE_PROGRAM: \n\t$reply = (VM::hasRightTo('approve_registrant_application')\n\t\t ? array('',$this->say('NY'))\n\t\t : array('',$this->say('Ni')));\n }\n break;\n \n case STATUS_PENDING:\n if (@$this->rec['_a_name'] !== LODGING_OA_TXT) $this->rec['_a_name'] = $this->rec['_o_name'] = '';\n switch ($this->rec['v_type']){\n case VISIT_TYPE_RENT: // auto-accept the rents\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$this->v->setStatus(STATUS_YES);\n\t$this->v->setPolicy(VM_V_welcomeMailSent,True,False,True);\n\t$this->rec['v_status'] = STATUS_YES;\n\tbreak;\n\t\n case VISIT_OUT_OF_SCOPE:\n\tbreak 2;\n\t\n case VISIT_TYPE_OTHER:\n case VISIT_TYPE_COLLABORATION:\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$reply = (VM::hasRightTo('approve_guest_invitation',$this->v)\n\t\t ? array('','') \n\t\t : array('',$this->say('Pi')));\n\tbreak;\n\t\n case VISIT_TYPE_PROGRAM: \n\t$reply = (VM::hasRightTo('approve_registrant_application')\n\t\t ? array($this->say('Y'),\n\t\t\t $this->say('N'))\n\t\t : array('',$this->say('Pi')));\n\tbreak;\n\t\n default:\n\tb_debug::internalError('?? v_type=\"'.$this->rec['v_type'].'\"');\n }\n break;\n \n case STATUS_YES:\n switch ($this->rec['v_type']){\n case VISIT_OUT_OF_SCOPE:\n\tbreak;\n\n case VISIT_TYPE_RENT:\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$this->v->setPolicy(VM_V_welcomeMailSent,True,False,True);\n\t$this->rec['v_policy'] = $this->v->getValue('v_policy',1,1);\n\tbreak;\n\n case VISIT_TYPE_OTHER:\n case VISIT_TYPE_COLLABORATION:\n\tif (!$this->v) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$reply = (VM::hasRightTo('approve_guest_invitation',$this->v)\n\t\t ? array('','') \n\t\t : array('',$this->say('Yi')));\n\tbreak;\n\t\n case VISIT_TYPE_PROGRAM: \n\t$reply = (VM::hasRightTo('approve_registrant_application')\n\t\t ? array('',$this->say('YN'))\n\t\t : array('',$this->say('Yi')));\n\tbreak;\n }\n }\n bTiming()->cpu();\n // $t = $reply; array_unshift($t,3,$this->rec['v_id']); $this->dbg($t,True);\n return $reply;\n }", "public function rejectInvite($inviterID) {\n\t\treturn ConnectionFactory::DeleteRowFromTable(\"agencies\", array('user_one_id'=>$inviterID, \n\t\t\t\t'user_two_id'=>$this->id));\n\t}", "public function actionRejectByWr2($id){\n $model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all();\n\n foreach ($model as $m) {\n $m->status_by_wr2 = 4;\n }\n\n if($m->save()){\n \\Yii::$app->messenger->addErrorFlash(\"Permohonan Izin telah di-reject oleh WR 2\");\n return $this->redirect(['index-by-wr2']);\n } else {\n return $this->render('viewByWr2', [\n 'model'=>$model\n ]);\n }\n }", "public static function reject() {\n return new Reject('Not match Organic Subset');\n }", "public function rejectAction() {\n\n //CHECK AUTH\n if( !$this->_helper->requireUser()->isValid() ) return;\n\n //PROCESS\n $viewer = Engine_Api::_()->user()->getViewer();\n \n //GET THE SITEPAGE ID FROM THE URL\n $page_id = $this->_getParam('page_id');\n $sitepage = Engine_Api::_()->getItem('sitepage_page', $page_id);\n\n //MAKE FORM\n $this->view->form = $form = new Sitepagemember_Form_Member();\n $form->setTitle('Reject Page Invitation');\n $form->setDescription('Would you like to reject the invitation for this page?');\n $form->submit->setLabel('Reject Page Invitation');\n \n //PROCESS FORM\n if( !$this->getRequest()->isPost() ) {\n $this->view->status = false;\n $this->view->error = true;\n $this->view->message = Zend_Registry::get('Zend_Translate')->_('Invalid Method');\n return;\n }\n\n if( !$form->isValid($this->getRequest()->getPost()) ) {\n $this->view->status = false;\n $this->view->error = true;\n $this->view->message = Zend_Registry::get('Zend_Translate')->_('Invalid Data');\n return;\n }\n\n\t\tif (!empty($page_id)) {\n\t\t\n\t\t\t//DELETE THE RESULT FORM THE TABLE.\n\t\t\tEngine_Api::_()->getDbtable('membership', 'sitepage')->delete(array('resource_id =?' => $page_id, 'user_id =?' => $viewer->getIdentity()));\n\t\t}\n\t\t\n $this->view->status = true;\n $this->view->error = false;\n $message = Zend_Registry::get('Zend_Translate')->_('You have ignored the invite to the page %s');\n $message = sprintf($message, $sitepage->__toString());\n $this->view->message = $message;\n\n if( null === $this->_helper->contextSwitch->getCurrentContext() ) {\n return $this->_forwardCustom('success', 'utility', 'core', array(\n 'messages' => array($message),\n 'layout' => 'default-simple',\n \n 'parentRefresh' => true,\n ));\n }\n }", "public function reject(Request $request, $id)\n {\n $leave_record = LeaveRecord::find($id);\n $staff_id = $leave_record->staff_id;\n $user = DB::table('users')->where('username',$staff_id)->first();\n\n $data = [\n 'staff_name' => $user->full_name,\n 'man_name' => Auth::user()->full_name,\n 'staff_email' => $user->email,\n 'man_email' => Auth::user()->email,\n ];\n Mail::send(new LeaveRejectMail($data));\n\n /**\n * Check if the leave_record is not the\n * current authenticated leave_record\n */\n $date_current = Carbon::now()->toDateTimeString();\n\n $leave_record->status = $request->input('status');\n $leave_record->status_date = $date_current;\n $leave_record->save();\n return redirect('/my_leave_tasks')->with('info','Selected Leave Request has been Rejected!');\n }", "function delete_rejectproject($projectid){\n\tglobal $DB;\n\t$msg = \"\";\n\t$atalvar = get_atalvariables();\n\t$course = $DB->get_record('course',array('id'=>$projectid),'id,startdate,enddate,visible');\n\tif($course->startdate==0 && $course->visible==0 && $course->enddate==0){\n\t\t//Project is Rejected by Atal Incharge...Delete it.\n\t\tdelete_innovation($course->id);\n\t\t$msg=\"<p>This Innovation is Rejected, It will Be Deleted From \".$atalvar['sitename'].\"</p>\";\n\n\t\trecord_projectlog($course,'delete',\"Innovation deleted after rejected by school\");\n\t}\n\treturn $msg;\n}", "public function rejectTerms(){\n $db = DB::prepare('Delete FROM accept_terms WHERE user_id = ?');//Status 1 == accepted\n return $db->execute(array($this->id));\n }", "public function reject($mixed = null) {\n\t\t$validParameters = array(\n\t\t\t'(orderv2\\reject)',\n\t\t);\n\t\t$args = func_get_args();\n\t\t$this->_checkArguments($args, $validParameters);\n\t\treturn $this->__soapCall('reject', $this->make_soap_params($mixed));\n\t}", "public function testDeleteInvalidIdForHrAndAdmin() {\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES => 'hr',\n\t\t\tUSER_ROLE_USER | USER_ROLE_ADMIN => 'admin',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'delete',\n\t\t\t\t'1000',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkFlashMessage(__('Invalid ID for deferred save'));\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "public function reject(array $messages);", "function hook_commerce_adyen_refund_rejected(\\Commerce\\Adyen\\Payment\\Transaction\\Refund $transaction, \\stdClass $order) {\n\n}", "function reject_leave($data) {\n global $conn;\n\n $id = htmlspecialchars($data['id_cuti']);\n $pesan = htmlspecialchars($data['pesan']);\n\n $query = \"UPDATE cuti\n SET pesan = '$pesan',\n status = 'rejected'\n WHERE id_cuti = '$id'\";\n\n mysqli_query($conn, $query);\n \n return mysqli_affected_rows($conn);\n \n\n //APPROVE LEAVE END\n // mysqli_query($conn, $quer \"UPDATE cuti SET status = 'rejected' WHERE id_cuti = $id\");\n }", "public function reject(...$arguments): self {\n return $this->end(self::STATE_REJECTED, $this->_failed, $arguments);\n }", "public static function rejectAssignedRecord($requesterName, $requesterEmail, $acknowledged, $accepted, $rejected, $rejectedReason, $id, $uid, $eid, $aid, $lid = null)\n {\n $ret = false;\n \n if($accepted === true || $rejected === true || empty($rejectedReason)) {\n // We do not reject a request that has already been either\n // accepted, or rejected!\n return $ret;\n }\n \n // Ok, we do two things\n $sql = \"UPDATE event_request \"\n . \"SET status_id = (SELECT s.id FROM event_request_status s WHERE s.name = 'REJECTED'), \"\n . \" updated_on = NOW(), \"\n . \" updated_by_id = :uid, \";\n \n if($acknowledged === false) {\n $sql .= \" acknowledger_id = :uid, \"\n . \" acknowledged_on = NOW(), \";\n }\n \n $sql .= \" rejector_id = :uid, \"\n . \" rejected_on = NOW(),\"\n . \" rejected_reason = :reason \"\n . \" WHERE id = :id \"\n . \" AND event_id = :eid \";\n \n if($acknowledged === false) {\n $sql .= \" AND acknowledger_id IS NULL \";\n }\n \n $sql .= \" AND accepter_id IS NULL \"\n . \" AND rejector_id IS NULL \"\n . \" AND event_id IN (SELECT e.id \"\n . \" FROM event e \"\n . \" INNER JOIN arena a \"\n . \" ON e.arena_id = a.id \"\n . \" INNER JOIN arena_user_assignment aua \"\n . \" ON a.id = aua.arena_id \"\n . \" INNER JOIN user u \"\n . \" ON u.id = aua.user_id \";\n \n if($lid !== null) {\n $sql .= \" INNER JOIN location l \"\n . \" ON l.arena_id = a.id \";\n }\n \n $sql .= \" WHERE e.id = :eid \"\n . \" AND a.id = :aid \"\n . \" AND u.id = :uid \";\n\n if($lid !== null) {\n $sql .= \" AND l.id = :lid \"\n . \" AND e.location_id = :lid \";\n }\n \n $sql .= \")\";\n \n $command = Yii::app()->db->createCommand($sql);\n \n $command->bindParam(':reason', $rejectedReason, PDO::PARAM_STR);\n $command->bindParam(':id', $id, PDO::PARAM_INT);\n $command->bindParam(':uid', $uid, PDO::PARAM_INT);\n $command->bindParam(':eid', $eid, PDO::PARAM_INT);\n $command->bindParam(':aid', $aid, PDO::PARAM_INT);\n \n if($lid !== null) {\n $command->bindParam(':lid', $lid, PDO::PARAM_INT);\n }\n \n // Since we are updating, we are going to do this in a transaction\n // in case something catastrophic, such as more than one row being\n // updated, happens.\n \n $transaction = Yii::app()->db->beginTransaction();\n\n try\n {\n // Just update the record and if more than one row affected\n // we will roll back the transaction and return false!\n $count = $command->execute();\n \n if($count != 1) {\n $ret = false;\n } else {\n $ret = true;\n }\n \n if($ret == false) {\n $transaction->rollback();\n \n return $ret;\n }\n \n // Ok, we have successfully acknowledged this request,\n // send the requester an e-mail letting them know of this\n $ret = EventRequest::sendEmail(array(\"Rejected\", $rejectedReason) , $requesterName, $requesterEmail, $id, $uid, $eid, $aid, $lid);\n \n if($ret !== true) {\n throw new CHttpException(500, $ret);\n } else {\n $transaction->commit();\n }\n }\n catch(Exception $e)\n {\n if($transaction->active == true) {\n $transaction->rollback();\n }\n\n if($e instanceof CDbException) {\n throw $e;\n } elseif($e instanceof CHttpException) {\n throw $e;\n }\n\n $errorInfo = $e instanceof PDOException ? $e->errorInfo : null;\n $message = $e->getMessage();\n throw new CDbException(\n 'Failed to execute the SQL statement: ' . $message,\n (int)$e->getCode(),\n $errorInfo\n );\n }\n \n return $ret;\n }", "public function testApproveEmptyIdForHrAndAdmin() {\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES => 'hr',\n\t\t\tUSER_ROLE_USER | USER_ROLE_ADMIN => 'admin',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'approve',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkFlashMessage(__('Invalid ID for deferred save'));\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "public function actionDelete($id) {\n if (User::userIsAllowedTo('Submit back to office report')) {\n $model = $this->findModel($id);\n if ($model->delete()) {\n $audit = new AuditTrail();\n $audit->user = Yii::$app->user->id;\n $audit->action = \"Removed BtOR report from the system.\";\n $audit->ip_address = Yii::$app->request->getUserIP();\n $audit->user_agent = Yii::$app->request->getUserAgent();\n $audit->save();\n Yii::$app->session->setFlash('success', \"BtOR report was successfully removed.\");\n } else {\n Yii::$app->session->setFlash('error', \"BtOR report could not be removed. Please try again!\");\n }\n return $this->redirect(['index']);\n } else {\n Yii::$app->session->setFlash('error', 'You are not authorised to perform that action.');\n return $this->redirect(['home/home']);\n }\n }", "function eliminarHerrajeaccesorio(){\n\t\t$this->procedimiento='snx.ft_herrajeaccesorio_ime';\n\t\t$this->transaccion='SNX_HAC_ELI';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_herrajeaccesorio','id_herrajeaccesorio','int4');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}", "public function actionDelete($id)\n {\n $model= $this->findModel($id);\n $model->status=PostAd::STATUS_REJECTED;\n $model->save();\n\n return $this->redirect(Yii::$app->request->referrer);\n }", "public function rejectRequest($teamId, $login) {\n dibi::query(\"DELETE FROM team_requests WHERE login=%s\", $login, \"AND team=%i\", $teamId);\n }", "public function disapprove(EventDisapproveAttendancePost $request, $id)\n {\n $eventParticipant = EventParticipant::findOrFail($id);\n\n\n /*\n | @Begin Transaction\n |---------------------------------------------*/\n \\DB::beginTransaction();\n\n\n /* Disapprove the event participant */\n if($eventParticipant->disapprove($request->input('reason'))) {\n\n $event = $eventParticipant->event;\n $user = $eventParticipant->participant;\n\n \n /* Notify the user */\n $user->notify(new EventParticipantWasDisapproved($event, $user, $request->input('reason')));\n\n\n /*\n | @End Transaction\n |---------------------------------------------*/\n \\DB::commit();\n\n\n return response()->json([\n 'response' => 1,\n 'status' => $eventParticipant->status,\n 'message' => $eventParticipant->renderStatus(),\n ]);\n }\n\n return response()->json([\n 'response' => 0,\n 'message' => 'There seems to be a problem disapproving the request'\n ]); \n }", "public function testReject() {\n\t\t$array = array(1, 2, 3);\n\t\t$result = _::reject($array, function($value) {\n\t\t\treturn ($value < 4);\n\t\t});\n\t\t$this->assertInternalType('array', $array);\n\t\t$this->assertCount(0, $result);\n\n\t\t// test rejecting down to odd elements\n\t\t$result = _::reject($array, function($value) {\n\t\t\treturn (2 == $value);\n\t\t});\n\t\t$this->assertInternalType('array', $array);\n\t\t$this->assertCount(2, $result);\n\t\t$this->assertEquals(1, $result[0]);\n\t\t$this->assertEquals(3, $result[2]);\n\t}", "public function testApproveDenyNotHrAndAdmin() {\n\t\t$this->setExpectedException('MissingActionException');\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER => '',\n\t\t\tUSER_ROLE_USER | USER_ROLE_SECRETARY => 'secret',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'approve',\n\t\t\t\t'3',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkIsNotAuthorized();\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "function ticket_close($d){\n $url = $this->url.\"ticket_close\";\n $data['case_id'] =$d['case_id'] ;\n $data['action'] =$d['action'] ;\n $data['comfirm_closed_reason'] =$d['comfirm_closed_reason'] ;\n $data['submitter'] =$d['submitter'] ;\n $this->setTransactionToLog(\"method:\".__METHOD__);\n $result = $this->_exec($url,$data);\n }", "function logger_firmware_upgrade_disapprove($device) {\n\n logger_remove_firmware_upgrade_request($device);\n\n drupal_set_message('The firmware upgrade has been rejected.', 'warning');\n\n drupal_goto(\"energy\");\n}", "public function cleanInvalidScheduleAction(){\n \t$sql = new Frogg_Db_Sql('SELECT `rage_id` FROM `newseries` WHERE `flag` = '.Application_Model_NewSeries::INVALID);\n \t$ids = array();\n \tif($sql->rows()){\n \t\twhile($row=$sql->fetch()){\n \t\t\tarray_push($ids, $row['rage_id']);\n \t\t}\n \t}\n \t$ids = implode(',', $ids);\n \t\n \t$sql = new Frogg_Db_Sql('DELETE FROM `scheduled` WHERE `rage_id` IN ('.$ids.')');\n \tdie;\n }", "public function rejectTransaction($id, $employee_id) {\n $stmt = $this->conn->stmt_init ();\n $stmt->prepare ( \"call rejectTransaction (?, ?)\" );\n $stmt->bind_param ( 'ii', $id, $employee_id );\n $stmt->execute ();\n \n return $stmt->get_result ();\n }", "public static function rejectMessage($id) {\n $que = \"UPDATE message SET is_approved = 'N' where id = '{$id}'\";\n $gets = mysql_query($que);\n return $gets;\n }", "function rejectBooking($disputeId,$booking_no,$cancel_booking_id)\n\t{\n\t\t\t\n\t\t\t$condition = array('id' => $disputeId,'cancel_status' => $cancel_booking_id);\n\t\t\t$data = array('status' =>'Reject');\n\t\t\t$ok = $this->review_model->update_details(DISPUTE,$data,$condition);\n\t\t\n\t\t\t/* Mail to Guest Start*/\t\n $newsid='58';\n\t\t\t$template_values=$this->review_model->get_newsletter_template_details($newsid);\n\n\t\t\tif($template_values['sender_name']=='' && $template_values['sender_email']==''){\n\t\t\t\t$sender_email=$this->data['siteContactMail'];\n\t\t\t\t$sender_name=$this->data['siteTitle'];\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$sender_name=$template_values['sender_name'];\n\t\t\t\t$sender_email=$template_values['sender_email'];\n\t\t\t} \n \t\t\n\t\t$getdisputeDetails = $this->review_model->get_all_details(DISPUTE,$condition);\n\t\t\n\t\t/*GetHostDetails*/\n\t\t$condition = array (\n\t\t'id' => $getdisputeDetails->row()->disputer_id\n\t\t);\n\t\t$hostDetails = $this->review_model->get_all_details( USERS, $condition );\n\t\t\n\t\t$uid = $hostDetails->row ()->id;\n\t\t$hostname = $hostDetails->row()->user_name;\n\t\t$host_email = $hostDetails->row()->email;\n\t\t\n\t\t\n\t\t/*GetCustomerDetails*/\n\t\t$condition = array (\n\t\t'id' => $getdisputeDetails->row()->user_id\n\t\t);\n\t\t\n\t\t$custDetails = $this->review_model->get_all_details( USERS, $condition );\n\t\t$cust_name = $custDetails->row()->user_name;\n\t\t$email = $custDetails->row()->email;\n\t\t\n\t\t/*GetProductDetails*/\n\t\t$condition = array (\n\t\t'id' => $getdisputeDetails->row()->prd_id\n\t\t);\n\t\t$prdDetails = $this->review_model->get_all_details( PRODUCT, $condition );\n\t\t$prd_title = $prdDetails->row()->product_title;\n\t\t\n $email_values = array(\n\t\t\t\t\t'from_mail_id'=>$sender_email,\n\t\t\t\t\t'to_mail_id'=> $email,\n\t\t\t\t\t'subject_message'=>$template_values ['news_subject'],\n\t\t\t\t\t'body_messages'=>$message\n\t\t\t); \n\t\t\t\n\t\t\t$reg= array('host_name' => $hostname,'cust_name'=>$cust_name,'prd_title'=>$prd_title,'logo' => $this->data['logo']);\t\n $message = $this->load->view('newsletter/ToGuestRejectCancelBooking'.$newsid.'.php',$reg,TRUE);\n\t\t\t\n /*send mail*/\n $this->load->library('email',$config);\n $this->email->from($email_values['from_mail_id'], $sender_name);\n $this->email->to($email_values['to_mail_id']);\n $this->email->subject($email_values['subject_message']);\n $this->email->set_mailtype(\"html\");\n $this->email->message($message); \n\t\t\t\t\t\t\n\t\t\t\t try{\n\t\t\t\t\t$this->email->send();\n\t\t\t\t\t$returnStr ['msg'] = 'Successfully registered';\n\t\t\t\t\t\t$returnStr ['success'] = '1';\n\t\t\t\t\t}catch(Exception $e){\n\t\t\t\t\techo $e->getMessage();\n\t\t\t\t\t} \n \n /* Mail to Guest End*/\n\t\t\n\t\t\techo 'success';\n\t\t\t$this->setErrorMessage('success','Cancel booking rejected successfully');\n\t\t\tredirect('admin/dispute/cancel_booking_list');\t\t\t\t\n\t}", "function remove_aborted($pId=0) \n {\n // check the the actual user can really do this\n if ( !((galaxia_user_can_clean_instances()) || (galaxia_user_can_clean_aborted_instances())) )\n {\n $this->error[] = tra('user is not authorized to delete aborted instances');\n return false;\n }\n if (!(pId))\n {\n $whereand = '';\n $bindvars = array('aborted');\n }\n else\n {\n $whereand = 'and wf_p_id = ?';\n $bindvars = array('aborted', $pId);\n }\n $query=\"select `wf_instance_id` from `\".GALAXIA_TABLE_PREFIX.\"instances` where `wf_status`=?\".$whereand;\n // start a transaction\n $this->db->StartTrans();\n $result = $this->query($query,$bindvars);\n while($res = $result->fetchRow()) \n { \n $iid = $res['wf_instance_id'];\n $query = \"delete from `\".GALAXIA_TABLE_PREFIX.\"instance_activities` where `wf_instance_id`=?\";\n $this->query($query,array($iid));\n $query = \"delete from `\".GALAXIA_TABLE_PREFIX.\"workitems` where `wf_instance_id`=?\";\n $this->query($query,array($iid)); \n }\n $query = \"delete from `\".GALAXIA_TABLE_PREFIX.\"instances` where `wf_status`=?\".$whereand;\n $this->query($query,$bindvars);\n // perform commit (return true) or Rollback (return false)\n return $this->db->CompleteTrans();\n }", "public function reject_article($request)\n {\n $this->status_id = 4;\n\n if($this->update()) {\n $message = new Article_Reject_Messages;\n $message->article_id = $this->id;\n $message->text = $request['reason'];\n if($message->save()){\n Session::flash('flash_message_text', 'Статья была успешно отклонена');\n Session::flash('flash_message_class', 'success');\n if(Auth::user()->user_type == 4) return redirect('/dashboard/administrator/moderation_list');\n return redirect('/dashboard/moderator/moderation_list');\n }\n else {\n Session::flash('flash_message_text', 'Ошибка создания сообщения');\n Session::flash('flash_message_class', 'danger');\n if(Auth::user()->user_type == 4) return redirect('/dashboard/administrator/moderation_list');\n return redirect('/dashboard/moderator/moderation_list');\n }\n\n }\n else {\n Session::flash('flash_message_text', 'Ошибка отклонения статьи');\n Session::flash('flash_message_class', 'danger');\n return back();\n }\n }", "function eventAlertOptOutFormAction()\r\n\t{\t\t\r\n\t\tif(isset($_POST['EVENT_ALERT_OPTOUT'])){\r\n\t\t\t// VALIDATION\r\n\t\t\t$error = 0;\r\n\t\t\tif($_POST['email'] == \"\"){ $error=1; }\r\n\t\t\tif(VerifyEmail($_POST['email']) != 1){ $error=1; }\r\n\t\t\t\r\n\t\t\t// SUCCESSFUL VALIDATION\r\n\t\t\tif($error == 0){\r\n\t\t\t\t$_POST = escape_smart_array($_POST);\r\n\t\t\t\t$select = \t\"DELETE FROM blog_alert WHERE \".\r\n\t\t\t\t\t\t\t\"email='\".$_POST['email'].\"' \".$_SETTINGS['demosqland'].\"\";\r\n\t\t\t\t$result = \tdoQuery($select);\r\n\t\t\t\t$report = \"Email Removed Successsfully.\";\r\n\t\t\t\theader(\"Location: ?BLOGALERTREMOVE=1&page_id=\".$_REQUEST['page_id'].\"&CID=\".$_REQUEST['CID'].\"&BID=\".$_REQUEST['BID'].\"&report=\".$report.\"&success=1\");\r\n\t\t\t\texit();\r\n\t\t\t} else {\r\n\t\t\t\t$report = \"Please enter all *required information.\";\r\n\t\t\t\t$success = \"0\";\r\n\t\t\t\theader(\"Location: ?BLOGALERTREMOVE=1&page_id=\".$_REQUEST['page_id'].\"&CID=\".$_REQUEST['CID'].\"&BID=\".$_REQUEST['BID'].\"&name=\".$_POST['name'].\"&email=\".$_POST['email'].\"&report=\".$report.\"&success=0\");\r\n\t\t\t\texit();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function removeOutbound($rId, $state)\r\n {\r\n //pokupi informacije requesta da se mogu pobrisati dupli\r\n\r\n $sql=\"SELECT * FROM phone_order_outbound WHERE randomID='$rId' ORDER BY id DESC LIMIT 1\";\r\n $var=$this->conn->fetchAssoc($sql);\r\n\r\n $ime = $var['name'];\r\n $phone = $var['phone'];\r\n\r\n //BRISANJE REQUESTA PO ID-u\r\n $sql=\"DELETE FROM phone_order_outbound WHERE randomID='$rId' AND state = '$state' AND (phone_order_outbound.type = 6 OR phone_order_outbound.type = 9 OR phone_order_outbound.type = 7 OR phone_order_outbound.type = 8 OR phone_order_outbound.type = 10) LIMIT 1\";\r\n $this->conn->executeQuery($sql);\r\n\r\n // BRISANJE REQUESTA PO IMENU I BROJU\r\n $sql=\"DELETE FROM phone_order_outbound WHERE state = '$state' AND (`name`= '{$ime}' OR `phone` = '{$phone}') AND (phone_order_outbound.type = 6 OR phone_order_outbound.type = 7 OR phone_order_outbound.type = 8 OR phone_order_outbound.type = 9 OR phone_order_outbound.type = 10 OR phone_order_outbound.type = 11) AND `submitDate` > NOW() - INTERVAL 2 HOUR\";\r\n $this->conn->executeQuery($sql);\r\n\r\n\r\n\r\n $sql=\"SELECT * FROM phone_order_outbound WHERE randomID='$rId' ORDER BY id DESC LIMIT 1\";\r\n $var=$this->conn->fetchAssoc($sql);\r\n\r\n if(empty($var['id']))\r\n {\r\n echo 1;\r\n } else {\r\n echo -1;\r\n }\r\n }", "public function actionDecline()\n {\n $this->render('decline');\n }", "protected function abortAction($id)\n\t{\n\t\tif(Core::getUser()->get(\"umode\") || !$this->event)\n\t\t{\n\t\t\t$this->redirect(\"game/\".SID.\"/Research\");\n\t\t}\n\t\t$result = Core::getQuery()->select(\"construction\", array(\"buildingid\"), \"\", Core::getDB()->quoteInto(\"buildingid = ? AND mode = '2'\", $id));\n\t\tif($row = $result->fetchRow())\n\t\t{\n\t\t\t$result->closeCursor();\n\t\t\tHook::event(\"AbortResearch\", array($this));\n\t\t\tGame::getEH()->removeEvent($this->event->get(\"eventid\"));\n\t\t\t$this->redirect(\"game/\".SID.\"/Research\");\n\t\t}\n\t\t$result->closeCursor();\n\t\treturn $this;\n\t}", "public function sellerOrderReject(Request $request, $id){\n \\App::call('App\\Http\\Controllers\\OrderController@reject', [$id]);\n $orders = \\App::call('App\\Http\\Controllers\\OrderController@viewBySeller', [$request->user()->seller->id]);\n return view($request->view, compact('orders'));\n }", "public function discard()\n {\n $this->channel->basic_reject(\n $this->tag(),\n false\n );\n }", "public function actionVypisHistorieAukce($id = null) \n {\n if (!$this->user->isAllowed('drazba','vypisHistorie'))\n throw new Nette\\Application\\ForbiddenRequestException(); \n }", "function deny($reason) {\n $this->denied_reasons[] = $reason;\n }", "public function deleteAction(){\n\n\t\t$auth = Zend_Auth::getInstance();\n\t\tif($auth->hasIdentity())\n\t\t{\n\t\t\t\n\t\t\t$loginUserId = $auth->getStorage()->read()->id;\n\t\t}\n\t\t$id = $this->_request->getParam('id');\n\t\t$emp_id = $this->_request->getParam('emp_id');\n\t\t$messages['message'] = ''; $messages['msgtype'] = '';\n\t\t$messages['flagtype'] = '';\n\t\t$actionflag = 3;\n\t\tif($id)\n\t\t{\n\t\t\t\n\t\t\t$employeeadvancesModel = new Expenses_Model_Employeeadvances();\n\n\t\t\t//check employee has amount of select amount\n\t\t\t$getEmployeeBalance = $employeeadvancesModel->getEmpAdvanceSummary($emp_id);\n\t\t\t$total = !empty($getEmployeeBalance[0]['balance'])?$getEmployeeBalance[0]['balance']:0;\n\t\t\t\n\t\t\t$employeeAdvanceData = $employeeadvancesModel->getsingleEmployeeadvancesData($id,$type='advance');\n\t\t\t\n\t\t\t$employeebalance = !empty($employeeAdvanceData[0]['application_amount'])?$employeeAdvanceData[0]['application_amount']:0;\n\t\t\t\n\t\t\tif($total >= $employeebalance) //if employee has suffiecient amount to delete advance\n\t\t\t{\n\t\t\t\t$data = array('isactive'=>0,'modifieddate'=>gmdate(\"Y-m-d H:i:s\"));\n\t\t\t\t$data['modifiedby'] = $loginUserId;\n\t\t\t\t$where = array('id=?'=>$id);\n\t\t\t\t$id = $employeeadvancesModel->saveOrUpdateAdvanceData($data, $where);\n\t\t\t\tif($id == 'update')\n\t\t\t\t{\n\t\t\t\t\t//remove deleted advance amount from employee total advance amount\n\t\t\t\t\t$advancesummary = new Expenses_Model_Advancesummary();\n\t\t\t\t\t$emp_advance_summery = $advancesummary->getAdvanceDetailsById($emp_id);\n\t\t\t\t\t$totalsum = $emp_advance_summery[0]['total']-$employeebalance;\n\t\t\t\t\t$balence = $emp_advance_summery[0]['balance']-$employeebalance;\n\t\t\t\t\t$summerydata = array('total'=>$totalsum,\n\t\t\t\t\t\t\t\t\t'balance'=>$balence,\n\t\t\t\t\t\t\t\t\t 'modifiedby'=> $loginUserId,\n\t\t\t\t\t\t\t\t\t 'modifieddate' =>gmdate(\"Y-m-d H:i:s\")\n\t\t\t\t\t\t\t\t );\n\t\t\t\t\t$summeryWhere = array('employee_id=?'=>$emp_id); \n\t\t\t\t\t$insertSummey = $advancesummary->SaveAdvanceData($summerydata, $summeryWhere);\n\t\t\t\t\t\n\t\t\t\t\t$messages['message'] = 'advance deleted successfully.';\n\t\t\t\t\t$messages['msgtype'] = 'success';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$messages['message'] = 'advance cannot be deleted.';\n\t\t\t\t\t$messages['msgtype'] = 'error';\n\t\t\t\t}\n\t\t\t}else\n\t\t\t{\n\t\t\t\t$messages['message'] = 'advance cannot be deleted already used.';\n\t\t\t\t$messages['msgtype'] = 'error';\n\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t \n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$messages['message'] = 'advance cannot be deleted.';\n\t\t\t$messages['msgtype'] = 'error';\n\t\t}\n\t\t$this->_helper->json($messages);\n\n\t}", "public function reject_suggested_deal($id,&$msg){\n $q = \"delete from \".TP.\"transaction_suggestions_partners where suggestion_id='\".$id.\"'\";\n $result = mysql_query($q);\n if(!$result){\n return false;\n }\n\t\t\n\t\t$q = \"delete from \".TP.\"transaction_suggestions where id='\".$id.\"'\";\n $result = mysql_query($q);\n if(!$result){\n return false;\n }\n $msg = \"deleted\";\n return true;\n }", "public function destroy($id)\n {\n $getProject = Leave::find($id);\n \n if($getProject->status == 'rejected'){\n\n $getProject->delete();\n\n if( $getProject){\n return redirect()->route(\"leave.index\")->with(\"success\",\"Leave deleted successfully. \"); \n }else{\n return redirect()->route(\"leave.index\")->with(\"danger\",\"Unable to delete leave . \");\n }\n }else{\n return redirect()->route(\"leave.index\")->with(\"danger\",\"Unable to delete leave. It only delete when reject . \"); \n }\n \n }", "private function db_ignore_del_req($id)\n {\n RequestedTermination::find($id);\n $terminationRequest->delete;\n }", "public function treatmentSaveDraft2($risk_id, $suggested_rt, $risk, $impact, $actplan, $control, $objective, $uid)\n\t{\n\t\t//ubah2\n\t\t$risk_id_cek = $risk_id;\n\t\t$sql=\"select risk_existing_control from t_risk where risk_id = '$risk_id_cek' \";\n\t\t$query = $this->db->query($sql);\n\t\t$row = $query->row(); \n\t\t$hasil = $row->risk_existing_control;\n\t\tif($hasil != 'under'){\n\n\t\t$r_status = $risk['risk_status'];\n\t\t//update T-risk risk status sama switch_flag\n\t\t$sql = \"update t_risk set risk_status = '\".$r_status.\"', switch_flag='P' where risk_id = '\".$risk_id.\"' \";\n\t\t$res = $this->db->query($sql);\n\n\t\t$sql = \"update t_risk_impact set switch_flag='P' where risk_id = '\".$risk_id.\"' \";\n\t\t$res = $this->db->query($sql);\n\n\t\tif($suggested_rt == 'ACCEPT'){\n\n\t\t}else{\n\n\t\t\t$sql = \"update t_risk_action_plan set switch_flag='P' where risk_id = '\".$risk_id.\"' \";\n\t\t\t$res = $this->db->query($sql);\n\t\t}\n\n\t\t$sql = \"update t_risk_control set switch_flag='P' where risk_id = '\".$risk_id.\"' \";\n\t\t$res = $this->db->query($sql);\n\n\t\t$sql = \"update t_risk_objective set switch_flag='P' where risk_id = '\".$risk_id.\"' \";\n\t\t$res = $this->db->query($sql);\n\n/*\n\t\t$sql = \"delete from t_risk where risk_id = ? and switch_flag='P' \";\n\t\t$res = $this->db->query($sql, array('rid'=>$risk_id));\n\t\t\n\t\t$sql = \"delete from t_risk_impact where risk_id = ? and switch_flag='P' \";\n\t\t$res = $this->db->query($sql, array('rid'=>$risk_id));\n\t\t\n\t\t$sql = \"delete from t_risk_action_plan where risk_id = ? and switch_flag='P' \";\n\t\t$res = $this->db->query($sql, array('rid'=>$risk_id));\n\t\t\n\t\t$sql = \"delete from t_risk_control where risk_id = ? and switch_flag='P' \";\n\t\t$res = $this->db->query($sql, array('rid'=>$risk_id));\n\t\t\n\t\t$sql = \"insert into t_risk \n\t\t\t\tselect * from t_risk_change where risk_id = ? and switch_flag='P' \";\n\t\t$res = $this->db->query($sql, array('rid'=>$risk_id));\n\t\t\n\t\tif ($res) {\n\t\t\t// insert impact\n\t\t\t$sql = \"insert into t_risk_impact(risk_id, impact_id, impact_level, switch_flag) values(?, ?, ?, 'P')\";\n\t\t\tforeach ($impact as $key => $value) {\n\t\t\t\t$par = array(\n\t\t\t\t\t'rid' => $risk_id,\n\t\t\t\t\t'iid' => $value['impact_id'],\n\t\t\t\t\t'il' => $value['impact_level']\n\t\t\t\t);\n\t\t\t\t$res3 = $this->db->query($sql, $par);\n\t\t\t}\n\t\t\t\n\t\t\t// insert action plan\n\t\t\t$sql = \"insert into t_risk_action_plan(risk_id, action_plan_status, action_plan, due_date, division, switch_flag) \n\t\t\t\t\tvalues(?, 0, ?, ?, ?, 'P')\";\n\t\t\tforeach ($actplan as $key => $value) {\n\t\t\t\t$dd = implode('-', array_reverse( explode('-', $value['due_date']) ));\n\t\t\t\t$par = array(\n\t\t\t\t\t'rid' => $risk_id,\n\t\t\t\t\t'ap' => $value['action_plan'],\n\t\t\t\t\t'dd' => $dd,\n\t\t\t\t\t'div' => $value['division']\n\t\t\t\t);\n\t\t\t\t$res4 = $this->db->query($sql, $par);\n\t\t\t}\n\t\t\t\n\t\t\t// insert action plan\n\t\t\t$sql = \"insert into t_risk_control(\n\t\t\t\t\t\trisk_id, existing_control_id, risk_existing_control, \n\t\t\t\t\t\trisk_evaluation_control, risk_control_owner,switch_flag) \n\t\t\t\t\tvalues(?, ?, ?, ?, ?, 'P')\";\n\t\t\tforeach ($control as $key => $value) {\n\t\t\t\t$value['existing_control_id'] = $value['existing_control_id'] == '' || $value['existing_control_id'] == '0' ? null : $value['existing_control_id'];\n\t\t\t\t$par = array(\n\t\t\t\t\t'rid' => $risk_id,\n\t\t\t\t\t'ap' => $value['existing_control_id'],\n\t\t\t\t\t'dd' => $value['risk_existing_control'],\n\t\t\t\t\t'da' => $value['risk_evaluation_control'],\n\t\t\t\t\t'div' => $value['risk_control_owner']\n\t\t\t\t);\n\t\t\t\t$res5 = $this->db->query($sql, $par);\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\t*/\n\t\t\n\t\treturn $res;\n\t}\n\n\t}", "function reject(Transaction $transaction, $description)\n {\n return $this->addStatus($transaction,TransactionStatus::STATUS_REJECTED,$description);\n }" ]
[ "0.5979962", "0.59528494", "0.5618917", "0.5597563", "0.55412626", "0.55216956", "0.54665726", "0.5373148", "0.53549856", "0.53529334", "0.53248745", "0.5283008", "0.52739906", "0.5262473", "0.52505517", "0.52389973", "0.5234416", "0.52220976", "0.51656705", "0.5164191", "0.5159703", "0.5159101", "0.5149232", "0.5136543", "0.51270103", "0.5120222", "0.5105709", "0.5090954", "0.50790393", "0.5078929", "0.5076854", "0.50759625", "0.5062957", "0.502299", "0.5014753", "0.50072354", "0.50003093", "0.49996057", "0.4986958", "0.49728736", "0.4967883", "0.4956715", "0.49555665", "0.4934059", "0.49230117", "0.49190345", "0.4895704", "0.48945513", "0.48940256", "0.48901758", "0.48887992", "0.4887959", "0.4881845", "0.4879625", "0.48746815", "0.48665395", "0.48481405", "0.4809305", "0.480557", "0.48028883", "0.47997996", "0.47744903", "0.47601464", "0.47526675", "0.47472137", "0.4745823", "0.47349727", "0.47290295", "0.47248515", "0.46898302", "0.46742123", "0.46662676", "0.46640733", "0.46534306", "0.46386242", "0.4630114", "0.4627374", "0.46257874", "0.46188667", "0.46090692", "0.46082437", "0.4606342", "0.46057367", "0.45982423", "0.45856592", "0.4585245", "0.4570936", "0.45605502", "0.4554359", "0.45378596", "0.45201582", "0.4502493", "0.4500645", "0.45002073", "0.44975573", "0.44975528", "0.449218", "0.44905493", "0.44888884", "0.44848892" ]
0.65100855
0
actionid: rejectbyatasan actiondesc: Rejecting the izin by Supervisor
public function actionRejectByAtasan($id, $redback=null){ $model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all(); foreach ($model as $m) { $m->status_by_atasan = 4; $m->status_by_wr2 = 4; } if($m->save()){ \Yii::$app->messenger->addSuccessFlash("Permohonan Izin telah di-reject oleh Atasan"); if(is_null($redback)) return $this->redirect(['index-by-atasan']); else return $this->redirect(Yii::$app->request->referrer); } else { return $this->render('viewByAtasan', [ 'model'=>$model ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function reject() {\n }", "private function btn_approve_reject(){\n\n // Skip the unduly cases\n if ($not_my_case = (VM::outOfScope()\n\t\t\t|| !$this->isWritable() \n\t\t\t|| ($this->rec['v_type'] == VISIT_OUT_OF_SCOPE) \n\t\t\t|| !in_array($this->doing,array('lists','budget',)) \n\t\t\t)){\n $this->dbg('not my case? '.($not_my_case ? 'YES' : 'NO'));\n return array('','');\n }\n\n // The event is endorsed (i.e. changes are locked), show only pending applicants and return\n if(0) if (VM::isEventEndorsed() || ($this->rec['v_end'] < time())){\n\tif (False){ // ? Strange... To be changed?\n\t $reply = array('');\n\t if ($this->fnc_beslut) $reply[] = $this->highlights['fnc'][$this->fnc_beslut]['i'];\n\t else $reply[] = '';\n\t if (stripos(serialize($reply),'send mail') !== False) b_debug::var_dump('fnc_beslut',$this->fnc_beslut,date('Y-m-d',$this->rec['v_end']),$reply);\n\t if (stripos(serialize($reply),'send mail') !== False) b_debug::internalError();\n\t}else{ \n\t $reply = array('','');\n\t}\n\t// $t = $reply; array_unshift($t,2,$this->rec['v_id']); $this->dbg($t,True);\n\treturn $reply;\n }\n\n bTiming()->cpu(__function__);\n\n // \n // See what should we do, depends on the visit status \n //\n $reply = array('','');\n $v_status = bForm_vm_Visit::_getStatus($this->rec,$check_clashes=True);\n switch($v_status){\n \n case STATUS_CLASH:\n break;\n\n case STATUS_NO: \n $this->rec['_a_name'] = $this->rec['_o_name'] = '';\n switch ($this->rec['v_type']){\n case VISIT_TYPE_RENT:\n case VISIT_OUT_OF_SCOPE:\n\tbreak;\n\t\n case VISIT_TYPE_OTHER:\n case VISIT_TYPE_COLLABORATION:\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$reply = (VM::hasRightTo('approve_guest_invitation',$this->v)\n\t\t ? array('','') \n\t\t : array('',$this->say('Ni')));\n\tbreak;\n\t\n case VISIT_TYPE_PROGRAM: \n\t$reply = (VM::hasRightTo('approve_registrant_application')\n\t\t ? array('',$this->say('NY'))\n\t\t : array('',$this->say('Ni')));\n }\n break;\n \n case STATUS_PENDING:\n if (@$this->rec['_a_name'] !== LODGING_OA_TXT) $this->rec['_a_name'] = $this->rec['_o_name'] = '';\n switch ($this->rec['v_type']){\n case VISIT_TYPE_RENT: // auto-accept the rents\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$this->v->setStatus(STATUS_YES);\n\t$this->v->setPolicy(VM_V_welcomeMailSent,True,False,True);\n\t$this->rec['v_status'] = STATUS_YES;\n\tbreak;\n\t\n case VISIT_OUT_OF_SCOPE:\n\tbreak 2;\n\t\n case VISIT_TYPE_OTHER:\n case VISIT_TYPE_COLLABORATION:\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$reply = (VM::hasRightTo('approve_guest_invitation',$this->v)\n\t\t ? array('','') \n\t\t : array('',$this->say('Pi')));\n\tbreak;\n\t\n case VISIT_TYPE_PROGRAM: \n\t$reply = (VM::hasRightTo('approve_registrant_application')\n\t\t ? array($this->say('Y'),\n\t\t\t $this->say('N'))\n\t\t : array('',$this->say('Pi')));\n\tbreak;\n\t\n default:\n\tb_debug::internalError('?? v_type=\"'.$this->rec['v_type'].'\"');\n }\n break;\n \n case STATUS_YES:\n switch ($this->rec['v_type']){\n case VISIT_OUT_OF_SCOPE:\n\tbreak;\n\n case VISIT_TYPE_RENT:\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$this->v->setPolicy(VM_V_welcomeMailSent,True,False,True);\n\t$this->rec['v_policy'] = $this->v->getValue('v_policy',1,1);\n\tbreak;\n\n case VISIT_TYPE_OTHER:\n case VISIT_TYPE_COLLABORATION:\n\tif (!$this->v) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$reply = (VM::hasRightTo('approve_guest_invitation',$this->v)\n\t\t ? array('','') \n\t\t : array('',$this->say('Yi')));\n\tbreak;\n\t\n case VISIT_TYPE_PROGRAM: \n\t$reply = (VM::hasRightTo('approve_registrant_application')\n\t\t ? array('',$this->say('YN'))\n\t\t : array('',$this->say('Yi')));\n\tbreak;\n }\n }\n bTiming()->cpu();\n // $t = $reply; array_unshift($t,3,$this->rec['v_id']); $this->dbg($t,True);\n return $reply;\n }", "public function do_reject(Request $request, $id){\n\n\n $leave = Leave::find($id);\n\n if(auth::id() == $leave->supervisor_id){\n\n $leave->supervisor_action = 2;\n $leave->current_position = 0;\n $leave->leave_status = 2;\n $leave->leave_message = \"Rejected by Supervisor\";\n $leave->reject_comment = $request->comment;\n $leave->rejected_by = Auth::id();\n\n $leave->save();\n\n\n\n $action = WorkflowAction::create([\n\n 'type' => 'leave',\n 'user_id' =>Auth::id(),\n 'post_id' => $id,\n 'status' => 'rejected',\n 'comments' => 'Rejected by Supervisor',\n 'position' => 'Supervisor',\n 'sent_to' => 162\n\n ]);\n\n /////////////////////////////////////////////send notification to users\n $toHr1 = User::find(162);\n $toHr2 = User::find(168);\n $torequester = User::find($leave->user_id);\n $toreliever = User::find($leave->reliever_id);\n\n /*auth()->user()->notify(new LeaveNotification($leave));\n $toHr1->notify(new LeaveNotification($leave));\n $toHr2->notify(new LeaveNotification($leave));\n $torequester->notify(new LeaveNotification($leave));*/\n\n\n $message_requester = \"Your \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been declined by \".User::find($leave->supervisor_id)->display_name.\". - \".$request->comment.\"\";\n\n $message_suppervisor = \" You have rejected \".User::find($leave->user_id)->display_name.\"\n \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application. Comment: \".$request->comment.\"\";\n\n $message_reliever = \"\".User::find($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been rejected by \".User::find($leave->supervisor_id)->display_name.\". Comment: \".$request->comment.\"\";\n\n /*$message_hr = \" \".User::find(auth::id())->display_name.\" needs your approval for\n \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave application.\";*/\n\n //send notification to users\n auth()->user()->notify(new LeaveNotification($leave,$message_suppervisor));\n /*$toHr1->notify(new LeaveNotification($leave,$message_hr));\n $toHr2->notify(new LeaveNotification($leave,$message_hr));*/\n $torequester->notify(new LeaveNotification($leave,$message_requester));\n $toreliever->notify(new LeaveNotification($leave,$message_reliever));\n\n // fire leavePublished event after post is successfully added to database\n\n\n //sending email staff\n $link = route('leave.show', ['id' => $leave->id]);\n $title = \"Your Leave Request\";\n $button_title = \"Click to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->user_id)->display_name.\"\",\"\".User::find( $leave->user_id)->user_email.\"\",$message_requester,$link,$title,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n //sending email reliever\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->reliever_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->user_email.\"\",$message_reliever,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n //sending email manager\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to Approve / Decline\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->supervisor_id)->user_email.\"\",$message_suppervisor,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n\n //end of send email\n\n\n\n\n\n // event(new leavePublished($post));\n\n return response()->json(['result'=>'1','message'=> \"You have rejected \".User::find\n ($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) leave application. \"]);\n\n } elseif((auth::id() == '162') || (auth::id() == '168') || (auth::id() == '182')) {\n\n\n $leave->hr_action = 2;\n $leave->current_position = 4;\n $leave->leave_status = 4;\n $leave->leave_message = \"Rejected by HR\";\n $leave->reject_comment = $request->comment;\n $leave->rejected_by = Auth::id();\n\n $leave->save();\n\n\n\n $action = WorkflowAction::create([\n\n 'type' => 'leave',\n 'user_id' =>Auth::id(),\n 'post_id' => $id,\n 'status' => 'rejected',\n 'comments' => 'Rejected by HR',\n 'position' => 'HR',\n 'sent_to' => 162\n\n ]);\n\n\n\n //send notification to users\n $toHr1 = User::find(162);\n $toHr2 = User::find(168);\n $torequester = User::find($leave->user_id);\n $toreliever = User::find($leave->reliever_id);\n $tosupervisor = User::find($leave->supervisor_id);\n\n /*auth()->user()->notify(new LeaveNotification($leave));\n $toHr1->notify(new LeaveNotification($leave));\n $toHr2->notify(new LeaveNotification($leave));\n $torequester->notify(new LeaveNotification($leave));*/\n\n\n $message_requester = \"Your \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been declined by \".User::find(auth::id())->display_name.\". (HR). Comment - \".$request->comment.\"\";\n\n $message_suppervisor = \"\".User::find($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been declined by \".User::find(auth::id())->display_name.\" (HR). Comment - \".$request->comment.\"\";\n\n $message_reliever = \"\".User::find($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been declined by \".User::find(auth::id())->display_name.\" (HR). Comment - \".$request->comment.\"\";\n\n $message_hr = \" \".User::find(auth::id())->display_name.\" declined \".User::find($leave->user_id)->display_name.\"\n \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application. Comment - \".$request->comment.\"\";\n\n //send notification to users\n //auth()->user()->notify(new LeaveNotification($leave,$message_suppervisor));\n $toHr1->notify(new LeaveNotification($leave,$message_hr));\n $toHr2->notify(new LeaveNotification($leave,$message_hr));\n $torequester->notify(new LeaveNotification($leave,$message_requester));\n $toreliever->notify(new LeaveNotification($leave,$message_reliever));\n $tosupervisor->notify(new LeaveNotification($leave,$message_suppervisor));\n\n // fire leavePublished event after post is successfully added to database\n // event(new leavePublished($post));\n\n // fire leavePublished event after post is successfully added to database\n // event(new leavePublished($post));\n\n //sending email staff\n $link = route('leave.show', ['id' => $leave->id]);\n $title = \"Your Leave Request\";\n $button_title = \"Click to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->user_id)->display_name.\"\",\"\".User::find( $leave->user_id)->user_email.\"\",$message_requester,$link,$title,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n //sending email reliever\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->reliever_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->user_email.\"\",$message_reliever,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n //sending email manager\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to Approve / Decline\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->supervisor_id)->user_email.\"\",$message_suppervisor,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n //sending email HR\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to Approve / Decline \";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $hr_email = \"[email protected]\";\n $this->send_email(\"HR\",$hr_email,$message_hr,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n\n\n\n return response()->json(['result'=>'1','message'=> \"You have rejected \".User::find\n ($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) leave application. \"]);\n\n }else{\n\n return response()->json(['result'=>'0','message'=> \"You are not authorized\"]);\n\n }\n\n\n\n\n\n }", "public function reject() {\n\t\t$query = array(\n\t\t\t'group' => $this->group->createReference(),\n\t\t\t'invitee' => $this->candidate->createReference(),\n\t\t);\n\t\t$invite = EpicDb_Mongo::db('invitation')->fetchOne($query);\n\t\tif($invite) $invite->delete();\n\t\t// Reject this application\n\t\t$this->status = \"rejected\";\n\t\t$this->save();\n\t}", "public function rejectInvitation()\n\t{\n\t\t$id = $this->request->data['id'];\n\t\t$invite['MeetingUser']['id'] = $id;\n\t\t//set status 1 as accepted\n\t\t$invite['MeetingUser']['is_accept'] = 2;\n\t\t$invite['MeetingUser']['is_read'] = 1;\n\t\t$invite['MeetingUser']['is_attend'] = 0;\n\t\t//set notification\n\t\t$oldCount1 = $this->Session->read('oldMeetingCount');\n\t\tif ($oldCount1>0) {\n\t\t\t$newCount1 = $oldCount1-1;\n\t\t\t$this->Session->write('oldMeetingCount',$newCount1);\n\t\t}\n\t\tif($this->MeetingUser->save($invite))\n\t\t\techo \"1\";\n\t\telse\n\t\t\techo \"0\";\n\t\texit;\n\t}", "public function rejectAction()\n\t{\trequire_once( 'form.inc' );\n\n\t\tif( $this->_getParam('user') && $this->_getParam('user_reason') )\n\t\t{\t// TODO: validate and write entry to database\n\t\t\t// TODO: add success message to view\n\t\t\tif( $this->db->rejectRefund( $this->_getParam('user'), $this->_getParam('user_reason') ) )\n\t\t\t{\n\t\t\t}else\n\t\t\t{\n\t\t\t}\n\t\t}\n\n\t\t// TODO: If the refunds period has closed, parse request logs against refund list, update rejected users\n\t\t$this->view->user_options = $this->db->getRefunds('REQUESTED');\n\t}", "public function reject()\n {\n return $this->setStatus(self::STATUS_REJECTED);\n }", "public function testRejectDenyNotHrAndAdmin() {\n\t\t$this->setExpectedException('MissingActionException');\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER => '',\n\t\t\tUSER_ROLE_USER | USER_ROLE_SECRETARY => 'secret',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'reject',\n\t\t\t\t'3',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkIsNotAuthorized();\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "function rejectServRequest(){\n $serv_ID=$this->uri->segment(3);\n echo $this->router->fetch_method();\n if ($this->deliveryAndPickupModel->rejectRequest($serv_ID)) {\n echo \"<script>alert('Successfully rejected');window.location.href='\".site_url('page/rider').\"';</script>\";\n }\n else\n {\n echo \"<script>alert('Something when wrong');window.location.href='\".site_url('page/rider').\"';</script>\";\n }\n\n\t}", "public static function reject(){\n if(ModelBenevole::isOrga($_SESSION['login'], $_GET['IDFestival'])){\n ModelBenevole::reject($_GET['IDBenevole'], $_GET['IDFestival']); //appel au modèle pour gerer la BD\n $controller = 'benevole';\n $view = 'demandesorga';\n $pagetitle = 'Liste des demandes Organisateur';\n require_once (File::build_path(array('view','view.php'))); //\"redirige\" vers la vue\n }else{\n $controller = 'benevole';\n $view = 'error';\n $pagetitle = 'Vous n\\'avez pas les droits ';\n }\n }", "function rejectAction(Request $request) {\n $resource = $this->findOr404($request);\n $arrangementProgramManager = $this->getArrangementProgramManager();\n\n if (!$arrangementProgramManager->isAllowToApprove($resource)) {\n throw $this->createAccessDeniedHttpException();\n }\n $observation = $request->get('observation');\n if (empty($observation)) {\n $this->flashHelper->setFlash('error', 'error_observation');\n } else {\n $resource->setStatus(ArrangementProgram::STATUS_REJECTED);\n $this->addObservation($resource, $observation);\n\n $user = $this->getUser();\n $details = $resource->getDetails();\n $details\n ->setRejectedBy($user)\n ->setRejectedDate(new DateTime());\n\n $this->domainManager->dispatchEvent('pre_rejected', new ResourceEvent($resource));\n\n $this->domainManager->update($resource);\n $this->flashHelper->setFlash('success', 'rejected');\n\n $this->domainManager->dispatchEvent('post_rejected', new ResourceEvent($resource));\n }\n return $this->redirectHandler->redirectTo($resource);\n }", "public function rejectAction() {\n\n //CHECK AUTH\n if( !$this->_helper->requireUser()->isValid() ) return;\n\n //PROCESS\n $viewer = Engine_Api::_()->user()->getViewer();\n \n //GET THE SITEPAGE ID FROM THE URL\n $page_id = $this->_getParam('page_id');\n $sitepage = Engine_Api::_()->getItem('sitepage_page', $page_id);\n\n //MAKE FORM\n $this->view->form = $form = new Sitepagemember_Form_Member();\n $form->setTitle('Reject Page Invitation');\n $form->setDescription('Would you like to reject the invitation for this page?');\n $form->submit->setLabel('Reject Page Invitation');\n \n //PROCESS FORM\n if( !$this->getRequest()->isPost() ) {\n $this->view->status = false;\n $this->view->error = true;\n $this->view->message = Zend_Registry::get('Zend_Translate')->_('Invalid Method');\n return;\n }\n\n if( !$form->isValid($this->getRequest()->getPost()) ) {\n $this->view->status = false;\n $this->view->error = true;\n $this->view->message = Zend_Registry::get('Zend_Translate')->_('Invalid Data');\n return;\n }\n\n\t\tif (!empty($page_id)) {\n\t\t\n\t\t\t//DELETE THE RESULT FORM THE TABLE.\n\t\t\tEngine_Api::_()->getDbtable('membership', 'sitepage')->delete(array('resource_id =?' => $page_id, 'user_id =?' => $viewer->getIdentity()));\n\t\t}\n\t\t\n $this->view->status = true;\n $this->view->error = false;\n $message = Zend_Registry::get('Zend_Translate')->_('You have ignored the invite to the page %s');\n $message = sprintf($message, $sitepage->__toString());\n $this->view->message = $message;\n\n if( null === $this->_helper->contextSwitch->getCurrentContext() ) {\n return $this->_forwardCustom('success', 'utility', 'core', array(\n 'messages' => array($message),\n 'layout' => 'default-simple',\n \n 'parentRefresh' => true,\n ));\n }\n }", "public function reject_invoice()\n\t{\n\t\tif ($_SERVER['REQUEST_METHOD'] === 'POST') {\n\t\t\tif (isset($_POST)) {\n\t\t\t\t$id = base64_decode($_POST['id']);\n\t\t\t\t$remark = validateInput($_POST['reason']);\n\t\t\t\tif ($remark != '' && $remark != null) {\n\t\t\t\t\t$tableName = 'master_invoice';\n\t\t\t\t\t$condition = array('send_status' => SENT, 'id' => $id);\n\t\t\t\t\t$result = $this->CustomModel->selectAllFromWhere($tableName, $condition);\n\t\t\t\t\tif ($result > 0) {\n\t\t\t\t\t\t$data = array('send_status' => REJECTED, 'reject_reason' => $remark);\n\t\t\t\t\t\t$res = $this->CustomModel->update_table($tableName, $condition, $data);\n\t\t\t\t\t\tif ($res > 0) {\n\t\t\t\t\t\t\techo $response = json_encode(array('message' => 'Success! Invoices rejected', 'type' => 'success'), true);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo $response = json_encode(array('message' => 'Error! Opps... Contact IT', 'type' => 'error'), true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\techo $response = json_encode(array('message' => 'Error! Reject reason is required..', 'type' => 'danger'), true);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\techo $response = json_encode(array('message' => 'Error! Opps... Something went wrong, contact IT', 'type' => 'danger'), true);\n\t\t\t}\n\t\t}\n\t}", "public function reject()\n {\n $type = $this->input->get('type');\n $id = $this->input->get('id');\n\n $this->model_review->reject($type, $id);\n\n redirect($_SERVER['HTTP_REFERER']);\n }", "public function reject()\n {\n $this->channel->basic_reject(\n $this->tag(),\n true\n );\n }", "public function rejected()\n {\n $this->setStatus(self::STATUS_REJECTED);\n }", "public function disapprove()\n {\n return $this->approve(false);\n }", "function reject( $booking_ids ){\n\t\treturn $this->set_status(2, $booking_ids);\n\t}", "public function reject(array $messages);", "public function reject()\n {\n if ($this->withdrawal->status == Withdrawal::STATUS_CREATED) {\n // update withdrawal model\n $this->withdrawal->status = Withdrawal::STATUS_REJECTED;\n $this->withdrawal->save();\n // create a credit transaction on user account to return funds\n $accountService = new AccountService($this->withdrawal->account);\n $accountService->transaction($this->withdrawal, $this->withdrawal->amount);\n }\n }", "public function reject($requests) {\n foreach ($requests as $teacher_id) {\n $this->deleteFromRequest($teacher_id);\n }\n}", "function reject_dispute(){\n\t\t$disputeId = $this->uri->segment(4);\n\n\t\t$condition = array('id' => $disputeId);\n\n\t\t$data = array('status' =>'Reject');\n\t\t\n\t\t$this->review_model->update_details(DISPUTE,$data,$condition);\n\n\n\t\t$this->setErrorMessage('success','Dispute rejected successfully');\n\t\tredirect('admin/dispute/display_dispute_list');\n\n\t}", "public function rejectInvitation() {\n\t\t$this->autoRender = false;\n\t\t$communityId = $this->request->data['communityId'];\n\t\t$community = $this->Community->findById($communityId);\n\t\tif (!empty($community)) {\n\t\t\t$userId = $this->Auth->user('id');\n\t\t\t$this->CommunityMember->reject($communityId, $userId);\n\t\t\t//Community unfollow data\n\t\t\t$followCommunityData = array(\n\t\t\t\t'type' => FollowingPage::COMMUNITY_TYPE,\n\t\t\t\t'page_id' => $communityId,\n\t\t\t\t'user_id' => $userId\n\t\t\t);\n\t\t\t$this->FollowingPage->unFollowPage($followCommunityData);\n\t\t\t$this->Session->setFlash(__('The invitation has been rejected.'), 'success');\n\t\t} else {\n\t\t\t$this->Session->setFlash(__($this->invalidMessage), 'error');\n\t\t}\n\t}", "public function testRejectSuccessForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin'\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$url = '/admin/deferred/reject/2';\n\t\t$this->testAction($url, $opt);\n\t\t$this->checkFlashMessage(__('The deferred save has been %s.', __('rejected')));\n\t\t$result = $this->Controller->Deferred->find('list', ['recursive' => -1]);\n\t\t$expected = [\n\t\t\t1 => '1',\n\t\t\t3 => '3',\n\t\t\t4 => '4',\n\t\t\t5 => '5',\n\t\t];\n\t\t$this->assertData($expected, $result);\n\t}", "public function reject()\n {\n $url = URIResource::Make($this->path, array($this->id));\n $data = new DataPacket(array(\"state\" => CALL_STATES::rejected));\n $this->client->post($url, $data->get());\n\n return Constructor::Make($this, $data->get());\n }", "public static function reject() {\n return new Reject('Not match Atom in []');\n }", "public function handleRejectEvent(object $message): void;", "function rejectRecord(){ \n\n // No need to read the list of participants when processing those tabs\n if ($this->current_tab_does_not_need_applicants()) return True;\n\n $reply = False;\n $dbg_text = '';\n if (is_object($this->b_tabs)){\n $active_tab_index = $this->b_tabs->active_tab();\n $tabs = array_values($this->tabs_toShow);\n $reply = (strpos($tabs[$active_tab_index],'bList') !== False);\n $dbg_text = 'b_Tabs';\n }\n\n $this->v = Null;\n if (!$reply && empty($this->av)) switch ($this->doing){\n\t\n case '2excel':\n\tif (bForm_vm_Visit::_getStatus($this->rec) != STATUS_YES) return True;\n case 'photos':\n\tif (bForm_vm_Visit::_getStatus($this->rec) == STATUS_NO) return True;\n case 'budget':\n case 'myguests':\n case 'budget_byProjects':\n\tbreak;\n\t\n case 'lists':\n\tif (bForm_vm_Visit::_getStatus($this->rec) == STATUS_NO){\n\t if (VM_organizer_here && VM::$e->isEventEndorsed()){\n\t $dbg_text = $this->rec['av_firstname'].' '.$this->rec['av_lastname'].' - After the approval do not show the refused applicants to the organizers';\n\t $reply = True;\n\t }\n\t}\n case 'show_mails_exchange':\n\tif (!cnf_dev && $this->rec['v_type'] === VISIT_TYPE_RENT){\n\t $dbg_text = 'VISIT_TYPE_RENT... to be completed';\n\t $reply = True;\n\t}elseif (empty(VM::$e)){\n\t // Visits outside conferences/programs\n\t if (!VM_administrator_here && ($this->rec['v_host_avid'] != @bAuth::$av->ID)){\n\t $dbg_text = 'not my visit';\n\t $reply = True;\n\t }else{\n\t // Guarantee the correct value of status&policy in the snapshot record\n\t if (empty($this->rec['v_status'])){\n\t $this->v = loader::getInstance_new('bForm_vm_Visit',$this->rec['v_id'],'fatal');\n\t $this->rec['v_status'] = $this->v->getStatus();\n\t $this->rec['v_policy'] = $this->v->getValue('v_policy',True);\n\t }\n\t }\n\t}\n }\n if ($reply) $this->dbg($dbg_text);\n return $reply;\n }", "public function ajaxDeclineRequest()\n\t{\n\t\t$request = FriendshipRequest::declineRequest(Input::get('id'));\n\t\treturn array('error' => 0);\n\t}", "function getReject(){\n //check for the requested invitation available or not\n // $get_invite_id=$this->validateInvitationSecret();\n $invitation=MedicalGroupInvitation::find('all',array('conditions' => array('(user_id=? or email=?) and secret=? and active=1',$this->user_id,$this->email,$this->secret)));\n \n if(!empty($invitation)){\n foreach($invitation as $inv){\n $inv->status=\"REJECTED\";\n $inv->active=0;\n $inv->updated_on=time();\n $inv->save();\n }\n return TRUE;\n }\n else{\n return FALSE;\n }\n }", "public function reject_opportunity() {\n\t\tif($this->session->userdata('uid')){\n\t\t $user_id = $this->session->userdata('uid');\n\t\t $json = file_get_contents(\"php://input\");\n\t\t $data=json_decode($json);\n\n\t\t $op_id = $data->opportuniy_id;\n\t\t $stage_id = $data->stage_id;\n\t\t $opp_reject = $data->opp_reject;\n\t\t $remarks = $data->remarks;\n\t\t $status=array();\n\n\t\t $get_fromuser = \"\";\n\t\t $is_first_stage = $this->opp_sales->is_first_stage($stage_id);\n\n\t\t if ($is_first_stage == true) {\n\n\t\t \tif($opp_reject[0] == 'Ownership')\n\t\t \t{\n\t\t\t $check_assign= $this->opp_sales->assign_count($op_id);\n\t\t\t if($check_assign==true)\n\t\t\t {\n\t\t\t $status[0]=1;\n\t\t\t }\n\n\t\t\t //---------------- notification code----------------------------------\n\t\t $get_fromuser= $this->opp_sales->get_from_userid($op_id);\n\t\t //to user---- is the one who is to be notified.\n\t\t // from user---- is the one who performs action\n\t\t $dt = date('ymdHis');\n\t\t $notify_id= uniqid($dt);\n\t\t $remarks=\"reject of opp from executive module\";\n\t\t $getusername=$this->opp_mgr->getusernamae($get_fromuser);\n\t\t $getusername1=$this->opp_mgr->getusernamae($user_id);\n\t\t \t\t$data2= array(\n\t\t \t\t\t'notificationID' =>$notify_id,\n\t\t \t\t\t'notificationShortText'=>'Opportunity Rejected',\n\t\t \t\t\t'notificationText' =>'Opportunity Rejected by '.$getusername1.' given by '.$getusername ,\n\t\t \t\t\t'from_user'=>$user_id,\n\t\t \t\t\t'to_user'=>$get_fromuser,\n\t\t \t\t\t'action_details'=>'Opportunity',\n\t\t \t\t\t'notificationTimestamp'=>$dt,\n\t\t \t\t\t'read_state'=>0,\n\t\t \t\t\t'remarks'=>$remarks,\n\t\t \t\t);\n\n\t\t \t\tif($get_fromuser!=\"\"){\n \t\t$get_fromuser= $this->opp_sales->rej_opp_notification($data2);\n \t\t\t }\n\t\t \t}\n if($opp_reject[1] == 'Stage_Ownership')\n\t\t \t{\n\n\t\t\t\t\t\t$check_assign_stage= $this->opp_sales->assign_count_stage($op_id);\n\t\t\t\t\t\tif($check_assign_stage==true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$status[1]=1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//---------------- notification code----------------------------------\n\t\t\t\t\t\t$get_fromuser= $this->opp_sales->get_from_userid($op_id);\n\t\t\t\t\t\t//to user---- is the one who is to be notified.\n\t\t\t\t\t\t// from user---- is the one who performs action\n\t\t\t\t\t\t$dt = date('ymdHis');\n\t\t\t\t\t\t$notify_id= uniqid($dt);\n\t\t\t\t\t\t$remarks=\"reject of opp from executive module\";\n\t\t\t\t\t\t$getusername=$this->opp_mgr->getusernamae($get_fromuser);\n\t\t\t\t\t\t$getusername1=$this->opp_mgr->getusernamae($user_id);\n\t\t\t\t\t\t$data2= array(\n\t\t\t\t\t\t'notificationID' =>$notify_id,\n\t\t\t\t\t\t'notificationShortText'=>'Opportunity Stage Rejected',\n\t\t\t\t\t\t'notificationText' =>'Opportunity Stage Rejected by '.$getusername1.' given by '.$getusername ,\n\t\t\t\t\t\t'from_user'=>$user_id,\n\t\t\t\t\t\t'to_user'=>$get_fromuser,\n\t\t\t\t\t\t'action_details'=>'Opportunity',\n\t\t\t\t\t\t'notificationTimestamp'=>$dt,\n\t\t\t\t\t\t'read_state'=>0,\n\t\t\t\t\t\t'remarks'=>$remarks,\n\t\t\t\t\t\t);\n\t\t \t}\n\n\t\t \tif($get_fromuser!=\"\"){\n $get_fromuser= $this->opp_sales->rej_opp_notification($data2);\n \t\t}\n\n\n\t\t }\n\t\t else {\n\t\t \t$check_state= $this->opp_sales->check_state($op_id,$opp_reject);\n\t\t\t if(isset($check_state['Ownership'])){\n\t\t\t $check_assign= $this->opp_sales->assign_count($op_id);\n\t\t\t if($check_assign==true){\n\t\t\t $status[0]=1;\n\t\t\t }\n\n\t\t\t\t //---------------- notification code----------------------------------\n\t\t $get_fromuser= $this->opp_sales->get_from_userid($op_id);\n\t\t //to user---- is the one who is to be notified.\n\t\t // from user---- is the one who performs action\n\t\t $dt = date('ymdHis');\n\t\t $notify_id= uniqid($dt);\n\t\t $remarks=\"reject of opp from executive module\";\n\t\t $getusername=$this->opp_mgr->getusernamae($get_fromuser);\n\t\t $getusername1=$this->opp_mgr->getusernamae($user_id);\n\t\t \t\t$data2= array(\n\t\t \t\t\t'notificationID' =>$notify_id,\n\t\t \t\t\t'notificationShortText'=>'Opportunity Rejected',\n\t\t \t\t\t'notificationText' =>'Opportunity Rejected by '.$getusername1.' given by '.$getusername ,\n\t\t \t\t\t'from_user'=>$user_id,\n\t\t \t\t\t'to_user'=>$get_fromuser,\n\t\t \t\t\t'action_details'=>'Opportunity',\n\t\t \t\t\t'notificationTimestamp'=>$dt,\n\t\t \t\t\t'read_state'=>0,\n\t\t \t\t\t'remarks'=>$remarks,\n\t\t \t\t);\n\n\t\t \t\tif($get_fromuser!=\"\"){\n \t\t$get_fromuser= $this->opp_sales->rej_opp_notification($data2);\n \t\t\t }\n\n\t\t\t }\n\t\t\t if(isset($check_state['Stage_Ownership'])){\n\t\t\t\t\t$check_assign_stage= $this->opp_sales->assign_count_stage($op_id);\n\t\t\t\t\tif($check_assign_stage==true){\n\t\t\t $status[1]=1;\n\t\t\t }\n\n\t \t\t //---------------- notification code----------------------------------\n\t\t $get_fromuser= $this->opp_sales->get_from_userid($op_id);\n\t\t //to user---- is the one who is to be notified.\n\t\t // from user---- is the one who performs action\n\t\t $dt = date('ymdHis');\n\t\t $notify_id= uniqid($dt);\n\t\t $remarks=\"reject of opp from executive module\";\n\t\t $getusername=$this->opp_mgr->getusernamae($get_fromuser);\n\t\t $getusername1=$this->opp_mgr->getusernamae($user_id);\n\t\t \t\t$data2= array(\n\t\t \t\t\t'notificationID' =>$notify_id,\n\t\t \t\t\t'notificationShortText'=>'Opportunity Stage Rejected',\n\t\t \t\t\t'notificationText' =>'Opportunity Stage Rejected by '.$getusername1.' given by '.$getusername ,\n\t\t \t\t\t'from_user'=>$user_id,\n\t\t \t\t\t'to_user'=>$get_fromuser,\n\t\t \t\t\t'action_details'=>'Opportunity',\n\t\t \t\t\t'notificationTimestamp'=>$dt,\n\t\t \t\t\t'read_state'=>0,\n\t\t \t\t\t'remarks'=>$remarks,\n\t\t \t\t);\n\n\t\t\t\t\tif($get_fromuser!=\"\"){\n\t\t\t\t\t\t$get_fromuser= $this->opp_sales->rej_opp_notification($data2);\n\t\t\t\t\t}\n\t\t\t }\n\t\t }\n\n //---------------------------------------------------------end -----------------\n\t\t echo json_encode($status);\n\n\t\t} else {\n\t\t\tredirect('indexController');\n\t\t}\n\t}", "private function rejectOrder($order){\r\n $this->log('Rejecting order #'.$order->get_order_number());\r\n $this->addOrderNote($order, 'La orden fue rechazada por Flow');\r\n $order->update_status('failed');\r\n }", "public static function reject() {\n return new Reject('Not match Organic Subset');\n }", "public function getRejected();", "private static function reject($args, $invite, $auth) {\n $values = array(\n 'id'=>$invite['id'],\n 'deleted' => 't'\n );\n $s = submission_builder::build_submission($values, array('model' => 'group_invitation'));\n $r = data_entry_helper::forward_post_to('group_invitation', $s, $auth['write_tokens']);\n hostsite_show_message(lang::get(\"OK, thanks anyway. We've removed your invitation to join this group.\"));\n hostsite_goto_page($args['groups_page_path']);\n return '';\n }", "public function ajax_unblock_one() {\n\n $response = array();\n $object_id = json_decode($this->input->post(\"id\"));\n\n // request for approval if not super admin\n if ($this->session->userdata(\"role\") != USER_SUPER_ADMIN) {\n\n // make notification for seatizen block operation.\n\n // request for unblock this seatizen. (flag: not followed up yet)\n $notification = array(\n \"source\" => $this->session->userdata(\"id\"),\n \"destination\" => NULL,\n \"type\" => NOTIF_UNBLOCK_SEATIZEN,\n \"target\" => $object_id,\n \"status\" => false // haven't followed up yet\n );\n\n $this->generic->create($this->_notification_table, $notification);\n\n $response[\"status\"] = \"success\";\n $response[\"notification\"] = \"Seatizen unblock is waiting for super admin approval.\";\n\n } else {\n // arrange unblock configuration\n $result = $this->unblock($object_id);\n\n if ($result) {\n $response[\"status\"] = \"success\";\n $response[\"notification\"] = \"One item has been unblocked.\";\n } else {\n $response[\"status\"] = \"error\";\n $response[\"notification\"] = \"Cannot unblock item\";\n }\n }\n\n $this->output->set_content_type(\"application/json\");\n $this->output->set_status_header(200);\n $this->output->set_output(json_encode($response));\n }", "public function actionRejectByBaak($id, $id_baak)\n {\n $model = $this->findModel($id);\n $pegawai = Pegawai::find()->where('deleted!=1')->all();\n\n foreach ($pegawai as $p) {\n if ($p->pegawai_id == $id_baak) {\n if ($model->status_request_id = 1) {\n $model->status_request_id = 3;\n $model->baak_id = $id_baak;\n $model->save();\n\n \\Yii::$app->messenger->addSuccessFlash(\"Izin telah ditolak\");\n return $this->redirect(['index-baak']);\n } else {\n return $this->render('IndexBaak', [\n 'model'=>$model\n ]);\n }\n }\n }\n\n \\Yii::$app->messenger->addWarningFlash(\"Anda belum terdaftar di data kepegawaian IT Del, hubungi HRD untuk memasukkan data Pegawai anda\");\n return $this->redirect(['izin-by-admin-index']);\n\n }", "public function rejectExpiredRequests()\n {\n try {\n $expiredRequests = CustomRequest::where('status', RequestStatus::Verification)\n ->whereDate('expiry_date', Carbon::today())\n ->where('type', CreationType::KP)\n ->get();\n\n foreach ($expiredRequests as $key => $expiredRequest) {\n $expiredRequest->status = RequestStatus::RejectBySistem;\n $expiredRequest->expiry_date = null;\n $expiredRequest->save();\n Log::info('Sedang menolak pendaftaran '. CreationType::getString($expiredRequest->type) .' : '. $expiredRequest->student()->first()->npm . ' | '. $expiredRequest->student()->first()->name);\n }\n } catch(\\Exception $e) {\n $errorStr = method_exists($e, 'getMessage') ? json_decode($e->getMessage()) : json_encode($e);\n Log::info($errorStr);\n }\n }", "public function rejectTerms(){\n $db = DB::prepare('Delete FROM accept_terms WHERE user_id = ?');//Status 1 == accepted\n return $db->execute(array($this->id));\n }", "public static function rejectMessage($id) {\n $que = \"UPDATE message SET is_approved = 'N' where id = '{$id}'\";\n $gets = mysql_query($que);\n return $gets;\n }", "public function deny()\n {\n ++$this->denied;\n\n $this->result = NODE_ACCESS_DENY;\n\n // Where the actual magic happens please read the README.md file.\n if (!$this->byVote) {\n $this->stopPropagation();\n }\n }", "public function deniedAction() {\n \t// assegno i valori alla view\n $this->viewInit();\n \t$this->view->title = parent::$_config->application->name.\" - Accesso Negato\";\n \t$this->view->pagetitle = \"Accesso Negato\";\n \t$this->view->message = \"Stai tentando di accedere a una risorsa non consentita per il tuo profilo.\";\n }", "function reject(Transaction $transaction, $description)\n {\n return $this->addStatus($transaction,TransactionStatus::STATUS_REJECTED,$description);\n }", "function reject_leave($data) {\n global $conn;\n\n $id = htmlspecialchars($data['id_cuti']);\n $pesan = htmlspecialchars($data['pesan']);\n\n $query = \"UPDATE cuti\n SET pesan = '$pesan',\n status = 'rejected'\n WHERE id_cuti = '$id'\";\n\n mysqli_query($conn, $query);\n \n return mysqli_affected_rows($conn);\n \n\n //APPROVE LEAVE END\n // mysqli_query($conn, $quer \"UPDATE cuti SET status = 'rejected' WHERE id_cuti = $id\");\n }", "public function reject(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'aula_id' => 'required',\n 'aluno_id' => 'required',\n 'mensagem' => 'required'\n ]);\n\n if($validator->fails()){\n return $this->sendError('Validation Error.', $validator->errors()); \n }\n \n $aula = Aula::find($request->aula_id);\n $aluno = Aluno::find($request->aluno_id);\n\n if(auth()->user()->roles->pluck('name')[0] == 'Professor' && auth()->user()->professor->id == $aula->professor_id) {\n DB::table('aula_aluno')->where('aula_id',$aula->id)->where('aluno_id',$aluno->id)->update([\n 'status' => 'Rejeitado',\n 'mensagem' => $request->mensagem,\n 'visualizado' => 0,\n ]);\n\n $inscricao = DB::table('aula_aluno')->where('aula_id',$aula->id)->where('aluno_id',$aluno->id)->first();\n $aula->inscricoes = $inscricao;\n\n return $this->sendResponse(new AulaResource($aula), 'Participation accept successfully.');\n }\n\n return $this->sendError('You cannot reject the selected participation.');\n }", "public function reject($taskid)\n {\n\t\t$task = task::find($taskid);\n\t\t\t\t\t\t\n\t\t$task->completed = 2; // to changes task status as rejected\n\t\t$task->isCommited = 0; // to reset committed flag\n $task->save();\n\t\t\n $users = task::find($taskid)->students->first()->user;\t// to get user details who belongs task\n\t\t\n\t\t$info = [\n\t\t\t'email' => $users->email,\n\t\t\t'name' => $users->name,\n\t\t\t'subject' => 'Task Reject',\n\t\t\t];\n\t\t$data = ['taskName' => $task->name]; // to send name of task in mail view\n\t\t// to sent mail to user whose task is rejected\n\t\tMail::send('mail_template.notifyTaskReject', $data, function ($message) use ($info) {\n\t\t\t$message->to($info['email'], $info['name'])\n\t\t\t->subject($info['subject']);\n\t\t});\n\t\techo \"Task Rejected and Rejection Email has been sent\";\n }", "public function ajax_deny_approval()\n {\n if (empty($_POST)) return;\n\n ee()->load->model('publisher_approval');\n $msg = ee()->publisher_approval->deny();\n ee()->publisher_helper->send_ajax_response($msg);\n }", "public function reject($id)\n {\n //Mengambil session admin\n $id_user = $this->session->userdata('id_user');\n\n //Melakukan update data ticket dengan mengubah status ticket menjadi 0, data ditampung ke dalam array '$data' yang nanti akan diupdate dengan query\n $data = array(\n 'status' => 0,\n 'last_update'=> date(\"Y-m-d H:i:s\")\n );\n\n //Melakukan insert data tracking ticket bahwa ticket di-reject oleh admin, data tracking ke dalam array '$datatracking' yang nanti akan di-insert dengan query\n $datatracking = array(\n 'id_ticket' => $id,\n 'tanggal' => date(\"Y-m-d H:i:s\"),\n 'status' => \"Ticket Rejected\",\n 'deskripsi' => \"\",\n 'id_user' => $id_user\n );\n\n //Query untuk melakukan update data ticket sesuai dengan array '$data' ke tabel ticket\n $this->db->where('id_ticket', $id);\n $this->db->update('ticket', $data);\n\n //Query untuk melakukan insert data tracking ticket sesuai dengan array '$datatracking' ke tabel tracking\n $this->db->insert('tracking', $datatracking);\n }", "public function rejectR(Request $request, $id)\n {\n //\n $data = rider::where('Rider_ID', $id)->get();\n $reason = $request->Reason;\n DB::select(\"UPDATE riders set Reason = '$reason' , Rider_Status = 'REJECTED' where Rider_ID = ?\",[$id]);\n $data = DB::select(\"SELECT * FROM riders WHERE Rider_Status = 'PENDING'\");\n $message = \"Rider registration rejected.\";\n echo \"<script type='text/javascript'>alert('$message');</script>\";\n return view('ManageAccount.RegistrationListInterface', compact(\"data\"));\n \n \n }", "public function stop_archieve ()\n {\n if (post_data('appointment_id') == NULL || post_data('archieve_id') == NULL)\n {\n return;\n }\n\n $archive_result = $this->opentok->stopArchive(post_data('archieve_id'));\n\n $table_data = array(\n 'archieve_id' => $archive_result->id,\n 'duration' => $archive_result->duration,\n 'size' => $archive_result->size,\n 'status' => $archive_result->status\n );\n $this->appointment_model->save_archieve($table_data, 'update', array(\n 'archieve_id' => $table_data['archieve_id'],\n 'appointment_id' => post_data('appointment_id'),\n ));\n }", "public function testApproveDenyNotHrAndAdmin() {\n\t\t$this->setExpectedException('MissingActionException');\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER => '',\n\t\t\tUSER_ROLE_USER | USER_ROLE_SECRETARY => 'secret',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'approve',\n\t\t\t\t'3',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkIsNotAuthorized();\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "public function reject($id)\n {\n $interview = Interview::findOrFail($id);\n\n $interview->update([\n 'status' => 'rejected'\n ]);\n }", "public function reject(...$arguments): self {\n return $this->end(self::STATE_REJECTED, $this->_failed, $arguments);\n }", "public function actionUnsubscribe(){\n $perfil = \\app\\models\\PerfilUsuario::find()->where(['fk_usuario'=>Yii::$app->user->id])->one();\n $igualas_user_viejo = \\app\\models\\IgualasUsers::find()->where(['fk_users_cliente'=>$perfil->id, 'estatus'=>'concretado'])->one();\n if ($igualas_user_viejo){\n $plan_viejo = \\app\\models\\Igualas::find()->where(['id'=>$igualas_user_viejo->fk_iguala])->one();\n try {\n $agreement_viejo = paypalSuspendPlanToUser($igualas_user_viejo->subscription_id);\n }catch(\\Exception $e){\n Yii::$app->getSession()->setFlash('danger',$e->getMessage());\n return $this->redirect(['update', 'id' => Yii::$app->user->id]);\n }\n // $igualas_user_viejo->delete();\n if ($agreement_viejo){\n $igualas_user_viejo->estatus = \"cancelado\";\n $igualas_user_viejo->save();\n Yii::$app->session->setFlash('success', 'Usted ha cancelado la subscripción correctamente.');\n }\n else{\n Yii::$app->session->setFlash('error', 'Problemas al cancelar la subscripción');\n }\n }\n return $this->redirect(['update', 'id' => Yii::$app->user->id]);\n }", "function deny($reason) {\n $this->denied_reasons[] = $reason;\n }", "public function actionRejectByHrd($id){\n $model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all();\n\n foreach ($model as $m) {\n $m->status_by_hrd = 4;\n $m->status_by_atasan = 4;\n $m->status_by_wr2 = 4;\n }\n\n if($m->save()){\n \\Yii::$app->messenger->addErrorFlash(\"Permohonan Izin telah di-reject oleh HRD\");\n return $this->redirect(['index-by-hrd']);\n } else {\n return $this->render('viewByHrd', [\n 'model'=>$model\n ]);\n }\n }", "public function requestAcceptAction() {\r\n $notification = $this->_getParam('notification', 0);\r\n\t\t$is_suggestionExist = Engine_Api::_()->getItem('user', $notification->object_id);\r\n\t\tif( empty($is_suggestionExist) ) {\r\n\t\t\t// If user are not exist then we are deleting the \"User Request\" which loggden user are gettig.\r\n\t\t\tEngine_Api::_()->getDbtable('notifications', 'activity')->delete(array('notification_id = ?' => $notification->notification_id));\r\n\t\t\t$this->_helper->redirector->gotoRoute(array('route' => 'default'));\r\n\t\t}else {\r\n\t\t\t$this->view->notification = $notification;\r\n\t\t}\r\n }", "public function reject($id)\n {\n //\n $data = rider::where('Rider_ID', $id)->get();\n return view('ManageAccount.RejectRegistrationInterface', compact(\"data\"));\n }", "public function rejectInvitation($id){\n\n $invite = Invitation::find($id);\n $invite->delete();\n return redirect()->back();\n }", "public function reject_article($request)\n {\n $this->status_id = 4;\n\n if($this->update()) {\n $message = new Article_Reject_Messages;\n $message->article_id = $this->id;\n $message->text = $request['reason'];\n if($message->save()){\n Session::flash('flash_message_text', 'Статья была успешно отклонена');\n Session::flash('flash_message_class', 'success');\n if(Auth::user()->user_type == 4) return redirect('/dashboard/administrator/moderation_list');\n return redirect('/dashboard/moderator/moderation_list');\n }\n else {\n Session::flash('flash_message_text', 'Ошибка создания сообщения');\n Session::flash('flash_message_class', 'danger');\n if(Auth::user()->user_type == 4) return redirect('/dashboard/administrator/moderation_list');\n return redirect('/dashboard/moderator/moderation_list');\n }\n\n }\n else {\n Session::flash('flash_message_text', 'Ошибка отклонения статьи');\n Session::flash('flash_message_class', 'danger');\n return back();\n }\n }", "public function deny($obj, $actions){\r\n $this->_type = NULL;\r\n $this->loadObject();\r\n $suc = $this->_obj->deny($obj, $actions);\r\n \r\n return $suc;\r\n }", "public function cancelMyReserved($id);", "public function handleDeclineInvite($iid) {\n\t\tCourseListModel::declineInvite($iid);\n\t\t$this->redirect('this');\n\t}", "public function rejectedits() {\n\t\t\tglobal $db, $user;\n\t\t\t$query = \"delete from content where parent = '\".$this->guid.\"' and revision_id=1\";\n\t\t\t//print \"$query<br>\\n\";\n\t\t\tif ($db->query($query)) {\n\n\t\t\t\t// We have rejected edits to the page\n\t\t\t\taddHistory($user->id, \"\", $this->guid, \"Changes rejected\", $this->template_type.\"s\");\n\n\t\t\t\t// Update this page in the history table also\n\t\t\t\t$query = \"UPDATE history \n\t\t\t\t\tSET completed_action='CHANGES REJECTED', completed_date=now(), completed_by=\".$user->id.\" \n\t\t\t\t\tWHERE action='publish' \n\t\t\t\t\tAND completed_action is null\n\t\t\t\t\tAND (info='Page saved' OR info='Panel saved')\n\t\t\t\t\tAND guid='\".$this->guid.\"'\";\n\t\t\t\tif (!$db->query($query)) {\n\t\t\t\t\t//print \"failed($query)<br>\\n\";\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "public function testRejectSuccessForHr() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES,\n\t\t\t'prefix' => 'hr'\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$url = '/hr/deferred/reject/3';\n\t\t$this->testAction($url, $opt);\n\t\t$this->checkFlashMessage(__('The deferred save has been %s.', __('rejected')));\n\t\t$result = $this->Controller->Deferred->find('list', ['recursive' => -1]);\n\t\t$expected = [\n\t\t\t1 => '1',\n\t\t\t2 => '2',\n\t\t\t4 => '4',\n\t\t\t5 => '5',\n\t\t];\n\t\t$this->assertData($expected, $result);\n\t}", "public function reject( $id ) {\n\t\treturn ( new TripController() )->destroy( $id );\n\t}", "public function disapprove(EventDisapproveAttendancePost $request, $id)\n {\n $eventParticipant = EventParticipant::findOrFail($id);\n\n\n /*\n | @Begin Transaction\n |---------------------------------------------*/\n \\DB::beginTransaction();\n\n\n /* Disapprove the event participant */\n if($eventParticipant->disapprove($request->input('reason'))) {\n\n $event = $eventParticipant->event;\n $user = $eventParticipant->participant;\n\n \n /* Notify the user */\n $user->notify(new EventParticipantWasDisapproved($event, $user, $request->input('reason')));\n\n\n /*\n | @End Transaction\n |---------------------------------------------*/\n \\DB::commit();\n\n\n return response()->json([\n 'response' => 1,\n 'status' => $eventParticipant->status,\n 'message' => $eventParticipant->renderStatus(),\n ]);\n }\n\n return response()->json([\n 'response' => 0,\n 'message' => 'There seems to be a problem disapproving the request'\n ]); \n }", "public function reject(Request $request, $id)\n {\n $leave_record = LeaveRecord::find($id);\n $staff_id = $leave_record->staff_id;\n $user = DB::table('users')->where('username',$staff_id)->first();\n\n $data = [\n 'staff_name' => $user->full_name,\n 'man_name' => Auth::user()->full_name,\n 'staff_email' => $user->email,\n 'man_email' => Auth::user()->email,\n ];\n Mail::send(new LeaveRejectMail($data));\n\n /**\n * Check if the leave_record is not the\n * current authenticated leave_record\n */\n $date_current = Carbon::now()->toDateTimeString();\n\n $leave_record->status = $request->input('status');\n $leave_record->status_date = $date_current;\n $leave_record->save();\n return redirect('/my_leave_tasks')->with('info','Selected Leave Request has been Rejected!');\n }", "public function disapprove($id)\n {\n Provider::where('id', $id)->update(['status' => 'banned']);\n return back()->with('flash_success', \"Provider Disapproved\");\n }", "public function rejected() {\n\n $data = array();\n $data['result'] = $this->property_model->fetchAll(getLoginUserId(), 2); // Rejected\n $data['title'] = \"Rejected Properties\";\n \n $this->render('admin/property/rejected', $data);\n }", "public static function rejectSettlementRequest($request, $note = null);", "public function doRejectTransfer($iClient = 0, $iAccount = 0, $fromDate = null, $toDate = null, $iOperation=0) {\n if ($iOperation == 0) {\n $this->redirect('ctransaction/showTransferList/', 'Nebyla zvolena operace', 3);\n }\n $oOperation = $this->moperation->getById($iOperation);\n $oOperation->state = 2;\n $oOperation->employee = $_SESSION['user_id'];\n $oOperation->update();\n $this->redirect('ctransaction/showTransferList/'.$iClient.'/'.$iAccount.'/'.$fromDate.'/'.$toDate, 'Klient byl odmítnut', 1);\n }", "function process_bulk_action() {\r\n if( 'apporve'===$this->current_action() ) {\r\n wp_die('Items deleted (or they would be if we had items to delete)!');\r\n }\r\n elseif( 'reject'===$this->current_action() ) {\r\n wp_die('Items deleted (or they would be if we had items to delete)!');\r\n }\r\n \r\n }", "public function forbiddenAction() {\n }", "function declineJob($postData)\n\t\t{\n\t\t\t//update the accept flag\n\t\t\t$update_1 = $this->manageContent->updateValueWhere(\"award_info\",\"is_declined\",1,\"bid_id\",$postData['bid']);\n\t\t\t$update_2 = $this->manageContent->updateValueWhere(\"award_info\",\"result_date\",date('Y-m-d g:i:s'),\"bid_id\",$postData['bid']);\n\t\t\t\n\t\t\tif( $update_1 == 1 && $update_2 == 1 )\n\t\t\t{\n\t\t\t\t//get the bid information\n\t\t\t\t$bid_details = $this->manageContent->getValue_where('bid_info','*','bid_id',$postData['bid']);\n\t\t\t\t\n\t\t\t\t//get the project details on which bid is made\n\t\t\t\t$project_details = $this->manageContent->getValue_where(\"project_info\",\"*\",\"project_id\",$bid_details[0]['project_id']);\n\t\t\t\t\n\t\t\t\t//get contractor details\n\t\t\t\t$con_details = $this->manageContent->getValue_where('user_info', '*', 'user_id', $bid_details[0]['user_id']);\n\t\t\t\t//getting employer details\n\t\t\t\t$emp_details = $this->getEmailIdFromUserId($project_details[0]['user_id']);\n\t\t\t\t//sending mail to employer\n\t\t\t\t$this->mailSent->mailForDecliningJob($emp_details[0], $emp_details[1], $con_details[0]['name'], $project_details[0]['title']);\n\t\t\t\t\n\t\t\t\techo \"Successfully declined.\";\n\t\t\t}\n\t\t}", "public function discard($id) {\n $data = array(\n \"status\" => \"discarded\"\n );\n $this->db->where(\"id\", $id);\n $this->db->update(\"violations\", $data);\n }", "public function rejectTimesheet() {\n $id = request('timesheetId');\n $notes = request('notes');\n Timesheet::find($id)->update([\n 'status'=>'rejected',\n 'notes'=>$notes\n ]);\n return back();\n }", "public function do_approve(Request $request, $id){\n\n\n $leave = Leave::find($id);\n\n /* for supervisours */\n if(auth::id() == $leave->supervisor_id){\n\n $leave->supervisor_action = 1;\n $leave->current_position = 1;\n $leave->leave_status = 1;\n $leave->leave_message = \"Approved by Supervisor, Pending HR approval\";\n\n $leave->save();\n\n\n\n $action = WorkflowAction::create([\n\n 'type' => 'leave',\n 'user_id' =>Auth::id(),\n 'post_id' => $id,\n 'status' => 'approved',\n 'comments' => 'Pending HR approval',\n 'position' => 'Supervisor',\n 'sent_to' => 162\n\n ]);\n\n /////////////////////////////////////////////send notification to users\n $toHr1 = User::find(162);\n $toHr2 = User::find(168);\n $torequester = User::find($leave->user_id);\n $toreliever = User::find($leave->reliever_id);\n\n /*auth()->user()->notify(new LeaveNotification($leave));\n $toHr1->notify(new LeaveNotification($leave));\n $toHr2->notify(new LeaveNotification($leave));\n $torequester->notify(new LeaveNotification($leave));*/\n\n\n $message_requester = \"Your \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been approved by \".User::find($leave->supervisor_id)->display_name.\".\";\n\n $message_suppervisor = \" You have successfully approved \".User::find($leave->user_id)->display_name.\"\n \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application, pushed to HR for approval.\";\n\n $message_reliever = \"\".User::find($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been approved by \".User::find($leave->supervisor_id)->display_name.\".\";\n\n $message_hr = \" \".User::find($leave->user_id)->display_name.\" needs your approval for\n \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave application as supervisor (\".User::find($leave->supervisor_id)->display_name.\") has successfully approved this leave application.\";\n\n //send notification to users\n auth()->user()->notify(new LeaveNotification($leave,$message_suppervisor));\n //$toHr1->notify(new LeaveNotification($leave,$message_hr));\n //$toHr2->notify(new LeaveNotification($leave,$message_hr));\n $torequester->notify(new LeaveNotification($leave,$message_requester));\n $toreliever->notify(new LeaveNotification($leave,$message_reliever));\n\n\n /*auth()->user()->notify(new LeaveNotification($post,$message_requester) );\n User::find($request->supervisor)->notify(new LeaveNotification($post,$message_suppervisor) );\n User::find($request->reliever)->notify(new LeaveNotification($post, $message_reliever) );*/\n\n //sending email staff\n $link = route('leave.show', ['id' => $leave->id]);\n $title = \"Your Leave Request\";\n $button_title = \"Click to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->user_id)->display_name.\"\",\"\".User::find( $leave->user_id)->user_email.\"\",$message_requester,$link,$title,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n //sending email reliever\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->reliever_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->user_email.\"\",$message_reliever,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n //sending email manager\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to Approve / Decline\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->supervisor_id)->user_email.\"\",$message_suppervisor,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n //sending email HR\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to Approve / Decline \";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $hr_email = \"[email protected]\";\n $this->send_email(\"HR\",$hr_email,$message_hr,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n\n\n\n // fire leavePublished event after post is successfully added to database\n // event(new leavePublished($post));\n\n\n\n\n return response()->json(['result'=>'1','message'=> \"You have successfully approved \".User::find\n ($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) leave application. \"]);\n\n } elseif((auth::id() == '162') || (auth::id() == '168') || (auth::id() == '182')) {\n\n /*FOR HR APPROVAL*/\n\n\n $leave->hr_action = 1;\n $leave->current_position = 3;\n $leave->leave_status = 3;\n $leave->leave_message = \"Approved by Supervisor and HR\";\n\n $leave->save();\n\n\n\n $action = WorkflowAction::create([\n\n 'type' => 'leave',\n 'user_id' =>Auth::id(),\n 'post_id' => $id,\n 'status' => 'approved',\n 'comments' => 'Approved by HR',\n 'position' => 'HR',\n 'sent_to' => 162\n\n ]);\n\n\n //send notification to users\n $toHr1 = User::find(162);\n $toHr2 = User::find(168);\n $torequester = User::find($leave->user_id);\n $toreliever = User::find($leave->reliever_id);\n $tosupervisor = User::find($leave->supervisor_id);\n\n /*auth()->user()->notify(new LeaveNotification($leave));\n $toHr1->notify(new LeaveNotification($leave));\n $toHr2->notify(new LeaveNotification($leave));\n $torequester->notify(new LeaveNotification($leave));*/\n\n\n $message_requester = \"Your \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been approved by \".User::find(auth::id())->display_name.\". (HR)\";\n\n $message_suppervisor = \"\".User::find($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been approved by \".User::find(auth::id())->display_name.\" (HR)\";\n\n $message_reliever = \"\".User::find($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been approved by \".User::find(auth::id())->display_name.\" (HR)\";\n\n $message_hr = \" \".User::find(auth::id())->display_name.\" successfully approved \".User::find($leave->user_id)->display_name.\"\n \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application.\";\n\n //send notification to users\n // auth()->user()->notify(new LeaveNotification($leave,$message_suppervisor));\n $toHr1->notify(new LeaveNotification($leave,$message_hr));\n $toHr2->notify(new LeaveNotification($leave,$message_hr));\n $torequester->notify(new LeaveNotification($leave,$message_requester));\n $toreliever->notify(new LeaveNotification($leave,$message_reliever));\n $tosupervisor->notify(new LeaveNotification($leave,$message_suppervisor));\n\n // fire leavePublished event after post is successfully added to database\n // event(new leavePublished($post));\n\n\n //sending email staff\n $link = route('leave.show', ['id' => $leave->id]);\n $title = \"Your Leave Request\";\n $button_title = \"Click to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->user_id)->display_name.\"\",\"\".User::find( $leave->user_id)->user_email.\"\",$message_requester,$link,$title,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n //sending email reliever\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->reliever_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->user_email.\"\",$message_reliever,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n //sending email manager\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to Approve / Decline\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->supervisor_id)->user_email.\"\",$message_suppervisor,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n //sending email HR\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to Approve / Decline \";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $hr_email = \"[email protected]\";\n $this->send_email(\"HR\",$hr_email,$message_hr,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n\n\n\n\n\n\n\n return response()->json(['result'=>'1','message'=> \"You have successfully approved \".User::find\n ($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) leave application.\"]);\n\n\n\n\n }else{\n\n return response()->json(['result'=>'0','message'=> \"You are not authorized\"]);\n\n }\n\n\n\n\n\n }", "public function testIndexGroupActionBadConditionsPostForAdmin() {\n\t\t$userInfo = [\n\t\t\t'role' => USER_ROLE_USER | USER_ROLE_ADMIN,\n\t\t\t'prefix' => 'admin',\n\t\t];\n\t\t$this->applyUserInfo($userInfo);\n\t\t$this->generateMockedController();\n\t\t$opt = [\n\t\t\t'data' => [\n\t\t\t\t'FilterGroup' => [\n\t\t\t\t\t'action' => GROUP_ACTION_DEFERRED_SAVE_REJECT,\n\t\t\t\t],\n\t\t\t\t'FilterData' => [\n\t\t\t\t\t'BAD_CONDITIONS'\n\t\t\t\t]\n\t\t\t],\n\t\t\t'method' => 'POST',\n\t\t\t'return' => 'result',\n\t\t];\n\t\t$result = $this->testAction('/admin/deferred/index', $opt);\n\t\t$flashMsgPcre = '/' . __('Processing of selected tasks put in queue...') . '|' . __('Selected tasks has been processed.') . '|' . __('Selected tasks could not be processed. Please, try again.') . '/';\n\t\t$this->checkFlashMessage($flashMsgPcre, true, true);\n\t}", "public function deny($obj, $actions){\r\n $this->loadAro();\r\n return $this->aro->deny($obj, $actions);\r\n }", "public function rejectRequest($teamId, $login) {\n dibi::query(\"DELETE FROM team_requests WHERE login=%s\", $login, \"AND team=%i\", $teamId);\n }", "public function reject(callable $c);", "public function decline() {\n header('Content-type: application/json');\n $requestId = input(\"requestid\");\n Database::table(\"requests\")->where(\"id\", $requestId)->update(array(\"status\" => \"Declined\"));\n $request = Database::table(\"requests\")->where(\"id\", $requestId)->first();\n $sender = Database::table(\"users\")->where(\"id\", $request->sender)->first();\n $documentLink = env(\"APP_URL\").\"/document/\".$request->document;\n $send = Mail::send(\n $sender->email, \"Signing invitation declined by \".$request->email,\n array(\n \"title\" => \"Signing invitation declined.\",\n \"subtitle\" => \"Click the link below to view document.\",\n \"buttonText\" => \"View Document\",\n \"buttonLink\" => $documentLink,\n \"message\" => $request->email.\" has declined the signing invitation you had sent. Click the link above to view the document.<br><br>Thank you<br>\".env(\"APP_NAME\").\" Team\"\n ),\n \"withbutton\"\n );\n $actionTakenBy = escape($request->email);\n /*\n * Check, whether IP address register is allowed in .env\n * If yes, then capture the user's IP address\n */\n if (env('REGISTER_IP_ADDRESS_IN_HISTORY') == 'Enabled') {\n $actionTakenBy .= ' ['.getUserIpAddr().']';\n }\n $activity = '<span class=\"text-primary\">'.$actionTakenBy.'</span> declined a signing invitation of this document.';\n Signer::keephistory($request->document, $activity, \"default\");\n $notification = '<span class=\"text-primary\">'.escape($request->email).'</span> declined a signing invitation of this <a href=\"'.url(\"Document@open\").$request->document.'\">document</a>.';\n Signer::notification($sender->id, $notification, \"decline\");\n if (!$send) { exit(json_encode(responder(\"error\", \"Oops!\", $send->ErrorInfo))); }\n exit(json_encode(responder(\"success\", \"Declined!\", \"Request declined and sender notified.\",\"reload()\")));\n }", "public function reject_complaint($id)\n {\n $output['token'] = $this->security->get_csrf_hash();\n header('Content-Type: application/json');\n $output['response'] = $this->database->_update_to_table('tbl_reports', array('status' => 2), array('id' => $id));\n $output = html_escape($this->security->xss_clean($output));\n exit(json_encode($output));\n }", "public function isRejected() {\n\t\treturn $this->approved == -1;\n\t}", "public function markApprovalAsRejected(User $user)\n {\n if (!$user->hasRoleSlug('expert')) {\n return $this->respondNotFound(trans('user::messages.user not found'));\n }\n\n $user->setApprovalStatus(ApprovalStatusEnum::REJECTED);\n\n event(new UserApprovalHasBeenRejected($user));\n\n return $this->respond([\n 'message' => trans('user::messages.user approval-rejected'),\n 'status' => $user->getStatus(),\n 'pending_approval' => $user->approvalIsRejected()\n ]);\n }", "function deny()\r\n\t{\r\n\t\tJRequest::checkToken() or jexit('Invalid Token');\r\n\t\t\r\n\t\t// Get the selected items\r\n\t\t$cid = JRequest::getVar('cid', array(0), 'post', 'array');\r\n\t\t\r\n\t\t$total = count($cid);\r\n\t\t$msg = JText::sprintf('RSM_TRANSACTIONS_DENIED', $total);\r\n\t\t\r\n\t\t// Force array elements to be integers\r\n\t\tJArrayHelper::toInteger($cid, array(0));\r\n\t\t\r\n\t\t$msg = '';\r\n\t\t\r\n\t\t// No items are selected\r\n\t\tif (!is_array($cid) || count($cid) < 1)\r\n\t\t\tJError::raiseWarning(500, JText::_('SELECT ITEM'));\r\n\t\telse\r\n\t\t{\r\n\t\t\t$user =& JFactory::getUser();\r\n\t\t\t$user_id = $user->get('username');\r\n\t\t\tforeach ($cid as $id)\r\n\t\t\t{\r\n\t\t\t\tRSMembership::saveTransactionLog('Manually denied by '.$user_id, $id);\r\n\t\t\t\tRSMembership::deny($id);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$total = count($cid);\r\n\t\t\t$msg = JText::sprintf('RSM_TRANSACTIONS_DENIED', $total);\r\n\t\t\t\r\n\t\t\t// Clean the cache, if any\r\n\t\t\t$cache =& JFactory::getCache('com_rsmembership');\r\n\t\t\t$cache->clean();\r\n\t\t}\r\n\t\t\r\n\t\t$this->setRedirect('index.php?option=com_rsmembership&view=transactions', $msg);\r\n\t}", "public function testItCanRejectASuggestedEditPendingCuration()\n {\n $this->logInAsUser(['curator' => 1]);\n\n $edit = factory('App\\Models\\SuggestedEdit')->create();\n\n $this->get('/curation/edits/reject/' . $edit->id)->assertResponseStatus(302);\n\n $this->seeInDatabase('suggested_edits', [\n 'id' => $edit->id,\n 'approved' => 0,\n ]);\n }", "#[@test]\n public function reasonOnly() {\n $action= $this->parseCommandSetFrom('\n if true { \n vacation \"Out of office\";\n }\n ')->commandAt(0)->commands[0];\n $this->assertClass($action, 'peer.sieve.action.VacationAction');\n $this->assertEquals('Out of office', $action->reason);\n }", "public function createRejected($reason);", "public function rejectInvite($inviterID) {\n\t\treturn ConnectionFactory::DeleteRowFromTable(\"agencies\", array('user_one_id'=>$inviterID, \n\t\t\t\t'user_two_id'=>$this->id));\n\t}", "public function deny($aro, $aco, $action = \"*\")\n {\n return $this->_Instance->deny($aro, $aco, $action);\n }", "function lobby_membersapi_reject($args)\r\n{\r\n\t$uid = (int)$args['uid'];\r\n\t$group = $args['group'];\r\n\t$gid = (int)$group['id'];\r\n\tif (!($uid > 1) || !($gid > 0)) {\r\n \t \tLogUtil::registerError(_LOBBY_GROUP_REJECT_MEMBER_FAILURE);\r\n\t\treturn false;\r\n\t} else {\r\n\t \t// get Group\r\n\t \t$table \t\t= pnDBGetTables();\r\n\t \t$column\t\t= $table['lobby_members_pending_column'];\r\n\t \t$where\t\t= $column['uid'].\" = \".$uid.\" AND \".$column['gid'].\" = \".$gid;\r\n\t\t$result\t\t= DBUtil::selectObjectArray('lobby_members_pending',$where);\r\n\t\t$obj = $result[0];\r\n\t\t$result = DBUtil::deleteObject($obj,'lobby_members_pending');\r\n\t\tif ($result) {\r\n\t\t\tLogUtil::registerStatus(_LOBBY_MEMBERSHIP_REQUEST_REJECTED);\r\n\t\t\t// send Mail\r\n\t\t\tLoader::includeOnce('modules/lobby/includes/common_email.php');\r\n\t\t\tlobby_notify_rejectmembershiprequest($group,$uid);\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t \tLogUtil::registerError(_LOBBY_MEMBERSHIP_REJECT_ERROR);\r\n\t\t \treturn false;\r\n\t\t}\r\n\t}\r\n}", "public function sellerOrderReject(Request $request, $id){\n \\App::call('App\\Http\\Controllers\\OrderController@reject', [$id]);\n $orders = \\App::call('App\\Http\\Controllers\\OrderController@viewBySeller', [$request->user()->seller->id]);\n return view($request->view, compact('orders'));\n }", "public function deactivate()\n {\n $project = $this->getProject();\n $recovery_plan_id = $this->request->getIntegerParam('recovery_plan_id', 0);\n\n\n $this->response->html($this->template->render('status:recoveryPlanDetail/makeInactive', array(\n 'title' => t('Remove recovery plan'),\n 'project_id' => $project['id'],\n 'values' => array('id' => $recovery_plan_id)\n )));\n }", "public function blockIllegalRequests(ActionRequest $request);", "public function denyAccess(): AccessResultInterface;", "public function cancel()\n {\n $this->confirmationArchived = false;\n }", "protected function processDeny($data) {\n \t$s = new Zend_Session_Namespace('lastRequest');\n \tunset($s->hasRequested);\n $state = isset($data[STATE]) ? $data[STATE] : NULL;\n $urlHelper = $this->_helper->RedirectUriFormatter;\n\n $url = $urlHelper->errorRedirect($data[REDIRECT_URI], $state);\n\tZend_Auth::getInstance()->clearIdentity();\n $this->_helper->redirector->gotoUrl($url);\n }", "public function deny_advertiser(Request $request)\n {\n\n }" ]
[ "0.61445177", "0.6097199", "0.6088785", "0.6006791", "0.5961893", "0.5953223", "0.59032404", "0.5857687", "0.585365", "0.578245", "0.5742401", "0.57403046", "0.57257354", "0.5708631", "0.5699718", "0.56657505", "0.55850405", "0.5570304", "0.55542666", "0.55375594", "0.5537281", "0.5536586", "0.55115324", "0.5503749", "0.54918575", "0.54852605", "0.54801583", "0.5479122", "0.54725957", "0.54455924", "0.5445024", "0.54323906", "0.5423297", "0.5410789", "0.5406832", "0.5397585", "0.5393545", "0.53633153", "0.5351991", "0.5341643", "0.53316903", "0.5328619", "0.531316", "0.52987856", "0.52949876", "0.52894163", "0.5279597", "0.5277561", "0.5274562", "0.5271994", "0.52596885", "0.525333", "0.52140087", "0.51735836", "0.515092", "0.5140107", "0.51287687", "0.5127917", "0.5120872", "0.5112032", "0.5107012", "0.50947523", "0.5074032", "0.50712883", "0.5064263", "0.5059831", "0.50577176", "0.50565743", "0.5040248", "0.5034448", "0.5033927", "0.50282294", "0.5016693", "0.5006466", "0.49929944", "0.49830636", "0.49812245", "0.49806693", "0.4978859", "0.4969317", "0.49638253", "0.49524307", "0.49518424", "0.49343884", "0.49164647", "0.48935887", "0.4888626", "0.48750424", "0.4863793", "0.48575506", "0.48517218", "0.484172", "0.4841637", "0.48413703", "0.48396915", "0.48390707", "0.48376238", "0.4831378", "0.48310396", "0.4830175" ]
0.5896964
7
actionid: rejectbywr2 actiondesc: Rejecting the izin by Vice Rector2
public function actionRejectByWr2($id){ $model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all(); foreach ($model as $m) { $m->status_by_wr2 = 4; } if($m->save()){ \Yii::$app->messenger->addErrorFlash("Permohonan Izin telah di-reject oleh WR 2"); return $this->redirect(['index-by-wr2']); } else { return $this->render('viewByWr2', [ 'model'=>$model ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reject_dispute(){\n\t\t$disputeId = $this->uri->segment(4);\n\n\t\t$condition = array('id' => $disputeId);\n\n\t\t$data = array('status' =>'Reject');\n\t\t\n\t\t$this->review_model->update_details(DISPUTE,$data,$condition);\n\n\n\t\t$this->setErrorMessage('success','Dispute rejected successfully');\n\t\tredirect('admin/dispute/display_dispute_list');\n\n\t}", "public function rejectAction()\n\t{\trequire_once( 'form.inc' );\n\n\t\tif( $this->_getParam('user') && $this->_getParam('user_reason') )\n\t\t{\t// TODO: validate and write entry to database\n\t\t\t// TODO: add success message to view\n\t\t\tif( $this->db->rejectRefund( $this->_getParam('user'), $this->_getParam('user_reason') ) )\n\t\t\t{\n\t\t\t}else\n\t\t\t{\n\t\t\t}\n\t\t}\n\n\t\t// TODO: If the refunds period has closed, parse request logs against refund list, update rejected users\n\t\t$this->view->user_options = $this->db->getRefunds('REQUESTED');\n\t}", "public function reject()\n {\n $type = $this->input->get('type');\n $id = $this->input->get('id');\n\n $this->model_review->reject($type, $id);\n\n redirect($_SERVER['HTTP_REFERER']);\n }", "public static function reject(){\n if(ModelBenevole::isOrga($_SESSION['login'], $_GET['IDFestival'])){\n ModelBenevole::reject($_GET['IDBenevole'], $_GET['IDFestival']); //appel au modèle pour gerer la BD\n $controller = 'benevole';\n $view = 'demandesorga';\n $pagetitle = 'Liste des demandes Organisateur';\n require_once (File::build_path(array('view','view.php'))); //\"redirige\" vers la vue\n }else{\n $controller = 'benevole';\n $view = 'error';\n $pagetitle = 'Vous n\\'avez pas les droits ';\n }\n }", "function rejectServRequest(){\n $serv_ID=$this->uri->segment(3);\n echo $this->router->fetch_method();\n if ($this->deliveryAndPickupModel->rejectRequest($serv_ID)) {\n echo \"<script>alert('Successfully rejected');window.location.href='\".site_url('page/rider').\"';</script>\";\n }\n else\n {\n echo \"<script>alert('Something when wrong');window.location.href='\".site_url('page/rider').\"';</script>\";\n }\n\n\t}", "public function reject_opportunity() {\n\t\tif($this->session->userdata('uid')){\n\t\t $user_id = $this->session->userdata('uid');\n\t\t $json = file_get_contents(\"php://input\");\n\t\t $data=json_decode($json);\n\n\t\t $op_id = $data->opportuniy_id;\n\t\t $stage_id = $data->stage_id;\n\t\t $opp_reject = $data->opp_reject;\n\t\t $remarks = $data->remarks;\n\t\t $status=array();\n\n\t\t $get_fromuser = \"\";\n\t\t $is_first_stage = $this->opp_sales->is_first_stage($stage_id);\n\n\t\t if ($is_first_stage == true) {\n\n\t\t \tif($opp_reject[0] == 'Ownership')\n\t\t \t{\n\t\t\t $check_assign= $this->opp_sales->assign_count($op_id);\n\t\t\t if($check_assign==true)\n\t\t\t {\n\t\t\t $status[0]=1;\n\t\t\t }\n\n\t\t\t //---------------- notification code----------------------------------\n\t\t $get_fromuser= $this->opp_sales->get_from_userid($op_id);\n\t\t //to user---- is the one who is to be notified.\n\t\t // from user---- is the one who performs action\n\t\t $dt = date('ymdHis');\n\t\t $notify_id= uniqid($dt);\n\t\t $remarks=\"reject of opp from executive module\";\n\t\t $getusername=$this->opp_mgr->getusernamae($get_fromuser);\n\t\t $getusername1=$this->opp_mgr->getusernamae($user_id);\n\t\t \t\t$data2= array(\n\t\t \t\t\t'notificationID' =>$notify_id,\n\t\t \t\t\t'notificationShortText'=>'Opportunity Rejected',\n\t\t \t\t\t'notificationText' =>'Opportunity Rejected by '.$getusername1.' given by '.$getusername ,\n\t\t \t\t\t'from_user'=>$user_id,\n\t\t \t\t\t'to_user'=>$get_fromuser,\n\t\t \t\t\t'action_details'=>'Opportunity',\n\t\t \t\t\t'notificationTimestamp'=>$dt,\n\t\t \t\t\t'read_state'=>0,\n\t\t \t\t\t'remarks'=>$remarks,\n\t\t \t\t);\n\n\t\t \t\tif($get_fromuser!=\"\"){\n \t\t$get_fromuser= $this->opp_sales->rej_opp_notification($data2);\n \t\t\t }\n\t\t \t}\n if($opp_reject[1] == 'Stage_Ownership')\n\t\t \t{\n\n\t\t\t\t\t\t$check_assign_stage= $this->opp_sales->assign_count_stage($op_id);\n\t\t\t\t\t\tif($check_assign_stage==true)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$status[1]=1;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//---------------- notification code----------------------------------\n\t\t\t\t\t\t$get_fromuser= $this->opp_sales->get_from_userid($op_id);\n\t\t\t\t\t\t//to user---- is the one who is to be notified.\n\t\t\t\t\t\t// from user---- is the one who performs action\n\t\t\t\t\t\t$dt = date('ymdHis');\n\t\t\t\t\t\t$notify_id= uniqid($dt);\n\t\t\t\t\t\t$remarks=\"reject of opp from executive module\";\n\t\t\t\t\t\t$getusername=$this->opp_mgr->getusernamae($get_fromuser);\n\t\t\t\t\t\t$getusername1=$this->opp_mgr->getusernamae($user_id);\n\t\t\t\t\t\t$data2= array(\n\t\t\t\t\t\t'notificationID' =>$notify_id,\n\t\t\t\t\t\t'notificationShortText'=>'Opportunity Stage Rejected',\n\t\t\t\t\t\t'notificationText' =>'Opportunity Stage Rejected by '.$getusername1.' given by '.$getusername ,\n\t\t\t\t\t\t'from_user'=>$user_id,\n\t\t\t\t\t\t'to_user'=>$get_fromuser,\n\t\t\t\t\t\t'action_details'=>'Opportunity',\n\t\t\t\t\t\t'notificationTimestamp'=>$dt,\n\t\t\t\t\t\t'read_state'=>0,\n\t\t\t\t\t\t'remarks'=>$remarks,\n\t\t\t\t\t\t);\n\t\t \t}\n\n\t\t \tif($get_fromuser!=\"\"){\n $get_fromuser= $this->opp_sales->rej_opp_notification($data2);\n \t\t}\n\n\n\t\t }\n\t\t else {\n\t\t \t$check_state= $this->opp_sales->check_state($op_id,$opp_reject);\n\t\t\t if(isset($check_state['Ownership'])){\n\t\t\t $check_assign= $this->opp_sales->assign_count($op_id);\n\t\t\t if($check_assign==true){\n\t\t\t $status[0]=1;\n\t\t\t }\n\n\t\t\t\t //---------------- notification code----------------------------------\n\t\t $get_fromuser= $this->opp_sales->get_from_userid($op_id);\n\t\t //to user---- is the one who is to be notified.\n\t\t // from user---- is the one who performs action\n\t\t $dt = date('ymdHis');\n\t\t $notify_id= uniqid($dt);\n\t\t $remarks=\"reject of opp from executive module\";\n\t\t $getusername=$this->opp_mgr->getusernamae($get_fromuser);\n\t\t $getusername1=$this->opp_mgr->getusernamae($user_id);\n\t\t \t\t$data2= array(\n\t\t \t\t\t'notificationID' =>$notify_id,\n\t\t \t\t\t'notificationShortText'=>'Opportunity Rejected',\n\t\t \t\t\t'notificationText' =>'Opportunity Rejected by '.$getusername1.' given by '.$getusername ,\n\t\t \t\t\t'from_user'=>$user_id,\n\t\t \t\t\t'to_user'=>$get_fromuser,\n\t\t \t\t\t'action_details'=>'Opportunity',\n\t\t \t\t\t'notificationTimestamp'=>$dt,\n\t\t \t\t\t'read_state'=>0,\n\t\t \t\t\t'remarks'=>$remarks,\n\t\t \t\t);\n\n\t\t \t\tif($get_fromuser!=\"\"){\n \t\t$get_fromuser= $this->opp_sales->rej_opp_notification($data2);\n \t\t\t }\n\n\t\t\t }\n\t\t\t if(isset($check_state['Stage_Ownership'])){\n\t\t\t\t\t$check_assign_stage= $this->opp_sales->assign_count_stage($op_id);\n\t\t\t\t\tif($check_assign_stage==true){\n\t\t\t $status[1]=1;\n\t\t\t }\n\n\t \t\t //---------------- notification code----------------------------------\n\t\t $get_fromuser= $this->opp_sales->get_from_userid($op_id);\n\t\t //to user---- is the one who is to be notified.\n\t\t // from user---- is the one who performs action\n\t\t $dt = date('ymdHis');\n\t\t $notify_id= uniqid($dt);\n\t\t $remarks=\"reject of opp from executive module\";\n\t\t $getusername=$this->opp_mgr->getusernamae($get_fromuser);\n\t\t $getusername1=$this->opp_mgr->getusernamae($user_id);\n\t\t \t\t$data2= array(\n\t\t \t\t\t'notificationID' =>$notify_id,\n\t\t \t\t\t'notificationShortText'=>'Opportunity Stage Rejected',\n\t\t \t\t\t'notificationText' =>'Opportunity Stage Rejected by '.$getusername1.' given by '.$getusername ,\n\t\t \t\t\t'from_user'=>$user_id,\n\t\t \t\t\t'to_user'=>$get_fromuser,\n\t\t \t\t\t'action_details'=>'Opportunity',\n\t\t \t\t\t'notificationTimestamp'=>$dt,\n\t\t \t\t\t'read_state'=>0,\n\t\t \t\t\t'remarks'=>$remarks,\n\t\t \t\t);\n\n\t\t\t\t\tif($get_fromuser!=\"\"){\n\t\t\t\t\t\t$get_fromuser= $this->opp_sales->rej_opp_notification($data2);\n\t\t\t\t\t}\n\t\t\t }\n\t\t }\n\n //---------------------------------------------------------end -----------------\n\t\t echo json_encode($status);\n\n\t\t} else {\n\t\t\tredirect('indexController');\n\t\t}\n\t}", "public function rejectAction() {\n\n //CHECK AUTH\n if( !$this->_helper->requireUser()->isValid() ) return;\n\n //PROCESS\n $viewer = Engine_Api::_()->user()->getViewer();\n \n //GET THE SITEPAGE ID FROM THE URL\n $page_id = $this->_getParam('page_id');\n $sitepage = Engine_Api::_()->getItem('sitepage_page', $page_id);\n\n //MAKE FORM\n $this->view->form = $form = new Sitepagemember_Form_Member();\n $form->setTitle('Reject Page Invitation');\n $form->setDescription('Would you like to reject the invitation for this page?');\n $form->submit->setLabel('Reject Page Invitation');\n \n //PROCESS FORM\n if( !$this->getRequest()->isPost() ) {\n $this->view->status = false;\n $this->view->error = true;\n $this->view->message = Zend_Registry::get('Zend_Translate')->_('Invalid Method');\n return;\n }\n\n if( !$form->isValid($this->getRequest()->getPost()) ) {\n $this->view->status = false;\n $this->view->error = true;\n $this->view->message = Zend_Registry::get('Zend_Translate')->_('Invalid Data');\n return;\n }\n\n\t\tif (!empty($page_id)) {\n\t\t\n\t\t\t//DELETE THE RESULT FORM THE TABLE.\n\t\t\tEngine_Api::_()->getDbtable('membership', 'sitepage')->delete(array('resource_id =?' => $page_id, 'user_id =?' => $viewer->getIdentity()));\n\t\t}\n\t\t\n $this->view->status = true;\n $this->view->error = false;\n $message = Zend_Registry::get('Zend_Translate')->_('You have ignored the invite to the page %s');\n $message = sprintf($message, $sitepage->__toString());\n $this->view->message = $message;\n\n if( null === $this->_helper->contextSwitch->getCurrentContext() ) {\n return $this->_forwardCustom('success', 'utility', 'core', array(\n 'messages' => array($message),\n 'layout' => 'default-simple',\n \n 'parentRefresh' => true,\n ));\n }\n }", "public function reject() {\n\t\t$query = array(\n\t\t\t'group' => $this->group->createReference(),\n\t\t\t'invitee' => $this->candidate->createReference(),\n\t\t);\n\t\t$invite = EpicDb_Mongo::db('invitation')->fetchOne($query);\n\t\tif($invite) $invite->delete();\n\t\t// Reject this application\n\t\t$this->status = \"rejected\";\n\t\t$this->save();\n\t}", "private function btn_approve_reject(){\n\n // Skip the unduly cases\n if ($not_my_case = (VM::outOfScope()\n\t\t\t|| !$this->isWritable() \n\t\t\t|| ($this->rec['v_type'] == VISIT_OUT_OF_SCOPE) \n\t\t\t|| !in_array($this->doing,array('lists','budget',)) \n\t\t\t)){\n $this->dbg('not my case? '.($not_my_case ? 'YES' : 'NO'));\n return array('','');\n }\n\n // The event is endorsed (i.e. changes are locked), show only pending applicants and return\n if(0) if (VM::isEventEndorsed() || ($this->rec['v_end'] < time())){\n\tif (False){ // ? Strange... To be changed?\n\t $reply = array('');\n\t if ($this->fnc_beslut) $reply[] = $this->highlights['fnc'][$this->fnc_beslut]['i'];\n\t else $reply[] = '';\n\t if (stripos(serialize($reply),'send mail') !== False) b_debug::var_dump('fnc_beslut',$this->fnc_beslut,date('Y-m-d',$this->rec['v_end']),$reply);\n\t if (stripos(serialize($reply),'send mail') !== False) b_debug::internalError();\n\t}else{ \n\t $reply = array('','');\n\t}\n\t// $t = $reply; array_unshift($t,2,$this->rec['v_id']); $this->dbg($t,True);\n\treturn $reply;\n }\n\n bTiming()->cpu(__function__);\n\n // \n // See what should we do, depends on the visit status \n //\n $reply = array('','');\n $v_status = bForm_vm_Visit::_getStatus($this->rec,$check_clashes=True);\n switch($v_status){\n \n case STATUS_CLASH:\n break;\n\n case STATUS_NO: \n $this->rec['_a_name'] = $this->rec['_o_name'] = '';\n switch ($this->rec['v_type']){\n case VISIT_TYPE_RENT:\n case VISIT_OUT_OF_SCOPE:\n\tbreak;\n\t\n case VISIT_TYPE_OTHER:\n case VISIT_TYPE_COLLABORATION:\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$reply = (VM::hasRightTo('approve_guest_invitation',$this->v)\n\t\t ? array('','') \n\t\t : array('',$this->say('Ni')));\n\tbreak;\n\t\n case VISIT_TYPE_PROGRAM: \n\t$reply = (VM::hasRightTo('approve_registrant_application')\n\t\t ? array('',$this->say('NY'))\n\t\t : array('',$this->say('Ni')));\n }\n break;\n \n case STATUS_PENDING:\n if (@$this->rec['_a_name'] !== LODGING_OA_TXT) $this->rec['_a_name'] = $this->rec['_o_name'] = '';\n switch ($this->rec['v_type']){\n case VISIT_TYPE_RENT: // auto-accept the rents\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$this->v->setStatus(STATUS_YES);\n\t$this->v->setPolicy(VM_V_welcomeMailSent,True,False,True);\n\t$this->rec['v_status'] = STATUS_YES;\n\tbreak;\n\t\n case VISIT_OUT_OF_SCOPE:\n\tbreak 2;\n\t\n case VISIT_TYPE_OTHER:\n case VISIT_TYPE_COLLABORATION:\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$reply = (VM::hasRightTo('approve_guest_invitation',$this->v)\n\t\t ? array('','') \n\t\t : array('',$this->say('Pi')));\n\tbreak;\n\t\n case VISIT_TYPE_PROGRAM: \n\t$reply = (VM::hasRightTo('approve_registrant_application')\n\t\t ? array($this->say('Y'),\n\t\t\t $this->say('N'))\n\t\t : array('',$this->say('Pi')));\n\tbreak;\n\t\n default:\n\tb_debug::internalError('?? v_type=\"'.$this->rec['v_type'].'\"');\n }\n break;\n \n case STATUS_YES:\n switch ($this->rec['v_type']){\n case VISIT_OUT_OF_SCOPE:\n\tbreak;\n\n case VISIT_TYPE_RENT:\n\tif (empty($this->v)) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$this->v->setPolicy(VM_V_welcomeMailSent,True,False,True);\n\t$this->rec['v_policy'] = $this->v->getValue('v_policy',1,1);\n\tbreak;\n\n case VISIT_TYPE_OTHER:\n case VISIT_TYPE_COLLABORATION:\n\tif (!$this->v) $this->v = new bForm_vm_Visit($this->rec['v_id']); \n\t$reply = (VM::hasRightTo('approve_guest_invitation',$this->v)\n\t\t ? array('','') \n\t\t : array('',$this->say('Yi')));\n\tbreak;\n\t\n case VISIT_TYPE_PROGRAM: \n\t$reply = (VM::hasRightTo('approve_registrant_application')\n\t\t ? array('',$this->say('YN'))\n\t\t : array('',$this->say('Yi')));\n\tbreak;\n }\n }\n bTiming()->cpu();\n // $t = $reply; array_unshift($t,3,$this->rec['v_id']); $this->dbg($t,True);\n return $reply;\n }", "public function reject_invoice()\n\t{\n\t\tif ($_SERVER['REQUEST_METHOD'] === 'POST') {\n\t\t\tif (isset($_POST)) {\n\t\t\t\t$id = base64_decode($_POST['id']);\n\t\t\t\t$remark = validateInput($_POST['reason']);\n\t\t\t\tif ($remark != '' && $remark != null) {\n\t\t\t\t\t$tableName = 'master_invoice';\n\t\t\t\t\t$condition = array('send_status' => SENT, 'id' => $id);\n\t\t\t\t\t$result = $this->CustomModel->selectAllFromWhere($tableName, $condition);\n\t\t\t\t\tif ($result > 0) {\n\t\t\t\t\t\t$data = array('send_status' => REJECTED, 'reject_reason' => $remark);\n\t\t\t\t\t\t$res = $this->CustomModel->update_table($tableName, $condition, $data);\n\t\t\t\t\t\tif ($res > 0) {\n\t\t\t\t\t\t\techo $response = json_encode(array('message' => 'Success! Invoices rejected', 'type' => 'success'), true);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo $response = json_encode(array('message' => 'Error! Opps... Contact IT', 'type' => 'error'), true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\techo $response = json_encode(array('message' => 'Error! Reject reason is required..', 'type' => 'danger'), true);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\techo $response = json_encode(array('message' => 'Error! Opps... Something went wrong, contact IT', 'type' => 'danger'), true);\n\t\t\t}\n\t\t}\n\t}", "public function do_reject(Request $request, $id){\n\n\n $leave = Leave::find($id);\n\n if(auth::id() == $leave->supervisor_id){\n\n $leave->supervisor_action = 2;\n $leave->current_position = 0;\n $leave->leave_status = 2;\n $leave->leave_message = \"Rejected by Supervisor\";\n $leave->reject_comment = $request->comment;\n $leave->rejected_by = Auth::id();\n\n $leave->save();\n\n\n\n $action = WorkflowAction::create([\n\n 'type' => 'leave',\n 'user_id' =>Auth::id(),\n 'post_id' => $id,\n 'status' => 'rejected',\n 'comments' => 'Rejected by Supervisor',\n 'position' => 'Supervisor',\n 'sent_to' => 162\n\n ]);\n\n /////////////////////////////////////////////send notification to users\n $toHr1 = User::find(162);\n $toHr2 = User::find(168);\n $torequester = User::find($leave->user_id);\n $toreliever = User::find($leave->reliever_id);\n\n /*auth()->user()->notify(new LeaveNotification($leave));\n $toHr1->notify(new LeaveNotification($leave));\n $toHr2->notify(new LeaveNotification($leave));\n $torequester->notify(new LeaveNotification($leave));*/\n\n\n $message_requester = \"Your \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been declined by \".User::find($leave->supervisor_id)->display_name.\". - \".$request->comment.\"\";\n\n $message_suppervisor = \" You have rejected \".User::find($leave->user_id)->display_name.\"\n \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application. Comment: \".$request->comment.\"\";\n\n $message_reliever = \"\".User::find($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been rejected by \".User::find($leave->supervisor_id)->display_name.\". Comment: \".$request->comment.\"\";\n\n /*$message_hr = \" \".User::find(auth::id())->display_name.\" needs your approval for\n \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave application.\";*/\n\n //send notification to users\n auth()->user()->notify(new LeaveNotification($leave,$message_suppervisor));\n /*$toHr1->notify(new LeaveNotification($leave,$message_hr));\n $toHr2->notify(new LeaveNotification($leave,$message_hr));*/\n $torequester->notify(new LeaveNotification($leave,$message_requester));\n $toreliever->notify(new LeaveNotification($leave,$message_reliever));\n\n // fire leavePublished event after post is successfully added to database\n\n\n //sending email staff\n $link = route('leave.show', ['id' => $leave->id]);\n $title = \"Your Leave Request\";\n $button_title = \"Click to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->user_id)->display_name.\"\",\"\".User::find( $leave->user_id)->user_email.\"\",$message_requester,$link,$title,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n //sending email reliever\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->reliever_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->user_email.\"\",$message_reliever,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n //sending email manager\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to Approve / Decline\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->supervisor_id)->user_email.\"\",$message_suppervisor,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n\n //end of send email\n\n\n\n\n\n // event(new leavePublished($post));\n\n return response()->json(['result'=>'1','message'=> \"You have rejected \".User::find\n ($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) leave application. \"]);\n\n } elseif((auth::id() == '162') || (auth::id() == '168') || (auth::id() == '182')) {\n\n\n $leave->hr_action = 2;\n $leave->current_position = 4;\n $leave->leave_status = 4;\n $leave->leave_message = \"Rejected by HR\";\n $leave->reject_comment = $request->comment;\n $leave->rejected_by = Auth::id();\n\n $leave->save();\n\n\n\n $action = WorkflowAction::create([\n\n 'type' => 'leave',\n 'user_id' =>Auth::id(),\n 'post_id' => $id,\n 'status' => 'rejected',\n 'comments' => 'Rejected by HR',\n 'position' => 'HR',\n 'sent_to' => 162\n\n ]);\n\n\n\n //send notification to users\n $toHr1 = User::find(162);\n $toHr2 = User::find(168);\n $torequester = User::find($leave->user_id);\n $toreliever = User::find($leave->reliever_id);\n $tosupervisor = User::find($leave->supervisor_id);\n\n /*auth()->user()->notify(new LeaveNotification($leave));\n $toHr1->notify(new LeaveNotification($leave));\n $toHr2->notify(new LeaveNotification($leave));\n $torequester->notify(new LeaveNotification($leave));*/\n\n\n $message_requester = \"Your \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been declined by \".User::find(auth::id())->display_name.\". (HR). Comment - \".$request->comment.\"\";\n\n $message_suppervisor = \"\".User::find($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been declined by \".User::find(auth::id())->display_name.\" (HR). Comment - \".$request->comment.\"\";\n\n $message_reliever = \"\".User::find($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application has\n been declined by \".User::find(auth::id())->display_name.\" (HR). Comment - \".$request->comment.\"\";\n\n $message_hr = \" \".User::find(auth::id())->display_name.\" declined \".User::find($leave->user_id)->display_name.\"\n \".$leave->no_days.\" day(s) \".$leave->leave_category.\" leave\n application. Comment - \".$request->comment.\"\";\n\n //send notification to users\n //auth()->user()->notify(new LeaveNotification($leave,$message_suppervisor));\n $toHr1->notify(new LeaveNotification($leave,$message_hr));\n $toHr2->notify(new LeaveNotification($leave,$message_hr));\n $torequester->notify(new LeaveNotification($leave,$message_requester));\n $toreliever->notify(new LeaveNotification($leave,$message_reliever));\n $tosupervisor->notify(new LeaveNotification($leave,$message_suppervisor));\n\n // fire leavePublished event after post is successfully added to database\n // event(new leavePublished($post));\n\n // fire leavePublished event after post is successfully added to database\n // event(new leavePublished($post));\n\n //sending email staff\n $link = route('leave.show', ['id' => $leave->id]);\n $title = \"Your Leave Request\";\n $button_title = \"Click to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->user_id)->display_name.\"\",\"\".User::find( $leave->user_id)->user_email.\"\",$message_requester,$link,$title,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n //sending email reliever\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to view\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->reliever_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->user_email.\"\",$message_reliever,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n //sending email manager\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to Approve / Decline\";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $this->send_email(\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->supervisor_id)->user_email.\"\",$message_suppervisor,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n //sending email HR\n $link = route('leave.show', ['id' => $leave->id]);\n $title2 = \"Leave Request From \".ucwords(User::find($leave->user_id)->display_name).\"\";\n $button_title = \"Click here to Approve / Decline \";\n $leave_date = \"\".$leave->start_date.\" to \".$leave->end_date.\"\";\n $hr_email = \"[email protected]\";\n $this->send_email(\"HR\",$hr_email,$message_hr,$link,$title2,$button_title,\"\".User::find($leave->user_id)->display_name.\"\",$leave->leave_category,$leave->no_days,$leave_date,$leave->leave_year,\"\".User::find($leave->supervisor_id)->display_name.\"\",\"\".User::find($leave->reliever_id)->display_name.\"\");\n //end of send email\n\n\n\n\n\n return response()->json(['result'=>'1','message'=> \"You have rejected \".User::find\n ($leave->user_id)->display_name.\" \".$leave->no_days.\" day(s) leave application. \"]);\n\n }else{\n\n return response()->json(['result'=>'0','message'=> \"You are not authorized\"]);\n\n }\n\n\n\n\n\n }", "public function reject()\n {\n return $this->setStatus(self::STATUS_REJECTED);\n }", "function getReject(){\n //check for the requested invitation available or not\n // $get_invite_id=$this->validateInvitationSecret();\n $invitation=MedicalGroupInvitation::find('all',array('conditions' => array('(user_id=? or email=?) and secret=? and active=1',$this->user_id,$this->email,$this->secret)));\n \n if(!empty($invitation)){\n foreach($invitation as $inv){\n $inv->status=\"REJECTED\";\n $inv->active=0;\n $inv->updated_on=time();\n $inv->save();\n }\n return TRUE;\n }\n else{\n return FALSE;\n }\n }", "public function rejectInvitation() {\n\t\t$this->autoRender = false;\n\t\t$communityId = $this->request->data['communityId'];\n\t\t$community = $this->Community->findById($communityId);\n\t\tif (!empty($community)) {\n\t\t\t$userId = $this->Auth->user('id');\n\t\t\t$this->CommunityMember->reject($communityId, $userId);\n\t\t\t//Community unfollow data\n\t\t\t$followCommunityData = array(\n\t\t\t\t'type' => FollowingPage::COMMUNITY_TYPE,\n\t\t\t\t'page_id' => $communityId,\n\t\t\t\t'user_id' => $userId\n\t\t\t);\n\t\t\t$this->FollowingPage->unFollowPage($followCommunityData);\n\t\t\t$this->Session->setFlash(__('The invitation has been rejected.'), 'success');\n\t\t} else {\n\t\t\t$this->Session->setFlash(__($this->invalidMessage), 'error');\n\t\t}\n\t}", "public function rejectTerms(){\n $db = DB::prepare('Delete FROM accept_terms WHERE user_id = ?');//Status 1 == accepted\n return $db->execute(array($this->id));\n }", "public function actionRejectByHrd($id){\n $model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all();\n\n foreach ($model as $m) {\n $m->status_by_hrd = 4;\n $m->status_by_atasan = 4;\n $m->status_by_wr2 = 4;\n }\n\n if($m->save()){\n \\Yii::$app->messenger->addErrorFlash(\"Permohonan Izin telah di-reject oleh HRD\");\n return $this->redirect(['index-by-hrd']);\n } else {\n return $this->render('viewByHrd', [\n 'model'=>$model\n ]);\n }\n }", "public function rejectInvitation()\n\t{\n\t\t$id = $this->request->data['id'];\n\t\t$invite['MeetingUser']['id'] = $id;\n\t\t//set status 1 as accepted\n\t\t$invite['MeetingUser']['is_accept'] = 2;\n\t\t$invite['MeetingUser']['is_read'] = 1;\n\t\t$invite['MeetingUser']['is_attend'] = 0;\n\t\t//set notification\n\t\t$oldCount1 = $this->Session->read('oldMeetingCount');\n\t\tif ($oldCount1>0) {\n\t\t\t$newCount1 = $oldCount1-1;\n\t\t\t$this->Session->write('oldMeetingCount',$newCount1);\n\t\t}\n\t\tif($this->MeetingUser->save($invite))\n\t\t\techo \"1\";\n\t\telse\n\t\t\techo \"0\";\n\t\texit;\n\t}", "function rejectBooking($disputeId,$booking_no,$cancel_booking_id)\n\t{\n\t\t\t\n\t\t\t$condition = array('id' => $disputeId,'cancel_status' => $cancel_booking_id);\n\t\t\t$data = array('status' =>'Reject');\n\t\t\t$ok = $this->review_model->update_details(DISPUTE,$data,$condition);\n\t\t\n\t\t\t/* Mail to Guest Start*/\t\n $newsid='58';\n\t\t\t$template_values=$this->review_model->get_newsletter_template_details($newsid);\n\n\t\t\tif($template_values['sender_name']=='' && $template_values['sender_email']==''){\n\t\t\t\t$sender_email=$this->data['siteContactMail'];\n\t\t\t\t$sender_name=$this->data['siteTitle'];\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$sender_name=$template_values['sender_name'];\n\t\t\t\t$sender_email=$template_values['sender_email'];\n\t\t\t} \n \t\t\n\t\t$getdisputeDetails = $this->review_model->get_all_details(DISPUTE,$condition);\n\t\t\n\t\t/*GetHostDetails*/\n\t\t$condition = array (\n\t\t'id' => $getdisputeDetails->row()->disputer_id\n\t\t);\n\t\t$hostDetails = $this->review_model->get_all_details( USERS, $condition );\n\t\t\n\t\t$uid = $hostDetails->row ()->id;\n\t\t$hostname = $hostDetails->row()->user_name;\n\t\t$host_email = $hostDetails->row()->email;\n\t\t\n\t\t\n\t\t/*GetCustomerDetails*/\n\t\t$condition = array (\n\t\t'id' => $getdisputeDetails->row()->user_id\n\t\t);\n\t\t\n\t\t$custDetails = $this->review_model->get_all_details( USERS, $condition );\n\t\t$cust_name = $custDetails->row()->user_name;\n\t\t$email = $custDetails->row()->email;\n\t\t\n\t\t/*GetProductDetails*/\n\t\t$condition = array (\n\t\t'id' => $getdisputeDetails->row()->prd_id\n\t\t);\n\t\t$prdDetails = $this->review_model->get_all_details( PRODUCT, $condition );\n\t\t$prd_title = $prdDetails->row()->product_title;\n\t\t\n $email_values = array(\n\t\t\t\t\t'from_mail_id'=>$sender_email,\n\t\t\t\t\t'to_mail_id'=> $email,\n\t\t\t\t\t'subject_message'=>$template_values ['news_subject'],\n\t\t\t\t\t'body_messages'=>$message\n\t\t\t); \n\t\t\t\n\t\t\t$reg= array('host_name' => $hostname,'cust_name'=>$cust_name,'prd_title'=>$prd_title,'logo' => $this->data['logo']);\t\n $message = $this->load->view('newsletter/ToGuestRejectCancelBooking'.$newsid.'.php',$reg,TRUE);\n\t\t\t\n /*send mail*/\n $this->load->library('email',$config);\n $this->email->from($email_values['from_mail_id'], $sender_name);\n $this->email->to($email_values['to_mail_id']);\n $this->email->subject($email_values['subject_message']);\n $this->email->set_mailtype(\"html\");\n $this->email->message($message); \n\t\t\t\t\t\t\n\t\t\t\t try{\n\t\t\t\t\t$this->email->send();\n\t\t\t\t\t$returnStr ['msg'] = 'Successfully registered';\n\t\t\t\t\t\t$returnStr ['success'] = '1';\n\t\t\t\t\t}catch(Exception $e){\n\t\t\t\t\techo $e->getMessage();\n\t\t\t\t\t} \n \n /* Mail to Guest End*/\n\t\t\n\t\t\techo 'success';\n\t\t\t$this->setErrorMessage('success','Cancel booking rejected successfully');\n\t\t\tredirect('admin/dispute/cancel_booking_list');\t\t\t\t\n\t}", "public function rejectR(Request $request, $id)\n {\n //\n $data = rider::where('Rider_ID', $id)->get();\n $reason = $request->Reason;\n DB::select(\"UPDATE riders set Reason = '$reason' , Rider_Status = 'REJECTED' where Rider_ID = ?\",[$id]);\n $data = DB::select(\"SELECT * FROM riders WHERE Rider_Status = 'PENDING'\");\n $message = \"Rider registration rejected.\";\n echo \"<script type='text/javascript'>alert('$message');</script>\";\n return view('ManageAccount.RegistrationListInterface', compact(\"data\"));\n \n \n }", "public function reject()\n {\n if ($this->withdrawal->status == Withdrawal::STATUS_CREATED) {\n // update withdrawal model\n $this->withdrawal->status = Withdrawal::STATUS_REJECTED;\n $this->withdrawal->save();\n // create a credit transaction on user account to return funds\n $accountService = new AccountService($this->withdrawal->account);\n $accountService->transaction($this->withdrawal, $this->withdrawal->amount);\n }\n }", "public function actionUnsubscribe(){\n $perfil = \\app\\models\\PerfilUsuario::find()->where(['fk_usuario'=>Yii::$app->user->id])->one();\n $igualas_user_viejo = \\app\\models\\IgualasUsers::find()->where(['fk_users_cliente'=>$perfil->id, 'estatus'=>'concretado'])->one();\n if ($igualas_user_viejo){\n $plan_viejo = \\app\\models\\Igualas::find()->where(['id'=>$igualas_user_viejo->fk_iguala])->one();\n try {\n $agreement_viejo = paypalSuspendPlanToUser($igualas_user_viejo->subscription_id);\n }catch(\\Exception $e){\n Yii::$app->getSession()->setFlash('danger',$e->getMessage());\n return $this->redirect(['update', 'id' => Yii::$app->user->id]);\n }\n // $igualas_user_viejo->delete();\n if ($agreement_viejo){\n $igualas_user_viejo->estatus = \"cancelado\";\n $igualas_user_viejo->save();\n Yii::$app->session->setFlash('success', 'Usted ha cancelado la subscripción correctamente.');\n }\n else{\n Yii::$app->session->setFlash('error', 'Problemas al cancelar la subscripción');\n }\n }\n return $this->redirect(['update', 'id' => Yii::$app->user->id]);\n }", "function rejectAction(Request $request) {\n $resource = $this->findOr404($request);\n $arrangementProgramManager = $this->getArrangementProgramManager();\n\n if (!$arrangementProgramManager->isAllowToApprove($resource)) {\n throw $this->createAccessDeniedHttpException();\n }\n $observation = $request->get('observation');\n if (empty($observation)) {\n $this->flashHelper->setFlash('error', 'error_observation');\n } else {\n $resource->setStatus(ArrangementProgram::STATUS_REJECTED);\n $this->addObservation($resource, $observation);\n\n $user = $this->getUser();\n $details = $resource->getDetails();\n $details\n ->setRejectedBy($user)\n ->setRejectedDate(new DateTime());\n\n $this->domainManager->dispatchEvent('pre_rejected', new ResourceEvent($resource));\n\n $this->domainManager->update($resource);\n $this->flashHelper->setFlash('success', 'rejected');\n\n $this->domainManager->dispatchEvent('post_rejected', new ResourceEvent($resource));\n }\n return $this->redirectHandler->redirectTo($resource);\n }", "function rejectRecord(){ \n\n // No need to read the list of participants when processing those tabs\n if ($this->current_tab_does_not_need_applicants()) return True;\n\n $reply = False;\n $dbg_text = '';\n if (is_object($this->b_tabs)){\n $active_tab_index = $this->b_tabs->active_tab();\n $tabs = array_values($this->tabs_toShow);\n $reply = (strpos($tabs[$active_tab_index],'bList') !== False);\n $dbg_text = 'b_Tabs';\n }\n\n $this->v = Null;\n if (!$reply && empty($this->av)) switch ($this->doing){\n\t\n case '2excel':\n\tif (bForm_vm_Visit::_getStatus($this->rec) != STATUS_YES) return True;\n case 'photos':\n\tif (bForm_vm_Visit::_getStatus($this->rec) == STATUS_NO) return True;\n case 'budget':\n case 'myguests':\n case 'budget_byProjects':\n\tbreak;\n\t\n case 'lists':\n\tif (bForm_vm_Visit::_getStatus($this->rec) == STATUS_NO){\n\t if (VM_organizer_here && VM::$e->isEventEndorsed()){\n\t $dbg_text = $this->rec['av_firstname'].' '.$this->rec['av_lastname'].' - After the approval do not show the refused applicants to the organizers';\n\t $reply = True;\n\t }\n\t}\n case 'show_mails_exchange':\n\tif (!cnf_dev && $this->rec['v_type'] === VISIT_TYPE_RENT){\n\t $dbg_text = 'VISIT_TYPE_RENT... to be completed';\n\t $reply = True;\n\t}elseif (empty(VM::$e)){\n\t // Visits outside conferences/programs\n\t if (!VM_administrator_here && ($this->rec['v_host_avid'] != @bAuth::$av->ID)){\n\t $dbg_text = 'not my visit';\n\t $reply = True;\n\t }else{\n\t // Guarantee the correct value of status&policy in the snapshot record\n\t if (empty($this->rec['v_status'])){\n\t $this->v = loader::getInstance_new('bForm_vm_Visit',$this->rec['v_id'],'fatal');\n\t $this->rec['v_status'] = $this->v->getStatus();\n\t $this->rec['v_policy'] = $this->v->getValue('v_policy',True);\n\t }\n\t }\n\t}\n }\n if ($reply) $this->dbg($dbg_text);\n return $reply;\n }", "public function testRejectDenyNotHrAndAdmin() {\n\t\t$this->setExpectedException('MissingActionException');\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER => '',\n\t\t\tUSER_ROLE_USER | USER_ROLE_SECRETARY => 'secret',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'reject',\n\t\t\t\t'3',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkIsNotAuthorized();\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "public function reject() {\n }", "public function actionRejectByAtasan($id, $redback=null){\n $model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all();\n\n foreach ($model as $m) {\n $m->status_by_atasan = 4;\n $m->status_by_wr2 = 4;\n }\n\n if($m->save()){\n \\Yii::$app->messenger->addSuccessFlash(\"Permohonan Izin telah di-reject oleh Atasan\");\n if(is_null($redback))\n return $this->redirect(['index-by-atasan']);\n else\n return $this->redirect(Yii::$app->request->referrer);\n } else {\n return $this->render('viewByAtasan', [\n 'model'=>$model\n ]);\n }\n }", "public function reject($id)\n {\n //\n $data = rider::where('Rider_ID', $id)->get();\n return view('ManageAccount.RejectRegistrationInterface', compact(\"data\"));\n }", "public function actionToreject()\n {\n $reject = new ClientReject;\n if ($reject->load(Yii::$app->request->post())) {\n $client = $this->findModel($reject->client_id);\n if (!\\Yii::$app->user->can('updateClient', ['client' => $client])) {\n throw new ForbiddenHttpException('Нет разрешения на редактирование клиента\"' . $client->name . '\"');\n }\n $client->status = Client::STATUS_REJECT;\n\n $valid = $client->validate();\n $valid = $reject->validate() && $valid;\n\n if ($valid) {\n $transaction = \\Yii::$app->db->beginTransaction();\n try {\n if (! ($flag = $client->save(false))) {\n $transaction->rollBack();\n }\n if (! ($flag = $reject->save(false))) {\n $transaction->rollBack();\n }\n if ($flag) {\n $transaction->commit();\n return $this->redirect(['client/reject']);\n }\n } catch (Exception $e) {\n $transaction->rolBack();\n }\n }\n }\n }", "public static function reject() {\n return new Reject('Not match Organic Subset');\n }", "private function rejectOrder($order){\r\n $this->log('Rejecting order #'.$order->get_order_number());\r\n $this->addOrderNote($order, 'La orden fue rechazada por Flow');\r\n $order->update_status('failed');\r\n }", "function reject( $booking_ids ){\n\t\treturn $this->set_status(2, $booking_ids);\n\t}", "public function actionAcceptByWr2($id){\n $model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all();\n\n foreach ($model as $m) {\n $m->status_by_wr2 = 6;\n }\n\n if($m->save()){\n \\Yii::$app->messenger->addSuccessFlash(\"Permohonan Izin telah di-accept oleh WR 2\");\n return $this->redirect(['index-by-wr2']);\n } else {\n return $this->render('viewByWr2', [\n 'model'=>$model\n ]);\n }\n }", "public function ajaxDeclineRequest()\n\t{\n\t\t$request = FriendshipRequest::declineRequest(Input::get('id'));\n\t\treturn array('error' => 0);\n\t}", "public function reject($id)\n {\n //Mengambil session admin\n $id_user = $this->session->userdata('id_user');\n\n //Melakukan update data ticket dengan mengubah status ticket menjadi 0, data ditampung ke dalam array '$data' yang nanti akan diupdate dengan query\n $data = array(\n 'status' => 0,\n 'last_update'=> date(\"Y-m-d H:i:s\")\n );\n\n //Melakukan insert data tracking ticket bahwa ticket di-reject oleh admin, data tracking ke dalam array '$datatracking' yang nanti akan di-insert dengan query\n $datatracking = array(\n 'id_ticket' => $id,\n 'tanggal' => date(\"Y-m-d H:i:s\"),\n 'status' => \"Ticket Rejected\",\n 'deskripsi' => \"\",\n 'id_user' => $id_user\n );\n\n //Query untuk melakukan update data ticket sesuai dengan array '$data' ke tabel ticket\n $this->db->where('id_ticket', $id);\n $this->db->update('ticket', $data);\n\n //Query untuk melakukan insert data tracking ticket sesuai dengan array '$datatracking' ke tabel tracking\n $this->db->insert('tracking', $datatracking);\n }", "public function reject($id)\n {\n $interview = Interview::findOrFail($id);\n\n $interview->update([\n 'status' => 'rejected'\n ]);\n }", "public function deny($obj, $actions){\r\n $this->_type = NULL;\r\n $this->loadObject();\r\n $suc = $this->_obj->deny($obj, $actions);\r\n \r\n return $suc;\r\n }", "public function actionCheckwarranty()\n {\n $repairs = new Repair();\n $repairs = $repairs->getRepairOutWarranty();\n\n if (sizeof($repairs)>0){\n\n $body = \"Foi detetado que algumas reparações estão prestes a terminar a garantia nos próximos <b>5 dias</b>. <br/><br/>\n Aceda ao portal em <a href=\\\"http://sat.toquereservado.pt/backend/web/warning/warranty\\\">www.sat.toquereservado.pt</a> para identificar e resolver o problema das seguintes reparações:\n <br/>\n <ul>\n \";\n\n foreach($repairs as $row) {\n $body.='\n <li>\n <a href=\"http://sat.toquereservado.pt/backend/web/warning/warranty?SearchRepair%5Bid_repair%5D='.$row[\"id_repair\"].'&SearchRepair%5Bstore_id%5D=&SearchRepair%5Bequip%5D=&SearchRepair%5Bmodel%5D=&SearchRepair%5Brepair_desc%5D=&SearchRepair%5Bclient%5D=&SearchRepair%5Bdate_entry%5D=&SearchRepair%5Bdatediff%5D=\">'.$row[\"id_repair\"].'</a>\n </li>\n ';\n }\n\n $body.=\"</ul>\";\n\n //echo $body; \n\n $to = \\Yii::$app->params[\"adminEmail\"];\n $from = \\Yii::$app->params[\"adminEmail\"];\n $subject = \"Garantia a expirar\";\n\n $name='=?UTF-8?B?'.base64_encode(\"Sistema de Gestão de ToqueReservado\").'?=';\n $subject='=?UTF-8?B?'.base64_encode($subject).'?=';\n $headers=\"From: $name <{$from}>\\r\\n\".\n \"Reply-To: {$to}\\r\\n\".\n \"MIME-Version: 1.0\\r\\n\".\n \"Content-Type: text/html; charset=UTF-8\";\n\n mail($to,$subject,$body,$headers);\n }\n }", "public function reject()\n {\n $this->channel->basic_reject(\n $this->tag(),\n true\n );\n }", "public function deniedAction() {\n \t// assegno i valori alla view\n $this->viewInit();\n \t$this->view->title = parent::$_config->application->name.\" - Accesso Negato\";\n \t$this->view->pagetitle = \"Accesso Negato\";\n \t$this->view->message = \"Stai tentando di accedere a una risorsa non consentita per il tuo profilo.\";\n }", "private static function reject($args, $invite, $auth) {\n $values = array(\n 'id'=>$invite['id'],\n 'deleted' => 't'\n );\n $s = submission_builder::build_submission($values, array('model' => 'group_invitation'));\n $r = data_entry_helper::forward_post_to('group_invitation', $s, $auth['write_tokens']);\n hostsite_show_message(lang::get(\"OK, thanks anyway. We've removed your invitation to join this group.\"));\n hostsite_goto_page($args['groups_page_path']);\n return '';\n }", "public function reject_doc($id)\n {\n $countDoc = ProviderDocument::where('provider_id', $id)->count();\n if ($countDoc > 0) {\n ProviderDocument::where('provider_id', $id)->update(['verification_status' => 2]);\n Provider::where('id', $id)->update(['status' => 'banned', 'admin_verified' => 0]);\n } else {\n Provider::where('id', $id)->update(['admin_verified' => 1]);\n }\n return back()->with('flash_success', \"Provider Document Disapproved\");\n }", "function reject_leave($data) {\n global $conn;\n\n $id = htmlspecialchars($data['id_cuti']);\n $pesan = htmlspecialchars($data['pesan']);\n\n $query = \"UPDATE cuti\n SET pesan = '$pesan',\n status = 'rejected'\n WHERE id_cuti = '$id'\";\n\n mysqli_query($conn, $query);\n \n return mysqli_affected_rows($conn);\n \n\n //APPROVE LEAVE END\n // mysqli_query($conn, $quer \"UPDATE cuti SET status = 'rejected' WHERE id_cuti = $id\");\n }", "public static function rejectMessage($id) {\n $que = \"UPDATE message SET is_approved = 'N' where id = '{$id}'\";\n $gets = mysql_query($que);\n return $gets;\n }", "public function rejectInvitation($id){\n\n $invite = Invitation::find($id);\n $invite->delete();\n return redirect()->back();\n }", "public function rejectExpiredRequests()\n {\n try {\n $expiredRequests = CustomRequest::where('status', RequestStatus::Verification)\n ->whereDate('expiry_date', Carbon::today())\n ->where('type', CreationType::KP)\n ->get();\n\n foreach ($expiredRequests as $key => $expiredRequest) {\n $expiredRequest->status = RequestStatus::RejectBySistem;\n $expiredRequest->expiry_date = null;\n $expiredRequest->save();\n Log::info('Sedang menolak pendaftaran '. CreationType::getString($expiredRequest->type) .' : '. $expiredRequest->student()->first()->npm . ' | '. $expiredRequest->student()->first()->name);\n }\n } catch(\\Exception $e) {\n $errorStr = method_exists($e, 'getMessage') ? json_decode($e->getMessage()) : json_encode($e);\n Log::info($errorStr);\n }\n }", "public function rejected()\n {\n $this->setStatus(self::STATUS_REJECTED);\n }", "function invi_accept() {\n if(isset($_GET['room_id'], $_GET['user_id'], $_GET['invi_id'])) {\n $data = $this->mod_user->md_acceptInvi($_GET['room_id'], $_GET['user_id'], $_GET['invi_id']);\n } else {\n die();\n }\n }", "public function reject(Recruitment $model)\n {\n $requestStatus = Option::firstWhere([\n 'type' => 'REQUEST_STATUS',\n 'name' => 'REJECTED'\n ])->id;\n $logs = LogDB::where('model', $this->log_model)\n ->where('model_id',$model->id)\n ->orderBy('created_at', 'DESC')\n ->get();\n $contents = array(\n array(\n 'label' => 'Reason to reject',\n 'field' => 'remark',\n 'has_logs' => $logs->contains('field', 'remark'),\n 'type' => 'textarea'\n ),\n array(\n 'field' => 'request_status_id',\n 'type' => 'hidden',\n 'value' => $requestStatus\n ),\n array(\n 'field' => 'change_request_status_by_user',\n 'type' => 'hidden',\n 'value' => \\Auth::user()->id\n ),\n );\n return view('page.content.edit')\n ->with('model', $model)\n ->with('logs',$logs)\n ->with('contents', $contents);\n }", "public function rejectTimesheet() {\n $id = request('timesheetId');\n $notes = request('notes');\n Timesheet::find($id)->update([\n 'status'=>'rejected',\n 'notes'=>$notes\n ]);\n return back();\n }", "public function handleDeclineInvite($iid) {\n\t\tCourseListModel::declineInvite($iid);\n\t\t$this->redirect('this');\n\t}", "public function reject()\n {\n $url = URIResource::Make($this->path, array($this->id));\n $data = new DataPacket(array(\"state\" => CALL_STATES::rejected));\n $this->client->post($url, $data->get());\n\n return Constructor::Make($this, $data->get());\n }", "public function rejectInvite($inviterID) {\n\t\treturn ConnectionFactory::DeleteRowFromTable(\"agencies\", array('user_one_id'=>$inviterID, \n\t\t\t\t'user_two_id'=>$this->id));\n\t}", "public function rejected() {\n\n $data = array();\n $data['result'] = $this->property_model->fetchAll(getLoginUserId(), 2); // Rejected\n $data['title'] = \"Rejected Properties\";\n \n $this->render('admin/property/rejected', $data);\n }", "public function actionReject($campaign_id, $channel_id)\n {\n if (Yii::$app->request->isAjax) {\n $model = $this->findModel($campaign_id, $channel_id);\n $model->status = 3;\n if ($model->save()) {\n return 'success';\n }\n// return $campaign_id.$channel_id;\n }\n\n }", "public function deny($obj, $actions){\r\n $this->loadAro();\r\n return $this->aro->deny($obj, $actions);\r\n }", "public function rejected()\n {\n $spare_parts_orders_id = Input::get('spare_parts_orders_id');\n $data = SparePartsOrderModel::where('spare_parts_orders_id', $spare_parts_orders_id)->first();\n $data->confirmation = 'rejected';\n if ($data->save()) {\n $notification = array(\n 'message' => 'Successfully Rejected this Order.',\n 'alert-type' => 'success'\n );\n return redirect()->back()->with($notification);\n }\n }", "public function cancelRequestOfUserForReceivedApprovedRequest() {\n extract($_GET);\n $gender = $this->session->userdata('key_gender');\n $encodedkey = $this->session->userdata('PariKey_session');\n $key = base64_decode($encodedkey);\n $keyarr = explode('|', $key);\n $sessionUser_id = $keyarr[2];\n $result = $this->Searchbyprofileid_model->cancelRequestOfUserForReceivedApprovedRequest($profile_user_id, $sessionUser_id, $gender);\n// print_r($result);\n// die();\n if ($result == 200) {\n echo 200;\n } else {\n echo 500;\n }\n }", "public function reject($requests) {\n foreach ($requests as $teacher_id) {\n $this->deleteFromRequest($teacher_id);\n }\n}", "public function ajax_deny_approval()\n {\n if (empty($_POST)) return;\n\n ee()->load->model('publisher_approval');\n $msg = ee()->publisher_approval->deny();\n ee()->publisher_helper->send_ajax_response($msg);\n }", "#[Post('/revoke')]\n protected final function postRevoke(): Effect\n {\n $client = $this->ensureClientFromHeader();\n $token = $this->request->post->get('token');\n $tokenTypeHint = $this->request->post->get('token_type_hint');\n $tokenFactory = $this->oAuth2->tokenFactory;\n\n if ($token !== null) {\n if ($tokenTypeHint === 'access_token' && ($accessToken = $tokenFactory->getAccessToken($token)) !== null) {\n $tokenFactory->revokeAccessToken($client, $accessToken);\n } else if ($tokenTypeHint === 'authorization_code' && ($authorizationCode = $tokenFactory->getAuthorizationCode($client, $token)) !== null) {\n $tokenFactory->revokeAuthorizationCode($client, $authorizationCode);\n } else if ($tokenTypeHint === 'refresh_token' && ($refreshToken = $tokenFactory->getRefreshToken($client, $token)) !== null) {\n $tokenFactory->revokeRefreshToken($client, $refreshToken);\n } else {\n if (($accessToken = $tokenFactory->getAccessToken($token)) !== null) {\n $tokenFactory->revokeAccessToken($client, $accessToken);\n } else if (($authorizationCode = $tokenFactory->getAuthorizationCode($client, $token)) !== null) {\n $tokenFactory->revokeAuthorizationCode($client, $authorizationCode);\n } else if (($refreshToken = $tokenFactory->getRefreshToken($client, $token)) !== null) {\n $tokenFactory->revokeRefreshToken($client, $refreshToken);\n }\n }\n }\n\n $this->router\n ->getResponseRegistry()\n ->responseCode(HttpResponseCode::OK);\n\n return new VoidEffect($this->router);\n }", "public static function reject() {\n return new Reject('Not match Atom in []');\n }", "public function getRejected();", "public function cancelRequest(){\n //the other users Id\n $otherUserId = $_POST[\"otherUserId\"];\n //deletes the record in the database\n $this->individualGroupModel->cancelGroupRequestInvitation($otherUserId); \n //redirects\n $path = '/IndividualGroupController/individualGroup?groupId=' . $_SESSION['current_group']; \n redirect($path);\n }", "public function reject_article($request)\n {\n $this->status_id = 4;\n\n if($this->update()) {\n $message = new Article_Reject_Messages;\n $message->article_id = $this->id;\n $message->text = $request['reason'];\n if($message->save()){\n Session::flash('flash_message_text', 'Статья была успешно отклонена');\n Session::flash('flash_message_class', 'success');\n if(Auth::user()->user_type == 4) return redirect('/dashboard/administrator/moderation_list');\n return redirect('/dashboard/moderator/moderation_list');\n }\n else {\n Session::flash('flash_message_text', 'Ошибка создания сообщения');\n Session::flash('flash_message_class', 'danger');\n if(Auth::user()->user_type == 4) return redirect('/dashboard/administrator/moderation_list');\n return redirect('/dashboard/moderator/moderation_list');\n }\n\n }\n else {\n Session::flash('flash_message_text', 'Ошибка отклонения статьи');\n Session::flash('flash_message_class', 'danger');\n return back();\n }\n }", "public function sendReject($id='')\n {\n $data['info'] = $this->m_scholar->singleGet($id);\n $email = $this->m_scholar->emailGet($data['info']->Student_id);\n $msg = 'Dear '. $data['info']->name.',\n Your Karnataka Labour Welfare Board Scholarship has been rejected from Labour Welfare Board due to '.$data['info']->reject_reason.', More information login to your account and check the Scholarship status';\n $this->studentSms($msg,$id);\n $this->load->config('email');\n $this->load->library('email');\n $from = $this->config->item('smtp_user');\n $msg = $this->load->view('mail/reject', $data, true);\n $this->email->set_newline(\"\\r\\n\");\n $this->email->from($from , 'Karnataka Labour Welfare Board');\n $this->email->to($email);\n $this->email->subject('Scholarship application Rejected from Labour Welfare Board'); \n $this->email->message($msg);\n if($this->email->send()) \n {\n return true;\n } \n else\n {\n \n return false;\n }\n }", "function deny()\r\n\t{\r\n\t\tJRequest::checkToken() or jexit('Invalid Token');\r\n\t\t\r\n\t\t// Get the selected items\r\n\t\t$cid = JRequest::getVar('cid', array(0), 'post', 'array');\r\n\t\t\r\n\t\t$total = count($cid);\r\n\t\t$msg = JText::sprintf('RSM_TRANSACTIONS_DENIED', $total);\r\n\t\t\r\n\t\t// Force array elements to be integers\r\n\t\tJArrayHelper::toInteger($cid, array(0));\r\n\t\t\r\n\t\t$msg = '';\r\n\t\t\r\n\t\t// No items are selected\r\n\t\tif (!is_array($cid) || count($cid) < 1)\r\n\t\t\tJError::raiseWarning(500, JText::_('SELECT ITEM'));\r\n\t\telse\r\n\t\t{\r\n\t\t\t$user =& JFactory::getUser();\r\n\t\t\t$user_id = $user->get('username');\r\n\t\t\tforeach ($cid as $id)\r\n\t\t\t{\r\n\t\t\t\tRSMembership::saveTransactionLog('Manually denied by '.$user_id, $id);\r\n\t\t\t\tRSMembership::deny($id);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$total = count($cid);\r\n\t\t\t$msg = JText::sprintf('RSM_TRANSACTIONS_DENIED', $total);\r\n\t\t\t\r\n\t\t\t// Clean the cache, if any\r\n\t\t\t$cache =& JFactory::getCache('com_rsmembership');\r\n\t\t\t$cache->clean();\r\n\t\t}\r\n\t\t\r\n\t\t$this->setRedirect('index.php?option=com_rsmembership&view=transactions', $msg);\r\n\t}", "public function cancelMyReserved($id);", "public function disapprove()\n {\n return $this->approve(false);\n }", "public function reject_complaint($id)\n {\n $output['token'] = $this->security->get_csrf_hash();\n header('Content-Type: application/json');\n $output['response'] = $this->database->_update_to_table('tbl_reports', array('status' => 2), array('id' => $id));\n $output = html_escape($this->security->xss_clean($output));\n exit(json_encode($output));\n }", "public function cancel_approve_request($id_exam)\n {\n try {\n $exam = $this->_db_exam->get_a_exam_file($id_exam);\n //kiem tra xem co phai de cua nguoi nay khong\n //kiem tra xem co phai de duoc phep huy gui duyet khong\n if (is_null($exam) || $exam->status != EXAM_WAITING_APPROVE) {\n return redirect()->back()\n ->with('message_notification', \"Đề thi này không được hủy gửi yêu cầu duyệt\");\n }\n $rs = $this->_db_exam->cancel_send_approve($id_exam);\n if (is_numeric($rs)) {\n return redirect('ctv/exam/have_answer/list=%20')\n ->with('message_success', \"Hủy yêu cầu duyệt đề thi thành công\");\n } else {\n return redirect()->back()\n ->with('message_notification', \"Hủy yêu cầu duyệt thất bại\");\n }\n\n } catch (\\Exception $ex) {\n return $ex;\n }\n }", "public function reject( $id ) {\n\t\treturn ( new TripController() )->destroy( $id );\n\t}", "public static function reject() {\n return new Reject('Not match Reference');\n }", "public function reject(array $messages);", "public function actionAjaxWhyStatusDeactivate()\n {\n\t $id=$_REQUEST['id'];\n\t $rec=WhyUsHome::model()->findByPk(array('id'=>$id));\n\t $status=$rec->status;\n\t if($status==1)\n\t {\n\t \t $rec->status=0;\n\t \t $rec->save();\n\t }\n\t else\n\t { \n\t $rec->status=1;\n\t \t $rec->save(); \n\n\t \t \n\t }\t\n }", "function lobby_membersapi_reject($args)\r\n{\r\n\t$uid = (int)$args['uid'];\r\n\t$group = $args['group'];\r\n\t$gid = (int)$group['id'];\r\n\tif (!($uid > 1) || !($gid > 0)) {\r\n \t \tLogUtil::registerError(_LOBBY_GROUP_REJECT_MEMBER_FAILURE);\r\n\t\treturn false;\r\n\t} else {\r\n\t \t// get Group\r\n\t \t$table \t\t= pnDBGetTables();\r\n\t \t$column\t\t= $table['lobby_members_pending_column'];\r\n\t \t$where\t\t= $column['uid'].\" = \".$uid.\" AND \".$column['gid'].\" = \".$gid;\r\n\t\t$result\t\t= DBUtil::selectObjectArray('lobby_members_pending',$where);\r\n\t\t$obj = $result[0];\r\n\t\t$result = DBUtil::deleteObject($obj,'lobby_members_pending');\r\n\t\tif ($result) {\r\n\t\t\tLogUtil::registerStatus(_LOBBY_MEMBERSHIP_REQUEST_REJECTED);\r\n\t\t\t// send Mail\r\n\t\t\tLoader::includeOnce('modules/lobby/includes/common_email.php');\r\n\t\t\tlobby_notify_rejectmembershiprequest($group,$uid);\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t \tLogUtil::registerError(_LOBBY_MEMBERSHIP_REJECT_ERROR);\r\n\t\t \treturn false;\r\n\t\t}\r\n\t}\r\n}", "public function treatmentSaveDraft2($risk_id, $suggested_rt, $risk, $impact, $actplan, $control, $objective, $uid)\n\t{\n\t\t//ubah2\n\t\t$risk_id_cek = $risk_id;\n\t\t$sql=\"select risk_existing_control from t_risk where risk_id = '$risk_id_cek' \";\n\t\t$query = $this->db->query($sql);\n\t\t$row = $query->row(); \n\t\t$hasil = $row->risk_existing_control;\n\t\tif($hasil != 'under'){\n\n\t\t$r_status = $risk['risk_status'];\n\t\t//update T-risk risk status sama switch_flag\n\t\t$sql = \"update t_risk set risk_status = '\".$r_status.\"', switch_flag='P' where risk_id = '\".$risk_id.\"' \";\n\t\t$res = $this->db->query($sql);\n\n\t\t$sql = \"update t_risk_impact set switch_flag='P' where risk_id = '\".$risk_id.\"' \";\n\t\t$res = $this->db->query($sql);\n\n\t\tif($suggested_rt == 'ACCEPT'){\n\n\t\t}else{\n\n\t\t\t$sql = \"update t_risk_action_plan set switch_flag='P' where risk_id = '\".$risk_id.\"' \";\n\t\t\t$res = $this->db->query($sql);\n\t\t}\n\n\t\t$sql = \"update t_risk_control set switch_flag='P' where risk_id = '\".$risk_id.\"' \";\n\t\t$res = $this->db->query($sql);\n\n\t\t$sql = \"update t_risk_objective set switch_flag='P' where risk_id = '\".$risk_id.\"' \";\n\t\t$res = $this->db->query($sql);\n\n/*\n\t\t$sql = \"delete from t_risk where risk_id = ? and switch_flag='P' \";\n\t\t$res = $this->db->query($sql, array('rid'=>$risk_id));\n\t\t\n\t\t$sql = \"delete from t_risk_impact where risk_id = ? and switch_flag='P' \";\n\t\t$res = $this->db->query($sql, array('rid'=>$risk_id));\n\t\t\n\t\t$sql = \"delete from t_risk_action_plan where risk_id = ? and switch_flag='P' \";\n\t\t$res = $this->db->query($sql, array('rid'=>$risk_id));\n\t\t\n\t\t$sql = \"delete from t_risk_control where risk_id = ? and switch_flag='P' \";\n\t\t$res = $this->db->query($sql, array('rid'=>$risk_id));\n\t\t\n\t\t$sql = \"insert into t_risk \n\t\t\t\tselect * from t_risk_change where risk_id = ? and switch_flag='P' \";\n\t\t$res = $this->db->query($sql, array('rid'=>$risk_id));\n\t\t\n\t\tif ($res) {\n\t\t\t// insert impact\n\t\t\t$sql = \"insert into t_risk_impact(risk_id, impact_id, impact_level, switch_flag) values(?, ?, ?, 'P')\";\n\t\t\tforeach ($impact as $key => $value) {\n\t\t\t\t$par = array(\n\t\t\t\t\t'rid' => $risk_id,\n\t\t\t\t\t'iid' => $value['impact_id'],\n\t\t\t\t\t'il' => $value['impact_level']\n\t\t\t\t);\n\t\t\t\t$res3 = $this->db->query($sql, $par);\n\t\t\t}\n\t\t\t\n\t\t\t// insert action plan\n\t\t\t$sql = \"insert into t_risk_action_plan(risk_id, action_plan_status, action_plan, due_date, division, switch_flag) \n\t\t\t\t\tvalues(?, 0, ?, ?, ?, 'P')\";\n\t\t\tforeach ($actplan as $key => $value) {\n\t\t\t\t$dd = implode('-', array_reverse( explode('-', $value['due_date']) ));\n\t\t\t\t$par = array(\n\t\t\t\t\t'rid' => $risk_id,\n\t\t\t\t\t'ap' => $value['action_plan'],\n\t\t\t\t\t'dd' => $dd,\n\t\t\t\t\t'div' => $value['division']\n\t\t\t\t);\n\t\t\t\t$res4 = $this->db->query($sql, $par);\n\t\t\t}\n\t\t\t\n\t\t\t// insert action plan\n\t\t\t$sql = \"insert into t_risk_control(\n\t\t\t\t\t\trisk_id, existing_control_id, risk_existing_control, \n\t\t\t\t\t\trisk_evaluation_control, risk_control_owner,switch_flag) \n\t\t\t\t\tvalues(?, ?, ?, ?, ?, 'P')\";\n\t\t\tforeach ($control as $key => $value) {\n\t\t\t\t$value['existing_control_id'] = $value['existing_control_id'] == '' || $value['existing_control_id'] == '0' ? null : $value['existing_control_id'];\n\t\t\t\t$par = array(\n\t\t\t\t\t'rid' => $risk_id,\n\t\t\t\t\t'ap' => $value['existing_control_id'],\n\t\t\t\t\t'dd' => $value['risk_existing_control'],\n\t\t\t\t\t'da' => $value['risk_evaluation_control'],\n\t\t\t\t\t'div' => $value['risk_control_owner']\n\t\t\t\t);\n\t\t\t\t$res5 = $this->db->query($sql, $par);\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\t*/\n\t\t\n\t\treturn $res;\n\t}\n\n\t}", "public function reject($mixed = null) {\n\t\t$validParameters = array(\n\t\t\t'(orderv2\\reject)',\n\t\t);\n\t\t$args = func_get_args();\n\t\t$this->_checkArguments($args, $validParameters);\n\t\treturn $this->__soapCall('reject', $this->make_soap_params($mixed));\n\t}", "public static function declineRequest($userId1, $userId2 = null)\n {\n /*if($userId2 == null)\n $userId2 = self::getLoggedInUser()->id;\n\n $relation = Friends::where('user_that_sent_request', $userId1)->where('user_that_accepted_request', $userId2)->where('accepted', '0')->first();\n\n $relation->accepted = 2;\n $relation->save();*/\n\n if(!Friends::isRequested($userId1, $userId2))\n return;\n\n $request = Friends::request($userId1, $userId2)->first();\n\n $request->setStatus(2);\n\n $request->save();\n\n }", "public function doRejectTransfer($iClient = 0, $iAccount = 0, $fromDate = null, $toDate = null, $iOperation=0) {\n if ($iOperation == 0) {\n $this->redirect('ctransaction/showTransferList/', 'Nebyla zvolena operace', 3);\n }\n $oOperation = $this->moperation->getById($iOperation);\n $oOperation->state = 2;\n $oOperation->employee = $_SESSION['user_id'];\n $oOperation->update();\n $this->redirect('ctransaction/showTransferList/'.$iClient.'/'.$iAccount.'/'.$fromDate.'/'.$toDate, 'Klient byl odmítnut', 1);\n }", "public static function reject($id)\n {\n return Order::where('id',$id)\n ->update(['status'=>'CANCELLED']);\n }", "public function disapprove($id)\n {\n Provider::where('id', $id)->update(['status' => 'banned']);\n return back()->with('flash_success', \"Provider Disapproved\");\n }", "public function reject(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'aula_id' => 'required',\n 'aluno_id' => 'required',\n 'mensagem' => 'required'\n ]);\n\n if($validator->fails()){\n return $this->sendError('Validation Error.', $validator->errors()); \n }\n \n $aula = Aula::find($request->aula_id);\n $aluno = Aluno::find($request->aluno_id);\n\n if(auth()->user()->roles->pluck('name')[0] == 'Professor' && auth()->user()->professor->id == $aula->professor_id) {\n DB::table('aula_aluno')->where('aula_id',$aula->id)->where('aluno_id',$aluno->id)->update([\n 'status' => 'Rejeitado',\n 'mensagem' => $request->mensagem,\n 'visualizado' => 0,\n ]);\n\n $inscricao = DB::table('aula_aluno')->where('aula_id',$aula->id)->where('aluno_id',$aluno->id)->first();\n $aula->inscricoes = $inscricao;\n\n return $this->sendResponse(new AulaResource($aula), 'Participation accept successfully.');\n }\n\n return $this->sendError('You cannot reject the selected participation.');\n }", "public function DenyAuction($id){\n\n\t\t\tif ($this->session->has_userdata(\"user\")){\n\t\t\t\t$user = $this->session->userdata(\"user\");\n\t\t\t\t\n\t\t\t\tif ($user->user_rank < 1){\n\t\t\t\t\tredirect(\"InfoMessage/PageNotFound\");\n\t\t\t\t}\n\t\t\t\telse{\n\n\t\t\t\t\t$auction = $this->Auction->getAuctionById($id);\n\n\t\t\t\t\tif (count($auction) == 1){\n\n\t\t\t\t\t\tif ($auction[0]->auction_state == \"Pending confirmation\"){\n\n\t\t\t\t\t\t\t$this->db->set(\"auction_state\", \"Denied\");\n\t\t\t\t\t\t\t$this->db->where(\"auction_id\", $id);\n\t\t\t\t\t\t\t$this->db->update(\"auctions\");\n\n\t\t\t\t\t\t\tredirect(\"InfoMessage/AuctionDenySuccess\");\n\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tredirect(\"InfoMessage/AuctionDenyFailed\");\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tredirect(\"InfoMessage/AuctionNotFound\");\n\t\t\t\t\t}\n\n\t\t\t\t} \n\t\t\t}\n\t\t\telse{\n\t\t\t\tredirect(\"InfoMessage/PageNotFound\");\n\t\t\t}\n\n\t\t}", "public function deactivate()\n {\n $project = $this->getProject();\n $recovery_plan_id = $this->request->getIntegerParam('recovery_plan_id', 0);\n\n\n $this->response->html($this->template->render('status:recoveryPlanDetail/makeInactive', array(\n 'title' => t('Remove recovery plan'),\n 'project_id' => $project['id'],\n 'values' => array('id' => $recovery_plan_id)\n )));\n }", "public function cancelRequestOfUserForReceived() {\n extract($_GET);\n $gender = $this->session->userdata('key_gender');\n $encodedkey = $this->session->userdata('PariKey_session');\n $key = base64_decode($encodedkey);\n $keyarr = explode('|', $key);\n $sessionUser_id = $keyarr[2];\n $result = $this->Searchbyprofileid_model->cancelRequestOfUserForReceived($profile_user_id, $sessionUser_id, $gender);\n// print_r($result);\n// die();\n if ($result == 200) {\n echo 200;\n } else {\n echo 500;\n }\n }", "public function rejectedits() {\n\t\t\tglobal $db, $user;\n\t\t\t$query = \"delete from content where parent = '\".$this->guid.\"' and revision_id=1\";\n\t\t\t//print \"$query<br>\\n\";\n\t\t\tif ($db->query($query)) {\n\n\t\t\t\t// We have rejected edits to the page\n\t\t\t\taddHistory($user->id, \"\", $this->guid, \"Changes rejected\", $this->template_type.\"s\");\n\n\t\t\t\t// Update this page in the history table also\n\t\t\t\t$query = \"UPDATE history \n\t\t\t\t\tSET completed_action='CHANGES REJECTED', completed_date=now(), completed_by=\".$user->id.\" \n\t\t\t\t\tWHERE action='publish' \n\t\t\t\t\tAND completed_action is null\n\t\t\t\t\tAND (info='Page saved' OR info='Panel saved')\n\t\t\t\t\tAND guid='\".$this->guid.\"'\";\n\t\t\t\tif (!$db->query($query)) {\n\t\t\t\t\t//print \"failed($query)<br>\\n\";\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "function delete_rejectproject($projectid){\n\tglobal $DB;\n\t$msg = \"\";\n\t$atalvar = get_atalvariables();\n\t$course = $DB->get_record('course',array('id'=>$projectid),'id,startdate,enddate,visible');\n\tif($course->startdate==0 && $course->visible==0 && $course->enddate==0){\n\t\t//Project is Rejected by Atal Incharge...Delete it.\n\t\tdelete_innovation($course->id);\n\t\t$msg=\"<p>This Innovation is Rejected, It will Be Deleted From \".$atalvar['sitename'].\"</p>\";\n\n\t\trecord_projectlog($course,'delete',\"Innovation deleted after rejected by school\");\n\t}\n\treturn $msg;\n}", "public function acceptOrDenyAction(Request $request)\n {\n $ad = (int)$request->attributes->get('ad');\n $offer = (int)$request->attributes->get('offer');\n $type = $request->attributes->get('action');\n $userAttr = $this->user->getAttributes();\n $isTest = (int)$request->attributes->get('test');\n $testResult = (int)$request->attributes->get('result');\n $validCSRF = $this->validateCSRF();\n if($isTest == 1 && $testResult == 0)\n {\n $userAttr = array('id' => (int)$request->attributes->get('user'));\n $ad = (int)$request->attributes->get('id');\n $offer = (int)$request->attributes->get('id2');\n $type = 'accepter';\n $validCSRF = true;\n }\n elseif($isTest == 1 && $testResult == 1)\n {\n $userAttr = array('id' => (int)$request->attributes->get('elUser1'));\n $ad = (int)$request->attributes->get('id');\n $offer = (int)$request->attributes->get('id2');\n $type = 'accepter';\n $validCSRF = true;\n }\n elseif($this->isTest)\n {\n $userAttr = array('id' => 2);\n $validCSRF = true;\n }\n $data = $this->enMan->getRepository('AdItemsBundle:AdsOffersPropositions')->propositonExists($ad, $offer, (int)$userAttr['id']);\n if($validCSRF === true && ($type == 'accepter' || $type == 'refuser') && isset($data['id_ad']) && $data['id_ad'] == $ad && isset($data['id_of']) && $offer == $data['id_of'])\n {\n // access tests case\n if($isTest == 1)\n {\n return new Response(parent::testAccess($testResult, 1), 200);\n }\n $this->enMan->getConnection()->beginTransaction();\n try\n {\n $tplVals = array('{AD_TITLE}', '{OFFER_NAME}', '{LOGIN}');\n $realVals = array($data['adName'], $data['offerName'], $this->user->getUser());\n switch($type)\n {\n case 'accepter':\n // add offer to ads_offers table\n $aofEnt = new AdsOffers;\n $aofEnt->setAdsIdAd($this->enMan->getReference('Ad\\ItemsBundle\\Entity\\Ads', $ad));\n $aofEnt->setOffersIdOf($this->enMan->getReference('Catalogue\\OffersBundle\\Entity\\Offers', $offer));\n $aofEnt->setAddedDate('');\n $this->enMan->persist($aofEnt);\n $this->enMan->flush();\n\n $i = 1;\n\n // notify ad's author about the new offer\n $template = str_replace($tplVals, $realVals, file_get_contents(rootDir.'messages/offer_accepted.message'));\n // $templateMail = str_replace($tplVals, $realVals, file_get_contents(rootDir.'mails/offer_accepted.maildoc'));\n $title = \"Proposition a été acceptée\";\n $message = \"Proposition a été correctement acceptée\";\n\n // update ads_modified table with the last modification\n $this->enMan->getRepository('AdItemsBundle:AdsModified')->adModified($ad, 'offer_accepted');\n break;\n case 'refuser':\n $i = -1;\n $template = str_replace($tplVals, $realVals, file_get_contents(rootDir.'messages/offer_denied.message'));\n // $templateMail = str_replace($tplVals, $realVals, file_get_contents(rootDir.'mails/offer_denied.maildoc'));\n $title = \"Proposition a été réfusée\";\n $message = \"Proposition a été correctement supprimée\";\n break;\n }\n $q = $this->enMan->createQueryBuilder()->delete('Ad\\ItemsBundle\\Entity\\AdsOffersPropositions', 'aop')\n ->where('aop.ads_id_ad = ?1 AND aop.offers_id_of = ?2 AND aop.users_id_us = ?3')\n ->setParameter(1, $ad)\n ->setParameter(2, $offer)\n ->setParameter(3, $userAttr['id'])\n ->getQuery();\n $p = $q->execute();\n\n // update offers quantity for this ad\n $this->enMan->getRepository('AdItemsBundle:Ads')->updateOffersQuantity($i, $ad);\t\t\n\n // Send private message\n $author = $this->enMan->getReference('User\\ProfilesBundle\\Entity\\Users', (int)$userAttr['id']);\n $messageVals = array(\n 'title' => $title,\n 'content' => $template,\n 'type' => 2,\n 'state' => 1\n );\n $this->enMan->getRepository('MessageMessagesBundle:Messages')->sendPm($author, $this->enMan->getReference('User\\ProfilesBundle\\Entity\\Users', $data['id_us']), $messageVals);\n\n $emtEnt = new EmailsTemplates;\n $mail = \\Swift_Message::newInstance()\n ->setSubject($title)\n ->setFrom($this->from['mail'])\n ->setTo($data['email'])\n ->setContentType(\"text/html\")\n ->setBody($emtEnt->getHeaderTemplate().$template.$emtEnt->getFooterTemplate());\n $this->get('mailer')->send($mail);\n\n // commit SQL transaction\n $this->enMan->getConnection()->commit();\n if($this->isTest)\n {\n return new Response('accepted_successfully');\n }\n $ret['isError'] = 0;\n $ret['message'] = $message;\n }\n catch(Exception $e)\n {\n $this->enMan->getConnection()->rollback();\n $this->enMan->close();\n throw $e;\n }\n }\n elseif($validCSRF === false)\n {\n $ret['isError'] = 1;\n $ret['message'] = \"Votre session a expiré. Veuillez réessayer\";\n }\n else\n {\n // access tests case\n if($isTest == 1)\n {\n return new Response(parent::testAccess($testResult, 0), 200);\n }\n $ret['isError'] = 1;\n $ret['message'] = \"Une erreur s'est produite\";\n }\n echo json_encode($ret);\n\tdie();\n }", "public function actionDecline()\n {\n $this->render('decline');\n }", "public function reject(Request $request, $id)\n {\n $leave_record = LeaveRecord::find($id);\n $staff_id = $leave_record->staff_id;\n $user = DB::table('users')->where('username',$staff_id)->first();\n\n $data = [\n 'staff_name' => $user->full_name,\n 'man_name' => Auth::user()->full_name,\n 'staff_email' => $user->email,\n 'man_email' => Auth::user()->email,\n ];\n Mail::send(new LeaveRejectMail($data));\n\n /**\n * Check if the leave_record is not the\n * current authenticated leave_record\n */\n $date_current = Carbon::now()->toDateTimeString();\n\n $leave_record->status = $request->input('status');\n $leave_record->status_date = $date_current;\n $leave_record->save();\n return redirect('/my_leave_tasks')->with('info','Selected Leave Request has been Rejected!');\n }", "public function forbiddenAction() {\n }", "public function testApproveDenyNotHrAndAdmin() {\n\t\t$this->setExpectedException('MissingActionException');\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER => '',\n\t\t\tUSER_ROLE_USER | USER_ROLE_SECRETARY => 'secret',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => 'POST',\n\t\t];\n\t\tforeach ($userRoles as $userRole => $userPrefix) {\n\t\t\t$userInfo = [\n\t\t\t\t'role' => $userRole,\n\t\t\t\t'prefix' => $userPrefix,\n\t\t\t];\n\t\t\t$this->applyUserInfo($userInfo);\n\t\t\t$this->generateMockedController();\n\t\t\t$url = [\n\t\t\t\t'controller' => 'deferred',\n\t\t\t\t'action' => 'approve',\n\t\t\t\t'3',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkIsNotAuthorized();\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "function deny($reason) {\n $this->denied_reasons[] = $reason;\n }", "public function weixinblacklistAction()\n\t{\n\t\t//检查当日没来的,进入黑名单\n\t\t$model=M(\"AppointHistory\");\n\t\t$yesterday=date('Y-m-d H:i:s',strtotime(\"-2 hour\"));\n\t\t$values = $model->field(\"a.*,b.start as starttime\")->table(array(\"yoga_appoint_history\"=>\"a\",\"yoga_club_schedule\"=>\"b\"))->where(\"a.is_check=0 and a.come=0 and a.schedule_id=b.id and b.start<='{$yesterday}'\")->select();\n\t\t$month = date('Y-m'); \n\t\tforeach ($values as $key => $value) { \n\t\t\t\t$model->where(\"id=\".$value['id'])->setField(\"is_check\",1); \n\t\t\t$starttime = $value['starttime'];\n\t\t\t$starttime = substr($starttime,0,10);\n\t\t\t$ct=M(\"CheckHistory\")->where(array(\"member_id\"=>$value['member_id'],\"create_time\"=>array(\"like\",$starttime.\"%\")))->count();\n\t\t\tif($ct>0)\n\t\t\t{\n\t\t\t\tM(\"AppointHistory\")->where(\"id=\".$value['id'])->setField(\"come\",1);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t//本月爽约历史记录次数次数\n\t\t\t//$history=M(\"AppointBlackList\")->where(array(\"member_id\"=>$value['member_id'],\"create_time\"=>array(\"gt\",$month)))->count();\n\t\t\t$count = $model-> where(array(\"create_time\"=>array(\"gt\",$month),\"come\"=>0,\"member_id\"=>$value['member_id']))->count(); \n\t\t if($count==0){ continue; } \n//爽约原因\n $schedule_id = $value['schedule_id'];\n $schedule = D(\"ClubSchedule\")->find($schedule_id);\n if(!empty($schedule)){\n $class = M(\"PtClassPublic\")->find($schedule['class_id']);\n $reason = \"缺席\".$schedule['start'].\"的\".$class['name'];}\n else\n $reason=\"缺席\";\n\t\t\tif($count==1)\n\t\t\t{\n\t\t\t\t$end_time = date('Y-m-d H:i:s',strtotime(\"+4 day\"));\n\t\t\t\t//4天\n\t\t\t\tM(\"AppointBlackList\")->data(array(\"reason\"=>$reason,\"member_id\"=>$value['member_id'],\"history_id\"=>$value['id'],\"create_time\"=>getDbTime(),\"start_time\"=>getDbTime(),\"end_time\"=>$end_time ))->add();\n\t\t\t}\n\t\t\telse if($count==2)\n\t\t\t{\n\t\t\t\t//2周\n\n\t\t\t\t$end_time = date('Y-m-d H:i:s',strtotime(\"+2 week\"));\n\t\t\t\t//4天\n\t\t\t\tM(\"AppointBlackList\")->data(array(\"reason\"=>$reason,\"member_id\"=>$value['member_id'],\"history_id\"=>$value['id'],\"create_time\"=>getDbTime(),\"start_time\"=>getDbTime(),\"end_time\"=>$end_time ))->add();\n\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//本月\n\t\t\t\t$end_time =date('Y-m-d H:i:s', strtotime(date('Y-m-01') . ' +1 month -1 day'));\n\t\t\t\t//4天\n\t\t\t\tM(\"AppointBlackList\")->data(array(\"reason\"=>$reason,\"member_id\"=>$value['member_id'],\"history_id\"=>$value['id'],\"create_time\"=>getDbTime(),\"start_time\"=>getDbTime(),\"end_time\"=>$end_time ))->add();\n\t\n\t\t\t}\n\t\t\t \n\t\t}\n\t}", "public function createRejected($reason);", "public function denyItem($reason)\n {\n $item = $this->getItem();\n\n $item->setState(\\Apprecie\\Library\\Items\\ItemState::DENIED);\n $item->setRejectionReason($reason);\n $item->update();\n\n $this->setStatus(\\Apprecie\\Library\\Items\\ApprovalState::DENIED);\n $this->setDeniedReason($reason);\n $this->setVerifiedByUserId($this->getDI()->getDefault()->get('auth')->getAuthenticatedUser()->getUserId());\n return $this->update();\n }", "function resendCancelEmail(){\n\t\t//echo \"resend...\";\n\t\t$db\t\t= JFactory::getDbo();\n\t\t$query\t= $db->getQuery(true);\n\t\tif($_POST['cancelReId'] == '')\n\t\t\t$nId = $_POST['appCanId'];\n\t\telse\n\t\t\t$nId = $_POST['cancelReId'];\n\n\t\t$query->select($db->nameQuote('s_name'));\n\t\t$query->select($db->nameQuote('s_prename'));\n\t\t$query->select($db->nameQuote('s_address'));\n\t\t$query->select($db->nameQuote('s_plz'));\n\t\t$query->select($db->nameQuote('s_city'));\n\t\t$query->select($db->nameQuote('s_phone'));\n\t\t$query->select($db->nameQuote('s_email'));\n\t\t$query->select($db->nameQuote('idt_drivin_event_apply')); \n\t\t$query->select($db->nameQuote('s_title'));\t\t\n\t\t$query->from($db->nameQuote('#__jevent_events_apply'));\n\t\t$this->_id2 = $nId;\n\t\t$query->where($db->nameQuote('idt_drivin_event_apply') . '=' . $nId);\n\t\t//if(!$bCanceled)\n\t\t//\t$query->where($db->nameQuote('dt_Cancel') . ' is null');\n\t\t//else\n\t\t\t$query->where($db->nameQuote('dt_Cancel') . ' is not null');\n\t\t//echo \"SQLSTRING: \" . $query;\n\t\t$db->setQuery($query);\n\t\tif ($link = $db->loadRowList()) {\n\t\t\t$mailer = new jEventMailer();\n\t\t\t//$mailer->test();\n\t\t\t\n\t\t\tif(!$mailer->sendApplicationEmail2(1, $link, $this->getEventById2(), true)){\n\t\t\t\t$this->setError($mailer->error);\n\t\t\t\techo \"Eroooor \" . $mailer->error;\n\t\t\t}\n\t\t}else{\n\t\t\techo \"No Record Found! ReID: \". $nId;\n\t\t}\n\t\treturn true;\n\t\n\t}", "public function cancelAction() \n {\n \t\t$tblVote = Facebook_Vote::Table();\n\t\t$objSession = new App_Session_Namespace( 'facebook' );\n\t\t\n\t\tif ( is_object( $objSession )) {\n\t\t\t$nUserId = $objSession->user->fbu_id;\n\t\t\t$nVoteId = $this->_getIntParam( 'fbv_vote_id', 1 );\n\t\t\t\n\t\t\t$objVote = $tblVote->findVote( $nUserId, $nVoteId );\n\t\t\tif ( is_object( $objVote ) ) {\n \t\t\t\t$objVote->delete();\n\t\t\t}\n\t\t}\n\t\t$this->view->return = $this->_getParam( 'return' );\n }", "public function sellerOrderReject(Request $request, $id){\n \\App::call('App\\Http\\Controllers\\OrderController@reject', [$id]);\n $orders = \\App::call('App\\Http\\Controllers\\OrderController@viewBySeller', [$request->user()->seller->id]);\n return view($request->view, compact('orders'));\n }", "public function getRejectReason() {\n\t\tif(isset($this->reviewInfo->rejectReason)) {\n\t\t\treturn $this->reviewInfo->rejectReason;\n\t\t} else {\n\t\t\treturn \"\";\n\t\t}\n\t}" ]
[ "0.63430685", "0.6341274", "0.6259934", "0.61988956", "0.60780966", "0.6043334", "0.6038304", "0.60374784", "0.5955958", "0.5937332", "0.58797896", "0.58552337", "0.58208334", "0.5779325", "0.5773487", "0.5765985", "0.57568806", "0.57109153", "0.562517", "0.5623991", "0.56186354", "0.5594198", "0.55579174", "0.5557587", "0.55371916", "0.55205345", "0.54716325", "0.5469018", "0.5464254", "0.5464052", "0.5459005", "0.5456894", "0.5446849", "0.53866464", "0.5381489", "0.5365412", "0.5358548", "0.531827", "0.5302763", "0.5302683", "0.5295315", "0.52821314", "0.5277818", "0.52608544", "0.5250045", "0.52480984", "0.52234733", "0.5216424", "0.51923347", "0.516894", "0.5166858", "0.5160788", "0.515182", "0.51499414", "0.51484495", "0.5134659", "0.51340026", "0.5108992", "0.510761", "0.5103984", "0.5083422", "0.50814235", "0.5074827", "0.50647616", "0.50547653", "0.5054569", "0.5030218", "0.50236714", "0.50196546", "0.5017692", "0.5010312", "0.49960625", "0.4992066", "0.49891907", "0.49859878", "0.4984666", "0.4980682", "0.4971862", "0.49687937", "0.49511015", "0.4942648", "0.4932475", "0.4928261", "0.49245596", "0.49203596", "0.49162927", "0.49141827", "0.49111754", "0.49071604", "0.49035087", "0.4902368", "0.48980653", "0.48745343", "0.4872653", "0.48684147", "0.4863713", "0.4858049", "0.4856669", "0.4855009", "0.48530412" ]
0.6686062
0
actionid: cancelbystaf actiondesc: Rejecting the izin by HRD
public function actionCancelByStaf($id, $confirm=false){ $model = StatusIzin::find()->where(['permohonan_izin_id' => $id])->all(); if ($confirm) { foreach ($model as $m) { $m->status_by_hrd = 5; $m->status_by_atasan = 5; $m->status_by_wr2 = 5; } if($m->save()){ \Yii::$app->messenger->addErrorFlash("Permohonan Izin telah dibatalkan"); return $this->redirect(['index-by-staf']); } } return $this->render('confirmCancel', ['id' => $id]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cancel();", "public function cancel(): void;", "public function actionCancel()\n {\n }", "public function cancel(): int;", "public function cancelMyReserved($id);", "protected function _cancelOperation() {}", "public function cancel()\n {\n }", "public function cancel()\n {\n }", "public function cancelAction() \n {\n \t\t$tblVote = Facebook_Vote::Table();\n\t\t$objSession = new App_Session_Namespace( 'facebook' );\n\t\t\n\t\tif ( is_object( $objSession )) {\n\t\t\t$nUserId = $objSession->user->fbu_id;\n\t\t\t$nVoteId = $this->_getIntParam( 'fbv_vote_id', 1 );\n\t\t\t\n\t\t\t$objVote = $tblVote->findVote( $nUserId, $nVoteId );\n\t\t\tif ( is_object( $objVote ) ) {\n \t\t\t\t$objVote->delete();\n\t\t\t}\n\t\t}\n\t\t$this->view->return = $this->_getParam( 'return' );\n }", "protected function cancelAppointmentRequest($args) {\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], '2');\n\n if (is_array($returned))\n return $returned;\n\n $checkBookingsQry = \"select appointment_id from appointment where slave_id = '\" . $this->User['entityId'] . \"' and status IN (6,7,8)\";\n $checkBookingsRes = mysql_query($checkBookingsQry, $this->db->conn);\n\n if (mysql_num_rows($checkBookingsRes) > 0)\n return $this->_getStatusMessage(93, 93);\n\n if ($this->_updateSlvApptStatus($this->User['entityId'], '3') == 0)\n return $this->_getStatusMessage(74, 74);\n else\n return $this->_getStatusMessage(3, 1);\n }", "public function cancel()\n {\n $this->confirmationArchived = false;\n }", "function cancelPending() {\n\t\tself::$_db->saveQry(\"SELECT `ID` FROM `#_reservations` \".\n\t\t\t\t\"WHERE (`status` = 'pending' OR `status` = 'prefered') \".\n\t\t\t\t\"AND ? >= `startTime` \",\n\t\t\t\tCalendar::startCancel());\n\t\t\n\n\t\twhile($res = self::$_db->fetch_assoc())\n\t\t\tReservation::load($res['ID'])->failed();\n\t\t\n\t\t\n\t\t// TagesEnde - BuchungsCancelZeit ist kleiner als Aktueller Zeitblock\n\t\tif(Calendar::calculateTomorrow()) {\n\t\t\t$opening = Calendar::opening(date('Y-m-d', strtotime(\"tomorrow\")));\n\t\t\tself::$_db->saveQry(\"SELECT * FROM `#_reservations` \".\n\t\t\t\t\t\"WHERE (`status` = 'pending' OR `status` = 'prefered') \".\n\t\t\t\t\t\"AND ? <= `startTime` AND `startTime` <= ? \",\n\t\t\t\t\t$opening->format(\"Y-m-d H:i\"), \n\t\t\t\t\tCalendar::startCancel($opening));\n\t\t\t\n\t\t\twhile($res = self::$_db->fetch_assoc())\n\t\t\t\tReservation::load($res['ID'])->failed();\n\t\t}\n\t\t\n\t}", "public function cancel_request() {\n\n $pending_request_exists = $this->micro_relation_exists($this->from, $this->to, \"P\");\n\n if($pending_request_exists) {\n $this->delete_relation(\"P\");\n }\n }", "protected function cancel(): void\n {\n }", "function cancel(){\n\t\t//echo \"In Cancel\";\n\t\t\n\t\t//echo 'Das aktuelle Datum und die aktuelle Zeit ist: ';\n\t\t//echo JFactory::getDate('now', JFactory::getApplication()->getCfg('offset'))->toFormat() . \"\\n<br/><br/>\";\n\t\t\n\t\t//$date = JFactory::getDate();\n\t\t//$date->setOffset(JFactory::getApplication()->getCfg('offset'));\n\t \n\t \t//echo \"Offset: \" . JFactory::getApplication()->getCfg('offset');\n\t\t//echo 'Das aktuelle Datum und die aktuelle Zeit ist: ' . $date->toFormat() . \"\\n\";\n\t\t$date =& JFactory::getDate($time= 'now', $tzOffset=0);\n\n\t\t//$date->setOffset($mainframe->getCfg('offset'));\n\t\t//echo 'Das aktuelle Datum und die aktuelle Zeit ist: ' . $date->toFormat();\n\t\t\n\t\t//echo \"New date: \" . date('Y-m-d H:i:s');\n\n\t\t//return false;\n\t\t\n\t\t$insData =new stdClass();\n\t\t$insData->idt_drivin_event_apply = $_POST['appCanId'];\n\n\t\t//$date = new DateTime();\n\t\t$insData->dt_cancel = date('Y-m-d H:i:s'); //'CURRENT_TIMESTAMP';//$date->getTimestamp();\n\t\t\n\t\t$db = JFactory::getDBO();\n\t\tif(!$db->updateObject( '#__jevent_events_apply', $insData, 'idt_drivin_event_apply' )){\n\t\t\techo $database->stderr();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;//resendCancelEmailById($insData->idt_drivin_event_apply);\n\t}", "function cancelCommit()\n{\n global $user;\n $UID = $user->uid;\n $params = drupal_get_query_parameters();\n $OID = $params['OID'];\n\n // removing user's commitment from the outreach completely\n dbRemoveUserFromOutreach($UID,$OID);\n drupal_set_message(\"Your commitment to outreach event: \" . dbGetOutreachname($OID) . \" has been removed!\"); //letting them know and redirecting user to the previous page they were on\n drupal_goto($_SERVER['HTTP_REFERER']);\n}", "public function cancel($reason)\n {\n $this->cancel_time = Format::timestamp2datetime(Format::timestamp());\n\n if ($this->state == self::STATE_COMPLETED) {\n $this->state = self::STATE_CANCELLED_AFTER_COMPLETE;\n } else {\n $this->state = self::STATE_CANCELLED;\n }\n\n if (!$reason) {\n $reason = (($this->state == self::STATE_CANCELLED_AFTER_COMPLETE) ?\n self::REASON_FUND_RETURNED : self::REASON_PROCESSING_EXECUTION_FAILED);\n }\n $this->reason = $reason;\n\n Log::log('transactions_payme', $this->id, 'Reason: '.$reason.PHP_EOL.\n ', State: '.$this->state , 'cancel');\n $this->update(['cancel_time', 'state', 'reason']);\n }", "public function cancelAction()\n\t{\n\t\t$this->processToken = null;\n\t\t$this->isNewProcess = true;\n\n\t\t$this->dropTempFile();\n\n\t\t$this->instanceBucket();\n\n\t\tif ($this->bucket instanceof \\CCloudStorageBucket)\n\t\t{\n\t\t\tif ($this->bucket->FileExists($this->uploadPath))\n\t\t\t{\n\t\t\t\tif (!$this->bucket->DeleteFile($this->uploadPath))\n\t\t\t\t{\n\t\t\t\t\t$this->addError(new Error('Cloud drop error.'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->clearProgressParameters();\n\n\t\t$result = $this->preformAnswer(self::ACTION_CANCEL);\n\n\t\t$result['STATUS'] = self::STATUS_COMPLETED;\n\n\t\treturn $result;\n\t}", "function cancel() {\n if($this->request->isAsyncCall()) {\n if($this->active_invoice->isLoaded()) {\n if($this->active_invoice->canCancel($this->logged_user)) {\n if($this->request->isSubmitted()) {\n try {\n $this->active_invoice->markAsCanceled($this->logged_user);\n \n $issued_to_user = $this->active_invoice->getIssuedTo();\n if ($issued_to_user instanceof User && Invoices::getNotifyClientAboutCanceledInvoice()) {\n $notify_users = array($issued_to_user);\n \t if ($issued_to_user->getId() != $this->logged_user->getId()) {\n \t $notify_users[] = $this->logged_user;\n \t } // if\n\n AngieApplication::notifications()\n ->notifyAbout('invoicing/invoice_canceled', $this->active_invoice, $this->logged_user)\n ->sendToUsers($notify_users);\n } // if\n \n \t\t\t\t\t\t$this->response->respondWithData($this->active_invoice, array(\n \t \t'as' => 'invoice', \n \t 'detailed' => true,\n \t ));\n } catch (Error $e) {\n \t$this->response->exception($e);\n } // try\n } // if\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n } else {\n $this->response->badRequest();\n } // if\n }", "public function actionCancel()\n {\n $this->render('cancel');\n }", "public function cancelAction()\n {\n $event = Mage::getModel('payanyway/event')\n ->setEventData($this->getRequest()->getParams());\n $message = $event->cancelEvent();\n\n // set quote to active\n $session = $this->_getCheckout();\n if ($quoteId = $session->getPayanywayQuoteId()) {\n $quote = Mage::getModel('sales/quote')->load($quoteId);\n if ($quote->getId()) {\n $quote->setIsActive(true)->save();\n $session->setQuoteId($quoteId);\n }\n }\n $session->addError($message);\n $this->_redirect('checkout/cart');\n }", "public function cancel() {\n # cleanup code before cancellng job\n $ret = array('message'=>'You cancelled this job at '.date('H:i:s'));\n return $ret;\n }", "public function massCancelAction()\n {\n $this->_ratepayMassEvent('cancel');\n \n $this->_redirect('*/*/index');\n }", "public function cancelOperation() {\n printf(\"Cancelling...\\n\");\n $this->_cancelled = true;\n posix_kill($this->_pid, SIGKILL);\n pcntl_signal_dispatch();\n }", "function jx_cancel_paf()\r\n\t{\r\n\t\t$this->auth(PAF_ROLE);\r\n\t\tif(!$_POST)\r\n\t\t\tdie();\r\n\t\t$output = array();\r\n\t\t$user = $this->auth(true);\r\n\t\t \r\n\t\t$id = $this->input->post('id');\r\n\t\t$this->db->query('update t_paf_list set paf_status=3,cancelled_on=?,cancelled_by=? where id = ? and paf_status = 1',array(date('Y-m-d H:i:s'),$user['userid'],$id));\r\n\t\tif($this->db->affected_rows())\r\n\t\t{\r\n\t\t\t$output['status'] = 'success';\r\n\t\t\t$output['message'] = 'Cancelled Successfully';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$output['status'] = 'error';\r\n\t\t\t$output['message'] = 'Unable to cancel this paf';\r\n\t\t}\r\n\t\techo json_encode($output);\r\n\t}", "public function cancelRequest(){\n //the other users Id\n $otherUserId = $_POST[\"otherUserId\"];\n //deletes the record in the database\n $this->individualGroupModel->cancelGroupRequestInvitation($otherUserId); \n //redirects\n $path = '/IndividualGroupController/individualGroup?groupId=' . $_SESSION['current_group']; \n redirect($path);\n }", "public function cancelAction()\n\t{\n\t\t$this->_redirect('checkout/onepage/failure');\n\t}", "public function cancel() {\n\t\t$this->workflowActivitySpecification->setState(WorkflowActivityStateEnum::CANCELLED);\n\n\t\tif ($this->runtimeContext)\n\t\t\t$this->workflowActivity->onCancel($this->runtimeContext);\n\t}", "public function cancelAction() {\n\n return $this->_redirect('/order_basis/payment');\n }", "public function cancelAction() {\n $this->chekcingForMarketplaceSellerOrNot ();\n $orderId = $this->getRequest ()->getParam ( 'id' );\n $produtId = $this->getRequest ()->getParam ( 'item' );\n $sellerId = Mage::getSingleton ( 'customer/session' )->getId ();\n /**\n * Prepare product collection for cancel\n */\n $products = Mage::getModel ( 'marketplace/commission' )->getCollection ();\n $products->addFieldToSelect ( '*' );\n $products->addFieldToFilter ( 'seller_id', $sellerId );\n $products->addFieldToFilter ( 'order_id', $orderId );\n $products->addFieldToFilter ( 'product_id', $produtId );\n $collectionId = $products->getFirstItem ()->getId ();\n $orderStatusFlag = Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_manage' );\n if (! empty ( $collectionId ) && $orderStatusFlag == 1) {\n try {\n $data = array (\n 'order_status' => 'canceled',\n 'customer_id' => 0,\n 'credited' => 1,\n 'item_order_status' => 'canceled'\n );\n $commissionModel = Mage::getModel ( 'marketplace/commission' )->load ( $collectionId )->addData ( $data );\n $commissionModel->setId ( $collectionId )->save ();\n\n /**\n * Load order details based on the order id.\n */\n $_order = Mage::getModel ( 'sales/order' )->load ( $orderId );\n /**\n * Update order items to cancel status\n */\n foreach ( $_order->getAllItems () as $item ) {\n if ($this->getRequest ()->getParam ( 'item' ) == $item->getId ()) {\n $item->cancel ();\n }\n }\n /**\n * Send cancel notification for admin\n */\n Mage::helper('marketplace/general')->sendCancelOrderAdminNotification($orderId,$produtId,$sellerId);\n\n Mage::helper('marketplace/general')->sendCancelOrderBuyerNotification($_order);\n /**\n * Redirect to order view page\n */\n Mage::getSingleton ( 'core/session' )->addSuccess ( $this->__ ( $this->__ ( 'The item has been cancelled.' ) ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $orderId );\n } catch ( Exception $e ) {\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( $e->getMessage () ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $orderId );\n }\n } else {\n /**\n * Return to order manage page\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( 'You do not have permission to access this page' ) );\n $this->_redirect ( 'marketplace/order/manage' );\n return false;\n }\n }", "public function actionCancelPlan(){\n // Redirect back to billing page if doesnt have a plan active\n $isBillingActive = Yii::$app->user->identity->getBillingDaysLeft();\n if(!$isBillingActive){\n return $this->redirect(['billing/index']);\n }\n\n $customerName = Yii::$app->user->identity->agent_name;\n $latestInvoice = Yii::$app->user->identity->getInvoices()->orderBy('invoice_created_at DESC')->limit(1)->one();\n\n if($latestInvoice){\n Yii::error(\"[Requested Cancel Billing #\".$latestInvoice->billing->twoco_order_num.\"] Customer: $customerName\", __METHOD__);\n // Cancel the recurring plan\n $latestInvoice->billing->cancelRecurring();\n }\n\n Yii::$app->getSession()->setFlash('warning', \"[Plan Cancelled] Billing plan has been cancelled as requested.\");\n\n return $this->redirect(['billing/index']);\n }", "public function cancelAction() {\n /**\n * Admin configuration for order cancel request active status.\n */\n $orderCancelStatusFlag = Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_cancel_request' );\n $data = $this->getRequest ()->getPost ();\n $emailSent = '';\n /**\n * Get order id\n * @var int\n */\n $orderId = $data ['order_id'];\n $loggedInCustomerId = '';\n /**\n * Check that customer login or not.\n */\n if (Mage::getSingleton ( 'customer/session' )->isLoggedIn () && isset ( $orderId )) {\n /**\n * Get customer data\n * @var id\n */\n $customerData = Mage::getSingleton ( 'customer/session' )->getCustomer ();\n $loggedInCustomerId = $customerData->getId ();\n $customerid = Mage::getModel ( 'sales/order' )->load ( $data ['order_id'] )->getCustomerId ();\n } else {\n /**\n * Error message for the when unwanted person access these request.\n */\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( \"You do not have permission to access this page\" ) );\n $this->_redirect ( 'sales/order/history' );\n return;\n }\n if ($orderCancelStatusFlag == 1 && ! empty ( $loggedInCustomerId ) && $customerid == $loggedInCustomerId) {\n $shippingStatus = 0;\n try {\n /**\n * Get templete id for the order cancel request notification.\n */\n $templateId = ( int ) Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_cancel_request_notification_template_selection' );\n if ($templateId) {\n /**\n * Load email templete.\n */\n $emailTemplate = Mage::helper ( 'marketplace/marketplace' )->loadEmailTemplate ( $templateId );\n } else {\n $emailTemplate = Mage::getModel ( 'core/email_template' )->loadDefault ( 'marketplace_cancel_order_admin_email_template_selection' );\n }\n /**\n * Load order product details based on the orde id.\n */\n $_order = Mage::getModel ( 'sales/order' )->load ( $orderId );\n /**\n * Get increment id\n * @var int\n */\n $incrementId = $_order->getIncrementId ();\n $sellerProductDetails = array ();\n $selectedProducts = $data ['products'];\n $selectedItemproductId = '';\n /**\n * Get the order item from the order.\n */\n foreach ( $_order->getAllItems () as $item ) {\n /**\n * Get Product id\n * @var int\n */\n $itemProductId = $item->getProductId ();\n $orderItem = $item;\n if (in_array ( $itemProductId, $selectedProducts )) {\n $shippingStatus = $this->getShippingStatus ( $orderItem );\n\n $sellerId = Mage::getModel ( 'catalog/product' )->load ( $itemProductId )->getSellerId ();\n $selectedItemproductId = $itemProductId;\n $sellerProductDetails [$sellerId] [] = $item->getName ();\n }\n }\n /**\n * Get seller product details.\n */\n foreach ( $sellerProductDetails as $key => $productDetails ) {\n $productDetailsHtml = \"<ul>\";\n /**\n * Increment foreach loop\n */\n foreach ( $productDetails as $productDetail ) {\n $productDetailsHtml .= \"<li>\";\n $productDetailsHtml .= $productDetail;\n $productDetailsHtml .= \"</li>\";\n }\n $productDetailsHtml .= \"</ul>\";\n $customer = Mage::getModel ( 'customer/customer' )->load ( $loggedInCustomerId );\n $seller = Mage::getModel ( 'customer/customer' )->load ( $key );\n /**\n * Get customer name and customer email id.\n */\n $buyerName = $customer->getName ();\n $buyerEmail = $customer->getEmail ();\n $sellerEmail = $seller->getEmail ();\n $sellerName = $seller->getName ();\n $recipient = $sellerEmail;\n if (empty ( $sellerEmail )) {\n $adminEmailIdVal = Mage::getStoreConfig ( 'marketplace/marketplace/admin_email_id' );\n /**\n * Get the to mail id\n */\n $getToMailId = Mage::getStoreConfig ( \"trans_email/ident_$adminEmailIdVal/email\" );\n $recipient = $getToMailId;\n }\n $emailTemplate->setSenderName ( $buyerName );\n $emailTemplate->setSenderEmail ( $buyerEmail );\n /**\n * To set cancel/refund request sent\n */\n if ($shippingStatus == 1) {\n $requestedType = $this->__ ( 'cancellation' );\n Mage::getModel ( 'marketplace/order' )->updateSellerRequest ( $selectedItemproductId, $orderId, $loggedInCustomerId, $sellerId, 0 );\n } else {\n $requestedType = $this->__ ( 'return' );\n Mage::getModel ( 'marketplace/order' )->updateSellerRequest ( $selectedItemproductId, $orderId, $loggedInCustomerId, $sellerId, 1 );\n }\n $emailTemplateVariables = array (\n 'ownername' => $sellerName,'productdetails' => $productDetailsHtml, 'order_id' => $incrementId,\n 'customer_email' => $buyerEmail,'customer_firstname' => $buyerName,\n 'reason' => $data ['reason'],'requesttype' => $requestedType,\n 'requestperson' => $this->__ ( 'Customer' )\n );\n $emailTemplate->setDesignConfig ( array ('area' => 'frontend') );\n /**\n * Sending email to admin\n */\n $emailTemplate->getProcessedTemplate ( $emailTemplateVariables );\n $emailSent = $emailTemplate->send ( $recipient, $sellerName, $emailTemplateVariables );\n }\n if ($shippingStatus == 1) {\n Mage::getSingleton ( 'core/session' )->addSuccess ( $this->__ ( \"Item cancellation request has been sent successfully.\" ) );\n } else {\n Mage::getSingleton ( 'core/session' )->addSuccess ( $this->__ ( \"Item return request has been sent successfully.\" ) );\n }\n $this->_redirect ( 'sales/order/view/order_id/' . $data ['order_id'] );\n } catch ( Exception $e ) {\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( $e->getMessage () ) );\n $this->_redirect ( 'sales/order/view/order_id/' . $data ['order_id'] );\n }\n } else {\n Mage::getSingleton ( 'core/session' )->addError ( $this->__ ( \"You do not have permission to access this page\" ) );\n $this->_redirect ( 'sales/order/view/order_id/' . $orderId );\n }\n }", "public function handleCancel() {\n // logit('HC: ' . print_r($this->data, true));\n if ($this->data['submit_button'] == 'Cancel') {\n $this->data = array();\n $this->error = array();\n $this->_redirector->gotoUrl($this->mainpage);\n }\n }", "function updateCancelInMain($village)\n{\n\tglobal $db;\n\tif(!empty($_GET['cancel']) && is_numeric($_GET['cancel']))\n\t{\n\t\t$sql=\"DELETE FROM wg_status WHERE id=\".$_GET['cancel'].\" AND village_id=$village AND type=17 AND status=0\";\n\t\t$db->setQuery($sql);\n\t\t$db->query();\n\t\tif($db->getAffectedRows()==0)\n\t\t{\n\t\t\tglobalError2('function updateCancelInMain:'.$sql);\n\t\t}\n\t\theader(\"Location:build.php?id=\".$_GET['id'].\"\");\n\t\texit();\n\t}\n\treturn NULL;\n}", "function _cancel($info)\n\t{\n\t // Gan trang thai xac thuc\n\t $data = array();\n\t $data['status'] = mod('order')->status('canceled');\n\t\n\t // Cap nhat du lieu vao data\n\t model('user_bank')->update($info->id, $data);\n\t // Gui thong bao\n\t set_message(lang('notice_update_success'));\n\t return TRUE;\n\t}", "public function cancel($id, $actor) {\n // Make sure the job is in a cancelable status\n \n $curStatus = $this->field('status', array('CoJob.id' => $id));\n \n if(!$curStatus) {\n throw new InvalidArgumentException(_txt('er.notfound', array(_txt('ct.co_jobs.1'), $id)));\n }\n \n // This array corresponds to View/CoJob/fields.inc\n if(!in_array($curStatus, array(JobStatusEnum::InProgress, JobStatusEnum::Queued))) {\n throw new InvalidArgumentException(_txt('er.jb.cxl.status', array(_txt('en.status.job', null, $curStatus))));\n }\n \n // Finally update the status\n \n return $this->finish($id, _txt('rs.jb.cxld.by', array($actor)), JobStatusEnum::Canceled);\n }", "public function cancelRequests()\n {\n $this->prepareCancel();\n\n $url = $this->urlbase.$this->urlbranch;\n\n $query = $this->genQuery();\n\n $path = $this->options['Action'].'Result';\n\n if ($this->mockMode) {\n $xml = $this->fetchMockFile()->$path;\n } else {\n $response = $this->sendRequest($url, ['Post' => $query]);\n\n if (! $this->checkResponse($response)) {\n return false;\n }\n\n $xml = simplexml_load_string($response['body'])->$path;\n }\n\n $this->parseXML($xml);\n }", "public function cancelAction()\n {\n \n $po_order_id = $this->getRequest()->getParam('po_order_id');\n \n Mage::dispatchEvent('purchase_order_stockmovement_cancel_po', array('po_order_id'=>$po_order_id)); \n \n //move to 'purchase_order_stockmovement_cancel' event to handle.\n /*$collection = mage::getModel('Purchase/StockMovement')\n ->getCollection()\n ->addFieldToFilter('sm_po_num', $po_num);\n foreach ($collection as $item)\n {\n $item->delete();\n }\n */\n /*\n $order = mage::getModel('Purchase/Order')->load($po_num);\n foreach ($order->getProducts() as $item)\n {\n $productId = $item->getpop_product_id();\n Mage::dispatchEvent('purchase_update_supply_needs_for_product', array('product_id'=>$productId));\n }\n */\n \n //Move to order cancel funciton.\n /*$collection = mage::getModel('purchase/orderitem')\n ->getCollection()\n ->addFieldToFilter('pop_order_num', $po_num);\n foreach ($collection as $item)\n {\n $item->delete();\n } */\n \n \n $purchaseOrder = Mage::getModel('purchase/order')->load($po_order_id);\n\n $purchaseOrder->cancel();\n \n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Purchase order successfully Canceled'));\n \n $this->_redirect('purchase/orders/list');\n }", "function cancel_booking_approve($id)\n {\n $useremail = $this->userinfo_by_bookingid($id);\n $this->emails_model->booking_approve_cancellation_email($useremail);\n $this->cancel_booking($id);\n // $this->delete_booking($id);\n }", "public function cancelAction() \n {\n if (Mage::getEdition() == Mage::EDITION_ENTERPRISE) {\n $this->helper()->storeCreditSessionUnset();\n $this->helper()->giftCardsSessionUnset();\n }\n\n $this->_redirect('checkout/cart');\n }", "protected function cancel()\n\t{\n\t\t$this->executeTask('Rollback');\n\n\t\treturn false;\n\t}", "public function cancelApplication($appId) {\r\n \r\n $queryresult = $this->db->query(\"UPDATE t_sr_subject SET STATUS = 'Cancelled' WHERE ID = ?\", \r\n array($appId));\r\n \r\n if($this->db->affected_rows() > 0) {\r\n return \"Success\";\r\n } else {\r\n return \"Error\";\r\n }\r\n }", "public function cancelRequestOfUserForReceivedApprovedRequest() {\n extract($_GET);\n $gender = $this->session->userdata('key_gender');\n $encodedkey = $this->session->userdata('PariKey_session');\n $key = base64_decode($encodedkey);\n $keyarr = explode('|', $key);\n $sessionUser_id = $keyarr[2];\n $result = $this->Searchbyprofileid_model->cancelRequestOfUserForReceivedApprovedRequest($profile_user_id, $sessionUser_id, $gender);\n// print_r($result);\n// die();\n if ($result == 200) {\n echo 200;\n } else {\n echo 500;\n }\n }", "public function cancelApproval(InvoiceInterface $invoice): void;", "public function actionCancel() {\n $token = trim($_GET['token']);\n// $payerId = trim($_GET['PayerID']);\n $criteria = new CDbCriteria;\n $criteria->condition = 'token=:Tokenw';\n $criteria->params = array(':Tokenw' => $token);\n $orders = Orders::model()->find($criteria);\n if ($orders->status_id == '4') {\n $orders->status_id = '2';\n $orders->save();\n// need to clear cart\n//Yii::app()->shoppingCart->clear();\n }\n $this->render('cancel');\n }", "function cancelObject($in_rep = false)\n\t{\n\t\tilUtil::sendInfo($this->lng->txt('msg_cancel'), true);\n\t\t// TODO: check this\n\t\tilUtil::redirect('repository.php?cmd=frameset&ref_id='.$_GET['ref_id']);\n\t}", "function eve_api_subtask_cancel(&$form_state) {\n // Clear our ctools cache object. It's good housekeeping.\n eve_api_clear_page_cache('signup');\n}", "public function dockCancel(){\n\t\treturn $this->_sendPacketToController(self::DOCK_CANCEL);\n\t}", "function cancel()\n\t{\n\t\tif ($_GET[\"obj_id\"] != 0)\n\t\t{\n\t\t\tif ($_GET[\"new_type\"] == \"pg\")\n\t\t\t{\n\t\t\t\t$this->ctrl->redirect($this, \"view\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->ctrl->redirect($this, \"subchap\");\n\t\t\t}\n\t\t}\n\t}", "public function cancelAuthorizationShouldNotAddCancellationIfCancellationFails(): void\n {\n $heidelpay = new Heidelpay('s-priv-123');\n $payment = (new Payment())->setParentResource($heidelpay)->setId('myPaymentId');\n $authorization = (new Authorization())->setPayment($payment)->setId('s-aut-1');\n\n /** @var ResourceService|MockObject $resourceSrvMock */\n $resourceSrvMock = $this->getMockBuilder(ResourceService::class)->disableOriginalConstructor()->setMethods(['createResource'])->getMock();\n $cancellationException = new HeidelpayApiException(\n 'Cancellation failed',\n 'something went wrong',\n ApiResponseCodes::API_ERROR_ALREADY_CANCELLED\n );\n $resourceSrvMock->expects($this->once())->method('createResource')->willThrowException($cancellationException);\n\n $cancelSrv = $heidelpay->setResourceService($resourceSrvMock)->getCancelService();\n $this->expectException(HeidelpayApiException::class);\n $this->expectExceptionCode(ApiResponseCodes::API_ERROR_ALREADY_CANCELLED);\n $cancelSrv->cancelAuthorization($authorization, 12.122);\n $this->assertCount(0, $authorization->getCancellations());\n }", "public function handleCancellation($request, $context) { }", "public function cancelled()\n {\n \n $this->alert('info', 'Understood');\n }", "public function cancelled()\n {\n \n $this->alert('info', 'Understood');\n }", "public function cancel()\n {\n $this->resetInput();\n $this->updateMode = false;\n }", "public function cancelClassByStudent_post()\n {\n /* code goes here */\n }", "function tripal_jobs_cancel ($job_id){\n $sql = \"select * from {tripal_jobs} where job_id = %d\";\n $job = db_fetch_object(db_query($sql,$job_id));\n\n // set the end time for this job\n if($job->start_time == 0){\n $record = new stdClass();\n $record->job_id = $job->job_id;\n\t $record->end_time = time();\n\t $record->status = 'Cancelled';\n\t $record->progress = '0';\n\t drupal_write_record('tripal_jobs',$record,'job_id');\n drupal_set_message(\"Job #$job_id cancelled\");\n } else {\n drupal_set_message(\"Job #$job_id cannot be cancelled. It is in progress or has finished.\");\n }\n drupal_goto(\"admin/tripal/tripal_jobs\");\n}", "public function cancel()\n {\n $user = Auth::user();\n\n if ( $user->cancel_rank() )\n flash('Your place request was canceled.')->success()->important();\n\n if ( $user->cancel_place() )\n flash('Your place as been removed.')->success()->important();\n\n return redirect()->back();\n }", "public static function cancellingCallback($params) {\n\t\t$params[Filesystem::signal_param_run] = false;\n\t}", "public function getCancelReason()\n {\n return $this->cancel_reason;\n }", "function ajax_cancelNow()\n{\n $cc = new CapabilityCheck('cancelNow', $_POST);\n if (!$cc->checkCapability()) {\n return;\n }\n\n check_ajax_referer('CPWP');\n\n $_POST['json'] = 1;\n $cpjm = new CPJobManager('cancelNow', $_POST);\n $cpjm->RunJob();\n\n}", "public function getCancelAbilities();", "protected function cancelAppointment($args) {\n\n if ($args['ent_appnt_dt'] == '' || $args['ent_dri_email'] == '' || $args['ent_date_time'] == '')\n return $this->_getStatusMessage(1, $args);\n\n $this->curr_date_time = urldecode($args['ent_date_time']);\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], '2');\n\n if (is_array($returned))\n return $returned;\n\n $args['ent_appnt_dt'] = urldecode($args['ent_appnt_dt']);\n\n $getApptDetQry = \"select a.appointment_dt, a.appt_type, a.status, a.mas_id, a.appointment_id, a.user_device from appointment a, master d where a.mas_id = d.mas_id and d.email = '\" . $args['ent_dri_email'] . \"' and a.appointment_dt = '\" . $args['ent_appnt_dt'] . \"' and a.slave_id = '\" . $this->User['entityId'] . \"' order by a.appointment_id DESC\";\n $getApptDetRes = mysql_query($getApptDetQry, $this->db->conn);\n\n if (mysql_affected_rows() <= 0)\n return $this->_getStatusMessage(32, 32);\n\n $apptDet = mysql_fetch_assoc($getApptDetRes);\n\n if (!is_array($apptDet))\n return $this->_getStatusMessage(32, 32);\n\n if ($apptDet['status'] == '3')\n return $this->_getStatusMessage(44, 44);\n\n if ($apptDet['status'] == '4')\n return $this->_getStatusMessage(41, $getApptDetQry);\n\n if ($apptDet['status'] == '5')\n return $this->_getStatusMessage(82, 3);\n\n if ($apptDet['status'] == '9')\n return $this->_getStatusMessage(75, 3);\n\n// $docData = $this->_getEntityDet($args['ent_dri_email'], '1');\n\n $after_5min = date('Y-m-d H:i:s', (strtotime($apptDet['appointment_dt']) + $this->cancellationTimeInSec));\n\n if ($this->curr_date_time >= $after_5min)\n $cancelStatus = \"cancel_status = '3', \";\n else\n $cancelStatus = \"cancel_status = '2', \";\n\n $cancelApntQry = \"update appointment set status = 4, \" . $cancelStatus . \" last_modified_dt = '\" . $this->curr_date_time . \"', cancel_dt = '\" . $this->curr_date_time . \"' where appointment_id = '\" . $apptDet['appointment_id'] . \"'\"; // slave_id = '\" . $this->User['entityId'] . \"' and mas_id = '\" . $apptDet['mas_id'] . \"' and appointment_dt = '\" . $args['ent_appnt_dt'] . \"'\";\n mysql_query($cancelApntQry, $this->db->conn);\n\n if (mysql_affected_rows() <= 0)\n return $this->_getStatusMessage(3, $cancelApntQry);\n\n $location = $this->mongo->selectCollection('location');\n\n $master = $location->findOne(array('user' => (int) $apptDet['mas_id']));\n\n $pubnubContent = array('a' => 10, 'dt' => $apptDet['appointment_dt'], 'e' => $this->User['email'], 'bid' => $apptDet['appointment_id'], 't' => $apptDet['appt_type'],);\n\n if (!is_null($master['listner']))\n $pushNum['pubnub'] = $this->pubnub->publish(array(\n 'channel' => $master['listner'],\n 'message' => $pubnubContent\n ));\n\n $message = \"Passenger cancelled the appointment on \" . $this->appName . \"!\";\n\n $this->ios_cert_path = $this->ios_roadyo_driver;\n $this->ios_cert_pwd = $this->ios_dri_pwd;\n $this->androidApiKey = $this->masterApiKey;\n $aplPushContent = array('alert' => $message, 'nt' => '10', 'd' => $apptDet['appointment_dt'], 'e' => $this->User['email'], 'sound' => 'default', 'id' => $apptDet['appointment_id'], 'r' => $args['ent_cancel_type'], 't' => $apptDet['appt_type']);\n $andrPushContent = array('payload' => $message, 'action' => '10', 'sname' => $this->User['firstName'], 'dt' => $apptDet['appointment_dt'], 'e' => $this->User['email'], 'bid' => $apptDet['appointment_id'], 'r' => $args['ent_cancel_type'], 't' => $apptDet['appt_type']);\n $pushNum['push'] = $this->_sendPush($this->User['entityId'], array($apptDet['mas_id']), $message, '10', $this->User['firstName'], $this->curr_date_time, '1', $aplPushContent, $andrPushContent);\n\n $deleteAllSessionsQry = \"update master set status = '3' where mas_id = '\" . $apptDet['mas_id'] . \"'\";\n mysql_query($deleteAllSessionsQry, $this->db->conn);\n\n $location->update(array('user' => (int) $apptDet['mas_id']), array('$set' => array('status' => 3, 'apptStatus' => 0)));\n\n if ($this->curr_date_time >= $after_5min)\n return $this->_getStatusMessage(43, $cancelApntQry . $after_5min);\n else\n return $this->_getStatusMessage(42, $cancelApntQry . $after_5min);\n }", "public function cancelBoleto(){\n $cancelamento = Mage::getStoreConfig( 'payment/gwap_boleto/cancelamento' );\n if( is_numeric($cancelamento) && $cancelamento > 0 ){ \n $cancelamento++;\n $due_date = Mage::getModel('core/date')->timestamp( '-'.$cancelamento.' days' );\n }else{\n $due_date = Mage::getModel('core/date')->timestamp( '-2 days' );\n }\n \n $mGwap = Mage::getModel('gwap/order')->getCollection()\n ->addExpireFilter( $due_date )\n ->addTypeFilter('boleto')\n ->addStatusFilter(Indexa_Gwap_Model_Order::STATUS_CAPTUREPAYMENT);\n \n if( $mGwap->count() ){\n foreach ($mGwap as $mGwapitem){\n \n $mGwapitem->setStatus('canceled');\n $mGwapitem->save();\n \n $can_cancel = Mage::getStoreConfig( 'payment/gwap_boleto/cancelar_expirado' );\n \n if( $can_cancel ){\n \n $order = Mage::getModel('sales/order')->load( $mGwapitem->getOrderId() );\n /* var $order Mage_Sales_Model_Order */\n $order->cancel();\n $order->save();\n \n }\n \n }\n }\n return $this;\n }", "public function cancelAction()\n {\n $params = $this->getRequest()->getParams();\n if (array_key_exists('shipment', $params)) {\n $shipment = Mage::getModel('sales/order_shipment')->load($params['shipment']);\n if (Mage::helper('iparcel/api')->cancelShipment($shipment)) {\n Mage::getSingleton('adminhtml/session')->addSuccess('Shipment canceled');\n }\n }\n\n $this->_redirectReferer();\n return true;\n }", "public function cancellationRequested() : bool;", "public function rejectAction()\n\t{\trequire_once( 'form.inc' );\n\n\t\tif( $this->_getParam('user') && $this->_getParam('user_reason') )\n\t\t{\t// TODO: validate and write entry to database\n\t\t\t// TODO: add success message to view\n\t\t\tif( $this->db->rejectRefund( $this->_getParam('user'), $this->_getParam('user_reason') ) )\n\t\t\t{\n\t\t\t}else\n\t\t\t{\n\t\t\t}\n\t\t}\n\n\t\t// TODO: If the refunds period has closed, parse request logs against refund list, update rejected users\n\t\t$this->view->user_options = $this->db->getRefunds('REQUESTED');\n\t}", "public function actionPaypalCancel($payment_id) {\n /*Do what you want*/ \n }", "public function actioncancelThisEscrow(){\n $model = new Escrow;\n $escrow_id = $_POST['escrow_id'];\n $product_id = $_POST['product_id'];\n $member_id = Yii::app()->user->id;\n $quantity = $_POST['quantity_of_purchase'];\n $escrow_operation_for = $_POST['escrow_request_from'];\n \n if($model->isThisEscrowCancellable($escrow_id)){\n if($model->isCancellingThisEscrowAtEscrowASuccess($escrow_id)){\n if($escrow_operation_for == 'post'){\n if($this->isRemovingEscrowFacilityAtSubscriptionASuccess($product_id,$member_id,$quantity)){\n //escrow cancelled successfully\n $msg = \"The Escrow is cancelled successful.\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n \"escrow_operation_for\"=>$escrow_operation_for\n )\n );\n }else{\n //escrow cancelled but subscription escrow feature not modified. \n $msg = \"The escrow is cancelled but an attempt to modify the escrow facility on the subscribed product failed.Please contact customer care for assistance \";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n \"escrow_operation_for\"=>$escrow_operation_for\n )\n );\n }\n }else{\n $msg = \"The Escrow is cancelled successful.\";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"msg\" => $msg,\n \"escrow_operation_for\"=>$escrow_operation_for\n )\n );\n }\n \n }else{\n //escrow could not be cancelled\n $msg = \"This escrow could not be cancelled. It is possible the escrow is unavailable.Please contact customer care for assistance \";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg,\n )\n );\n }\n \n \n }else{\n //escrow cannot be cancelled\n $msg = \"This escrow could not be cancelled. It is possible a decision had already been made on the escrow. Please contact customer care for some clarification \";\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() != 0,\n \"msg\" => $msg,\n \"cancellable?\"=>$model->isThisEscrowCancellable($escrow_id),\n \"escrow_id\"=>$escrow_id \n )\n );\n }\n }", "abstract public function abort(): void;", "public function cancelBooking($param) { \n if (!$this->aaa->has_right('openruth', 500))\n $res->bookingError->_value = 'authentication_error';\n else {\n $agencyId = self::strip_agency($param->agencyId->_value);\n $targets = $this->config->get_value('ruth', 'ztargets');\n if ($tgt = $targets[$agencyId]) {\n $book = &$booking->BookingDelete->_value;\n $book->LibraryNo->_value = $agencyId;\n $book->DisposalID->_value = $param->bookingId->_value;\n $xml = '<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?'.'>' . utf8_decode($this->objconvert->obj2xml($booking));\n $z = new z3950();\n $z->set_target($tgt['host']);\n $z->set_database($tgt['database'].'-ophelia');\n $z->set_authentication($tgt['authentication']);\n if ($tgt['proxy']) {\n $z->set_proxy($tgt['proxy']);\n }\n $xml_ret = $z->z3950_xml_update($xml, $tgt['timeout']);\n//echo 'error: ' . $z->get_errno();\n//print_r($xml);\n//print_r($xml_ret);\n if ($z->get_errno() == 0 && $xml_ret['xmlUpdateDoc']) {\n $dom = new DomDocument();\n $dom->preserveWhiteSpace = false;\n if ($dom->loadXML($xml_ret['xmlUpdateDoc'])) {\n if ($err = $dom->getElementsByTagName('ErrorResponse')->item(0)) {\n verbose::log(ERROR, __FUNCTION__ . ' (' . __LINE__ . ') errno: ' . $err->getAttribute('Err'));\n if (!($res->bookingError->_value = $this->errs[$err->getAttribute('Err')])) \n $res->bookingError->_value = 'unspecified error (' . $err->getAttribute('Err') . '), order not possible';\n } else {\n $res->bookingOk->_value->bookingId->_value = $param->bookingId->_value;\n }\n } else {\n verbose::log(ERROR, __FUNCTION__ . ' (' . __LINE__ . ') loadXML error of: ' . $xml_ret['xmlUpdateDoc']);\n $res->bookingError->_value = 'system error';\n }\n } else {\n self::log_z_error(__FUNCTION__, __LINE__, $agencyId, $z->get_errno(), $z->get_error_string());\n $res->bookingError->_value = 'system error';\n }\n } else\n $res->bookingError->_value = 'unknown agencyId';\n }\n\n $ret->cancelBookingResponse->_value = $res;\n //var_dump($param); print_r($res); die();\n return $ret;\n }", "public static function cancelar($aD) {\n\n $sJsonCancel = self::makeJsonCancelamento($aD);\n \n \n $sJsonRetorno = self::curlConnect($sJsonCancel, \"Cancel\");\n \n if ($sJsonRetorno==false) {\n\n return self::error('sysbella: retorno json false');\n\n }\n\n $aCancelResponse = json_decode($sJsonRetorno, true);\n\n if (is_array( $aCancelResponse['ErrorReport'] )) {\n\n return self::error( $aCancelResponse['ErrorReport']['ErrorItemCollection']['ErrorCode'].\". \".$aCancelResponse['ErrorReport']['ErrorItemCollection']['Description'].\" [\".$aCancelResponse['ErrorReport']['ErrorItemCollection']['ErrorField'].\"]\");\n\n } else {\n return $sJsonRetorno;\n }\n\n ##\n return false;\n }", "public function cancel(\\Exception $e = null)\n {\n $this->stopped();\n\n $this->setStatus(Job::STATUS_CANCELLED, $e);\n\n $this->redis->zadd(Queue::redisKey($this->queue, 'cancelled'), time(), $this->payload);\n $this->redis->lrem(Queue::redisKey($this->queue, $this->worker->getId() . ':processing_list'), 1, $this->payload);\n \n Stats::incr('cancelled', 1);\n Stats::incr('cancelled', 1, Queue::redisKey($this->queue, 'stats'));\n\n Event::fire(Event::JOB_CANCELLED, $this);\n }", "public function cancel($params)\n { \n return $this->request(Resource::RESOURCE_ORDER_CANCEL, $params);\n }", "public function abort(): void;", "function cancel($watcherId);", "public function cancel_approve_request($id_exam)\n {\n try {\n $exam = $this->_db_exam->get_a_exam_file($id_exam);\n //kiem tra xem co phai de cua nguoi nay khong\n //kiem tra xem co phai de duoc phep huy gui duyet khong\n if (is_null($exam) || $exam->status != EXAM_WAITING_APPROVE) {\n return redirect()->back()\n ->with('message_notification', \"Đề thi này không được hủy gửi yêu cầu duyệt\");\n }\n $rs = $this->_db_exam->cancel_send_approve($id_exam);\n if (is_numeric($rs)) {\n return redirect('ctv/exam/have_answer/list=%20')\n ->with('message_success', \"Hủy yêu cầu duyệt đề thi thành công\");\n } else {\n return redirect()->back()\n ->with('message_notification', \"Hủy yêu cầu duyệt thất bại\");\n }\n\n } catch (\\Exception $ex) {\n return $ex;\n }\n }", "public function Cancel_Book($disputeId,$booking_no,$cancel_booking_id)\n\t{\t\n\t\t\t$condition = array('id' => $disputeId,'cancel_status' => $cancel_booking_id);\n\t\t\t$data = array('status' =>'Accept');\n\t\t\t$disputeData = $this->review_model->get_all_details(DISPUTE,$condition);\n\t\t\t\n\t\t\t$this->review_model->update_details(DISPUTE,$data,$condition);\n\t\t\t\n\t\t\t$getBookedDate = $this->review_model->ExecuteQuery(\"select DATE(checkin) as checkinDate ,DATE(checkout) as checkoutDate from \".RENTALENQUIRY.\" where Bookingno='\".$booking_no.\"'\")->row();\n\n\t\t\t//Update Rental Enquiry for cancel accept\n\t\t\t$UpdateArr=array('cancelled'=>'Yes');\n\t\t\t$Condition=array('Bookingno'=>$booking_no);\n\t\t\t$this->product_model->update_details(RENTALENQUIRY,$UpdateArr,$Condition);\n\t\t\n\t\t\t$schedule_q = $this->review_model->get_all_details(SCHEDULE,array('id'=>$disputeData->row()->prd_id));\n\t\t\t$sched = $schedule_q->row()->data;\n\t\t\n\t\t\t$data = json_decode($sched, true);\n\t\t\tforeach ($data as $key => $entry) \n\t\t\t{\n\t\t\n\t\t if ($key>= $getBookedDate->checkinDate && $key<=$getBookedDate->checkoutDate) {\n\t\t //echo $data[$key]['status'] = \"available\";\n\t\t if($entry['status'] != 'available')\n {\n unset($data[$key]);\n }\n // unset($data[$key]);\n\t\t $up_Q = \"delete from bookings WHERE the_date='\".$key.\"' and PropId=\".$disputeData->row()->prd_id;\n\t\t\t$this->review_model->ExecuteQuery($up_Q);\n\t\t\t\n\t\t }\n\t\t}\n\t\t\n\t\t$nw_schedule = json_encode($data);\n\t\t$up_Q = \"UPDATE schedule SET data='\".$nw_schedule.\"' WHERE id=\".$disputeData->row()->prd_id;\n\t\t$this->review_model->ExecuteQuery($up_Q);\n\t\t\n\t\t/* Start - Update RentalEnquiry and Commission Tracking*/\n\t\t$UpdateArr=array('cancelled'=>'Yes');\n\t\t$Condition=array('prd_id'=>$disputeData->row()->prd_id,\n\t\t\t\t\t\t'user_id'=>$disputeData->row()->user_id,\n\t\t\t\t\t\t'Bookingno'=>$disputeData->row()->booking_no);\n\n\t\t$this->review_model->update_details(RENTALENQUIRY,$UpdateArr,$Condition);\t\n\t\t$getEnquiryDet=$this->review_model->get_all_details(RENTALENQUIRY,array('Bookingno'=>$disputeData->row()->booking_no));\n\t\t\n\t\t$TheSubTot=$getEnquiryDet->row()->subTotal;\n\t\t$SecDeposit=$getEnquiryDet->row()->secDeposit;\n\t\t$CancelPercentage=$getEnquiryDet->row()->cancel_percentage;\n\t\t$CancelPercentAmt=$TheSubTot/100*$CancelPercentage;\n\t\t$cancel_amount_toGuest=$TheSubTot-$CancelPercentAmt;\n\t\t\n\t\tif($getEnquiryDet->row()->cancel_percentage!=\"100\"){ //For Moderate,Flexible\n\t\t\t$CancelAmountWithSecDeposit=$cancel_amount_toGuest+$SecDeposit;\n\t\t}else{ //For Strict\n\t\t\t$CancelAmountWithSecDeposit=$SecDeposit;\n\t\t}\n\t\t$UpdateCommissionArr=array('paid_cancel_amount'=>$CancelAmountWithSecDeposit);\n\t\t/*$TheSubTot=$getEnquiryDet->row()->subTotal;\n\t\t$CancelPercentage=$getEnquiryDet->row()->cancel_percentage;\n\t\t$CancelAmount=$TheSubTot/100*$CancelPercentage;\n\t\t$UpdateCommissionArr=array('paid_cancel_amount'=>$CancelAmount);*/\n\t\t\n\t\t\n\t\t$ConditionCommission=array('booking_no'=>$disputeData->row()->booking_no);\n\t\t$this->review_model->update_details(COMMISSION_TRACKING,$UpdateCommissionArr,$ConditionCommission);\n\t\t//$this->review_model->update_details(COMMISSION_TRACKING,$UpdateCommissionArr,$ConditionCommission);\n\t\t/* End - Update RentalEnquiry and Commission Tracking*/\n\t\t\n\t\t\t\t\t\t\t\t\t \n\t\t/*Mail To Guest Start*/\n\n\t\t$condition = array (\n\t\t'id' =>$disputeData->row()->disputer_id\n\t\t);\n\t\t$hostDetails = $this->review_model->get_all_details( USERS, $condition );\n\t\t\n\t\t$uid = $hostDetails->row ()->id;\n\t\t$hostname = $hostDetails->row()->user_name;\n\t\t$host_email = $hostDetails->row()->email;\n\n\t\t/*GetCustomerDetails*/\n\t\t$condition = array (\n\t\t'id' => $disputeData->row()->user_id\n\t\t);\n\n\t\t$custDetails = $this->review_model->get_all_details( USERS, $condition );\n\t\t$cust_name = $custDetails->row()->user_name;\n\t\t$cust_email = $custDetails->row()->email;\n\t \n\t\t\t$newsid='57'; \n\t\t\t$template_values=$this->review_model->get_newsletter_template_details($newsid);\n\t\t\tif($template_values['sender_name']=='' && $template_values['sender_email']=='')\n\t\t\t{\n\t\t\t\t$sender_email=$this->data['siteContactMail'];\n\t\t\t\t$sender_name=$this->data['siteTitle'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$sender_name=$template_values['sender_name'];\n\t\t\t\t$sender_email=$template_values['sender_email'];\n\t\t\t} \n \n $email_values = array('mail_type'=>'html',\n\t\t\t 'from_mail_id'=>$sender_email,\n\t\t\t\t\t'to_mail_id'=> $cust_email,\n\t\t\t\t\t'subject_message'=>$template_values ['news_subject'],\n\t\t\t\t\t\n\t\t\t); \n\n\t\t\t$reg = array ('name' => 'Accepted','host_name'=>$hostname,'cus_name'=>$cust_name,'logo' => $this->data['logo']);\n\n\t\t\t $message = $this->load->view('newsletter/ToGuestAcceptRejection'.$newsid.'.php',$reg,TRUE);\n $this->load->library('email'); \n $this->email->set_mailtype($email_values['mail_type']);\n $this->email->from($email_values['from_mail_id'], $sender_name);\n $this->email->to($email_values['to_mail_id']);\n $this->email->subject($email_values['subject_message']);\n $this->email->message($message); \n try{\n $this->email->send();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif($this->lang->line('mail_send_success') != '') \n\t\t\t\t\t\t\t{ \n\t\t\t\t\t\t\t\t$message = stripslashes($this->lang->line('mail_send_success')); \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$message = \"mail send success\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$this->setErrorMessage ( 'success',$message );\n\t\t\t\t\t\t\t\n }catch(Exception $e){\n echo $e->getMessage();\n\n\t\t\t}\n\t\t\t/*Mail To Guest End*/\n\t\t\n\t\t\t$this->setErrorMessage('success','Cancel booking accepted successfully');\n\t\t\tredirect('admin/dispute/cancel_booking_list');\t\t\n\n\t}", "public function actionCancelconvert() {\n if (!empty($_POST['id']))\n {\n\t CConvertQueue::model()->deleteUserQueue($this->user_id, $_POST['id']);\n }\n }", "public function actionCancel($id)\n {\n // $this->findModel($id)->delete();\n $model = $this->findModel($id);\n $model->approved = 'cancelled';\n $model->status = 0;\n if ( $model->save() ) {\n Yii::$app->getSession()->setFlash('success', 'Quotation Cancelled');\n } else {\n Yii::$app->getSession()->setFlash('danger', 'Unable to cancel the Quotation');\n }\n\n return $this->redirect(['index']);\n }", "public function cancel()\n {\n $this->updateMode = false;\n $this->resetInputFields();\n }", "public function cancel()\n {\n $this->updateMode = false;\n $this->resetInputFields();\n }", "public function cancelOrdersInPending()\n {\n //Etape 1 : on recupere pour chaque comptes le nombre de jours pour l'annulation\n $col = Mage::getModel('be2bill/merchandconfigurationaccount')->getCollection();\n $tabLimitedTime = array();\n foreach ($col as $obj) {\n $tabLimitedTime[$obj->getData('id_b2b_merchand_configuration_account')] = $obj->getData('order_canceled_limited_time') != null ? $obj->getData('order_canceled_limited_time') : 0;\n }\n\n //Etape 2\n $collection = Mage::getResourceModel('sales/order_collection')\n ->addFieldToFilter('main_table.state', Mage_Sales_Model_Order::STATE_NEW)\n ->addFieldToFilter('op.method', 'be2bill');\n $select = $collection->getSelect();\n $select->joinLeft(array(\n 'op' => Mage::getModel('sales/order_payment')->getResource()->getTable('sales/order_payment')), 'op.parent_id = main_table.entity_id', array('method', 'additional_information')\n );\n\n Mage::log((string)$collection->getSelect(), Zend_Log::DEBUG, \"debug_clean_pending.log\");\n\n // @var $order Mage_Sales_Model_Order\n foreach ($collection as $order) {\n $addInfo = unserialize($order->getData('additional_information'));\n $accountId = $addInfo['account_id'];\n $limitedTime = (int)$tabLimitedTime[$accountId];\n\n if ($limitedTime <= 0) {\n continue;\n }\n\n $store = Mage::app()->getStore($order->getStoreId());\n $currentStoreDate = Mage::app()->getLocale()->storeDate($store, null, true);\n $createdAtStoreDate = Mage::app()->getLocale()->storeDate($store, strtotime($order->getCreatedAt()), true);\n\n $difference = $currentStoreDate->sub($createdAtStoreDate);\n\n $measure = new Zend_Measure_Time($difference->toValue(), Zend_Measure_Time::SECOND);\n $measure->convertTo(Zend_Measure_Time::MINUTE);\n\n if ($limitedTime < $measure->getValue() && $order->canCancel()) {\n try {\n $order->cancel();\n $order->addStatusToHistory($order->getStatus(),\n // keep order status/state\n Mage::helper('be2bill')->__(\"Commande annulée automatique par le cron car la commande est en 'attente' depuis %d minutes\", $limitedTime));\n $order->save();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n }\n\n return $this;\n }", "function revoke()\n\t{\n\t}", "function resendCancelEmail(){\n\t\t//echo \"resend...\";\n\t\t$db\t\t= JFactory::getDbo();\n\t\t$query\t= $db->getQuery(true);\n\t\tif($_POST['cancelReId'] == '')\n\t\t\t$nId = $_POST['appCanId'];\n\t\telse\n\t\t\t$nId = $_POST['cancelReId'];\n\n\t\t$query->select($db->nameQuote('s_name'));\n\t\t$query->select($db->nameQuote('s_prename'));\n\t\t$query->select($db->nameQuote('s_address'));\n\t\t$query->select($db->nameQuote('s_plz'));\n\t\t$query->select($db->nameQuote('s_city'));\n\t\t$query->select($db->nameQuote('s_phone'));\n\t\t$query->select($db->nameQuote('s_email'));\n\t\t$query->select($db->nameQuote('idt_drivin_event_apply')); \n\t\t$query->select($db->nameQuote('s_title'));\t\t\n\t\t$query->from($db->nameQuote('#__jevent_events_apply'));\n\t\t$this->_id2 = $nId;\n\t\t$query->where($db->nameQuote('idt_drivin_event_apply') . '=' . $nId);\n\t\t//if(!$bCanceled)\n\t\t//\t$query->where($db->nameQuote('dt_Cancel') . ' is null');\n\t\t//else\n\t\t\t$query->where($db->nameQuote('dt_Cancel') . ' is not null');\n\t\t//echo \"SQLSTRING: \" . $query;\n\t\t$db->setQuery($query);\n\t\tif ($link = $db->loadRowList()) {\n\t\t\t$mailer = new jEventMailer();\n\t\t\t//$mailer->test();\n\t\t\t\n\t\t\tif(!$mailer->sendApplicationEmail2(1, $link, $this->getEventById2(), true)){\n\t\t\t\t$this->setError($mailer->error);\n\t\t\t\techo \"Eroooor \" . $mailer->error;\n\t\t\t}\n\t\t}else{\n\t\t\techo \"No Record Found! ReID: \". $nId;\n\t\t}\n\t\treturn true;\n\t\n\t}", "function PKG_discardJob($client, $package)\n{\n\tCHECK_FW(CC_clientname, $client, CC_package, $package);\n\t$sql=\"DELETE FROM clientjobs WHERE client='$client' AND status='wait4acc' AND package='$package';\";\n\tDB_query($sql); //FW ok\n}", "public function cancelEdit($data) {\n\t\t\n\t\t// Redirect back to the edit page\n\t\treturn $this->redirect(\"budgeting/edit\");\n\t}", "public function refundCancel($refundHandle);", "public function cancel_membership() {\n \t$membership_id = $this->uri->segment(3);\n\n \t$data = [\n \t\t'id' => $membership_id,\n \t\t'status' => 'Cancelled'\n \t];\n\n \t$this->Member_Model->update_membership($data);\n\n \tredirect('members/list/active');\n }", "public function abortDuel(){\n $this->plugin->getScheduler()->cancelTask($this->countdownTaskHandler->getTaskId());\n }", "public function cancel()\n {\n $this->_statement =null;\n }", "function abort() {\n $this->aborted = TRUE;\n }", "function cancelFriendRequest($params) {\n $username1 = $params['username1'];\n $username2 = $params['username2'];\n\n $response = rejectFriendRequest($username1, $username2);\n\n if ($response['status'] == 'SUCCESS') {\n echo json_encode($response['response']);\n } else {\n errorHandler($response['status'], $response['code']);\n }\n }", "function cancelar()\r\n\t{\r\n\t\t$this->_log->debug( $this->get_txt() . \"[ cancelar ]\", 'toba');\r\n\t\t$this->limpiar_memoria();\r\n\t}", "public function hookActionProductCancel($params)\n {\n if ($params['action'] === CancellationActionType::STANDARD_REFUND) {\n $order = $params['order'];\n $cart_id = $order->id_cart;\n $cart = new Cart($cart_id);\n\n // realizamos la consulta de base de datos para el tiketNumber\n $query = 'SELECT * FROM '._DB_PREFIX_.'kushkipagos WHERE `cart_id` = \\''.$cart_id.'\\' limit 1 ';\n $order_kushki = Db::getInstance()->executeS($query);\n\n $ticket_number = $order_kushki[0][\"ticket_number\"];\n $kushkiToken = $order_kushki[0][\"token\"];\n\n $currency_order = new Currency((int)((int)$params[\"order\"]->id_currency));\n\n $amount = $this->getAmountValues($cart);\n\n $obj_amount = array_merge($amount, array(\"currency\" =>$currency_order->iso_code));\n // llamamos al endpoint de refund\n $refund = $this->callUrlRefund($obj_amount, $ticket_number);\n\n if ( ! $refund ) {\n throw new PrestaShopException('An error occurred while attempting to create the refund using the payment gateway API.');\n }else{\n if ($refund->isSuccessful()) {\n //cambiamos el status a refunded\n $history = new OrderHistory();\n $history->id_order = (int)$order->id;\n $history->changeIdOrderState(7, (int)($order->id));\n $order->setCurrentState(7);\n PrestaShopLogger::addLog('Kushki Refund CORRECTO en orden' . $order->id . ' Ticket number: ' . $refund->getTicketNumber(), 1);\n $this->saveDataRefund($kushkiToken, $refund->getTicketNumber(), $cart_id, (int)$order->id, (int)Configuration::get('PS_OS_REFUND'), $order->total_paid, \"kushkipagos\", \"refund\", (int)$order->id_currency, $order->secure_key, \"initialized\" );\n } else {\n PrestaShopLogger::addLog('Kushki Refund FALLIDO en orden '.$order->id.' Message ' . $refund->getResponseText(), 3);\n throw new OrderException('Hubo un error en el refund de esta orden.');\n }\n }\n\n } else if ($params['action'] === CancellationActionType::PARTIAL_REFUND) {\n throw new OrderException('Kushki no puede hacer devoluciones parciales, debe hacer la devolución del total del pedido');\n }\n }", "public function cancel($id)\n {\n $reservation = $this->repository->makeModel()->find($id);\n\n $reservation->is_canceled = true;\n $reservation->canceled_at = Carbon::now();\n\n $reservation->is_confirmed = null;\n $reservation->confirmed_at = null;\n\n $history = $reservation->history;\n\n $log = [\n 'full_name' => \\Auth::user()->full_name,\n 'action' => 'cancel',\n 'label' => 'Cancelou a reserva',\n 'date' => Carbon::now()->format('Y-m-d H:i:s')\n ];\n\n if (!$history) {\n $history = [$log];\n }else{\n $history = array_prepend($history, $log);\n }\n\n $reservation->history = $history;\n\n $reservation->save();\n\n if (request()->wantsJson()) {\n\n return response()->json([\n 'message' => 'PlaceReservations canceled.',\n 'canceled' => $reservation->load('client'),\n ]);\n }\n\n return redirect()->back()->with('message', 'PlaceReservations deleted.');\n }", "public function cancel($mixed = null) {\n\t\t$validParameters = array(\n\t\t\t'(orderv2\\cancel)',\n\t\t);\n\t\t$args = func_get_args();\n\t\t$this->_checkArguments($args, $validParameters);\n\t\treturn $this->__soapCall('cancel', $this->make_soap_params($mixed));\n\t}", "public function reject()\n {\n if ($this->withdrawal->status == Withdrawal::STATUS_CREATED) {\n // update withdrawal model\n $this->withdrawal->status = Withdrawal::STATUS_REJECTED;\n $this->withdrawal->save();\n // create a credit transaction on user account to return funds\n $accountService = new AccountService($this->withdrawal->account);\n $accountService->transaction($this->withdrawal, $this->withdrawal->amount);\n }\n }", "protected function abortAction($id)\n\t{\n\t\tif(Core::getUser()->get(\"umode\") || !$this->event)\n\t\t{\n\t\t\t$this->redirect(\"game/\".SID.\"/Research\");\n\t\t}\n\t\t$result = Core::getQuery()->select(\"construction\", array(\"buildingid\"), \"\", Core::getDB()->quoteInto(\"buildingid = ? AND mode = '2'\", $id));\n\t\tif($row = $result->fetchRow())\n\t\t{\n\t\t\t$result->closeCursor();\n\t\t\tHook::event(\"AbortResearch\", array($this));\n\t\t\tGame::getEH()->removeEvent($this->event->get(\"eventid\"));\n\t\t\t$this->redirect(\"game/\".SID.\"/Research\");\n\t\t}\n\t\t$result->closeCursor();\n\t\treturn $this;\n\t}", "private function cancelOrder($order){\r\n $this->log('Cancelling order #'.$order->get_order_number());\r\n $this->addOrderNote($order, 'La orden fue cancelada por Flow');\r\n $order->update_status('cancelled');\r\n }", "public function cancel($value) {\n return $this->setProperty('cancel', $value);\n }", "function cancel() {\n\n\t\tif (KRequest::getVar('return')) {\n\t\t\t$url = KLink::base64UrlDecode(KRequest::getVar('return'));\n\t\t}\n\t\telse {\n\t\t\t$controllerName = KenedoController::getControllerNameFromClass(get_class($this));\n\t\t\t$url = KLink::getRoute('index.php?option='.$this->component.'&controller='.$controllerName, false);\n\t\t}\n\n\t\t$this->setRedirect($url);\n\n\t}" ]
[ "0.70950896", "0.6792129", "0.673451", "0.6637228", "0.66296", "0.66229475", "0.6556718", "0.6556718", "0.6524305", "0.64539254", "0.64478517", "0.6418768", "0.6393506", "0.63328683", "0.6309004", "0.6247098", "0.62436557", "0.62217855", "0.61927325", "0.6090705", "0.6030654", "0.6012683", "0.6012108", "0.5999509", "0.59586203", "0.59475726", "0.59288526", "0.588143", "0.5872035", "0.5871387", "0.5849865", "0.5814963", "0.5814606", "0.5797223", "0.5790642", "0.57629246", "0.5762026", "0.5749797", "0.5742678", "0.57423764", "0.5728034", "0.5723754", "0.5709814", "0.5707654", "0.5701477", "0.56984514", "0.569573", "0.5693597", "0.56777185", "0.5676552", "0.5662797", "0.5662608", "0.5662608", "0.56448346", "0.5637989", "0.5636387", "0.5626594", "0.5608206", "0.5607843", "0.56072056", "0.56018215", "0.5598666", "0.5592755", "0.5589444", "0.55787355", "0.55771154", "0.5570164", "0.55686027", "0.55661446", "0.55591863", "0.55585736", "0.55539775", "0.55436015", "0.5540928", "0.55402356", "0.55346304", "0.5527541", "0.5525859", "0.5510888", "0.55009294", "0.55009294", "0.54947346", "0.5493131", "0.5487387", "0.5487", "0.54819185", "0.54807854", "0.5473671", "0.5467014", "0.5457157", "0.544737", "0.54432505", "0.5434907", "0.54302615", "0.5428857", "0.54245967", "0.5416562", "0.5413681", "0.54118", "0.5404326", "0.5399103" ]
0.0
-1
actionid: download actiondesc: Download surat
public function actionDownload($id){ $model = $this->findModel($id); $file = $model->file_surat; $path = Yii::getAlias('@webroot').'/'.$file; if(file_exists($path)){ Yii::$app->response->sendFile($path); }else{ $this->render('download404'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function downloadAction() {}", "function downloadDocumentAction()\n\t{\n\t\t$request = $this->_request->getParams();\n\t\t$this->_redirect(\"/BO/download-quote.php?type=\".$request['type'].\"&mission_id=\".$request['mission_id'].\"&index=\".$request['index'].\"&quote_id=\".$request['quote_id'].\"&logid=\".$request['logid'].\"&filename=\".$request['filename']);\n\t}", "public function download() {\t\t}", "public function downloadAction(){\n //These are the files that are downloadable.\n $pathToDocs = RAIZ. \"/docs\";\n $param_to_file = array( \"milestone1\" => $pathToDocs . \"/milestone 1/group13-milestone1.pdf\",\n \"milestone2\" => $pathToDocs . \"/milestone 2/group13-milestone2.pdf\",\n \"milestone2-revision1\" => $pathToDocs . \"/milestone 2/group13-milestone2-comments.pdf\",\n \"milestone2-presentation\" => $pathToDocs . \"/milestone 2/group13-milestone2-presentation.pptx\");\n $file = $param_to_file[$this->_getParam('file')];\n //If we are being ask for a file that is not in the previous array, throw an Exception.\n if(is_null($file)){\n throw new Exception(\"Unknown file\");\n }\n //Disable view and layout\n $this->_helper->layout()->disableLayout();\n $this->_helper->viewRenderer->setNoRender(true);\n //The file is in the previous array. So, fetch it and force the download.\n if (file_exists($file) && is_file($file)) {\n header('Content-Description: File Transfer');\n header('Content-Type: application/octet-stream');\n header('Content-Disposition: attachment; filename='.basename($file));\n header('Content-Transfer-Encoding: binary');\n header('Expires: 0');\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n header('Pragma: public');\n header('Content-Length: ' . filesize($file));\n ob_clean();\n flush();\n readfile($file);\n exit;\n }else{\n echo \"<pre style='color:red'>The file does not exists</pre>\";\n } \n }", "public function downloadAction() {\r\n $file_id = $this->getRequest()->getParam('file_id');\r\n $chanelphoto = Engine_Api::_()->getItem('sesvideo_chanelphoto', $this->getRequest()->getParam('photo_id'));\r\n if (!$chanelphoto)\r\n return;\r\n $chanelphoto->download_count = $chanelphoto->download_count + 1;\r\n $chanelphoto->save();\r\n $file_id = $chanelphoto->file_id;\r\n if ($file_id == '' || intval($file_id) == 0)\r\n return;\r\n $storageTable = Engine_Api::_()->getDbTable('files', 'storage');\r\n $select = $storageTable->select()->from($storageTable->info('name'), array('storage_path', 'name'))->where('file_id = ?', $file_id);\r\n $storageData = $storageTable->fetchRow($select);\r\n $storageData = (object) $storageData->toArray();\r\n if (empty($storageData->name) || $storageData->name == '' || empty($storageData->storage_path) || $storageData->storage_path == '')\r\n return;\r\n //Get base path\r\n $basePath = APPLICATION_PATH . '/' . $storageData->storage_path;\r\n @chmod($basePath, 0777);\r\n header(\"Content-Disposition: attachment; filename=\" . urlencode(basename($storageData->name)), true);\r\n header(\"Content-Transfer-Encoding: Binary\", true);\r\n header(\"Content-Type: application/force-download\", true);\r\n header(\"Content-Type: application/octet-stream\", true);\r\n header(\"Content-Type: application/download\", true);\r\n header(\"Content-Description: File Transfer\", true);\r\n header(\"Content-Length: \" . filesize($basePath), true);\r\n readfile(\"$basePath\");\r\n exit();\r\n // for safety resason double check\r\n return;\r\n }", "public function downloadFile();", "public function Download(){\n\t\t\n\t\t\n\t}", "public function download()\n\t{\n\t\tR::selectDatabase('oxid');\n\t\t$files = $this->getFilesByName(Flight::request()->query->file);\n\t\tif (empty($files)) $this->redirect('/');\n\t\t$file = reset($files);\n\t\t$dwnloadDir = substr($file['OXSTOREHASH'], 0, 2);\n\t\t$dwnloadFile = Flight::get('oxid_dir_downloads').$dwnloadDir.'/'.$file['OXSTOREHASH'];\n\t\tif ( ! is_file($dwnloadFile)) $this->redirect('/');\n\t\t//error_log($dwnloadFile);\n\t\theader('Content-type: application/pdf');\n\t\theader('Content-Disposition: inline; filename=\"'.$file['OXFILENAME'].'\"');\n\t\t@readfile($dwnloadFile);\n\t}", "function download()\n {\n $field = $this->GET('field');\n $id = $this->GET('id');\n $file = $this->table->data[$id][$field];\n header('Content-Type: ' . $this->_mime_content_type($file));\n header('Content-Length: ' . strlen($file));\n header('Content-Disposition: attachment; filename=\"' . $field . '_' . $id . '\";');\n echo $file;\n }", "public function downloadAction()\n {\n $url = $this->getRequest()->REQUEST_URI;\n $url = str_replace('/stream/download/', '/', '../data/uploads/images' . $url);\n $this->download($url, null, 'application/jpg');\n $this->view->message = \"Download erfolgreich.\";\n }", "public function downloadftvAction()\n {\n $user_params=$this->_request->getParams();\n $request_id = $user_params['request_id'];\n $zipname = explode(\"/\",$user_params['filename']);\n // set example variables\n $filename = $zipname[1];\n $filepath = $request_id.\"-\".$filename;\n\n $this->_redirect(\"/BO/download_ftv.php?ftvfile=\".$filepath.\"\");\n /** Author: Thilagam **/\n /** Date:05/05/2016 **/\n /** Reason: Code optimization **/\n //$this->_redirect(\"/BO/download-files.php?function=downloadFtv&ftvfile=\".$filepath.\"\");\n\n }", "public function action_download()\n\t{\n\t\t$view = View::forge('tracker/download');\n\t\t$data = array(\n\t\t\t'page_title' => '動漫清單',\n\t\t\t'loggedin' => true,\n\t\t\t'user' => $this->getUserInfo(),\n\t\t);\n\t\t$view->set_global($data);\n\t\treturn $view;\n\t}", "function download($id){\r\n\t\t\r\n\t\t$id = Sanitize::escape($id);\r\n\t\t//$this->Version->unbind();\r\n\t\t$archivo = $this->Version->findById($id);\r\n\t\t$archivo_id = $archivo['Archivo']['id'];\r\n\t\t\r\n\t\t#Permitir la descarga del archivo si tiene los permisos\r\n\t\tif(!$this->Archivo->verificarPermiso($archivo_id, $this->Session->read('usuario_id'), 'read', $this->Session->read('alias')) ){\r\n\t\t\t$this->flash(\"Existio un error no es posible descargar el Archivo\", \"/categorias/index\");\r\n\t\t}else{\r\n\t\t\t$f = new File($archivo['Version']['nombre']);\r\n\t\t\theader('Content-type: ' . $archivo['Archivo']['type']);\r\n\t\t\theader('Content-length: ' . $archivo['Version']['size']);\r\n\t\t\theader('Content-Disposition: attachment; filename=\"'.$archivo['Archivo']['nombre'].'\"');\r\n\t\t\techo $f->read();\r\n\t\t\tConfigure::write('debug',0);\r\n\t\t\texit(0);\r\n\t\t}\r\n\t}", "public function downloadMaterialAction()\n {\n $codigo = $this->_getParam('codigo');\n $anexo = $this->getService('AnexoArtefatoVinculo')->find($codigo);\n $path = explode('/',$anexo->getDeCaminhoAnexo());\n $registry = \\Zend_Registry::get('configs');\n $options = array('path' => $registry['upload']['material']);\n $file = \"{$path['4']}\";\n $this->_helper->download($file, $options);\n }", "public function download()\n\t{\n\t\t$sfUsers = sfCore::getClass('sfUsers');\n\t\tif($this->auth_requirement != 0)\n\t\t{\n\t\t\tif($sfUsers::translateAuthLevelString($sfUsers::getUserAuthLevel()) < $this->auth_requirement)\n\t\t\t{\n\t\t\t\tthrow new sfAuthorizationException();\n\t\t\t}\n\t\t}\n\n\t\t$update = sfCore::db->query(\"UPDATE `swoosh_file_storage` SET `downloads` = `downloads`+1 WHERE `id` = '%i' LIMIT 1;\",\n\t\t\t$this->id);\n\t\tfSession::close();\n\t\t$this->fFile->output(true, true);\n\t}", "public function actionDownloadedit() {\n\n $model = $this->loadModel();\n if (isset($_POST['file_index'])) { //download file from file_bytes \t\t\n CActiveForm::validate($model);\n /**\n *\n */\n $model->validate();\n /**\n *\n */\n $attachment_id = $_POST['file_index'];\n /**\n *\n */\n if ($attachment_id == '1') {\n $file_name = $model->attachment1_file_name;\n $file_type = $model->attachment1_file_type;\n $content = base64_decode($model->attachment1_file_bytes);\n } else if ($attachment_id == '2') {\n $file_name = $model->attachment2_file_name;\n $file_type = $model->attachment2_file_type;\n $content = base64_decode($model->attachment2_file_bytes);\n } else if ($attachment_id == '3') {\n $file_name = $model->attachment3_file_name;\n $file_type = $model->attachment3_file_type;\n $content = base64_decode($model->attachment3_file_bytes);\n }\n /**\n *\n */\n header('Content-Type: ' . $file_type);\n header('Content-Disposition: attachment;filename=\"' . $file_name . '\"');\n header('Cache-Control: max-age=0');\n echo $content;\n } else {\n //download file from host\n $attachment_id = 0;\n if (isset($_GET['1'])) {\n $attachment_id = 1;\n } else if (isset($_GET['2'])) {\n $attachment_id = 2;\n } else if (isset($_GET['3'])) {\n $attachment_id = 3;\n }\n if ($attachment_id != 0) {\n $file_name = Yii::app()->db->createCommand()\n ->select('attachment' . $attachment_id)\n ->from('hobby_new')\n ->where('id=:id', array('id' => $_GET['id']))\n ->queryScalar();\n if ($file_name != \"\" && file_exists(Yii::getPathOfAlias('webroot') . $file_name)) {\n Yii::import('ext.helpers.EDownloadHelper');\n EDownloadHelper::download(Yii::getPathOfAlias('webroot') . $file_name);\n }\n }\n }\n exit;\n }", "public function download($id);", "public function action_doc_quick_download()\n\t{\n\t\t$document_id = $this->request->param('id');\n\t\t$knowledgetree_data = Kohana::$config->load('config')->get('KnowledgeTree');\n\t\t$kt_connection = New KTClient($knowledgetree_data['url']);\n\t\t$kt_connection->initSession($knowledgetree_data['username'], $knowledgetree_data['password']);\n\t\t$kt_connection->downloadDocument($document_id);\n\t}", "public function download()\n {\n $encrypt = $this->services['encrypt'];\n $file_name = $encrypt->decode($this->getPost('id'));\n $type = $this->getPost('type');\n $storage = $this->services['backup']->setStoragePath($this->settings['working_directory']);\n if($type == 'files')\n {\n $file = $storage->getStorage()->getFileBackupNamePath($file_name);\n }\n else\n {\n $file = $storage->getStorage()->getDbBackupNamePath($file_name);\n }\n \n \n $backup_info = $this->services['backups']->setLocations($this->settings['storage_details'])->getBackupData($file);\n $download_file_path = false;\n if( !empty($backup_info['storage_locations']) && is_array($backup_info['storage_locations']) )\n {\n foreach($backup_info['storage_locations'] AS $storage_location)\n {\n if( $storage_location['obj']->canDownload() )\n {\n $download_file_path = $storage_location['obj']->getFilePath($backup_info['file_name'], $backup_info['backup_type']); //next, get file path\n break;\n }\n }\n }\n \n if($download_file_path && file_exists($download_file_path))\n {\n $this->services['files']->fileDownload($download_file_path);\n exit;\n }\n }", "function instant_download($product_id, $ftype=null) {\n \n if (!$filetype = GetReq('filetype'))\n $filetype = $ftype ? $ftype : $this->ftype;\n \n \t //extra security set form must be filled as session param\n\t //to prevent cmd instant download without it.\n\t if ((GetSessionParam('FORMSUBMITED')) || GetSessionParam(\"CODESUBMITED\")) {\t \n \n $file = $this->wherethefileis . $product_id . $this->file_epithema . $filetype;\t \n\t //$file = \"c:\\\\php\\\\webos2\\\\projects\\\\re-coding-official\\\\demo\\\\delphi2java_shareware.zip\";\n\t //echo \"DOWNLOAD:\",$file;\n\t //die();\n $downloadfile = new DOWNLOADFILE($file);\n\t \n /*$this->tell_by_mail(\"demo file downloaded\",\n\t '[email protected]',\n\t\t '[email protected]',\n\t\t\t\t\t\t $file);\t\n\t\t\t\t\t\t \n $this->tell_by_sms(\"$product_id demo file downloaded.\");*/\t\n\t\t \n\t //inform bt mail and sms\n\t $this->send_downloaded_mail($product_id);\t\t\t\t\t \n\t \n if (!$downloadfile->df_download()) {\n\t //echo \"Sorry, we are experiencing technical difficulties downloading this file. Please report this error to Technical Support.\";\t \t \n\t\t$m = paramload('RCDOWNLOAD','error');\t\n\t\t$ff = $this->prpath.$m;\n\t\tif (is_file($ff)) {\n\t\t $ret = file_get_contents($ff);\n\t\t}\n\t\telse\n\t\t $ret = $m; //plain text\t\t \n\t }\n\t //else\n\t // $ret = \"OK\";\t\n\t }\n\t else\n\t $ret = \"Prohibited area!\"; \n\t\t \t \n\t return ($ret);\n\t \n\t \n\t //use download2.lib\n\t //$dFile = new Download_file($this->prpath . paramload('RCDOWNLOAD','dirsource') , $product_id . $this->ftype);\n }", "function executeDownload($e){\n $url = \"app/info/exportRequestHistory.php?account=\" . $this->account->intVal();\n $html = '<iframe src=\"'.$url.'\" width=\"1\" height=\"1\" style=\"position:absolute;visibility:hidden;\"></iframe>';\n $this->downloadFrame->html($html);\n $this->downloadFrame->updateClient();\n }", "public function downloadAction()\n\t{\n\t\t$settings = $this->getProgressParameters();\n\n\t\tif (!empty($settings['downloadParams']['filePath']) && !empty($settings['downloadParams']['fileName']))\n\t\t{\n\t\t\t$file = new Main\\IO\\File($settings['downloadParams']['filePath']);\n\t\t\tif ($file->isExists())\n\t\t\t{\n\t\t\t\t$response = new Main\\Engine\\Response\\File(\n\t\t\t\t\t$file->getPath(),\n\t\t\t\t\t$settings['downloadParams']['fileName'],\n\t\t\t\t\t$settings['downloadParams']['fileType']\n\t\t\t\t);\n\n\t\t\t\treturn $response;\n\t\t\t}\n\t\t}\n\n\t\t$this->addError(new Error('File not found'));\n\t}", "function httpdownload($product_id) {\n \n \t //extra security set form must be filled as session param\n\t //to prevent cmd instant download without it.\n\t if (GetSessionParam('FORMSUBMITED')) {//&&\n\t //(GetGlobal('controller')->calldpc_method('httpdownload.get_filename'))) {\t \n\n $file = $this->wherethefileis . $product_id . $this->file_epithema . $this->ftype;\t \n\t $title = $this->get_product_info($product_id);\t\t \n \n \n if ($this->download_link) { \n //$d = new httpdownload($file);\n\t //$ret = $d->select_download_type();\t \n\t\t //$ret = GetGlobal('controller')->calldpc_method('httpdownload.select_download_type');\n\t\t $ret = GetGlobal('controller')->calldpc_method('httpdownload.set_download use NRSPEED');\n\t\t //infoem by mail and sms\n\t\t $this->send_downloaded_mail($product_id);\n\t }\n\t else\n\t $ret = \"ERROR:file not exist!\";\t \n\t \n\t $w = new window($title. \" SHAREWARE EDITION\",\"<h2>\".$ret.\"</h2>\");//$link);\n\t $out = $w->render();\n\t unset($w);\t\n\t }\n\t else\n\t $out = \"Prohibited area!\"; \n\t \n\t return ($out);\n }", "function downloadFile($args) {\n\t\t$monographId = isset($args[0]) ? $args[0] : 0;\n\t\t$fileId = isset($args[1]) ? $args[1] : 0;\n\t\t$revision = isset($args[2]) ? $args[2] : null;\n\n\t\t$this->validate($monographId);\n\t\t$submission =& $this->submission;\n\t\tif (!CopyeditorAction::downloadCopyeditorFile($submission, $fileId, $revision)) {\n\t\t\tRequest::redirect(null, null, 'submission', $monographId);\n\t\t}\n\t}", "public function downloadFile()\n {\n // Check for request forgeries.\n Session::checkToken('get') or jexit(Text::_('JINVALID_TOKEN'));\n\n $model = $this->getModel();\n $model->downloadFile();\n }", "public function download() {\n $this->autoRender = false;\n $filename = $this->request->params['pass'][3];\n $orgfilename = $this->request->params['pass'][4];\n// pr($this->request->params); exit;\n $this->response->file(\n 'webroot/uploads/post/files/' . $filename, array(\n 'download' => true,\n 'name' => $orgfilename\n )\n );\n// return $this->response;\n }", "public function download(string $url);", "public function download(){\n\t\t$lang = \"En\";\n\t\tif (isset ( $_SESSION [\"user_settings\"] [\"language\"] )) {\n\t\t\t$lang = $_SESSION [\"user_settings\"] [\"language\"];\n\t\t}\n\t\t\n\t\t// get form posts\n\t\t$localurl = $this->request->getParameter(\"localurl\");\n\t\t$filename = $this->request->getParameter(\"filename\");\n\t\t\n\t\t// get the user login\n\t\t$idUser = $_SESSION[\"id_user\"];\n\t\t$modelUser = new User();\n\t\t$userlogin = $modelUser->userLogin($idUser);\n\t\t\n\t\t// parse the files names\n\t\t$filename = str_replace(\"__--__\", \".\", $filename);\n\t\t$filename = str_replace(\"__---__\", \" \", $filename);\n\t\t$filename = str_replace(\"__----__\", \"/\", $filename);\n\t\t$localurl = str_replace(\"\\\\\", \"/\" , $localurl) . \"/\" . basename($filename);\n\t\t$fileName = \"./\" . $userlogin .\"/\".basename($filename);\n\t\t\n\t\t// refuse to download if the quotas is over\n\t\t$modelQuotas = new StUserQuota();\n\t\t$userQuotas = $modelQuotas->getQuota($idUser); // in GB\n\t\t$modelUploader = new StUploader();\n\t\t$usage = $modelUploader->getUsage($userlogin);\n\t\t$usage = $usage/1000000000; \n\t\t\n\t\tif ($usage >= $userQuotas){\n\t\t\t$this->index( StTranslator::QuotasHoverMessage($lang) . $localurl);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// download\n\t\t$modelFiles = new StUploader();\n\t\t$modelFiles->downloadFile($localurl, $fileName);\n\t\t\n\t\t\n\t\t// view\n\t\t$this->index( StTranslator::DownloadMessage($lang) . $localurl);\n\t\treturn;\n\t}", "public function download()\n {\n $hashids = new Hashids(Configure::read('Security.salt'));\n $pk = $hashids->decode($this->request->query['i'])[0];\n $this->loadModel($this->request->query['m']);\n $data = $this->{$this->request->query['m']}->find('first', array(\n 'recursive' => -1,\n 'conditions' => array(\n \"{$this->request->query['m']}.\" . $this->{$this->request->query['m']}->primaryKey => $pk\n ),\n 'fields' => array(\n \"{$this->request->query['m']}.{$this->request->query['f']}\"\n )\n ));\n $file = json_decode($data[$this->request->query['m']][$this->request->query['f']], true);\n\n header('Content-length: ' . $file['size']);\n header('Content-type: ' . $file['type']);\n header('Content-Disposition: inline; filename=' . $file['name']);\n echo base64_decode($file['content']);\n\n die();\n }", "public function sendPrroductDownloadToBrowser() {\n $transaction = getTransaction($_GET['id']);\n if ($transaction['status'] == \"valid\") {\n header(\"Content-Type: application/octet-stream\");\n header(\"Content-Transfer-Encoding: binary\");\n header(\"Content-Description: File Transfer\");\n if ($_GET[\"oto\"] && $transaction['oto']) {\n $fparts = explode(\"/\", $sys_oto_location);\n $filename = $fparts[count($fparts)-1];\n header(\"Content-Disposition: attachment; filename=$filename\");\n @readfile($sys_oto_location);\n } else {\n $fparts = explode(\"/\", $sys_item_location);\n $filename = $fparts[count($fparts)-1];\n header(\"Content-Disposition: attachment; filename=$filename\");\n @readfile($sys_item_location);\n }\n exit;\n } elseif ($transaction['status'] == \"expired\") {\n $filename = \"downloadexpired.html\";\n } else {\n $filename = \"invalid.html\";\n }\n showTemplate($filename);\n }", "public function download($id) {\n\t\tif (!$this->request->is('post')) {\n\t\t\tthrow new MethodNotAllowedException();\n\t\t}\n\t\tConfigure::write('debug', 0);\n\t\t$file = $this->Resource->findById($id);\n\t\t\n\t\t//header('Content-type: ' . $file['MyFile']['type']);\n//\t\theader('Content-length: ' . $file['MyFile']['size']); // some people reported problems with this line (see the comments), \t\t\tcommenting out this line helped in those cases\n\t\theader('Content-Disposition: attachment; filename=\"'.$file['Resource']['title'].'\"');\n\t\techo $file['Resource']['data'];\n\t\t\t\n\t\texit();\n}", "function downloadFile($data){\r\n\r\n $dao = new \\PNORD\\Model\\MaintenanceDAO($this->app); \r\n $info = $dao->getMaintenance($data); \r\n $this->app->log->info('****info **** -> '.$this->dumpRet($info));\r\n\r\n\r\n if (file_exists($info['FILES'])) {\r\n\r\n // header('Content-Description: File Transfer');\r\n header('Content-Type: application/zip');\r\n $name = split('maintenances/', $info['FILES']);\r\n $this->app->log->info('****name **** -> '.$this->dumpRet($name));\r\n $this->app->log->info('****info Files **** -> '.$this->dumpRet($info['FILES']));\r\n $this->app->log->info('****filesize(info[FILES]) **** -> '.$this->dumpRet(filesize($info['FILES'])));\r\n header('Content-Disposition: inline; filename='.basename($name[1]));\r\n header('Expires: 0');\r\n header('Cache-Control: must-revalidate');\r\n header('Pragma: public');\r\n header('Content-Length: ' . filesize($info['FILES']));\r\n ob_clean();\r\n flush();\r\n readfile($info['FILES']);\r\n exit;\r\n\r\n } \r\n\r\n }", "public function actionDownloadBackupFile()\n\t{\n\t\t$fileName = craft()->request->getRequiredQuery('fileName');\n\n\t\tif (($filePath = IOHelper::fileExists(craft()->path->getTempPath().$fileName.'.zip')) == true)\n\t\t{\n\t\t\tcraft()->request->sendFile(IOHelper::getFileName($filePath), IOHelper::getFileContents($filePath), array('forceDownload' => true));\n\t\t}\n\t}", "public function download($id)\n\t{\n\t\t$fileInfo = $this->m_admin->getRows(array('name' => $id));\n\t\t//file path\n\t\t$filename = $fileInfo['name'] ?? 'default value';\n\t\t$filepath = 'C:\\xampp\\htdocs\\repositori\\uploads\\file_aplikasi/' . $fileInfo['name'];\n\t\t$data = file_get_contents($filepath);\n\t\t//download file from directory\n\t\t$mime = get_mime_by_extension($filepath);\n\t\theader('Content-Type: ' . $mime); // Add the mime type from Code igniter.\n\n\t\treturn force_download($filename, $data);\n\t}", "public function download() {\n\t\theader('Content-Disposition: attachment; filename=\"' . basename($this->fileName) . '\"');\n\t\t$this->show();\n\t}", "function download_suket_021()\n\t{\n\t\tforce_download('assets/uploads/warga/suket_021/template_surat_recomendasi_usaha_mikro_kecil.docx', NULL);\n\t}", "public function getDownloadInfoAction() {\n list($gameId, $from) = $this->parseGameIdInput();\n\n if (self::GAME_SOURCE_BAIDU == $from) {\n $this->localOutput(-1, 'baidu game not supported by this api');\n }\n\n $version = Resource_Service_Games::getGameVersionInfo($gameId);\n if (!$version) {\n $message = 'there is no this game: ' . $gameId;\n $this->localOutput(-1, $message);\n }\n\n $downloadInfo[Util_JsonKey::GAME_ID] = '' . $gameId;\n $downloadInfo[Util_JsonKey::VERSION_CODE] = $version['version_code'];\n $downloadInfo[Util_JsonKey::VERSION_NAME] = $version['version'];\n\n if (strnatcmp($this->getInput('type'), 'split') == 0) {\n \t$game = $this->getPackageGameInfo($gameId);\n \tif ($game) {\n\t \t$downloadInfo[Util_JsonKey::DOWN_URL] = $this->getDiffPackageUrl($game, $this->getInput('md5'));\n \t} else {\n \t\t$downloadInfo[Util_JsonKey::DOWN_URL] = '';\n \t}\n } else {\n \t$downloadInfo[Util_JsonKey::DOWN_URL] = $version['link'];\n }\n\n $this->localOutput(0, '', $downloadInfo);\n }", "function downloadtarget(){\n\t\t$userid=$GLOBALS['username'];\n\t\t$contenttarget=mysql_query(\"SELECT sentence from \".$userid.\"target\") or die(mysql_error());\n\t\t$contentsize=mysql_query(\"SELECT count(sentence) from \".$userid.\"target\") or die(mysql_error());\n\t\t$sizevar=mysql_fetch_array($contentsize);\n\t\t$size=$sizevar[\"count(sentence)\"];\n\t\theader('Content-Description: File Transfer');\n\t\theader('Content-Type: application/octet-stream');\n\t\theader('Content-Disposition: attachment; filename='.$userid.'target.txt');\n\t\theader('Content-Transfer-Encoding: binary');\n\t\theader('Expires: 0');\n\t\theader('Cache-Control: must-revalidate');\n\t\theader('Pragma: public');\n\t\twhile($target=mysql_fetch_array($contenttarget)){\n\t\t\techo $target['sentence'].\"\\n\";\n\t\t}\n\t\texit;\n}", "function download_activity_file($filename)\n\t{\n\t\t$this->http_set_content_type(NULL);\n\t\t$this->load_url(\"activities/$filename\", 'get');\n\t\treturn $this->http_response_body;\n\t}", "function tdc_do_download($file_name){\n $database = tdc_open_database(TDC_DATABASE_FILE);\n $filenode = tdc_find_filenode($database, $file_name);\n\n if($filenode != null){\n $file_path = TDC_DOC_ROOT . tdc_get_filepath($filenode);\n $file_name = tdc_get_filename($filenode);\n if(tdc_send_file($file_path, $file_name)){\n tdc_update_count($database, $filenode, TDC_DATABASE_FILE);\n }\n }\n}", "function download($filename){\n\t\t$this->downloadFile('files/pdf/',$filename);\n\t}", "public function actionDownload($id,$format){\n\t\t$ext = array(\n\t\t\t1=>'.pdf',\n\t\t\t2=>'.epub',\n\t\t\t3=>'.mobi',\n\t\t);\n\t\tif(!isset($ext[$format]))\n\t\t\t$this->redirect(array('books/files','id'=>$id));\n\t\t$model = Books::model()->findByPk($id);\n\t\tif(!$model)\n\t\t\t$this->redirect(YII::app()->createAbsoluteUrl(''));\n\t\t$model->downloads++;\n\t\t$model->save();\n\t\tif($model->chapters){\n\t\t\t$zipname = CHtml::decode($model->title).'.zip';\n\t\t\t$zip = new ZipArchive;\n\t\t\t$zip->open($zipname, ZipArchive::CREATE);\n\t\t\tforeach ($model->chapters as $file) {\n\t\t\t $zip->addFile(YII::app()->basePath.'/../upload/pdf/'.$file->id.$ext[$format],$file->title.$ext[$format]);\n\t\t\t}\n\t\t\t$zip->close();\n\t\t\theader('Content-Type: application/zip');\n\t\t\theader('Content-disposition: attachment; filename=\"'.$zipname.'\"');\n\t\t\theader('Content-Length: ' . filesize($zipname));\n\t\t\treadfile($zipname);\n\t\t\tunlink($zipname);\n\t\t} else {\n\t\t\theader('Content-Disposition: attachment; filename=\"'.CHtml::decode($model->title).$ext[$format]);\n\t\t\treadfile(YII::app()->basePath.'/../upload/pdf/'.$id.$ext[$format]);\n\t\t}\n\t}", "public function download()\n {\n header('Content-Description: File Transfer');\n header('Content-Type: application/octet-stream');\n header('Content-Disposition: attachment; filename=' . $this->getFilename());\n header('Content-Transfer-Encoding: binary');\n header('Expires: 0');\n header('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n header('Pragma: public');\n header('Content-Length: ' . $this->getSize());\n \\Oka\\Web\\Buffer::Clean();\n\n $this->read();\n exit;\n }", "public function download( $args, $assoc_args ) {\n\t\tself::run( 'core download', $args, $assoc_args );\n\t}", "function ft_hook_download($dir, $file) {}", "function erp_import_export_download_sample_action() {\n\n $type = isset( $_POST['type'] ) ? sanitize_text_field( wp_unslash( $_POST['type'] ) ) : '';\n\n if ( ! isset( $_GET['action'] ) || $_GET['action'] != 'download_sample' ) {\n return;\n }\n\n if ( ! isset( $_GET['_wpnonce'] ) || ! wp_verify_nonce( sanitize_key( $_GET['_wpnonce'] ), 'erp-emport-export-sample-nonce' ) ) {\n return;\n }\n\n if ( ! isset( $type ) ) {\n return;\n }\n\n $type = strtolower( $type );\n $fields = erp_get_import_export_fields();\n\n if ( isset( $fields[ $type ] ) ) {\n $keys = $fields[ $type ]['fields'];\n $keys = array_flip( $keys );\n $file_name = \"sample_csv_{$type}.csv\";\n\n erp_make_csv_file( [ $keys ], $file_name, false );\n }\n\n return;\n}", "public function postProcessDownload()\n {\n }", "function download(){\n $file = $this->input->get('backup');\n $sql = file_get_contents('backups/'.$file);\n $this->load->helper('download');\n force_download($file, $sql);\n }", "function cbc_download() {\n\n $this->layout = NULL;\n\t\t\n $vc_cust_no = trim($this->Session->read('Auth.Customer.vc_cust_no'));\n\n $vc_comp_code = trim($this->Session->read('Auth.Customer.vc_comp_code'));\n\t\t\n $DownloadFile = $this->DocumentUploadCbc->find('first', array(\n\t\t 'fields'=>array('DocumentUploadCbc.vc_upload_doc_path',\n\t\t 'DocumentUploadCbc.vc_upload_doc_type',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'DocumentUploadCbc.vc_upload_doc_name'),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'DocumentUploadCbc.vc_comp_code' => $vc_comp_code,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'DocumentUploadCbc.vc_cust_no' => $vc_cust_no,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'DocumentUploadCbc.vc_upload_doc_for' => $this->globalParameterarray['DOCUPLOAD01']),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'order'=>array('DocumentUploadCbc.dt_date_uploaded'=>'desc')));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\n\t if ( isset($DownloadFile['DocumentUploadCbc']['vc_upload_doc_name']) && file_exists($DownloadFile['DocumentUploadCbc']['vc_upload_doc_path'] . DS . $DownloadFile['DocumentUploadCbc']['vc_upload_doc_name']) ) {\n\t\t\t \n\t\t\t$path = $DownloadFile['DocumentUploadCbc']['vc_upload_doc_path'] . DS . $DownloadFile['DocumentUploadCbc']['vc_upload_doc_name'];\n \n\t\t\theader('Expires: 0');\n \n\t\t\theader('Pragma: public');\n\t\t\t\n\t\t\theader('Content-type:'.$DownloadFile['DocumentUploadCbc']['vc_upload_doc_type']);\n\t\t\t\n\t\t\theader('Cache-Control: must-revalidate, post-check=0, pre-check=0');\n \n\t\t\theader('Content-Disposition: attachment; filename=\"' . basename($DownloadFile['DocumentUploadCbc']['vc_upload_doc_name']) . '\"');\n \n\t\t\theader('Content-Transfer-Encoding: binary');\n\t\t\t\n\t\t\t@readfile($path);\n\t\t\t\n\t\t\texit(0);\n \n\t\t} else {\n\n $this->Session->setFlash('Sorry No file', 'info');\n\n // $this->redirect($this->referer());\n\t\t $this->redirect('view');\n }\n }", "public function download($check = '') {\r\n\r\n\t\t// init vars\r\n\t\t$filepath = $this->app->path->path('root:'.$this->get('file'));\r\n\t\t$download_mode = $this->config->get('download_mode');\r\n\r\n\t\t// check access\r\n\t\tif (!$this->canAccess()) {\r\n\t\t\theader('Content-Type: text/html');\r\n\t\t\techo JText::_('Unable to access download').'!';\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// check limit\r\n\t\tif ($this->isDownloadLimitReached()) {\r\n\t\t\theader('Content-Type: text/html');\r\n\t\t\techo JText::_('Download limit reached').'!';\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// trigger on download event\r\n\t\t$canDownload = true;\r\n\t\t$this->app->event->dispatcher->notify($this->app->event->create($this, 'element:download', array('check' => $check, 'canDownload' => &$canDownload)));\r\n\r\n\t\tif ($canDownload) {\r\n\r\n\t\t\t// output file\r\n\t\t\tif ($download_mode == 1 && is_readable($filepath) && is_file($filepath)) {\r\n\t\t\t\t$this->set('hits', $this->get('hits', 0) + 1);\r\n\t\t\t\t$this->app->filesystem->output($filepath);\r\n\t\t\t} else if ($download_mode == 2 && $this->filecheck() == $check && is_readable($filepath) && is_file($filepath)) {\r\n\t\t\t\t$this->set('hits', $this->get('hits', 0) + 1);\r\n\t\t\t\t$this->app->filesystem->output($filepath);\r\n\t\t\t} else {\r\n\t\t\t\theader('Content-Type: text/html');\r\n\t\t\t\techo JText::_('Invalid file').'!';\r\n\t\t\t}\r\n\r\n\t\t\t// save item\r\n\t\t\t$this->app->table->item->save($this->getItem());\r\n\r\n\t\t}\r\n\r\n\t}", "public function download_backup(){\n\t\tif ($this->in->get('backups') != \"\"){\n\n\t\t\t$file_name = $this->pfh->FolderPath('backup', 'eqdkp').$this->in->get('backups');\n\n\t\t\tif (preg_match('#^eqdkp-backup_([0-9]{10})_([0-9]{1,10})\\.(sql|zip?)$#', $this->in->get('backups'), $matches) || preg_match('#^eqdkp-fbackup_([0-9]{10})_([0-9]{1,10})\\.(sql|zip?)$#', $this->in->get('backups'), $matches) ){\n\n\t\t\t\t$name = 'eqdkp-backup_' . $this->time->date('Y-m-d_Hi', $matches[1]).\".\".$matches[3];\n\n\t\t\t\tswitch ($matches[3]){\n\t\t\t\t\tcase 'sql':\n\t\t\t\t\t\t$mimetype = 'text/x-sql';\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'zip':\n\t\t\t\t\t\t$mimetype = 'application/zip';\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\theader('Pragma: no-cache');\n\t\t\t\theader(\"Content-Type: $mimetype; name=\\\"$name\\\"\");\n\t\t\t\theader(\"Content-disposition: attachment; filename=$name\");\n\n\t\t\t\t@set_time_limit(0);\n\n\t\t\t\t$fp = @fopen($file_name, 'rb');\n\n\t\t\t\tif ($fp !== false){\n\t\t\t\t\twhile (!feof($fp)){\n\t\t\t\t\t\techo fread($fp, 8192);\n\t\t\t\t\t}\n\t\t\t\t\tfclose($fp);\n\t\t\t\t}\n\t\t\t\tflush();\n\t\t\t}\n\t\t\texit();\n\t\t\t//$this->display('1');\n\t\t} else {\n\t\t}\n\t}", "function download_suket_020()\n\t{\n\t\tforce_download('assets/uploads/warga/suket_020/template_surat_rekomendasi_izin_mendirikan_bangunan.docx', NULL);\n\t}", "function download_site_file($file_id) {\n$this->session->keep_flashdata($this->back_url_key);\nif (strlen(trim($this->back_url)) <= 0 || $this->back_url == NULL) {\n$this->back_url = $this->home_url;\n}\n$file_data = $this->backup->check_site_file($file_id);\nif ($file_data !== NULL) {\n$this->load->helper('download');\n$file_path = $file_data->backup_location . $file_data->backup_name;\n$data = file_get_contents($file_path); // Read the file's contents\n$filename = basename($file_path);\n$ext = pathinfo($filename, PATHINFO_EXTENSION);\n$name = md5(date('d-m-Y H:i:s')) . date('_d-m-Y_H:i:s') . '.' . $ext;\nforce_download($name, $data);\n}\nredirect($this->back_url);\n}", "abstract function download($rempath, $locpath, $mode = 'auto');", "protected function actionDownloadTempfile($params){\t\t\n\t\t\n\t\t$inline = !isset($params['inline']) || !empty($params['inline']);\n\t\t\n\t\t$file = new \\GO\\Base\\Fs\\File(GO::config()->tmpdir.$params['path']);\n\t\tif($file->exists()){\n\t\t\t\\GO\\Base\\Util\\Http::outputDownloadHeaders($file, $inline, !empty($params['cache']));\n\t\t\t$file->output();\t\t\n\t\t}else\n\t\t{\n\t\t\techo \"File not found!\";\n\t\t}\n\t}", "public function download(): void\n\t{\n\t\t/** @var ExtensionModel $model */\n\t\t$model = $this->getModel();\n\t\t$id = $this->input->getInt('id');\n\t\t$fileDetails = $model->getFilename($id);\n\n\t\tif (!file_exists($fileDetails->file))\n\t\t{\n\t\t\tthrow new InvalidArgumentException(Text::sprintf('COM_JED_EXTENSIONS_DOWNLOAD_NOT_FOUND',\n\t\t\t\t$fileDetails->file));\n\t\t}\n\n\t\theader('Content-type: application/zip');\n\t\theader('Content-Disposition: attachment; filename=' . $fileDetails->originalFile);\n\t\theader('Content-length: ' . filesize($fileDetails->file));\n\t\theader('Pragma: no-cache');\n\t\theader('Expires: 0');\n\t\treadfile($fileDetails->file);\n\n\t\tFactory::getApplication()->close();\n\t}", "public function download($id = null)\n {\n if (preg_match('/^[0-9a-f]{8,8}-[0-9a-f]{4,4}-[0-9a-f]{4,4}-[0-9a-f]{4,4}-[0-9a-f]{12,12}$/', $id)) {\n $result = $this->Upload->find('first', array('conditions' => array('id' => $id)));\n\n if (!$result) {\n $this->Session->setFlash(__('Invalid Upload', true), 'alert');\n $this->redirect(array('action' => 'index'));\n }\n list($name, $extension) = explode('.', basename($result['Upload']['path']));\n $path = dirname($result['Upload']['fullpath']).DS;\n $file = basename($result['Upload']['fullpath']);\n $type = $result['Upload']['type'];\n } else {\n $file = $id;\n $path = Configure::read('Uploads.private');\n list($name, $extension) = explode('.', $id);\n $id3 = new FiId3($path);\n $info = $id3->info();\n unset($id3);\n $type = $info['type'];\n }\n\n $this->view = 'Media';\n\n $params = array(\n 'id' => $file,\n 'name' => $name,\n 'download' => true,\n 'extension' => strtolower($extension),\n 'mimeType' => array(strtolower($extension) => $type),\n 'path' => $path,\n );\n $this->set($params);\n }", "public function download() : bool {\t\n\t\t$req = self::init_req( ( (object) self::$URLS )->download );\n\t\tif( is_null( $req ) ){\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\tcurl_exec( $req );\n\t\t\tself::$httpCode = curl_getinfo( $req, CURLINFO_HTTP_CODE );\n\t\t\tcurl_close( $req );\n\t\t\treturn true;\n\t\t}\n\t}", "public function actionDownload() {\n if(isset($_GET['type']) && isset($_GET['id'])) {\n\n $model = Project::model()->findByPk($_GET['id']);\n\n // $dataProvider = new CActiveDataProvider('Project', array('id'=>$_GET['id']));\n /*\n $keys = array_keys($model->attributes);\n $colHeads = array();\n foreach($keys as $key) {\n $colHeads[] = $model->get\n }*/\n $data = array(\n 1 => array_values($model->attributeLabels()),\n array_values($model->attributes),\n );\n\n /*\n echo '<pre>';\n print_r($model->attributeLabels());\n echo '</pre>';\n */\n\n switch($_GET['type']) {\n\n case \"excel\":\n Yii::import('application.extensions.phpexcel.JPhpExcel');\n $xls = new JPhpExcel('UTF-8', false, $model->project_name);\n $xls->addArray($data);\n $xls->generateXML($model->project_name);\n break;\n }\n }\n }", "public function download($id){\n if(!empty($id)) {\n $selectedData = $this->_model->selectDataByID($id);\n if (isset($selectedData) && !empty($selectedData)) {\n header('Content-Description: File Transfer');\n header('Content-Disposition: attachment; filename=\"'.basename(ROOT.UPLOAD_DIR.$selectedData[0]['logo_image']).'\"');\n header('Expires: 0');\n header('Cache-Control: must-revalidate');\n header('Content-Transfer-Encoding: binary');\n header('Pragma: public');\n header('Content-Length: ' . filesize(ROOT.'assets/uploads/'.$selectedData[0]['logo_image']));\n readfile(ROOT.'assets/uploads/'.$selectedData[0]['logo_image']);\n exit;\n } else {\n $this->_view->flash[] = \"No data matches this ID\";\n Session::set('backofficeFlash', array($this->_view->flash, 'failure'));\n Url::redirect('backoffice/users/');\n }\n }else{\n $this->_view->flash[] = \"No ID was provided\";\n Session::set('backofficeFlash', array($this->_view->flash, 'failure'));\n Url::redirect('backoffice/users/');\n }\n }", "public function downloadtxtAction()\n {\n $googleCategoriesCount = Mage::getModel('googlemerchants/googlecategory')->getCollection()->count();\n if ($googleCategoriesCount != 0) {\n $this->_redirect('adminhtml/googlemerchants/index');\n }\n $this->_initAction();\n $this->renderLayout();\n }", "function downloadFile($folder,$fielname) {\n\t\t$this->autoLayout = false;\n\t\t$newFileName = $fielname;\n\t\t$folder = str_replace('-','/',$folder);\n\t\t//Replace - to / to view subfolder\n\t $path = WWW_ROOT.$folder.'/'.$fielname;\n\t\tif(file_exists($path) && is_file($path)) {\t\n\t\t\t$mimeContentType = 'application/octet-stream';\n\t\t\t$temMimeContentType = $this->_getMimeType($path); \n\t\t\tif(isset($temMimeContentType) && !empty($temMimeContentType))\t{ \n\t\t\t\t\t\t\t$mimeContentType = $temMimeContentType;\n\t\t\t}\n\t\n\t\t\t// START ANDR SILVA DOWNLOAD CODE\n\t\t\t// required for IE, otherwise Content-disposition is ignored\n\t\t\tif(ini_get('zlib.output_compression'))\n\t\t\t \tini_set('zlib.output_compression', 'Off');\n\t\t\theader(\"Pragma: public\"); // required\n\t\t\theader(\"Expires: 0\");\n\t\t\theader(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n\t\t\theader(\"Cache-Control: private\",false); // required for certain browsers\n\t\t\theader(\"Content-Type: \" . $mimeContentType );\n\t\t\t// change, added quotes to allow spaces in filenames, by Rajkumar Singh\n\t\t\theader(\"Content-Disposition: attachment; filename=\\\"\".(is_null($newFileName)?basename($path):$newFileName).\"\\\";\" );\n\t\t\theader(\"Content-Transfer-Encoding: binary\");\n\t\t\theader(\"Content-Length: \".filesize($path));\n\t\t\treadfile($path);\n\t\t\texit();\n\t\t\t// END ANDR SILVA DOWNLOAD CODE\n\t\t }\n\t\t if(isset($_SERVER['HTTP_REFERER'])) {\n\t\t \t $this->Session->setFlash('File not found.');\n\t\t\t $this->redirect($_SERVER['HTTP_REFERER']);\n\t\t }\n \t}", "function downloadFiles()\n\t{\n\t\t$appointment = $this->appointment;\n\n\t\t//calendar in the sidebar (marginal calendar)\n\t\tif(empty($appointment))\n\t\t{\n\t\t\t$entry_id = (int)$_GET['app_id'];\n\t\t\t$entry = new ilCalendarEntry($entry_id);\n\t\t\t//if the entry exists\n\t\t\tif($entry->getStart())\n\t\t\t{\n\t\t\t\t$appointment = array(\n\t\t\t\t\t\"event\" => $entry,\n\t\t\t\t\t\"dstart\" => $entry->getStart(),\n\t\t\t\t\t\"dend\"\t=> $entry->getEnd(),\n\t\t\t\t\t\"fullday\" => $entry->isFullday()\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tilUtil::sendFailure($this->lng->txt(\"obj_not_found\"), true);\n\t\t\t\t$this->ctrl->returnToParent($this);\n\t\t\t}\n\t\t}\n\n\t\tinclude_once './Services/Calendar/classes/BackgroundTasks/class.ilDownloadFilesBackgroundTask.php';\n\t\t$download_job = new ilDownloadFilesBackgroundTask($this->user->getId());\n\n\t\t$download_job->setBucketTitle($this->lng->txt(\"cal_calendar_download\").\" \".$appointment['event']->getTitle());\n\t\t$download_job->setEvents(array($appointment));\n\t\t$download_job->run();\n\n\t\t$this->ctrl->returnToParent($this);\n\t}", "public function download($mid)\n\t{\n\t\t// Clears file status cache\n\t\tclearstatcache();\n\n\t\t$this->hitDownloads((int) $mid);\n\t\t$input = new JInput;\n\t\t$template = $input->get('t', '1', 'int');\n\t\t$db = JFactory::getDBO();\n\n\t\t// Get the template so we can find a protocol\n\t\t$query = $db->getQuery(true);\n\t\t$query->select('id, params')->from('#__bsms_templates')->where('id = ' . $template);\n\t\t$db->setQuery($query);\n\t\t$template = $db->loadObject();\n\n\t\t// Convert parameter fields to objects.\n\t\t$registry = new JRegistry;\n\t\t$registry->loadString($template->params);\n\t\t$params = $registry;\n\n\t\t$protocol = $params->get('protocol', '//');\n\t\t$query = $db->getQuery(true);\n\t\t$query->select('#__bsms_mediafiles.*,'\n\t\t\t. ' #__bsms_servers.id AS ssid, #__bsms_servers.server_path AS spath,'\n\t\t\t. ' #__bsms_folders.id AS fid, #__bsms_folders.folderpath AS fpath,'\n\t\t\t. ' #__bsms_mimetype.id AS mtid, #__bsms_mimetype.mimetype')\n\t\t\t->from('#__bsms_mediafiles')\n\t\t\t->leftJoin('#__bsms_servers ON (#__bsms_servers.id = #__bsms_mediafiles.server)')\n\t\t\t->leftJoin('#__bsms_folders ON (#__bsms_folders.id = #__bsms_mediafiles.path)')\n\t\t\t->leftJoin('#__bsms_mimetype ON (#__bsms_mimetype.id = #__bsms_mediafiles.mime_type)')\n\t\t\t->where('#__bsms_mediafiles.id = ' . $mid);\n\t\t$db->setQuery($query, 0, 1);\n\n\t\t$media = $db->LoadObject();\n JResponse::clearHeaders();\n\t\t$server = $media->spath;\n\t\t$path = $media->fpath;\n\t\t$filename = $media->filename;\n\t\t$size = $media->size;\n\t\t$download_file = $protocol . $server . $path . $filename;\n\t\t$mimeType = $media->mimetype;\n\t\t/** @var $download_file object */\n\t\t$getsize = $this->getRemoteFileSize($download_file);\n\n\t\tif (!$size || ($size != $getsize && $getsize != false))\n\t\t{\n\t\t\t\t$size = $getsize;\n\t\t}\n\n\t\t// Clean the output buffer\n\t\t@ob_end_clean();\n\n\t\t// Test for protocol and set the appropriate headers\n\t\tjimport('joomla.environment.uri');\n\t\t$_tmp_uri = JURI::getInstance(JURI::current());\n\t\t$_tmp_protocol = $_tmp_uri->getScheme();\n\n\t\tif ($_tmp_protocol == \"https\")\n\t\t{\n\t\t\t// SSL Support\n\t\t\theader('Cache-Control: private, max-age=0, must-revalidate, no-store');\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader(\"Cache-Control: public, must-revalidate\");\n\t\t\theader('Cache-Control: pre-check=0, post-check=0, max-age=0');\n\t\t\theader('Pragma: no-cache');\n\t\t\theader(\"Expires: 0\");\n\t\t} /* end if protocol https */\n\t\theader('Content-Transfer-Encoding: none');\n\t\theader('Expires: Sat, 26 Jul 1997 05:00:00 GMT');\n\t\theader(\"Accept-Ranges: bytes\");\n\n\n\t\t// Modified by Rene\n\t\t// HTTP Range - see RFC2616 for more information's (http://www.ietf.org/rfc/rfc2616.txt)\n\t\t$newFileSize = $size - 1;\n\n\t\t// Default values! Will be overridden if a valid range header field was detected!\n\t\t$resultLenght = (string) $size;\n\t\t$resultRange = \"0-\" . $newFileSize;\n\n\t\t/* We support requests for a single range only.\n\t\t * So we check if we have a range field. If yes ensure that it is a valid one.\n\t\t * If it is not valid we ignore it and sending the whole file.\n\t\t * */\n\t\tif (isset($_SERVER['HTTP_RANGE']) && preg_match('%^bytes=\\d*\\-\\d*$%', $_SERVER['HTTP_RANGE']))\n\t\t{\n\t\t\t// Let's take the right side\n\t\t\tlist($a, $httpRange) = explode('=', $_SERVER['HTTP_RANGE']);\n\n\t\t\t// And get the two values (as strings!)\n\t\t\t$httpRange = explode('-', $httpRange);\n\n\t\t\t// Check if we have values! If not we have nothing to do!\n\t\t\tif (!empty($httpRange[0]) || !empty($httpRange[1]))\n\t\t\t{\n\t\t\t\t// We need the new content length ...\n\t\t\t\t$resultLenght = $size - $httpRange[0] - $httpRange[1];\n\n\t\t\t\t// ... and we can add the 206 Status.\n\t\t\t\theader(\"HTTP/1.1 206 Partial Content\");\n\n\t\t\t\t// Now we need the content-range, so we have to build it depending on the given range!\n\t\t\t\t// ex.: -500 -> the last 500 bytes\n\t\t\t\tif (empty($httpRange[0]))\n\t\t\t\t{\n\t\t\t\t\t$resultRange = $resultLenght . '-' . $newFileSize;\n\t\t\t\t}\n\n\t\t\t\t// Ex.: 500- -> from 500 bytes to file size\n\t\t\t\telseif (empty($httpRange[1]))\n\t\t\t\t{\n\t\t\t\t\t$resultRange = $httpRange[0] . '-' . $newFileSize;\n\t\t\t\t}\n\n\t\t\t\t// Ex.: 500-1000 -> from 500 to 1000 bytes\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$resultRange = $httpRange[0] . '-' . $httpRange[1];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\theader('Content-Length: ' . $resultLenght);\n\t\theader('Content-Range: bytes ' . $resultRange . '/' . $size);\n\n\t\theader('Content-Type: ' . $mimeType);\n\t\theader('Content-Disposition: attachment; filename=\"' . $filename . '\"');\n\t\theader('Content-Transfer-Encoding: binary\\n');\n\n\t\t// Try to deliver in chunks\n\t\t@set_time_limit(0);\n\t\t$fp = @fopen($download_file, 'rb');\n\n\t\tif ($fp !== false)\n\t\t{\n\t\t\twhile (!feof($fp))\n\t\t\t{\n\t\t\t\techo fread($fp, 8192);\n\t\t\t}\n\t\t\tfclose($fp);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t@readfile($download_file);\n\t\t}\n\t\tflush();\n\t\texit;\n\t}", "function download_db_file($file_id) {\n$this->session->keep_flashdata($this->back_url_key);\nif (strlen(trim($this->back_url)) <= 0 || $this->back_url == NULL) {\n$this->back_url = $this->home_url;\n}\n$file_data = $this->backup->check_db_file($file_id);\nif ($file_data !== NULL) {\n$this->load->helper('download');\n$file_path = $this->db_backup_path . $file_data->backup_name;\n$data = file_get_contents($file_path); // Read the file's contents\n$filename = basename($file_path);\n$ext = pathinfo($filename, PATHINFO_EXTENSION);\n$name = md5(date('d-m-Y H:i:s')) . date('_d-m-Y_H:i:s') . '.' . $ext;\nforce_download($name, $data);\n}\nredirect($this->back_url);\n}", "function downloadFile($option, $cid){\n global $jlistConfig;\n\n $app = &JFactory::getApplication(); \n $database = &JFactory::getDBO(); \n clearstatcache(); \n \n $view_types = array();\n $view_types = explode(',', $jlistConfig['file.types.view']);\n \n // get path\n $database->SetQuery(\"SELECT * FROM #__jdownloads_files WHERE file_id = $cid\");\n $file = $database->loadObject();\n\n if ($file->url_download){\n $database->SetQuery(\"SELECT cat_dir FROM #__jdownloads_cats WHERE cat_id = $file->cat_id\");\n $cat_dir = $database->loadResult();\n $filename_direct = JURI::root().$jlistConfig['files.uploaddir'].DS.$cat_dir.DS.$file->url_download;\n $file = JPATH_SITE.DS.$jlistConfig['files.uploaddir'].DS.$cat_dir.DS.$file->url_download; \n } else {\n exit;\n } \n\n $len = filesize($file);\n \n // if set the option for direct link to the file\n if (!$jlistConfig['use.php.script.for.download']){\n if (empty($filename_direct)) {\n $app->redirect($file);\n } else {\n $app->redirect($filename_direct);\n }\n } else { \n $filename = basename($file);\n $file_extension = strtolower(substr(strrchr($filename,\".\"),1));\n $ctype = datei_mime($file_extension);\n ob_end_clean();\n // needed for MS IE - otherwise content disposition is not used?\n if (ini_get('zlib.output_compression')){\n ini_set('zlib.output_compression', 'Off');\n }\n \n header(\"Cache-Control: public, must-revalidate\");\n header('Cache-Control: pre-check=0, post-check=0, max-age=0');\n // header(\"Pragma: no-cache\"); // Problems with MS IE\n header(\"Expires: 0\"); \n header(\"Content-Description: File Transfer\");\n header(\"Expires: Sat, 26 Jul 1997 05:00:00 GMT\");\n header(\"Content-Type: \" . $ctype);\n header(\"Content-Length: \".(string)$len);\n if (!in_array($file_extension, $view_types)){\n header('Content-Disposition: attachment; filename=\"'.$filename.'\"');\n } else {\n // view file in browser\n header('Content-Disposition: inline; filename=\"'.$filename.'\"');\n } \n header(\"Content-Transfer-Encoding: binary\\n\");\n \n // set_time_limit doesn't work in safe mode\n if (!ini_get('safe_mode')){ \n @set_time_limit(0);\n }\n @readfile($file);\n }\n exit;\n}", "function download() {\n $diffusion_id = JFactory::getApplication()->input->getInt('id', null, 'int');\n $order_id = JFactory::getApplication()->input->getInt('order', null, 'int');\n\n if (empty($diffusion_id)):\n $return['ERROR'] = JText::_('COM_EASYSDI_SHOP_ORDER_ERROR_EMPTY_ID');\n echo json_encode($return);\n die();\n endif;\n\n $order = JTable::getInstance('order', 'Easysdi_shopTable');\n $order->load($order_id);\n\n /////////// Check user right on this order\n $downloadAllowed = false;\n\n //the user is shop admin\n if (JFactory::getUser()->authorise('core.manage', 'com_easysdi_shop')):\n $downloadAllowed = true;\n endif;\n\n if (!$downloadAllowed) {\n $return['ERROR'] = JText::_('JERROR_ALERTNOAUTHOR');\n echo json_encode($return);\n die();\n }\n\n //Load order response\n $orderdiffusion = JTable::getInstance('orderdiffusion', 'Easysdi_shopTable');\n $keys = array();\n $keys['order_id'] = $order_id;\n $keys['diffusion_id'] = $diffusion_id;\n $orderdiffusion->load($keys);\n\n return Easysdi_shopHelper::downloadOrderFile($orderdiffusion);\n }", "public function download()\n {\n $this->pdf->Output(\n $this->fileName,\n self::EXPORT_TYPE_DOWNLOAD\n );\n }", "protected function generateDownloadLink()\n\t{\n\t\t$params = array(\n\t\t\t'PROCESS_TOKEN' => $this->processToken,\n\t\t\t'EXPORT_TYPE' => $this->exportType,\n\t\t\t'COMPONENT_NAME' => $this->componentName,\n\t\t);\n\n\t\treturn $this->getActionUri(self::ACTION_DOWNLOAD, $params);\n\t}", "public function downloadFiles()\r\n {\r\n // check permission\r\n $this->_check_group_permission();\r\n\r\n $access_full_path = $this->_get_access_full_path();\r\n $filenames = $this->input->get_post('filenames');\r\n $filenames_arr = json_decode($filenames);\r\n $targetname = $this->input->get_post('targetname');\r\n\r\n // insert userlog\r\n $gid = $this->input->get_post('gid');\r\n if (substr($gid, 0, 1) === 's')\r\n {\r\n $b36_sid = substr($gid, 1);\r\n $share = $this->login->get_share_access($b36_sid);\r\n $gid = $share['gid'];\r\n $folder_name = $share['name'];\r\n }\r\n else\r\n {\r\n $folder_name = $this->login->get_group_name($gid);\r\n }\r\n if (count($filenames_arr) == 1)\r\n {\r\n $fileinode = $this->files_model->fileinode($access_full_path .'/'. $filenames_arr[0]);\r\n $target = str_replace('/'. $folder_name, '', $access_full_path, $cnt = 1) .'/'. $filenames_arr[0];\r\n $details = '';\r\n }\r\n else\r\n {\r\n $fileinode = 0;\r\n $target = $this->files_model->get_utf8_basename($access_full_path) . '.zip';\r\n $details = $filenames;\r\n }\r\n $user = $this->login->get_user();\r\n $this->userlog_model->insert(\r\n $user['id'],\r\n $user['name'],\r\n Userlog_model::FILE_DOWNLOAD,\r\n $gid,\r\n $folder_name,\r\n $fileinode,\r\n $target,\r\n $details\r\n );\r\n\r\n $this->files_model->download_files($access_full_path, $filenames_arr, $targetname);\r\n }", "public function show(Download $download)\n {\n //\n }", "function download_suket_016()\n\t{\n\t\tforce_download('assets/uploads/warga/suket_016/template_surat_pernyataan_penyerahan_waris.docx', NULL);\n\t}", "function download_suket_019()\n\t{\n\t\tforce_download('assets/uploads/warga/suket_019/template_surat_pernyataan_penyerahan_tanah.docx', NULL);\n\t}", "public function download(){\n\t\treturn $this->fpdi->Output($this->fileName, 'D');\n\t}", "function download($file = \"\") {\n\t\t// Set maximum execution time in seconds (0 means no limit).\n\n\t\tset_time_limit(0);\n\t\t\n\t\t// Check downloader is admin or manager\n\t\tif(!empty($file)) {\n\t\t\t$file = SITE_DIR.\"public\".base64_decode($file);\n\n\t\t\t$this->output_file($file);\n\t\t} else\n\t\t\t$this->download_forbidden();\n\t\texit;\n\t}", "function cfc_edd_receipt_show_download_files() {\n\treturn false;\n}", "public function download_xml_file(){\r\n \r\n if (file_exists($this->attachfile)) {\r\n $attachfilename = 'export_xml_'.date(\"Y-m-d\").'.xml';\r\n \r\n header(\"Content-Description: File Transfer\");\r\n header(\"Content-type: text/xml\");\r\n header('Content-Disposition: attachment; filename=\"'.$attachfilename.'\"');\r\n \r\n readfile($this->attachfile);\r\n unlink($this->attachfile);\r\n return true;\r\n }\r\n return false;\r\n }", "public function DownoadFile()\r\n\t{\r\n\t\theader(\"download.php?key=\".$this->secretKey);\r\n\t}", "public static function view_Download () {\n header(\"Content-type: text/csv\");\n header('Content-disposition: attachment; filename=\"'.$_SESSION['CSV']['title'].'.csv\"');\n echo $_SESSION['CSV']['csv'];\n exit;\n }", "public function download_file($id_cc){\n $file = $this->Dao_control_cambios_model->getFileCC($id_cc);\n\n $archivo = $file['archivo'];\n $nombre = $file['nombre_archivo'];\n $tipo = $file['tipo_archivo'];\n $extension = $file['extension_archivo'];\n\n header(\"Content-type: $tipo\");\n header('Content-disposition: attachment; filename=\"'.$nombre.'.docx\"');\n header(\"Content-disposition: attachment; filename='$nombre.$extension'\");\n // header(\"Content-Disposition: inline; filename=$nombre.pdf\");\n print_r($archivo);\n }", "function download_suket_015()\n\t{\n\t\tforce_download('assets/uploads/warga/suket_015/template_surat_keterangan_kepemilikan_tanah.docx', NULL);\n\t}", "function download_lampiran_surat_masuk($id_sm)\n {\n $data = $this->db->get_where('surat_masuk', ['id_sm' => $id_sm])->row();\n force_download('../assets/uploads/admin/lampiran_sm/' . $data->lampiran, NULL);\n }", "protected function actionDownloadPublicFile($params){\n\t\t$file = new \\GO\\Base\\Fs\\File(GO::config()->file_storage_path.'public/'.$params['path']);\n\t\t\n\t\tif($file->exists()){\n\t\t\t\\GO\\Base\\Util\\Http::outputDownloadHeaders($file,false,!empty($params['cache']));\n\t\t\t$file->output();\t\t\n\t\t}else\n\t\t{\n\t\t\techo \"File not found!\";\n\t\t}\n\t}", "function download_url($url,$fichier_destination)\n{\n\tglobal $conf;\n\t\n//Pause\n\t$pause = 5;//En seconde\n\t\n//log file\n\t$fp_ok = fopen($conf['log_file_recuperation_ok'],\"a\");\n\t$fp_ko = fopen($conf['log_file_recuperation_ko'],\"a\");\n\t$fp_0_octet = fopen($conf['log_file_recuperation_0_octet'],\"a\");\t\t\t\t\t\n\t\n//Media Recovery\n\t$status = \"\";\n\tif(!copy($url,$fichier_destination))\n\t{\n\t\tfwrite($fp_ko,date(\"Ymd H:i:s\").\" ===> COPIE KO (tentative 1/3) ===> \".$url.\" ===> \".$fichier_destination.\"\\r\\n\");\n\t\tsleep($pause);\n\t\tif(!copy($url,$fichier_destination))\n\t\t{\n\t\t\tfwrite($fp_ko,date(\"Ymd H:i:s\").\" ===> COPIE KO (tentative 2/3) ===> \".$url.\" ===> \".$fichier_destination.\"\\r\\n\");\n\t\t\tsleep($pause);\n\t\t\tif(!copy($url,$fichier_destination))\n\t\t\t{\n\t\t\t\tfwrite($fp_ko,date(\"Ymd H:i:s\").\" ===> COPIE KO (tentative 3/3) ===> \".$url.\" ===> \".$fichier_destination.\"\\r\\n\");\n\t\t\t\tsleep($pause);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tfwrite($fp_ok,date(\"Ymd H:i:s\").\" ===> COPIE OK ===> \".$url.\" ===> \".$fichier_destination.\"\\r\\n\");\t\t\t\n\t\t\t\t$status = \"ok\";\t\t\n\t\t\t}\t\t\t\t\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfwrite($fp_ok,date(\"Ymd H:i:s\").\" ===> COPIE OK ===> \".$url.\" ===> \".$fichier_destination.\"\\r\\n\");\t\t\t\n\t\t\t$status = \"ok\";\t\t\n\t\t}\t\t\t\t\t\t\n\t}\n\telse\n\t{\n\t\tfwrite($fp_ok,date(\"Ymd H:i:s\").\" ===> COPIE OK ===> \".$url.\" ===> \".$fichier_destination.\"\\r\\n\");\t\t\t\n\t\t$status = \"ok\";\t\t\n\t}\t\n\n//Closing Log Files\n\tfclose($fp_ok);\n\tfclose($fp_ko);\n\tfclose($fp_0_octet);\n\t\n\tif($status==\"\")\n\t\t$status=\"ko\";\n\t\t\t\t\n\treturn $status;\t\t\t\t\n}", "public function actionDownloadTaskStatusChanged()\n {\n $taskId = Yii::app()->request->getQuery('task_id', 0);\n $status = Yii::app()->request->getQuery('task_status', '');\n if (empty($taskId) || !in_array($status, Task::$statuses))\n return;\n \n $task = Task::model()->findByPk($taskId);\n if ($task instanceof Task) {\n if ($task->isDownload())\n $this->logFileDownload($task->id, '', '', $status);\n }\n\n $file_name = Yii::app()->request->getPost('file_name');\n if ($file_name) {\n $project = NetflixBacklotProject::model()->findByAttributes(['download_task_id' => $taskId]);\n if ($project instanceof NetflixBacklotProject) {\n $project->video_file_name = $file_name;\n }\n }\n }", "function downloadFile($folder,$filename) {\n\t\t$this->autoLayout = false;\n\t\t$newFileName = $filename;\n\t\t$folder = str_replace('-','/',$folder);\n\t\t//Replace - to / to view subfolder\n\t $path = WWW_ROOT.$folder.'/'.$filename;\n\t\tif(file_exists($path) && is_file($path)) {\n\t\t\t$mimeContentType = 'application/octet-stream';\n\t\t\t$temMimeContentType = $this->_getMimeType($path);\n\t\t\tif(isset($temMimeContentType) && !empty($temMimeContentType))\t{\n\t\t\t\t\t\t\t$mimeContentType = $temMimeContentType;\n\t\t\t}\n\t\t //echo 'sssssssssss--->' . $mimeContentType;\t\t exit;\n\t\t\t// START ANDR SILVA DOWNLOAD CODE\n\t\t\t// required for IE, otherwise Content-disposition is ignored\n\t\t\tif(ini_get('zlib.output_compression'))\n\t\t\t \tini_set('zlib.output_compression', 'Off');\n\t\t\theader(\"Pragma: public\"); // required\n\t\t\theader(\"Expires: 0\");\n\t\t\theader(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n\t\t\theader(\"Cache-Control: private\",false); // required for certain browsers \n\t\t\theader(\"Content-Type: \" . $mimeContentType );\n\t\t\t// change, added quotes to allow spaces in filenames, by Rajkumar Singh\n\t\t\theader(\"Content-Disposition: attachment; filename=\\\"\".(is_null($newFileName)?basename($path):$newFileName).\"\\\";\" );\n\t\t\theader(\"Content-Transfer-Encoding: binary\");\n\t\t\theader(\"Content-Length: \".filesize($path));\n\t\t\treadfile($path);\n\t\t\texit();\n\t\t\t// END ANDR SILVA DOWNLOAD CODE\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t }\n\t\t if(isset($_SERVER['HTTP_REFERER'])) {\n\t\t \t $this->Session->setFlash('File not found.');\n\t\t\t $this->redirect($_SERVER['HTTP_REFERER']);\n\t\t }\t \n \t}", "private function fileDownload()\n {\n /**\n * Defined variables\n */\n $configHelper = $this->dataHelper;\n $request = $this->getRequest();\n $ds = DIRECTORY_SEPARATOR;\n $baseDir = DirectoryList::VAR_DIR;\n $fileFactory = $this->fileFactory;\n $contentType = 'application/octet-stream';\n $paramNameRequest = $request->getParam('m');\n $packagePathDir = $configHelper->getConfigAbsoluteDir();\n\n $lastItem = $this->packageFilter();\n $versionPackageData = $lastItem;\n $file = $versionPackageData->getData('file');\n\n $packageName = str_replace('_', '/', $paramNameRequest);\n $correctPathFile = $packagePathDir . $ds . $packageName . $ds . $file;\n\n $fileName = $file;\n $content = file_get_contents($correctPathFile, true);\n $fileDownload = $fileFactory->create($fileName, $content, $baseDir, $contentType);\n\n return $fileDownload;\n }", "public function action_download($file = NULL) {\n $path_file = DOCROOT.\"sites\" . DIRECTORY_SEPARATOR . \"$file.zip\";\n \n //Verifica se o arquivo existe\n if (\\File::exists($path_file)) {\n //Download do arquivo \n \\Sucker::Download($path_file, \"$file\");\n }else{\n //Redireciona caso o arquivo não exista\n \\Response::redirect('home');\n }\n \n }", "function download_suket_018_janda()\n\t{\n\t\tforce_download('assets/uploads/warga/suket_018/template_surat_pengantar_nikah_janda.docx', NULL);\n\t}", "public function download()\n\t{\n\t\t$get_header \t\t\t= $this->db->get_where('header', array('header_is_displayed' => 'Y'));\n\t\t$get_footer \t\t\t= $this->db->get_where('footer', array('footer_is_displayed' => 'Y'));\n\t\t\n\t\t$data['get_header']\t\t= $get_header;\n\t\t$data['get_footer']\t\t= $get_footer;\n\t\t$this->load->view('download', $data);\n\t}", "function sopac_bib_record_download($bnum = NULL) {\n $locum = sopac_get_locum();\n $actions = sopac_parse_uri();\n if(!$bnum){\n $actions = sopac_parse_uri();\n $bnum = $actions[1];\n }\n $bib = $locum->get_bib_item($bnum);\n $type = $_GET['type'];\n $license = isset($bib['licensed_from']) ? $bib['licensed_from'] : 'magnatune';\n global $user;\n if ($user->uid && $user->bcode_verified && $type && $bib['zipmd5']) {\n switch($type){\n case 'album':\n $locum->count_download($bnum,\"album\");\n $path = \"http://media.aadl.org/music/$license/$bnum/derivatives/\".$bib['zipmd5'].\".zip?name=$bnum.zip\";\n header(\"Location: $path\");\n break;\n case 'flac':\n $locum->count_download($bnum,\"flac\");\n $path = \"http://media.aadl.org/music/$license/$bnum/derivatives/\".$bib['zipmd5'].\"-flac.zip?name=$bnum-flac.zip\";\n header(\"Location: $path\");\n break;\n case 'track':\n $tracknum = $_GET['tracknum'];\n $locum->count_download($bnum,\"track\",$tracknum);\n if(!$tracknum) {\n $path = variable_get('sopac_url_prefix', 'cat/seek') . '/record/' . $bnum;\n drupal_set_message(t(\"There appears to be a problem downloading the file. Please make sure you have an active library card associated with this account\"),\"error\");\n drupal_goto($path);\n }\n $paddedtrack = str_pad($tracknum, 2, \"0\", STR_PAD_LEFT);\n $trackname = $bib['tracks'][$tracknum]['title'] . \"-\" . $bib['artist'];\n if($bib['tracks'][$tracknum]['filename']) {\n $filename = $bib['tracks'][$tracknum]['filename'];\n }\n else {\n $filename = $paddedtrack.\"-\".str_replace(array(' ','(',')'),'-', $trackname).\".mp3\";\n }\n $path = \"http://media.aadl.org/music/$license/$bnum/derivatives/\".str_replace(array(' ','(',')','/'),'-', $bib['title']).\"/\".urlencode($filename).\"?name=\".urlencode($filename);\n //header('Content-Disposition: attachment; filename=\"'.$path.'\"');\n //readfile($path);\n header(\"Location: $path\");\n break;\n case 'play':\n $tracknum = $_GET['tracknum'];\n $locum->count_download($bnum,\"play\",$tracknum);\n $paddedtrack = str_pad($tracknum, 2, \"0\", STR_PAD_LEFT);\n $trackname = $bib['tracks'][$tracknum]['title'] . \"-\" . $bib['artist'];\n if($bib['tracks'][$tracknum]['filename']) {\n $filename = $bib['tracks'][$tracknum]['filename'];\n }\n else {\n $filename = $paddedtrack.\"-\".str_replace(array(' ','(',')'),'-', $trackname).\".mp3\";\n }\n $path = \"http://media.aadl.org/music/$license/$bnum/derivatives/streaming/\".rawurlencode($filename);\n //header('Content-Disposition: attachment; filename=\"'.$path.'\"');\n header('Content-Type: audio/mpeg');\n readfile($path);\n //header(\"Location: $path\");\n break;\n }\n\n }\n else {\n $path = variable_get('sopac_url_prefix', 'cat/seek') . '/record/' . $bnum;\n drupal_set_message(t(\"There appears to be a problem downloading the file. Please make sure you have an active library card associated with this account\"),\"error\");\n drupal_goto($path);\n }\n}", "function ciniki_events_web_fileDownload($ciniki, $tnid, $event_permalink, $file_permalink) {\n\n //\n // Get the tenant storage directory\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'hooks', 'storageDir');\n $rc = ciniki_tenants_hooks_storageDir($ciniki, $tnid, array());\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $tenant_storage_dir = $rc['storage_dir'];\n\n //\n // Get the file details\n //\n $strsql = \"SELECT ciniki_event_files.id, \"\n . \"ciniki_event_files.uuid, \"\n . \"ciniki_event_files.name, \"\n . \"ciniki_event_files.permalink, \"\n . \"ciniki_event_files.extension, \"\n . \"ciniki_event_files.binary_content \"\n . \"FROM ciniki_events, ciniki_event_files \"\n . \"WHERE ciniki_events.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND ciniki_events.permalink = '\" . ciniki_core_dbQuote($ciniki, $event_permalink) . \"' \"\n . \"AND ciniki_events.id = ciniki_event_files.event_id \"\n . \"AND (ciniki_events.flags&0x01) = 0x01 \"\n . \"AND ciniki_event_files.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"AND CONCAT_WS('.', ciniki_event_files.permalink, ciniki_event_files.extension) = '\" . ciniki_core_dbQuote($ciniki, $file_permalink) . \"' \"\n . \"AND (ciniki_event_files.webflags&0x01) = 0 \" // Make sure file is to be visible\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.events', 'file');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['file']) ) {\n return array('stat'=>'noexist', 'err'=>array('code'=>'ciniki.events.62', 'msg'=>'Unable to find requested file'));\n }\n $rc['file']['filename'] = $rc['file']['name'] . '.' . $rc['file']['extension'];\n\n //\n // Get the storage filename\n //\n $storage_filename = $tenant_storage_dir . '/ciniki.events/files/' . $rc['file']['uuid'][0] . '/' . $rc['file']['uuid'];\n if( file_exists($storage_filename) ) {\n $rc['file']['binary_content'] = file_get_contents($storage_filename); \n }\n\n return array('stat'=>'ok', 'file'=>$rc['file']);\n}", "function download_suket_017()\n\t{\n\t\tforce_download('assets/uploads/warga/suket_017/template_surat_keterangan_ahli_waris.docx', NULL);\n\t}", "public function onJSpaceAssetDownload($asset)\n {\n $credentials = new Credentials(\n $this->params->get('access_key_id'), \n $this->params->get('secret_access_key')); \n\n $s3 = S3Client::factory(array('credentials'=>$credentials));\n\n $storage = JSpaceArchiveAssetHelper::buildStoragePath($asset->record_id);\n $path = $storage.$asset->hash;\n\n $options = array('ResponseContentDisposition'=>'attachment; filename=\"'.$asset->getMetadata()->get('fileName', $path).'\"');\n\n $url = $s3->getObjectUrl($this->params->get('bucket'), $path, \"+10minute\", $options);\n \n JFactory::getApplication()->redirect($url);\n }", "public function downloadBackup() {\n $nonce = $this->getNonce();\n\n if ($nonce && isset($_GET['download'])) {\n $zipfile = $this->tempPath() . self::ZIPCOMP_STUB;\n if (file_exists($zipfile)) {\n $this->loadManifest();\n\n $filename = array(\n __CLASS__,\n $nonce,\n preg_replace('/(?:https?)?[^a-z0-9]+/i', '-', $this->manifest['home_url']),\n );\n\n header('Content-Description: File Transfer');\n header('Content-Type: application/octet-stream');\n header('Content-Disposition: attachment; filename=' . implode('-', $filename) . '.zip');\n header('Expires: 0');\n header('Cache-Control: no-cache');\n header('Content-Length: ' . filesize($zipfile));\n readfile($zipfile);\n $this->doCleanup();\n exit();\n } else {\n wp_die('No matching cambrian archive found');\n }\n }\n }", "public function download($id_pelapor)\n {\n // $id = 0;\n // $noTiket = 0;\n // foreach ($query as $key) {\n // $id = $key['id_pelapor'];\n // $noTiket = $key['no_tiket'];\n // }\n\n // $query2 = $this->detailLaporanModel->where('report_id', $id)->findAll();\n\n\n // foreach ($query2 as $key) {\n // # code...\n // // $url = ROOTPATH . \"public/uploads/\" . $key['gambar'];\n // $url = ROOTPATH . \"public/uploads/\" . $key['gambar'];\n // // file_get_contents($url);\n // // print_r($url);\n // }\n // return $this->response->download($key['gambar'], $url);\n // session()->setFlashdata('pesan', 'Gambar berhasil diunduh.');\n // return redirect()->to(base_url('/admin/reportLaporan'));\n $query = $this->load->library('zip');\n }", "public function downloadTask()\n\t{\n\t\t$filters = array(\n\t\t\t'event_id' => Request::getState(\n\t\t\t\t$this->_option . '.' . $this->_controller . '.event_id',\n\t\t\t\t'id',\n\t\t\t\tarray()\n\t\t\t),\n\t\t\t'search' => urldecode(Request::getState(\n\t\t\t\t$this->_option . '.' . $this->_controller . '.search',\n\t\t\t\t'search',\n\t\t\t\t''\n\t\t\t)),\n\t\t\t// Get sorting variables\n\t\t\t'sort' => Request::getState(\n\t\t\t\t$this->_option . '.' . $this->_controller . '.sort',\n\t\t\t\t'filter_order',\n\t\t\t\t'registered'\n\t\t\t),\n\t\t\t'sort_Dir' => Request::getState(\n\t\t\t\t$this->_option . '.' . $this->_controller . '.sortdir',\n\t\t\t\t'filter_order_Dir',\n\t\t\t\t'DESC'\n\t\t\t)\n\t\t);\n\n\t\t$query = Respondent::all();\n\n\t\tif ($filters['search'])\n\t\t{\n\t\t\t$query->whereLike('first_name', strtolower((string)$filters['search']), 1)\n\t\t\t\t->orWhereLike('last_name', strtolower((string)$filters['search']), 1)\n\t\t\t\t->resetDepth();\n\t\t}\n\n\t\tif ($filters['event_id'])\n\t\t{\n\t\t\tif (!is_array($filters['event_id']))\n\t\t\t{\n\t\t\t\t$filters['event_id'] = array($filters['event_id']);\n\t\t\t}\n\t\t\tif (!empty($filters['event_id']))\n\t\t\t{\n\t\t\t\t$query->whereIn('event_id', $filters['event_id']);\n\t\t\t}\n\t\t}\n\n\t\t$rows = $query\n\t\t\t->order($filters['sort'], $filters['sort_Dir'])\n\t\t\t->paginated('limitstart', 'limit')\n\t\t\t->rows();\n\n\t\tCsv::downloadlist($rows, $this->_option);\n\t}", "function downloadUrl($url)\r\n{\r\n\r\n $ch = curl_init ($url);\r\n\tcurl_setopt($ch, CURLOPT_HEADER, 0);\r\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\n\tcurl_setopt($ch, CURLOPT_BINARYTRANSFER,0);\r\n\tcurl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 0);\r\n\r\n\t$rawdata=curl_exec($ch);\r\n\tcurl_close ($ch);\r\n /*$LogHandler->addRecord(\r\n Logger::NOTICE,\r\n \"Finished downloading \".$url,\r\n array('url' => $url)\r\n );\r\n*/\r\n\treturn $rawdata;\r\n}", "public function downloadReport($filename);", "function dl($f3,$args) {\r\n\r\n $file_obj = new File();\r\n $file_id = $file_obj->find($args['client'],$args['project'],$args['version'],$args['quality']);\r\n\r\n $file = $file_obj->get($file_id);\r\n\r\n $file_obj->download($file);\r\n\r\n\r\n }" ]
[ "0.8220704", "0.76008755", "0.74366516", "0.72721887", "0.72226197", "0.7214948", "0.7186463", "0.70845246", "0.6976117", "0.695915", "0.6901893", "0.68966025", "0.686082", "0.68560493", "0.6787797", "0.67801464", "0.6764954", "0.6748668", "0.66758376", "0.66487926", "0.66347635", "0.66188675", "0.6613277", "0.655157", "0.6542815", "0.65361553", "0.6486025", "0.6482993", "0.64709127", "0.6376324", "0.6342256", "0.6341798", "0.6338852", "0.63198096", "0.6293598", "0.62890035", "0.6277756", "0.6269346", "0.6238263", "0.6222276", "0.62112826", "0.619258", "0.6185034", "0.61828125", "0.61824507", "0.61813056", "0.61810416", "0.6172617", "0.61569566", "0.61548275", "0.61396927", "0.61288124", "0.6123764", "0.61087626", "0.61060935", "0.6104562", "0.6097906", "0.6086416", "0.60851955", "0.6079937", "0.6063461", "0.6050073", "0.6046048", "0.6039089", "0.6037846", "0.6028971", "0.6021817", "0.60179704", "0.6017277", "0.6006288", "0.59885186", "0.59857017", "0.5981986", "0.59587425", "0.59574234", "0.5955435", "0.5947272", "0.5942989", "0.5927252", "0.5927042", "0.59208447", "0.59108126", "0.5906149", "0.59022814", "0.58933324", "0.58863574", "0.5872654", "0.5871472", "0.58569384", "0.5849751", "0.58338183", "0.58301365", "0.5814089", "0.58078206", "0.58023286", "0.579908", "0.5796245", "0.57958394", "0.57890975", "0.5782054" ]
0.68514663
14
actionid: edit actiondesc: Edit izin
public function actionEdit($id) { $model = $this->findModel($id); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->permohonan_izin_id]); } else { return $this->render('edit', [ 'model' => $model, ]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function editAction() {}", "public function _editAction() {\n\t\t\n\t\t$args = $this->getAllArguments ();\n\t\t\n\t\tif (array_key_exists ( 'cid', $args )) {\n\t\t\t$action_id = $args ['cid'] [0];\n\t\t} else {\n\t\t\t$action_id = @$args [3] ? @$args [3] : $args [1];\n\t\t}\n\t\t\n\t\t$field = $this->getModel ( 'field' );\n\t\t$field->getAllWhere ( 'form_id = \"' . ( int ) $this->_getFormId () . '\"' );\n\t\t\n\t\t$action = $this->getModel ( 'action' );\n\t\t$action->get ( ( int ) $action_id );\n\t\t\n\t\t$this->loadPluginModel ( 'actions' );\n\t\t\n\t\t$this->setView ( 'edit_action' );\n\t\n\t}", "public function editAction()\r\n {\r\n }", "public function actionEdit($id) { }", "public function editAction($id)\n {\n }", "public function annimalEditAction()\n {\n }", "public function edit( )\r\n {\r\n //\r\n }", "public function isEditAction() {}", "public function edit() {\n\t\t\t\n\t\t}", "public function editAction()\n {\n $this->createEditParameters = $this->createEditParameters + $this->_editExtraParameters;\n\n parent::editAction();\n }", "public function edit($id) {\n\t\t\n\t}", "public function edit()\n\t{\n\t\t//\n\t}", "public function edit($id){\n\t\t//\n\t}", "public function edit($id){\n\t\t//\n\t}", "public function editAction() {\n# process the edit form.\n# check the post data and filter it.\n\t\tif(isset($_POST['cancel'])) {\n\t\t\tAPI::Redirect(API::printUrl($this->_redirect));\n\t\t}\n\t\t$input_check = $this->_model->check_input($_POST);\n\t\tif(is_array($input_check)) {\n\t\t\tAPI::Error($input_check);\n\t\t\tAPI::redirect(API::printUrl($this->_redirect));\n\t\t}\n\t\t// all hooks will stack their errors onto the API::Error stack\n\t\t// but WILL NOT redirect.\n\t\tAPI::callHooks(self::$module, 'validate', 'controller', $_POST);\n\t\tif(API::hasErrors()) {\n\t\t\tAPI::redirect(API::printUrl($this->_redirect));\n\t\t}\n\n\t\t$this->_model->set_data($_POST);\n\n\t\t// auto call the hooks for this module/action\n\t\tAPI::callHooks(self::$module, 'save', 'controller');\n\n\t\tAPI::redirect(API::printUrl($this->_redirect));\n\n\n\t}", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Browser_Service_Recsite::getRecsite(intval($id));\t\t\n\t\t$this->assign('info', $info);\n\t\t$this->assign('models', $this->models);\n\t\t$this->assign('types', $this->types);\n\t}", "public function edit($id)\t{\n\t\t//\n\t}", "public function edit($id)\n\t{\t\t\n\n\t}", "public function edit($id) {\r\n //\r\n }", "public function editAction()\n {\n \n $id = $this->_request->getParam(\"id\");\n \n // Get object from form Request\n $request_info=array();\n // Get value from Request POST\n $body = $this->_request->getParam(\"desc\");\n // to send Id to database\n $request_info['id']=$id;\n $request_info['desc']=$body;\n // Get object from model Requests\n $request_model=new Application_Model_Requests();\n // Calling edit request function to edit data\n $request_model->editRequest($request_info);\n // redirect to list Request\n // $this->redirect(\"Requests/list\");\n\n\t \n \n \n \n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit()\r\n {\r\n //\r\n }", "public function edit()\n\t{\n\t\t\n\t}", "public function edit($id)\n\t{\n\t\t\n\t}", "public function edit($id)\n\t{\n\t\t\n\t}", "public function edit($id)\n\t {\n\t //\n\t }", "public function edit( $id ) {\n\n\t}", "public function edit($id) {\n\t\t//\n\t}", "public function edit($id) {\n\t\t//\n\t}", "public function edit($id) {\n\t\t//\n\t}", "public function edit($id) {\n\t\t//\n\t}", "public function edit($id) {\n\t\t//\n\t}", "public function edit($id) {\n\t\t//\n\t}", "public function edit($id) {\n\t\t//\n\t}", "public function edit($id) {\n\t\t//\n\t}", "public function edit($id) {\n\t\t//\n\t}", "public function edit($id) {\n\t\t//\n\t}", "public function edit($id)\r\n {\r\n \r\n \r\n\r\n }", "public function edit($id)\n { \n //\n }", "public function edit($id){\n }", "public function editAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Fj_Service_Goods::getGoods(intval($id));\n $this->assign('dir', \"goods\");\n $this->assign('ueditor', true);\n\t\t$this->assign('info', $info);\n\t}", "public function edit($id)\n\t{\n\t //\n\t}", "public function edit($id) {\n//\n }", "public function edit($id) {\n//\n }", "public function edit($id){\n //\n }", "public function edit($id){\n //\n }", "public function edit($id){\n //\n }", "public function edit($id){\n //\n }", "public function edit($id)\n {\n\n\n\n }", "public function edit($id)\n {\n // \n }", "public function edit($id) //Hämta redan bokad boking\n\t{\n\t\t//\n\t}", "public function edit($id)\n {\n\t\t\n \n }", "public\n function edit($id)\n {\n //\n }", "public\n function edit($id)\n {\n //\n }", "public\n function edit($id)\n {\n //\n }", "public\n function edit($id)\n {\n //\n }", "public function edit($id)\n {\n \n\n\n }", "public function edit( $id ) {\n\t\t//\n\t}", "public function edit( $id ) {\n\t\t//\n\t}", "public function edit($id)\r\n {\r\n }", "public function edit($id)\r\n {\r\n }", "public function edit($id)\n\t{\n\n\t}", "public function edit($id)\n\t{\n\n\t}", "public function edit($id)\n\t{\n\n\t}", "public function edit($id)\n\t{\n\n\t}", "public function edit($id)\n\t{\n\n\t}", "public function editAction()\n {\n parent::editAction();\n $this->_fillMappingsArray();\n $this->_fillAvailableProperties();\n }", "public function edit($id)\n\t{\n\t}", "public function edit($id)\n {\n //\n }", "public function edit($id)\n {\n//\n }", "public function edit($id)\r\n\t{\r\n\t\t//\r\n\t}", "public function edit($id)\r\n\t{\r\n\t\t//\r\n\t}", "public function edit($id) {\n //\n }", "public function edit($id)\n {\n //\n }", "public function edit($id)\n {\n // \n }", "public function edit( $id ) {\n //\n }", "public function edit($id) {\n //\n }", "public function edit($id)\n {\n }", "public function edit($id) {\n //\n }", "public function edit($id) {\n //\n }", "public function edit($id) {\n //\n }", "public function edit($id) {\n //\n }", "public function edit($id) {\n //\n }", "public function edit($id) {\n //\n }", "public function edit($id) {\n //\n }", "public function edit($id) {\n //\n }", "public function edit($id) {\n //\n }", "public function edit($id) {\n //\n }", "public function edit($id) {\n //\n }", "public function edit($id) {\n //\n }", "public function edit($id) {\n //\n }", "public function edit($id) {\n //\n }", "public function edit($id) {\n //\n }", "public function edit($id) {\n //\n }", "public function edit($id) {\n //\n }", "public function edit($id) {\n //\n }", "public function edit($id) {\n //\n }", "public function edit($id) {\n //\n }", "public function edit($id) {\n //\n }", "public function edit($id) {\n //\n }", "public function edit($id) {\n //\n }" ]
[ "0.8456243", "0.82970595", "0.818856", "0.806185", "0.7854688", "0.78171337", "0.7763189", "0.7675151", "0.76412493", "0.762144", "0.7598418", "0.7586079", "0.75772464", "0.75772464", "0.75530565", "0.75425965", "0.75419194", "0.75359976", "0.7533302", "0.7526414", "0.75207794", "0.75207794", "0.75202435", "0.7508998", "0.7508998", "0.7507908", "0.7507504", "0.7506474", "0.7506474", "0.7506474", "0.7506474", "0.7506474", "0.7506474", "0.7506474", "0.7506474", "0.7506474", "0.7506474", "0.75055534", "0.749236", "0.74865425", "0.7485668", "0.7475779", "0.7474185", "0.7474185", "0.747086", "0.747086", "0.747086", "0.747086", "0.7470289", "0.746993", "0.74696314", "0.74616057", "0.7460265", "0.7460265", "0.7460265", "0.7460265", "0.74578196", "0.74526423", "0.74526423", "0.7452222", "0.7452222", "0.7451663", "0.7451663", "0.7451663", "0.7451663", "0.7451663", "0.7451332", "0.7448944", "0.7445915", "0.7438651", "0.74369717", "0.74369717", "0.74368817", "0.74367964", "0.74359965", "0.74359417", "0.74343586", "0.7432817", "0.74315584", "0.74315584", "0.74315584", "0.74315584", "0.74315584", "0.74315584", "0.74315584", "0.74315584", "0.74315584", "0.74315584", "0.74315584", "0.74315584", "0.74315584", "0.74315584", "0.74315584", "0.74315584", "0.74315584", "0.74315584", "0.74315584", "0.74315584", "0.74315584", "0.74315584", "0.74315584" ]
0.0
-1
actionid: del actiondesc: Deleting izin
public function actionDel($id) { $this->findModel($id)->delete(); return $this->redirect(['index']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function undeleteAction(){\n\t}", "static function delete($action_id) {\n\t\t$mAction=new Maerdo_Model_Action();\n\t\treturn($mAction->deleteByPrimarykey($action_id));\n\t}", "public function actionDelete() {}", "public function actionDelete() {}", "public function deleteAction() {\n \n }", "protected function deleteAction()\n {\n }", "public function deleteAction()\n {\n }", "function deleteAction($action)\r\n {\r\n if (in_array($action, $this->_actions))\r\n {\r\n $key = array_search($action, $this->_actions);\r\n array_splice($this->_actions, $key, 1);\r\n }\r\n }", "public function deleteAction()\n {\n \n }", "public function annimalDelAction()\n {\n }", "public function deleteAction() {\n\t\t$this->_notImplemented();\n\t}", "public function deleteAction()\n {\n $this->deleteParameters = $this->deleteParameters + $this->_deleteExtraParameters;\n\n parent::deleteAction();\n }", "public function deleteAction() {\n parent::deleteAction();\n }", "public function delete(Action $action) {\r\n\t\t$stmt = $this->db->prepare(\"DELETE from accion WHERE id_accion=?\");\r\n\t\t$stmt->execute(array($action->getCodaction()));\r\n\t}", "public function deleteAction(){\n\n\t\t$auth = Zend_Auth::getInstance();\n\t\tif($auth->hasIdentity())\n\t\t{\n\t\t\t\n\t\t\t$loginUserId = $auth->getStorage()->read()->id;\n\t\t}\n\t\t$id = $this->_request->getParam('id');\n\t\t$emp_id = $this->_request->getParam('emp_id');\n\t\t$messages['message'] = ''; $messages['msgtype'] = '';\n\t\t$messages['flagtype'] = '';\n\t\t$actionflag = 3;\n\t\tif($id)\n\t\t{\n\t\t\t\n\t\t\t$employeeadvancesModel = new Expenses_Model_Employeeadvances();\n\n\t\t\t//check employee has amount of select amount\n\t\t\t$getEmployeeBalance = $employeeadvancesModel->getEmpAdvanceSummary($emp_id);\n\t\t\t$total = !empty($getEmployeeBalance[0]['balance'])?$getEmployeeBalance[0]['balance']:0;\n\t\t\t\n\t\t\t$employeeAdvanceData = $employeeadvancesModel->getsingleEmployeeadvancesData($id,$type='advance');\n\t\t\t\n\t\t\t$employeebalance = !empty($employeeAdvanceData[0]['application_amount'])?$employeeAdvanceData[0]['application_amount']:0;\n\t\t\t\n\t\t\tif($total >= $employeebalance) //if employee has suffiecient amount to delete advance\n\t\t\t{\n\t\t\t\t$data = array('isactive'=>0,'modifieddate'=>gmdate(\"Y-m-d H:i:s\"));\n\t\t\t\t$data['modifiedby'] = $loginUserId;\n\t\t\t\t$where = array('id=?'=>$id);\n\t\t\t\t$id = $employeeadvancesModel->saveOrUpdateAdvanceData($data, $where);\n\t\t\t\tif($id == 'update')\n\t\t\t\t{\n\t\t\t\t\t//remove deleted advance amount from employee total advance amount\n\t\t\t\t\t$advancesummary = new Expenses_Model_Advancesummary();\n\t\t\t\t\t$emp_advance_summery = $advancesummary->getAdvanceDetailsById($emp_id);\n\t\t\t\t\t$totalsum = $emp_advance_summery[0]['total']-$employeebalance;\n\t\t\t\t\t$balence = $emp_advance_summery[0]['balance']-$employeebalance;\n\t\t\t\t\t$summerydata = array('total'=>$totalsum,\n\t\t\t\t\t\t\t\t\t'balance'=>$balence,\n\t\t\t\t\t\t\t\t\t 'modifiedby'=> $loginUserId,\n\t\t\t\t\t\t\t\t\t 'modifieddate' =>gmdate(\"Y-m-d H:i:s\")\n\t\t\t\t\t\t\t\t );\n\t\t\t\t\t$summeryWhere = array('employee_id=?'=>$emp_id); \n\t\t\t\t\t$insertSummey = $advancesummary->SaveAdvanceData($summerydata, $summeryWhere);\n\t\t\t\t\t\n\t\t\t\t\t$messages['message'] = 'advance deleted successfully.';\n\t\t\t\t\t$messages['msgtype'] = 'success';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$messages['message'] = 'advance cannot be deleted.';\n\t\t\t\t\t$messages['msgtype'] = 'error';\n\t\t\t\t}\n\t\t\t}else\n\t\t\t{\n\t\t\t\t$messages['message'] = 'advance cannot be deleted already used.';\n\t\t\t\t$messages['msgtype'] = 'error';\n\t\t\t}\n\t\t\t\t\n\t\t\t\n\t\t\t \n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$messages['message'] = 'advance cannot be deleted.';\n\t\t\t$messages['msgtype'] = 'error';\n\t\t}\n\t\t$this->_helper->json($messages);\n\n\t}", "public function delete($id)\n { \n $this->action('delete', array('id' => $id));\n }", "private function actionListDelete() {\n $put_vars = $this->actionListPutConvert();\n $this->loadModel($put_vars['id'])->delete();\n }", "public function deleteAction()\n {\n $actionRow = new Admin_Model_DbRow_Action();\n $ctrlRow = new Admin_Model_DbRow_Controller();\n $action = $this->dbAction->find($this->checkActionIdParam());\n\n IF($action->count() !== 1) {\n $form = new Admin_Form_Action_Delete($ctrlRow, $actionRow);\n $form->setAction('/noc/admin/action/delete');\n $form->setErrors(array('Invalid ActionId, cannot proceed!'));\n } ELSE {\n $actionRow->fromArray($action);\n $ctrlRow->fromArray($this->dbController->find($actionRow->get('mcId')));\n $form = new Admin_Form_Action_Delete($ctrlRow, $actionRow);\n $form->setAction('/noc/admin/action/delete');\n\n IF($this->getRequest()->isPost()) {\n IF($form->isValid($this->getRequest()->getParams()) === TRUE\n && $form->getElement('chkdelete')->isChecked() === TRUE) {\n $this->dbAction->deleteById($actionRow->get('id'));\n // delete all rules which are bound to this module / controller\n $dbRules = new Admin_Model_DbTable_Acl_Rule();\n $dbRules->deleteByActionId($actionRow->get('id'));\n\n $this->_redirect('admin/action/scan');\n } ELSE {\n $form->setErrors(array(\n 'Delete not successfull. Did you checked the checkbox?'\n ));\n }\n }\n }\n\n $this->view->form = $form;\n $this->view->controller = $ctrlRow;\n }", "public function deleteAction() {\n\t\t\t$this->_forward('index');\n\t\t}", "public function deleteAction() {\n\t\t$id = intval($this->getInput('id'));\n\t\t$info = Client_Service_Besttj::getBesttj($id);\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\n\t\t$result = Client_Service_Besttj::deleteBesttj($id);\n\t\tif (!$result) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功');\n\t}", "public function index_delete($id)\n {\n $this->write_db->delete($_table, array($_id=>$id));\n \n $this->response(['Item deleted successfully.'], REST_Controller::HTTP_OK);\n }", "public function delete($id = 0)\n {\n\t if (isset($_POST['btnAction']) AND is_array($_POST['action_to'])) \n\t\t {\n\t\t\t// pass the ids and let MY_Model delete the items\n\t\t\t$this->ramstrg_sites_m->delete_many($this->input->post('action_to'));\n\t\t\t$this->ramstrg_sites_business_hours_m->del_by_col($this->input->post('action_to'));\n\t\t\t$this->ramstrg_sites_holidays_m->del_by_col($this->input->post('action_to'));\n\n\t\t } \n\t elseif (is_numeric($id)) \n\t\t {\n\t\t\t// they just clicked the link so we'll delete that one\n\t\t\t$this->ramstrg_sites_m->delete($id);\n\t\t\t$this->ramstrg_sites_business_hours_m->del_by_col($id);\n\t\t\t$this->ramstrg_sites_holidays_m->del_by_col($id);\n\t\t }\n\t redirect('admin/ramstrg');\n }", "public function index_delete(){\n\t\t\n\t\t}", "public function actionDelete()\n {\n if(isset($_POST['id'])){\n $id = $_POST['id'];\n $this->findModel($id)->delete();\n echo \"success\";\n }\n }", "public function deleteAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif ($item) {\n\t\t\t$item->delete();\n\t\t}\n\t\t$this->_helper->redirector('list', null, null, array('model' => $modelName));\n\t}", "public function deleteAction()\n {\n $id=$this->_request->getParam(\"id\");\n if(!empty($id)){\n // Get object from Requests model\n $request_model=new Application_Model_Requests();\n // Calling delete function to delete request by id\n $request_model->deleteRequest($id);\n }\n // Redirct to list Request\n $this->redirect(\"Requests/list\");\n }", "public function deleteAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (true === $this->employee->setAction('delete'))\n\t\t{\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t}", "public function deleteAction() {\n\t\t\t\t\t\tif (! $this->CheckTransactionUser ()) {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tZend_Session::start ();\n\t\t\t\t\t\t\t\t$this->redirectToIndex();\n\t\t\t\t\t\t\t} catch ( Zend_Session_Exception $e ) {\n\t\t\t\t\t\t\t\techo \"Message:\" . $e->getMessage ();\n\t\t\t\t\t\t\t\tsession_start ();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t$lan = $this->_getParam ( 'lang' );\n\t\t\t\t\t\t\t\t$id = $this->_getParam ( 'id' );\n $actions= $this->_getParam ( 'actions' );\n //$this->getRequest ()->getPost ( 'process' )==1\n \n\t\t\t\t\t\t\t\tif ( $actions=='delete') {\n\t\t\t\t\t\t\t\t\t$this->unlinkImageFolder ( $id );\n\t\t\t\t\t\t\t\t\t$id = $this->_getParam ( 'id' );\n\t\t\t\t\t\t\t\t\t$deleteOrganizms = $this->GetModelOrganize->deleteAllDataFromOrganismeMenu($id);\n\t\t\t\t\t\t\t\t\t\t\tif ($deleteOrganizms) {\n\t\t\t\t\t\t\t\t\t\t\t\t$lan = $this->_getParam ( 'lang' );\n\t\t\t\t\t\t\t\t\t\t\t\t$this->_redirect ( $lan . '/organisme/index?success=delete' );\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/* In cases of multiple delete */\n\t\t\t\t\t\t\t\tif ($this->getRequest ()->getPost ( \"BtnDelOrg\" )) {\n\t\t\t\t\t\t\t\t\tif ($this->getRequest ()->getPost ( \"multiAction\" ) == \"Delete\") {\n\t\t\t\t\t\t\t\t\t\t$idOrganisme = $this->getRequest ()->getPost ( \"checkRow\" );\n\t\t\t\t\t\t\t\t\t\t$lan = $this->_getParam ( 'lang' );\n\t\t\t\t\t\t\t\t\t\tfor($i = 0; $i < count ( $idOrganisme ); $i ++) {\n\t\t\t\t\t\t\t\t\t\t\t$id = $idOrganisme [$i];\n\t\t\t\t\t\t\t\t\t\t\t$this->unlinkImageFolder ( $id );\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$this->deletemulti ();\n\t\t\t\t\t\t\t\t\t\t$this->_redirect ( $lan . '/Organisme/index?success=delete' );\n\t\t\t\t\t\t\t\t\t\texit ();\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$lan = $this->_getParam ( 'lang' );\n\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t function seleteDel(){\n\t\t\t\t alert(\"Please select on item to delete!\");\n\t\t\t\t return false;\n\t\t\t\t }\n\t\t\t\t seleteDel();\n </script>\n\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t// $this->_redirect ( $lan\n\t\t\t\t\t\t\t\t\t// .'/Organisme/index/' );\n\t\t\t\t\t\t\t\t\t\t// exit();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch ( ErrorException $exerr ) {\n\t\t\t\t\t\t\t\techo \"Messsage\" . $exerr->getMessage ();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "function delete($id);", "function delete()\n\t{\n\t\tSQL::query(\"delete from {$this->_table} where id = {$this->_data['id']}\");\n\t}", "protected function getAction() {\n return Wsu_Auditing_Helper_Data::ACTION_DELETE;\n }", "function deleteCorrectiveAction($id,$all=false){\n\t\t\n\t\tif($all){\n\t\t\t$query=\"DELETE from corrective_action where id in (\".$id.\")\";\n\t\t}else{\n\t\t\t$query=\"DELETE from corrective_action where id=\".\"'$id'\";\t\n\t\t}\n\t\t\n\t\tmysqli_query($this->plink,$query);\n\t\t// close connection\n\t\t//mysqli_close($this->plink);\n \n\t}", "public function actionDelete($id) {\n $this->loadModel($id)->delete();\n\n// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n if (!isset($_GET['ajax']))\n $this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n }", "public function actionDelete()\n {\n $id = Yii::$app->request->post('id');\n $this->findModel($id)->delete();\n }", "public function process_bulk_action() {\n\n\t\t\tswitch ( $this->current_action() ) {\n\t\t\t\tcase 'delete':\n\t\t\t\t\t// Check access rights.\n\t\t\t\t\tif ( 'on' !== $this->allow_delete ) {\n\t\t\t\t\t\t// Deleting records from list table is not allowed.\n\t\t\t\t\t\twp_die( __( 'ERROR: Not authorized [delete not allowed]', 'wp-data-access' ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t// Prepare wp_nonce action security check.\n\t\t\t\t\t$wp_nonce_action = \"wpda-delete-{$this->table_name}\";\n\n\t\t\t\t\t$row_to_be_deleted = []; // Gonna hold the row to be deleted.\n\t\t\t\t\t$i = 0; // Index, necessary for multi column keys.\n\n\t\t\t\t\t// Check all key columns.\n\t\t\t\t\tforeach ( $this->wpda_list_columns->get_table_primary_key() as $key ) {\n\t\t\t\t\t\t// Check if key is available.\n\t\t\t\t\t\tif ( ! isset( $_REQUEST[ $key ] ) ) { // input var okay.\n\t\t\t\t\t\t\twp_die( __( 'ERROR: Invalid URL [missing primary key values]', 'wp-data-access' ) );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Write key value pair to array.\n\t\t\t\t\t\t$row_to_be_deleted[ $i ]['key'] = $key;\n\t\t\t\t\t\t$row_to_be_deleted[ $i ]['value'] = sanitize_text_field( wp_unslash( $_REQUEST[ $key ] ) ); // input var okay.\n\t\t\t\t\t\t$i ++;\n\n\t\t\t\t\t\t// Add key values to wp_nonce action.\n\t\t\t\t\t\t$wp_nonce_action .= '-' . sanitize_text_field( wp_unslash( $_REQUEST[ $key ] ) ); // input var okay.\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check if delete is allowed.\n\t\t\t\t\t$wp_nonce = isset( $_REQUEST['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) : ''; // input var okay.\n\t\t\t\t\tif ( ! wp_verify_nonce( $wp_nonce, $wp_nonce_action ) ) {\n\t\t\t\t\t\twp_die( __( 'ERROR: Not authorized', 'wp-data-access' ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t// All key column values available: delete record.\n\t\t\t\t\t// Prepare named array for delete operation.\n\t\t\t\t\t$next_row_to_be_deleted = [];\n\t\t\t\t\t$count_rows = count( $row_to_be_deleted );\n\t\t\t\t\tfor ( $i = 0; $i < $count_rows; $i ++ ) {\n\t\t\t\t\t\t$next_row_to_be_deleted[ $row_to_be_deleted[ $i ]['key'] ] = $row_to_be_deleted[ $i ]['value'];\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( $this->delete_row( $next_row_to_be_deleted ) ) {\n\t\t\t\t\t\t$msg = new WPDA_Message_Box(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'message_text' => __( 'Row deleted', 'wp-data-access' ),\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$msg->box();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$msg = new WPDA_Message_Box(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'message_text' => __( 'Could not delete row', 'wp-data-access' ),\n\t\t\t\t\t\t\t\t'message_type' => 'error',\n\t\t\t\t\t\t\t\t'message_is_dismissible' => false,\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$msg->box();\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'bulk-delete':\n\t\t\t\t\t// Check access rights.\n\t\t\t\t\tif ( $this->allow_delete !== 'on' ) {\n\t\t\t\t\t\t// Deleting records from list table is not allowed.\n\t\t\t\t\t\tdie( __( 'ERROR: Not authorized [delete not allowed]', 'wp-data-access' ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t// We first need to check if all the necessary information is available.\n\t\t\t\t\tif ( ! isset( $_REQUEST['bulk-selected'] ) ) { // input var okay.\n\t\t\t\t\t\t// Nothing to delete.\n\t\t\t\t\t\t$msg = new WPDA_Message_Box(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'message_text' => __( 'Nothing to delete', 'wp-data-access' ),\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$msg->box();\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check if delete is allowed.\n\t\t\t\t\t$wp_nonce_action = 'wpda-delete-*';\n\t\t\t\t\t$wp_nonce = isset( $_REQUEST['_wpnonce2'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce2'] ) ) : ''; // input var okay.\n\t\t\t\t\tif ( ! wp_verify_nonce( $wp_nonce, $wp_nonce_action ) ) {\n\t\t\t\t\t\tdie( __( 'ERROR: Not authorized', 'wp-data-access' ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t$bulk_rows = $_REQUEST['bulk-selected'];\n\t\t\t\t\t$no_rows = count( $bulk_rows ); // # rows to be deleted.\n\n\t\t\t\t\t$rows_to_be_deleted = []; // Gonna hold rows to be deleted.\n\n\t\t\t\t\tfor ( $i = 0; $i < $no_rows; $i ++ ) {\n\t\t\t\t\t\t// Write \"json\" to named array. Need to strip slashes twice. Once for the normal conversion\n\t\t\t\t\t\t// and once extra for the pre-conversion of double quotes in method column_cb().\n\t\t\t\t\t\t$row_object = json_decode( stripslashes( stripslashes( $bulk_rows[ $i ] ) ), true );\n\t\t\t\t\t\tif ( $row_object ) {\n\t\t\t\t\t\t\t$j = 0; // Index used to build array.\n\n\t\t\t\t\t\t\t// Check all key columns.\n\t\t\t\t\t\t\tforeach ( $this->wpda_list_columns->get_table_primary_key() as $key ) {\n\t\t\t\t\t\t\t\t// Check if key is available.\n\t\t\t\t\t\t\t\tif ( ! isset( $row_object[ $key ] ) ) {\n\t\t\t\t\t\t\t\t\twp_die( __( 'ERROR: Invalid URL [missing primary key values]', 'wp-data-access' ) );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Write key value pair to array.\n\t\t\t\t\t\t\t\t$rows_to_be_deleted[ $i ][ $j ]['key'] = $key;\n\t\t\t\t\t\t\t\t$rows_to_be_deleted[ $i ][ $j ]['value'] = $row_object[ $key ];\n\t\t\t\t\t\t\t\t$j ++;\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Looks like eveything is there. Delete records from table...\n\t\t\t\t\t$no_key_cols = count( $this->wpda_list_columns->get_table_primary_key() );\n\t\t\t\t\t$rows_succesfully_deleted = 0; // Number of rows succesfully deleted.\n\t\t\t\t\t$rows_with_errors = 0; // Number of rows that could not be deleted.\n\t\t\t\t\tfor ( $i = 0; $i < $no_rows; $i ++ ) {\n\t\t\t\t\t\t// Prepare named array for delete operation.\n\t\t\t\t\t\t$next_row_to_be_deleted = [];\n\n\t\t\t\t\t\t$row_found = true;\n\t\t\t\t\t\tfor ( $j = 0; $j < $no_key_cols; $j ++ ) {\n\t\t\t\t\t\t\tif ( isset( $rows_to_be_deleted[ $i ][ $j ]['key'] ) ) {\n\t\t\t\t\t\t\t\t$next_row_to_be_deleted[ $rows_to_be_deleted[ $i ][ $j ]['key'] ] = $rows_to_be_deleted[ $i ][ $j ]['value'];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t$row_found = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( $row_found ) {\n\t\t\t\t\t\t\tif ( $this->delete_row( $next_row_to_be_deleted ) ) {\n\t\t\t\t\t\t\t\t// Row(s) succesfully deleted.\n\t\t\t\t\t\t\t\t$rows_succesfully_deleted ++;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// An error occured during the delete operation: increase error count.\n\t\t\t\t\t\t\t\t$rows_with_errors ++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// An error occured during the delete operation: increase error count.\n\t\t\t\t\t\t\t$rows_with_errors ++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Inform user about the results of the operation.\n\t\t\t\t\t$message = '';\n\n\t\t\t\t\tif ( 1 === $rows_succesfully_deleted ) {\n\t\t\t\t\t\t$message = __( 'Row deleted', 'wp-data-access' );\n\t\t\t\t\t} elseif ( $rows_succesfully_deleted > 1 ) {\n\t\t\t\t\t\t$message = \"$rows_succesfully_deleted \" . __( 'rows deleted', 'wp-data-access' );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( '' !== $message ) {\n\t\t\t\t\t\t$msg = new WPDA_Message_Box(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'message_text' => $message,\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$msg->box();\n\t\t\t\t\t}\n\n\t\t\t\t\t$message = '';\n\n\t\t\t\t\tif ( $rows_with_errors > 0 ) {\n\t\t\t\t\t\t$message = __( 'Not all rows have been deleted', 'wp-data-access' );\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( '' !== $message ) {\n\t\t\t\t\t\t$msg = new WPDA_Message_Box(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'message_text' => $message,\n\t\t\t\t\t\t\t\t'message_type' => 'error',\n\t\t\t\t\t\t\t\t'message_is_dismissible' => false,\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$msg->box();\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'bulk-export':\n\t\t\t\tcase 'bulk-export-xml':\n\t\t\t\tcase 'bulk-export-json':\n\t\t\t\tcase 'bulk-export-excel':\n\t\t\t\tcase 'bulk-export-csv':\n\t\t\t\t\t// Check access rights.\n\t\t\t\t\tif ( ! WPDA::is_wpda_table( $this->table_name ) ) {\n\t\t\t\t\t\tif ( 'on' !== WPDA::get_option( WPDA::OPTION_BE_EXPORT_ROWS ) ) {\n\t\t\t\t\t\t\t// Exporting rows from list table is not allowed.\n\t\t\t\t\t\t\tdie( __( 'ERROR: Not authorized [export not allowed]', 'wp-data-access' ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// We first need to check if all the necessary information is available.\n\t\t\t\t\tif ( ! isset( $_REQUEST['bulk-selected'] ) ) { // input var okay.\n\t\t\t\t\t\t// Nothing to export.\n\t\t\t\t\t\t$msg = new WPDA_Message_Box(\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\t'message_text' => __( 'Nothing to export', 'wp-data-access' ),\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t);\n\t\t\t\t\t\t$msg->box();\n\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check if export is allowed.\n\t\t\t\t\t$wp_nonce_action = 'wpda-export-*';\n\t\t\t\t\t$wp_nonce = isset( $_REQUEST['_wpnonce'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['_wpnonce'] ) ) : ''; // input var okay.\n\t\t\t\t\tif ( ! wp_verify_nonce( $wp_nonce, $wp_nonce_action ) ) {\n\t\t\t\t\t\tdie( __( 'ERROR: Not authorized', 'wp-data-access' ) );\n\t\t\t\t\t}\n\n\t\t\t\t\t$bulk_rows = $_REQUEST['bulk-selected'];\n\t\t\t\t\t$no_rows = count( $bulk_rows ); // # rows to be exported.\n\n\t\t\t\t\t$format_type = '';\n\t\t\t\t\tswitch ( $this->current_action() ) {\n\t\t\t\t\t\tcase 'bulk-export-xml':\n\t\t\t\t\t\t\t$format_type = 'xml';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'bulk-export-json':\n\t\t\t\t\t\t\t$format_type = 'json';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'bulk-export-excel':\n\t\t\t\t\t\t\t$format_type = 'excel';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'bulk-export-csv':\n\t\t\t\t\t\t\t$format_type = 'csv';\n\t\t\t\t\t}\n\n\t\t\t\t\t$querystring = '';\n\t\t\t\t\tif ( ! is_admin() ) {\n\t\t\t\t\t\t// Add admin path for public access\n\t\t\t\t\t\t$querystring = admin_url() . 'admin.php';\n\t\t\t\t\t}\n\t\t\t\t\t$querystring .= \"?action=wpda_export&type=row&mysql_set=off&show_create=off&show_comments=off&schema_name={$this->schema_name}&table_names={$this->table_name}&_wpnonce=$wp_nonce&format_type=$format_type\";\n\n\t\t\t\t\t$j = 0;\n\t\t\t\t\tfor ( $i = 0; $i < $no_rows; $i ++ ) {\n\t\t\t\t\t\t// Write \"json\" to named array. Need to strip slashes twice. Once for the normal conversion\n\t\t\t\t\t\t// and once extra for the pre-conversion of double quotes in method column_cb().\n\t\t\t\t\t\t$row_object = json_decode( stripslashes( stripslashes( $bulk_rows[ $i ] ) ), true );\n\t\t\t\t\t\tif ( $row_object ) {\n\t\t\t\t\t\t\t// Check all key columns.\n\t\t\t\t\t\t\tforeach ( $this->wpda_list_columns->get_table_primary_key() as $key ) {\n\t\t\t\t\t\t\t\t// Check if key is available.\n\t\t\t\t\t\t\t\tif ( ! isset( $row_object[ $key ] ) ) {\n\t\t\t\t\t\t\t\t\twp_die( __( 'ERROR: Invalid URL', 'wp-data-access' ) );\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// Write key value pair to array.\n\t\t\t\t\t\t\t\t$querystring .= \"&{$key}[{$j}]=\" . urlencode( $row_object[ $key ] );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$j ++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Export rows.\n\t\t\t\t\techo '\n\t\t\t\t\t\t<script type=\\'text/javascript\\'>\n\t\t\t\t\t\t\tjQuery(document).ready(function() {\n\t\t\t\t\t\t\t\tjQuery(\"#stealth_mode\").attr(\"src\",\"' . $querystring . '\");\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t</script>\n\t\t\t\t\t';\n\t\t\t}\n\n\t\t}", "function deleteCdtActionFunction(CdtActionFunction $oCdtActionFunction) ;", "public function deleteAction() {\n\t\t$id = $this->getInput('id');\n\t\t$info = Client_Service_Ad::getAd($id);\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\n\t\t$result = Client_Service_Ad::deleteAd($id);\n\t\tif (!$result) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功');\n\t}", "public function actionDelete($id)\n\t{\n $uid = Yii::app()->user->getId(); \n if($uid != 1){\n $value = ComSpry::getUnserilizedata($uid);\n if(empty($value) || !isset($value)){\n throw new CHttpException(403,'You are not authorized to perform this action.');\n }\n if(!in_array(37, $value)){\n throw new CHttpException(403,'You are not authorized to perform this action.');\n }\n }\n\t\tif(Yii::app()->request->isPostRequest)\n\t\t{\n\t\t\t// we only allow deletion via POST request\n\t\t\t$this->loadModel($id)->delete();\n\n\t\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\t\tif(!isset($_GET['ajax']))\n\t\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t\t}\n\t\telse\n\t\t\tthrow new CHttpException(400,'Invalid request. Please do not repeat this request again.');\n \n\t}", "function deleteAction(){\n/*--------------------------------------------------------------*/\n\t$CheckUser = CheckUser($_COOKIE['login'], $_COOKIE['password']);\n if(!$CheckUser)\n return header('Location: /authorization/?status=ошибка авторизации');\n\n if($CheckUser['login'] == 'spjkee1488' OR $CheckUser['login'] == 'milky'){}\n else{\n $GetPrivilege = GetPrivilege($CheckUser['class']);\n if(!$GetPrivilege)\n return header('Location: /index/?status=Ошибка привилегии');\n\n\n if($GetPrivilege['flags']['access_site'] != 1)\n return header('Location: /index/?status=Забанен');\n\n if($GetPrivilege['flags']['access_adminpanel'] != 1)\n return header('Location: /index/?status=Нет доступа.');\n }\n\n\t//if($GetPrivilege['flags']['delete_user'] != 1)\n\t\t//return header('Location: /error/?error=privilege accesss denied');\n/* !-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!-!- \t*/\n\n\n\t$id = $_GET['id'] ? $_GET['id'] : 0;\n\n\tif($id)\n\t\tdeleteLog($id);\n\n\theader('Location: ' . $_SERVER['HTTP_REFERER']);\n}", "public function del($id)\n {\n }", "public function deleteAction() {\n $post_data = $request = $this->getRequest()->getPost();\n\n $mapper = new Application_Model_DistractionMapper();\n $anzDeletedRows = $mapper->delete($post_data['id']);\n\n $this->view->success = ($anzDeletedRows > 0);\n }", "public function deleteAction()\n {\n if ($this->isConfirmedItem($this->_('Delete %s'))) {\n $model = $this->getModel();\n $deleted = $model->delete();\n\n $this->addMessage(sprintf($this->_('%2$u %1$s deleted'), $this->getTopic($deleted), $deleted), 'success');\n $this->_reroute(array('action' => 'index'), true);\n }\n }", "public function delete($id) {\r\n \r\n }", "abstract function allowDeleteAction();", "public function actionDelete($id)\n\t{\n if(file_exists(dirname(Fircms::$basePath).DIRECTORY_SEPARATOR.$this->loadModel($id)->path))\n unlink(dirname(Fircms::$basePath).DIRECTORY_SEPARATOR.$this->loadModel($id)->path);\n \n $this->loadModel($id)->delete();\n \n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}", "public function deleteAction(){\n\t\t$this->view->isLoggedIn = $this->isLoggedIn;\n\t\t\n\t\t$id = (int)$this->_request->getParam('id');\n\t\t\n\t\tif(is_numeric($id)){\n\t\t\t$notificationTable = new Zend_Db_Table('notifications');\n\t\t\t$where = array(\n\t\t\t\t\t\t'user_id = ?' => $this->user_id_seq,\n\t\t\t\t\t\t'id = ?' => $id\n\t\t\t\t\t\t);\n\t\t\t$notificationTable->delete($where);\n\t\t}\n\t}", "function delete()\n {\n }", "public function actionDelete($id)\n\t{\n\t\t//$this->loadModel($id)->delete();\n $model=$this->loadModel($id);\n $model->IdEstadoSolicitudCita = 3;\n $model->save();\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}", "function delete($id)\n {\n }", "function actionsForDeleteMethod()\n {\n if (isset($this->id)) {\n $info = $this->api->get($this->id);\n\n if (count($info) == 0) {\n $this->print_json(404, \"Not Found\", null);\n } else {\n $this->api->id = $this->id;\n $data = $this->api->delete();\n\n if ($data) {\n array_pop($info);\n if (count($info) == 0) {\n $this->print_json(404, \"Not Found\", null);\n } else {\n $this->print_json(200, \"Item deleted\", $info);\n }\n } else {\n $this->print_json(200, false, null);\n }\n }\n\n } else {\n $this->print_json(405, \"Method Not Allowed\", null);\n }\n }", "public function removeAction()\n {\n }", "public function deleted_user_action($id) {\r\n $this->db->delete_by_user_id($id);\r\n }", "public function deleteAction() {\r\n\t\t$id = $this->getInput('id');\r\n\t\t$info = Gou_Service_Ad::getAd($id);\r\n\t\tif ($info && $info['id'] == 0) $this->output(-1, '无法删除');\r\n//\t\tUtil_File::del(Common::getConfig('siteConfig', 'attachPath') . $info['img']);\r\n\t\t$result = Gou_Service_Ad::deleteAd($id);\r\n\t\tif (!$result) $this->output(-1, '操作失败');\r\n\t\t$this->output(0, '操作成功');\r\n\t}", "public function deleting()\n {\n # code...\n }", "public function delete($id) \r\n {\r\n $this->load(array('id=?',$id));\r\n $this->erase();\r\n }", "function delete()\r\n {\r\n\r\n }", "public function delete($id){\r\n }", "public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\t}", "public function delete( $id ){\n \n\n }", "public function deleteIdAction() {\n\t\t$id = intval($this->getInput('id'));\n\t\t$game_id = intval($this->getInput('game_id'));\n\t\t$result = Client_Service_Besttj::deleteByBesttjId($game_id,$id);\n\t\tClient_Service_Besttj::updateBesttjDate(intval($id));\n\t\tif (!$result) $this->output(-1, '操作失败');\n\t\t$this->output(0, '操作成功');\n\t}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "function delete() {\n \tglobal $mysql;\n \tif(empty($this->id)) return;\n \t$tablename = $this->class_name();\n \t$id = $this->id;\n \t$query = \"DELETE FROM $tablename WHERE id=$id\";\n \t$mysql->update($query);\n }", "public function Do_delete_Example1(){\n\n\t}", "public function delete( $id );", "public function deleted($id)\n {\n }", "public function actionDelete($id)\n {\n //$this->findModel($id)->delete();\n $tmp = $this->findModel($id);\n $tmp_id = $tmp->counter_id;\n $tmp->delete();\n return $this->redirect(['/indication/index', 'id' => $tmp_id]);\n }", "public function actionDelete($id)\n\t{\n\t\t$this->loadModel($id)->delete();\n\t\t$utilLog = new Utils;\n\t\t$utilLog->saveAuditLogs();\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}", "public function deleteAction() {\n\t\tif(!isset($this->params['cancel'])) {\n\n\t\t\t// XXX: Maybe do some hook call validation here?\n\n\t\t\t// auto call the hooks for this module/action\n\t\t\tAPI::callHooks(self::$module, $this->action, 'controller', $this);\n\n\t\t\t// delete an entry\n\t\t\t$host = $this->_model->delete();\n\t\t}\n\t\tAPI::redirect(API::printUrl($this->_redirect));\n\t}", "function delete() ;", "function delete() ;", "public function actionDelete()\n\t{\n\t parent::actionDelete();\n\t $id=$_POST['id'];\n\t foreach($id as $ids)\n\t {\n\t\t$model=$this->loadModel($ids);\n\t\t$model->recordstatus=0;\n\t\t$model->save();\n\t }\n\t echo CJSON::encode(array(\n\t\t\t 'status'=>'success',\n\t\t\t 'div'=>'Data deleted'\n\t\t\t ));\n\t Yii::app()->end();\n\t}", "public function delete($id = null){\n\t\t\n\t}", "public function postDelete($id)\n\t{\n\t\t//\n\t}", "public function actionDelete($id)\n \n\t{ \n $clausuras=\"select cod_convencion, nro_clausura from clausuras where id='\".$id.\"'\";\n $verificando1=YII::app()->db->createCommand($clausuras)->queryAll();\n \n $verificar2=\"select id from clausuras where cod_convencion='\".$verificando1[0]['cod_convencion'].\"' and nro_clausura='\".$verificando1[0]['nro_clausura'].\"'\";\n $verificando3=YII::app()->db->createCommand($verificar2)->queryAll();\n foreach($verificando3 as $valor){\n $this->loadModel($valor['id'])->delete();\n }\n \n \n\t\t\n\n\t\t// if AJAX request (triggered by deletion via admin grid view), we should not redirect the browser\n\t\tif(!isset($_GET['ajax']))\n\t\t\t$this->redirect(isset($_POST['returnUrl']) ? $_POST['returnUrl'] : array('admin'));\n\t}", "public function actionDelete()\n\t{\n\t parent::actionDelete();\n\t\t$id=$_POST['id'];\n\t\tforeach($id as $ids)\n\t\t{\n\t\t $model=$this->loadModel($ids);\n\t\t $model->recordstatus=0;\n\t\t $model->save();\n\t\t}\n\t\techo CJSON::encode(array(\n 'status'=>'success',\n 'div'=>'Data deleted'\n\t\t\t\t));\n Yii::app()->end();\n\t}", "public function delete( $id ){\n\n }", "public function delete($id)\r\n {\r\n }", "public function index_delete($id)\n {\n $this->db->delete('items', array('id'=>$id));\n \n $this->response(['Item deleted successfully.'], REST_Controller::HTTP_OK);\n }", "public function index_delete($id)\n {\n $this->db->delete('items', array('id'=>$id));\n \n $this->response(['Item deleted successfully.'], REST_Controller::HTTP_OK);\n }", "public function actionDelete($id)\n { \n\t\t$model = $this->findModel($id); \n $model->isdel = 1;\n $model->save();\n //$model->delete(); //this will true delete\n \n return $this->redirect(['index']);\n }", "public function actionDelete($id) {\n $model=$this->findModel($id);\n\t\t$id_operacion=$model->id_operacion;\n\t\t$model->delete();\n\t\t\n\t\treturn $this->redirect(['index', 'id_operacion' => $id_operacion]);\n //return $this->redirect(['index']);\n }", "public function delete($id)\n\t{\n\t}", "public function delete($id)\n\t{\n\t}", "abstract public function delete($id);", "abstract public function delete($id);", "abstract public function delete($id);", "public function delete($id) {\r\n\r\n }" ]
[ "0.7915909", "0.78556454", "0.75841963", "0.75841963", "0.74591523", "0.74209744", "0.73930055", "0.7311004", "0.73010063", "0.72980964", "0.7287662", "0.7270027", "0.7221455", "0.71985924", "0.71497613", "0.69943744", "0.6987597", "0.6961916", "0.6939307", "0.6863796", "0.6833706", "0.6832059", "0.6829126", "0.6809475", "0.6793149", "0.6771432", "0.67674077", "0.6764472", "0.67166346", "0.6689508", "0.66854936", "0.6672261", "0.66711074", "0.6664307", "0.66631335", "0.6659868", "0.6644933", "0.66383696", "0.6626059", "0.6621337", "0.66115975", "0.6607204", "0.6600066", "0.6593836", "0.6591227", "0.65907145", "0.6588966", "0.6583657", "0.65836346", "0.6580881", "0.6577686", "0.65657985", "0.6560913", "0.6560804", "0.65592515", "0.65541655", "0.6549836", "0.65435135", "0.6540413", "0.6538337", "0.6537309", "0.6537309", "0.6537309", "0.6537309", "0.6537309", "0.6537309", "0.6537309", "0.6537309", "0.6537309", "0.6537309", "0.6537309", "0.6537309", "0.6537309", "0.6537309", "0.6537309", "0.6529118", "0.65266687", "0.6520706", "0.6516541", "0.65120596", "0.65098405", "0.65089303", "0.65040207", "0.65040207", "0.65027213", "0.6502062", "0.65019995", "0.6494576", "0.6493486", "0.6489943", "0.64898854", "0.64888877", "0.64888877", "0.64888495", "0.6487146", "0.6486738", "0.6486738", "0.6484707", "0.6484707", "0.6484707", "0.6483251" ]
0.0
-1
Finds the PermohonanIzin model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown.
protected function findModel($id) { if (($model = PermohonanIzin::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract function find($primary_key, $model);", "public static function find( $primaryKey )\n\t{\n\t\tself::init();\n\t\t\n\t\t// Select one item by primary key in Database\n\t\t$result = Database::selectOne(\"SELECT * FROM `\" . static::$table . \"` WHERE `\" . static::$primaryKey . \"` = ?\", $primaryKey);\t\t\n\t\tif( $result == null )\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// Create & return new object of Model\n\t\treturn self::newItem($result);\n\t}", "public function find($id){\n\t\t$db = static::getDatabaseConnection();\n\t\t//Create a select query\n\t\t$query = \"SELECT \" . implode(\",\" , static::$columns).\" FROM \" . static::$tableName . \" WHERE id = :id\";\n\t\t//prepare the query\n\t\t$statement = $db->prepare($query);\n\t\t//bind the column id with :id\n\t\t$statement->bindValue(\":id\", $id);\n\t\t//Run the query\n\t\t$statement->execute();\n\n\t\t//Put the associated row into a variable\n\t\t$record = $statement->fetch(PDO::FETCH_ASSOC);\n\n\t\t//If there is not a row in the database with that id\n\t\tif(! $record){\n\t\t\tthrow new ModelNotFoundException();\n\t\t}\n\n\t\t//put the record into the data variable\n\t\t$this->data = $record;\n\t}", "private function findModel($id)\n {\n return Pekerjaan::findOne($id);\n }", "protected function findModel($id)\n {\n if (($model = Menu::findOne([ 'id' => $id ])) !== null)\n {\n return $model;\n }\n else\n {\n throw new HttpException(404, Yii::t('backend', 'The requested page does not exist.'));\n }\n }", "protected function findModel($id)\n {\n\t\t$p = $this->primaryModel;\n if (($model = $p::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "private function findModel($key)\n {\n if (null === $key) {\n throw new BadRequestHttpException('Key parameter is not defined in findModel method.');\n }\n\n $modelObject = $this->getNewModel();\n\n if (!method_exists($modelObject, 'findOne')) {\n $class = (new\\ReflectionClass($modelObject));\n throw new UnknownMethodException('Method findOne does not exists in ' . $class->getNamespaceName() . '\\\\' .\n $class->getShortName().' class.');\n }\n\n $result = call_user_func([\n $modelObject,\n 'findOne',\n ], $key);\n\n if ($result !== null) {\n return $result;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = KhoSanPham::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function returnFindByPK($id);", "public static function findModel($id='')\n {\n $model = static::find()->where(['id' => $id])->one();\n if ($model == null) {\n throw new \\yii\\web\\NotFoundHttpException(Yii::t('app',\"Page not found!\"));\n }\n return $model;\n }", "public function findById($primaryKeyValue){\n //Select* From employers Where $this->primaryKey(noemp)=$primaryKeyValue(1000)\n $array = $this->findWhere($this->primaryKey. \"=$primaryKeyValue\");\n if (count($array) != 1 ) die (\"The ID $primaryKeyValue is not valid\");\n return $array[0];\n }", "public function find($primary)\n {\n if (isset($this->models[$primary])) {\n return $this->models[$primary];\n }\n\n return;\n }", "protected function findModel($id)\n {\n if (($model = PaidEmployment::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404);\n }\n }", "protected function findModel($id)\n {\n if (($model = PoinKebaikan::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id) {\n\t\tif (($model = EntEmpleados::findOne ( $id )) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new NotFoundHttpException ( 'The requested page does not exist.' );\n\t\t}\n\t}", "protected function findModel($id)\n\t{\n\t\tif (($model = Trailer::findOne($id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "protected function findModel($id)\n {\n if (($model = Was27Inspeksi::findOne(['id_was_27_inspeksi'=>$id])) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id) {\n\n\n if (($model = page::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function returnDetailFindByPK($id);", "protected function findModel($id)\n {\n if (($model = SanPham::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n\t\t{\n\t\t\tif (($model = PhoneRecord::findOne($id)) !== null) {\n\t\t\t\treturn $model;\n\t\t\t}\n\t\t\t\n\t\t\tthrow new NotFoundHttpException(Yii::t('app', 'Запрашиваемая страница не существует.'));\n\t\t}", "protected function findModel($id)\r\n {\r\n if (($model = Apresentacao::findOne($id)) !== null) {\r\n return $model;\r\n } else {\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }\r\n }", "public function findById() {\n // TODO: Implement findById() method.\n }", "protected function findModel($masterlist_id)\n\t{\n\t\tif (($model = WiMasterlist::findOne($masterlist_id)) !== null) {\n\t\t\treturn $model;\n\t\t} else {\n\t\t\tthrow new HttpException(404, 'The requested page does not exist.');\n\t\t}\n\t}", "protected function findModel($id)\n {\n if (($model = Kamar::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = IzinRuangan::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = MaklumatPelajarPenjaga::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function findPk($pk)\r\n {\r\n $pkColumns = $this->getObject()->getTable()->getIdentifierColumnNames();\r\n if(($count = count($pkColumns)) > 1)\r\n {\r\n // composite primary key\r\n if(!is_array($pk))\r\n {\r\n throw new Exception(sprintf('Class %s has a composite primary key and expects %s parameters to retrieve a record by pk', $this->class, join(', ', $pkColumns)));\r\n } \r\n else if (is_array($count[0]))\r\n {\r\n // array of arrays\r\n // sorry the finder can't do that on objects with composte primary keys\r\n throw new Exception('Impossible to find a list of Pks on an objects with composite primary keys');\r\n }\r\n for ($i=0; $i < $count; $i++)\r\n { \r\n $this->addCondition('and', $pkColumns[$i], '=', $pk[$i]);\r\n }\r\n return $this->findOne();\r\n }\r\n else\r\n {\r\n // simple primary kay\r\n if(is_array($pk))\r\n {\r\n $this->addCondition('and', $pkColumns[0], ' IN ', $pk);\r\n return $this->find();\r\n }\r\n else\r\n {\r\n $this->addCondition('and', $pkColumns[0], '=', $pk);\r\n return $this->findOne();\r\n }\r\n }\r\n }", "protected function findModel($id)\n {\n if (($model = Penulis::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function find($pk)\r\n {\r\n $row = $this->getTable()->find($pk);\r\n if(!$row){\r\n return false;\r\n }\r\n $sampleModel = new SampleModel();\r\n $this->_map($sampleModel, $row);\r\n return $sampleModel;\r\n }", "protected function findModel($id)\n {\n if (($model = Picture::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, \\Yii::t('The requested object does not exist or has been already deleted.'));\n }\n }", "protected function findModel($id)\n {\n if (($model = HasilKonsultasi::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = Penilaian::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = JenisPelayanan::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = PublicNum::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = TKaryawan::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=InvoicePenjualan::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Pengalaman::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\r\n {\r\n if (($model = Pelanggaran::findOne($id)) !== null) {\r\n return $model;\r\n } else {\r\n throw new NotFoundHttpException('The requested page does not exist.');\r\n }\r\n }", "protected function findModel($id)\n {\n if (($model = Persyaratan::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function find(int $id): ?Model;", "public function find(int $id): ?Model;", "protected function findModel($id)\n {\n if (($model = DetailPinjam::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function findModel($id)\n {\n if (($model = Page::findOne($id)) !== null) \n {\n return $model;\n } \n else \n {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = PersonalPlan::findOne($id)) !== null) {\n // $exec_div_record = ExecDivAssignment::findOne(['job_id' => $model->id]);\n // if($exec_div_record)$model->executor_div_id = $exec_div_record->div_id;\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = PostKey::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=Pegawai::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n {\n $model=RJAsuhankeperawatanT::model()->findByPk($id);\n if($model===null)\n throw new CHttpException(404,'The requested page does not exist.');\n return $model;\n }", "protected function findModel($id)\n {\n \tif (\\Yii::$app->user->isGuest) {\n \t\treturn $this->redirect(Yii::$app->params['default']);\n \t}\n\t\t//supaya org non guest gabisa akses yg lain\n\t\t\n if (($model = Barismilestone::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = SubAkun::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id) {\n if (($model = UserPlans::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = AplikasiItday::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($chpu)\n {\n if (($model = StaticPage::find()->where(['chpu' => $chpu])->one()) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = StoreKasir::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function loadModel($id)\n\t{\n\t\t$model=Topik::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Nursinghomes::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = InmueblePorcentajePropietario::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n {\n $model=SAAsuhankeperawatanT::model()->findByPk($id);\n if($model===null)\n throw new CHttpException(404,'The requested page does not exist.');\n return $model;\n }", "public function show($pk)\n {\n return $this->model->findOrFail($pk);\n }", "public function loadModel($id)\n\t{\n\t\t$model=Korzet::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'A keresett tartalom nem található.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Offer::findOne($id)) !== null) {\n return $model;\n } else {\n throw new HttpException(404, 'The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = PraktekMahasiswa::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function loadModel($id)\n\t{\n\t\t$model=Pooja::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Kaohao::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = CompPrep::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel($id)\n\t{\n\t\t$model=Kzone::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Avisa_rotina::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id) {\n\t\tif (($model = Menu::findOne ( $id )) !== null) {\n\t\t\treturn $model;\n\t\t}\n\t\t\n\t\tthrow new NotFoundHttpException ( 'The requested page does not exist.' );\n\t}", "protected function findModel($id)\n {\n if (($model = Campanha::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = Klien::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = DataPribadi::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "protected function findModel($id)\n {\n if (($model = Prefix::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n$model = Reports::findOne($id);\n\t\tif ((isset(Yii::$app->params['ADMIN_CLIENT_ID']) and Yii::$app->user->identity->clientID == Yii::$app->params['ADMIN_CLIENT_ID']))\n\t\t{\n return $model;\n }\n\t\telse\n\t\t\tthrow new NotFoundHttpException('The requested page does not exist.');\n\t\t\n }", "public function loadModel($id)\r\n\t{\r\n\t\t$model=Klient::model()->findByPk($id);\r\n\t\tif($model===null)\r\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\r\n\t\treturn $model;\r\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=PPJadwaldokterM::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=AKPenjaminpasienM::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=PegawaiM::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Persona::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = SkepPenetapanBcf15::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function find($id){\n return $this->model->query()->findOrFail($id);\n }", "public function loadModel($id) {\n $model = MissionCarers::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, Yii::t('texts', 'FLASH_ERROR_404_THE_REQUESTED_PAGE_DOES_NOT_EXIST'));\n return $model;\n }", "protected function findModel($id)\n {\n if (($model = CodeMember::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = PengirimanKoleksi::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel() {\n if ($this->_model === null) {\n if (isset($_GET['id']))\n $this->_model = Project::model()->findbyPk($_GET['id']);\n if ($this->_model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n }\n return $this->_model;\n }", "protected function findModel($id)\n {\n if (($model = PagosPrestamos::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Creditortmp::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "function find($id)\n{\n\t$model = $this->newModel(null);\n\treturn $model->find($id);\n}", "protected function findModel($id) {\n if (($model = Bonification::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "public function loadModel()\n\t{\n\t\tif($this->_model===null)\n\t\t{\n\t\t\tif(isset($_GET['id']))\n\t\t\t\t$this->_model=emprestimo::model()->findbyPk($_GET['id']);\n\t\t\tif($this->_model===null)\n\t\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\t}\n\t\treturn $this->_model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Pos::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=PPDokrekammedisM::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "protected function findModel($id)\n {\n if (($model = Empleado::findOne($id)) !== null) {\n return $model;\n } else {\n throw new NotFoundHttpException('The requested page does not exist.');\n }\n }", "protected function findModel($id)\n {\n if (($model = Orcamento::findOne($id)) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function loadModel($id)\n\t{\n\t\t$model=RKInfoPasienLamaV::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id) {\n $model = Qircomentario::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "protected function findModel($project_ppi, $author_scopus_id)\n {\n if (($model = AuthorsProjectAuthorMatch::findOne(['project_ppi' => $project_ppi, 'author_scopus_id' => $author_scopus_id])) !== null) {\n return $model;\n }\n\n throw new NotFoundHttpException('The requested page does not exist.');\n }", "public function loadModel($id)\n {\n $model = Kupons::model()->findByPk($id);\n if ($model === null)\n throw new CHttpException(404, 'The requested page does not exist.');\n return $model;\n }", "public function find($model, $id);", "public function loadModel($id)\n\t{\n\t\t$model=Pago::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}", "public function loadModel($id)\n\t{\n\t\t$model=Pago::model()->findByPk($id);\n\t\tif($model===null)\n\t\t\tthrow new CHttpException(404,'The requested page does not exist.');\n\t\treturn $model;\n\t}" ]
[ "0.72843975", "0.6915632", "0.6840357", "0.6817828", "0.6814886", "0.6729786", "0.6729632", "0.66939825", "0.6660874", "0.6628279", "0.66102403", "0.65743405", "0.65606976", "0.6555757", "0.65285313", "0.65232766", "0.6520711", "0.6515585", "0.6508427", "0.64959127", "0.6489665", "0.6481624", "0.64727634", "0.6467093", "0.64635426", "0.6459537", "0.64563495", "0.64524215", "0.64512914", "0.6449847", "0.6448033", "0.64384645", "0.64316696", "0.64292926", "0.64260143", "0.641593", "0.6408101", "0.6404235", "0.6401467", "0.64009976", "0.6395664", "0.6395664", "0.63871676", "0.6381499", "0.6377086", "0.63745975", "0.63714135", "0.63704544", "0.63686526", "0.6367712", "0.63658893", "0.6364784", "0.63587", "0.6358016", "0.6356367", "0.63465554", "0.6344654", "0.6339725", "0.633833", "0.6335708", "0.63333017", "0.6333024", "0.6332761", "0.63321024", "0.6331609", "0.63296396", "0.6327287", "0.63223946", "0.6321804", "0.6317797", "0.63177943", "0.63119155", "0.6310193", "0.6308112", "0.63048655", "0.63046086", "0.6301625", "0.6301446", "0.6301188", "0.62977886", "0.6297038", "0.62957996", "0.62954926", "0.6293683", "0.62896615", "0.6286805", "0.6285412", "0.6284454", "0.62837285", "0.62670165", "0.6266898", "0.6259329", "0.62557256", "0.6253941", "0.625325", "0.6251147", "0.6248954", "0.6245926", "0.6245497", "0.6245497" ]
0.66580063
9
Gets person by identification number
public function getPersonById(int $id): ?Person;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_person($person_id)\n {\n return $this->db->get_where('person',array('person_id'=>$person_id))->row_array();\n }", "function getPerson_ID($name, &$official_name)\r\n\t{\r\n\t\t//build the api request using the key [global variable] and json format, and postcode \r\n\t\tglobal $Open_Australia_Key;\r\n\t\t$person_id = null;\r\n\r\n\t\t\r\n\t\tfor($count = 0; $person_id == null && $count < 2; $count++)\r\n\t\t{\r\n\t\t\tif($count == 0)\r\n\t\t\t\t$url = \"http://www.openaustralia.org/api/getRepresentatives\";\r\n\t\t\telse\r\n\t\t\t\t$url = \"http://www.openaustralia.org/api/getSenators\";\r\n\t\t\t\t\r\n\t\t\t$data = array('search'=>$name,'output'=>'js','key'=> $Open_Australia_Key);\r\n\t\t\t$GETurl = sprintf(\"%s?%s\", $url, http_build_query($data));\r\n\t\t\r\n\t\t\t//translate fullBio into a usable form\r\n\t\t\t$fullBio = json_decode(file_get_contents($GETurl));\r\n\t\t\t\r\n\t\t\t//check if the name yielded any actual data;\r\n\t\t\tif(! ($fullBio == new StdClass()))\r\n\t\t\t{\r\n\t\t\t\t//pull the first record [it's now an object!!!]\r\n\t\t\t\t$pollie = $fullBio[0];\r\n\r\n\t\t\t\t\r\n\t\t\t\t//get the values from the object\r\n\t\t\t\t$person_id = $pollie->person_id;\r\n\t\t\t\t$official_name = $pollie->full_name;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn $person_id;\r\n\t}", "function get_person($id)\n {\n\t$this->db->where('id',$id);\n\t$query = $this->db->get('person');\n\t$row = $query->row();\n\treturn $row;\n\t}", "public function getPersonByID($id) {\n\t\tglobal $db;\n\n\t\t$person = $db->query(\"SELECT * FROM person WHERE id=$id\");\n\t\treturn $person[0];\n\t}", "public function getPersonGuid();", "function personne($id){\r\n\t\treturn mysql_fetch_assoc(mysql_query(\"SELECT * FROM personnes WHERE id='$id'\"));\r\n\t}", "public function findIdentifierByValue($value)\n {\n $repo = $this->_em->getRepository($this->getPersonIdentifierClassName());\n return $repo->findOneBy(array('value' => $value)); \n }", "public function getPerson($id=null)\n {\n $app = \\Cobalt\\Container::get('app');\n $id = $id ? $id : $app->input->get('id');\n\n if ($id > 0) {\n\n $db = JFactory::getDBO();\n //generate query\n //\n $query = $db->getQuery(true);\n $query->select('p.*,c.name as company_name,stat.name as status_name,\n source.name as source_name, owner.name as owner_name, crmery_user.first_name AS owner_first_name, crmery_user.last_name AS owner_last_name');\n $query->from('#__people AS p');\n $query->leftJoin('#__companies AS c ON c.id = p.company_id AND c.published>0');\n $query->leftJoin('#__people_status AS stat ON stat.id = p.status_id');\n $query->leftJoin('#__sources AS source ON source.id = p.source_id');\n $query->leftJoin('#__users AS owner ON p.owner_id = owner.id');\n $query->leftJoin(\"#__users AS crmery_user ON crmery_user.id = p.owner_id\");\n\n //searching for specific person\n $query->where(\"p.published=\".$this->published);\n $query->where(\"p.id='\".$id.\"'\");\n\n //run query and grab results\n $db->setQuery($query);\n $person = $db->loadAssoc();\n\n /* Deals */\n $dealModel = new CobaltModelDeal();\n $dealModel->set('person_id',$person['id']);\n $person['deals'] = $dealModel->getDeals();;\n\n /* Notes */\n $notesModel = new CobaltModelNote();\n $person['notes'] = $notesModel->getNotes($person['id'],'person');\n\n /* Docs */\n $docsModel = new CobaltModelDocument();\n $docsModel->set('person_id',$person['id']);\n $person['documents'] = $docsModel->getDocuments();\n\n /* Tweets */\n if ($person['twitter_user']!=\"\" && $person['twitter_user']!=\" \") {\n $person['tweets'] = TweetsHelper::getTweets($person['twitter_user']);\n }\n\n $this->person = $person;\n\n } else {\n\n //TODO update things to OBJECTS\n $person = (array) new PeopleTable;\n $this->person = $person;\n\n }\n\n $app->triggerEvent('onPersonLoad', array(&$person));\n\n return $person;\n }", "function getPersonID()\n {\n return $this->getValueByFieldName('person_id');\n }", "public function getFindPerson()\n\t{\n\t\t$this->_makeRequest(Wp_WhitePages_Model_Api::API_REQUEST_METHOD_FINDPERSON);\n\t\treturn $this->_result;\n\t}", "public function getPersonID() {\n\t\t$session_id = $this->getCurrentID();\n\t\t$this->load($session_id);\n\t\treturn $this->contactid;\n }", "public static function getRecord($id) {\r\n $connection = Database::getConnection();\r\n // Set up the query\r\n $query = 'SELECT `id`,`first_name`,`last_name`,`gender`,`avatar`,`bloodgroup`, `email`, `phone`,\r\n `user_name`, `access`\r\n FROM `persons` WHERE id=\"'. (int) $id.'\"';\r\n // Run the MySQL command \r\n $result_obj = ''; \r\n try {\r\n $result_obj = $connection->query($query);\r\n if (!$result_obj) {\r\n throw new Exception($connection->error);\r\n } else {\r\n $item = $result_obj->fetch_object('Person');\r\n if (!$item) {\r\n throw new Exception($connection->error);\r\n } else {\r\n // pass back the results\r\n return($item);\r\n }\r\n }\r\n }\r\n catch(Exception $e) {\r\n echo $e->getMessage();\r\n }\r\n }", "public function loadPersonLeagueForIdentifier($identifier)\n {\n $repo = $this->_em->getRepository($this->getPersonLeagueClassName());\n return $repo->findOneBy(array('identifier' => $identifier));\n }", "public function getRecord()\n {\n return $this->options['peoplefinder']->getByNUID($this->nu_id);\n }", "public static function getPerson($id) {\n\t\t$person = self::with('whimseys', 'socials')->find($id);\n\t\treturn $person;\n\t}", "protected function person()\n {\n try {\n return Person::findOrFail($this->authorizationServer->getResourceOwnerId());\n } catch (ModelNotFoundException $e) {\n throw new PersonNotFoundException;\n }\n }", "public function findPerson()\n {\n\n // AITS EnterpriseUser API Source\n if($this->dev) {\n\n $source = 'https://webservices-dev.admin.uillinois.edu/xfunctionalWS/data/' . $this->senderAppID . '/EnterpriseUser/1_1/' . $this->netid . '/' . $this->domain;\n\n } else {\n\n $source = 'https://webservices.admin.uillinois.edu/xfunctionalWS/data/' . $this->senderAppID . '/EnterpriseUser/1_1/' . $this->netid . '/' . $this->domain;\n\n }\n\n // Initialize a curl resource\n $curl = curl_init();\n\n // Set curl options\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_URL, $source);\n curl_setopt($curl, CURLOPT_HTTPHEADER, array());\n\n // JSON Response\n $response = curl_exec($curl);\n\n if(curl_getinfo($curl, CURLINFO_HTTP_CODE) == 200) {\n\n // Cache the response in $this->response\n $this->response = new \\stdClass();\n $this->response->type = 'JSON';\n $this->response->data = $response;\n\n // Set the UIN\n $this->uin = $this->findUIN($response);\n\n } else {\n\n throw new \\Exception($response);\n\n }\n\n }", "function getPersonID($projectUUID, $personName){\n\t\n\t\t $db = $this->startDB();\n\t\t \n\t\t $sql = \"SELECT persons.uuid\n\t\t\t\t\tFROM persons\n\t\t\t\t\tWHERE persons.project_id = '\".$projectUUID.\"'\n\t\t\t\t\tAND persons.combined_name LIKE '%\".$personName.\"%'\t\n\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\n\t\t\t\t\tUNION\n\t\t\t\t\t\n\t\t\t\t\tSELECT users.uuid AS uuid\n\t\t\t\t\tFROM users \n\t\t\t\t\tWHERE users.combined_name LIKE '%\".$personName.\"%'\t\n\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\n\t\t\t\t\t\";\n\t\t \n\t\t $result = $db->fetchAll($sql, 2);\n\t\t $personID = false;\n\t\t if($result){\n\t\t\t\t$personID = $result[0][\"uuid\"];\n\t\t }\n\t\t \n\t\t return $personID;\n \n }", "public function getIdPerson()\n {\n return $this->idPerson;\n }", "public function getPersonId()\n {\n return $this->personId;\n }", "public function getPerson() {\n return $this->getPersoner()->getSingle();\n }", "public static function getByID($id) { \n $str = \"\n SELECT id, firstName, lastName, email, password\n FROM indPrj_persons\n WHERE id = \" . $id;\n \n return mysql_fetch_array(Database::query($str));\n }", "function getPersonID () {\r\n if (checkLogin()) {\r\n $stmt = runQuery(\"SELECT PersonID FROM people WHERE LogonName = \" . $_SESSION['user']['name']);\r\n if ($stmt->rowCount() > 0) {\r\n $row = $stmt->fetch();\r\n //return the ID\r\n return $row['PersonID'];\r\n }\r\n }\r\n //returns null by default\r\n return null;\r\n}", "function &getById($personId, $objectId = null) {\n\t\t$params = array((int) $personId);\n\t\tif ($objectId) $params[] = (int) $objectId;\n\n\t\t$result =& $this->retrieve(\n\t\t\t'SELECT * FROM object_for_review_persons WHERE person_id = ?'. ($objectId ? ' AND object_id = ?' : ''),\n\t\t\t$params\n\t\t);\n\n\t\t$returner = null;\n\t\tif ($result->RecordCount() != 0) {\n\t\t\t$returner =& $this->_fromRow($result->GetRowAssoc(false));\n\t\t}\n\t\t$result->Close();\n\t\treturn $returner;\n\t}", "public function get($identifier);", "function getIdentifier();", "function getIdentifier();", "function get_third_person($id){\n\t\t\t$str= \"SELECT name FROM mgl_fair_person_detail where transaction_id=$id\";\t\n\t\t\t$rs=mysql_query($str);\n\t\t\t$row=mysql_fetch_array($rs);\n\t\t\treturn $row['name'];\n\t\t}", "function find_callerid($number){\n $number = unify_number($number);\n foreach( find_entries_matching($number) as $entry ){\n return \"{$entry[\"name\"]} ({$entry[\"number\"]})\";\n }\n\n return $number;\n}", "function getID($pID){\r\n $this->db->select('ID');\r\n $this->db->from('familydetails');\r\n $this->db->where('person_id', $pID); \r\n $query = $this->db->get();\r\n $row = $query->row(); \r\n return $row->ID;\r\n }", "public function person() {\n $personId = $_REQUEST['id'];\n $person = $this->tmdb->getPerson($personId);\n $imageUrl = $this->tmdb->getImageUrl($person['profile_path'], TMDb::IMAGE_PROFILE, 'w185');\n //$images = $this->tmdb->getPersonImages($personId);\n $credits = $this->tmdb->getPersonCredits($personId);\n $map = array('person' => $person, 'imageUrl' => $imageUrl, 'credits' => $credits);\n $this->reply($map);\n }", "public function retrieveById(mixed $identifier);", "function people_findByUsername ($username) {\n $response = $this->execute(array('method' => 'flickr.people.findByUsername', 'username' => $username));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['user']['nsid'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function getItemByNumber($num)\n {\n $this->db->select('*');\n $this->db->from('tbl_user');\n $this->db->where('userid', $num);\n $query = $this->db->get();\n $result = $query->result();\n if (count($result) == 0) $result[0] = NULL;\n return $result[0];\n }", "function select_people($conn, $id) {\n\t$name = \"\";\n\t$sql = \"SELECT * FROM People WHERE People_ID = '$id'\";\n\t$result = mysqli_query($conn, $sql);\n\t// happen to have one match, i.e. one unique corrosponding person\n\tif (mysqli_num_rows($result)== 1){\n\t\t$row = mysqli_fetch_assoc($result);\n\t\t$name = $row[\"People_Name\"];\n\t}\n\treturn $name;\n}", "public function getPersonne()\n {\n return $this->id_personne;\n }", "function imdb_person ($id) {\n $this->imdb_base($id);\n }", "abstract public function getIdent();", "public static function ObtenerPersona($persona){\n\t\t$sql = 'SELECT * FROM personas WHERE dni = :dni';\n $consulta = AccesoDatos::ObtenerObjetoAccesoDatos()->ObtenerConsulta($sql);\n\t\t$consulta->bindParam(':dni', $persona->dni);\n\t $consulta->execute();\n\t return $consulta->fetch(PDO::FETCH_ASSOC);\n\t}", "protected function getPersonIDfromViewerID($viewer_id)\n {\n $accessPriv = new RowManager_AccessManager();\n $accessPriv->setViewerID($viewer_id);\n \n $accessPrivList = $accessPriv->getListIterator();\n $accessPrivArray = $accessPrivList->getDataList();\n \n $personID = '';\n reset($accessPrivArray);\n foreach (array_keys($accessPrivArray) as $k)\n {\n \t$record = current($accessPrivArray);\n \t$personID = $record['person_id'];\t// can only be 1 person_id per viewer_id\n \tnext($accessPrivArray);\n \t }\n \n return $personID;\n }", "public function get( int $id ) : IEmployerIncentive\n {\n if ( !isset( self::DB[$id] ))\n throw new RecordNotFoundException();\n \n return self::DB[$id]; \n }", "public static function findIdentity($id);", "public function get($identifier, array $criteria = array());", "public function retrieveById($identifier) {}", "public function getIdentificacao();", "public static function get_customer_name_using_identity_no($identity_number){\n $name=\"\";\n $conn= DBConnect::getConnection();\n if ($conn->connect_error) {\n echo \"Connection failed: \" . $conn->connect_error;\n }else{\n $sql=\" SELECT name FROM customers where identity_number = $identity_number;\";\n $result=$conn->query($sql);\n if ($result->num_rows ==0 ) { echo\" لا يوجد مستخدم يحمل رقم الهوية هذا \\\"$identity_number\\\" \";}\n else{\n while($row = $result->fetch_assoc()) {\n $name=$row[\"name\"];\n }\n return $name;\n }\n }\n\n }", "function lookForPerson($person){\n return $this->lookForBOCPerson($person);\n }", "public function retrieveById($identifier);", "public function retrieveById($identifier);", "public function retrieveById($identifier);", "abstract public function getByGooglePersonId($googlePersonId);", "function people_getInfo ($user_id) {\n $response = $this->execute(array('method' => 'flickr.people.getInfo', 'user_id' => $user_id));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['person'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function find($identifier);", "public abstract function getIdentifier();", "public function readIdByNumber($pdo){\n $stmt = $pdo->prepare(\"SELECT aid from agent WHERE agentNumber=?\");\n $stmt->execute([$this->getNumber()]);\n $row = $stmt->fetch();\n\n if($row != null) {\n return $row['aid'];\n }else{\n return false;\n }\n \n}", "static function findByIdnumber($idnumber) {\n\n $result = get_record('block_courseprefs_users', 'idnumber', $idnumber);\n\n if (!$result) {\n return null;\n }\n\n return new CoursePrefsUser($result->username, $result->firstname, $result->lastname,\n $result->idnumber, $result->year, $result->college, $result->reg_status, \n $result->classification, $result->keypadid, $result->ferpa, \n $result->degree_candidacy, $result->anonymous, $result->format, \n $result->numsections, $result->hidden, $result->cr_delete, $result->id, \n $result->update_flag, $result->moodleid);\n }", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getIdentifier();", "public function getPersonn()\n {\n return $this->_personn;\n }", "abstract public function getIdentifier();", "function getParty($person){\n\t\t\t\n\t\t\t$name = $person->person->name;\n $tuples = explode(\"[\", $name);\n\t\t\treturn strstr($tuples[1], \"-\", true);\n\t\t}", "function getPersonDetails($id)\r\n\t{\r\n\t\t//build the api request using the key [global variable] and json format, and postcode \r\n\t\tglobal $They_Vote_Key;\r\n\r\n\t\t$url = \t\"https://theyvoteforyou.org.au/api/v1/people/\".$id.\".json\";\r\n\r\n\t\t$data = array('key'=> $They_Vote_Key);\r\n\t\t$GETurl = sprintf(\"%s?%s\", $url, http_build_query($data));\r\n\t\r\n\t\t//translate fullBio into a usable form\r\n\t\t$fullDetails = json_decode(file_get_contents($GETurl));\r\n\t\t\r\n\t\tif(isset($fullDetails->error))\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn $fullDetails;\t\r\n\t}", "function findByusername($n){\r\n \r\n $db = new Database();\r\n \r\n \r\n \r\n \r\n \r\n $connection = $db->getConnnection();\r\n \r\n $stmt = $connection->prepare(\"SELECT idUsers, username, email FROM users WHERE username LIKE ?\");\r\n \r\n if(!$stmt) {\r\n echo \"Something wrong in the binding process. \";\r\n exit;\r\n }\r\n \r\n $like_n = \"%\" . $n . \"%\";\r\n \r\n $stmt->bind_param(\"s\", $like_n);\r\n \r\n $stmt->execute();\r\n \r\n \r\n $stmt->store_result();\r\n \r\n $numRows = $stmt->num_rows;\r\n \r\n \r\n \r\n $stmt->bind_result($id, $username, $email);\r\n \r\n $person_array = array();\r\n \r\n while( $stmt->fetch()){\r\n \r\n \r\n \r\n // create a person object\r\n $p = Array($id, $username, $email);\r\n \r\n // pusha that peron onto the array\r\n \r\n array_push($person_array, $p);\r\n }\r\n return $person_array;\r\n }", "public function getIdpersona()\n {\n return $this->idpersona;\n }", "function getID();", "public function get($info)\n {\n if (is_integer($info)) {\n \n } elseif (is_string($info)) {\n \n } else {\n throw new Exception\\IdentityException(sprintf(\n 'A string-based username or an integer-based user ID is valid'\n ));\n }\n }", "function findAccountByNum($numero){\n $sql = \"SELECT * FROM compte WHERE numero='$numero'\";\n \n global $db;\n\n return $db->query($sql)->fetch();\n }", "function salesperson_select_id($email)\n{\n $conn = db_connect();\n\n // Prepared statement for selecting a salesperson's information from the database\n $salesperson_select_id_stmt = pg_prepare($conn, \"salesperson_select_id_stmt\", \"SELECT * FROM salespeople WHERE email_address = $1\");\n $id = pg_fetch_result(pg_execute($conn, \"salesperson_select_id_stmt\", array($email)), 0, \"id\");\n\n return $id;\n}", "public function show($id)\n {\n $person = $this->personRepo->find($id);\n return $person;\n return $this->sendResponse($person->toArray(), 'Persona encontrada!');\n }", "public function getPersona_id(){\n return $this->persona_id;\n }", "public function getPersona_id(){\n return $this->persona_id;\n }", "public function findExistingPerson(Ticket $ticket, AbstractReader $reader);", "function getPerson($id){\n $sql = \"SELECT * FROM henkilo WHERE idhenkilo = '$id';\";\n $result = execute_query($sql);\n $html_row=\"\";\n if ($result->num_rows > 0) {\n // output data of each row\n while($row = $result->fetch_assoc()) {\n $html_row=$row;\n }\n return $html_row;\n }\n else {\n return \"SQL failure\";\n }\n}", "function getPublicite($identifiant)\r\n{\r\n\tglobal $pdo;\r\n\t\r\n\t$SQL = \"SELECT * FROM pas_publicite WHERE identifiant = '$identifiant'\";\r\n\t$reponse = $pdo->query($SQL);\r\n\t$req = $reponse->fetch();\r\n\t\r\n\treturn $req['code'];\r\n}", "public function findById($primaryKeyValue){\n //Select* From employers Where $this->primaryKey(noemp)=$primaryKeyValue(1000)\n $array = $this->findWhere($this->primaryKey. \"=$primaryKeyValue\");\n if (count($array) != 1 ) die (\"The ID $primaryKeyValue is not valid\");\n return $array[0];\n }", "public function getUserPeopleByIdAction()\n {\n /** @var Object_People $people */\n $data = $this->getRequestData();\n if (isset($data['people_id'])) {\n $people = Object_People::getById($data['people_id']);\n if (!$people) {\n $this->setErrorResponse('no People with this people_id!');\n } elseif ($this->getDeviceSession()->getUserId() != $people->getCreator()->getId()) {\n $this->setErrorResponse('no People for this user with current people_id!');\n }\n }\n\n $this->_helper->json($people);\n }", "public function getByPersonId( $personId ) {\n\t\treturn $this->get( array( \"meta_query\" => array( array( \"key\" => \"walletPersonId\", \"value\" => $personId ) ) ) );\n\t}", "function get(string $id);", "function getId();", "public abstract function getIdentity(array $params);", "function loadByPersonID( $personID )\n {\n $condition = 'person_id='.$personID;\n return $this->loadByCondition( $condition );\n }", "protected function readPerson_galaWithId ($attr)\n\t{\n\t\tglobal $connection;\n\t\ttry\n\t\t{\n\t\t\topenDB();\n\t\t\t$sql = \"SELECT * FROM person_gala WHERE id = :id LIMIT 1;\";\n\t\t\t\n\t\t\t$stmt = $connection->prepare( $sql );\n\t\t\t$stmt->bindValue( \":id\", $attr, PDO::PARAM_STR);\n\t//\t\t\techo $sql . '<br/>';\n\t\t\t$stmt->execute();\n\t\t\t$pinvitationrow = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\t}\n\t\tcatch (PDOException $e) \n\t\t{\n\t\t\t echo 'Connectie (person_gala 2) met de database mislukt: ' . $e->getMessage();\n\t\t\t return FALSE;\n\t\t}\n\t return $pinvitationrow;\t\n\t}", "function getByGuid($id);", "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 }", "static function retrieveOwnerID($pid)\n\t{\n $db = JFactory::getDbo();\n $query = $db->getQuery(true);\n $query->select('agent_id')->from('#__osrs_properties')->where('id = \"'.$pid.'\"');\n $db->setQuery($query);\n return $db->loadResult();\n }", "public function readNameByNumber($pdo){\n $stmt = $pdo->prepare(\"SELECT name from agent WHERE agentNumber=?\");\n $stmt->execute([$this->getNumber()]);\n $row = $stmt->fetch();\n\n if($row != null) {\n return $row['name'];\n }else{\n return false;\n }\n \n}", "public function getRecipient($id);", "public function show($param)\n {\n if (is_numeric($param)) {\n $employer = Employer::where('id', $param)->first();\n return $employer === null ? $this->errorResponse('Does not exists any job with the specified identificator', 404) : $this->showOne($employer);\n } else {\n $employer = Employer::where('slug', $param)->first();\n return $employer === null ? $this->errorResponse('Does not exists any job with the specified identificator', 404) : $this->showOne($employer);\n }\n }", "public function getOne($identifier) {\n\t\t$identifier = is_numeric($identifier) ? ((int) $identifier) : $this -> quote($identifier);\n\t\treturn $this -> get() -> where($this -> _primary . '=' . $identifier) -> queryOne();\n\t}", "public function findByIdentifier($identifier);", "public function findByIdentifier($identifier);", "public static function getPersonIdByUser($user_name) {\r\n $connection = Database::getConnection(); \r\n // set up the query\r\n $id = '';\r\n $query = 'SELECT id FROM `persons` \r\n WHERE user_name=\"'. Database::prep($user_name) .'\" \r\n LIMIT 1';\r\n // Run the MySQL command \r\n $result_obj = ''; \r\n // Run the MySQL command\r\n $result_obj = $connection->query($query); \r\n while($result = $result_obj->fetch_array(MYSQLI_ASSOC)) {\r\n $id = $result['id'];\r\n }\r\n // if user name not found, return false\r\n if (!$id) { // if user name not found, return with error message\r\n return false;\r\n } else {\r\n return $id;\r\n }\r\n }", "public function getPerson($nik){\n\t\t$data = $this->halo_model->getPerson($nik);\n\t\t\n\t\techo json_encode($data->result());\n\t}" ]
[ "0.6535599", "0.6403498", "0.63537335", "0.6346315", "0.6344366", "0.62725645", "0.6128911", "0.6113965", "0.6083623", "0.60691845", "0.60671324", "0.60181475", "0.5973074", "0.5916448", "0.5910586", "0.58945763", "0.58905876", "0.58891404", "0.58780116", "0.58754736", "0.5862937", "0.5839695", "0.5830144", "0.5819094", "0.58098114", "0.5803329", "0.5803329", "0.5801155", "0.57984895", "0.57963854", "0.57852864", "0.5751846", "0.5738753", "0.5730944", "0.57202566", "0.5705109", "0.56975967", "0.56919247", "0.5679028", "0.5678025", "0.5657825", "0.56495184", "0.5648598", "0.56442314", "0.56426716", "0.5641034", "0.5639722", "0.5632952", "0.5632952", "0.5632952", "0.5625701", "0.5622938", "0.56224793", "0.56204253", "0.55768865", "0.5564485", "0.5556626", "0.5556626", "0.5556626", "0.5556626", "0.5556626", "0.5556626", "0.5556626", "0.5556626", "0.5556626", "0.55460995", "0.553403", "0.55252314", "0.5521556", "0.5521258", "0.551654", "0.5502967", "0.54959494", "0.5486469", "0.54847234", "0.54842865", "0.54731846", "0.54731846", "0.5455011", "0.5449806", "0.5440911", "0.5440761", "0.54290146", "0.5423939", "0.54153925", "0.5409678", "0.5399542", "0.53983253", "0.5395642", "0.5392552", "0.5391727", "0.53903896", "0.538118", "0.5377918", "0.5376557", "0.5375335", "0.5374601", "0.5374601", "0.53683937", "0.5361319" ]
0.54874283
73
Gets person by nickname
public function getPersonByNick(string $nick): ?Person;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function people_findByUsername ($username) {\n $response = $this->execute(array('method' => 'flickr.people.findByUsername', 'username' => $username));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['user']['nsid'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "public function getFindPerson()\n\t{\n\t\t$this->_makeRequest(Wp_WhitePages_Model_Api::API_REQUEST_METHOD_FINDPERSON);\n\t\treturn $this->_result;\n\t}", "public function getPerson($nik){\n\t\t$data = $this->halo_model->getPerson($nik);\n\t\t\n\t\techo json_encode($data->result());\n\t}", "protected function getUserFromAccessToken()\n {\n try {\n return $this->api('GET', '/v1/people/~:(id,firstName,lastName,headline)');\n } catch (LinkedInApiException $e) {\n return;\n }\n }", "function people_getInfo ($user_id) {\n $response = $this->execute(array('method' => 'flickr.people.getInfo', 'user_id' => $user_id));\n\t\t$object = unserialize($response);\n\t\tif ($object['stat'] == 'ok') {\n\t\t\treturn $object['person'];\n\t\t} else {\n\t\t\t$this->setError($object['message'], $object['code']);\n\t\t\treturn NULL;\n\t\t}\n\t}", "function ret_nick($nickID) {\n $conn = accessdb();\n $nickname = $conn->prepare('SELECT userid, nickname FROM user WHERE userid = ?'); //Prepare SQL statement to find the Author's nickname from the userid on the post\n $nickname->execute([$nickID]); //Execute the SQL statement\n $nickResult = $nickname->fetch(PDO::FETCH_ASSOC); //Put the statement into an associative array\n $retval = $nickResult['nickname'];\n $conn=null;\n return $retval;\n}", "public function getNicknameByID($userID){\n $userDAO = new UserDAO();\n return $userDAO->getNicknameByIDFromDB($userID);\n }", "function findByusername($n){\r\n \r\n $db = new Database();\r\n \r\n \r\n \r\n \r\n \r\n $connection = $db->getConnnection();\r\n \r\n $stmt = $connection->prepare(\"SELECT idUsers, username, email FROM users WHERE username LIKE ?\");\r\n \r\n if(!$stmt) {\r\n echo \"Something wrong in the binding process. \";\r\n exit;\r\n }\r\n \r\n $like_n = \"%\" . $n . \"%\";\r\n \r\n $stmt->bind_param(\"s\", $like_n);\r\n \r\n $stmt->execute();\r\n \r\n \r\n $stmt->store_result();\r\n \r\n $numRows = $stmt->num_rows;\r\n \r\n \r\n \r\n $stmt->bind_result($id, $username, $email);\r\n \r\n $person_array = array();\r\n \r\n while( $stmt->fetch()){\r\n \r\n \r\n \r\n // create a person object\r\n $p = Array($id, $username, $email);\r\n \r\n // pusha that peron onto the array\r\n \r\n array_push($person_array, $p);\r\n }\r\n return $person_array;\r\n }", "function nickname() {\n if (empty($this->nick_name)) {\n if ($this->page[\"Bio\"] == \"\") $this->openpage (\"Bio\",\"person\");\n if (preg_match(\"/Nickname<\\/h5>\\s*\\n(.*?)\\n<h5>/ms\",$this->page[\"Bio\"],$match)) {\n $nicks = explode(\"<br/>\",$match[1]);\n foreach ($nicks as $nick) {\n $nick = trim($nick);\n if (!empty($nick)) $this->nick_name[] = $nick;\n }\n }\n }\n return $this->nick_name;\n }", "public function getNickname() //geter leo la informacion\n\n {\n return $this->nickname;\n }", "static function searchUserByName() : string\n {\n return \"SELECT *\n FROM users\n WHERE LOCATE( :Name , nickname) > 0;\";\n }", "public function getNickname()\n {\n return $this->nickname;\n }", "public function getNickname()\n {\n return $this->nickname;\n }", "public function getNickname()\n {\n return $this->nickname;\n }", "public function getNickname()\n {\n return $this->nickname;\n }", "public function getNickname()\n {\n return $this->nickname;\n }", "public function getMe()\n {\n return $this->players[$this->myId];\n }", "public function findPersonByName($name)\n {\n $pgw = $this->di['personGateway'];\n return $pgw->findByName($name);\n }", "public function findPerson()\n {\n\n // AITS EnterpriseUser API Source\n if($this->dev) {\n\n $source = 'https://webservices-dev.admin.uillinois.edu/xfunctionalWS/data/' . $this->senderAppID . '/EnterpriseUser/1_1/' . $this->netid . '/' . $this->domain;\n\n } else {\n\n $source = 'https://webservices.admin.uillinois.edu/xfunctionalWS/data/' . $this->senderAppID . '/EnterpriseUser/1_1/' . $this->netid . '/' . $this->domain;\n\n }\n\n // Initialize a curl resource\n $curl = curl_init();\n\n // Set curl options\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($curl, CURLOPT_URL, $source);\n curl_setopt($curl, CURLOPT_HTTPHEADER, array());\n\n // JSON Response\n $response = curl_exec($curl);\n\n if(curl_getinfo($curl, CURLINFO_HTTP_CODE) == 200) {\n\n // Cache the response in $this->response\n $this->response = new \\stdClass();\n $this->response->type = 'JSON';\n $this->response->data = $response;\n\n // Set the UIN\n $this->uin = $this->findUIN($response);\n\n } else {\n\n throw new \\Exception($response);\n\n }\n\n }", "public function findUserName($peerID)\n\t{\n\t\t$result = mysql_query(\"SELECT * FROM dragoni6_penfightdb.playerstable WHERE peerID='$peerID'\");\n\t\t$row = mysql_fetch_object($result);\n\t\treturn $row;\n\t}", "function fetch_user_by_nick($nick) {\n if(!cache_isset('taxi_!un_'.$nick)) {\n if(cache_isset('taxi_un_'.$nick)) {\n return fetch_user_by_id(cache_get('taxi_un_'.$nick));\n } else {\n global $DB;\n connect_db();\n $result=$DB->users->findOne(['nick'=>$nick]);\n if(is_array($result)) {\n cache_set('taxi_uid_'.$result['id'],$result);\n cache_set('taxi_un_'.$result['nick'],$result['id']);\n } else {\n cache_set('taxi_!un_'.$nick);\n }\n return $result;\n }\n }\n}", "public function getNickname()\n {\n return $this->_nickname;\n }", "function get_user_by_username($username) {\n $read_json = file_get_contents(__DIR__ . '/data_users.json');\n $data = json_decode($read_json, JSON_OBJECT_AS_ARRAY);\n\n // iterate over db, if username is found, return user\n foreach ($data as $user){\n if ($user[\"username\"] == $username){\n return $user;\n }\n }\n return false;\n}", "public function person() {\n $personId = $_REQUEST['id'];\n $person = $this->tmdb->getPerson($personId);\n $imageUrl = $this->tmdb->getImageUrl($person['profile_path'], TMDb::IMAGE_PROFILE, 'w185');\n //$images = $this->tmdb->getPersonImages($personId);\n $credits = $this->tmdb->getPersonCredits($personId);\n $map = array('person' => $person, 'imageUrl' => $imageUrl, 'credits' => $credits);\n $this->reply($map);\n }", "public function getPerson() {\n return $this->getPersoner()->getSingle();\n }", "public function getNickname() {\n return $this->nickname;\n }", "public function getNickname(): string {\n return $this->nickname;\n }", "protected function person()\n {\n try {\n return Person::findOrFail($this->authorizationServer->getResourceOwnerId());\n } catch (ModelNotFoundException $e) {\n throw new PersonNotFoundException;\n }\n }", "function getPlayerNick($login, $forcequery = false) {\n\n\t\tif (isset($this->server->players->player_list[$login]) &&\n\t\t $this->server->players->player_list[$login]->nickname != '' && !$forcequery) {\n\t\t\t$rtn = $this->server->players->player_list[$login]->nickname;\n\t\t} else {\n\t\t\t$query = 'SELECT NickName FROM players\n\t\t\t WHERE Login=' . quotedString($login);\n\t\t\t$result = mysql_query($query);\n\t\t\tif (mysql_num_rows($result) > 0) {\n\t\t\t\t$row = mysql_fetch_row($result);\n\t\t\t\t$rtn = $row[0];\n\t\t\t} else {\n\t\t\t\t$rtn = '';\n\t\t\t}\n\t\t\tmysql_free_result($result);\n\t\t}\n\t\treturn $rtn;\n\t}", "function getUser(Login $login);", "public function getUserWithUsername($username);", "public function getUsername($id);", "public function findPersonAction()\n {\n $email = $this->params()->fromQuery('email');\n $hat = $this->params()->fromQuery('hat');\n if (! $email or ! $hat) {\n return new JsonModel([\n 'status' => 'error',\n 'valid' => false,\n 'message' => 'missing parameters',\n ]);\n }\n\n $validator = new \\Laminas\\Validator\\EmailAddress();\n $valid = $validator->isValid($email);\n if (! $valid) {\n return new JsonModel([\n 'status' => 'error',\n 'valid' => false,\n 'message' => 'invalid email address',\n ]);\n }\n // try to locate the person by email address\n $repo = $this->entityManager\n ->getRepository('InterpretersOffice\\Entity\\Person');\n $people = $repo->findPersonByEmail($email);\n return new JsonModel([\n 'valid' => true,\n 'status' => 'success',\n 'result' => $people,\n ]);\n }", "public function getUserByName($name) {\n\t\treturn $this->executeMethod('twitter.users.getUserByName', array(\n\t\t\t'name' => $name,\n\t\t))->getUser();\n\t}", "public function get_member_from_username($name)\n {\n return $this->connection->query_select_value_if_there('users', 'uid', array('username' => $name));\n }", "function getFirstName() {\n\t$COMMON = new Common($debug);\n\t$uID = $_SESSION[\"userID\"];\n\n\t$sql = \"select * from Proj2Advisors where `id` = '$uID'\";\n\t$rs = $COMMON->executeQuery($sql, $_SERVER[\"SCRIPT_NAME\"]);\n\t$row = mysql_fetch_row($rs);\n\n\t$name = $row[1];\n\treturn $name;\n}", "function getuid_nick($nick)\n{\n $uid = mysql_fetch_array(mysql_query(\"SELECT id FROM ibwf_users WHERE name='\".$nick.\"'\"));\n return $uid[0];\n}", "function lookupUser($username)\n { \n try {\n $connection = Doctrine_Manager::connection();\n $query = \"SELECT username, access_token FROM constant_contact WHERE username='\".$username.\"' ORDER BY id DESC LIMIT 1\";\n $statement = $connection->execute($query);\n $statement->execute();\n\n $resultset = $statement->fetch(PDO::FETCH_OBJ);\n \n if (empty($resultset)) {\n $returnUser = false;\n throw new Exception('Username '.$username.' not found in datastore');\n }\n else {\n $fields = array();\n foreach ($resultset as $k => $v) $fields[$k] = $v;\n $returnUser = $fields;\n }\n\n }\n catch(Exception $e) {\n echo 'OAuth Exception: '.$e->getMessage();\n }\n return $returnUser;\n }", "public function getUserByLogin(string $login);", "public function getNickname()\n {\n return $this->attributes['nickname'] ?? null;\n }", "function UserLastName($uid) {\n\t$uidarray = array('uid'=>new MongoId($uid));\n\t$uresult = FindOneInCollection('UserInfo', $uidarray);\nreturn $uresult['last_name'];\t\t\t\n}", "public static function getPerson($id) {\n\t\t$person = self::with('whimseys', 'socials')->find($id);\n\t\treturn $person;\n\t}", "function getnick_uid($uid)\n{\n $unick = mysql_fetch_array(mysql_query(\"SELECT name FROM ibwf_users WHERE id='\".$uid.\"'\"));\n return $unick[0];\n}", "function nombre($username){\n\t\t$conexion = mysqli_connect(\"localhost\", \"root\", \"\", \"b14_22049034_curriculum\");\n\t\t//$conexion = mysqli_connect(\"sql306.byethost.com\", \"b14_22049034\", \"kvr1vm\", \"b14_22049034_curriculum\");\n\t\t$sql = \"SELECT * FROM profesor WHERE username = '$username'\";\n\t\t$resultado = mysqli_query($conexion, $sql);\n\t\t$persona = mysqli_fetch_array($resultado);\n\t\techo $persona['nombre'].\" \".$persona['apellidoP'].\" \".$persona['apellidoM'];\n\t}", "function getUserName() {\n\t\treturn $this->nickname;\n\t\t/*\n\t\tif(!$this->user_name) {\n\t\t\t$this->sql(\"SELECT nickname FROM \".UT_USE.\" WHERE id = \".$this->user_id);\n\t\t\t$this->user_name = $this->getQueryResult(0, \"nickname\");\n \t\t}\n\t\treturn $this->user_name;\n\t\t*/\n\t}", "private function getUser($name) {\n\t\t$i = 0;\n\t\t\n\t\tforeach ( $this->configuration->getElement ( \"system\" )->users [0] as $user ) {\n\t\t\tif ($user->getName () == 'user' && strcasecmp ( $user ['name'], $name ) == 0) {\n\t\t\t\treturn $user;\n\t\t\t} elseif ($user->getName () == 'user') {\n\t\t\t\t$i ++; // count the users.\n\t\t\t}\n\t\t}\n\t\t\n\t\t//If no users exist, get the default user\n\t\tif ($i == 0) {\n\t\t\t$user = $this->configuration->getElement ( \"system\" )->users [0]->{'default-user'} [0];\n\t\t\tif (strcasecmp ( $user ['name'], $name ) == 0) {\n\t\t\t\treturn $user;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn null; // user not found.\n\t}", "public function getByName(string $name): User;", "function select_people($conn, $id) {\n\t$name = \"\";\n\t$sql = \"SELECT * FROM People WHERE People_ID = '$id'\";\n\t$result = mysqli_query($conn, $sql);\n\t// happen to have one match, i.e. one unique corrosponding person\n\tif (mysqli_num_rows($result)== 1){\n\t\t$row = mysqli_fetch_assoc($result);\n\t\t$name = $row[\"People_Name\"];\n\t}\n\treturn $name;\n}", "function getUserByUsername($username, $users)\n {\n foreach ($users as $user)\n {\n if ($user['username'] == $username)\n {\n return $user;\n }\n }\n return NULL;\n }", "public function getUsername()\n {\n return $this->getNickname();\n }", "public function retrieve($username);", "function findName($firstName,$nickName) {\n if($nickName === \"\") {\n $answer = $firstName;\n } else {\n// otherwise, return nickName\n $answer = $nickName;\n }\n return $answer;\n}", "public static function GetByUserName ($userName);", "public function getPersonByID($id) {\n\t\tglobal $db;\n\n\t\t$person = $db->query(\"SELECT * FROM person WHERE id=$id\");\n\t\treturn $person[0];\n\t}", "static function existsNickName() : string\n {\n return \" SELECT *\n FROM users\n WHERE nickname = :value ;\";\n }", "function personne($id){\r\n\t\treturn mysql_fetch_assoc(mysql_query(\"SELECT * FROM personnes WHERE id='$id'\"));\r\n\t}", "function getUserInfo(){\n\n\t\t/* Fetch user info from Flickr */\n\t\t$user = $this->askFlickr('people.getinfo','user_id='.$this->user);\n\n\t\t/* Return User info */\n\t\treturn $user;\n\t}", "public function getPerson($id=null)\n {\n $app = \\Cobalt\\Container::get('app');\n $id = $id ? $id : $app->input->get('id');\n\n if ($id > 0) {\n\n $db = JFactory::getDBO();\n //generate query\n //\n $query = $db->getQuery(true);\n $query->select('p.*,c.name as company_name,stat.name as status_name,\n source.name as source_name, owner.name as owner_name, crmery_user.first_name AS owner_first_name, crmery_user.last_name AS owner_last_name');\n $query->from('#__people AS p');\n $query->leftJoin('#__companies AS c ON c.id = p.company_id AND c.published>0');\n $query->leftJoin('#__people_status AS stat ON stat.id = p.status_id');\n $query->leftJoin('#__sources AS source ON source.id = p.source_id');\n $query->leftJoin('#__users AS owner ON p.owner_id = owner.id');\n $query->leftJoin(\"#__users AS crmery_user ON crmery_user.id = p.owner_id\");\n\n //searching for specific person\n $query->where(\"p.published=\".$this->published);\n $query->where(\"p.id='\".$id.\"'\");\n\n //run query and grab results\n $db->setQuery($query);\n $person = $db->loadAssoc();\n\n /* Deals */\n $dealModel = new CobaltModelDeal();\n $dealModel->set('person_id',$person['id']);\n $person['deals'] = $dealModel->getDeals();;\n\n /* Notes */\n $notesModel = new CobaltModelNote();\n $person['notes'] = $notesModel->getNotes($person['id'],'person');\n\n /* Docs */\n $docsModel = new CobaltModelDocument();\n $docsModel->set('person_id',$person['id']);\n $person['documents'] = $docsModel->getDocuments();\n\n /* Tweets */\n if ($person['twitter_user']!=\"\" && $person['twitter_user']!=\" \") {\n $person['tweets'] = TweetsHelper::getTweets($person['twitter_user']);\n }\n\n $this->person = $person;\n\n } else {\n\n //TODO update things to OBJECTS\n $person = (array) new PeopleTable;\n $this->person = $person;\n\n }\n\n $app->triggerEvent('onPersonLoad', array(&$person));\n\n return $person;\n }", "public function userNome($idu){\r\n $idu = self::$conn->real_escape_string($idu);\r\n $query = \"SELECT nome FROM \".$this->tables['utentetable'].\r\n \" WHERE nickname='$idu'\";\r\n\t\t$result = self::$conn->query($query);\r\n if($result){\r\n $row = $result->fetch_array(MYSQLI_NUM);\r\n return $row[0];\r\n }\r\n return '';\r\n }", "public function GetByUsername($username);", "function get_the_author_nickname()\n {\n }", "public function get_user_by_concat_name($name_lastname){\n $query = $this->db->query(\"\n SELECT k_id_user\n FROM \n user \n WHERE CONCAT_WS(' ', n_name_user, n_last_name_user) \n LIKE '%$name_lastname';\n \");\n return $query->row();\n }", "function get_person($person_id)\n {\n return $this->db->get_where('person',array('person_id'=>$person_id))->row_array();\n }", "public function getUsersName(){\n //Get the Id\n $userId = $_GET[\"userId\"];\n //Gets the users name \n $usersName = $this->individualGroupModel->getTheUsersName($userId); \n //echos out a created users name given the first and last name\n echo $usersName->User_First_Name . \" \" . $usersName->User_Last_Name;\n }", "function lookForPerson($person){\n return $this->lookForBOCPerson($person);\n }", "public function getUserWithId($id){\r\n\r\n\t\t$sql = \"Select * from users where id = ?\";\r\n\t\t$query = $this->db->prepare($sql);\r\n\t\t$query->execute([$id]);\r\n\r\n\t\t$postOwner = $query->fetch(PDO::FETCH_OBJ);\r\n\t\treturn $postOwner;\r\n\t}", "function get_profile_lname($lname){\r\n\t\r\n}", "function getUsersLastNameLike($in){\r\n $data=new \\Cars\\Data\\Common($this->app);\r\n return $data->getUsersByLastNameInit($in);\r\n\r\n }", "public static function getMemberName($id){\n\t\t$db = DemoDB::getConnection();\n $sql = \"SELECT first_name,last_name\n FROM member\n WHERE id = :id\";\n $stmt = $db->prepare($sql);\n $stmt->bindValue(\":id\", $id);\n $ok = $stmt->execute();\n if ($ok) {\n return $stmt->fetch(PDO::FETCH_ASSOC);\n }\n\t}", "public function retrieveByUsername($username);", "public function getGivenName ();", "public function findByPlayer($name);", "public function getPerson($first_name, $last_name)\r\n {\r\n if (empty(trim($first_name)) || empty(trim($first_name))) {\r\n return false;\r\n } else {\r\n $persons = array_values(array_filter($this->persons, function ($person) use ($first_name, $last_name) {\r\n return $person->getFirstName() == $first_name && $person->getLastName() == $last_name;\r\n }));\r\n if (count($persons) == 1) {\r\n return $persons[0];\r\n } else {\r\n return false;\r\n }\r\n }\r\n }", "public function getUserOrProperName()\n {\n $person = $this->getPerson();\n if (strtolower($person->getEmail()) != strtolower($this->username)) {\n return $this->username;\n } else {\n $init = substr($person->getFirstname(), 0, 1);\n return \"{$init}. {$person->getLastname()}\";\n }\n }", "public function getMe()\n {\n return $this->_execute('/user/', self::METHOD_GET);\n }", "public static function getNickname() {\n if ( !isset($_SESSION['user']['nickname']) \n || empty($_SESSION['user']['nickname']) ) {\n return \"Anonym\";\n }\n return $_SESSION['user']['nickname'];\n }", "private function /*bool*/ findUsername(/*string*/ $name) {\n\t\t$variations = array(\n\t\t\t$name,\n\t\t\tstrtolower($name[0]) . substr($name, 1),\n\t\t\tstr_replace(\" \", \"_\", $name),\n\t\t);\n\n\t\t$crowd = $this->getCrowd();\n\t\tforeach ($variations as $v) {\n\t\t\ttry {\n\t\t\t\t$crowd->findPrincipalByName(array(\"in0\" => $this->token, \"in1\" => $v));\n\t\t\t\treturn $v;\n\t\t\t} catch (Exception $e) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "public function getUsername(): string\n {\n return (string) $this->nickname;\n }", "function getfname($usern){\r\n\r\n\tglobal $conn;\r\n\r\n\t$q = \"SELECT * FROM users WHERE username='\".$usern.\"' \";\r\n\r\n\t$result = mysql_query($q,$conn);\r\n\r\n\t$row=mysql_fetch_array($result);\r\n\r\n\treturn $row['first_name'];\r\n\r\n}", "public function getUsername();", "public function getUsername();", "public function getUsername();", "public function getUsername();", "public function getUsername();", "function getlname($usern){\r\n\r\n\tglobal $conn;\r\n\r\n\t$q = \"SELECT * FROM users WHERE username='\".$usern.\"' \";\r\n\r\n\t$result = mysql_query($q,$conn);\r\n\r\n\t$row=mysql_fetch_array($result);\r\n\r\n\treturn $row['last_name'];\r\n\r\n}", "function UserFirstName($uid) {\n\t$uidarray = array('uid'=>new MongoId($uid));\n\t$uresult = FindOneInCollection('UserInfo', $uidarray);\nreturn $uresult['first_name'];\t\t\t\n}", "public function getUsername($id) \n {\n return $this->usernameGet($id);\n }", "protected static function get_nickname($name) {\n if (preg_match(\"/[\\(|\\\"].*?[\\)|\\\"]/\", $name, $matches)) {\n return $matches[0];\n }\n return false;\n }", "public function getProfile($userid);", "public function getHonoreeFirstName();", "function master_user_name($nick)\n{\n // LOGINFIXME: Do this query through the proper API\n return \"unknown\";\n $magic_cookie = (!empty($_COOKIE['MAGIC_COOKIE'])) ?\n $_COOKIE['MAGIC_COOKIE'] :\n '' ; // need a generic key here!!\n\n if (!$fp = @fsockopen('master.php.net', 80))\n return $nick;\n\n fputs($fp, \"GET /manage/users.php?username=$nick HTTP/1.0\\r\\n\".\n \"Host: master.php.net\\r\\n\".\n \"Cookie: MAGIC_COOKIE=$magic_cookie\\r\\n\".\n \"\\r\\n\");\n\n $txt = @fread($fp, 50000);\n fclose($fp);\n\n // if we found a name, cache it in the DB\n if (preg_match('@<th[^>]+>Name:</th>\\s+<td><input[^>]+value=\"([^\"]+)\"@', $txt, $match)) {\n sqlite_query($GLOBALS['idx'], \"INSERT INTO users (username, name) VALUES ('$nick', '$match[1]')\"); //the server has no sqlite_exec support yet (still php4)\n return $match[1];\n }\n\n return $nick;\n}", "public function getUser($surname, $firstname)\n {\n return self::getModel(\"users WHERE firstname = '$firstname' AND surname = '$surname'\", \"*\");\n }", "public function getHonoreeLastName();", "function get_third_person($id){\n\t\t\t$str= \"SELECT name FROM mgl_fair_person_detail where transaction_id=$id\";\t\n\t\t\t$rs=mysql_query($str);\n\t\t\t$row=mysql_fetch_array($rs);\n\t\t\treturn $row['name'];\n\t\t}", "public function getNickname(): ?string\n {\n return $this->_nickname;\n }", "function FindUser($User) {\n $User = str_replace('ZZ ', '', $User);\n\n //separa o primeiro nome do sobrenome\n $name_complete = explode(' ', $User);\n $user_name = array_shift($name_complete);\n $user_lastname = implode(' ', $name_complete);\n\n $Read = new WsUsers();\n\n $Read->setUser_name($user_name);\n $Read->setUser_lastname($user_lastname);\n $Result = $Read->Execute()->Query(\"user_name like '%{$user_name}%' AND user_lastname like '%{$user_lastname}%'\");\n\n if (!empty($Result)):\n return $Result[0]->user_id;\n endif;\n}", "function Obtenernameuser($identificador){\n\n\tglobal $database_softPark, $softPark, $mysqli;\n\t#mysql_select_db($database_softPark, $softPark);\n\t$query_consultafuncion = sprintf(\"SELECT users.FirstName FROM users WHERE Id= %s\",$identificador);\n\t$consultafuncion = $mysqli->query($query_consultafuncion) or die(mysqli_error());\n\t$row_consultafuncion = $consultafuncion->fetch_assoc();\n\t#$totalRows_consultafuncion = $row_consultafuncion->num_rows;\n\treturn $row_consultafuncion['FirstName']; \n\tmysqli_free_result($consultafuncion);\n}", "public function getNick(): string\n {\n return $this->nick;\n }", "public function utenteNome($idu){\r\n $idu = self::$conn->real_escape_string($idu);\r\n $query = \"SELECT nome FROM \".$this->tables['utentetable'].\r\n \" WHERE nickname='$idu'\";\r\n\t\t$result = self::$conn->query($query);\r\n if(!$result || $result->num_rows != 1)\r\n return ''; \r\n $row = $result->fetch_array(MYSQLI_NUM);\r\n return $row[0];\r\n }", "function memberByUsername($username)\r\n {\r\n $select = 'SELECT member_id, username, firstname, lastname, email, password, image FROM atlas_members WHERE username=:username';\r\n \r\n $statement = $this->_pdo->prepare($select);\r\n $statement->bindValue(':username', $username, PDO::PARAM_INT);\r\n \r\n \r\n $statement->execute();\r\n \r\n return $statement->fetch(PDO::FETCH_ASSOC);\r\n }" ]
[ "0.6406432", "0.62485933", "0.6065081", "0.6038427", "0.6017064", "0.6014015", "0.5981655", "0.59593564", "0.5944888", "0.59309214", "0.58845174", "0.5850759", "0.5850759", "0.5850759", "0.5850759", "0.5850759", "0.5842141", "0.5810166", "0.5807012", "0.5785411", "0.5774685", "0.5774184", "0.57730365", "0.57606906", "0.5746834", "0.57430404", "0.57418036", "0.57370704", "0.5707024", "0.5700909", "0.5696745", "0.56951797", "0.56687945", "0.5664509", "0.5653771", "0.5650579", "0.56505096", "0.5644041", "0.56283396", "0.562125", "0.56112236", "0.5595212", "0.5585581", "0.5569203", "0.55538505", "0.55422837", "0.55413795", "0.5540998", "0.5535378", "0.5516858", "0.551647", "0.5512111", "0.5511471", "0.5510194", "0.54978424", "0.54950964", "0.54896677", "0.5487577", "0.5484404", "0.5468866", "0.5451786", "0.5432315", "0.54294235", "0.5427116", "0.5419943", "0.5395975", "0.53938234", "0.53863335", "0.5385229", "0.53839475", "0.53810227", "0.53805625", "0.53683686", "0.536204", "0.53558266", "0.5349389", "0.53463805", "0.5344408", "0.5343871", "0.5341814", "0.5341814", "0.5341814", "0.5341814", "0.5341814", "0.533591", "0.5334609", "0.5327243", "0.5320553", "0.53164166", "0.5311187", "0.53097236", "0.5308333", "0.530623", "0.52974397", "0.5292872", "0.52781516", "0.5277535", "0.5263096", "0.526149", "0.52612317" ]
0.72174025
0
Adds a new person
public function addPerson( string $nick, string $passwordHash, string $email, string $firstName, string $lastName, string $birth ): void;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addPerson(){\n\t\t \n\t\t $this->getMakeMetadata();\n\t\t $changesMade = false;\n\t\t $requestParams = $this->requestParams;\n\t\t if(isset($requestParams[\"uuid\"]) && isset($requestParams[\"role\"])){\n\t\t\t\t\n\t\t\t\t$personUUID = trim($requestParams[\"uuid\"]);\n\t\t\t\t$uri = self::personBaseURI.$personUUID;\n\t\t\t\t\n\t\t\t\tif(isset($requestParams[\"rank\"])){\n\t\t\t\t\t $rank = $requestParams[\"rank\"];\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t $rank = false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$pObj = new dbXML_dbPerson;\n\t\t\t\t$pObj->initialize();\n\t\t\t\t$pObj->dbPenelope = true;\n\t\t\t\t$pFound = $pObj->getByID($personUUID);\n\t\t\t\tif($pFound){\n\t\t\t\t\t $name = $pObj->label;\n\t\t\t\t\t if($requestParams[\"role\"] == \"creator\"){\n\t\t\t\t\t\t $persons = $this->rawCreators;\n\t\t\t\t\t\t $persons = $this->addPersonRank($persons, $name, $uri, $rank);\n\t\t\t\t\t\t $this->rawCreators = $persons;\n\t\t\t\t\t\t $changesMade = true;\n\t\t\t\t\t }\n\t\t\t\t\t elseif($requestParams[\"role\"] == \"contributor\"){\n\t\t\t\t\t\t $persons = $this->rawContributors;\n\t\t\t\t\t\t $persons = $this->addPersonRank($persons, $name, $uri, $rank);\n\t\t\t\t\t\t $this->rawContributors = $persons;\n\t\t\t\t\t\t $changesMade = true;\n\t\t\t\t\t }\n\t\t\t\t\t elseif($requestParams[\"role\"] == \"person\"){\n\t\t\t\t\t\t $persons = $this->rawLinkedPersons;\n\t\t\t\t\t\t $persons = $this->addPersonRank($persons, $name, $uri, $rank);\n\t\t\t\t\t\t $this->rawLinkedPersons = $persons;\n\t\t\t\t\t\t $changesMade = true;\n\t\t\t\t\t }\n\t\t\t\t\t else{\n\t\t\t\t\t\t \n\t\t\t\t\t }\n\t\t\t\t}\n\t\t }\n\t\t \n\t\t if($changesMade){\n\t\t\t\t$this->saveMetadata(); //save the results\n\t\t }\n\t\t return $changesMade;\n\t }", "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_post(){\n $response = $this->PersonM->add_person(\n $this->post('name'),\n $this->post('hp'),\n $this->post('email'),\n $this->post('message')\n );\n $this->response($response);\n }", "function _add_user()\n {\n if (!$this->has_arg('PROJECTID'))\n $this->_error('No project id specified');\n if (!$this->has_arg('PERSONID'))\n $this->_error('No user specified');\n\n $proj = $this->db->pq(\"SELECT p.projectid FROM project p WHERE p.personid LIKE :1 AND p.projectid=:2\", array($this->user->personId, $this->arg('PROJECTID')));\n\n if (!sizeof($proj))\n $this->_error('No such project');\n $proj = $proj[0];\n\n $person = $this->db->pq(\"SELECT CONCAT(CONCAT(givenname, ' '), familyname) as fullname FROM person WHERE personid=:1\", array($this->arg('PERSONID')));\n if (!sizeof($person))\n $this->_error('No such person');\n $person = $person[0];\n\n $this->db->pq(\"INSERT INTO project_has_person (projectid, personid) VALUES (:1, :2)\", array($this->arg('PROJECTID'), $this->arg('PERSONID')));\n\n $this->_output(array('FULLNAME' => $person['FULLNAME']));\n }", "public function add() {\n\n\t\tif(isset($_POST['name']) && isset($_POST['age']) && $_POST['phoneNumber']) {\n\n\t\t\t$name = $_POST['name'];\n\t\t\t$age = $_POST['age'];\n\t\t\t$phoneNumber = $_POST['phoneNumber'];\n\n\t\t\t$results = Person::add($name, $age, $phoneNumber);\n\n\t\t\techo json_encode(array_merge($this->response, $results));\n\t\t} else {\n\t\t\techo json_encode(array_merge($this->response, array('error' => 1, 'message' => 'Please provide all request')));\n\t\t}\n\t}", "public function addNewPersonToCity()\n {\n }", "public function add($name);", "function firstentity_addperson($form , &$form_state , $personality) {\n $form['name'] = array(\n '#type' => 'textfield',\n '#title' => 'name'\n );\n\n $person = new stdClass();\n $person->personality = $personality;\n $person->id = 0;\n\n $form['person'] = array(\n '#type' => 'value',\n '#value' => $person\n );\n // validations requires is element\n $form['personality'] = array(\n '#type' => 'value',\n '#value' => $personality\n );\n // attach form elements for attached fields\n field_attach_form( 'person' , $person , $form , $form_state );\n \n $form['actions'] = array('#type' => 'actions');\n $form['actions']['add'] = array(\n '#type' => 'submit',\n '#value' => 'add'\n );\n return $form;\n}", "public static function addPerson(array $form, FormStateInterface $form_state) {\n $form_state->set('num_persons', $form_state->get('num_persons') + 1);\n $form_state->setRebuild();\n }", "public function addPerson($first_name, $last_name)\r\n {\r\n $person = $this->getPerson($first_name, $last_name);\r\n if ($person instanceof Person) {\r\n return $person;\r\n } else {\r\n $person = new Person($this, $first_name, $last_name);\r\n $this->persons[] = $person;\r\n return $person;\r\n }\r\n }", "public function add_personnel()\n\t{\n\t\t$data = array(\n\t\t\t'personnel_onames'=>ucwords(strtolower($this->input->post('personnel_onames'))),\n\t\t\t'personnel_fname'=>ucwords(strtolower($this->input->post('personnel_fname'))),\n\t\t\t'personnel_phone'=>$this->input->post('personnel_phone'),\n\t\t\t'personnel_password'=> md5($this->input->post('personnel_password'))\n\t\t);\n\t\t\n\t\tif($this->db->insert('personnel', $data))\n\t\t{\n\t\t\treturn $this->db->insert_id();\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function hire(Person $person)\r\n {\r\n $this->staff->add($person);\r\n\r\n }", "function createPerson($first_name, $last_name, $birth_date) {\n $person = new Person($first_name, $last_name, $birth_date);\n $this->persons[] = $person;\n return $person;\n }", "public static function add($firstName, $lastName, $email, $password) {\n $mysqli = Database::getMYSQLI();\n \n $stmt = $mysqli->prepare(\"\n INSERT INTO indPrj_persons (firstName, lastName, email, password)\n VALUES (?,?,?,?)\");\n \n $stmt->bind_param('ssss', $firstName, $lastName, $email, $password);\n \n $stmt->execute();\n $stmt->close();\n $mysqli->close();\n }", "public function addperson ($id, $name, $lastname){\n $query = \"INSERT INTO alumno VALUES (?,?,?);\";\n $new = $this->mysqli->prepare($query);\n $new->bind_param('iss', $id, $name, $lastname);\n $result = $new->execute();\n $new->close();\n return $result;\n }", "public function add();", "public function add();", "public function insert(Persona $persona);", "public function addIndividual()\n {\n }", "public function addUser(){}", "public function add()\n\t{\n\t\t// TODO\n\t\t// if(user has permissions){}\n\t\t$this -> loadModel('User');\n\t\tif($this -> request -> is('post') && !$this -> User -> exists($this -> request -> data['SgaPerson']['user_id']))\n\t\t{\n\t\t\t$this -> Session -> setFlash(\"Please select a valid JacketPages user to add.\");\n\t\t\t$this -> redirect(array('action' => 'index',$id));\n\t\t}\n\t\t$this -> loadModel('User');\n\t\tif ($this -> request -> is('post'))\n\t\t{\n\t\t\t$this -> SgaPerson -> create();\n\t\t\tif ($this -> SgaPerson -> save($this -> data))\n\t\t\t{\n\t\t\t\t$user = $this -> User -> read(null, $this -> data['SgaPerson']['user_id']);\n\t\t\t\t$this -> User -> set('level', 'sga_user');\n\t\t\t\t$this -> User -> set('sga_id', $this -> SgaPerson -> getInsertID());\n\t\t\t\t$this -> User -> save();\n\t\t\t\t$this -> Session -> setFlash(__('The user has been added to SGA.', true));\n\t\t\t\t$this -> redirect(array('action' => 'index'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this -> Session -> setFlash(__('Invalid user. User may already be assigned a role in SGA. Please try again.', true));\n\t\t\t}\n\t\t}\n\t}", "function create_person($personRec = \"\", $personID = \"\")\n\t{\n\t\t//throw new exception(\"create_person - this function is not implemented\");\n\n\t}", "public function hire(Person $person)\n\t{\n\t\t$this->staff->add($person);\n\t}", "function insertObject(&$person) {\n\t\t$this->update(\n\t\t\t'INSERT INTO object_for_review_persons\n\t\t\t\t(object_id, seq, role, first_name, middle_name, last_name)\n\t\t\t\tVALUES\n\t\t\t\t(?, ?, ?, ?, ?, ?)',\n\t\t\tarray(\n\t\t\t\t(int) $person->getObjectId(),\n\t\t\t\t(float) $person->getSequence(),\n\t\t\t\t$person->getRole(),\n\t\t\t\t$person->getFirstName(),\n\t\t\t\t$person->getMiddleName() . '', // make non-null\n\t\t\t\t$person->getLastName()\n\t\t\t)\n\t\t);\n\t\t$person->setId($this->getInsertId());\n\t\treturn $person->getId();\n\t}", "public function addAction() {\r\n\t\tif ($this->request->isPost ()) {\r\n\t\t\t$user = new Users ();\r\n\t\t\t$user->firstname = $this->request->get ( \"first_name\" );\r\n\t\t\t$user->lastname = $this->request->get ( \"last_name\" );\r\n\t\t\t$user->bithday = $this->request->get ( \"date\" );\r\n\t\t\t$user->save ();\r\n\t\t}\r\n\t}", "public function add($team);", "public function addNursing(Person $person)\n {\n $db = PDOController::getInstance();\n $req = $db->prepare('INSERT INTO persons(email,code,lastname,firstname,role)\n VALUES\n (?,?,?,?,?)');\n $req->execute([\n $person->getEmail(),\n $person->getCode(),\n $person->getLastName(),\n $person->getFirstName(),\n $person->getRole(),\n ]);\n return $req->fetch();\n }", "public function add($pid = null) {\n\t\t\n if ($this->request->is('post')) {\n $this->Organization->create();\n\t\t\t// Use saveAll will save Organization info and relation id to association table.\n if ($this->Organization->saveAll($this->request->data)) {\n $this->Session->setFlash(__('Organization has been saved.'));\n\t\t\t\t//once save, bring user go to contact person list.\n $this->redirect(array('controller' => 'persons', 'action' => 'view',$pid));\n } else {\n $this->Session->setFlash(__('Unable to add organization.'));\n }\n }\n\t\t\n\t\t//pass contact person's id to Organization add View\n\t\t$this->set('personid',$pid);\n }", "public function store(CreatePersonRequest $request)\n {\n $input = $request->all();\n\n $person = $this->personRepository->create($input);\n $person->communities()->attach($request->communities);\n\n for($i = 0; $i < count($request->communities); $i++){\n $person->features()->attach($request->features, \n [\n 'community_id' => $request->communities[$i]\n ]); \n } \n\n Flash::success(trans('flash.store', ['model' => trans_choice('functionalities.people', 1)]));\n\n return redirect(route('people.index'));\n }", "public function add($entity);", "public function add(){\n\t\t// if we got a post information, do add else do nothing\n\t\tif($this->request->is('post')){\n\t\t\t$this->User->create();\n\t\t\tif($this->User->save($this->request->data)){\n\t\t\t\t// if the information is successfully saved\n\t\t\t\t$this->Session->setFlash(__('Congratulation, the user has been created.'));\n\t\t\t\t$this->redirect(array('controller'=>'jobs', 'action'=>'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Sorry, the user can not be created.'));\n\t\t\t}\n\t\t}\n\t}", "function add_person($params)\n {\n $this->db->insert('person',$params);\n $this->db->insert('company_person',array_slice($params, 13)); \n \n return $this->db->insert_id();\n //$this->db->query('select company_id, company_name from company');\n \n }", "public function add()\n {\n }", "public function add()\n {\n }", "public function add()\n {\n }", "public function add()\n\t{\n\n\t}", "public function add()\n\t{\n\n\t}", "public function addAction()\n {\n $viewModel = new ViewModel(['title' => 'add a user']);\n // if they are trying to add a user account for an existing person...\n $person_id = $this->params()->fromRoute('id');\n // or if there's no person_id route parameter...\n if (! $person_id && isset($this->params()->fromPost()['user'])) {\n // try post parameters\n $user = $this->params()->fromPost()['user'];\n if (isset($user['person']) && ! empty($user['person']['id'])) {\n $person_id = $user['person']['id'];\n }\n }\n $options = [\n 'action' => 'create',\n 'auth_user_role' => $this->auth_user_role,\n 'constrain_email' => true,\n ];\n\n if ($person_id) {\n /** @todo better db efficiency... */\n $person = $this->entityManager\n ->find('InterpretersOffice\\Entity\\Person', $person_id);\n if (! $person) {\n return $viewModel->setVariables(\n ['errorMessage' => \"person with id $person_id not found\"]\n );\n }\n $options['existing_person'] = $person;\n } else {\n $person = null;\n }\n $form = new UserForm($this->entityManager, $options);\n $user = new Entity\\User();\n if ($person) {\n $this->events->trigger(\n 'load-person',\n $this,\n compact('person', 'form')\n );\n $user->setPerson($person);\n $form->get('user')->get('person')->setObject($person);\n }\n\n $form->bind($user);\n $viewModel->form = $form;\n $request = $this->getRequest();\n\n if ($request->isPost()) {\n $form->setData($request->getPost());\n if (! $form->isValid()) {\n return new JsonModel(['status' => 'error',\n 'validation_errors' => $form->getMessages()]);\n }\n $user->setCreated(new \\DateTime());\n $this->entityManager->persist($user);\n if (! $person_id) {\n $this->entityManager->persist($user->getPerson());\n }\n // we could do this in the model instead, with lifecycle callback (?)\n $user->setPassword(bin2hex(openssl_random_pseudo_bytes(8)));\n $this->entityManager->flush();\n $person = $user->getPerson();\n $this->flashMessenger()->addSuccessMessage(\n sprintf(\n 'A user account has been created for %s <strong>%s %s</strong>.',\n $user->getRole(),\n $person->getFirstName(),\n $person->getLastname()\n )\n );\n return new JsonModel(['status' => 'success','validation_errors' => null]);\n }\n\n return $viewModel;\n }", "public function insert(personal $personal);", "public function testCreatePerson()\n {\n }", "public function store(PersonRequest $request)\n {\n $person = new Person();\n $person -> first_name = $request->first_name;\n $person -> middle_name = $request->middle_name;\n $person -> last_name = $request->last_name;\n $person -> gender = $request->gender;\n $person -> cadre = $request->cadre;\n $person -> email = $request->email;\n $person -> phone = $request->phone;\n $person -> facility = $request->facility;\n $person -> save(); \n $personId = $person->person_id;\n $pRole = $request->role;\n \n if ($pRole == 1) {\n $mentor = new Mentor();\n $mentor->person_id = $personId;\n $mentor->save();\n } else {\n $mentee = new Mentee();\n $mentee->person_id = $personId;\n $mentee->save();\n }\n return redirect('person-home');\n \n }", "public function store(PersonRequest $request)\n {\n $this->validate($request, [\n 'codigo' => 'required|unique:persona|max:30',\n ]);\n\n Person::create([\n 'codigo' => $request->codigo,\n 'nombre' => $request->nombre,\n 'apaterno' => $request->apaterno,\n 'amaterno' => $request->amaterno,\n 'fec_nac' => $request->fec_nac,\n 'tipo' => $request->tipo,\n 'sexo' => $request->sexo,\n ]);\n\n PersonalData::create([\n 'persona_codigo' => $request->codigo,\n 'estado_civil' => $request->estado_civil,\n 'religion' => $request->religion,\n 'email' => $request->email,\n 'telefono' => $request->telefono,\n 'escolaridad' => $request->escolaridad,\n 'carrera_id' => $request->carrera_id,\n 'domicilio' => $request->domicilio,\n 'actividad_economica' => $request->actividad_economica,\n 'lug_nac' => $request->lug_nac,\n 'lug_res' => $request->lug_res,\n ]);\n\n toast('Alumno registrado correctamente.', 'success', 'top');\n return redirect()->route('student.show', $request['codigo']);\n }", "function RegisterPerson()\n {\n if(!isset($_POST['submitted']))\n {\n return false;\n }\n // Maak een Array\n $formvars = array();\n \n $this->CollectRegistrationSubmissionPerson($formvars);\n \n \n if(!$this->SaveToDatabasePerson($formvars))\n {\n return false;\n }\n \n return true;\n }", "public function store(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:people,email,NULL,id,deleted_at,NULL',\n 'jabatan' => 'required',\n 'status' => 'required',\n ]);\n\n if ($validator->fails()) {\n return redirect('persons/add')\n ->withErrors($validator)\n ->withInput();\n }\n\n $Person = new Person();\n $Person->institution_id = Institution::getIdForCurrentUser($request->input('institution_id'));\n $Person->name = $request->input('name');\n $Person->email = $request->input('email');\n $Person->jabatan = $request->input('jabatan');\n $Person->status = $request->input('status');\n if ($request->has('nip')) {\n $Person->nip = $request->input('nip');\n }\n if ($request->has('expertises')) {\n $Person->expertises = $request->input('expertises');\n }\n $Person->user_id = Auth::user()->id;\n\n if ($Person->save()) {\n Log::info('User: '.Auth::user()->id. '->Create Person: '. $Person->id);\n flash()->overlay('Berhasil disimpan', 'Notification');\n return redirect('persons');\n }\n }", "public function submitNewPerson(array &$form, FormStateInterface $form_state) {\n $form_state->setRebuild();\n\n $person = $this->registrantFormHelper->createPersonForRegistrant($this->registrant);\n $this->registrant->setIdentity($person);\n }", "function addUser(){\n $name = $_REQUEST['name'];\n $pword = $_REQUEST['pword'];\n $num = $_REQUEST['number'];\n include(\"../model/user.php\");\n $obj=new user();\n\n if($obj->addUser($name, $pword, $num)) {\n echo '{\"result\":1}';\n }else {\n echo '{\"result\":0}';\n }\n }", "public function add(){\r\n\t\t//$this->auth->set_access('add');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//call save method\r\n\t\t$this->save();\r\n\t}", "public function create_person($data)\r\n {\r\n //check if person already exists via facebook id, if so then update that shiz\r\n if(isset($data[\"facebook_id\"]) && $data[\"facebook_id\"] != '')\r\n {\r\n if ( isset($data['facebook_id']) && $data['facebook_id'] != '') {\r\n $data['photo'] = 'http://graph.facebook.com/'.$data[\"facebook_id\"].'/picture';\r\n }elseif( !isset($data['photo']) ) {\r\n $data['photo'] = '';\r\n }\r\n\r\n $person = People::model()->findByAttributes( array( 'facebook_id' => $data['facebook_id'] ) );\r\n if( count( $person ) ) {\r\n $person->attributes = $data;\r\n $person->save();\r\n return $person;\r\n }\r\n }\r\n \r\n $person = new People;\r\n $person->attributes = $data;\r\n $person->save();\r\n return $person;\r\n }", "public function add()\n\t{\n\t\tif (! $this->is_admin) {\n\t\t\t$this->redirect('admin/error/deny');\n\t\t}\n\n\t\t$authModel = M('auth');\n\t\t$userModel = M('user');\n\n\t\t$authArr = $authModel->field('user_id')->where(array('level' => 1))->select();\n\t\t$leaderUids = makeImplode($authArr, 'user_id');\n\n\t\t$userArr = $userModel\n\t\t\t->field('id, truename')\n\t\t\t->where(array('id' => array('IN', \"$leaderUids\")))\n\t\t\t->select();\n\n\t\t$leaderIdsList = makeIndex($userArr, 'id');\n\n\t\t$this->assign('leader_list', $userArr);\n\t\t$this->display();\n\t}", "public function createUserPeopleAction()\n {\n $data = $this->getRequestData();\n if (isset($data['name'])) {\n $user = Object_User::getById($this->getDeviceSession()->getUserId());\n $folder = Object_Folder::getByPath('/peoples/' . $user->getKey() . \"-people\");\n if (!$folder) {\n $folder = new Object_Folder();\n $folder->setKey($user->getKey() . \"-people\");\n $folder->setParentId(52);\n $folder->save();\n }\n $people = new Object_People();\n $people->setCreator($user);\n $people->setName($data['name']);\n $people->setCompany(isset($data['company']) ? $data['company'] : \"\");\n $people->setPhone(isset($data['phone']) ? $data['phone'] : \"\");\n $people->setEmail(isset($data['email']) ? $data['email'] : \"\");\n $people->setImage(isset($data['image']) ? Asset_Image::getById($data['image']) : \"\");\n $people->setKey(Pimcore_File::getValidFilename($user->getKey() . \"-\" . $data['name'] . \"-\" . time()));\n $people->setPublished(true);\n $people->setParentId($folder->getId());\n if (!$people->save()) {\n $this->setErrorResponse('cannot save People object');\n }\n } else {\n $this->setErrorResponse('name is mandatory field for this request!');\n }\n\n $this->_helper->json($people);\n }", "public function addUser(){\n\t}", "public function addUser()\n {\n\n foreach ($this->employeeStorage->getEmployeeScheme() as $key => $singleUser) {\n\n $userInput = readline(\"$singleUser : \");\n $validate = $this->validateInput($userInput, $key); // Each input is sent for validation using validateInput method\n\n while (!$validate) // loop that forces user to enter valid input\n {\n $userInput = readline(\"Unesite ispravan format : \");\n $validate = $this->validateInput($userInput, $key);\n\n }\n if ($key === 'income'){\n $userInput = number_format((float)$userInput, 2, '.', ''); // formats income input so it always has 2 decimal points\n }\n\n $data[$key] = $userInput;\n\n }\n\n $this->employeeStorage->setEmployee( $data ); // After every input is validated data is stored using setEmployee method\n\n echo \"\\033[32m\". \"## Novi zaposlenik \". $data['name'].\" \". $data['lastname'].\" je dodan! \\n\\n\".\"\\033[0m\";\n\n\n }", "public function p_add() {\n\t\t$_POST = DB::instance(DB_NAME)->sanitize($_POST);\n\t\t\n\t\t# Unix timestamp of when this post was created / modified\n\t\t$_POST['created'] = Time::now();\n\t\t$_POST['modified'] = Time::now();\n\t\t$_POST['created_by'] = $this->user['email'];\n\t\t$_POST['modified_by'] = $this->user['email'];\n\t\tunset($_POST['MAX_FILE_SIZE']);\n\n\t\t# Insert\n\t\t# Note we didn't have to sanitize any of the $_POST data because we're using the insert method which does it for us\n\t\tDB::instance(DB_NAME)->insert('teachers', $_POST);\n\n\t\t\n\t\t# Send them to the main page\n\t\tRouter::redirect(\"/\");\n\n\n\t}", "public function add()\n {\n $originalInput = Request::input();\n $request = Request::create('/users/add', 'POST', array('email'=>Input::get('email'),'name'=>Input::get('name')));\n Request::replace($request->input());\n $userId = Route::dispatch($request)->getContent();\n Request::replace($originalInput);\n\n Task::create(array('user_id'=>$userId,'title'=>Input::get('title'),'description'=>Input::get('description'),'priority'=>Input::get('priority'),'flag'=>'n','duedate'=>Input::get('duedate')));\n\n echo true;\n }", "public function addNewHospital()\n {\n }", "function add_profession()\n\t{\n\t\t$data['name']\t\t\t\t\t=\t$this->input->post('name');\n\t\t$data['created_on']\t\t\t\t= \ttime();\n\t\t$data['created_by']\t\t\t\t= \t$this->session->userdata('user_id');\n\t\t$data['timestamp']\t\t\t\t= \ttime();\n\t\t$data['updated_by']\t\t\t\t= \t$this->session->userdata('user_id');\n\n\t\t$this->db->insert('profession', $data);\n\n\t\t$this->session->set_flashdata('success', 'New profession has been added successfully.');\n\n\t\tredirect(base_url() . 'profession_settings', 'refresh');\n\t}", "public function add() {\n $user = $this->Users->newEntity();\n if ($this->request->is('post')) {\n $user = $this->Users->patchEntity($user, $this->request->data);\n if ($this->Users->save($user)) {\n $this->Flash->success(__('The user has been saved.'));\n \n return $this->redirect(['action' => 'login']);\n } else {\n $this->Flash->error(__('The user could not be saved. Please, try again.'));\n }\n }\n \n $this->set(compact('user'));\n $this->set('_serialize', ['user']);\n }", "public function addPerson(User $user)\n {\n $comunas = Comuna::select('id','nombre')->orderBy('nombre','ASC')->get();\n\n return view('people.addPerson',compact('user','comunas'));\n }", "public function add()\n {\n $this->request->allowMethod(['post']);\n\n $user = $this->Users->newEmptyEntity();\n\n if ($this->request->is('post')) {\n $user = $this->Users->patchEntity($user, $this->request->getData());\n\n if (!$this->Users->save($user)) {\n throw new ValidationErrorException($user);\n }\n }\n\n $this->set('data', $user);\n }", "public static function addUser()\n {\n // ADD NEW DATA TO A TABLE\n // MAKE SURE TO SEND USERS TO THE /users page when a user is added\n }", "public function addName($name) {\n $this->names[] = $name;\n }", "public function create() {\n $response = $this->sendRequest(\n 'GET', '/api/v1/persons/create'\n );\n\n return $this->validate($response);\n }", "public function add_user($id) {\n UserToPres::create_entry($id,$this->id);\n }", "public function store(Request $request)\n {\n $formFields = $this->validate($request, [\n 'first-name' => 'required',\n 'last-name' => 'required',\n 'date-of-birth' => 'required|date',\n 'phone-primary' => 'required',\n 'phone-secondary' => 'nullable',\n 'address' => 'required',\n 'notes' => 'string|nullable'\n ]);\n $this->peopleRepo->addFromInput($formFields);\n\n return redirect('/people')->with('success', 'Person was added');\n }", "public function store(PersonRequest $request) {\n\t\t//\n\t\t$data = $request->all();\n\t\t// var_dump($data);\n\t\t// var_dump('store');die;\n\t\t$manager = $this->person->store($data, 'manager');\n\t\tif ($manager->id) {\n\t\t\t//添加成功\n\t\t\t//记录系统日志,这里并未使用事件监听来记录日志\n\t\t\t$log = [\n\t\t\t\t'uid' => user('id'),\n\t\t\t\t'type' => 'manager',\n\t\t\t\t'content' => '管理员:成功新增一名管理用户' . $manager->username . '<' . $manager->email . '>。',\n\t\t\t];\n\t\t\tSystemLogger::write($log);\n\n\t\t\t// return redirect()->route('admin.person.index')->with('message', '成功新增管理员!');\n\t\t\tif (isset($data['operaId']) && $data['operaId'] > 0) {\n\t\t\t\t$this->opera->update($data['operaId'], array('uid' => $manager->id), 'manager');\n\t\t\t}\n\t\t\tif (isset($data['jobWantId']) && $data['jobWantId'] > 0) {\n\t\t\t\t$this->jobWant->update($data['jobWantId'], array('uid' => $manager->id));\n\t\t\t}\n\t\t\techo $manager->id;\n\t\t} else {\n\t\t\techo 1;\n\t\t\t// return redirect()->back()->withInput($request->input())->with('fail', '数据库操作返回异常!');\n\t\t}\n\t}", "public function testAddNewPersonWithPersonList() {\n // Add an existing person.\n Profile::create([\n 'type' => 'person',\n 'field_name' => 'Existing person',\n 'field_email' => '[email protected]',\n 'uid' => $this->adminUser->id(),\n ])->save();\n\n $this->addProductToCart($this->product);\n $this->goToCheckout();\n $this->assertCheckoutProgressStep('Event registration');\n\n // Go to add registrant page.\n $this->clickLink('Add registrant');\n // Assert that one person is already shown.\n $this->assertSession()->pageTextContains('Existing person');\n $this->submitForm([], 'New person');\n\n // Assert that no new profile is created yet.\n $this->assertNull(Profile::load(2));\n\n // Now, create person.\n $this->submitForm([\n 'person[field_name][0][value]' => 'Person 1',\n 'person[field_email][0][value]' => '[email protected]',\n ], 'Save');\n\n // Assert that a new profile now exists.\n $person = Profile::load(2);\n $this->assertEquals('Person 1', $person->field_name->value);\n $this->assertEquals($this->adminUser->id(), $person->getOwnerId());\n\n // Continue checkout.\n $this->submitForm([], 'Continue');\n $this->assertSession()->pageTextContains('1 item');\n $this->processOrderInformation(FALSE);\n // Review.\n $this->assertCheckoutProgressStep('Review');\n $this->assertSession()->pageTextContains('Contact information');\n $this->assertSession()->pageTextContains('Billing information');\n $this->assertSession()->pageTextContains('Order Summary');\n $this->assertSession()->pageTextContains('Person 1');\n // Finalize order.\n $this->submitForm([], 'Complete checkout');\n $this->assertSession()->pageTextContains('Your order number is 1. You can view your order on your account page when logged in.');\n $this->assertSession()->pageTextContains('0 items');\n }", "public function storeNewEmployer($input);", "function _createTeam($name, $personID){\n\n\t$dbQuery = sprintf(\"INSERT INTO Team\n\t\t(Name, PersonID, TeamID) VALUES\n\t\t('%s', '%s', UUID())\",\n\t\tmysql_real_escape_string($name),\n\t\tmysql_real_escape_string($personID));\n\t//echo $dbQuery;\n\tif(!insertQuery($dbQuery)){\n\t\tdatabaseError();\n\t}\n\telse{\n\n\t\t$teamIDQ = sprintf(\"SELECT TeamID FROM Team\n\t\t\tWHERE Name='%s' AND PersonID='%s'\",\n\t\t\tmysql_real_escape_string($name),\n\t\t\tmysql_real_escape_string($personID));\n\t\t$id = getDBResultsArray($teamIDQ)[0]['TeamID'];\n\t\t//echo \"\\n\";\n\t\t//echo $id;\n\t\t//Without triggers, there's no better way to do this\n\t\t$insertMemberQ = sprintf(\"INSERT INTO TeamMembers (TeamID, PersonID) VALUES\n\t\t\t('%s', '%s')\",\n\t\t\tmysql_real_escape_string($id),\n\t\t\tmysql_real_escape_string($personID));\n\t\tif(!insertQuery($insertMemberQ)){\n\t\t\tdatabaseError();//TODO - anything but this\n\t\t}\n\t\telse{\n\t\t\techo json_encode(Array(\"Success\"=>\"Team Created\"));\n\t\t}\n\t}\n}", "public function addAddress($address);", "public function savePerson($person)\n {\n // Deal with new ayso record\n // One type at a time for now since getRPs will not work for new records\n // Need to deal with the case of adding a new person with an existing ayso record\n $personRegs = array($person->getRegAYSOV(),$person->getRegUSSF());\n foreach($personRegs as $personReg)\n {\n if ($personReg->getRegKey()) \n {\n // See if one already exists\n // Move to a validator?\n $personRegx = $this->loadPersonRegForKey($personReg->getRegKey());\n \n // Nothng existing means to just go ahead and create\n if (!$personRegx) $this->persist($personReg);\n else\n {\n // No change is okay\n if ($personReg->getId() == $personRegx->getId()) {}\n else\n {\n // Punt for now\n die('Trying to change to existing reg key');\n }\n }\n }\n else\n {\n if ($personReg->getId())\n {\n $this->remove($personReg);\n }\n }\n }\n // If no project then remove from flush\n $currentProjectPerson = $person->getCurrentProjectPerson();\n if (!$currentProjectPerson->getProject())\n {\n // This allows removeing a person from a project\n $this->remove($currentProjectPerson);// die('detached');\n \n // Need this otherwise an entity always gets added even with remove/detach\n // The cascade=persist was causing this when addProjectPerson was called by the form\n // $person->clearProjectPersons();\n }\n else $this->persist($currentProjectPerson); // Only persist if have a project\n \n // Deal with new persons\n if (!$person->getId()) $this->persist($person);\n \n $this->flush();\n }", "public function Add(&$entity)\n {\n \n }", "public function store(PersonRequest $personRequest)\n {\n $person = $this->personRepo->create($personRequest->all());\n return $this->sendResponse($person->toArray(), 'Persona Creada!');\n }", "public function action_add()\r\n\t{\r\n\t\tif ( Request::current()->method() == Request::POST )\r\n\t\t{\r\n\t\t\treturn $this->_add();\r\n\t\t}\r\n\t\t\r\n\t\t$this->template->title = __('Add user');\r\n\t\t$this->breadcrumbs\r\n\t\t\t->add($this->template->title);\r\n\r\n\t\t// check if user have already enter something\r\n\t\t$data = Flash::get( 'post_data', array() );\r\n\r\n\t\t$user = new User( $data );\r\n\r\n\t\t$this->template->content = View::factory( 'user/edit', array(\r\n\t\t\t'action' => 'add',\r\n\t\t\t'user' => $user,\r\n\t\t\t'permissions' => Model_Permission::get_all()\r\n\t\t) );\r\n\t}", "public function createPerson($personData) {\n return $this->createRecord('person', $personData);\n }", "public function addEmployee($name, $gender, $phone, $email) {\n // create a new element represeting the new book\n //$contact = $this->domDocument->documentElement;\n $newEmp = $this->domDocument->createElement(\"employee\");\n // append the newly created element\n $this->domDocument->documentElement->appendChild($newEmp);\n\n $name = $this->domDocument->createElement(\"name\", $name);\n $newEmp->appendChild($name);\n\n $gender = $this->domDocument->createElement(\"gender\", $gender);\n $newEmp->appendChild($gender);\n\n $phone = $this->domDocument->createElement(\"phone\", $phone);\n $newEmp->appendChild($phone);\n\n $email = $this->domDocument->createElement(\"email\", $email);\n $newEmp->appendChild($email);\n\n //$contact->appendChild($newEmp);\n\n //$this->domDocument->appendChild($contact);\n // save the document\n //header(\"Content-type: text/xml\");\n $this->domDocument->saveXML();\n $this->domDocument->save($this->xmlPath);\n }", "public function add() {\n\t\t$user_id = $this->UserAuth->getUserId();\n\t\t\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->request->data[\"Contact\"][\"user_id\"] = $user_id;\n\t\t\t$this->Contact->saveAssociated($this->request->data, array(\"deep\" => true));\n\t\t}\n\t\t\n\t\t$this->render('form');\n\t}", "public function only_person(CreateVisitorRequest $request){\n \n $person = Person::create([\n 'type_dni' => $request->type_dni,\n 'dni' => $request->dni,\n 'name' => $request->name,\n 'lastname' => $request->lastname,\n 'address' => $request->address,\n 'phone' => $request->phone,\n 'email' => $request->email,\n 'branch_id' => 1,\n ]);\n\n /**\n * Registro de la fotografia \n */\n if ($request->file('file') != null) {\n $photo = $request->file('file');\n $path = $photo->store('persons');\n $image = new Image;\n $image->path = $path;\n $image->imageable_type = \"App\\Person\";\n $image->imageable_id = $person->id;\n $image->save();\n }\n\n return response()->json([\n 'message' => 'Registrado correctamente',\n ]);\n }", "public function add()\n {\n if($this->Auth->user('level') != \"Officer\" && $this->Auth->user('level') != \"Admin\")\n $this->redirect(\n array('controller' => 'Users', 'action' => 'profilehub/' . $this->Auth->user('id')));\n \n if($this->request->is('post'))\n {\n $this->Event->create();\n \n if($this->Event->save($this->request->data))\n {\n $this->redirect('announcements');\n }\n }\n \n $this->loadModel('User');\n $users = $this->User->find('all');\n\n $this->set('user', $users);\n \n $this->layout = 'hero-ish';\n $this->Session->write('Page', 'Hub');\n }", "function addTeam($name) {\n global $link;\n $query = 'INSERT INTO team (name)\n VALUES (:name)';\n $statement = $link->prepare($query);\n $statement->bindValue(':name', $name);\n $statement->execute();\n $statement->closeCursor();\n }", "public function canAddUnknownPerson();", "public function add() {\n\t\t$user = $this->User->read(null, $this->Auth->user('id'));\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->User->create();\n\t\t\t$this->request->data['User']['password'] = AuthComponent::password($this->request->data['User']['password']);\n\t\t\tif ($this->User->save($this->request->data)) {\n\t\t\t\t$this->Session->setFlash(__('The user has been saved'));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('The user could not be saved. Please, try again.'));\n\t\t\t}\n\t\t} else {\n\t\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t\t$lookupSupported = isset($queryURL) && \"\" <> $queryURL;\r\n\t\t\t$this->set('lookupSupported', $lookupSupported);\n\t\t\t$this->set('userType', $user['User']['type']);\n\t\t}\n\t}", "public function testUpdatePerson()\n {\n }", "public function add(string $name, string $type = null, array $options = []);", "public function store(Request $request)\n {\n\n $new_person = new Person();\n $new_person->name = request('name');\n $new_person->designation = request('designation');\n $new_person->profile_link = request('profile_link');\n $new_person->imagepath = request('imagepath');\n $new_person->save();\n\n return redirect('/people');\n }", "public function add_post(){\n $response = $this->BayiM->add(\n $this->post('iduser'),\n $this->post('nama'),\n $this->post('gender')\n );\n $this->response($response);\n }", "public function Add($entity) {\n }", "public function insert_people($id_reserve, $name, $lastname, $comment, $type){\n $query=\"INSERT INTO `\".DB_PREFIX.\"people` (`id`,\n\t\t\t\t\t\t\t\t\t\t\t\t`id_reserve` ,\n\t\t\t\t\t\t\t\t\t\t\t\t`name` ,\n\t\t\t\t\t\t\t\t\t\t\t\t`lastname` ,\n\t\t\t\t\t\t\t\t\t\t\t\t`passport` ,\n\t\t\t\t\t\t\t\t\t\t\t\t`type`)\n \t\t\t\t\tVALUES ( NULL ,'\".$this->link->myesc($id_reserve).\"','\".$this->link->myesc($name).\"','\".$this->link->myesc($lastname).\"','\".$this->link->myesc($comment).\"','\".$this->link->myesc($type).\"')\";\n $result = $this->link->execute($query);\n return $result;\n\t}", "public function add() {\n\t\tRouter::redirect('/users/profile');\t\n\t}", "public function _friendadd() {\n\t\t$this->history = false;\n\n\t\t// for authenticated only\n\t\tif ($this->user && csrf::valid()) {\n\n\t\t\t// require valid user\n\t\t\t$this->member = new User_Model($username);\n\t\t\tif ($this->member->id) {\n\t\t\t\t$this->user->add_friend($this->member);\n\n\t\t\t\t// News feed event\n\t\t\t\tnewsfeeditem_user::friend($this->user, $this->member);\n\n\t\t\t}\n\t\t}\n\n\t\turl::back('members');\n\t}", "public function addPet() {\n $body = $this->objectConverter->convert($_POST, Pet::CLASS);\n $this->petService->addPet($body);\n }", "public function add(Actor $actor): self ;", "public function addUser() {\n $db = new ClassDB();\n $db->connect();\n\n $result = $db->getConnection()->prepare('INSERT INTO users (user_email,\n user_password,\n user_first_name,\n user_last_name) \n VALUES (:email,\n :pass,\n :firstName,\n :lastName)');\n\n $result->bindParam(':email', $this->user_email); \n $result->bindParam(':pass', $this->user_password); \n $result->bindParam(':firstName', $this->user_first_name);\n $result->bindParam(':lastName', $this->user_last_name);\n \n $result->execute();\n $db->disconnect();\n }", "function add() {\n }", "function becomeFriendsWith($person) {\n $query = \"INSERT INTO friends (friend_id, user_id) VALUES ('{$person}','\".$this->data['id'].\"')\";\n $query2 = \"INSERT INTO friends (friend_id, user_id) VALUES ('\".$this->data['id'].\"','{$person}')\";\n mysql_query($query);\n mysql_query($query2);\n\n header('location: home.php');\n }", "public function addAccount(){\n\n\t}", "public function addUser($name, $email, $password)\n {\n\n //\n }", "public function add_user_get(){\r\n if (!$this->pronet_model->add_user('Fname Lname', '7711223344553', '[email protected]', '31111225', '1990-01-01','134091830-2')) {\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => FALSE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_BAD_REQUEST);\r\n } else {\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => TRUE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_OK);\r\n }\r\n }", "public function create() //添加\n {\n\t\t//\n }", "public function addFriend($friend_guid);", "function add_persona_perfil($params)\n {\n $this->db->insert('persona_perfil',$params);\n return $this->db->insert_id();\n }" ]
[ "0.7678857", "0.7320694", "0.7290546", "0.7103825", "0.6934668", "0.69042194", "0.6768898", "0.6720561", "0.6719033", "0.6670787", "0.66181356", "0.6606887", "0.65902233", "0.657001", "0.653468", "0.64788", "0.64788", "0.6457209", "0.6380336", "0.63676625", "0.6363387", "0.6329638", "0.63225573", "0.6229246", "0.61760247", "0.6165285", "0.61651117", "0.61585397", "0.6148756", "0.6128502", "0.610633", "0.6104185", "0.60959226", "0.60959226", "0.60959226", "0.60832274", "0.60832274", "0.6015553", "0.6011445", "0.6011175", "0.5992435", "0.59806645", "0.5959411", "0.5948899", "0.59425384", "0.5916551", "0.59140563", "0.59067214", "0.5902961", "0.59022707", "0.58997524", "0.5897411", "0.589691", "0.5888749", "0.5875452", "0.58662987", "0.5805997", "0.58042", "0.579639", "0.5792632", "0.57816505", "0.57724386", "0.5751248", "0.5726936", "0.5725248", "0.5719679", "0.57134026", "0.5711927", "0.5702701", "0.5700539", "0.569858", "0.56931466", "0.56904006", "0.5677907", "0.56777483", "0.56761575", "0.5673656", "0.5669059", "0.56533396", "0.5652479", "0.56507254", "0.56444895", "0.56380105", "0.5635237", "0.5633548", "0.5633362", "0.5629438", "0.56262267", "0.56158936", "0.56148773", "0.5612029", "0.56096274", "0.5608154", "0.56034076", "0.5592508", "0.55924267", "0.55899835", "0.55795884", "0.5577908", "0.5570775" ]
0.72322035
3
Determine if the validation rule passes.
public function passes($attribute, $value) { return in_array('team_id', $value) && in_array('phone', $value) && in_array('sticky_phone_number_id', $value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function isValidationPassed();", "public function passes()\n {\n $validator = $this->validator->make($this->data, $this->rules, $this->messages);\n \n if($validator->fails())\n {\n $this->errors = $validator->messages();\n return false;\n }\n \n return true;\n }", "public function passes()\n {\n $rules = $this->replace();\n\n $validator = Validator::make($this->data, $rules);\n\n if( $validator->passes() )\n {\n return true;\n }\n\n $this->errors = $validator->messages();\n }", "function passes() {\n return $this->startValidation();\n }", "public function validate() : bool\n {\n return $this->passes();\n }", "public function passes()\n {\n $validator = $this->validator->make($this->data, $this->rules);\n\n if($validator->passes())\n {\n return true;\n }\n\n $this->errors = $validator->errors()->all(':message');\n return false;\n }", "public function passes()\n {\n foreach ($this->rules as $attribute => $rules) {\n foreach ($rules as $rule) {\n $this->validate($attribute, $rule);\n }\n }\n\n return count($this->messages) === 0;\n }", "public function passes() {\n $this->message = new MessageBag;\n\n // We'll spin through each rule, validating the attributes attached to that\n // rule. Any error messages will be added to the containers with each of\n // the other error messages, returning true if we don't have messages.\n foreach ($this->rules as $attribute => $rules) {\n\n }\n\n return $this->message->isEmpty();\n }", "public function isValid()\r\n\t{\r\n\t\t$valid = $this->validate($this->rule, $this->control->getValue(), $this->arg);\r\n\t\tif ($this->negative)\r\n\t\t\t$valid = !$valid;\r\n\r\n\t\tif ($valid)\r\n\t\t\treturn true;\r\n\r\n\t\t$this->control->setError($this->getMessage());\r\n\t\treturn false;\r\n\t}", "public function valid(): bool {\n return false !== current($this->rules);\n }", "public function valid()\n {\n return $this->makeValidator()->passes();\n }", "public function valid()\n {\n return current($this->rules) !== false;\n }", "public function validation()\n {\n if ($this->validationHasFailed() == true) {\n return false;\n }\n }", "public function validate(): bool\n {\n $result = true;\n foreach ($this->rules as $field_name => $field_rules) {\n foreach ($field_rules as $field_rule => $field_params) {\n\n if (array_key_exists($field_rule, self::$known_rules)) {\n\n if (class_exists(self::$known_rules[$field_rule]) and\n is_subclass_of(self::$known_rules[$field_rule], 'Shulha\\Framework\\Validation\\Rules\\AbstractValidationRule')) {\n\n /** @var $validation_class AbstractValidationRule */\n $validation_class = new self::$known_rules[$field_rule];\n $field_value = isset($this->request->$field_name) ? $this->request->$field_name : null;\n\n if (!$validation_class->check($field_name, $field_value, $field_params)) {\n $result = false;\n $this->errorList[$field_name][] = $validation_class->getError($field_name, $field_value, $field_params);\n }\n } else\n throw new RuleClassNotFoundException(\"Class \" . self::$known_rules[$field_rule] . \" not found or don't extends AbstractValidationRule\");\n } else\n throw new RuleNotFoundException(\"Rule \\\"$field_rule\\\" not found\");\n }\n }\n return $result;\n\n }", "public function passed(){\n \n //Loop through all the fields in the ruleset\n foreach($this->rules as $fieldName => $ruleCollection){\n foreach($ruleCollection as $rule => $rule_value){\n $this->validateField($fieldName, $rule, $rule_value); \n }\n }\n \n if($this->useValidationToken){\n if( Input::get(\"form_token\") != Session::get(\"form_token\") ){\n $this->addError(\"form_token\", \"token\", \"Could not process form form at this time. Please try again.\");\n }\n }\n \n //If we're using session flash, add a formatted list of errors to the session flash system\n if($this->useSessionFlash){\n Session::addFlash($this->formattedErrors(\"list\"), \"danger\", \"Please correct the following errors\");\n }\n \n return $this->hasPassed;\n }", "public function isValid() {\n\t\t$validation = Validator::make($this->attributes, static::$rules);\n\n\t\tif ($validation->passes()){\n\t\t\treturn true;\n\t\t}\n\n\t\t$this->messages = $validation->messages();\n\t\treturn false;\n\t}", "function validate()\n\t{\n\t\t$result = true;\n\t\tif ($this->required && !$this->value) { $result = false; }\n\n\t\tif (!$result) { $this->error = '*'; }\n\n\t\treturn $result;\n\t}", "public function fails()\n {\n return count($this->_rules->errors) > 0;\n }", "public function validate()\n {\n foreach ($this->aRule as $aRule) {\n if (count($aRule) < 2) { continue; }\n $sKey = array_shift($aRule);\n $sValidator = array_shift($aRule);\n $Validator = $this->createValidator(\n $sValidator,\n $sKey,\n Arr::get($this->aData, $sKey),\n $aRule,\n Arr::get($this->aMsg, $sKey, array())\n );\n if(true !== ($sValidMsg = $Validator->validator())){\n return $sValidMsg;\n }\n }\n return true;\n }", "function fails() {\n return !($this->startValidation());\n }", "public function checkValidity()\n {\n if($this->validator->fails()) {\n return $this->validator->errors();\n }\n else\n return false;\n }", "public function passes()\n {\n if ($this->isRemoteValidationRequest()) {\n return $this->validateJsRemoteRequest($this->data['_jsvalidation'], [$this, 'parent::passes']);\n }\n\n return parent::passes();\n }", "public function isValid(): bool\n {\n $success = true;\n\n foreach ($this->rules->getRules() as $field => $rules) {\n foreach ($rules as $rule => $args) {\n $fieldError = $this->fieldErrors[$field] ?? null;\n\n if (key_exists($rule, $this->sets) === false) {\n // Rule doesn't exist, throw an exception\n throw new InvalidArgumentException(\"Unknown rule '$rule'\");\n }\n\n if ($this->params->has($field) === false) {\n // The field doesn't exist.\n if ($this->rules->isRequired($field)) {\n // The rule is required but doesn't exist. Set error and\n // continue to the next field\n $this->errors->add($field, $fieldError ?? \"$field is required\");\n $success = false;\n break;\n }\n\n // The rule doesn't exist but isn't required, so let's just\n // continue to the next field\n continue;\n }\n\n // Add the field value as the first argument\n array_unshift($args, $this->params->get($field));\n\n $callback = call_user_func_array($this->sets[$rule], $args);\n\n if ($callback === true) {\n // The validation rule passed, continue to next\n continue;\n }\n\n // Set success to false since the validation failed\n $success = false;\n\n if ($fieldError || is_string($callback)) {\n // We found a custom field error, let's use that\n $this->errors->add($field, $fieldError ?? $callback);\n break;\n }\n\n // No other error messages was found or returned, create a generic one\n $this->errors->add($field, \"Validation for $rule failed\");\n break;\n }\n }\n\n return $success;\n }", "public function validation() {\n $this->validate(\n new PresenceOf(\n array(\n \"field\" => \"name\",\n \"message\" => \"The name is required\"\n )\n )\n );\n\n if ($this->validationHasFailed() == true) {\n return false;\n }\n\n return true;\n }", "public function validationHasFailed(): bool;", "public function isValid(): bool{\n if ($this->getError() == null){return true;}\n return false;\n }", "protected final function validate()\n {\n $validator = new Validator($this);\n $validator->validate();\n\n return $this->hasErrors() ? false : true;\n }", "public function isRulesPassed()\n {\n if(!isset($this->rules_objects_list[$this->table_name]))\n return true;\n\n //current table's rules object\n $l_target = $this->rules_objects_list[$this->table_name];\n\n return ($l_target->rules_error_flag == false);\n }", "public function isFailed()\n {\n return $this->validator->fails();\n }", "public function validate()\n {\n $validator = new Validator;\n $validator->add($this->rules);\n if ($validator->validate($this->attributes)) {\n return TRUE;\n }\n\n $this->errors = $validator->getMessages();\n\n return FALSE;\n }", "public function isValid()\n {\n $this->beforeValidation();\n\n if ( ! isset($this->validationRules)) {\n throw new NoValidationRulesException('No validation rules found on class ' . get_called_class());\n }\n\n $this->validator = Validator::make($this->inputData, $this->validationRules, $this->validationMessages);\n\n return $this->validator->passes();\n }", "function isValid () {\r\n if ( count ($this->errors) > 0 ) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "public function isValid(): bool\n {\n return (count($this->violations) <= 0);\n }", "public function isValidated()\n {\n return $this->attribute('state') == self::STATUS_VALIDATED;\n }", "public function isValid()\n {\n return $this->validates();\n }", "public function isValidated(): bool\n {\n return $this->status != self::STATUS_ERROR;\n }", "public function validate() : bool\n {\n foreach ($this->rules() as $inputName => $rules) {\n $value = $this->{$inputName} ?? '';\n foreach ($rules as $rule) {\n if(!is_string($rule)) {\n $ruleName = $rule[0];\n } else $ruleName = $rule;\n if($ruleName === self::RULE_REQUIRED && !$value) {\n $this->addError($inputName, self::RULE_REQUIRED);\n } else if ($ruleName === self::RULE_EMAIL && !filter_var($value, FILTER_VALIDATE_EMAIL) ) {\n $this->addError($inputName, self::RULE_EMAIL);\n } else if ($ruleName === self::RULE_MAX && strlen($value) > $rule['max']) {\n $this->addError($inputName, self::RULE_MAX, $rule);\n } else if ($ruleName === self::RULE_MIN && strlen($value) < $rule['min']) {\n $this->addError($inputName, self::RULE_MIN, $rule);\n } else if ($ruleName === self::RULE_MATCH && $value !== $this->{$rule['match']}) {\n $this->addError($inputName, self::RULE_MATCH, $rule);\n } else if ($ruleName === self::RULE_UNIQUE) {\n $sql = \" SELECT uniqueID from \" . self::$tableName . \" WHERE \" . $rule['column'] . \"=?\"; \n $stmt = self::$mysqli->prepare($sql);\n $stmt->bind_param('s', $value);\n if($stmt->execute() === false) {\n $this->addError($inputName, self::RULE_UNIQUE, $rule);\n } else {\n $result = $stmt->get_result()->fetch_all(); \n if(count($result) > 0) {\n $this->addError($inputName, self::RULE_UNIQUE, $rule);\n }\n }\n }\n }\n }\n return empty($this->errors);\n }", "public function isValidated()\n {\n if (empty($this->errors)) {\n return true;\n } else {\n return false;\n }\n }", "public function isValid(): bool\n {\n return $this->getErrors()->count() === 0;\n }", "public function isValid()\n {\n return $this->isBound() ? count($this->errors)==0 : false; // TESTME\n }", "public function validate(): bool;", "public function validate(): bool;", "public function validate(): bool;", "public function validate(): bool;", "public function isValid() {}", "public function isValid() {}", "public function isValid() {}", "public function isValid() {}", "public function isValid() {}", "public function isValid() {}", "public function isValid() {}", "public function isValid() {}", "function isValid() {\n return $this->validator ? $this->validator->isValid($this->value) : true;\n }", "public function validate(): bool\n {\n return true;\n }", "public function validate(): bool\n {\n return true;\n }", "public function validate(): bool\n {\n return true;\n }", "public function validate(): bool\n {\n return true;\n }", "public function validate(): bool\n {\n return true;\n }", "public function validation()\n {\n $this->validate(new PresenceOf(\n array(\n \"field\" => \"timestamp\",\n \"message\" => \"The field timestamp is required\"\n )\n ));\n\n $this->validate(new Regex(\n array(\n \"field\" => \"ip\",\n \"pattern\" => '/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\z/',\n \"message\" => \"The email must be unique\"\n )\n ));\n\n $this->validate(new Numericality(\n array(\n \"field\" => \"load_threshold\",\n \"message\" => \"The load threshold must be numeric\"\n )\n ));\n\n return $this->validationHasFailed() != true;\n }", "public function isValid() : bool {\n\t\t\treturn $this->error == 0;\n\t\t}", "protected function isValid()\r\n\t{\r\n\t\treturn $this->isValid;\r\n\t}", "public function valid()\n {\n\n if ($this->container['rule_id'] === null) {\n return false;\n }\n if ($this->container['rule_name'] === null) {\n return false;\n }\n if ($this->container['status'] === null) {\n return false;\n }\n if ($this->container['execution_source'] === null) {\n return false;\n }\n return true;\n }", "public function isValid()\n\t{\n\t\treturn true;\n\t}", "public function isValid() {\n return $this->getValidation()->isValidField($this->getName());\n }", "public function getIsValid()\n {\n return $this->isValid;\n }", "public function isValid() {\n\t\ttry {\n\t\t\t$this->validate();\n\t\t\treturn true;\n\t\t} catch (ValidationException $e) {\n\t\t\treturn false;\n\t\t}\n\t}", "public function passes()\n {\n if (!($this->validator instanceof \\Illuminate\\Validation\\Validator)) {\n throw new LogicException('No model was set. Nothing to validate.');\n }\n\n return $this->getValidator()->passes();\n }", "public function validate(): bool\n {\n foreach ($this->rules() as $attribute => $rules) {\n\n $value = $this->{$attribute};\n //We loop twice because some rules have array rules within them\n foreach ($rules as $rule) {\n /* If $rule is a string take the $rule and assign it to to $ruleName*/\n $ruleName = $rule;\n /* If $rule is not a string i.e an array, take the first element of the array i.e.\n *$rule[0] and assign it to to $ruleName\n */\n if(!is_string($rule))\n {\n $ruleName = $rule[0];\n }\n /*\n * If any attribute has a rule required and no value exists, add an error to the\n * errors array and pass the attribute and the rule as parameters to the addErrors function\n */\n if($ruleName === self::RULE_REQUIRED && !$value)\n {\n $this->addErrors($attribute, self::RULE_REQUIRED);\n }\n /*\n * If any attribute has a rule email and the value does not pass as valid email, add to the\n * errors array and pass the attribute and the rule as parameters to the addErrors function\n */\n\n if($ruleName === self::RULE_EMAIL && !filter_var($value, FILTER_VALIDATE_EMAIL))\n {\n $this->addErrors($attribute, self::RULE_EMAIL);\n }\n\n /*\n * If any attribute has a rule match and the value does not match with the value passed\n * in the rule array where this rule is found i.e $this->{$rule['match']} which corresponds\n * to password, so in short, $this->password, if they don't match add error to the\n * errors array and pass the attribute and the rule as parameters to the addErrors function\n */\n\n if($ruleName === self::RULE_MATCH && $value !== $this->{$rule['match']})\n {\n $this->addErrors($attribute, self::RULE_MATCH);\n }\n\n /*\n * This control structure if the user input is unique to the database. If it is not,\n * it adds an error to the errors array and pass the attribute and\n * the rule as parameters to the addErrors function\n * The model class that returns the unique set of rules also returns the tableName and the attributes\n * (column names in db) specific to that model class\n * The unique rule is rendered differently to cater for various classes, an array with the unique\n * rule passed along with the self::class that calls the active model class which extends to model\n * and attr is also passed along withe corresponding attribute (this is optional)\n *\n */\n\n if($ruleName === self::RULE_UNIQUE)\n {\n /*\n * Here, the active class is gotten along with the tablename and attribute which we\n * call uniqueAttr specific to the active model class\n */\n $className = $rule['class'];\n $tableName = $className::tableName();\n $uniqueAttr = $rule['attr'] ?? $attribute;\n\n /*\n * We prepare a statement that selects all from the tablename gotten where uniqueAttr\n * is typed param :attr (to avoid sql injection)\n * :attr is bound to $value which is the user input (remember data was loaded before\n * passing it through the validate() function) and executed and object of the result is fetched\n */\n\n $statement = Application::$app->db->prepare(\"SELECT * FROM $tableName WHERE $uniqueAttr = :attr\");\n $statement->bindValue(\":attr\", $value);\n $statement->execute();\n $record = $statement->fetchObject();\n\n /*\n * If a record exists, add an Error, if not it returns true\n */\n if($record)\n {\n $this->addErrors($uniqueAttr, self::RULE_UNIQUE);\n }\n\n }\n /*\n * Added a rule valid start date and valid end date that check if the start date is before\n * the current date and if the end date is before the start date of the project\n * If the rule name has valid_start_date and the value is before (here we use < )\n * the date of today which is passed as a corresponding value of start_date in the\n * RULE_VALID_START_DATE array that is passed. Then add an error for the corresponding\n * attribute and rule passing them as arguments in the addErrors function\n */\n\n if ($ruleName === self::RULE_VALID_START_DATE && $value < $rule['start_date'])\n {\n $this->addErrors('start_date', self::RULE_VALID_START_DATE);\n }\n\n /*\n * If the attribute has rule valid_end_date and the value is before or equal to the\n * day of the project start date. Then add an error for the corresponding\n * attribute and rule passing them as arguments in the addErrors function\n */\n\n if ($ruleName === self::RULE_VALID_END_DATE && $value <= $this->{$rule['end_date']})\n {\n $this->addErrors('end_date', self::RULE_VALID_END_DATE);\n }\n\n }\n }\n /*\n * If all the above conditions are met it means validation passed for the data that was passed\n * to the validate function. If so it means the errors array is empty\n * Then if validate passed, return if empty errors array, as true. If errors array is not empty\n * validate function returns false\n */\n return empty($this->errors);\n\n }", "function validate()\n {\n if ( $this->options['required'] && $this->value == '' )\n {\n $this->validationError = $this->label . ' is required!';\n fWarn::getInstance()->add('Validation failed for ' . $this->name . ', field is required.');\n return false;\n }\n if ( isset($this->regex) )\n {\n $return = preg_match($this->regex, $this->value);\n if ( !$return )\n $this->fDebug->add('Could not validate \"' . $this->value . '\" against \"' . $this->regex . '\"', 1);\n return $return;\n }\n return true;\n }", "private function isValid(){\r\n $this->validator->required('title', 'Image Title Is Required');\r\n $this->validator->required('slideHint', 'Slide Name Is Required');\r\n $this->validator->image('image');\r\n return $this->validator->passes();\r\n }", "public function validation()\n {\n\n $this->validate(\n new Email(\n array(\n \"field\" => \"email\",\n \"required\" => true,\n )\n )\n );\n if ($this->validationHasFailed() == true) {\n return false;\n }\n }", "public function validation()\n {\n\n $this->validate(\n new Email(\n array(\n \"field\" => \"email\",\n \"required\" => true,\n )\n )\n );\n if ($this->validationHasFailed() == true) {\n return false;\n }\n }", "public function validation()\n {\n\n $this->validate(\n new Email(\n array(\n \"field\" => \"email\",\n \"required\" => true,\n )\n )\n );\n if ($this->validationHasFailed() == true) {\n return false;\n }\n }", "public function validation()\n {\n $this->validate(\n new Email(\n array(\n 'field' => 'email',\n 'required' => true,\n )\n )\n );\n\n if ($this->validationHasFailed() == true) {\n return false;\n }\n\n return true;\n }", "public function validation()\n {\n $this->validate(\n new Email(\n array(\n 'field' => 'email',\n 'required' => true,\n )\n )\n );\n\n if ($this->validationHasFailed() == true) {\n return false;\n }\n\n return true;\n }", "public function validation()\n {\n $this->validate(\n new Email(\n array(\n 'field' => 'email',\n 'required' => true,\n )\n )\n );\n\n if ($this->validationHasFailed() == true) {\n return false;\n }\n\n return true;\n }", "public function validation()\n {\n $this->validate(\n new Email(\n array(\n 'field' => 'email',\n 'required' => true,\n )\n )\n );\n\n if ($this->validationHasFailed() == true) {\n return false;\n }\n\n return true;\n }", "public function validation()\n {\n $this->validate(\n new Email(\n array(\n 'field' => 'email',\n 'required' => true,\n )\n )\n );\n\n if ($this->validationHasFailed() == true) {\n return false;\n }\n\n return true;\n }", "public function isValid() {\r\n $this->errors->clean();\r\n $this->validate();\r\n\r\n return $this->errors->isEmpty();\r\n }", "public function validate(): bool\r\n {\r\n array_walk(\r\n $this->rules,\r\n function ($rules, $field) {\r\n // $all_rules = array_merge(array_keys($rules), array_values($rules));\r\n try {\r\n // if (!isset($this->data[$field])) {\r\n // throw new FieldDoesNotExist(\"$field is requied\");\r\n // }\r\n\r\n // if (empty($this->data($field))) {\r\n // throw new FieldEmpty(\"$field can't be empty\");\r\n // }\r\n\r\n $this->validateField($field);\r\n } catch (FieldDoesNotExist | FieldEmpty $e) {\r\n // if (in_array(\"nullable\", $all_rules)) {\r\n // unset($this->data[$field]);\r\n // return;\r\n // }\r\n $this->addError($field, str_replace(\"_\", \" \", $e->getMessage()));\r\n }\r\n }\r\n );\r\n\r\n $this->valid = !boolval(count($this->getErrors()));\r\n\r\n $this->validated = true;\r\n\r\n return $this->valid;\r\n }", "public function validation()\n {\n\n $this->validate(\n new Email(\n array(\n 'field' => 'email',\n 'required' => true,\n )\n )\n );\n if ($this->validationHasFailed() == true) {\n return false;\n }\n }", "public function validation()\n {\n\n $this->validate(\n new Email(\n array(\n 'field' => 'email',\n 'required' => true,\n )\n )\n );\n if ($this->validationHasFailed() == true) {\n return false;\n }\n }", "private function isRuleChecked(): bool\n {\n $res = true;\n foreach ($this->getRules() as $method => $rule) {\n if (is_array($rule)) {\n foreach ($rule as $r) {\n $res = $res && $this->checkRule($method, $r);\n }\n } else {\n $res = $res && $this->checkRule($method, $rule);\n }\n }\n return $res;\n }", "public function isValid() {\n\t\treturn $this->is_valid;\n\t}", "public function validate(): bool\n {\n $result = true;\n foreach ($this->validation_data as $rule_name => $verifiable_data) {\n if (array_key_exists($rule_name, self::$know_validated_rule)) {\n if (class_exists(self::$know_validated_rule[$rule_name])) {\n /** @var $class BaseRule */\n $class = new self::$know_validated_rule[$rule_name](array_pop($verifiable_data));\n if (!$class->check($this->object, $verifiable_data)) {\n $result = false;\n $this->errors[$rule_name] = $class->getErrors();\n }\n } else {\n throw new ValidationClassNotFoundException(\"Class \". self::$know_validated_rule[$rule_name] . \" not found!\");\n }\n } else {\n throw new ValidationRuleNotFoundException(\"Rule '$rule_name' not found!\");\n }\n }\n return $result;\n }", "public function isValid()\n\t{\n\t\treturn $this->valid;\n\t}", "public function isValid()\n\t{\n\t\treturn $this->valid;\n\t}", "public function validateRules();", "public function getIsValid(){\r\n\t\treturn $this->isValid;\r\n\t}", "public function isValid() : bool {\n\t\t\treturn $this->isValid;\n\t\t}", "public function is_valid()\n\t{\n\t\tif (!array_key_exists('errors', $this->vars)) $this->validate();\n\t\treturn (!count($this->get_var('errors', array())));\n\t}", "protected function rule()\n {\n if (!key_exists('value', $this->admittedFields['Mobile']) && !key_exists('value', $this->admittedFields['Phone'])) {\n $this->setErrorMsg('At least mobile or phone number are required');\n\n return false;\n }\n\n return true;\n }", "public function isValid() {\n return $this->isAccepted();\n }", "public function validate(){\r\n\t\t// make validation\r\n\t\t$res = Validator::validate( $this->value, $this->constraints );\r\n\t\tif ( !$res )\r\n\t\t\t$this->has_error = true;\r\n\r\n\t\treturn $res;\r\n\t}", "public function validate()\n {\n return true;\n }", "public function validate()\n {\n return true;\n }", "public function validate()\n {\n return true;\n }", "public function validate()\n {\n return true;\n }", "public function validate()\n {\n return true;\n }", "public function valid() : bool\n {\n return $this->errors() ? false : true;\n }", "public function getIsValid(){\n return $this->isValid;\n }" ]
[ "0.8134079", "0.7997835", "0.7949278", "0.7919281", "0.7847517", "0.7822461", "0.7803436", "0.76242334", "0.74825335", "0.7478956", "0.7434276", "0.73734236", "0.72997475", "0.72766656", "0.72679114", "0.72175634", "0.72138244", "0.7207498", "0.72072244", "0.7204593", "0.7193237", "0.719122", "0.7180477", "0.7158428", "0.7119562", "0.7113741", "0.7095033", "0.70808625", "0.70656186", "0.7063977", "0.70504767", "0.7040689", "0.7038693", "0.702322", "0.6997715", "0.6989029", "0.69827986", "0.6957955", "0.6953303", "0.693774", "0.69308335", "0.69308335", "0.69308335", "0.69308335", "0.69090897", "0.69090897", "0.69082606", "0.69082606", "0.69082606", "0.69082606", "0.69082606", "0.6907946", "0.6906513", "0.6903731", "0.6903731", "0.6903731", "0.6903731", "0.6903731", "0.68877023", "0.68534404", "0.6826993", "0.68235135", "0.6817235", "0.68163925", "0.6814034", "0.67994845", "0.6794968", "0.67928606", "0.6787228", "0.67841166", "0.67768675", "0.67768675", "0.67768675", "0.6776756", "0.6776756", "0.6776756", "0.6776756", "0.6776756", "0.6776189", "0.6775836", "0.67753583", "0.67753583", "0.67751616", "0.6766938", "0.67632324", "0.67496836", "0.67496836", "0.6748262", "0.67426765", "0.6710668", "0.6708833", "0.6707874", "0.6707427", "0.6701415", "0.67003304", "0.67003304", "0.67003304", "0.67003304", "0.67003304", "0.66956264", "0.6688455" ]
0.0
-1
Get the validation error message.
public function message() { return 'The fields [Team ID, Phone and Sticky Phone Number ID] are required'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\n return 'The validation error message.';\n }", "public function message()\n {\n return 'The validation error messagess.';\n }", "public function getErrorMessage()\n {\n return $this->error_message;\n }", "public function getErrorMessage()\r\n {\r\n return $this->error_message;\r\n }", "public function get_error_message() {\n\t\treturn $this->error_message;\n\t}", "public function message()\n {\n return $this->errorText;\n }", "public function getMessage()\n {\n return $this->_error;\n }", "function getErrorMessage()\n\t{\n\t\t// Ah, we have a custom message, use that.\n\t\tif ($this->errorMessage) {\n\t\t\treturn $this->errorMessage;\n\t\t}\n\t\t\n\t\t// Field is required, but empty, so return a fill in this form message.\n\t\telse if ($this->required && $this->value == false) \n\t\t\treturn sprintf($this->getTranslationString(\"Please fill in the required '%s' field.\"), $this->label);\n\t\n\t\t// Have we got an empty error message? Create a default one\n\t\telse if (!$this->errorMessage) {\n\t\t\treturn sprintf($this->getTranslationString(\"There's a problem with value for '%s'.\"), $this->label);\n\t\t} \n\t}", "public function message()\n {\n return __(\"validation.{$this->error}\", ['attribute' => 'nomor sampel']);\n }", "public function getErrorMessage()\n {\n return $this->singleValue('//i:errorMessage');\n }", "public function getMessage()\n {\n return self::getMessageForError($this->value);\n }", "public function getMessage() {\n\n // Remove the 'validate_' prefix that GUMP adds to all broken rules.\n $key = str_replace('validate_', '', $this->rule);\n\n // Get the message template for this rule.\n $template = self::$messages[$key];\n\n // Inject our field label, and if this field has a parameter, inject that too.\n $message = preg_replace(array(\"/(%s)/\", \"/(%s)/\"), array($this->field->getLabel(), $this->parameter), $template, 1);\n\n // Return the message.\n return $message;\n }", "protected function getErrorMessage(): string\n\t{\n\t\tif($this->input !== null)\n\t\t{\n\t\t\t$errorMessage = $this->input->getErrorMessage();\n\t\t}\n\n\t\treturn $errorMessage ?? $this->defaultErrorMessage;\n\t}", "public function getErrorMessage()\n {\n // then re-apply the error code:\n if(($this->error_code !== 0) && empty($this->error_msg))\n {\n $this->setError($this->error_code);\n }\n return $this->error_msg;\n }", "public function message()\n {\n return $this->getError();\n }", "function get_error_message() {\n return $this->error_msg;\n }", "public function getErrorMessage() {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n\t{\n\t\treturn $this->errorMessage;\n\t}", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n {\n return $this->errorMessage;\n }", "public function message()\n {\n if ($this->error['type'] === 'custom') {\n return $this->error['message'];\n }\n\n $messages = null;\n\n if ($this->request) {\n $messages = $this->request->messages();\n }\n\n $message = $messages[\"{$this->error['attribute']}.check_file_{$this->error['type']}\"] ??\n trans(\"validation.check_file_{$this->error['type']}\");\n\n [$keys, $values] = Arr::divide($this->error['payload'] ?? []);\n\n $keys = \\array_map(function (string $key) {\n return \":{$key}\";\n }, $keys);\n\n return \\str_replace($keys, $values, $message);\n }", "public function message()\n {\n return $this->errorMsg;\n }", "public function getMessage()\n {\n return isset($this->data->failure_msg) ? $this->data->failure_msg : '';\n }", "function getMessage()\n {\n return ($this->error_message_prefix . $this->message);\n }", "public function message()\n {\n return $this->validationFailures;\n }", "public function message()\n {\n return $this->error_message;\n }", "public function getErrorMessage() : string\n {\n return $this->errorMessage;\n }", "public function message()\n {\n return $this->errorMessage;\n }", "public function message()\n {\n return $this->errorMessage;\n }", "public function getErrorMessage()\n\t{\n\t\treturn $this->_errorMessage;\n\t}", "public function getErrorMessage()\n {\n return $this->applyTemplate();\n }", "public function message()\n {\n return 'Invalid message mark up.';\n }", "public function getErrorMessage()\n {\n $errorMessages = $this->getErrorMessages();\n if (empty($errorMessages)) {\n return false;\n }\n return $errorMessages[0];\n }", "public function getErrMsg() {\n return $this->get(self::ERR_MSG);\n }", "public function getErrorMessage();", "public function getErrorMessage();", "public function getErrMsg()\n {\n return $this->get(self::ERRMSG);\n }", "public function getMessage(): string\n\t{\n\t\treturn $this->err->getMessage();\n\t}", "public function getErrorMessage(): string\n {\n if ($this->getSuccess()) {\n return '';\n }\n\n return (string) $this->errorMessage;\n }", "public function message(): string\n {\n return $this->errorMessage;\n }", "public function getErrorMessage() {\n return '';\n }", "public function errorMessage()\n {\n $errorMsg = '<strong>' . $this->getMessage() . \"</strong><br />\\n\";\n return $errorMsg;\n }", "public function getErrorMessage()\n {\n return $this->validator->errors()->all();\n }", "public function getMsgError() {\r\n return $this->msg_error;\r\n }", "public function message(): string\n {\n return $this->getValidationMessage(Str::snake(class_basename($this)), __('The :attribute size cannot exceed :max_size.', ['max_size' => $this->bytesToHuman($this->max_size)]));\n }", "protected function getMessage(\\Phalcon\\Validation $validator)\n {\n // get message\n $message = $this->getOption('message');\n if (! $message) {\n $message = $this->message;\n }\n return $message;\n }", "public function getMessage()\n {\n // check if any error message available.\n if (!is_null($this->_message)) {\n // return the message\n return $this->lang->line($this->_message) ? $this->lang->line($this->_message) : $this->_message;\n }\n\n // return nothing if previous condition does not apply\n return NULL;\n }", "public function errorMessage() {\n\t\t\treturn $this->strError; \n\t\t}", "public final function getLastErrorMsg() {\n return $this->lastErrorMsg;\n }", "public function getRuleError()\n {\n if(!isset($this->rules_objects_list[$this->table_name]))\n return '';\n\n //current table rules object\n $l_target = $this->rules_objects_list[$this->table_name];\n\n if($l_target->rules_error_flag)\n return $l_target->rules_error_message;\n\n return '';\n }", "public function message()\n {\n return \"Ошибочное значение\";\n }", "public function getErrorMessage(): string\n {\n static $errors = [\n UPLOAD_ERR_OK => 'No error found.',\n UPLOAD_ERR_INI_SIZE => 'The file \"%s\" exceeds your upload_max_filesize ini directive (limit is %d kb).',\n UPLOAD_ERR_FORM_SIZE => 'The file \"%s\" exceeds the upload limit defined in your form.',\n UPLOAD_ERR_PARTIAL => 'The file \"%s\" was only partially uploaded.',\n UPLOAD_ERR_NO_FILE => 'No file was uploaded.',\n UPLOAD_ERR_CANT_WRITE => 'The file \"%s\" could not be written on disk.',\n UPLOAD_ERR_NO_TMP_DIR => 'File could not be uploaded: missing temporary directory.',\n UPLOAD_ERR_EXTENSION => 'File upload was stopped by a PHP extension.',\n ];\n\n $errorCode = $this->error;\n $maxFilesize = $errorCode === UPLOAD_ERR_INI_SIZE ? self::getMaxFilesize() / 1024 : 0;\n $message = $errors[$errorCode] ?? 'The file \"%s\" was not uploaded due to an unknown error.';\n\n return sprintf($message, $this->getOriginalName(), $maxFilesize);\n }", "public function getErrMsg() {\n $errMsg = 'Error on line ' . $this->getLine() . ' in ' . $this->getFile()\n . '<br><b>Message: ' . $this->getMessage()\n . '</b><br>Exception Type: NoFormsFoundException';\n return $errMsg;\n }", "public function getErrorMessage(): ?string {\n\t\t// 1. a string with an error message (e.g. `{\"error\":{\"code\":404,\"errors\":\"invalid token\"},\"success\":false}`)\n\t\t// 2. an object (e.g. `{\"error\":{\"code\":120,\"errors\":{\"name\":\"payload\",\"reason\":\"required\"}},\"success\":false}`)\n\t\t//\n\t\t// Below is an attempt to make sense of such craziness.\n\t\t$error = $this->getValue('[error][errors]');\n\t\tif ($error === null) {\n\t\t\treturn null;\n\t\t}\n\n\t\tif (!is_array($error)) {\n\t\t\t$error = [\n\t\t\t\t'name' => 'generic',\n\t\t\t\t'reason' => $error,\n\t\t\t];\n\t\t}\n\n\t\treturn sprintf(\n\t\t\t'name=%s, reason=%s',\n\t\t\t(array_key_exists('name', $error) ? $error['name'] : 'missing'),\n\t\t\t(array_key_exists('reason', $error) ? $error['reason'] : 'missing')\n\t\t);\n\t}", "function getErrorMsg() {\n\t\treturn $this->errorMsg;\n\t}", "public function errorMessage()\n\t{\n\t\treturn $this->_source->errorMessage();\n\t}", "public function getMessage(): string\n {\n return $this->requireString('message');\n }", "public function getErrorMessage($input) {\n\t\treturn $input . ' is invalid.';\n\t}", "public function message()\n {\n return 'Invalid phone number format.';\n }", "public function getErrorMessage() {\n\t\tswitch( $this->error ) {\n\t\t\tcase TAN_NOT_FOUND : return \"Die TAN wurde nicht gefunden\";\n case REGISTRATION_USER_EXISTS : return \"Dieser Nutzer Existiert bereits\";\n\t\t}\n\t}", "public function message()\n {\n return $this->doorman->error;\n }", "public function message()\n {\n return trans('validation.custom.phone.error');\n }", "public function message()\n {\n return trans('validation.BTCValidation');\n //return trans('validation.uppercase');\n }", "public function getMessage(): string\n {\n return \"The $this->name field is not a valid date.\";\n }", "public final function last_error_message()\n {\n return isset($this->error) ? $this->error['message'] : '';\n }", "public function getError(): string\n {\n return $this->Error;\n }", "public function getErrorMessage()\n {\n $error = $this->_checkoutSession->getErrorMessage();\n return $error;\n }", "function error() {\n return $this->error_message;\n }", "public function getError(){\n if (empty($this->getErrorCode())) {\n return null;\n }\n return $this->getErrorCode().': '.$this->getErrorMessage();\n }", "public function getError(): string\n {\n return $this->error;\n }", "public function getErrorMessage():? string\n {\n return $this->errorMessage;\n }", "public function publicErrorMessage()\n\t{\n\t\t$errorMsg = $this->getMessage().' is not a valid E-Mail address.';\n\t\treturn $errorMsg;\n\t}", "public function message()\n {\n switch ($this->errorType) {\n case self::ERROR_TYPE_NUMERIC:\n $msg = 'Điện thoại phải là chữ số';\n break;\n case self::ERROR_TYPE_LENGTH:\n $msg = 'Điện thoại phải có độ dài từ 10 hoặc 11 số';\n break;\n default:\n $msg = 'Số điện thoại không đúng định dạng';\n break;\n }\n return $msg;\n }", "protected function getErrorFlashMessage() {\n\t\treturn $this->translate('tx_placements.error'.'.organization.'. $this->actionMethodName);\n\t }", "public function getFailedMessage()\n {\n if (array_key_exists(\"failedMessage\", $this->_propDict)) {\n return $this->_propDict[\"failedMessage\"];\n } else {\n return null;\n }\n }", "public function errorMessage() { return $this->errorMessage; }", "public function getErrorMessage()\n {\n return null;\n }", "public function errorMessage()\n {\n return $this->provider->errorMessage;\n }", "public function errorMessage()\n {\n return $this->error;\n }", "function errorMsg() {\r\n return \r\n $this->resultError;\r\n }", "public function message()\n {\n return 'Recaptcha validation failed.';\n }", "public function messages()\n {\n return VALIDATION_MESSAGE;\n }", "public function messages()\n {\n return VALIDATION_MESSAGE;\n }", "public function getValidationErrorMessages() {}", "public static function message()\n {\n return __('validation.translate_required');\n }", "public function getError() : string\r\n {\r\n return $this->strError;\r\n }", "public function message()\n {\n return 'The Phone Number does not match the expected format';\n }", "public function message()\n {\n return 'O Titulo de eleitor digitado é invalido';\n }", "public function getErrorText(){\n return $this->error;\n }", "public function getValidatedMessage(){\n $valid = $this->getIsValid();\n if(!is_null($valid)){\n if($valid === false) $key = 'error';\n else $key = 'success';\n return \"<p class=\\\"form_{$key}\\\">{$this->validatedMessage[$key]}</p>\";\n }\n return '';\n }", "public function message()\n {\n return 'Errores en plantilla<li>'.join('</li><li>',$this->invalid);\n }" ]
[ "0.8368853", "0.8368853", "0.8368853", "0.8368853", "0.8368853", "0.8368853", "0.8207248", "0.8094182", "0.8061137", "0.80309856", "0.8023962", "0.79981095", "0.7994271", "0.79576373", "0.7955562", "0.7948321", "0.7938317", "0.7914095", "0.78989285", "0.78862643", "0.78477675", "0.78278995", "0.7820734", "0.78084075", "0.78084075", "0.78084075", "0.78084075", "0.78084075", "0.78084075", "0.78084075", "0.78047746", "0.7791322", "0.777954", "0.77778727", "0.77716756", "0.77658075", "0.7762871", "0.7700995", "0.7700995", "0.7690562", "0.76759744", "0.7670985", "0.76627505", "0.7611973", "0.7593284", "0.7593284", "0.7588579", "0.75603616", "0.75542986", "0.75334644", "0.7519062", "0.7456365", "0.74313736", "0.7404993", "0.73731256", "0.73456687", "0.73453265", "0.7322456", "0.73109883", "0.73097974", "0.73096555", "0.7306417", "0.7298058", "0.7262625", "0.7258779", "0.7251916", "0.7245762", "0.7235462", "0.7227823", "0.7226286", "0.72256136", "0.7219457", "0.72138363", "0.72109324", "0.7205099", "0.7190278", "0.71763974", "0.7174699", "0.7172004", "0.7169085", "0.7161534", "0.71573865", "0.7155334", "0.7152703", "0.7149651", "0.71428394", "0.7142287", "0.7136937", "0.71314335", "0.71309406", "0.7130864", "0.71253085", "0.71253085", "0.71201915", "0.7118912", "0.71098405", "0.71092737", "0.71021503", "0.70993507", "0.7079352", "0.70751965" ]
0.0
-1
put your code here
public function __construct() { if (Eabi_Ipenelo_Calendar::get('show_link')) { add_action('wp_footer', array(&$this, 'link')); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n //\n \n }", "public function run()\n\t{\n\t\t//\n\t}", "public function preExecute(){\n\n\t\n\t}", "function script()\n {\n }", "public function run()\n {\n \n }", "public function run()\n {\n \n }", "public function custom()\n\t{\n\t}", "public function run()\n {\n //\n }", "public function run()\n {\n //\n }", "public function run()\r\n {\r\n\r\n }", "public function run(){\n parent::run();\n //Do stuff...\n }", "function run() {\r\n $this->set_demopage();\r\n\r\n $options_def = array(\r\n __class__ => '', // code CSS. ATTENTION [ ] à la place des {}\r\n 'id' => ''\r\n );\r\n\r\n $options = $this->ctrl_options($options_def);\r\n\r\n // il suffit de charger le code dans le head\r\n $this->load_css_head($options[__class__]);\r\n\r\n // -- aucun code en retour\r\n return '';\r\n }", "public function run()\n {\n\n parent::run();\n\n }", "public function run()\n {\n\n }", "public function run()\n {\n\n }", "public function run()\n {\n\n }", "function execute()\r\n\t{\r\n\t\t\r\n\t}", "protected function doExecute()\n\t{\n\t\t// Your application routines go here.\n\t}", "function use_codepress()\n {\n }", "public function run()\n {\n // Put your code here;\n }", "function run()\r\n {\r\n }", "public function run()\n {\n }", "public function run()\n {\n }", "public function run()\n {\n }", "public function run()\n {\n }", "public function run() {\n }", "public static function run() {\n\t}", "public function onRun()\n {\n }", "public function run() {\n\t\t\\Yii::trace(__METHOD__.'()', 'sweelix.yii1.admin.core.widgets');\n\t\t$content = ob_get_contents();\n\t\tob_end_clean();\n\t\tif(\\Yii::app()->user->isGuest === true) {\n\t\t\techo $content;\n\t\t} else {\n\t\t\t$this->render('header');\n\t\t}\n\t}", "public function run() {\n }", "public function render_content() {\n\t}", "public function main()\r\n {\r\n \r\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "public function render_content()\n {\n }", "function render() ;", "function execute()\n {\n }", "public function run(): void\n {\n //\n }", "protected function main()\n /**/\n {\n parent::run();\n }", "public function execute()\n {\n //echo __('Hello Webkul Team.');\n $this->_view->loadLayout();\n $this->_view->renderLayout();\n }", "public function render()\n {\n //\n }", "public function run(){\n echo CHtml::closeTag( \"div\" );\n $this->registerScript();\n }", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "public function run();", "function __desctuct(){\r\n\t\t?>\r\n\r\n\t\t</body>\r\n\t\t</html>\r\n\t\t<?php\r\n\t}", "public function run(){}", "public function demo()\n {\n // xu ly logic\n }", "protected function render_content()\n {\n }", "protected function render_content()\n {\n }", "protected function render_content()\n {\n }", "protected function render_content()\n {\n }", "public function render(){\n\t\t\n\t}", "public static function main(){\n\t\t\t\n\t\t}", "public function render() {\r\n\t\t\r\n\t}", "public function main()\n\t{\n\t}", "function handle() ;", "public function execute() {\n\t}", "function preProcess()\n {\t\n parent::preProcess( );\n\t\t \n\t}", "public function run() {}", "public\n\n\tfunction generate_code()\n\t{\n\t\t$data[\"hitung\"] = $this->Madmin->buat_code();\n\t\t$this->load->view('admin/Generate_code', $data);\n\t}", "public function display_code() {\n\t\techo '<h1>Premise Demo Page</h1>\n\t\t<div class=\"span10\">';\n\n\n\t\t\t// test a form with all possible fields.\n\t\t\t// pass your own arguments if you'd like.\n\t\t\t// new PWP_Demo_Form();\n\n\t\t\t// Premise_test::fields();\n\t\t\t// Premise_test::fields_hooks();\n\t\t\t// Premise_test::fields_demo();\n\t\t\t// Premise_test::videos_embed();\n\t\t\t// Premise_test::fields_duplicate();\n\t\t\t// Premise_test::google_map();\n\t\t\t// Premise_test::grids();\n\n\t\techo '</div>';\n\t}", "function main()\r\n {\r\n $this->setOutput();\r\n }", "public function run()\n\n {\n DB::table('actives')->insert([\n 'script_tag' => 0,\n 'status' =>0\n \n ]);\n //\n }", "protected function _exec()\n {\n }", "public function run() {\n\n\t\t// generate random string md5(uniqid(rand(), true));\n\t\t$this->goneta();\n\t\t$this->pamparam();\n\t\t$this->insideOut();\n\t\t$this->morfoza();\n\t\t$this->basorelief();\n\t\t$this->acajouWasZuSagen();\n\t}", "protected function after_load(){\n\n\n }", "public function work()\n {\n }", "function run();", "function run();", "public function run() {\n\t\t// include other classes\n\t\trequire_once plugin_dir_path ( __FILE__ ) . 'class-top-ratter-render.php';\n\t\trequire_once plugin_dir_path ( __FILE__ ) . 'class-top-ratter-sso.php';\n\t\t\n\t\t// enque styles for this plugin\n\t\tadd_action ( 'wp_enqueue_scripts', array (\n\t\t\t\t$this,\n\t\t\t\t'register_plugin_styles' \n\t\t) );\n\t\t// enque jquery scripts for this plugin\n\t\tadd_action ( 'wp_enqueue_scripts', array (\n\t\t\t\t$this,\n\t\t\t\t'register_plugin_script' \n\t\t) );\n\t\t// add submit action form to redirect and catch from admin.php\n\t\tadd_action ( 'admin_post_tr_action', array (\n\t\t\t\t$this,\n\t\t\t\t'prefix_admin_tr_action' \n\t\t) );\n\t\t\n\t\t// check if plugin tables exist\n\t\t$this->table_check ();\n\t\t\n\t\t// instantiate the render class for shortcodes to work\n\t\t$shortcodes = new Top_Ratter_Render ();\n\t}", "function tap_run_page_handler() \n {\n include(\"/var/www/html/run/tap_run.php\");\n \n $params = cargaArray('Torneo Argentino de Programación', $form, '');\n \n include('body.php'); \n }", "function run() {\r\n $this->view->data=$this->model->run();\r\n }", "function custom_construction() {\r\n\t\r\n\t\r\n\t}", "public function run()\n {\n \\App\\Model\\TemplateLib::create([\n 'name' => 'FNK Test',\n 'stylesheet' => 'body {background:white};',\n 'javascript' => '',\n 'code_header' => $this->codeHeader,\n 'code_footer' => $this->codeFooter,\n 'code_index' => $this->codeIndex,\n 'code_search' => '<h1>saya di search</h1>',\n 'code_category' => '<h1>saya di category</h1>',\n 'code_page' => $this->codePage,\n 'code_post' => $this->codePost,\n 'code_about' => '<h1>saya di about</h1>',\n 'code_404' => '<h1>saya di 404</h1>',\n ]);\n }", "public function helper()\n\t{\n\t\n\t}", "public function drawContent()\n\t\t{\n\t\t}" ]
[ "0.60586566", "0.59289104", "0.5919654", "0.5899511", "0.5838488", "0.5838488", "0.58356965", "0.5814271", "0.5814271", "0.57796824", "0.5701954", "0.5700516", "0.5685669", "0.5684617", "0.5684617", "0.5684617", "0.5639208", "0.563027", "0.56278986", "0.56231225", "0.5620407", "0.56068903", "0.56068903", "0.56068903", "0.56016845", "0.5597219", "0.5595339", "0.5591545", "0.558057", "0.55636305", "0.55034596", "0.5487096", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.5477182", "0.54594034", "0.5446425", "0.5446197", "0.54451364", "0.54319674", "0.5426377", "0.54072845", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.5401934", "0.53981763", "0.5394762", "0.5392594", "0.5392164", "0.5391672", "0.5391672", "0.5391672", "0.5386191", "0.53823715", "0.5374112", "0.5373851", "0.5371084", "0.5369742", "0.53666246", "0.5365522", "0.5358571", "0.53542304", "0.5353158", "0.5345768", "0.5339915", "0.53389114", "0.53339213", "0.5332912", "0.5323722", "0.5323722", "0.5321411", "0.5318719", "0.53184503", "0.5300535", "0.5290181", "0.52723837", "0.52723306" ]
0.0
-1
Return if loading cache is success If $object is ICacheable, call setCache() method. If not, leave the value in $object
public static function load($area, $name, &$value, $context = null) { if (!RuntimeConfiguration::$cache) { return false; } try { $cacheDir = self::getCacheDir($area); $cacheFileName = self::getCacheFileName($name, $context); $cachePath = $cacheDir . $cacheFileName; if (!file_exists($cachePath)) { return false; } $cache = file_get_contents($cachePath); if ($value instanceof ICacheable) { $value->setCache($cache); } else { $value = unserialize($cache); } return true; } catch (Exception $ex) { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setFromCache($object)\r\n {\r\n // TODO: Implement setFromCache() method.\r\n }", "protected function loadCacheData()\n\t{\n\t\t//is it enabled?\n\t\tif ($this->useObjectCaching)\n\t\t{\n\t\t\t//get our cache data... is it there?\n\t\t\t$data = $this->getCache();\n\t\t\tif ($data)\n\t\t\t{\n\t\t\t\t//load it, and we're good.\n\t\t\t\t$this->hydrate($data);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function updateData(CacheableInterface $object)\n {\n $cacheKey = $object->getCacheKey();\n $data = $object->getData();\n\n if ($data) {\n $this->cache->set($cacheKey, $data);\n }\n\n return $data;\n }", "public function setCache()\n\t{\n\t\treturn CacheBot::set($this->getCacheKey(), $this->getDataToCache(), self::$objectCacheLife);\n\t}", "public function enableObjectCache() {\n\t\t$this->asset_model->useObjectCaching = true;\n\t}", "function loadCacheObject ()\n {\n if (!$this->cacheObjectLocked()) {\n $return = $this->cacheObjectContents($this->cacheObjectId);\n } else {\n $return = $this->loadLockedObject();\n }\n\n return $return;\n }", "public static function store($object){\n\t\t\tif(!is_object($object)){\n\t\t\t\tLogger::warning(MessageUtility::CACHE_LOAD_WARNING, \"A primitive value of type \".gettype($object).\" cannot be cached.\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t//Check that the specified $object is an object of PersistentClass\n\t\t\t$objectClass = Mirror::reflectClass($object);\n\t\t\tif(!$objectClass->descendsFrom(\"Wadapi\\Persistence\\PersistentClass\")){\n\t\t\t\tLogger::warning(MessageUtility::CACHE_LOAD_WARNING, \"Object of class \".get_class($object).\" is not a descendant \".\n\t\t\t\t\t\t\t\t \"of PersistentClass and cannot be stored in cache.\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tself::$cache[$object->getId()] = $object;\n\t\t}", "protected function cache()\n\t{\n\t\tif ( ! $this->executed OR $this->result === NULL)\n\t\t\treturn;\n\n\t\tif ($this->config['cache'] === FALSE OR ! ($this->cache instanceof Cache))\n\t\t\tthrow new Kohana_User_Exception('Curl.cache()', 'Cache not enabled for this instance. Please check your settings.');\n\n\t\t// Store the correct data\n\t\t$cache_data = array\n\t\t(\n\t\t\t'result' => $this->result,\n\t\t\t'info' => $this->info,\n\t\t);\n\n\t\treturn $this->cache->set($this->create_cache_key(), $cache_data, $this->config['cache_tags'], $this->config['cache']);\n\t}", "protected function loadFromCache() {}", "private function cacheFetch() {\n //$data = cache_get($this->id, 'cache');;\n $data = NULL;\n if ($data) {\n foreach ($this->properties as $prop) {\n if (isset($data->data[$prop]) && !empty($data->data[$prop])) {\n $this->$prop = $data->data[$prop];\n }\n }\n }\n }", "public function setLoadedFromCache($value)\n {\n $this->loadedFromCache = (bool) $value;\n }", "public function load(): void\n {\n $list = $this->localCache->getObject($this->key);\n $value = $this->resultExtractor->extractObjectFromList($list, $this->targetType);\n $this->resultObject->setValue($this->property, $value);\n }", "public function isCacheable()\n {\n return $this->cacheable;\n }", "public function cacheObjectInfo($obj) {\n\t\t$this->_link_cache[$obj->id] = $obj->links;\n\t\t$this->_title_cache[$obj->id] = $obj->properties[\"cmis:name\"]; // Broad Assumption Here?\n\t\t$this->_objTypeId_cache[$obj->id] = $obj->properties[\"cmis:objectTypeId\"];\n\t\tif (isset($obj->properties[\"cmis:changeToken\"])) {\n\t\t\t$this->_changeToken_cache[$obj->id] = $obj->properties[\"cmis:changeToken\"];\n\t\t}\n\t}", "public function setCaching($cache);", "protected function cacheModel()\n {\n $xmlObject = $this->getSimpleXmlObject();\n if ($xmlObject === null) {\n return;\n }\n\n $this->cache = $this->convertItem($xmlObject);\n }", "protected function _loadCache()\n {\n return false;\n }", "private function _checkCache()\r\n {\r\n // get a string representation of the object\r\n ob_start();\r\n var_dump(get_object_vars($this));\r\n $buffer = ob_get_clean();\r\n \r\n // build the hash for this object\r\n $hash = md5($buffer);\r\n \r\n // check if the cache file exists, if it does use it\r\n if (file_exists(\"{$this->_config['paths']['cache']}/{$hash}\")){\r\n die(file_get_contents(\"{$this->_config['paths']['cache']}/{$hash}\"));\r\n }\r\n }", "function object_cache_flush() {\n\tglobal $ts_object_cache;\n\n\treturn $ts_object_cache->flush();\n}", "public function isLoadedFromCache()\n {\n return $this->loadedFromCache;\n }", "public function is_use_cache()\r\n {\r\n return $this->cache;\r\n }", "public function isCached() {}", "public function cache() {\r\n\t\t$this->resource->cache();\r\n\t}", "protected function saveToCache() {}", "public function set_from_cache() {\n\t\t$this->from_cache = true;\n\t}", "public function setObjToCache($key, $value, $timeToCache = 0);", "public function isCacheEnabled(){\n return(true);\n }", "public function isCacheEnabled(){\n return(true);\n }", "public function writeToCache(CacheObject $object) {\n $type = $object->getType();\n $id = $object->getId();\n\n $this->readType($type);\n\n if (!array_key_exists($type, $this->cache)) {\n $this->cache[$type] = array();\n }\n\n $this->cache[$type][$id] = $object;\n }", "private function _loadCacheObj()\n {\n $cache = new mime_type_cache();\n self::$_mime_type_obj = $cache->getCache();\n\t\treturn;\n }", "public function updateCache();", "function updateCacheObject ($contents)\n {\n $return = FALSE;\n if ($this->cacheObjectExists()) {\n if (!$this->cacheObjectLocked()) {\n //if object exists lock it\n if ($this->lockCacheObject()) {\n if ($this->writeCacheObject($contents)) {\n if ($this->unlockCacheObject()) {\n $return = TRUE;\n }\n }\n }\n $return = $contents;\n } else {\n $return = $this->loadLockedObject();\n }\n } else {\n $return = $this->writeCacheObject($contents);\n }\n\n return $return;\n }", "private function loadCache(): void\n {\n //====================================================================//\n // Safety Check\n if (!is_string($this->cacheKey) || empty($this->cacheKey)) {\n return;\n }\n //====================================================================//\n // Connect to Apcu Cache\n $this->cacheAdapter = new ApcuAdapter();\n //====================================================================//\n // Load Links from Cache\n try {\n /** @var array $cache */\n $cache = $this->cacheAdapter->get($this->cacheKey, function (ItemInterface $item): array {\n $item->expiresAfter(self::$cacheTtl);\n\n return array();\n });\n $this->cache = $cache;\n $this->cacheItem = $this->cacheAdapter->getItem($this->cacheKey);\n } catch (InvalidArgumentException $e) {\n $this->cache = array();\n }\n //====================================================================//\n // Load Empty Value\n if (!isset($this->cache)) {\n $this->cache = array();\n }\n }", "public function getFromCache() {}", "public function isCacheEnabled()\n {\n return $this->cache;\n }", "protected function initializeCache() {}", "protected function initializeCache() {}", "public function cacheParentCall($object, $method, $args)\n {\n $cache_key = null;\n\n if (function_exists('spl_object_id')) {\n $cache_key = spl_object_id($object);\n } else {\n $cache_key = spl_object_hash($object);\n }\n\n $cache_key .= '-'.\n get_class($object).\n '::'.\n $method;\n\n if ($args) {\n // Fix object arguments\n $cacheArgs = array_map(function($el) {\n if (is_object($el)) {\n if (function_exists('spl_object_id')) {\n return spl_object_id($el);\n } else {\n return spl_object_hash($el);\n }\n }\n return $el;\n }, $args);\n\n $cache_key .= '-'.implode('-', $cacheArgs);\n }\n\n if (null !== $value = $this->get($cache_key))\n {\n return $this->get($cache_key);\n }\n\n $result = $object->parentCall($method, $args);\n $this->put($cache_key, $result);\n\n return $result;\n }", "public function isCached(): bool;", "public function setIsCallForCache($blIsCallForCache = null)\n {\n $this->_blIsCallForCache = $blIsCallForCache;\n }", "public function setCacheable(bool $value) {\n $this->cacheable = $value;\n }", "public function enableCaching()\n {\n $this->cache = true;\n }", "protected function flushCached()\n\t{\n\t\t$this->objectCache = [];\n\t}", "public function isCacheEnabled() {\n\t\treturn $this->cache;\n\t}", "public function wasCached();", "public function isLazyLoadableObject()\n {\n return $this->lazyLoadable;\n }", "function object_cache_reset() {\n\tglobal $ts_object_cache;\n\n\treturn $ts_object_cache->reset();\n}", "function object_cache_set($key, $data, $flag = '', $expire = 0) {\n\tglobal $ts_object_cache;\n\n\treturn $ts_object_cache->set($key, $data, $flag, $expire);\n}", "public function setUpCache();", "private function readCache(): void{\n //stdClass é uma classe predefinido ou dinamica\n $this->cache = new stdClass();\n if(file_exists('cache.cache')){\n $this->cache = json_decode(file_get_contents('cache.cache'));\n }\n }", "public function getIsCallForCache()\n {\n return $this->_blIsCallForCache;\n }", "private function _shouldBeCached()\n {\n $item = $this->repo->get(SettingKeys::CACHE_SETTINGS);\n //The setting failed to fetch, don't cache value to be on the safe side.\n if (!$item) {\n Log::channel('runtime')->warning(\n '[SettingsManager:39] Failed to fetch setting.',\n ['key' => SettingKeys::CACHE_SETTINGS]\n );\n return false;\n }\n return $item->value;\n }", "function wp_start_object_cache()\n {\n }", "function wp_cache_init()\n{\n global $wp_object_cache;\n\n if (! ($wp_object_cache instanceof WP_Object_Cache)) {\n $fail_gracefully = ! defined('WP_REDIS_GRACEFUL') || WP_REDIS_GRACEFUL;\n\n $wp_object_cache = new WP_Object_Cache($fail_gracefully);\n }\n}", "public function getCacheable() : bool {\n return $this->cacheable;\n }", "private function updateObject($name,$object){\n $this->cache->set($name, $object);\n }", "public function isCacheEnabled()\n {\n return $this->isCacheEnabled;\n }", "public function should_suggest_persistent_object_cache()\n {\n }", "public function set_cache(Rest_Response $response)\n\t{\n\t\t$headers = $response->headers();\n\n\t\tif ($cache_control = Rest_Arr::get($headers, 'cache-control'))\n\t\t{\n\t\t\t// Parse the cache control\n\t\t\t$cache_control = Rest_HTTP_Header::parse_cache_control($cache_control);\n\n\t\t\t// If the no-cache or no-store directive is set, return\n\t\t\tif (array_intersect($cache_control, array('no-cache', 'no-store')))\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t// Check for private cache and get out of here if invalid\n\t\t\tif (! $this->_allow_private_cache AND in_array('private', $cache_control))\n\t\t\t{\n\t\t\t\tif (! isset($cache_control['s-maxage']))\n\t\t\t\t{\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\n\t\t\t\t// If there is a s-maxage directive we can use that\n\t\t\t\t$cache_control['max-age'] = $cache_control['s-maxage'];\n\t\t\t}\n\n\t\t\t// Check that max-age has been set and if it is valid for caching\n\t\t\tif (isset($cache_control['max-age']) AND $cache_control['max-age'] < 1)\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\tif ($expires = Rest_Arr::get($headers, 'expires') AND ! isset($cache_control['max-age']))\n\t\t{\n\t\t\t// Can't cache things that have expired already\n\t\t\tif (strtotime($expires) <= time())\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}", "function _can_cache() {\n\t\treturn true;\n\t}", "abstract protected function cacheData();", "function updateCache() {\r\n return $this->_fHandler->updateCache();\r\n }", "public function testCacheSetRetrievement(){\n\n $this->initCache();\n\n $this->assertNotEmpty($this->cache);\n\n // Trying to set, save and get value:\n $this->cache->set('test_var', 'testvalue');\n $this->cache->save();\n $this->assertEquals('testvalue', $this->cache->get('test_var'));\n }", "function object_cache_init() {\n\tif (!isset($GLOBALS['ts_object_cache']))\n\t\t$GLOBALS['ts_object_cache'] = service('ObjectCache');\n}", "public static function enableCaching(): void\n {\n static::$caching = true;\n }", "public function preCacheUpdate()\n\t{\n\t\t$this->template->assign('updateCache', true);\n\t}", "public function isUseCache()\n {\n return $this->use_cache;\n }", "public function isCacheEnabled()\n {\n return $this->cacheEnabled;\n }", "public static function setCache($cache) {}", "function setCache($cache) {\n if ($cache !== ($oldCache = $this->cache)) {\n $this->cache = (bool) $cache;\n }\n }", "public function _AllowCache()\n {\n return true;\n }", "public function cache(): object\n {\n return $this->baseApp($this)->loadCache();\n }", "protected function extractDataFromCache()\n\t{\n\t\treturn false;\n\t}", "public function enableCache()\n\t{\n\t\t$this->_enableCache = true;\n\t}", "public function refresh(&$object)\n {\n if (!isset($this->objectsRepository[spl_object_hash($object)])) {\n return;\n }\n $repository = $this->objectsRepository[spl_object_hash($object)];\n $id = $repository->getHydrator()->unhydrate($object)[\"_id\"];\n $projection = $repository->getLastProjection($object);\n $collection = $repository->getCollection();\n $hydrator = $repository->getHydrator();\n\n if (null !== ($data = $collection->findOne(['_id' => $id], ['projection' => $projection]))) {\n $hydrator->hydrate($object, $data);\n $repository->cacheObject($object);\n } else {\n $object = null;\n }\n return $object;\n }", "public function isCacheEnabled(){\n return(false);\n }", "function training_object_cache_callback() {\n ctools_include('object-cache');\n $obj = new stdClass();\n $obj->title = 'my-item';\n $obj->data = training_menu();\n ctools_object_cache_set('training_object', $obj->title, $obj);\n //$obj = ctools_object_cache_get('training_object', 'my-item', TRUE);\n\n return t('Lorem ipsum');\n}", "protected function useCache()\n {\n // Should we use a cached version?\n if ($this->cache && $this->cacheExists()) {\n $this->templateOutput = $this->getCache();\n if ($this->templateOutput !== false) {\n return true;\n }\n }\n return false;\n }", "function cache($is_cached = null)\n {\n if (func_num_args() > 0) {\n if (is_bool($is_cached) == false) {\n throw new AjaxIllegalArgumentException('In class <b>' . get_class($this) . '</b> in method <b>cache($is_cached)</b>: Argument <b>$is_cached</b> MUST BE of type Boolean - <b style=\"color:red\">' . (is_object($is_cached) ? get_class($is_cached) : gettype($is_cached)) . '</b> given!');\n }\n $this->property(\"cache\", $is_cached);\n return $this;\n } else {\n return $this->property(\"cache\");\n }\n }", "function should_cache() {\n return array_key_exists('cache', $this->options) && $this->options['cache'] === TRUE;\n }", "function wp_cache_flush()\r\n\t{\r\n\t\tglobal $wp_object_cache;\r\n\t\t$wp_object_cache->flush();\r\n\t\treturn true;\r\n\t}", "public function afterLoad($object)\n {\n if(!$object->hasData($this->getAttribute()->getAttributeCode())) {\n $object->setData($this->getAttribute()->getAttributeCode(), $this->getDefaultValue());\n }\n }", "function object_cache_replace($key, $data, $flag = '', $expire = 0) {\n\tglobal $ts_object_cache;\n\n\treturn $ts_object_cache->replace($key, $data, $flag, $expire);\n}", "public function set_cache_rows($value) {\n\t\t$this->cache_rows = ($value===true);\n\t}", "public function setCache(Db_Cache $cache_object)\n\t{\n\t\t$this->cache_obj = $cache_object;\n\t\t\n\t\treturn $this;\n\t}", "function lockCacheObject ()\n {\n return copy($this->cacheObjectId, $this->cacheObjectId.'.lock');\n }", "public function cacheIsSet()\n {\n return is_a($this->Cache, CacheInterface::class);\n }", "public function loadFromCache() {\n parent::loadFromCache();\n $this->historyLinks = $this->data;\n }", "public function getObjFromCache($key);", "public function get_test_persistent_object_cache()\n {\n }", "function wp_clear_object_cache() {\n\tglobal $wpdb, $wp_object_cache;\n\n\t$wpdb->queries = array(); // or define( 'WP_IMPORTING', true );\n\n\tif ( ! is_object( $wp_object_cache ) ) {\n\t\treturn;\n\t}\n\n\t$wp_object_cache->group_ops = array();\n\t$wp_object_cache->stats = array();\n\t$wp_object_cache->memcache_debug = array();\n\t$wp_object_cache->cache = array();\n\n\tif ( is_callable( $wp_object_cache, '__remoteset' ) ) {\n\t\t$wp_object_cache->__remoteset(); // important\n\t}\n}", "final public function set(object $value): CacheItemInterface\n\t{\n\t\tif ($stm = $this->_prepare('INSERT INTO `Cache` (\n\t\t\t\t`key`,\n\t\t\t\t`value`,\n\t\t\t\t`expires`\n\t\t\t) VALUES (:key, :value, :expires)\n\t\t\tON DUPLIATE KEY UPDATE\n\t\t\t\t`value` = :value,\n\t\t\t\t`expires`= COALESCE(:expires, NULL);')) {\n\t\t\t$stm->bindValue(':key', $this->getKey());\n\t\t\t$stm->bindValue(':value', serialize($value));\n\n\t\t\tif (isset($this->_expires)) {\n\t\t\t\t$stm->bindValue(':expires', $this->_expires->format(DateTimeInterface::W3C));\n\t\t\t}\n\n\t\t\t$stm->execute();\n\t\t}\n\n\t\treturn $this;\n\t}", "public function cacheGet() {\n }", "public function cached()\n {\n // check cache is available else set cache and return\n return Cache::get('Klaravel\\Settings\\Setting', function () {\n $data = $this->get();\n Cache::put('Klaravel\\Settings\\Setting', $data, 60 * 24);\n\n return $data;\n });\n }", "public function setCacheable(bool $cacheable)\n {\n $this->cacheable = $cacheable;\n }", "function cacheObjectExists ()\n {\n return is_file($this->cacheObjectId);\n }", "public function beforeSave(\\Magento\\Framework\\DataObject $object)\n {\n parent::beforeSave($object);\n $this->_cache->clean([$this->cacheHelper->getCacheKeyCustomerDirectoryEntity($object->getEntityId())]);\n }", "public function setPropelCacheObject($object2ClassName, $object2Pk, $object = false)\n {\n $pk = $object2Pk;\n if ($pk === null && $object) {\n $pk = $object->getPrimaryKey();\n }\n\n if (is_array($pk)) {\n $npk = '';\n foreach ($pk as $k) {\n $npk .= urlencode($k) . '_';\n }\n } else {\n $pk = urlencode($pk);\n }\n\n $cacheKey = 'core/object-caching.' . strtolower(preg_replace('/[^\\w]/', '.', $object2ClassName)) . '/' . $pk;\n\n $clazz = $object2ClassName . 'Query';\n $object2 = $object;\n if (!$object2) {\n $object2 = $clazz::create()->findPk($object2Pk);\n }\n\n if (!$object2) {\n return false;\n }\n\n $this->getKrynCore()->setDistributedCache($cacheKey, serialize($object2));\n\n return $object2;\n\n }", "public function useCache()\n {\n return false;\n }", "function loadObject( &$object ) {\n\t\tif ($object != null) {\n\t\t\tif (!($cur = $this->query())) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ($array = mysql_fetch_assoc( $cur )) {\n\t\t\t\tmysql_free_result( $cur );\n\t\t\t\tmosBindArrayToObject( $array, $object, null, null, false );\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\tif ($cur = $this->query()) {\n\t\t\t\tif ($object = mysql_fetch_object( $cur )) {\n\t\t\t\t\tmysql_free_result( $cur );\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\t$object = null;\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public static function setCache($caching)\n{\nself::$caching=$caching;\n}" ]
[ "0.67894346", "0.6630795", "0.6452187", "0.6359012", "0.62834144", "0.62622637", "0.6189899", "0.6138124", "0.5941089", "0.5937183", "0.592958", "0.5767328", "0.5750837", "0.57381535", "0.5726987", "0.5723723", "0.57183444", "0.56622654", "0.5658137", "0.56467015", "0.56404924", "0.5630695", "0.56068796", "0.5598752", "0.55890334", "0.55798155", "0.55782634", "0.55782634", "0.5570587", "0.55643445", "0.555376", "0.5551095", "0.5520728", "0.55185276", "0.55176026", "0.55060136", "0.55005634", "0.54989684", "0.54945856", "0.547659", "0.5475076", "0.5463059", "0.5462934", "0.5459483", "0.5425908", "0.5416984", "0.5408022", "0.5404338", "0.540279", "0.5402457", "0.53982276", "0.5387256", "0.537437", "0.5354426", "0.5344208", "0.53430676", "0.53427577", "0.53403455", "0.53143156", "0.5314223", "0.53007036", "0.5297363", "0.5297055", "0.52732664", "0.5264039", "0.5263966", "0.5261747", "0.5247955", "0.5243989", "0.5239554", "0.52238804", "0.5220297", "0.5219", "0.5198585", "0.51958764", "0.5186741", "0.5181513", "0.51813275", "0.51711196", "0.51667523", "0.5151345", "0.5148226", "0.51406634", "0.5138685", "0.51348865", "0.51332635", "0.51191443", "0.5119136", "0.511851", "0.5116876", "0.51137376", "0.51081735", "0.5104776", "0.50979227", "0.5097302", "0.5095415", "0.5095115", "0.50910443", "0.5087849", "0.5086832", "0.5086243" ]
0.0
-1
Save cache If $object is ICacheable, call getCache() method. If not, serialize $object content
public static function save($area, $name, $value, $context = null) { if (!RuntimeConfiguration::$cache) { return false; } try { $cacheDir = self::getCacheDir($area); $cacheFileName = self::getCacheFileName($name, $context); $cachePath = $cacheDir . $cacheFileName; if ($value instanceof ICacheable) { $cache = $value->getCache(); } else { $cache = serialize($value); } static $permissionCode = 0774; $oldmask = umask(0); // Avoid readonly folder // Create folder if not exists if (!file_exists($cacheDir)) { mkdir($cacheDir, $permissionCode, true); chmod($cacheDir, $permissionCode); } // Create file file_put_contents($cachePath, $cache); chmod($cachePath, $permissionCode); umask($oldmask); // Restore default configuration return true; } catch (Exception $ex) { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function writeToCache(CacheObject $object) {\n $type = $object->getType();\n $id = $object->getId();\n\n $this->readType($type);\n\n if (!array_key_exists($type, $this->cache)) {\n $this->cache[$type] = array();\n }\n\n $this->cache[$type][$id] = $object;\n }", "private function writeCache($object)\r\n {\r\n $fp = fopen(WEMO_CACHE, 'w');\r\n fwrite($fp, json_encode($object));\r\n fclose($fp);\r\n }", "protected function saveToCache() {}", "protected function cacheSave() {\n $data = array();\n foreach ($this->properties as $prop) {\n $data[$prop] = $this->$prop;\n }\n //cache_set($this->id, $data, 'cache');\n }", "public function cacheObjectInfo($obj) {\n\t\t$this->_link_cache[$obj->id] = $obj->links;\n\t\t$this->_title_cache[$obj->id] = $obj->properties[\"cmis:name\"]; // Broad Assumption Here?\n\t\t$this->_objTypeId_cache[$obj->id] = $obj->properties[\"cmis:objectTypeId\"];\n\t\tif (isset($obj->properties[\"cmis:changeToken\"])) {\n\t\t\t$this->_changeToken_cache[$obj->id] = $obj->properties[\"cmis:changeToken\"];\n\t\t}\n\t}", "protected function setFromCache($object)\r\n {\r\n // TODO: Implement setFromCache() method.\r\n }", "public static function store($object){\n\t\t\tif(!is_object($object)){\n\t\t\t\tLogger::warning(MessageUtility::CACHE_LOAD_WARNING, \"A primitive value of type \".gettype($object).\" cannot be cached.\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t//Check that the specified $object is an object of PersistentClass\n\t\t\t$objectClass = Mirror::reflectClass($object);\n\t\t\tif(!$objectClass->descendsFrom(\"Wadapi\\Persistence\\PersistentClass\")){\n\t\t\t\tLogger::warning(MessageUtility::CACHE_LOAD_WARNING, \"Object of class \".get_class($object).\" is not a descendant \".\n\t\t\t\t\t\t\t\t \"of PersistentClass and cannot be stored in cache.\");\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tself::$cache[$object->getId()] = $object;\n\t\t}", "public function saveCache()\n {\n if($this->isCacheExists()){\n if($this->isUpdateRequired()){\n $this->updateCache();\n }\n } else {\n $this->packData()->writeFile();\n }\n }", "public function updateData(CacheableInterface $object)\n {\n $cacheKey = $object->getCacheKey();\n $data = $object->getData();\n\n if ($data) {\n $this->cache->set($cacheKey, $data);\n }\n\n return $data;\n }", "public function save()\n {\n $this->readCache();\n\n file_put_contents($this->filePath, json_encode($this->cacheContents));\n }", "public function afterSave(\\Magento\\Framework\\DataObject $object)\n {\n parent::afterSave($object);\n $this->_cache->save(\n $this->serializer->serialize($object->getData()),\n $this->cacheHelper->getCacheKeyCustomerDirectoryEntity($object->getEntityId()),\n [\n Config::TYPE_IDENTIFIER\n ]\n );\n }", "private function _saveCache($buffer)\r\n {\r\n // build the hash for this object\r\n $hash = md5($buffer);\r\n \r\n // save to the cache\r\n file_put_contents(\"{$this->_config['paths']['cache']}/{$hash}\", $buffer);\r\n }", "public function cache() {\r\n\t\t$key = $this->cacher.'.' . $this->hash();\r\n\t\tif (($content = pzk_store($key)) === NULL) {\r\n\t\t\t$content = $this->getContent();\r\n\t\t\tpzk_store($key, $content);\r\n\t\t}\r\n\t\techo $content;\r\n\t}", "public function enableObjectCache() {\n\t\t$this->asset_model->useObjectCaching = true;\n\t}", "private function saveCache(): void\n {\n //====================================================================//\n // Safety Check\n if (!isset($this->cacheItem) || !isset($this->cache) || empty($this->cache)) {\n return;\n }\n //====================================================================//\n // Save Links are In Cache\n $this->cacheItem->set($this->cache);\n $this->cacheAdapter->save($this->cacheItem);\n }", "function object_cache_flush() {\n\tglobal $ts_object_cache;\n\n\treturn $ts_object_cache->flush();\n}", "public function encode(ISerializable $Object, $flags = ISerializer::SERIALIZER_FLAGS)\n {\n self::$cache = self::$cache ?: new SplObjectStorage();\n\n // @codeCoverageIgnoreStart\n\n // PHP < 5.4 Check cache\n if (version_compare(PHP_VERSION, '5.4.0', '<')) {\n\n if (self::$cache->contains($Object)) {\n\n list($count, $cached, $time) = self::$cache[$Object];\n\n // Expire cache after 2 second\n if (time() < $time) {\n return $cached;\n }\n }\n\n self::$cache[$Object] = array(1, '', time() + 1);\n }\n\n // @codeCoverageIgnoreEnd\n\n // Export porperties of object\n $this->export($Object, $Properties);\n\n // Serialize properties\n $serialized = serialize($Properties);\n\n // @codeCoverageIgnoreStart\n\n // PHP < 5.4 Check cache\n if (version_compare(PHP_VERSION, '5.4.0', '<')) {\n // Update cache\n self::$cache[$Object] = array(0, $serialized, time() + 1);\n }\n\n // @codeCoverageIgnoreEnd\n\n // Done\n return $serialized;\n }", "public function setCache()\n\t{\n\t\treturn CacheBot::set($this->getCacheKey(), $this->getDataToCache(), self::$objectCacheLife);\n\t}", "protected function cacheModel()\n {\n $xmlObject = $this->getSimpleXmlObject();\n if ($xmlObject === null) {\n return;\n }\n\n $this->cache = $this->convertItem($xmlObject);\n }", "private function save_cache() : bool {\n\t\tif ($this->use_cache) {\n\t\t\tif (!$this->cache_path) {\n\t\t\t\tthrow new Exception('Cannot save cache when $cache_path is not set.');\n\t\t\t}\n\n\t\t\tfile_put_contents($this->cache_path, json_encode($this->posts, JSON_UNESCAPED_UNICODE));\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function saveToCacheForever();", "public function cache() {\r\n\t\t$this->resource->cache();\r\n\t}", "public function setObjToCache($key, $value, $timeToCache = 0);", "abstract public function save( $data = null, $cacheID = '', $serialize = true );", "public function save(CacheItemInterface $item): bool;", "public function storeObject($object,$key=null) {\n\t\tif (is_null($key)) {\n\t\t\t$key = get_class($object);\n\t\t}\n\t\treturn $this->set($key,serialize($object));\n\t}", "public function save()\r\n\t{\r\n\t\t$this->getCache()->save($this->key, ob_get_flush(), $this->frame);\r\n\t\t$this->key = $this->frame = NULL;\r\n\t}", "abstract public function getCacheContent( $cacheID = '', $unserialize = true );", "protected function saveToPackageCache() {}", "protected function saveCacheObject($hash)\n {\n if (!is_string($hash)) {\n throw new \\InvalidArgumentException(\"Invalid object ID hash supplied.\");\n }\n if (!isset($this->cacheObjects[$hash])) {\n throw new \\RuntimeException(\"Cannot save non-existent cache object.\");\n }\n $fileName = $this->getObjectsDirectory() . $hash;\n if (file_exists($fileName) && !is_writeable($fileName)) {\n throw new \\RuntimeException(\"Unable to overwrite existing cache data for object $objectId.\");\n }\n $oldUmask = umask(0);\n $check = file_put_contents($fileName, serialize($this->cacheObjects[$hash]), LOCK_EX);\n if ($check === false && $this->strict) {\n umask($oldUmask);\n throw new \\RuntimeException(\"Unable to save cache object $objectId.\");\n }\n @chmod($fileName, 0666);\n umask($oldUmask);\n }", "private function _checkCache()\r\n {\r\n // get a string representation of the object\r\n ob_start();\r\n var_dump(get_object_vars($this));\r\n $buffer = ob_get_clean();\r\n \r\n // build the hash for this object\r\n $hash = md5($buffer);\r\n \r\n // check if the cache file exists, if it does use it\r\n if (file_exists(\"{$this->_config['paths']['cache']}/{$hash}\")){\r\n die(file_get_contents(\"{$this->_config['paths']['cache']}/{$hash}\"));\r\n }\r\n }", "public function put ( $obj , $cache_key_field = null )\r\n\t{\r\n\t\tif ( $obj == null || is_array ( $obj ) ) return;\r\n\t\t\r\n\t\t$obj_clazz = get_class ( $obj );\r\n\t\t\r\n\t\tif ( $cache_key_field == null )\r\n\t\t{\r\n\t\t\t$id = $obj->getId();\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$getter_func_name = \"get{$cache_key_field}\";\r\n\t\t\t$id = \"{$cache_key_field}_\" . $obj->$getter_func_name();\r\n\t\t}\r\n//\t\techo \"\\nmyObjectCache::put: [\" . $obj_clazz . \"] [$id]\\n\"; \r\n\t\t\t\t\r\n\t\t$key = $obj_clazz . \"_\" . $id;\r\n\t\t\r\n\t\t// make the memory cache much shorter - for whn using it in batch processes. the memcahce can be cleared easily\r\n\t\tself::$s_memory_cache->put ( $key , $obj , (int)($this->m_expiry_in_seconds /10) ); \r\n\t\tself::$s_cache->put ( $key , $obj , $this->m_expiry_in_seconds);\r\n\t}", "static private function _update($object) {\n $type = $object->_type;\n $id = $object->_id;\n // Load cache if we havent already\n if (!isset(self::$cache[$type])) {\n self::$cache[$type] = self::getStack($type);\n }\n // Can't update, nothing found\n if(!isset(self::$cache[$type][$id])){\n return;\n }\n \n $objects = self::$cache[$type];\n $fileName = self::getFileNameByObject($object);\n $id = $object->_id;\n $objects[$id] = $object;\n $stringToWrite = '';\n foreach ($objects as $object) {\n $stringToWrite .= json_encode($object) . self::getConfig('delimiter') . PHP_EOL;\n }\n if (file_put_contents($fileName, $stringToWrite)) {\n return $id;\n }\n self::fail('Failed while updating ' . $id);\n }", "public function setCaching($cache);", "private function _cache_save($data_to_cache, $cache_id, $cache_group = 'global')\n {\n\n if ($data_to_cache == false) {\n $cache_file = $this->_cache_get_file_path($cache_id, $cache_group);\n $cache_file = normalize_path($cache_file, false);\n if (is_file($cache_file)) {\n @unlink($cache_file);\n }\n return false;\n } else {\n\n $mem_var = $this->mw_cache_mem;\n if (!isset($mem_var[$cache_group])) {\n $this->mw_cache_mem[$cache_group] = array();\n }\n\n if ($data_to_cache == '--true--') {\n $this->mw_cache_mem[$cache_group][$cache_id] = true;\n } else {\n $this->mw_cache_mem[$cache_group][$cache_id] = $data_to_cache;\n\n }\n\n $data_to_cache = serialize($data_to_cache);\n\n $this->_cache_write_to_file($cache_id, $data_to_cache, $cache_group);\n\n return true;\n }\n }", "private function saveCache($contents, \\Request\\Module $request)\n\t{\n\t\tif ($this->cache === true) {\n\t\t\t$registry = $this->cacheRegistry();\n\t\t\t$resource = $registry->create(\"response\", \"cache\", $request->params(), $contents);\n\t\t\t$registry->put($resource);\n\t\t}\n\t}", "public function cacheAnObject($key, $data, $options = array())\n\t{\n\t\t$cache = $this->get('dxFilecache')->getFileCache()->setOptions($options);\n\t\treturn $cache->setItem($key, $data);\n\t}", "public function saveToCache(){\r\n\t\t$n = \"hotspot_\" . $this->id;\r\n\r\n\t\t\\CacheHandler::setToCache($n,$this,20*60);\r\n\t}", "function saveItem(cacheItem $item);", "abstract function cache_output();", "protected function cache()\n\t{\n\t\tif ( ! $this->executed OR $this->result === NULL)\n\t\t\treturn;\n\n\t\tif ($this->config['cache'] === FALSE OR ! ($this->cache instanceof Cache))\n\t\t\tthrow new Kohana_User_Exception('Curl.cache()', 'Cache not enabled for this instance. Please check your settings.');\n\n\t\t// Store the correct data\n\t\t$cache_data = array\n\t\t(\n\t\t\t'result' => $this->result,\n\t\t\t'info' => $this->info,\n\t\t);\n\n\t\treturn $this->cache->set($this->create_cache_key(), $cache_data, $this->config['cache_tags'], $this->config['cache']);\n\t}", "function writeCacheObject ($contents)\n {\n $fp = fopen ($this->cacheObjectId, 'w');\n if ($fp != FALSE) {\n if (fputs ($fp, $contents)) {\n fclose($fp);\n $return = TRUE;\n } else {\n $return = FALSE;\n }\n } else {\n $return = FALSE;\n }\n\n return $return;\n }", "public function save($cache_name, $cache_data, $expires);", "public function saveCache($data) {\n\t\t$data = serialize($data);\n\t\ttry {\n\t\t\t$old = umask(0);\n\t\t\tumask(0);\n\t\t\tfile_put_contents($this->path, $data);\n\t\t\tchmod($this->path, 0755);\n\t\t\tumask($old);\n\t\t} catch (Exception $e) {\n\t\t\tutils::log('Err on saving data to file \"' . $this->path . '\": ' . $e->getMessage(), \"cache-err\");\n\t\t}\n\t}", "abstract protected function cacheData();", "public static function save_cache() {\n if (self::$_cache_invalid) {\n if (@file_put_contents(self::$_path_cache_file\n , serialize(self::$_abs_file_paths))) {\n error_log('failed to write absolute file path cache to: ' . self::$_path_cache_file);\n }\n }\n }", "protected function toCache()\n {\n return $this;\n }", "public function save($object);", "public function getCache();", "public function SerializeObject () {\n return serialize ($this);\n }", "public function save(CacheItemInterface $item)\n {\n return true;\n }", "public function save()\n\t{\n\t\t//we should do any cleanup if possible\n\t\tif ($this->isDirty())\n\t\t\t$this->clean();\n\t\n\t\t//save it to wherever\n\t\t$data = $this->saveData();\n\n\t\t//bust our cache.\n\t\tif ($this->useObjectCaching)\n\t\t\t$this->deleteCache();\n\t\t\n\t\treturn $data;\n\t}", "function training_object_cache_callback() {\n ctools_include('object-cache');\n $obj = new stdClass();\n $obj->title = 'my-item';\n $obj->data = training_menu();\n ctools_object_cache_set('training_object', $obj->title, $obj);\n //$obj = ctools_object_cache_get('training_object', 'my-item', TRUE);\n\n return t('Lorem ipsum');\n}", "public function storeCache() {\n\t\tif ($this->cacheFilePath) {\n\t\t\tfile_put_contents($this->cacheFilePath, serialize($this->classFileIndex));\n\t\t}\n\t}", "private function readCache(): void{\n //stdClass é uma classe predefinido ou dinamica\n $this->cache = new stdClass();\n if(file_exists('cache.cache')){\n $this->cache = json_decode(file_get_contents('cache.cache'));\n }\n }", "public function cache(): object\n {\n return $this->baseApp($this)->loadCache();\n }", "protected function _writeObject(\\SetaPDF_Core_Document $document, $objectId, $generation, $cache) {}", "private function saveFileToCache(FileInterface $file)\n {\n $cachedPath = \\sys_get_temp_dir() . self::CACHE_DIR . $file->getRelativePath();\n\n if (!\\is_dir(\\dirname($cachedPath))) {\n \\mkdir(\\dirname($cachedPath), 0700, true);\n }\n\n $cmd = \\sprintf('git show :%s > %s', $file->getRelativePath(), $cachedPath);\n $process = new Process($cmd);\n $process->run();\n\n $file->setCachedPath($cachedPath);\n\n return $file;\n }", "private function write_cache($content)\r\n\t{\r\n\t\tfile_put_contents($this->cache_file, $content);\r\n\t}", "public function save( CacheItemInterface $item ) {\n return true;\n }", "protected function dump_container($cache)\n\t{\n\t\ttry\n\t\t{\n\t\t\t$dumper = new PhpDumper($this->container);\n\t\t\t$proxy_dumper = new ProxyDumper();\n\t\t\t$dumper->setProxyDumper($proxy_dumper);\n\n\t\t\t$cached_container_dump = $dumper->dump(array(\n\t\t\t\t'class' => 'phpbb_cache_container',\n\t\t\t\t'base_class' => 'Symfony\\\\Component\\\\DependencyInjection\\\\ContainerBuilder',\n\t\t\t));\n\n\t\t\t$cache->write($cached_container_dump, $this->container->getResources());\n\t\t}\n\t\tcatch (IOException $e)\n\t\t{\n\t\t\t// Don't fail if the cache isn't writeable\n\t\t}\n\t}", "public function getCache()\n\t{\n\t\treturn CacheBot::get($this->getCacheKey(), self::$objectCacheLife);\n\t}", "function loadCacheObject ()\n {\n if (!$this->cacheObjectLocked()) {\n $return = $this->cacheObjectContents($this->cacheObjectId);\n } else {\n $return = $this->loadLockedObject();\n }\n\n return $return;\n }", "abstract public function getCache( $cacheID = '', $unserialize = true );", "protected function flushCached()\n\t{\n\t\t$this->objectCache = [];\n\t}", "function wp_cache_flush()\n{\n global $wp_object_cache;\n\n return $wp_object_cache->flush();\n}", "public function save(CacheItem $item): bool;", "private function updateObject($name,$object){\n $this->cache->set($name, $object);\n }", "public function save($object){\n\t\t$facade = FacadeGenerico::getInstance();\n\t\treturn $facade->adicionar($object);\n\t}", "public function save($id, $data)\n\t{\n\t\t$this->cache->load($id);\n\t\t$this->cache->save( serialize($data) );\n\t}", "public function getFromCache() {}", "public function cacheParentCall($object, $method, $args)\n {\n $cache_key = null;\n\n if (function_exists('spl_object_id')) {\n $cache_key = spl_object_id($object);\n } else {\n $cache_key = spl_object_hash($object);\n }\n\n $cache_key .= '-'.\n get_class($object).\n '::'.\n $method;\n\n if ($args) {\n // Fix object arguments\n $cacheArgs = array_map(function($el) {\n if (is_object($el)) {\n if (function_exists('spl_object_id')) {\n return spl_object_id($el);\n } else {\n return spl_object_hash($el);\n }\n }\n return $el;\n }, $args);\n\n $cache_key .= '-'.implode('-', $cacheArgs);\n }\n\n if (null !== $value = $this->get($cache_key))\n {\n return $this->get($cache_key);\n }\n\n $result = $object->parentCall($method, $args);\n $this->put($cache_key, $result);\n\n return $result;\n }", "function object_cache_set($key, $data, $flag = '', $expire = 0) {\n\tglobal $ts_object_cache;\n\n\treturn $ts_object_cache->set($key, $data, $flag, $expire);\n}", "public function saved(EntryInterface $entry)\n {\n $this->dispatch(new ClearHttpCache());\n\n return parent::saved($entry);\n }", "public function flushCache();", "protected function SaveKeysCache()\n\t{\n\t\tif (!is_dir(APPROOT.'data'))\n\t\t{\n\t\t\tmkdir(APPROOT.'data');\n\t\t}\n\t\t$hFile = @fopen($this->m_sCacheFileName, 'w');\n\t\tif ($hFile !== false)\n\t\t{\n\t\t\t$sData = serialize( array('keys' => $this->m_aKeys,\n\t\t\t\t\t\t\t\t\t'objects' => $this->m_aObjectsCache,\n\t\t\t\t\t\t\t\t\t'change' => $this->m_oChange,\n\t\t\t\t\t\t\t\t\t'errors' => $this->m_aErrors,\n\t\t\t\t\t\t\t\t\t'warnings' => $this->m_aWarnings,\n\t\t\t\t\t\t\t\t\t));\n\t\t\tfwrite($hFile, $sData);\n\t\t\tfclose($hFile);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tthrow new Exception(\"Cannot write to file: '{$this->m_sCacheFileName}'\");\n\t\t}\n\t}", "public function persist($object);", "function wp_start_object_cache()\n {\n }", "function updateCacheObject ($contents)\n {\n $return = FALSE;\n if ($this->cacheObjectExists()) {\n if (!$this->cacheObjectLocked()) {\n //if object exists lock it\n if ($this->lockCacheObject()) {\n if ($this->writeCacheObject($contents)) {\n if ($this->unlockCacheObject()) {\n $return = TRUE;\n }\n }\n }\n $return = $contents;\n } else {\n $return = $this->loadLockedObject();\n }\n } else {\n $return = $this->writeCacheObject($contents);\n }\n\n return $return;\n }", "final public function set(object $value): CacheItemInterface\n\t{\n\t\tif ($stm = $this->_prepare('INSERT INTO `Cache` (\n\t\t\t\t`key`,\n\t\t\t\t`value`,\n\t\t\t\t`expires`\n\t\t\t) VALUES (:key, :value, :expires)\n\t\t\tON DUPLIATE KEY UPDATE\n\t\t\t\t`value` = :value,\n\t\t\t\t`expires`= COALESCE(:expires, NULL);')) {\n\t\t\t$stm->bindValue(':key', $this->getKey());\n\t\t\t$stm->bindValue(':value', serialize($value));\n\n\t\t\tif (isset($this->_expires)) {\n\t\t\t\t$stm->bindValue(':expires', $this->_expires->format(DateTimeInterface::W3C));\n\t\t\t}\n\n\t\t\t$stm->execute();\n\t\t}\n\n\t\treturn $this;\n\t}", "public function saveElement(CacheElement $element)\n {\n $path = $element->getPath() . '/index.' . $element->getType(); //Type contains extension\n\n return $this->finder->writeFile($path, $element->getContent());\n }", "public function setCache(Db_Cache $cache_object)\n\t{\n\t\t$this->cache_obj = $cache_object;\n\t\t\n\t\treturn $this;\n\t}", "function cache($type, $parameters, $data)\n{\n if($type == 'browse')\n $filename = CACHE.'/browse.'.$parameters['browsenode'].'.'.$parameters['page'].'.'.$parameters['mode'].'.dat';\n if($type == 'search')\n $filename = CACHE.'/search.'.$parameters['search'].'.'.$parameters['page'].'.'.$parameters['mode'].'.dat';\n if($type == 'asin')\n $filename = CACHE.'/asin.'.$parameters['asin'].'.'.$parameters['mode'].'.dat';\n \n $data = serialize($data);\n \n $fp = fopen($filename, 'wb');\n if(!$fp||(fwrite($fp, $data)==-1))\n {\n echo ('<p>Error, could not store cache file');\n }\n fclose($fp);\n}", "function getCache() {\n\t\tif (!is_a($this->_cache, 'PubObjectCache')) {\n\t\t\t// Instantiate the cache.\n\t\t\timport('classes.plugins.PubObjectCache');\n\t\t\t$this->_cache = new PubObjectCache();\n\t\t}\n\t\treturn $this->_cache;\n\t}", "public function cache()\n {\n return $this->cache;\n }", "protected function getObject()\n\t{\n\t\tif( !isset( $this->object ) ) {\n\t\t\t$this->object = \\Aimeos\\MAdmin\\Cache\\Manager\\Factory::createManager( $this->context )->getCache();\n\t\t}\n\n\t\treturn $this->object;\n\t}", "public function saveData($objectId, $object, $expiry = null, $persistImmediately = false)\n {\n if (!is_string($objectId)) {\n throw new \\InvalidArgumentException(\"Invalid object ID supplied.\");\n }\n // If the expiry date has already passed, don't bother with it.\n if (!is_int($expiry) || $expiry < time()) {\n $expiry = null;\n }\n if (!isset($this->cacheInfo[\"objects\"][$objectId])) {\n $this->cacheInfo[\"objects\"][$objectId] = array();\n }\n $hash = sha1($objectId);\n $this->cacheInfo[\"objects\"][$objectId][\"store\"] = $hash;\n $this->cacheInfo[\"objects\"][$objectId][\"expiry\"] = $expiry;\n $this->cacheObjects[$hash] = $object;\n if ($persistImmediately === true) {\n $this->saveCacheObject($hash);\n } else {\n $this->markAsChanged($objectId);\n }\n }", "public function getObjFromCache($key);", "public function save(Varien_Object $object)\n {\n $start = microtime(true);\n $result = parent::save($object);\n\n if (!$object->isDeleted()) {\n //is captured separately\n $this->dispatch('model_resource_db_save', [\n 'object' => $object,\n 'time' => microtime(true) - $start\n ]);\n }\n\n return $result;\n }", "abstract public function save($cacheLabel, $cacheData, $expire = null);", "public function beforeSave(\\Magento\\Framework\\DataObject $object)\n {\n parent::beforeSave($object);\n $this->_cache->clean([$this->cacheHelper->getCacheKeyCustomerDirectoryEntity($object->getEntityId())]);\n }", "public function cache()\n {\n\n $route = Route::requireRoueFiiles();\n if (file_put_contents($this->cacheFile, serialize($route))) {\n echo 'OK';\n } else {\n echo 'ERROR';\n }\n }", "public function getContentCache()\n {\n return $this->contentCache;\n }", "protected function saveToCache($data)\r\n {\r\n if(extension_loaded('apc') && ini_get('apc.enabled')) {\r\n apc_store($this->getCacheKey(), $data, 0);\r\n }\r\n }", "private function _store()\n {\n return $this->redis->redis->set($this->clientPrefix, json_encode($this->cache));\n }", "public function saveDeferred(CacheItemInterface $item)\n {\n }", "public function cache($output)\n\t{\n\t\t$name = Kohana::config($this->type.'.cache_folder').'/'.md5($this->file).EXT;\n\t\t// add offset to cache file if using load() if not nested don't indent\n\t\tfile_put_contents($name, $output);\n\t\tunset($output);\n\t}", "function _write_cache($output){\n return false;\n\n return parent::_write_cache($output);\n }", "protected function _save(FieldInterface $field)\r\n {\r\n $this->arrayCache[$field->getId()] = $field;\r\n\r\n return $this->cache->save($field->getId(), $field);\r\n }", "public static function setCache($cache) {}", "protected function _store_to_object ($obj)\n {\n parent::_store_to_object ($obj);\n \n switch ($this->value_for ('state'))\n {\n case Testing:\n $obj->test (Defer_database_update);\n break;\n case Shipped:\n $obj->ship (Defer_database_update);\n break;\n case Locked:\n $obj->lock (Defer_database_update);\n break;\n }\n }" ]
[ "0.69816387", "0.6870417", "0.67739785", "0.6387498", "0.6299655", "0.62904984", "0.6243206", "0.615054", "0.6117879", "0.6066476", "0.6063975", "0.5990695", "0.5981172", "0.5977786", "0.59769136", "0.59560025", "0.5936963", "0.5912359", "0.5883404", "0.579319", "0.574472", "0.5683614", "0.56589735", "0.5647332", "0.55439776", "0.5542409", "0.5509872", "0.54950875", "0.5452431", "0.5419134", "0.5412132", "0.5406827", "0.5391468", "0.5374692", "0.5373899", "0.5356844", "0.53554374", "0.53484434", "0.5347185", "0.5305279", "0.5301041", "0.5291772", "0.5287675", "0.52839404", "0.5279624", "0.5272399", "0.5268769", "0.52638286", "0.5260575", "0.52375686", "0.5228182", "0.52196014", "0.52156276", "0.52119994", "0.5206591", "0.52040786", "0.51966506", "0.51916176", "0.5179587", "0.51782686", "0.5158261", "0.51568925", "0.51519334", "0.51452017", "0.5142155", "0.5139733", "0.51396686", "0.513734", "0.5135834", "0.512366", "0.5122261", "0.50980866", "0.5094634", "0.5080156", "0.5076264", "0.50703967", "0.5069922", "0.5066728", "0.5058195", "0.5052422", "0.5050457", "0.50457335", "0.50363725", "0.5033064", "0.5022311", "0.50188124", "0.50134355", "0.50110525", "0.5002757", "0.49909067", "0.49892062", "0.49889776", "0.49838275", "0.49742776", "0.49686745", "0.4956494", "0.49445915", "0.49386343", "0.49373665", "0.49370188", "0.49367756" ]
0.0
-1
Get directory of cache area
private static function getCacheDir($area) { return SolutionConfiguration::$cachesDir . "{$area}/"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_cache_directory() {\n\t\treturn $this->cache_directory;\n\t}", "public function getCacheDir();", "public function getCacheFolder()\n {\n\n return dirname(__FILE__) . '/../../store/cache/';\n }", "protected function get_cache_dir()\n\t{\n\t\treturn $this->cache_dir ?: $this->phpbb_root_path . 'cache/' . $this->get_environment() . '/';\n\t}", "public function getCachePath()\r\n\t{\r\n\t\t$path = AD.$this->getConfig()->getChildren(\"cache\")->getString(\"path\");\r\n\t\tif(!is_dir($path))\r\n\t\t{\r\n\t\t\tmkdir($path, 0777, true);\r\n\t\t}\r\n\t\treturn $path;\r\n\t}", "public function getCacheDir(){\r\n return $this->_cache->getDir();\r\n }", "public static function getCacheDir()\n {\n return self::getRoot() . DIRECTORY_SEPARATOR . 'cache';\n }", "protected function getCacheDirectory()\n {\n return $this->cache_dir;\n }", "protected function getCacheDirectory()\n {\n return $this->cache_dir;\n }", "public function getCacheDirectory() {}", "private function _dirCache()\n {\n return $this->_config['dir_cache'] . (!empty($this->_config['store_prefix']) ? $this->_config['store_prefix'] . '/' : '');\n }", "public function getCacheDirectory() {\n\t\treturn $this->cacheDirectory;\n\t}", "protected function getCacheDirectory()\n {\n return $this->cacheDirectory;\n }", "public static function getCacheDir()\n {\n return self::getDir('getCacheHome');\n }", "function get_cache_dir() {\n $cacheDir = 'pug_cache/';\n if (array_key_exists('cacheDir', $this->options)) {\n $cacheDir = $this->options['cacheDir'];\n }\n return $cacheDir;\n }", "protected function _getCacheDir()\n\t{\n\t\treturn $this->_cacheDir;\n\t}", "public function getCacheDir()\n {\n $fileSystem = new Filesystem();\n $path = 'var/cache/assets/'.$this->name.'/';\n \n if (!$fileSystem->exists($path)) {\n $fileSystem->mkdir($path);\n }\n \n return $path;\n }", "function getCacheDirectory()\n {\n global $serendipity;\n if ($this->cache_dir === null) {\n $this->cache_dir = $serendipity['serendipityPath'] . PATH_SMARTY_COMPILE . '/serendipity_event_avatar';\n }\n return $this->cache_dir;\n }", "public function getCachePath() {\r\n\t\treturn $this->getFramework()->getPath(Core::PATH_CACHE);\r\n\t}", "public function getCacheDir()\n {\n return __DIR__ . '/../var/cache/' . $this->getEnvironment();\n }", "public function getCacheDir()\n {\n return $this->rootDir . '/../cache/'.$this->getEnvironment();\n }", "public function getCachePath()\n {\n return $this->getSettingArray()[\"cache_path\"];\n }", "public function getCacheDir()\n {\n return $this->cacheDir;\n }", "public function getCacheDir()\n {\n return $this->cacheDir;\n }", "public function getCacheDir()\n {\n return $this->cacheDir;\n }", "public function getCacheDir()\n {\n return $this->cacheDir;\n }", "public function getCacheDirectoryPath()\n {\n return $this->cacheDirectoryPath;\n }", "public function getCacheDirectory() {\n \n return $this->cacheDirectory;\n \n }", "private function _getCachePath() {\n return DIR_PUBLIC_CACHE_SEARCHES . $this->_id . '.json';\n }", "public static function getCachePath()\n {\n $cacheDir = Config::get('media.cache_dir');\n $cacheFullPath = ROOT . self::getFilesPath() . $cacheDir;\n\n if(!file_exists($cacheFullPath))\n {\n if(!is_writable(ROOT . self::getFilesPath()) || !mkdir($cacheFullPath, Config::get('media.dir_chmod'), true))\n return false;\n }\n\n return $cacheDir;\n }", "public function getFolderCache() : string\n {\n $aeFiles = \\MarkNotes\\Files::getInstance();\n $aeFolders = \\MarkNotes\\Folders::getInstance();\n\n $folder = rtrim($this->folderWebRoot, DS).DS.'cache';\n\n if (!$aeFolders->exists($folder)) {\n $aeFolders->create($folder, CHMOD_FOLDER);\n }\n\n if ($aeFolders->exists($folder)) {\n if (!$aeFiles->exists($fname = $folder.'/.gitignore')) {\n $aeFiles->create($fname, '# Ignore everything'.PHP_EOL.'*');\n }\n\n if (!$aeFiles->exists($fname = $folder.'/.htaccess')) {\n $content = '# marknotes - Deny access to this folder'.PHP_EOL.\n 'deny from all';\n $aeFiles->create($fname, $content);\n }\n }\n\n return $folder.DS;\n }", "function cache_path()\n {\n $paths = getPaths();\n\n /**\n * Return false if the cache folder is NOT writable\n */\n if( ! is_writable($paths['cache']) )\n {\n return false;\n }\n\n return $paths['cache'];\n }", "public function getCache()\r\n {\r\n if ($this->exists('cache')) {\r\n return ROOT . $this->get('cache');\r\n }\r\n else\r\n return ROOT . '/cache';\r\n }", "public function getCacheDir(): string\n {\n return __DIR__ . '/../../../../../../var/cache/test';\n }", "public function getCachePath()\n {\n return $this->config->get('system.paths.root') . '/cache/' . $this->application . '/';\n }", "public function getCacheDir()\n {\n return __DIR__.'/../var/cache/'.$this->getEnvironment();\n }", "public function get_cache_dir()\n\t{\n\t\t// return the cache dir as entered by admin\n\t\t// or if cache dir is empty, get cache directory from plugin\n\t\t// directory, i.e. `bwp-minify/cache`, this is the default\n\t\t$cache_dir = !empty($this->options['input_cache_dir'])\n\t\t\t? $this->options['input_cache_dir']\n\t\t\t: $this->get_default_cache_dir();\n\n\t\t// allow overidden of the generated cache dir via constants\n\t\t$cache_dir = defined('BWP_MINIFY_CACHE_DIR') && '' != BWP_MINIFY_CACHE_DIR\n\t\t\t? BWP_MINIFY_CACHE_DIR : $cache_dir;\n\n\t\treturn apply_filters('bwp_minify_cache_dir', $cache_dir);\n\t}", "public function getImageCachePath()\n {\n return $this->getSettingArray()[\"image_cache_path\"];\n }", "public function getCachePath()\n {\n return $this->cachePath;\n }", "protected\n function setCachePath()\n {\n $cachePath = public_path() . config('album.paths.cache');\n\n if (!file_exists($cachePath)) mkdir($cachePath, 0777, true);\n\n return $cachePath;\n }", "public function getCacheDir():string {\n return $this->getProjectDir() . '/var/cache';\n }", "public function getKernelCacheDir()\n {\n return $this->kernelCacheDir;\n }", "function elgg_get_filepath_cache() {\n\tglobal $CONFIG;\n\tstatic $FILE_PATH_CACHE;\n\tif (!$FILE_PATH_CACHE) {\n\t\t$FILE_PATH_CACHE = new ElggFileCache($CONFIG->dataroot);\n\t}\n\n\treturn $FILE_PATH_CACHE;\n}", "public function get_default_cache_dir()\n\t{\n\t\t$plugin_wp_dir = plugin_dir_path($this->plugin_file);\n\t\t$cache_dir = trailingslashit($plugin_wp_dir) . 'cache/';\n\t\t$cache_dir = str_replace('\\\\', '/', $cache_dir);\n\n\t\treturn $cache_dir;\n\t}", "protected function cachePath() {\n if (isset($this->config['cachePath']))\n {\n return $this->config['cachePath'];\n }\n\n return $this->assetPath() . '/cache';\n }", "public function getCacheDir()\n {\n return __DIR__ . '/Fixtures/app/cache';\n }", "private function getDir() {\n return sprintf(\"%s/%s/\", app_path(), config('newportal.portlets.namespace'));\n }", "public function getCachedConfigPath();", "protected function getCacheFile(){\n\t\treturn $this->getPath() . $this->getCacheName();\n\t}", "protected function getObjectsDirectory()\n {\n return $this->cacheDirectory . self::DIR_OBJECTS . \"/\";\n }", "function get_cache($key) {\n return $this->get_cache_dir() . $key . '.cache';\n }", "protected function _getPath()\n {\n if (!defined('PATH_CACHE')) {\n throw new \\Exception(\"PATH_CACHE is NOT set!\");\n }\n return PATH_CACHE . $this->_group . DIRECTORY_SEPARATOR;\n }", "public function getCachePathString()\n\t{\n\t\treturn \"rs-\".$this->_maxWidth.\"-\".$this->_maxHeight.\"-\".$this->_maintainAspectRatio.\"-\".$this->_scaleUp;\n\t}", "public function getDiskCachingDirectory()\n {\n return $this->diskCachingDirectory;\n }", "public function getDiskCachingDirectory()\n {\n return $this->diskCachingDirectory;\n }", "protected function get_sitemap_root_cache_file_path() {\n\n\t\t$upload_dir = wp_upload_dir();\n\n\t\t// Set directory the sitemap will be stored in.\n\t\t$cache_dir = '.';\n\t\tif ( isset( $upload_dir['basedir'] ) ) {\n\t\t\t$cache_dir = $upload_dir['basedir'];\n\t\t}\n\n\t\t// Generate sitemap file path.\n\t\t$cache_file = sprintf(\n\t\t\t'%s/sitemap_index.xml',\n\t\t\t$cache_dir\n\t\t);\n\n\t\t$cache_file = \\apply_filters( 'yoast_sitemap_cli_root_cache_file_path', $cache_file );\n\n\t\treturn $cache_file;\n\n\t}", "public function getCacheLocation(): string\n {\n return getenv(self::GH_CACHE_LOCATION);\n }", "public function getCacheFile()\n\t{\n\t\treturn $this->tempDir . '/' . $this->filename;\n\t}", "public function getZipCachePath()\n {\n return $this->getSettingArray()[\"zip_cache_path\"];\n }", "public function getDir();", "public function cachePath($name)\n\t\t\t{\n\t\t\t global $CFG;\n\t\t\t $cacheFolder = $CFG['site']['project_path'].$CFG['feature']['data_cache']['folder'];\n\t\t\t if(!$cacheFolder) $cacheFolder = trim($_SERVER['DOCUMENT_ROOT'],'/').'/cache/';\n\t\t\t return $cacheFolder . md5(strtolower(trim($name))) . '.cache';\n\t\t \t}", "public function getCachedServicesPath();", "private function cacheFolder(){\n $cachePath = ROOT . \"/\" . $this->_config['cachePath'];\n if (!is_dir( $cachePath )) { // no\n if (!mkdir( $cachePath, 0755, true)) { // so make it\n if (!is_dir( $cachePath )) { // check again to protect against race conditions\n\n // uh-oh, failed to make that directory\n $this->sendErrorImage(\"Failed to create cache directory at: $cachePath\");\n }\n }\n }\n }", "public function configurationCacheFilePath();", "public function getPathCache($append = ''){\n\t\treturn $this->paths['cache'].$append;\n\t}", "public function getCompiledCachePath()\n {\n return $this->cachePath;\n }", "public function getLibDir()\n {\n return Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA) . DS . 'hycube' . DS . 'geoip';\n }", "public function getCachedServicesPath()\n {\n return $this->normalizeCachePath('APP_SERVICES_CACHE', 'cache/services.php');\n }", "protected function _getCliLockDir()\n {\n return HaloBase::getInstance()->getScriptLockPath();\n }", "function getTempFolder() {\n\t$cachefolder = \"silverstripe-cache\" . str_replace(array(\"/\",\":\", \"\\\\\"),\"-\", substr($_SERVER['SCRIPT_FILENAME'], 0, strlen($_SERVER['SCRIPT_FILENAME']) - strlen('/sapphire/main.php')));\n\t$ssTmp = dirname(dirname($_SERVER['SCRIPT_FILENAME'])) . \"/silverstripe-cache\";\n if(@file_exists($ssTmp)) {\n \treturn $ssTmp;\n }\n\t\n if(function_exists('sys_get_temp_dir')) {\n $sysTmp = sys_get_temp_dir();\n } elseif(isset($_ENV['TMP'])) {\n\t\t$sysTmp = $_ENV['TMP']; \t\n } else {\n $tmpFile = tempnam('adfadsfdas','');\n unlink($tmpFile);\n $sysTmp = dirname($tmpFile);\n }\n\n $worked = true;\n $ssTmp = \"$sysTmp/$cachefolder\";\n if(!@file_exists($ssTmp)) {\n \t@$worked = mkdir($ssTmp);\n }\n if(!$worked) {\n \t$ssTmp = dirname(dirname($_SERVER['SCRIPT_FILENAME'])) . \"/silverstripe-cache\";\n \t$worked = true;\n \tif(!@file_exists($ssTmp)) {\n \t\t@$worked = mkdir($ssTmp);\n \t}\n }\n if(!$worked) {\n \tuser_error(\"Permission problem gaining access to a temp folder. \" .\n \t\t\"Please create a folder named silverstripe-cache in the base folder \" .\n \t\t\"of the installation and ensure it has the correct permissions\", E_USER_ERROR);\n }\n \n return $ssTmp;\n}", "function getCacheFilePath($eventData)\n {\n global $serendipity;\n\n $cache_filename = $this->getCacheFileName($eventData);\n if (!isset($cache_filename)) {\n return null;\n }\n return $this->getCacheDirectory() .'/' . $cache_filename;;\n }", "private function getCacheFile() {\n return new File($this->rootPath, self::CACHE_FILE);\n }", "public function getCachedConfigPath()\n {\n return $this['path.storage'].'/framework/config.php';\n }", "public static function get_cache_dir($rel_path) {\n $candidate = self::$_cache_dir . $rel_path;\n if ( ! is_dir($candidate)) {\n if (file_exists($candidate))\n throw new Exception(\"cache path '$rel_path' exists but not a directory\");\n\n if ( ! @mkdir($candidate, 0755, TRUE))\n throw new Exception(\"failed to create cache directory '$rel_path'\");\n }\n return $candidate;\n }", "public function diruri() {\n if(isset($this->cache['diruri'])) return $this->cache['diruri'];\n return $this->cache['diruri'] = ltrim($this->parent()->diruri() . '/' . $this->dirname(), '/');\n }", "protected function getCacheFilePath(): string\n {\n return self::env('CONFIG_CACHE_FILE_PATH', Directory::cachePath('config.php'));\n }", "function _prepare_cache_path($cur_cache_name = \"\") { \n\t\t// Get name of the cache file\n\t\tif (empty($cur_cache_name)) {\n\t\t\treturn false;\n\t\t}\n\t\t// Memcached code\n\t\tif ($this->USE_MEMCACHED) {\n\t\t\treturn $cur_cache_name;\n\t\t}\n\t\t// Base cache dir\n\t\t$cache_dir = $this->CACHE_DIR;\n\t\t// Create subdir (a/b/c)\n\t\t$cache_sub_dir = $cur_cache_name[0].\"/\".$cur_cache_name[1].\"/\".$cur_cache_name[2].\"/\";\n\t\t$cache_dir .= $cache_sub_dir;\n\t\t_mkdir_m($cache_dir, 0777);\n\t\treturn $cache_dir. $this->_file_prefix. $cur_cache_name. $this->_file_ext;\n\t}", "public function getReportCacheDir()\n {\n return $this->reportCacheDir;\n }", "public function get_files_directory() {\n return '../data/files/' . hash_secure($this->name);\n }", "function getCacheFilename() {\n\t\treturn 'cache/fc-categories.php';\n\t}", "public function getCacheActionsDir () {\n return $this->cacheActionsDir; \n }", "public function getDirectory();", "public function getDirectory();", "public function get_cached_path() {\n // Set either the source or cache file as our datasource\n if ($this->serve_default)\n {\n $file_data = $this->source_file;\n }\n else\n {\n $file_data = $this->cached_file;\n }\n\n // Output the file\n return $file_data;\n }", "public static function getCachePath($sPath=''){\n return self::getWritablePath('cache'.DIRECTORY_SEPARATOR.$sPath);\n }", "public static function getWorkingDir()\n {\n return Mage::getBaseDir('var') . DS . 'storelocator' . DS;\n }", "public function getConfigCacheFile()\n {\n return $this->getCacheDir() . '/module-config-cache.'.$this->getConfigCacheKey().'.php';\n }", "public function getDir() {\n return Yii::getAlias('@static').'/'.$this->module.'/'. $this->parent_id .'/';\n }", "public function cacheFolder() {\n\t\t$full_path = trim(str_replace(MODX_BASE_PATH, '', trim($this->config['cacheFolder'])), DIRECTORY_SEPARATOR);\n\n\t\tif (!file_exists(MODX_BASE_PATH . $full_path)) {\n\t\t\t$tmp = explode(DIRECTORY_SEPARATOR, $full_path);\n\t\t\t$path = MODX_BASE_PATH;\n\t\t\tforeach ($tmp as $v) {\n\t\t\t\tif (!empty($v)) {\n\t\t\t\t\t$path .= $v . DIRECTORY_SEPARATOR;\n\t\t\t\t\tif (!file_exists($path)) {\n\t\t\t\t\t\tmkdir($path);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (substr($full_path, -1) !== DIRECTORY_SEPARATOR) {\n\t\t\t$full_path .= DIRECTORY_SEPARATOR;\n\t\t}\n\n\t\t// Could not create cache directory\n\t\tif (!file_exists(MODX_BASE_PATH . $full_path)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Get the latest cache files\n\t\t$this->config['cacheFolder'] = $cacheFolder = MODX_BASE_PATH . $full_path;\n\t\t$regexp = '('.$this->config['jsFilename'].'|'.$this->config['cssFilename'].')';\n\t\t$regexp .= '_(\\d{10})';\n\t\t$regexp .= '('.$this->config['jsExt'].'|'.$this->config['cssExt'].')';\n\n\t\t$files = scandir($cacheFolder);\n\t\tforeach ($files as $file) {\n\t\t\tif ($file == '.' || $file == '..') {continue;}\n\n\t\t\tif (preg_match(\"/^$regexp$/iu\", $file, $matches)) {\n\t\t\t\tif ($matches[3] == $this->config['jsExt']) {\n\t\t\t\t\t$this->current['js'][] = array(\n\t\t\t\t\t\t'file' => $matches[0],\n\t\t\t\t\t\t'time' => filemtime($cacheFolder . $file),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->current['css'][] = array(\n\t\t\t\t\t\t'file' => $matches[0],\n\t\t\t\t\t\t'time' => filemtime($cacheFolder . $file),\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public function getDir(): string;", "public static function getCacheFile()\r\n {\r\n return self::$_cacheFile;\r\n }", "public function getResourceSpacePath()\n\t{\n\t\treturn realpath(dirname(__FILE__).'/../../../'.Yii::app()->config->system['rsDirectory']).'/';\n\t}", "private function _cache_get_dir($cache_group = 'global', $deleted_cache_dir = false)\n {\n $function_cache_id = false;\n $args = func_get_args();\n foreach ($args as $k => $v) {\n $function_cache_id = $function_cache_id . serialize($k) . serialize($v);\n }\n $function_cache_id = __FUNCTION__ . crc32($function_cache_id);\n $cache_content = '$this->cache_get_dir_' . $function_cache_id;\n if (!defined($cache_content)) {\n } else {\n return (constant($cache_content));\n }\n if (strval($cache_group) != '') {\n $cache_group = str_replace('/', DIRECTORY_SEPARATOR, $cache_group);\n // we will seperate the dirs by 1000s\n $cache_group_explode = explode(DIRECTORY_SEPARATOR, $cache_group);\n $cache_group_new = array();\n foreach ($cache_group_explode as $item) {\n if (intval($item) != 0) {\n $item_temp = intval($item) / 1000;\n $item_temp = ceil($item_temp);\n $item_temp = $item_temp . '000';\n $cache_group_new[] = $item_temp;\n $cache_group_new[] = $item;\n } else {\n $cache_group_new[] = $item;\n }\n }\n $cache_group = implode(DIRECTORY_SEPARATOR, $cache_group_new);\n $cacheDir = MW_CACHE_DIR . $cache_group;\n if (!defined($cache_content)) {\n define($cache_content, $cacheDir);\n }\n return $cacheDir;\n } else {\n if (!defined($cache_content)) {\n define($cache_content, $cache_group);\n }\n return $cache_group;\n }\n }", "public function custom_change_twig_cache_dir() {\n return get_option( 'timber_cache_path' );\n }", "public function cacheDir($dir)\n {\n return rtrim($this->config['cache_dir'], '/') . \"/\" . $dir;\n }", "function dirPath () { return (\"../../\"); }", "public function setCacheDir(string $path);", "public function getDirectory()\n {\n return mfConfig::get('mf_sites_dir').\"/\".$this->getSiteName().\"/\".$this->getApplication().\"/view/pictures/\".$this->get('lang');\n }", "public function cacheBin() {\n return 'cache_forsrights_webservice';\n }", "public static function getMapDir() {\n return isset(self::$mapDir)\n ? self::$mapDir\n : (self::$mapDir = self::getBaseDir() . '/maps');\n\t}" ]
[ "0.8108191", "0.806681", "0.8035283", "0.79428685", "0.78919595", "0.78735846", "0.7720608", "0.7720376", "0.7720376", "0.767161", "0.76457065", "0.7551495", "0.75488365", "0.7507906", "0.7504676", "0.7472603", "0.7455249", "0.74402016", "0.74361646", "0.7435384", "0.74173576", "0.7409884", "0.7392279", "0.7392279", "0.7392279", "0.7392279", "0.7390397", "0.73734623", "0.72815514", "0.7260705", "0.7256956", "0.72436965", "0.72341585", "0.72215444", "0.72189355", "0.7155437", "0.7148969", "0.7117984", "0.70902765", "0.70563316", "0.6953041", "0.6919992", "0.68849206", "0.68769777", "0.6864238", "0.677061", "0.6750083", "0.67418295", "0.672643", "0.67051095", "0.67047495", "0.6667122", "0.6666168", "0.66561127", "0.66561127", "0.6637826", "0.6590734", "0.6589001", "0.657223", "0.65694433", "0.6565787", "0.6558787", "0.65339005", "0.65285844", "0.6518016", "0.6493421", "0.6434402", "0.63983846", "0.63894355", "0.6378907", "0.63708067", "0.63263965", "0.6322448", "0.63201207", "0.631157", "0.6306835", "0.6301898", "0.6292381", "0.6259859", "0.6259605", "0.6258186", "0.62373483", "0.62373483", "0.6234064", "0.6232739", "0.62309456", "0.6230941", "0.62162393", "0.62023234", "0.6187662", "0.6171913", "0.6167023", "0.61590564", "0.6151161", "0.6148328", "0.6131798", "0.61276376", "0.6125873", "0.6117173", "0.6087152" ]
0.82545537
0
Get cache file name
private static function getCacheFileName($name, $context) { if ($context === null) { return RuntimeConfiguration::$project . ".{$name}.tmp"; } else { return RuntimeConfiguration::$project . ".{$name}." . md5(serialize($context)) . '.tmp'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _getFileName() {\n\n\t\t\treturn \t$this->_cacheFolder.$this->_getHash($this->_cacheFile).$this->_cacheExtension;\n\n\t\t}", "protected function getCacheFile(){\n\t\treturn $this->getPath() . $this->getCacheName();\n\t}", "public function cache_filename()\n {\n return $this->_name . '_' . $this->id() . '.' . $this->_type;\n }", "public function getCacheName();", "private function get_filename() {\n \n $md5 = md5($_SERVER[\"HTTP_HOST\"] . $_SERVER[\"REQUEST_URI\"]);\n return CACHE_DIR . \"/\" . $md5;\n }", "public function getCacheFile()\n\t{\n\t\treturn $this->tempDir . '/' . $this->filename;\n\t}", "public function get_cache_filename($url)\n {\n }", "function _CacheFileName($key) {\n\t\t$FileName = $this->CacheDir . '/' . $this->_CleanKey($key);\n\n\t\treturn $FileName;\n\t}", "protected function getCacheName(){\n\t\tif(is_null($this->param)) {\n\t\t\tthrow new \\Exception('Call \"setParameters\" first!');\n\t\t}\n\n\t\t// Change character when making incompatible changes to prevent loading\n\t\t// errors due to incompatible file contents \\|/\n\t\treturn hash('md5', http_build_query($this->param) . 'A') . '.cache';\n\t}", "protected function cacheName($file){\n $hash = sha1($file);\n return \"$this->cache/$hash.php\";\n }", "public function getCachedFileName($key) {\n\t\treturn $key.$this->getCachedFileExtension();\n\t}", "function getCacheFilename() {\n\t\treturn 'cache/fc-categories.php';\n\t}", "protected function getCacheFile($key) {\n\t\treturn $this->cacheFolder.'/'.$this->getCachedFileName($key);\n\t}", "function file_name ($url) {\n $filename = md5( $url );\n return join( DIRECTORY_SEPARATOR, array( $this->BASE_CACHE, $filename ) );\n }", "private function getFilePath($key) {\n return $this->cacheFilePath . md5($key) . '.cache';\n }", "public function GetCacheFileName($endpoint=null){\r\n\t\t$data=Array(\r\n\t\t\t'server'\t\t=>\t$this,\r\n\t\t\t'endpoint'\t\t=>\t$endpoint,\r\n\t\t\t'filename'\t\t=>\t(is_null(self::$CacheFolder))?null:self::$CacheFolder.'/'.sha1((is_null($endpoint))?$this->EndPoint:$endpoint).'.wsdl'\r\n\t\t);\r\n\t\tself::CallHook(\r\n\t\t\t'CacheFileNameHook',\r\n\t\t\t$data\r\n\t\t);\r\n\t\treturn $data['filename'];\r\n\t}", "function get_cache($key) {\n return $this->get_cache_dir() . $key . '.cache';\n }", "public function getCacheFilename($uri)\n {\n return $this->getDirectory() . DIRECTORY_SEPARATOR . md5(serialize($uri)) . '.cache';\n }", "public function CacheFileName()\n {\n $parts = pathinfo($this->pathToImage);\n $this->fileExtension = $parts['extension'];\n $this->saveAs = is_null($this->saveAs) ? $this->fileExtension : $this->saveAs;\n $quality_ = is_null($this->quality) ? null : \"_q{$this->quality}\";\n $cropToFit_ = is_null($this->cropToFit) ? null : \"_cf\";\n $sharpen_ = is_null($this->sharpen) ? null : \"_s\";\n $dirName = preg_replace('/\\//', '-', dirname($this->src));\n $cacheFileName = CACHE_PATH . \"-{$dirName}-{$parts['filename']}_{$this->newWidth}_{$this->newHeight}{$quality_}{$cropToFit_}{$sharpen_}.{$this->saveAs}\";\n $cacheFileName = preg_replace('/^a-zA-Z0-9\\.-_/', '', $cacheFileName);\n\n if($this->verbose) { self::verbose(\"Cache file is: {$cacheFileName}\"); }\n return $cacheFileName;\n }", "public static function getCacheFile()\r\n {\r\n return self::$_cacheFile;\r\n }", "public function getCacheFilesBaseName()\n {\n return $this->phptal->getCodePath();\n }", "private function getCacheFile()\n {\n if (is_null($this->cachePath) || !file_exists($this->cachePath)) {\n $this->error('Invalid Cache Path. '.$this->cachePath);\n return false;\n }\n\n $cacheKey = is_null($this->cacheKey) ? md5($this->templateFile) : $this->cacheKey;\n return($this->cachePath . $cacheKey);\n }", "private function generateCacheName(): string\n\t{\n\t\t$get = implode('-', $_GET);\n\t\t$name = $this->_resizeMode . $this->_imagePath . $this->_oldWidth . $this->_oldHeight . $this->_newWidth . $this->_newHeight . $get;\n\t\treturn md5($name) . '.' . $this->_extension;\n\t}", "public function cacheName()\n\t\t{\n\t\t\treturn $GLOBALS[\"ID\"] . \"_call.xml\";\n\t\t}", "private function getCacheFileByKey($key) {\n return self::CACHE_DIR . str_replace(DIRECTORY_SEPARATOR, '_', $key) . '.cache.php';\n\n }", "function getCacheFilePath($eventData)\n {\n global $serendipity;\n\n $cache_filename = $this->getCacheFileName($eventData);\n if (!isset($cache_filename)) {\n return null;\n }\n return $this->getCacheDirectory() .'/' . $cache_filename;;\n }", "protected function getFilename(string $key): string\n {\n return \\hash('sha256', $key) . '.cache';\n }", "private function getCacheFile(string $key)\n {\n return $this->cacheDirectory . DIRECTORY_SEPARATOR . $key . self::CACHE_SUFFIX;\n }", "private function _getCachedFile( $key ) \n\t{\n\t\t$cachefile\t= BASE_PATH .DS. '_cache' .DS. md5($key);\n\t\t\n\t\treturn $cachefile;\n\t}", "function getCacheFileName($eventData)\n {\n global $serendipity;\n\n if (!isset($eventData['email']) && !isset($eventData['email_md5']) && !isset($eventData['url'])) {\n return null;\n }\n $email_md5 = '';\n if (isset($eventData['email_md5'])) {\n $email_md5 = $eventData['email_md5'];\n }\n else if (isset($eventData['email'])) {\n $email_md5 = md5(strtolower($eventData['email']));\n }\n\n $author_md5= isset($eventData['author'])? md5($eventData['author']) : '';\n $url_md5 = isset($eventData['url'])? md5($eventData['url']) : '' ;\n\n return $url_md5 . '_' . $email_md5 . '_' . $author_md5;\n }", "public function cachePath($name)\n\t\t\t{\n\t\t\t global $CFG;\n\t\t\t $cacheFolder = $CFG['site']['project_path'].$CFG['feature']['data_cache']['folder'];\n\t\t\t if(!$cacheFolder) $cacheFolder = trim($_SERVER['DOCUMENT_ROOT'],'/').'/cache/';\n\t\t\t return $cacheFolder . md5(strtolower(trim($name))) . '.cache';\n\t\t \t}", "private function _getCachePath() {\n return DIR_PUBLIC_CACHE_SEARCHES . $this->_id . '.json';\n }", "private function _cacheName() {\n $file = APPLICATION_PATH . '/application/settings/restapi_caching_url.php';\n if (file_exists($file)) {\n $enableCacheUrl = include $file;\n } else {\n return '';\n }\n $viewer = Engine_Api::_()->user()->getViewer();\n $front = Zend_Controller_Front::getInstance();\n $request = $front->getRequest();\n $params = array();\n $params['module'] = $request->getModuleName();\n $params['controller'] = $request->getControllerName();\n $params['action'] = $request->getActionName();\n $parameters = $request->getParams();\n $language = $parameters['language'];\n $cacheName = implode(\"_\", $params);\n $key_val = '';\n $cacheName = str_replace('-', '_', $cacheName);\n if (!isset($enableCacheUrl[$cacheName]) || empty($enableCacheUrl[$cacheName]))\n return;\n $getRequestUri = htmlspecialchars($_SERVER['REQUEST_URI']);\n $urlarray = explode(\"?\", $getRequestUri);\n $trimData = trim($urlarray[0], \"/\");\n $cachName = str_replace(\"/\", \"_\", $trimData);\n $viewerId = 0;\n $keys = array_keys($parameters);\n $matched = preg_grep('/_id|_type$/', $keys);\n $matched = array_flip($matched);\n $matched = array_intersect_key($parameters, $matched);\n $key_val = implode('_', $matched);\n\n if ($enableCacheUrl[$cacheName] == 'member_level') {\n $viewerId = $viewer && $viewer->getIdentity() ? $viewer->level_id : 0;\n } elseif ($enableCacheUrl[$cacheName] == 'user_level') {\n $viewerId = $viewer && $viewer->getIdentity() ? $viewer->getIdentity() : 0;\n }\n\n $cachName = $cachName . '_' . $language . '_' . $key_val . '_' . $viewerId;\n $cachName = str_replace('-', '_', $cachName);\n $cachName = str_replace('.', '_', $cachName);\n return $cachName;\n }", "public function get_cached_path() {\n // Set either the source or cache file as our datasource\n if ($this->serve_default)\n {\n $file_data = $this->source_file;\n }\n else\n {\n $file_data = $this->cached_file;\n }\n\n // Output the file\n return $file_data;\n }", "protected static function getCacheName()\n\t{\n\t\tstatic $strCacheName;\n\t\tif (!isset($strCacheName))\n\t\t{\n\t\t\t$strCacheName = __CLASS__;\n\t\t}\n\t\treturn $strCacheName;\n\t}", "public function getCacheFilename($name)\n {\n if (false === $this->cache) {\n return false;\n }\n $class = substr($this->getTemplateClass($name), strlen($this->templateClassPrefix));\n return $this->getCache().'/'.substr($class, 0, 2).'/'.substr($class, 2, 2).'/'.substr($class, 4).'.php';\n }", "protected function getFileName($id)\n {\n $directory = $this->getDirectory($id);\n $hash = sha1($id, false);\n $file = $directory . DIRECTORY_SEPARATOR . $hash . '.cache';\n return $file;\n }", "protected function getFileName($id)\n {\n $directory = $this->getDirectory($id);\n $hash = sha1($id, false);\n $file = $directory . DIRECTORY_SEPARATOR . $hash . '.cache';\n return $file;\n }", "function getFile() {\n return IMMOTOOL_BASE_PATH . 'cache/order.' . $this->getName();\n }", "protected function get_container_filename()\n\t{\n\t\t$container_params = [\n\t\t\t'phpbb_root_path' => $this->phpbb_root_path,\n\t\t\t'use_extensions' => $this->use_extensions,\n\t\t\t'config_path' => $this->config_path,\n\t\t];\n\n\t\treturn $this->get_cache_dir() . 'container_' . md5(implode(',', $container_params)) . '.' . $this->php_ext;\n\t}", "public function getConfigCacheFile()\n {\n return $this->getCacheDir() . '/module-config-cache.'.$this->getConfigCacheKey().'.php';\n }", "public function getImageCachePath()\n {\n return $this->getSettingArray()[\"image_cache_path\"];\n }", "protected function getFilePath($key)\n {\n return $this->file_path . '/sb_Cache' . $key;\n }", "function get_file_path($key)\n\t{\n\t\t$key = md5($key);\n\t\t$file_name = $key.'.cache';\n\t\t$file_path = CACHE_DIR.$file_name;\n\n\t\treturn $file_path;\n\t}", "private function getCacheFile() {\n return new File($this->rootPath, self::CACHE_FILE);\n }", "private function getFilename()\n {\n if ($this->uniqueFile) {\n return $this->filename;\n }\n\n return $this->filename . self::SEPARATOR . $this->getCurrentSitemap();\n }", "protected function get_cache_file_path( $key ) {\n\t\treturn $this->cache_dir . DIRECTORY_SEPARATOR . $key;\n\t}", "protected function getCacheSuffix() {\n return '';\n }", "private function getCacheKey(): string\n {\n return $this->webserviceId.$this->cacheKey;\n }", "protected function filename()\n {\n return 'history_' . time();\n }", "protected function filename()\n {\n return 'ticket_' . time();\n }", "protected function _getCache()\n {\n if (!isset($this->_configuration)) {\n $this->_configuration = \\Yana\\Db\\Binaries\\ConfigurationSingleton::getInstance();\n }\n return $this->_configuration->getFileNameCache();\n }", "public function getCachePathString()\n\t{\n\t\treturn \"rs-\".$this->_maxWidth.\"-\".$this->_maxHeight.\"-\".$this->_maintainAspectRatio.\"-\".$this->_scaleUp;\n\t}", "public function getCachePath()\n {\n return $this->getSettingArray()[\"cache_path\"];\n }", "protected function getCacheFilename($url)\n {\n global $serendipity;\n if (!defined('PATH_SMARTY_COMPILE')) {\n return '';\n }\n return $serendipity['serendipityPath'] . PATH_SMARTY_COMPILE . '/sharedcount/' . sha1($url);\n }", "public function getCache(): string\n {\n return $this->cache;\n }", "protected function filename()\n {\n return 'compras_' . time();\n }", "protected function getCacheFilePath($key) {\n $tempPath = sys_get_temp_dir();\n if (!$tempPath)\n throw new RuntimeException('Unable to get temp directory');\n\n return $tempPath . '/' . $key . '.webcache';\n }", "public static function getFile(){\n\t\t$file_name = base_path().\"/resources/views/DURC/durc_html.mustache\";\n\t\treturn($file_name);\n\t}", "public function getCache()\r\n {\r\n if ($this->exists('cache')) {\r\n return ROOT . $this->get('cache');\r\n }\r\n else\r\n return ROOT . '/cache';\r\n }", "protected static function cacheFileName(string $namespace, File $file): string\n {\n return ($namespace === '*' ? null : $namespace . DIRECTORY_SEPARATOR) . $file->localPath() . DIRECTORY_SEPARATOR . $file->filename();\n }", "public function getFilename()\n {\n return static::filename($this->path);\n }", "private static function getCacheFileName($path, $options, $timeout) {\n /* If timeout is not set, we're not caching */\n if (!$timeout)\n return FALSE;\n if (!is_dir($path) || !is_writeable($path))\n return FALSE;\n\n $cacheFileName = $path.'cache_'.self::$website_id.'_';\n $cacheFileName .= md5(self::array_to_query_string($options));\n\n return $cacheFileName;\n }", "public function getCacheName($name){\n if($this->is_mobile)\n $name .= '_mobile';\n return $name;\n }", "public function cacheKey(): string {\n return self::CACHE_PREFIX . $this->id\n . ($this->revisionId ? '_r' . $this->revisionId : '');\n }", "function _getFileName()\r\n\t{\r\n\t\t$f = $this->pathHomeDir . '/' . $this->pathLocale . '/' . $this->pathFile . \".\" . $this->pathEx;\r\n\t\treturn $f;\r\n\t}", "private function _get_cached_asset_filename($type, $assets, $extension)\n\t{\n\t\t$file = '';\n\t\t\n\t\t$cache_path = $this->_ci->config->item('cache_path') == '' ? BASEPATH . 'cache/' : $this->_ci->config->item('cache_path');\n\t\t$cache_path = $this->_reduce_double_slashes($cache_path . $this->_ci->config->item('bucket_assets_cache_path'));\n\t\t\n\t\t$file .= $cache_path . '/';\n\t\t$file .= md5(serialize(array('type' => $type, 'extension' => $extension, 'names' => $assets)));\n\t\t\n\t\treturn $file;\n\t}", "function cachefile($url = false) {\n\t\tif(!$url) {\n\t\t\t$url = uniqid();\n\t\t}\n\t\t\n\t\t$request_hash = sha1($url);\n\t\t\n\t\t$tmp_path = sys_get_temp_dir();\n\t\t\n\t\t$cache_name = 'wmjapi-' . $this->token_hash . '-' \n\t\t\t. sha1($url) . '.json';\n\t\t\n\t\tif(substr($tmp_path, -1) !== '/') {\n\t\t\t$tmp_path = $tmp_path . '/';\n\t\t}\n\t\t\n\t\t$cache_file = $tmp_path . $cache_name;\n\t\t\n\t\treturn $cache_file;\n\t}", "protected function filename()\n {\n return 'newsItemDataTable_' . time();\n }", "function _cache_get ($cache_name = \"\") {\n\t\tif (empty($cache_name)) {\n\t\t\treturn false;\n\t\t}\n\t\t$cache_file_path = $this->_prepare_cache_path($cache_name);\n\t\treturn $this->_get_cache_file($cache_file_path);\n\t}", "public function getFileName()\n {\n return $this->prefix.$this->scope.'_'.$this->comName;\n }", "protected function getCacheFilePath(): string\n {\n return self::env('CONFIG_CACHE_FILE_PATH', Directory::cachePath('config.php'));\n }", "function getCacheFileUrl($eventData)\n {\n global $serendipity;\n\n $cache_filename = $this->getCacheFileName($eventData);\n if (!isset($cache_filename)) {\n return null;\n }\n return $serendipity['baseURL'] . '/' . PATH_SMARTY_COMPILE . '/serendipity_event_gravatar/' . $cache_filename;\n }", "public function getCacheName($config)\n {\n if (strlen($config) > 3 && ctype_alpha($config[0]) && $config[1] == ':' && ($config[2] == '\\\\' || $config[2] == '/')) {\n // file is a windows absolute path, strip off the drive letter\n $config = substr($config, 3);\n }\n\n // replace unfriendly filename characters with an underscore\n $config = str_replace(['\\\\', '/', ' '], '_', $config);\n $config .= '.php';\n\n return $this->getConfigCacheDir() . '/' . $config;\n }", "function _get_cache_file ($cache_file = \"\") {\n\t\tif (empty($cache_file)) {\n\t\t\treturn null;\n\t\t}\n\t\tif ($this->USE_MEMCACHED) {\n//\t\t\t$cache_key = basename($cache_file);\n//\t\t\t$data = $this->MC_OBJ->get($cache_key);\n// TODO\n\t\t// Common (files-based) cache code\n\t\t} else {\n\t\t\tclearstatcache();\n\t\t\tif (!file_exists($cache_file)) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t// Delete expired cache files\n\t\t\t$last_modified = filemtime($cache_file);\n\t\t\t$TTL = $this->CACHE_TTL;\n\t\t\tif ($last_modified < (time() - $TTL)) {\n\t\t\t\tunlink($cache_file);\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t// Get data from file\n\t\t\t$data = [];\n\t\t\tif (DEBUG_MODE) {\n\t\t\t\t$_time_start = microtime(true);\n\t\t\t}\n\t\t\t// Try to include file\n\t\t\tinclude ($cache_file);\n/*\t\t\t@eval(\"?> \".file_get_contents($cache_file).\" <?php\"); */\n\t\t\tif (DEBUG_MODE) {\n\t\t\t\t$GLOBALS['include_files_exec_time'][strtolower(str_replace(DIRECTORY_SEPARATOR, \"/\", $cache_file))] = (microtime(true) - $_time_start);\n\t\t\t}\n\t\t}\n\t\treturn $data;\n\t}", "protected function filename()\n {\n return 'verifydatatables_' . time();\n }", "public function getFilename();", "public function getFilename();", "protected function filename()\n {\n return 'photos_datatable_' . time();\n }", "private function pf_getCacheFileName($strCacheName, $strCacheKey)\r\n\t{\r\n\t\t$reEvilChars = '#[/\\\\:*?\"<>|\\'\\.=]#';\t// '=' too because it is used in the name-key concat below\r\n\t\t\r\n\t\tif (!$this->isCacheKeyToBecomePath)\r\n\t\t{\r\n\t\t\t$strFileName = preg_replace($reEvilChars, '_', $this->strCacheSalt);\r\n\t\t\t$strFileName .= preg_replace($reEvilChars, '_', $strCacheName);\r\n\t\t\t$strFileName .= '_==_'.preg_replace($reEvilChars, '_', $strCacheKey);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$strFileName = strtr($strCacheKey, array($this->strCacheKeyToPathSeparator => '/'));\r\n\t\t\t$strFileName .= '/'.preg_replace($reEvilChars, '_', $this->strCacheSalt);\r\n\t\t\t$strFileName .= preg_replace($reEvilChars, '_', $strCacheName);\r\n\t\t\t$strFileName .= '_==_'.preg_replace($reEvilChars, '_', $strCacheKey);\r\n\t\t}\r\n\r\n\t\t$strFileName = $this->strCachePath . $strFileName . '.php';\r\n\t\treturn $strFileName;\r\n\t}", "protected function filename()\n {\n return 'properties_' . time();\n }", "protected function get_autoload_filename()\n\t{\n\t\t$container_params = [\n\t\t\t'phpbb_root_path' => $this->phpbb_root_path,\n\t\t\t'use_extensions' => $this->use_extensions,\n\t\t\t'config_path' => $this->config_path,\n\t\t];\n\n\t\treturn $this->get_cache_dir() . 'autoload_' . md5(implode(',', $container_params)) . '.' . $this->php_ext;\n\t}", "public function configurationCacheFilePath();", "function make_filename_cache($file)\n\t{\n\t\t$str = str_replace($this->cache_search, $this->cache_replace, $file);\n\t\tif(substr($file, 0, $this->tpldir_len) !== $this->tpldir || empty($this->tpl))\n\t\t{\n\t\t\treturn $this->cachedir . XS_TPL_PREFIX2 . $str;\n\t\t}\n\t\t// removing not needed part\n\t\t$file = substr($file, $this->tpldir_len, strlen($file));\n\t\t// creating filename\n\t\treturn $this->cachedir . XS_TPL_PREFIX . str_replace($this->cache_search, $this->cache_replace, $file);\n\t}", "public function getCachedFilePath($fileName)\n {\n $targetPath = dirname($fileName).DIRECTORY_SEPARATOR.basename($fileName);\n $targetPath = str_replace($this->getFolderRoot(), $this->getFolderCache(), $targetPath);\n return $targetPath;\n }", "private function createCacheFileName($params) {\n $parts = pathinfo($this->imgPath);\n $fileExtension = $parts['extension'];\n $this->saveAs = is_null($params['save_as']) ? $fileExtension : $params['save_as'];\n $quality_ = is_null($params['quality']) ? null : \"_q{$params['quality']}\";\n $cropToFit_ = is_null($params['crop_to_fit']) ? null : \"_cf\";\n $dirName = preg_replace('/\\//', '-', dirname($params['src']));\n $cacheFileName = IMAGE_CACHE_PATH . \"-{$dirName}-{$parts['filename']}_{$params['width']}_{$params['height']}{$quality_}{$cropToFit_}.{$this->saveAs}\";\n $cacheFileName = preg_replace('/^a-zA-Z0-9\\.-_/', '', $cacheFileName);\n if($this->verbose) { $this->createVerbose(\"Cache file is: {$cacheFileName}\"); }\n return $cacheFileName;\n \n }", "public function getCachePath() {\r\n\t\treturn $this->getFramework()->getPath(Core::PATH_CACHE);\r\n\t}", "public function getFileName()\n {\n return basename($this->path);\n }", "function get_stored_file_name()\n\t{\n\t\tglobal $log;\n\t\t$log->debug(\"Entering get_stored_file_name() method ...\");\n\t\t$log->debug(\"Exiting get_stored_file_name method ...\");\n\t\treturn $this->stored_file_name;\n\t}", "public function getFilename() {}", "protected function filename()\n {\n return 'account_list_' . date('Y_m_d_H_i_s');\n }", "function _getDatCacheFilename($module_srl)\n {\n return sprintf('%sfiles/cache/xedocs/%d.dat', _XE_PATH_,$module_srl);\n }", "abstract function get_cache_prefix(): string;", "public function cacheSetup()\n\t{\n\t\t// Generate the name\n\t\t$time = $this->modified;\n\t\t$extension = $this->type;\n\t\t$fileName = pathinfo($this->name, PATHINFO_FILENAME) . \".\" . md5($this->name . '.' . $time);\n\t\t$name = $fileName . \".\" . $extension;\n\n\t\t// Generate the cache file path\n\t\t$this->cacheFilePath = realpath(public_path() . '/' . $this->app['assets::config']['cache_path']) . '/' . $name;\n\n\t\t// Generate the cache file URL\n\t\t$this->cacheFileUrl = $this->app['assets::config']['cache_url'] . $name;\n\n\t\treturn $this->cacheFile = $name;\n\t}", "protected function getCachePath($cacheKey)\n {\n return $this->cache . '/' . $cacheKey . '.php';\n }", "public function getFileName();", "public function getFileName();", "public function getFileName();", "protected function filename()\n {\n return 'fieldagents_' . time();\n }", "public function filename()\n\t{\n\t\treturn $this->_filename();\n\t}" ]
[ "0.8573595", "0.8318777", "0.8247268", "0.80906206", "0.7868973", "0.7842908", "0.76628834", "0.7655277", "0.7566484", "0.7562407", "0.75622946", "0.7539638", "0.7514068", "0.7482308", "0.7436447", "0.74255514", "0.741857", "0.74150294", "0.74020267", "0.73892134", "0.73857623", "0.73427856", "0.7338612", "0.72858196", "0.72471607", "0.72445875", "0.72018635", "0.7169146", "0.7166194", "0.7061876", "0.69884306", "0.6988349", "0.6980394", "0.6926874", "0.69121015", "0.68916625", "0.68821317", "0.68821317", "0.68410736", "0.68323076", "0.681309", "0.6805403", "0.6805033", "0.67803144", "0.67620707", "0.67548347", "0.6742817", "0.6730102", "0.6714516", "0.6705147", "0.670009", "0.66990644", "0.66937995", "0.66790074", "0.667552", "0.6666175", "0.66459936", "0.66435885", "0.6622883", "0.6618689", "0.6612223", "0.66021687", "0.6592995", "0.65888727", "0.6561957", "0.65614575", "0.6545712", "0.6540623", "0.6538578", "0.65235215", "0.6522764", "0.6513356", "0.65117955", "0.6503927", "0.6496078", "0.64943165", "0.64830196", "0.64830196", "0.6478571", "0.64778626", "0.64774305", "0.6473583", "0.64709026", "0.6460865", "0.6456699", "0.64512706", "0.6446599", "0.64453906", "0.64387935", "0.6438377", "0.6433785", "0.6427144", "0.64256245", "0.64221346", "0.64194435", "0.64112717", "0.64112717", "0.64112717", "0.64102167", "0.64045006" ]
0.67233473
48
Resolve previous node match.
public function resolveNextNode(NodeContract $node, NodeContract $new_node) { // Nothing to resolve... }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function previousNode(): ?Node\n {\n return $this->traverse('previous');\n }", "public function lookback()\n {\n $token = prev($this->tokens);\n next($this->tokens);\n\n return $token;\n\n }", "function _reparseAfterCurrentBlock () {\r\n // this should definitely not happen!\r\n if (($stack_count = count ($this->_stack)) < 2) {\r\n return false;\r\n }\r\n $topelem =& $this->_stack[$stack_count-1];\r\n \r\n $node_parent =& $topelem->_parent;\r\n // remove the child from the tree\r\n $res = $node_parent->removeChild ($topelem, false);\r\n if (!$res) {\r\n return false;\r\n }\r\n $res = $this->_popNode ();\r\n if (!$res) {\r\n return false;\r\n }\r\n \r\n // now try to get the position of the object\r\n if ($topelem->occurredAt < 0) {\r\n return false;\r\n }\r\n // HACK: could it be necessary to set a different status\r\n // if yes, how should this be achieved? Another member of\r\n // StringParser_Node?\r\n $this->_setStatus (0);\r\n $res = $this->_appendText ($this->_text{$topelem->occurredAt});\r\n if (!$res) {\r\n return false;\r\n }\r\n \r\n $this->_cpos = $topelem->occurredAt + 1;\r\n $this->_recentlyReparsed = true;\r\n \r\n return true;\r\n }", "function getPrevNode($data)\n\t{\n\t\treturn $this->find('first', array(\n\t\t\t\t\t'conditions'\t=> array($this->name . '.lft < ' . $data[$this->name]['lft']),\n\t\t\t\t\t'order'\t\t\t=> $this->name . '.lft DESC'));\t\t\n\t}", "protected function rewindRefactoredNodes()\n {\n $this->refactoredNodes = 0;\n }", "public function getPrevious()\n {\n $prev = $this;\n $find = false;\n if (!is_null($this->parent)) {\n foreach ($this->parent->content as $c) {\n if ($c === $this) {\n $find=true;\n break;\n }\n if (!$find) {\n $prev = $c;\n }\n }\n }\n return $prev;\n }", "public function resolve() {\n return $this->evaluate($this->left, $this->right);\n }", "public function getLastMatch()\n {\n $node = $this->getXml()->getElementsByTagName('LastMatch')->item(0);\n if ($node !== null && $node->hasChildNodes()) {\n $lastmatch = new \\DOMDocument('1.0', 'UTF-8');\n $lastmatch->appendChild($lastmatch->importNode($node, true));\n return new LastMatch($lastmatch, Config\\Config::MATCH_SENIOR);\n }\n return null;\n }", "function prevArticle() {\n\t\t$parent = $this->parent();\n\t\tif (!$parent) {\n\t\t\treturn false;\n\t\t}\n\t\t$parentChildren = $parent->children();\n\t\t$aCount = sizeof($parentChildren);\n\t\t$foundAtPos=null;\n\t\tfor ($i=0;$i<$aCount;$i++) {\n\t\t\tif ($parentChildren[$i]->getId() == $this->getId()) {\n\t\t\t\t$foundAtPos=($i-1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($foundAtPos>=0) {\n\t\t\treturn $parentChildren[$foundAtPos];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function loadPreviousSibling()\n {\n $id = $this->_cache->getBackend()->getPreviousSiblingId($this);\n return $this->setPreviousSiblingId($id);\n }", "protected function afterFind(){\t\t\n\t\t\n\t\tif(isset($this->history))\n\t\t\t$this->history=json_decode($this->history,true);\n\t\t\n\t\t$this->_oldAttributes = $this->attributes;\n\t\n\t\treturn parent::afterFind();\n\t}", "public function previousElement();", "public function completeNode() {\n $this->current = $this->current->parent();\n }", "protected function resolveDependencies() {\n\t\t$sortedNodes = array();\n\t\twhile (count($this->nodesWithoutIncoming) > 0) {\n\t\t\t$node = array_pop($this->nodesWithoutIncoming);\n\t\t\t$sortedNodes[] = $node;\n\t\t\t$nodeHash = spl_object_hash($node);\n\t\t\tif (isset($this->dependenciesOutgoing[$nodeHash])) {\n\t\t\t\tforeach ($this->dependenciesOutgoing[$nodeHash] as $dependencyHash => $dependencyNode) {\n\t\t\t\t\tunset($this->dependenciesOutgoing[$nodeHash][$dependencyHash]);\n\t\t\t\t\tunset($this->dependenciesIncoming[$dependencyHash][$nodeHash]);\n\n\t\t\t\t\tif (count($this->dependenciesIncoming[$dependencyHash]) === 0) {\n\t\t\t\t\t\t$this->nodesWithoutIncoming[$dependencyHash] = $dependencyNode;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $sortedNodes;\n\t}", "public function resolveToSource() {\r\n\t\tif($this->status == self::CONFLICT && $this->numFiles == 2) {\r\n\t\t\t$this->status = self::OUTDATED;\r\n\t\t\t$this->from = &$this->target;\r\n\t\t\t$this->to = &$this->source;\r\n\t\t\t$this->direction = 2;\r\n\t\t}\r\n\t}", "public function firstPreviousMatch(){\n return $this->belongsTo('App\\Match', 'prev_match1_id', 'id');\n }", "public function getLastMatch()\n {\n return new Xml\\Match\\Chunk($this->getXml('LastMatch'));\n }", "public function prev()\n {\n $current = $this->current();\n\n if ($current) {\n $this->current = $current->getBefore();\n }\n }", "public function retrievePrevSibling(BaseObject $node)\n {\n $c = new Criteria();\n $c->add(self::getColumnConstant(get_class($node), 'right'), $node->getLeftValue() - 1, Criteria::EQUAL);\n $c->add(self::getColumnConstant(get_class($node), 'scope'), $node->getScopeIdValue(), Criteria::EQUAL);\n\n return call_user_func(array(get_class($node->getPeer()), 'doSelectOne'), $c);\n }", "function reset() {\n\t\t$this->recursive = -1;\n\t\t$nodes = array_keys($this->Node->find('list', array(\n\t\t\t'conditions' => array('Node.id >' => 0),\n\t\t\t'order' => 'id',\n\t\t\t'recursive' => -1\n\t\t)));\n\t\tset_time_limit (max(count($nodes) / 10, 30));\n\t\t$this->unbindModel(array('belongsTo' => array('Node')), false);\n\t\t$order = 'Revision.id DESC';\n\t\t$fields = array('id');\n\t\tforeach ($nodes as $id) {\n\t\t\t$langs = $this->find('list', array(\n\t\t\t\t'fields' => array('lang', 'lang'),\n\t\t\t\t'conditions' => array('node_id' => $id)\n\t\t\t));\n\t\t\tforeach ($langs as $lang) {\n\t\t\t\t$conditions = array(\n\t\t\t\t\t'node_id' => $id,\n\t\t\t\t\t'lang' => $lang,\n\t\t\t\t\t'NOT' => array('status' => 'rejected')\n\t\t\t\t);\n\t\t\t\t$count = $this->find('count', compact('conditions'));\n\t\t\t\tif (!$count) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$conditions['Revision.status'] = 'current';\n\t\t\t\tif ($this->find('count', compact('conditions')) === 1) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$conditions['Revision.status'] = 'previous';\n\t\t\t\t$last = $this->find('first', compact('conditions', 'order', 'fields'));\n\t\t\t\tif (!$last) {\n\t\t\t\t\tunset($conditions['Revision.status']);\n\t\t\t\t\t$last = $this->find('first', compact('conditions', 'order', 'fields'));\n\t\t\t\t}\n\t\t\t\t$this->updateAll(array('status' => '\"current\"'), array('Revision.id' => $last['Revision']['id']));\n\t\t\t\t$conditions['Revision.status'] = 'current';\n\t\t\t\t$conditions['NOT'] = array('Revision.id' => $last['Revision']['id']);\n\t\t\t\t$this->updateAll(array('Revision.status' => '\"previous\"'), $conditions);\n\t\t\t}\n\t\t}\n\t}", "public function resolveToTarget() {\r\n\t\tif($this->status == self::CONFLICT && $this->numFiles == 2) {\r\n\t\t\t$this->status = self::OUTDATED;\r\n\t\t\t$this->from = &$this->source;\r\n\t\t\t$this->to = &$this->target;\r\n\t\t\t$this->direction = 1;\r\n\t\t}\r\n\t}", "public function getPreviousMatch($team) {\n\t\t// whose time slot was last before the time slot of $this match\n\t\t\n\t\tFB::log('trying to find the previous match of team '.$team->name);\n\t\t$previousTime=0;\n\t\t$previousMatch=false;\n\t\tforeach($team->HomeMatches as $homeMatch) {\n\t\t\tif ($homeMatch->scheduledTime > $previousTime && $homeMatch->scheduledTime < $this->scheduledTime) {\n\t\t\t\t$previousMatch=$homeMatch;\n\t\t\t\t$previousTime=$homeMatch->scheduledTime;\n\t\t\t}\n\t\t} \n\t\tforeach($team->AwayMatches as $awayMatch) {\n\t\t\tif ($awayMatch->scheduledTime > $previousTime && $awayMatch->scheduledTime < $this->scheduledTime) {\n\t\t\t\t$previousMatch=$awayMatch;\n\t\t\t\t$previousTime=$awayMatch->scheduledTime;\n\t\t\t}\n\t\t} \n\t\t\n\t\tFB::log('found match '.$previousMatch->HomeTeam->name.'-'.$previousMatch->AwayTeam->name);\n\t\t\n\t\treturn $previousMatch;\n\t}", "public function getNodeOriginalRoute();", "public function findPrevious(File $file, $pattern);", "public function getPrevSibling();", "protected function initializeNodeResolver() {}", "function mREFERENCE(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$REFERENCE;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:601:3: ( '^^' ) \n // Tokenizer11.g:602:3: '^^' \n {\n $this->matchString(\"^^\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "public function getNextMatch()\n {\n return new Xml\\Match\\Chunk($this->getXml('NextMatch'));\n }", "function scrap_page_prev($url)\n {\n $page = curl_get_file($url);\n $regex = '@(?s)<h2.*?Add to Compare@';\n preg_match_all($regex,$page,$match);\n if($match == null)\n echo \"No match found!!\";\n else\n {\n foreach($match[0] as $m)\n scrap($m);\n }\n \n //To find prev url\n $regex = '@<link\\s*rel=\"prev\"\\s*href=\"(.*)?\"@';\n preg_match($regex,$page,$u);\n if($u == null)\n return null;\n else \n return $u[1]; \n }", "public function getPrevSibling()\n\t{\n\t\t$owner=$this->getOwner();\n\t\t$db=$owner->getDbConnection();\n\t\t$criteria=$owner->getDbCriteria();\n\t\t$alias=$db->quoteColumnName($owner->getTableAlias());\n\t\t$criteria->addCondition($alias.'.'.$db->quoteColumnName($this->rightAttribute).'='.($owner->{$this->leftAttribute}-1));\n\n\t\tif($this->hasManyRoots)\n\t\t\t$criteria->addCondition($alias.'.'.$db->quoteColumnName($this->rootAttribute).'='.$owner->{$this->rootAttribute});\n\n\t\treturn $owner->find();\n\t}", "public function testExistedNodeFirstSiblingsMovePrependTo()\n {\n $model8 = Animal::findOne(8);\n $model9 = Animal::findOne(9);\n \n $this->assertTrue($model8->prependTo($model8->parent()));\n $this->assertEquals(1, $model8->weight);\n $model9->refresh();\n $this->assertEquals(2, $model9->weight);\n }", "public function wasTransited(): ?Transition\n {\n if ($engine = $this->engine) {\n $model = $engine->model;\n $attribute = $engine->attribute;\n\n if ($model->wasChanged($attribute) &&\n ($source = $model->getOriginal($attribute)) &&\n ($target = $model->getAttribute($attribute)) &&\n $source != $target) {\n\n $transition = $engine->getTransitionListing()\n ->from($source)\n ->to($target)\n // Transition must exist\n ->sole();\n\n // Pass context to transition, so it will be accessible in events.\n $transition->context($this->context($model, $attribute));\n\n return $transition;\n }\n }\n\n return null;\n }", "protected function peek() {\n $this->lookAhead = $this->get();\n return $this->lookAhead;\n }", "public function testResolve2()\n{\n\n // Traversed conditions\n // if (!$this->cached) == true (line 193)\n // if (!($prev = $this->handler)) == false (line 194)\n\n $actual = $this->handlerStack->resolve();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "public function back()\n {\n return prev($this->tokens);\n }", "public function ahead(): int\n {\n if ($this->hasNodeId()) {\n if ($this->nodeId !== head($this->ranks)) {\n $ranks = $this->ranks;\n $ranks = array_diff($ranks, [$this->nodeId]);\n $this->commit(array_merge([$this->nodeId], $ranks));\n }\n\n return 1;\n }\n }", "function attemptDirectLinkFix() {\n\t\t$ref = array();\n\t\tforeach ($this->assets as $id => $asset) {\n\t\t\t$ref[$asset->lft] = $asset;\n\t\t}\n\t\tforeach ($this->assets as $id => $asset) {\n\t\t\tif ((!isset($asset->parent_asset)) && ($asset->errors)) {\n\t\t\t\tif (isset($ref[($asset->lft-1)])) {\n\t\t\t\t\t$asset->parent_asset = $ref[($asset->lft-1)];\n\t\t\t\t\t$asset->parent_asset->addChild($asset);\n\t\t\t\t\t$asset->fixes[] = 'Parent assigned by attemptDirectLinkFix';\n\t\t\t\t\t$this->removeRoot($asset->id);\n\t\t\t\t\t$this->fixed[] = $asset;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function resolveRemove() {\r\n\t\tif($this->status == self::CONFLICT && $this->numFiles == 1) {\r\n\t\t\t$this->status = self::OBSOLETE;\r\n\t\t\tlist($this->from, $this->to) = array($this->to, $this->from);\t// Swaps from and to\r\n\t\t\t$this->direction = 3 - $this->direction;\t// Changes direction: 1 -> 2, 2 -> 1\r\n\t\t}\r\n\t}", "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 }", "function find_previous_booking($EM_Booking){\n\t\t//First see if we have a similar person on record that's making this booking\n\t\t$EM_Booking->person->load_similar();\n\t\t//If person exists on record, see if they've booked this event before, if so return the booking.\n\t\tif( is_numeric($EM_Booking->person->ID) && $EM_Booking->person->ID > 0 ){\n\t\t\t$EM_Booking->person_id = $EM_Booking->person->ID;\n\t\t\tforeach ($this->load() as $booking){\n\t\t\t\tif( $booking->person_id == $EM_Booking->person->ID ){\n\t\t\t\t\treturn $booking;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function nowTransiting(): ?Transition\n {\n if ($engine = $this->engine) {\n $model = $engine->model;\n $attribute = $engine->attribute;\n\n if ($model->isDirty($attribute) &&\n ($source = $model->getOriginal($attribute)) &&\n ($target = $model->getAttribute($attribute)) &&\n $source != $target) {\n\n $transition = $engine->getTransitionListing()\n ->from($source)\n ->to($target)\n // Transition must exist\n ->sole();\n\n // Pass context to transition for validation. May throw an Exception\n $transition->context($this->context($model, $attribute));\n\n return $transition;\n }\n }\n\n return null;\n }", "final public function getPrevious() {\n\t\treturn null;\n\t}", "function prev() {\n\n $next = $this->find('first', array('conditions'=>array('position <'=>$this->data['Ringsite']['position']),\n 'order'=>'position DESC'));\n\n if (empty($next)) {\n $next = $this->find('first', array('conditions'=>array('position >='=>0),\n 'order'=>'position DESC'));\n }\n\n return $next;\n }", "#[\\ReturnTypeWillChange]\n public function prev()\n {\n $value = prev($this->_data);\n return key($this->_data) !== null ? $value : null;\n }", "public function testResolve1()\n{\n\n // Traversed conditions\n // if (!$this->cached) == true (line 193)\n // if (!($prev = $this->handler)) == false (line 194)\n\n $actual = $this->handlerStack->resolve();\n $expected = null; // TODO: Expected value here\n $this->assertEquals($expected, $actual);\n}", "final public function done() {\n $first = $this;\n while ($first->prev) {\n $first = $first->prev;\n }\n return $first;\n }", "private function solveDeps($node)\n {\n $error = false;\n if(!isset($this->resolved[$node['key']])) {\n $this->unresolved[$node['key']] = $node['key'];\n if($node['dependencies']!=null) {\n if(is_array($node['dependencies'])) {\n foreach($node['dependencies'] as $dep) {\n if(!in_array($dep, $this->resolved)) {\n if(in_array($dep, $this->unresolved)) {\n $this->error[$dep] = $dep;\n $error = true;\n } else {\n if(isset($this->scripts[$dep])) {\n $this->solveDeps($this->scripts[$dep]);\n } else {\n $this->error[$dep] = $dep;\n }\n }\n }\n }\n } else {\n if(!in_array($node['dependencies'], $this->resolved)) {\n if(in_array($node['dependencies'], $this->unresolved)) {\n $this->error[$node['dependencies']] = $node['dependencies'];\n $error = true;\n } else {\n if(isset($this->scripts[$node['dependencies']])) {\n $this->solveDeps($this->scripts[$node['dependencies']]);\n } else {\n $this->error[$node['dependencies']] = $node['dependencies'];\n }\n }\n }\n }\n }\n if(!$error) {\n $this->resolved[$node['key']] = $node['key'];\n unset($this->unresolved[$node['key']]);\n }\n }\n }", "private function previous()\n {\n $this->m--;\n $this->init();\n }", "function prev_url($url)\n {\n \n $page = curl_get_file($url);\n //To find prev url\n $regex = '@<link\\s*rel=\"prev\"\\s*href=\"(.*)?\"@';\n preg_match($regex,$page,$u);\n if($u == null)\n return null;\n else \n return $u[1];\n }", "public function prev() {\n $db = $this->getDbConnection();\n $criteria = $this->getDbCriteria();\n $alias = $db->quoteColumnName($this->getTableAlias());\n $criteria->addCondition($alias . '.' . $db->quoteColumnName($this->rightAttribute) . '=' . ($this->{$this->leftAttribute} - 1));\n\n if ($this->hasManyRoots) {\n $criteria->addCondition($alias . '.' . $db->quoteColumnName($this->rootAttribute) . '=' . CDbCriteria::PARAM_PREFIX . CDbCriteria::$paramCount);\n $criteria->params[CDbCriteria::PARAM_PREFIX . CDbCriteria::$paramCount++] = $this->{$this->rootAttribute};\n }\n\n return $this;\n }", "public function prev() {\n return $this->_prev($this->parent->children(), func_get_args());\n }", "public function previousSibling()\n {\n $node = $this->node->previousSibling;\n\n if ($node === null) {\n return null;\n }\n\n return new Element($node);\n }", "public function getPreviousState();", "public function optimize()\n {\n $current = $this;\n while (null !== $current->parent\n && $current->lastSlot === $current->parent->lastSlot) {\n $current = $current->parent;\n }\n\n return $current;\n }", "public function sourceSelector(){\n try {\n // Sparql11query.g:110:3: ( iriRef ) \n // Sparql11query.g:111:3: iriRef \n {\n $this->pushFollow(self::$FOLLOW_iriRef_in_sourceSelector394);\n $this->iriRef();\n\n $this->state->_fsp--;\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }", "public function getPreviousRoute()\r\n {\r\n if ($this->_currentStep == reset($this->_steps)) {\r\n return false;\r\n }\r\n return [$this->owner->id . '/' . $this->owner->action->id] + [$this->queryParam => $this->_currentStep, $this->previousButton => ''];\r\n }", "public function restore_previous_locale() {\n\t\t$previous_locale = array_pop( $this->locales );\n\n\t\tif ( null === $previous_locale ) {\n\t\t\t// The stack is empty, bail.\n\t\t\treturn false;\n\t\t}\n\n\t\t$locale = end( $this->locales );\n\n\t\tif ( ! $locale ) {\n\t\t\t// There's nothing left in the stack: go back to the original locale.\n\t\t\t$locale = $this->original_locale;\n\t\t}\n\n\t\t$this->change_locale( $locale );\n\n\t\t/**\n\t\t * Fires when the locale is restored to the previous one.\n\t\t *\n\t\t * @since 4.7.0\n\t\t *\n\t\t * @param string $locale The new locale.\n\t\t * @param string $previous_locale The previous locale.\n\t\t */\n\t\tdo_action( 'restore_previous_locale', $locale, $previous_locale );\n\n\t\treturn $locale;\n\t}", "private function popNode()\r\n {\r\n $this->currentNode = $this->currentNode->parentNode;\r\n }", "public function processFindReplace ()\n {\n\n if ( $this->replaceQuery ) {\n\n $this->replace ();\n\n } else {\n\n $this->find ();\n\n }\n\n }", "public static function getPreviousSiblingElement($node) {\n do {\n $node = $node->previousSibling;\n } while ($node && !($node instanceof DOMElement));\n return $node;\n }", "function previous_post_smart( $format = '%link', $title = '%title', $fallback = true, $in_same_cat = true, $excluded_categories = '' ) {\n\treturn Smarter_Navigation::adjacent_post( $format, $title, true, $fallback, $in_same_cat, $excluded_categories );\n}", "public function hasPrevSibling();", "function smarty_block_mtentryprevious($args, $content, &$ctx, &$repeat) {\n static $_prev_cache = array();\n if (!isset($content)) {\n $ctx->localize(array('entry', 'conditional', 'else_content'));\n $entry = $ctx->stash('entry');\n if ($entry) {\n $label = $entry->entry_id;\n if (isset($args['by_author']) && $args['by_author']) {\n $label .= ':author=' . $entry->entry_author_id;\n }\n if ((isset($args['by_category']) && $args['by_category']) || (isset($args['by_folder']) && $args['by_folder'])) {\n $cat = $entry->category();\n $cat_id = $cat ? $cat->category_id : 0;\n $label .= ':category=' . $cat_id;\n }\n\n if (isset($_prev_cache[$label])) {\n $prev_entry = $_prev_cache[$label];\n } else {\n $mt = MT::get_instance();\n $blog_id = $entry->entry_blog_id;\n if (isset($args['class'])) {\n $class = $args['class'];\n } else {\n $class = 'entry';\n }\n $ts = $mt->db()->db2ts( ($class == 'entry')\n ? $entry->entry_authored_on\n : $entry->entry_modified_on\n );\n $eargs = array('not_entry_id' => $entry->entry_id,\n 'current_timestamp_end' => $ts,\n 'lastn' => 1,\n 'blog_id' => $blog_id,\n 'class' => $class);\n if (isset($args['by_author'])) {\n $eargs['author_id'] = $entry->entry_author_id;\n }\n if (isset($args['by_category']) || isset($args['by_folder'])) {\n $eargs['category_id'] = $cat_id;\n }\n list($prev_entry) = $ctx->mt->db()->fetch_entries($eargs);\n if ($prev_entry) $_prev_cache[$label] = $prev_entry;\n }\n $ctx->stash('entry', $prev_entry);\n }\n $ctx->stash('conditional', isset($prev_entry));\n $ctx->stash('else_content', null);\n } else {\n if (!$ctx->stash('conditional')) {\n $content = $ctx->stash('else_content');\n }\n $ctx->restore(array('entry', 'conditional', 'else_content'));\n }\n return $content;\n}", "protected function initMatchAndReverse () {\n\t\tif ($this->reverseSections !== NULL) return;\n\t\tif ($this->pattern === NULL)\n\t\t\t$this->throwExceptionIfKeyPropertyIsMissing('pattern');\n\n\t\t$this->lastPatternParam = NULL;\n\t\t$match = addcslashes($this->pattern, \"#(){}-?!=^$.+|:*\\\\\");\n\t\t$reverse = $this->reverse !== NULL\n\t\t\t? $this->reverse\n\t\t\t: $this->pattern;\n\n\t\tlist($this->reverseSections, $matchSections) = $this->initSectionsInfoForMatchAndReverse(\n\t\t\t$reverse, $match\n\t\t);\n\t\t$this->reverse = $reverse;\n\t\t$this->reverseParams = $this->initReverseParams(\n\t\t\t$reverse, $this->reverseSections, $this->constraints, $match\n\t\t);\n\t\t$this->initFlagsByPatternOrReverse($reverse);\n\t\t$this->match = $this->initMatchComposeRegex(\n\t\t\t$match, $matchSections, $this->reverseParams, $this->constraints\n\t\t);\n\t}", "function getPreviousState();", "public function getPreviousPosition(string $string): ?int;", "public function reset(): void {\n $this->node = $this->dfa->getStartNode();\n $this->errorState = false;\n $this->finalState = $this->dfa->isFinal($this->node);\n }", "public function loadPreviousPage()\n {\n $prevPage = $this->results->getPreviousPage();\n $this->search($prevPage);\n }", "public function testPreSubmitWithOldNode()\n {\n $nodeSourceId = 'root';\n Phake::when($this->node)->getId()->thenReturn($nodeSourceId);\n Phake::when($this->form)->getData()->thenReturn($this->node);\n Phake::when($this->event)->getData()->thenReturn(array('nodeSource' => $nodeSourceId));\n\n $this->subscriber->preSubmit($this->event);\n\n Phake::verify($this->nodeManager, Phake::never())->hydrateNodeFromNodeId(Phake::anyParameters());\n }", "function sopac_prev_search_url($override = FALSE) {\n if (!$_SESSION['search_url']) { return FALSE; }\n $referer = substr($_SERVER['HTTP_REFERER'], 7 + strlen($_SERVER['HTTP_HOST']));\n $search = $_SESSION['search_url'];\n if ((($search == $referer) || $override) && $_SESSION['search_url']) {\n return $search;\n }\n else {\n return FALSE;\n }\n}", "public function getNext()\n {\n $next = null;\n $find = false;\n if (!is_null($this->parent)) {\n foreach ($this->parent->content as $c) {\n if ($find) {\n $next = &$c;\n break;\n }\n if ($c == $this) {\n $find = true;\n }\n }\n }\n return $next;\n }", "protected function _findLeaveNodeByKey(\\SetaPDF_Core_Type_Dictionary $node, $key, $exactMatch = true, &$intermediateNodes = [/** value is missing */]) {}", "public function getPreviousArticle() {\n return ArticleLanguageVersion::join('article', 'translated_article.article_id', '=', 'article.id')\n ->where('article.created', '<', $this->article->created)\n ->where('translated_article.language', $this->articleLanguageVersion->language)\n ->where('translated_article.published', true)\n ->orderBy('article.created', 'DESC')\n ->first();\n }", "protected function incrementRefactoredNodes()\n {\n $this->refactoredNodes++;\n }", "protected function resolveOtherName(PHPParser_Node_Name $name) {\n // ones at compiler-time\n if ($name->isFullyQualified() || $name->isUnqualified()) {\n return $name;\n }\n\n // resolve aliases for qualified names\n $aliasName = strtolower($name->getFirst());\n if ($name->isQualified() && isset($this->aliases[$aliasName])) {\n $name->setFirst($this->aliases[$aliasName]);\n // prepend namespace for relative names\n } elseif (null !== $this->namespace) {\n $name->prepend($this->namespace);\n }\n\n return new PHPParser_Node_Name_FullyQualified($name->parts, $name->getAttributes());\n }", "protected function resolveClassName(PHPParser_Node_Name $name) {\n if (in_array((string) $name, array('self', 'parent', 'static'))) {\n return $name;\n }\n\n // fully qualified names are already resolved\n if ($name->isFullyQualified()) {\n return $name;\n }\n\n // resolve aliases (for non-relative names)\n $aliasName = strtolower($name->getFirst());\n if (!$name->isRelative() && isset($this->aliases[$aliasName])) {\n $name->setFirst($this->aliases[$aliasName]);\n // if no alias exists prepend current namespace\n } elseif (null !== $this->namespace) {\n $name->prepend($this->namespace);\n }\n\n return new PHPParser_Node_Name_FullyQualified($name->parts, $name->getAttributes());\n }", "public function reorder()\n {\n $node = $this->page->find($this->request->get('nodeToChangeParent'));\n\n if ($this->request->get('parent') === '#') {\n $node->makeRoot();\n $this->changeSiblingsPositions($node, $this->request->get('position'));\n } else {\n $parent = $this->page->find($this->request->get('parent'));\n $node->makeChildOf($parent);\n $this->changeSiblingsPositions($node, $this->request->get('position'));\n }\n\n return [\n 'Position changed' => true,\n ];\n }", "abstract public function resolve();", "public function secondPreviousMatch(){\n return $this->belongsTo('App\\Match', 'prev_match2_id', 'id');\n }", "public function getPrevious(\n ?array $criteria = null,\n ?array $order = null\n ) {\n if ($this->getNode()->getPosition() <= 1) {\n return null;\n }\n if (null === $order) {\n $order = [];\n }\n\n if (null === $criteria) {\n $criteria = [];\n }\n\n $criteria['parent'] = $this->getNode()->getParent();\n /*\n * Use < operator to get first previous nodeSource\n * even if it’s not the previous position index\n */\n $criteria['position'] = [\n '<',\n $this->getNode()->getPosition(),\n ];\n\n $order['position'] = 'DESC';\n\n return $this->getRepository()->findOneBy(\n $criteria,\n $order\n );\n }", "public function afterFind(&$result){\n\t}", "function getPreviousStep($step)\r\n {\r\n $ret = null;\r\n $steps = array_keys($this->_steps);\r\n\r\n $done = false;\r\n foreach ($steps as $s) {\r\n if ($s == $step) {\r\n $done = true;\r\n break;\r\n }\r\n $ret = $s;\r\n }\r\n\r\n return $ret;\r\n }", "public function getPrevious() {}", "public function Previous()\n {\n return parent::Previous();\n }", "protected function resolveOtherName(Node\\Name $name) {\n // ones at compiler-time\n if ($name->isFullyQualified() || $name->isUnqualified()) {\n return $name;\n }\n\n // resolve aliases for qualified names\n if ($name->isQualified() && isset($this->aliases[$name->getFirst()])) {\n $name->setFirst($this->aliases[$name->getFirst()]);\n // prepend namespace for relative names\n } elseif (null !== $this->namespace) {\n $name->prepend($this->namespace);\n }\n\n return new Node\\Name\\FullyQualified($name->parts, $name->getAttributes());\n }", "public function fastForward()\n {\n $this->current = $this->top();\n }", "protected function fixSelf() {}", "protected function fixSelf() {}", "public function countPrevSiblings();", "public function previous() {\r\n return prev($this->collection);\r\n }", "public function prev_entry()\n\t{\n\t\treturn $this->_prev_next('prev');\n\t}", "function SearchPrev ( $cFieldExp )\n{\n return $this->Search_Data($this->_SQL_Where_('<',$this->KeyCurrList()),$cFieldExp,false);\n}", "function CheckPreviousSibling($pPreviousSibling, $pDepth){\n\t$lPutNewline = true;\n\t$lPutFormattingSymbols = CalculateNodeFormattingSymbols($pDepth);\n\tif( !$pPreviousSibling || $pPreviousSibling->nodeType != 3 ){\n\t\treturn array($lPutNewline, $lPutFormattingSymbols);\n\t}\n\t$lText = $pPreviousSibling->textContent;\n\t$lLastNewLinePos = mb_strrpos($lText, \"\\n\");\n\tif( $lLastNewLinePos === false ){\n\t\treturn array($lPutNewline, $lPutFormattingSymbols);\n\t}\n\t$lFollowingText = mb_substr($lText, $lLastNewLinePos + 1);\n\t$lFollowingLength = mb_strlen($lFollowingText);\n\tfor( $i = 0; $i < $lFollowingLength; ++$i ){\n\t\tif( $lFollowingText[$i] !== XML_FORMATTING_SYMBOL ){\n\t\t\t//~ echo 111;\n\t\t\t//~ var_dump($lFollowingText[$i]);\n\t\t\t//~ var_dump(XML_FORMATTING_SYMBOL);\n\t\t\t//~ var_dump($lFollowingText[$i] === ' ');\n\t\t\t//~ exit;\n\t\t\treturn array($lPutNewline, $lPutFormattingSymbols);\n\t\t}\n\t}\n\n\treturn array(false, $lPutFormattingSymbols - $lFollowingLength);\n}", "function checkForPreviousImport(){\n global $name, $blockToCheck, $con, $runType, $sqlAction, $university, $previousCheckComplete, $passedStartAdvisor, $startAdvisor,\n $previousHeader, $school, $department, $previousInfo, $similarNames, $previousPic, $previousSchool, $previousDepartment, $newName;\n \n $newName = \"\";\n if ( function_exists(\"parseLink\") === false ){\n require(\"../../../lib/linkParser.php\");\n }\n\t // Get the name and check to see if the name exists in the database\n\t \n\t if ( isset($_GET[\"completed\"]) ){\n\t $completed = json_decode($_GET[\"completed\"],true);\n\t }\n\t $nameCheck = runSQL($con,\"SELECT `Header`,`Block`,`School`,`Department`,`Info`,`Name` FROM `$runType` WHERE `University` = '$university'\");\n\t if ( mysqli_num_rows($nameCheck) > 0 ){\n\t // Check to see if the advisor already exists in the database\n\t $id = 1;\n\t while ( $row = mysqli_fetch_array($nameCheck) ){\n\t $lev = levenshtein($row[\"Name\"],$name);\n\t if ( $name == $row[\"Name\"] ){\n\t $sqlAction = \"UPDATE\";\n\t $blockToCheck = $row[\"Block\"];\n\t $previousHeader = $row[\"Header\"];\n\t $previousInfo = $row[\"Info\"];\n\t $previousPic = $row[\"Picture\"];\n\t $previousSchool = $row[\"School\"];\n\t $previousDepartment = $row[\"Department\"];\n\t echo $name . \"<br/>\";\n\t //print_r($previousDepartment);\n\t echo \"<br/>\";\n\t return \"UPDATE\";\n\t }\n\t else if ( ( $lev > -1 && $lev < 4 ) ){\n\t $nameInfo = json_decode(file_get_contents(\"http://www.projectlever.com/import/lib/names.json\"),true);\n\t if ( $nameInfo[$name] != null ){\n\t if ( stripos($nameInfo[$name],\"-continue\") === false ){\n\t $newName = str_replace(\"-continue\",\"\",$nameInfo[$name]);\n\t //echo $newName;exit;\n\t }\n\t $sqlAction = \"UPDATE\";\n \t $blockToCheck = $row[\"Block\"];\n \t $previousHeader = $row[\"Header\"];\n \t $previousInfo = $row[\"Info\"];\n \t $previousPic = $row[\"Picture\"];\n \t $previousSchool = $row[\"School\"];\n \t $previousDepartment = $row[\"Department\"];\n \t echo $name . \"<br/>\";\n \t //print_r($previousDepartment);\n \t return \"UPDATE\";\n\t }\n\t else if ( $nameInfo[$row[\"Name\"]] != null ){\n\t if ( stripos($nameInfo[$row[\"Name\"]],\"-continue\") === false ){\n\t $newName = str_replace(\"-continue\",\"\",$nameInfo[$row[\"Name\"]]);\n\t }\n\t $sqlAction = \"UPDATE\";\n \t $blockToCheck = $row[\"Block\"];\n \t $previousHeader = $row[\"Header\"];\n \t $previousInfo = $row[\"Info\"];\n \t $previousPic = $row[\"Picture\"];\n \t $previousSchool = $row[\"School\"];\n \t $previousDepartment = $row[\"Department\"];\n \t echo $name . \"<br/>\";\n \t \n \t echo \"<br/>\";\n \t return \"UPDATE\";\n\t }\n\t else if ( strpos($row[\"Name\"],trim($name)) !== false ){\n\t $newName = trim($name);\n\t $sqlAction = \"UPDATE\";\n\t return \"UPDATE\";\n\t }\n\t else {\n\t echo \"<span class='change' onclick='window.parent.keepMe(document.advisorToRun,document.nameFromSQL)' style='cursor:default'>\".$name . \"</span> -- <span onclick='window.parent.keepMe(document.nameFromSQL,document.advisorToRun)' style='cursor:default' class='change'>\" . $row[\"Name\"] . \"</span>\";\n\t echo \"<button onclick='window.parent.skip(document.advisorToRun,document.nameFromSQL)'>Skip</button><button onclick='window.parent.setNewName(document.advisorToRun)'>New Name</button>\";\n\t echo \"<script>window.parent.set(\\\"\".$name.\"\\\",\\\"\".$row[\"Name\"].\"\\\");\n \t document.advisorToRun = \\\"\".$name.\"\\\";\n \t document.nameFromSQL = \\\"\".$row[\"Name\"].\"\\\";\n \t </script>\";\n\t exit;\n\t }\n\t }\n\t }\n\t // The advisor doesn't exist in the database yet!\n\t $sqlAction = \"INSERT\";\n return \"INSERT\";\n\t }\n\t $sqlAction = \"continue\";\n $previousCheckComplete = true;\n\t return \"continue\";\n }", "public function test_resolve_current_version_going_up()\n {\n $this->clear_dummy_data();\n $this->insert_dummy_version_data( array(1));\n\n $migrator_util = new Ruckusing_Util_Migrator($this->adapter);\n $migrator_util->resolve_current_version(3, 'up');\n\n $executed = $migrator_util->get_executed_migrations();\n $this->assertEquals(true, in_array(3, $executed));\n $this->assertEquals(true, in_array(1, $executed));\n $this->assertEquals(false, in_array(2, $executed));\n }", "public function next_match() {\r\n if ($this->raw_matches_created) {\r\n if (isset($this->matches[$this->match_pointer])) {\r\n $this->match_pointer++;\r\n return $this->matches[$this->match_pointer - 1];\r\n }\r\n else\r\n return false;\r\n }\r\n elseif($this->matchdays_created) {\r\n if (isset($this->matches[$this->matchday_pointer - 1][$this->match_pointer])) {\r\n $this->match_pointer++;\r\n return $this->matches[$this->matchday_pointer - 1][$this->match_pointer - 1];\r\n }\r\n else\r\n return false;\r\n }\r\n else {\r\n $this->error = 'No matches created yet.';\r\n return false;\r\n }\r\n }", "public function back()\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 unshiftNode( $node );", "public function prevSibling()\n {\n return $this->adjacentSibling(-1);\n }", "public function previous($fallback = false)\n {\n return $this->url->previous($fallback);\n }" ]
[ "0.5552641", "0.5229051", "0.5058993", "0.5048684", "0.5048008", "0.5003722", "0.4993257", "0.48843005", "0.48292768", "0.48287633", "0.47988746", "0.4765076", "0.4754491", "0.47362277", "0.47285512", "0.4705516", "0.4705513", "0.47052988", "0.47004864", "0.46934402", "0.4687768", "0.46729556", "0.4668881", "0.46156907", "0.45702627", "0.4568772", "0.4557643", "0.45387086", "0.45254585", "0.45056733", "0.44924843", "0.44802877", "0.44711792", "0.44676772", "0.446525", "0.4431357", "0.44296047", "0.4428631", "0.44253662", "0.4418029", "0.44164488", "0.44068485", "0.4402981", "0.4393418", "0.438605", "0.43516302", "0.43502533", "0.4348013", "0.43413207", "0.4339775", "0.4330415", "0.43127176", "0.431252", "0.4310039", "0.43094116", "0.43082315", "0.43021122", "0.430201", "0.4296096", "0.42922813", "0.42911878", "0.4288966", "0.42844093", "0.4282306", "0.42730042", "0.42697868", "0.42688227", "0.42688", "0.4250391", "0.42485583", "0.4242587", "0.42353275", "0.42343092", "0.4233848", "0.42327797", "0.4223627", "0.4223455", "0.42231762", "0.42038742", "0.4199819", "0.41818342", "0.41812593", "0.4180172", "0.4169819", "0.41653055", "0.41648316", "0.41614687", "0.41614687", "0.41487825", "0.414124", "0.4140321", "0.41397256", "0.4138645", "0.4137647", "0.41304958", "0.41297647", "0.41291934", "0.4126673", "0.4126082", "0.4108067" ]
0.5586638
0
Tests if the configuration is valid If the configuration has a "table_service" key, and that service exists, then the configuration is valid. Otherwise, it checks if the service $requestedName\Table exists.
protected function isValidConfig(array $config, $requestedName, ServiceLocatorInterface $services) { if (isset($config['table_service'])) { return $services->has($config['table_service']); } $tableGatewayService = $requestedName . '\Table'; return $services->has($tableGatewayService); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n {\n// return (substr($requestedName, 0, strlen('application.table.')) == 'application.table.') || (substr($requestedName, 0, strlen('quiz.table.')) == 'quiz.table.');\n return (strpos($requestedName, '.model.table.') !== false);\n }", "public function canCreate(ContainerInterface $container, $requestedName)\n {\n if (0 !== strpos($requestedName, self::SERVICE_PREFIX)) {\n return false;\n }\n $config = $this->getConfig($container);\n\n return $this->hasNamedConfig($requestedName, $config);\n }", "public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n {\n $config = $serviceLocator->get('config');\n\n if(empty($config)){\n return false;\n }\n\n return isset($config[$this->configKey][$requestedName]);\n\n }", "public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n {\n $config = $this->getConfig($serviceLocator);\n if (empty($config)) {\n return false;\n }\n\n if (isset($config[$requestedName])\n && is_array($config[$requestedName])\n && !empty($config[$requestedName])\n ) {\n return true;\n }\n return false;\n }", "public function valid()\n {\n\n if ($this->container['serviceName'] === null) {\n return false;\n }\n $allowedValues = $this->getServiceNameAllowableValues();\n if (!in_array($this->container['serviceName'], $allowedValues)) {\n return false;\n }\n if ($this->container['minimumStanding'] === null) {\n return false;\n }\n if ($this->container['surchargePerBadStanding'] === null) {\n return false;\n }\n if ($this->container['discountPerGoodStanding'] === null) {\n return false;\n }\n return true;\n }", "public function canCreate(ContainerInterface $container, $requestedName)\n {\n if (! $container->has('config') || ! array_key_exists(self::class, $container->get('config'))) {\n return false;\n }\n $config = $container->get('config');\n $dependencies = $config['mamaz_db'];\n return is_array($dependencies);\n }", "public function isTableExists(): bool\n {\n $sql = 'SHOW TABLES LIKE :table_name;';\n $stmt = $this->pdo->prepare($sql);\n $result = $stmt->execute([':table_name' => $this->tableName]);\n if (!$result) {\n $errorInfo = print_r($stmt->errorInfo(), true);\n throw new \\RuntimeException(\"Couldn't check if Log table exists. Query string: `{$stmt->queryString}`, table name: `{$this->tableName}`, error info: `{$errorInfo}`.\");\n }\n\n return 1 === $stmt->rowCount();\n }", "public function tableExists( $tablename );", "private function _checkTXNTableExists() {\n $curTable = readSetting( $this->settings['DataFile'], 'txnTable' );\n $txnTable = $this->settings['txnTable'];\n $rVal = false;\n\n // If the Transaction Table is Not the Same as Expected, then Create It\n if ( $curTable != $txnTable ) {\n $sqlStr = $this->_readTXNTableDefinitions();\n if ( $sqlStr ) {\n $rslt = doSQLExecute( $sqlStr );\n }\n\n // Confirm the Table Exists, and Save the TXN Name if Appropriate\n if ( $this->_confirmTXNTables() ) {\n $rVal = saveSetting( $this->settings['DataFile'], 'txnTable', $txnTable );\n writeNote( \"Saved Transaction Table Record: \" . BoolYN($rVal) );\n }\n }\n\n // Return the Boolean Response\n return $rVal;\n }", "public function has_Table(string $nameTable): bool\n {\n return $this->is_Table($nameTable);\n }", "public function tableExists(string $tableName): bool;", "public function isConfigured(): bool\n {\n foreach ($this->dbal->getDatabases() as $db) {\n if (!$db->hasTable($this->config->getTable())) {\n return false;\n }\n }\n\n return true;\n }", "public function canCreateServiceWithName(ServiceLocatorInterface $services, $name, $requestedName)\n {\n $config = $this->getConfig($services);\n if (empty($config)) {\n return false;\n }\n\n return (\n isset($config[$requestedName])\n && is_array($config[$requestedName])\n );\n }", "public function tableExists(string $table_name): bool\n {\n if (isset($this->getData()[$table_name])) {\n return true;\n }\n\n return false;\n }", "function check_requirements()\n\t{\n\t\t$sql_obj\t\t= New sql_query;\n\t\t$sql_obj->string\t= \"SELECT id FROM services WHERE id='\". $this->id .\"' LIMIT 1\";\n\t\t$sql_obj->execute();\n\n\t\tif (!$sql_obj->num_rows())\n\t\t{\n\t\t\tlog_write(\"error\", \"page_output\", \"The requested service (\". $this->id .\") does not exist - possibly the service has been deleted.\");\n\t\t\treturn 0;\n\t\t}\n\n\t\tunset($sql_obj);\n\n\t\treturn 1;\n\t}", "public function serviceExists(string $serviceName): bool;", "public function canCreate(ContainerInterface $container, $requestedName)\n {\n if (! $container->has('config')) {\n return false;\n }\n\n $config = $container->get('config');\n if (! isset($config['zf-rpc'][$requestedName])) {\n return false;\n }\n\n $config = $config['zf-rpc'][$requestedName];\n\n if (! is_array($config)\n || ! isset($config['callable'])\n ) {\n return false;\n }\n\n return true;\n }", "abstract public function tableExists($tableName);", "public function testCheckTableExist() {\n\n\t}", "public function tableExists($tableName, $schemaName=null){ }", "public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n {\n if ($serviceLocator instanceof AbstractPluginManager) {\n $serviceLocator = $serviceLocator->getServiceLocator();\n }\n\n $config = $this->getConfig($serviceLocator);\n if (empty($config)) {\n return false;\n }\n\n return (\n isset($config[$requestedName])\n && is_array($config[$requestedName])\n && !empty($config[$requestedName])\n && isset($config[$requestedName]['model'])\n && is_string($config[$requestedName]['model'])\n );\n }", "abstract public function hasTable($tableName);", "final public static function tableExists( $chrTable ) {\n\n\t\t$objQuery = DB::prepare(\"SELECT * FROM information_schema.tables WHERE TABLE_NAME = ? AND ? LIKE(CONCAT('%', TABLE_SCHEMA, '%'))\");\n\t\t$objQuery->execute(array($chrTable, Config::get('database:dsn')));\n\t\t$arrResults = $objQuery->fetchAll();\n\t\t\n\t\tif(sizeof($arrResults) > 0){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}", "public function hasTable($tableName);", "public function hasTable($tableName);", "public function checkInstalled() {\n $query = $this->db->query(sprintf('SHOW TABLES LIKE \"%s\"',\n Config::getTableName('requests')));\n $request_table_result = $query->rowCount();\n\n $query = $this->db->query(sprintf('SHOW TABLES LIKE \"%s\"',\n Config::getTableName('users')));\n $user_table_result = $query->rowCount();\n\n if ($request_table_result > 0 || $user_table_result > 0) {\n return true;\n } else {\n return false;\n }\n }", "public function hasSchemaTable();", "public function is_Table(string $nameTable): bool\n {\n if ($nameTable == \"\") {\n return false;\n }\n $entity = $this->getschema($nameTable);\n return $entity->getNameTable() != null;\n }", "public static function checkIfHasTable($table)\n\t {\n\t \t if(is_null($table))\n {\n exit('Table name is required!');\n }\n\t }", "public static function tableExists() {\n self::init();\n return self::$wpdb->get_var(self::$wpdb->prepare(\"SHOW TABLES LIKE '%s'\", self::$table)) === self::$table;\n }", "public function hasTable($table);", "public function isServiceLoaded(string $serviceName): bool;", "public function canGetTableName() {\n\t\t$provider = $this->getConfigurationProviderInstance();\n\t\t$record = $this->getBasicRecord();\n\t\t$tableName = $provider->getTableName($record);\n\t\t$this->assertNull($tableName);\n\t}", "function tableExists($tablename);", "public function tableExists()\n {\n /**\n * Here we check to see if a table with that name already exists.\n */\n $mysqli = $this->getMysqli();\n $SQL = \"SHOW TABLES LIKE '\".$this->vars['db']['table'].\"'\";\n // echo $SQL;\n if (!$result = $mysqli->query($SQL)) {\n echo $mysqli->error;\n exit();\n }\n return !($result->num_rows == 0);\n }", "function tableExists($db, $table = 'settings') {\n try {\n $result = $db->query(\"SELECT 1 FROM $table LIMIT 1\"); \n } catch (Exception $e) {\n return false;\n }\n return $result == true;\n }", "function _cacheTableExists(){\n\t\tif ( isset($this->_cacheTableExists) ) return $this->_cacheTableExists;\n\t\t$res = mysql_query(\"SHOW TABLES LIKE '\".addslashes($this->tableName).\"'\", $this->app->db());\n\t\tif ( !$res ){\n\t\t\ttrigger_error(mysql_error($this->app->db()), E_USER_ERROR);\n\t\t}\n\t\treturn (mysql_num_rows($res) > 0);\n\t}", "private function tableExists($tablename)\t{\n\t\t$query = \"show table status where Name=\\\"\".$tablename.\"\\\"\";\n if ($result = $this->db_conn->query($query))\t{\n return $result->num_rows > 0;\n\t\t}\n\t\telse\t{\n\t\t\tdie (\"Error sending the query '\".$query.\"' to MySQL: \".$this->db_conn->error.\"\\n\");\n\t\t}\n\t}", "public function checkIfEssentialConfigurationExists() {}", "function sql_existTableName($tablename)\n {\n global $SQL_DBH;\n if (!$SQL_DBH) return FALSE;\n\n $drivername = $SQL_DBH->getAttribute(PDO::ATTR_DRIVER_NAME);\n $input_parameters = array(':name' => $tablename);\n if ($drivername == 'sqlite')\n {\n $sql = \"SELECT name FROM sqlite_master WHERE type='table' AND name = :name\";\n }\n else\n {\n // mysql\n $sql = 'SHOW TABLES LIKE :name ';\n }\n $res = array();\n $stmt = $SQL_DBH->prepare($sql);\n if ( $stmt && $stmt->execute($input_parameters) )\n $res = $stmt->fetch();\n if ($res && count($res)>0)\n return TRUE;\n return FALSE;\n }", "public function exists()\n\t{\n\t\treturn in_array($this->name, $this->driver->getTables());\n\t}", "public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n {\n return count($this->getServiceRegistry()->queryForName($name)) > 0 || count($this->getServiceRegistry()->queryForName($requestedName));\n }", "protected static function tableExists($sTable)\n {\n $oConfig = Registry::getConfig();\n $sDbName = $oConfig->getConfigParam('dbName');\n $sQuery = \"\n SELECT 1\n FROM information_schema.tables\n WHERE table_schema = ?\n AND table_name = ?\n \";\n\n return (bool)DatabaseProvider::getDb()->getOne($sQuery, array($sDbName, $sTable));\n }", "function tableExists($table);", "public function exists(string $sTableName): bool\n {\n $sDatabaseName = $this->getConnector()->getConfiguration()->getDatabaseName();\n\n $sQuery = '';\n $sQuery .= 'SELECT table_name ';\n $sQuery .= 'FROM information_schema.tables ';\n $sQuery .= \"WHERE table_schema = '$sDatabaseName' \";\n $sQuery .= \"AND table_name = '$sTableName' \";\n $sQuery .= \"LIMIT 1 \";\n\n try {\n $bExists = count($this->getConnector()->fetchAll($sQuery)) > 0;\n } catch (QueryException $oException) {\n $bExists = false;\n }\n\n return $bExists;\n }", "private function _configurationExists($input) {\n\t\t$check = $this->db->queryFetchSingle(\"SELECT * FROM \"._WE_CREDITSYS_.\" WHERE config_id = ?\", array($input));\n\t\tif($check) return true;\n\t\treturn false;\n\t}", "function TableExists($tableName, $connection, $dbName) {\r\n $t = mysqli_real_escape_string($connection, $tableName);\r\n $d = mysqli_real_escape_string($connection, $dbName);\r\n\r\n $checktable = mysqli_query($connection, \r\n \"SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_NAME = '$t' AND TABLE_SCHEMA = '$d'\");\r\n\r\n if(mysqli_num_rows($checktable) > 0) return true;\r\n\r\n return false;\r\n}", "public function testExists()\n {\n $this->assertFalse(TableRegistry::exists('Articles'));\n\n TableRegistry::config('Articles', ['table' => 'articles']);\n $this->assertFalse(TableRegistry::exists('Articles'));\n\n TableRegistry::get('Articles', ['table' => 'articles']);\n $this->assertTrue(TableRegistry::exists('Articles'));\n }", "public function hasConfig();", "private function TableExists($tableName)\r\n\t{\r\n\t\t$isTableName = false;\r\n if (!self::$_tables || !count(self::$_tables) || !isset(self::$_tables[$this->_dbCatalog]))\r\n {\r\n $this->UpdateStorageLocations();\r\n }\r\n\t\tif (isset(self::$_tables[$this->_dbCatalog][$tableName]))\r\n\t\t{\r\n\t\t\t$isTableName = true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$isTableName = false;\r\n\t\t\tforeach (self::$_tables[$this->_dbCatalog] as $testTableName => $tableValue)\r\n\t\t\t{\r\n\t\t\t\tif (strcasecmp($testTableName, $tableName) == 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$isTableName = true;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $isTableName;\r\n\t}", "public function checkForTable( $table );", "public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName) : bool\n {\n $requestedName = $requestedName.'Controller';\n\n if ($requestedName !== 'SD\\Admin\\Controller\\SettingsController') {\n return class_exists($requestedName);\n }\n\n return false;\n }", "public function isValid()\n {\n if (!file_exists($this->filename)) {\n $this->error = 'File does not exist';\n\n return false;\n }\n\n if (!is_readable($this->filename)) {\n $this->error = 'File is not readable';\n\n return false;\n }\n\n if (!$this->parseConfig()) {\n return false;\n }\n\n foreach ($this->connectionConfigRequired as $configKeyRequired) {\n if (!array_key_exists($configKeyRequired, $this->config->get('connection')) || is_null($this->config->get('connection.'.$configKeyRequired))) {\n $this->error = sprintf('Connection config key missing or null: %s', $configKeyRequired);\n }\n }\n\n $numberOfDatabases = count($this->get('databases', []));\n\n if ($numberOfDatabases === 0) {\n $this->error = 'No database configuration provided. Cannot continue.';\n\n return false;\n }\n\n if (!empty($this->error)) {\n return false;\n }\n\n return true;\n }", "public function hasTableName(){\n return $this->_has(1);\n }", "public function hasTableName(){\n return $this->_has(1);\n }", "public function hasTableName(){\n return $this->_has(1);\n }", "public function hasTableName(){\n return $this->_has(1);\n }", "public function hasTableName(){\n return $this->_has(1);\n }", "public function hasTableName(){\n return $this->_has(1);\n }", "private static function checkIfTodoListTableExists()\n {\n $query = \"SELECT 1 FROM Todo_List\";\n $result = mysqli_query(Core_DbConnectionModel::getInstance(), $query);\n\n //this part allows you to do something if the result is false or just return $result, however, you should check for MySQL error just in-case.\n $tableExistStatus = ($result !== false) ? true : false;\n\n return $tableExistStatus;\n }", "public function exists() : bool {\n return DB::tableExists($this->_name);\n }", "function TableExists($tableName, $connection, $dbName) {\n $t = mysqli_real_escape_string($connection, $tableName);\n $d = mysqli_real_escape_string($connection, $dbName);\n\n $checktable = mysqli_query($connection,\n \"SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_NAME = '$t' AND TABLE_SCHEMA = '$d'\");\n\n if(mysqli_num_rows($checktable) > 0) return true;\n\n return false;\n}", "function TableExists($tableName, $connection, $dbName) {\n $t = mysqli_real_escape_string($connection, $tableName);\n $d = mysqli_real_escape_string($connection, $dbName);\n\n $checktable = mysqli_query($connection,\n \"SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_NAME = '$t' AND TABLE_SCHEMA = '$d'\");\n\n if(mysqli_num_rows($checktable) > 0) return true;\n\n return false;\n}", "function tableExists($tableName) {\n\t\t$siteDao =& DAORegistry::getDAO('SiteDAO');\n\t\t$dict = NewDataDictionary($siteDao->getDataSource());\n\n\t\t// Check whether the table exists.\n\t\t$tables = $dict->MetaTables('TABLES', false);\n\t\treturn in_array($tableName, $tables);\n\t}", "public function oldTaxTableExists() {\n \n static $alreadyChecked = false;\n static $tableExists = false; // remember result of check if already done (prevents multiple checks per script execution)\n \n if ($alreadyChecked == false) {\n $tableExists = tx_pttools_div::dbTableExists($this->getTableName('STEUER'), $this->gsaDbObj);\n $alreadyChecked = true;\n }\n \n return $tableExists; \n \n }", "public function has(string $name): bool\n {\n try {\n $result = $this->configCommand($name);\n } catch (RuntimeException $exception) {\n return false;\n }\n\n return $result->isSuccessful();\n }", "function TableExists($tableName, $connection, $dbName) {\n $t = mysqli_real_escape_string($connection, $tableName);\n $d = mysqli_real_escape_string($connection, $dbName);\n\n $checktable = mysqli_query($connection, \n \"SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_NAME = '$t' AND TABLE_SCHEMA = '$d'\");\n\n if(mysqli_num_rows($checktable) > 0) return true;\n\n return false;\n}", "public function tableExists($name)\n {\n return (bool)$this->fetchValue(\"SHOW TABLES LIKE ?\", $name);\n }", "function tableExists($pdo, $table) {\n \n // Try a select statement against the table\n // Run it in try/catch in case PDO is in ERRMODE_EXCEPTION.\n try {\n $result = $pdo->query(\"SELECT 1 FROM $table LIMIT 1\");\n } catch (Exception $e) {\n // We got an exception == table not found\n return FALSE;\n }\n // Result is either boolean FALSE (no table found) or PDOStatement Object (table found)\n return $result !== FALSE;\n \n }", "static public function hasTable($table)\n {\n return self::call(__FUNCTION__ , func_get_args());\n }", "public function testHasValidTableName()\n {\n $this->assertSame('tbl_fields_types', $this->stub->getTable());\n }", "public function checkIfTablesExist()\n {\n foreach (self::DB_TABLE_INFO as $tableName => $createSql) {\n try {\n $result = $this->connection->query('SELECT 1 FROM turns LIMIT 1');\n } catch (Exception $e) {\n $result = false;\n }\n\n if ($result === false) {\n $this->connection->exec($createSql);\n }\n }\n }", "public function tableExists($table) {\n if (array_key_exists($table, $this->schema) && is_writable($this->directories['data']['core']['dir'].$table)) {\n return true;\n }\n else return false;\n }", "public function tableExists( $table, $fname = __METHOD__ ) {\n\t\t$table = $this->tableName( $table );\n\t\t$old = $this->ignoreErrors( true );\n\t\t$res = $this->query( \"SELECT 1 FROM $table LIMIT 1\", $fname );\n\t\t$this->ignoreErrors( $old );\n\n\t\treturn (bool)$res;\n\t}", "public static function tableExists( $sTableName ) {\n\t\t$rRes = mysql_query( sprintf( \"SHOW TABLES LIKE '%s'\", $sTableName ) );\n\t\treturn mysql_num_rows( $rRes ) ? TRUE : FALSE;\t\n\t}", "public function tableExists($name)\n {\n $tables = $this->listTables();\n foreach ($tables as $tableName) {\n if ($tableName == $name) {\n return true;\n }\n }\n \n return false;\n }", "public function newTaxTableExists() {\n \n static $alreadyChecked = false;\n static $tableExists = false; // remember result of check if already done (prevents multiple checks per script execution)\n \n if ($alreadyChecked == false) {\n $tableExists = tx_pttools_div::dbTableExists($this->getTableName('BHSTEUER'), $this->gsaDbObj);\n $alreadyChecked = true;\n }\n \n return $tableExists; \n \n }", "public function table_check() {\n\t // check if tables exist then create if not\n\t global $wpdb;\n\t \n\t $required_tables = array (\n\t \"$wpdb->prefix\" . \"tr_ratting_data\",\n\t \"$wpdb->prefix\" . \"tr_characters\",\n\t \"$wpdb->prefix\" . \"tr_structures_income\",\n\t \"$wpdb->prefix\" . \"tr_pvp_chars_kills\",\n\t \"$wpdb->prefix\" . \"tr_users_chars\",\n\t )\n\t \n\t ;\n\t foreach ( $required_tables as $table ) {\n\t $val = $wpdb->get_var ( \"SHOW TABLES LIKE '$table'\" );\n\t if ($val == $table) {\n\t // exists//\n\t } else {\n\t // create non existing\n\t $this->create_table ( $table );\n\t }\n\t }\n\t}", "public function tableExists($tableName) {\n $check = $this->con->query(\"SELECT 1 FROM $tableName\");\n if($check !== false && $check->num_rows > 0) {\n return true;\n } else {\n return false;\n }\n }", "public function isServiceEnabled(): bool\n {\n return $this->getModuleRegistry()->isModuleEnabled(SchemaConfigurationFunctionalityModuleResolver::SCHEMA_CONFIGURATION);\n }", "private function checkServiceServiceSet () {\n if(is_null($this->serviceService)) {\n $this->exceptionWithResponseCode(500,\n \"Internal error: The service service has not been set. Please contact a GOCDB administrator and report this error.\"\n );\n }\n }", "public function testValidatorForTableShouldBeExisted()\n {\n Log::info(__FUNCTION__);\n\n //Preparation -----------------------------\n //Add original data for update\n $postDataAdd = [\n 'datasource_name' => '1',\n 'table_id' => 1,\n 'starting_row_number' => 2,\n ];\n //TODO need to use \"V1\" in the url\n $addResponse = $this->post('api/add/data-source', $postDataAdd);\n $addResponseJson = json_decode($addResponse->content());\n $targetDataSourceId = $addResponseJson->id;\n\n //Execute -----------------------------\n $updatePostData = [\n 'datasource_name' => '1',\n 'table_id' => 100,\n 'starting_row_number' => 2,\n ];\n //TODO need to use \"V1\" in the url\n $updateResponse = $this->post('api/update/data-source', $updatePostData);\n\n //checking -----------------------------\n $updatedTable = Datasource::where('id', $targetDataSourceId)->first();\n\n // Check table data doesn't update\n $this->assertEquals($postDataAdd['datasource_name'], $updatedTable->datasource_name);\n $this->assertEquals($postDataAdd['table_id'], $updatedTable->table_id);\n $this->assertEquals($postDataAdd['starting_row_number'], $updatedTable->starting_row_number);\n\n\n //Check response\n $updateResponse\n ->assertStatus(422)\n ->assertJsonFragment([\"選択されたテーブルIDは正しくありません。\"]);\n }", "protected function ensureTableExists() {\n try {\n $database_schema = $this->connection->schema();\n $schema_definition = $this->schemaDefinition();\n $database_schema->createTable(static::TABLE_NAME, $schema_definition);\n }\n // If another process has already created the batch table, attempting to\n // recreate it will throw an exception. In this case just catch the\n // exception and do nothing.\n catch (DatabaseException $e) {\n }\n catch (\\Exception $e) {\n return FALSE;\n }\n return TRUE;\n }", "abstract function tables_present($prefix);", "public function canCreateServiceWithName(ServiceLocatorInterface $container, $name, $requestedName)\n {\n return $this->canCreate($container, $requestedName);\n }", "public function canCreate(ContainerInterface $container, $requestedName)\n {\n /* We check, if $requestedName ends with the string '/Events'.\n * Instead of parsing the string with regular expressions (eg. ~/Events$~),\n * it's more efficient to just check with strpos, if the reversed string starts\n * with the reverted '/Events' string.\n */\n return 0 === strpos(strrev($requestedName), 'stnevE/');\n }", "public function checkConfig();", "public function tableExists($tableName)\n {\n $db = \\Db::getInstance();\n $sql = 'SELECT * FROM ' . _DB_PREFIX_ . $tableName;\n try {\n $db->getValue($sql);\n } catch (\\Exception $e) {\n $this->logger->error(sprintf('Table %s does not exist', _DB_PREFIX_ . $tableName));\n\n return false;\n }\n\n return true;\n }", "public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)\n {\n $explodedName = explode('.', $requestedName);\n\n if(isset($explodedName[1])) {\n return $explodedName[1] === $this->getFactoryType();\n }\n }", "final public function hasService($name)\n {\n $services = $this->getServices();\n return isset($services[$name]);\n }", "private function tableAvailable($tableId)\n {\n $table = Table::where('id', $tableId)\n ->where('status', Table::AVAILABLE)\n ->first();\n\n if (! $table) {\n return false;\n }\n\n return true;\n }", "function tep_db_table_exists($table, $link = 'db_link') {\n $result = tep_db_query(\"show table status from `\" . DB_DATABASE . \"`\");\n while ($list_tables = tep_db_fetch_array($result)) {\n if ($list_tables['Name'] == $table) {\n return true;\n }\n }\n return false;\n }", "public static function tableExists( $table_name ) {\n\t\tglobal $wpdb;\n\n\t\t$response = [];\n\t\t$table = $wpdb->base_prefix . $table_name;\n\t\t$query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $table ) );\n\n\t\tif ( ! $wpdb->get_var( $query ) == $table_name ) {\n\n\t\t\tif ( self::$table_feedback == $table_name ) {\n\t\t\t\t$response[] = self::setupHelpfulFeedbackTable();\n\t\t\t}\n\n\t\t\tif ( self::$table_helpful == $table_name ) {\n\t\t\t\t$response[] = self::setupHelpfulTable();\n\t\t\t}\n\t\t}\n\n\t\treturn $response;\n\t}", "public function createTable(string $table_name): bool\n {\n if (!$this->tableExists($table_name)) {\n $this->data[$table_name] = [];\n\n return true;\n }\n\n return false;\n }", "public final function checkTables()\n {\n $stmt = self::$globalConnection->query('SELECT TABLE_NAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = \"BASE TABLE\" AND TABLE_SCHEMA = \"' . self::$database . '\"');\n $tables = [];\n while ($row = $stmt->fetch()) $tables[] = $row[0];\n $stmt->closeCursor();\n \n $needed_tables = [\n self::USERS,\n self::CLIENTS,\n self::CONFIG,\n self::RELOADS,\n self::EXPENSES,\n self::FORMULAS,\n self::FORMULAS_BOUGHT,\n self::FORMULAS_BOUGHT_PRODUCTS,\n self::FORMULAS_CHOICES,\n self::FORMULAS_CHOICES_PRODUCTS,\n self::FORMULAS_EDITS,\n self::PRODUCTS,\n self::PRODUCTS_BOUGHT,\n self::PRODUCTS_EDITS,\n self::PRODUCTS_GROUPS,\n self::REPLENISHMENTS,\n self::USERS\n ];\n \n if(count(array_intersect($tables, $needed_tables)) >= count($needed_tables)) return;\n \n self::query('SET foreign_key_checks = 0');\n \n if (! in_array($this->USERS, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->USERS` (\n `id` bigint(20) NOT NULL AUTO_INCREMENT,\n `username` varchar(255) NOT NULL,\n `email` varchar(255) NOT NULL,\n `firstname` varchar(255) NOT NULL,\n `familyname` varchar(255) NOT NULL,\n `phone` varchar(20) DEFAULT NULL,\n `group_id` tinyint(11) NOT NULL DEFAULT '1',\n `registration` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,\n `last_signin` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,\n `signin_count` bigint(20) NOT NULL DEFAULT '0',\n `password` varchar(500) NOT NULL,\n `permissions` longtext,\n PRIMARY KEY (`id`),\n UNIQUE KEY `username` (`username`),\n UNIQUE KEY `email` (`email`)\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->CLIENTS, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->CLIENTS` (\n `id` bigint(20) NOT NULL AUTO_INCREMENT,\n `user_id` bigint(20) COMMENT \"user\\'s id\",\n `member` int(11) NOT NULL DEFAULT '0',\n `balance` float(10,2) NOT NULL DEFAULT '0.00',\n PRIMARY KEY (`id`),\n FOREIGN KEY (`user_id`)\n REFERENCES `$this->USERS`(`id`)\n ON UPDATE CASCADE\n ON DELETE SET NULL\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->RELOADS, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->RELOADS` (\n `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT \"reload\\'s id\",\n `user_id` bigint(20) NOT NULL COMMENT \"user\\'s id\",\n `amount` float(10,2) NOT NULL COMMENT \"reload\\'s amount\",\n `user_balance` float(10,2) NOT NULL DEFAULT \"0.00\" COMMENT \" user\\'s balance after transaction\",\n `details` varchar(255) NOT NULL DEFAULT \"APP/UNKNOW\" COMMENT \"reload method\",\n `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT \"transaction\\'s date\",\n PRIMARY KEY (`id`),\n FOREIGN KEY (`user_id`)\n REFERENCES `$this->CLIENTS`(`id`)\n ON UPDATE CASCADE\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->CONFIG, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->CONFIG` (\n `id` int(11) NOT NULL AUTO_INCREMENT COMMENT \"id\",\n `name` varchar(255) NOT NULL COMMENT \"configuration key\",\n `value` text NOT NULL COMMENT \"configuration value\",\n `edit` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT \"last edition\",\n PRIMARY KEY (`id`)\n ) ENGINE=MyISAM DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->EXPENSES, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->EXPENSES` (\n `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT \"transaction\\'s id\",\n `user_id` bigint(20) NOT NULL COMMENT \"user\\'s id\",\n `user_balance` float(10,2) NOT NULL DEFAULT \"0.00\" COMMENT \"user\\'s balance after transaction\",\n `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT \"transaction\\'s date\",\n PRIMARY KEY (`id`),\n FOREIGN KEY (`user_id`)\n REFERENCES `$this->CLIENTS`(`id`)\n ON UPDATE CASCADE\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->PRODUCTS_GROUPS, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->PRODUCTS_GROUPS` (\n `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT \"product group id\",\n `name` varchar(30) NOT NULL COMMENT \"product group name\",\n `display_name` varchar(255) NOT NULL COMMENT \"product group display name\",\n `edit` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT \"edit time\",\n PRIMARY KEY (`id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->PRODUCTS_EDITS, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->PRODUCTS_EDITS` (\n `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT \"edit id\",\n `product` bigint(20) NOT NULL COMMENT \"product id\",\n `name` varchar(255) NULL DEFAULT NULL COMMENT \"new product name\",\n `price` float(10,2) NULL DEFAULT NULL COMMENT \"new product price\",\n `edit` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT \"edition\",\n PRIMARY KEY (`id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->PRODUCTS, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->PRODUCTS` (\n `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT \"product id\",\n `product_group` bigint(11) NOT NULL DEFAULT \"0\" COMMENT \"product group\",\n `image` longtext COMMENT \"product image\",\n `stock` BIGINT NOT NULL DEFAULT \"0\" COMMENT \"amount in stock\",\n `viewable` tinyint(1) NOT NULL DEFAULT \"1\" COMMENT \"does the product have to be shown\",\n `last_edit` bigint(20) NOT NULL DEFAULT \"0\" COMMENT \"last product edit id\",\n PRIMARY KEY (`id`),\n FOREIGN KEY (`last_edit`)\n REFERENCES `$this->PRODUCTS_EDITS`(`id`)\n ON UPDATE CASCADE,\n FOREIGN KEY (`product_group`)\n REFERENCES `$this->PRODUCTS_GROUPS`(`id`)\n ON UPDATE CASCADE\n ON DELETE CASCADE\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->PRODUCTS_BOUGHT, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->PRODUCTS_BOUGHT` (\n `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT \"transaction id\",\n `expense_id` bigint(11) NOT NULL COMMENT \"expense id\",\n `product_id` bigint(11) NOT NULL COMMENT \"product bought id\",\n `edit_id` bigint(20) NULL DEFAULT NULL COMMENT \"product edit id at the transaction date\",\n `user_id` bigint(20) NOT NULL COMMENT \"user id\",\n `quantity` int(11) NOT NULL DEFAULT \"1\" COMMENT \"product quantity\",\n `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT \"transaction date\",\n PRIMARY KEY (`id`),\n FOREIGN KEY (`expense_id`)\n REFERENCES `$this->EXPENSES`(`id`)\n ON UPDATE CASCADE\n ON DELETE CASCADE,\n FOREIGN KEY (`edit_id`)\n REFERENCES `$this->PRODUCTS_EDITS`(`id`)\n ON UPDATE CASCADE,\n FOREIGN KEY (`user_id`)\n REFERENCES `$this->CLIENTS`(`id`)\n ON UPDATE CASCADE\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->REPLENISHMENTS, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->REPLENISHMENTS` (\n `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT \"replenishment id\",\n `product_id` bigint(11) COMMENT \"product id\",\n `quantity` int(11) NOT NULL COMMENT \"replenishment quantity\",\n `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT \"replenishment date\",\n PRIMARY KEY (`id`),\n FOREIGN KEY (`product_id`)\n REFERENCES `$this->PRODUCTS`(`id`)\n ON UPDATE CASCADE\n ON DELETE SET NULL\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->FORMULAS_EDITS, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->FORMULAS_EDITS` (\n `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT \"id\",\n `formula` bigint(20) NOT NULL COMMENT \"formula id\",\n `name` varchar(255) NULL DEFAULT NULL COMMENT \"new formula name\",\n `price` float(10,2) NULL DEFAULT NULL COMMENT \"new formula price\",\n `edit` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT \"edition\",\n PRIMARY KEY (`id`)\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->FORMULAS, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->FORMULAS` (\n `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT \"formula\\'s id\",\n `image` longtext COMMENT \"formula\\'s image\",\n `viewable` tinyint(1) NOT NULL DEFAULT \"1\" COMMENT \"is the formula viewable\",\n `last_edit` bigint(20) NOT NULL DEFAULT \"0\" COMMENT \"last formula edit id\",\n PRIMARY KEY (`id`),\n FOREIGN KEY (`last_edit`)\n REFERENCES `$this->FORMULAS_EDITS`(`id`)\n ON UPDATE CASCADE\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->FORMULAS_BOUGHT, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->FORMULAS_BOUGHT` (\n `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT \"transaction id\",\n `expense_id` bigint(11) NOT NULL COMMENT \"expense id\",\n `formula_id` bigint(11) NOT NULL COMMENT \"formula id\",\n `edit_id` bigint(20) NULL DEFAULT NULL COMMENT \"formula edit id at the transaction date\",\n `user_id` bigint(20) NOT NULL COMMENT \"user id\",\n `quantity` int(11) NOT NULL DEFAULT \"1\" COMMENT \"quantity\",\n `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT \"transaction date\",\n PRIMARY KEY (`id`),\n FOREIGN KEY (`expense_id`)\n REFERENCES `$this->EXPENSES`(`id`)\n ON UPDATE CASCADE\n ON DELETE CASCADE,\n FOREIGN KEY (`edit_id`)\n REFERENCES `$this->FORMULAS_EDITS`(`id`)\n ON UPDATE CASCADE,\n FOREIGN KEY (`user_id`)\n REFERENCES `$this->CLIENTS`(`id`)\n ON UPDATE CASCADE\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->FORMULAS_BOUGHT_PRODUCTS, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->FORMULAS_BOUGHT_PRODUCTS` (\n `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT \"id\",\n `transaction_id` bigint(11) NOT NULL COMMENT \"id in formulas bought\",\n `product_id` bigint(11) NOT NULL COMMENT \"product id\",\n `product_edit` BIGINT(20) NULL COMMENT \"the product edit\",\n `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT \"transaction date\",\n PRIMARY KEY (`id`),\n FOREIGN KEY (`transaction_id`)\n REFERENCES `$this->FORMULAS_BOUGHT`(`id`)\n ON UPDATE CASCADE\n ON DELETE CASCADE,\n FOREIGN KEY (`product_edit`)\n REFERENCES `$this->PRODUCTS_EDITS`(`id`)\n ON UPDATE CASCADE\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->FORMULAS_CHOICES, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->FORMULAS_CHOICES` (\n `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT \"formula choice id\",\n `formula` bigint(11) NOT NULL COMMENT \"formula id\",\n `name` varchar(255) NOT NULL COMMENT \"choice name\",\n `edit` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT \"edit time\",\n PRIMARY KEY (`id`),\n FOREIGN KEY (`formula`)\n REFERENCES `$this->FORMULAS`(`id`)\n ON DELETE CASCADE\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n if (! in_array($this->FORMULAS_CHOICES_PRODUCTS, $tables)) {\n self::query(\n <<<EOSQL\n CREATE TABLE IF NOT EXISTS `$this->FORMULAS_CHOICES_PRODUCTS` (\n `id` bigint(11) NOT NULL AUTO_INCREMENT COMMENT \"id\",\n `choice` bigint(11) NOT NULL COMMENT \"formula choice id\",\n `product` bigint(11) NOT NULL COMMENT \"product id\",\n `edit` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT \"edit time\",\n PRIMARY KEY (`id`),\n FOREIGN KEY (`choice`)\n REFERENCES `$this->FORMULAS_CHOICES`(`id`)\n ON DELETE CASCADE,\n FOREIGN KEY (`product`)\n REFERENCES `$this->PRODUCTS`(`id`)\n ON DELETE CASCADE\n ) ENGINE=InnoDB DEFAULT CHARSET=`$this->CHARSET` COLLATE `$this->COLLATE`;\nEOSQL\n );\n }\n \n self::query('SET foreign_key_checks=1;');\n }", "protected function tableExists($table)\n {\n try {\n $query = $this->app['db']->query(\"SHOW TABLES LIKE '$table'\");\n return (false !== ($row = $query->fetch())) ? true : false;\n } catch (\\Doctrine\\DBAL\\DBALException $e) {\n throw new \\Exception($e);\n }\n }", "function tableExists($connection) {\n\t$t = mysqli_real_escape_string($connection, TABLE_NAME);\n\t$d = mysqli_real_escape_string($connection, DB_DATABASE);\n\n\t$checktable = mysqli_query($connection, \n\t\t\"SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_NAME = '$t' AND TABLE_SCHEMA = '$d'\");\n\n\tif(mysqli_num_rows($checktable) > 0) return true;\n\n\treturn false;\n}", "public function hasTable($name)\n {\n return $this->connection->getSchemaManager()->tablesExist([$name]);\n }", "public function entityTableExists($fullyQualifiedClassName)\n {\n $em = $this->getEntityManager($fullyQualifiedClassName);\n $connection = $em->getConnection();\n // Get a schema manager for the connection that specifies a database name.\n $schemaManager = $connection->getSchemaManager();\n // Obtain the table name from the entity's class metadata.\n $cmf = new DisconnectedClassMetadataFactory();\n $cmf->setEntityManager($em);\n $classMetadata = $cmf->getMetadataFor($fullyQualifiedClassName);\n $table = $classMetadata->getTableName();\n // Check if this database already contains the table for the doctrine entity.\n $tables = array($table);\n if ($schemaManager->tablesExist($tables)) {\n // The table exists.\n return true;\n }\n else {\n // The table does not exist.\n return false;\n }\n }", "public function tableExists($table)\n {\n return $this->db_instance->table_exists($table);\n }" ]
[ "0.6184819", "0.5958592", "0.57073075", "0.5621764", "0.56166565", "0.5565932", "0.5527164", "0.5516012", "0.550134", "0.5497208", "0.54883057", "0.54792434", "0.54645735", "0.5412064", "0.5406321", "0.53952837", "0.53915215", "0.5386843", "0.5364325", "0.53615254", "0.5347966", "0.5330332", "0.53180677", "0.5301879", "0.5301879", "0.5300965", "0.529384", "0.5262552", "0.5248637", "0.5242165", "0.5182098", "0.51804143", "0.5176867", "0.51754105", "0.5175098", "0.5147698", "0.51422215", "0.51311", "0.511522", "0.50956327", "0.50951505", "0.5091139", "0.5090714", "0.5074717", "0.50588334", "0.50442725", "0.5027301", "0.50256985", "0.5013046", "0.501216", "0.5010361", "0.50032634", "0.5000151", "0.49903378", "0.49903378", "0.49903378", "0.49903378", "0.49903378", "0.49903378", "0.49876732", "0.4986601", "0.49809906", "0.49809906", "0.49767494", "0.49761885", "0.49744943", "0.496906", "0.49635467", "0.4949007", "0.49469084", "0.49444178", "0.4930029", "0.49205163", "0.49201542", "0.49177748", "0.49128896", "0.49001482", "0.48996338", "0.48896158", "0.4889391", "0.48850605", "0.48771986", "0.4872808", "0.48719162", "0.4850006", "0.48424724", "0.4823298", "0.4819005", "0.4818074", "0.4816154", "0.48108438", "0.48087066", "0.4800536", "0.4798625", "0.47967017", "0.47864583", "0.47851044", "0.47818574", "0.47647336", "0.47598034" ]
0.67578113
0
returns the elapsed time since the given time
public static function timeElapsedInSeconds($time){ $date_time = date_create($time); return time() - $date_time->format('U'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getElapsedTime();", "public function elapsedtime() {\n return fmod(floatval($this->servertime()),$this->waitingtime());\n\t}", "public static function get_elapsed_time()\n {\n return microtime( true ) - $_SESSION['time']['script_start_time'];\n }", "function elapsed($event) {\n $endTime = Timer::getMicroTime();\n if (Timer::isStopped($event)) {\n $endTime = Timer::getEndTime($event);\n }\n return round($endTime - Timer::getStartTime($event), 4);\n }", "protected function getElapsedTimeInMs()\n {\n return (microtime(true) - $this->start) * 1000;\n }", "public function getElapsed() {\n if ($this->hasStarted() && $this->hasStopped()) {\n return number_format($this->stoppedAt - $this->startedAt, 7);\n }\n throw new StopwatchException('Cannot get elapsed time, insufficient data');\n }", "public function getElapsedTime() {\n\t\treturn self::$elapsedTime;\n\t}", "function getElapsedSeconds() {\n\t\treturn $this->time;\n\t}", "function elapsed_time($start_time, $finish_time){\n\treturn sc_strtotime($finish_time) - sc_strtotime($start_time);\n}", "public function getTimePassed(): float\n {\n if ($this->started) {\n return microtime(true) - $this->start_time;\n } else {\n return $this->stop_time - $this->start_time;\n }\n }", "public function time()\n\t{\n\t\treturn $this->endTimer-$this->startTimer;\n\t}", "public function get_time_since_ended() {\r\n\t\tif ( 0 !== $this->get_seconds_left() ) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\r\n\t\treturn current_time( 'timestamp' ) - $this->get_end_time();\r\n\t}", "public function getElapsed()\n {\n $elapsedTime = array_sum($this->_totalTime);\n\n // No elapsed time or currently running? take/add current running time\n if ($this->_start !== null) {\n $elapsedTime += microtime(true) - $this->_start;\n }\n\n return $elapsedTime;\n }", "function elapsedSeconds() {\n if (null === $this->startMicrotime) {\n throw new InvalidArgumentException(\"Start time was not marked\");\n }\n if (null === $this->endMicrotime) {\n // Not stopped so return time from start to now\n return microtime(true) - $this->startMicrotime;\n }\n // Stopped so show total elapsed time between start and stop\n return $this->endMicrotime - $this->startMicrotime;\n }", "public function getTimeElapsed()\n {\n $start_time = $this->getStartTime();\n\n if (isset($start_time)) {\n $end_time = $this->getEndTime();\n\n if (!isset($end_time)) {\n $end_time = microtime(true);\n }\n\n return $end_time - $this->getStartTime();\n }\n\n return false;\n }", "protected function getFinalTime() {\n $currentTime = $this->getTime();\n \n $result = $currentTime - $this->startTime;\n \n return $result;\n }", "protected function getFinalTime()\n {\n $currentTime = $this->getTime();\n $result = $currentTime - $this->startTime;\n\n return $result;\n }", "public function getTimeTaken(){\r\n return round($this->getEndTime() - $this->getStartTime(), 6);\r\n }", "public static function timeSinceStart(): float\n {\n return \\microtime(true) - self::getRequestTime();\n }", "function subtract($time1, $time2)\n{\n\t$total=$time1-$time2;\n\treturn $total;\n}", "public function time() {\n return $this->info['total_time'];\n }", "static function timeElapsed($timestamp)\n {\n $d1 = new DateTime($timestamp);\n $d2 = new DateTime();\n $interval = $d1->diff($d2);\n $totalDiff = abs(time() - strtotime($timestamp)); // diff in seconds\n if ($totalDiff < 60) return \"seconds ago\";\n if ($totalDiff >= 60 && $totalDiff < 3600) return $interval->i . \" minutes ago\";\n if ($totalDiff >= 3600 && $totalDiff < 86400) return $interval->h . \" hours ago\";\n if ($totalDiff >= 86400) return $interval->d . \" days ago\";\n }", "public static function agoFromTime($time, $t){\n\t\treturn date('Y-m-d H:i:s', $time-$t);\n\t}", "protected static function _timeToStopwatch()\n {\n return self::$_startupTime - $_SERVER['REQUEST_TIME_FLOAT'];\n }", "public function getTime()\n {\n $time = 0;\n foreach ($this->data['calls'] as $call) {\n $time += $call['time'];\n }\n\n return $time;\n }", "public function getTime()\n {\n return (float)sprintf(\"%.1f\", 1000*(microtime(true) - $this->startTime));\n }", "public function get_exec_time()\n\t\t{\n\t\t\treturn $this->stop_time - $this->start_time;\n\t\t}", "public function getRelativeTime() : float\n {\n return ($this->timeStamp - static::$startTime);\n \n }", "public function getTotalTime()\n {\n return $this->info->total_time * 1000;\n }", "function getTimeDuration();", "public static function timeElapsedInDays($time){\n $date_time = date_create($time);\n $diff = time() - $date_time->format('U');\n return floor($diff/ (60*60*24));\n }", "public function getTimeElapsed(): string\n {\n $now = new DateTime('now');\n $ago = new DateTime($this->datetime);\n $diff = $ago->diff($now);\n if (!empty($diff->y)) {\n $age = $diff->y . 'year';\n $age = $age . ($diff->y > 1 ? 's' : '');\n } elseif ($diff->m > 0) {\n $age = $diff->m . 'month';\n $age = $age . ($diff->m > 1 ? 's' : '');\n } elseif ($diff->d > 0) {\n $age = $diff->d . 'day';\n $age = $age . ($diff->d > 1 ? 's' : '');\n } elseif ($diff->h > 0) {\n $age = $diff->h . 'hour';\n $age = $age . ($diff->h > 1 ? 's' : '');\n } elseif ($diff->i > 0) {\n $age = $diff->i . 'minute';\n $age = $age . ($diff->i > 1 ? 's' : '');\n } else {\n $age = $diff->s . 'second';\n $age = $age . ($diff->s > 1 ? 's' : '');\n }\n $ageWithPostfix = $age . ' ago';\n return $ageWithPostfix;\n }", "public static function difference($time1, $time2) {\n\t\treturn self::toUnix($time1) - self::toUnix($time2);\n\t}", "function etime($time_start){\n $time_end = microtime(true);\n $execution_time = ($time_end - $time_start);\n\n return number_format((float) $execution_time, 1);\n}", "public function getTotalTime()\n {\n return 0; //@todo\n }", "public static function getElapsedTime( $label = 'default' )\n\t{\n\t\treturn microtime( true ) - self::$timer[$label]['start'];\n\t}", "function getTime(){\n\t\t$mtime = microtime();//print(\"\\n time : \" . $mtime);\n\t\t$mtime = explode(' ', $mtime);\n\t\t$mtime = $mtime[1] + $mtime[0];\n\t\treturn $mtime;\n\t}", "public function getTime() : int\n {\n $eventTime = $this->getTimeStamp();\n $eventStartTime = static::getStartTime();\n \n return number_format((($eventTime - $eventStartTime) * 1000), 0, '', '');\n \n }", "public function getRunningTime()\n\t{\n\t\treturn $this->microtime_float() - $this->start_time;\n\t}", "private static function time()\n {\n list($usec, $sec) = explode(\" \", microtime());\n return ((float)$usec + (float)$sec);\n }", "public function getCurrentTimeDifference($time_record, $unit = 'm');", "public function getCurrentTimeDifference($time_record, $unit = 'm');", "public function get_total_time() {\n\t\t\treturn $this->total_time;\n\t\t}", "protected function getElapsedTime($start)\n {\n return round((microtime(true) - $start) * 1000, 2);\n }", "function timeSince ( $timestamp ) {\r\n\r\n\t$diff = time() - $timestamp;\r\n\r\n\tif ( $diff < 4000 ) {\r\n\t\t$diff = ceil ( $diff / 60 );\r\n\t\t$unit = \"minute\";\r\n\r\n\t} elseif ( $diff < 100000 ) {\r\n\t\t$diff = ceil ( $diff / 3600 );\r\n\t\t$unit = \"hour\";\r\n\r\n\t} else {\r\n\t\t$diff = ceil ( $diff / 86400 );\r\n\t\t$unit = \"day\";\r\n\t}\r\n\r\n\t$end = ( $diff <= 1 ) ? NULL : \"s\";\r\n\r\n\treturn \"$diff $unit$end ago\";\r\n\r\n}", "function subtract( $time )\r\n {\r\n $ret = false;\r\n if ( is_a( $time, \"eZTime\" ) )\r\n {\r\n $tmpTime = new eZTime( $this->hour(), $this->minute(), $this->second() );\r\n\r\n $secondsElapsed = ( ( 86400 + $this->SecondsElapsed ) - $time->secondsElapsed() ) % 86400;\r\n $tmpTime->setSecondsElapsed( $secondsElapsed );\r\n\r\n $ret = $tmpTime;\r\n }\r\n\r\n return $ret;\r\n }", "public function getTimeDiff()\n {\n $start = ServiceUtil::getManager()->getArgument('debug.toolbar.panel.rendertime.start');\n $end = microtime(true);\n\n $diff = $end - $start;\n return $diff;\n }", "protected function getElapsedTime($start)\n {\n return round ( (microtime ( true ) - $start) * 1000, 2 );\n }", "protected static function _timeToCake()\n {\n return TIME_START - $_SERVER['REQUEST_TIME_FLOAT'];\n }", "public function passedTicks() {\r\n\t\t$seconds = 300;\r\n\r\n\t\t$lastUpdate = (int)($this->lastUpdate() / $seconds);\r\n\t\t$now = (int)(TIME / $seconds);\r\n\r\n\t\treturn ($now - $lastUpdate);\r\n\t}", "protected function time()\n {\n $time = microtime();\n $time = explode(' ', $time);\n $time = $time[1] + $time[0];\n return $time;\n }", "public function currentTime();", "protected static function TimeDifference()\n\t{\n\t\t$ts=0;\n\t\t$ts -= date ( \"Z\" ) * 1;\n\t\t$daylight = date ( \"I\" );\n\t\t$daylight *= 1;\n\t\t$daylight *= 3600;\n\t\t$ts += $daylight; //12600 seconds 3:30+ GMT Tehran\n\t\t$ts += self::$GMTdelta;\n\t\treturn $ts;\n\t\t\n\t}", "public static function elapsed($timerName = 'default') {\n return microtime(true) - self::$startTimes[$timerName];\n }", "public function getTime()\n {\n $time = 0;\n foreach ($this->data['commands'] as $command) {\n $time += $command['executionMS'];\n }\n\n return $time;\n }", "public static function getTimer()\n {\n return microtime(true) - $_SERVER[\"REQUEST_TIME_FLOAT\"];\n }", "public function getElapsedTimeInSeconds()\n {\n if(!$this->_timeStartInMicroSeconds)\n {\n return 0;\n }\n\n $microSecsStart = $this->_timeStartInMicroSeconds;\n $microSecsStop = $this->_timeStopInMicroSeconds;\n\n if($microSecsStop == 0)\n {\n // The function stopTimer was not called.\n $microSecsStop = microtime(true);\n }\n\n $seconds = $microSecsStop - $microSecsStart;\n\n return round($seconds, 4);\n }", "public function timeDiff($time1, $time2)\n {\n return $this->fixhour($time2- $time1);\n }", "public function getTimeRemaining(): int\n {\n return $this->runtimeDeadlineMs - $this->nowInMilliseconds();\n }", "public static function elapsed($timerName = 'default') {\n return microtime(true) - self::$startTimes[$timerName];\n }", "public function getTotalTime(){\n return $this->totalTime;\n }", "public static function totalDuration()\n {\n return microtime(true) - static::initialTime();\n }", "public function getRemainingTime()\n {\n return $this->isExpired() ? 0\n : ($this->getExpirationDate()->getTimestamp() - time());\n }", "function time_elapsed_string($ptime)\n{\n if (empty($ptime)) {\n return \"No Time\";\n }\n $etime = time() - $ptime;\n\n if ($etime < 1) {\n return '0 seconds';\n }\n\n $a = array(365 * 24 * 60 * 60 => 'year',\n 30 * 24 * 60 * 60 => 'month',\n 24 * 60 * 60 => 'day',\n 60 * 60 => 'hour',\n 60 => 'min',\n 1 => 'sec'\n );\n $a_plural = array('year' => 'years',\n 'month' => 'months',\n 'day' => 'days',\n 'hour' => 'hours',\n 'min' => 'min',\n 'sec' => 'secs'\n );\n\n foreach ($a as $secs => $str) {\n $d = $etime / $secs;\n if ($d >= 1) {\n $r = round($d);\n return $r . ' ' . ($r > 1 ? $a_plural[$str] : $str) . '';\n }\n }\n}", "public function getTimeRemaining()\n {\n return $this->time_remaining;\n }", "public function get_seconds_left() {\r\n\t\tif ( $this->is_endless() ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$time_left = $this->get_end_time() - current_time( 'timestamp' );\r\n\t\treturn $time_left < 0 ? 0 : $time_left;\t\r\n\t}", "public function getElapsedMilliseconds() : int\n {\n return $this->elapsedMilliseconds;\n }", "public function getRawTime(): float\n {\n return $this->endTime - $this->startTime;\n }", "static function ts(){\r\n $dt = microtime(true) - self::$starttime;\r\n return self::mtformat($dt);\r\n }", "function timer_stop(){\n\t\t$mtime = explode(' ', microtime());\n\t\t$time_end = $mtime[1] + $mtime[0];\n\t\t$time_total = $time_end - $this->time_start;\n\t\treturn $time_total;\n\t}", "public function test_elapsed_time() {\n\t\t$this->assertInternalType( 'string', locomotive_time_ago( 1472852621 ) );\n\t}", "function secondsElapsed()\r\n {\r\n return $this->SecondsElapsed;\r\n }", "public static function timer_stop() {\n $mtime = microtime();\n $mtime = explode(' ', $mtime);\n $time_end = $mtime[1] + $mtime[0];\n $time_total = $time_end - self::$time_start;\n return $time_total;\n }", "public function getTime(): float\n {\n return $this->time;\n }", "protected static function _timeFromCakeToStopwatch(): float\n {\n return self::$_startupTime - TIME_START;\n }", "public static function ms(): int\n {\n return round((static::elapsed() * 1000), 0);\n }", "public function getElapsedTimeInMillisecs()\n {\n $seconds = $this->getElapsedTimeInSeconds();\n $milliSeconds = $seconds * self::MILLISEC_PER_SECOND;\n\n return round($milliSeconds, 1);\n }", "public function execTime()\n {\n $packet = $this->getPacket();\n\n if(empty($packet['started'])) return 0;\n\n if (!isset($packet['finished']) || $packet['finished'] === 0) {\n throw new \\Exception('The job has not yet ran');\n }\n\n return $packet['finished'] - $packet['started'];\n }", "protected function calculateTime()\n {\n return $this->start->diffInHours($this->end) +\n round(\n ($this->start->diffInMinutes($this->end) - ($this->start->diffInHours($this->end) * 60)) / 60,\n 1\n );\n }", "function secondsAfterNow($time, $timezone) {\n if (empty($time)) {\n\t return null;\n }\n\n // save old timezone\n\t$oldtimezone = date_default_timezone_get();\n\tdate_default_timezone_set($timezone);\n\t$result = strtotime($time) - time();\n\n\t// reset to old timezone\n\tdate_default_timezone_set($oldtimezone);\n\n\treturn $result;\n }", "function getTime() {\n list($usec, $sec) = explode(\" \", microtime());\n return ((float)$usec + (float)$sec);\n}", "function eQTimeElapsed() {\n\t\tif ($GLOBALS['qTimeTotal']) {\n\t\t\treturn number_format($GLOBALS['qTimeTotal']*1000000.0,1);\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\t}", "function ago($time) {\n $timediff=time()-$time;\n $days=intval($timediff/86400);\n $remain=$timediff%86400;\n $hours=intval($remain/3600);\n $remain=$remain%3600;\n $mins=intval($remain/60);\n $secs=$remain%60;\n\n if ($secs>=0) $timestring = $secs.\"s\";//\"0m\".\n if ($mins>0) $timestring = $mins.\"m\";//.$secs.\"s\";\n if ($hours>0) $timestring = $hours.\"h\";//.$mins.\"m\";\n if ($days>0) $timestring = $days.\"d\";//.$hours.\"h\";\n\n return $timestring;\n}", "public static function getTimeToRun();", "public function testElapsed() {\n // Stop the timer\n $this->timer->stop();\n\n // Get the elapsed time\n $elapsed_time = $this->timer->get_elapsed();\n\n // It should be less than a second\n $this->assertTrue( $elapsed_time > 0 && $elapsed_time < 1 );\n }", "public function getUserIdleSeconds()\n {\n try\n {\n $luats = $this->getInstanceUserActionTimestamp();\n $now = time();\n $diff = $now - $luats;\n return $diff;\n } catch (\\Exception $ex) {\n throw $ex;\n }\n }", "function time_ago($time, $units = 1) {\n //add mysql-server time difference to time;\n $time_diff = 0;\n $time = strtotime(\"+$time_diff hours\", strtotime($time));\n $now = time(); //current time\n return strtolower(timespan($time, $now, $units)). ' ago';\n}", "function time_ago($time, $units = 1) {\n //add mysql-server time difference to time;\n $time_diff = 0;\n $time = strtotime(\"+$time_diff hours\", strtotime($time));\n $now = time(); //current time\n return strtolower(timespan($time, $now, $units)). ' ago';\n}", "static public function get_time() {\n // By Zach Buller ([email protected])\n $time1 = \\microtime();\n \\settype($time1, 'string'); //convert to string to keep trailing zeroes\n $time2 = explode(\" \", $time1);\n $sub_secs = \\preg_replace('/0./', '', $time2[0], 1);\n $time3 = ($time2[1].$sub_secs)/100;\n return $time3;\n }", "protected function getStepTime()\n {\n $currentTime = $this->getTime();\n $result = $currentTime - $this->latsStepTime;\n $this->latsStepTime = $currentTime;\n\n return $result;\n }", "function getQueryTime($time_start,$time_end) {\n\t\treturn round($time_end - $time_start,4).'sec';\n\t}", "public function getTotalTime()\n {\n if (isset($this->results)) {\n return $this->results->getTotalTime();\n }\n }", "function timeElapsed($sec){\n\n if( $sec <= 1 ) 'Agora mesmo';\n\n $date = [ 'ano' => 31536000,\n 'mes' => 2592000,\n 'dia' => 86400,\n 'hora' => 3600,\n 'minuto' => 60,\n 'segundo' => 1];\n \n foreach( $date as $name => $time ){\n $qtde = $sec / $time;\n if( $qtde >= 1 ) return 'há ' . floor( $qtde ) . ' ' . $name . ($qtde > 2 ? 's' : '');\n }\n\n }", "private function _upTime() \n {\n return microtime(true) - $this->_startTime;\n }", "public function getExecutionTime()/*# : float */;", "function get_time_ago( $time )\n{\n $time_difference = time() - $time;\n \n if( $time_difference < 1 ) { return 'less than 1 second ago'; }\n $condition = array( 12 * 30 * 24 * 60 * 60 => 'year',\n 30 * 24 * 60 * 60 => 'month',\n 24 * 60 * 60 => 'day',\n 60 * 60 => 'hour',\n 60 => 'minute',\n 1 => 'second'\n );\n \n foreach( $condition as $secs => $str )\n {\n $d = $time_difference / $secs;\n \n if( $d >= 1 )\n {\n $t = round( $d );\n return $t . ' ' . $str . ( $t > 1 ? 's' : '' ) . ' ago';\n }\n }\n}", "function _get_time()\n{\n $_mtime = microtime();\n $_mtime = explode(\" \", $_mtime);\n\n return (double) ($_mtime[1]) + (double) ($_mtime[0]);\n}", "public function getTime(): int {\n\t\treturn $this->time;\n\t}", "protected function getExecTime()\n {\n return \\microtime(true) - $this->beginTime;\n }", "public function getTotalTime() {\n return (float) $this->profile->userTotals->totalDuration;\n }" ]
[ "0.77578217", "0.7519196", "0.71578276", "0.71339744", "0.70760936", "0.70117855", "0.70093393", "0.69473183", "0.69304156", "0.6874192", "0.68551975", "0.67813647", "0.6752962", "0.67230433", "0.6705795", "0.6676008", "0.6662416", "0.65207845", "0.646922", "0.6466804", "0.6462598", "0.6443547", "0.6396423", "0.63793325", "0.6373577", "0.63649035", "0.63134915", "0.6313484", "0.6287457", "0.62830234", "0.6263058", "0.6256472", "0.625501", "0.62511927", "0.6225583", "0.6220322", "0.62202764", "0.6214667", "0.6209712", "0.6198088", "0.61776584", "0.61776584", "0.6175104", "0.616115", "0.61502403", "0.61420727", "0.61306643", "0.61306244", "0.61195886", "0.6119285", "0.6116223", "0.6115272", "0.6112521", "0.6101896", "0.6078943", "0.60718876", "0.60446894", "0.6042201", "0.6037708", "0.6036153", "0.6029717", "0.60084385", "0.6004678", "0.60002136", "0.59956735", "0.59948933", "0.5986185", "0.59786826", "0.59719044", "0.59712535", "0.59703046", "0.59508115", "0.59401", "0.59296066", "0.59263015", "0.5923409", "0.5920005", "0.5904106", "0.5903028", "0.590055", "0.5876839", "0.5862796", "0.5853591", "0.5853517", "0.5851712", "0.5844337", "0.584217", "0.584217", "0.5839661", "0.5836848", "0.5829738", "0.5818687", "0.5817039", "0.581604", "0.5815375", "0.58059883", "0.58025175", "0.5797804", "0.5794718", "0.5792609" ]
0.6926548
9
returns the elapsed time since the given time
public static function timeElapsedInDays($time){ $date_time = date_create($time); $diff = time() - $date_time->format('U'); return floor($diff/ (60*60*24)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getElapsedTime();", "public function elapsedtime() {\n return fmod(floatval($this->servertime()),$this->waitingtime());\n\t}", "public static function get_elapsed_time()\n {\n return microtime( true ) - $_SESSION['time']['script_start_time'];\n }", "function elapsed($event) {\n $endTime = Timer::getMicroTime();\n if (Timer::isStopped($event)) {\n $endTime = Timer::getEndTime($event);\n }\n return round($endTime - Timer::getStartTime($event), 4);\n }", "protected function getElapsedTimeInMs()\n {\n return (microtime(true) - $this->start) * 1000;\n }", "public function getElapsed() {\n if ($this->hasStarted() && $this->hasStopped()) {\n return number_format($this->stoppedAt - $this->startedAt, 7);\n }\n throw new StopwatchException('Cannot get elapsed time, insufficient data');\n }", "public function getElapsedTime() {\n\t\treturn self::$elapsedTime;\n\t}", "function getElapsedSeconds() {\n\t\treturn $this->time;\n\t}", "function elapsed_time($start_time, $finish_time){\n\treturn sc_strtotime($finish_time) - sc_strtotime($start_time);\n}", "public static function timeElapsedInSeconds($time){\n $date_time = date_create($time);\n return time() - $date_time->format('U');\n }", "public function getTimePassed(): float\n {\n if ($this->started) {\n return microtime(true) - $this->start_time;\n } else {\n return $this->stop_time - $this->start_time;\n }\n }", "public function time()\n\t{\n\t\treturn $this->endTimer-$this->startTimer;\n\t}", "public function get_time_since_ended() {\r\n\t\tif ( 0 !== $this->get_seconds_left() ) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\r\n\t\treturn current_time( 'timestamp' ) - $this->get_end_time();\r\n\t}", "public function getElapsed()\n {\n $elapsedTime = array_sum($this->_totalTime);\n\n // No elapsed time or currently running? take/add current running time\n if ($this->_start !== null) {\n $elapsedTime += microtime(true) - $this->_start;\n }\n\n return $elapsedTime;\n }", "function elapsedSeconds() {\n if (null === $this->startMicrotime) {\n throw new InvalidArgumentException(\"Start time was not marked\");\n }\n if (null === $this->endMicrotime) {\n // Not stopped so return time from start to now\n return microtime(true) - $this->startMicrotime;\n }\n // Stopped so show total elapsed time between start and stop\n return $this->endMicrotime - $this->startMicrotime;\n }", "public function getTimeElapsed()\n {\n $start_time = $this->getStartTime();\n\n if (isset($start_time)) {\n $end_time = $this->getEndTime();\n\n if (!isset($end_time)) {\n $end_time = microtime(true);\n }\n\n return $end_time - $this->getStartTime();\n }\n\n return false;\n }", "protected function getFinalTime() {\n $currentTime = $this->getTime();\n \n $result = $currentTime - $this->startTime;\n \n return $result;\n }", "protected function getFinalTime()\n {\n $currentTime = $this->getTime();\n $result = $currentTime - $this->startTime;\n\n return $result;\n }", "public function getTimeTaken(){\r\n return round($this->getEndTime() - $this->getStartTime(), 6);\r\n }", "public static function timeSinceStart(): float\n {\n return \\microtime(true) - self::getRequestTime();\n }", "function subtract($time1, $time2)\n{\n\t$total=$time1-$time2;\n\treturn $total;\n}", "public function time() {\n return $this->info['total_time'];\n }", "static function timeElapsed($timestamp)\n {\n $d1 = new DateTime($timestamp);\n $d2 = new DateTime();\n $interval = $d1->diff($d2);\n $totalDiff = abs(time() - strtotime($timestamp)); // diff in seconds\n if ($totalDiff < 60) return \"seconds ago\";\n if ($totalDiff >= 60 && $totalDiff < 3600) return $interval->i . \" minutes ago\";\n if ($totalDiff >= 3600 && $totalDiff < 86400) return $interval->h . \" hours ago\";\n if ($totalDiff >= 86400) return $interval->d . \" days ago\";\n }", "public static function agoFromTime($time, $t){\n\t\treturn date('Y-m-d H:i:s', $time-$t);\n\t}", "protected static function _timeToStopwatch()\n {\n return self::$_startupTime - $_SERVER['REQUEST_TIME_FLOAT'];\n }", "public function getTime()\n {\n $time = 0;\n foreach ($this->data['calls'] as $call) {\n $time += $call['time'];\n }\n\n return $time;\n }", "public function getTime()\n {\n return (float)sprintf(\"%.1f\", 1000*(microtime(true) - $this->startTime));\n }", "public function getRelativeTime() : float\n {\n return ($this->timeStamp - static::$startTime);\n \n }", "public function get_exec_time()\n\t\t{\n\t\t\treturn $this->stop_time - $this->start_time;\n\t\t}", "public function getTotalTime()\n {\n return $this->info->total_time * 1000;\n }", "function getTimeDuration();", "public function getTimeElapsed(): string\n {\n $now = new DateTime('now');\n $ago = new DateTime($this->datetime);\n $diff = $ago->diff($now);\n if (!empty($diff->y)) {\n $age = $diff->y . 'year';\n $age = $age . ($diff->y > 1 ? 's' : '');\n } elseif ($diff->m > 0) {\n $age = $diff->m . 'month';\n $age = $age . ($diff->m > 1 ? 's' : '');\n } elseif ($diff->d > 0) {\n $age = $diff->d . 'day';\n $age = $age . ($diff->d > 1 ? 's' : '');\n } elseif ($diff->h > 0) {\n $age = $diff->h . 'hour';\n $age = $age . ($diff->h > 1 ? 's' : '');\n } elseif ($diff->i > 0) {\n $age = $diff->i . 'minute';\n $age = $age . ($diff->i > 1 ? 's' : '');\n } else {\n $age = $diff->s . 'second';\n $age = $age . ($diff->s > 1 ? 's' : '');\n }\n $ageWithPostfix = $age . ' ago';\n return $ageWithPostfix;\n }", "public static function difference($time1, $time2) {\n\t\treturn self::toUnix($time1) - self::toUnix($time2);\n\t}", "function etime($time_start){\n $time_end = microtime(true);\n $execution_time = ($time_end - $time_start);\n\n return number_format((float) $execution_time, 1);\n}", "public function getTotalTime()\n {\n return 0; //@todo\n }", "function getTime(){\n\t\t$mtime = microtime();//print(\"\\n time : \" . $mtime);\n\t\t$mtime = explode(' ', $mtime);\n\t\t$mtime = $mtime[1] + $mtime[0];\n\t\treturn $mtime;\n\t}", "public static function getElapsedTime( $label = 'default' )\n\t{\n\t\treturn microtime( true ) - self::$timer[$label]['start'];\n\t}", "public function getTime() : int\n {\n $eventTime = $this->getTimeStamp();\n $eventStartTime = static::getStartTime();\n \n return number_format((($eventTime - $eventStartTime) * 1000), 0, '', '');\n \n }", "public function getRunningTime()\n\t{\n\t\treturn $this->microtime_float() - $this->start_time;\n\t}", "private static function time()\n {\n list($usec, $sec) = explode(\" \", microtime());\n return ((float)$usec + (float)$sec);\n }", "public function getCurrentTimeDifference($time_record, $unit = 'm');", "public function getCurrentTimeDifference($time_record, $unit = 'm');", "public function get_total_time() {\n\t\t\treturn $this->total_time;\n\t\t}", "protected function getElapsedTime($start)\n {\n return round((microtime(true) - $start) * 1000, 2);\n }", "function timeSince ( $timestamp ) {\r\n\r\n\t$diff = time() - $timestamp;\r\n\r\n\tif ( $diff < 4000 ) {\r\n\t\t$diff = ceil ( $diff / 60 );\r\n\t\t$unit = \"minute\";\r\n\r\n\t} elseif ( $diff < 100000 ) {\r\n\t\t$diff = ceil ( $diff / 3600 );\r\n\t\t$unit = \"hour\";\r\n\r\n\t} else {\r\n\t\t$diff = ceil ( $diff / 86400 );\r\n\t\t$unit = \"day\";\r\n\t}\r\n\r\n\t$end = ( $diff <= 1 ) ? NULL : \"s\";\r\n\r\n\treturn \"$diff $unit$end ago\";\r\n\r\n}", "function subtract( $time )\r\n {\r\n $ret = false;\r\n if ( is_a( $time, \"eZTime\" ) )\r\n {\r\n $tmpTime = new eZTime( $this->hour(), $this->minute(), $this->second() );\r\n\r\n $secondsElapsed = ( ( 86400 + $this->SecondsElapsed ) - $time->secondsElapsed() ) % 86400;\r\n $tmpTime->setSecondsElapsed( $secondsElapsed );\r\n\r\n $ret = $tmpTime;\r\n }\r\n\r\n return $ret;\r\n }", "public function getTimeDiff()\n {\n $start = ServiceUtil::getManager()->getArgument('debug.toolbar.panel.rendertime.start');\n $end = microtime(true);\n\n $diff = $end - $start;\n return $diff;\n }", "protected function getElapsedTime($start)\n {\n return round ( (microtime ( true ) - $start) * 1000, 2 );\n }", "public function passedTicks() {\r\n\t\t$seconds = 300;\r\n\r\n\t\t$lastUpdate = (int)($this->lastUpdate() / $seconds);\r\n\t\t$now = (int)(TIME / $seconds);\r\n\r\n\t\treturn ($now - $lastUpdate);\r\n\t}", "protected static function _timeToCake()\n {\n return TIME_START - $_SERVER['REQUEST_TIME_FLOAT'];\n }", "protected function time()\n {\n $time = microtime();\n $time = explode(' ', $time);\n $time = $time[1] + $time[0];\n return $time;\n }", "public function currentTime();", "protected static function TimeDifference()\n\t{\n\t\t$ts=0;\n\t\t$ts -= date ( \"Z\" ) * 1;\n\t\t$daylight = date ( \"I\" );\n\t\t$daylight *= 1;\n\t\t$daylight *= 3600;\n\t\t$ts += $daylight; //12600 seconds 3:30+ GMT Tehran\n\t\t$ts += self::$GMTdelta;\n\t\treturn $ts;\n\t\t\n\t}", "public static function elapsed($timerName = 'default') {\n return microtime(true) - self::$startTimes[$timerName];\n }", "public function getTime()\n {\n $time = 0;\n foreach ($this->data['commands'] as $command) {\n $time += $command['executionMS'];\n }\n\n return $time;\n }", "public static function getTimer()\n {\n return microtime(true) - $_SERVER[\"REQUEST_TIME_FLOAT\"];\n }", "public function getElapsedTimeInSeconds()\n {\n if(!$this->_timeStartInMicroSeconds)\n {\n return 0;\n }\n\n $microSecsStart = $this->_timeStartInMicroSeconds;\n $microSecsStop = $this->_timeStopInMicroSeconds;\n\n if($microSecsStop == 0)\n {\n // The function stopTimer was not called.\n $microSecsStop = microtime(true);\n }\n\n $seconds = $microSecsStop - $microSecsStart;\n\n return round($seconds, 4);\n }", "public function timeDiff($time1, $time2)\n {\n return $this->fixhour($time2- $time1);\n }", "public function getTimeRemaining(): int\n {\n return $this->runtimeDeadlineMs - $this->nowInMilliseconds();\n }", "public static function elapsed($timerName = 'default') {\n return microtime(true) - self::$startTimes[$timerName];\n }", "public function getTotalTime(){\n return $this->totalTime;\n }", "public static function totalDuration()\n {\n return microtime(true) - static::initialTime();\n }", "public function getRemainingTime()\n {\n return $this->isExpired() ? 0\n : ($this->getExpirationDate()->getTimestamp() - time());\n }", "function time_elapsed_string($ptime)\n{\n if (empty($ptime)) {\n return \"No Time\";\n }\n $etime = time() - $ptime;\n\n if ($etime < 1) {\n return '0 seconds';\n }\n\n $a = array(365 * 24 * 60 * 60 => 'year',\n 30 * 24 * 60 * 60 => 'month',\n 24 * 60 * 60 => 'day',\n 60 * 60 => 'hour',\n 60 => 'min',\n 1 => 'sec'\n );\n $a_plural = array('year' => 'years',\n 'month' => 'months',\n 'day' => 'days',\n 'hour' => 'hours',\n 'min' => 'min',\n 'sec' => 'secs'\n );\n\n foreach ($a as $secs => $str) {\n $d = $etime / $secs;\n if ($d >= 1) {\n $r = round($d);\n return $r . ' ' . ($r > 1 ? $a_plural[$str] : $str) . '';\n }\n }\n}", "public function getTimeRemaining()\n {\n return $this->time_remaining;\n }", "public function get_seconds_left() {\r\n\t\tif ( $this->is_endless() ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$time_left = $this->get_end_time() - current_time( 'timestamp' );\r\n\t\treturn $time_left < 0 ? 0 : $time_left;\t\r\n\t}", "public function getElapsedMilliseconds() : int\n {\n return $this->elapsedMilliseconds;\n }", "public function getRawTime(): float\n {\n return $this->endTime - $this->startTime;\n }", "static function ts(){\r\n $dt = microtime(true) - self::$starttime;\r\n return self::mtformat($dt);\r\n }", "public function test_elapsed_time() {\n\t\t$this->assertInternalType( 'string', locomotive_time_ago( 1472852621 ) );\n\t}", "function timer_stop(){\n\t\t$mtime = explode(' ', microtime());\n\t\t$time_end = $mtime[1] + $mtime[0];\n\t\t$time_total = $time_end - $this->time_start;\n\t\treturn $time_total;\n\t}", "function secondsElapsed()\r\n {\r\n return $this->SecondsElapsed;\r\n }", "public static function timer_stop() {\n $mtime = microtime();\n $mtime = explode(' ', $mtime);\n $time_end = $mtime[1] + $mtime[0];\n $time_total = $time_end - self::$time_start;\n return $time_total;\n }", "public function getTime(): float\n {\n return $this->time;\n }", "protected static function _timeFromCakeToStopwatch(): float\n {\n return self::$_startupTime - TIME_START;\n }", "public static function ms(): int\n {\n return round((static::elapsed() * 1000), 0);\n }", "public function getElapsedTimeInMillisecs()\n {\n $seconds = $this->getElapsedTimeInSeconds();\n $milliSeconds = $seconds * self::MILLISEC_PER_SECOND;\n\n return round($milliSeconds, 1);\n }", "public function execTime()\n {\n $packet = $this->getPacket();\n\n if(empty($packet['started'])) return 0;\n\n if (!isset($packet['finished']) || $packet['finished'] === 0) {\n throw new \\Exception('The job has not yet ran');\n }\n\n return $packet['finished'] - $packet['started'];\n }", "protected function calculateTime()\n {\n return $this->start->diffInHours($this->end) +\n round(\n ($this->start->diffInMinutes($this->end) - ($this->start->diffInHours($this->end) * 60)) / 60,\n 1\n );\n }", "function secondsAfterNow($time, $timezone) {\n if (empty($time)) {\n\t return null;\n }\n\n // save old timezone\n\t$oldtimezone = date_default_timezone_get();\n\tdate_default_timezone_set($timezone);\n\t$result = strtotime($time) - time();\n\n\t// reset to old timezone\n\tdate_default_timezone_set($oldtimezone);\n\n\treturn $result;\n }", "function getTime() {\n list($usec, $sec) = explode(\" \", microtime());\n return ((float)$usec + (float)$sec);\n}", "function eQTimeElapsed() {\n\t\tif ($GLOBALS['qTimeTotal']) {\n\t\t\treturn number_format($GLOBALS['qTimeTotal']*1000000.0,1);\n\t\t} else {\n\t\t\treturn '';\n\t\t}\n\t}", "function ago($time) {\n $timediff=time()-$time;\n $days=intval($timediff/86400);\n $remain=$timediff%86400;\n $hours=intval($remain/3600);\n $remain=$remain%3600;\n $mins=intval($remain/60);\n $secs=$remain%60;\n\n if ($secs>=0) $timestring = $secs.\"s\";//\"0m\".\n if ($mins>0) $timestring = $mins.\"m\";//.$secs.\"s\";\n if ($hours>0) $timestring = $hours.\"h\";//.$mins.\"m\";\n if ($days>0) $timestring = $days.\"d\";//.$hours.\"h\";\n\n return $timestring;\n}", "public static function getTimeToRun();", "public function testElapsed() {\n // Stop the timer\n $this->timer->stop();\n\n // Get the elapsed time\n $elapsed_time = $this->timer->get_elapsed();\n\n // It should be less than a second\n $this->assertTrue( $elapsed_time > 0 && $elapsed_time < 1 );\n }", "public function getUserIdleSeconds()\n {\n try\n {\n $luats = $this->getInstanceUserActionTimestamp();\n $now = time();\n $diff = $now - $luats;\n return $diff;\n } catch (\\Exception $ex) {\n throw $ex;\n }\n }", "function time_ago($time, $units = 1) {\n //add mysql-server time difference to time;\n $time_diff = 0;\n $time = strtotime(\"+$time_diff hours\", strtotime($time));\n $now = time(); //current time\n return strtolower(timespan($time, $now, $units)). ' ago';\n}", "function time_ago($time, $units = 1) {\n //add mysql-server time difference to time;\n $time_diff = 0;\n $time = strtotime(\"+$time_diff hours\", strtotime($time));\n $now = time(); //current time\n return strtolower(timespan($time, $now, $units)). ' ago';\n}", "static public function get_time() {\n // By Zach Buller ([email protected])\n $time1 = \\microtime();\n \\settype($time1, 'string'); //convert to string to keep trailing zeroes\n $time2 = explode(\" \", $time1);\n $sub_secs = \\preg_replace('/0./', '', $time2[0], 1);\n $time3 = ($time2[1].$sub_secs)/100;\n return $time3;\n }", "protected function getStepTime()\n {\n $currentTime = $this->getTime();\n $result = $currentTime - $this->latsStepTime;\n $this->latsStepTime = $currentTime;\n\n return $result;\n }", "function getQueryTime($time_start,$time_end) {\n\t\treturn round($time_end - $time_start,4).'sec';\n\t}", "public function getTotalTime()\n {\n if (isset($this->results)) {\n return $this->results->getTotalTime();\n }\n }", "function timeElapsed($sec){\n\n if( $sec <= 1 ) 'Agora mesmo';\n\n $date = [ 'ano' => 31536000,\n 'mes' => 2592000,\n 'dia' => 86400,\n 'hora' => 3600,\n 'minuto' => 60,\n 'segundo' => 1];\n \n foreach( $date as $name => $time ){\n $qtde = $sec / $time;\n if( $qtde >= 1 ) return 'há ' . floor( $qtde ) . ' ' . $name . ($qtde > 2 ? 's' : '');\n }\n\n }", "private function _upTime() \n {\n return microtime(true) - $this->_startTime;\n }", "public function getExecutionTime()/*# : float */;", "function get_time_ago( $time )\n{\n $time_difference = time() - $time;\n \n if( $time_difference < 1 ) { return 'less than 1 second ago'; }\n $condition = array( 12 * 30 * 24 * 60 * 60 => 'year',\n 30 * 24 * 60 * 60 => 'month',\n 24 * 60 * 60 => 'day',\n 60 * 60 => 'hour',\n 60 => 'minute',\n 1 => 'second'\n );\n \n foreach( $condition as $secs => $str )\n {\n $d = $time_difference / $secs;\n \n if( $d >= 1 )\n {\n $t = round( $d );\n return $t . ' ' . $str . ( $t > 1 ? 's' : '' ) . ' ago';\n }\n }\n}", "function _get_time()\n{\n $_mtime = microtime();\n $_mtime = explode(\" \", $_mtime);\n\n return (double) ($_mtime[1]) + (double) ($_mtime[0]);\n}", "public function getTime(): int {\n\t\treturn $this->time;\n\t}", "protected function getExecTime()\n {\n return \\microtime(true) - $this->beginTime;\n }", "public function getTotalTime() {\n return (float) $this->profile->userTotals->totalDuration;\n }" ]
[ "0.7757037", "0.7518272", "0.7157845", "0.7133439", "0.7075485", "0.7010659", "0.7008785", "0.69474214", "0.69295126", "0.6927698", "0.68746454", "0.68546146", "0.6780142", "0.6752152", "0.672236", "0.67052084", "0.6675649", "0.6662004", "0.6520105", "0.6468729", "0.64654565", "0.6462567", "0.64426357", "0.63960665", "0.6378596", "0.63743", "0.63646793", "0.63136345", "0.63124245", "0.62868255", "0.6281531", "0.6256104", "0.6253941", "0.6251513", "0.6224596", "0.62198937", "0.6218825", "0.6214239", "0.62085605", "0.61974895", "0.61764085", "0.61764085", "0.617451", "0.6160845", "0.6149074", "0.61415875", "0.6130335", "0.6130302", "0.6119687", "0.61192983", "0.6115819", "0.61150414", "0.6110429", "0.61005723", "0.60790926", "0.6071001", "0.60440654", "0.60403115", "0.6036303", "0.6034876", "0.6029095", "0.60075545", "0.60030866", "0.59999555", "0.5994613", "0.5994294", "0.59860444", "0.59785926", "0.5971062", "0.5970622", "0.5969822", "0.5950705", "0.5938795", "0.59300363", "0.5925669", "0.5923664", "0.59198195", "0.5903871", "0.5901415", "0.5900283", "0.5876269", "0.58623", "0.5852932", "0.5852101", "0.58514005", "0.5844208", "0.58410597", "0.58410597", "0.5839296", "0.5837915", "0.582894", "0.58178043", "0.5816265", "0.58152634", "0.5815063", "0.5805585", "0.5802265", "0.57980525", "0.579373", "0.57920414" ]
0.6263303
31
Create a new model instance.
public function __construct(array $attributes = []) { parent::__construct($attributes); if ($connection = config('roles.connection')) { $this->connection = $connection; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function newModel()\n {\n $model = static::$model;\n\n return new $model;\n }", "protected function createModel()\n {\n $this->call('make:model', array_filter([\n 'name' => $this->getNameInput(),\n '--factory' => $this->option('factory'),\n '--migration' => $this->option('migration'),\n ]));\n }", "public function create(Model $model);", "public function create(): Model;", "protected function createModel()\n {\n $class = $this->getModelClass();\n\n $attributes = $this->getModelAttributes();\n\n return new $class($attributes);\n }", "public function createModel()\n\t{\n\t\treturn $this->getModelConfiguration()->createModel();\n\t}", "public function createModel()\n {\n }", "public function create()\n {\n return $this->modelManager->instance($this->model);\n }", "protected function createModel()\n {\n $model = $this->info['model'];\n\n $modelName = basename(str_replace('\\\\', '/', $model));\n\n // make it singular\n $modelName = Str::singular($modelName);\n\n $this->info['modelName'] = $modelName;\n\n $modelOptions = [\n 'model' => $this->info['model'],\n '--module' => $this->moduleName,\n ];\n $options = $this->setOptions([\n 'index',\n 'unique',\n 'data',\n 'uploads',\n 'float',\n 'bool',\n 'int',\n 'data',\n 'parent'\n ]);\n\n $this->call('engez:model', array_merge($modelOptions, $options));\n }", "public function createModel()\n {\n $class = '\\\\' . ltrim($this->model, '\\\\');\n\n return new $class;\n }", "public function createModel()\n {\n $class = '\\\\' . ltrim($this->model, '\\\\');\n\n return new $class;\n }", "public function createModel()\n\t{\n\t\t$class = '\\\\'.ltrim($this->model, '\\\\');\n\t\treturn new $class;\n\t}", "protected function make(): Model\n {\n $model = new $this->model;\n $this->modelPk = $model->getKeyName();\n\n return $model;\n }", "public function create(array $attributes) : Model;", "protected function makeModel()\n {\n return factory(Employee::class)->create();\n }", "protected function newModel(): Model\n {\n return (new $this->model)->fresh();\n }", "public function create(array $attributes): Model\n {\n return $this->model->create($attributes);\n }", "public function create($data) : Model\n {\n return $this->getModel()->create($data);\n }", "protected function createModel()\n {\n $this->call('wizard:model', [\n 'name' => $this->argument('name'),\n ]);\n }", "abstract protected function newModel(): Model;", "protected function makeModel()\n {\n new MakeModel($this, $this->files);\n }", "public function create($data)\n\t{\n\t\t$model = $this->model->create($data);\n\n\t\treturn $model;\n\t}", "public function create(){}", "public function create($data=null) {\n\t\t\treturn $this->_create_model_instance(parent::create($data));\n\t}", "public static function create($params = array())\n {\n $model = new static();\n static::getSchema();\n if (!empty($params)) {\n $model->setProperties($params);\n }\n\n return $model;\n }", "public function createModel() {\n return null;\n }", "public function create(array $attributes = [])\n {\n $class = $this->getModelNamespace();\n /** @var \\Illuminate\\Database\\Eloquent\\Model $model */\n $model = new $class($attributes);\n $res = $model->save();\n if ($res !== true) throw new \\Exception('Error creating model.');\n return $model;\n }", "public function createModel(PayModel $model);", "public function create($modelData);", "protected function getModelInstance()\n {\n return new $this->model();\n }", "public function create() {}", "public static function create(array $attributes = [])\n {\n $model = new static($attributes);\n\n $model->save();\n\n return $model;\n }", "public static function create(array $attributes = [])\n {\n $model = new static($attributes);\n\n $model->save();\n\n return $model;\n }", "private function createModel()\n {\n $class = get_class($this->data);\n\n $this->name = strtolower(class_basename($class));\n\n $result = $this->callEvent($class, [$class => $this->data]);\n\n if ($result instanceof $this->data) {\n $this->data = $result;\n }\n\n $this->makePaginator();\n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "function createModel($name, array $conf);", "protected function getNewModel()\n {\n $modelName = $this->getModelName();\n return new $modelName;\n }", "public function create()\n {}", "public function create(Request $request): Model;", "public function create()\n {\n //TODO\n }", "protected function instantiate()\n\t{\n\t\t$class = get_class($this);\n\t\t$model = new $class(null);\n\t\treturn $model;\n\t}", "public function create() {\n\t\t$model = new $this->model_class;\n\t\t$model->status = 3;\n\t\t$model->author_id = Session::get('wildfire_user_cookie');\n\t\t$model->url = time();\n\t\tif(Request::get(\"title\")) $model->title = Request::get(\"title\");\n\t\telse $model->title = \"Enter Your Title Here\";\n\t\t$this->redirect_to(\"/admin/content/edit/\".$model->save()->id.\"/\");\n\t}", "function create($model)\n {\n }", "public static function model()\n {\n return new self;\n }", "public function create() {\n \n }", "public function create() {\n \n }", "private function makeModel()\n {\n\n $this->model = $this->app->make($this->model());\n\n if (!$this->model instanceof Model)\n throw new Exception(\"Class \".$this->model.\" must be an instance of Illuminate\\\\Database\\\\Eloquent\\\\Model\");\n\n\n return $this->model;\n }", "public function creating($model)\n\t{\n\t}", "public function __construct()\n {\n $this ->model = $this ->makeModel($this ->model());\n }", "public function create() {\n //\n }", "public function create()\n {\n return $this->objectManager->create($this->className);\n }", "public function create(): object\n {\n if (!Bouncer::can('create', $this->model)) {\n abort(403);\n }\n $form = $this->form($this->form, [\n 'method' => 'POST',\n 'route' => [$this->routeWithModulePrefix . '.' . 'store']\n ]);\n\n $item = new $this->model;\n return $this->view($this->baseView . '.create', ['form' => $form, 'item' => $item]);\n }", "protected function _newModel($class)\n {\n // instantiate\n $model = new $class($this);\n \n // done!\n return $model;\n }", "public function create(array $request): Model;", "public function model() {\n require_once \"../app/models/model.php\";\n $this->model = new Model($this->db);\n }", "static function Create() \n\t{\n if (NULL == self::$userModel) {\n self::$userModel = new UserModel();\n }\n return self::$userModel;\n }", "public function create()\n {\n }", "public function create()\n {\n }", "public function make($modelClass);", "public function create() {\r\n }", "protected function makeModel()\n {\n $model = app($this->getModelClass());\n\n if (!$model instanceof Model) {\n throw new \\Exception(\"Invalid Eloquent model\");\n }\n\n $this->model = $model;\n }", "public function newModel($name)\n {\n $class = $this->getClass($name);\n return $this->_newModel($class);\n }", "public function create() {\n }", "public function create() {\n }", "public static function create($attributes) {\n\t\t$model = new static($attributes);\n\n\t\t$success = $model->save();\n\n\t\treturn ($success) ? $model : false;\n\t}", "public static function newModel(...$params) : Model\n {\n $model = new Model();\n $count = $params ? count($params) : 0;\n\n if ($count === 1)\n {\n $model->loadModelFromText($params[0]);\n }\n\n if ($count === 2 && $params[0])\n {\n $model->loadModel($params[0]);\n }\n\n return $model;\n }", "protected function createModel()\n {\n return new LeafModel();\n }", "public function newEntryModel();", "public static function Create() {\r\n\t\t$cls = get_called_class();\r\n\t\t$model = new $cls();\r\n\t\t$record = new Dbi_Record($model, array());\r\n\t\treturn $record;\r\n\t}", "private static function newModel(string $model, array $attributes = [])\n {\n return new $model(...array_values($attributes));\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create()\n {\n //\n }", "public function create() {\n\t\t\t//\n\t\t}", "public function create()\n {\n \n //\n }", "public function create($data = null) {\n\t\t$class = $this->type->getModelClassname();\n\t\t$object = new $class($data);\n\t\t$object->setModelStorage($this->type->getStorage());\n\t\treturn $object;\n\t}", "function __construct () {\n\t\t$this->_model = new Model();\n\t}", "public function create() {\r\n //\r\n }", "public function create() {\n\n\t\t\n\t}", "public function createAction()\n {\n $data = $this->getRequest()->getBody();\n $model = $this->getBinding()->create($data);\n $responseClass = $this->container->getParameter('response.class');\n $response = new $responseClass($model, 201);\n\n return $response;\n }", "public function model($model) {\n // Require model file\n require_once \"../app/models/{$model}.php\";\n\n // Instantiate model\n return new $model();\n }", "public function create()\n\t\t{\n\t\t\t//\n\t\t}", "public function create()\n\t\t{\n\t\t\t//\n\t\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}", "public function create() {\n\t\t//\n\t}" ]
[ "0.7933823", "0.7851583", "0.7826538", "0.7813565", "0.7800567", "0.77239335", "0.77196413", "0.7622064", "0.7588289", "0.75590146", "0.75590146", "0.7546743", "0.74987847", "0.7443237", "0.7269825", "0.72538024", "0.7197245", "0.7147188", "0.71250486", "0.7101891", "0.7099071", "0.7074536", "0.7025229", "0.7011847", "0.7004833", "0.6997296", "0.6979964", "0.6979824", "0.6935975", "0.6932361", "0.6875818", "0.6866037", "0.6866037", "0.68619925", "0.6860413", "0.6860413", "0.6860413", "0.6860413", "0.6860413", "0.6860413", "0.6860413", "0.6860413", "0.6860413", "0.6860413", "0.6860413", "0.6841861", "0.6840567", "0.6837045", "0.68312794", "0.6771033", "0.67656046", "0.6765552", "0.67625254", "0.67500514", "0.672965", "0.672965", "0.6719713", "0.6708891", "0.6700617", "0.6688328", "0.667881", "0.6675992", "0.66691345", "0.66648096", "0.66647375", "0.66614574", "0.66578543", "0.66578543", "0.66566914", "0.66554135", "0.6645795", "0.6645649", "0.66453743", "0.66453743", "0.6640169", "0.6630784", "0.66288686", "0.6627811", "0.66277766", "0.6623342", "0.66079825", "0.66079825", "0.66079825", "0.66079825", "0.6607975", "0.66029406", "0.65889895", "0.65879554", "0.65857327", "0.65821826", "0.65755314", "0.65692586", "0.6568499", "0.6568499", "0.6560166", "0.6560166", "0.6560166", "0.6560166", "0.6560166", "0.6560166", "0.6560166" ]
0.0
-1
Permission belongs to many roles.
public function roles() { return $this->belongsToMany(UserManager::package()->config('models.role')) ->withTimestamps(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function permissions(): BelongsToMany\n {\n return $this->belongsToMany(\n Permission::class,\n 'role_permissions',\n 'role_id',\n 'permission_id'\n );\n }", "public function permissions(): BelongsToMany\n {\n return $this->belongsToMany(\n HCAclPermission::class,\n 'hc_acl_role_permission_connection',\n 'role_id',\n 'permission_id'\n );\n }", "public function roles()\n {\n return $this->hasManyThrough(Permission::class);\n }", "public function roles(): BelongsToMany\n {\n return $this->belongsToMany(\n config('permission.models.role'),\n config('permission.table_names.role_has_permissions')\n );\n }", "public function roles(): BelongsToMany\n {\n return $this->belongsToMany(\n config('acl.models.role'),\n config('acl.table_names.role_has_permissions')\n );\n }", "public function roles(): BelongsToMany\n {\n return $this->belongsToMany(\n Config::get('laratrust.models.role'),\n Config::get('laratrust.tables.permission_role'),\n Config::get('laratrust.foreign_keys.permission'),\n Config::get('laratrust.foreign_keys.role')\n );\n }", "public function permissions()\n {\n return $this->belongsToMany(\n config('laravel-authorisation.models.permission'),\n config('laravel-authorisation.table_names.role_has_permissions')\n );\n }", "public function permissions()\n {\n return $this->belongsToMany(\n config('admin.permission.models.permission'),\n config('admin.permission.table_names.role_has_permissions')\n );\n }", "public function permissions(){ return new manytomany_link($this, 'permission', 'rolepermissions');\n }", "public function perms() {\n return $this->belongsToMany(config('entrust.permission'), config('entrust.permission_role_table'), 'role_id', 'permission_id');\n }", "public function permissions()\n {\n return $this->belongsToMany('Bican\\Roles\\Permission');\n }", "public function perms()\n {\n return $this->belongsToMany(Permission::class, 'permission_role', 'role_id', 'permission_id');\n }", "public function roles(): BelongsToMany\n {\n $role = $this->aclRoleModelInstance();\n\n return $this->belongsToMany(\n $this->aclRoleModel(),\n $this->aclTable('roles_permissions'),\n $this->getForeignKey(),\n $role->getForeignKey()\n );\n }", "public function permissions()\n {\n \t// belongsTo(RelatedModel, foreignKey = _id, keyOnRelatedModel = id)\n \treturn $this->belongsToMany('App\\Permission','permission_role','role_id','permission_id')->withTimestamps();\n }", "public function permissions()\n {\n return $this->embedsMany(\n config('laravel-permission.table_names.role_has_permissions')\n );\n }", "public function roles()\r\n {\r\n return $this->belongsToMany(config('bootstrap-menu.models.role'), config('bootstrap-menu.relations.permission_role'))->withTimestamps();\r\n }", "public function role(){\n return $this->belongsToMany('App\\Models\\Role','permission_role','permission_id', 'role_id');\n }", "public function roles()\n {\n /** @var \\UserFrosting\\Sprinkle\\Core\\Util\\ClassMapper $classMapper */\n $classMapper = static::$ci->classMapper;\n\n return $this->belongsToMany($classMapper->getClassMapping('role'), 'permission_roles', 'permission_id', 'role_id')->withTimestamps();\n }", "public function permissions()\n {\n return $this->belongsToMany('bedoke\\LaravelRolePerms\\Models\\Permission', 'role_permissions')\n ->withPivot('id')\n ->withTimestamps();\n }", "public function permissions()\n {\n return $this->belongsToManyThrough(\n EloquentTestPermission::class,\n EloquentTestRole::class,\n 'role_users',\n 'user_id',\n 'role_id',\n 'permission_roles',\n 'role_id',\n 'permission_id'\n );\n }", "public function perms()\n {\n return $this->belongsToMany(Config::get('guardian.permission'), Config::get('guardian.permission_role_table'), Config::get('guardian.role_foreign_key'), Config::get('guardian.permission_foreign_key'));\n }", "public function permissions()\n {\n return $this->belongsToMany(EloquentTestPermission::class, 'permission_roles', 'role_id', 'permission_id');\n }", "public function roles()\n {\n return $this->belongsToMany(\n config('laravel-permission.models.role'),\n config('laravel-permission.table_names.user_has_roles')\n )->withTimestamps();\n }", "public function permissionGroup()\n {\n return $this->belongsToMany(config('roles.models.permission'))->withTimestamps();\n }", "public function permissions(): MorphToMany\n {\n return $this->morphToMany(config('roles.models.permission'), 'permissionable');\n }", "public function roles(){\n return $this->belongsToMany('\\App\\Permission\\Models\\Role')->withTimestamps();\n }", "public function perms()\n {\n return $this->belongsToMany(Config::get('entrust-branch.permission'), Config::get('entrust-branch.permission_role_table'));\n }", "public function permission(){\n return $this->belongsToMany(Permission::class);\n }", "public function roles()\n {\n $pivotTable = config('permission.database.permission_roles_table');\n\n $relatedModel = config('permission.database.roles_model');\n\n return $this->belongsToMany($relatedModel, $pivotTable, 'permission_id', 'role_id')->withTimestamps();\n }", "public function permissions() {\n return $this->belongsToMany(Permission::class);\n }", "public function permissions()\n\t{\n\t\treturn $this->manyShiftsToMany('Permission');\n\t}", "public function roles() : BelongsToMany\n {\n $pivotTable = config('permission.table_names.role_has_menus');\n\n return $this->belongsToMany(RbacRole::class, $pivotTable, 'menu_id', 'rbac_role_id');\n }", "public function permissions()\n {\n return $this->belongsToMany(Permission::class);\n }", "public function permissions()\n {\n return $this->belongsToMany(Permission::class);\n }", "public function permissions()\n {\n return $this->belongsToMany(Permission::class);\n }", "public function permissions()\n {\n return $this->belongsToMany(Permission::class);\n }", "public function permissions()\n {\n return $this->belongsToMany(Permission::class);\n }", "public function permissions()\n {\n return $this->belongsToMany(Permission::class);\n }", "public function permissions(){\n return $this->belongsToMany(Permission::class);\n }", "public function roles() {\n $roleClass = config('cani.models.role');\n $rolePropertieInPermission = config('cani.collections.role_permissions_propertie');\n \n return $this->belongsToMany(\n $roleClass, null, $rolePropertieInPermission . '._id'\n );\n }", "public function permissions(){\n return new manytomany_link($this, 'permission', 'staffpermissions');\n }", "public function listPermissionByRole()\n {\n $roles = $this->roleRepository->all();\n $permissions = $this->permissionRepository->all();\n return view('admin.permission.permission_role', compact('roles', 'permissions'));\n }", "public function roles(): MorphToMany;", "public function permissions()\n {\n return $this->hasMany(Permission::class);\n }", "public function role(){\n $obj = $this->hasMany(UserRole::class,'user_id','id')\n ->join('role', 'role.id', '=', 'role_id')->with('permissions');\n return $obj;\n }", "public function roles()\n {\n return $this->belongsToMany(EloquentTestRole::class, 'permission_roles', 'permission_id', 'role_id');\n }", "public function permissions()\n {\n return $this->belongsToMany(\n Permission::class,\n null,\n \"context_ids\",\n \"permission_ids\"\n );\n }", "public function roles(): MorphToMany\n {\n return $this->morphToMany(\n config('permission.models.role'),\n 'model',\n config('permission.table_names.model_has_roles'),\n config('permission.column_names.model_morph_key'),\n 'role_id'\n );\n }", "public function permissions()\n\t{\n\t\treturn $this->belongsToMany(Permission::class, 'users_permissions');\n\t}", "public function roles(): BelongsToMany\n {\n return $this->belongsToMany(\n config('admin.database.roles_model'),\n config('admin.database.role_menu_table'),\n 'menu_id',\n 'role_id'\n );\n }", "public function permissions()\n {\n return $this->hasMany(UserPermission::class);\n }", "public function permissions()\n {\n return $this->belongsToMany(\n config('laravel-permission.models.permission'),\n config('laravel-permission.table_names.user_has_permissions')\n )->withTimestamps();\n }", "public function permissions()\n {\n return $this->belongsToMany(Permission::class)->withPivot('has_access');\n }", "public function permissions()\n {\n return $this->belongsToMany(config('rbac.models.permission'))->withTimestamps()->withPivot('granted');\n }", "public function roles(): BelongsToMany\n {\n return $this->belongsToMany(Role::class);\n }", "public function ability($roles, $permissions, $options = []);", "public function children(): HasMany\n {\n return $this->hasMany(Permission::class);\n }", "public function getPermissionsViaRole()\n {\n return $this->roles->map(function (Role $role) {\n return $role->getAllPermissions();\n })->flatten();\n }", "public function permissions()\n {\n return $this->belongsToMany('MDH\\Permissions\\Permission')->withTimestamps();\n }", "protected function getPermissions()\n {\n return Permission::with('roles')->get();\n }", "public function permissions()\n {\n $model = config('authorization.permission');\n\n return $this->belongsToMany($model);\n }", "public function getRolePermissions()\n {\n $headers = ['Ability', 'Role'];\n\n $role_name = $this->argument('needle');\n\n $role = $this->permission->findBy('role_name', $role_name);\n if ($role) {\n $permissions = json_to_array($role->permission);\n\n if (!is_array($permissions)) {\n $permissions = [];\n }\n\n foreach ($permissions as $module=>$permission) {\n $this->warn(\"\\n\" . strtoupper($module));\n $data = [];\n\n foreach ($permission as $ability=>$perm) {\n $vals = [$module, $ability];\n if (is_bool($perm)) {\n if ($perm) {\n $vals[] = 'true';\n } else {\n $vals[] = 'false';\n }\n }\n if (is_string($perm)) {\n $vals[] = $perm;\n }\n $data[] = $vals;\n }\n $this->table($headers, $data);\n }\n\n } else {\n $this->error(\"No role found!\");\n }\n }", "public function roles() {\n return $this->belongsToMany('Models\\Role');\n }", "public function roles()\n {\n return $this->belongsToMany(Config::get('laracancan.role_model', 'Hamedmehryar\\Laracancan\\Models\\Role'), 'lcc_role_user', 'user_id', 'role_id');\n }", "public function roles() {\n return $this->belongsToMany('App\\Role');\n }", "public function roles()\n {\n return $this->belongsToMany(Role::class);\n }", "public function roles(): BelongsToMany\n {\n return $this->belongsToMany(Role::class, 'role_user');\n }", "public function roles() {\n return $this->belongsToMany('App\\Models\\Role');\n }", "public function roles()\n {\n return $this->belongsToMany(Role::class);\n }", "public function createRolesPermissions($permissions)\n {\n\n \tforeach ($permissions as $index => $item) {\n\n \t\t// Verifica si existe el permiso o si no lo crea\n \t\t$permission = Permission::where('name', $item['name'])\n \t\t\t\t\t\t\t\t->where('guard_name', $item['guard_name'])\n\t\t\t\t\t\t\t\t\t-> first();\n\t\t\tif($permission == null){\n \t\t\t\t$permission = Permission::create(['name' => $item['name'],'guard_name'=>$item['guard_name']]);\n \t\t\t}\n\n\t\t\tif(isset($item['roles'])){\n\t\t\t\t// asigna el permiso a los roles\n\t\t\t\t$roles = $item['roles'];\n\n\t\t\t\tforeach ($roles as $key => $codeRole) {\n\n\t \t\t\t$role = Role::where('name', $codeRole)\n\t \t\t\t\t\t\t->where('guard_name', $permission-> guard_name)\n\t \t\t\t\t\t\t-> first();\n\n\t \t\t\t\tif($role != null){\n\t \t\t\t\t\tif(!$role -> hasPermissionTo($permission-> name)){\n\t \t\t\t\t\t\t$role -> givePermissionTo($permission-> name);\n\t \t\t\t\t\t}\n\t \t\t\t\t}\n\n\t \t\t}\n\t\t\t}\n \t}\n }", "protected function _addRoleResources() {\n if (!empty($this->commonPermission)) {\n foreach ($this->commonPermission as $resource => $permissions) {\n foreach ($permissions as $permission) {\n $this->allow(self::DEFAULT_ROLE, $resource, $permission);\n }\n }\n }\n\n if (!empty($this->rolePermission)) {\n foreach ($this->rolePermission as $rolePermissions) {\n $this->allow($rolePermissions['role_name'], $rolePermissions['resource_name'], $rolePermissions['permission_name']);\n }\n }\n\n return $this;\n }", "public function roles()\n {\n return $this->belongsToMany('App\\Role');\n }", "public function roles()\n {\n return $this->belongsToMany('App\\Role');\n }", "public function roles()\n {\n return $this->belongsToMany('App\\Role');\n }", "public function roles()\n {\n return $this->belongsToMany('App\\Role');\n }", "public function roles()\n {\n return $this->belongsToMany(config('rpac.models.role'))->withTimestamps();\n }", "public function getPermissionAndRoleList()\n {\n $user = $this->user;\n\n if (!$user) {\n throw new RoleAndPriviledgeServiceException(\"The user is not defined\");\n }\n $permissions = $user->directPermissions;\n\n $user->loadMissing(\"roles\", \"roles.permissions\");\n\n $roles = $user->roles;\n\n // $roles = $user->roles()->with(\"permissions\")->get();\n\n $roles->each(function ($role) use (&$permissions) {\n $permissions = $permissions->merge($role->permissions);\n });\n\n $rv = [\n array_unique($permissions->pluck(\"name\")->all()),\n array_unique($roles->pluck(\"name\")->all())\n ];\n\n return $rv;\n }", "public function __construct(Permission $permission, Collection $roles)\n {\n parent::__construct($permission);\n\n $this->roles = $roles;\n }", "public function roles()\n {\n return $this->hasMany('Role');\n }", "public function roles(){\n return $this->belongsToMany('App\\Role');\n }", "public function roles()\n {\n return $this->belongsToMany('App\\Models\\Role');\n }", "public function roles(){\n return $this->belongsToMany(Role::class);\n }", "public function roles()\n {\n return $this->belongsToMany('App\\Model\\Role');\n }", "public function roles()\n {\n return $this->belongsToMany(Role::class);\n }", "public function roles()\n {\n return $this->belongsToMany(Role::class);\n }", "public function roles()\n {\n return $this->belongsToMany(Role::class);\n }", "public function roles()\n {\n return $this->belongsToMany(Role::class);\n }", "public function roles()\n {\n return $this->belongsToMany(Role::class);\n }", "public function roles()\n {\n return $this->belongsToMany(Role::class);\n }", "public function roles()\n {\n return $this->belongsToMany(Role::class);\n }", "public function roles()\n {\n return $this->belongsToMany(Role::class);\n }", "public function roles()\n {\n return $this->belongsToMany(Role::class);\n }", "public function roles()\n {\n return $this->belongsToMany(Role::class);\n }", "public function roles()\n {\n return $this->belongsToMany(Authorization::roleModel())->using(RolePivot::class);\n }", "public function roles()\n {\n return $this->belongsToMany(\n Config::get('able.role'),\n Config::get('able.role_group_table'),\n Config::get('able.group_foreign_key'),\n Config::get('able.role_foreign_key')\n );\n }", "public function roles()\n {\n return $this->hasMany('App\\Model\\Role');\n }", "public function permission_mass_assignament(array $roles){\n foreach($roles as $role){\n if(!$this->has_role($role)){\n $role_obj=Role::findOrFail($role);\n $permissions=$role_obj->permissions;\n //como queremos conservar los permisos que ya tiene el usuario NO USAMOS\n //que solamente se sincronizen los nuevos permisos\n //pasamos como parametro la coleccion de modelos\n $this->permissions()->syncWithoutDetaching($permissions);\n\n }\n }\n\n }", "public function roles()\n {\n return $this->belongsToMany(config('gate.models.role'));\n }", "public function create() {\n// $role = Sentinel::findRoleById(1);\n// $roles = Rol::get();\n// foreach($roles as $role){\n// $role->removePermission(0);\n// $role->removePermission(1);\n// $role->save();\n// }\n// dd(Sentinel::getUser()->hasAccess('sds'));\n// dd(\\Modules\\Permissions\\Entities\\ModulePermission::where('module_id', 10)->where('permission', 'like', '%.view')->orderBy('menu_id')->lists('permission')->toArray());\n }", "function associatePermissionsToRole()\n {\n $retObj = array();\n try {\n\n if (isset($_POST['role_id']))\n {\n $permission_ids = json_decode($_POST['permission_ids']);\n $params = array(\n 'role_id' => $_POST['role_id'],\n 'permission_ids' => $permission_ids\n );\n\n $objAcl = new AclManager();\n $retObj['completed'] = false;\n $response = $objAcl->associatePermissionsToRole($params);\n $retObj['completed'] = true;\n\n } else {\n\n throw new \\Exception('Unsupported Request: missing critical parameter(s).');\n\n }\n\n\n } catch (\\Exception $e) {\n\n Api::invalidResponse(\n $e->getMessage(),\n 400,\n Constants::STATUS_INVALID,\n $e,\n true,\n true\n );\n\n }\n\n return Api::apiResponse($retObj, Constants::STATUS_SUCCESSFUL);\n }", "public function rolePermissions(): Collection\n {\n return $this->roles?->loadMissing('permissions')->pluck('permissions')->flatten() ?? collect();\n }" ]
[ "0.77475893", "0.7532417", "0.73828846", "0.7373415", "0.72926646", "0.72416306", "0.72102726", "0.71283704", "0.70862246", "0.70778847", "0.7048877", "0.70060563", "0.69969", "0.6982131", "0.6982116", "0.69708717", "0.6967185", "0.6912088", "0.6906401", "0.6729847", "0.6723894", "0.6687686", "0.668315", "0.6657271", "0.661231", "0.6602138", "0.65767866", "0.6572667", "0.65566903", "0.6535607", "0.6514252", "0.65048194", "0.64989144", "0.64989144", "0.64989144", "0.64989144", "0.64989144", "0.64989144", "0.6498422", "0.64895433", "0.6489465", "0.64379805", "0.6425283", "0.641464", "0.6371332", "0.63642734", "0.6336353", "0.6297567", "0.6288772", "0.62729514", "0.626855", "0.62563527", "0.6234777", "0.623385", "0.6227063", "0.6222209", "0.62117153", "0.6190827", "0.6188642", "0.6184578", "0.6182102", "0.61799437", "0.613766", "0.60831743", "0.60735756", "0.6047437", "0.60449535", "0.6043121", "0.6034172", "0.6026583", "0.6010716", "0.6010568", "0.6010568", "0.6010568", "0.6010568", "0.5997281", "0.5991717", "0.5984482", "0.59838545", "0.5983317", "0.5978381", "0.5977467", "0.59759647", "0.5969549", "0.5969549", "0.5969549", "0.5969549", "0.5969549", "0.5969549", "0.5969549", "0.5969549", "0.5969549", "0.5969549", "0.59661275", "0.59650606", "0.5961497", "0.595578", "0.59480035", "0.5932118", "0.5928524", "0.59234667" ]
0.0
-1
Redirect to the 'login' page
private function _login_required(Yaf_Request_Abstract $request) { $request->setControllerName('Auth'); $request->setActionName('login'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function redirectLogin()\n\t{\n\t\tredirect('auth/login');\n\t}", "public function actionLogin()\r\n\t{\r\n\t $this->redirect(array('//user/auth'));\r\n\t}", "public function login_page()\n\t{\n\t\t$this->redirect( EagleAdminRoute::get_login_route() );\n\t}", "function _loginRedirect(){\r\n \t// send user to the login page\r\n \theader(\"Location:/index.php\");\r\n }", "public function loginAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n $site = $this->view->site;\n $loginUser = $this->view->loginUser;\n\n if ( $loginUser ) {\n $homeUrl = $site->getUrl( 'home' );\n return $this->_redirect( $homeUrl );\n }\n\n // set the input params\n $this->processInput( null, null, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n return $this->renderPage( 'authLogin' );\n }", "public function login()\n\t{\n\t\tif (isLogin()) {\n\t\t\tredirect('/backoffice');\n\t\t} else {\n\t\t\t$this->display(\n\t\t\t\t'backoffice/login.html.twig'\n\t\t\t);\n\t\t}\n\n\t}", "public function doRedirectLogin() {\n\t\t\theader(\"Location: ../../login.php?\".http_build_query($_REQUEST));\n\t\t\texit;\n\t\t}", "function template_redirect() {\r\n\t\tappthemes_auth_redirect_login();\r\n\t}", "public function index() {\n redirect(\"auth/login\", \"refresh\");\n }", "function login() {\n $this->layout = \"no_header\";\n $this->Auth->loginRedirect = array('controller' => 'pages', 'action' => 'display', \"home\");\n }", "public function actionLogin()\n\t{\n\t\tif ($this->getUser()->isLoggedIn())\n\t\t\t$this->redirect('Administration:default');\n\t}", "public function loginAction()\n {\n $session = new Zend_Session_Namespace(__CLASS__);\n $baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();\n try {\n $referer = Zend_Uri_Http::factory($_SERVER['HTTP_REFERER']);\n } catch (Exception $e) {\n }\n if ($this->_getParam('referer')) {\n $session->referer = $this->_getParam('referer');\n } else if ($referer && \n $referer->getHost() == $_SERVER['HTTP_HOST'] &&\n (!$referer->getPort() || $referer->getPort() == $_SERVER['SERVER_PORT']) &&\n substr($referer->getPath(), 0, strlen($baseUrl)) == $baseUrl) {\n $session->referer = substr($referer->getPath(), strlen($baseUrl));\n $session->referer = ltrim($session->referer, '/'); \n if ($referer->getQuery()) {\n $session->referer .= '?' . $referer->getQuery();\n }\n if ($referer->getFragment()) {\n $session->referer .= '#' . $referer->getFragment();\n }\n } else {\n $session->referer = $this->_getDefaultLandingPath();\n }\n \n $this->_redirect($this->_getCasAdapter()->getLoginUrl());\n }", "function auth_redirect() {\n\n\t\tauth_redirect();\n\n\t}", "public function loginAction()\r\n\t{\r\n\t\r\n\t\t$post_back = $this->request->getParam( \"postback\" );\r\n\t\t$config_https = $this->registry->getConfig( \"SECURE_LOGIN\", false, false );\r\n\t\r\n\t\t// if secure login is required, then force the user back thru https\r\n\t\r\n\t\tif ( $config_https == true && $this->request->uri()->getScheme() == \"http\" )\r\n\t\t{\r\n\t\t\t$uri = $this->request->uri();\r\n\t\t\t$uri->setScheme('https');\r\n\t\r\n\t\t\treturn $this->redirect()->toUrl((string) $uri);\r\n\t\t}\r\n\t\r\n\t\t### remote authentication\r\n\t\r\n\t\t$result = $this->authentication->onLogin();\r\n\t\r\n\t\tif ( $result == Scheme::REDIRECT )\r\n\t\t{\r\n\t\t\treturn $this->doRedirect();\r\n\t\t}\r\n\t\r\n\t\t### local authentication\r\n\t\r\n\t\t// if this is not a 'postback', then the user has not submitted the form, they are arriving\r\n\t\t// for first time so stop the flow and just show the login page with form\r\n\t\r\n\t\tif ( $post_back == null ) return 1;\r\n\t\r\n\t\t$bolAuth = $this->authentication->onCallBack();\r\n\t\r\n\t\tif ( $bolAuth == Scheme::FAILED )\r\n\t\t{\r\n\t\t\t// failed the login, so present a message to the user\r\n\t\r\n\t\t\treturn array(\"error\" => \"authentication\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn $this->doRedirect();\r\n\t\t}\r\n\t}", "public function login()\n\t{\n\t\t$this->view('/');\n\t}", "public function loginPost(){\n\t\t\tif($this->modelLogin())\n\t\t\t\techo \"<script>location.href='home';</script>\";\n\t\t\telse\n\t\t\t\techo \"<script>location.href='login/register-fail';</script>\";\n\t\t}", "public function login() {\n if ($this->request->is('post')) {\n if ($this->Auth->login()) {\n return $this->redirect($this->Auth->redirectUrl());\n }\n $this->Flash->error(__('Invalid username or password, try again'));\n }\n\n $this->render('index');\n }", "public function loginAction()\r\n\t{\r\n\t\t$this->setSubTitle($this->loginSubTitle);\r\n\t\t\r\n\t\t$this->view->form = new $this->loginFormClassName();\r\n\t\t\r\n\t\t$this->checkAuth();\r\n\t}", "function index()\r\n\t{\r\n\t\t\tredirect('c_login', 'refresh');\r\n\t}", "public function maverickLoginAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n $site = $this->view->site;\n $loginUser = $this->view->loginUser;\n\n if ( $loginUser ) {\n $homeUrl = $site->getUrl( 'home' );\n return $this->_redirect( $homeUrl );\n }\n\n // set the input params\n $this->processInput( null, null, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n return $this->renderPage( 'authMaverickLogin' );\n }", "public function login()\n {\n $login = new Login();\n\n $path = '/inloggen';\n if (CSRF::validate() && $login->check()) {\n // try to send the user to the reservation form or sign up for meet the expert page\n $path = Session::get('path');\n unset($_SESSION['path']);\n\n if (empty($path)) {\n $path = '/';\n }\n }\n\n return new RedirectResponse($path);\n }", "public function logged_in_redirect(){\n\n\t\tif (isset($_SESSION['user_id'])) {\n\t\t \t# code...\n\t\t \theader('Location: index.php');\n\t\t } \n\t}", "public function login() {\n if (isset($_SESSION['userid'])) {\n $this->redirect('?v=project&a=show');\n } else {\n $this->view->login();\n }\n }", "public function formLogin(){\n $user = $this->model->connectFromCookie();\n if ($user) {\n header('location:index.php?controller=dashboard');\n } else {\n $this->view->addFormLogin();\n }\n }", "public function loginAction() {\n if ($this->_getSession()->isLoggedIn()) {\n $this->_redirect('*/*/');\n return;\n }\n $this->getResponse()->setHeader('Login-Required', 'true');\n $this->loadLayout();\n $this->_initLayoutMessages('customer/session');\n $this->_initLayoutMessages('catalog/session');\n $this->renderLayout();\n }", "public function login(){\n \t\t//TODO redirect if user already logged in\n \t\t//TODO Seut up a form\n \t\t//TODO Try to log in\n \t\t//TODO Redirect\n \t\t//TODO Error message\n \t\t//TODO Set subview and load layout\n\n \t}", "protected function Login()\n {\n $this->redirectParams[\"openid.realm\"] = $this->config[\"realm\"];\n $this->redirectParams[\"openid.return_to\"] = $this->config[\"return_to\"];\n\n $params = http_build_query($this->redirectParams);\n\n $url = $this->urlAuthorize . \"?$params\";\n\n header(\"Location: $url\");\n exit();\n }", "public function loginForm()\n {\n\n if (isset($_SESSION['login_ss'])) {\n header('location: http://localhost/nhi_mvc/index/students');\n exit();\n }\n $this->view->render(\"login/login\");\n }", "public function actionLogin()\n\t{\n\t\tUtilities::updateCallbackURL();\n\t\t$this->render('login');\n\t}", "public static function authPage(){\n\t\tif(!self::isLogged()){\n\t\t\theader(\"Location: login.php?required\");\n\t\t\texit;\n\t\t}\n\t}", "protected function _loginPostRedirect()\n {\n $session = $this->_getSession();\n if ($session->isLoggedIn()) {\n $redirectUrl = Mage::getUrl('/');\n } else {\n $redirectUrl = Mage::getUrl('customer/account/login');\n }\n $this->_redirectUrl($redirectUrl);\n }", "public function login() {\n $page = 'login';\n\n require('./View/default.php');\n }", "public function login()\n {\n require_once(app_path().'/config/id.php');\n\n // if user is already logged in, redirect to current page\n if (Session::has('user'))\n {\n try {\n return Redirect::back();\n }\n catch (Exception $e) {\n return Redirect::to('/');\n }\n }\n\n // else redirect user to CS50 ID\n else\n {\n //store url in session\n Session::put('redirect', URL::previous());\n\n return Redirect::to(CS50::getLoginUrl(TRUST_ROOT, RETURN_TO));\n }\n }", "public function login(): RedirectResponse\n {\n return redirect($this->auth->getLoginUrl());\n }", "function login() \n\t{\n // Specify the navigation column's path so we can include it based\n // on the action being rendered\n \n \n // check for cookies and if set validate and redirect to corresponding page\n\t\t$this->viewData['navigationPath'] = $this->getNavigationPath('users');\n\t\t$this->renderWithTemplate('users/login', 'MemberPageBaseTemplate');\n\t\t\n }", "public function dologinpage()\n\t\t{\n\t\t\t$userdata = array(\n\t\t\t\t'email' => Input::get('email'),\n\t\t\t\t'password' => Input::get('password')\n\t\t\t);\n\n\t\t\tif(Auth::attempt($userdata)) {\n\t\t\t\tSession::flash('successMessage', \"Welcome back, \" . Auth::user()->username . \"!\");\n\t\t\t\tSession::put('loggedinuser', Auth::user()->username);\n\t\t\t\treturn Redirect::intended('/posts');\n\t\t\t\t// $userid = DB::table('users')->where('username', Session::get('loggedinuser'))->pluck('id');\n\t\t\t\t// Session::put('loggedinid', $userid);\n\t\t\t\t\n\t\t\t\t// return Redirect::action('PostsController@index');\n\t\t\t} else {\n\t\t\t\tSession::flash('errorMessage', 'Your username or password is incorrect');\n\t\t\t\treturn Redirect::to('login');\n\t\t\t}\n\t\t}", "public function post_signin()\n\t{\n\t\tif(Service\\Validation\\Login::passes(Input::all()))\n\t\t{\n\t\t\tif(Service\\Security::authorize(array('username' => Input::get('username'), 'password' => Input::get('password'))))\n\t\t\t{\n\t\t\t\treturn Redirect::home();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn Redirect::to_route('login')->with_input()->with_errors(new Messages(array(\n\t\t\t\t\t__('login.failed')->get()\n\t\t\t\t)));\n\t\t\t}\n\t\t}\n\n\t\treturn Redirect::to_route('login')->with_input()->with_errors(Service\\Validation::errors());\n\t}", "function login() {\n\n $this->redirect(\"/staff/users/alllogin\");\n \n $this->layout = 'login_layout';\n\t\t// Display error message on failed authentication\n\t\tif (!empty($this->data) && !$this->Auth->_loggedIn) {\n\t\t\t$this->Session->setFlash($this->Auth->loginError);\t\t\t\n\t\t}\n\t\t// Redirect the logged in user to respective pages\n\t\t$this->setLoginRedirects();\n\t}", "public function login()\n {\n\n \t// only login if not already logged in\n \tif (Auth::guest())\n \t{\n \t\treturn view('login');\n\n \t}\n \t\n \t// send user to root if already logged in\n \treturn redirect('/');\n\n }", "public function redirectToLogin() {\n\t\t//\tcreate and save the state parameter\n\t\t$openIdStateMap =& storageFindOrCreate( \"openIdStateMap\" );\n\t\t$state = generatePassword(10);\n\t\t$openIdStateMap[ $state ] = $this->code;\n\n\t\t//\tcreate the URL\n\t\t$config = $this->getConfig();\n\t\t$request = new HttpRequest( $config[\"authorization_endpoint\"], \"GET\", array( \n\t\t\t\"response_type\" => \"code\",\n\t\t\t\"scope\" => $this->scope,\n\t\t\t\"client_id\" => $this->clientId,\n\t\t\t\"state\" => $state,\n\t\t\t\"redirect_uri\" => projectURL() . GetTableLink(\"openidcallback\")\n\t\t));\n\n\t\theader( \"Location: \" . $request->getUrl() );\n\t}", "public function loginAction() : object\n {\n $title = \"Logga in\";\n\n // Deal with incoming variables\n $user = getPost('user');\n $pass = getPost('pass');\n $pass = MD5($pass);\n\n if (hasKeyPost(\"login\")) {\n $sql = loginCheck();\n $res = $this->app->db->executeFetchAll($sql, [$user, $pass]);\n if ($res != null) {\n $this->app->session->set('user', $user);\n return $this->app->response->redirect(\"content\");\n }\n }\n\n // Add and render page to login\n $this->app->page->add(\"content/login\");\n return $this->app->page->render([\"title\" => $title,]);\n }", "public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login.twig', [\n 'model' => $model,\n ]);\n }\n }", "public function loginAction()\n {\n // Instantiate the form that asks the user to log in.\n $form = new Application_Form_LoginForm();\n\n // Initialize the error message to be empty.\n $this->view->formResponse = '';\n\n // For security purposes, only proceed if this is a POST request.\n if ($this->getRequest()->isPost())\n {\n // Process the filled-out form that has been posted:\n // if the input values are valid, attempt to authenticate.\n $formData = $this->getRequest()->getPost();\n if ($form->isValid($formData))\n {\n if ( $this->_authenticate($formData) )\n {\n $this->_helper->redirector('index', 'index');\n }\n }\n }\n\n // Render the view.\n $this->view->form = $form;\n }", "public function requireLogin(){\n if( ! Authentifiacation::isLoggedIn()){\n Authentifiacation::rememberRequestedPage();\n Flash::addMessage('You need to login to view this page', Flash::INFO);\n self::redirect('/login/new');\n }\n }", "public function actionLogin()\n {\n $this->view->registerCssFile('/css/ShortPage.css');\n if (!Yii::$app->user->isGuest) {\n // return $this->goHome();\n return Yii::$app->getResponse()->redirect('../price');\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }", "public function redirectLogin()\n {\n return redirect()->to('/login');\n }", "public function login()\n\t{\n\t\tif ($this->request->is('post')) {\n\n\t\t\t// If no parameter passed to login(), CakePHP automatically give the request params as parameters.\n\t\t\tif ($this->Auth->login()) {\n\t\t\t\treturn $this->redirect($this->Auth->redirectUrl());\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->set('signInFail', true); // view vars\n\t\t\t}\n\t\t}\n\t}", "private function redirect()\n\t\t{\n\t\t\tif(isUserLoggedIn())\n\t\t\t{\n\t\t\t\theader(\"Location: \" . APPROOT);\n\t\t\t}\n\t\t}", "function login()\n {\n if (isset($_SESSION['username'])) {\n redirect('user/index');\n } else {\n $this->view->load('frontend/user/login');\n }\n }", "public static function loginThenRedirect ($message){\n unset($_SESSION['return_to']);\n if (!session::isUser()){\n $_SESSION['return_to'] = $_SERVER['REQUEST_URI'];\n session::setActionMessage($message);\n http::locationHeader('/account/login/index');\n die;\n }\n }", "function redirectToLogin()\n{\n\t\n\t$expired = \"\";\n\t$url = \"http://\";\n\tif( $_SERVER[\"HTTPS\"] && $_SERVER[\"HTTPS\"] != \"off\")\n\t\t$url = \"https://\";\n\t$url .= $_SERVER[\"HTTP_HOST\"] . $_SERVER['REQUEST_URI'];\n\n\n\tif( isset($_SERVER['HTTP_REFERER']) )\n\t{\n\t\tif( getDirectoryFromURI( $_SERVER['HTTP_REFERER'] ) == getDirectoryFromURI( $url ) \n\t\t\t&& getFilenameFromURI( $_SERVER['HTTP_REFERER'] ) != \"index.htm\" \n\t\t\t&& $_SERVER['HTTP_REFERER'] != getDirectoryFromURI( $url ))\n\t\t\t$expired = \"message=expired\";\n\t}\n\tHeaderRedirect(\"login\", \"\", $expired);\n\texit();\n}", "private function formLogin(){\n\t\tView::show(\"user/login\");\n\t}", "public function indexAction()\n {\n $redirectionUri = $this->backendRedirectionService->getAfterLoginRedirectionUri($this->request);\n if ($redirectionUri === null) {\n $redirectionUri = $this->uriBuilder->uriFor('index', array(), 'Login', 'Neos.Neos');\n }\n $this->redirectToUri($redirectionUri);\n }", "public static function index() {\n if (Auth::hasUser()) {\n redirect('/');\n } else {\n $login_page = new View('forms/signin.php');\n $login_page->render();\n }\n }", "function logged_in_redirect() {\n if(logged_in()) {\n header('Location: index.php');\n exit();\n }\n }", "function auth_redirect()\n {\n }", "public function loginView() { \n\t\ttry {\n\t\t\tif (!Sentinel::check()) {\t\t\t\t\n\t\t\t\treturn view('layouts.back.login');\n\t\t\t} else {\n\t\t\t\t$redirect = Session::get('loginRedirect', '');\n\t\t\t\tSession::forget('loginRedirect');\n\t\t\t\treturn redirect($redirect);\n\t\t\t}\n\t\t} catch (\\Exception $e) {\n\t\t\treturn view('layouts.back.login')->withErrors(['login' => $e->getMessage()]);\n\t\t}\n\t}", "public function loginAction() {\n $auth = Zend_Auth::getInstance();\n\n if ($auth->hasIdentity()) {\n $this->_redirect($this->getUrl());\n }\n\n $request = $this->getRequest();\n\n $redirect = $request->getPost('redirect');\n if (strlen($redirect) == 0)\n $redirect = $request->getServer('REQUEST_URI');\n if (strlen($redirect) == 0)\n $redirect = $this->getUrl();\n\n $errors = array();\n\n if ($request->isPost()) {\n // get the hash\n $hash = $request->getPost('hash');\n\n if ($this->checkHash($hash)) {\n $username = $request->getPost('username');\n $password = $request->getPost('password');\n\n if (strlen($username) == 0 || strlen($password) == 0)\n $errors['username'] = 'Required field must not be blank';\n\n if (count($errors) == 0) {\n $adapter = new Champs_Auth_Doctrine($username, $password);\n\n $result = $auth->authenticate($adapter);\n\n if ($result->isValid()) {\n $this->_redirect($this->getUrl());\n }\n\n $errors['username'] = 'Your login details were invalid';\n }\n }\n }\n\n // setup hash\n $this->initHash();\n\n $this->view->errors = $errors;\n $this->view->redirect = $redirect;\n }", "public function login()\n {\n $this->renderView('login');\n }", "public function index()\n\t{\n\t\t$requestUrl = $this->input->get(\"redirect\");\n\t\t\n\t\tif ($this->login_util->isUserLoggedIn()){\n\t\t\t// session exists\n\t\t\tredirect($requestUrl, 'refresh');\n\t\t}\n\t\t\n\t\t$this->display_login($requestUrl);\n\t}", "public function actionLogin()\n {\n $this->layout = '/login';\n $manager = new Manager(['userId' => UsniAdaptor::app()->user->getId()]);\n $userFormDTO = new UserFormDTO();\n $model = new LoginForm();\n $postData = UsniAdaptor::app()->request->post();\n $userFormDTO->setPostData($postData);\n $userFormDTO->setModel($model);\n if (UsniAdaptor::app()->user->isGuest)\n {\n $manager->processLogin($userFormDTO);\n if($userFormDTO->getIsTransactionSuccess())\n {\n return $this->goBack();\n }\n }\n else\n {\n return $this->redirect($this->resolveDefaultAfterLoginUrl());\n }\n return $this->render($this->loginView,['userFormDTO' => $userFormDTO]);\n }", "protected function LoginRedirect()\n {\n try\n {\n // set cookies to know where to redirect on success\n setcookie( 'AUTHURL', $this->sSuccessUrl, 0, \"/\", '.clemson.edu', false, true);\n setcookie( 'AUTHREASON', '', 0, \"/\", '.clemson.edu', false, true);\n\n // redirect to the login site\n header( 'Location: https://login.clemson.edu' );\n die();\n }\n catch( Exception $oException )\n {\n throw cAnomaly::BubbleException( $oException );\n }\n }", "public function login() {\n if(Auth::check()){\n return redirect()->intended('/');\n }else {\n return view('auth.login');\n }\n }", "protected function redirectTo()\n {\n //generate URL dynamicaly .\n return '/login'; // return dynamicaly generated URL.\n }", "function login()\n {\n // run the login() method in the login-model, put the result in $login_successful (true or false)\n $login_model = $this->loadModel('Login');\n // perform the login method, put result (true or false) into $login_successful\n $login_successful = $login_model->login();\n\n // check login status\n if ($login_successful) {\n // if YES, then move user to dashboard/index\n // please note: this is a browser-redirection, not a rendered view\n header('location: ' . URL . 'dashboard/index');\n } else {\n // if NO, then show the login/index (login form) again\n $this->view->render('login/index');\n }\n }", "protected function LoginRedirect()\n {\n try\n {\n // set the success url in session\n $_SESSION[ 'onsuccess' ] = $this->sSuccessUrl;\n\n // get the base url\n $sSlash = substr( $_SERVER[ 'HTTP_HOST' ], -1 ) == '/' ? '' : '/';\n\n // redirect to the login site\n header( 'Location: ' . $this->GetProtocol() . '://' . $_SERVER[ 'HTTP_HOST' ] . $sSlash . 'ldap-login.php' );\n die();\n }\n catch( Exception $oException )\n {\n throw cAnomaly::BubbleException( $oException );\n }\n }", "function redirect_when_logged() {\n $is_logged_in = AppAuthentication::is_logged_in();\n\n // If the user is already logged in we redirect to the default path of\n // his role.\n if ($is_logged_in) {\n $user_info = AppAuthentication::get_user_data();\n redirect_to_user_default_path($user_info);\n return TRUE;\n }\n\n return FALSE;\n }", "public function actionLogin()\n {\n if (!\\Yii::$app->user->isGuest) {\n return $this->redirect([ 'site/index' ]);\n }\n $referer = \\Yii::$app->request->get('referer', \\Yii::$app->request->referrer);\n if (empty( $referer )) {\n $referer = Url::to([ 'cabinet/main' ], true);\n }\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return Yii::$app->getResponse()\n ->redirect($referer);\n } else {\n return $this->render(\n 'login',\n [\n 'model' => $model,\n ]\n );\n }\n }", "public function login()\n {\n if( Confide::user() )\n {\n // If user is logged, redirect to internal \n // page, change it to '/admin', '/dashboard' or something\n return Redirect::to('/member');\n }\n else\n {\n return View::make(Config::get('confide::login_form'));\n }\n }", "public function login() {\n\t\tif ($this->request->is('post')) {\n\t\t\tif ($this->Auth->login()) {\n\t\t\t\treturn $this->redirect($this->Auth->redirect());\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Invalid username or password, try again'));\n\t\t\t}\n\t\t}\n\t}", "function redirectAfterLogin() {\n\tsession_start();\n\tif(!isset($_SESSION[\"gotoPage\"]))\n\t\ttrigger_error(\"There is no redirect page\");\n\t//trigger_error(\"going to \" . $_SESSION[\"gotoPage\"]);\n\theader(\"Location: \" . $_SESSION[\"gotoPage\"]);\n}", "public function login() {\r\n if ($this->request->is('post')) {\r\n \r\n //If the user is authenticated...\r\n if ($this->Auth->login()) {\r\n \r\n if ($this->isAdmin()) $this->redirect(\"/admin/halls\");\r\n else $this->redirect(\"/halls\");\r\n }\r\n else {\r\n $this->Session->setFlash(__('Invalid username or password, try again'));\r\n }\r\n }\r\n }", "public function actionLogin()\n {\n if (!\\Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }", "public function actionLogin()\n {\n if (!\\Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }", "public function actionLogin() {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }", "public function actionLogin() {\n if (!\\Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login() && $model->validate()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }", "public function loginHome() {\n Auth::checkAuthentication();\n Redirect::to('index/about');\n }", "public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }", "public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }", "public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }", "public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }", "public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }", "public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }", "public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }", "public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }", "public function actionLogin()\n {\n if (!Yii::$app->user->isGuest) {\n return $this->goHome();\n }\n\n $model = new LoginForm();\n if ($model->load(Yii::$app->request->post()) && $model->login()) {\n return $this->goBack();\n } else {\n return $this->render('login', [\n 'model' => $model,\n ]);\n }\n }", "public function showloginpage()\n\t\t{\n\t\t\tif(Auth::check()) {\n\t\t\t\tSession::flash('errorMessage', 'You are already logged in!');\n\t\t\t\treturn Redirect::action('UsersController@index');\n\t\t\t} else {\n\t\t\t\treturn View::make('login');\n\t\t\t}\n\t\t}", "function display_login(){\n header(\"Location: view/login.php\");\n}", "function login() {\n\t\tif (isset($_REQUEST['username']) && !empty($_REQUEST['username'])) {\n\t\t\t$username = $_REQUEST['username'];\n\n\t\t\t$userDAO = implementationUserDAO_Dummy::getInstance();\n\t\t\t$users = $userDAO->getUsers();\n\n\t\t\tforeach ($users as $key => $user) {\n\t\t\t\tif ($user->getUsername() === $username) {\n\t\t\t\t\t$userFound = $user;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isset($userFound) && $userFound != null) {\n\n\t\t\t\tif (isset($_REQUEST['password']) && !empty($_REQUEST['password'])) {\n\t\t\t\t\t$password = $_REQUEST['password'];\n\n\t\t\t\t\tif ($userFound->getPassword() === $password) {\n\n\t\t\t\t\t\tsession_start();\n\t\t\t\t\t\t$_SESSION['USERNAME']= $username;\n\n\t\t\t\t\t\t$url = getPreviousUrl();\n\t\t\t\t\t\t$newUrl = substr($url, 0, strpos($url, \"?\"));\n\n\t\t\t\t\t\tredirectToUrl($newUrl);\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->resendLoginPage('danger', 'Mot de passe invalide.');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\t// redirecting to login with bad password alert\n\t\t\t\t\t$this->resendLoginPage('danger', 'Mot de passe invalide.');\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$this->resendLoginPage('danger', 'Login invalide.');\n\t\t\t}\n\t\t}\n\n\t\telse {\n\t\t\t// redirecting to login page with bad username alert\n\t\t\t$this->resendLoginPage('danger', 'Login invalide.');\n\t\t}\n\n\n\t}", "public function login()\n\t{\n\t\t$this->load->view(\"default/painel/login\");\n\t}", "public function controlLogin()\n {\n if ($this->checkUserLogin() == false) {\n if (isset($_SERVER[\"REQUEST_URI\"])) {\n $url = trim($_SERVER[\"REQUEST_URI\"], '/');\n $this->server->redirect(\"/login?pre=\" . $url);\n } else {\n $this->server->redirect(\"/login\");\n }\n } else {\n return true;\n }\n }", "public function login()\n\t{\n\t\t$this->load->view('login_main');\n\n\t}", "protected function getLoginFormRedirection() {\n return new RedirectResponse(Url::fromRoute('user.login')->toString());\n }", "public function redirect_login($name){\n\t\t$query = \"SELECT user_id FROM tb_user WHERE username = '$name'\";\n\t\t$result = mysqli_query($this->db,$query);\n\t\t$row = mysqli_fetch_assoc($result);\n\n\t\t$_SESSION['user'] = $name;\n\t\t$_SESSION['user_id'] = $row[\"user_id\"];\n\t\theader('location:index.php');\n\n\t}", "public function login_redirect_test()\n {\n $response = $this->get('/');\n\n $response->assertRedirect('/login');\n }", "public function login(){\n\t\tif(Session::get('admin_user_id'))\n\t\t\treturn redirect('/admin');\n\t\telse\n\t\t\treturn view('admin.login');\n\t}", "function redirect_login_page(){\n\t$page_viewed = basename($_SERVER['REQUEST_URI']);\n\t\n // Where we want them to go\n \t$login_page = site_url();\n \t//Write your site URL here.\n\t// Two things happen here, we make sure we are on the login page\n\t// and we also make sure that the request isn't coming from a form\n\t// this ensures that our scripts & users can still log in and out.\n\tif( !is_user_logged_in() && $page_viewed == \"wp-admin\" && $_SERVER['REQUEST_METHOD'] == 'GET') {\n\t\twp_redirect($login_page);\n \t\texit();\n \t}\n}", "public function loginAction() {\n\t\tif (isset($_POST['password'])) {\n\t\t\t$entered = $_POST['password'];\n\t\t} elseif (isset($_COOKIE['password'])) {\n\t\t\t$entered = $_COOKIE['password'];\n\t\t} else {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->logIn($entered);\n\t\tif ($this->loggedIn()) {\n\t\t\t//setcookie('password', $entered, time() + 3600 * 24 * 30, '/');\n\t\t\t$this->forward(ChibiRegistry::getHelper('url')->url('/a/index'));\n\t\t\tChibiRegistry::getHelper('mg')->log('Correct password');\n\t\t} else {\n\t\t\tChibiRegistry::getView()->entered = $entered;\n\t\t\tChibiRegistry::getHelper('mg')->log('Wrong password: ' . $entered);\n\t\t}\n\t}", "public function loginAction() {\n $user_session = new Container('user');\n $user_session->username = 'Andy0708';\n \n return $this->redirect()->toRoute('welcome');\n }", "private function _authRedirect() {\n $options = array('scope' => $this->settings['permissions']);\n if (!empty($this->settings['appUrl'])) {\n $options['redirect_uri'] = $this->settings['appUrl'];\n }\n $url = $this->facebook->getLoginUrl($options);\n echo \"<script type=\\\"text/javascript\\\">top.location.href = '$url';</script>\";\n exit;\n }", "public function redirect_if_logged_in()\n {\n Session::_start();\n if(isset($_SESSION['user']))\n {\n header('location: ' . URL_WITH_INDEX_FILE . 'results/index');\n exit();\n }\n }" ]
[ "0.851756", "0.8308398", "0.82841724", "0.81350154", "0.8064592", "0.7823407", "0.7817286", "0.77881527", "0.776401", "0.7717194", "0.77144754", "0.76863575", "0.7644845", "0.76152974", "0.7578504", "0.7565321", "0.75301105", "0.7499114", "0.74559516", "0.7453929", "0.74442416", "0.74431586", "0.7411646", "0.74058944", "0.7346335", "0.7335823", "0.73294455", "0.73081625", "0.73073363", "0.7305541", "0.7280243", "0.7273783", "0.7268233", "0.7259509", "0.72513646", "0.72403735", "0.72282475", "0.7220599", "0.7210198", "0.7202748", "0.72005445", "0.7197835", "0.7194526", "0.7187717", "0.71855956", "0.7179359", "0.7174052", "0.7132023", "0.7131874", "0.7129942", "0.712899", "0.7123879", "0.7122964", "0.71216404", "0.7117273", "0.7114405", "0.7108486", "0.70994467", "0.7093531", "0.70868903", "0.7085094", "0.7076713", "0.7075624", "0.7067381", "0.7066057", "0.70617294", "0.7059823", "0.7058838", "0.7057791", "0.70570135", "0.70453835", "0.7036316", "0.70334303", "0.70334303", "0.7033235", "0.7029914", "0.70282596", "0.7027348", "0.7026258", "0.7026258", "0.7026258", "0.7026258", "0.7026258", "0.7026258", "0.7026258", "0.7026258", "0.7026228", "0.7025916", "0.70250493", "0.70215136", "0.70195615", "0.70176446", "0.70068234", "0.699806", "0.6991998", "0.6989103", "0.6987998", "0.69838506", "0.69830465", "0.69822675", "0.698128" ]
0.0
-1
Handle an incoming request.
public function handle($request, Closure $next) { switch ($request->user()->userrole) { case '1': return redirect(generateLangugeUrlAdmin(App::getLocale(), url('/dashboard'))); break; case '2': return redirect(generateLangugeUrl(App::getLocale(), url('/teacher/dashboard'))); break; case '3': return redirect(generateLangugeUrl(App::getLocale(), url('/home'))); break; case '4': return redirect(generateLangugeUrl(App::getLocale(), url('/schooldistrict/dashboard'))); break; case '5': return redirect(generateLangugeUrl(App::getLocale(), url('/portaladmin/dashboard'))); break; case '6': return redirect(generateLangugeUrl(App::getLocale(), url('/school/dashboard'))); break; } return $next($request); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function handle_request();", "public function handleRequest();", "public function handleRequest();", "public function handleRequest();", "protected abstract function handleRequest();", "abstract public function handleRequest($request);", "abstract public function handleRequest(Request $request);", "public function handle($request);", "public function handleRequest() {}", "function handleRequest() ;", "public function handle(Request $request);", "protected function handle(Request $request) {}", "public function handle(array $request);", "public function process_request() {\n if(!empty($this->POST)) {\n return $this->handlePOST();\n } else {\n return $this->handleGET();\n }\n }", "public function handleRequest() {\n // Make sure the action parameter exists\n $this->requireParam('action');\n\n // Call the correct handler based on the action\n switch($this->requestBody['action']) {\n\n case 'checkoutLocker':\n $this->handleCheckoutLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'remindLocker':\n $this->handleRemindLocker();\n\t\t\t\tbreak;\n\n\t\t\tcase 'returnLocker':\n $this->handleReturnLocker();\n\t\t\t\tbreak;\n\n default:\n $this->respond(new Response(Response::BAD_REQUEST, 'Invalid action on Locker resource'));\n }\n }", "abstract protected function process(Request $request);", "public function handleRequest($request)\n {\n list ($route, $params) = $request->resolve();\n $this->requestedRoute = $route;\n $result = $this->runAction($route, $params);\n\n if ($result instanceof Response) {\n return $result;\n } elseif ($result instanceof Looper){\n $result->loop();\n\n $response = $this->getResponse();\n $response->exitStatus = 0;\n\n return $response;\n } else {\n $response = $this->getResponse();\n $response->exitStatus = $result;\n\n return $response;\n }\n }", "abstract function handle(Request $request, $parameters);", "protected function handle_request() {\r\n global $wp;\r\n $film_query = $wp->query_vars['films'];\r\n \r\n if (!$film_query) { // send all films\r\n $raw_data = $this->get_all_films();\r\n }\r\n else if ($film_query == \"featured\") { // send featured films\r\n $raw_data = $this->get_featured_films();\r\n }\r\n else if (is_numeric($film_query)) { // send film of id\r\n $raw_data = $this->get_film_by_id($film_query);\r\n }\r\n else { // input error\r\n $this->send_response('Bad Input');\r\n }\r\n\r\n $all_data = $this->get_acf_data($raw_data);\r\n $this->send_response('200 OK', $all_data);\r\n }", "public function handle(ServerRequestInterface $request);", "public function handleRequest()\n {\n $route = $this->router->match();\n\n if ($route) {\n $controllerName = $route['target']['controllerName'];\n $methodName = $route['target']['methodName'];\n\n $controller = new $controllerName();\n\n $controller->$methodName($route['params']);\n } else {\n header(\"HTTP:1.0 404 not Found\");\n echo json_encode([\n \"error_code\" => 404,\n \"reason\" => \"page not found\"\n ]);\n }\n }", "function handle(Request $request = null, Response $response = null);", "public function processRequest();", "public abstract function processRequest();", "public function handleRequest(Request $request, Response $response);", "abstract public function processRequest();", "public function handle(array $request = []);", "public function handleRequest()\n {\n $router = new Router();\n $controllerClass = $router->resolve()->getController();\n $controllerAction = $router->getAction();\n\n \n\n if(!class_exists($controllerClass)\n || !method_exists($controllerClass,$controllerAction)\n ){\n header('Not found', true, 404);\n exit;\n }\n\n $controller = new $controllerClass();\n call_user_func([$controller, $controllerAction]);\n\n }", "public function handle(Request $request)\n {\n if ($request->header('X-GitHub-Event') === 'push') {\n return $this->handlePush($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'pull_request') {\n return $this->handlePullRequest($request->input());\n }\n\n if ($request->header('X-GitHub-Event') === 'ping') {\n return $this->handlePing();\n }\n\n return $this->handleOther();\n }", "protected function _handle()\n {\n return $this\n ->_addData('post', $_POST)\n ->_addData('get', $_GET)\n ->_addData('server', $_SERVER)\n ->_handleRequestRoute();\n }", "public function processRequest() {\n $action = \"\";\n //retrieve action from client.\n if (filter_has_var(INPUT_GET, 'action')) {\n $action = filter_input(INPUT_GET, 'action');\n }\n\n switch ($action) {\n case 'login':\n $this->login(); \n break;\n case 'register':\n $this->register(); //list all articles\n break;\n case 'search':\n $this->search(); //show a form for an article\n break;\n case 'searchList':\n $this->searchList();\n break;\n case 'remove':\n $this->removeArticle();\n break;\n case 'modify':\n $this->modifyArticle();\n break;\n case 'listCategoryForm':\n $this->listCategoryForm();\n break;\n case 'listCategory':\n $this->listCategory();\n break;\n default :\n break;\n }\n }", "public static function handleRequest($request)\r\n {\r\n // Load controller for requested resource\r\n $controllerName = ucfirst($request->getRessourcePath()) . 'Controller';\r\n\r\n if (class_exists($controllerName))\r\n {\r\n $controller = new $controllerName();\r\n\r\n // Get requested action within controller\r\n $actionName = strtolower($request->getHTTPVerb()) . 'Action';\r\n\r\n if (method_exists($controller, $actionName))\r\n {\r\n // Do the action!\r\n $result = $controller->$actionName($request);\r\n\r\n // Send REST response to client\r\n $outputHandlerName = ucfirst($request->getFormat()) . 'OutputHandler';\r\n\r\n if (class_exists($outputHandlerName))\r\n {\r\n $outputHandler = new $outputHandlerName();\r\n $outputHandler->render($result);\r\n }\r\n }\r\n }\r\n }", "public function process(Request $request, Response $response, RequestHandlerInterface $handler);", "public function handle(Request $request)\n {\n $handler = $this->router->match($request);\n if (!$handler) {\n echo \"Could not find your resource!\\n\";\n return;\n }\n\n return $handler();\n }", "public function handleRequest() {\n\t\t\n\t\tif (is_null($this->itemObj)) {\n\t\t\t$this->itemObj = MovieServices::getVcdByID($this->getParam('vcd_id'));\n\t\t}\n\t\t\n\t\t$action = $this->getParam('action');\n\t\t\n\t\tswitch ($action) {\n\t\t\tcase 'upload':\n\t\t\t\t$this->uploadImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 'fetch':\n\t\t\t\t$this->fetchImages();\n\t\t\t\t// reload and close upon success\n\t\t\t\tredirect('?page=addscreens&vcd_id='.$this->itemObj->getID().'&close=true');\n\t\t\t\tbreak;\n\t\t\n\t\t\tdefault:\n\t\t\t\tredirect();\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function handle(Request $request): Response;", "public static function process_http_request()\n {\n }", "public function processRequest() {\r\n switch($this->requestMethod) {\r\n case 'GET':\r\n if($this->id) {\r\n $response = $this->get($this->id);\r\n }\r\n else {\r\n $response = $this->getAll();\r\n }\r\n break;\r\n case 'POST':\r\n $response = $this->create();\r\n break;\r\n case 'PUT':\r\n $response = $this->update($this->id);\r\n break;\r\n case 'DELETE':\r\n $response = $this->delete($this->id);\r\n break;\r\n case 'OPTIONS':\r\n break;\r\n default:\r\n $response = $this->notFoundResponse();\r\n break;\r\n }\r\n\r\n header($response['status_code_header']);\r\n\r\n // If there is a body then echo it\r\n if($response['body']) {\r\n echo $response['body'];\r\n }\r\n }", "abstract public function handle(ServerRequestInterface $request): ResponseInterface;", "public function processRequest()\n\t\t{\n\t\t\t$request_method = strtolower($_SERVER['REQUEST_METHOD']);\n\t\t\tswitch ($request_method)\n\t\t\t{\n\t\t\t\tcase 'get':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'post':\n\t\t\t\t\t$data = $_GET['url'];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t$request_parts = explode('/', $data);\n\t\t\t$controller = $request_parts[0];\n\t\t\tswitch ($controller)\n\t\t\t{\n\t\t\t\tcase 'ad':\n\t\t\t\t\tprocessAdRequest(substr($data, strlen('ad')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'category':\n\t\t\t\t\tprocessCategoryRequest(substr($data, strlen('category')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user':\n\t\t\t\t\tprocessUserRequest(substr($data, strlen('user')+1));\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\techo \"Invalid Request!\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}", "function handleRequest (&$request, &$context) {\n\n\t\t/* cycle through our process callback queue. using each() vs.\n\t\t * foreach, etc. so we may add elements to the callback array\n\t\t * later. probably primarily used for conditional callbacks. */\n\t\treset ($this->_processCallbacks);\n\t\twhile ($c = each ($this->_processCallbacks)) {\n\n\t\t\t// test for a successful view dispatch\n\t\t\tif ($this->_processProcess ($this->_processCallbacks[$c['key']],\n\t\t\t $request,\n\t\t\t $context))\n\t\t\t\treturn;\n\t\t}\n\n\t\t// if no view has been found yet attempt our default\n\t\tif ($this->defaultViewExists ())\n\t\t\t$this->renderDefaultView ($request, $context);\n\t}", "public function handle($request, $next);", "public function handle(): void\n {\n $globals = $_SERVER;\n //$SlimPsrRequest = ServerRequestFactory::createFromGlobals();\n //it doesnt matters if the Request is of different class - no need to create Guzaba\\Http\\Request\n $PsrRequest = ServerRequestFactory::createFromGlobals();\n //the only thing that needs to be fixed is the update the parsedBody if it is NOT POST & form-fata or url-encoded\n\n\n //$GuzabaPsrRequest =\n\n //TODO - this may be reworked to reroute to a new route (provided in the constructor) instead of providing the actual response in the constructor\n $DefaultResponse = $this->DefaultResponse;\n //TODO - fix the below\n// if ($PsrRequest->getContentType() === ContentType::TYPE_JSON) {\n// $DefaultResponse->getBody()->rewind();\n// $structure = ['message' => $DefaultResponse->getBody()->getContents()];\n// $json_string = json_encode($structure, JSON_UNESCAPED_SLASHES);\n// $StreamBody = new Stream(null, $json_string);\n// $DefaultResponse = $DefaultResponse->\n// withBody($StreamBody)->\n// withHeader('Content-Type', ContentType::TYPES_MAP[ContentType::TYPE_JSON]['mime'])->\n// withHeader('Content-Length', (string) strlen($json_string));\n// }\n\n $FallbackHandler = new RequestHandler($DefaultResponse);//this will produce 404\n $QueueRequestHandler = new QueueRequestHandler($FallbackHandler);//the default response prototype is a 404 message\n foreach ($this->middlewares as $Middleware) {\n $QueueRequestHandler->add_middleware($Middleware);\n }\n $PsrResponse = $QueueRequestHandler->handle($PsrRequest);\n $this->emit($PsrResponse);\n\n }", "public function HandleRequest(Request $request)\r\n {\r\n $command = $this->_commandResolver->GetCommand($request);\t// Create command object for Request\r\n $response = $command->Execute($request);\t\t\t\t\t// Execute the command to get response\r\n $view = ApplicationController::GetView($response);\t\t\t\t\t// Send response to the appropriate view for display\r\n $view->Render();\t\t\t\t\t\t\t\t\t\t\t// Display the view\r\n }", "public function process($path, Request $request);", "public function handle(string $query, ServerRequestInterface $request);", "public function handleRequest()\n\t{\n\t\t$fp = $this->fromRequest();\n\t\treturn $fp->render();\n\t}", "private function _processRequest()\n\t{\n\t\t// prevent unauthenticated access to API\n\t\t$this->_secureBackend();\n\n\t\t// get the request\n\t\tif (!empty($_REQUEST)) {\n\t\t\t// convert to object for consistency\n\t\t\t$this->request = json_decode(json_encode($_REQUEST));\n\t\t} else {\n\t\t\t// already object\n\t\t\t$this->request = json_decode(file_get_contents('php://input'));\n\t\t}\n\n\t\t//check if an action is sent through\n\t\tif(!isset($this->request->action)){\n\t\t\t//if no action is provided then reply with a 400 error with message\n\t\t\t$this->reply(\"No Action Provided\", 400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n\n\t\t//check if method for the action exists\n\t\tif(!method_exists($this, $this->request->action)){\n\t\t\t//if method doesn't exist, send 400 code and message with reply'\n\t\t\t$this->reply(\"Action method not found\",400);\n\t\t\t//kill script\n\t\t\texit();\n\t\t}\n \n\t\tswitch($this->request->action){\n\t\t\tcase \"hello\":\n\t\t\t\t$this->hello($this->request->data);\n\t\t\t\tbreak;\n\t\t\tcase \"submit_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->submit_video($this->request, $_FILES);\n\t\t\t\tbreak;\n\t\t\tcase \"remove_video\":\n\t\t\t\t//error_log(\"formSubmit has been sent through\");\n\t\t\t\t$this->remove_video($this->request);\n\t\t\t\tbreak;\n\t\t\tcase \"isSubmitted\":\n\t\t\t\t$this->isSubmitted($this->request);\n\t\t\tdefault:\n\t\t\t\t$this->reply(\"action switch failed\",400);\n\t\t\tbreak;\n\t\t}\n\n\n\n\t}", "public function handleRequest ()\n\t{\n\t\t$this->version = '1.0';\n\t\t$this->id = NULL;\n\n\t\tif ($this->getProperty(self::PROPERTY_ENABLE_EXTRA_METHODS))\n\t\t\t$this->publishExtraMethods();\n\n\t\tif ($_SERVER['REQUEST_METHOD'] == 'POST')\n\t\t{\n\n\t\t\t$json = file_get_contents('php://input');\n\t\t\t$request = \\json_decode($json);\n\n\t\t\tif (is_array($request))\n\t\t\t{\n\t\t\t\t// Multicall\n\t\t\t\t$this->version = '2.0';\n\n\t\t\t\t$response = array();\n\t\t\t\tforeach ($request as $singleRequest)\n\t\t\t\t{\n\t\t\t\t\t$singleResponse = $this->handleSingleRequest($singleRequest, TRUE);\n\t\t\t\t\tif ($singleResponse !== FALSE)\n\t\t\t\t\t\t$response[] = $singleResponse;\n\t\t\t\t}\n\n\t\t\t\t// If all methods in a multicall are notifications, we must not return an empty array\n\t\t\t\tif (count($response) == 0)\n\t\t\t\t\t$response = FALSE;\n\t\t\t}\n\t\t\telse if (is_object($request))\n\t\t\t{\n\t\t\t\t$this->version = $this->getRpcVersion($request);\n\t\t\t\t$response = $this->handleSingleRequest($request);\n\t\t\t}\n\t\t\telse\n\t\t\t\t$response = $this->formatError(self::ERROR_INVALID_REQUEST);\n\t\t}\n\t\telse if ($_SERVER['PATH_INFO'] != '')\n\t\t{\n\t\t\t$this->version = '1.1';\n\t\t\t$this->id = NULL;\n\n\t\t\t$method = substr($_SERVER['PATH_INFO'], 1);\n\t\t\t$params = $this->convertFromRpcEncoding($_GET);\n\n\t\t\tif (!$this->hasMethod($method))\n\t\t\t\t$response = $this->formatError(self::ERROR_METHOD_NOT_FOUND);\n\t\t\telse\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\tRpcResponse::setWriter(new JsonRpcResponseWriter($this->version, $this->id));\n\t\t\t\t\t$res = $this->invoke($method, $params);\n\t\t\t\t\tif ($res instanceof JsonRpcResponseWriter)\n\t\t\t\t\t{\n\t\t\t\t\t\t$res->finalize();\n\t\t\t\t\t\t$resposne = FALSE;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$response = $this->formatResult($res);\n\t\t\t\t}\n\t\t\t\tcatch (\\Exception $exception)\n\t\t\t\t{\n\t\t\t\t\t$response = $this->formatException($exception);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$response = $this->formatError(self::ERROR_PARSE_ERROR);\n\t\t}\n\n\t\tif (!headers_sent())\n\t\t{\n\t\t\theader('Content-Type: application/json', TRUE);\n\t\t\theader('Cache-Control: nocache', TRUE);\n\t\t\theader('Pragma: no-cache', TRUE);\n\t\t}\n\n\t\tif ($response !== FALSE)\n\t\t{\n\t\t\t$result = \\json_encode($this->convertToRpcEncoding($response));\n\n\t\t\tif ($result === FALSE)\n\t\t\t\terror_log(var_export($response, TRUE));\n\t\t\telse\n\t\t\t\techo($result);\n\t\t}\n\t}", "public function handle($request)\n {\n $this->setRouter($this->app->compose('Cygnite\\Base\\Router\\Router', $request), $request);\n\n try {\n $response = $this->sendRequestThroughRouter($request);\n /*\n * Check whether return value is a instance of Response,\n * otherwise we will try to fetch the response form container,\n * create a response and return to the browser.\n *\n */\n if (!$response instanceof ResponseInterface && !is_array($response)) {\n $r = $this->app->has('response') ? $this->app->get('response') : '';\n $response = Response::make($r);\n }\n } catch (\\Exception $e) {\n $this->handleException($e);\n } catch (Throwable $e) {\n $this->handleException($e);\n }\n\n return $response;\n }", "public function handleRequest()\n\t{\n $response = array();\n switch ($this->get_server_var('REQUEST_METHOD')) \n {\n case 'OPTIONS':\n case 'HEAD':\n $response = $this->head();\n break;\n case 'GET':\n $response = $this->get();\n break;\n case 'PATCH':\n case 'PUT':\n case 'POST':\n $response = $this->post();\n break;\n case 'DELETE':\n $response = $this->delete();\n break;\n default:\n $this->header('HTTP/1.1 405 Method Not Allowed');\n }\n\t\treturn $response;\n }", "public function handleRequest(Zend_Controller_Request_Http $request)\n {\n \n }", "final public function handle(Request $request)\n {\n $response = $this->process($request);\n if (($response === null) && ($this->successor !== null)) {\n $response = $this->successor->handle($request);\n }\n\n return $response;\n }", "public function process(Aloi_Serphlet_Application_HttpRequest $request, Aloi_Serphlet_Application_HttpResponse $response) {\r\n\r\n\t\ttry {\r\n\t\t\t// Identify the path component we will use to select a mapping\r\n\t\t\t$path = $this->processPath($request, $response);\r\n\t\t\tif (is_null($path)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (self::$log->isDebugEnabled()) {\r\n\t\t\t\tself::$log->debug('Processing a \"' . $request->getMethod() . '\" for path \"' . $path . '\"');\r\n\t\t\t}\r\n\r\n\t\t\t// Select a Locale for the current user if requested\r\n\t\t\t$this->processLocale($request, $response);\r\n\r\n\t\t\t// Set the content type and no-caching headers if requested\r\n\t\t\t$this->processContent($request, $response);\r\n\t\t\t$this->processNoCache($request, $response);\r\n\r\n\t\t\t// General purpose preprocessing hook\r\n\t\t\tif (!$this->processPreprocess($request, $response)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t//Identify the mapping for this request\r\n\t\t\t$mapping = $this->processMapping($request, $response, $path);\r\n\t\t\tif (is_null($mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Check for any role required to perform this action\r\n\t\t\tif (!$this->processRoles($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process any ActionForm bean related to this request\r\n\t\t\t$form = $this->processActionForm($request, $response, $mapping);\r\n\t\t\t$this->processPopulate($request, $response, $form, $mapping);\r\n\t\t\tif (!$this->processValidate($request, $response, $form, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Process a forward or include specified by this mapping\r\n\t\t\tif (!$this->processForward($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (!$this->processInclude($request, $response, $mapping)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Create or acquire the Action instance to process this request\r\n\t\t\t$action = $this->processActionCreate($request, $response, $mapping);\r\n\t\t\tif (is_null($action)) {\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\t// Call the Action instance itself\r\n\t\t\t$forward = $this->processActionPerform($request, $response, $action, $form, $mapping);\r\n\r\n\t\t\t// Process the returned ActionForward instance\r\n\t\t\t$this->processForwardConfig($request, $response, $forward);\r\n\t\t} catch (ServletException $e) {\r\n\t\t\tthrow $e;\r\n\t\t}\r\n\t}", "function handleRequest() {\n // I. On récupère l'action demandée par l'utilisateur, avec retrocompatibilité\n // Controller et Entité\n $entityName = (isset($_GET['controller']) ? $_GET['controller'] : \"article\");\n // on retravaille le nom pour obtenir un nom de la forme \"Article\"\n $entityName = ucfirst(strtolower($entityName));\n\n // Action\n $actionName = (isset($_GET['action']) ? $_GET['action'] : \"index\");\n $actionName = strtolower($actionName);\n\n // II à IV sont maintenant dans loadDep\n $controller = $this->loadDependencies($entityName);\n\n // V. On regarde si l'action de controller existe, puis on la charge\n // on retravaille la var obtenue pour obtenir un nom de la forme \"indexAction\"\n $action = $actionName . \"Action\";\n\n // si la méthode demandée n'existe pas, remettre \"index\"\n if (!method_exists($controller, $action)) {\n $actionName = \"index\";\n $action = \"indexAction\";\n }\n\n // on stock le titre sous la forme \"Article - Index\"\n $this->title = $entityName . \" - \" . $actionName;\n\n // on appelle dynamiquement la méthode de controller\n $this->content = $controller->$action();\n }", "public function handle(RequestInterface $request): ResponseInterface;", "public function handleRequest() {\n $this->loadErrorHandler();\n\n $this->sanitizeRequest();\n $this->modx->invokeEvent('OnHandleRequest');\n if (!$this->modx->checkSiteStatus()) {\n header('HTTP/1.1 503 Service Unavailable');\n if (!$this->modx->getOption('site_unavailable_page',null,1)) {\n $this->modx->resource = $this->modx->newObject('modDocument');\n $this->modx->resource->template = 0;\n $this->modx->resource->content = $this->modx->getOption('site_unavailable_message');\n } else {\n $this->modx->resourceMethod = \"id\";\n $this->modx->resourceIdentifier = $this->modx->getOption('site_unavailable_page',null,1);\n }\n } else {\n $this->checkPublishStatus();\n $this->modx->resourceMethod = $this->getResourceMethod();\n $this->modx->resourceIdentifier = $this->getResourceIdentifier($this->modx->resourceMethod);\n if ($this->modx->resourceMethod == 'id' && $this->modx->getOption('friendly_urls', null, false) && !$this->modx->getOption('request_method_strict', null, false)) {\n $uri = $this->modx->context->getResourceURI($this->modx->resourceIdentifier);\n if (!empty($uri)) {\n if ((integer) $this->modx->resourceIdentifier === (integer) $this->modx->getOption('site_start', null, 1)) {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL);\n } else {\n $url = $this->modx->getOption('site_url', null, MODX_SITE_URL) . $uri;\n }\n $this->modx->sendRedirect($url, array('responseCode' => 'HTTP/1.1 301 Moved Permanently'));\n }\n }\n }\n if (empty ($this->modx->resourceMethod)) {\n $this->modx->resourceMethod = \"id\";\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $this->modx->resourceIdentifier = $this->_cleanResourceIdentifier($this->modx->resourceIdentifier);\n }\n if ($this->modx->resourceMethod == \"alias\") {\n $found = $this->findResource($this->modx->resourceIdentifier);\n if ($found) {\n $this->modx->resourceIdentifier = $found;\n $this->modx->resourceMethod = 'id';\n } else {\n $this->modx->sendErrorPage();\n }\n }\n $this->modx->beforeRequest();\n $this->modx->invokeEvent(\"OnWebPageInit\");\n\n if (!is_object($this->modx->resource)) {\n if (!$this->modx->resource = $this->getResource($this->modx->resourceMethod, $this->modx->resourceIdentifier)) {\n $this->modx->sendErrorPage();\n return true;\n }\n }\n\n return $this->prepareResponse();\n }", "public function process(\n ServerRequestInterface $request,\n RequestHandlerInterface $handler\n );", "protected function handleRequest() {\n\t\t// TODO: remove conditional when we have a dedicated error render\n\t\t// page and move addModule to Mustache#getResources\n\t\tif ( $this->adapter->getFormClass() === 'Gateway_Form_Mustache' ) {\n\t\t\t$modules = $this->adapter->getConfig( 'ui_modules' );\n\t\t\tif ( !empty( $modules['scripts'] ) ) {\n\t\t\t\t$this->getOutput()->addModules( $modules['scripts'] );\n\t\t\t}\n\t\t\tif ( $this->adapter->getGlobal( 'LogClientErrors' ) ) {\n\t\t\t\t$this->getOutput()->addModules( 'ext.donationInterface.errorLog' );\n\t\t\t}\n\t\t\tif ( !empty( $modules['styles'] ) ) {\n\t\t\t\t$this->getOutput()->addModuleStyles( $modules['styles'] );\n\t\t\t}\n\t\t}\n\t\t$this->handleDonationRequest();\n\t}", "public function handleHttpRequest($requestParams)\n\t{\n\t\t$action = strtolower(@$requestParams[self::REQ_PARAM_ACTION]);\t\t\n\t\t$methodName = $this->actionToMethod($action);\n\t\t\n\t\ttry\n\t\t{\n\t\t\t$this->$methodName($requestParams);\n\t\t} catch(Exception $e)\n\t\t{\n\t\t\techo \"Error: \".$e->getMessage();\n\t\t}\n\t}", "public static function handleRequest()\n\t{\n\t\t// Load language strings\n\t\tself::loadLanguage();\n\n\t\t// Load the controller and let it run the show\n\t\trequire_once dirname(__FILE__).'/classes/controller.php';\n\t\t$controller = new LiveUpdateController();\n\t\t$controller->execute(JRequest::getCmd('task','overview'));\n\t\t$controller->redirect();\n\t}", "public function handle() {\n $this->initDb(((!isset(self::$_config['db']['type'])) ? 'mysql' : self::$_config['db']['type']));\n $request = new corelib_request(self::$_config['routing'], self::$_config['reg_routing']);\n $path = parse_url($_SERVER['REQUEST_URI']);\n\n if (self::$_config['home'] == \"/\" || self::$_config['home'] == \"\") {\n $uri = ltrim($path['path'], '/');\n } else {\n $uri = str_replace(self::$_config['home'], '', $path['path']);\n }\n\n if (\"\" == $uri || \"/\" == $uri) {\n $uri = self::$_config['routing']['default']['controller'] . '/' . self::$_config['routing']['default']['action'];\n }\n self::$isAjax = $request->isAjax();\n self::$request = $request->route($uri);\n self::$request['uri'] = $uri;\n\n if (self::$request['action'] == \"\")\n self::$request['action'] = self::$_config['routing']['default']['action'];\n\n $this->_run( self::$request['params'] );\n }", "public function processRequest() {\n $this->server->service($GLOBALS['HTTP_RAW_POST_DATA']);\n }", "public function request_handler(){\r\n\t\t$route = new Router;\r\n\t\t$session = new Session;\r\n\t\t$segments = $route->urlRoute();\r\n\t\t#check if controller/action exist\r\n\t\t#if not use default_controller / default_action\r\n\t\tif( count($segments) == 0 || count($segments) == 1 ){\r\n\t\t\tinclude_class_method( default_controller , default_action );\r\n\t\t}else{\r\n\t\t#if controller/action exist in the url\r\n\t\t#then check the controller if it's existed in the file\r\n\t\t\tif( file_exists( CONTROLLER_DIR . $segments[0] . CONT_EXT ) )\r\n\t\t\t{\r\n\t\t\t\t#check for segments[1] = actions\r\n\t\t\t\t#if segments[1] exist, logically segments[0] which is the controller is also exist!!\r\n\t\t\t\t//if( isset($segments[1]) ){\r\n\t\t\t\t\tinclude_class_method( $segments[0], $segments[1] . 'Action' );\r\n\t\t\t\t//}\r\n\t\t\t}else{\r\n\t\t\t\terrorHandler(CONTROLLER_DIR . $segments[0] . CONT_EXT);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function handle() {\n if(method_exists($this->class, $this->function)) {\n echo $this->class->{$this->function}($this->request);\n }else {\n echo Response::response(['error' => 'function does not exist on ' . get_class($this->class)], 500);\n }\n }", "public function handle(ClientInterface $client, RequestInterface $request, HttpRequest $httpRequest);", "public function handleRequest() {\n $questions=$this->contactsService->getAllQuestions(\"date\");\n //load all the users\n $userList = User::loadUsers();\n //load all the topics\n \t\t$topics = $this->contactsService2->getAllTopics(\"name\");\n \t\t\n\t\t\t\trequire_once '../view/home.tpl';\n\t}", "public function serve_request()\n {\n }", "public static function process($request){\r\n\t\tcall_user_func($request -> action, $request -> params);\r\n\t}", "function process($request) {\n\t//$logFusion =& LoggerManager::getLogger('fusion');\n//PBXFusion begin\n\t$request=$this->mapRequestVars($request);\n $mode = $request->get('callstatus');\n\t//$logFusion->debug(\"PBX CONTROLLER PROCESS mode=\".$mode);\n//PBXFusion end\n switch ($mode) {\n\t//PBXFusion begin\n \t case \"CallStart\" :\n $this->processCallStart($request);\n break;\n\t//PBXFusion end\n case \"StartApp\" :\n $this->processStartupCallFusion($request);\n break;\n case \"DialAnswer\" :\n $this->processDialCallFusion($request);\n break;\n case \"Record\" :\n $this->processRecording($request);\n break;\n case \"EndCall\" :\n $this->processEndCallFusion($request);\n break;\n case \"Hangup\" :\n $callCause = $request->get('causetxt');\n if ($callCause == \"null\") {\n break;\n }\n $this->processHangupCall($request);\n break;\n }\n }", "public function handle() {\n\t\n\t\t$task = $this->request->getTask();\n\t\t$handler = $this->resolveHandler($task);\n\t\t$action = $this->request->getAction();\n\t\t$method = empty($action) ? $this->defaultActionMethod : $action.$this->actionMethodSuffix;\n\t\t\n\t\tif (! method_exists($handler, $method)) {\n\t\t\tthrow new Task\\NotHandledException(\"'{$method}' method not found on handler.\");\n\t\t}\n\t\t\n\t\t$handler->setRequest($this->request);\n\t\t$handler->setIo($this->io);\n\t\t\n\t\treturn $this->invokeHandler($handler, $method);\n\t}", "private function handleCall() { //$this->request\n $err = FALSE;\n // route call to method\n $this->logToFile($this->request['action']);\n switch($this->request['action']) {\n // Edit form submitted\n case \"edit\":\n // TODO: improve error handling\n try {\n $this->logToFile(\"case: edit\");\n $this->edit($this->request['filename']);\n //$this->save();\n } catch (Exception $e) {\n $err = \"Something went wrong: \";\n $err .= $e.getMessage();\n }\n break;\n }\n // TODO: set error var in response in case of exception / error\n // send JSON response\n if($err !== FALSE) {\n $this->request['error_msg'] = $err;\n }\n $this->giveJSONResponse($this->request);\n }", "function handle()\n {\n $this->verifyPost();\n\n $postTarget = $this->determinePostTarget();\n\n $this->filterPostData();\n\n switch ($postTarget) {\n case 'upload_media':\n $this->handleMediaFileUpload();\n break;\n case 'feed':\n $this->handleFeed();\n break;\n case 'feed_media':\n $this->handleFeedMedia();\n break;\n case 'feed_users':\n $this->handleFeedUsers();\n break;\n case 'delete_media':\n $this->handleDeleteMedia();\n break;\n }\n }", "public function run() {\n\t\t// If this particular request is not a hook, something is wrong.\n\t\tif (!isset($this->server[self::MERGADO_HOOK_AUTH_HEADER])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s is to be used only for handling hooks sent from Mergado.\n\t\t\t\tMergado-Apps-Hook-Auth is missing.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t}\n\n\t\tif (!$decoded = json_decode($this->rawRequest, true)) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle request, because the data to be handled is empty.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t} elseif (!isset($decoded['action'])) {\n\t\t\tthrow new \\RuntimeException(sprintf(\n\t\t\t\t\"%s cannot handle the hook, because the hook action is undefined.\",\n\t\t\t\t__CLASS__\n\t\t\t));\n\t\t};\n\n\t\t$this->handle($decoded['action'], $decoded);\n\n\t}", "public function handleRequest()\n {\n $version = $this->versionEngine->getVersion();\n $queryConfiguration = $version->parseRequest($this->columnConfigurations);\n $this->provider->prepareForProcessing($queryConfiguration, $this->columnConfigurations);\n $data = $this->provider->process();\n return $version->createResponse($data, $queryConfiguration, $this->columnConfigurations);\n }", "public function process()\n\t{\n\t\t$action = $this->getAction();\n\t\tswitch (strtolower($action))\n\t\t{\n\t\t\tcase 'get':\n\t\t\tcase 'put':\n\t\t\tcase 'post':\n\t\t\tcase 'delete':\n\t\t}\t\n\t}", "public function run(){\n // server response object \n $requestMethod = $this->requestBuilder->getRequestMethod();\n $this->response = new Response($requestMethod);\n\n try{\n $route = $this->router->validateRequestedRoute($this->requestBuilder);\n\n // serve request object\n $this->requestBuilder->setQuery();\n $this->requestBuilder->setBody();\n $requestParams = $this->requestBuilder->getParam();\n $requestQuery = $this->requestBuilder->getQuery();\n $requestBody = $this->requestBuilder->getBody(); \n $this->request = new Request($requestParams, $requestQuery, $requestBody);\n\n $callback = $route->getCallback();\n $callback($this->request, $this->response);\n }catch(RouteNotImplementedException $e){\n $this->response->statusCode(404)->json($e->getMessage()); \n }\n \n }", "final public function handle()\n {\n \n $this->_preHandle();\n \n if ($this->_request->getActionName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the action name.');\n }\n\n if ($this->_request->getProviderName() == null) {\n throw new ZendL_Tool_Endpoint_Exception('Endpoint failed to setup the provider name.');\n }\n \n ob_start();\n \n try {\n $dispatcher = new ZendL_Tool_Rpc_Endpoint_Dispatcher();\n $dispatcher->setRequest($this->_request)\n ->setResponse($this->_response)\n ->dispatch();\n \n } catch (Exception $e) {\n //@todo implement some sanity here\n die($e->getMessage());\n //$this->_response->setContent($e->getMessage());\n return;\n }\n \n if (($content = ob_get_clean()) != '') {\n $this->_response->setContent($content);\n }\n \n $this->_postHandle();\n }", "public function RouteRequest ();", "public function handle(ServerRequestInterface $request, $handler, array $vars): ?ResponseInterface;", "public function DispatchRequest ();", "protected function handleRequest() {\n\t\t// FIXME: is this necessary?\n\t\t$this->getOutput()->allowClickjacking();\n\t\tparent::handleRequest();\n\t}", "public function listen() {\n\t\t// Checks the user agents match\n\t\tif ( $this->user_agent == $this->request_user_agent ) {\n\t\t\t// Determine if a key request has been made\n\t\t\tif ( isset( $_GET['key'] ) ) {\n\t\t\t\t$this->download_update();\n\t\t\t} else {\n\t\t\t\t// Determine the action requested\n\t\t\t\t$action = filter_input( INPUT_POST, 'action', FILTER_SANITIZE_STRING );\n\n\t\t\t\t// If that method exists, call it\n\t\t\t\tif ( method_exists( $this, $action ) )\n\t\t\t\t\t$this->{$action}();\n\t\t\t}\n\t\t}\n\t}", "abstract public function request();", "public function run() {\r\n $this->routeRequest(new Request());\r\n }", "public function processAction(Request $request)\n {\n // Get the request Vars\n $this->requestQuery = $request->query;\n\n // init the hybridAuth instance\n $provider = trim(strip_tags($this->requestQuery->get('hauth_start')));\n $cookieName = $this->get('azine_hybrid_auth_service')->getCookieName($provider);\n $this->hybridAuth = $this->get('azine_hybrid_auth_service')->getInstance($request->cookies->get($cookieName), $provider);\n\n // If openid_policy requested, we return our policy document\n if ($this->requestQuery->has('get') && 'openid_policy' == $this->requestQuery->get('get')) {\n return $this->processOpenidPolicy();\n }\n\n // If openid_xrds requested, we return our XRDS document\n if ($this->requestQuery->has('get') && 'openid_xrds' == $this->requestQuery->get('get')) {\n return $this->processOpenidXRDS();\n }\n\n // If we get a hauth.start\n if ($this->requestQuery->has('hauth_start') && $this->requestQuery->get('hauth_start')) {\n return $this->processAuthStart();\n }\n // Else if hauth.done\n elseif ($this->requestQuery->has('hauth_done') && $this->requestQuery->get('hauth_done')) {\n return $this->processAuthDone($request);\n }\n // Else we advertise our XRDS document, something supposed to be done from the Realm URL page\n\n return $this->processOpenidRealm();\n }", "public function run() {\n $base = $this->request->getNextRoute();\n if ($base !== BASE) {\n $this->response->notFound();\n }\n $start = $this->request->getNextRoute();\n if ($rs = $this->getRs($start)) {\n if ($this->request->isOptions()) {\n $this->response->okEmpty();\n return;\n }\n try {\n $this->response->ok($rs->handleRequest());\n\n } catch (UnauthorizedException $e) {\n $this->response->unauthorized();\n\n } catch (MethodNotAllowedException $e) {\n $this->response->methodNotAllowed();\n\n } catch (BadRequestExceptionInterface $e) {\n $this->response->badRequest($e->getMessage());\n\n } catch (UnavailableExceptionInterface $e) {\n $this->response->unavailable($e->getMessage());\n\n } catch (Exception $e) {\n $this->response->unavailable($e->getMessage());\n }\n } else {\n $this->response->badRequest();\n }\n }", "public function handle(Request $request, Response|JsonResponse|BinaryFileResponse|StreamedResponse $response, int $length);", "public function handle(Request $request, Closure $next);", "public function handleGetRequest($id);", "abstract function doExecute($request);", "public function parseCurrentRequest()\n {\n // If 'action' is post, data will only be read from 'post'\n if ($action = $this->request->post('action')) {\n die('\"post\" method action handling not implemented');\n }\n \n $action = $this->request->get('action') ?: 'home';\n \n if ($response = $this->actionHandler->trigger($action, $this)) {\n $this->getResponder()->send($response);\n } else {\n die('404 not implemented');\n }\n }", "abstract public function mapRequest($request);", "public function handle(ServerRequestInterface $request)\n {\n $router = $this->app->get(RouterInterface::class);\n $response = $router->route($request);\n\n if (! headers_sent()) {\n\n // Status\n header(sprintf(\n 'HTTP/%s %s %s',\n $response->getProtocolVersion(),\n $response->getStatusCode(),\n $response->getReasonPhrase()\n ));\n\n // Headers\n foreach ($response->getHeaders() as $name => $values) {\n foreach ($values as $value) {\n header(sprintf('%s: %s', $name, $value), false);\n }\n }\n }\n\n echo $response->getBody()->getContents();\n }", "abstract public function processRequest(PriceWaiter_NYPWidget_Controller_Endpoint_Request $request);", "private function handleRequest()\n {\n // we check the inputs validity\n $validator = Validator::make($this->request->only('rowsNumber', 'search', 'sortBy', 'sortDir'), [\n 'rowsNumber' => 'required|numeric',\n 'search' => 'nullable|string',\n 'sortBy' => 'nullable|string|in:' . $this->columns->implode('attribute', ','),\n 'sortDir' => 'nullable|string|in:asc,desc',\n ]);\n // if errors are found\n if ($validator->fails()) {\n // we log the errors\n Log::error($validator->errors());\n // we set back the default values\n $this->request->merge([\n 'rowsNumber' => $this->rowsNumber ? $this->rowsNumber : config('tablelist.default.rows_number'),\n 'search' => null,\n 'sortBy' => $this->sortBy,\n 'sortDir' => $this->sortDir,\n ]);\n } else {\n // we save the request values\n $this->setAttribute('rowsNumber', $this->request->rowsNumber);\n $this->setAttribute('search', $this->request->search);\n }\n }", "public function handle() {\n\t\t\n\t\t\n\t\t\n\t\theader('ApiVersion: 1.0');\n\t\tif (!isset($_COOKIE['lg_app_guid'])) {\n\t\t\t//error_log(\"NO COOKIE\");\n\t\t\t//setcookie(\"lg_app_guid\", uniqid(rand(),true),time()+(10*365*24*60*60));\n\t\t} else {\n\t\t\t//error_log(\"cookie: \".$_COOKIE['lg_app_guid']);\n\t\t\t\n\t\t}\n\t\t// checks if a JSON-RCP request has been received\n\t\t\n\t\tif (($_SERVER['REQUEST_METHOD'] != 'POST' && (empty($_SERVER['CONTENT_TYPE']) || strpos($_SERVER['CONTENT_TYPE'],'application/json')===false)) && !isset($_GET['d'])) {\n\t\t\t\techo \"INVALID REQUEST\";\n\t\t\t// This is not a JSON-RPC request\n\t\t\treturn false;\n\t\t}\n\t\t\t\t\n\t\t// reads the input data\n\t\tif (isset($_GET['d'])) {\n\t\t\tdefine(\"WEB_REQUEST\",true);\n\t\t\t$request=urldecode($_GET['d']);\n\t\t\t$request = stripslashes($request);\n\t\t\t$request = json_decode($request, true);\n\t\t\t\n\t\t} else {\n\t\t\tdefine(\"WEB_REQUEST\",false);\n\t\t\t//error_log(file_get_contents('php://input'));\n\t\t\t$request = json_decode(file_get_contents('php://input'),true);\n\t\t\t//error_log(print_r(apache_request_headers(),true));\n\t\t}\n\t\t\n\t\terror_log(\"Method: \".$request['method']);\n\t\tif (!isset($this->exemptedMethods[$request['method']])) {\n\t\t\ttry {\n\t\t\t\t$this->authenticate();\n\t\t\t} catch (Exception $e) {\n\t\t\t\t$this->authenticated = false;\n\t\t\t\t$this->handleError($e);\n\t\t\t}\n\t\t} else {\n\t\t\t//error_log('exempted');\n\t\t}\n\t\ttrack_call($request);\n\t\t//error_log(\"RPC Method Called: \".$request['method']);\n\t\t\n\t\t//include the document containing the function being called\n\t\tif (!function_exists($request['method'])) {\n\t\t\t$path_to_file = \"./../include/methods/\".$request['method'].\".php\";\n\t\t\tif (file_exists($path_to_file)) {\n\t\t\t\tinclude $path_to_file;\n\t\t\t} else {\n\t\t\t\t$e = new Exception('Unknown method. ('.$request['method'].')', 404, null);\n \t$this->handleError($e);\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t// executes the task on local object\n\t\ttry {\n\t\t\t\n\t\t\t$result = @call_user_func($request['method'],$request['params']);\n\t\t\t\n\t\t\tif (!is_array($result) || !isset($result['result']) || $result['result']) {\n\t\t\t\t\n\t\t\t\tif (is_array($result) && isset($result['result'])) unset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'result' => $result,\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t );\n\t\t\t} else {\n\t\t\t\tunset($result['result']);\n\t\t\t\t\n\t\t\t\t$response = array (\n\t\t\t\t\t\t\t\t\t'jsonrpc' => '2.0',\n\t\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t\t'error' => $result\n\t\t\t\t\t\t\t\t );\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception $e) {\n\t\t\t\n\t\t\t$response = array (\n\t\t\t\t\t\t\t\t'id' => $request['id'],\n\t\t\t\t\t\t\t\t'result' => NULL,\n\t\t\t\t\t\t\t\t'error' => $e->getMessage()\n\t\t\t\t\t\t\t\t);\n\t\t\t\n\t\t}\n\t\t// output the response\n\t\tif (!empty($request['id'])) { // notifications don't want response\n\t\t\theader('content-type: text/javascript');\n\t\t\t//error_log(@print_r($response));\n\t\t\tif (isset($_GET['d'])) $str_response = $_GET['jsoncallback'].\"(\".str_replace('\\/','/',json_encode($response)).\")\";\n\t\t\telse $str_response = str_replace('\\/','/',json_encode($response));\n\t\t\t\n\t\t\tif ($_SERVER['SERVER_ADDR']=='192.168.1.6') {\n\t\t\t\t//error_log($str_response);\n\t\t\t}\n\t\t\techo $str_response;\n\t\t}\n\t\t\n\t\t\n\t\t// finish\n\t\treturn true;\n\t}", "protected function handle(Request $request)\n {\n return 1;\n }", "public function __invoke(Request $request, RequestHandler $handler) {\n R::setup('mysql:host=127.0.0.1;dbname=cellar','root','');\n \n $response = $handler->handle($request);\n R::close();\n return $response;\n }", "public function handle($req)\n {\n $params = $req->post ?: [];\n\n $files = $this->transformFiles($req->files);\n\n $cookies = $req->cookie ?: [];\n\n $server = $this->transformHeadersToServerVars(array_merge($req->header, [\n 'PATH_INFO' => array_get($req->server, 'path_info'),\n ]));\n $server['X_REQUEST_ID'] = Str::uuid()->toString();\n\n $requestUri = $req->server['request_uri'];\n if (isset($req->server['query_string']) && $req->server['query_string']) {\n $requestUri .= \"?\" . $req->server['query_string'];\n }\n\n $resp = $this->call(\n strtolower($req->server['request_method']),\n $requestUri, $params, $cookies, $files,\n $server, $req->rawContent()\n );\n\n return [\n 'status' => $resp->getStatusCode(),\n 'headers' => $resp->headers,\n 'body' => $resp->getContent(),\n ];\n }", "public function handle(Request $request)\n {\n $route_params = $this->_router->match($request->getUri());\n $route = $route_params['route'];\n $params = $route_params['params'];\n\n $func = reset($route) . self::CONTROLLER_METHOD_SUFIX;\n $class_name = key($route);\n $controller = new $class_name($request);\n\n $response = call_user_func_array(\n [\n $controller,\n $func,\n ],\n [$params]\n );\n\n if ($response instanceof Response) {\n return $response;\n } else {\n throw new InvalidHttpResponseException();\n }\n }" ]
[ "0.8299201", "0.8147294", "0.8147294", "0.8147294", "0.8127764", "0.7993589", "0.7927201", "0.7912899", "0.7899075", "0.76317674", "0.75089735", "0.7485808", "0.74074036", "0.7377414", "0.736802", "0.7294553", "0.72389543", "0.7230166", "0.72108", "0.71808434", "0.7170364", "0.71463037", "0.7126907", "0.7122795", "0.71225274", "0.7116879", "0.70607233", "0.6981947", "0.6966695", "0.69393975", "0.6912079", "0.68985975", "0.6887614", "0.68774897", "0.6806274", "0.67969805", "0.67778915", "0.6762979", "0.67565143", "0.67533374", "0.67192745", "0.6683243", "0.66487724", "0.66395754", "0.6634629", "0.66283566", "0.6617558", "0.6610097", "0.6610011", "0.6544976", "0.653806", "0.6512757", "0.64682734", "0.64381886", "0.6416964", "0.63373476", "0.63359964", "0.6334543", "0.63308066", "0.6321675", "0.63176167", "0.631661", "0.6310991", "0.63108873", "0.6295945", "0.6279438", "0.62778515", "0.62508965", "0.62422955", "0.62321424", "0.62237644", "0.6203428", "0.61954546", "0.6191255", "0.61774665", "0.61682004", "0.6151806", "0.61271876", "0.61257905", "0.6116093", "0.61126447", "0.6112368", "0.6101652", "0.60893977", "0.60871464", "0.60862815", "0.60734737", "0.60535145", "0.6028341", "0.60250086", "0.60224646", "0.6011745", "0.6011483", "0.60106593", "0.5998867", "0.5997086", "0.5991233", "0.59844923", "0.59668386", "0.5961315", "0.5954762" ]
0.0
-1
Display a listing of the resource.
public function index(Request $request) { return $this->users->index()->get(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Display the specified resource.
public function show(Request $request) { return $request->user(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show(Resena $resena)\n {\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function show()\n\t{\n\t\t\n\t}", "public function get_resource();", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "public function display() {\n echo $this->render();\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n {\n //\n $this->_show($id);\n }", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public abstract function display();", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "abstract public function resource($resource);", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8232636", "0.81890994", "0.68296117", "0.64987075", "0.649589", "0.64692974", "0.64633286", "0.63640857", "0.6307513", "0.6281809", "0.621944", "0.61926234", "0.61803305", "0.6173143", "0.61398774", "0.6119022", "0.61085826", "0.6106046", "0.60947937", "0.6078597", "0.6047151", "0.60409963", "0.6021287", "0.5989136", "0.5964405", "0.5962407", "0.59518087", "0.59309924", "0.5921466", "0.5908002", "0.5908002", "0.5908002", "0.59051657", "0.5894554", "0.5871459", "0.5870088", "0.586883", "0.5851384", "0.58168566", "0.58166975", "0.5815869", "0.58056176", "0.5799148", "0.5795126", "0.5791158", "0.57857597", "0.5783371", "0.5761351", "0.57592535", "0.57587147", "0.5746491", "0.57460666", "0.574066", "0.5739448", "0.5739448", "0.57295275", "0.57293373", "0.5729069", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57253987", "0.57214445", "0.57149816", "0.5712036", "0.5710076", "0.57073003", "0.5707059", "0.5705454", "0.5705454", "0.5700382", "0.56997055", "0.5693362", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868", "0.5687868" ]
0.0
-1
Run the database seeds.
public function run() { $this->call(CountriesTableSeeder::class); $this->call(StatesTableSeeder::class); $this->call(CitiesTableSeeder::class); factory(Group::class)->create(); factory(Contact::class, 5000)->create(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
Ensure that the start date <= the end date.
public function validateStartEnd(array &$element, FormStateInterface $form_state, array &$complete_form) { $start_date = $element['value']['#value']['object']; $end_date = $element['end_value']['#value']['object']; if ($start_date instanceof DrupalDateTime && $end_date instanceof DrupalDateTime) { if ($start_date->getTimestamp() !== $end_date->getTimestamp()) { $interval = $start_date->diff($end_date); if ($interval->invert === 1) { $form_state->setError($element, $this->t('The @title end date cannot be before the start date', ['@title' => $element['#title']])); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 validateDates(&$start, &$end) {\n $sixMonthsAgo = strtotime(\"-6 months\");\n $day = 86400;\n $end = time();\n \n if (!$start) {\n $start = strtotime(\"-7 days\");\n }\n \n $gap = $end - $start; \n \n //Don't mess the dates!\n switch ($gap) {\n case $gap < ($day * 31) :\n $gap = $day * 7;\n break;\n\n case $gap < ($day * 180) ://6 months\n $gap = $day * 31;\n break;\n \n case $gap >= ($day * 180) : \n default : \n $gap = $day * 180; \n break;\n }\n \n $end = time();\n $start = $end - $gap;\n }", "public function test_end_date_is_before_start_date()\n {\n // show actiual errors without handling\n //$this->withoutExceptionHandling();\n \n $this->json('POST', '/', array_merge($this->data(),['start_date'=>date('Y-m-d'),'end_date'=>date('Y-m-d', strtotime('-35 days'))]))\n ->seeJson([\n 'end_date' => [\"The end date must be a date after or equal to start date.\"]\n ]);\n \n }", "public function test_start_date_is_after_end_date()\n {\n // show actiual errors without handling\n //$this->withoutExceptionHandling();\n \n $this->json('POST', '/', array_merge($this->data(),['start_date'=>date('Y-m-d', strtotime('+35 days')),'end_date'=>date('Y-m-d')]))\n ->seeJson([\n 'start_date' => [\"The start date must be a date before end date.\",\"The start date must be a date before today.\"]\n ]);\n \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 }", "private function validateBookingDuration($start, $end)\n {\n if ($end <= $start) {\n throw new Exceptions\\InvalidDateException('End date time should be earlier than start date time');\n }\n\n $start = (clone $start);\n $start->modify('+2 hours');\n if ($end > $start) {\n throw new Exceptions\\InvalidDateException('Booking duration should be shorter or equal to 2 hours');\n }\n }", "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}", "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 validateDateRange($date1, $date2){\n\treturn ( strtotime($date1) - strtotime($date2) ) <= 0;\t//should be a negative number, or 0 if posts=expiration\n}", "function _isValidEndDate()\r\n {\r\n if (strtotime($this->data[$this->name]['end_date']) > strtotime(date('Y-m-d H:i:s'))) {\r\n return true;\r\n }\r\n return false;\r\n }", "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 isBetween($start, $end) {\n return $this->is(new NotPossible('cannot be between anything'));\n }", "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 checkDates($startdate, $enddate) {\n return $this->checkDate($startdate) && $this->checkDate($enddate);\n }", "public function isTodayLessThanOrEqualToEndValidityDate($today,$end_date){\n \n if(($end_date['year'] - $today['year'])>0){\n return true;\n }else if(($end_date['year'] - $today['year'])<0){\n return false;\n }else{\n if(($end_date['mon'] - $today['mon'])>0){\n return true;\n }else if(($end_date['mon'] - $today['mon'])<0){\n return false;\n }else{\n if(($end_date['mday'] - $today['mday'])>0){\n return true;\n }else if(($end_date['mday'] - $today['mday'])==0){\n return true;\n }else{\n return false;\n }\n }\n }\n \n \n }", "protected function _checkDate($from, $to) {\r\n $return = true;\r\n $date = date( 'Y-m-d');\r\n $today = strtotime ($date);\r\n if ($from && $today < $from) {\r\n $return = false;\r\n }\r\n if ($to && $today > $to) {\r\n $return = false;\r\n }\r\n if (! $to && ! $from) {\r\n $return = false;\r\n }\r\n return $return;\r\n }", "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 validateDate()\n {\n if (\n ($from = $this->getAvailableFrom()) &&\n ($till = $this->getAvailableTill()) &&\n $from->InPast() &&\n $till->InFuture()\n ) {\n return true;\n }\n\n return false;\n }", "public function between($start, $end, bool $inclusive = true, bool $throwException = true): bool\n {\n $this->ensureCompatibleArgs([$start, $end]);\n return static::betweenCalculation(\n $this->value,\n $start,\n $end,\n $inclusive,\n $this->internalMaxDecPl(),\n $throwException\n );\n }", "function greaterDate($start_date = null, $end_date = null, $equalTo = false)\n {\n $start = strtotime($start_date);\n $end = strtotime($end_date);\n if ($end-$start > 0)\n return true;\n else if ($equalTo && $end-$start >= 0)\n return true;\n else\n return false;\n }", "function _erpal_crm_activity_queue_view_validate (&$form, &$form_state) {\n \n $values = $form_state['values'];\n \n if (\n _erpal_crm_activity_queue_view_create_timestamp ($values['range_from']) >\n _erpal_crm_activity_queue_view_create_timestamp ($values['range_to']) \n ) {\n form_set_error ('range_from', t('The start date can not be later than the end date.'));\n }\n \n if (\n _erpal_crm_activity_queue_view_create_timestamp ($values['range_to']) <\n _erpal_crm_activity_queue_view_create_timestamp ($values['range_from']) \n ) {\n form_set_error ('range_to', t('The end date can not be earlier than the start date.'));\n }\n \n return;\n}", "function greaterDate($start_date,$end_date)\r\n\t\t{\r\n\t\t $start = strtotime($start_date);\r\n\t\t $end = strtotime($end_date);\r\n\t\t if ($start-$end > 0)\r\n\t\t return 1;\r\n\t\t else\r\n\t\t return 0;\r\n\t\t}", "function CHECK_valability($endDATE) {\n\n $TMSP_end = strtotime($endDATE);\n $TMSP_today = time();\n\n if($TMSP_end > $TMSP_today) return true;\n else return false;\n }", "public function test_end_date_before_more_than_30_days()\n {\n // show actiual errors without handling\n //$this->withoutExceptionHandling();\n \n $this->json('POST', '/', array_merge($this->data(),['end_date'=>date('Y-m-d', strtotime('-35 days'))]))\n ->seeJson([\n 'end_date' => [\"The end date must be a date after or equal to start date.\"]\n ]);\n \n \n }", "public function leadsInDates($start, $end, $data = []);", "public function isValid(): bool\n {\n $now = new \\DateTime();\n return $now < $this->getEndDate();\n }", "private function CheckStartFinishDate()\n\t{\n\t\t$start_date = MicroGrid::GetParameter('start_date', false);\n\t\t$finish_date = MicroGrid::GetParameter('finish_date', false);\n\t\t\n\t\tif($start_date > $finish_date){\n\t\t\t$this->error = _START_FINISH_DATE_ERROR;\n\t\t\treturn false;\n\t\t}\t\n\t\treturn true;\t\t\n\t}", "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 function between(string $lowerDate, string $upperDate) : bool\r\n {\r\n return ($this->getTimestamp() >= strtotime($lowerDate) && $this->getTimestamp() <= strtotime($upperDate));\r\n }", "protected function checkDate($start_date, $end_date = null){\r\n $checkStartDate = HariTidakEfektif::find()\r\n ->where([\r\n 'Or',\r\n \"date(tanggal_awal) = '$start_date' And tanggal_akhir IS null\",\r\n [\r\n 'And',\r\n \"date(tanggal_awal) <= '$start_date'\",\r\n \"date(tanggal_akhir) >= '$start_date'\"\r\n ]\r\n ])->one();\r\n if( $end_date != null ){\r\n $checkEndDate = HariTidakEfektif::find()\r\n ->where([\r\n 'Or',\r\n \"date(tanggal_awal) = '$end_date' And tanggal_akhir IS null\",\r\n [\r\n 'And',\r\n \"date(tanggal_awal) <= '$end_date'\",\r\n \"date(tanggal_akhir) >= '$end_date'\"\r\n ]\r\n ])->one();\r\n }\r\n\r\n if ( is_null($checkStartDate)){\r\n if( isset($checkEndDate) ){\r\n if (is_null($checkEndDate)) return true;\r\n else false;\r\n } else {\r\n return true;\r\n }\r\n } \r\n return false;\r\n }", "public static function validatorPublicationEnds(ArticleInterface $article, ExecutionContextInterface $context): void\n {\n if (\\is_object($article->getPublicationStartsAt())\n && \\is_object($article->getPublicationEndsAt())\n && $article->getPublicationStartsAt()->format('U') >= $article->getPublicationEndsAt()->format('U')\n ) {\n $context->buildViolation('article.publication_start_date_before_end_date')->addViolation();\n }\n }", "public function setDateRestrictions($start, $end)\n\t{\n\t\t$this->setStartDate($start);\n\t\t$this->setEndDate($end);\n\t}", "function warranty_validation ($conn, $data) {\n\n\t$get_date1= $data[\"replaced_date\"];\n\t$start = strtotime(\"$get_date1\");\n\n\t$get_date2 = $data[\"warranty_period\"];\n\t$end = strtotime(\"$get_date2\");\n\n\tif ($end > $start) {\n\t\treturn \"YES\";\n\t}else{\n\t\treturn \"NO\" ;\n\t}\n\n\tdie();\n\n}", "protected function validateDateInterval(\\DateTime $value, \\DateTime $min, \\DateTime $max)\n {\n\n if (($value >= $min) && ($value <= $max)) {\n\n return true;\n }\n\n return false;\n }", "private function check_hour_starts_before_end(int $start_at, int $end_at): bool\n {\n // PHP zet het on-the-fly in een DateTimeImmutable, dus het kost wel wat extra werk\n // Dit doet dus date('Y-m-d H:i:s', $start_at) < date(......\n return $start_at < $end_at;\n }", "public function isScopeDateInInterval($scope, $dateFrom = null, $dateTo = null);", "public function isScopeDateInInterval($scope, $dateFrom = null, $dateTo = null);", "function date_forbid() {\n if (empty($this->argument)) {\n return TRUE;\n }\n $this->date_range = $this->date_handler->arg_range($this->argument);\n $this->min_date = $this->date_range[0];\n $this->max_date = $this->date_range[1];\n $this->limit = date_range_years($this->options['year_range']);\n $group = !empty($this->options['date_group']) ? $this->options['date_group'] : 0;\n\n // See if we're outside the allowed date range for our argument.\n if (date_format($this->min_date, 'Y') < $this->limit[0] || date_format($this->max_date, 'Y') > $this->limit[1]) {\n $this->forbid = TRUE;\n $this->view->build_info['fail'] = TRUE;\n return TRUE;\n }\n return FALSE;\n }", "public static function checkDatesChronological($start_date_hour, $ending_date_hour) {\n $v = Validator::make(\n ['ending_date_hour' => $ending_date_hour], ['ending_date_hour' => 'required|after:' . $start_date_hour]\n );\n if ($v->fails()) {\n $response['fail'] = $v->messages()->getMessages();\n } else {\n $response = true;\n }\n return $response;\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 valid()\n {\n return $this->_current !== null\n && $this->_current->getTimestamp() < $this->_endDate->getTimestamp();\n }", "public static function greaterDate($start_date, $end_date)\r\n {\r\n $start = strtotime($start_date);\r\n $end = strtotime($end_date);\r\n if ($start - $end > 0)\r\n return 1;\r\n else\r\n return 0;\r\n }", "private function validateDate($date)\n {\n $dateHead = new \\DateTime();\n $dateTail = (new \\DateTime('+2 weeks, +1 day'))->modify('midnight');\n\n if ($date < $dateHead || $date >= $dateTail) {\n throw new Exceptions\\InvalidDateException('Date outside acceptable range');\n }\n }", "function date_larger($ended_date = NULL, $started_date) {\n\n // Ended date value is not required , only check when $ended_date has value\n if($ended_date && strtotime($ended_date) < strtotime($started_date)) {\n $this->set_message('date_larger', '終了日時は開始日時より後になるように設定してください。');\n return FALSE;\n }\n\n return TRUE;\n }", "function IsDateBetween($startDate, $checkDate, $endDate){\n\t\tif(strtotime($checkDate) >= strtotime($startDate) && strtotime($checkDate) <= strtotime($endDate)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function supportsDateRange() {\n\t\treturn true;\n\t}", "function test_range() {\n\t\t// Check range\n\t\tlist( $start, $end ) = $this->revenue->get_month_range( 2018, 1 );\n\t\t$this->assertEquals( '2018-01-01 00:00:00', $start );\n\t\t$this->assertEquals( '2018-01-31 23:59:59', $end );\n\t\t// Check leap year\n\t\tlist( $start, $end ) = $this->revenue->get_month_range( 2004, 2 );\n\t\t$this->assertEquals( '2004-02-01 00:00:00', $start );\n\t\t$this->assertEquals( '2004-02-29 23:59:59', $end );\n\t\t// Check exceptional leap year.\n\t\tlist( $start, $end ) = $this->revenue->get_month_range( 1900, 2 );\n\t\t$this->assertEquals( '1900-02-01 00:00:00', $start );\n\t\t$this->assertEquals( '1900-02-28 23:59:59', $end );\n\t}", "private function compare_with_date()\n {\n }", "public function beforeEnd($data) {\n\t\t$values = array_values($data);\n\t\tif (!isset($values)) {\n\t\t\treturn false;\n\t\t}\n\t\t$value = $values[0];\n\n\t\t$enddate = strtotime(Configure::read('Account.enddate') . ' 00:00:00');\n\t\t$entrydate = strtotime($value . ' 00:00:00');\n\n\t\tif ($enddate >= $entrydate) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\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 reportsInPeriodScope($dateStart, $dateEnd);", "public function isBetween(SortCode $start, SortCode $end)\n {\n return 0 <= $this->compareTo($start) && -1 === $this->compareTo($end);\n }", "function FirstCompareDates($SenStart, $SenEnd, $uStart, $uEnd){\n\t$boolOut = \"FALSE\";\n\tif((strtotime($uStart) >= strtotime($SenStart))&&(strtotime($uEnd) <= strtotime($SenEnd))){\n\t\t$boolOut = \"TRUE\";\n\t}\n\telse {\n\t\t$boolOut = \"FALSE\";\n\t}\n\treturn \t$boolOut;\n}", "protected function fiterByDateRange(string $start_date = null, string $end_date = null)\n {\n if ($start_date && $end_date) {\n $this->builder->whereBetween(\n 'time_played',\n [$start_date, $end_date]\n );\n }\n }", "function checkTimeRange($params) {\n\n if (!isset($params['start_date']) || $params['start_date'] == null) {\n return -1;\n }\n \n if (!isset($params['stop_date']) || $params['stop_date'] == null) {\n return -2;\n }\n \n if (!isset($params['start_time']) || $params['start_time'] == null) {\n return -3;\n }\n \n if (!isset($params['end_time']) || $params['end_time'] == null) {\n return -4;\n }\n \n $startTime = $params['start_date'] . ' ' . $params['start_time'];\n $emdTime = $params['stop_date'] . ' ' . $params['end_time'];\n \n if(strtotime($startTime) > strtotime($emdTime)) {\n return -5;\n }\n return 1;\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 __construct(JustDate $start, JustDate $end)\n {\n if ($start->isAfter($end)) {\n throw new InvalidArgumentException(\"Start date cannot be after end date\");\n }\n $this->start = clone $start;\n $this->end = clone $end;\n }", "private static function betweenCalculation(\n $value,\n $start,\n $end,\n bool $inclusive,\n int $decPl,\n bool $throwException = true\n ): bool {\n\n if (is_null($value)) {\n return false;\n }\n\n $start = static::extractBasicValue($start, $decPl, true, $throwException);\n $end = static::extractBasicValue($end, $decPl, true, $throwException);\n $min = $max = null;\n\n // between $start and $end (doesn't matter the order)\n if ((!is_null($start)) && (!is_null($end))) {\n\n // swap start and end if needed\n switch (bccomp($start, $end, $decPl)) {\n case -1:\n $min = $start;\n $max = $end;\n break;\n case 1:\n $min = $end;\n $max = $start;\n break;\n default: // case 0:\n $min = $max = $start;\n }\n } elseif (!is_null($start)) { // > or >= $start\n $min = $start;\n } elseif (!is_null($end)) { // <= or < $end\n $max = $end;\n }\n\n // compare $value to the bounds\n if (\n (!is_null($min))\n && (!in_array(bccomp($value, $min, $decPl), ($inclusive ? [0, 1] : [1])))\n ) {\n return false;\n }\n if (\n (!is_null($max))\n && (!in_array(bccomp($value, $max, $decPl), ($inclusive ? [-1, 0] : [-1])))\n ) {\n return false;\n }\n\n return true;\n }", "public function traslapeRange(RangeDates $rangeCompare, \n RangeDates $rangeSearch){\n return !($rangeSearch->initialDate->greaterThan($rangeCompare->finalDate) or\n $rangeCompare->initialDate->greaterThan($rangeSearch->finalDate));\n }", "public function getByStartDateAndEndDate(\n DateTime $start_date,\n DateTime $end_date\n );", "private function checkDatesValidity(){\n\t\t$valid=true;\n\t\t$today = date(\"Y-m-d\");\n\t\tif($this->validFrom!=\"\" && $this->validFrom!=\"0000-00-00\" && $today<$this->validFrom) $valid=false;\n\t\tif($this->validUntil!=\"\" && $this->validUntil!=\"0000-00-00\" && $today>$this->validUntil) $valid=false;\n\t\treturn $valid;\n\t}", "protected function dates_filter(){\n \t//+Constraint Isgi: only one year data\n \t$temporal = $this->get_temporal();\n \tif( strtolower($temporal->end) == \"now\"){\n \t\t$now = new \\DateTime();\n \t\t$temporal->end = $now->format(\"Y-m-d\");\n \t}\n \t\n \t\n \t//change start and end\n \tif( $this->start < $temporal->start){\n \t\t$this->start = $temporal->start;\n \t}\n \tif( $this->end > $temporal->end){\n \t\t$this->end = $temporal->end;\n \t}\n \t$update = $this->get_update();\n \tif( !empty( $update) && $update < $this->end){\n \t\t$this->end = $update;\n \t}\n \t// diff between start and end\n \t$start = new \\DateTime( $this->start);\n \t$end = new \\DateTime( $this->end);\n \t$interval = $start->diff( $end);\n \tif( $interval->invert){\n \t\t//end < start\n \t\t$this->error = \"NO_DATA\";\n \t}else{\n\t \tif( $interval->days > 365){\n\t \t\t$start = clone $end;\n\t \t\t$start->sub( new \\DateInterval(\"P364D\"));\n\t \t\t$this->start = $start->format(\"Y-m-d\");\n\t \t}\n \t}\n }", "public function isBooked($start_date, $end_date) {\n\t\t$bookings = Booking::getBookingDates($this->id, date('Y-m-d'));\n\n\t\tforeach ($bookings as $booking) {\n\t\t\t// if they overlap return false\n\t\t\tif (strtotime($start_date) <= strtotime($booking->end_date) && strtotime($booking->start_date) <= strtotime($end_date)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "public function isBetween($initialDate, $finalDate){\n\t\t$fecha = $this->getDate();\n\t\t$c1 = self::compareDates($fecha, $initialDate);\n\t\t$c2 = self::compareDates($fecha, $finalDate);\n\t\treturn ($c1!=-1)&&($c2!=1);\n\t}", "public function testBetween(): void\n {\n $period = Period::between(LocalDate::of(2010, 1, 15), LocalDate::of(2011, 3, 18));\n $this->assertPeriodIs(1, 2, 3, $period);\n }", "public function getEventsForRange($dt1, $dt2) {\n $events = $this->_machine->plugin(\"DB\")->getEventsFromDB(\"AND events.active = 1\", \"\", false, \"time_to DESC\");\n $events = array_filter($events, function($ev) use ($dt1, $dt2) {\n $from = new \\DateTime($ev[\"time_from\"]);\n $to = new \\DateTime($ev[\"time_to\"]);\n $from->setTime(0,0);\n $to->setTime(23,59);\n $dt1->setTime(0,0);\n $dt2->setTime(23,59);\n \n /*\n echo \"================================= \\r\\n\";\n echo \"ev: \" . ($ev[\"id\"]) . \"\\r\\n\";\n echo \"from: \" . $from->getTimestamp() . \"\\r\\n\";\n echo \"to: \" . $to->getTimestamp() . \"\\r\\n\";\n echo \"dt1: \" . $dt1->getTimestamp() . \"\\r\\n\";\n echo \"dt2: \" . $dt2->getTimestamp() . \"\\r\\n\";\n var_dump( ($dt1->getTimestamp() < $from->getTimestamp() && $dt2->getTimestamp() < $from->getTimestamp()) || ($dt1->getTimestamp() > $to->getTimestamp() && $dt2->getTimestamp() > $to->getTimestamp()) );\n */\n \n //echo \"from: \" . $from->getTimestamp() . \"\\r\\n\";\n // 20/4 <= 19/4 && 19/4 <= 20/4 || 20/4 <= 21/4 && 21/4 <= 20/4 \n //if (($from <= $dt1 && $dt1 <= $to) || ($from <= $dt2 && $dt2 <= $to)) {\n //if (($dt1 <= $from && $from <= $dt2) || ($dt1 <= $to && $to <= $dt2)) { \n // return true;\n //}\n //return false;\n if (($dt1 < $from && $dt2 < $from) || ($dt1 > $to && $dt2 > $to)) {\n return false;\n }\n return true;\n });\n return $events;\n }", "public function testDateIntegrity()\n {\n $chunker = new NbpApiDateRangeChunker();\n\n $chunks = $chunker->chunk(new \\DateTime('2007-03-18'), new \\DateTime('2017-03-18'));\n $this->assertCount(10, $chunks);\n\n $chunks = $chunker->chunk(new \\DateTime('2007-03-18'), new \\DateTime('2017-03-19'));\n $this->assertCount(11, $chunks);\n\n for ($i = 0, $chunkCount = count($chunks); $i < $chunkCount; $i++) {\n $this->assertTrue($chunks[$i]['from'] < $chunks[$i]['to']);\n\n //each date range except last one should be exaclty one year long\n if ($i != $chunkCount - 1) {\n $this->assertEquals(1, $chunks[$i]['from']->diff($chunks[$i]['to'])->y);\n }\n }\n }", "public function checkInput()\n\t{\n\t\tglobal $lng;\n\t\t\n\t\tif($this->getDisabled())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\t$post = $_POST[$this->getPostVar()];\n\t\tif(!is_array($post))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$start = $post[\"start\"];\n\t\t$end = $post[\"end\"];\n\t\t\n\t\t// if full day is active, ignore time format\n\t\t$format = $post['tgl']\n\t\t\t? 0\n\t\t\t: $this->getDatePickerTimeFormat();\n\t\t\n\t\t// always done to make sure there are no obsolete values left\n\t\t$this->setStart(null);\n\t\t$this->setEnd(null);\n\t\t\n\t\t$valid_start = false;\n\t\tif(trim($start))\n\t\t{\n\t\t\t$parsed = ilCalendarUtil::parseIncomingDate($start, $format);\n\t\t\tif($parsed)\n\t\t\t{\t\t\t\t\t\t\t\t\t\n\t\t\t\t$this->setStart($parsed);\n\t\t\t\t$valid_start = true;\n\t\t\t}\t\t\t\t\t\t\n\t\t}\n\t\telse if(!$this->getRequired() && !trim($end))\n\t\t{\n\t\t\t$valid_start = true;\t\t\t\n\t\t}\n\t\t\t\t\t\t\t\t\n\t\t$valid_end = false;\t\t\n\t\tif(trim($end))\n\t\t{\t\t\t\n\t\t\t$parsed = ilCalendarUtil::parseIncomingDate($end, $format);\t\t\n\t\t\tif($parsed)\n\t\t\t{\n\t\t\t\t$this->setEnd($parsed);\n\t\t\t\t$valid_end = true;\n\t\t\t}\t\t\t\t\t\n\t\t}\n\t\telse if(!$this->getRequired() && !trim($start))\n\t\t{\t\t\t\t\t\n\t\t\t$valid_end = true;\t\t\t\n\t\t}\n\t\t\n\t\tif($this->getStartYear())\n\t\t{\n\t\t\tif($valid_start && \n\t\t\t\t$this->getStart()->get(IL_CAL_FKT_DATE, \"Y\") < $this->getStartYear())\n\t\t\t{\n\t\t\t\t$valid_start = false;\n\t\t\t}\n\t\t\tif($valid_end && \n\t\t\t\t$this->getEnd()->get(IL_CAL_FKT_DATE, \"Y\") < $this->getStartYear())\n\t\t\t{\n\t\t\t\t$valid_end = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$valid = ($valid_start && $valid_end);\t\n\t\t\n\t\tif($valid && \n\t\t\t$this->getStart() && \n\t\t\t$this->getEnd() &&\n\t\t\tilDateTime::_after($this->getStart(), $this->getEnd()))\t\t\t\n\t\t{\n\t\t\t$valid = false;\t\t\t\n\t\t}\n\t\t\n\t\tif(!$valid)\n\t\t{\n\t\t\t$this->invalid_input_start = $start;\n\t\t\t$this->invalid_input_end = $end;\n\t\t\t\n\t\t\t$_POST[$this->getPostVar()][\"start\"] = null;\n\t\t\t$_POST[$this->getPostVar()][\"end\"] = null;\n\t\t\t\n\t\t\t$this->setAlert($lng->txt(\"form_msg_wrong_date\"));\n\t\t}\t\n\t\telse\n\t\t{\t\t\t\n\t\t\tif($this->getStart() &&\n\t\t\t\t$this->getEnd())\n\t\t\t{\n\t\t\t\t// getInput() should return a generic format\t\n\t\t\t\t$post_format = $format\n\t\t\t\t\t? IL_CAL_DATETIME\n\t\t\t\t\t: IL_CAL_DATE;\t\t\t\n\t\t\t\t$_POST[$this->getPostVar()][\"start\"] = $this->getStart()->get($post_format);\n\t\t\t\t$_POST[$this->getPostVar()][\"end\"] = $this->getEnd()->get($post_format);\t\t\t\t\n\t\t\t\tunset($_POST[$this->getPostVar()][\"tgl\"]);\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$_POST[$this->getPostVar()][\"start\"] = null;\n\t\t\t\t$_POST[$this->getPostVar()][\"end\"] = null;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif($valid)\n\t\t{\n\t\t\t$valid = $this->checkSubItemsInput();\n\t\t}\n\t\t\n\t\treturn $valid;\n\t}", "function __construct($start, $end)\r\n {\r\n\r\n // For creating a DateRange object for an exact date (like if exact\r\n // date-of-birth is known) just pass the same value for `start` and `end`.\r\n\r\n if (!empty($start))\r\n {\r\n $this->start = $start;\r\n }\r\n if (!empty($end))\r\n {\r\n $this->end = $end;\r\n }\r\n\r\n if (empty($this->start) && empty($this->end))\r\n {\r\n throw new InvalidArgumentException('Start/End parameters missing');\r\n }\r\n\r\n if (($this->start && $this->end) && ($this->start > $this->end))\r\n {\r\n $t = $this->end;\r\n $this->end = $this->start;\r\n $this->start = $t;\r\n }\r\n }", "function is_now_valid($start, $end)\n{\n $now = new DateTime;\n $hour = strval($now->format(\"H\"));\n if ($hour >= $start && $hour < $end)\n {\n return true;\n }\n return false;\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 }", "function createRangeStat($start, $end, $format = 'Y-m-d') {\n \t\tdate_default_timezone_set(\"Europe/London\");\n\t\t$start = new DateTime($start);\n\t\t$end = new DateTime($end);\n\t\t$invert = $start > $end;\n\n\t\t$dates = array();\n\t\t$dates[] = $start->format($format);\n\t\twhile ($start != $end) {\n\t\t\t$start->modify(($invert ? '-' : '+') . '1 day');\n\t\t\t$dates[] = $start->format($format);\n\t\t}\n\t\treturn $dates;\n\t}", "function beginIsAfterEnd($beginTime, $endTime){\n if($beginTime > $endTime) {\n return true;\n }\n else {\n return false;\n }\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 }", "public function startDate_validation($str) {\n $dt = date('Y-m-d');\n \n if ($str < $dt) {\n $this->form_validation->set_message(\"startDate_validation\", 'Start date-time should greater then current date-time.');\n return FALSE;\n }\n return TRUE;\n }", "public function __construct($startDate, $endDate)\n {\n $startDate = static::filterDatePoint($startDate);\n $endDate = static::filterDatePoint($endDate);\n if ($startDate > $endDate) {\n throw new LogicException(\n 'The ending datepoint must be greater or equal to the starting datepoint'\n );\n }\n $this->startDate = $startDate;\n $this->endDate = $endDate;\n }", "public function testBookingCanStartWhenAnotherEnds()\n {\n $previous = factory(Booking::class)->create([\n 'start_time' => Carbon::parse('2017-01-01 12:00:00'),\n 'end_time' => Carbon::parse('2017-01-01 13:00:00'),\n ]);\n\n $booking = factory(Booking::class)->create([\n 'resource_id' => $previous->resource_id,\n 'start_time' => Carbon::parse('2017-01-01 13:00:00'),\n 'end_time' => Carbon::parse('2017-01-01 14:00:00'),\n ]);\n\n $availableRule = new Available($booking->start_time, $booking->end_time, $booking->id);\n\n $this->assertTrue($availableRule->passes('resource_id', $booking->resource_id));\n }", "public function inPeriod(\\DateTime $date)\n {\n return $date >= $this->startDate && $date <= $this->endDate;\n }", "function buscar_fecha ($fecha) {\n global $DB;\n $fechamin = buscar_menor_fecha();\n $fechamax = buscar_mayor_fecha();\n if ($fecha >= $fechamin->date && $fecha <= $fechamax->date) {\n return true;\n } else {\n return false;\n }\n}", "private function hasEventForRange($ical, $start, $end)\n {\n return ! empty($ical->eventsFromRange($start, $end));\n }", "public function testBookingCannotOverlapStartOfAnotherBooking()\n {\n $previous = factory(Booking::class)->create([\n 'start_time' => Carbon::parse('2017-01-01 13:00:00'),\n 'end_time' => Carbon::parse('2017-01-01 14:00:00'),\n ]);\n\n $booking = factory(Booking::class)->create([\n 'resource_id' => $previous->resource_id,\n 'start_time' => Carbon::parse('2017-01-01 12:00:00'),\n 'end_time' => Carbon::parse('2017-01-01 13:15:00'),\n ]);\n\n $availableRule = new Available($booking->start_time, $booking->end_time, $booking->id);\n\n $this->assertFalse($availableRule->passes('resource_id', $booking->resource_id));\n }", "public function test_start_date_before_more_than_30_days()\n {\n // show actiual errors without handling\n //$this->withoutExceptionHandling();\n \n $this->json('POST', '/', array_merge($this->data(),['start_date'=>date('Y-m-d', strtotime('-35 days'))]))\n ->seeJson([\n 'start_date' => [\"The start date must be a date after today -30 days.\"]\n ]);\n \n }", "static function formRule( $values ) \n {\n $errors = array( );\n\n if (!empty($values['start_date']) && !empty($values['end_date']) ) {\n $start = CRM_Utils_Date::processDate( $values['start_date'] );\n $end = CRM_Utils_Date::processDate( $values['end_date'] );\n if ( ($end < $start) && ($end != 0) ) {\n $errors['end_date'] = ts( 'End date should be after Start date' );\n }\n } \n return $errors;\n }", "private function checkEventDateNotDue(){\n $event = Event::find($this->id);\n $now = Carbon::now();\n \n $startTime = Carbon::createFromFormat('Y-m-d H:i:s', $event->start_time);\n return $startTime->gt($now);\n }", "public function testBookingCanEndWhenAnotherStart()\n {\n $previous = factory(Booking::class)->create([\n 'start_time' => Carbon::parse('2017-01-01 13:00:00'),\n 'end_time' => Carbon::parse('2017-01-01 14:00:00'),\n ]);\n\n $booking = factory(Booking::class)->create([\n 'resource_id' => $previous->resource_id,\n 'start_time' => Carbon::parse('2017-01-01 12:00:00'),\n 'end_time' => Carbon::parse('2017-01-01 13:00:00'),\n ]);\n\n $availableRule = new Available($booking->start_time, $booking->end_time, $booking->id);\n\n $this->assertTrue($availableRule->passes('resource_id', $booking->resource_id));\n }", "public function during(DateTimePeriod $period): bool\n {\n return\n $period->getStart() < $this->getStart() &&\n $this->getEnd() < $period->getEnd();\n }", "public function dateValidator($attribute,$params){\n\t\t//kamus lokal\n\t\t$message ='start date : '.$this->PlannedStartDate.' end date : '.$this->PlannedEndDate;\n\t\t$category = 'date initial in validator cek value';\n\t\tYii::trace($message, $category);\n\t\t//function\n if (($this->PlannedStartDate <= $this->PlannedEndDate) OR ($this->PlannedEndDate === date(\"Y-m-d\"))){\n\t\t\t$message=\"valid\";\n\t\t\t$category=\"date debugging\";\n\t\t\tYii::trace($message, $category);\n\t\t}else{\n\t\t\t\t$message=\"invalid\";\n\t\t\t\t$category=\"date debugging\";\n\t\t\t\tYii::trace($message, $category);\n\t\t\t$this->addError('PlannedStartDate', 'Planned Start Date invalid, must be >= than Planned End Date');\n\t\t}\n\t}", "private function isValidStartAndEndTime($startHour, $startMin, $endHour, $endMin)\n {\n \t$start = $startHour * 60 + $startMin;\n \t$end = $endHour * 60 + $endMin;\n \t\n \treturn $start < $end;\n }", "public function addBetweenCondition($field,$value_start,$value_end,$operator='AND') {\r\n $this->addRelationCompare($field, ['#between#'=>true,$value_start,$value_end],false,$operator);\r\n }", "function isPast()\r\n {\r\n $agora = new Date();\r\n if($this->before($agora)) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public function isTodayGreaterThanOrEqualToStartValidityDate($today, $start_date){\n \n if(($today['year'] - $start_date['year'])>0){\n return true;\n }else if(($today['year'] - $start_date['year'])<0){\n return false;\n }else{\n if(($today['mon'] - $start_date['mon'])>0){\n return true;\n }else if(($today['mon'] - $start_date['mon'])<0){\n return false;\n }else{\n if(($today['mday'] - $start_date['mday'])>0){\n return true;\n }else if(($today['mday'] - $start_date['mday'])==0){\n return true;\n }else{\n return false;\n }\n }\n }\n \n \n \n }", "public function searchBookListBetweenDate($start, $end)\n {\n return $this->bookDao->searchBookListBetweenDate($start, $end);\n }", "public function setEndDate(DrupalDateTime $end_date = NULL);", "public function BeforeInsertRecord()\n\t{\n\t\tif(!$this->CheckStartFinishDate()) return false;\n\t\tif(!$this->CheckDateOverlapping()) return false;\n\t\treturn true;\n\t}", "public static function _within(ilDateTime $dt, ilDateTime $start, ilDateTime $end, $a_compare_field = '', $a_tz = '')\n\t{\n\t\treturn \n\t\t\t(ilDateTime::_after($dt, $start,$a_compare_field,$a_tz) or ilDateTime::_equals($dt, $start,$a_compare_field,$a_tz)) &&\n\t\t\t(ilDateTime::_before($dt, $end,$a_compare_field,$a_tz) or ilDateTime::_equals($dt, $end,$a_compare_field,$a_tz));\n\t}", "public function testDateGreaterThanOptions()\n {\n $options = [\n 'min' => '2020-06-05',\n 'format' => 'Y-m-d',\n 'inclusive' => false,\n ];\n $validator = new DateGreaterThan($options);\n\n $optionsValidator = [\n 'min' => $validator->getMin(),\n 'format' => $validator->getFormat(),\n 'inclusive' => $validator->getInclusive(),\n ];\n\n $this->assertSame($options, $optionsValidator);\n }", "protected function isActivatedViaEndDateAndTime() {}", "public function __construct(Time $start, Time $end)\n {\n if ($start->isAfter($end)) {\n throw new \\Exception(\n 'The end of a time range cannot be before the start.'\n );\n }\n $this->start = $start;\n $this->end = $end;\n }", "public function rules()\n {\n return [\n 'start' => 'required|date|after_or_equal:'.date('Y-m-d'),\n 'end' => 'required|date|after:start',\n 'poll_id' => 'required',\n ];\n\n }", "public function reservationValidation($reservation, $start, $end)\n {\n $usedTables = DB::table('individual_reservations')->where('table_id', $reservation->table_id)->where('id', '!=', $reservation->id)/*->where('start_date', '>', $date)*/\n ->get();\n\n\n foreach ($usedTables as $res)\n {\n if (($res->start_date >= $start && $res->start_date <= $end) || ($res->end_date >= $start && $res->end_date <= $end))\n {\n return ['start' => $res->start_date, 'end' => $res->end_date];\n }\n }\n\n return null;\n }" ]
[ "0.72673243", "0.71455395", "0.6995664", "0.6913768", "0.6868164", "0.6834857", "0.67338294", "0.671087", "0.67076486", "0.66682726", "0.65308297", "0.64928603", "0.6476005", "0.64357895", "0.64342326", "0.6343966", "0.63147926", "0.62953746", "0.6259254", "0.6235723", "0.6233899", "0.6219644", "0.6204154", "0.62021345", "0.620044", "0.6196565", "0.61904687", "0.60910606", "0.60868835", "0.60642743", "0.60526276", "0.6035217", "0.6019398", "0.60067457", "0.5995989", "0.5988544", "0.5988544", "0.598156", "0.5963824", "0.59616864", "0.5953289", "0.59525055", "0.59481066", "0.5940232", "0.59245867", "0.58762354", "0.5854798", "0.5852095", "0.58287716", "0.58155435", "0.5798721", "0.5794405", "0.5772458", "0.57612693", "0.57609606", "0.5760283", "0.5723208", "0.5705435", "0.57033616", "0.5695568", "0.5691249", "0.5687134", "0.56870204", "0.56820774", "0.56680137", "0.56544375", "0.56305695", "0.5626209", "0.5612715", "0.56097203", "0.5600542", "0.5598689", "0.5576192", "0.55736476", "0.55509555", "0.55441016", "0.55229026", "0.55204606", "0.55199236", "0.5515716", "0.55129623", "0.55100435", "0.54942673", "0.54915565", "0.54864144", "0.5483695", "0.54825354", "0.5481641", "0.54721886", "0.54658824", "0.5465562", "0.546059", "0.54399323", "0.5437518", "0.5420742", "0.5416078", "0.53975683", "0.53833", "0.5376407", "0.536002" ]
0.65600705
10
TODO: update contract time
public static function createOrUpdate($data) { $tenant = self::where(['name' => $data['name']])->first(); if (!$tenant) { $tenant = new Tenant(); $tenant->name = $data['name']; $tenant->created_admin_id = $data['created_admin_id']; } $tenant->save(); return $tenant; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function Contracts(){\n }", "public function projectContractPrepared()\n\t{\n\n\t}", "public function projectContractAccepted()\n\t{\n\n\t}", "public function flagAsContracted()\n {\n $request = $this->newRequest(static::$token);\n $token = $this->quotation_token;\n\n $request->flagAsContracted($this, $token);\n }", "public function created(Contract $contract)\n {\n //\n }", "public function testConstructAndTheGetters(): void\n {\n $signature = SignatureStub::default();\n\n $contract = new Contract(\n [$signature],\n [$signature]\n );\n\n self::assertEquals($signature, $contract->getDefendantSignatures()[0]);\n self::assertEquals($signature, $contract->getPlaintiffSignatures()[0]);\n }", "public function updated(Contract $contract)\n {\n //\n }", "public function retrieved(Contract $contract)\n {\n \n // foreach ($contracts as $contract) {\n // $end_date = $contract->data_fine;\n // $start_date = $contract->data_inizio;\n\n // $today = Carbon::today();\n\n // if ($today>= $start_date && $today<=$end_date) {\n // $contract->bike->bloccata = 1;\n // }\n\n // }\n \n }", "public function getContract()\n {\n return $this->contract;\n }", "public function run()\n {\n Contract::insert([\n\n [\n 'short' => '24m',\n 'description' => '24 months',\n ],\n [\n 'short' => '12m',\n 'description' => '12 months',\n ],\n [\n 'short' => '1m',\n 'description' => '1 month',\n ]\n\n ]);\n }", "public function breakdown(): CostBreakdownContract;", "private function updateServiceContractInfo($contract) {\n\n // TODO check sc_teamid in grantedTeams\n\n $sc_teamid = Tools::getSecurePOSTIntValue('sc_teamid');\n\n if ($sc_teamid != $this->teamid) {\n // switch team (because you won't find the SC in current team's contract list)\n $_SESSION['teamid'] = $sc_teamid;\n $this->updateTeamSelector();\n }\n $contract->setTeamid($sc_teamid);\n\n $formattedValue = Tools::getSecurePOSTStringValue('servicecontractName');\n $contract->setName($formattedValue);\n\n $formattedValue = Tools::getSecurePOSTStringValue('servicecontractReference','');\n $contract->setReference($formattedValue);\n\n $formattedValue = Tools::getSecurePOSTStringValue('servicecontractVersion','');\n $contract->setVersion($formattedValue);\n\n $formattedValue = Tools::getSecurePOSTStringValue('servicecontractReporter','');\n $contract->setReporter($formattedValue);\n\n $formattedValue = Tools::getSecurePOSTStringValue('servicecontractDesc','');\n $contract->setDesc($formattedValue);\n\n $formattedValue = Tools::getSecurePOSTStringValue('serviceContractStartDate','');\n if ('' != $formattedValue) {\n $contract->setStartDate(Tools::date2timestamp($formattedValue));\n }\n $formattedValue = Tools::getSecurePOSTStringValue('serviceContractEndDate','');\n if ('' != $formattedValue) {\n $contract->setEndDate(Tools::date2timestamp($formattedValue));\n }\n\n // State not used for now\n //$contract->setState(SmartyTools::checkNumericValue($_POST['servicecontractState'], true));\n }", "public function implementation_pending()\n {\n }", "public function saved(Contract $contract)\n {\n if ($contract->isDirty('full_approves') && $contract->full_approves && !$contract->ceo_approve) {\n $url = url('ceo/' . $contract->id . '/approve');\n $this->sendCeoNotifocation($contract, $url);\n $this->sendCeoEmail($contract, $url);\n }\n\n if (!isset($contract->contract_code)) {\n $serviceTypeId = $contract->service_type_id;\n $first_party_title = strtolower(substr(optional($contract->first_parties)->first_party_title,0,2));\n $second_party_id = optional($contract->second_parties)->second_party_id;\n $second_party_type_id = optional($contract->second_party_type)->id;\n $contract_id = rand(111,999).uniqid();\n\n $contract->contract_code = $serviceTypeId.'-'.$first_party_title.'-'.$second_party_id.'-'.$second_party_type_id.'-'.$contract_id;\n\n $contract->save();\n }\n\n if ($contract->isDirty('ceo_approve') && $contract->ceo_approve) {\n $this->updateContractItems($contract);\n foreach($contract->items as $item) {\n $department_mails = Department::whereIn('id',explode(',', $item->department_ids))->pluck('email')->toArray();\n $this->sendDepartmentEmail($contract,$item->item,$department_mails);\n }\n }\n\n if ($contract->isDirty('ceo_renew') && $contract->ceo_renew == CeoRenewStatus::RENEW) {\n $data['contract_id'] = $contract->id;\n $data['renew_start_date'] = request()->get('renew_start_date');\n $data['renew_expire_date'] = request()->get('renew_expire_date');\n $data['renew_duration_id'] = request()->get('renew_duration_id');\n $this->contractRenewService->handle($data);\n }\n }", "public function __construct($company = null, $location = null, $third = null, $thirdVat = null, $thirdName = null, $dateFrom = null, $dateTo = null, $product = null, $productDesc = null, $quantity = null, $um = null, \\bunge\\StructType\\RespPlateAuthTransporter $carrier = null, \\bunge\\StructType\\RespPlateAuthTransporter $agency = null, $plate1Country = null, $plate1CountryDesc = null, $plate1MeanOfTransport = null, $plate1 = null, $plate2Country = null, $plate2CountryDesc = null, $plate2MeanOfTransport = null, $plate2 = null, $rfrContractThird = null, $rfrOrderThird = null, $destinationAddress = null, $contactPhone = null, $destinationTimetable = null, $awardeeName = null, $awardeeAddress = null, $awardeeCode = null, $awardeeCountry = null, $awardeeCountryDesc = null, $awardeeProvince = null, $awardeeProvinceDesc = null, $awardeeCity = null, $obs = null, $obsWaybillNote = null, $flexiTare = null, $flexiContainer = null, $flexiBookNumber = null, $tankType = null, $swtCallOff = null, $driverId = null, $driverIdCountry = null, $driverIdCountryDesc = null, $driverName = null, $swtSample = null, $priceTransport = null, $currencyPrice = null, $umPrice = null, $act = null, array $listContracts = array(), array $listStockTransferOrders = array(), $authType = null, $whoContractsTransport = null)\n {\n $this\n ->setCompany($company)\n ->setLocation($location)\n ->setThird($third)\n ->setThirdVat($thirdVat)\n ->setThirdName($thirdName)\n ->setDateFrom($dateFrom)\n ->setDateTo($dateTo)\n ->setProduct($product)\n ->setProductDesc($productDesc)\n ->setQuantity($quantity)\n ->setUm($um)\n ->setCarrier($carrier)\n ->setAgency($agency)\n ->setPlate1Country($plate1Country)\n ->setPlate1CountryDesc($plate1CountryDesc)\n ->setPlate1MeanOfTransport($plate1MeanOfTransport)\n ->setPlate1($plate1)\n ->setPlate2Country($plate2Country)\n ->setPlate2CountryDesc($plate2CountryDesc)\n ->setPlate2MeanOfTransport($plate2MeanOfTransport)\n ->setPlate2($plate2)\n ->setRfrContractThird($rfrContractThird)\n ->setRfrOrderThird($rfrOrderThird)\n ->setDestinationAddress($destinationAddress)\n ->setContactPhone($contactPhone)\n ->setDestinationTimetable($destinationTimetable)\n ->setAwardeeName($awardeeName)\n ->setAwardeeAddress($awardeeAddress)\n ->setAwardeeCode($awardeeCode)\n ->setAwardeeCountry($awardeeCountry)\n ->setAwardeeCountryDesc($awardeeCountryDesc)\n ->setAwardeeProvince($awardeeProvince)\n ->setAwardeeProvinceDesc($awardeeProvinceDesc)\n ->setAwardeeCity($awardeeCity)\n ->setObs($obs)\n ->setObsWaybillNote($obsWaybillNote)\n ->setFlexiTare($flexiTare)\n ->setFlexiContainer($flexiContainer)\n ->setFlexiBookNumber($flexiBookNumber)\n ->setTankType($tankType)\n ->setSwtCallOff($swtCallOff)\n ->setDriverId($driverId)\n ->setDriverIdCountry($driverIdCountry)\n ->setDriverIdCountryDesc($driverIdCountryDesc)\n ->setDriverName($driverName)\n ->setSwtSample($swtSample)\n ->setPriceTransport($priceTransport)\n ->setCurrencyPrice($currencyPrice)\n ->setUmPrice($umPrice)\n ->setAct($act)\n ->setListContracts($listContracts)\n ->setListStockTransferOrders($listStockTransferOrders)\n ->setAuthType($authType)\n ->setWhoContractsTransport($whoContractsTransport);\n }", "public function request(): RequestContract;", "abstract public function createContract(): ProviderCustomer;", "public function testListMemberTransactions()\n {\n }", "public function testCreateContractFees(): void\n {\n $contract = $this->createApiManager(\n [\n 'action' => 'debit',\n 'created_at' => '2019-02-25T05=>43=>31Z',\n 'currency' => 'AUD',\n 'ewallet' => [\n 'created_at' => '2019-02-24T23=>34=>11Z',\n 'currency' => 'AUD',\n 'id' => '6e967a8e9971aab24d2db4e932ca1a06',\n 'pan' => 'Y...K8Y7',\n 'primary' => true,\n 'reference' => 'YNGANFK8Y7',\n 'type' => 'ewallet',\n 'updated_at' => '2019-02-24T23=>34=>11Z',\n 'user' => [\n 'created_at' => '2019-02-24T23=>34=>11Z',\n 'email' => '[email protected]',\n 'updated_at' => '2019-02-24T23=>34=>11Z',\n ],\n ],\n 'fixed_fee' => '0.02',\n 'group' => 'Mastercard',\n 'type' => 'contract',\n 'updated_at' => '2019-02-26T03=>19=>03Z',\n 'user' => [\n 'created_at' => '2019-02-24T23=>34=>11Z',\n 'email' => '[email protected]',\n 'updated_at' => '2019-02-24T23=>34=>11Z',\n ],\n 'variable_rate' => '0.10',\n ],\n 200\n )->create((string)\\getenv('PAYMENTS_API_KEY'), new Contract(\n [\n 'group' => 'mastercard',\n 'currency' => 'AUD',\n 'fixed_fee' => '0.02',\n 'variable_rate' => '0.10',\n 'user' => new User(['id' => 'external-user-id']),\n ]\n ));\n\n self::assertInstanceOf(Contract::class, $contract);\n\n /**\n * @var \\EoneoPay\\PhpSdk\\Endpoints\\Users\\Contract $contract\n *\n * @see https://youtrack.jetbrains.com/issue/WI-37859 - typehint required until PhpStorm recognises assertion\n */\n self::assertInstanceOf(Ewallet::class, $contract->getEwallet());\n }", "public function testCreatePayrun()\n {\n }", "public function modifyContract(ContractModifyRequest $request)\n {\n $user = LoginController::currentUser();\n if (!$request->has('contract') && (AccessController::isMembership($user) || AccessController::isPledgeEducator($user))) {\n //Process bulk transactions\n $brothers = $request->get('brothers');\n $failedBrothers = [];\n $successBrothers = [];\n foreach ($brothers as $brother) {\n $id = $brother['id'];\n $newContract = $brother['contract'];\n if (!$this->changeContract($id, $newContract)) {\n array_push($brothers, $brother->id);\n } else {\n array_push($successBrothers, ['id' => $id, 'contract' => $newContract]);\n }\n }\n if (count($failedBrothers) == 0) {\n return Response::json(['message' => 'OK', 'brothers' => $successBrothers], 200);\n } else {\n return Response::json([\n 'errors' => [\n 'general' => [\n 'An error occured signing contracts for users: .' . join(',', $failedBrothers)\n ]\n ]\n ], 500);\n }\n } else {\n //Process a personal transaction. Check to make sure that contract signing is enabled.\n if (GlobalVariable::ContractSigning()->value) {\n $newContract = $request->get('contract');\n if ($this->changeContract($user->id, $newContract)) {\n //Send responses to committees to membership vp and the person who signed.\n $semester = Semester::currentSemester();\n $contract = $user->contractForSemester($semester);\n $contractName = $contract::$name;\n $userFullName = $user->getFullDisplayName();\n $userId = $user->id;\n $semesterText = ucwords($semester->semester) . ' ' . $semester->year;\n $reason = null;\n if ($newContract == 'Active' || $newContract == 'Associate') {\n $committees = $request->get('committees');\n $committees = collect($committees)->sortBy(function ($item) {\n return $item['rating'];\n });\n $committees->transform(function ($item) {\n return $item['name'];\n });\n } else {\n $committees = null;\n }\n if ($newContract == 'Inactive') {\n $reason = $request->get('reason');\n }\n Mail::queue('emails.contracts.contract_signed',\n compact('contractName', 'userFullName', 'semesterText', 'committees', 'reason', 'userId'),\n function ($message) use ($userId, $userFullName, $semesterText) {\n $message->to($userId . '@case.edu',\n $userFullName)->subject('Contract Signed for ' . $semesterText);\n });\n Mail::queue('emails.contracts.contract_sign_results',\n compact('contractName', 'userFullName', 'semesterText', 'committees', 'reason', 'userId'),\n function ($message) use ($userId, $userFullName, $semesterText) {\n $message->to('[email protected]',\n $userFullName)->subject('Contract Signed for ' . $userFullName . ' (' . $userId . ') ' . $semesterText);\n });\n return Response::json(['message' => 'OK'], 200);\n } else {\n return Response::json(['errors' => ['general' => ['An error occurred signing your contract.']]],\n 500);\n }\n } else {\n return Response::json(['errors' => ['general' => ['Contract signing is not enabled at this time.']]],\n 403);\n }\n }\n }", "abstract public function determineTransaction();", "public function getContractInfo()\n {\n return $this->get(self::CONTRACTINFO);\n }", "function getContractList() {\n $sql = \"SELECT * FROM contract ORDER BY id DESC\";\n return getAll($sql);\n}", "public function getContractID() {\r\n\t\treturn $this->contract_id;\r\n\t}", "function head() {\n global $_lib;\n\n $query = \"select max(RemittanceDaySequence) from invoicein where RemittanceSendtDateTime='\" . $_lib['sess']->get_session('Date') . \"' and Active=1\";\n #print \"Finn h¿yeste dag sekvens: $query\";\n $daysequence = $_lib['storage']->get_row(array('query' => $query));\n\n $query = \"select max(RemittanceSequence) from invoicein where Active=1\";\n #print \"Finn h¿yeste sekvens: $query\";\n $sequence = $_lib['storage']->get_row(array('query' => $query));\n \n #print \"<h2>Her kommer remitteringsfila p&aring; TelePay 2.0.1 formatet</h2>\";\n $transaction = new stdClass();\n $this->transaction->RemittanceSequence = $daysequence->RemittanceSequence + 1; #MŒ kalkuleres og settes\n $this->transaction->RemittanceDaySequence = $daysequence->RemittanceDaySequence; #MŒ kalkuleres og settes\n\n #$this->transaction->BatchID = 99; #MŒ kalkuleres og settes\n $this->transaction->Date = $_lib['sess']->get_session('Date');\n $this->transaction->Datetime = $_lib['sess']->get_session('Datetime');\n $this->transaction->VersionSoftware = '00001.00 LODO';\n \n $old_pattern = array(\"/[^0-9]/\");\n $new_pattern = array(\"\");\n $this->transaction->CustomerOrgNumber = strtolower(preg_replace($old_pattern, $new_pattern , $_lib['sess']->get_companydef('OrgNumber'))); \n $this->transaction->CustomerName = $_lib['sess']->get_companydef('CompanyName');\n $this->transaction->Database = $_SETUP['DB_NAME']['0'];\n \n $this->transaction->NumTransactions = 0;\n $this->transaction->TotalAmount = 0;\n $this->transaction->NumRecords = 0; \n\n if(!$InvoiceO->CustomerBankAccount) { #Sjekke lengde og modulus pŒ kontonummer ogsŒ\n $_lib['message']->Add(\"Betalerkonto mangler\");\n return;\n }\n if(!$this->transaction->CustomerOrgNumber) {\n $_lib['message']->Add(\"Orgnummer/personnummer mangler p&aring; betaler\");\n return;\n }\n }", "public function testGetContractFees(): void\n {\n $apiManager = $this->createApiManager(\n [\n 'action' => 'debit',\n 'created_at' => '2019-02-25T05:43:31Z',\n 'currency' => 'AUD',\n 'ewallet' => [\n 'created_at' => '2019-02-24T23:34:11Z',\n 'currency' => 'AUD',\n 'id' => '6e967a8e9971aab24d2db4e932ca1a06',\n 'pan' => 'Y...K8Y7',\n 'primary' => true,\n 'reference' => 'YNGANFK8Y7',\n 'type' => 'ewallet',\n 'updated_at' => '2019-02-24T23:34:11Z',\n 'user' => [\n 'created_at' => '2019-02-24T23:34:11Z',\n 'email' => '[email protected]',\n 'id' => '3T93F7TXCVGX4ZV7AFW2',\n 'updated_at' => '2019-02-24T23:34:11Z',\n ],\n ],\n 'fixed_fee' => '0.02',\n 'group' => 'Mastercard',\n 'type' => 'contract',\n 'updated_at' => '2019-02-26T03:19:03Z',\n 'user' => [\n 'created_at' => '2019-02-24T23:34:11Z',\n 'email' => '[email protected]',\n 'id' => '3T93F7TXCVGX4ZV7AFW2',\n 'updated_at' => '2019-02-24T23:34:11Z',\n ],\n 'variable_rate' => '0.10',\n ],\n 201\n );\n\n /** @var \\EoneoPay\\PhpSdk\\Endpoints\\Users\\Contract $contract */\n $contract = $apiManager->findOneBy(\n Contract::class,\n (string)\\getenv('PAYMENTS_API_KEY'),\n ['userId' => '3T93F7TXCVGX4ZV7AFW2']\n );\n\n self::assertSame('0.10', $contract->getVariableRate());\n self::assertSame('Mastercard', $contract->getGroup());\n self::assertSame('AUD', $contract->getCurrency());\n self::assertSame('0.02', $contract->getFixedFee());\n self::assertSame('debit', $contract->getAction());\n self::assertInstanceOf(User::class, $contract->getUser());\n self::assertInstanceOf(Ewallet::class, $contract->getEwallet());\n }", "public function create_unsigned_contract()\n {\n $contract_id = factory(Contract::class, 'testing_unsigned_legal')->create([\n 'value' => $value = self::$faker->numberBetween(5000, 100000),\n 'start_date' => '',\n 'end_date' => '',\n 'participants' => $participants = rand(12, 20),\n 'payments' => $payments = rand(0, 12),\n 'client_id' => $client_id = factory(Legal::class, 'accept_meeting')->create()->client_id\n ])->id;\n for ($i = 1; $i <= $participants; $i++) {\n $participant_id = factory(Participant::class)->create()->id;\n factory(ContractParticipant::class)->create([\n 'contract_id' => $contract_id,\n 'participant_id' => $participant_id\n ]);\n }\n for ($i = 1; $i <= $payments; $i++) {\n $payment_id = factory(Payment::class)->create([\n 'value_euro' => $value_euro = round($value/$payments),\n 'pay_date' => date('Y-m-d', strtotime(\"+\".$i.\" month\")),\n 'contract_id' => $contract_id\n ])->id;\n factory(Invoice::class)->create([\n 'value_euro' => $value_euro,\n 'paid_date' => date('Y-m-d', strtotime(\"+\".$i.\" month\")),\n 'payment_id' => $payment_id,\n 'contract_id' => $contract_id,\n 'client_id' => $client_id\n ]);\n }\n }", "public function getContractNum()\n {\n return $this->contract_num;\n }", "public function source(): SourceContract;", "public function implementation_pending(): void\n {\n }", "private function jumpThroughContracts()\r\n {\r\n $this->getRelatedOwners();\r\n switch (strtolower($this->option('type'))) {\r\n case 'new':\r\n $this->newContract();\r\n break;\r\n case 'update':\r\n $this->updatedContract();\r\n break;\r\n default:\r\n $this->error(\"No type selected {new, update}\");\r\n }\r\n }", "public function testCreatePayItem()\n {\n }", "public function tellNotEnoughMoneyInAccount()\n {\n }", "public function getContractStartDate(): DateTime\n {\n return $this->contractStartDate;\n }", "public function postImportContractAdd(){\n\t\t$inputs = \\Input::all();\n\t\t$val = true; /*Validator::make($input,Contract::$contractRule);*/\n\t\tif($val){\n\t\t\t$feederSteerQty = \\Input::get('feedersteer_quantity');\n\t\t\t$feederHeiferQty = \\Input::get('feederheifer_quantity');\n\t\t\t$breederBullQty = \\Input::get('breederbull_quantity');\n\t\t\t$breederHeiferQty = \\Input::get('breederheifer_quantity');\n\t\t\t$feederSteerWeight = \\Input::get('feedersteer_weight');\n\t\t\t$feederHeiferWeight = \\Input::get('feederheifer_weight');\n\t\t\t$breederBullWeight = \\Input::get('breederbull_weight');\n\t\t\t$breederHeiferWeight = \\Input::get('breederheifer_weight');\n\t\t\t$feederSteerPrice = \\Input::get('feedersteer_price');\n\t\t\t$feederHeiferPrice = \\Input::get('feederheifer_price');\n\t\t\t$breederBullPrice = \\Input::get('breederbull_price');\n\t\t\t$breederHeiferPrice = \\Input::get('breederheifer_price');\n\t\t\t//\n\t\t\t$importDate = date(\"Y-m-d\",strtotime(\\Input::get('import_date')));\n\t\t\t$openLcDate = date(\"Y-m-d\",strtotime(\\Input::get('lc_open_last_date')));\n\t\t\t$contractInsert = array(\n\t\t\t\t'feedersteer_quantity' => $feederSteerQty,\n\t\t\t\t'feederheifer_quantity' => $feederHeiferQty,\n\t\t\t\t'breederbull_quantity' => $breederBullQty,\n\t\t\t\t'breederheifer_quantity' => $breederHeiferQty,\n\t\t\t\t'feedersteer_weight'\t=> $feederSteerWeight,\n\t\t\t\t'feederheifer_weight'\t=> $feederHeiferWeight,\n\t\t\t\t'breederbull_weight'\t=> $breederBullWeight,\n\t\t\t\t'breederheifer_weight'\t=> $breederHeiferWeight,\n\t\t\t\t'feedersteer_price'\t=>$feederSteerPrice,\n\t\t\t\t'feederheifer_price'\t=> $feederHeiferPrice,\n\t\t\t\t'breederbull_price'\t\t=>$breederBullPrice,\n\t\t\t\t'breederheifer_price'\t=> $breederHeiferPrice,\n\t\t\t\t'name'\t=> $inputs['imp_contract_name'],\n\t\t\t\t'import_date'=>$importDate,\n\t\t\t\t'lc_open_last_date' => $openLcDate,\n\t\t\t\t'imp_status_text' => \\input::get('imp_status_text'),\n\t\t\t\t'partner_id' => $inputs['partner_id'],\n\t\t\t\t'farm_id'\t=>$inputs['farm_id'],\n\t\t\t\t'company_id' => $inputs['company_id'],\n\t\t\t\t'port_id' => $inputs['port_id']\n\t\t\t);\n\n\t\t\t// Tinh so lan nhap cua doi tac\t\t\t\n\t\t\t$importCounts = Contract::where('partner_id',$inputs['partner_id'])->count() + 1;\n\t\t\t//Tinh don gia trung binh nhap\n\t\t\t$partner = Partner::find($inputs['partner_id']);\t\t\t\n\t\t\t$newAvgPrice = array();\n\t\t\tif($partner){\n\t\t\t\t$currentAvgPrices = json_decode($partner->import_avg_prices,true);\n\t\t\t\tforeach ($currentAvgPrices as $key => $price) {\n\t\t\t\t\t$varName = $key.'Price';\n\t\t\t\t\t$newAvgPrice[$key] = (($importCounts - 1) * $price + $$varName) / ($importCounts);\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry{\n\t\t\t\tContract::create($contractInsert);\n\t\t\t\t$partner->update(array(\n\t\t\t\t\t'import_counts'=>$importCounts,\n\t\t\t\t\t'import_avg_prices' => json_encode($newAvgPrice)\n\t\t\t\t));\n\t\t\t\treturn \\Redirect::route('admin_report_import_contract_get')->with('success',\"Thêm thành hợp đồng nhập bò\");\n\t\t\t}catch(exp $e ){\n\t\t\t\treturn \\Redirect::route('admin_report_import_contract_get')->with('error',\"Lỗi hệ thống, vui lòng liên hệ quản trị\");\n\t\t\t}\t\t\t\t\n\t\t}else{\n\t\t\treturn $val->errors();\n\t\t}\n\t}", "protected function __construct() {\n $this->state = State::PENDING;\n $date = date('Y-m-d H:i:s');\n $this->createTime = new \\DateTime();\n $this->updateTime = new \\DateTime();\n $this->appt = null;\n $this->invoiceId = -1;\n }", "public function deleted(Contract $contract)\n {\n //\n }", "public function run()\n\t{\n\t\tContractType::create([\n\t\t\t'key' => 'monthly',\n\t\t\t'description' => 'Mensual']);\n\n\t\tContractType::create([\n\t\t\t'key' => 'biannual',\n\t\t\t'description' => 'Semestral']);\n\t\t\n\t\tContractType::create([\n\t\t\t'key' => 'annual',\n\t\t\t'description' => 'Anual']);\n\t}", "public function testBillingDownloadInvoice()\n {\n }", "public function createTransaction()\n {\n }", "private function sellTrasactionPendingAddsMoney(){\n\n }", "public function __construct(DeliveredContract $contract)\n {\n $this->contract = $contract;\n }", "public function testPayersPayerTypeCommissionAmountGet()\n {\n }", "public function response(): ResponseContract;", "function init_item_relate_contract($contract) {\n\tif ($contract) {\n\t\techo '<li>\n <a href=\"' . admin_url('team_password/items_relate/' . $contract->id) . '\" target=\"_blank\">\n ' . _l('view_items_relate') . '\n </a>\n </li>';\n\t} else {\n\t\techo '';\n\t}\n}", "function getContract() {\n $etp = $this->entity_table;\n $eid = $this->entity_id;\n switch ($etp) {\n case 'civicrm_contribution_recur' :\n $recur = new CRM_Contribute_BAO_ContributionRecur();\n $recur->get('id', $eid);\n return $recur;\n break;\n case 'civicrm_contribution' :\n $contr = new CRM_Contribute_BAO_Contribution();\n $contr->get('id', $eid);\n return $contr;\n break;\n default:\n echo 'Huh ? ' . $etp;\n }\n return null;\n }", "public function testRegisterNewContract()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs(factory(User::class)->create());\n $property = factory(Property::class)->create([\n 'rented' => null,\n 'status' => Property::STATUS_ACTIVE\n ]);\n $lessee = factory(Lessee::class)->create();\n\n $browser\n ->visit(route('contrato.create'))\n ->on(new CreateContractPage())\n ->assertSee('Nuevo Contrato');\n\n\n\n\n\n $browser->selectLessor($property->lessor->id);\n $browser->selectProperty($property->id);\n $browser->selectLessee($lessee->id);\n $browser->typeSlowly('@years',1);\n // Contract dates\n $this->fillInputDate($browser,'periods[0][fecha_inicio]', now());\n $this->fillInputDate($browser,'periods[0][fecha_fin]', now()->addMonth());\n $browser->typeSlowly('input[name=\\'periods[0][cantidad]\\']', random_int(1000,1210));\n\n $browser->pause(500);\n $browser->screenshot('after');\n $browser->screenshot('test');\n $browser->type('@bonus',10);\n $browser->type('@deposit',5000);\n $browser->click('@submit');\n\n $browser->assertRouteIs('contrato.index');\n $browser->assertSee('Catalogo de Contratos');\n });\n }", "function ef_contract_action_info() {\n // UPDATE COUNTRY GROUP AND CONTRACT\n $actions['ef_contract_update_country_group_and_contract'] = array(\n 'type' => 'node',\n 'label' => t('Update Country group and Contract'),\n 'configurable' => FALSE,\n 'triggers' => array('any'),\n 'behavior' => array('changes_property'),\n 'vbo_configurable' => FALSE,\n 'pass rows' => TRUE,\n );\n // UPDATE old contracts with real values (Authors and contracts)\n $actions['ef_contract_upload_contract'] = array(\n 'type' => 'node', // Here come's the name of your custom entity type\n 'label' => t('Upload contract'),\n 'configurable' => FALSE,\n 'triggers' => array('any'),\n 'behavior' => array('changes_property'),\n 'vbo_configurable' => FALSE,\n 'pass rows' => TRUE,\n );\n // UPDATE old contracts with N/A contract\n $actions['ef_contract_upload_NA_contract'] = array(\n 'type' => 'node', // Here come's the name of your custom entity type\n 'label' => t('Upload N/A contracts'),\n 'configurable' => FALSE,\n 'triggers' => array('any'),\n 'behavior' => array('changes_property'),\n 'vbo_configurable' => FALSE,\n 'pass rows' => TRUE,\n );\n // Change EF Article, CAR/REP,NC,IR Dictionary status\n // from Approved for Editing to On external Editing\n $actions['ef_editor_to_ee'] = array(\n 'type' => 'node', // Here come's the name of your custom entity type\n 'label' => t('Change status to On External Editing'),\n 'configurable' => FALSE,\n 'triggers' => array('any'),\n 'behavior' => array('changes_property'),\n 'vbo_configurable' => FALSE,\n 'pass rows' => TRUE,\n );\n // Update empty contracts for network quarterly reports\n $actions['empty_network'] = array(\n 'type' => 'node', // Here come's the name of your custom entity type\n 'label' => t('Update empty Network Quarterly Reports'),\n 'configurable' => FALSE,\n 'triggers' => array('any'),\n 'behavior' => array('changes_property'),\n 'vbo_configurable' => FALSE,\n 'pass rows' => TRUE,\n );\n\n return $actions;\n}", "public function index()\n {\n $contracts = Contract::all();\n\n foreach ($contracts as $contract) {\n dd($contract);\n\n $contract['validity'] = Carbon::createFromFormat('d/m/Y', $contract['validity']); \n \n }\n\n\n\n return view('contracts.index',compact('contracts'))\n\n ->with('i', (request()->input('page', 1) - 1) * 5);\n }", "public function model()\n {\n return Contract::class;\n }", "public function testUpdateTimesheet()\n {\n }", "public function getOperationMade() {}", "public function getContractExpirate()\n {\n $contractExpirate = false;\n foreach ($this->getContracts() as $contract ) {\n if($contract->getStatus() === 4 || $contract->getStatus() === 5 )\n $contractExpirate = true;\n }\n return $contractExpirate;\n }", "public function testReportsEmailcreditsHistoryGet()\n {\n }", "public function create_contracts_for_one_legal_client()\n {\n $client_id = factory(Legal::class, 'active')->create()->client_id;\n factory(Contract::class, 'in_progress_legal', 2)->create(['client_id' => $client_id]);\n factory(Contract::class, 'finished_legal', 2)->create(['client_id' => $client_id]);\n }", "public function getNewTCE() {}", "function sample(){\n\t\t$price = 10;\n\t\t$tax = number_format($price * .095,2); // Set tax\n\t\t$amount = number_format($price + $tax,2); // Set total amount\n\n\n \t$this->authorizenet->setFields(\n\t\tarray(\n\t\t'amount' => '10.00',\n\t\t'card_num' => '370000000000002',\n\t\t'exp_date' => '04/17',\n\t\t'first_name' => 'James',\n\t\t'last_name' => 'Angub',\n\t\t'address' => '123 Main Street',\n\t\t'city' => 'Boston',\n\t\t'state' => 'MA',\n\t\t'country' => 'USA',\n\t\t'zip' => '02142',\n\t\t'email' => '[email protected]',\n\t\t'card_code' => '782',\n\t\t)\n\t\t);\n\t\t$response = $this->authorizenet->authorizeAndCapture();\n\n\t\t/*print_r($response);*/\n\n\t\tif ($response->approved) {\n\t\techo \"approved\";\n /*echo \"APPROVED\";*/\n\t\t} else {\n echo FALSE;\n\t\t/*echo \"DENIED \".AUTHORIZENET_API_LOGIN_ID.\" \".AUTHORIZENET_TRANSACTION_KEY;*/\n\t\t}\n\n }", "function getMemberContractList() {\n $sql = \"SELECT b.* \n FROM user_contract a INNER JOIN contract b ON a.contract_id = b.id \n WHERE a.user_type = 'member' AND a.uid = ? \n ORDER BY b.id DESC\";\n return getAll($sql, [getLogin()['mid']]);\n}", "public function serch()\n {\n }", "public function testReportsReferralsPayoutHistoryGet()\n {\n }", "public function testCreateSuperfund()\n {\n }", "public function payWayPurchase()\n\t{\n\t}", "public function testUpdatePayrun()\n {\n }", "public function get_amount_requested()\n {\n }", "function main( $isFuturePay ) {\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : handling WorldPay payment response IPN\");\r\n\r\n $objects = $ids = $input = array( );\r\n\r\n $component = self::retrieve('MC_module','String','POST',true);\r\n $input[\"component\"] = $component;\r\n $contact = self::retrieve('MC_contact_id','Integer','POST',true);\r\n\r\n $this->getInput($input,$ids);\r\n\r\n if (!$isFuturePay) {\r\n // not a future payment notication but may be a future payment\r\n // agreement being made...\r\n\r\n // get ids\r\n $ids[\"contact\"] = self::retrieve('MC_contact_id','String','POST',true);\r\n $ids[\"contribution\"] = self::retrieve('MC_contribution_id','String','POST',true);\r\n $ids[\"thankyoupage\"] = self::retrieve('MC_civi_thankyou_url','String','POST',true);\r\n $ids[\"cancelpage\"] = self::retrieve('MC_civi_cancel_url','String','POST',true);\r\n if ($component=='event') {\r\n $ids[\"event\"] = self::retrieve('MC_event_id','String','POST',true);\r\n $ids[\"participant\"] = self::retrieve('MC_participant_id','String','POST',true);\r\n }\r\n else {\r\n // contribution optional id's\r\n $ids['membership'] = self::retrieve('MC_membership_id','String','POST',false);\r\n $ids['contributionRecur'] = self::retrieve( 'MC_contribution_recur_id', 'Integer', 'GET', false );\r\n $ids['contributionPage'] = self::retrieve( 'MC_contribution_page_id' , 'Integer', 'GET', false );\r\n }\r\n\r\n if (is_numeric($input[\"futurePayId\"])) {\r\n // this is a futurepay agreement being made \r\n // so store the ids and do nothing more here\r\n // since no money has actually been transferred yet\r\n // ...watch futurepay repsonse for such transfers\r\n self::storeFuturePayIds($component,$input[\"futurePayId\"],$ids);\r\n return;\r\n }\r\n }\r\n else {\r\n if (!is_numeric($input[\"futurePayId\"])) {\r\n CRM_Core_Error::debug_log_message(\"futurePayId is missing for recurring payment.\");\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : futurePayId is missing for recurring payment. input=\".print_r($input,true));\r\n exit();\r\n }\r\n self::retrieveFuturePayIds($component,$input[\"futurePayId\"],$ids);\r\n if (!$ids) {\r\n CRM_Core_Error::debug_log_message(\"Some sort of error occured retrieving ids for futurePayId=$futurePayId\");\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : Some sort of error occured retrieving ids for futurePayId=$futurePayId\");\r\n exit();\r\n }\r\n }\r\n\r\n $paymentProcessorID = self::retrieve('processor_id', 'Integer', 'POST', FALSE);\r\n if (empty($paymentProcessorID)) {\r\n $processorParams = array(\r\n 'user_name' => self::retrieve('installation', 'String', 'POST', FALSE),\r\n 'payment_processor_type_id' => CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessorType', 'WorldPay', 'id', 'name'),\r\n 'is_test' => empty($input['is_test']) ? 0 : 1,\r\n );\r\n\r\n $processorInfo = array();\r\n if (!CRM_Financial_BAO_PaymentProcessor::retrieve($processorParams, $processorInfo)) {\r\n return FALSE;\r\n }\r\n $paymentProcessorID = $processorInfo['id'];\r\n }\r\n\r\n // validateData also loads the obects\r\n if (!$this->validateData($input,$ids,$objects,TRUE,$paymentProcessorID)) {\r\n error_log(__FILE__.\":\".__LINE__.\": validate data failed, input=\".print_r($input,true).\" ids=\".print_r($ids,true));\r\n return false;\r\n }\r\n\r\n self::$_paymentProcessor =& $objects['paymentProcessor'];\r\n if ($isFuturePay) {\r\n // future pay payment notification\r\n return $this->handleFuturepayPayment($input,$ids,$objects);\r\n }\r\n else if (is_numeric($input[\"futurePayId\"])) {\r\n // future pay payment initial agreement set up\r\n // appears like a single payment but no money changes hands\r\n return $this->handleFuturepayAgreement($input,$ids,$objects);\r\n }\r\n else {\r\n // single payment\r\n error_log(__FILE__.\":\".__FUNCTION__.\" : now processing single payment\");\r\n return $this->handleSinglePayment($input,$ids,$objects);\r\n }\r\n }", "public function creditCardPayment()\n {\n }", "public function restored(Contract $contract)\n {\n //\n }", "function addContractHandler() {\n global $inputs;\n\n $cid = insert('contract',[\n 'title' => $inputs['title'],\n 'content' => $inputs['content'],\n 'status' => $inputs['status'],\n ]);\n\n $loginInfo = getLogin();\n if (isset($loginInfo['uid']) && $loginInfo['uid'] ) {\n $userType = 'admin';\n $uid = $loginInfo['uid'];\n } else {\n $userType = 'member';\n $uid = $loginInfo['mid'];\n }\n\n insert('user_contract',[\n 'user_type' => $userType,\n 'uid' => $uid,\n 'contract_id' => $cid,\n ]);\n\n formatOutput(true, 'add success');\n}", "private function _consolideDate(){\n\t\t$this->_mktime();\n\t\t$this->_setDate();\n\t}", "function show_estimated_ship_date_new_subscription_orders_email( $order ) { \n $item = array_pop( $order->get_items() );\n if ( $order->status == 'processing' && $item['name'] != 'Try or Gift' ) {\n echo '<h2>Estimated Shipment Date</h2>';\n echo '<p>Your package ships by: <strong>' . new_orders_next_subscription_ship_date( $order->order_date ) . '</strong>.</p>';\n }\n}", "public function testCreatePayrollCalendar()\n {\n }", "public function getC() {}", "public function reservation()\n\t{\n\n\t}", "public function blockchain(Request $request2){\n\n\n $customer_id = $request2->session()->get(\"customer_id\");\n// $package = $this->getUserPendingPackage(Session::get('customer_id'));\n//\n// $cpackage = CustomerPackages::find($customer->last_package_hsitory);\n// $price = $cpackage->quantity * $package->price;\n\n\n $customer = Customer::find(Session::get('customer_id'));\n $package = Package::find($customer->next_package);\n $cpackage = CustomerPackages::find($customer->last_package_hsitory);\n $price = $cpackage->quantity * $package->price;\n\n\n $old_address = \\App\\blockchain::where([[\"customer_id\",$customer_id],[\"package_id\",$package->id],[\"status\",\"pending\"]])->orderBy(\"id\",\"desc\")->first();\n\n\n if(empty($old_address)){\n\n $api_key = env(\"BLOCKCHAIN_API_KEY\");\n $xpub = env(\"BLOCKCHAIN_UPUB_KEY\");\n $secret = env(\"BLOCKCHAIN_SECRIT\");\n\n\n\n\n\n $payment_h = new PaymentsHistory;\n $payment_h->customer_id = $customer_id;\n $payment_h->package_id = $package->id;\n $payment_h->payment_value = $price;\n $payment_h->payment_type = \"pay\";\n $payment_h->gateway = \"BlockChain\";\n $payment_h->status = \"PaymentPending\";\n $payment_h->save();\n\n $payment_id = $payment_h->id;\n\n\n $callbackURL = url(\"/blockchain/callback?payment=\".$payment_id.\"&secret=\".$secret);\n\n\n\n\n $receive_url = \"https://api.blockchain.info/v2/receive?key=\".$api_key.\"&xpub=\".$xpub.\"&callback=\".urlencode($callbackURL).\"&gap_limit=10000\";\n\n $request = curl_init();\n curl_setopt($request, CURLOPT_SSL_VERIFYPEER, true);\n curl_setopt($request, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($request, CURLOPT_URL, $receive_url);\n $response = curl_exec($request);\n\n $response = json_decode($response, true);\n\n\n//return $response;\n $paymentAddress = $response['address'];\n\n\n\n\n\n\n\n\n\n\n\n $btc_value = file_get_contents(\"https://www.blockchain.com/tobtc?currency=usd&value=\" .$price);\n\n\n\n\n\n $oaddress = new \\App\\blockchain();\n $oaddress->customer_id = $customer_id;\n $oaddress->address = $paymentAddress;\n $oaddress->value = $btc_value;\n $oaddress->package_id = $package->id;\n $oaddress->payment_id = $payment_id;\n $oaddress->status = \"pending\";\n $oaddress->save();\n\n\n }else{\n\n\n\n $paymentAddress = $old_address->address;\n $btc_value = $old_address->value;\n\n\n }\n\n\n\n\n\n\n return view(\"FrontEnd.Payments.Checkout.blockchain\",compact(\"paymentAddress\",\"btc_value\"));\n\n\n }", "function createContract( $contract=null ){\n global $mysqli;\n if(!isset($contract) || $contract=='')\n return;\n $contract = $mysqli->real_escape_string($contract);\n $results = $mysqli->query(\"SELECT id FROM index_contracts WHERE contract='{$contract}' LIMIT 1\");\n if($results){\n if($results->num_rows){\n $row = $results->fetch_assoc();\n return $row['id'];\n } else {\n $results = $mysqli->query(\"INSERT INTO index_contracts (contract) values ('{$contract}')\");\n if($results){\n return $mysqli->insert_id;\n } else {\n byeLog('Error while trying to create record in index_contracts table');\n }\n }\n } else {\n byeLog('Error while trying to lookup record in index_contracts table');\n }\n}", "protected function getStub()\n {\n //\n }", "public function if_is_instance_of_contract()\n {\n $this->assertInstanceOf('App\\Contract', self::$contract);\n }", "public function testGetUnitBillingMethods()\n {\n }", "public function inquire_bill_get(){\r\n// if (!$this->pronet_model->inquire_bill(1, '002', '0000000',0, null, 'E004', 3)) {\r\n if (!$this->pronet_model->inquire_bill(1, '101', '999999999999',0, null, 'E007', 10)) {//test for financial services using genesis\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => FALSE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_BAD_REQUEST);\r\n } else {\r\n $response = $this->pronet_model->get_response();\r\n $this->response([\r\n 'status' => TRUE,\r\n 'message' => $response['ResponseMessage'],\r\n 'response_code' => $response['ResponseCode']\r\n ], REST_Controller::HTTP_OK);\r\n }\r\n }", "function beManaged()\n {\n }", "abstract protected function getTransactions();", "protected function Reserve()\n {\n }", "function updateContractHandler() {\n global $inputs;\n\n $res = updateDb('contract',[\n 'status' => $inputs['status'],\n 'title' => $inputs['title'],\n 'content' => $inputs['content'],\n ], [\n 'id' => $inputs['id']\n ]);\n\n formatOutput(true, 'update success', $res);\n}", "public function exchangeRate() {\n try{\n $client = new GuzzleHttp\\Client(['base_uri' => 'https://api.exchangeratesapi.io/']);\n // Latest endpoint \n $response = $client->request('GET', 'latest');\n $statusCode = $response->getStatusCode();\n if($statusCode == 200) {\n // Get body of the response and stringify\n $body = (string)$response->getBody();\n // Parse json to ApiResponse Object\n $apiResponse = new ApiResponse($body);\n // Print associative response to console\n print_r($apiResponse);\n }\n }catch(Exception $e){\n echo $e;\n }\n\n }", "public function testGetAccountPeriodicPaymentsUsingGET()\n {\n }", "public function __construct(BaseContract $contract, $column_name)\n {\n $this->contract = $contract;\n $this->column_name = $column_name;\n }", "function public_payment_info() {\n if (!$this->request->isAsyncCall()) {\n $this->response->badRequest();\n } // if\n if ($this->active_invoice->isNew()) {\n $this->response->notFound();\n } // if\n\n }", "public function payout()\n\t{\n\t}", "public function testAddExternalShipmentAudit()\n {\n }", "public function __construct($id)\n {\n $this->contract_id = $id;\n }", "public function index()\n {\n $existingContract = LoginController::currentUser()->contractForSemester(null);\n $signableContracts = Contract::getCurrentSignableContracts();\n $signableContracts->transform(function ($item) {\n\n if($item->version > 1){\n $contractVersionCode = $item->contract_name . 'V' . $item->version;\n } else {\n $contractVersionCode = $item->contract_name;\n }\n $actualName = Contract::ContractHome . $contractVersionCode . 'Contract';\n $meta = $actualName::getMetadata();\n $item->code = $contractVersionCode;\n $item->metadata = $meta;\n return $item;\n });\n// dd($signableContracts);\n return view('contracts.sign')->with(compact('existingContract', 'signableContracts'));\n }", "public function testUpdateExternalShipment()\n {\n }", "public function testCorrectCanBuyWithEqualMoney(){\n\t\t\t//ARRANGE\n\t\t\t$a= new APIManager();\n\t\t\t$b= new PortfolioManager(14);\n\t\t\t$b->setBalance(100);\n\t\t\t$c= new Trader($a, $b);\n\t\t\t$stock = new Stock(\"Google\",\"GOOGL\",100,10,9);\n\t\t\t//ACT \n\t\t\t$result = $c->canBuy($stock,1);\n\t\t\t//ASSERT\n\t\t\t$this->assertEquals(True,$result);\n\n\t\t}", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "public function create_contracts_with_all_statuses()\n {\n factory(Contract::class, 'unsigned_legal', 3)->create();\n factory(Contract::class, 'in_progress_legal', 3)->create();\n factory(Contract::class, 'finished_legal', 3)->create();\n factory(Contract::class, 'broken_legal', 3)->create();\n }", "public function __construct()\n {\n $now = new \\DateTime();\n $this->number = 'CR' . $now->format('Y') . $now->format('m') . '-';\n $this->dateCreation = new \\DateTime();\n $this->dateEnlevement = new \\DateTime();\n $this->heureEnlevement = new \\DateTime('14:00');\n $this->dateRetour = new \\DateTime('NOW + 2 day');\n $this->heureRetour = new \\DateTime('14:00');\n $this->effectue = false;\n $this->annule = false;\n $this->factureRecue = false;\n $this->mailSent = false;\n $this->nbJoursExploit = 1;\n $this->avecHayon = false;\n }", "public function beforeSave()\n {\n parent::beforeSave();\n $currentDate = new \\DateTime('now', new \\DateTimeZone($this->_localeDate->getConfigTimezone()));\n\n if (!$this->getId()) {\n $this->setDateCreated($currentDate);\n if (!$this->hasCode()) {\n $this->_defineCode();\n }\n $this->setIsNew(true);\n } else {\n if ($this->getOrigData('balance') != $this->getBalance()) {\n if ($this->getBalance() > 0) {\n $this->setState(self::STATE_AVAILABLE);\n } elseif ($this->getIsRedeemable() && $this->getIsRedeemed()) {\n $this->setState(self::STATE_REDEEMED);\n } else {\n $this->setState(self::STATE_USED);\n }\n }\n }\n\n if (is_numeric($this->getLifetime()) && $this->getLifetime() > 0) {\n $this->setDateExpires(\n $this->_localeDate->date(clone $currentDate)\n ->modify('+' . $this->getLifetime() . ' days')\n ->format('Y-m-d')\n );\n } else {\n if ($this->getDateExpires()) {\n if ($this->isExpired()) {\n throw new \\Magento\\Framework\\Exception\\LocalizedException(\n __('The expiration date must be set in the future.')\n );\n }\n } else {\n $this->setDateExpires(null);\n }\n }\n\n if (!$this->getId() && !$this->hasHistoryAction()) {\n $this->setHistoryAction(\\Magento\\GiftCardAccount\\Model\\History::ACTION_CREATED);\n }\n\n if (!$this->hasHistoryAction() && $this->getOrigData('balance') != $this->getBalance()) {\n $this->setHistoryAction(\n \\Magento\\GiftCardAccount\\Model\\History::ACTION_UPDATED\n )->setBalanceDelta(\n $this->getBalance() - $this->getOrigData('balance')\n );\n }\n if ($this->getBalance() < 0) {\n throw new \\Magento\\Framework\\Exception\\LocalizedException(\n __('The balance cannot be less than zero.')\n );\n }\n }", "public function testGettingTransactionDetails() {\n $txHash = $this->getLastPendingTransaction();\n $txDetails = $this->ethplorer->getTransactionDetails($txHash);\n $this->assertArrayHasKey('pending', $txDetails);\n $this->assertTrue($txDetails['pending']);\n }" ]
[ "0.7120781", "0.6909136", "0.67331195", "0.6431208", "0.5920787", "0.58612776", "0.57814384", "0.5768268", "0.57597154", "0.5673181", "0.5615752", "0.55808735", "0.55312884", "0.55234456", "0.549727", "0.54504263", "0.543962", "0.5326813", "0.52910674", "0.5274576", "0.52624875", "0.5250048", "0.5232987", "0.52278364", "0.5176854", "0.5176525", "0.51680857", "0.5161991", "0.5158933", "0.5148377", "0.5128894", "0.5101818", "0.50874156", "0.5086819", "0.5067757", "0.5064893", "0.50586635", "0.5015341", "0.50151265", "0.5015108", "0.49799377", "0.49651867", "0.49480736", "0.4946449", "0.49416065", "0.49296564", "0.49230355", "0.49191424", "0.4907804", "0.49073762", "0.49015948", "0.48991928", "0.4895185", "0.48892134", "0.488779", "0.4884798", "0.4883865", "0.488314", "0.4876392", "0.48537207", "0.4853296", "0.48500556", "0.4849794", "0.48489523", "0.48472208", "0.4832445", "0.48310298", "0.48263496", "0.48242256", "0.48226672", "0.48223487", "0.48217106", "0.48212996", "0.48210317", "0.48183492", "0.48170736", "0.48142582", "0.48007882", "0.4791956", "0.47834083", "0.47822732", "0.4776522", "0.47750106", "0.47731283", "0.4772497", "0.47723705", "0.47717252", "0.47698444", "0.4766644", "0.47656727", "0.4765614", "0.47641134", "0.47568923", "0.47530428", "0.47514674", "0.47514674", "0.47514674", "0.47476268", "0.47435454", "0.47428498", "0.47423714" ]
0.0
-1
Display a listing of the resource.
public function index() { $tags = Tag::whereHas('articles', function($query) { $query->released(); })->get()->sortBy('name')->values(); return view('tags.index')->with('tags', $tags); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n {\n $this->booklist();\n }", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7447426", "0.73628515", "0.73007894", "0.7249563", "0.7164474", "0.7148467", "0.71320325", "0.7104678", "0.7103152", "0.7100512", "0.7048493", "0.6994995", "0.69899315", "0.6935843", "0.6899995", "0.68999326", "0.6892163", "0.6887924", "0.6867505", "0.6851258", "0.6831236", "0.68033123", "0.6797587", "0.6795274", "0.67868614", "0.67610204", "0.67426085", "0.67303514", "0.6727031", "0.67257243", "0.67257243", "0.67257243", "0.67195046", "0.67067856", "0.67063624", "0.67045796", "0.66655326", "0.666383", "0.66611767", "0.66604036", "0.66582054", "0.6654805", "0.6649084", "0.6620993", "0.66197145", "0.6616024", "0.66077465", "0.6602853", "0.6601494", "0.6593894", "0.65878326", "0.6586189", "0.6584675", "0.65813804", "0.65766823", "0.65754175", "0.657203", "0.657202", "0.65713936", "0.65642136", "0.6563951", "0.6553249", "0.6552584", "0.6546312", "0.6536654", "0.6534106", "0.6532539", "0.6527516", "0.6526785", "0.6526042", "0.65191233", "0.6518727", "0.6517732", "0.6517689", "0.65155584", "0.6507816", "0.65048593", "0.6503226", "0.6495243", "0.6492096", "0.6486592", "0.64862204", "0.6485348", "0.6483991", "0.64789015", "0.6478804", "0.64708763", "0.6470304", "0.64699143", "0.6467142", "0.646402", "0.6463102", "0.6460929", "0.6458856", "0.6454334", "0.6453653", "0.645357", "0.6450551", "0.64498454", "0.64480853", "0.64453584" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create()\n {\n return view('student::students.student.create');\n }" ]
[ "0.7593198", "0.7593198", "0.75881755", "0.75787884", "0.7570936", "0.74992913", "0.7436037", "0.7431172", "0.7386512", "0.7351077", "0.7337819", "0.73100585", "0.7295612", "0.72803086", "0.7272473", "0.72422874", "0.7229479", "0.7224403", "0.7184453", "0.7177193", "0.7173551", "0.71482", "0.71424824", "0.7141885", "0.7135663", "0.7126202", "0.7121413", "0.7113729", "0.7113729", "0.7113729", "0.7110717", "0.7092118", "0.7083616", "0.7080794", "0.7078082", "0.70561296", "0.70561296", "0.7054459", "0.703925", "0.70373696", "0.70346737", "0.70324355", "0.70287114", "0.7025425", "0.7025232", "0.7018496", "0.7016745", "0.7002774", "0.70019513", "0.69991785", "0.69942427", "0.69936013", "0.69929653", "0.6988009", "0.69856364", "0.6965122", "0.6964889", "0.6955187", "0.69511235", "0.69497", "0.6947041", "0.69432163", "0.6940678", "0.6939846", "0.6936846", "0.6936846", "0.6936506", "0.6933589", "0.69309", "0.69273484", "0.6925485", "0.6921386", "0.6917649", "0.6913987", "0.6910826", "0.6909406", "0.69085246", "0.6907409", "0.69021183", "0.6900961", "0.68997645", "0.68991655", "0.6894049", "0.68920606", "0.6892033", "0.6891114", "0.6890811", "0.6890811", "0.6887868", "0.6887327", "0.68854356", "0.688366", "0.68805534", "0.68766564", "0.68753666", "0.6872474", "0.68717086", "0.6869974", "0.6869806", "0.6868809", "0.68685615" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { // Get the specified tag that has one released article at least $tag = Tag::whereHas('articles', function($query) { $query->released(); })->findOrFail($id); // Get the articles those applied current tag, and paginate them $data = $tag->with('articles.thumbnails')->get()->filter(function($item) use ($tag) { return $item->id = $tag->id && $item->name === $tag->name; })->first()->articles->filter(function($item) { return $item->approval != 0 && $item->released_at <= Carbon::now(); })->values(); // Paginate by manual $perPage = 15; $currentPage = Paginator::resolveCurrentPage(); $totalArticles = $data->count(); $articles = $data->slice(($currentPage - 1) * $perPage, $perPage)->all(); $pagination = new LengthAwarePaginator($articles, $totalArticles, $perPage, $currentPage, [ 'path' => Paginator::resolveCurrentPath(), 'pageName' => 'page', ]); // -- manual pagination end -- // Other popular tags $popular = Tag::with(['articles' => function($query) { $query->released(); }])->get()->filter(function($item) { return $item->articles->isEmpty() !== true; })->sortByDesc(function($item) { return $item->articles->count(); }); return view('tags.show', [ 'tag' => $tag, 'articles' => $articles, 'pagination'=> $pagination, 'popular' => $popular, ])->with('id', (int) $id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit(form $form)\n {\n //\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.7854417", "0.7692986", "0.72741747", "0.72416574", "0.7173436", "0.706246", "0.70551765", "0.698488", "0.6948513", "0.694731", "0.69425464", "0.6929177", "0.6902573", "0.6899662", "0.6899662", "0.6878983", "0.6865711", "0.6861037", "0.6858774", "0.6847512", "0.6836162", "0.68129057", "0.68083996", "0.68082106", "0.6803853", "0.67966306", "0.6794222", "0.6794222", "0.6789979", "0.67861426", "0.678112", "0.677748", "0.67702436", "0.67625374", "0.6748088", "0.67475355", "0.67475355", "0.67446774", "0.6742005", "0.67374676", "0.6727497", "0.6714345", "0.6696231", "0.6693851", "0.6689907", "0.6689746", "0.6687102", "0.66870165", "0.6684574", "0.6670877", "0.66705006", "0.6667089", "0.6667089", "0.6663205", "0.66626745", "0.66603845", "0.66593564", "0.66560745", "0.66545844", "0.66447026", "0.6633528", "0.66319114", "0.66298395", "0.66298395", "0.6622365", "0.6621021", "0.66170275", "0.661664", "0.6612467", "0.66107714", "0.6608453", "0.65979743", "0.659645", "0.6596389", "0.6592672", "0.6591205", "0.6588125", "0.6582166", "0.6581656", "0.65811247", "0.65785724", "0.65782833", "0.6576397", "0.6570971", "0.6569483", "0.6568432", "0.656811", "0.6563493", "0.6563493", "0.65622604", "0.65602434", "0.65585065", "0.6557997", "0.65574414", "0.6556701", "0.65565753", "0.6556226", "0.6556107", "0.6549118", "0.65485924", "0.65463555" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update($request, $id);", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "abstract public function put($data);", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public abstract function update($object);", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update($id, $input);", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.74238616", "0.7062842", "0.7057816", "0.6897868", "0.65820867", "0.64505464", "0.6347915", "0.62114644", "0.6145006", "0.61231726", "0.6115922", "0.6100021", "0.6089019", "0.60542375", "0.60187906", "0.6008231", "0.5974106", "0.5944986", "0.59397626", "0.59393746", "0.58937186", "0.58607864", "0.5853811", "0.5853811", "0.58521867", "0.5815276", "0.58061725", "0.57518756", "0.57518756", "0.5736318", "0.57246256", "0.5715636", "0.5696208", "0.5691033", "0.5687788", "0.56692934", "0.56556624", "0.5652178", "0.56494987", "0.5636202", "0.56355816", "0.5632871", "0.563206", "0.56291884", "0.5621382", "0.56087434", "0.5602465", "0.55928403", "0.55825645", "0.55821884", "0.5581833", "0.5576869", "0.55712104", "0.5568173", "0.55648434", "0.5562885", "0.5560537", "0.5560537", "0.5560537", "0.5560537", "0.5560537", "0.55592597", "0.5556131", "0.5555849", "0.5555397", "0.5553912", "0.55530137", "0.5543831", "0.55430055", "0.5540152", "0.5539437", "0.55359006", "0.5535772", "0.5534487", "0.552458", "0.5518245", "0.5515452", "0.55145514", "0.5509227", "0.55079365", "0.55065364", "0.55039924", "0.5501616", "0.5500345", "0.5499738", "0.54980725", "0.5496017", "0.5496017", "0.5494488", "0.5494334", "0.54936594", "0.54934716", "0.5491019", "0.54835314", "0.54795796", "0.5479442", "0.5478275", "0.54646415", "0.54637444", "0.5461914", "0.54562414" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1