query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Waits until file is free to write into...
private function state_update() { if (!file_exists(self::STATE_FILE)) { file_put_contents(self::STATE_FILE, "0"); } $file = fopen(self::STATE_FILE, 'r+'); if ($file) { $block = true; if (flock($file, LOCK_EX, $block)) { $cc = intval(trim(fgets($file, 4096)))+1; fseek($file, 0); fwrite($file, $cc); } fclose($file); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function waitForFile($file, $error)\n {\n if (!$error) {\n $handle = fopen(\"mp3/\".$file, \"r\");\n if (is_resource($handle)) {\n fclose($handle);\n }\n else {\n $i = 0;\n while (!is_resource($handle) && $i<10) {\n $i++;\n $handle = fopen(\"mp3/\".$file, \"r\");\n usleep(100000);\n }\n fclose($handle);\n }\n }\n }", "public function writelock($wait = -1) {}", "function waitfor($file)\r\n\t{\r\n\t\treturn parent::waitFor($file);\r\n\t}", "function write($filename)\n\t{\n\t\t// open, but do not truncate leaving data in place for others\n\t\t$fp = fopen($this->folder . $filename . '.html', 'c'); \n\t\tif ($fp === false) \n\t\t{\n error_log(\"Couldn't open \" . $filename . ' cache for updating!');\n }\n\t\t// exclusive lock, but don't block it so others can still read\n\t\tflock($fp, LOCK_EX | LOCK_NB); \n // truncate it now we've got our exclusive lock\n\t\tftruncate($fp, 0);\n\t\tfwrite($fp, ob_get_contents());\n\t\tflock($fp, LOCK_UN); // release lock\n\t\tfclose($fp);\n\t\t// finally send browser output\n\t\tob_end_flush();\n\t}", "public function writeAndClose();", "public function hasWritePending();", "function __sleep() {\r\n fclose($this->fp);\r\n return array('filename');\r\n }", "public function stream_write(string $data)\n\t{\n\t\t$len = strlen($data);\n\t\t$res = fwrite($this->tempHandle, $data, $len);\n\n\t\tif ($res !== $len) { // disk full?\n\t\t\t$this->writeError = true;\n\t\t}\n\n\t\treturn $res;\n\t}", "function _file_save($head, $olen, $nlen = 0)\n {\n if ($nlen == 0) $nlen = strlen($head);\n if ($nlen == $olen)\n {\n\t// shorter\n\tflock($this->fd, LOCK_EX);\n\tfseek($this->fd, 0, SEEK_SET);\n\tfwrite($this->fd, $head, $nlen);\n\tflock($this->fd, LOCK_UN);\n }\n else\n {\n\t// longer, buffer required\n\t$stat = fstat($this->fd);\n\t$fsize = $stat['size'];\n\n\t// buf required (4096?) 应该不会 nlen - olen > 4096 吧\n\t$woff = 0;\n\t$roff = $olen;\n\n\t// read first buffer\n\tflock($this->fd, LOCK_EX);\n\tfseek($this->fd, $roff, SEEK_SET);\n\t$buf = fread($this->fd, 4096);\n\n\t// seek to start\n\tfseek($this->fd, $woff, SEEK_SET);\n\tfwrite($this->fd, $head, $nlen);\n\t$woff += $nlen;\n\n\t// seek to woff & write the data\n\tdo\n\t {\n\t $buf2 = $buf;\n\t $roff += 4096;\n\t if ($roff < $fsize) \n\t {\n\t\tfseek($this->fd, $roff, SEEK_SET);\n\t\t$buf = fread($this->fd, 4096);\n\t }\n\n\t // save last buffer\n\t $len2 = strlen($buf2);\n\t fseek($this->fd, $woff, SEEK_SET);\n\t fwrite($this->fd, $buf2, $len2);\n\t $woff += $len2;\n\t }\n\twhile ($roff < $fsize);\n\tftruncate($this->fd, $woff);\n\tflock($this->fd, LOCK_UN);\n }\n }", "static function flock_put_contents($fn, $cnt, $block=false) {\n $ret = false;\n if( $f = fopen($fn, 'c+') ) {\n $app = $block & FILE_APPEND and $block ^= $app;\n if( $block ? self::do_flock($f, LOCK_EX) : flock($f, LOCK_EX | LOCK_NB) ) {\n if(is_array($cnt) || is_object($cnt)) $cnt = serialize($cnt);\n if($app) fseek($f, 0, SEEK_END);\n if(false !== ($ret = fwrite($f, $cnt))) ftruncate($f, ftell($f));\n flock($f, LOCK_UN);\n }\n fclose($f);\n }\n return $ret;\n }", "public function writeunlock() {}", "public function writeLockFile(): bool\n {\n try {\n $this->io->write(\n sprintf(\"\\n <info>Writing new lock data to %s<info>\", $this->file->getPath())\n );\n $this->file->write($this->lockedData);\n\n return true;\n } catch (\\Throwable $exception) {\n $this->io->error($exception->getMessage());\n\n return false;\n }\n }", "function finish_writing()\n {\n eval(PUBSUB_MUTATE);\n $this->_finished_writing = true;\n $this->_shutdown_if_necessary();\n return 1;\n }", "function writeToFile($filename){\n\t\tif(!file_exists($filename)){\n\t\t\t// File is created with class Files in order to maintain file permissions\n\t\t\tFiles::TouchFile($filename,$err,$err_str);\n\t\t\tif($err){\n\t\t\t\tthrow new Exception(get_class($this).\": cannot do touch on $filename ($err_msg)\");\n\t\t\t}\n\t\t}\n\n\t\t$total_length = $this->getLength();\n\t\t$chunk_size = 1024 * 1024; // 1MB\n\t\t$bytes_written = 0;\n\n\t\tif($total_length===0){\n\t\t\tFiles::EmptyFile($filename,$err,$err_str);\n\t\t\tif($err){\n\t\t\t\tthrow new Exception(get_class($this).\": cannot empty file $filename ($err_msg)\");\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t$f = fopen($filename,\"w\");\n\t\tif($f === false){\n\t\t\tthrow new Exception(get_class($this).\": cannot open $filename for writing\");\n\t\t}\n\t\twhile($bytes_written < $total_length){\n\t\t\t$length = min($chunk_size,$total_length - $bytes_written);\n\t\t\t$chunk = $this->substr($bytes_written,$length);\n\t\t\t$_bytes = fwrite($f,$chunk,$length);\n\t\t\tif($_bytes !== $length){\n\t\t\t\tthrow new Exception(get_class($this).\": cannot write to $filename\");\n\t\t\t}\n\t\t\t$bytes_written += $length;\n\t\t}\n\t\tfclose($f);\n\t}", "public static function SingleProcessWrite (\n\t\t$fullPath, \n\t\t$content, \n\t\t$writeMode = 'w', \n\t\t$lockWaitMilliseconds = 100, \n\t\t$maxLockWaitMilliseconds = 5000, \n\t\t$oldLockMillisecondsTolerance = 30000\n\t);", "public function OutputWaiting($fileId) {\n\t\t$handle = fopen(ProcMonitor::GetFName($fileId),\"r\");\n\t\t$fstat = fstat($handle);\n\t\tfclose($handle);\n\n\t\tif ($fstat['size'] > ProcMonitor::GetBytesRead($fileId)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "private function htWriteFile() {\r\n global $php_errormsg;\r\n $filename = $this->FILE;\r\n // On WIN32 box this should -still- work OK,\r\n // but it'll generate the tempfile in the system\r\n // temporary directory (usually c:\\windows\\temp)\r\n // YMMV\r\n $tempfile = tempnam( \"/tmp\", \"fort\" );\r\n $name = \"\";\r\n $pass = \"\";\r\n $count = 0;\r\n $fd;\r\n $myerror = \"\";\r\n if ( $this->EMPTY ) {\r\n $this->USERCOUNT = 0;\r\n }\r\n if ( !copy( $filename, $tempfile ) ) {\r\n $this->error( \"FATAL cannot create backup file [$tempfile] [$php_errormsg]\", 1 );\r\n }\r\n $fd = fopen( $tempfile, \"w\" );\r\n if ( empty( $fd ) ) {\r\n $myerror = $php_errormsg; // In case the unlink generates\r\n // a new one - we don't care if\r\n // the unlink fails - we're\r\n // already screwed anyway\r\n unlink( $tempfile );\r\n $this->error( \"FATAL File [$tempfile] access error [$myerror]\", 1 );\r\n }\r\n for ( $count = 0; $count <= $this->USERCOUNT; $count++ ) {\r\n $name = $this->USERS[$count][\"user\"];\r\n $pass = $this->USERS[$count][\"pass\"];\r\n if ( ($name != \"\") && ($pass != \"\") ) {\r\n fwrite( $fd, \"$name:$pass\\n\" );\r\n }\r\n }\r\n fclose( $fd );\r\n if ( !copy( $tempfile, $filename ) ) {\r\n $myerror = $php_errormsg; // Stash the error, see above\r\n unlink( $tempfile );\r\n $this->error( \"FATAL cannot copy file [$filename] [$myerror]\", 1 );\r\n }\r\n // Update successful\r\n unlink( $tempfile );\r\n if ( file_exists( $tempfile ) ) {\r\n // Not fatal but it should be noted\r\n $this->error( \"Could not unlink [$tempfile] : [$php_errormsg]\", 0 );\r\n }\r\n // Update the information in memory with the\r\n // new file contents.\r\n $this->initialize( $filename );\r\n return TRUE;\r\n }", "public function testFileFunctions() {\n $filename = 'public://' . $this->randomMachineName();\n file_put_contents($filename, str_repeat('d', 1000));\n\n // Open for rw and place pointer at beginning of file so select will return.\n $handle = fopen($filename, 'c+');\n $this->assertNotFalse($handle, 'Able to open a file for appending, reading and writing.');\n\n // Attempt to change options on the file stream: should all fail.\n $this->assertFalse(@stream_set_blocking($handle, 0), 'Unable to set to non blocking using a local stream wrapper.');\n $this->assertFalse(@stream_set_blocking($handle, 1), 'Unable to set to blocking using a local stream wrapper.');\n $this->assertFalse(@stream_set_timeout($handle, 1), 'Unable to set read time out using a local stream wrapper.');\n $this->assertEquals(-1 /*EOF*/, @stream_set_write_buffer($handle, 512), 'Unable to set write buffer using a local stream wrapper.');\n\n // This will test stream_cast().\n $read = [$handle];\n $write = NULL;\n $except = NULL;\n $this->assertEquals(1, stream_select($read, $write, $except, 0), 'Able to cast a stream via stream_select.');\n\n // This will test stream_truncate().\n $this->assertEquals(1, ftruncate($handle, 0), 'Able to truncate a stream via ftruncate().');\n fclose($handle);\n $this->assertEquals(0, filesize($filename), 'Able to truncate a stream.');\n\n // Cleanup.\n unlink($filename);\n }", "function file_write($file, $data, $flags = 0) {\n if (($bytes = file_put_contents($file, $data, $flags)) !== strlen($data)) {\n error('Failed to write ' . spy($data) . ' to ' . spy($file) . '.');\n }\n\n return $bytes;\n}", "public function waitingForFile(){\n return !empty($this->check_for_file);\n }", "function writeFile($res,$loc){\n $f = fopen($loc,'r+');\n fwrite($f,$res);\n ftruncate($f,strlen($res));\n fclose($f);\n}", "public function flush() {\n\t\tfflush($this->fp);\n\t}", "public function onWriteAvailable()\n\t{\n\t\tif (($written = @fwrite($this->stream, $this->writeBuffer)) === false) {\n\t\t\t$this->closeWithError(\"Could not write data to socket.\");\n\t\t\treturn;\n\t\t}\n\n\t\tif ($written === 0) {\n\t\t\t$this->closeWithError(\"Broken pipe or closed connection.\");\n\t\t\treturn;\n\t\t}\n\n\t\t$this->writeBuffer = substr($this->writeBuffer, $written) ?: \"\";\n\n\t\tif (empty($this->writeBuffer)) {\n\t\t\t$this->flushing = false;\n\t\t\t$this->loop->removeWriteStream($this->stream);\n\t\t}\n\t}", "public function fileEnd(): void;", "protected function _closeFile() {}", "protected function _closeFile() {}", "public function hasFinishWrite(){\n return $this->_has(3);\n }", "public function wait(): void;", "private function waitForUnlocking()\n\t{\n\t\t$times = self::LOCK_TTL;\n\t\t$i = 0;\n\t\twhile ($this->isExecutionLocked() && $i < $times)\n\t\t{\n\t\t\tsleep(1);\n\t\t\t$i++;\n\t\t}\n\t}", "public function writeFile()\n {\n $this->eof();\n\n return parent::writeFile();\n }", "function write_time_file($wait){\n\t\t$myFile= \"/home/hvn0220437/supercleaner.info/public_html/time.txt\";\n\t\t$fh = fopen($myFile, 'w+') or die(\"Cannot write time file\");\t\t\n\t\t$doneTime = date('d')*24*60*60+date('H')*60*60 + date('i')*60 + date('s');\n\t\t$newOutput = $doneTime.\"+\".$wait;\n\t\tfwrite($fh, $newOutput);\n\t\tfclose($fh);\n\t}", "function fileNeedsProcessing() ;", "function writeToFile ( $evenLogFullPath , $eventLine )\r\n\t{\r\n\t\t$stream = @fopen( $evenLogFullPath , 'a', false) ;\r\n\t\t$res = fwrite($stream, $eventLine);\r\n\t\tif ( ! $res )\r\n\t\t{\r\n\t\t\t// sleep a little and try again... \r\n\t\t\tusleep ( 50 + rand ( 0,50 ));\r\n\t\t\t$res = fwrite($stream, $eventLine);\r\n\t\t}\r\n\t\tif (is_resource($stream) ) {\r\n fclose($stream);\r\n\t\t}\r\n\t\t\r\n\t\treturn $res;\r\n\t}", "public function processWrite()\n {\n if (!$this->hasPendingWrite()) {\n return;\n }\n\n if (!$this->pendingWriteBuffer) {\n $this->pendingWriteBuffer .= array_shift($this->pendingWrites)->toRawData();\n }\n\n $this->log('Writing data to client, buffer contents: ' . $this->pendingWriteBuffer, Loggable::LEVEL_DEBUG);\n\n $bytesWritten = fwrite($this->socket, $this->pendingWriteBuffer);\n\n if ($bytesWritten === false) {\n $this->log('Data write failed', Loggable::LEVEL_ERROR);\n $this->trigger('error', $this, 'Data write failed');\n\n $this->disconnect();\n } else if ($bytesWritten > 0) {\n $this->pendingWriteBuffer = (string) substr($this->pendingWriteBuffer, $bytesWritten);\n }\n }", "public function openForAppend(): void\n {\n $this->content->seek(0, SEEK_END);\n $this->lastAccessed = time();\n }", "public function wait()\n {\n register_shutdown_function(array($this, 'close'));\n while (count($this->ch->callbacks)) {\n $this->ch->wait();\n }\n }", "public function close_cache_file()\n {\n $this->log(1,__FUNCTION__,\"Closing cache file, transferred {$this->tsize} bytes, {$this->tcount} buffers, {$this->dretry} retries\");\n if (!$this->cache_fp) {\n $this->log(1,__FUNCTION__,\"URL not cached, file pointer empty\");\n return;\n }\n\n $cl = $this->server_reply_headers['Content-Length'];\n $sz = ftell($this->cache_fp) - $this->cache_header_size;\n if ($sz != $cl) {\n $this->log(1,__FUNCTION__,\"Not fully downloaded [$sz/$cl]\");\n }\n else if (fflush($this->cache_fp) === FALSE || fclose($this->cache_fp) === FALSE) {\n $this->log(2,__FUNCTION__,\"Cannot close written cache file: [{$this->cache_filename}]\");\n }\n else if (rename($this->temp_cache_filename, $this->cache_filename) === FALSE) {\n $this->log(2,__FUNCTION__,\"Cannot rename temporary cache file: [{$this->temp_cache_filename}] to [{$this->cache_filename}]\");\n }\n else {\n $this->add_video($sz); // Add video to the db\n $this->add_to_stats(); // Calc stats\n $this->cache_fp = null;\n $this->log(1,__FUNCTION__,\"Close cached file: \".$this->cache_filename);\n }\n\n $this->close_temporary_transfer($this->cache_request); // Delete from temporary\n $this->stop_caching();\n }", "function writeover($filename,$data,$method=\"rb+\",$iflock=1,$check=1,$chmod=1){\n\t$check && strpos($filename,'..')!==false && exit('Forbidden');\n\ttouch($filename);\n\t$handle=fopen($filename,$method);\n\tif($iflock){\n\t\tflock($handle,LOCK_EX);\n\t}\n\tfwrite($handle,$data);\n\tif($method==\"rb+\") ftruncate($handle,strlen($data));\n\tfclose($handle);\n\t$chmod && @chmod($filename,0777);\n}", "function beginReadWrite();", "public function fileNeedsProcessing() {}", "function gzfile_put_contents($file, $text, $mode = 'w+') {\n if (($fp = @fopen($file.'.lock', 'w+')) === FALSE) {\n return FALSE;\n }\n fwrite($fp, '.lock');\n fclose($fp);\n if (($fp = gzopen($file, $mode)) === FALSE) {\n return FALSE;\n }\n if (!empty($text) && !gzwrite($fp, $text)) {\n gzclose($fp);\n return FALSE;\n }\n gzclose($fp);\n unlink($file.'.lock');\n return TRUE;\n}", "function writeDataChunks()\n {\n if ($this->dbg)\n echo (\"writeDataChunks \" . $this->bytesToSend . \" which is \" .\n $this->bytesToSend/$this->byteRateAdjusted . \" sec <br/>\");\n $fp = fopen($this->fileName, \"rb\");\n if (!$fp) die;\n $i = 0;\n while ($this->byteToSendStart >= $this->chunkSizeArray[$i])\n $this->byteToSendStart -= $this->chunkSizeArray[$i++];\n while ($this->bytesToSend)\n {\n $seekPos = $this->chunkPosArray[$i] + $this->byteToSendStart;\n if ($this->dbg)\n echo (\"fseek to \" . $seekPos . \" <br/>\");\n fseek($fp, $seekPos, SEEK_SET);\n $toSend = $this->bytesToSend;\n $maxSend = $this->chunkSizeArray[$i] - $this->byteToSendStart;\n if ($toSend > $maxSend)\n $toSend = $maxSend;\n $str = fread($fp, $toSend);\n if ($this->dbg)\n echo (\"read \" . $toSend . \" and got \" . strlen($str) . \" <br/>\");\n else\n echo ($str);\n $this->bytesToSend -= $toSend;\n $this->byteToSendStart = 0;\n $i++;\n }\n fclose($fp);\n if ($this->dbg) echo (\"finished writing from \" . $this->fileName . \"<br/>\");\n }", "function file_append($file, $data, $delimiter = '') {\n return file_write($file, $data . $delimiter, FILE_APPEND);\n}", "function write_cache(&$var, $filename) {\n $filename = DIR_FS_CACHE . $filename;\n $success = false;\n\n// try to open the file\n if ($fp = @fopen($filename, 'w')) {\n// obtain a file lock to stop corruptions occuring\n flock($fp, 2); // LOCK_EX\n// write serialized data\n fputs($fp, serialize($var));\n// release the file lock\n flock($fp, 3); // LOCK_UN\n fclose($fp);\n $success = true;\n }\n\n return $success;\n }", "function loop_write($file, $txt, $num){\n\n for ($x=1;$x<=$num;$x++){\n fwrite($file,$txt);\n }\n\n}", "function write_time_output_file($wait){\n\t\t$myFile= \"/home/hvn0220437/supercleaner.info/public_html/output.txt\";\n\t\t$fh = fopen($myFile, 'a') or die(\"Cannot append output file\");\t\t\n\t\t$time = date('H:i:s');\n\t\t$newOutput = \"[ \".$time.\" ]\".\" Tạm dừng. Lần tiếp theo sau \".$wait.\" phút<br>\";\n\t\tfwrite($fh, $newOutput);\n\t\tfclose($fh);\n\t}", "function logFileTest() {\r\n\tprint 'Testing writing to logfile...<br />';\r\n\t$message = \"------ Testing ------\\r\\n\";\r\n\t$message .= \"Date: \".date('d m y H:i:s').\"\\r\\n\";\r\n\t$message .= \"Message: This is a test\\r\\n\";\r\n\t\t\r\n\t$fp = fopen('NGOData.log', 'a');\r\n\r\n\tif (flock($fp, LOCK_EX)) { // do an exclusive lock\r\n\t\tfwrite($fp, $message);\r\n\t\tprint 'Wrote message: '.$message.'<br />';\r\n\t\tflock($fp, LOCK_UN); // release the lock\r\n\t\tprint 'released lock...<br />';\r\n\t} else {\r\n\t\t// cannot get lock\r\n\t\tprint 'Cannot get lock on file!';\r\n\t}\r\n\r\n\tfclose($fp);\r\n}", "function biometricfile($id) {\r\n\t//produce random file code\r\n\t$Name = rand(100,999);\r\n\t$Attempts = 0;\r\n\t//find a filename that doesn't exist\r\n\twhile (file_exists(\"fingerlog\" . $Name . \".txt\") AND ++$Attempts < 1000)\r\n\t\t$Name = rand(100,999);\r\n\t\r\n\t//if available file found, create file\r\n\tif ($Attempts < 1000)\r\n\t{\r\n\t\t//create file for writing\r\n\t\t$newID = fopen(\"fingerlog\" . $Name . \".txt\", \"w\");\r\n\t\t//wrtie $Identity into file\r\n\t\tfwrite($newID, $id);\r\n\t\t//close file\r\n\t\tfclose($newID);\r\n\t\t//postcondition assumption: account creation will consume and delete file\r\n\t\treturn $Name;\r\n\t}\r\n\telse\r\n\t\treturn -1;\r\n}", "public function _lockedFilewrite($filename, $mode, $contents = '', $timeLimit = 300000, $staleAge = 5)\n {\n $lockDir = $filename . '.lock';\n\n /* Make sure if the user disconnects that this doesn't fail */\n ignore_user_abort(true);\n\n if (is_dir($lockDir)) {\n if ((time() - filemtime($lockDir)) > $staleAge) {\n rmdir($lockDir);\n }\n }\n\n $locked = @mkdir($lockDir);\n\n if ($locked === false) {\n $timeStart = microtimeFloat();\n\n do {\n if ((microtimeFloat() - $timeStart) > $timeLimit) {\n break;\n }\n\n\n $locked = @mkdir($lockDir);\n } while ($locked === false);\n }\n\n $success = false;\n\n if ($locked === true) {\n $fp = @fopen($filename, $mode);\n\n if (@fwrite($fp, $data)) {\n $success = true;\n }\n\n @fclose($fp);\n\n rmdir($lockDir);\n }\n\n ignore_user_abort(0);\n\n return $success;\n }", "protected function add_ready_file( $file ) {\r\n\t\t\t$file['isvalid'] = true;\r\n\t\t\t$file['issaved'] = true;\r\n\t\t\t\r\n\t\t\t$this->Files_ready[] = $file;\r\n\t\t\t$this->Files_ready_count++;\r\n\t\t}", "public function drain(): void;", "function flush() ;", "function flush() ;", "function ccio_appendData($filename, $data) {\r\n\t//$fh = fopen($filename, \"ab\");\r\n\t$fh = fopen($filename, \"at\");\r\n\tfwrite($fh, $data);\t\t\r\n\tfclose($fh);\r\n\treturn TRUE;\r\n}", "public function flushesExpiredFiles(UnitTester $I)\n {\n\n $create_file = function () {\n $file_contents = str_repeat(\"0123456789\", 1000);\n\n $uploaded_file_path = \"{$this->temp_dir}/\" . self::FILENAME;\n\n file_put_contents($uploaded_file_path, $file_contents);\n\n return new UploadedFile(\n new Stream($uploaded_file_path),\n strlen($file_contents),\n UPLOAD_ERR_OK,\n self::FILENAME,\n self::MEDIA_TYPE\n );\n };\n\n $uploaded_file = $create_file();\n\n // bootstrap a mock service for test:\n\n $service = new MockTempFileService($this->filesystem, \"tmp\", 1, 100); // always flush after 1 minute\n\n $service->time = time(); // fake time\n\n // collect the uploaded file as a temporary file:\n\n $uuid = $service->collect($uploaded_file);\n\n $I->assertInstanceOf(TempFile::class, $service->recover($uuid), \"can recover temporary file\");\n\n // advance time by 1 minute:\n\n $service->time += 61;\n\n // trigger flushing by collecting another file:\n\n $another_file = $create_file();\n\n $service->collect($another_file);\n\n // recover the uploaded file:\n\n $exception = null;\n\n try {\n $service->recover($uuid);\n } catch (TempFileRecoveryException $exception) {\n // caught!\n }\n\n $I->assertInstanceOf(TempFileRecoveryException::class, $exception);\n\n $I->assertCount(2, $this->filesystem->listPaths(\"tmp\"), \"temp dir contains only one json/tmp file pair\");\n }", "public function flush(int $file_ino) {\n // no-op, stateless io.\n return null;\n }", "function addToRecoveryFile($task)\n{\n\t$file = '../recovery.txt';\n\t$myfile = file_put_contents($file, $task .\"\\r\\n\" , FILE_APPEND | LOCK_EX);\n\techo \"Server Offline, Task will start when server is started!\";\n\tdie();\n}", "public function wait($wait = -1) {}", "function add($str){\nglobal $gbfile;\n $tmp = trim($str);\n $fp=fopen($gbfile,'a+'); \n flock($fp, LOCK_EX); \n fwrite($fp, $tmp. \"\\n\"); \n flock($fp, LOCK_UN); \n fclose($fp); \n}", "private function waitForLock($key) {\n $tries = 20;\n $cnt = 0;\n do {\n // 250 ms is a long time to sleep, but it does stop the server from burning all resources on polling locks..\n usleep ( 250 );\n $cnt ++;\n } while ( $cnt <= $tries && $this->isLocked ( $key ) );\n if ($this->isLocked ( $key )) {\n // 5 seconds passed, assume the owning process died off and remove it\n $this->removeLock ( $key );\n }\n }", "public function testWriteFile() {\n\t\t$filename = 'test.json';\n\t\t$filestream = 'maryhad';\n\t\ttextus_put_file($filename, $filestream);\n\t}", "function src_tarpit() {\n\t$h = fopen('/dev/random', 'rb');\n\n\t$len = 8192;\n\t$sleep = 5;\n\t$max_time = 60 * 5;\n\n\t$wait = 0;\n\n\twhile ($wait < $max_time) {\n\t\t$contents = fread($h, $len);\n\t\techo $contents;\n\t\tflush();\n\t\tsleep($sleep);\n\t\t$wait += $sleep;\n\t}\n}", "function write_file($my_file,$new_content){\n\treturn file_put_contents($my_file,$new_content);\n}", "private function waitForLock($key) {\n $tries = 20;\n $cnt = 0;\n do {\n // 250 ms is a long time to sleep, but it does stop the server from burning all resources on polling locks..\n usleep(250);\n $cnt ++;\n } while ($cnt <= $tries && $this->isLocked());\n if ($this->isLocked()) {\n // 5 seconds passed, assume the owning process died off and remove it\n $this->removeLock($key);\n }\n }", "public function writeCompletely($stream) {\n\t\t$written = 0;\n\t\twhile (!$this->complete) {\n\t\t\t$written += $this->writeTo($stream);\n\t\t}\n\t\t//echo \"\\nWritten \" . $written . ' bytes ';\n\t\treturn $written;\n\t}", "protected function closeFile() {}", "function checkFile($file) {\n if (file_exists($file))\n unlink($file);\n \n\t $handle = fopen($file, 'w+');\n\n if(handle){\n return true;\n } else {\n echo \"Unable to open stdout for writing.\\n\";\n return false;\n }\n\n }", "function file_write ($filename, $data) {\r\n $fd = fopen($filename, 'w') or die(\"Can't open file $filename for write!\");\r\n fwrite($fd, $data);\r\n fclose($fd);\r\n }", "private function writeFile($stub)\n {\n $this->files->put($this->path, $stub);\n }", "public function acquire() {\r\n\t\tif( $this->use_file_lock ) {\r\n\t\t\tif ( empty( $this->filename ) ) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\r\n\t\t\tif( false == ( $this->filepointer = @fopen( $this->filename, \"w+\" ) ) ) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\tif( false == flock( $this->filepointer, LOCK_EX ) ) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif ( ! sem_acquire( $this->sem_id ) ) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->is_acquired = true;\r\n\t\treturn true;\r\n\t}", "public function flushFile()\n {\n $this->em->flush();\n }", "public function setWriteTimeout(float $timeout): void\n {\n }", "public function writeBlocking($buf)\n {\n $write = [$this->stream];\n\n $null = null;\n // fwrite to a socket may be partial, so loop until we\n // are done with the entire buffer\n $failedAttempts = 0;\n $bytesWritten = 0;\n $bytesToWrite = strlen($buf);\n while ($bytesWritten < $bytesToWrite) {\n // wait for stream to become available for writing\n $writable = $this->select($write, $this->sendTimeoutSec, $this->sendTimeoutUsec, false);\n if (false === $writable) {\n throw new \\Kafka\\Exception\\Socket('Could not write ' . $bytesToWrite . ' bytes to stream');\n }\n if (0 === $writable) {\n $res = $this->getMetaData();\n if (! empty($res['timed_out'])) {\n throw new \\Kafka\\Exception('Timed out writing ' . $bytesToWrite . ' bytes to stream after writing ' . $bytesWritten . ' bytes');\n } else {\n throw new \\Kafka\\Exception\\Socket('Could not write ' . $bytesToWrite . ' bytes to stream');\n }\n }\n \n if ($bytesToWrite - $bytesWritten > self::MAX_WRITE_BUFFER) {\n // write max buffer size\n $wrote = fwrite($this->stream, substr($buf, $bytesWritten, self::MAX_WRITE_BUFFER));\n } else {\n // write remaining buffer bytes to stream\n $wrote = fwrite($this->stream, substr($buf, $bytesWritten));\n }\n \n if ($wrote === -1 || $wrote === false) {\n throw new \\Kafka\\Exception\\Socket('Could not write ' . strlen($buf) . ' bytes to stream, completed writing only ' . $bytesWritten . ' bytes');\n } elseif ($wrote === 0) {\n // Increment the number of times we have failed\n $failedAttempts++;\n if ($failedAttempts > $this->maxWriteAttempts) {\n throw new \\Kafka\\Exception\\Socket('After ' . $failedAttempts . ' attempts could not write ' . strlen($buf) . ' bytes to stream, completed writing only ' . $bytesWritten . ' bytes');\n }\n } else {\n // If we wrote something, reset our failed attempt counter\n $failedAttempts = 0;\n }\n $bytesWritten += $wrote;\n }\n return $bytesWritten;\n }", "function flush() {\n fflush($this->fp);\n }", "static function send_buffer()\n {\n self::log_debug('Start sending buffer ...');\n\n $requests_sent = 0;\n $buffer_file = self::$log_dir . self::$log_file_buffer;\n $buffer_file_tmp = self::$log_dir . self::$log_file_buffer . '.' . rand(1, 100000) . '.tmp';\n\n try {\n\n if (!is_file($buffer_file)) {\n self::log_debug('Buffer file does not exists, nothing found to sent.');\n return false;\n }\n\n // take the current buffer and put it inside a unique tmp buffer\n rename($buffer_file, $buffer_file_tmp);\n\n // read and process the tmp buffer\n $fh = fopen($buffer_file_tmp, \"r\");\n if ($fh) {\n while (!feof($fh)) {\n $data_serialized = fgets($fh);\n\n if ($data_serialized == false) {\n continue;\n }\n\n $data = unserialize($data_serialized);\n \n if (self::send($data['e'], $data['m'], $data['d'])) {\n $requests_sent++;\n }\n }\n fclose($fh);\n }\n unlink($buffer_file_tmp);\n\n self::log_debug('Queue was sent successfully! Sent ' . $requests_sent . ' requests.');\n } catch (Exception $e) {\n self::log_error($e->getMessage());\n }\n }", "private function flush()\n {\n $this->writeBlock();\n return $this->io->flush();\n }", "protected function isStreamFinished()\n {\n return gzeof($this->file);\n }", "function flush();", "function createLockFile($file=null){\n $lockFile = ($file!='') ? $file : LOCKFILE;\n if(file_exists($lockFile)){\n print \"detected lockfile at {$lockFile} ... exiting\\n\";\n exit;\n } else {\n // Write a lockfile so we prevent other runs while we are running\n file_put_contents($lockFile, 1);\n }\n}", "abstract function flush();", "protected function _completeFlush() {\r\n\r\n }", "function file_write($filename, $content)\n\t{\n\t\t$handle = @fopen($filename, 'w');\n\t\t$result = @fwrite($handle, $content, strlen($content));\n\t\t@fclose($handle);\n\t\treturn $result;\n\t}", "public function isWriteCompleted(): bool {\n return $this->_builder->isWriteCompleted();\n }", "public function readunlock() {}", "function write_file($opt, $contents)\n{\n if (is_writable($opt)) \n {\n if (!$open = fopen($opt, \"w\")) \n {\n exit_program(\"Cannot write to file\\n\", code_error::error_write_file);\n }\n }\n else \n {\n $open = fopen($opt, \"x\");\n }\n fwrite($open, $contents);\n fclose($open);\n return;\n\n}", "function writeFile($filename)\n{\n\t$fp_input = fopen(\"php://input\", \"r\");\n\n\t/* Open a file for writing */\n\t$fp = fopen($filename, \"w\");\n\t\n\t/* Read 8 KB at a time and write to the file */\n\twhile ($data = fread($fp_input, 1024 * 8))\n\t\tfwrite($fp, $data);\n\n\t/* Close the streams */\n\tfclose($fp);\n\tfclose($fp_input);\n}", "public function transferEnd() {\n fclose($this->_transferFile);\n\n /* Reset the values */\n $this->_transferStarted = FALSE;\n $this->_transferFile = NULL;\n }", "function writeMsgInFile($fileFullPath, $lineToWrite)\n{\n // Open the file\n $myFile = fopen($fileFullPath, 'a');\n\n // Write one the file\n fwrite($myFile, $lineToWrite . \"\\n\");\n\n // Close the file\n fclose($myFile);\n}", "private function write_cache() {\n if (!file_exists(CACHE_DIR))\n mkdir(CACHE_DIR, 0755, TRUE);\n\n if (is_dir(CACHE_DIR) && is_writable(CACHE_DIR)) {\n if (function_exists(\"sem_get\") && ($mutex = @sem_get(2013, 1, 0644 | IPC_CREAT, 1)) && @sem_acquire($mutex))\n file_put_contents($this->cache_file, $this->html . $this->debug) . sem_release($mutex);\n /**/\n else if (($mutex = @fopen($this->cachefile, \"w\")) && @flock($mutex, LOCK_EX))\n file_put_contents($this->cache_file, $this->html . $this->debug) . flock($mutex, LOCK_UN);\n /**/\n }\n }", "protected function _write() {}", "function yt_file_write( $handle, $string ) {\n\n\t$func = 'f' . 'write';\n\treturn $func( $handle, $string );\n \n}", "public function writeFile($data);", "public function waitWithBackoff()\n {\n $waitTime = $this->calculateSleepTime();\n if ($waitTime > 1000000) {\n sleep((int) ($waitTime / 1000000));\n } else {\n usleep($waitTime);\n }\n }", "private function closeFile( \\SplFileObject &$file ) {\n if( !$this->gzip && !$file->flock( LOCK_UN ) ) {\n $file = NULL;\n\n throw new \\Exception( 'Could not unlock file' );\n }\n\n $file = NULL;\n }", "public static function send($_file,$_kbps=0) {\n\t\t$_file=F3::resolve($_file);\n\t\tif (!file_exists($_file)) {\n\t\t\tF3::http404();\n\t\t\treturn FALSE;\n\t\t}\n\t\tif (PHP_SAPI!='cli' && !F3::$global['QUIET'] && !headers_sent()) {\n\t\t\theader(F3::HTTP_Content.': application/octet-stream');\n\t\t\theader(F3::HTTP_Disposition.': '.\n\t\t\t\t'attachment; filename='.basename($_file));\n\t\t\theader(F3::HTTP_Length.': '.filesize($_file));\n\t\t\tF3::httpCache(0);\n\t\t\tob_end_flush();\n\t\t}\n\t\t$_max=ini_get('max_execution_time');\n\t\t$_ctr=1;\n\t\t$_handle=fopen($_file,'r');\n\t\t$_time=time();\n\t\twhile (!feof($_handle) && !connection_aborted()) {\n\t\t\tif ($_kbps>0) {\n\t\t\t\t// Throttle bandwidth\n\t\t\t\t$_ctr++;\n\t\t\t\t$_elapsed=microtime(TRUE)-$_time;\n\t\t\t\tif (($_ctr/$_kbps)>$_elapsed)\n\t\t\t\t\tusleep(1e6*($_ctr/$_kbps-$_elapsed));\n\t\t\t}\n\t\t\t// Send 1KiB and reset timer\n\t\t\techo fread($_handle,1024);\n\t\t\tset_time_limit($_max);\n\t\t}\n\t\tfclose($_handle);\n\t\treturn TRUE;\n\t}", "public function put(\n $handle\n ) {\n $total = 0;\n while( $buffer = $this->handler->read() ) {\n $length = strlen( $buffer );\n $attempts = 0;\n $written = 0;\n while( $written < $length ) {\n $result = fwrite( $handle, substr( $buffer, $written ) );\n if( $result === false ) {\n throw new \\Exception( 'Unable to write output.' );\n }\n else if( $result === 0 ) {\n $attempts += 1;\n if( $attempts > 1000 ) {\n throw new \\Exception( 'Unable to write output.' );\n }\n }\n $written += $result;\n }\n $total += $written;\n }\n return $total;\n }", "function fileWrite( $fileName, $myMode, $myStr )\n{\n $isOpen = fopen( $fileName, $myMode ) ;\n if ( $isOpen )\n {\n fwrite( $isOpen, $myStr ) ;\n fclose( $isOpen ) ;\n return TRUE ;\n }\n else\n {\n return FALSE ;\n }\n}", "protected function write()\n {\n if (!is_dir($this->path)) {\n mkdir($this->path);\n }\n\n file_put_contents($this->file, json_encode([\n 'network' => $this->network,\n 'epoch' => static::$epoch,\n 'iteration' => static::$iteration,\n 'a' => $this->a,\n 'e' => $this->e\n ]));\n }", "function write($data) {\n if (!@fwrite($this->_handler, $data, strlen($data))) {\n \tFire_Error::throwError(sprintf('Failed to write %s data to %s file.',\n \t $data,\n \t $this->_file\n \t ), __FILE__, __LINE__\n \t);\n }\n }", "public function transferEnd() {\n fclose( $this->_transferFile );\n $this->_transferStarted = FALSE;\n $this->_transferSize = NULL;\n $this->_transferFile = NULL;\n\n if ($this->removeAfterTransfer) {\n unlink( $this->filePath );\n }\n }", "function fn_is_writable($file_path)\n{\n clearstatcache(true, $file_path);\n $is_writable = is_writable($file_path);\n\n // is_writable() is not always a reliable way to determine whether\n // file or directory are really writable for current PHP process,\n // so we should perform an additional check\n if ($is_writable) {\n if (is_dir($file_path)) { // For directories we try to create an empty file into it\n $test_filepath = $file_path . DIRECTORY_SEPARATOR . uniqid(mt_rand(0, 10000));\n\n if (@touch($test_filepath)) {\n @unlink($test_filepath);\n } else {\n $is_writable = false;\n }\n } elseif (is_file($file_path)) { // For files we try to modify the file by appending \"nothing\" to it\n if (false === @file_put_contents($file_path, null, FILE_APPEND)) {\n $is_writable = false;\n }\n }\n }\n\n return $is_writable;\n}" ]
[ "0.6201736", "0.5795209", "0.56660914", "0.56402797", "0.5508758", "0.54255587", "0.53226495", "0.5296417", "0.52627105", "0.52532315", "0.5236741", "0.51701003", "0.5168335", "0.5158054", "0.5145762", "0.51428515", "0.5134936", "0.5091132", "0.5072809", "0.5044906", "0.50401187", "0.5025453", "0.5000722", "0.4995226", "0.49201676", "0.49201676", "0.49057582", "0.49047425", "0.48877424", "0.4883748", "0.48716575", "0.48715585", "0.48701838", "0.48428982", "0.48373106", "0.48286343", "0.48277175", "0.48174405", "0.48082754", "0.4801348", "0.4800606", "0.47974524", "0.47715944", "0.47544786", "0.47526625", "0.47459814", "0.47376883", "0.4734931", "0.47239608", "0.47138608", "0.47134593", "0.47130474", "0.47130474", "0.47018147", "0.47001058", "0.46928495", "0.46922943", "0.4680168", "0.46788096", "0.46722335", "0.46698195", "0.4666264", "0.4659922", "0.4657255", "0.46566525", "0.46454462", "0.46390706", "0.46313328", "0.46283638", "0.46280396", "0.46255565", "0.46190038", "0.46150854", "0.4604066", "0.46039233", "0.45925218", "0.4581533", "0.45813966", "0.45738885", "0.45703682", "0.45657697", "0.45542797", "0.45488238", "0.45423317", "0.45423263", "0.4542012", "0.4531861", "0.45303738", "0.4526501", "0.45241588", "0.45210102", "0.45110482", "0.45058265", "0.4504094", "0.44966617", "0.44943848", "0.44909072", "0.44887456", "0.4486673", "0.44738883", "0.4467572" ]
0.0
-1
Display a listing of the resource.
public function getListProducts() { $listProducts = Products::all(); //$listProducts = []; return response()->json([ 'message' => 'Get list products successfully', 'list_products' => $listProducts ], 200); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function addProducts(Request $request) { $products = new Products(); $validator = \Validator::make($request->all(),[ 'title' => 'required|min:2|max:250', 'category_id' => 'required', 'contents' => 'required' ],[ 'title.required' => 'Tên Sản Phẩm không được trống.', 'category_id.required' => 'Loại Sản Phẩm không được trống.', 'contents.required' => 'Nội dung Sản Phẩm không được trống.', ]); if ($validator->fails()) { return response()->json(['error' => $validator->errors(),'success' => 0]); } $data['title'] = $request->title; //$path = $request->file('image')->store('products'); $data['image'] = $request->file_name;; $data['category_id'] = $request->category_id; $data['summary'] = $request->summary; $data['contents'] = $request->contents; $data['completed'] = 1; $data['status'] = 0; if (!empty($request->status)){ $data['status'] = 1; } if (!empty($request->id)){ $products = Products::find($request->id); $products->fill($data); $products->save(); }else{ $products->fill($data); $products->save(); } return response()->json([ 'message' => 'Product Added Successfully', 'success' => 1, 'products' => $products ], 200); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function 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(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() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function 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 //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\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 $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(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($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.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
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 update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($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
Shopping Cart belongs to a User
public function user() { return $this->belongsTo(User::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cart()\n {\n return $this->hasOne('App\\Cart', 'id_user');\n }", "public function UserCart()\n {\n return $this->hasMany(UserCart::class, 'id_user_cart', 'id');\n }", "public function addToCart(Request $request){\n if($request->session()->has('user'))\n {\n //add item info inside cart table\n $cart = new Cart;\n $cart->user_id = auth()->user()->id;\n $cart->product_id = $request->product_id;\n $cart->save();\n return redirect('/products');\n }else{\n return redirect('/login');\n }\n }", "public function cart() {\n return $this->belongsTo('App\\Cart');\n }", "public function cart()\n {\n return $this->belongsTo(Cart::class);\n }", "public function cart() : BelongsTo\n {\n return $this->belongsTo(Cart::class);\n }", "public function findCartByUserId($id)\n {\n \t$cart = $this->model->whereUserId($id)->first();\n \n \treturn $cart;\n }", "public function cart()\n {\n return $this->belongsTo('TechTrader\\Models\\Cart');\n }", "public function cart()\n {\n return $this->belongsTo('App\\Models\\Cart', 'cart_id', 'id');\n }", "public function shoppingCart()\n {\n return $this->hasMany(ShoppingCart::class);\n }", "public function cart()\n {\n return $this->belongsTo('JulioBitencourt\\Cart\\Storage\\Eloquent\\Entities\\Cart');\n }", "public function show(User $user, $id)\n {\n return Cart::where('user_id', $user->id)\n ->where('product_id', $id)->first();\n }", "public function __construct(User $user , Cart $cart)\n {\n $this->user=$user;\n $this->cart=$cart;\n }", "public function carts(){\n return $this->hasMany('App\\Model\\Cart','customer_id','id');\n }", "public function cart()\n {\n return $this->hasMany(Item::class);\n }", "public function addToCart(Request $request)\n {\n $id = $request->id;\n $type = $request->type;\n $message = '';\n\n switch($type)\n {\n case 'file':\n $product = File::find($id);\n break;\n case 'episode':\n $product = Episode::find($id);\n break;\n case 'plan':\n $product = Plan::find($id);\n break;\n }\n\n\n if(!$product)\n {\n abort(404);\n }\n\n if(Auth::check())\n {\n $userId = Auth::id(); //extracting user ID\n $userCartExistance = Cart::HasCart($userId); //check if this user has any cart or not, this syntax returns true or false\n\n if($userCartExistance) // if logged in user has any cart then return cart object of this user\n {\n\n $userCart = Cart::userCart($userId); // returning cart object\n $cartId = $userCart->id; //returning cart's ID\n\n $productExistance = Cartable::CheckIfExists($cartId, $id, $type); //check if this product already exists in the cartables table or not\n\n if($productExistance) //if this product exists in the cart\n {\n $message = 'محصول موردنظر در سبد خرید شما موجود است.';\n }\n else\n {\n switch($type)\n {\n case 'file':\n $userCart->files()->attach($id);\n break;\n case 'episode':\n $userCart->episodes()->attach($id);\n break;\n case 'plan':\n $userCart->plans()->attach($id);\n break;\n }\n\n $message = 'محصول موردنظر به سبد خرید اضافه شد.';\n\n }\n\n }\n else //if logged in user has no cart then create one for her!\n {\n $userCart = new Cart();\n $userCart->user_id = $userId;\n $userCart->save();\n\n switch($type)\n {\n case 'file':\n $userCart->files()->attach($id);\n break;\n case 'episode':\n $userCart->episodes()->attach($id);\n break;\n case 'plan':\n $userCart->plans()->attach($id);\n break;\n }\n\n $message = 'محصول موردنظر به سبد خرید اضافه شد.';\n\n }\n }\n else // if user is not logged in then store cart information in session\n {\n $oldCart = Session::has('cart') ? Session::get('cart') : null;\n $cart = new ShoppingCart($oldCart);\n $message = $cart->add($product, $type, $id);\n Session::put('cart', $cart);\n }\n // route('showProduct', $id)\n // return redirect()->back()->with('message', $message);\n\n return response()->json(['message' => $message]);\n }", "public function cartItem()\n {\n return $this->hasMany('App\\Model\\CartItem');\n }", "public function myCart(){\n Auth::loginUsingId(1);\n // $currentUser = Auth::user();\n // $cartList = $currentUser->cartProductId();\n $currUserId = Auth::user()->id;\n $cartList = Cart::cartList($currUserId)->get();\n return view ('myCart',compact('cartList'));\n // return view('myCart',compact('cartList'));\n }", "public function show(UserCart $userCart) {\n\t\t//\n\t}", "public function store(User $user, Request $request)\n {\n $cart = Cart::where('user_id', $user->id)->where('product_id', $request->product_id)->first();\n if ($cart){\n $cart->count += $request->count;\n $cart->save();\n }\n else {\n Cart::create(\n [\n 'count' => $request->count,\n 'product_id' => $request->product_id,\n 'user_id' => $user->id\n ]\n );\n }\n return response()->noContent(201);\n }", "public function store(Request $request)\n {\n $dubl = Cart::search(function ($cartItem, $rowId) use ($request) {\n return $cartItem->id === $request->id;\n });\n if ($dubl->isNotEmpty()) {\n \n toastr()->warning('product is already in cart !');\n\n \n \n\n\n\n };\n\n \n\n ///////////////////////////////////////////////////\n\n $user = DB::table('orders')\n ->where('user_id', '=', Auth::user()->id)\n ->first();\n //////////////////////////////////////////////\n\n //////////////////////////////////\n $order_id = order::latest()->first()->id;\n\n /////////////////\n\n\n////////////////////////////////////\n\n\n /////////////////////////////////////////////////\n\n if (isset($user) ) {\n\n\n orderItem::create([\n 'order_id' =>$order_id,\n 'product_id' => $request->id,\n 'user_id' => Auth::user()->id,\n 'quantity' => 1,\n 'price' => $request->price,\n ]);\n\n\n\n\n } else{\n\n order::create([\n 'user_id' => (Auth::user()->id),\n 'status' => 1,\n\n ]);\n\n orderItem::create([\n 'order_id' => $order_id,\n 'product_id' => $request->id,\n 'user_id ' => Auth::user()->id,\n 'quantity' => 1,\n 'price' => $request->price,\n ]);\n }\n\n\n\n\n\n\n /////////////////////////////////////////\n\n Cart::add($request->id, $request->name, 1, $request->price)->associate('App\\product', 'App\\orderItem');\n toastr()->success('product added Successfully');\n\n\n return redirect()->back();\n \n }", "static function cartItem (){\n $user_id = auth()->user()->id;\n return Cart::where('user_id',$user_id)->count();\n }", "public function store(Request $request)\n {\n $rules = CartProduct::rules($request);\n $request->validate($rules);\n $product = Products::findOrFail($request->product_id);\n // Check if user has already cart\n $cart = Cart::where('user_id', Auth()->id())\n ->first();\n if ($cart==null) {// User does not have cart\n $newCart = Cart::create([\n 'user_id' => Auth()->id(),\n 'total' => $product->product_price\n ]);\n $credentials = CartProduct::credentials($request, $product);\n $credentials['cart_id'] = $newCart->id;\n $CART = CartProduct::create($credentials);\n } else {//User already have cart\n $credentials = CartProduct::credentials($request, $product);\n $credentials['cart_id'] = $cart->id;\n // Test 1\n $SameProduct = CartProduct::where('user_id', Auth()->id())->where('product_id' , $product->id )->get();\n if ($SameProduct->count() >= 1 ) {\n return redirect()->route('my-cart.index')->withErrors('The Item Is Already Exist');\n } else {\n // Insert product into cart\n $CART = CartProduct::create($credentials);\n // update total price\n $this->updateTotal($cart);\n }\n }\n\n\n return redirect()->route('my-cart.index');\n }", "private function check_cart() {\n $users_id = $this->session->userdata('id');\n if ($users_id) {\n // User connected > DB\n $this->data['deals'] = $this->users_cart->getForUser($users_id);\n } else {\n // Guest > Session\n $deals = $this->session->userdata('cart');\n if ($deals) {\n $this->data['deals'] = $this->deals->getDeals(false, false, false, false, false, false, $deals);\n } else {\n $this->data['deals'] = array();\n }\n }\n }", "public function shoppingCarts()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ShoppingCart','sp_id','sp_id');\n }", "public function carts()\n {\n return $this->hasMany('App\\Cart');\n }", "public function cartItems() {\n return $this->hasMany(CartItem::class);\n }", "public function product_user()\n {\n return $this->belongsTo(Product_user::class);\n }", "public function createCart($user_id){\n\n date_default_timezone_set('Asia/Colombo');\n $creation_date_time = date('Y-m-d H:i:s');\n\n $data = [\n 'User_ID' => $user_id,\n 'CreationDateTime' => $creation_date_time\n ];\n\n $cart_id = $this->InsertAndReturnID(\"cart\", $data);\n if(!$cart_id){\n return false;\n }else{\n return $cart_id;\n }\n }", "public function userCartCount($user_id)\n {\n return Cart::where('user_id',$user_id)->count();\n }", "public function shoppingCarts()\n {\n \t// hasMany(RelatedModel, foreignKeyOnRelatedModel = spsd_id, localKey = spsd_id)\n \treturn $this->hasMany('App\\ShoppingCart','spsd_id','spsd_id');\n }", "public function addToCart($id){\n $produk=Product::findOrFail($id);\n Auth::loginUsingId(1);\n $user = Auth::user()->id;\n $addToCart = Cart::create(['product_id'=>$produk->id,\n 'user_id'=>$user]);\n return 'Berhasil Memasukan data ke cart list';\n }", "public function addToCart()\n {\n $product = Cart::firstOrNew([\n 'user_id' => $this->student->id,\n 'product_id' => $this->id,\n 'product_type' => Enrollment::class\n ]);\n\n $product->save();\n return $product->id;\n }", "public function showUserCart()\n\t{\n\n\t\t$modelUserCart = $this->getModel('usercart');\n\t\t$userId = $this->_getUserId();\n\n\t\tif (!JSession::checkToken('get'))\n\t\t{\n\n\t\t\techo new JResponseJson(null, JText::_('JINVALID_TOKEN'), true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$modelUserCart->getUserCart($userId);\n\t\t\techo new JResponseJson($modelUserCart->getUserCart($userId),true, false);\n\n\t\t}\n\t}", "public function actionAddToCart($product_id, $user_id, $variation_id) {\n $saveArr['product_id'] = $product_id;\n $saveArr['user_id'] = $user_id;\n $saveArr['variation_id'] = $variation_id;\n $saveArr['created_date'] = date('Y-m-d H:i:s');\n $saveArr['updated_date'] = date('Y-m-d H:i:s');\n $saveArr['updated_by'] = $user_id;\n $saveArr['status'] = '1';\n Yii::$app->db->createCommand()->insert('shopping_cart', $saveArr)->execute();\n exit;\n }", "public function cart()\n {\n if(Auth::check()) {\n $user_email = Auth::user()->email;\n $userCart = DB::table('cart')->where('user_email', $user_email)->get();\n } else {\n $session_id = Session::get('session_id');\n $userCart = DB::table('cart')->where('session_id', $session_id)->get();\n }\n \n // Get images for cart items\n foreach($userCart as $key => $product){\n $product = Product::where('id', $product->product_id)->first();\n $userCart[$key]->image = $product->image;\n }\n $meta_title = \"Shopping Cart - E-com Website\";\n $meta_description = \"View Shopping Cart of E-com Website\";\n $meta_keywords = \"Shopping Cart - E-com Website\";\n return view('products.cart', compact('userCart', 'meta_title','meta_description', 'meta_keywords'));\n }", "public function carts()\n {\n return $this->hasMany(Cart::class);\n }", "public function carts()\n {\n return $this->hasMany(Cart::class);\n }", "public function carts()\n {\n return $this->hasMany(Cart::class);\n }", "public function view_cart($user_id)\n {\n $this->db->select('*')\n ->from('cart')\n ->join('product', 'cart.pro_id = product.pro_id')\n ->where('user_id',$user_id);\n $data = $this->db->get();\n return $data->result_array(); \n }", "public function productos()\n {\n return $this->hasMany(User::class);\n }", "public function index(User $user)\n {\n return $user->carts()->with(['user', 'product'])->get();\n }", "public function addToCart()\n {\n $inputs = request()->all();\n\n try\n {\n $items = $this->userRepo->addToUserCart(auth()->user(), $inputs, session('area_id'));\n }\n catch(AddToCartException $e)\n {\n return $this->respondWithErrors($e->getMessage());\n }\n\n return $this->respondWithSuccess([\n 'items' => $items\n ]);\n }", "public function addToCart(Request $request, $id){\n if(Auth::user()) {\n $shop = Product::find($request->product);\n if(!$shop) {\n abort(404);\n }\n \n $cart = session()->get('cart'); //verificam daca exista un cos in sesiune\n\n if(!$cart) {\n $cart = [\n $id => [\n \"name\" => $shop->name,\n \"quantity\" => 1,\n \"price\" => $shop->price,\n \"image\" => $shop->image\n ]\n ];\n session()->put('cart', $cart);\n return redirect()->back()->with('cart-success', 'Produs adaugat cu succes!');\n }\n \n if(isset($cart[$id])) { // daca cart nu este gol at verificam daca produsul exista pt a incrementa cantitate\n $cart[$id]['quantity']++;\n session()->put('cart', $cart);\n return redirect()->back()->with('cart-success', 'Produs adaugat cu succes!');\n }\n \n $cart[$id] = [ // daca item nu exista in cos at addaugam la cos cu quantity = 1\n \"name\" => $shop->name,\n \"quantity\" => 1,\n \"price\" => $shop->price,\n \"image\" => $shop->image\n ];\n session()->put('cart', $cart);\n return redirect()->back()->with('cart-success', 'Produs adaugat cu succes!');\n } else {\n return view('auth.login', ['url' => 'user']);\n }\n \n }", "public function carts()\n\t{\n\t\treturn $this->belongsToMany(Cart::class, 'items_carts', 'item_id', 'cart_id');\n\t}", "public function store(Request $request)\n {\n $userId = Auth::id();\n $task = Cart::create(['user_id' => $userId]);\n }", "public function addToCart(Request $req)\n {\n if($req->session()->has('user'))\n { \n \n $user_id = Session::get('user')['id'];\n $cartId = DB::table('cart')\n ->where('cart_status','=','0')\n ->where('user_id',$user_id)\n ->pluck('id')->first();\n \n \n\n if(isset($cartId))\n {\n\n $cartdetail = new CartDetail;\n \n $cartdetail->order_id = $cartId;\n $cartdetail->product_id = $req->product_id; \n $cartdetail->quantity = $req->quantity;\n $cartdetail->weight = $req->weight;\n $cartdetail->message = $req->message;\n $cartdetail->baselayer = $req->baselayer;\n $cartdetail->save(); \n \n $tot_cost = DB::table('cart')\n ->where('cart_status','=','0')\n ->where('user_id',$user_id)\n ->pluck('total_cost')->first();\n \n $qty = DB::table('cart')\n ->join('cartdetails','cart.id','=','cartdetails.order_id')\n ->join('products','cartdetails.product_id','=','products.id')\n ->where('user_id',$user_id)\n ->where('cart.user_id',$user_id)\n ->where('cartdetails.product_id',$req->product_id)\n ->pluck('cartdetails.quantity')\n ->first();\n \n \n // echo \"<pre>\";\n // print_r($qty);\n // die();\n\n Cart::where('cart_status','=','0')\n ->where('user_id',$user_id)\n ->update(['total_cost' => ($qty * $req->price) + $tot_cost]);\n\n $qty_before = DB::table('products')\n ->where('id','=',$req->product_id)\n ->pluck('qty_available')->first();\n \n // echo \"<pre>\";\n // print_r($qty_before);\n // die();\n $qty_after = DB::table('products')\n ->where('id','=',$req->product_id)\n ->update(['qty_available' => $qty_before - $qty]);\n\n }\n else\n {\n $cart= new Cart;\n $cart->user_id = $user_id;\n $cart->save();\n $cartId=$cart->id;\n\n \n $cartdetail= new CartDetail;\n \n $cartdetail->order_id = $cartId;\n $cartdetail->product_id = $req->product_id; \n $cartdetail->quantity = $req->quantity;\n $cartdetail->weight = 5;\n $cartdetail->message = $req->message;\n $cartdetail->baselayer = $req->baselayer;\n $cartdetail->save(); \n\n $cart->total_cost = $req->quantity * $req->price;\n \n $cart->save();\n\n $qty = DB::table('cart')\n ->join('cartdetails','cart.id','=','cartdetails.order_id')\n ->join('products','cartdetails.product_id','=','products.id')\n ->where('user_id',$user_id)\n ->where('cart.user_id',$user_id)\n ->where('cartdetails.product_id',$req->product_id)\n ->pluck('cartdetails.quantity')\n ->first();\n\n $qty_before = DB::table('products')\n ->where('id','=',$req->product_id)\n ->pluck('qty_available')->first();\n\n $qty_after = DB::table('products')\n ->where('id','=',$req->product_id)\n ->update(['qty_available' => $qty_before - $qty]);\n\n }\n return redirect ('/cart');\n\n }\n else\n { \n\n return redirect ('/home');\n }\n }", "public function addToCart($request)\n\t{\n // Validation \n $this->attributes = $request;\n $this->user_id = 1;\n\n if(!$this->validate()){\n return false;\n }\n\n // Validation: Check Product Exist in Product Table \n $productModel = Products::findOne($this->product_id);\n if(!$productModel){\n $this->addError(\"Failed to Add\",\"Given Product (\".$this->product_id.\") is not Available\");\n return false;\n }\n\n // Check Product Already Exist. If already exist then update other wise add\n $cartProduct = Cart::find()->where([\"product_id\"=>$this->product_id])->one();\n\n if($cartProduct){\n $cartProduct->quantity = $cartProduct->quantity + $this->quantity; \n $isSaved = $cartProduct->save();\n return $isSaved ? $cartProduct->id : false; \n }else{\n $isSaved = $this->save(); \n return $isSaved ? $this->id : false; \n }\n }", "public function cart(): void\n {\n $userData = $this->getSession()->getCurrentUserData();\n\n if ($userData->getCart() && $userData->getCart()->hasProducts())\n {\n echo $this->render('cart/shoppingCart', $userData->getRenderCartParams());\n }\n }", "public function addToCart(Request $request)\n {\n $cartModel = New Cart();\n $user_id = $request->user_id;\n $product_id = $request->product_id;\n $quantity = $request->quantity;\n $cartItems = $cartModel->addToCart($user_id,$product_id,$quantity);\n return response()->json($cartItems, 201);\n }", "public function stockUser()\n {\n return $this->belongsTo(\\App\\Models\\User::class, 'stock_user_id');\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'product_id' => 'required'\n ],\n [\n 'product_id.required' => 'Please Selcet Any product First !'\n ]);\n\n if(!empty($request->user_id)){\n $cart = Cart::where('user_id', $request->user_id)\n ->where('product_id', $request->product_id)\n ->where('order_id', NULL)\n ->first();\n }else{\n $cart = Cart::where('ip_address', request()->ip())\n ->where('product_id', $request->product_id)\n ->where('order_id', NULL)\n ->first();\n\n }\n\n if(!is_null($cart)){\n $cart->increment('product_quantity');\n }\n else{\n $cart = new Cart();\n if(!empty($request->user_id)){\n $cart->user_id = $request->user_id;\n }\n $cart->ip_address = request()->ip();\n $cart->product_id = $request->product_id;\n $cart->save();\n }\n\n session()->flash('success', 'This product are added to cart');\n return back();\n }", "public function carts() {\n return $this->belongsToMany('App\\Cart', 'sales', 'sale_id',\n 'sale_id', 'sale_id', 'sale_id')\n ;\n }", "public function getCart(){\n $session_id = Session::get('session_id');\n $userCart = Cart::where('session_id', $session_id)->get();\n $totalPrice = 0;\n if($userCart->count() > 0){\n foreach($userCart as $key => $cart){\n // Kiểm tra nếu sản phẩm có status == 0 thì xóa khỏi giỏ hàng\n if($cart->products->status == 0){\n $cart->delete();\n unset($userCart[$key]);\n }\n // Kiểm tra nếu kho = 0\n if($cart->attributes->stock == 0){\n $cart->quantity = 0;\n $cart->save();\n }\n // Kiểm tra nếu kho < quantity\n if($cart->attributes->stock < $cart->quantity){\n $cart->quantity = $cart->attributes->stock;\n $cart->save();\n }\n $totalPrice += $cart->attributes->price*$cart->quantity;\n }\n $totalItems = $userCart->sum('quantity');\n \n }else{\n $totalItems = 0;\n }\n \n return view('frontend.cart_page')->withUserCart($userCart)->withTotalItems($totalItems)->withTotalPrice($totalPrice);\n }", "public function add(Request $request, $product_id){\n\n $product = Product::find($product_id);\n\n // data validator \n $validator = Validator::make($request->all(), [\n 'quantity' => 'required|integer|min:1',\n ]);\n\n // case validator fails\n if($validator->fails()){\n return redirect()->back()->with('error', 'You have to add at least one item in your cart');\n }\n\n // check if product exists\n if($product){\n \n if(Auth::user()){\n\n $cartItems = Auth::user()->cartItems;\n foreach($cartItems as $item){\n if($item->product_id == $product->id){\n // case product already exists in cart\n $item->quantity += $request->quantity;\n $item->save();\n \n return redirect()->back()->with('success', 'Product added to cart');\n }\n }\n \n $cartItem = new CartItem;\n $cartItem->quantity = $request->quantity;\n $cartItem->product_id = $product_id;\n $cartItem->user_id = Auth::user()->id;\n $cartItem->save();\n\n }else{\n \n // if there are products in this session\n if(Session::has('cartItems')){\n foreach(Session::get('cartItems') as $item){\n if($item->product_id == $product->id){\n // case product already exists in cart\n $item->quantity += $request->quantity;\n \n return redirect()->back()->with('success', 'Product added to cart');\n }\n }\n\n $cartItem = new \\stdClass();\n $cartItem->quantity = $request->quantity;\n $cartItem->product_name = $product->name;\n $cartItem->product_id = $product->id;\n $cartItem->product_price = $product->price;\n\n $cartItems = Session::get('cartItems');\n array_push($cartItems, $cartItem);\n Session::put('cartItems', $cartItems);\n\n }else{\n\n $cartItem = new \\stdClass();\n $cartItem->quantity = $request->quantity;\n $cartItem->product_name = $product->name;\n $cartItem->product_id = $product->id;\n $cartItem->product_price = $product->price;\n\n Session::put('cartItems', array());\n $cartItems = Session::get('cartItems');\n array_push($cartItems, $cartItem);\n Session::put('cartItems', $cartItems);\n\n }\n\n } \n\n return redirect()->back()->with('success', 'Product added to cart');\n\n }\n\n // case product not found\n return redirect()->back()->with('error', 'Product not found');\n\n }", "function check_product_in_the_cart($product){\n if (auth()->check()){\n $cart = Cart::where('user_id', auth()->user()->id)->where('product_id', $product->id)->first();\n }else{\n if(session()->has('carts')){\n $cart = key_exists($product->uuid, session('carts'));\n }else{\n $cart = false;\n }\n }\n\n if ($cart){\n return true;\n }else{\n return false;\n }\n}", "public function getCartByUserId($userId)\n {\n \t$cart = $this->findCartByUserId($userId);\n \treturn $cart;\n }", "public function store(Request $request)\n {\n $this->validate(request(),[\n 'user_id'=>'required',\n 'product_id'=>'required',\n 'product_price'=>'required',\n 'seller_id'=>'required',\n ]);\n \n $orders = Order::where('user_id', Auth::user()->id)\n ->where('order_status_id', 1)->get();\n if(!count($orders)){\n $seller = User::find($request->seller_id);\n $order = new Order();\n $order->user_id = $request->user_id;\n $order->order_status_id = 1;\n $order->order_number = mt_rand();\n\n if( $order->save() ){\n $order_id = $order->id;\n }\n\n $seller->addCart()->attach($order_id);\n $orderitem = new OrderItem();\n $orderitem->order_id=$order_id;\n $orderitem->product_id = $request->product_id;\n $orderitem->product_price = $request->product_price;\n $orderitem->quantity = 1;\n $orderitem->save();\n return redirect('/buyers');\n }\n else{\n $order = Order::where('user_id', Auth::user()->id)\n ->where('order_status_id', 1)->first();\n $order_id = $order->id;\n\n $orderInCart = OrderUser::where('user_id',$request->seller_id)\n ->where('order_id',$order_id)->get();\n\n if( !count($orderInCart) ) {\n $seller = User::find($request->seller_id);\n $seller->addCart()->attach($order_id);\n }\n \n $orderitem = new OrderItem();\n $orderitem->order_id=$order_id;\n $orderitem->product_id = $request->product_id;\n $orderitem->product_price = $request->product_price;\n $orderitem->quantity = 1;\n $orderitem->save();\n return redirect('/buyers');\n }\n \n return back();\n }", "public function addToShoppingCart($User_Name, $Product_ID){\r\n $check = $this->DB->prepare(\"SELECT * FROM shopping_cart WHERE (User_Name = '$User_Name') AND (Product_ID = $Product_ID);\");\r\n $check->execute ();\r\n $check = $check->fetchAll (PDO::FETCH_ASSOC);\r\n\r\n if(count($check) == 0){ //If the user has not added the item to the cart previously,\r\n $stmt = $this->DB->prepare('INSERT INTO shopping_cart values(NULL, :User_Name, :Product_ID, 1)');\r\n $stmt->bindParam( 'User_Name', $User_Name );\r\n $stmt->bindParam( 'Product_ID', $Product_ID );\r\n $stmt->execute();\r\n } else {\r\n $stmt = $this->DB->prepare (\"UPDATE shopping_cart SET Product_Count = Product_Count + 1 WHERE (User_Name = :User_Name) AND (Product_ID = :Product_ID)\");\r\n $stmt->bindParam( 'User_Name', $User_Name );\r\n $stmt->bindParam( 'Product_ID', $Product_ID );\r\n $stmt->execute ();\r\n }\r\n }", "public function addCart($cart){\n $this->cart_id = $cart; \n }", "public function process(Cart $cart, User $user, MessageBag $messageBag);", "public function testGetUserCart()\n {\n $this->json('get', 'cart')\n ->assertOk();\n }", "public function getCartIdentifire()\n {\n return $this->hasOne(Cart::className(), ['cart_identifire' => 'cart_identifire']);\n }", "public function store(Request $request)\n {\n $cartDetail = New CartDetail();\n /**ID del Carrito del Usuario */\n $cartDetail->cart_id = auth()->user()->cart->id;//Campo Calculado del ID del Carrito para el usuario solo hay un Carrito activo para cada Usuario\n /**Recibimos los datos del producto y lo asociamos */\n $cartDetail->product_id = $request->product_id;\n $cartDetail->cost_price = $request->cost_price;\n $cartDetail->price = $request->price;\n $cartDetail->quantity = $request->quantity;\n $cartDetail->colours = $request->colour;\n $cartDetail->opcional_colours = $request->colourOptional;\n $cartDetail->waists = $request->waist;\n /**Guardamos la información recibida */\n $cartDetail->save();\n /**Lo llevamos al lugar don el usuario se encontraba */\n flash('¡Bien Hecho! Agregamos Correctamente el Producto a tu Carrito de Compras.')->success()->important();\n return back();\n\n }", "public function getCart();", "public function store(Request $request)\n {\n $user = Auth::User();\n $cart = DB::table('orders')\n ->select('id')\n ->where('status_id', '=', 1)\n ->where('user_id', '=', $user->id)\n ->value('id');\n\n if(empty($cart)) {\n $order = new Order;\n $order->user_id = $user->id;\n $order->status_id = 1;\n $order->save();\n\n $orderProduct = new OrderProduct;\n $orderProduct->order_id = $order->id;\n $orderProduct->product_id = $request->product_id;\n $orderProduct->quantity = $request->quantity;\n $orderProduct->save();\n } else {\n // if you already have this product in your cart just add the next quantity to the same line item\n if (OrderProduct::where('order_id', $cart)->where('product_id', $request->product_id)->exists() ){\n $repeatOrderProduct = OrderProduct::where('order_id', $cart)->where('product_id', $request->product_id)->first();\n $orderProduct = OrderProduct::find($repeatOrderProduct->id);\n $orderProduct->product_id = $request->product_id;\n $orderProduct->quantity = $request->quantity + $orderProduct->quantity;\n $orderProduct->save();\n }\n // else make a new line item for this new item\n else {\n $orderProduct = new OrderProduct;\n $orderProduct->order_id = $cart;\n $orderProduct->product_id = $request->product_id;\n $orderProduct->quantity = $request->quantity;\n $orderProduct->save();\n }\n }\n\n Activity::log('Saved an item to their cart.', $user->id);\n\n $request->session()->flash('status', 'Product was saved to cart.');\n\n return Redirect::action('CartController@index');\n\n }", "public function add_to_cart(Request $request){\n $product = Product::find($request->input('product_id'));\n //On s'assure qu'il y'a bien un produit qui est retourne\n if($product){\n //On enregistre la session cart dans une variable\n $cart = $request->session()->get('cart');\n //On verifie si la cle du produit est deja dans les produits dans la session avant de l'ajouter\n if(!isset($cart['products'][$product->id])){\n //On prepare comment ajouter le produit dans les sessions. Chaque produit dans la sessoin set enregistre dans une cle cart. cette cle contient un\n $cart['products'][$product->id] = ['name' => $product->name, 'price' => $product->price, 'quantite' => 1, \"total\" => $product->price];\n //On ajoute la variable $cart dans les sessions\n $request->session()->put('cart',$cart);\n }\n }\n return response()->json(['success' => true,], 200);\n }", "public function store(Request $request)\n {\n $data = $this->validate(request(),\n [\n 'user_id' => 'required|numeric',\n 'product_id' => 'required|numeric',\n 'quantity' => 'required|numeric',\n \n \n ], [] ,[\n 'user_id' => trans('admin.user_id'),\n 'product_id' => trans('admin.product_id'),\n 'country_id' => trans('admin.country_id'),\n \n \n ]);\n \n Cart::create($data);\n session()->flash('success',trans('admin.record_added'));\n return redirect(aurl('carts'));\n }", "public function created(User $user)\n {\n $customerRole = Role::where('name', 'customer')->first();\n\n if(!($customerRole instanceof Role))\n {\n Artisan::call('db:seed --class=RoleSeeder');\n $customerRole = Role::where('name', 'customer')->first();\n }\n \n $user->attachRole($customerRole);\n\n if($user->cart == null)\n {\n $user->cart()->save(new Cart);\n \n }\n }", "public function getCartable();", "public function addShoppingCart(ShoppingCart $l)\n\t{\n\t\tif ($this->collShoppingCarts === null) {\n\t\t\t$this->initShoppingCarts();\n\t\t}\n\t\tif (!in_array($l, $this->collShoppingCarts, true)) { // only add it if the **same** object is not already associated\n\t\t\tarray_push($this->collShoppingCarts, $l);\n\t\t\t$l->setUser($this);\n\t\t}\n\t}", "public function checkout(){\n \n $user_id = Auth::user()->id;\n $order = new Order;\n $total = 0;\n if(Session::has('cart_'.Auth::user()->id)){\n foreach(session('cart_'.Auth::user()->id) as $id => $product){\n $total += $product['price'] * $product['quantity'] ;\n $order->total_price = $total;\n $order->quantity = $product['quantity'];\n $order->user_id = $user_id;\n $order->save();\n $order->product()->sync($product['id'],false);\n }//end foreach\n \n \n Session::forget('cart_'.Auth::user()->id);\n return redirect()->back();\n }\n else{\n return redirect('UserHome');\n }\n \n \n }", "public function postAddItem(Request $request){\n // Forget Coupon Code & Amount in Session\n Session::forget('CouponAmount');\n Session::forget('CouponCode');\n\n $session_id = Session::get('session_id');\n if(empty($session_id)){\n $session_id = str_random(40);\n Session::put('session_id', $session_id);\n }\n\n // Kiểm tra item đã có trong giỏ hàng chưa\n $checkItem = Cart::where(['product_id'=>$request['product_id'], 'attribute_id'=>$request['attribute_id'], 'session_id'=>$session_id])->first();\n\n // Nếu item đã có trong giỏ hàng thì cộng số lượng\n // Nếu item chưa có trong giỏ hàng thì thêm vào cart\n if(!empty($checkItem)){\n $checkItem->quantity = $checkItem->quantity + $request['quantity'];\n $checkItem->save();\n }else{\n $cart = new Cart;\n $cart->product_id = $request['product_id'];\n $cart->attribute_id = $request['attribute_id'];\n $cart->quantity = $request['quantity'];\n $cart->session_id = $session_id;\n if($request['user_email']){\n $cart->user_email = '';\n }else{\n $cart->user_email = $request['user_email'];\n }\n $cart->save();\n }\n\n return redirect()->route('get.cart')->with('flash_message_success', 'Sản phẩm đã được thêm vào giỏ hàng!');\n }", "public function AddToCart(Request $request)\n {\n // return $request->price;\n if ($request->session()->has(\"onlineClient\")) {\n $clientInfo = $request->session()->get(\"onlineClient\");\n $idd = $clientInfo->id;\n $cartOld = AddToCartModel::where('userId', $idd)->where('productId', $request->productId)->first();\n if ($cartOld == null) {\n $cartnew = new AddToCartModel;\n $cartnew->productId = $request->productId;\n $cartnew->userId = $idd;\n $cartnew->type = $request->productType;\n $cartnew->price = $request->price;\n $cartnew->save();\n } else {\n $cartOld->quantity += 1;\n $cartOld->save();\n }\n return \"success\";\n } elseif ($request->session()->has(\"uniqid\")) {\n $uniqid = $request->session()->get(\"uniqid\");\n $idd = $uniqid;\n $cartOld = AddToCartModel::where('sessionId', $idd)->where('productId', $request->productId)->first();\n if ($cartOld == null) {\n $cartnew = new AddToCartModel;\n $cartnew->productId = $request->productId;\n $cartnew->type = $request->productType;\n $cartnew->price = $request->price;\n $cartnew->sessionId = $idd;\n $cartnew->save();\n } else {\n $cartOld->quantity += 1;\n $cartOld->save();\n }\n return \"success\";\n } else {\n return \"error\";\n }\n }", "public function addToCart(Request $request)\n {\n // Cart::destroy();\n // return $request->all();\n $duplicate = Cart::instance('shopping')->search(function ($cartItem, $rowId) use ($request) {\n return $cartItem->id === $request->id;\n });\n if ($duplicate->isNotEmpty()) {\n $rowId = Cart::instance('shopping')->content()->where('id', $request->id)->first()->rowId;\n // Cart::remove($rowId);\n $arr = array('msg' => 'Already in Cart', 'Status' => false, 'Cart_cout' => Cart::instance('shopping')->content());\n return response($arr, 200);\n } else {\n // Cart::add(['id' => '293ad', 'name' => 'Product 1', 'qty' => 1, 'price' => 9.99 );\n\n Cart::instance('shopping')->add($request->id, $request->name, $request->qty ?? 1, $request->amount , ['qtyValue' => $request->qtyValue])\n ->associate('\\App\\Product');;\n $arr = array('msg' => 'Added to cart', 'Status' => true, 'Cart_cout' => Cart::instance('shopping')->content());\n return response($arr, 200);\n }\n }", "public function store(Request $request, $id)\n {\n\n $cart=Cart::find(session('cartId'));\n\n $cart->products()->attach($id);\n //si esta logueado meto tambien el user id al Carrito si no lo tiene\n\n return redirect()->back();\n }", "public function store(Request $request){\n $cartDetail = new CartDetail(); //creamos un nuevo objeto\n $cartDetail->cart_id = auth()->user()->cart->id; //capturamos el usuario de ese carro\n $cartDetail->product_id= $request->product_id;\n $cartDetail->quantity = $request->quantity;\n $cartDetail->save();\n $notification = \"El producto fue añadido correctamente\";\n return back()-> with(compact('notification'));\n }", "public function edit(UserCart $userCart) {\n\t\t//\n\t}", "public function getCartItems()\n {\n return $this->hasMany(CartItem::className(), ['product_id' => 'id']);\n }", "function cartHasCourse($course_id)\n{\n return CartItem::where('cart_id', getUserCart()->id)->where('course_id', $course_id)->first();\n}", "private function addToCart () {\n }", "private function addToCart () {\n }", "public function test_products_belongs_to_user()\n {\n $product = Product::factory()->create();\n \n $this->assertInstanceOf( User::class, $product->createdBy );\n }", "public function cart()\n {\n $data['cart'] = Cart::where('user_id',Auth::user()->id)->get();\n return view('cart',$data);\n }", "public function seller() {\n return $this->belongsTo(User::class);\n }", "public function add(Request $request)\n {\n $cart = new Shoppingcart($request);\n $cart->add($request->input('id')); \n }", "public function store(Request $request)\n {\n //\n $request->validate([\n 'item_id'=>'required',\n ]);\n\n $data=$request->all();\n $data['user_id']=auth()->user()->id;\n $item=Item::findOrFail($request->item_id);\n $data['price']=$item->price_per;\n $data['quantity']=$request->quantity;\n $data['item']=$item->name;\n \n $cart =new Cart($data);\n $cart->save();\n return redirect()->route('cart.index')->with('sucess','Added in Cart');\n \n }", "public function store(Request $request)\n {\n Cart::Create([\n 'user_id'=>Auth::User()->id,\n 'item_id'=>$request->item_id,\n ]);\n return redirect()->action('CartController@index');\n }", "public function store(Request $request)\n {\n $product = Product::find($request->id);\n $item = new Cart;\n $item->name = $product->name;\n $item->description = $product->description;\n $item->price = $product->price;\n $item->featured_img = $product->featured_img;\n $item->quantity = 1;\n $item->user_id = Auth::user()->id;\n $item->status = 0; //producto no comprado.\n $item->cart_number = 0;\n $item->save();\n return redirect('/cart');\n }", "public function index()\n {\n $userCart = Cart::where('user_id', Auth()->id())\n ->first();\n $MyCart = CartProduct::where('user_id' , Auth()->id())->get();\n\n // dd($userCart);\n if ($userCart == NULL)\n {\n return view('cart', compact('userCart'));\n } else {\n $CartProducts = CartProduct::where('user_id', Auth()->id())\n ->where('cart_id', $userCart->id)\n ->get();\n return view('cart', compact('userCart', 'CartProducts','MyCart'));\n }\n }", "public function addToCart(Request $req)\n {\n //cek jika user sudah login\n if(Auth::check())\n {\n //mencari cart yang useridnya sama dengan id yang sedang login\n $cart = Cart::find(Auth::user()->userId.'#'.$req->id);\n //jika cart sudah ada isi dengan barang yang sama, maka jumlah hanya akan ditambah\n if(isset($cart))\n {\n $cart->qty += $req->qty;\n $cart->save();\n }\n else //jika belum ada maka akan dibuat baru\n {\n $cart = new Cart;\n $cart->cartId = Auth::user()->userId.'#'.$req->id;;\n $cart->qty = $req->qty;\n $cart->save();\n }\n return redirect('/cart');\n }\n\n return redirect ('/');\n }", "public function add(Request $request)\n {\n $product = Product::find($request->id);\n if (isset($_COOKIE['user_ip'])) {\n $ip = $_COOKIE['user_ip'];\n } else {\n $ip = $request->ip();\n setcookie('user_ip', $ip, time() + 1206900);\n }\n $cart = new Cart();\n $cart->user_ip = $ip;\n $cart->product_id = $product->id;\n $cart->user_system_info = $request->server('HTTP_USER_AGENT');\n $cart->quantity = 1;\n $cart->save();\n\n return redirect()->back();\n }", "function add_to_cart(item $item) {\n \\Cart::session(auth()->id())->add(array(\n 'id' => $item->id,\n 'name' => $item->name,\n 'price' => $item->price,\n 'quantity' => 1,\n 'attributes' => array(),\n 'associatedModel' => $item\n ));\n return redirect('/cart');\n }", "public function getCart() {\r\n\t\treturn $this->getUser()->getCart();\r\n\t}", "public function rapidAdd($id){\n $product=Products::find($id);\n $cart= Cart::add([\n'id'=>$product->id,\n'name'=>$product->pro_name,\n'qty'=>1,\n'price'=>$product->pro_price,\n ]);\n Cart::associate($cart->rowId, 'App\\Models\\Products');\nreturn redirect('/cart')->with('info', 'Product added in cart');\n }", "public function addToCart()\n {\n\n $id = $_POST['id'];\n $quantity = intval($_POST['quantity']);\n\n $model = new ProductModel();\n $dice = $model->getProductByID($id);\n $diceToAdd = [\n 'product' => $dice,\n 'quantity' => $quantity\n ];\n\n // if cart is empty, initialize empty cart\n if (empty($_SESSION['shoppingCart'])) {\n $_SESSION['shoppingCart'] = [];\n }\n\n // item already in cart ? no\n $found = false;\n\n // if product is already in the cart, adding to quantity\n for ($i = 0; $i < count($_SESSION['shoppingCart']); $i++) {\n if ($_SESSION['shoppingCart'][$i]['product']['id'] == $id) {\n $_SESSION['shoppingCart'][$i]['quantity'] += $quantity;\n $_SESSION['totalInCart'] += $quantity;\n\n $found = true;\n }\n }\n\n //if not, adding product and quantity\n if ($found == false) {\n array_push($_SESSION['shoppingCart'], $diceToAdd);\n $_SESSION['totalInCart'] += $diceToAdd['quantity'];\n }\n\n header('Location: ./shop');\n exit;\n }", "public function addToCart($id, Request $request)\n {\n $product = DB::table('products')\n ->join('images', 'products.id', '=', 'images.product_id')\n ->select('products.*', 'images.name as imageName')\n ->where('products.id', '=', $id)\n ->groupby('products.id')\n ->get();\n $name = $product[0]->name;\n $price = $product[0]->price * ((100-$product[0]->sale)/100);\n $image = $product[0]->imageName;\n Cart::add(array('id' => $id, 'name' => $name, 'qty' => 1, 'price' => $price, 'options' => array('size' => 'L', 'image' => $image)));\n return redirect('user/cart');\n }", "public function create()\n {\n $cart = session()->get('cart');\n }", "function store(Request $request){\n\n // $user->name = request('name');\n // // $user->email = request('email');\n // $user->address = request('address');\n // $user->doctor = request('doctor');\n // $user->save();\n // $user = auth()->user();\n\n $total = Cart::subtotal();\n //insert into orders table \n\n $order = UserOrder::create([\n 'user_id'=> auth()->user() ? auth()->user()->id : null,\n 'email' => $request->email,\n 'name' => $request->name,\n 'address' => $request->address,\n 'doctor' => $request->doctor,\n 'sub_total' => $total ,\n ]);\n\n //insert into product\n foreach(Cart::Content() as $item){\n PatientOrders::create([\n 'order_id' => $order->id,\n 'product_id' => $item->model->id,\n // 'quantity' => $item->qty\n\n ]);\n }\n\n Cart::destroy();\n return redirect()->route('list.index')->with('success_message', 'Order Placed'); \n }", "public function update(Request $request, UserCart $userCart) {\n\t\t//\n\t}", "function getCart($cart) //when i get a cart, i can manipulate\n {\n $this->cart=$cart;\n }" ]
[ "0.7761302", "0.7456331", "0.70496047", "0.70012146", "0.69671553", "0.6877826", "0.6732093", "0.6713625", "0.6705336", "0.6621397", "0.6582574", "0.656863", "0.6425222", "0.64217776", "0.63947475", "0.6360661", "0.6347893", "0.6327786", "0.6323656", "0.62776035", "0.62415975", "0.6240766", "0.62042147", "0.61900306", "0.6171008", "0.6156842", "0.61465544", "0.6129161", "0.6106319", "0.60969037", "0.60834014", "0.60830826", "0.60798365", "0.6066074", "0.60566133", "0.60400385", "0.6039815", "0.6039815", "0.6039815", "0.60381055", "0.60377175", "0.6037654", "0.60183376", "0.60093343", "0.60062754", "0.6001518", "0.5992307", "0.59803516", "0.5954102", "0.59482104", "0.5945755", "0.5926268", "0.5917988", "0.59170175", "0.59139985", "0.5910338", "0.59091544", "0.5902493", "0.58980167", "0.58907336", "0.5889854", "0.58895475", "0.58886105", "0.5879664", "0.58583474", "0.58567303", "0.5848257", "0.58442575", "0.58407253", "0.58343625", "0.582687", "0.58200884", "0.58083594", "0.57898164", "0.5785333", "0.5777448", "0.57680607", "0.5767514", "0.5753603", "0.57532537", "0.57438844", "0.57438844", "0.574252", "0.5742351", "0.57406664", "0.5729373", "0.57263017", "0.57185304", "0.5713396", "0.5706984", "0.5705909", "0.5693507", "0.5685589", "0.56836635", "0.56827116", "0.56761396", "0.5674124", "0.56687206", "0.566703", "0.56517684", "0.56498384" ]
0.0
-1
Shopping Cart has many Cart Items
public function cartItems() { return $this->hasMany(CartItem::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function cart()\n {\n return $this->hasMany(Item::class);\n }", "public function cartItem()\n {\n return $this->hasMany('App\\Model\\CartItem');\n }", "public function carts()\n\t{\n\t\treturn $this->belongsToMany(Cart::class, 'items_carts', 'item_id', 'cart_id');\n\t}", "public function carts()\n {\n return $this->hasMany('App\\Cart');\n }", "public function carts()\n {\n return $this->hasMany(Cart::class);\n }", "public function carts()\n {\n return $this->hasMany(Cart::class);\n }", "public function carts()\n {\n return $this->hasMany(Cart::class);\n }", "public function getCartItems()\n {\n return $this->hasMany(CartItem::className(), ['product_id' => 'id']);\n }", "public function cart() {\n return $this->belongsTo('App\\Cart');\n }", "public function shoppingCart()\n {\n return $this->hasMany(ShoppingCart::class);\n }", "public function cart()\n {\n return $this->belongsTo(Cart::class);\n }", "public function carts(){\n return $this->hasMany('App\\Model\\Cart','customer_id','id');\n }", "public function cart()\n {\n return $this->belongsTo('JulioBitencourt\\Cart\\Storage\\Eloquent\\Entities\\Cart');\n }", "public function cart() : BelongsTo\n {\n return $this->belongsTo(Cart::class);\n }", "public function shoppingCarts()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\ShoppingCart','sp_id','sp_id');\n }", "public function cart()\n {\n return $this->belongsTo('TechTrader\\Models\\Cart');\n }", "public function cart()\n {\n return $this->belongsTo('App\\Models\\Cart', 'cart_id', 'id');\n }", "public function carts() {\n return $this->belongsToMany('App\\Cart', 'sales', 'sale_id',\n 'sale_id', 'sale_id', 'sale_id')\n ;\n }", "public function shoppingCarts()\n {\n \t// hasMany(RelatedModel, foreignKeyOnRelatedModel = spsd_id, localKey = spsd_id)\n \treturn $this->hasMany('App\\ShoppingCart','spsd_id','spsd_id');\n }", "public function carts()\n {\n return $this->belongsToMany(Cart::class)->withPivot('quantity')->withTimestamps();\n }", "public function UserCart()\n {\n return $this->hasMany(UserCart::class, 'id_user_cart', 'id');\n }", "public function cart()\n {\n return $this->hasOne('App\\Cart', 'id_user');\n }", "public function carts()\n {\n return $this->belongsToMany(Cart::class, 'cart_discount_code', 'discount_code_id', 'cart_id')->withPivot(\n 'cart_id',\n 'discount_code_id',\n 'attributed_at',\n 'converted_at',\n 'deleted_at',\n 'new_referral'\n );\n }", "public function getCartItems($cart_id);", "public function getCart();", "public function getCartDetails()\n {\n return $this->hasMany(CartDetails::className(), ['cart_id' => 'id']);\n }", "public function details()\n {\n\n return $this->hasMany(CartDetail::class);\n }", "public function getCartable();", "public function addCart($cart){\n $this->cart_id = $cart; \n }", "public function ProductItems()\n {\n return $this->belongsToMany('App\\Order','order_product');\n }", "public function items()\n {\n return $this->hasMany('App\\OrderItem');\n }", "static function cartItem (){\n $user_id = auth()->user()->id;\n return Cart::where('user_id',$user_id)->count();\n }", "public function items(){\n \treturn $this->hasMany('mat3am\\Item');\n }", "public function items()\n {\n return $this->hasMany('App\\Models\\Misc\\Equipment\\EquipmentStocktakeItem', 'stocktake_id');\n }", "function getCart(){\n \treturn $this->myCart->getList();\n }", "public function items(){\n return $this->hasMany(OrderItem::class);\n }", "public function cartItems()\n {\n if(Auth::check()) //if user is logged in\n {\n $userCartExistence = Cart::hasCart(Auth::id()); //check if logged in user has any cart\n if($userCartExistence) //if athenticated user has any cart then retrieve items from cart\n {\n $cartItems = Cart::CartItems(Auth::id());\n }\n else\n {\n $cartItems = null;\n }\n }\n else //if user is not logged in\n {\n $Cart = Session::has('cart') ? Session::get('cart') : null; //check if there is any cart in the session\n if($Cart)\n {\n $cartItems = $Cart->items; //if there is cart then retrieve items from cart\n }\n else\n {\n $cartItems = null;\n }\n }\n\n return $cartItems;\n // return response()->json(['cartItems' => $cartItems]);\n }", "private function addToCart () {\n }", "private function addToCart () {\n }", "public function add(Request $request, $product_id){\n\n $product = Product::find($product_id);\n\n // data validator \n $validator = Validator::make($request->all(), [\n 'quantity' => 'required|integer|min:1',\n ]);\n\n // case validator fails\n if($validator->fails()){\n return redirect()->back()->with('error', 'You have to add at least one item in your cart');\n }\n\n // check if product exists\n if($product){\n \n if(Auth::user()){\n\n $cartItems = Auth::user()->cartItems;\n foreach($cartItems as $item){\n if($item->product_id == $product->id){\n // case product already exists in cart\n $item->quantity += $request->quantity;\n $item->save();\n \n return redirect()->back()->with('success', 'Product added to cart');\n }\n }\n \n $cartItem = new CartItem;\n $cartItem->quantity = $request->quantity;\n $cartItem->product_id = $product_id;\n $cartItem->user_id = Auth::user()->id;\n $cartItem->save();\n\n }else{\n \n // if there are products in this session\n if(Session::has('cartItems')){\n foreach(Session::get('cartItems') as $item){\n if($item->product_id == $product->id){\n // case product already exists in cart\n $item->quantity += $request->quantity;\n \n return redirect()->back()->with('success', 'Product added to cart');\n }\n }\n\n $cartItem = new \\stdClass();\n $cartItem->quantity = $request->quantity;\n $cartItem->product_name = $product->name;\n $cartItem->product_id = $product->id;\n $cartItem->product_price = $product->price;\n\n $cartItems = Session::get('cartItems');\n array_push($cartItems, $cartItem);\n Session::put('cartItems', $cartItems);\n\n }else{\n\n $cartItem = new \\stdClass();\n $cartItem->quantity = $request->quantity;\n $cartItem->product_name = $product->name;\n $cartItem->product_id = $product->id;\n $cartItem->product_price = $product->price;\n\n Session::put('cartItems', array());\n $cartItems = Session::get('cartItems');\n array_push($cartItems, $cartItem);\n Session::put('cartItems', $cartItems);\n\n }\n\n } \n\n return redirect()->back()->with('success', 'Product added to cart');\n\n }\n\n // case product not found\n return redirect()->back()->with('error', 'Product not found');\n\n }", "public function getCartItemCollection()\n {\n return $this->items;\n }", "public function items() : HasMany\n {\n return $this->hasMany(OrderItem::class);\n }", "public function getShoppingCart()\r\n\t{\r\n\t\treturn $this->shoppingCart;\r\n\t}", "public function cart()\n {\n if(Auth::check()) {\n $user_email = Auth::user()->email;\n $userCart = DB::table('cart')->where('user_email', $user_email)->get();\n } else {\n $session_id = Session::get('session_id');\n $userCart = DB::table('cart')->where('session_id', $session_id)->get();\n }\n \n // Get images for cart items\n foreach($userCart as $key => $product){\n $product = Product::where('id', $product->product_id)->first();\n $userCart[$key]->image = $product->image;\n }\n $meta_title = \"Shopping Cart - E-com Website\";\n $meta_description = \"View Shopping Cart of E-com Website\";\n $meta_keywords = \"Shopping Cart - E-com Website\";\n return view('products.cart', compact('userCart', 'meta_title','meta_description', 'meta_keywords'));\n }", "public function getCartIdentifire()\n {\n return $this->hasOne(Cart::className(), ['cart_identifire' => 'cart_identifire']);\n }", "public function addItem(Cart $cart, CartItem $item);", "public function items()\n {\n return $this->hasMany(OrderItems::class);\n }", "public function addToCart() {\n\t\t$baseQuantity = 1;\n\t\t$result = $this->db->select();\n\t\twhile(($row = mysql_fetch_assoc($result)) != FALSE){\n\t\t\t$_SESSION['cart'][] = array($row['id'], $row['name'], $row['description'], $row['cost'], $baseQuantity);\n\t\t}\n\t}", "public function addToCart(Request $request){\n if($request->session()->has('user'))\n {\n //add item info inside cart table\n $cart = new Cart;\n $cart->user_id = auth()->user()->id;\n $cart->product_id = $request->product_id;\n $cart->save();\n return redirect('/products');\n }else{\n return redirect('/login');\n }\n }", "public function items()\n {\n return $this->hasMany('App\\Models\\PurchaseItem', 'purchase_id', 'id');\n }", "public function items()\n {\n return $this->hasMany(\"App\\Model\\Item\");\n }", "public function items() {\n return $this->hasMany(OrderItem::class);\n }", "public function getPrice(){\n return $this->hasMany(Inventory::class, 'product_id','id');\n}", "public function getCart()\n {\n return $this->cart;\n }", "public function getCart()\n {\n return $this->cart;\n }", "public function getCart()\n {\n return $this->cart;\n }", "public function rapidAdd($id){\n $product=Products::find($id);\n $cart= Cart::add([\n'id'=>$product->id,\n'name'=>$product->pro_name,\n'qty'=>1,\n'price'=>$product->pro_price,\n ]);\n Cart::associate($cart->rowId, 'App\\Models\\Products');\nreturn redirect('/cart')->with('info', 'Product added in cart');\n }", "public function items()\n {\n return $this->hasMany(QuoteItemProxy::modelClass());\n }", "function add_to_cart(item $item) {\n \\Cart::session(auth()->id())->add(array(\n 'id' => $item->id,\n 'name' => $item->name,\n 'price' => $item->price,\n 'quantity' => 1,\n 'attributes' => array(),\n 'associatedModel' => $item\n ));\n return redirect('/cart');\n }", "public function clearCart(): Cart;", "function getCart($cart) //when i get a cart, i can manipulate\n {\n $this->cart=$cart;\n }", "public function add_item(Request $request)\n {\n $user = $request->user();\n $cart = $user->cart()->first();\n\n $validatedData = $request->validate([\n 'id' => 'required|integer',\n 'qty' => 'required|integer',\n ]);\n\n $product = Product::find($validatedData['id']);\n\n if (!$cart) {\n $cart = Cart::create([\n 'user_id' => $user->id,\n ]);\n $cart->items()->create([\n 'product_id' => $product->id,\n 'qty' => $validatedData['qty'],\n 'item_sub_total' => $product->price * $validatedData['qty'],\n ]);\n $cart->cart_sub_total = Cart::total($cart->items()->get()->toArray());\n $cart->save();\n $response = [\n 'items' => CartItemCollection::collection(CartItem::where('cart_id', $cart->id)->get()),\n 'total' => $cart->cart_sub_total,\n ];\n return response()->json($response);\n }\n\n $items = $cart->items()->get();\n\n if (in_array($validatedData['id'], array_column($items->toArray(), 'product_id'))) {\n $key = array_search($validatedData['id'], array_column($items->toArray(), 'product_id'));\n $obj = $cart->items()->find($items[$key]['id']);\n $obj->qty += $validatedData['qty'];\n $obj->item_sub_total = $product->price * $obj->qty;\n $obj->save();\n } else {\n $cart->items()->create([\n 'product_id' => $product->id,\n 'qty' => $validatedData['qty'],\n 'item_sub_total' => $product->price * $validatedData['qty'],\n ]);\n }\n\n $cart->cart_sub_total = Cart::total(CartItem::where('cart_id', $cart->id)->get()->toArray());\n\n $cart->save();\n\n $response = [\n 'items' => CartItemCollection::collection(CartItem::where('cart_id', $cart->id)->get()),\n 'total' => $cart->cart_sub_total,\n ];\n\n return response()->json($response);\n }", "public function items()\n {\n return $this->hasMany(PayoutItem::class);\n }", "public function addItemToCart($id)\n {\n $session=Yii::app()->session;\n $arr_session=array();\n $model=Item::model()->findbyPk($id);\n $my_product=$model->attributes;\n if(isset($session['cart']))\n {\n $arr_session=$session['cart'];\n if(array_key_exists($id,$session['cart']))\n {\n $arr_session=$session['cart'];\n $arr_session[$id]['quantity']++;\n $session['cart']=$arr_session;\n \n }else{\n $arr_session=$session['cart'];\n $arr_session[$id]=$my_product;\n $arr_session[$id]['quantity']=1;\n $arr_session[$id]['discount']=0;\n //$arr_session['0']['payment_amount']=0;\n $session['cart']=$arr_session;\n }\n }else{\n $session['cart']=array($id=>$my_product,);\n $arr_session=$session['cart'];\n $arr_session[$id]['quantity']=1;\n $arr_session[$id]['discount']=0;\n //$arr_session['0']['payment_amount']=0;\n $session['cart']=$arr_session;\n }\n }", "public function cart(): void\n {\n $userData = $this->getSession()->getCurrentUserData();\n\n if ($userData->getCart() && $userData->getCart()->hasProducts())\n {\n echo $this->render('cart/shoppingCart', $userData->getRenderCartParams());\n }\n }", "public function items()\n {\n return $this->hasMany(OrderItem::class);\n }", "public function items()\n {\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = sp_id, localKey = sp_id)\n return $this->hasMany('App\\Item','sp_id','sp_id');\n }", "public function index() //localhost:8000/cart\n {\n //Session::forget(\"cart\");\n // dd(Session::get(\"cart\"));\n // use the session cart to get the details for the items.\n $details_of_items_in_cart =[];\n $total = 0;\n if(Session::exists(\"cart\") || Session::get(\"cart\") != null){\n foreach (Session::get(\"cart\") as $item_id => $quantity) {\n \n // Because session cart has keys(item_id) and values (quantity)\n //Find the item\n $product = Product::find($item_id);\n //Get the details needed (add properties not in the original item)\n $product->quantity = $quantity;\n $product->subtotal = $product->cost * $quantity;\n // Note : these properties (quantity and subtoptal Are Not part of the Product Stored in the database, they are only for $product)\n //Push to array containing the details\n //google how to push data in an array\n //Syntax: array_push(target array, data to be pushed)\n array_push($details_of_items_in_cart, $product);\n $total += $product->subtotal;\n //total = total + subtotal\n }\n //send the array to the view\n //dd($details_of_items_in_cart);\n }\n return view(\"products.cart\", compact(\"details_of_items_in_cart\",\n \"total\"));\n }", "public function items()\n {\n return $this->hasMany('TechTrader\\Models\\OrderItem');\n }", "public function items()\n\t{\n\t\treturn $this->hasMany('Item');\n\t}", "public function addToCart()\n\t{\n\t\t$id \t= $this->request['item_id'];\n\t\t$number = intval($this->request['quantity']);\n\t\t\n\t\t#permission and enabled?\n\t\t$this->registry->ecoclass->canAccess('cart', false);\n\t\t\n\t\t#init\n\t\t$checks \t\t= array();\n\n\t\t#break up the item classification that we're adding to our cart\t\t\t \n\t\t$item_input_name = explode('_' , $id);\n\n\t\t$type \t\t\t= $item_input_name[0];\n\t\t$id \t\t\t= $item_input_name[1];\n\t\t$banktype \t\t= strtolower($item_input_name[2]);\n\n\t\t#loan hotfix\n\t\t$type\t\t\t= ( $banktype != 'loan' ) ? $type : $banktype;\n\t\t\n\t\t#grab this cart types class object\n\t\t$cartItemType = $this->registry->ecoclass->grabCartTypeClass($type);\n\n\t\t#format number a bit..\t\n\t\t$number = $this->registry->ecoclass->makeNumeric($number, true);\n\n\t\t#grab item from cache\n\t\t$theItem\t= $cartItemType->grabItemByID($id);\n\t\t\t\t\n\t\t#check for any illegal activity :shifty:\n\t\t$checks = $this->checkCartAdditions( $id, $type, $banktype, $number, $theItem, false, $cartItemType );\n\t\t\n\t\t#if after all that we have an error...\n\t\tif ( $checks['error'] )\n\t\t{\n\t\t\t$this->registry->output->showError( $checks['error'] );\n\t\t}\n\n\t\t#no error? Lets throw the item and number in our cart!\n\t\tif ( $checks['cartItem'] )\n\t\t{\n\t\t\t$add2Item = array('c_quantity' => $checks['cartItem']['c_quantity'] + $checks['number'] );\n\t\t\t\t\t\t\t\n\t\t\t$this->DB->update( 'eco_cart', $add2Item, 'c_member_id = ' .$this->memberData['member_id'].' AND c_id = '.$checks['cartItem'] ['c_id'] );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$newItem = array( 'c_member_id' \t=> $this->memberData['member_id'],\n\t\t\t\t\t\t\t 'c_member_name'\t=> $this->memberData['members_display_name'],\n\t\t\t\t\t\t\t 'c_type' \t\t\t=> ( $type == 'loan' ) ? 'bank' : $type,\n\t\t\t\t\t\t\t 'c_type_id' \t\t=> $id,\n\t\t\t\t\t\t\t 'c_type_class' \t=> ( $type == 'bank' || $type == 'loan' ) ? $banktype : '',\n\t\t\t\t\t\t\t 'c_quantity'\t\t=> $checks['number'],\n\t\t\t\t\t\t\t);\n\t\t\t$this->DB->insert( 'eco_cart', $newItem );\n\t\t}\n\t\t\n\t\t#redirect message and show what we added\n\t\t$redirect_message = $cartItemType->add2CartRedirectMessage($checks, $theItem);\n\t\t\n\t\t$this->registry->output->redirectScreen( $redirect_message, $this->settings['base_url'] . \"app=ibEconomy&amp;tab=buy&amp;area=cart\" );\n\t}", "private function getCart()\n {\n $session = $this->app->make('session');\n $events = $this->app->make('events');\n\n $cart = new Cart($session, $events);\n\n return $cart;\n }", "public function actionCartPayment()\n\t{ \n\t # - Get Visitor Cart Items for Listing\n\t\t$model = new Store;\t\n \t $cartItem = $model->getAllCartItem();\n \t\t\n\t\t# Create invoice for the subscriptions\n\t\t$invoiceModel = new Invoices;\n\t\t$invoice_id = $invoiceModel->createInvoiceByCart( $cartItem );\n\t\t \n \t\t# Create Subscription for each Item and create relation with the invoice\n\t\t$subModel\t = new Subscriptions;\n\t\t$subs = $subModel->createSubscriptionByCart( $invoice_id, $cartItem );\n\t\t\n\t\t$_SESSION['invoice_id'] = $invoice_id;\n \t\t$this->render(\"cartPayment\", array(\"cartItems\"=>$cartItem));\n\t}", "public function hasItem(CartItemInterface $item);", "public function ingredients()\n {\n return $this->hasMany('App\\Models\\Product');\n }", "public function cartAction()\r\n\t{\r\n\t\t$this->_view->_title = 'Giỏ hàng';\r\n\t\t$this->_view->motoInCart = $this->_model->listItem($this->_arrParam, ['task' => 'motos_in_cart']);\r\n\t\t$this->_view->render($this->_arrParam['controller'] . '/cart');\r\n\t}", "public function order_items()\n {\n return $this->hasMany('App\\Order_Item');\n }", "public function products() {\n \treturn $this->belongsToMany(Product::class, 'items_product', 'item_id', 'product_id');\n }", "public function addItemToCart(Request $request)\n {\n $validator = Validator::make($request->all(), [\n 'cart_id' => 'required|string',\n 'product_id' => 'required|integer',\n 'product_attributes' => 'required|string',\n 'quantity' => 'required|integer'\n ]);\n\n if( $validator->fails() )\n {\n return response()->json([\n \"error\" => [\n 'status' => 400,\n 'code' => 'CART_01',\n 'messages'=> $validator->errors(),\n ]\n ], 400); \n }\n\n // Check if Product already Exists in the Cart\n $item = ShoppingCart::where('cart_id', $request->cart_id)\n ->where('product_id', $request->product_id)->first();\n\n if( $item )\n {\n $item->attributes = $request->product_attributes;\n $item->quantity = $request->quantity;\n\n if( $item->save() )\n {\n return response()->json([\n 'cart_id' => $request->cart_id,\n 'product_id'=> $request->product_id,\n 'attributes'=> $request->product_attributes,\n 'quantity' => $request->quantity,\n 'item_id' => $item->item_id,\n ], 201);\n }\n }\n else\n {\n $cart = new ShoppingCart;\n $cart->cart_id = $request->cart_id;\n $cart->product_id = $request->product_id;\n $cart->attributes = $request->product_attributes;\n $cart->quantity = $request->quantity;\n $cart->customer_id= auth()->user()->getKey();\n $cart->added_on = Carbon::now()->toDateTimeString();\n\n if( $cart->save() )\n {\n return response()->json([\n 'cart_id' => $request->cart_id,\n 'product_id'=> $request->product_id,\n 'attributes'=> $request->product_attributes,\n 'quantity' => $request->quantity,\n 'item_id' => $cart->item_id,\n ], 201);\n }\n }\n\n\n return response()->json([\n \"error\" => [\n 'status' => 400,\n 'code' => 'CART_02',\n 'message'=> 'Unable to add item to Cart',\n ]\n ], 400);\n }", "public function addItem(string $sku, int $qty): Cart;", "public function getCart(){\n $session_id = Session::get('session_id');\n $userCart = Cart::where('session_id', $session_id)->get();\n $totalPrice = 0;\n if($userCart->count() > 0){\n foreach($userCart as $key => $cart){\n // Kiểm tra nếu sản phẩm có status == 0 thì xóa khỏi giỏ hàng\n if($cart->products->status == 0){\n $cart->delete();\n unset($userCart[$key]);\n }\n // Kiểm tra nếu kho = 0\n if($cart->attributes->stock == 0){\n $cart->quantity = 0;\n $cart->save();\n }\n // Kiểm tra nếu kho < quantity\n if($cart->attributes->stock < $cart->quantity){\n $cart->quantity = $cart->attributes->stock;\n $cart->save();\n }\n $totalPrice += $cart->attributes->price*$cart->quantity;\n }\n $totalItems = $userCart->sum('quantity');\n \n }else{\n $totalItems = 0;\n }\n \n return view('frontend.cart_page')->withUserCart($userCart)->withTotalItems($totalItems)->withTotalPrice($totalPrice);\n }", "public function addToCart()\n {\n\n $id = $_POST['id'];\n $quantity = intval($_POST['quantity']);\n\n $model = new ProductModel();\n $dice = $model->getProductByID($id);\n $diceToAdd = [\n 'product' => $dice,\n 'quantity' => $quantity\n ];\n\n // if cart is empty, initialize empty cart\n if (empty($_SESSION['shoppingCart'])) {\n $_SESSION['shoppingCart'] = [];\n }\n\n // item already in cart ? no\n $found = false;\n\n // if product is already in the cart, adding to quantity\n for ($i = 0; $i < count($_SESSION['shoppingCart']); $i++) {\n if ($_SESSION['shoppingCart'][$i]['product']['id'] == $id) {\n $_SESSION['shoppingCart'][$i]['quantity'] += $quantity;\n $_SESSION['totalInCart'] += $quantity;\n\n $found = true;\n }\n }\n\n //if not, adding product and quantity\n if ($found == false) {\n array_push($_SESSION['shoppingCart'], $diceToAdd);\n $_SESSION['totalInCart'] += $diceToAdd['quantity'];\n }\n\n header('Location: ./shop');\n exit;\n }", "public function addCart($id) {\n $product = Product::where('id', $id)->first();\n $Cart = Product::addToCart($product->id);\n return response()->json($Cart);\n }", "public function addToCart(Request $request)\n {\n $id = $request->id;\n $type = $request->type;\n $message = '';\n\n switch($type)\n {\n case 'file':\n $product = File::find($id);\n break;\n case 'episode':\n $product = Episode::find($id);\n break;\n case 'plan':\n $product = Plan::find($id);\n break;\n }\n\n\n if(!$product)\n {\n abort(404);\n }\n\n if(Auth::check())\n {\n $userId = Auth::id(); //extracting user ID\n $userCartExistance = Cart::HasCart($userId); //check if this user has any cart or not, this syntax returns true or false\n\n if($userCartExistance) // if logged in user has any cart then return cart object of this user\n {\n\n $userCart = Cart::userCart($userId); // returning cart object\n $cartId = $userCart->id; //returning cart's ID\n\n $productExistance = Cartable::CheckIfExists($cartId, $id, $type); //check if this product already exists in the cartables table or not\n\n if($productExistance) //if this product exists in the cart\n {\n $message = 'محصول موردنظر در سبد خرید شما موجود است.';\n }\n else\n {\n switch($type)\n {\n case 'file':\n $userCart->files()->attach($id);\n break;\n case 'episode':\n $userCart->episodes()->attach($id);\n break;\n case 'plan':\n $userCart->plans()->attach($id);\n break;\n }\n\n $message = 'محصول موردنظر به سبد خرید اضافه شد.';\n\n }\n\n }\n else //if logged in user has no cart then create one for her!\n {\n $userCart = new Cart();\n $userCart->user_id = $userId;\n $userCart->save();\n\n switch($type)\n {\n case 'file':\n $userCart->files()->attach($id);\n break;\n case 'episode':\n $userCart->episodes()->attach($id);\n break;\n case 'plan':\n $userCart->plans()->attach($id);\n break;\n }\n\n $message = 'محصول موردنظر به سبد خرید اضافه شد.';\n\n }\n }\n else // if user is not logged in then store cart information in session\n {\n $oldCart = Session::has('cart') ? Session::get('cart') : null;\n $cart = new ShoppingCart($oldCart);\n $message = $cart->add($product, $type, $id);\n Session::put('cart', $cart);\n }\n // route('showProduct', $id)\n // return redirect()->back()->with('message', $message);\n\n return response()->json(['message' => $message]);\n }", "public function order_items_details()\n {\n return $this->hasManyThrough('App\\Models\\Product\\Product','App\\Models\\Sales\\SalesOrderItem', 'sales_order_id','id','id','product_id');\n }", "public function orderItems()\n {\n return $this->hasMany('App\\OrderItem');\n }", "public function items(){\n\n\t\t// hasMany(RelatedModel, foreignKeyOnRelatedModel = service_id, localKey = id)\n\t\treturn $this->hasMany(Item::class);\n\t}", "public function cart()\n {\n $items = $this->_session->offsetGet('products');\n if ($this->_isCartArray($items) === TRUE)\n {\n $items = array();\n foreach ($this->_session->offsetGet('products') as $key => $value)\n {\n $items[$key] = array(\n 'id' \t\t=> \t$value['id'],\n 'qty' \t\t=> \t$value['qty'],\n 'price' \t=> \t$value['price'],\n 'name' \t\t=> \t$value['name'],\n 'sub_total'\t=> \t$this->_formatNumber($value['price'] * $value['qty']),\n \t'options' \t=> \t$value['options'],\n 'date' \t\t=> \t$value['date'],\n 'vat' => $value['vat']\n );\n }\n return $items;\n }\n }", "public function testCheckCart()\n {\n \n\n $customerSession = $this->getModelMock('customer/session', array('getQuote', 'start', 'renewSession', 'init'));\n $this->replaceByMock('model', 'customer/session', $customerSession);\n \n $itemsCollection = array();\n $product = new Varien_Object();\n $product->setId(1);\n $item = new Varien_Object();\n $item->setProduct($product);\n $item->setId(1);\n $itemsCollection[] = $item;\n $item = new Varien_Object();\n $product->setId(2);\n $item->setProduct($product);\n $item->setId(2);\n $itemsCollection[] = $item;\n $item = new Varien_Object();\n $product->setId(3);\n $item->setProduct($product);\n $item->setId(3);\n $itemsCollection[] = $item;\n $quoteMock = $this->getModelMock('sales/quote', array('getAllItems'));\n $quoteMock->expects($this->any())\n ->method('getAllItems')\n ->will($this->returnValue($itemsCollection));\n $this->replaceByMock('model', 'sales/quote', $quoteMock);\n $quote = Mage::getModel('sales/quote')->load(2);\n $checkoutSession = $this->getModelMock('checkout/session', array('getQuote', 'start', 'renewSession', 'init'));\n $checkoutSession->expects($this->any())\n ->method('getQuote')\n ->will($this->returnValue($quote));\n $this->replaceByMock('model', 'checkout/session', $checkoutSession);\n \n $this->assertEquals(21, Mage::helper('postident/data')->checkCart());\n }", "public function getActiveCart();", "public function getItems()\n {\n return $this->hasMany(Items::className(), ['ingredient_id' => 'id']);\n }", "public function getCartAttribute()\n {\n return $this->carts()->latest()->first();\n }", "public function addToCart(): void\n {\n //añadimos un Item con la cantidad indicada al Carrito\n Cart::add($this->oferta->id, $this->product->name, $this->oferta->getRawOriginal('offer_prize'), $this->quantity);\n //emite al nav-cart el dato para que lo actualize\n $this->emitTo('nav-cart', 'refresh');\n }", "public function items()\n {\n return $this->hasMany(Item::class);\n }", "public function items()\n {\n return $this->hasMany(Item::class);\n }", "public function items()\n {\n return $this->hasMany(Item::class);\n }", "public function items()\n {\n return $this->hasMany(Item::class);\n }", "public function items()\n {\n return $this->hasMany(Item::class);\n }", "public function postAddItem(Request $request){\n // Forget Coupon Code & Amount in Session\n Session::forget('CouponAmount');\n Session::forget('CouponCode');\n\n $session_id = Session::get('session_id');\n if(empty($session_id)){\n $session_id = str_random(40);\n Session::put('session_id', $session_id);\n }\n\n // Kiểm tra item đã có trong giỏ hàng chưa\n $checkItem = Cart::where(['product_id'=>$request['product_id'], 'attribute_id'=>$request['attribute_id'], 'session_id'=>$session_id])->first();\n\n // Nếu item đã có trong giỏ hàng thì cộng số lượng\n // Nếu item chưa có trong giỏ hàng thì thêm vào cart\n if(!empty($checkItem)){\n $checkItem->quantity = $checkItem->quantity + $request['quantity'];\n $checkItem->save();\n }else{\n $cart = new Cart;\n $cart->product_id = $request['product_id'];\n $cart->attribute_id = $request['attribute_id'];\n $cart->quantity = $request['quantity'];\n $cart->session_id = $session_id;\n if($request['user_email']){\n $cart->user_email = '';\n }else{\n $cart->user_email = $request['user_email'];\n }\n $cart->save();\n }\n\n return redirect()->route('get.cart')->with('flash_message_success', 'Sản phẩm đã được thêm vào giỏ hàng!');\n }", "public function items()\n\t{\n\t\treturn $this->hasMany(Item::class);\n\t}" ]
[ "0.8017298", "0.79342914", "0.76961607", "0.76542604", "0.75875205", "0.75875205", "0.75875205", "0.75695926", "0.753876", "0.7495373", "0.7487104", "0.74207026", "0.73673517", "0.7315237", "0.7308528", "0.730656", "0.72836226", "0.72270525", "0.7177483", "0.7087602", "0.70848566", "0.7060097", "0.6789553", "0.6712723", "0.66845864", "0.66188747", "0.6503362", "0.64864624", "0.6257092", "0.62193966", "0.62065965", "0.61756897", "0.61471915", "0.6128647", "0.612205", "0.6106217", "0.6091512", "0.6084167", "0.6084167", "0.60840255", "0.60695916", "0.6067427", "0.6052951", "0.6044645", "0.6043056", "0.60136306", "0.60105056", "0.5995484", "0.599081", "0.5987234", "0.59864616", "0.596557", "0.5960186", "0.59529024", "0.59529024", "0.59529024", "0.5951948", "0.5951215", "0.59496367", "0.5945182", "0.5943754", "0.5933608", "0.59285295", "0.59272766", "0.592465", "0.59221274", "0.59179", "0.59154963", "0.59052", "0.5905001", "0.58946157", "0.58942914", "0.58844906", "0.587589", "0.58723855", "0.5858695", "0.58529633", "0.58467764", "0.58368963", "0.58340275", "0.5833014", "0.5825446", "0.5820086", "0.58177793", "0.5812835", "0.5812204", "0.58080596", "0.5806681", "0.5798479", "0.5794597", "0.5785616", "0.5776121", "0.576904", "0.5764748", "0.5764748", "0.5764748", "0.5764748", "0.5764748", "0.5759745", "0.5756799" ]
0.8001362
1
Shopping Cart has 1 Delivery Service Provider
public function deliveryService() { return $this->belongsTo(DeliveryService::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCartable();", "public function hasActiveCart();", "public function getActiveCart();", "public function getCart();", "public function getCartShippingMethod()\n {\n }", "private function addToCart () {\n }", "private function addToCart () {\n }", "public function getActiveCartProducts();", "public function isMultiAddressDelivery(){\n static $cache = null;\n\n if (is_null($cache)) {\n $db = JFactory::getDBO();\n\n $query = \"SELECT count(distinct address_delivery_id) FROM \" . $db->quoteName('#__jeproshop_cart_product');\n $query .= \" AS cart_product WHERE cart_product.cart_id = \" . (int)$this->cart_id;\n\n $db->setQuery($query);\n $cache = (bool)($db->loadResult() > 1);\n }\n return $cache;\n }", "public function isMultishippingCheckoutAvailable(){\n $multishippingFlag = parent::isMultishippingCheckoutAvailable();\n if(Mage::getSingleton('mysubscription/cart')->getMsquote()->hasItems()){\n return false;\n }\n return $multishippingFlag;\n }", "public function getShippingInvoiced();", "public function isEnabledCart()\n {\n return $this->isEnabled() && Mage::getStoreConfig(self::GENE_BRAINTREE_APPLEPAY_EXPRESS_CART);\n }", "public function getCartShippingMethodID()\n {\n }", "private function check_cart() {\n $users_id = $this->session->userdata('id');\n if ($users_id) {\n // User connected > DB\n $this->data['deals'] = $this->users_cart->getForUser($users_id);\n } else {\n // Guest > Session\n $deals = $this->session->userdata('cart');\n if ($deals) {\n $this->data['deals'] = $this->deals->getDeals(false, false, false, false, false, false, $deals);\n } else {\n $this->data['deals'] = array();\n }\n }\n }", "public function provides()\n {\n return ['shppcart_service'];\n }", "public function getCurrentCartIdentifier();", "public function addCartItem($rateplanId, $quantity){\r\n\t\terror_log('cart.php rateplanId is: ' . $rateplanId, 0);\r\n\t\terror_log('cart.php quantity is: ' . $quantity, 0);\r\n\t\t//$newCartItem = new Cart_Item($rateplanId, $quantity, $this->latestItemId);\r\n\r\n\r\n\r\n\t\t$newCartItem = new Cart_Item();\r\n\t\t$newCartItem->ratePlanId = $rateplanId;\r\n\t\terror_log('cart.php ratePlanId2 is: ' . $newCartItem->ratePlanId, 0);\r\n\t\t$newCartItem->itemId = $this->latestItemId++;\r\n\t\terror_log('cart.php itemId is: ' . $newCartItem->itemId, 0);\r\n\t\t$newCartItem->quantity = $quantity;\r\n\r\n\t\t//$plan = Catalog::getRatePlan($newCartItem->ratePlanId);\r\n\t\t$rpId = $newCartItem->ratePlanId;\r\n\r\n\t\r\n\r\n\r\n\t\t$catalog_groups = self::readCache();\t//should be in associative array already.\r\n\r\n\t\t$catalog_products = $catalog_groups->products;\t//returns enture product array.\r\n\t\t//error_log(print_r($catalog_products, true));\r\n\t\t//error_log(print_r($catalog_products[2], true));\t//returns a product array with productrateplan and productrateplancharges arrays embedded inside.\r\n\t\t$catalog_rateplans = $catalog_products[0]->productRatePlans;\r\n\t\t//error_log(print_r($catalog_rateplans, true));\r\n\r\n\r\n\r\n\t\t//Commented out for DEMO\r\n\t\t// foreach($catalog_groups as $group){\r\n\t\t// \t\r\n\t\t// \tforeach($group->products as $product){\r\n\t\t// \t\t\r\n\t\t// \t\tforeach($product->productRatePlans as $ratePlan){\r\n\t\t// \t\t\tif($ratePlan->id == $rpId){\r\n\t\t// \t\t\t\t$plan = $ratePlan;\r\n\t\t// \t\t\t}\r\n\t\t// \t\t}\r\n\t\t// \t}\r\n\t\t// }\r\n\t\t// $plan = NULL;\r\n\r\n\t/**\r\n\t * Given a RatePlan ID, retrieves all rateplan information by searching through the cached catalog file\r\n\t * @return RatePlan model\r\n\t */\r\n\t// public static function getRatePlan($rpId){\r\n\t// \t$catalog_groups = self::readCache();\r\n\t// \tforeach($catalog_groups as $group){\r\n\t// \t\tforeach($group->products as $product){\r\n\t// \t\t\tforeach($product->ratePlans as $ratePlan){\r\n\t// \t\t\t\tif($ratePlan->Id == $rpId){\r\n\t// \t\t\t\t\treturn $ratePlan;\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 NULL;\r\n\t// }\r\n\r\n\r\n/*\t\t//Not needed? no Uom. \r\n\t\tif(isset($plan->Uom)){\r\n\t\t\t$newCartItem->uom = $plan->Uom;\r\n\t\t} else {\r\n\t\t\t$newCartItem->uom = null;\t\t\t\r\n\t\t}\r\n*/\t\r\n\t\t// $newCartItem->ratePlanName = $plan!=null ? $plan->Name : 'Invalid Product';\r\n\t\t// $newCartItem->ProductName = $plan!=null ? $plan->productName : 'Invalid Product';\r\n\r\n\t\t//Commented out for DEMO\r\n\t\t// $newCartItem->ratePlanName = $plan!=null ? $plan->name : 'Invalid Product';\r\n\t\t// $newCartItem->productName = $plan!=null ? $plan->productName : 'Invalid Product';\r\n\t\tarray_push($this->cart_items, $newCartItem);\r\n\t}", "public function getDeliveryOrder();", "public function HasCart() {\n\tif ($this->IsNew()) {\n\t return FALSE;\n\t} else {\n\t return (!is_null($this->GetCartID()));\n\t}\n }", "public function getShipping();", "public function get_sess_cart_items()\n {\n $cart = array();\n $new_cart = array();\n $this->cart_product_ids = array();\n if (!empty($this->session->userdata('mds_shopping_cart'))) {\n $cart = $this->session->userdata('mds_shopping_cart');\n }\n foreach ($cart as $cart_item) {\n $product = $this->product_model->get_available_product($cart_item->product_id);\n if (!empty($product)) {\n //if purchase type is bidding\n if ($cart_item->purchase_type == 'bidding') {\n $this->load->model('bidding_model');\n $quote_request = $this->bidding_model->get_quote_request($cart_item->quote_request_id);\n if (!empty($quote_request) && $quote_request->status == 'pending_payment') {\n $item = new stdClass();\n $item->cart_item_id = $cart_item->cart_item_id;\n $item->product_id = $product->id;\n $item->product_type = $cart_item->product_type;\n $item->product_title = $cart_item->product_title;\n $item->options_array = $cart_item->options_array;\n $item->quantity = $cart_item->quantity;\n $item->unit_price = $quote_request->price_offered / $quote_request->product_quantity;\n $item->total_price = $quote_request->price_offered;\n $item->discount_rate = 0;\n $item->currency = $product->currency;\n $item->product_vat = 0;\n $item->shipping_cost = $quote_request->shipping_cost;\n $item->purchase_type = $cart_item->purchase_type;\n $item->quote_request_id = $cart_item->quote_request_id;\n $item->is_stock_available = 1;\n if ($this->form_settings->shipping != 1) {\n $item->shipping_cost = 0;\n }\n array_push($new_cart, $item);\n }\n } else {\n $object = $this->get_product_price_and_stock($product, $cart_item->product_title, $cart_item->options_array);\n $price = calculate_product_price($product->price, $product->discount_rate);\n $item = new stdClass();\n $item->cart_item_id = $cart_item->cart_item_id;\n $item->product_id = $product->id;\n $item->product_type = $cart_item->product_type;\n $item->product_title = $cart_item->product_title;\n $item->options_array = $cart_item->options_array;\n $item->quantity = $cart_item->quantity;\n $item->unit_price = $object->price_calculated;\n $item->total_price = $object->price_calculated * $cart_item->quantity;\n $item->discount_rate = $object->discount_rate;\n $item->currency = $product->currency;\n $item->product_vat = $this->calculate_total_vat($object->price_calculated, $product->vat_rate, $cart_item->quantity);\n $item->shipping_cost = $this->get_product_shipping_cost($product, $cart_item->quantity);\n $item->purchase_type = $cart_item->purchase_type;\n $item->quote_request_id = $cart_item->quote_request_id;\n $item->is_stock_available = $object->is_stock_available;\n if ($this->form_settings->shipping != 1) {\n $item->shipping_cost = 0;\n }\n array_push($new_cart, $item);\n }\n }\n }\n $this->session->set_userdata('mds_shopping_cart', $new_cart);\n return $new_cart;\n }", "public function process(){\n\t$payment_mode = $this->input->post('paymentmethod');\n /**********************************************************************************/\n $delivery_req = $this->input->post('delivery_req');\n\t$final_amount_post = $this->cart->total(); \n\t$shipping_charges_post = $this->input->post('shipping_charges');\n if($shipping_charges_post>0){\n $shipping_charges=abs($shipping_charges_post);\n $final_amount_post=abs($final_amount_post);\n $final_amount=$final_amount_post+$shipping_charges;\n }else{\n $shipping_charges=0;\n $final_amount=abs($final_amount_post);\n }\n\t$cod_charges = 0;//$this->input->post('cod_charges');\n $shipping_address_id = $this->input->post('shipping_address_id');\n\t$user_id = $this->session->userdata('customer_id');\n\t$user_info = $this->Customer_model->getCustomerDetails($user_id);\n\t$cart_id = $this->input->post('cart_id'); \n\t\t$agree_terms = $this->input->post('agree_terms');\n if(isset($agree_terms)&&$agree_terms=='yes'){\n $agree_terms_value='yes';\n }else{\n $agree_terms_value='no'; \n }\n $mobile_number=$user_info->mobile;\n\t$cart_items = $this->Cart_model->getCartItems($cart_id);\n \n if(($user_id=='')||($user_id<1)){\n $this->session->set_flashdata('message', 'You has been logout.Please login again!');\n redirect(base_url('login'));\n }\n \n if((count($cart_items)=='')||(count($cart_items)<1)){\n $this->session->set_flashdata('message', 'Your cart is empty.Please Add product in the cart.');\n redirect(base_url('cart'));\n }\n \n //echo count($cart_items).'------';die;\n \n // check if added item is exist in cmspricelist table \n $cartinfo = $this->Cart_model->getCustomerCart($user_id);\n $cart_items = $this->Cart_model->getCartItems($cartinfo->id); \n foreach ($cart_items as $items){\n $itemid = $items->product_id; \n $pricelist_count = $this->Cart_model->getpriclistItems($itemid);\n if(($pricelist_count=='')||($pricelist_count<1)){\n $this->session->set_flashdata('message', 'There is some problem in product you have added to cart.Please delete some product and try again.');\n //redirect(base_url('cart')); \n }\n }\n // Check if payment option is online \n /*1 For cash on delevery, 2 For CCAvenue, 3 For Paytm, 4 for payyoumoney*/ \n if($payment_mode==3){\n //paytm\n $this->session->set_flashdata('message', 'Paytm is not activated now.Please select Online Payment option now.');\n redirect('/cart'); die;\n $this->load->helper('paytm_helper'); \n $paytm=$this->config->item('paytm');\n $checkSum = \"\";\n $paramList = array();\n // Create an array having all required parameters for creating checksum.\n $paramList[\"MID\"] = $paytm['PAYTM_MERCHANT_MID'];\n $paramList[\"ORDER_ID\"] = $order_no;\n $paramList[\"CUST_ID\"] = $user_id;\n $paramList[\"INDUSTRY_TYPE_ID\"] = 'Retail';//$INDUSTRY_TYPE_ID;\n $paramList[\"CHANNEL_ID\"] = 'WEB';//$CHANNEL_ID;\n $paramList[\"TXN_AMOUNT\"] = $final_amount;\n $paramList[\"WEBSITE\"] = $paytm['PAYTM_MERCHANT_WEBSITE'];\n $checkSum = getChecksumFromArray($paramList,$paytm['PAYTM_MERCHANT_KEY']);\n $paramList[\"CHECKSUMHASH\"]=$checkSum;\n $data[\"PAYTM_TXN_URL\"]=$paytm['PAYTM_TXN_URL'];\n $data[\"parameters\"]=$paramList;\n $this->load->view('cart/processpaytm',$data);\n }elseif($payment_mode==4){\n\t\t\t/*PayuMoney start*/\n\t\t\t$postdata = $_POST;\n$msg = '';\nif (isset($postdata ['key'])) {\n\t$key\t\t\t\t= $postdata['key'];\n\t$salt\t\t\t\t= $postdata['salt'];\n\t$txnid \t\t\t\t= \t$postdata['txnid'];\n\t$order_no \t\t\t= \t$postdata['order_no'];\n\t$amount \t\t= \t$postdata['amount'];\n\t$productInfo \t\t= \t$postdata['productinfo'];\n\t$firstname \t\t= \t$postdata['firstname'];\n\t$email \t\t=\t$postdata['email'];\n\t$udf5\t\t\t\t= $postdata['udf5'];\n\t$mihpayid\t\t\t=\t$postdata['mihpayid'];\n\t$status\t\t\t\t= \t$postdata['status'];\n\t$resphash\t\t\t\t= \t$postdata['hash'];\n\t//Calculate response hash to verify\t\n\t$keyString \t \t\t= \t$key.'|'.$txnid.'|'.$amount.'|'.$productInfo.'|'.$firstname.'|'.$email.'|||||'.$udf5.'|||||';\n\t$keyArray \t \t\t= \texplode(\"|\",$keyString);\n\t$reverseKeyArray \t= \tarray_reverse($keyArray);\n\t$reverseKeyString\t=\timplode(\"|\",$reverseKeyArray);\n\t$CalcHashString \t= \tstrtolower(hash('sha512', $salt.'|'.$status.'|'.$reverseKeyString));\n\t\n\t\n\tif ($status == 'success' && $resphash == $CalcHashString) {\n\t\t$msg = \"Transaction Successful and Hash Verified...\";\n\t\t//Do success order processing here...\n\t\t\n\t\t//order status Coplete/success\n\t$orderstatus=1;\n\t\n\t$paymentstatus=1;\n\t}\n\telse {\n\t\t//tampered or failed\n\t\t$msg = \"Payment failed for Hash not verified...\";\n\t\t//order status cancelled\n\t$orderstatus=2;\n\t$paymentstatus=0;\n\t} \n\t$order_id=$txnid;\t\n\t$order_no=$order_no;\n\t$order_no=$order_no;\n\t$txn_number=$mihpayid;\n\t$order = $this->Customer_model->updateOrder($order_id,$order_no,$paymentstatus,$txn_number,$orderstatus);\n $this->Cart_model->removeCart($cart_id,$user_id);\n $this->cart->destroy();\n\t \n $this->session->set_flashdata('message', $msg);\n redirect('/cart'); \n}\n\t\t\t/*PayuMoney End*/\n\t\t}elseif($payment_mode==2){\n\t\t\t/*CCAvenue for web start*/\n $this->session->set_userdata('cart_id',$cart_id); \n $order=$this->Customer_model->addOrder($user_id,$payment_mode,$final_amount,$shipping_charges,$cod_charges,$shipping_address_id,$agree_terms_value);\n $order_id=$order['order_id'];\n $order_no=$order['order_no'];\n //CCAVENUE\n $shipping_address= $this->Customer_model->getAddressDetail($shipping_address_id); \n $this->config->load('ccavenue');\n $this->load->helper('ccavenue');\n $user=$this->Customer_model->getCustomerDetails($user_id);\n $this->data['action']=$this->config->item('action');\n $workingkey=$this->config->item('workingkey');\n $checksum = getCheckSum($this->config->item('Merchant_Id'),$final_amount,$order_no ,$this->config->item('Redirect_Url'),$workingkey);\n $form_array=array('Merchant_Id'=>$this->config->item('Merchant_Id'),\n 'Redirect_Url'=>$this->config->item('Redirect_Url'),\n 'Amount'=>$final_amount,\n 'Order_Id'=>$order_no,\n 'Checksum'=>$checksum,\n 'billing_cust_name'=>$shipping_address->address_name,\n 'billing_cust_address'=>$shipping_address->address.' '.$shipping_address->address2,\n 'billing_cust_country'=>'INDIA',\n 'billing_cust_state'=>$shipping_address->state_name,\n 'billing_cust_tel'=>$user->mobile,\n 'billing_cust_email'=>$user->email,\n 'delivery_cust_name'=>$shipping_address->address_name,\n 'delivery_cust_address'=>$shipping_address->address.' '.$shipping_address->address2,\n 'delivery_cust_country'=>'INDIA',\n 'delivery_cust_state'=>$shipping_address->state_name,\n 'delivery_cust_tel'=>$user->mobile,\n 'delivery_cust_notes'=>'',\n 'Merchant_Param'=>$user_id.'_'.$order_id,\n 'billing_cust_city'=>$shipping_address->city_name,\n 'billing_zip_code'=>$shipping_address->zipcode,\n 'delivery_cust_city'=>$shipping_address->city_name,\n 'delivery_zip_code'=>$shipping_address->zipcode);\n $this->data['parameters']=$form_array;\n $this->load->view('cart/processpayment',$this->data);\n }elseif($payment_mode==1){\n\t\t\t $loginFranId = $this->session->userdata('loginFranId');\n //COD\n\t\t\t\t\tif($loginFranId>0){\n\t\t\t\t\t\t//need to add message\n\t\t\t\t\t}else{\n if($this->session->userdata('customer_id')!='71696'){\n //COD Activate for one testing account only\n $this->session->set_flashdata('message', 'This method is not activated now.Please select Online Payment option now.');\n redirect('/cart'); die;\n }\n\t\t\t\t\t}\n \n \n $this->session->set_userdata('cart_id',$cart_id); \n $order=$this->Customer_model->addOrder($user_id,$payment_mode,$final_amount,$shipping_charges,$cod_charges,$shipping_address_id,$agree_terms_value);\n $order_id=$order['order_id'];\n $order_no=$order['order_no'];\n foreach ($this->cart->contents() as $item){\n //$this->Products_model->updateQuantity($item['id'],$item['qty']);\n } \n $this->Customer_model->ediCod_Orderstatus($order_id,1);\n // @TO-DO : add payment mode condition and execute following code for cod.\n $this->Cart_model->removeCart($cart_id,$user_id);\n $this->cart->destroy();\n \n \n $this->sms->send_sms($mobile_number, 'your order No# '. $order_no .' at STUDYADDA is Completed.Please Login to your account to access your products.You can View/Download your product from My Account Section.'); \n $message = 'Dear Sir/Madam,'.'<br>'.'Your Order Was Successfull, Below is your order number for further references.'.'<br>'.'Your Order Number is'.'&nbsp;'.$order_no.'<br>For Technical Support<br>06267349244';\n $subject = 'Order Confirmation-'.$mobile_number;\n $to = $user_info->email;\n $mobile_number = $user_info->mobile;\n // $sms_message = 'Hello Mr/Mrs/Ms'.$user_info->firstname.' ,this is a confirmation message from patanjaliayurved.net.Your order has been placed successfully.Order No : '.$order_no;\n // \n $product_list='';\n for($i=0;count($order['order_details_array'])>$i;$i++){\n if($order['offline']==0){\n $Offline='Offline'; \n }else{\n $Offline='Online'; \n }\n \n $product_list .='<tr>\n\t\t <td>'.$order['order_details_array'][$i]->modules_item_name.'</td>\n\t\t \n\t\t <td>'.$Offline.'</td>\n\t\t <td><i class=\"fa fa-inr\">'.$order['order_details_array'][$i]->price.'</i></td>\n </tr>';\n }\n\n \n $message .= '<div style=\"min-height: 0.01%;\n overflow-x: auto;\"><table style=\"margin-bottom: 20px;\n max-width: 100%;\n width: 100%;\" border=\"1\"> \n <thead>\n <tr>\n <th>Product Name</th>\n\t\t<th>Mode</th>\n <th>Amount</th> \n </tr>\n </thead>\n <tbody>\t\n\t\t'.$product_list.'<tr align=\"left\">\n\t\t <th>Total</th>\n\t\t \n\t\t <th>'.$order['order_qty'].'</th>\n\t\t <th><i class=\"fa fa-inr\"></i>'.$order['order_price'].'</th>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<th>&nbsp;</th>\n\t\t\t\n\t\t\t<th align=\"left\">Extra charges</th>\n\t\t\t<th align=\"left\"><i class=\"fa fa-inr\"></i> '.$order['shipping_charges'].'</th>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<th>&nbsp;</th>\n\t\t\t\n\t\t\t<th>&nbsp;</th>\n\t\t\t<th align=\"left\"><i class=\"fa fa-inr\"></i>'.$order['final_amount'].'</th>\n\t\t</tr>\n </tbody>\n </table></div>';\n $message .= '<br>Thanks,<br>Team Studyadda';\n //send email\n sendEmail($to,$subject,$message);\n //$this->sms->send_sms($mobile_number,$sms_message); \n \n $this->session->set_flashdata('update_msg','Your order has been placed successfully');\n redirect('/user/orders');\n }else{\n \n $this->session->set_flashdata('message', 'Please Select Atleast One Payment Method.');\n redirect('/cart'); \n }\n }", "public function isGoodsInShopcart()\n\t{\n\t\treturn !!$this->count();\n\t}", "public function isCheckoutAvailable()\n {\n return Mage::helper('checkout')->isMultishippingCheckoutAvailable();\n }", "public function ChooseShippingProvider()\n\t{\n\t\tif(isset($_SESSION['CHECKOUT']['CHECKOUT_TYPE']) && $_SESSION['CHECKOUT']['CHECKOUT_TYPE'] == 'express') {\n\t\t\t$redirectOnError = getConfig('ShopPath').'/checkout.php?action=express';\n\t\t}\n\t\telse {\n\t\t\t$redirectOnError = getConfig('ShopPath').'/checkout.php?action=checkout';\n\t\t}\n\n\t\t// If guest checkout is not enabled and the customer isn't signed in then send the customer\n\t\t// back to the beginning of the checkout process.\n\t\tif(!GetConfig('GuestCheckoutEnabled') && !CustomerIsSignedIn()) {\n\t\t\tredirect($redirectOnError);\n\t\t}\n\n\t\t// ensure products are in stock\n\t\t$this->CheckStockLevels();\n\n\t\t// Setup the default shipping error message\n\t\t$GLOBALS['ShippingError'] = GetLang(\"NoShippingProvidersError\");\n\n\t\t$addressDetails = 0;\n\n\t\tif($_SERVER['REQUEST_METHOD'] == 'POST') {\n\t\t\t// If the customer isn't signed in then they've just entered an address that we need to validate\n\t\t\tif(!CustomerIsSignedIn()) {\n\t\t\t\t$errors = array();\n\t\t\t\t// An invalid address was entered, show the form again\n\t\t\t\t$addressDetails = $this->ValidateGuestCheckoutAddress('shipping', $errors);\n\t\t\t\tif(!$addressDetails) {\n\t\t\t\t\t$this->ChooseShippingAddress($errors);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// We've just selected an address\n\t\tif(isset($_GET['address_id'])) {\n\t\t\t$addressDetails = (int)$_GET['address_id'];\n\t\t}\n\n\t\tif($addressDetails !== 0 && !$this->SetOrderShippingAddress($addressDetails)) {\n\t\t\tredirect($redirectOnError);\n\t\t}\n\n\t\t// Are we split shipping?\n\t\t$splitShipping = $this->getQuote()->getIsSplitShipping();\n\n\t\t// At this stage, the quote should have a complete shipping address. Make sure there's\n\t\t// nothing missing.\n\t\t$shippingAddresses = $this->getQuote()->getShippingAddresses();\n\t\tforeach($shippingAddresses as $shippingAddress) {\n\t\t\tif(!$shippingAddress->hasCompleteAddress()) {\n\t\t\t\tredirect($redirectOnError);\n\t\t\t}\n\t\t}\n\n\t\t// Now, for each shipping address, fetch available shipping quotes\n\t\t$GLOBALS['HideNoShippingProviders'] = 'none';\n\t\t$GLOBALS['ShippingQuotes'] = '';\n\n\t\t$hideItemList = true;\n\t\tif(count($shippingAddresses) > 1) {\n\t\t\t$hideItemList = false;\n\t\t}\n\t\telse {\n\t\t\t$splitShipping = false;\n\t\t}\n\t\t$hasTransit = false;\n\t\t$numLoopedAddresses = 0;\n\t\t$totalAddresses = count($shippingAddresses);\n\t\tforeach($shippingAddresses as $i => $shippingAddress) {\n\t\t\t++$numLoopedAddresses;\n\n\t\t\tif(!$splitShipping) {\n\t\t\t\t$GLOBALS['HideAddressLine'] = 'display: none';\n\t\t\t\t$GLOBALS['HideItemList'] = 'display: none';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$GLOBALS['HideAddressLine'] = '';\n\t\t\t\t$GLOBALS['HideItemList'] = '';\n\t\t\t}\n\n\t\t\t$GLOBALS['HideHorizontalRule'] = 'display: none';\n\t\t\tif($numLoopedAddresses != $totalAddresses) {\n\t\t\t\t$GLOBALS['HideHorizontalRule'] = '';\n\t\t\t}\n\n\t\t\t$GLOBALS['AddressId'] = $shippingAddress->getId();\n\n\t\t\t// If no methods are available, this order can't progress so show an error\n\t\t\t$shippingQuotes = $shippingAddress->getAvailableShippingMethods();\n\t\t\tif(empty($shippingQuotes)) {\n\t\t\t\t$GLOBALS['HideNoShippingProviders'] = '';\n\t\t\t\t$GLOBALS['HideShippingProviderList'] = 'none';\n\t\t\t\t$hideItemList = false;\n\t\t\t}\n\n\t\t\t$GLOBALS['ItemList'] = '';\n\t\t\tif(!$hideItemList) {\n\t\t\t\t$items = $shippingAddress->getItems();\n\t\t\t\tforeach($items as $item) {\n\t\t\t\t\t// Only show physical products\n\t\t\t\t\tif($item->isDigital() == true) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$GLOBALS['ProductQuantity'] = $item->getQuantity();\n\t\t\t\t\t$GLOBALS['ProductName'] = isc_html_escape($item->getName());\n\n\t\t\t\t\t$GLOBALS['HideGiftWrapping'] = 'display: none';\n\t\t\t\t\t$GLOBALS['HideGiftMessagePreview'] = 'display: none';\n\t\t\t\t\t$GLOBALS['GiftWrappingName'] = '';\n\t\t\t\t\t$GLOBALS['GiftMessagePreview'] = '';\n\t\t\t\t\t$giftWrapping = $item->getGiftWrapping();\n\t\t\t\t\tif($giftWrapping !== false) {\n\t\t\t\t\t\t$GLOBALS['HideGiftWrapping'] = '';\n\t\t\t\t\t\t$GLOBALS['GiftWrappingName'] = isc_html_escape($giftWrapping['wrapname']);\n\t\t\t\t\t\tif($giftWrapping['wrapmessage']) {\n\t\t\t\t\t\t\tif(isc_strlen($giftWrapping['wrapmessage']) > 30) {\n\t\t\t\t\t\t\t\t$giftWrapping = substr($giftWrapping['wrapmessage'], 0, 27).'...';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$GLOBALS['GiftMessagePreview'] = isc_html_escape($giftWrapping['wrapmessage']);\n\t\t\t\t\t\t\t$GLOBALS['HideGiftMessagePreview'] = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$GLOBALS['ItemList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('ShippingQuoteProduct');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If no methods are available, this order can't progress so show an error\n\t\t\tif(empty($shippingQuotes)) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif(!$GLOBALS['HideAddressLine']) {\n\t\t\t\t$addressLine = array(\n\t\t\t\t\t$shippingAddress->getFirstName().' '.$shippingAddress->getLastName(),\n\t\t\t\t\t$shippingAddress->getCompany(),\n\t\t\t\t\t$shippingAddress->getAddress1(),\n\t\t\t\t\t$shippingAddress->getAddress2(),\n\t\t\t\t\t$shippingAddress->getCity(),\n\t\t\t\t\t$shippingAddress->getStateName(),\n\t\t\t\t\t$shippingAddress->getZip(),\n\t\t\t\t\t$shippingAddress->getCountryName()\n\t\t\t\t);\n\n\t\t\t\t// Please see self::GenerateShippingSelect below.\n\t\t\t\t$addressLine = array_filter($addressLine, array($this, 'FilterAddressFields'));\n\t\t\t\t$GLOBALS['AddressLine'] = isc_html_escape(implode(', ', $addressLine));\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$GLOBALS['AddressLine'] = '';\n\t\t\t}\n\n\t\t\t// Now build a list of the actual available quotes\n\t\t\t$GLOBALS['ShippingProviders'] = '';\n\t\t\tforeach($shippingQuotes as $quoteId => $method) {\n\t\t\t\t$price = getClass('ISC_TAX')->getPrice(\n\t\t\t\t\t$method['price'],\n\t\t\t\t\tgetConfig('taxShippingTaxClass'),\n\t\t\t\t\tgetConfig('taxDefaultTaxDisplayCart'),\n\t\t\t\t\t$shippingAddress->getApplicableTaxZone()\n\t\t\t\t);\n\t\t\t\t$GLOBALS['ShippingProvider'] = isc_html_escape($method['description']);\n\t\t\t\t$GLOBALS['ShippingPrice'] = CurrencyConvertFormatPrice($price);\n\t\t\t\t$GLOBALS['ShipperId'] = $quoteId;\n\t\t\t\t$GLOBALS['ShippingData'] = $GLOBALS['ShipperId'];\n\n\t\t\t\tif(isset($method['transit'])) {\n\t\t\t\t\t\t$hasTransit = true;\n\n\t\t\t\t\t$days = $method['transit'];\n\n\t\t\t\t\tif ($days == 0) {\n\t\t\t\t\t\t$transit = GetLang(\"SameDay\");\n\t\t\t\t\t}\n\t\t\t\t\telse if ($days == 1) {\n\t\t\t\t\t\t$transit = GetLang('NextDay');\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$transit = sprintf(GetLang('Days'), $days);\n\t\t\t\t\t}\n\n\t\t\t\t\t$GLOBALS['TransitTime'] = $transit;\n\t\t\t\t\t$GLOBALS['TransitTime'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('CartShippingTransitTime');\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$GLOBALS['TransitTime'] = \"\";\n\t\t\t\t}\n\t\t\t\t$GLOBALS['ShippingProviders'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"ShippingProviderItem\");\n\t\t\t}\n\n\t\t\t// Add it to the list\n\t\t\t$GLOBALS['ShippingQuotes'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('ShippingQuote');\n\t\t}\n\n\t\tif ($hasTransit) {\n\t\t\t$GLOBALS['DeliveryDisclaimer'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('CartShippingDeliveryDisclaimer');\n\t\t}\n\n\t\t// Show the list of available shipping providers\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetConfig('StoreName') . \" - \" . GetLang('ChooseShippingProvider'));\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate(\"checkout_shipper\");\n\t\t$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();\n\t}", "public function getPriceDelivery()\n {\n return $this->priceDelivery;\n }", "public function successAfter($observer) {\r\n $sellerDefaultCountry = '';\r\n $nationalShippingPrice = $internationalShippingPrice = 0;\r\n $orderIds = $observer->getEvent()->getOrderIds();\r\n $order = Mage::getModel('sales/order')->load($orderIds [0]);\r\n $customer = Mage::getSingleton('customer/session')->getCustomer();\r\n $getCustomerId = $customer->getId();\r\n $grandTotal = $order->getGrandTotal();\r\n $status = $order->getStatus();\r\n $itemCount = 0;\r\n $shippingCountryId = '';\r\n $items = $order->getAllItems();\r\n $orderEmailData = array();\r\n foreach ($items as $item) {\r\n\r\n $getProductId = $item->getProductId();\r\n $createdAt = $item->getCreatedAt();\r\n $is_buyer_confirmation_date = '0000-00-00 00:00:00';\r\n $paymentMethodCode = $order->getPayment()->getMethodInstance()->getCode();\r\n $products = Mage::helper('marketplace/marketplace')->getProductInfo($getProductId);\r\n $products_new = Mage::getModel('catalog/product')->load($item->getProductId());\r\n if($products_new->getTypeId() == \"configurable\")\r\n {\r\n $options = $item->getProductOptions() ;\r\n\r\n $sku = $options['simple_sku'] ;\r\n $getProductId = Mage::getModel('catalog/product')->getIdBySku($sku);\r\n }\r\n else{\r\n $getProductId = $item->getProductId();\r\n }\r\n\r\n\r\n\r\n $sellerId = $products->getSellerId();\r\n $productType = $products->getTypeID();\r\n /**\r\n * Get the shipping active status of seller\r\n */\r\n $sellerShippingEnabled = Mage::getStoreConfig('carriers/apptha/active');\r\n if ($sellerShippingEnabled == 1 && $productType == 'simple') {\r\n /**\r\n * Get the product national shipping price\r\n * and international shipping price\r\n * and shipping country\r\n */\r\n $nationalShippingPrice = $products->getNationalShippingPrice();\r\n $internationalShippingPrice = $products->getInternationalShippingPrice();\r\n $sellerDefaultCountry = $products->getDefaultCountry();\r\n $shippingCountryId = $order->getShippingAddress()->getCountry();\r\n }\r\n /**\r\n * Check seller id has been set\r\n */\r\n if ($sellerId) {\r\n $orderPrice = $item->getBasePrice() * $item->getQtyOrdered();\r\n $productAmt = $item->getBasePrice();\r\n $productQty = $item->getQtyOrdered();\r\n if ($paymentMethodCode == 'paypaladaptive') {\r\n $credited = 1;\r\n } else {\r\n $credited = 0;\r\n }\r\n\r\n /* check for checking if payment method is credit card or cash on delivery and if method\r\n is cash on delivery then it will check if the order status of previous orders are complete or not\r\n no need to disable sending email from admin*/\r\n\r\n /*-----------------Adding Failed Delivery Value--------------------------*/\r\n Mage::helper('progos_ordersedit')->getFailedDeliveryStatus($order);\r\n /*----------------------------------------------------------------------*/\r\n\r\n if ($paymentMethodCode == 'ccsave' || $paymentMethodCode == 'telrpayments_cc' || $paymentMethodCode == 'telrtransparent' ) {\r\n $is_buyer_confirmation = 'No';\r\n $is_buyer_confirmation_date = $createdAt;\r\n $item_order_status = 'pending_seller';\r\n $data = 0;\r\n\r\n /*---------------------------Updating comment----------------------*/\r\n /*\r\n * Elabelz-2057\r\n */\r\n /*$product = Mage::getModel(\"catalog/product\")->load($getProductId);\r\n $comment = \"Order Item having SKU '{$product->getSku()}' is <strong>accepted</strong> by buyer\";\r\n $order->addStatusHistoryComment($comment, $order->getStatus())\r\n ->setIsVisibleOnFront(0)\r\n ->setIsCustomerNotified(0);\r\n $order->save();*/\r\n /*---------------------------Updating comment----------------------*/\r\n\r\n } elseif ($paymentMethodCode == 'cashondelivery' || $paymentMethodCode == 'msp_cashondelivery') {\r\n\r\n $counter = 0;\r\n $orders = Mage::getModel('sales/order')->getCollection();\r\n $orders->addFieldToSelect('*');\r\n $orders->addFieldToFilter('customer_id', Mage::getSingleton('customer/session')->getId());\r\n foreach ($orders as $ord) {\r\n if ($ord->getStatus() == \"complete\"):\r\n $counter = $counter + 1;\r\n endif;\r\n }\r\n if ($counter != 0) {\r\n $is_buyer_confirmation = 'Yes';\r\n $is_buyer_confirmation_yes = \"Accepted\";\r\n $item_order_status = 'pending_seller';\r\n $data = 0;\r\n\r\n /*---------------------------Updating comment----------------------*/\r\n $product = Mage::getModel(\"catalog/product\")->load($getProductId);\r\n $comment = \"Order Item having SKU '{$product->getSku()}' is <strong>accepted</strong> by buyer\";\r\n $order->addStatusHistoryComment($comment, $order->getStatus())\r\n ->setIsVisibleOnFront(0)\r\n ->setIsCustomerNotified(0);\r\n $order->save();\r\n /*---------------------------Updating comment----------------------*/\r\n\r\n } else {\r\n $is_buyer_confirmation = 'No';\r\n $item_order_status = 'pending';\r\n $tel = $order->getBillingAddress()->getTelephone();\r\n $nexmoActivated = Mage::getStoreConfig('marketplace/nexmo/nexmo_activated');\r\n $nexmoStores = Mage::getStoreConfig('marketplace/nexmo/nexmo_stores');\r\n $nexmoStores = explode(',', $nexmoStores);\r\n $currentStore = Mage::app()->getStore()->getCode();\r\n #check nexmo sms module is active or not and check on which store its enabled\r\n $reservedOrderId = $order->getIncrementId();\r\n $mdlEmapi = Mage::getModel('restmob/quote_index');\r\n $id = $mdlEmapi->getIdByReserveId($reservedOrderId);\r\n if ($nexmoActivated == 1 && in_array($currentStore, $nexmoStores) && !$id) {\r\n # code...\r\n $data = Mage::helper('marketplace/marketplace')->sendVerify($tel);\r\n $data = $data['request_id'];\r\n\r\n }\r\n //$data = 0;\r\n\r\n }\r\n }\r\n\r\n\r\n // $orderPriceToCalculateCommision = $products_new->getPrice() * $item->getQtyOrdered();\r\n $shippingPrice = Mage::helper('marketplace/market')->getShippingPrice($sellerDefaultCountry, $shippingCountryId, $orderPrice, $nationalShippingPrice, $internationalShippingPrice, $productQty);\r\n /**\r\n * Getting seller commission percent\r\n */\r\n $sellerCollection = Mage::helper('marketplace/marketplace')->getSellerCollection($sellerId);\r\n $percentperproduct = $sellerCollection ['commission'];\r\n $commissionFee = $orderPrice * ($percentperproduct / 100);\r\n\r\n // Product price after deducting\r\n // $productAmt = $products_new->getPrice() - $commissionFee;\r\n\r\n $sellerAmount = $shippingPrice - $commissionFee;\r\n\r\n if($item->getProductType() == 'simple')\r\n {\r\n $getProductId = $item->getProductId();\r\n }\r\n\r\n /**\r\n * Storing commission information in database table\r\n */\r\n\r\n if ($commissionFee > 0 || $sellerAmount > 0) {\r\n $parentIds = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($getProductId);\r\n $parent_product = Mage::getModel('catalog/product')->load($parentIds[0]);\r\n\r\n if ($parent_product->getSpecialPrice()) {\r\n $orderPrice_sp = $parent_product->getSpecialPrice() * $item->getQtyOrdered();\r\n $orderPrice_base = $parent_product->getPrice() * $item->getQtyOrdered();\r\n\r\n $commissionFee = $orderPrice_sp * ($percentperproduct / 100);\r\n $sellerAmount = $orderPrice_sp - $commissionFee;\r\n } else {\r\n $orderPrice_base = $item->getBasePrice() * $item->getQtyOrdered();\r\n $commissionFee = $orderPrice_base * ($percentperproduct / 100);\r\n $sellerAmount = $shippingPrice - $commissionFee;\r\n }\r\n\r\n $commissionDataArr = array(\r\n 'seller_id' => $sellerId,\r\n 'product_id' => $getProductId,\r\n 'product_qty' => $productQty,\r\n 'product_amt' => $productAmt,\r\n 'commission_fee' => $commissionFee,\r\n 'seller_amount' => $sellerAmount,\r\n 'order_id' => $order->getId(),\r\n 'increment_id' => $order->getIncrementId(),\r\n 'order_total' => $grandTotal,\r\n 'order_status' => $status,\r\n 'credited' => $credited,\r\n 'customer_id' => $getCustomerId,\r\n 'status' => 1,\r\n 'created_at' => $createdAt,\r\n 'payment_method' => $paymentMethodCode,\r\n 'item_order_status' => $item_order_status,\r\n 'is_buyer_confirmation' => $is_buyer_confirmation,\r\n 'sms_verify_code' => $data,\r\n 'is_buyer_confirmation_date'=> $is_buyer_confirmation_date,\r\n 'is_seller_confirmation_date'=> '0000-00-00 00:00:00',\r\n 'shipped_from_elabelz_date'=> '0000-00-00 00:00:00',\r\n 'successful_non_refundable_date'=> '0000-00-00 00:00:00',\r\n 'commission_percentage' => $sellerCollection ['commission']\r\n );\r\n\r\n $commissionId = $this->storeCommissionData($commissionDataArr);\r\n $orderEmailData [$itemCount] ['seller_id'] = $sellerId;\r\n $orderEmailData [$itemCount] ['product_qty'] = $productQty;\r\n $orderEmailData [$itemCount] ['product_id'] = $getProductId;\r\n $orderEmailData [$itemCount] ['product_amt'] = $productAmt;\r\n $orderEmailData [$itemCount] ['commission_fee'] = $commissionFee;\r\n $orderEmailData [$itemCount] ['seller_amount'] = $sellerAmount;\r\n $orderEmailData [$itemCount] ['increment_id'] = $order->getIncrementId();\r\n $orderEmailData [$itemCount] ['customer_firstname'] = $order->getCustomerFirstname();\r\n $orderEmailData [$itemCount] ['customer_email'] = $order->getCustomerEmail();\r\n $orderEmailData [$itemCount] ['product_id_simple'] = $getProductId;\r\n $orderEmailData [$itemCount] ['is_buyer_confirmation'] = $is_buyer_confirmation_yes;\r\n $orderEmailData [$itemCount] ['itemCount'] = $itemCount;\r\n $itemCount = $itemCount + 1;\r\n }\r\n }\r\n // if ($paymentMethodCode == 'paypaladaptive') {\r\n // $this->updateCommissionPA($commissionId);\r\n // }\r\n }\r\n\r\n if ($paymentMethodCode == 'ccsave' || $paymentMethodCode == 'telrpayments_cc' || $paymentMethodCode == 'telrtransparent' ) {\r\n /*if (Mage::getStoreConfig('marketplace/admin_approval_seller_registration/sales_notification') == 1) {\r\n $this->sendOrderEmail($orderEmailData);\r\n }*/\r\n } elseif ($paymentMethodCode == 'cashondelivery' || $paymentMethodCode == 'msp_cashondelivery') {\r\n $counter = 0;\r\n $orders = Mage::getModel('sales/order')->getCollection();\r\n $orders->addFieldToSelect('*');\r\n $orders->addFieldToFilter('customer_id', Mage::getSingleton('customer/session')->getId());\r\n foreach ($orders as $ord) {\r\n if ($ord->getStatus() == \"complete\"){\r\n $counter = $counter + 1;\r\n }\r\n }\r\n if ($counter != 0) {\r\n if (Mage::getStoreConfig('marketplace/admin_approval_seller_registration/sales_notification') == 1) {\r\n\r\n $this->sendOrderEmail($orderEmailData);\r\n }\r\n }\r\n }\r\n\r\n //$this->enqueueDataToFareye($observer);\r\n\r\n }", "public static function saveToCart($cart_products,$order, $total_price,$currency,$ses_id){\n $error = array();\n foreach($cart_products as $product){\n $prod = Product::productById($product['product_id']);\n //$latest_products_info[$product['product_id']] = $prod; \n if($product['cart_quantity'] > $prod['quantity']){ \n $error['error'] .= \"{$product['name']} , Quantity: {$product['cart_quantity']} not Available, \\n\";\n }\n }\n if(!empty($error)){ $error['success'] = false; echo json_encode($error); die; }\n\n\n if(!isset($order['shipping_address_id']) || !isset($order['billing_address_id']) || !isset($order['payment_method']) || !isset($order['shipping_method'])){\n $error['success'] = false;\n $error['error'] = 'Fill Order Steps';\n //pr($order);\n echo json_encode($error);\n die; \n }\n \n \n $sessUserId = (isset($_SESSION['sess_user_id']) ? $_SESSION['sess_user_id'] : 0);\n if($sessUserId!=$order['customer_id']){\n $error['success'] = false;\n $error['error'] = 'Please login to correct user'; \n }\n \n \n \n //$store = Store::loadById(2);\n $store = Store::load($start = 1, $limit = 1);\n $store = $store[0];\n if(empty($store)){\n $error['success'] = false;\n $error['error'] = 'Please login to correct user';\n echo json_encode($error);\n die; \n }\n $customer = Customer::loadById($order['customer_id']);\n $store_url = BASE_URL.\"admins/store/index.php?id=1\"; \n\n $paddress = CustomerAddress::loadById($order['billing_address_id']);\n $shipaddress = CustomerAddress::loadById($order['shipping_address_id']);\n $payment_country_name = Country::loadById( $paddress->getCountryId() );\n $ship_country_name = Country::loadById( $shipaddress->getCountryId() );\n $payment_zone_name = Zone::loadById($paddress->getZoneId());\n $ship_zone_name = Zone::loadById($shipaddress->getZoneId());\n $PaymentMethod = PaymentMethod::loadByCode($order['payment_method']);\n $shippingMethod = DeliveryMethod::loadByCode($order['shipping_method']);\n $date_added = date('Y-m-d H:i:s', time());\n\n if(empty($PaymentMethod)){\n $error['success'] = false;\n $error['error'] = 'Select Payment method';\n echo json_encode($error);\n die; \n }\n\n \n if(empty($shippingMethod)){\n $error['success'] = false;\n $error['error'] = 'Select Shipping method';\n echo json_encode($error);\n die; \n }\n\n \n \n \n $objOrderList = new OrderList(); \n $objOrderList->setInvoiceNo(0);\n $objOrderList->setInvoicePrefix(\"INV-\".date(\"Y-m\"));\n $objOrderList->setStoreId(0);\n $objOrderList->setStoreName($store->getName());\n $objOrderList->setStoreUrl($store_url);\n $objOrderList->setCustomerId($customer->getCustomerId());\n $objOrderList->setCustomerGroupId($customer->getCustomerGroupId());\n $objOrderList->setFirstname($customer->getFirstname());\n $objOrderList->setLastname($customer->getLastname());\n $objOrderList->setEmail($customer->getEmail());\n $objOrderList->setTelephone($customer->getTelephone());\n $objOrderList->setFax($customer->getFax());\n $objOrderList->setPaymentFirstname($paddress->getFirstname());\n $objOrderList->setPaymentLastname($paddress->getLastname());\n $objOrderList->setPaymentCompany($paddress->getCompany());\n $objOrderList->setPaymentCompanyId($paddress->getCompanyId());\n $objOrderList->setPaymentTaxId($paddress->getTaxId());\n $objOrderList->setPaymentAddress1($paddress->getAddress1());\n $objOrderList->setPaymentAddress2($paddress->getAddress2());\n $objOrderList->setPaymentCity($paddress->getCity());\n $objOrderList->setPaymentPostcode($paddress->getPostcode());\n $objOrderList->setPaymentCountry($payment_country_name->getName());\n $objOrderList->setPaymentCountryId($paddress->getCountryId());\n $objOrderList->setPaymentZone($payment_zone_name->getName()); \n $objOrderList->setPaymentZoneId($paddress->getZoneId());\n $objOrderList->setPaymentAddressFormat('');\n $objOrderList->setPaymentMethod($PaymentMethod->getName()); \n $objOrderList->setPaymentCode($order['payment_method']);\n $objOrderList->setPaymentComment($order[\"payment_comment\"]);\n $objOrderList->setBankName($order[\"bank_name\"]);\n $objOrderList->setBankAcountNo($order[\"bank_acount_no\"]);\n $objOrderList->setShippingFirstname($shipaddress->getFirstname());\n $objOrderList->setShippingLastname($shipaddress->getLastname());\n $objOrderList->setShippingCompany($shipaddress->getCompany());\n $objOrderList->setShippingAddress1($shipaddress->getAddress1());\n $objOrderList->setShippingAddress2($shipaddress->getAddress2());\n $objOrderList->setShippingCity($shipaddress->getCity()); \n $objOrderList->setShippingPostcode($shipaddress->getPostcode());\n $objOrderList->setShippingCountry($ship_country_name->getName());\n $objOrderList->setShippingCountryId($shipaddress->getCountryId());\n $objOrderList->setShippingZone($ship_zone_name->getName());\n $objOrderList->setShippingZoneId($shipaddress->getZoneId());\n $objOrderList->setShippingAddressFormat('');\n $objOrderList->setShippingMethod($shippingMethod->getMethodName());\n $objOrderList->setShippingCode($order['shipping_method']);\n $objOrderList->setComment($order['shipping_comment']); //$order['shipping_comment']\n $objOrderList->setTotal($total_price);\n $objOrderList->setOrderStatusId(1);\n $objOrderList->setAffiliateId(0);\n $objOrderList->setCommission(0);\n $objOrderList->setLanguageId(1);\n $objOrderList->setCurrencyId($currency[\"currency_id\"]);\n $objOrderList->setCurrencyCode($currency[\"code\"]);\n $objOrderList->setCurrencyValue($currency[\"value\"]);\n $objOrderList->setIp($_SERVER['REMOTE_ADDR']);\n $objOrderList->setForwardedIp('');\n $objOrderList->setUserAgent($_SERVER[\"HTTP_USER_AGENT\"]);\n $objOrderList->setAcceptLanguage($_SERVER['HTTP_ACCEPT_LANGUAGE']);\n $objOrderList->setDateAdded($date_added);\n $objOrderList->setDateModified($date_added);\n $objOrderList->setCbaFreeShipping(0);\n \n\n \n $result = $objOrderList->save(); \n $order_id = $objOrderList->getOrderId();\n \n if($result['success']){ \n $customer_reward = $cart_total_price = 0;\n\n // order Product insertion\n if(!empty($cart_products))\n foreach($cart_products as $k=>$product){\n $cart_product_price_total = $price= 0;\n $objOrderProduct = new OrderProduct();\n //$objOrderProduct->setOrderProductId($resultRow[\"order_product_id\"]);\n $objOrderProduct->setOrderId($order_id);\n $objOrderProduct->setProductId($product[\"product_id\"]);\n $objOrderProduct->setName($product[\"name\"]);\n $objOrderProduct->setModel($product[\"manufacture_name\"]);\n $objOrderProduct->setQuantity($product[\"cart_quantity\"]);\n $objOrderProduct->setSize($product[\"product_size\"]);\n if($product['product_discount_id']!=NULL)\n $price = ($product[\"discount_price\"]*$currency['value']);\n else \n $price = ($product[\"price\"]*$currency['value']);\n \n $objOrderProduct->setPrice($price);\n $cart_product_price_total = $price*$product[\"cart_quantity\"];\n $cart_total_price +=$cart_product_price_total;\n $objOrderProduct->setTotal($cart_product_price_total);\n $objOrderProduct->setTax(0);\n $objOrderProduct->setReward(($product[\"points\"]*$product[\"cart_quantity\"]));\n $customer_reward += intval($product[\"points\"]); \n $result_prod = $objOrderProduct->save();\n $objOrderProduct->getOrderProductId();\n\n $order_products[] = \"{$product[\"name\"]} - {$product[\"cart_quantity\"]} - {$currency['code']}{$price} \";\n } \n\n // order Reward insertion\n if($customer_reward>0){\n $custrewardinfo = CustomerReward::fetchByCustomerId($customer->getCustomerId());\n $objCustomerReward = new CustomerReward();\n if(!empty($custrewardinfo) && $custrewardinfo->getCustomerRewardId()>0)\n $objCustomerReward->setCustomerRewardId($custrewardinfo->getCustomerRewardId());\n $objCustomerReward->setCustomerId($customer->getCustomerId());\n $objCustomerReward->setOrderId(1);\n $objCustomerReward->setDescription(\"Reward point\");\n $objCustomerReward->setPoints($customer_reward);\n $objCustomerReward->setDateAdded($date_added);\n $objCustomerReward->save();\n }\n\n // order Total insertion only shipping implement\n \n\n $objOrderTotal = new OrderTotal();\n $objOrderTotal->setOrderId($order_id);\n $objOrderTotal->setCode('sub_total');\n $objOrderTotal->setTitle('Sub-Total');\n $objOrderTotal->setText($cart_total_price);\n $objOrderTotal->setValue($cart_total_price);\n $objOrderTotal->setSortOrder(1);\n $objOrderTotal->save();\n \n\n $objOrderTotal = new OrderTotal();\n $objOrderTotal->setOrderId($order_id);\n $objOrderTotal->setCode($shippingMethod->getDeliveryMethodCode());\n $objOrderTotal->setTitle($shippingMethod->getMethodName());\n $objOrderTotal->setText($shippingMethod->getMethodName());\n $ship_rate = $shippingMethod->getCost()*$currency['value'];\n $objOrderTotal->setValue($ship_rate);\n $objOrderTotal->setSortOrder(2);\n $result = $objOrderTotal->save();\n\n $objOrderTotal = new OrderTotal();\n //$objOrderTotal->setOrderTotalId($resultRow[\"order_total_id\"]);\n $objOrderTotal->setOrderId($order_id);\n $objOrderTotal->setCode('total');\n $objOrderTotal->setTitle('Total');\n $objOrderTotal->setText(($cart_total_price+$ship_rate));\n $objOrderTotal->setValue(($cart_total_price+$ship_rate));\n $objOrderTotal->setSortOrder(3);\n $result = $objOrderTotal->save();\n \n // Order Hisory Entry\n $objOrderHistory = new OrderHistory(); \n $objOrderHistory->setOrderId($order_id);\n $objOrderHistory->setOrderStatusId(1);\n $objOrderHistory->setNotify(1);\n $objOrderHistory->setComment($order['payment_comment']);\n $objOrderHistory->setDateAdded($date_added);\n $result = $objOrderHistory->save(); \n unset($_SESSION[$ses_id]['Order']);\n unset($_SESSION[$ses_id]['Products']);\n unset($_SESSION[$ses_id]['Cart_Total_Price']);\n $customerinfo = Customer::loadById($customer->getCustomerId());\n $result = Customer::saveCart($customer->getCustomerId(), serialize(array()));\n $result['result'] = \"Succes submit\";\n\n $order_products_str = implode(\", \\n\", $order_products);\n\n /*$mailObj = new Mailer();\n $from = $customer->getEmail(); \n $fromname = $customer->getFirstname(). \" \".$customer->getLastname();\n \n $subject = sprintf(CART_CHECKOUT_SUBJECT,$order_id);\n $body = sprintf(CART_CHECKOUT_BODY,$order_products_str);\n $mailObj->setMailAddress($from, $fromname);\n $mailObj->setMailSubject($subject);\n $mailObj->setMailBody(sprintf(CART_CHECKOUT_BODY,$order_products_str));\n //pr($mailObj); die(\"d\"); \n //if(!$mailObj->MailSend($from,$fromname,$subject,$body)){\n if(!$mailObj->MailSend()){\n $result['error'] = \"Mail can\\'t send ! Order Submit. \\n Check your Account Order history\";\n $result['success']=false;\n echo json_encode($result);\n die;\n }*/\n\n $result['order_id'] = $order_id;\n $result['success']=true;\n \n echo json_encode($result);\n die;\n\n \n }\n\n\n }", "public function isSeller(){\n\t\t\tif ($this->config->get('module_purpletree_multivendor_status')) {\n\t\t$query = $this->db->query(\"SELECT id, store_status, multi_store_id, is_removed FROM \" . DB_PREFIX . \"purpletree_vendor_stores where seller_id='\".$this->customer_id.\"'\");\n\t\treturn $query->row;\n\t}\n\t}", "function get_item_shipping() {\n\t}", "public function isAutoShipping(): bool;", "function getShippingChoicesList() {\n\t\tApp::import('Model', 'CartsProduct');\n\t\t$this->CartsProduct = &new CartsProduct;\n\t\t$cart_stats = $this->CartsProduct->getStats($this->CartsProduct->Cart->get_id());\n\n\t\t// pokud nesplnuju podminky pro dopravy doporucenym psanim, zakazu si tyto zpusoby dopravy vykreslit zakaznikovi\n\t\t$conditions = array();\n\t\tif (!$this->isRecommendedLetterPossible()) {\n\t\t\t$conditions = array('Shipping.id NOT IN (' . implode(',', $this->Shipping->getRecommendedLetterShippingIds()) . ')');\n\t\t}\n\n\t\t$shipping_choices = $this->Shipping->find('all', array(\n\t\t\t'conditions' => $conditions,\n\t\t\t'contain' => array(),\n\t\t\t'fields' => array('id', 'name', 'price', 'free'),\n\t\t\t'order' => array('Shipping.order' => 'asc')\n\t\t));\n\t\t\n\t\t// pokud mam v kosiku produkty, definovane v Cart->free_shipping_products v dostatecnem mnozstvi, je doprava zdarma\n\t\tApp::import('Model', 'Cart');\n\t\t$this->Cart = &new Cart;\n\t\tif ($this->Cart->isFreeShipping()) {\n\t\t\t// udelam to tak, ze nastavim hodnotu kosiku na strasne moc a tim padem budu mit v kosiku vzdycky vic, nez je\n\t\t\t// minimalni hodnota kosiku pro dopravu zdarma\n\t\t\t$cart_stats['total_price'] = 99999;\n\t\t}\n\n\t\t// v selectu chci mit, kolik stoji doprava\n\t\tforeach ($shipping_choices as $shipping_choice) {\n\t\t\t$shipping_item = $shipping_choice['Shipping']['name'] . ' - ' . $shipping_choice['Shipping']['price'] . ' Kč';\n\t\t\tif ($cart_stats['total_price'] > $shipping_choice['Shipping']['free']) {\n\t\t\t\t$shipping_item = $shipping_choice['Shipping']['name'] . ' - zdarma';\n\t\t\t}\n\t\t\t$shipping_choices_list[$shipping_choice['Shipping']['id']] = $shipping_item;\n\t\t}\n\t\t\n\t\treturn $shipping_choices_list;\n\t}", "protected abstract function isSingleProduct();", "public function testShoppingCartCanBeRetrievedById()\n {\n $id1 = new UUID();\n $cart1 = new ShoppingCart($id1);\n $this->gateway->insert($id1, $cart1);\n\n $id2 = new UUID();\n $cart2 = new ShoppingCart($id2);\n $this->gateway->insert($id2, $cart2);\n\n $query = $this->db->query('SELECT * FROM shoppingCart');\n $result = $query->fetchAll(PDO::FETCH_COLUMN);\n\n $cart = $this->gateway->findById($id1);\n\n $this->assertEquals(2, count($result));\n $this->assertInstanceOf('ShoppingCart', $cart);\n $this->assertEquals($id1, $cart->getId());\n }", "public function getShowInCart()\n {\n return Mage::getStoreConfig('splitprice/split_price_presentation/show_cart');\n }", "public function getIsRequiredShipping()\n {\n $model = $this->_coreRegistry->registry('sales_subscription');\n $productId = $model->getSubProductId();\n $product = $this->productRepository->getById($productId);\n $productTypes = ['virtual', 'downloadable'];\n\n if ($product) {\n $productType = $product->getTypeId();\n if (!in_array($productType, $productTypes)) {\n return true;\n }\n }\n return false;\n }", "public function getShowCartInPayPal()\n {\n return $this->_blShowCartInPayPal;\n }", "public function verifyShippingDisponibility() {\n\n $return = array();\n $items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();\n $PackageWeight = 0;\n foreach ($items as $item) {\n if (($item->getProductType() == \"configurable\") || ($item->getProductType() == \"grouped\")) {\n $PackageWeight += ($item->getWeight() * (((int) $item->getQty()) - 1));\n } else {\n $PackageWeight += ($item->getWeight() * ((int) $item->getQty()));\n }\n }\n\n $customerAdressCountryCode = $this->getCustomerCountry();\n //verify destination country\n $keyOdExpressDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod1);\n $keyOdMessagerieDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod2);\n\n\n if ($keyOdExpressDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 0;\n }\n\n if ($keyOdMessagerieDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 0;\n }\n\n return $return;\n }", "public function getDeliveryMode()\n {\n }", "public function quoteHasServiceProduct()\n {\n $quote = Mage::getSingleton('checkout/session')->getQuote();\n if (!$quote->hasData('has_service_product')) {\n $quote->setData('has_service_product', false);\n foreach ($quote->getAllVisibleItems() as $item) {\n if ($this->isQuoteItemServiceProduct($item)) {\n $quote->setData('has_service_product', true);\n break;\n }\n }\n }\n\n return $quote->getData('has_service_product');\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function getBaseShippingInvoiced();", "function check_product_in_the_cart($product){\n if (auth()->check()){\n $cart = Cart::where('user_id', auth()->user()->id)->where('product_id', $product->id)->first();\n }else{\n if(session()->has('carts')){\n $cart = key_exists($product->uuid, session('carts'));\n }else{\n $cart = false;\n }\n }\n\n if ($cart){\n return true;\n }else{\n return false;\n }\n}", "private function getAlreadyPurchasedProduct()\n {\n // If is Guest then hide the review form\n if (!$this->getCustomerId()) {\n return false;\n }\n try {\n $product = $this->getProductInfo();\n $orders = $this->getCustomerOrders();\n foreach ($orders as $order) {\n // Get all visible items in the order\n /** @var $items \\Magento\\Sales\\Api\\Data\\OrderItemInterface[] **/\n $items = $order->getAllVisibleItems();\n // Loop all items\n foreach ($items as $item) {\n // Check whether the current product exist in the order.\n if ($item->getProductId() == $product->getId()) {\n return true;\n }\n }\n }\n return false;\n } catch (\\Exception $e) {\n return false;\n }\n }", "protected function _getCart()\n {\n return Mage::getSingleton('checkout/cart');\n }", "private function checkCartStatus()\n {\n if ($this->quote->getIsActive()=='0') {\n $this->getMagentoOrderId();\n throw new \\Exception(self::CMOS_ALREADY_PROCESSED);\n }\n }", "abstract public function checkAvailability(VAPCartItem $item, array $service);", "private function isServipag(){\r\n return $this->getPaymentMethod() == 2;\r\n }", "function getfaircoin_only_one_item_on_cart($download_id) {\r\n //echo 'CART CONTENTS: ';\r\n //print_r($cart_contents);\r\n //$cart_contents = edd_get_cart_contents();\r\n //if($cart_contents) return false;\r\n //else return $download_id;\r\n edd_empty_cart();\r\n}", "abstract function has_paid_plan();", "public function addToCartEvent($observer) {\r\n /**\r\n * check the observer event gull action name is equal to the checkout cart add\r\n */\r\n if ($observer->getEvent()->getControllerAction()->getFullActionName() == 'checkout_cart_add') {\r\n /**\r\n * Assign the customer id as empty\r\n */\r\n $customerId = '';\r\n /**\r\n * Check the customer is currently logged in\r\n * if so then get the customer data\r\n */\r\n if (Mage::getSingleton('customer/session')->isLoggedIn()) {\r\n $customerData = Mage::getSingleton('customer/session')->getCustomer();\r\n $customerId = $customerData->getId();\r\n }\r\n\r\n $product = Mage::getModel('catalog/product')->load(Mage::app()->getRequest()->getParam('product', 0));\r\n /**\r\n * Check the product id is not set\r\n * or cutomer id is empty\r\n * if so return\r\n */\r\n if (!$product->getId() || empty($customerId)) {\r\n return;\r\n }\r\n $sellerId = $product->getSellerId();\r\n /**\r\n * check the the current customer id is equal to the seller id\r\n */\r\n if ($sellerId == $customerId) {\r\n\r\n $assignProductId = $product->getAssignProductId();\r\n if (!empty($assignProductId)) {\r\n $productUrl = Mage::getModel('catalog/product')->load($assignProductId)->getProductUrl();\r\n } else {\r\n $productUrl = $product->getProductUrl();\r\n }\r\n\r\n $msg = Mage::helper('marketplace')->__(\"Seller can't buy their own product.\");\r\n Mage::getSingleton('core/session')->addError($msg);\r\n\r\n Mage::app()->getFrontController()->getResponse()->setRedirect($productUrl);\r\n Mage::app()->getResponse()->sendResponse();\r\n\r\n $controller = $observer->getControllerAction();\r\n $controller->getRequest()->setDispatched(true);\r\n $controller->setFlag('', Mage_Core_Controller_Front_Action::FLAG_NO_DISPATCH, true);\r\n }\r\n }\r\n return $this;\r\n }", "function changeProduct($cart_table_id,$true_or_false)\n {\n $this->pdelivery[$cart_table_id]=$true_or_false; //change product group delivery\n }", "public function isExpressCheckout(): bool\n {\n return false;\n }", "public static function promotion_check_delivery(\\Blink\\Request $request) {\n $delivery_method = $request->cookie->find(\"delivery_method\");\n \n if(!$request->cookie->is_set(\"delivery_method\")) {\n return false;\n }\n \n if($delivery_method == \"email\") {\n $count = 0;\n for($i = 1; $i <= Config::$NotLoggedInMaxEmailCount; $i++) {\n if($request->cookie->is_set(\"email_email$i\")) {\n $count++;\n }\n }\n if(!$count) {\n return false;\n }\n } else if($delivery_method == \"facebook\") {\n if(!$request->cookie->is_set(\"facebook_ids\")) {\n return false;\n }\n }\n \n return true;\n }", "public function cart_no_shipping()\n\t{\n\n\t\t// get the store cart cookie\n\t\t$cookie = ee()->input->cookie('store_cart');\n\n\t\t// if the cookie has a value\n\t\tif ($cookie) {\n\n\t\t\t// query for the items in the order\n\t\t\t$query = ee()->db\n\t\t\t\t->select('sku, exp_store_order_items.url_title, weight, height, width, length, field_id_26 as container')\n\t \t->where('order_hash', $cookie)\n\t \t->join('store_orders', 'exp_store_orders.id = exp_store_order_items.order_id')\n\t \t->join('channel_data', 'exp_channel_data.entry_id = exp_store_order_items.entry_id')\n\t \t->get('store_order_items');\n\n\t // default the values\n\t $vars['cart_weight'] = 0;\n\t $vars['missing_dimensions'] = 'n';\n\t $vars['container_self'] = 'n';\n\n\t // loop through the cart and update the values\n\t foreach($query->result() as $item)\n\t {\n\t \tif(!empty($item->weight))\n\t \t{\n\t \t\t$vars['cart_weight'] += $item->weight;\n\t \t}\t\n\t \t\n\n\t \tif(!$item->weight || !$item->height || !$item->width || !$item->length)\n\t \t{\n\t \t\t$vars['missing_dimensions'] = 'y';\n\t \t}\n\n\t \tif($item->container == 'Self')\n\t \t{\n\t \t\t$vars['container_self'] = 'y';\n\t \t}\t\n\t }\n\n\t \t// parse the variables into the tagdata\n\t \treturn ee()->TMPL->parse_variables_row(ee()->TMPL->tagdata, $vars);\n\t \t\n } // end of if\n\n\t}", "public function hasShoporder(){\n return $this->_has(27);\n }", "function getCart(){\n \treturn $this->myCart->getList();\n }", "public function getCartProduct(){\n $sId = session_id();\n $squery = \"SELECT * FROM tbl_cart WHERE sId='$sId'\";\n $result = $this->db->select($squery);\n if ($result) {\n return $result;\n }else {\n return false;\n }\n }", "public function getShoppingCart()\r\n\t{\r\n\t\treturn $this->shoppingCart;\r\n\t}", "public function markCartsAdditionalProducts(Order $draftOrder): bool;", "private function _collectShippingInfo(){\n\t\tif(!empty($this->_shippingPriceCache)) return $this->_shippingPriceCache;\n\t\t$return = Mage::getSingleton(\"ultracart/cart\")->_collectShippingInfo();\n\t\t$this->_shippingPriceCache = $return;\n\t\t\n\t\treturn $return;\n\t\t\n\t}", "public function getHasCartIdentifier()\n {\n return method_exists($this, 'getKey') ? $this->getKey() : $this->id;\n }", "public function magicMethod(){\n $cart = $this->_getCart();\n $quoteArrayFreeProducts = array();\n $quoteArrayNonFreeProducts = array();\n $AddThisInCart = array();\n $finalAdd = array();\n\n // finding both free and non free products and saving them in array\n $quote = Mage::getSingleton('checkout/session')->getQuote();\n foreach($quote->getAllVisibleItems() as $item) {\n if($item->getData('price') == 0){\n $quoteArrayFreeProducts['item_id'][] = $item->getData('product_id');\n $quoteArrayFreeProducts['qty'][] = $item->getData('qty');\n }else{\n $quoteArrayNonFreeProducts['item_id'][] = $item->getData('product_id');\n $quoteArrayNonFreeProducts['qty'][] = $item->getData('qty');\n }\n }\n \n // print_r($quoteArrayFreeProducts);die;\n // finding free associatied produts and adding them in another array\n for($i = 0; $i < count($quoteArrayNonFreeProducts['item_id']) ;$i++){\n $product = Mage::getModel('catalog/product')->load($quoteArrayNonFreeProducts['item_id'][$i]);\n // print_r($product->getAttributeText('buyxgety'));die;\n if($product->getAttributeText('buyxgety') == 'Enable'){\n $Buyxgety_xqty = $product->getBuyxgety_xqty();\n $Buyxgety_ysku = $product->getBuyxgety_ysku();\n $Buyxgety_yqty = $product->getBuyxgety_yqty();\n\n // $Buyxgety_ydiscount = $product->getBuyxgety_ydiscount();\n if(!empty($Buyxgety_xqty) && !empty($Buyxgety_ysku) && !empty($Buyxgety_yqty) ){\n // die($Buyxgety_ysku);\n $AddThisInCart['item_id'][] = Mage::getModel('catalog/product')->getIdBySku($Buyxgety_ysku);\n $AddThisInCart['qty'][] = (int)($quoteArrayNonFreeProducts['qty'][$i]/$Buyxgety_xqty)*$Buyxgety_yqty;\n }\n }\n }\n for($i = 0; $i < count($AddThisInCart['item_id']) ;$i++){\n if(isset($quoteArrayFreeProducts['item_id'])){\n for($j = 0; $j < count($quoteArrayFreeProducts['item_id']) ;$j++){\n if($AddThisInCart['item_id'][$i] == $quoteArrayFreeProducts['item_id'][$j]){\n $finalAdd['item_id'][] = $AddThisInCart['item_id'][$i];\n $finalAdd['qty'][] = $AddThisInCart['qty'][$i] - $quoteArrayFreeProducts['qty'][$j];\n }else{\n $finalAdd['item_id'][] = $AddThisInCart['item_id'][$i];\n $finalAdd['qty'][] = $AddThisInCart['qty'][$i];\n }\n }\n }else{\n $finalAdd['item_id'][] = $AddThisInCart['item_id'][$i];\n $finalAdd['qty'][] = $AddThisInCart['qty'][$i];\n }\n }\n\n for($i = 0; $i < count($finalAdd['item_id']) ;$i++){\n for($j = 0; $j < count($quoteArrayNonFreeProducts['item_id']); $j++){\n if($finalAdd['item_id'][$i] == $quoteArrayNonFreeProducts['item_id'][$j]){\n foreach ($quoteArrayFreeProducts['item_id'] as $value) {\n if($value == $finalAdd['item_id'][$i]){\n $flag = 1;\n }else{\n $flag = 0;\n }\n }\n if($flag == 1){\n $finalAdd['new_row'][] = 0;\n }else{\n $finalAdd['new_row'][] = 1;\n }\n }\n }\n if(!empty($quoteArrayFreeProducts['item_id'])){\n for($j = 0; $j < count($quoteArrayFreeProducts['item_id']); $j++){\n if($finalAdd['item_id'][$i] == $quoteArrayFreeProducts['item_id'][$j]){\n $finalAdd['new_row'][] = 0;\n }else{\n $finalAdd['new_row'][] = 1;\n }\n }\n }else{\n $finalAdd['new_row'][] = 1;\n } \n }\n\n // print_r($finalAdd);die;\n\n if(isset($finalAdd['item_id'])){\n for($i = 0; $i < count($finalAdd['item_id']) ;$i++){\n if($finalAdd['qty'][$i] > 0){\n Mage::getSingleton('core/session')->setMultilineAddingObserver($finalAdd['new_row'][$i]);\n Mage::getSingleton('core/session')->setZeroSettingObserver(1);\n if($finalAdd['new_row'][$i] == 0){\n $cartHelper = Mage::helper('checkout/cart');\n $items = $cartHelper->getCart()->getItems(); \n foreach ($items as $item) \n {\n $itemId = $item->getItemId();\n if($item->getProductId() == $finalAdd['item_id'][$i] && $item->getPrice() == 0){\n $cartHelper->getCart()->removeItem($itemId)->save();\n $this->magicMethod();\n }\n }\n }else{\n $productToAdd = $product->load($finalAdd['item_id'][$i]);\n $params['qty'] = $finalAdd['qty'][$i];\n $params['product'] = $finalAdd['item_id'][$i];\n $cart->addProduct($productToAdd, $params);\n $cart->save();\n }\n }else if($finalAdd['qty'][$i] < 0){\n $cartHelper = Mage::helper('checkout/cart');\n $items = $cartHelper->getCart()->getItems(); \n foreach ($items as $item) \n {\n $itemId = $item->getItemId();\n if($item->getProductId() == $finalAdd['item_id'][$i] && $item->getPrice() == 0){\n $cartHelper->getCart()->removeItem($itemId)->save();\n $this->_updateShoppingCart();\n }\n } \n }\n }\n }\n }", "protected function getCurrentCart()\n {\n return $this\n ->getProvider()\n ->getCart()\n ;\n }", "public static function checkForNearProducts() {\n $cartDeliveryPostcodeSessionKey = \\Config::get('appConstants.user_delivery_postcode_session_key');\n $landingPagePostcodeSessionKey = \\Config::get('appConstants.user_landing_postcode_session_key');\n $landingPostcode = session()->get($landingPagePostcodeSessionKey, '');\n $cartPostcode = session()->get($cartDeliveryPostcodeSessionKey, '');\n if (!empty($landingPostcode)\n || !empty($cartPostcode)\n ) {\n return true;\n }\n return false;\n }", "function it_exchange_abandoned_carts_is_active_shopper() {\n\t// We do not start tracking until they log in\n\tif ( ! it_exchange_get_current_customer() )\n\t\treturn false;\n\n\t// We do not start tracking until they have an item in their cart\n\t$cart_products = it_exchange_get_cart_products();\n\tif ( count( $cart_products ) < 1 )\n\t\treturn false;\n\n\t// If user is logged in and has an item in their cart, this is an active shopper\n\treturn true;\n}", "public function seachItemPurchase(Request $request){\n return m_item::seachItemPurchase($request);\n }", "public function provides()\n {\n return array('shopify');\n }", "public function continue_checkout($Recipt,$ShoppingCart,$discount)\n {\n $Recipt->update([\n 'is_init_for_card_payment' => null\n ]);\n\n Recipt::where('member_id',$Recipt->member_id)->where('is_init_for_card_payment','1')->delete();\n\n $ReciptProducts = [];\n //--for create Recipt Products--\n foreach ($ShoppingCart as $key => $Cart)\n {\n $this_product = Product::find($Cart->product_id);\n if( $this_product->quantity > 0 || !$this_product)\n {\n //check if selected quantity is not bigger than the stock quantity\n $required_quantity = ($Cart->quantity < $this_product->quantity) ? $Cart->quantity : $this_product->quantity;\n $produ = null;\n $produ = [\n 'recipt_id' => $Recipt->id,\n 'quantity' => $required_quantity ,\n 'product_name_en' => $this_product->name_en ,\n 'product_name_ar' => $this_product->name_ar,\n 'product_id' => $this_product->id ,\n 'cheese_type' => $Cart->cheese_type,\n 'cheese_weight' => $Cart->cheese_weight,\n 'bundle_products_ids' => $this_product->bundle_products_ids,\n 'single_price' => $this_product->price,\n 'total_price' => $this_product->price * $Cart->quantity\n ];\n array_push($ReciptProducts, $produ);\n\n //---decrease the quantity from the product---\n $this_product->update([\n 'quantity' => $this_product->quantity - $required_quantity\n ]);\n }//End if\n }//End foreach\n ReciptProducts::insert($ReciptProducts);\n ShoppingCart::where( 'member_id',$Recipt->member_id )->delete();\n if($discount)\n {\n $myPromo = MemberPromo::where( 'member_id',$Recipt->member_id )->where('is_used',0)->first();\n $myPromo->update([\n 'is_used' => 1,\n 'used_date' => \\Carbon\\Carbon::now()\n ]);\n }\n\n $member = \\App\\Member::find($Recipt->member_id);\n\n $member->update([\n // 'reward_points' => ( $member->reward_points + ceil($Recipt->total_price / 20) ) - $Recipt->points_deduction_price\n 'reward_points' => $member->reward_points - $Recipt->points_deduction_price\n ]);\n\n if($Recipt->payment_method == 'creadit_card')\n {\n $Recipt->update([\n 'payment_method' => 'creadit_card' ,\n 'is_piad' => 1 ,\n ]);\n\n try {\n \\Mail::to($member->email)\n ->send(new \\App\\Mail\\ConfirmOrder($Recipt,$member));\n } catch (\\Exception $e) {\n\n }\n }\n else {\n try {\n \\Mail::to($member->email)\n ->send(new \\App\\Mail\\ConfirmOrder($Recipt,$member));\n }catch (\\Exception $e) {\n\n }\n }\n return response()->json([\n 'status' => 'success',\n 'status_message' => __('page.Thank you for purchasing from us'),\n ]);\n }", "function harvest_in_order( $order ) {\n\n\t$items = $order->get_items(); \n\n\tforeach ( $items as $item_id => $item ) {\n\n\t\tif ( $item->get_product_id() === 37592 ) {\n\t\t\t\n\t\t\treturn true;\n\t\t\t\n\t\t}\n\n\t}\n\t\n\treturn false;\n\n}", "public function hasItem(CartItemInterface $item);", "function buy_annual_subscription_action() {\n // Annual subscription + membership product ID: 11327\n $product_id = 11326;\n $added_product = WC()->cart->add_to_cart($product_id);\n\n if ($added_product !== '') {\n echo \"Subscription added to cart!\";\n } else {\n echo \"Subscription not add to cart!\";\n }\n\n wp_die();\n }", "static function cartItem (){\n $user_id = auth()->user()->id;\n return Cart::where('user_id',$user_id)->count();\n }", "function make_donation_action() {\n // Annual subscription + membership product ID: 11327\n $product_id = 11336;\n $product_cart_id = WC()->cart->generate_cart_id($product_id);\n $is_product_in_the_cart = WC()->cart->find_product_in_cart($product_cart_id);\n $added_product = null;\n\n if (!$is_product_in_the_cart) {\n $added_product = WC()->cart->add_to_cart($product_id);\n\n if ($added_product !== '') {\n echo \"<span class='msg msg_success'>Membership added to cart!</span>\";\n } else {\n echo \"<span class='msg msg_error'>Membership not add to cart!</span>\";\n }\n } else {\n echo \"<span class='msg msg_info'>You have already added a membership</span>\";\n }\n\n wp_die();\n }", "abstract function has_purchased_before();", "public function manageOrderProducts()\n {\n }", "public function applyCartDiscount(Varien_Event_Observer $observer)\n { \n try\n { \n $bundle_product_ids = [];\n $quote_product_ids = [];\n $cookieValue = Mage::getModel('core/cookie')->get('ivid');\n $userBundleCollection = Mage::getModel('increasingly_analytics/bundle')->getCollection()->addFieldToFilter('increasingly_visitor_id',$cookieValue);\n $items = $observer->getEvent()->getQuote()->getAllItems();\n $eligibleProducts = [];\n $discount = 0;\n foreach ($items as $item) {\n array_push($quote_product_ids, $item->getProductId());\n }\n foreach ($userBundleCollection as $bundle) {\n //First Bundle products\n $bundle_product_ids = explode(',', $bundle->getProductIds()); \n $productsIds = array_intersect($quote_product_ids, $bundle_product_ids);\n if(count($productsIds) == count($bundle_product_ids) )\n $discount += $bundle->getDiscountPrice();\n }\n\n if($discount > 0){\n $quote=$observer->getEvent()->getQuote();\n $quoteid=$quote->getId();\n $discountAmount=$discount;\n if($quoteid) { \n if($discountAmount>0) {\n $total=$quote->getBaseSubtotal();\n $quote->setSubtotal(0);\n $quote->setBaseSubtotal(0);\n\n $quote->setSubtotalWithDiscount(0);\n $quote->setBaseSubtotalWithDiscount(0);\n\n $quote->setGrandTotal(0);\n $quote->setBaseGrandTotal(0);\n \n\n $canAddItems = $quote->isVirtual()? ('billing') : ('shipping'); \n foreach ($quote->getAllAddresses() as $address) {\n\n $address->setSubtotal(0);\n $address->setBaseSubtotal(0);\n\n $address->setGrandTotal(0);\n $address->setBaseGrandTotal(0);\n\n $address->collectTotals();\n\n $quote->setSubtotal((float) $quote->getSubtotal() + $address->getSubtotal());\n $quote->setBaseSubtotal((float) $quote->getBaseSubtotal() + $address->getBaseSubtotal());\n\n $quote->setSubtotalWithDiscount(\n (float) $quote->getSubtotalWithDiscount() + $address->getSubtotalWithDiscount()\n );\n $quote->setBaseSubtotalWithDiscount(\n (float) $quote->getBaseSubtotalWithDiscount() + $address->getBaseSubtotalWithDiscount()\n );\n\n $quote->setGrandTotal((float) $quote->getGrandTotal() + $address->getGrandTotal());\n $quote->setBaseGrandTotal((float) $quote->getBaseGrandTotal() + $address->getBaseGrandTotal());\n\n $quote ->save(); \n\n $quote->setGrandTotal($quote->getBaseSubtotal()-$discountAmount)\n ->setBaseGrandTotal($quote->getBaseSubtotal()-$discountAmount)\n ->setSubtotalWithDiscount($quote->getBaseSubtotal()-$discountAmount)\n ->setBaseSubtotalWithDiscount($quote->getBaseSubtotal()-$discountAmount)\n ->save(); \n\n\n if($address->getAddressType()==$canAddItems) {\n //echo $address->setDiscountAmount; exit;\n $address->setSubtotalWithDiscount((float) $address->getSubtotalWithDiscount()-$discountAmount);\n $address->setGrandTotal((float) $address->getGrandTotal()-$discountAmount);\n $address->setBaseSubtotalWithDiscount((float) $address->getBaseSubtotalWithDiscount()-$discountAmount);\n $address->setBaseGrandTotal((float) $address->getBaseGrandTotal()-$discountAmount);\n if($address->getDiscountDescription()){\n $address->setDiscountAmount(-($address->getDiscountAmount()-$discountAmount));\n $address->setDiscountDescription($address->getDiscountDescription().', Custom Discount');\n $address->setBaseDiscountAmount(-($address->getBaseDiscountAmount()-$discountAmount));\n }else {\n $address->setDiscountAmount(-($discountAmount));\n $address->setDiscountDescription('Custom Discount');\n $address->setBaseDiscountAmount(-($discountAmount));\n }\n $address->save();\n }//end: if\n } //end: foreach\n //echo $quote->getGrandTotal();\n\n foreach($quote->getAllItems() as $item){\n //We apply discount amount based on the ratio between the GrandTotal and the RowTotal\n $rat=$item->getPriceInclTax()/$total;\n $ratdisc=$discountAmount*$rat;\n $item->setDiscountAmount(($item->getDiscountAmount()+$ratdisc) * $item->getQty());\n $item->setBaseDiscountAmount(($item->getBaseDiscountAmount()+$ratdisc) * $item->getQty())->save(); \n }\n } \n }\n }\n }\n catch(Exception $e)\n {\n Mage::log(\"Remove from cart tracking - \" . $e->getMessage(), null, 'Increasingly_Analytics.log');\n }\n\n }", "public function getActiveCartSignInMode();", "public function is_single_use() {\n\n\t\t$single_use = true;\n\n\t\tif ( $this->get_gateway()->get_plugin()->is_pre_orders_active() && \\WC_Pre_Orders_Cart::cart_contains_pre_order() && \\WC_Pre_Orders_Product::product_is_charged_upon_release( \\WC_Pre_Orders_Cart::get_pre_order_product() ) ) {\n\t\t\t$single_use = false;\n\t\t}\n\n\t\tif ( $this->get_gateway()->get_plugin()->is_subscriptions_active() && ( \\WC_Subscriptions_Cart::cart_contains_subscription() || wcs_cart_contains_renewal() ) ) {\n\t\t\t$single_use = false;\n\t\t}\n\n\t\treturn $single_use;\n\t}", "static public function get_shipping_exist( $order ){\n\n \t\t$version = toret_check_wc_version();\n\n \tif( $version === false ){\n\n \tif( (int)$order->order_shipping > 0 ){\n\n \t\treturn true;\n\n \t}\n \n \t}else{\n\n\t $shippings = $order->get_items( 'shipping' );\n\t\t\t\t\n\t\t\t\tif( !empty( $shippings ) ){\n\n\t\t\t\t\treturn true;\n\t\t\t\t} \t\n\n \t}\n\n \treturn false;\n\n \t}", "function add_item_to_cart( $prodId = null ) {\n if ( null != $prodId && is_numeric( $prodId ) ) {\n\n // Probably should sql check database to see\n // if product exisits.\n\n if( $_SESSION[\"cart\"][$prodId] ) {\n $_SESSION[\"cart\"][$prodId]++;\n }\n else {\n $_SESSION[\"cart\"][$prodId] = 1;\n }\n }\n}", "public function isAddingThisProductToCartASuccess($order_id,$product_id,$quantity_of_purchase,$amount_saved_on_purchase,$prevailing_retail_selling_price,$cobuy_member_selling_price,$start_price_validity_period,$end_price_validity_period,$is_escrowed,$is_escrow_accepted){\n \n $model = new OrderHasProducts;\n return $model->isAddingThisProductToCartASuccess($order_id,$product_id,$quantity_of_purchase,$amount_saved_on_purchase,$prevailing_retail_selling_price,$cobuy_member_selling_price,$start_price_validity_period,$end_price_validity_period,$is_escrowed,$is_escrow_accepted);\n }", "public function getSellerShipping() {\r\n return Mage::getResourceModel ( 'eav/entity_attribute' )->getIdByCode ( 'catalog_product', 'seller_shipping_option' );\r\n }", "function VariationOrProductIsInCart() {\r\n\t\treturn ($this->owner->IsInCart() || $this->VariationIsInCart());\r\n\t}", "public function isValidForDelivery();", "function checkCartForItem($addItem, $cartItems) {\n if (is_array($cartItems) && !(is_null($cartItems)))\n {\n foreach($cartItems as $key => $item) \n {\n if($item['productId'] == $addItem)\n return true;\n }\n }\n return false;\n}", "public function cartExists() {\n\t\t$cart = $this->find('first', array('conditions' => $this->cartConditions(), 'contain' => FALSE));\n\t\treturn !empty($cart);\n\t}", "public function shoppingCarts()\n {\n \t// hasMany(RelatedModel, foreignKeyOnRelatedModel = spsd_id, localKey = spsd_id)\n \treturn $this->hasMany('App\\ShoppingCart','spsd_id','spsd_id');\n }", "public function getCartTotal()\n {\n }", "public function getDeliveryMode();", "public function getShowInCart()\n {\n return $this->_scopeConfig->getValue('splitprice/split_price_presentation/show_cart', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n }", "public function canItemsAddToCart()\n {\n foreach ($this->getItems() as $item) {\n if (!$item->isComposite() && $item->isSaleable() && !$item->getRequiredOptions()) {\n return true;\n }\n }\n return false;\n }", "function is_carton() {\n\treturn ( is_shop() || is_product_category() || is_product_tag() || is_product() ) ? true : false;\n}", "private function isOnepay(){\r\n return $this->getPaymentMethod() == 5;\r\n }", "public function store(Request $request)\n {\n \n $duplicata=Cart::search(function ($cartItem, $rowId) use($request) {\n return $cartItem->id == $request->pid;\n });\n if($duplicata->isNotEmpty()){\n return redirect()->back()->with('success','Sorry the item is already added');\n }\n $product=Product::find($request->pid);\n Cart::add($product->pid,$product->name,1,$product->price)\n ->associate('card/store');\n return redirect('/')->with('success','the product added to card succesfully');\n }", "private function SaveShippingProvider()\n\t{\n\t\tif(isset($_SESSION['CHECKOUT']['CHECKOUT_TYPE']) && $_SESSION['CHECKOUT']['CHECKOUT_TYPE'] == 'express') {\n\t\t\t$redirectOnError = getConfig('ShopPath').'/checkout.php?action=express';\n\t\t}\n\t\telse {\n\t\t\t$redirectOnError = getConfig('ShopPath').'/checkout.php?action=checkout';\n\t\t}\n\n\t\t// If guest checkout is not enabled and the customer isn't signed in then send the customer\n\t\t// back to the beginning of the checkout process.\n\t\tif(!GetConfig('GuestCheckoutEnabled') && !CustomerIsSignedIn()) {\n\t\t\tredirect($redirectOnError);\n\t\t}\n\n\t\t// ensure products are in stock\n\t\t$this->CheckStockLevels();\n\n\t\t// For each shipping address in the order, the shipping provider now needs to be saved\n\t\t$shippingAddresses = $this->getQuote()->getShippingAddresses();\n\t\tforeach($shippingAddresses as $shippingAddress) {\n\t\t\t$shippingAddressId = $shippingAddress->getId();\n\t\t\tif(!isset($_POST['shipping_provider'][$shippingAddressId])) {\n\t\t\t\tredirect($redirectOnError);\n\t\t\t}\n\n\t\t\t$id = $_POST['shipping_provider'][$shippingAddressId];\n\t\t\t$cachedShippingMethod = $shippingAddress->getCachedShippingMethod($id);\n\t\t\t$shippingAddress->removeCachedShippingMethods();\n\t\t\tif(empty($cachedShippingMethod)) {\n\t\t\t\tredirect($redirectOnError);\n\t\t\t}\n\n\t\t\t$shippingAddress->setShippingMethod(\n\t\t\t\t$cachedShippingMethod['price'],\n\t\t\t\t$cachedShippingMethod['description'],\n\t\t\t\t$cachedShippingMethod['module']\n\t\t\t);\n\t\t\t$shippingAddress->setHandlingCost($cachedShippingMethod['handling']);\n\t\t}\n\n\t\t// We've saved the shipping provider - to the next step we go!\n\t\t@ob_end_clean();\n\t\theader(sprintf(\"location: %s/checkout.php?action=confirm_order\", $GLOBALS['ShopPath']));\n\t\tdie();\n\t}" ]
[ "0.6509452", "0.61208415", "0.6107691", "0.6079439", "0.60094595", "0.59797215", "0.59797215", "0.5928547", "0.5877682", "0.58770865", "0.5872198", "0.5865817", "0.5842469", "0.5653713", "0.5563979", "0.55528885", "0.5533078", "0.5516511", "0.55043674", "0.54887885", "0.5486386", "0.54645056", "0.54561645", "0.5446749", "0.54301023", "0.54229623", "0.54201627", "0.5408828", "0.5408596", "0.54057056", "0.540074", "0.5398677", "0.5385708", "0.53853166", "0.5383194", "0.5382208", "0.53799963", "0.53797096", "0.53788143", "0.53670704", "0.5367011", "0.5367011", "0.5367011", "0.5367011", "0.5367011", "0.53653085", "0.53588915", "0.5349402", "0.5348319", "0.5339667", "0.5335799", "0.53348744", "0.5330725", "0.53181714", "0.5315348", "0.5308956", "0.5308141", "0.53080213", "0.5304861", "0.53017664", "0.5301577", "0.5294862", "0.52856684", "0.52837926", "0.5283247", "0.527739", "0.5274121", "0.52714044", "0.5270349", "0.526139", "0.52530116", "0.52510214", "0.5244745", "0.5243432", "0.5243234", "0.5238885", "0.52352124", "0.5234474", "0.5231797", "0.52286965", "0.5221023", "0.5218429", "0.5209793", "0.52023685", "0.51987785", "0.51954645", "0.51943386", "0.5188705", "0.51795304", "0.5175179", "0.5172952", "0.51708674", "0.51701236", "0.5156507", "0.51548797", "0.5151879", "0.5149941", "0.514854", "0.5145838", "0.5141831" ]
0.5332311
52
Shopping Cart has 1 Delivery Option of the Service
public function deliveryOption() { return $this->belongsTo(DeliveryOption::class); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCartable();", "public function getPriceDelivery()\n {\n return $this->priceDelivery;\n }", "public function hasActiveCart();", "public function isMultiAddressDelivery(){\n static $cache = null;\n\n if (is_null($cache)) {\n $db = JFactory::getDBO();\n\n $query = \"SELECT count(distinct address_delivery_id) FROM \" . $db->quoteName('#__jeproshop_cart_product');\n $query .= \" AS cart_product WHERE cart_product.cart_id = \" . (int)$this->cart_id;\n\n $db->setQuery($query);\n $cache = (bool)($db->loadResult() > 1);\n }\n return $cache;\n }", "public function hasShoporder(){\n return $this->_has(27);\n }", "public function getDeliveryMode()\n {\n }", "public function isGoodsInShopcart()\n\t{\n\t\treturn !!$this->count();\n\t}", "public function getDeliveryOrder();", "public function getShippingInvoiced();", "public function isMultishippingCheckoutAvailable(){\n $multishippingFlag = parent::isMultishippingCheckoutAvailable();\n if(Mage::getSingleton('mysubscription/cart')->getMsquote()->hasItems()){\n return false;\n }\n return $multishippingFlag;\n }", "public function getDeliveryMode();", "public function isEnabledCart()\n {\n return $this->isEnabled() && Mage::getStoreConfig(self::GENE_BRAINTREE_APPLEPAY_EXPRESS_CART);\n }", "function VariationIsInCart() {\r\n\t\t$variations = $this->owner->Variations();\r\n\t\tif($variations) {\r\n\t\t\tforeach($variations as $variation) {\r\n\t\t\t\tif($variation->OrderItem() && $variation->OrderItem()->Quantity > 0) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function getActiveCart();", "public function isValidForDelivery();", "function item_quantities_none() {\r\n //if( isset($edd_options['coopshares_fair_checkout_info']) ) {\r\n // return true;\r\n //} else {\r\n return false;\r\n //}\r\n}", "public function getCart();", "public function getCartShippingMethod()\n {\n }", "private function check_cart() {\n $users_id = $this->session->userdata('id');\n if ($users_id) {\n // User connected > DB\n $this->data['deals'] = $this->users_cart->getForUser($users_id);\n } else {\n // Guest > Session\n $deals = $this->session->userdata('cart');\n if ($deals) {\n $this->data['deals'] = $this->deals->getDeals(false, false, false, false, false, false, $deals);\n } else {\n $this->data['deals'] = array();\n }\n }\n }", "function getfaircoin_only_one_item_on_cart($download_id) {\r\n //echo 'CART CONTENTS: ';\r\n //print_r($cart_contents);\r\n //$cart_contents = edd_get_cart_contents();\r\n //if($cart_contents) return false;\r\n //else return $download_id;\r\n edd_empty_cart();\r\n}", "public function getDeliveryMode(): int\n {\n }", "function is_added_to_cart($product_id, $set = '', $op = '')\n {\n $carted = $this->cart->contents();\n //var_dump($carted);\n if (count($carted) > 0) {\n foreach ($carted as $items) {\n if ($items['id'] == $product_id) {\n\n if ($set == '') {\n return true;\n } else {\n if($set == 'option'){\n $option = json_decode($items[$set],true);\n return $option[$op]['value'];\n } else {\n return $items[$set];\n }\n }\n }\n }\n } else {\n return false;\n }\n }", "public function deliveryPriceDhaka()\n {\n }", "public function isAutoShipping(): bool;", "public function quoteHasServiceProduct()\n {\n $quote = Mage::getSingleton('checkout/session')->getQuote();\n if (!$quote->hasData('has_service_product')) {\n $quote->setData('has_service_product', false);\n foreach ($quote->getAllVisibleItems() as $item) {\n if ($this->isQuoteItemServiceProduct($item)) {\n $quote->setData('has_service_product', true);\n break;\n }\n }\n }\n\n return $quote->getData('has_service_product');\n }", "function is_added_to_cart($product_id, $set = '', $op = '')\n {\n $carted = $this->cart->contents();\n //var_dump($carted);\n if (count($carted) > 0) {\n foreach ($carted as $items) {\n if ($items['id'] == $product_id) {\n \n if ($set == '') {\n return true;\n } else {\n if($set == 'option'){\n $option = json_decode($items[$set],true);\n return $option[$op]['value'];\n } else {\n return $items[$set];\n }\n }\n }\n }\n } else {\n return false;\n }\n }", "public function hasPrice(){\n return $this->_has(12);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "function checkdelivery($package) {\n\n\t$item = $package['item'];\t\n\t$quantity = $package['quantity'];\t\n\t$to = $package['to'];\t\n\t$from = $package['from'];\t\n\n// Based on the location of the delivery address and \n// the warehouse the courier can decide if they can \n// make the delivery. If yes, they could then let the \n// warehouse know the cost and delivery date.\n\n\t$accepted = 1;\n\n\tif ( $accepted )\n\t{\n\t\t$cost = 10;\n\t\t$date = '12-05-2004';\n\n\t\t$output = array(\n\t\t\t\t\t'accepted' => $accepted,\n\t\t\t\t\t'cost' => $cost,\n\t\t\t\t\t'date' => $date\n\t\t\t\t\t);\n\t} else {\n\t\t$output = array(\n\t\t\t\t\t'accepted' => $accepted,\n\t\t\t\t\t'cost' => 0,\n\t\t\t\t\t'date' => 'null'\n\t\t\t\t\t);\n\t}\n\n return new soapval('return', 'DeliveryDetail', $output, false, 'urn:MyURN');\n}", "public function HasCart() {\n\tif ($this->IsNew()) {\n\t return FALSE;\n\t} else {\n\t return (!is_null($this->GetCartID()));\n\t}\n }", "public function hasQuantity(): bool;", "private function checkCartStatus()\n {\n if ($this->quote->getIsActive()=='0') {\n $this->getMagentoOrderId();\n throw new \\Exception(self::CMOS_ALREADY_PROCESSED);\n }\n }", "public function cart_no_shipping()\n\t{\n\n\t\t// get the store cart cookie\n\t\t$cookie = ee()->input->cookie('store_cart');\n\n\t\t// if the cookie has a value\n\t\tif ($cookie) {\n\n\t\t\t// query for the items in the order\n\t\t\t$query = ee()->db\n\t\t\t\t->select('sku, exp_store_order_items.url_title, weight, height, width, length, field_id_26 as container')\n\t \t->where('order_hash', $cookie)\n\t \t->join('store_orders', 'exp_store_orders.id = exp_store_order_items.order_id')\n\t \t->join('channel_data', 'exp_channel_data.entry_id = exp_store_order_items.entry_id')\n\t \t->get('store_order_items');\n\n\t // default the values\n\t $vars['cart_weight'] = 0;\n\t $vars['missing_dimensions'] = 'n';\n\t $vars['container_self'] = 'n';\n\n\t // loop through the cart and update the values\n\t foreach($query->result() as $item)\n\t {\n\t \tif(!empty($item->weight))\n\t \t{\n\t \t\t$vars['cart_weight'] += $item->weight;\n\t \t}\t\n\t \t\n\n\t \tif(!$item->weight || !$item->height || !$item->width || !$item->length)\n\t \t{\n\t \t\t$vars['missing_dimensions'] = 'y';\n\t \t}\n\n\t \tif($item->container == 'Self')\n\t \t{\n\t \t\t$vars['container_self'] = 'y';\n\t \t}\t\n\t }\n\n\t \t// parse the variables into the tagdata\n\t \treturn ee()->TMPL->parse_variables_row(ee()->TMPL->tagdata, $vars);\n\t \t\n } // end of if\n\n\t}", "public function getIsRequiredShipping()\n {\n $model = $this->_coreRegistry->registry('sales_subscription');\n $productId = $model->getSubProductId();\n $product = $this->productRepository->getById($productId);\n $productTypes = ['virtual', 'downloadable'];\n\n if ($product) {\n $productType = $product->getTypeId();\n if (!in_array($productType, $productTypes)) {\n return true;\n }\n }\n return false;\n }", "static public function get_shipping_exist( $order ){\n\n \t\t$version = toret_check_wc_version();\n\n \tif( $version === false ){\n\n \tif( (int)$order->order_shipping > 0 ){\n\n \t\treturn true;\n\n \t}\n \n \t}else{\n\n\t $shippings = $order->get_items( 'shipping' );\n\t\t\t\t\n\t\t\t\tif( !empty( $shippings ) ){\n\n\t\t\t\t\treturn true;\n\t\t\t\t} \t\n\n \t}\n\n \treturn false;\n\n \t}", "function VariationOrProductIsInCart() {\r\n\t\treturn ($this->owner->IsInCart() || $this->VariationIsInCart());\r\n\t}", "public function deliveryPriceOutDhaka()\n {\n }", "public static function promotion_check_delivery(\\Blink\\Request $request) {\n $delivery_method = $request->cookie->find(\"delivery_method\");\n \n if(!$request->cookie->is_set(\"delivery_method\")) {\n return false;\n }\n \n if($delivery_method == \"email\") {\n $count = 0;\n for($i = 1; $i <= Config::$NotLoggedInMaxEmailCount; $i++) {\n if($request->cookie->is_set(\"email_email$i\")) {\n $count++;\n }\n }\n if(!$count) {\n return false;\n }\n } else if($delivery_method == \"facebook\") {\n if(!$request->cookie->is_set(\"facebook_ids\")) {\n return false;\n }\n }\n \n return true;\n }", "public function getDelivery()\n {\n return $this->delivery;\n }", "private function addToCart () {\n }", "private function addToCart () {\n }", "public function deliveryService() {\n return $this->belongsTo(DeliveryService::class);\n }", "function changeProduct($cart_table_id,$true_or_false)\n {\n $this->pdelivery[$cart_table_id]=$true_or_false; //change product group delivery\n }", "public function canItemsAddToCart()\n {\n foreach ($this->getItems() as $item) {\n if (!$item->isComposite() && $item->isSaleable() && !$item->getRequiredOptions()) {\n return true;\n }\n }\n return false;\n }", "public function markCartsAdditionalProducts(Order $draftOrder): bool;", "public function getCartShippingMethodID()\n {\n }", "public function hasShippingOptions()\n {\n $product = $this->getProduct();\n return strlen($product->getMdlShipments());\n }", "public function getShowCartInPayPal()\n {\n return $this->_blShowCartInPayPal;\n }", "public function getIdDelivery()\n {\n return $this->idDelivery;\n }", "public function getActiveCartProducts();", "function harvest_in_order( $order ) {\n\n\t$items = $order->get_items(); \n\n\tforeach ( $items as $item_id => $item ) {\n\n\t\tif ( $item->get_product_id() === 37592 ) {\n\t\t\t\n\t\t\treturn true;\n\t\t\t\n\t\t}\n\n\t}\n\t\n\treturn false;\n\n}", "function getShippingChoicesList() {\n\t\tApp::import('Model', 'CartsProduct');\n\t\t$this->CartsProduct = &new CartsProduct;\n\t\t$cart_stats = $this->CartsProduct->getStats($this->CartsProduct->Cart->get_id());\n\n\t\t// pokud nesplnuju podminky pro dopravy doporucenym psanim, zakazu si tyto zpusoby dopravy vykreslit zakaznikovi\n\t\t$conditions = array();\n\t\tif (!$this->isRecommendedLetterPossible()) {\n\t\t\t$conditions = array('Shipping.id NOT IN (' . implode(',', $this->Shipping->getRecommendedLetterShippingIds()) . ')');\n\t\t}\n\n\t\t$shipping_choices = $this->Shipping->find('all', array(\n\t\t\t'conditions' => $conditions,\n\t\t\t'contain' => array(),\n\t\t\t'fields' => array('id', 'name', 'price', 'free'),\n\t\t\t'order' => array('Shipping.order' => 'asc')\n\t\t));\n\t\t\n\t\t// pokud mam v kosiku produkty, definovane v Cart->free_shipping_products v dostatecnem mnozstvi, je doprava zdarma\n\t\tApp::import('Model', 'Cart');\n\t\t$this->Cart = &new Cart;\n\t\tif ($this->Cart->isFreeShipping()) {\n\t\t\t// udelam to tak, ze nastavim hodnotu kosiku na strasne moc a tim padem budu mit v kosiku vzdycky vic, nez je\n\t\t\t// minimalni hodnota kosiku pro dopravu zdarma\n\t\t\t$cart_stats['total_price'] = 99999;\n\t\t}\n\n\t\t// v selectu chci mit, kolik stoji doprava\n\t\tforeach ($shipping_choices as $shipping_choice) {\n\t\t\t$shipping_item = $shipping_choice['Shipping']['name'] . ' - ' . $shipping_choice['Shipping']['price'] . ' Kč';\n\t\t\tif ($cart_stats['total_price'] > $shipping_choice['Shipping']['free']) {\n\t\t\t\t$shipping_item = $shipping_choice['Shipping']['name'] . ' - zdarma';\n\t\t\t}\n\t\t\t$shipping_choices_list[$shipping_choice['Shipping']['id']] = $shipping_item;\n\t\t}\n\t\t\n\t\treturn $shipping_choices_list;\n\t}", "abstract public function checkAvailability(VAPCartItem $item, array $service);", "protected function shouldAddShippingInformation(): bool\r\n {\r\n if (DocumentTypes::requiresDelivery($this->documentType)) {\r\n return true;\r\n }\r\n\r\n return $this->useShipping === Boolean::YES;\r\n }", "protected abstract function isSingleProduct();", "public function cartExists() {\n\t\t$cart = $this->find('first', array('conditions' => $this->cartConditions(), 'contain' => FALSE));\n\t\treturn !empty($cart);\n\t}", "public function getDeliveryIncluded()\n {\n return $this->deliveryIncluded;\n }", "private function checkOrderSent(OrderInterface $commerce_order): bool {\n $order = new OrderController($commerce_order);\n /** @var User $proveedor */\n $proveedor = User::load($this->account->id());\n $enviado = TRUE;\n foreach ($order->getOrderItemsProvider($proveedor) as $line) {\n if ($line->get('field_estado')->value != 'enviado') {\n $enviado = FALSE;\n break;\n }\n }\n return $enviado;\n }", "public function getDeliveryMode() {\n return $this->delivery_mode;\n }", "public function isAddingThisProductToCartASuccess($order_id,$product_id,$quantity_of_purchase,$amount_saved_on_purchase,$prevailing_retail_selling_price,$cobuy_member_selling_price,$start_price_validity_period,$end_price_validity_period,$is_escrowed,$is_escrow_accepted){\n \n $model = new OrderHasProducts;\n return $model->isAddingThisProductToCartASuccess($order_id,$product_id,$quantity_of_purchase,$amount_saved_on_purchase,$prevailing_retail_selling_price,$cobuy_member_selling_price,$start_price_validity_period,$end_price_validity_period,$is_escrowed,$is_escrow_accepted);\n }", "public function isCollection()\n {\n if (Checkout::config()->click_and_collect) {\n $type = Session::get(\"Checkout.Delivery\");\n \n return ($type == \"collect\") ? true : false;\n } else {\n return false;\n }\n }", "public function getShowInCart()\n {\n return Mage::getStoreConfig('splitprice/split_price_presentation/show_cart');\n }", "public function check_cart_has_digital_product()\n {\n $cart_items = $this->session_cart_items;\n if (!empty($cart_items)) {\n foreach ($cart_items as $cart_item) {\n if ($cart_item->product_type == 'digital') {\n return true;\n }\n }\n }\n return false;\n }", "public function isDelivered() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn InputValidator::isEmpty($this->deliveryDate) ? false: true;\r\n\t}", "private function isServipag(){\r\n return $this->getPaymentMethod() == 2;\r\n }", "public function hasActdiscount(){\n return $this->_has(34);\n }", "public function getCartProduct(){\n $sId = session_id();\n $squery = \"SELECT * FROM tbl_cart WHERE sId='$sId'\";\n $result = $this->db->select($squery);\n if ($result) {\n return $result;\n }else {\n return false;\n }\n }", "public function isApplicable() : bool{\r\n $items = $this->order->getOrderItems();\r\n foreach($items as $item){\r\n // checks every item for order if the quantity is >= $products_nr\r\n if($item[\"quantity\"] >= $this->products_nr){\r\n $tmp_item = $this->order->getProductById($item[\"product-id\"]);\r\n\r\n // checks if product category equals $category_id \r\n if((int)$tmp_item[\"category\"] === $this->category_id){\r\n $tmp_item[\"qty\"] = $item[\"quantity\"];\r\n\r\n // saves the discounted items in a temporary array\r\n $this->items_matching[] = $tmp_item;\r\n\r\n // stores the total cost of the discount\r\n $this->discounted_value += $tmp_item[\"price\"] * floor($item[\"quantity\"] / $this->products_nr);\r\n }\r\n }\r\n }\r\n\r\n if($this->discounted_value > 0){\r\n $this->is_applicable = true;\r\n $this->calculateDiscount();\r\n return true; \r\n }\r\n return false;\r\n }", "public function hasPrice(){\n return $this->_has(5);\n }", "public function isCheckoutAvailable()\n {\n return Mage::helper('checkout')->isMultishippingCheckoutAvailable();\n }", "public function verifyShippingDisponibility() {\n\n $return = array();\n $items = Mage::getSingleton('checkout/session')->getQuote()->getAllItems();\n $PackageWeight = 0;\n foreach ($items as $item) {\n if (($item->getProductType() == \"configurable\") || ($item->getProductType() == \"grouped\")) {\n $PackageWeight += ($item->getWeight() * (((int) $item->getQty()) - 1));\n } else {\n $PackageWeight += ($item->getWeight() * ((int) $item->getQty()));\n }\n }\n\n $customerAdressCountryCode = $this->getCustomerCountry();\n //verify destination country\n $keyOdExpressDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod1);\n $keyOdMessagerieDestinationCountry = array_search($customerAdressCountryCode, $this->geodisDestinationCountryMethod2);\n\n\n if ($keyOdExpressDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_1] = 0;\n }\n\n if ($keyOdMessagerieDestinationCountry && ($PackageWeight < self::FRANCEEXPRESS_POIDS_MAX)) {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 1;\n } else {\n $return['s_method_franceexpress_ondemandlogo_' . self::FRANCEEXPRESS_METHOD_2] = 0;\n }\n\n return $return;\n }", "function getTotalPrice(){\n \treturn $this->myCart->total();\n }", "public function isDeliverable()\n {\n $deliverable = false;\n\n foreach ($this->getItems() as $item) {\n if ($item->Deliverable) {\n $deliverable = true;\n }\n }\n\n return $deliverable;\n }", "public function add($product) {\n $ajout = false;\n if ($this->products_id) {\n if (array_key_exists($product->id,$this->products_id)) {\n if ($product->quantity >= $this->products_id[\"$product->id\"]++){\n $this->products_id[\"$product->id\"]++;\n $ajout = true;\n }\n }else {\n if($product->quantity >= 1){\n $this->products_id += [\"$product->id\"=>1];\n $ajout = true;\n }\n }\n }else {\n if($product->quantity >= 1){\n $this->products_id = [\"$product->id\"=>1];\n $ajout = true;\n }\n }\n if($ajout){\n $this->total_product ++;\n if($this->discountisused){\n $this->total_price += ($product->price - $product->price * $this->discounts[$this->discountused]/100);\n $this->discountamount += $product->price*$this->discounts[$this->discountused]/100;\n }\n\n else\n $this->total_price += $product->price;\n }\n}", "public function canStoreOrder();", "private function getAlreadyPurchasedProduct()\n {\n // If is Guest then hide the review form\n if (!$this->getCustomerId()) {\n return false;\n }\n try {\n $product = $this->getProductInfo();\n $orders = $this->getCustomerOrders();\n foreach ($orders as $order) {\n // Get all visible items in the order\n /** @var $items \\Magento\\Sales\\Api\\Data\\OrderItemInterface[] **/\n $items = $order->getAllVisibleItems();\n // Loop all items\n foreach ($items as $item) {\n // Check whether the current product exist in the order.\n if ($item->getProductId() == $product->getId()) {\n return true;\n }\n }\n }\n return false;\n } catch (\\Exception $e) {\n return false;\n }\n }", "public function isAllowInCart() {\n return !$this->isEnabled();\n }", "public function markCartsProductsAsFirst(Order $draftOrder): bool;", "function getDeliveryCharges($product_id = null, $seller_id = null, $condition_id = null) {\n\t\tif(empty($product_id) && is_null($seller_id) ){\n\t\t}\n\t\tApp::import('Model','ProductSeller');\n\t\t$this->ProductSeller = & new ProductSeller();\n\t\t$prodSellerInfo = $this->ProductSeller->find('first', array('conditions'=>array('ProductSeller.product_id'=>$product_id ,'ProductSeller.seller_id'=>$seller_id , 'ProductSeller.condition_id'=>$condition_id ),'fields'=>array('ProductSeller.standard_delivery_price')));\n\t\t//pr($prodSellerInfo);\n\t\tif(is_array($prodSellerInfo)){\n\t\t\treturn $prodSellerInfo['ProductSeller']['standard_delivery_price'];\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function isIncludedInPrice();", "function check_cart_item_stock() {\n\t\t\t$error = new WP_Error();\n\t\t\tforeach ($this->cart_contents as $cart_item_key => $values) :\n\t\t\t\t$_deals = $values['data'];\n\t\t\t\tif ($_deals->managing_stock()) :\n\t\t\t\t\tif ($_deals->is_in_stock() && $_deals->has_enough_stock( $values['quantity'] )) :\n\t\t\t\t\t\t// :)\n\t\t\t\t\telse :\n\t\t\t\t\t\t$error->add( 'out-of-stock', sprintf(__('Sorry, we do not have enough \"%s\" in stock to fulfill your order (%s in stock). Please edit your cart and try again. We apologise for any inconvenience caused.', 'cmdeals'), $_deals->get_title(), $_deals->_stock ) );\n\t\t\t\t\t\treturn $error;\n\t\t\t\t\tendif;\n\t\t\t\tendif;\n\t\t\tendforeach;\n\t\t\treturn true;\n\t\t}", "public function getCartTotal()\n {\n }", "public function getProductOption();", "public function isExpressCheckout(): bool\n {\n return false;\n }", "function add_to_cart( $deal_id, $quantity = 1, $variation_id = '', $variation = '' ) {\n\t\t\tglobal $cmdeals;\n\t\t\t\n\t\t\tif ($quantity < 1) return false;\n\t\t\t\n\t\t\t// Load cart item data - may be added by other plugins\n\t\t\t$cart_item_data = (array) apply_filters('cmdeals_add_cart_item_data', array(), $deal_id);\n\t\t\t\n\t\t\t// Generate a ID based on deals ID, variation ID, variation data, and other cart item data\n\t\t\t$cart_id = $this->generate_cart_id( $deal_id, $variation_id, $variation, $cart_item_data );\n\t\t\t\n\t\t\t// See if this deals and its options is already in the cart\n\t\t\t$cart_item_key = $this->find_deals_in_cart($cart_id);\n\t\t\t\n\t\t\tif ($variation_id>0) :\n\t\t\t\t$deal_data = new cmdeals_deals_variation( $variation_id );\n\t\t\telse :\n\t\t\t\t$deal_data = new cmdeals_deals( $deal_id );\n\t\t\tendif;\n\t\t\t\n\t\t\t// Type/Exists check\n\t\t\tif ( $deal_data->is_type('external') || !$deal_data->exists() ) :\n\t\t\t\t$cmdeals->add_error( __('This deals cannot be purchased.', 'cmdeals') );\n\t\t\t\treturn false; \n\t\t\tendif;\n\t\t\t\n\t\t\t// Price set check\n\t\t\tif( $deal_data->get_price() === '' ) :\n\t\t\t\t$cmdeals->add_error( __('This deals cannot be purchased - the price is not yet set.', 'cmdeals') );\n\t\t\t\treturn false; \n\t\t\tendif;\n\t\n\t\t\t// Stock check - only check if we're managing stock and backsales are not allowed\n\t\t\tif ( !$deal_data->has_enough_stock( $quantity ) ) :\n\t\t\t\t$cmdeals->add_error( sprintf(__('You cannot add that amount to the cart since there is not enough stock. We have %s in stock.', 'cmdeals'), $deal_data->get_stock_quantity() ));\n\t\t\t\treturn false; \n\t\t\telseif ( !$deal_data->is_in_stock() ) :\n\t\t\t\t$cmdeals->add_error( __('You cannot add that deals to the cart since the deals is out of stock.', 'cmdeals') );\n\t\t\t\treturn false;\n\t\t\tendif;\n\t\t\t\n\t\t\tif ($cart_item_key) :\n\t\n\t\t\t\t$quantity = $quantity + $this->cart_contents[$cart_item_key]['quantity'];\n\t\t\t\t\n\t\t\t\t// Stock check - this time accounting for whats already in-cart\n\t\t\t\tif ( !$deal_data->has_enough_stock( $quantity ) ) :\n\t\t\t\t\t$cmdeals->add_error( sprintf(__('You cannot add that amount to the cart since there is not enough stock. We have %s in stock and you already have %s in your cart.', 'cmdeals'), $deal_data->get_stock_quantity(), $this->cart_contents[$cart_item_key]['quantity'] ));\n\t\t\t\t\treturn false; \n\t\t\t\telseif ( !$deal_data->is_in_stock() ) :\n\t\t\t\t\t$cmdeals->add_error( __('You cannot add that deals to the cart since the deals is out of stock.', 'cmdeals') );\n\t\t\t\t\treturn false;\n\t\t\t\tendif;\n\t\n\t\t\t\t$this->cart_contents[$cart_item_key]['quantity'] = $quantity;\n\t\n\t\t\telse :\n\t\t\t\t\n\t\t\t\t// Add item after merging with $cart_item_data - hook to allow plugins to modify cart item\n\t\t\t\t$this->cart_contents[$cart_id] = apply_filters('cmdeals_add_cart_item', array_merge( $cart_item_data, array(\n\t\t\t\t\t'deal_id'\t=> $deal_id,\n\t\t\t\t\t'variation_id'\t=> $variation_id,\n\t\t\t\t\t'variation' \t=> $variation,\n\t\t\t\t\t'quantity' \t\t=> $quantity,\n\t\t\t\t\t'data'\t\t\t=> $deal_data\n\t\t\t\t)));\n\t\t\t\n\t\t\tendif;\n\t\n\t\t\t$this->set_session();\n\t\t\t\n\t\t\treturn true;\n\t\t}", "public function process(){\n\t$payment_mode = $this->input->post('paymentmethod');\n /**********************************************************************************/\n $delivery_req = $this->input->post('delivery_req');\n\t$final_amount_post = $this->cart->total(); \n\t$shipping_charges_post = $this->input->post('shipping_charges');\n if($shipping_charges_post>0){\n $shipping_charges=abs($shipping_charges_post);\n $final_amount_post=abs($final_amount_post);\n $final_amount=$final_amount_post+$shipping_charges;\n }else{\n $shipping_charges=0;\n $final_amount=abs($final_amount_post);\n }\n\t$cod_charges = 0;//$this->input->post('cod_charges');\n $shipping_address_id = $this->input->post('shipping_address_id');\n\t$user_id = $this->session->userdata('customer_id');\n\t$user_info = $this->Customer_model->getCustomerDetails($user_id);\n\t$cart_id = $this->input->post('cart_id'); \n\t\t$agree_terms = $this->input->post('agree_terms');\n if(isset($agree_terms)&&$agree_terms=='yes'){\n $agree_terms_value='yes';\n }else{\n $agree_terms_value='no'; \n }\n $mobile_number=$user_info->mobile;\n\t$cart_items = $this->Cart_model->getCartItems($cart_id);\n \n if(($user_id=='')||($user_id<1)){\n $this->session->set_flashdata('message', 'You has been logout.Please login again!');\n redirect(base_url('login'));\n }\n \n if((count($cart_items)=='')||(count($cart_items)<1)){\n $this->session->set_flashdata('message', 'Your cart is empty.Please Add product in the cart.');\n redirect(base_url('cart'));\n }\n \n //echo count($cart_items).'------';die;\n \n // check if added item is exist in cmspricelist table \n $cartinfo = $this->Cart_model->getCustomerCart($user_id);\n $cart_items = $this->Cart_model->getCartItems($cartinfo->id); \n foreach ($cart_items as $items){\n $itemid = $items->product_id; \n $pricelist_count = $this->Cart_model->getpriclistItems($itemid);\n if(($pricelist_count=='')||($pricelist_count<1)){\n $this->session->set_flashdata('message', 'There is some problem in product you have added to cart.Please delete some product and try again.');\n //redirect(base_url('cart')); \n }\n }\n // Check if payment option is online \n /*1 For cash on delevery, 2 For CCAvenue, 3 For Paytm, 4 for payyoumoney*/ \n if($payment_mode==3){\n //paytm\n $this->session->set_flashdata('message', 'Paytm is not activated now.Please select Online Payment option now.');\n redirect('/cart'); die;\n $this->load->helper('paytm_helper'); \n $paytm=$this->config->item('paytm');\n $checkSum = \"\";\n $paramList = array();\n // Create an array having all required parameters for creating checksum.\n $paramList[\"MID\"] = $paytm['PAYTM_MERCHANT_MID'];\n $paramList[\"ORDER_ID\"] = $order_no;\n $paramList[\"CUST_ID\"] = $user_id;\n $paramList[\"INDUSTRY_TYPE_ID\"] = 'Retail';//$INDUSTRY_TYPE_ID;\n $paramList[\"CHANNEL_ID\"] = 'WEB';//$CHANNEL_ID;\n $paramList[\"TXN_AMOUNT\"] = $final_amount;\n $paramList[\"WEBSITE\"] = $paytm['PAYTM_MERCHANT_WEBSITE'];\n $checkSum = getChecksumFromArray($paramList,$paytm['PAYTM_MERCHANT_KEY']);\n $paramList[\"CHECKSUMHASH\"]=$checkSum;\n $data[\"PAYTM_TXN_URL\"]=$paytm['PAYTM_TXN_URL'];\n $data[\"parameters\"]=$paramList;\n $this->load->view('cart/processpaytm',$data);\n }elseif($payment_mode==4){\n\t\t\t/*PayuMoney start*/\n\t\t\t$postdata = $_POST;\n$msg = '';\nif (isset($postdata ['key'])) {\n\t$key\t\t\t\t= $postdata['key'];\n\t$salt\t\t\t\t= $postdata['salt'];\n\t$txnid \t\t\t\t= \t$postdata['txnid'];\n\t$order_no \t\t\t= \t$postdata['order_no'];\n\t$amount \t\t= \t$postdata['amount'];\n\t$productInfo \t\t= \t$postdata['productinfo'];\n\t$firstname \t\t= \t$postdata['firstname'];\n\t$email \t\t=\t$postdata['email'];\n\t$udf5\t\t\t\t= $postdata['udf5'];\n\t$mihpayid\t\t\t=\t$postdata['mihpayid'];\n\t$status\t\t\t\t= \t$postdata['status'];\n\t$resphash\t\t\t\t= \t$postdata['hash'];\n\t//Calculate response hash to verify\t\n\t$keyString \t \t\t= \t$key.'|'.$txnid.'|'.$amount.'|'.$productInfo.'|'.$firstname.'|'.$email.'|||||'.$udf5.'|||||';\n\t$keyArray \t \t\t= \texplode(\"|\",$keyString);\n\t$reverseKeyArray \t= \tarray_reverse($keyArray);\n\t$reverseKeyString\t=\timplode(\"|\",$reverseKeyArray);\n\t$CalcHashString \t= \tstrtolower(hash('sha512', $salt.'|'.$status.'|'.$reverseKeyString));\n\t\n\t\n\tif ($status == 'success' && $resphash == $CalcHashString) {\n\t\t$msg = \"Transaction Successful and Hash Verified...\";\n\t\t//Do success order processing here...\n\t\t\n\t\t//order status Coplete/success\n\t$orderstatus=1;\n\t\n\t$paymentstatus=1;\n\t}\n\telse {\n\t\t//tampered or failed\n\t\t$msg = \"Payment failed for Hash not verified...\";\n\t\t//order status cancelled\n\t$orderstatus=2;\n\t$paymentstatus=0;\n\t} \n\t$order_id=$txnid;\t\n\t$order_no=$order_no;\n\t$order_no=$order_no;\n\t$txn_number=$mihpayid;\n\t$order = $this->Customer_model->updateOrder($order_id,$order_no,$paymentstatus,$txn_number,$orderstatus);\n $this->Cart_model->removeCart($cart_id,$user_id);\n $this->cart->destroy();\n\t \n $this->session->set_flashdata('message', $msg);\n redirect('/cart'); \n}\n\t\t\t/*PayuMoney End*/\n\t\t}elseif($payment_mode==2){\n\t\t\t/*CCAvenue for web start*/\n $this->session->set_userdata('cart_id',$cart_id); \n $order=$this->Customer_model->addOrder($user_id,$payment_mode,$final_amount,$shipping_charges,$cod_charges,$shipping_address_id,$agree_terms_value);\n $order_id=$order['order_id'];\n $order_no=$order['order_no'];\n //CCAVENUE\n $shipping_address= $this->Customer_model->getAddressDetail($shipping_address_id); \n $this->config->load('ccavenue');\n $this->load->helper('ccavenue');\n $user=$this->Customer_model->getCustomerDetails($user_id);\n $this->data['action']=$this->config->item('action');\n $workingkey=$this->config->item('workingkey');\n $checksum = getCheckSum($this->config->item('Merchant_Id'),$final_amount,$order_no ,$this->config->item('Redirect_Url'),$workingkey);\n $form_array=array('Merchant_Id'=>$this->config->item('Merchant_Id'),\n 'Redirect_Url'=>$this->config->item('Redirect_Url'),\n 'Amount'=>$final_amount,\n 'Order_Id'=>$order_no,\n 'Checksum'=>$checksum,\n 'billing_cust_name'=>$shipping_address->address_name,\n 'billing_cust_address'=>$shipping_address->address.' '.$shipping_address->address2,\n 'billing_cust_country'=>'INDIA',\n 'billing_cust_state'=>$shipping_address->state_name,\n 'billing_cust_tel'=>$user->mobile,\n 'billing_cust_email'=>$user->email,\n 'delivery_cust_name'=>$shipping_address->address_name,\n 'delivery_cust_address'=>$shipping_address->address.' '.$shipping_address->address2,\n 'delivery_cust_country'=>'INDIA',\n 'delivery_cust_state'=>$shipping_address->state_name,\n 'delivery_cust_tel'=>$user->mobile,\n 'delivery_cust_notes'=>'',\n 'Merchant_Param'=>$user_id.'_'.$order_id,\n 'billing_cust_city'=>$shipping_address->city_name,\n 'billing_zip_code'=>$shipping_address->zipcode,\n 'delivery_cust_city'=>$shipping_address->city_name,\n 'delivery_zip_code'=>$shipping_address->zipcode);\n $this->data['parameters']=$form_array;\n $this->load->view('cart/processpayment',$this->data);\n }elseif($payment_mode==1){\n\t\t\t $loginFranId = $this->session->userdata('loginFranId');\n //COD\n\t\t\t\t\tif($loginFranId>0){\n\t\t\t\t\t\t//need to add message\n\t\t\t\t\t}else{\n if($this->session->userdata('customer_id')!='71696'){\n //COD Activate for one testing account only\n $this->session->set_flashdata('message', 'This method is not activated now.Please select Online Payment option now.');\n redirect('/cart'); die;\n }\n\t\t\t\t\t}\n \n \n $this->session->set_userdata('cart_id',$cart_id); \n $order=$this->Customer_model->addOrder($user_id,$payment_mode,$final_amount,$shipping_charges,$cod_charges,$shipping_address_id,$agree_terms_value);\n $order_id=$order['order_id'];\n $order_no=$order['order_no'];\n foreach ($this->cart->contents() as $item){\n //$this->Products_model->updateQuantity($item['id'],$item['qty']);\n } \n $this->Customer_model->ediCod_Orderstatus($order_id,1);\n // @TO-DO : add payment mode condition and execute following code for cod.\n $this->Cart_model->removeCart($cart_id,$user_id);\n $this->cart->destroy();\n \n \n $this->sms->send_sms($mobile_number, 'your order No# '. $order_no .' at STUDYADDA is Completed.Please Login to your account to access your products.You can View/Download your product from My Account Section.'); \n $message = 'Dear Sir/Madam,'.'<br>'.'Your Order Was Successfull, Below is your order number for further references.'.'<br>'.'Your Order Number is'.'&nbsp;'.$order_no.'<br>For Technical Support<br>06267349244';\n $subject = 'Order Confirmation-'.$mobile_number;\n $to = $user_info->email;\n $mobile_number = $user_info->mobile;\n // $sms_message = 'Hello Mr/Mrs/Ms'.$user_info->firstname.' ,this is a confirmation message from patanjaliayurved.net.Your order has been placed successfully.Order No : '.$order_no;\n // \n $product_list='';\n for($i=0;count($order['order_details_array'])>$i;$i++){\n if($order['offline']==0){\n $Offline='Offline'; \n }else{\n $Offline='Online'; \n }\n \n $product_list .='<tr>\n\t\t <td>'.$order['order_details_array'][$i]->modules_item_name.'</td>\n\t\t \n\t\t <td>'.$Offline.'</td>\n\t\t <td><i class=\"fa fa-inr\">'.$order['order_details_array'][$i]->price.'</i></td>\n </tr>';\n }\n\n \n $message .= '<div style=\"min-height: 0.01%;\n overflow-x: auto;\"><table style=\"margin-bottom: 20px;\n max-width: 100%;\n width: 100%;\" border=\"1\"> \n <thead>\n <tr>\n <th>Product Name</th>\n\t\t<th>Mode</th>\n <th>Amount</th> \n </tr>\n </thead>\n <tbody>\t\n\t\t'.$product_list.'<tr align=\"left\">\n\t\t <th>Total</th>\n\t\t \n\t\t <th>'.$order['order_qty'].'</th>\n\t\t <th><i class=\"fa fa-inr\"></i>'.$order['order_price'].'</th>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<th>&nbsp;</th>\n\t\t\t\n\t\t\t<th align=\"left\">Extra charges</th>\n\t\t\t<th align=\"left\"><i class=\"fa fa-inr\"></i> '.$order['shipping_charges'].'</th>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<th>&nbsp;</th>\n\t\t\t\n\t\t\t<th>&nbsp;</th>\n\t\t\t<th align=\"left\"><i class=\"fa fa-inr\"></i>'.$order['final_amount'].'</th>\n\t\t</tr>\n </tbody>\n </table></div>';\n $message .= '<br>Thanks,<br>Team Studyadda';\n //send email\n sendEmail($to,$subject,$message);\n //$this->sms->send_sms($mobile_number,$sms_message); \n \n $this->session->set_flashdata('update_msg','Your order has been placed successfully');\n redirect('/user/orders');\n }else{\n \n $this->session->set_flashdata('message', 'Please Select Atleast One Payment Method.');\n redirect('/cart'); \n }\n }", "function wc_add_notice_free_shipping() {\n\n $order_min_amount = get_free_shipping_minimum();\n\n $cart = WC()->cart->subtotal;\n $remaining = $order_min_amount - $cart;\n $f_str = \"\";\n if ( $cart < 1 ) {\n $f_str .= sprintf( __( '<strong>Free delivery</strong> from %s.', 'thegrapes' ), wc_price($order_min_amount));\n } else if ( $order_min_amount > $cart ){\n $f_str .= sprintf( __( 'Spend %s more to get <strong>free delivery</strong>.', 'thegrapes' ), wc_price($remaining));\n } else {\n $f_str .= '<strong>' . __( 'You have free delivery.', 'thegrapes' ) . '</strong>';\n }\n return $f_str;\n\n}", "function IsProduct() {\r\n\t\treturn true;\r\n\t}", "function is_carton() {\n\treturn ( is_shop() || is_product_category() || is_product_tag() || is_product() ) ? true : false;\n}", "public function cart_stock($product_id, $options, $quantity) {\n\t\t\n\t\t$ro_settings = $this->config->get('related_options');\n\t\t$ro_combs = $this->get_related_options_sets_by_poids($product_id, $options, true, true);\n\t\t//$ro_combs = $this->get_related_options_sets_by_poids($product_id, $options);\n\t\t$stock_ok = true;\n\t\tif ($ro_combs) {\n\t\t\tforeach ($ro_combs as $ro_comb) {\n\t\t\t\t$stock_ok = $stock_ok && ($quantity <= $ro_comb['quantity'] || !empty($ro_settings['allow_zero_select']));\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $stock_ok;\n\t\t\n\t}", "private function validateAddCart() {\n\t\tif (empty($this->request->post['price_studio_id']) || !isset($this->session->data['studio_data'][$this->request->post['price_studio_id']])) {\n\t\t\t$this->error['warning'] = $this->language->get('error_studio_id');\n\t\t} elseif (empty($this->session->data['studio_data'][$this->request->post['price_studio_id']][\"id_product\"])) {\n\t\t\t$this->error['warning'] = $this->language->get('error_product');\n\t\t} elseif (!is_array($this->session->data['studio_data'][$this->request->post['price_studio_id']][\"views\"])) {\n\t\t\t$this->error['warning'] = $this->language->get('error_printing_empty');\n\t\t} elseif (!is_array($this->session->data['studio_data'][$this->request->post['price_studio_id']][\"quantity_s_c\"])) {\n\t\t\t$this->error['warning'] = $this->language->get('error_matrix');\n\t\t} elseif (empty($this->session->data['studio_data'][$this->request->post['price_studio_id']][\"printing_method\"])) {\n\t\t\t$this->error['warning'] = $this->language->get('error_printing_method');\n\t\t}\n\n\t\tif (!$this->error) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function cart_stock($product_id, $options, $quantity) {\n\t\t\n\t\t$ro_settings = $this->config->get('related_options');\n\t\t$ro_combs = $this->getROCombsByPOIds($product_id, $options, true);\n\t\t//$ro_combs = $this->getROCombsByPOIds($product_id, $options);\n\t\t$stock_ok = true;\n\t\tif ($ro_combs) {\n\t\t\tforeach ($ro_combs as $ro_comb) {\n\t\t\t\t$stock_ok = $stock_ok && ($quantity <= $ro_comb['quantity'] || !empty($ro_settings['allow_zero_select']));\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $stock_ok;\n\t\t\n\t}", "function check_cart_items() {\n\t\t\tglobal $cmdeals;\n\t\t\t\n\t\t\t$result = $this->check_cart_item_stock();\n\t\t\tif (is_wp_error($result)) $cmdeals->add_error( $result->get_error_message() );\n\t\t}", "static function cartItem (){\n $user_id = auth()->user()->id;\n return Cart::where('user_id',$user_id)->count();\n }", "public function getBaseShippingInvoiced();", "public function getCartPrice()\n {\n return 111;\n }" ]
[ "0.62214464", "0.6187363", "0.6065278", "0.6032361", "0.6016836", "0.60083765", "0.60036594", "0.5883299", "0.58731216", "0.5852463", "0.58288914", "0.581848", "0.5802087", "0.5753564", "0.5752924", "0.5724028", "0.57140595", "0.57122105", "0.5710606", "0.57094055", "0.5704671", "0.56952554", "0.56948036", "0.5694703", "0.5687199", "0.5684707", "0.5683225", "0.5677443", "0.5677443", "0.5677443", "0.5677443", "0.5677443", "0.56749487", "0.56649494", "0.5622816", "0.56212044", "0.56153923", "0.5614223", "0.5603218", "0.55848527", "0.55706537", "0.55694896", "0.5568556", "0.5564936", "0.5564936", "0.55637676", "0.5557759", "0.55546534", "0.55470186", "0.5531883", "0.55215883", "0.5515511", "0.5515051", "0.54864645", "0.5466134", "0.5458594", "0.5446059", "0.5432193", "0.5423665", "0.54232323", "0.5416057", "0.54159516", "0.5408768", "0.5405213", "0.5387686", "0.537946", "0.5352843", "0.5346963", "0.534666", "0.53438157", "0.5338407", "0.53380626", "0.53356427", "0.53331375", "0.53324807", "0.53206164", "0.5312666", "0.53121513", "0.53055376", "0.5299156", "0.5294359", "0.52935827", "0.5292534", "0.5291918", "0.5288566", "0.528728", "0.528667", "0.52807534", "0.5279783", "0.5269493", "0.5267722", "0.52651405", "0.5263161", "0.525862", "0.5251992", "0.5251544", "0.52500653", "0.52473336", "0.52471185", "0.52463716" ]
0.56094736
38
Shopping Cart has 0 or 1 Promo
public function userPromotion() { return $this->belongsTo(UserPromotion::class, 'promotion_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testIfStockManagementHasPromo()\n {\n $this->assertNotNull($this->stock->getPromo());\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function hasProduct(){\n return $this->_has(1);\n }", "public function getCartable();", "public function HasCart() {\n\tif ($this->IsNew()) {\n\t return FALSE;\n\t} else {\n\t return (!is_null($this->GetCartID()));\n\t}\n }", "function VariationIsInCart() {\r\n\t\t$variations = $this->owner->Variations();\r\n\t\tif($variations) {\r\n\t\t\tforeach($variations as $variation) {\r\n\t\t\t\tif($variation->OrderItem() && $variation->OrderItem()->Quantity > 0) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function hasQuantity(): bool;", "public function hasActiveCart();", "public function isGoodsInShopcart()\n\t{\n\t\treturn !!$this->count();\n\t}", "function check_product_in_the_cart($product){\n if (auth()->check()){\n $cart = Cart::where('user_id', auth()->user()->id)->where('product_id', $product->id)->first();\n }else{\n if(session()->has('carts')){\n $cart = key_exists($product->uuid, session('carts'));\n }else{\n $cart = false;\n }\n }\n\n if ($cart){\n return true;\n }else{\n return false;\n }\n}", "private function check_cart() {\n $users_id = $this->session->userdata('id');\n if ($users_id) {\n // User connected > DB\n $this->data['deals'] = $this->users_cart->getForUser($users_id);\n } else {\n // Guest > Session\n $deals = $this->session->userdata('cart');\n if ($deals) {\n $this->data['deals'] = $this->deals->getDeals(false, false, false, false, false, false, $deals);\n } else {\n $this->data['deals'] = array();\n }\n }\n }", "static function cartItem (){\n $user_id = auth()->user()->id;\n return Cart::where('user_id',$user_id)->count();\n }", "function VariationOrProductIsInCart() {\r\n\t\treturn ($this->owner->IsInCart() || $this->VariationIsInCart());\r\n\t}", "function is_in_cart($conditions){\n\t\tunset($conditions['quantity']);\n\t\t// odpojim modely, ktere nepotrebuju\n\t\t$this->unbindModel(\n\t\t\tarray(\n\t\t\t\t'belongsTo' => array('Cart', 'Product')\n\t\t\t)\n\t\t);\n\n\t\t// vyhledam si produkt\n\t\t$data = $this->find($conditions);\n\n\t\t// pokud se mi podarilo nacist jej,\n\t\t// vratim jeho id, ktere se pouzije\n\t\t// pro upravu quantity\n\t\tif ( !empty($data) ){\n\t\t\treturn $data['CartsProduct']['id'];\n\t\t}\n\n\t\t// produkt neexistuje\n\t\treturn false;\n\t}", "function add_item_to_cart( $prodId = null ) {\n if ( null != $prodId && is_numeric( $prodId ) ) {\n\n // Probably should sql check database to see\n // if product exisits.\n\n if( $_SESSION[\"cart\"][$prodId] ) {\n $_SESSION[\"cart\"][$prodId]++;\n }\n else {\n $_SESSION[\"cart\"][$prodId] = 1;\n }\n }\n}", "public function cartExists() {\n\t\t$cart = $this->find('first', array('conditions' => $this->cartConditions(), 'contain' => FALSE));\n\t\treturn !empty($cart);\n\t}", "public function addProduct(Cart $cartObj) :bool\n {\n $orderObj = new Order();\n $orderObj->createOrder();\n $query = $this->pdo->prepare(\"SELECT orders_products.id from orders_products\nINNER JOIN orders on orders_products.order_id = orders.id\nWHERE orders.user_id = :user_id AND orders.status='cart' AND orders_products.product_id=:product_id\");\n $query->execute(array('product_id'=>$cartObj->getProductId(),'user_id'=> $orderObj->getUserId()));\n $row = $query->fetchALL(PDO::FETCH_ASSOC);\n if (empty($row)) {\n $query = $this->pdo->prepare(\"\n INSERT INTO orders_products\n SELECT NULL,id,:product_id,:quantity FROM orders WHERE user_id = :user_id AND status ='cart'\");\n $query->execute(array\n (\n 'product_id' => $cartObj->getProductId(),\n 'user_id' => $orderObj->getUserId(),\n 'quantity'=>$cartObj->getQuantity()));\n $product = new Product();\n $product->decreaseQuantity($cartObj->getOrderId(), $cartObj->getQuantity());\n unset($query);\n } else {\n $query = $this->pdo->prepare(\"UPDATE orders_products \n SET quantity = quantity+:quantity WHERE product_id =:product_id;\");\n $query->execute(array\n (\n 'product_id'=>$cartObj->getProductId(),\n 'quantity'=>$cartObj->getQuantity()));\n $product = new Product();\n $product->decreaseQuantity($cartObj->getProductId(), $cartObj->getQuantity());\n unset($query);\n }\n return true;\n }", "public function _assertStoreCartHasProductsWithMinimalQuantity()\n {\n }", "public function isAddingThisProductToCartASuccess($order_id,$product_id,$quantity_of_purchase,$amount_saved_on_purchase,$prevailing_retail_selling_price,$cobuy_member_selling_price,$start_price_validity_period,$end_price_validity_period,$is_escrowed,$is_escrow_accepted){\n \n $model = new OrderHasProducts;\n return $model->isAddingThisProductToCartASuccess($order_id,$product_id,$quantity_of_purchase,$amount_saved_on_purchase,$prevailing_retail_selling_price,$cobuy_member_selling_price,$start_price_validity_period,$end_price_validity_period,$is_escrowed,$is_escrow_accepted);\n }", "public function isProductNotAlreadyInTheCart($order_id,$product_id){\n $model = new OrderHasProducts;\n return $model->isProductNotAlreadyInTheCart($order_id,$product_id);\n }", "function isCartEmpty()\n{\n\t$isEmpty = false;\n\t\n\n\t$sql = \"SELECT *\n\t\t\tFROM Cart\";\n\t\n\t$result = query($sql);\n\t\n\tif (mysql_num_rows($result) == 0) {\n\t\t$isEmpty = true;\n\t}\t\n\t\n\treturn $isEmpty;\n}", "public function remove_promo()\n {\n $cart = $this->getService()->getSessionCart();\n\n return $this->getService()->removePromo($cart);\n }", "public function testCheckCart()\n {\n \n\n $customerSession = $this->getModelMock('customer/session', array('getQuote', 'start', 'renewSession', 'init'));\n $this->replaceByMock('model', 'customer/session', $customerSession);\n \n $itemsCollection = array();\n $product = new Varien_Object();\n $product->setId(1);\n $item = new Varien_Object();\n $item->setProduct($product);\n $item->setId(1);\n $itemsCollection[] = $item;\n $item = new Varien_Object();\n $product->setId(2);\n $item->setProduct($product);\n $item->setId(2);\n $itemsCollection[] = $item;\n $item = new Varien_Object();\n $product->setId(3);\n $item->setProduct($product);\n $item->setId(3);\n $itemsCollection[] = $item;\n $quoteMock = $this->getModelMock('sales/quote', array('getAllItems'));\n $quoteMock->expects($this->any())\n ->method('getAllItems')\n ->will($this->returnValue($itemsCollection));\n $this->replaceByMock('model', 'sales/quote', $quoteMock);\n $quote = Mage::getModel('sales/quote')->load(2);\n $checkoutSession = $this->getModelMock('checkout/session', array('getQuote', 'start', 'renewSession', 'init'));\n $checkoutSession->expects($this->any())\n ->method('getQuote')\n ->will($this->returnValue($quote));\n $this->replaceByMock('model', 'checkout/session', $checkoutSession);\n \n $this->assertEquals(21, Mage::helper('postident/data')->checkCart());\n }", "public function checkCookieCart()\n {\n if (!isset($_COOKIE['user_cart'])) {\n return \"\";\n } else {\n // Multidimensional array containing a SKU Key and a quantity Value (key-value pair)\n $cart = $this->getCookie(\"user_cart\");\n // Get all the keys of the Cart array\n $cart_keys = array_keys($cart);\n\n $count = 0;\n for ($counter = 0; $counter < count($cart_keys); $counter++) {\n // Count the number of items the User has selected\n $count = $count + $cart[$cart_keys[$counter]];\n }\n\n return \"data-badge=\" . $count;\n }\n }", "public function authorize()\n {\n return Cart::load()->getTotalQuantity() > 1;\n }", "function is_carton() {\n\treturn ( is_shop() || is_product_category() || is_product_tag() || is_product() ) ? true : false;\n}", "public function hasItem(CartItemInterface $item);", "public function continue_checkout($Recipt,$ShoppingCart,$discount)\n {\n $Recipt->update([\n 'is_init_for_card_payment' => null\n ]);\n\n Recipt::where('member_id',$Recipt->member_id)->where('is_init_for_card_payment','1')->delete();\n\n $ReciptProducts = [];\n //--for create Recipt Products--\n foreach ($ShoppingCart as $key => $Cart)\n {\n $this_product = Product::find($Cart->product_id);\n if( $this_product->quantity > 0 || !$this_product)\n {\n //check if selected quantity is not bigger than the stock quantity\n $required_quantity = ($Cart->quantity < $this_product->quantity) ? $Cart->quantity : $this_product->quantity;\n $produ = null;\n $produ = [\n 'recipt_id' => $Recipt->id,\n 'quantity' => $required_quantity ,\n 'product_name_en' => $this_product->name_en ,\n 'product_name_ar' => $this_product->name_ar,\n 'product_id' => $this_product->id ,\n 'cheese_type' => $Cart->cheese_type,\n 'cheese_weight' => $Cart->cheese_weight,\n 'bundle_products_ids' => $this_product->bundle_products_ids,\n 'single_price' => $this_product->price,\n 'total_price' => $this_product->price * $Cart->quantity\n ];\n array_push($ReciptProducts, $produ);\n\n //---decrease the quantity from the product---\n $this_product->update([\n 'quantity' => $this_product->quantity - $required_quantity\n ]);\n }//End if\n }//End foreach\n ReciptProducts::insert($ReciptProducts);\n ShoppingCart::where( 'member_id',$Recipt->member_id )->delete();\n if($discount)\n {\n $myPromo = MemberPromo::where( 'member_id',$Recipt->member_id )->where('is_used',0)->first();\n $myPromo->update([\n 'is_used' => 1,\n 'used_date' => \\Carbon\\Carbon::now()\n ]);\n }\n\n $member = \\App\\Member::find($Recipt->member_id);\n\n $member->update([\n // 'reward_points' => ( $member->reward_points + ceil($Recipt->total_price / 20) ) - $Recipt->points_deduction_price\n 'reward_points' => $member->reward_points - $Recipt->points_deduction_price\n ]);\n\n if($Recipt->payment_method == 'creadit_card')\n {\n $Recipt->update([\n 'payment_method' => 'creadit_card' ,\n 'is_piad' => 1 ,\n ]);\n\n try {\n \\Mail::to($member->email)\n ->send(new \\App\\Mail\\ConfirmOrder($Recipt,$member));\n } catch (\\Exception $e) {\n\n }\n }\n else {\n try {\n \\Mail::to($member->email)\n ->send(new \\App\\Mail\\ConfirmOrder($Recipt,$member));\n }catch (\\Exception $e) {\n\n }\n }\n return response()->json([\n 'status' => 'success',\n 'status_message' => __('page.Thank you for purchasing from us'),\n ]);\n }", "public function add($product) {\n $ajout = false;\n if ($this->products_id) {\n if (array_key_exists($product->id,$this->products_id)) {\n if ($product->quantity >= $this->products_id[\"$product->id\"]++){\n $this->products_id[\"$product->id\"]++;\n $ajout = true;\n }\n }else {\n if($product->quantity >= 1){\n $this->products_id += [\"$product->id\"=>1];\n $ajout = true;\n }\n }\n }else {\n if($product->quantity >= 1){\n $this->products_id = [\"$product->id\"=>1];\n $ajout = true;\n }\n }\n if($ajout){\n $this->total_product ++;\n if($this->discountisused){\n $this->total_price += ($product->price - $product->price * $this->discounts[$this->discountused]/100);\n $this->discountamount += $product->price*$this->discounts[$this->discountused]/100;\n }\n\n else\n $this->total_price += $product->price;\n }\n}", "public function isCartEmpty()\n {\n return empty($_SESSION['cart']) ? true : false;\n }", "public function add_order()\n {\n if (isset($_SESSION['cart'])) {\n $total_cost = 0;\n $quantity = 0;\n $quaty = \"\";\n foreach ($_SESSION['cart'] as $id => $quaty) {\n $product = Data::find_by_id($id);\n $cost = $product->price * $quaty; // $quaty is quantity.\n $quantity += $quaty;\n $total_cost = $total_cost + $cost;\n }\n if ($quaty > 0) {\n echo \"<p class='text-light pl-2 pr-2 pb-0 m-0'> $quantity </p>\";\n }\n } else {\n echo \"<p class='text-light pl-2 pr-2 pb-0 m-0'> Empty</p>\";\n }\n }", "public function addToCart(Request $request){\n $dish_id = $request->id;\n\n $dish = Dish::find($dish_id);\n\n $product = [\n 'id' => $dish->id,\n 'title'=> $dish->title,\n 'photo' => $dish->photo,\n 'quantity'=> 1,\n 'price' => $dish->price,\n 'total' => $dish->price\n ];\n\n $items = session('cart.items');\n $existing = false;\n $grand_total = 0;\n\n if($items && count($items)> 0) {\n\n foreach($items as $index => $item) {\n if($item['id'] == $dish_id) {\n $items[$index]['quantity'] = $item['quantity'] + $product['quantity'];\n $items[$index]['total'] = $items[$index]['quantity'] * $dish->price;\n $existing = true;\n $grand_total += $items[$index]['total'];\n } else {\n $grand_total += $item['total'];\n }\n }\n\n } \n\n if(!$existing){\n session()->push('cart.items', $product);\n $grand_total += $product['total'];\n } else {\n session(['cart.items'=> $items]);\n }\n\n session(['cart.total' => $grand_total]);\n\n return session('cart');\n \n }", "public function hasShoporder(){\n return $this->_has(27);\n }", "public function getCart();", "function checkCart() {\r\n if (! isset($_SESSION['cart'])) {\r\n $_SESSION['cart'] = [];\r\n return true;\r\n } else {\r\n return true;\r\n }\r\n}", "private function checkCartStatus()\n {\n if ($this->quote->getIsActive()=='0') {\n $this->getMagentoOrderId();\n throw new \\Exception(self::CMOS_ALREADY_PROCESSED);\n }\n }", "public function checkout()\n {\n if(session()->has('cart') && count(session()->get('cart')) == 0){\n return 'none';\n }\n\n\n //Joseph-190508 >>>\n //if(Cart::where('user_id', auth()->id())->delete()){\n //if(auth()->user()->carts()->delete()){\n if(true){ //tmp\n //Joseph-190508 <<< \n /* if(session()->has('cart'))\n {\n session(['cart' => []]);\n } */\n return 'true';\n }\n else{\n return 'false';\n }\n }", "static function cartItem()\n {\n if(session()->has('user'))\n {\n $user_id = Session::get('user')['id'];\n $cartId = DB::table('cart')\n ->where('cart_status','=','0')\n ->where('user_id',$user_id)\n ->pluck('id')->first();\n \n return Cartdetail::where('order_id',$cartId)->count();\n }\n else\n {\n return \"\";\n }\n \n }", "function check_if_added_to_cart($item_id) {\n $user_id = $_SESSION['user_id']; //We'll get the user_id from the session\n $con= mysqli_connect(\"localhost\",\"root\",\"\",\"intern\",\"3309\") or die(mysqli_error($con));\n // connecting to the database\n // We will select all the entries from the user_items table where the item_id is equal to the item_id we passed to this function, user_id is equal to the user_id in the session and status is 'Added to cart'\n \n $query = \"SELECT * FROM users_items WHERE item_id='$item_id' AND user_id ='$user_id' and status='Added to cart'\";\n $result = mysqli_query($con, $query) or die(mysqli_error($con));\n \n// We'll check if the no.of rows in the result and no.of rows returned by the mysqli_num_rows($result) is true. If yes then it return 0 else it returns 0\n if (mysqli_num_rows($result) >= 1) {\n return 1;\n } else {\n return 0;\n }\n}", "function checkCartForItem($addItem, $cartItems) {\n if (is_array($cartItems) && !(is_null($cartItems)))\n {\n foreach($cartItems as $key => $item) \n {\n if($item['productId'] == $addItem)\n return true;\n }\n }\n return false;\n}", "function show_cart_product($pro){\r\n\t\t\treturn $this->select(\"*\",\"items\",\"pro_id in($pro) order by pro_id desc\");\r\n\t\t}", "public function hasPromotion()\n {\n if($this->promotion instanceof PromotionInterface){\n return true;\n }\n return false;\n }", "public function validateCart($cart = null)\n {\n\n $check = true;\n $messages = [];\n\n if(!$cart) {\n $cart = $this->getCart(['cartItems.product']);\n }\n\n // Check we actually have items\n if(count($cart->cartItems) <= 0) {\n $check = false;\n \\Notification::warning('There are no items in your cart.');\n }\n\n\n // Check the validity of all cart items\n $cart->cartItems->each(function($item){\n if (!$item->valid){\n $check = false;\n \\Notification::warning('An item in your cart is invalid. Please either remove or replace it.');\n }\n\n });\n\n foreach($cart->cartItems->groupBy('product_id') as $itemGroup) {\n\n $cartQuantity = 0;\n\n foreach($itemGroup as $item) {\n $cartQuantity += $item->quantity;\n }\n\n $product = $itemGroup->first()->product;\n\n // Check product stock\n if (!$product->checkStock($cartQuantity)) {\n $check = false;\n \\Notification::warning('We don\\'t have enough of this product in stock.');\n }\n\n // Check product extras stock\n// foreach($product->extras as $extra) {\n// if (!$extra->checkStock($cartQuantity)) {\n// $check = false;\n// \\Notification::warning('We don\\'t have enough of this product extra in stock.');\n// }\n// };\n\n };\n\n return [\n 'check' => $check,\n 'messages' => $messages\n ];\n\n\n // Check that item products exist\n\n // Check that item options exist\n\n // Check that item extras exist\n\n\n // Check that item product has stock\n\n\n // Check that item extras have stock\n\n\n\n\n }", "function carton_empty_cart() {\n\t\tglobal $carton;\n\n\t\tif ( ! isset( $carton->cart ) || $carton->cart == '' )\n\t\t\t$carton->cart = new CTN_Cart();\n\n\t\t$carton->cart->empty_cart( false );\n\t}", "protected abstract function isSingleProduct();", "public function testShoppingCartCanBeUpdated()\n {\n $id1 = new UUID();\n $cart1 = new ShoppingCart($id1);\n $cart1->addItem($this->item);\n $this->gateway->insert($id1, $cart1);\n\n // Assert that item is added\n $this->assertEquals(1, count($cart1->getItems()));\n\n // Remove Item and assert\n $cart1->removeItem($this->item);\n $this->assertEquals(0, count($cart1->getItems()));\n\n // Update Cart Database\n $this->gateway->update($id1, $cart1);\n\n // Assert that the change has affected the cart in the database\n $cart = $this->gateway->findById($id1);\n $this->assertEquals(0, count($cart->getItems()));\n }", "function setProductInCartCount ($id, $amount) {\r\n //ensures that the cart exists within the session\r\n if (checkCart()) {\r\n //checks if the product is actually in the cart\r\n if (array_key_exists($id, $_SESSION['cart'])) {\r\n if ($amount > 0) {\r\n $_SESSION['cart'][$id]['amount'] = $amount;\r\n } else {\r\n //remove product\r\n unset($_SESSION['cart'][$id]);\r\n }\r\n } else {\r\n //if not add the product to the cart\r\n addToCart($id, $amount);\r\n }\r\n }\r\n}", "public function getShoppingCart()\r\n\t{\r\n\t\treturn $this->shoppingCart;\r\n\t}", "function check_cart_items() {\n\t\t\tglobal $cmdeals;\n\t\t\t\n\t\t\t$result = $this->check_cart_item_stock();\n\t\t\tif (is_wp_error($result)) $cmdeals->add_error( $result->get_error_message() );\n\t\t}", "private function getExistProductRecount() {\n return false;\n }", "public function add(Request $request): bool\n {\n /** @var Product $product */\n $product = Product::findOrFail($request->get('product_id'));\n $quantity = ($request->get('quantity')) ?? 1;\n\n if(! $product->canBeAddedToCart()) {\n return false;\n }\n\n \\Cart::add([\n 'id' => $product->id,\n 'name' => $product->title,\n 'price' => $product->price,\n 'quantity' => $quantity,\n 'attributes' => array(),\n 'associatedModel' => $product\n ]);\n\n return true;\n }", "public function canItemsAddToCart()\n {\n foreach ($this->getItems() as $item) {\n if (!$item->isComposite() && $item->isSaleable() && !$item->getRequiredOptions()) {\n return true;\n }\n }\n return false;\n }", "public function getCartIdentifire()\n {\n return $this->hasOne(Cart::className(), ['cart_identifire' => 'cart_identifire']);\n }", "public function clearCart(): Cart;", "public function store(Request $request)\n {\n $rules = CartProduct::rules($request);\n $request->validate($rules);\n $product = Products::findOrFail($request->product_id);\n // Check if user has already cart\n $cart = Cart::where('user_id', Auth()->id())\n ->first();\n if ($cart==null) {// User does not have cart\n $newCart = Cart::create([\n 'user_id' => Auth()->id(),\n 'total' => $product->product_price\n ]);\n $credentials = CartProduct::credentials($request, $product);\n $credentials['cart_id'] = $newCart->id;\n $CART = CartProduct::create($credentials);\n } else {//User already have cart\n $credentials = CartProduct::credentials($request, $product);\n $credentials['cart_id'] = $cart->id;\n // Test 1\n $SameProduct = CartProduct::where('user_id', Auth()->id())->where('product_id' , $product->id )->get();\n if ($SameProduct->count() >= 1 ) {\n return redirect()->route('my-cart.index')->withErrors('The Item Is Already Exist');\n } else {\n // Insert product into cart\n $CART = CartProduct::create($credentials);\n // update total price\n $this->updateTotal($cart);\n }\n }\n\n\n return redirect()->route('my-cart.index');\n }", "public function woocommerce_empty_cart_before_add()\n {\n global $woocommerce;\n\n // Get 'product_id' and 'quantity' for the current woocommerce_add_to_cart operation\n if (isset($_GET[\"add-to-cart\"])) {\n $prodId = (int)$_GET[\"add-to-cart\"];\n } else if (isset($_POST[\"add-to-cart\"])) {\n $prodId = (int)$_POST[\"add-to-cart\"];\n } else {\n $prodId = null;\n }\n if (isset($_GET[\"quantity\"])) {\n $prodQty = (int)$_GET[\"quantity\"];\n } else if (isset($_POST[\"quantity\"])) {\n $prodQty = (int)$_POST[\"quantity\"];\n } else {\n $prodQty = 1;\n }\n\n // If cart is empty\n if ($woocommerce->cart->get_cart_contents_count() == 0) {\n\n // Simply add the product (nothing to do here)\n\n // If cart is NOT empty\n } else {\n\n $cartQty = $woocommerce->cart->get_cart_item_quantities();\n $cartItems = $woocommerce->cart->cart_contents;\n\n // Check if desired product is in cart already\n if (array_key_exists($prodId, $cartQty)) {\n\n // Then first adjust its quantity\n foreach ($cartItems as $k => $v) {\n if ($cartItems[$k]['product_id'] == $prodId) {\n $woocommerce->cart->set_quantity($k, $prodQty);\n }\n }\n\n // And only after that, set other products to zero quantity\n foreach ($cartItems as $k => $v) {\n if ($cartItems[$k]['product_id'] != $prodId) {\n $woocommerce->cart->set_quantity($k, '0');\n }\n }\n }\n }\n }", "public function reduce1Product($product)\n {\n\n $cart = $product->cart()->where('cart_id',$this->id)->wherePivot('deleted_at',null)->first();\n\n if (! is_null($cart))\n {\n $quantity = $cart->pivot->quantity;\n\n if ($quantity == 1)\n {\n $cart->pivot->delete();\n }\n else\n {\n $quantity--;\n \n $cart->pivot->update(compact('quantity'));\n }\n }\n\n }", "public function hasProbs(){\n return $this->_has(1);\n }", "public function add_to_cart(Request $request){\n $product = Product::find($request->input('product_id'));\n //On s'assure qu'il y'a bien un produit qui est retourne\n if($product){\n //On enregistre la session cart dans une variable\n $cart = $request->session()->get('cart');\n //On verifie si la cle du produit est deja dans les produits dans la session avant de l'ajouter\n if(!isset($cart['products'][$product->id])){\n //On prepare comment ajouter le produit dans les sessions. Chaque produit dans la sessoin set enregistre dans une cle cart. cette cle contient un\n $cart['products'][$product->id] = ['name' => $product->name, 'price' => $product->price, 'quantite' => 1, \"total\" => $product->price];\n //On ajoute la variable $cart dans les sessions\n $request->session()->put('cart',$cart);\n }\n }\n return response()->json(['success' => true,], 200);\n }", "function check_if_product_was_bought($product_id,$purchase_id)\n\t{\n\t\t\n\t\t$sql = \"SELECT p_details_id FROM cane_purchase_details WHERE purchase_id = ? AND p_product_id= ? \";\n\t\t\n \t\t$query = $this->db->query($sql,array( $purchase_id, $product_id ));\t\t\n\n\t\tif ($query->num_rows() > 0)\n\t\t{ \n\t\t\treturn true;\n\t\t} \n\t\telse \n\t\t{ \n\t\t\techo false; \n\t\t}\n\n\n\t}", "private function addToCart () {\n }", "private function addToCart () {\n }", "function is_cart() {\n\t\treturn is_page( carton_get_page_id( 'cart' ) );\n\t}", "public function getActiveCart();", "public function hasActdiscount(){\n return $this->_has(34);\n }", "public function hasProducenum(){\n return $this->_has(35);\n }", "public function getCartProduct(){\n $sId = session_id();\n $squery = \"SELECT * FROM tbl_cart WHERE sId='$sId'\";\n $result = $this->db->select($squery);\n if ($result) {\n return $result;\n }else {\n return false;\n }\n }", "public function getCart(){\n $session_id = Session::get('session_id');\n $userCart = Cart::where('session_id', $session_id)->get();\n $totalPrice = 0;\n if($userCart->count() > 0){\n foreach($userCart as $key => $cart){\n // Kiểm tra nếu sản phẩm có status == 0 thì xóa khỏi giỏ hàng\n if($cart->products->status == 0){\n $cart->delete();\n unset($userCart[$key]);\n }\n // Kiểm tra nếu kho = 0\n if($cart->attributes->stock == 0){\n $cart->quantity = 0;\n $cart->save();\n }\n // Kiểm tra nếu kho < quantity\n if($cart->attributes->stock < $cart->quantity){\n $cart->quantity = $cart->attributes->stock;\n $cart->save();\n }\n $totalPrice += $cart->attributes->price*$cart->quantity;\n }\n $totalItems = $userCart->sum('quantity');\n \n }else{\n $totalItems = 0;\n }\n \n return view('frontend.cart_page')->withUserCart($userCart)->withTotalItems($totalItems)->withTotalPrice($totalPrice);\n }", "private function getAlreadyPurchasedProduct()\n {\n // If is Guest then hide the review form\n if (!$this->getCustomerId()) {\n return false;\n }\n try {\n $product = $this->getProductInfo();\n $orders = $this->getCustomerOrders();\n foreach ($orders as $order) {\n // Get all visible items in the order\n /** @var $items \\Magento\\Sales\\Api\\Data\\OrderItemInterface[] **/\n $items = $order->getAllVisibleItems();\n // Loop all items\n foreach ($items as $item) {\n // Check whether the current product exist in the order.\n if ($item->getProductId() == $product->getId()) {\n return true;\n }\n }\n }\n return false;\n } catch (\\Exception $e) {\n return false;\n }\n }", "public function testShoppingCartCanBeInserted()\n {\n $id1 = new UUID();\n $cart1 = new ShoppingCart($id1);\n $this->gateway->insert($id1, $cart1);\n\n $id2 = new UUID();\n $cart2 = new ShoppingCart($id2);\n $this->gateway->insert($id2, $cart2);\n\n $query = $this->db->query('SELECT * FROM shoppingCart');\n $result = $query->fetchAll(PDO::FETCH_COLUMN);\n\n $this->assertEquals(2, count($result));\n }", "public function cart(): void\n {\n $userData = $this->getSession()->getCurrentUserData();\n\n if ($userData->getCart() && $userData->getCart()->hasProducts())\n {\n echo $this->render('cart/shoppingCart', $userData->getRenderCartParams());\n }\n }", "public function checkDone(Request $request) {\n\t\t$cartPrice = DB::table('cartproduct')\n\t\t\t->where('customerid', $request->session()->get('loggedUser')->id)\n\t\t\t->sum('price');\n\t\t$cartlist = DB::table('cartproduct')\n\t\t\t->where('customerid', $request->session()->get('loggedUser')->id)\n\t\t\t->get();\n\t\t$cart = DB::table('cart')\n\t\t\t->where('customerid', $request->session()->get('loggedUser')->id)\n\t\t\t->count();\n\t\tif ($cart == 0) {\n\t\t\techo \"empty\";\n\t\t\treturn;\n\t\t}\n\t\tforeach ($cartlist as $p) {\n\t\t\tif ($p->quantity < $p->cartquantity) {\n\t\t\t\techo \"not available\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t$invoice = new invoice();\n\t\t$invoice->empid = 0;\n\t\t$invoice->customerid = $request->session()->get('loggedUser')->id;\n\t\t$invoice->price = $cartPrice;\n\t\t$invoice->status = \"ON_PROCESS\";\n\n\t\tdate_default_timezone_set('Asia/Dhaka');\n\n\t\t$invoice->datetime = date('Y-m-d H:i:s');\n\n\t\t$invoice->save();\n\t\tforeach ($cartlist as $cList) {\n\t\t\t$orderlist = new orderlist();\n\t\t\t$orderlist->productid = $cList->id;\n\t\t\t$orderlist->quantity = $cList->cartquantity;\n\t\t\t$orderlist->price = $cList->selling_price;\n\t\t\t$orderlist->total_price = $cList->price;\n\t\t\t$orderlist->invoiceid = $invoice->id;\n\t\t\t$orderlist->save();\n\n\t\t\t$product = product::find($cList->id);\n\t\t\t$product->quantity = $product->quantity - $cList->cartquantity;\n\t\t\t$product->save();\n\n\t\t}\n\t\tDB::table('cart')\n\t\t\t->where('customerid', $request->session()->get('loggedUser')->id)\n\t\t\t->delete();\n\t\treturn redirect()->route('products.index');\n\t}", "function cartHasCourse($course_id)\n{\n return CartItem::where('cart_id', getUserCart()->id)->where('course_id', $course_id)->first();\n}", "public function isProductTypeWithQty(): ?bool;", "public function postAddItem(Request $request){\n // Forget Coupon Code & Amount in Session\n Session::forget('CouponAmount');\n Session::forget('CouponCode');\n\n $session_id = Session::get('session_id');\n if(empty($session_id)){\n $session_id = str_random(40);\n Session::put('session_id', $session_id);\n }\n\n // Kiểm tra item đã có trong giỏ hàng chưa\n $checkItem = Cart::where(['product_id'=>$request['product_id'], 'attribute_id'=>$request['attribute_id'], 'session_id'=>$session_id])->first();\n\n // Nếu item đã có trong giỏ hàng thì cộng số lượng\n // Nếu item chưa có trong giỏ hàng thì thêm vào cart\n if(!empty($checkItem)){\n $checkItem->quantity = $checkItem->quantity + $request['quantity'];\n $checkItem->save();\n }else{\n $cart = new Cart;\n $cart->product_id = $request['product_id'];\n $cart->attribute_id = $request['attribute_id'];\n $cart->quantity = $request['quantity'];\n $cart->session_id = $session_id;\n if($request['user_email']){\n $cart->user_email = '';\n }else{\n $cart->user_email = $request['user_email'];\n }\n $cart->save();\n }\n\n return redirect()->route('get.cart')->with('flash_message_success', 'Sản phẩm đã được thêm vào giỏ hàng!');\n }", "public function addToCart(Request $request, $id){\n if(Auth::user()) {\n $shop = Product::find($request->product);\n if(!$shop) {\n abort(404);\n }\n \n $cart = session()->get('cart'); //verificam daca exista un cos in sesiune\n\n if(!$cart) {\n $cart = [\n $id => [\n \"name\" => $shop->name,\n \"quantity\" => 1,\n \"price\" => $shop->price,\n \"image\" => $shop->image\n ]\n ];\n session()->put('cart', $cart);\n return redirect()->back()->with('cart-success', 'Produs adaugat cu succes!');\n }\n \n if(isset($cart[$id])) { // daca cart nu este gol at verificam daca produsul exista pt a incrementa cantitate\n $cart[$id]['quantity']++;\n session()->put('cart', $cart);\n return redirect()->back()->with('cart-success', 'Produs adaugat cu succes!');\n }\n \n $cart[$id] = [ // daca item nu exista in cos at addaugam la cos cu quantity = 1\n \"name\" => $shop->name,\n \"quantity\" => 1,\n \"price\" => $shop->price,\n \"image\" => $shop->image\n ];\n session()->put('cart', $cart);\n return redirect()->back()->with('cart-success', 'Produs adaugat cu succes!');\n } else {\n return view('auth.login', ['url' => 'user']);\n }\n \n }", "public function store(Request $request, $id)\n {\n $produk = produk::where('id', $id)->first();\n if($request->qty > $produk->stok)\n {\n return redirect('detail/'.$id)->with('status', 'The order exceeds the existing stock limit');\n }\n\n $subtotal = $produk->harga * $request->qty;\n $cek_cart = Cart::where('id_produk', Session::get('id_produk'))->first();\n if(empty($cek_cart)){\n\n $itemcart = Cart::create($request->all());\n $itemcart-> id_user = $request->id_user;\n $itemcart-> id_produk = $request->id_produk;\n $itemcart-> qty = $request->qty;\n $itemcart->save();\n } else {\n \n }\n\n\n\n return redirect('/cart')->with('status', 'Successfully create a new product!');\n\n }", "public function addToCart($request)\n\t{\n // Validation \n $this->attributes = $request;\n $this->user_id = 1;\n\n if(!$this->validate()){\n return false;\n }\n\n // Validation: Check Product Exist in Product Table \n $productModel = Products::findOne($this->product_id);\n if(!$productModel){\n $this->addError(\"Failed to Add\",\"Given Product (\".$this->product_id.\") is not Available\");\n return false;\n }\n\n // Check Product Already Exist. If already exist then update other wise add\n $cartProduct = Cart::find()->where([\"product_id\"=>$this->product_id])->one();\n\n if($cartProduct){\n $cartProduct->quantity = $cartProduct->quantity + $this->quantity; \n $isSaved = $cartProduct->save();\n return $isSaved ? $cartProduct->id : false; \n }else{\n $isSaved = $this->save(); \n return $isSaved ? $this->id : false; \n }\n }", "function check_cart_item_stock() {\n\t\t\t$error = new WP_Error();\n\t\t\tforeach ($this->cart_contents as $cart_item_key => $values) :\n\t\t\t\t$_deals = $values['data'];\n\t\t\t\tif ($_deals->managing_stock()) :\n\t\t\t\t\tif ($_deals->is_in_stock() && $_deals->has_enough_stock( $values['quantity'] )) :\n\t\t\t\t\t\t// :)\n\t\t\t\t\telse :\n\t\t\t\t\t\t$error->add( 'out-of-stock', sprintf(__('Sorry, we do not have enough \"%s\" in stock to fulfill your order (%s in stock). Please edit your cart and try again. We apologise for any inconvenience caused.', 'cmdeals'), $_deals->get_title(), $_deals->_stock ) );\n\t\t\t\t\t\treturn $error;\n\t\t\t\t\tendif;\n\t\t\t\tendif;\n\t\t\tendforeach;\n\t\t\treturn true;\n\t\t}", "function CheckPurchaseRetur($id_purchase,$id_purchase_production) {\n $data = $this->db\n ->select('count(id_purchase_retur) as total')\n ->where('id_purchase',$id_purchase)\n ->where('id_purchase_production',$id_purchase_production)\n ->limit(1)\n ->get('purchase_retur')\n ->row_array();\n \n if ($data['total'] > 0) {\n // return false if already retured\n return FALSE;\n } else {\n return TRUE;\n }\n }", "public function test_total_products_quantity()\n {\n $order1 = \\App\\Order::find(1);\n $order2 = \\App\\Order::find(2);\n\n $this->assertEquals(9, $this->orders_service->getTotalProductsQuantity($order1));\n $this->assertEquals(3, $this->orders_service->getTotalProductsQuantity($order1, true));\n $this->assertEquals(0, $this->orders_service->getTotalProductsQuantity($order2, false));\n $this->assertEquals(0, $this->orders_service->getTotalProductsQuantity($order2, true));\n }", "public function addToCart(Request $request)\n {\n $quantity = 1;\n\n if ( abs( (int)$request->input('quantity') ) > 0 ) {\n $quantity = abs( (int)$request->input('quantity') );\n }\n\n \tif ( Cart::addToCart($request->input('prodcutID'), $quantity) ) {\n \t\treturn ['type' => 'success', 'message' => 'Ürün sepetinize eklenmiştir.'];\n \t}\n\n \treturn ['type' => 'error', 'message' => 'Ürün sepetinize eklenirken bir hata oluştu'];\n }", "public static function totalItem(){\n if(Auth::check()){\n $cart = cart::Where('user_id', Auth::id() )\n ->Where('order_id',NULL)\n ->get();\n }\n else{\n $cart = cart::Where('ip_address', request()->ip() )\n ->Where('order_id',NULL)\n ->get();\n }\n $totalItem=0;\n foreach ($cart as $value) {\n $totalItem += $value->product_quantity;\n }\n return $totalItem;\n\n}", "function wordimpress_is_conditional_product_in_cart( $product_id ) {\n //Check to see if user has product in cart\n global $woocommerce;\n \n //flag no book in cart\n $book_in_cart = false;\n \n foreach ( $woocommerce->cart->get_cart() as $cart_item_key => $values ) {\n $_product = $values['data'];\n \n if ( in_array($_product->id, $product_id) ) {\n //book is in cart!\n $book_in_cart = true;\n \n }\n }\n \n return $book_in_cart;\n \n}", "public function canAddToCart($product)\n {\n return (!$product->getData('personalization_allowed') || !$product->getData('personalization_required'));\n }", "function ju_assert_qty_supported(P $p):void {ju_assert(\n\tju_pt_has_qty($t = $p->getTypeId()), \"Products of type `$t` do not have a quantity.\"\n);}", "private function checkIfExistsProducts()\n {\n if (isset($_COOKIE['cart-data'])) {\n $productCookie = htmlspecialchars($_COOKIE['cart-data']);\n $products = trim($productCookie, '|');\n $products = explode('|', $products);\n foreach ($products as $product) {\n if (!Product::find($product)) {\n $productCookie = str_replace('|' . $product . '|', '|', $productCookie);\n }\n }\n setcookie('cart-data', $productCookie, time() + (86400 * 365), \"/\");\n }\n }", "private function update_total_with_promo_code() {\n\t\tif ($this->does_cart_already_have_promo_code() == true) {\n\t\t\t// Make new old total\n\t\t\t$this->old_total = $this->cart_total;\n\t\t\t$promo_code = $this->promo_code;\n\t\t\tif ($promo_code->code_type == 1) {\n\t\t\t\t$percent_off = $promo_code->percent_off;\n\t\t\t\t$cart_total = $this->cart_total;\n\t\t\t\t$amount_removed = $cart_total * $percent_off;\n\t\t\t\t$new_total = $cart_total - $amount_removed;\n\n\t\t\t\t// Update variables\n\t\t\t\t$this->old_total = $cart_total;\n\t\t\t\t$this->cart_total = $new_total;\n\t\t\t\t$this->promo_code = $promo_code;\n\n\t\t\t\t// Update cart\n\t\t\t\t$this->save();\n\t\t\t} else {\n\t\t\t\t$dollars_off = $promo_code->dollars_off;\n\t\t\t\t$minimum_amount = $promo_code->minimum_amount;\n\t\t\t\t$cart_total = $this->cart_total;\n\t\t\t\tif ($cart_total < $minimum_amount) {\n\t\t\t\t\treturn \"Cart total does not meet minimum requirement of $\" . $minimum_amount . \" for this promo code.\";\n\t\t\t\t} else {\n\t\t\t\t\t// Get new total\n\t\t\t\t\t$new_total = $cart_total - $dollars_off;\n\n\t\t\t\t\t// Update variables\n\t\t\t\t\t$this->old_total = $cart_total;\n\t\t\t\t\t$this->cart_total = $new_total;\n\t\t\t\t\t$this->promo_code = $promo_code;\n\n\t\t\t\t\t// Create addition in stats helper\n\t $site_stats_helper = new SiteStatsHelper();\n\t if (Auth::guest()) {\n\t $site_stats_helper->promo_code_add_guest_addition($promo_code->id);\n\t } else {\n\t \t$site_stats_helper->promo_code_add_member_addition($promo_code->id);\n\t }\n\n\t\t\t\t\t// Update cart\n\t\t\t\t\t$this->save();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function pre_confirmation_check() {\n global $cartID;\n global $cart;\n \n if (empty($cart->cartID)) {\n $cartID = $cart->cartID = $cart->generate_cart_id();\n }\n \n if (! tep_session_is_registered('cartID')) {\n tep_session_register('cartID');\n }\n }", "public function userCartCount($user_id)\n {\n return Cart::where('user_id',$user_id)->count();\n }", "public static function savePromo(Promo $promo, array $products){\n\t\t$total_price = 0;\n\t\t$details = array();\n\t\tforeach ($products as $product) {\n\t\t\t$price = $product->price * ((100 - $promo->total_discount)/100);\n\t\t $promo_detail = new PromoDetail;\n\t\t $promo_detail->promo_id = $promo->id;\n\t\t $promo_detail->product_code = $product->code;\n\t\t $promo_detail->product_name = $product->name;\n\t\t $promo_detail->product_price = $price;\n\t\t $promo_detail->product_discount = $promo->total_discount;\n\t\t $total_price += $price;\n\t\t array_push($details, $promo_detail);\n\t\t}\n\t\t$promo->total_price = $total_price;\n\t\t$promo->save();\n\t\tforeach ($details as $detail) {\n\t\t\t$detail->promo_id = $promo->id;\n\t\t\t$detail->save();\n\t\t\tProduct::reduceStockByCode($detail->product_code, $promo->stock);\n\t\t}\n\t\treturn true;\n\t\t\n\t}", "public function checkout(){\n \n $user_id = Auth::user()->id;\n $order = new Order;\n $total = 0;\n if(Session::has('cart_'.Auth::user()->id)){\n foreach(session('cart_'.Auth::user()->id) as $id => $product){\n $total += $product['price'] * $product['quantity'] ;\n $order->total_price = $total;\n $order->quantity = $product['quantity'];\n $order->user_id = $user_id;\n $order->save();\n $order->product()->sync($product['id'],false);\n }//end foreach\n \n \n Session::forget('cart_'.Auth::user()->id);\n return redirect()->back();\n }\n else{\n return redirect('UserHome');\n }\n \n \n }", "public function shoppingcart()\n {\n $products = Cart::all();\n if(count($products) === 0){\n $message = \"your cart is empty\";\n session::flash(\"error_message\", $message);\n }\n \n \n \n $items = Cart::userCartItems();\n // echo \"<pre>\"; print_r($items); die;\n\n return view('cart')->with(compact(\"items\"));\n }", "private function add($product){\n $cart = ['qty'=>0,'price' => 0, 'product' => $product];\n if($this->items){\n if(array_key_exists($product->prod_id, $this->items)){\n $cart = $this->items[$product->prod_id];\n }\n }\n $cart['qty']++;\n $cart['price'] += $product->price;\n $this->items[$product->prod_id] = $cart;\n $this->totalQty++;\n $this->totalPrice += $product->price;\n }", "public function hasPrice(){\n return $this->_has(12);\n }", "function is_added_to_cart($product_id, $set = '', $op = '')\n {\n $carted = $this->cart->contents();\n //var_dump($carted);\n if (count($carted) > 0) {\n foreach ($carted as $items) {\n if ($items['id'] == $product_id) {\n \n if ($set == '') {\n return true;\n } else {\n if($set == 'option'){\n $option = json_decode($items[$set],true);\n return $option[$op]['value'];\n } else {\n return $items[$set];\n }\n }\n }\n }\n } else {\n return false;\n }\n }", "public function addToShoppingCart($User_Name, $Product_ID){\r\n $check = $this->DB->prepare(\"SELECT * FROM shopping_cart WHERE (User_Name = '$User_Name') AND (Product_ID = $Product_ID);\");\r\n $check->execute ();\r\n $check = $check->fetchAll (PDO::FETCH_ASSOC);\r\n\r\n if(count($check) == 0){ //If the user has not added the item to the cart previously,\r\n $stmt = $this->DB->prepare('INSERT INTO shopping_cart values(NULL, :User_Name, :Product_ID, 1)');\r\n $stmt->bindParam( 'User_Name', $User_Name );\r\n $stmt->bindParam( 'Product_ID', $Product_ID );\r\n $stmt->execute();\r\n } else {\r\n $stmt = $this->DB->prepare (\"UPDATE shopping_cart SET Product_Count = Product_Count + 1 WHERE (User_Name = :User_Name) AND (Product_ID = :Product_ID)\");\r\n $stmt->bindParam( 'User_Name', $User_Name );\r\n $stmt->bindParam( 'Product_ID', $Product_ID );\r\n $stmt->execute ();\r\n }\r\n }", "function hacerPedido_carta($pedido, $carta){\n //realizamos la consuta y la guardamos en $sql\n $sql=\"INSERT INTO carta_pedido(id_pedido, id_carta) VALUES (\".$pedido.\", \".$carta.\")\";\n //Realizamos la consulta\n $resultado=$this->realizarConsulta($sql);\n if($resultado!=false){\n return true;\n }else{\n return null;\n }\n}" ]
[ "0.6377489", "0.6218451", "0.6218451", "0.6218451", "0.6218451", "0.6218451", "0.62084264", "0.61402273", "0.6132569", "0.6087864", "0.60854214", "0.6079813", "0.60257155", "0.6015866", "0.59557927", "0.59225464", "0.59193814", "0.58981097", "0.5888112", "0.5878442", "0.5852341", "0.58241904", "0.58005464", "0.57894635", "0.5773464", "0.5765828", "0.57389474", "0.5719134", "0.5691587", "0.56672657", "0.5663028", "0.5649968", "0.56346965", "0.56215024", "0.5620087", "0.5600843", "0.558709", "0.55781907", "0.55778843", "0.556269", "0.5561543", "0.555533", "0.554865", "0.5537908", "0.5536435", "0.5534614", "0.55074835", "0.55011445", "0.54795", "0.5479493", "0.54727536", "0.54657257", "0.5456329", "0.54532266", "0.5450924", "0.54492223", "0.5443414", "0.54386103", "0.5436904", "0.5434867", "0.542524", "0.5424253", "0.5419533", "0.5415464", "0.5415464", "0.540732", "0.54032165", "0.53972733", "0.53884727", "0.5380164", "0.5377192", "0.53755915", "0.537524", "0.5372517", "0.5367395", "0.5361421", "0.53574973", "0.5350146", "0.5347956", "0.53471255", "0.5342299", "0.5342157", "0.53386605", "0.53378963", "0.533428", "0.5333425", "0.53307885", "0.5329912", "0.5329606", "0.5326063", "0.53254175", "0.5320789", "0.53190863", "0.53158545", "0.5313637", "0.53129596", "0.5311492", "0.5304909", "0.52930295", "0.52910435", "0.5289904" ]
0.0
-1
Function to Get Discount Amount
public function getDiscountAttribute() { return $this->cartItems->map(function ($item, $key) { return $item->subtotal; })->sum() * (1 - ($this->userPromotion->promotion->discount / 100)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getDiscountAmount();", "public function getTotalDiscountAmount();", "public function getTotalDiscount(): float;", "public function getBaseDiscountAmount();", "public function getShippingDiscountAmount();", "public function getTotaldiscount()\n {\n return $this->totaldiscount;\n }", "public function getDiscountedAmount()\n\t{\n\t\t$amount = $this->getAmount();\n\n\t\treturn $amount - ($amount * $this->discount);\n\t}", "public function getDiscountAmount() {\n return $this->item->getDiscountAmount();\n }", "public function getAmount();", "public function getAmount();", "public function getAmount();", "public function getAmount();", "public function getDiscountAmount()\n\t{\n\t\treturn $this->discount_amount;\n\t}", "public function getTotalWithDiscount()\n {\n return $this->totalWithDiscount;\n }", "public function getTonicDiscount()\n {\n }", "public function getBaseShippingDiscountAmount();", "public function getDiscount(): int\n {\n return $this->discount;\n }", "public function getDiscountAmount(){\n return $this->getParameter('discount_amount');\n }", "public function getDiscountAmount()\n {\n $total = 0;\n $discount = 0;\n \n foreach ($this->items as $item) {\n if ($item->Price) {\n $total += ($item->Price * $item->Quantity);\n }\n \n if ($item->Discount) {\n $discount += ($item->TotalDiscount);\n }\n }\n \n if ($discount > $total) {\n $discount = $total;\n }\n\n return $discount;\n }", "public function getItemDiscountAmount()\n {\n return $this->itemDiscountAmount;\n }", "public function getTotalAmount();", "public function getDiscountTaxCompensationAmount();", "public function getDiscount()\n\t{\n\t\treturn $this->getKeyValue('Discount'); \n\n\t}", "public function getDiscount()\n {\n return $this->discount;\n }", "public function getDiscount()\n {\n return $this->discount;\n }", "public function getDiscount()\n {\n return $this->discount;\n }", "public function getDiscount()\n {\n return $this->discount;\n }", "public function getDiscount()\n {\n return $this->discount;\n }", "public function getDiscount()\n {\n return $this->discount;\n }", "public function getDiscount()\r\n {\r\n return $this->discount;\r\n }", "function customerDiscount()\r\n\t{\r\n\t\t$sql = $GLOBALS['db']->Query(\"SELECT Wert FROM \" . PREFIX . \"_modul_shop_kundenrabatte WHERE GruppenId = '\".UGROUP.\"' LIMIT 1\");\r\n\t\t$row = $sql->fetchrow();\r\n\t\t$sql->close();\r\n\t\tif(is_object($row))\r\n\t\t\treturn $row->Wert;\r\n\t}", "public function getDiscountInvoiced();", "public function getAmount(): float;", "public function get_total_debit(){\n return $this->get_storage_cost() + $this->get_services_cost();\n }", "public function getInsuranceAmount();", "function get_total_discount() {\n\t\t\tif ($this->discount_total || $this->discount_cart) :\n\t\t\t\treturn cmdeals_price($this->discount_total + $this->discount_cart); \n\t\t\tendif;\n\t\t\treturn false;\n\t\t}", "function getDiscountFor($product) {\n\t\treturn 30;\n\t}", "function get_order_discount_total() {\n\t\t\treturn $this->discount_total;\n\t\t}", "public function getDiscountRefunded();", "private function amount()\n {\n // Divide and return\n return ceil($this->total / $this->limit);\n }", "public function getBaseDiscountAmount() {\n return $this->item->getBaseDiscountAmount();\n }", "public function getSubtotalDiscount()\n {\n $this->initializeSubtotals();\n\n return $this->getIfSet('discount', $this->data->amount->subtotals);\n }", "public function getGiftcardAmount();", "function calculateNetAmount()\n {\n return $this->sellingPrice - 10;\n }", "private function calcDiscountPercent()\n\t{\n\t if( $this->db->table_exists($this->c_table)) $record = $this->db->query(\"select * from {$this->c_table} where products_count<=? and order_amount<=? order by discount_percent desc\",array($this->products_count,$this->order_amount))->row_array();\n\t if(!@$record) return 0;\n\t return $record['discount_percent'];\n\t}", "function discMoney($discMo)\n{\n\tglobal $con;\n\t\n\t$query_ConsultaFuncion = sprintf(\"SELECT money FROM adm_discount_list WHERE code=%s\",\n\t\t\t\t\t\t\t\t\t\t GetSQLValueString($discMo, \"text\"));\n\t//echo $query_ConsultaFuncion;\n\t$ConsultaFuncion = mysqli_query($con, $query_ConsultaFuncion) or die(mysqli_error($con));\n\t$row_ConsultaFuncion = mysqli_fetch_assoc($ConsultaFuncion);\n\t$totalRows_ConsultaFuncion = mysqli_num_rows($ConsultaFuncion);\n\t\n\treturn $row_ConsultaFuncion[\"money\"];\t\n\t\n\tmysqli_free_result($ConsultaFuncion);\n}", "public function calculateDiscount(): ?float;", "public function getShippingDiscountTaxCompensationAmount();", "public function getPriceDiscount()\n\t{\n\t\treturn $this->priceDiscount;\n\t}", "public function getDollarPrice(): float;", "public function calculateDiscount(array $order): float;", "public function getCustomGiftcardAmount();", "public function getAmount(): string;", "function get_cart_discount_total() {\n\t\t\treturn $this->discount_cart;\n\t\t}", "public function discounts()\n {\n $discount = 0;\n foreach ($this->coupons as $coupon) {\n $discount += $coupon->getDiscountApplied($this);\n }\n return $discount;\n }", "function fuc_discount($product, $percentage){\r\n $discountValue = $product / 100 * $percentage;\r\n $totalValue = $product - $discountValue; \r\n return $totalValue;\r\n\r\n}", "public function getBaseItemDiscountAmount()\n {\n return $this->baseItemDiscountAmount;\n }", "function getDiscountedPrice()\n {\n if (!$this->hasDiscount()) return null;\n $price = $this->price;\n if ($this->discount_active) {\n $price = $this->discountprice;\n }\n// NOTE: Add more conditions and rules as desired, i.e.\n// if ($this->testFlag('Outlet')) {\n// $discountRate = $this->getOutletDiscountRate();\n// $price = number_format(\n// $price * (100 - $discountRate) / 100,\n// 2, '.', '');\n// }\n return $price;\n }", "public function getTotalAfterDiscount()\n\t{\n\t\treturn $this->getKeyValue('total_after_discount'); \n\n\t}", "public function getDiscountPercent() {\n return $this->item->getDiscountPercent();\n }", "public function getUnitAmount();", "public function getDiscountDescription();", "private function _calculateTotalDiscount($order){\n\t $storeCredit = $order->getCustomerBalanceAmount();\n\t $giftCardAmount = $order->getGiftCardsAmount();\n\t $totalDiscountAmount = $storeCredit + $giftCardAmount;\n\t return number_format($totalDiscountAmount, 2, '.', '');\n }", "public function getAmount()\n\t{\n\t\treturn $this->get('Amount');\n\t}", "function getDiscountByOrder($orders_id) {\n\t\t$sel_ord_query = tep_db_query(\"SELECT value FROM \" . TABLE_ORDERS_TOTAL . \" WHERE orders_id = '\".$orders_id.\"' AND (class = 'ot_customer_discount' OR class='ot_gv')\");\n\t\t$disctot = 0;\n\t\twhile($rst_arr = tep_db_fetch_array($sel_ord_query)) {\n\t\t\t$disctot += $rst_arr[\"value\"];\n\t\t}\n\t\treturn $disctot;\n\t}", "public function amount() {\r\n\t\treturn $this->amount;\r\n\t}", "function course_discounted_amount($price, $coupon)\n{\n $return_val = $price;\n if (!empty($coupon)) {\n $coupon_details = CourseCoupon::where('code', $coupon)->first();\n if (!empty($coupon_details)) {\n if ($coupon_details->discount_type === 'percentage') {\n $discount_bal = ($price / 100) * (int)$coupon_details->discount;\n $return_val = $price - $discount_bal;\n } elseif ($coupon_details->discount_type === 'amount') {\n $return_val = $price - (int)$coupon_details->discount;\n }\n }\n }\n\n return $return_val;\n}", "function get_total() {\n\t\t\treturn cmdeals_price($this->total);\n\t\t}", "public function getAmount() \n {\n return $this->_fields['Amount']['FieldValue'];\n }", "public function get_concession_amount(){\n $row = 100; //$this->fetch($run);\n return $row;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getDiscount()\n {\n $currency = $this->currency();\n\n return array_reduce(\n $this->tickets(),\n function ($carry, Category $ticket) {\n return $ticket->getDiscount()->plus($carry);\n },\n Money::fromCent($currency, 0)\n );\n }", "public function getAmount()\n {\n return $this->get(self::_AMOUNT);\n }", "public function getAmount()\n {\n return $this->get(self::_AMOUNT);\n }", "public function getAmount()\n {\n return $this->get(self::_AMOUNT);\n }", "public function getAmount()\n {\n return $this->get(self::_AMOUNT);\n }", "public function getAmount()\n {\n return $this->get(self::_AMOUNT);\n }", "private function getTotalCharge() {\n $result = 0;\n\n foreach ($this->rentals as $rental) {\n $result += $rental->getCharge();\n }\n return $result;\n\n }", "public function getamount()\n {\n return $this->amount;\n }", "function discPerc($discPe)\n{\n\tglobal $con;\n\t\n\t$query_ConsultaFuncion = sprintf(\"SELECT percent FROM adm_discount_list WHERE code=%s\",\n\t\t\t\t\t\t\t\t\t\t GetSQLValueString($discPe, \"text\"));\n\t//echo $query_ConsultaFuncion;\n\t$ConsultaFuncion = mysqli_query($con, $query_ConsultaFuncion) or die(mysqli_error($con));\n\t$row_ConsultaFuncion = mysqli_fetch_assoc($ConsultaFuncion);\n\t$totalRows_ConsultaFuncion = mysqli_num_rows($ConsultaFuncion);\n\t\n\treturn $row_ConsultaFuncion[\"percent\"];\t\n\t\n\tmysqli_free_result($ConsultaFuncion);\n}", "public function getAmount()\r\n {\r\n return $this->amount;\r\n }", "public function getAmount()\r\n {\r\n return $this->amount;\r\n }", "public function getAmount()\r\n {\r\n return $this->amount;\r\n }", "public function getAmount()\r\n {\r\n return $this->amount;\r\n }", "public function getAmount()\n {\n return $this->getData(self::AMOUNT);\n }", "public function discountOrChargeValueBoleta()\n {\n if($this->discount_or_charge_value > 0)\n return $this->discount_or_charge_value;\n else if ($this->discount_or_charge_percentage > 0)\n return (int) round( ($this->discount_or_charge_percentage / 100) * ($this->price * $this->quantity));\n else //pos sale without discount\n return 0;\n }", "public function getDepositAmount()\n {\n return $this->depositAmount;\n }", "public function getDiscountPercent()\n\t{\n\t\treturn $this->discount_percent;\n\t}", "public function getCapturedAmount();", "function getOutletDiscountRate()\n {\n $dayOfMonth = date('j');\n return 20 + $dayOfMonth;\n }", "public function getBalance()\n {\n return (float)$this->client->requestExecute(\"credit\");\n }", "public function getDollarPriceChange(): float;", "public function getBaseDiscountTaxCompensationAmount();", "function getDiscountedAmountForFirstPayment($payableAmount, $ccode=''){\n\t\t$payableAmount = floatval(preg_replace('/[^\\d.]/', '', $payableAmount));\n\t\t$sqlCouponDetail = \"Select * from `red_coupons` where `coupon_code`='$ccode' and status='1' and valid_untill > now() limit 1\";\n\t\t$retVal = $payableAmount;\n\t\t$rsCoupon = $this->db->query($sqlCouponDetail);\n\t\n\t\tif($rsCoupon->num_rows() > 0){\n\t\t\t\n\t\t\t$arrCoupon = $rsCoupon->result_array();\n\t\t\t$maxnumberOfMembers = $arrCoupon[0]['max_number_of_members'];\n\t\t\t$totalUsedYet = $this->countCouponUsed($ccode); \n\n\t\t\tif($totalUsedYet > $maxnumberOfMembers){\n\t\t\t\t$retVal = $payableAmount;\n\t\t\t}elseif($arrCoupon[0]['coupon_type']== 0){\t\t\t\t\n\t\t\t\t$retVal = $payableAmount - $arrCoupon[0]['coupon_value'];\n\t\t\t}else{\t\t\t\t\n\t\t\t\t$coupn_val = (100 - $arrCoupon[0]['coupon_value']);\n\t\t\t\t$pay_amt = $payableAmount * $coupn_val;\n\t\t\t\t$retVal =($pay_amt/100);\t\t\t\n\t\t\t}\t\n\t\t\t\n\t\t} else{\n\t\t\t\n\t\t\t$retVal = $payableAmount;\n\t\t} \n\t\t\n\t\treturn ($retVal < 0 )?0:$retVal;\t\n\t}", "public function getBaseTotalInvoiced();", "public function getDisplayTotalDiscountAttribute() {\n return Shop::format($this->totalDiscount);\n }", "function discount_amount($discount_amount=null)\n {\n if (isset($discount_amount)) $this->discount_amount = $discount_amount;\n return $this->discount_amount;\n }", "public function getAmount()\n {\n return $this->_fields['Amount']['FieldValue'];\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }", "public function getAmount()\n {\n return $this->amount;\n }" ]
[ "0.84302664", "0.83335197", "0.79235566", "0.77290076", "0.7558491", "0.7349132", "0.7328716", "0.7291661", "0.72876304", "0.72876304", "0.72876304", "0.72876304", "0.7282395", "0.7277308", "0.72446114", "0.7214619", "0.7203908", "0.7167703", "0.713902", "0.7127627", "0.7121591", "0.711799", "0.70830923", "0.706729", "0.706729", "0.706729", "0.706729", "0.706729", "0.706729", "0.70589715", "0.70571095", "0.7048482", "0.7007309", "0.6912464", "0.6896737", "0.68855196", "0.6856563", "0.68553764", "0.6842408", "0.67981285", "0.6793831", "0.67786205", "0.674836", "0.67412055", "0.6739325", "0.6737824", "0.6681099", "0.6662249", "0.6658858", "0.66533583", "0.6648178", "0.6647978", "0.6632042", "0.6628031", "0.66032326", "0.6602952", "0.6602447", "0.6588915", "0.6587218", "0.6580873", "0.65731174", "0.65686977", "0.65666515", "0.6551661", "0.6538945", "0.65363884", "0.65180176", "0.65166867", "0.65164983", "0.6514869", "0.65087223", "0.65052795", "0.650396", "0.650396", "0.650396", "0.650396", "0.650396", "0.6498787", "0.6495643", "0.6488278", "0.6486937", "0.6486937", "0.6486937", "0.6486937", "0.6472656", "0.6470353", "0.64691615", "0.64606595", "0.64603883", "0.6455788", "0.64531344", "0.6425587", "0.6418823", "0.6414763", "0.6414702", "0.6414414", "0.6410253", "0.6401568", "0.6398991", "0.6398991", "0.6398991" ]
0.0
-1
Function to Get Total
public function getTotalAttribute() { return $this->cartItems->map(function ($item, $key) { return $item->subtotal; })->sum(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getTotal();", "public function getTotal();", "public function total();", "public function total();", "public function total();", "public function get_total()\n {\n }", "abstract public function countTotal();", "public function getTotal() {\n return $this->get(self::TOTAL);\n }", "public function getTotalAmount();", "protected function getTotal()\n {\n $total = 0;\n foreach ($this->entries as $entry) {\n $total += $entry['price'] * $entry['quantity'];\n }\n\n return $total;\n }", "public function getTotal()\n {\n $cart = $this->getContent();\n\n $sum = array_reduce($cart->all(), function ($a, ItemCollection $item) {\n return $a += $item->getPrice(false);\n }, 0);\n\n return Helpers::formatValue(floatval($sum), $this->config['format_numbers'], $this->config);\n }", "public function getTotal() \n {\n $tax = $this->getTax(); \n return $this->_subtotal + $tax; \n }", "public function total(): float;", "public function total(): float;", "public function subtotal();", "public function getTotal()\n\t{\n\t\treturn $this->total;\n\t}", "public function getTotal() {\n\t\treturn $this->total;\n\t}", "public function getTotal(){\n $total=0;\n\n foreach ( $this->getOrderLines() as $ol){\n $total += $ol->getSubTotal();\n }\n \n return $total;\n }", "public function total()\n {\n \treturn $this->price()*$this->quantity;\n }", "public function getTotal(): float;", "public function itemTotal(): float;", "public function getTotal()\n {\n return $this->total;\n }", "public function getTotal()\n {\n return $this->total;\n }", "public function getTotal()\n {\n return $this->total;\n }", "public function getTotal()\n {\n return $this->total;\n }", "public function getTotal()\n {\n return $this->total;\n }", "public function getTotal()\n {\n return $this->total;\n }", "public static function searchTotal()\n\t{\n\t\t$total = self::all()->total();\n\t\treturn $total;\n\t}", "public function getTotal(){\n\t\treturn $this->_total;\n\t}", "public function getTotal(): int;", "public function formattedTotal(): string;", "public function getTotal() {\n\n }", "public function getTotal()\n\t{\n\t\treturn $this->getKeyValue('total'); \n\n\t}", "function getTotal()\n\t{\n\t\treturn $this->_total;\n\t}", "public function totalCount();", "public function totalCount();", "public function getTotal()\n {\n $subTotal = $this->getSubTotal(false);\n\n $newTotal = 0.00;\n\n $process = 0;\n\n $conditions = $this\n ->getConditions()\n ->filter(function (CartCondition $cond) {\n return $cond->getTarget() === 'total';\n });\n\n // if no conditions were added, just return the sub total\n if (!$conditions->count()) {\n return Helpers::formatValue($subTotal, $this->config['format_numbers'], $this->config);\n }\n\n $conditions\n ->each(function (CartCondition $cond) use ($subTotal, &$newTotal, &$process) {\n $toBeCalculated = ($process > 0) ? $newTotal : $subTotal;\n\n $newTotal = $cond->applyCondition($toBeCalculated);\n\n $process++;\n });\n\n return Helpers::formatValue($newTotal, $this->config['format_numbers'], $this->config);\n }", "public function total()\n {\n return $this->calculateTotal();\n }", "public function total(){\n\t\treturn $this->total;\n\t}", "public function getTotal()\n {\n return $this->getAmount() * $this->getPrice();\n }", "public function get_total(){\n $total = 0;\n \n // récupert tous les articles de la commande\n $articles = $this->get_all_articles();\n \n // parcourt ces articles\n foreach($articles as $a){\n $price = $a->get_price(true);\n \n // puis calcul le prix\n $total += $a->nb * $price;\n }\n \n return $total;\n }", "public function initTotal()\n {\n // Return val.\n $temp = 0;\n // Add cone price.\n $temp += $this->coneType['price'];\n // Add all scoops of ice cream.\n foreach ($this->scoops as $scoop) {\n $temp += $scoop['price'];\n }\n // Return total item cost.\n return $temp;\n }", "public function total()\n\t{\n\t\treturn $this->total;\n\t}", "function calculerTotal () {\n\t $total = 0;\n\t \n\t foreach ($this->lignes as $lp) {\n\t $prod = $lp->prod;\n\t $prixLigne = $prod->prix * $lp->qte ;\n\t $total = $total + $prixLigne ;\n\t }\n\t \n\t return $total;\n\t }", "function get_total() {\n\t\t\treturn cmdeals_price($this->total);\n\t\t}", "public function getGrandTotal();", "public function gettotal()\r\n {\r\n return $this->total;\r\n }", "public function total()\n {\n return $this->total;\n }", "public function total()\n {\n return $this->total;\n }", "public function getTotal()\n {\n return $this->totalCalculator->getCartTotal($this->cart);\n }", "public function get_total_items(){\n\t \t$total = 0;\n\t \t//Si no esta vacio va sumando la cantidad de articulos\n\t \tif(!empty($this->cart)){\n\t \t\tforeach ($this->cart as $linea){\n\t\t\t\t\t$total += $linea['amount'];\n\t\t\t\t}\n\t \t}\n\t \techo $total;\n\t }", "private function total()\n\t{\n\t\t//\tObteniendo los productos del carro.\n\t\t$cart = \\Session::get('cart');\n\t\t$total = 0;\n\t\t//\tSumando el precio de cada producto.\n\t\tforeach($cart as $item){\n\t\t\t$total += $item->precio * $item->cantidad;\n\t\t}\n\t\treturn $total;\n\t}", "public function getSubtotal();", "public function getTotal()\n {\n return ($this->amount + $this->tax_amount)* $this->currency_converter;\n }", "protected function calculatetotal()\n {\n $total = $this->UnitPrice() * $this->Quantity;\n $this->extend('updateTotal', $total);\n $this->CalculatedTotal = $total;\n return $total;\n }", "public function get_total()\n\t{\n\t\treturn $this->EE->cartthrob->cart->total();\n\t}", "public function total()\n {\n return $this->subtotal() + $this->shipping() + $this->vat()->sum();\n }", "public function getTotal() {\n\t\treturn $this->find('count', array(\n\t\t\t'contain' => false,\n\t\t\t'recursive' => false,\n\t\t\t'cache' => $this->alias . '::' . __FUNCTION__,\n\t\t\t'cacheExpires' => '+24 hours'\n\t\t));\n\t}", "public function total(){\n $total = $this->qualification + $this->referee_report + $this->interview;\n }", "public function getTotal() : int\n {\n return $this->total;\n }", "public function getTotal(){\n $cantidad = $this->cantidad;\n\t\treturn $this->productos\n\t\t\t\t\t\t->map(function($prod){return $prod->precio;})\n\t\t\t\t\t\t->reduce(function($acum, $elem)use($cantidad){\n return $acum + ($elem * $cantidad);\n });\n\t}", "function getTotal()\r\n\t{\r\n\t\tif( empty($this->_total) )\r\n\t\t{\r\n\t\t\t$this->_total\t= $this->_getListCount( $this->_query() );\r\n\t\t}\r\n\r\n\t\treturn $this->_total;\r\n\t}", "public function totals()\n {\n return $this->get(self::BASE_PATH.'/totals');\n }", "public function getTotal() {\n $sub = ($this->hasDiscount()) ? $this->SubTotal - $this->DiscountAmount : $this->SubTotal;\n\n return number_format($sub + $this->Postage + $this->TaxTotal, 2);\n }", "function getTotal()\r\n{\r\n if (empty($this->_total))\r\n {\r\n $query = $this->_buildQuery();\r\n $this->_total = $this->_getListCount($query);\r\n }\r\n \r\n return $this->_total;\r\n}", "public function getTotalPrice();", "public function getTotalPrice();", "public function total()\n {\n $total = 0;\n\n foreach ($this->contents() as $item) $total += (float)$item->total();\n\n return (float)$total;\n }", "function getTotals(){\n\t\treturn $this->cache->getTotals();\n\t}", "public function getTotal()\n {\n return $this->service()->getTotalOfOrder();\n }", "public function calculateTotal() {\n $result = 0;\n\n if(isset($_SESSION['user']['basket']))\n foreach ($_SESSION['user']['basket'] as $item)\n $result += $item['product']['price']*$item['quantity'];\n\n return $result;\n }", "public function get_total()\n\t{\n\t\t$query = $this->query;\n\t\tif(isset($query['order']))\n\t\t\t$query['order'] = $this->model->table() . '.id';\n\t\treturn $this->model->count($query);\n\t}", "public function provideTotal()\n {\n return [\n [[1, 2, 5, 8], 16],\n [[-1, 2, 5, 8], 14],\n [[1, 2, 8], 11]\n ];\n }", "function getTotal() {\r\n\t\tif (empty ( $this->_total )) {\r\n\t\t\t$query = $this->_buildQuery ();\r\n\t\t\t$this->_total = $this->_getListCount ( $query );\r\n\t\t}\r\n\t\treturn $this->_total;\r\n\t}", "public function getTotal():int{\r\n\t return (int)$this->_vars['total_items']??0;\r\n\t}", "protected function _getTotal()\n {\n return $this->formatPriceWithComma($this->_getOrder()->getGrandTotal());\n }", "function totals()\n\t{\n\t\treturn $this->_tour_voucher_contents['totals'];\n\t}", "public function total()\n {\n // $this->line_items\n $total_price = 0;\n foreach ($this->line_items as $key => $value) {\n $total_price = $total_price + $value->product->price_amount;\n }\n // dd();\n return $total_price;\n }", "public function getTotal(): string\n {\n return $this->total;\n }", "function getTotal()\n\t{\n\t\tif (empty($this->_total)) {\n\t\t\t$query = $this->_buildQuery();\n\t\t\t$this->_total = $this->_getListCount($query); \n\t\t}\n\t\treturn $this->_total;\n\t}", "public function getTotalCount();", "public function getTotalCount();", "public function getTotalCount();", "public function Total()\n {\n if ($this->Order()->IsCart()) { //always calculate total if order is in cart\n return $this->calculatetotal();\n }\n return $this->CalculatedTotal; //otherwise get value from database\n }", "public function getMontoTotal() {\n $command = Yii::app()->db->createCommand()\n ->select('sum(t.monto) as total')\n ->from('pago t');\n return $command->queryRow()['total'];\n }", "function getTotal()\n\t{\n\t\tif (empty($this->_total)) {\n\t\t\t$query = $this->_buildQuery();\n\t\t\t$this->_total = $this->_getListCount($query);\n\t\t}\n\t\treturn $this->_total;\n\t}", "public function getTotalResults();", "public function getTotal()\n {\n return $this->getQty() * $this->getProduct()->getPrice();\n }", "public function reporteMensualTotal(){\n\n }", "public function total(){\n return $this->cart_contents['cart_total'];\n }", "function getTotal() {\n\t\tif (empty($this->_total)) {\n\t\t\t$query = $this->_buildQuery();\n\t\t\t$this->_total = $this->_getListCount($query);\n\t\t}\n\n\t\treturn $this->_total;\n\t}", "public function getValorTotal(){\n $sum = 0;\n foreach($this->itens as $i):\n $sum += $i->getPreco() * $i->getQuantidade();\n endforeach;\n\n return $sum;\n }", "public function netTotal(): float;", "public function total()\n {\n $total = 0;\n foreach($this->_data as &$product) {\n $total += ($product['price'] * $product['quantity']);\n }\n\n return $total;\n }", "public function totcarte()\n {\n $detalle = FacturaDet::join('factura_cab', 'factura_cab.numfac', '=', 'factura_det.numfac')\n ->select(DB::raw('sum(cantserv*valserv) as total'))\n ->where('factura_cab.estfac','<>','0')\n ->where('factura_cab.estfac','<>','1')\n ->first();\n $total=$detalle->total+0;\n $pagos = Pago::select(DB::raw('sum(valpago) as total'))\n ->first();\n if($pagos)\n $pagado = $pagos->total;\n else\n $pagado=0;\n $total = $total - $pagado;\n return $total;\n }", "function exibeTotal($params, &$smarty){\n return $this->NumResult;\n }", "public function total()\n\t{\n\t\treturn array_get($this->cart_contents, $this->cart_name . '.cart_total', 0);\n\t}", "public function getBaseGrandTotal();", "public static function total()\n {\n $total = 0;\n if (isset($_SESSION['cart']) && $_SESSION['cart'] != null) {\n foreach ($_SESSION['cart'] as $cart) {\n $total += $cart['qty'];\n }\n }\n return $total;\n }", "function getTotalPrice()\n {\n $total = 0;\n foreach ($_SESSION['cart'] as $key => $value) {\n $total += $_SESSION['cart'][$key]['total'];\n }\n return $total;\n }", "public function getCartTotal()\n {\n }" ]
[ "0.8709243", "0.8709243", "0.86939377", "0.86939377", "0.86939377", "0.82258415", "0.8216955", "0.8112814", "0.8099936", "0.8020833", "0.7952092", "0.7942201", "0.794125", "0.794125", "0.7929529", "0.7890795", "0.78890616", "0.7880917", "0.7870087", "0.7864581", "0.7859495", "0.78499335", "0.78499335", "0.78499335", "0.78499335", "0.78499335", "0.78499335", "0.783428", "0.78272843", "0.7810785", "0.7798676", "0.7793274", "0.7792492", "0.7766408", "0.7744855", "0.7744855", "0.7726394", "0.77225125", "0.77218574", "0.77102435", "0.76769906", "0.7663042", "0.7661538", "0.7647866", "0.7635945", "0.7603421", "0.7601487", "0.75920385", "0.75920385", "0.7587488", "0.75791895", "0.75672996", "0.75345427", "0.75324595", "0.74865794", "0.74781144", "0.74761254", "0.74710995", "0.74593383", "0.74364537", "0.74308276", "0.74279237", "0.7423359", "0.7419969", "0.74179846", "0.7411592", "0.7411592", "0.74110246", "0.740436", "0.73718566", "0.7363429", "0.7362834", "0.7359503", "0.735623", "0.7350587", "0.733522", "0.7332077", "0.7328508", "0.7319076", "0.73060143", "0.7295414", "0.7295414", "0.7295414", "0.72948855", "0.72720516", "0.72592556", "0.72540313", "0.72533613", "0.7251275", "0.72375894", "0.72358894", "0.723038", "0.72218925", "0.72153616", "0.7190364", "0.71840656", "0.71788025", "0.7174106", "0.7166633", "0.7165915", "0.7165048" ]
0.0
-1
Function to Get Grand Total
public function getGrandTotalAttribute() { $total = $this->cartItems->map(function ($item, $key) { return $item->subtotal; })->sum(); if ($this->userPromotion) { $total *= ($this->userPromotion->promotion->discount / 100); } $total += $this->deliveryOption->cost; return $total; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getGrandTotal();", "public function getBaseGrandTotal();", "protected function calculateGrandTotal()\n {\n $this->grandTotal = $this->subTotal + $this->gst + $this->unit->securityDeposit;\n }", "function getGrandtotal()\n {\n return $this->grandtotal;\n }", "public function getBaseGrandTotal(){\n return $this->_getData(self::BASE_GRAND_TOTAL);\n }", "public function total();", "public function total();", "public function total();", "public function subtotal();", "public function getTotal();", "public function getTotal();", "public function calculate_grand_total() {\n\n $this->total_price = $this->individual_products_total + ($this->meal_deal_count * 3);\n\n $this->total = floatval(number_format($this->total_price, 2,'.',''));\n\n // Formats the final total into json format\n\n return $total_array = Array (\n 'total' => $this->total,\n );\n\n }", "public function getGrandTotal()\n {\n return $this->getOrder()->getGrandTotal();\n }", "function getGrandTotal(){\n\t\t$data = $this->_collectShippingInfo();\n\t\treturn $data->getGrandTotalInclTax();\n\t}", "public function getSubtotal();", "public function getTotal() \n {\n $tax = $this->getTax(); \n return $this->_subtotal + $tax; \n }", "public function get_total()\n {\n }", "protected function _getTotal()\n {\n return $this->formatPriceWithComma($this->_getOrder()->getGrandTotal());\n }", "public function getGrandTotal(): Money\n {\n // Grand total:\n $total = new Money(\"0.00\", $this->_currency);\n\n foreach ($this->_items as $item) {\n $total = $total->add($item->getTotalAfterTaxes());\n }\n\n return $total;\n }", "public function getGrandTotal()\n {\n if (!isset($this->grandTotal)) {\n $this->getProducts();\n }\n\n return $this->grandTotal;\n }", "public function getGrossTotal(): float;", "public function getMinOrderTotal();", "public function getOrderBaseGrandTotal(){\n return $this->_getData(self::ORDER_BASE_GRAND_TOTAL);\n }", "public function getTotal(){\n $total=0;\n\n foreach ( $this->getOrderLines() as $ol){\n $total += $ol->getSubTotal();\n }\n \n return $total;\n }", "public function getTotalAmount();", "public function getMaxOrderTotal();", "public function getTotal()\n {\n $subTotal = $this->getSubTotal(false);\n\n $newTotal = 0.00;\n\n $process = 0;\n\n $conditions = $this\n ->getConditions()\n ->filter(function (CartCondition $cond) {\n return $cond->getTarget() === 'total';\n });\n\n // if no conditions were added, just return the sub total\n if (!$conditions->count()) {\n return Helpers::formatValue($subTotal, $this->config['format_numbers'], $this->config);\n }\n\n $conditions\n ->each(function (CartCondition $cond) use ($subTotal, &$newTotal, &$process) {\n $toBeCalculated = ($process > 0) ? $newTotal : $subTotal;\n\n $newTotal = $cond->applyCondition($toBeCalculated);\n\n $process++;\n });\n\n return Helpers::formatValue($newTotal, $this->config['format_numbers'], $this->config);\n }", "function get_total() {\n\t\t\treturn cmdeals_price($this->total);\n\t\t}", "public function initTotal()\n {\n // Return val.\n $temp = 0;\n // Add cone price.\n $temp += $this->coneType['price'];\n // Add all scoops of ice cream.\n foreach ($this->scoops as $scoop) {\n $temp += $scoop['price'];\n }\n // Return total item cost.\n return $temp;\n }", "public function total(): float;", "public function total(): float;", "abstract public function countTotal();", "public function getBaseSubtotal();", "public function formattedTotal(): string;", "public function getTotal() {\n return $this->get(self::TOTAL);\n }", "public function getBaseTotalRefunded();", "public function getPurchaseGrandTotal() {\n return $this->purchaseGrandtotal; \n }", "public function itemTotal(): float;", "public function getSubTotal() {\n $total = 0;\n\n // Calculate total from items in the list\n foreach($this->Items() as $item) {\n $total += $item->getSubTotal();\n }\n\n return $total;\n }", "public function subtotal()\n {\n $subTotal = 0;\n foreach($this->items as $item) {\n $subTotal += $item->get(Cart\\Item::KEY_AMOUNT);\n }\n return $subTotal;\n }", "public function total()\n {\n \treturn $this->price()*$this->quantity;\n }", "function calculerTotal () {\n\t $total = 0;\n\t \n\t foreach ($this->lignes as $lp) {\n\t $prod = $lp->prod;\n\t $prixLigne = $prod->prix * $lp->qte ;\n\t $total = $total + $prixLigne ;\n\t }\n\t \n\t return $total;\n\t }", "public function getTotal()\n {\n if($this->getQuote() instanceof Mage_Sales_Model_Quote)\n {\n $total = $this->getQuote()->getGrandTotal();\n } else {\n $total = 0;\n }\n\n return $total;\n }", "public function getGrandTotalAmount()\n {\n return $this->grandTotalAmount;\n }", "public function getTotal(){\n\t\treturn $this->_total;\n\t}", "public static function searchTotal()\n\t{\n\t\t$total = self::all()->total();\n\t\treturn $total;\n\t}", "public function getTotal(): float;", "public function getBaseTotalPaid();", "public function getSubtotal(){\n return $this->_getData(self::SUBTOTAL);\n }", "public function total(){\n\t\treturn $this->total;\n\t}", "public function getTotal() {\n\t\treturn $this->total;\n\t}", "public function gettotal()\r\n {\r\n return $this->total;\r\n }", "public function getTotal()\n {\n $cart = $this->getContent();\n\n $sum = array_reduce($cart->all(), function ($a, ItemCollection $item) {\n return $a += $item->getPrice(false);\n }, 0);\n\n return Helpers::formatValue(floatval($sum), $this->config['format_numbers'], $this->config);\n }", "function getTotal()\n\t{\n\t\treturn $this->_total;\n\t}", "public function getTotal()\n\t{\n\t\treturn $this->total;\n\t}", "public function getTotal()\n {\n return $this->getAmount() * $this->getPrice();\n }", "public function getTotal()\n {\n return $this->total;\n }", "public function getTotal()\n {\n return $this->total;\n }", "public function getTotal()\n {\n return $this->total;\n }", "public function getTotal()\n {\n return $this->total;\n }", "public function getTotal()\n {\n return $this->total;\n }", "public function getTotal()\n {\n return $this->total;\n }", "public function getSubtotalAddition()\n {\n $this->initializeSubtotals();\n\n return $this->getIfSet('addition', $this->data->amount->subtotals);\n }", "public function total()\n {\n return $this->calculateTotal();\n }", "public function total()\n\t{\n\t\treturn $this->total;\n\t}", "public function get_total()\n\t{\n\t\treturn $this->EE->cartthrob->cart->total();\n\t}", "public function getTotal()\n\t{\n\t\treturn $this->getKeyValue('total'); \n\n\t}", "protected function calculatetotal()\n {\n $total = $this->UnitPrice() * $this->Quantity;\n $this->extend('updateTotal', $total);\n $this->CalculatedTotal = $total;\n return $total;\n }", "public function getTotal(): int;", "public function getBaseTotal()\n {\n return ($this->amount + $this->tax_amount) ;\n }", "public function getTotal()\n {\n return ($this->amount + $this->tax_amount)* $this->currency_converter;\n }", "public function get_totals() {\n\t\treturn empty( $this->totals ) ? $this->default_totals : $this->totals;\n\t}", "public function total()\n {\n return $this->total;\n }", "public function total()\n {\n return $this->total;\n }", "public function getTotal() {\n $sub = ($this->hasDiscount()) ? $this->SubTotal - $this->DiscountAmount : $this->SubTotal;\n\n return number_format($sub + $this->Postage + $this->TaxTotal, 2);\n }", "protected function getTotal()\n {\n $total = 0;\n foreach ($this->entries as $entry) {\n $total += $entry['price'] * $entry['quantity'];\n }\n\n return $total;\n }", "public function getBaseTotalOnlineRefunded();", "public function netTotal(): float;", "function getTotals(){\n\t\treturn $this->cache->getTotals();\n\t}", "public function getSubTotalCost()\n {\n $total = 0;\n\n foreach ($this->items as $item) {\n if ($item->SubTotal) {\n $total += $item->SubTotal;\n }\n }\n \n return $total;\n }", "public function total()\n {\n return $this->subtotal() + $this->shipping() + $this->vat()->sum();\n }", "public function getTotal()\n {\n return $this->totalCalculator->getCartTotal($this->cart);\n }", "public function totcarte()\n {\n $detalle = FacturaDet::join('factura_cab', 'factura_cab.numfac', '=', 'factura_det.numfac')\n ->select(DB::raw('sum(cantserv*valserv) as total'))\n ->where('factura_cab.estfac','<>','0')\n ->where('factura_cab.estfac','<>','1')\n ->first();\n $total=$detalle->total+0;\n $pagos = Pago::select(DB::raw('sum(valpago) as total'))\n ->first();\n if($pagos)\n $pagado = $pagos->total;\n else\n $pagado=0;\n $total = $total - $pagado;\n return $total;\n }", "function totals()\n\t{\n\t\treturn $this->_tour_voucher_contents['totals'];\n\t}", "public function subtotal()\n\t{\n\t\tif(count($this->cart) > 0)\n\t\t{\n\t\t\t$products = \\Model_Products::build();\n\t\t\tforeach($this->cart as $key => $item)\n\t\t\t{\n\t\t\t\t$products->or_where('ProductID', $key);\n\t\t\t}\n\t\t\t$products->selector('Product_Price, ProductID');\n\n\t\t\t$prices = $products->execute();\n\n\t\t\t$subtotal = 0;\n\n\t\t\tforeach($prices as $price)\n\t\t\t{\n\t\t\t\t$subtotal += (int)$price->Product_Price*$this->cart[$price->ProductID];\n\t\t\t}\n\t\t\t\n\t\t\treturn $subtotal;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t}", "public function getFinalTotalCosts()\n {\n return $this->getProductsCostTotal() +\n $this->getFinalTaxesTotal();\n }", "public function getBaseTotalInvoiced();", "public function getNetTotal()\n\t{\n\t\treturn $this->getKeyValue('net_total'); \n\n\t}", "function grandTotal($param1 = '', $param2 = '', $param3 = '') {\r\n if ($this->session->userdata('accountant_login') != 1)\r\n redirect(base_url(), 'refresh');\r\n $page_data['page_name'] = 'grandTotal';\r\n $page_data['page_title'] = get_phrase('Grand Total');\r\n $this->db->order_by('creation_timestamp', 'desc');\r\n $page_data['invoices'] = $this->db->get('invoice')->result_array();\r\n $this->load->view('index', $page_data);\r\n }", "function getSubTotal()\n {\n return $this->_cart->getQuote()->getSubtotal();\n }", "public function get_total(){\n $total = 0;\n \n // récupert tous les articles de la commande\n $articles = $this->get_all_articles();\n \n // parcourt ces articles\n foreach($articles as $a){\n $price = $a->get_price(true);\n \n // puis calcul le prix\n $total += $a->nb * $price;\n }\n \n return $total;\n }", "public function reporteMensualTotal(){\n\n }", "public function Total()\n {\n if ($this->Order()->IsCart()) { //always calculate total if order is in cart\n return $this->calculatetotal();\n }\n return $this->CalculatedTotal; //otherwise get value from database\n }", "private function get_total_tax() {\n\n\t\t$taxes = $this->order->getCombinedTax();\n\n\t\t$tax = 0;\n\n\t\tif ( empty( $taxes ) ) {\n\t\t\treturn $tax;\n\t\t}\n\n\t\tforeach( $taxes as $name => $amount ) {\n\t\t\t$tax += $amount;\n\t\t}\n\n\t\treturn $tax;\n\t}", "function getSubtotal()\n\t{\n\t\t// Lets load the content if it doesn't already exist\n\t\tif (empty($this->_subtotal))\n\t\t{\n\t\t\t$query = $this->_buildSuburbs();\n\t\t\t$this->_subtotal = $this->_getListCount($query);\n\t\t}\n\n\t\treturn $this->_subtotal;\n\t}", "public function totalCount();", "public function totalCount();", "public function subtotal()\n {\n return $this->getCartItemCollection()->sum(function (CartItem $item) {\n return $item->subtotal();\n });\n }", "public function getTotal() {\n\n }", "public function totals()\n {\n return $this->get(self::BASE_PATH.'/totals');\n }" ]
[ "0.832193", "0.8175735", "0.7521551", "0.7482516", "0.745836", "0.74203646", "0.74203646", "0.74203646", "0.7349703", "0.73092246", "0.73092246", "0.72976315", "0.72636557", "0.7262349", "0.7193209", "0.7171401", "0.7169862", "0.7131957", "0.7110753", "0.7110291", "0.70979846", "0.7075325", "0.7069548", "0.7060514", "0.70302045", "0.69998145", "0.6983116", "0.6934932", "0.69293714", "0.6925444", "0.6925444", "0.6907263", "0.6899548", "0.688703", "0.68853045", "0.6852846", "0.6851682", "0.6845453", "0.6794872", "0.67939854", "0.6792418", "0.67749184", "0.6767789", "0.676502", "0.67632276", "0.6760943", "0.6756517", "0.6756175", "0.6744674", "0.6729535", "0.6721199", "0.6719478", "0.67163604", "0.6709992", "0.66852105", "0.6682832", "0.66729575", "0.66729575", "0.66729575", "0.66729575", "0.66729575", "0.66729575", "0.66721874", "0.66697973", "0.66649437", "0.6664931", "0.6650738", "0.6645818", "0.66455466", "0.6623915", "0.66229355", "0.6619809", "0.66123986", "0.66123986", "0.6585247", "0.6584563", "0.6565595", "0.6565005", "0.6555319", "0.6550406", "0.65475863", "0.6532524", "0.65119255", "0.6511419", "0.65107954", "0.6505948", "0.6504533", "0.65025043", "0.6501845", "0.6501596", "0.64991415", "0.6492701", "0.6490534", "0.64904106", "0.6480149", "0.647675", "0.647675", "0.6475785", "0.64564615", "0.6455698" ]
0.67056954
54
La carte suivante de l'emplacement d'origine est maintenant visible
private function set_card_visibility(&$move, $mode) { $iLastFrom = count($move['from']) - 1; if($iLastFrom >= 0) { $move['from'][$iLastFrom]->display = true; $this->currentScore += 20; } // La carte parente de l'emplacement de destination n'est plus visible si mouvement inversé $iLastTo = count($move['to']) - 2; if($iLastTo >= 0 && $mode == 'reverse') { $move['to'][$iLastTo]->display = false; $this->currentScore -= 20; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getVisible() {return $this->readVisible();}", "function getVisible() { return $this->readVisible(); }", "function getVisible() { return $this->readVisible(); }", "public function inOriginal();", "public function isVisible();", "public function isVisible();", "public function alejarCamaraPresidencia() {\n\n self::$presidencia->alejarZoom();\n\n }", "public function videPanier()\n {\n $this->CollProduit->vider();\n }", "public function setupVisibility();", "public function canBeEdited()\n {\n return true; ///< Every client sees only it's own information\n }", "public function viewableByOwnerOnly();", "public function filterVisible(): self;", "public function esPublica()\n {\n return false;\n }", "public function is_visible() {\n\t\treturn true;\n\t}", "public function isVisitante(){ return false; }", "public function isOriginVisible()\n {\n return (\n $this->isInformationVisible() && \n Mage::getStoreConfigFlag(self::XML_PATH_OPTIONS_DISPLAY_ORIGIN)\n ) ? true : false;\n }", "public function moverse(){\n\t\techo \"Soy $this->nombre y me estoy moviendo a \" . $this->getVelocidad();\n\t}", "public function getInvisibleFlag() {}", "public function inPreview();", "function isVisible() {\n return $this->entry->staff_id && $this->entry->type == 'R'\n && !parent::isEnabled();\n }", "public function setVisibility() {}", "private function metodo_privado() {\n }", "public function get_visibility()\n {\n }", "public function AggiornaPrezzi(){\n\t}", "public function isVisible() :bool {\n return false;\n }", "public function stampaDipendenti() {\n echo '<p> Nome: ' . $this->nome . '</p>';\n echo '<p> Cognome: ' . $this->cognome . '</p>';\n echo '<p> Software utilizzati: ' . $this->software . '</p>';\n }", "public function shouldHaveOwnerVisibility()\n {\n $this->makeVisible([\n 'card_brand',\n 'card_last_four',\n 'card_country',\n 'billing_address',\n 'billing_address_line_2',\n 'billing_city',\n 'billing_state',\n 'billing_zip',\n 'billing_country',\n 'extra_billing_information',\n ]);\n }", "final function velcom(){\n }", "function visible_to_admin_user()\n\t{\n\t\treturn true;\n\t}", "public function enfocarCamaraPresidencia() {\n\n self::$presidencia->enfocar();\n\n }", "function isVisible() {\n return ($this->entry->staff_id || $this->entry->user_id)\n && $this->entry->type != 'R' && $this->isEnabled();\n }", "public function reprova()\n {\n $this -> estadoAtual -> reprova($this);\n }", "private function add_model_visibility()\n {\n }", "function is_visible()\n\t{\n\t\treturn $this->visible;\n\t}", "public function testSetPaInvisible() {\n\n $obj = new Collaborateurs();\n\n $obj->setPaInvisible(true);\n $this->assertEquals(true, $obj->getPaInvisible());\n }", "public function getPanose() {}", "public function publicaciones() //Lleva ID del proveedor para hacer carga de BD\r\n\t{\r\n\t\t//Paso a ser totalmente otro modulo para generar mejor el proceso de visualizacion y carga de datos en la vistas\r\n\r\n\t}", "public function extra_voor_verp()\n\t{\n\t}", "public function setPublic()\n {\n $this->private = false;\n }", "public function isVisible()\n {\n return true;\n }", "public function present();", "function archobjet_autoriser() {\n}", "public function setHidden(){\n $this->_hidden = true;\n }", "function hideExhibit(){\n\t\t$this->setVisible('0');\n\t\t$res = requete_sql(\"UPDATE exhibit SET visible = '\".$this->visible.\"' WHERE id = '\".$this->id.\"' \");\n\t\tif ($res) {\n\t\t\treturn TRUE;\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function metodo_publico() {\n }", "function is_visible() {\n\t\tif ($this->visibility=='hidden') return false;\n\t\tif ($this->visibility=='visible') return true;\n\t\tif ($this->visibility=='search' && is_search()) return true;\n\t\tif ($this->visibility=='search' && !is_search()) return false;\n\t\tif ($this->visibility=='catalog' && is_search()) return false;\n\t\tif ($this->visibility=='catalog' && !is_search()) return true;\n\t}", "public function Latir() { //Irá receber da superclasse,apenas alteramos para o que queremos.\n return ' <b>Não conseguio latir!</b>'; // Retorne o latido\n parent::Latir();\n }", "public function isCatalogOriginVisible()\n {\n return (\n $this->isCatalogInformationVisible() && Mage::getStoreConfigFlag(self::XML_PATH_CATALOG_DISPLAY_ORIGIN)\n ) ? true : false;\n }", "public function ouvrir()\n {\n // On enregistre l'ouverture\n if ($this->set('mission_statut', 1)) {\n return true;\n } else {\n return false;\n }\n }", "function isVisible() {\n return $this->entry->staff_id && $this->entry->type == 'R'\n && $this->isEnabled();\n }", "public static function right_public(){return false;}", "private function ajoutauteur() {\n\t\t$this->_ctrlAuteur = new ControleurAuteur();\n\t\t$this->_ctrlAuteur->auteurAjoute();\n\t}", "public function panLeftCamaraPresidencia() {\n\n self::$presidencia->moverALaIzquierda();\n }", "static public function isVisible(): bool\n {\n return static::$visible;\n }", "public function recap(){\n\t\techo \"----- INFO\" . $this->getNom() . \" ----- <br>\";\n\t\techo $this->getNom() . \" a \" . $this->getVie() . ' points de vie <br>';\n\t}", "public function inativarregistroAction()\n\t{\n\n\t}", "protected function editar()\n {\n }", "public function RicercaAvanzata(){\n $view = new VRicerca();\n $view->mostraFiltri();\n }", "public function movedElementsCanNotBeFoundAtTheirOrigin() {}", "public function Latir() { //Irá receber da superclasse,apenas alteramos para o que queremos.\n return ' <b>Latiu baixo!</b>'; // Retorne o latido\n parent::Latir();\n }", "function formulaires_editer_adresse_traiter_dist($id_adresse='new', $objet='', $id_objet='', $retour=''){\n\tif ($retour) refuser_traiter_formulaire_ajax();\n $retours = formulaires_editer_objet_traiter('adresse', $id_adresse, '', '', $retour, '');\n $retours['editable'] = true;\n $retours['message_ok'] = _T('vacarme_commande:message_modification_enregistree');\n return $retours;\n}", "function afficher()\r\n\t{\r\n\t\t\r\n\t\tif (!empty($this->zones) || !empty($this->blocs) )\r\n\t\t{\r\n\t\t\t//:: On configure les zones obligatoires\r\n\t\t\t\tif (empty($this->zones['Menu_Log'])) $this->zone('Menu_Log', menu('membre'));\r\n\r\n\t\t\t\tif (empty($this->zones['description'])) $this->zone('description', DESCRIPTION);\r\n\t\t\t\tif (empty($this->zones['keywords'])) $this->zone('keywords', KEYWORDS);\r\n\t\t\t\t$this->zone('nom', NOM);\r\n\t\t\t\t\r\n\t\t\t\t// On s'occupe du chemin des fichiers\r\n\t\t\t\t$this->zone( 'baseUrl', URL ); $this->zone( 'design', $this->style );\r\n\t\t\t\t\r\n\t\t\t\tif (is_admin()) $this->zone('jvs-admin', '<script type=\"text/javascript\" src=\"javascript/-admin.js\"></script>');\r\n\t\t\t\t\r\n\t\t\t\t// Nouveaux messages \r\n\t\t\t\r\n\t\t\t\t// Antibug\r\n\t\t\t\tif ($this->zones['img_titre']!=\"<!-- rien -->\") $this->zone('img_titre', '<img src=\"theme/images/content.png\" class=\"title\" alt=\"\" />');\r\n\t\t\t\t\t\t\t\r\n\t\t\t// Ouverture du template //\r\n\t\t\t$fichier=$this->chemin.$this->template.'.tpl.php';\r\n\t\t\t$source = fopen($fichier, 'r');\r\n\t\t\t$this->design = fread($source, filesize ($fichier));\r\n\t\t\tfclose($source);\r\n\t\t\t\r\n\t\t\t// Parsage du template\r\n\t\t\tforeach ($this->zones as $zone => $contenu)\r\n\t\t\t{\r\n\t\t\t\t$this->design = preg_replace ('/{::'.$zone.'::}/', $contenu, $this->design);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Suppresion des {::xxxx::} inutilisées\r\n\t\t\t$this->design = preg_replace ('/{::[-_\\w]+::}/', '', $this->design);\r\n\r\n\t\t\t// On remplace les blocs par leurs contenus //\r\n\t\t\tforeach($this->blocs as $nomBloc => $occurences)\r\n\t\t\t{\r\n\t\t\t\tpreg_match( '#{--'.$nomBloc.'--}(.*){--/'.$nomBloc.'/--}#ms', $this->design, $contenuBloc );\r\n\t\t\t\t$contenuBloc=$contenuBloc[1];\r\n\t\t\t\t\r\n\t\t\t\t$idNewTab=0; unset($nomZones);\r\n\t\t\t\tforeach($occurences as $occurence => $zones)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (!isset($nomZones))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$nomZones=$zones;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$i=0;\r\n\t\t\t\t\t\t$newBloc[$idNewTab]=$contenuBloc;\r\n\t\t\t\t\t\tforeach($zones as $remplacement)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$newBloc[$idNewTab]=preg_replace ('/{:'.$nomZones[$i].':}/', $remplacement, $newBloc[$idNewTab]);\r\n\t\t\t\t\t\t\t$i++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$idNewTab++;\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\t$newContenuBloc=implode(\"\", $newBloc);\r\n\t\t\t\t$this->design = preg_replace ('#{--'.$nomBloc.'--}(.*){--/'.$nomBloc.'/--}#ms', $newContenuBloc, $this->design);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Suppression des blocs inutilisés\r\n\t\t\t$this->design = preg_replace ('#{--(.*)--}(.*){--/(.*)/--}#ms', '', $this->design);\r\n\r\n\t\t\t\r\n\t\t\t// Affichage du résultat final\r\n\t\t\t//$this->design = preg_replace ('/('.CHR(9).'|'.CHR(13).'|'.CHR(10).')/', \"\", $this->design);\r\n\r\n\t\t\t// Affichage du résultat final\r\n\t\t\techo $this->design;\r\n\t\t}\r\n\t}", "public function getHidden(): bool;", "public function partirAuTravail(): void\n\t{\n\t}", "public function getVisible()\n {\n return $this->visible;\n }", "public function getVisible()\n {\n return $this->visible;\n }", "public function getVisible()\n {\n return $this->visible;\n }", "public function getVisible()\n {\n return $this->visible;\n }", "public function getVisible()\n {\n return $this->visible;\n }", "public function getVisible()\n {\n return $this->visible;\n }", "public function init()\r\n {\r\n parent::init();\r\n $this->visible = true;\r\n $this->descriptionashint = true;\r\n $this->active = false;\r\n }", "abstract public function isVisibleToUser(User $user);", "public function mostrarA(){\n \n echo \"Classe a) Publico = {$this->publico}<br>\";\n echo \"Classe a) Privado = {$this->privado}<br>\"; \n echo \"Classe a) Protegido = {$this->protegido}<br>\";\n }", "public function carganoticiaspublic_ini(){\n\t\t$informacion=DB::table('MODBID_INFORMACIONPUBLIC')\t\t\t\t\t\t\n\t\t\t\t\t\t->select(DB::RAW('id,titulo,texto,foto,tipo,created_at,updated_at,id_usuario,fecha_noticia'))\n\t\t\t\t\t\t->where('borrado','=',0)\n\t\t\t\t\t\t->orderby('fecha_noticia')\n\t\t\t\t\t\t->get();\n\n\t\treturn View::make('modulobid/vista1',array('informacion'=>$informacion));\n\t}", "public function Latir() { //Irá receber da superclasse,apenas alteramos para o que queremos.\n return ' <b>Latiu alto!</b>'; // Retorne o latido\n parent::Latir();\n }", "public function keepAttribution()\n {\n return $this->addAction(Flag::keepAttribution());\n }", "public function nom_alien()\r\n{\r\n return $this->_nom_alien;\r\n}", "function cl_criterioavaliacaodisciplina() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"criterioavaliacaodisciplina\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function publicacioAction()\n {\n $idGal = (int) $this->getRequest()->getParam(\"id\",0);\n \n //passo page per quedarnos a la pàgina d'on venim\n $page = (int) $this->getRequest()->getParam(\"page\",0);\n //valor de publicar o despublicar\n $valor = (int) $this->getRequest()->getParam(\"val\",0);\n \n $controller = $this->getRequest()->getparam(\"c\",0);\n \n \n $this->_galeriaDoctrineDao->privacitat($idGal,$valor);\n \n if($controller ==='index'){\n $this->_redirect('/admin/index');\n }else{\n $this->_redirect('/admin/galeria/listado/page/'.$page);\n }\n }", "public function __clone()\n {\n echo 'Objet cloné<br/>';\n }", "public function executeVisu(sfWebRequest $request) {\n $this->forward404Unless($cp_etablissement = Doctrine_Core::getTable('CpEtablissement')->find(array($request->getParameter('cp_etablissement_id'))), sprintf('Object cp_etablissement does not exist (%s).', $request->getParameter('cp_etablissement_id')));\n $this->cp_etablissement = $cp_etablissement;\n\n /*\n * récuprération des informations de la fiche pour centrer la carte GoogleMap\n */\n //utilisation des coordonnées\n\n $val_test = 0;\n if (($cp_etablissement->getCpEtablissementLatitude() != '0.000000000'\n && !is_null($cp_etablissement->getCpEtablissementLatitude())\n && $cp_etablissement->getCpEtablissementLatitude() != '')\n && ($cp_etablissement->getCpEtablissementLongitude() != '0.000000000'\n && !is_null($cp_etablissement->getCpEtablissementLongitude())\n && $cp_etablissement->getCpEtablissementLongitude() != '')) {\n\n $this->gMap = new GMap();\n //récupération de l'adresse du lieu à partir des coordonnées\n // Reverse geocoding of the center of the map\n $geocoded_address = new GMapGeocodedAddress(null);\n $geocoded_address->setLat($cp_etablissement->getCpEtablissementLatitude());\n $geocoded_address->setLng($cp_etablissement->getCpEtablissementLongitude());\n $geocoded_address->reverseGeocode($this->gMap->getGMapClient());\n\n //gestion de l'adresse dans la bulle\n $info_window = new GMapInfoWindow('<div class=\"icon_map\"><b>Addresse:</b><br />' . $geocoded_address->getGeocodedAddress() . '</div>');\n $gMapEvent = new GMapEvent('click', \"get_click_coord\", false);\n $this->gMap->addEvent($gMapEvent);\n $this->gMap->addGlobalVariable('marker', 'null');\n\n $name = '\"' . $cp_etablissement->getCpEtablissementEtablissementNom() . '\"';\n\n $gMapMarker = new GMapMarker($cp_etablissement->getCpEtablissementLatitude(), $cp_etablissement->getCpEtablissementLongitude(), array('title' => $name), 'marker');\n\n $gMapMarker->addHtmlInfoWindow($info_window);\n\n $this->gMap->addMarker($gMapMarker);\n\n $this->gMap->centerAndZoomOnMarkers();\n }\n //utilisation de l'adresse\n elseif ($cp_etablissement->getCpEtablissementAdresse1() != '' && $cp_etablissement->getCpEtablissementCodePostal() != '' && $cp_etablissement->getCpEtablissementVilleId() != '') {\n $depVille = Doctrine_Core::getTable('VilleFr')->find($cp_etablissement->getCpEtablissementVilleId());\n //génération de l'adresse pour GMap\n $adresse = $cp_etablissement->getCpEtablissementAdresse1() . \", \" . $cp_etablissement->getCpEtablissementCodePostal() . \" \" . $depVille['nom_ville'];\n\n $this->gMap = new GMap();\n //récupération de l'adresse du lieu\n $geocoded_address = $this->gMap->geocode($adresse);\n //gestion de l'adresse dans la bulle\n $info_window = new GMapInfoWindow('<div class=\"icon_map\"><b>Addresse:</b><br />' . $adresse . '</div>');\n $gMapEvent = new GMapEvent('click', \"get_click_coord\", false);\n $this->gMap->addEvent($gMapEvent);\n $this->gMap->addGlobalVariable('marker', 'null');\n\n $name = '\"' . $cp_etablissement['cp_etablissement_etablissement_nom'] . '\"';\n\n $gMapMarker = new GMapMarker($geocoded_address->getLat(), $geocoded_address->getLng(), array('title' => $name), 'marker');\n\n $gMapMarker->addHtmlInfoWindow($info_window);\n\n $this->gMap->addMarker($gMapMarker);\n\n $this->gMap->centerAndZoomOnMarkers();\n\n //mise à jour des latitudes et longitudes\n }\n //utilisation de l'adresse de covoiturage plus (definie dans app.yml)\n else {\n $this->gMap = new GMap();\n //récupération de l'adresse de covoiturage plus (definie dans app.yml)\n $geocoded_address = $this->gMap->geocode(sfConfig::get('app_covoiturage_adresse_map'));\n $gMapMarker = new GMapMarker($geocoded_address->getLat(), $geocoded_address->getLng());\n //$gMapMarker->addHtmlInfoWindow('<b>Address:</b><br />'.sfConfig::get('app_covoiturage_adresse_map'));\n $this->gMap->addMarker($gMapMarker);\n\n //$this->gMap->addMarker(new GMapMarker($geocoded_address->getLat(),$geocoded_address->getLng()));\n $this->gMap->centerAndZoomOnMarkers();\n //$val_test = $geocoded_address->getLat().\"-\".$geocoded_address->getLng();\n //$val_test = $gAddress->getRawAddress();\n }\n\n //sélection du layout de popup en cas de demande d'affichage en popup\n if ($request->getParameter('popup') && $request->getParameter('popup') == 1) {\n $this->setLayout('layout-popup');\n\n //indicateur de fenetre en popup pour affichage des boutons adéquats\n $this->popup = 1;\n }\n \n //utilisation d'un indicateur indiquant que'un module est intégré dans un autre moduel\n // (permet d'éviter d'afficher plusieur fois le bouton \"fermer la fenetre\")\n if ($request->getParameter('listeIntegre') && $request->getParameter('listeIntegre') == 1) {\n $this->listeIntegre = 1;\n }\n }", "function accesrestreintobjets_affiche_milieu($flux){\n\tif ($flux[\"args\"][\"exec\"] == \"configurer_accesrestreint\") {\n\t\t$flux[\"data\"] = recuperer_fond('prive/squelettes/inclure/configurer',array('configurer'=>'configurer_accesrestreintobjets')).$flux[\"data\"];\n\t}\n\t// Ajouter la config des zones sur la vue de chaque objet autorisé\n\telseif (\n\t\t$exec = trouver_objet_exec($flux['args']['exec'])\n\t\tand include_spip('inc/config')\n\t\tand include_spip('inc/autoriser')\n\t\tand $objets_ok = lire_config('accesrestreintobjets/objets')\n\t\t// Si on a les arguments qu'il faut\n\t\tand $type = $exec['type']\n\t\tand $id = intval($flux['args'][$exec['id_table_objet']])\n\t\t// Si on est sur un objet restrictible\n\t\tand in_array($exec['table_objet_sql'], $objets_ok)\n\t\t// Et que l'on peut configurer le site\n\t\tand autoriser('configurer')\n\t) {\n\t\t$liens = recuperer_fond(\n\t\t\t'prive/objets/editer/liens',\n\t\t\tarray(\n\t\t\t\t'table_source'=>'zones',\n\t\t\t\t'objet' => $type,\n\t\t\t\t'id_objet' => $id,\n\t\t\t)\n\t\t);\n\t\tif ($liens){\n\t\t\tif ($pos = strpos($flux['data'],'<!--affiche_milieu-->'))\n\t\t\t\t$flux['data'] = substr_replace($flux['data'], $liens, $pos, 0);\n\t\t\telse\n\t\t\t\t$flux['data'] .= $liens;\n\t\t}\n\t}\n\t\n\treturn $flux;\n}", "function RellenarIndice()\r\n {\r\n $this->AddPage();\r\n\r\n $this->Imprimir('2. Revisión y Análisis de las siguientes interrupciones:', 20, 10);\r\n\r\n $cont_causa500 = 1;\r\n $cont_imp = 1;\r\n $cont_pro = 1;\r\n\r\n foreach ($this->eventos as $evento)\r\n {\r\n if (Doctrine_Core::getTable('SAF_EVENTO_CONVOCATORIA')->getEventoConvocatoria($evento, $this->convocatoria)->getStatus() == 'analizado')\r\n {\r\n $this->ImprimirSubtituloIndice($evento, $cont_causa500, $cont_imp, $cont_pro);\r\n\r\n $fecha_evento = strftime(\"%A, %d/%m/%Y\", strtotime($evento->getFHoraIni()));\r\n $text = \"RI. \" . $evento->getCEventoD() . \" - Circuito \" . $evento->getCircuito() . \". \" . $fecha_evento . '. MVAmin: ' . $evento->getMvaMin();\r\n $this->Imprimir($text, 40, 10);\r\n }\r\n }\r\n }", "function droit_ajout_agenda_ressource()\r\n{\r\n\tif($_SESSION[\"espace\"][\"droit_acces\"]==2 || ($_SESSION[\"user\"][\"id_utilisateur\"]>0 && option_module(\"ajout_agenda_ressource_admin\")!=true))\r\n\t\treturn true;\r\n}", "public function testSetInterdireAccesEntete() {\n\n $obj = new Collaborateurs();\n\n $obj->setInterdireAccesEntete(true);\n $this->assertEquals(true, $obj->getInterdireAccesEntete());\n }", "public function isInvisible() {\n return !$this->isVisible();\n }", "public function canBeViewed() {}", "public function isVisible() {\n return !is_null($this->num);\n }", "public function getPlaca(){ return $this->placa;}", "public function linea_colectivo();", "public function attaquer($adversaire){\n //on soustrait le nombre de vie par le nombre de degats\n $this->_Vie -= $this->_degat;\n echo \"<p>\". $this->_Pseudo . \" attaque \" .$adversaire->getPseudo() . \"</p>\";\n $adversaire->setVie($this->_Vie);\n }", "function isHidden();", "public function cloture()\n {\n // On prépare la modification pour enregistrer la fermeture de la mission\n $sql = 'UPDATE `mission`\n SET `mission_statut` = 0\n WHERE `mission_id` = :mission';\n $query = $this->_link->prepare($sql);\n $query->bindParam(':mission', $this->_data['mission_id'], PDO::PARAM_INT);\n\n // On effectue la modification\n $query->execute();\n }", "public function Preferiti() {\n $session = Sessione::getInstance();\n if($session->isLoggedUtente()){\n $utente = $session->getUtente();\n $idutente = $utente->getId();\n $pm = FPersistentManager::getInstance();\n $ut = $pm->loadById(\"utente\", $idutente);\n $ricette = $ut->getPreferiti();\n if($ricette!=null){\n $msg = \"\";\n } else {\n $msg = \"Non hai ricette preferite\";\n }\n $view = new VPreferiti();\n $view->mostraPreferiti($ricette, $msg);\n\n } else {\n header('Location: /myRecipes/web/Utente/Login');\n }\n }", "public function is_editable() {\n\t\treturn false;\n\t}", "public function isBrowsable() {}", "public static function parler()\n {\n echo 'Je suis un personnage <br/>';\n }", "public function showAction()\n {\n \n //Vérification de l'existance des données de l'entreprise\n \n $em = $this->getDoctrine()->getManager();\n $user_connected = $this->getUser();\n $entity = $em->getRepository('KbhGestionCongesBundle:Entreprise')->findAll();\n $cp= count($entity);\n \n if($cp != 0){\n $id=1;\n \n // Information de l'entreprise et formulaire\n $entity = $em->getRepository('KbhGestionCongesBundle:Entreprise')->find($id);\n $editForm = $this->createEditForm($entity);\n \n //Fériés et formulaire\n $feries = $em->getRepository('KbhGestionCongesBundle:Feries')->findAll();\n $new_feries = new Feries();\n $feriesForm = $this->createFeriesForm($new_feries);\n \n //ParamPermissions et formulaire\n $Permission = $em->getRepository('KbhGestionCongesBundle:Parampermissions')->findAll();\n $new_permission = new Parampermissions();\n $PermissionForm = $this->createPermissionForm($new_permission);\n \n //ParamCalculDroit\n $calculDroit = $em->getRepository('KbhGestionCongesBundle:Paramcalculsdroits')->find($id);\n $CalculDroitForm = $this->EditParamCalDroitForm($calculDroit);\n \n }\n \n if (in_array(\"ROLE_ADMIN\", $user_connected->getRoles())) {\n return $this->render('KbhGestionCongesBundle:Admin\\Entreprise:show.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'feriesForm' => $feriesForm->createView(),\n 'permissionForm' => $PermissionForm->createView(),\n 'edit_calculDroitForm' => $CalculDroitForm->createView(),\n 'feries' => $feries,\n 'param_permission' => $Permission,\n ));\n }\n if (in_array(\"ROLE_SUPER_ADMIN\", $user_connected->getRoles())) {\n return $this->render('KbhGestionCongesBundle:Super-Admin\\Entreprise:show.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'feriesForm' => $feriesForm->createView(),\n 'permissionForm' => $PermissionForm->createView(),\n 'edit_calculDroitForm' => $CalculDroitForm->createView(),\n 'feries' => $feries,\n 'param_permission' => $Permission,\n ));\n }\n }", "public function __clone()\n { \n trigger_error('La clonación no permitida', E_USER_ERROR); \n }", "public function setNoeudLocal(?bool $noeudLocal): DevisDescriptifLocaux {\n $this->noeudLocal = $noeudLocal;\n return $this;\n }" ]
[ "0.61015475", "0.6033511", "0.5998536", "0.59905887", "0.5890918", "0.5890918", "0.57906854", "0.5786703", "0.5780322", "0.5746917", "0.57190573", "0.57146317", "0.56991464", "0.56972426", "0.56963253", "0.5685588", "0.5672643", "0.56596017", "0.5580263", "0.5567049", "0.55515176", "0.5544867", "0.5507903", "0.5484317", "0.5483146", "0.5472549", "0.54711574", "0.5439542", "0.5430946", "0.5356352", "0.53235245", "0.53187066", "0.5314836", "0.53123367", "0.52901584", "0.5289992", "0.5289395", "0.52837074", "0.52717865", "0.52674454", "0.52464056", "0.5242482", "0.5233862", "0.5230172", "0.52282715", "0.5228172", "0.52259964", "0.5223848", "0.52168393", "0.5212957", "0.5176235", "0.5175821", "0.51713234", "0.51701844", "0.51669556", "0.5161484", "0.5157534", "0.51542443", "0.5153806", "0.5153451", "0.51526207", "0.5147495", "0.514104", "0.5139945", "0.5139872", "0.5139872", "0.5139872", "0.5139872", "0.5139872", "0.5139872", "0.5138112", "0.51350546", "0.51311034", "0.5119738", "0.5112994", "0.510744", "0.5107014", "0.5106951", "0.51062876", "0.51012784", "0.51009893", "0.50911015", "0.50855196", "0.50807077", "0.50797963", "0.50793606", "0.5071548", "0.5069651", "0.50692016", "0.5067266", "0.5066509", "0.5064656", "0.5064348", "0.5063451", "0.50568336", "0.5051616", "0.5042507", "0.5042153", "0.5035036", "0.50342864" ]
0.5265552
40
Test si une carte peut monter
private function get_next_move() { $move = $this->can_put_a_card_up(); if($move !== false) return $move; // Test si une carte peut être déplacée $move = $this->can_move_cards(); //if($move !== false) return $move; // Test si la carte du deck peut descendre $move2 = $this->can_put_deck_card_down(); if($move !== false && $move2 !== false) { array_push($move, $move2); return $move; } if($move !== false) return $move; if($move2 !== false) return $move2; // Test si une carte peut être montée suite à un déplacement spécial //$move = $this->can_put_a_card_up_after_move(); //if($move !== false) return $move; // Pioche $move = $this->can_turn_from_deck(); if($this->infinite_move($move)) return false; if($move !== false) return $move; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function testPrimeDirecteur2(){\n $directeurATester = new Directeur();\n $dateTemoin = \"12/07/2010\";\n $montantPrime = 11100;\n \n $directeurATester->setSalaire($this->salaireTemoin);\n $directeurATester->setDateEmbauche($dateTemoin);\n $this->assertEquals($montantPrime,$directeurATester->calculerPrime());\n }", "public function testPrimeDirecteur3(){\n $directeurATester = new Directeur();\n $dateTemoin = \"12/07/2010\";\n $montantPrime = 8880;\n $salaireTemoin = 24000;\n \n $directeurATester->setSalaire($salaireTemoin);\n $directeurATester->setDateEmbauche($dateTemoin);\n $this->assertEquals($montantPrime,$directeurATester->calculerPrime());\n }", "public function testPrimeDirecteur4(){\n $directeurATester = new Directeur();\n $dateTemoin = \"12/07/2018\";\n $montantPrime = 5850;\n $salaireTemoin = 45000;\n \n $directeurATester->setSalaire($salaireTemoin);\n $directeurATester->setDateEmbauche($dateTemoin);\n $this->assertEquals($montantPrime,$directeurATester->calculerPrime());\n }", "public function testPrimeDirecteur1(){\n $directeurATester = new Directeur();\n \n $directeurATester->setSalaire($this->salaireTemoin);\n\n $dateTemoin = \"12/07/2015\";\n $montantPrime = 6600;\n $directeurATester->setDateEmbauche($dateTemoin);\n $this->assertEquals($montantPrime,$directeurATester->calculerPrime());\n }", "function test($marca){\n\t\t//return FALSE;\n\t\treturn true;\n\t}", "public function mort()\n\t{\n\t\tif ( $this->vie <= 0 ) {\n\t\t\techo $this->nom . \" est mort <br>\";\n\t\t} else {\n\t\t\techo $this->nom . \" est vivant ! <br>\";\n\t\t}\n\t}", "function paginaValida($numeroPagina){\n global $totalImagenes;\n //si el numero de pagina es mayor que cero y menor que el total de imagenes($totalImagenes) entre(/)\n // la cantidad de imagenes por pagina(MAXIMO)\n if (MAXIMO<=0){die (\"el mmo de p&aacute;gina debe ser mayor que cero\"); exit(); }\n return (($numeroPagina>0) && ($numeroPagina<=ceil(($totalImagenes/MAXIMO)))); \n }", "public function calculateValuation(): bool\n {\n return 0;\n }", "function getMerezcoTarjeta(){\n\t\tif($this->numero_cambio >= 3)\n\t\t\t$necesito=2;\n\t\telse\n\t\t\t$necesito=1;\n\t\t\n\t\tif($necesito <= $this->sacar_tarjeta){\n\t\t\t$this->sacar_tarjeta=0;\n\t\t\treturn 1;\n\t\t}\n\t\telse{\n\t\t\t$this->sacar_tarjeta=0;\n\t\t\treturn 0;\n\t\t}\n\t}", "function getMontantTVAArticle($numserie) {\n // if ($this->calculmontant) return (sprintf(\"%.2f\", ($this->article[$numserie]['montantTTC'] - $this->article[$numserie]['montantHT'])));\n if (isset($this->calculmontant) && $this->calculmontant == true) return (sprintf(\"%.2f\", ($this->article[$numserie]['montantHT'] * ($this->TVA / 100))));\n else return 0;\n }", "public function testTiempoInvalido()\n {\n $tiempo = new TiempoFalso;\n $recargable = new Recargable();\n $medio = new Medio(0, $tiempo,$recargable);\n\t\t$saldoEsperado =0;\n\n $this->assertTrue($medio->recargar(1119.90));\t//Carga 1300.00\n $this->assertEquals($medio->restarSaldo(\"153\"), true);\n\t\t$saldoEsperado =$saldoEsperado+1300.00;\n\n $tiempo->avanzar(300);\n $this->assertEquals($medio->restarSaldo(\"153\"), true);\n\t\t$saldoEsperado =$saldoEsperado-(32.50/2);\n\n $tiempo->avanzar(50);\n $this->assertEquals($medio->restarSaldo(\"153\"), false);\n $tiempo->avanzar(50);\n $this->assertEquals($medio->restarSaldo(\"153\"), false);\n $tiempo->avanzar(50);\n $this->assertEquals($medio->restarSaldo(\"153\"), false);\n $tiempo->avanzar(50);\n $this->assertEquals($medio->restarSaldo(\"153\"), false);\n $tiempo->avanzar(50);\n $this->assertEquals($medio->restarSaldo(\"153\"), false);\n\n $tiempo->avanzar(50);\n $this->assertEquals($medio->restarSaldo(\"153\"), true);\n\t\t$saldoEsperado=$saldoEsperado-(32.50/2);\n\n $tiempo->avanzar(265);\n $this->assertEquals($medio->restarSaldo(\"153\"), false);\n $tiempo->avanzar(584);\n $this->assertEquals($medio->restarSaldo(\"153\"), true);\n $this->assertEquals($medio->restarSaldo(\"153\"), false);\n }", "function testMajuscule($valeurTeste){\r\n $retour = \"faux\";\r\n if($valeurTeste>=\"A\" && $valeurTeste<=\"Z\"){\r\n $retour = \"vrai\";\r\n }\r\n return $retour;\r\n }", "function test_entier($valeur){\r\n return ($valeur>0 || $valeur==\"0\");\r\n}", "public function testSetPrime1Mai() {\n\n $obj = new HistoPrepPaie();\n\n $obj->setPrime1Mai(10.092018);\n $this->assertEquals(10.092018, $obj->getPrime1Mai());\n }", "public function sePuedePagar(){\n $ahora = $this->obtenerTiempo();\n if(date('d', $ahora) == (date('d', $this->ultimoPagoMedio) + 1)) {\n $this->mediosDisponibles = 2;\n }\n if(($ahora - $this->ultimoPago) >= 300 && $this->mediosDisponibles != 0){\n return true;\n }else{\n return false;\n }\n }", "function fecha_menor($diainicio,$diafin,$mesinicio,$mesfin,$anioinicio,$aniofin){\r\n\r\n$dif_en_meses=(($mesfin-$mesinicio)+(12*($aniofin-$anioinicio)));\r\n\r\nif($dif_en_meses<0){return(0);}\r\nif(($dif_en_meses==0) && ($diafin<$diainicio)){return(0);}\r\nreturn(1);\r\n}", "private function choixEffectuer()\n {\n $valider = false;//on mets le forrmulaire a faux\n $valeur = $this->recupValeur($this->position['valeur']);//on recupêre la valeur a comparer\n\n if($this->position['egal'])\n {\n \n if($this->choix == $valeur)\n {\n $valider = true;\n }\n }\n else if($this->position['different'])\n {\n \n if($this->choix != $valeur)\n {\n $valider = true;\n }\n }\n else\n {\n Erreur::declarer_dev(27);\n }\n\n return $valider;\n\n }", "function numParImpar($num){\n $bool = true;\n if($num % 2 == 0){\n return true;\n }else{\n return false;\n }\n}", "public function testPagarTransbordoNormal(){\n $tarjetaMedioUni= new TarjetaMedioUni;\n $tarjetaMedioUni->recargar(50);\n $tarjetaMedioUni->normalTransbordo();\n $this->assertEquals($tarjetaMedioUni->obtenerSaldo(), 50-$tarjetaMedioUni->obtenerValor()*2*33/100);\n }", "public function isMileDistanceUnit()\n {\n return ($this->getDistanceUnit() == 'mi') ? true : false;\n }", "public function getMontantFixe(): ?bool {\n return $this->montantFixe;\n }", "public function comprobarSaldo($cantidad){ //en cantidad le pasaremos lo que se le va a cobrar\n if($this->time - $cantidad < -300){\n return false;\n }else{\n return true;\n }\n\n }", "function getMontantArticle($numserie) {\n if (isset($this->calculmontant) && $this->calculmontant == true) return (sprintf(\"%.2f\", $this->article[$numserie]['montantHT']));\n else return 0;\n }", "public function melyikFelev()\n {\n $datum = date(\"m\");\n if ((($datum >= 9) and ($datum <= 12)) || ($datum == 1)) {\n return 1;\n } elseif (($datum >= 2) and ($datum < 9)) {\n return 2;\n }\n }", "function hasDecimalMontant($mnt)\n{\n $hasDecimal = false;\n\n $mntIAP_Arrondie = ROUND($mnt);\n $diff = abs($mnt - $mntIAP_Arrondie);\n if ($diff > 0){\n $hasDecimal = true;\n }\n\n return $hasDecimal;\n\n}", "function charger_mascotte() {\n // Recherche de la mascotte\n $classe = Mascotte::getClasseByUtilisateur($_SESSION[\"utilisateur\"]->id);\n\n if (is_null($classe))\n return false;\n\n else {\n $m = (new $classe())->getByUtilisateur($_SESSION[\"utilisateur\"]->id);\n $m->vetements = (new Vetement())->getByMascotte($m->id);\n $m->decorations = (new Decoration())->getByMascotte($m->id);\n $_SESSION[\"mascotte\"] = $m;\n return true;\n }\n }", "private function _getMCMontaggioOLD()\n {\n $mc = 0;\n foreach ($this->lista_arredi as $arredo)\n {\n if ($arredo->getServizioMontaggio())\n {\n $tmp = $arredo->getMC();\n if ($arredo->getParametroB() == Arredo::MONTATO_PIENO)\n {\n $tmp = $tmp * $arredo->getCampo(Arredo::MONTATO_PIENO);\n $mc+= $tmp;\n\n }\n\n if ($arredo->getParametroB() == Arredo::MONTATO_VUOTO)\n {\n $tmp = $tmp * $arredo->getCampo(Arredo::MONTATO_VUOTO);\n $mc+= $tmp;\n\n }\n }\n\n }\n\n return $mc;\n }", "function renvoyerMin ($tabNombre)\n { // SI JE VEUX PRENDRE CHAQUE ELEMENT D'UN TABLEAU\n // => BOUCLE\n // IL FAUT DONNER UNE VALEUR A $plusPetit\n $plusPetit = $tabNombre[0]; // ON PREND LA PREMIERE VALEUR\n foreach($tabNombre as $nombre)\n {\n // SI JE COMPARE DES VALEURS => CONDITION\n if ($nombre < $plusPetit)\n {\n // $nombre EST PLUS PLUS PETIT QUE $plusPetit\n // DONC $nombre DEVIENT LE PLUS PETIT\n $plusPetit = $nombre;\n }\n } \n\n return $plusPetit;\n }", "public function testVolVolAgressionEtVolAccessoires()\n {\n $r = $this->primesFractionnees->volVolAgressionEtVolAccessoires(1,6000000,6);\n return $this->assertEquals(22500,$r);\n }", "public function showPricePerMonth() {\n $prijsPerMaand = Mage::getStoreConfig('santander/general/prijs_maand');\n if($prijsPerMaand) {\n return true;\n } else {\n return false;\n }\n }", "public function hasSpeed(){\r\n return $this->_has(22);\r\n }", "function calcul_panier() {\n\tglobal $a_tva;\n\n\t$montant = 0;\n\n\tif (isset($_SESSION['catalogue']['panier']['articles']) && is_array($_SESSION['catalogue']['panier']['articles'])) {\n\t\tinclude_once DIMS_APP_PATH.'/modules/catalogue/class_article.php';\n\n\t\tforeach ($_SESSION['catalogue']['panier']['articles'] as $ref => $fields) {\n\t\t\t$article = new article();\n\t\t\t$article->open($ref);\n\n\t\t\t$prix = catalogue_getprixarticle($article, $fields['qte']);\n\t\t\t$prixaff = catalogue_afficherprix($prix, $a_tva[$article->fields['PCTVA']]);\n\n\t\t\t$montant += $prixaff * $fields['qte'];\n\t\t}\n\t}\n\n\t$_SESSION['catalogue']['panier']['montant'] = $montant;\n}", "public function hasPrecost(){\n return $this->_has(25);\n }", "public function testSetMtPrime1Chantier() {\n\n $obj = new HistoPrepPaie();\n\n $obj->setMtPrime1Chantier(10.092018);\n $this->assertEquals(10.092018, $obj->getMtPrime1Chantier());\n }", "public function isPlanificado(){\n return ($this->tipoLote == TipoLote::PLANIFICACION);\n }", "public function testAbreLivroDepoisQueEleEFechado()\n {\n $this->livro->abreLivro();\n $this->livro->viraPagina();\n $this->livro->fechaLivro();\n\n $this->livro->abreLivro();\n\n $this->assertEquals(1, $this->livro->getPaginaAtual());\n }", "public function testPagarConMedioUni_False(){\n $colectivo = new Colectivo(144,\"RosarioBus\",5);\n $tarjeta1=new MedioBoletoUni(2345);\n $tiempo=new TiempoFalso;\n\n $tiempo->avanzar(400);\n $tarjeta1->recargar(100);\n $this->assertEquals($tiempo->time(), 400);\n $this->assertTrue($tarjeta1->descuentoSaldo($tiempo, $colectivo));\n $this->assertEquals($tiempo->time(), 400);\n $this->assertFalse($tarjeta1->descuentoSaldo($tiempo, $colectivo));\n }", "public function prime()\n {\n return $this->primeSalaire() + $this->primeAnciennete(); // on retourne le montant de la prime annuelle\n }", "function getMontantTTCArticle($numserie) {\n if (isset($this->calculmontant) && $this->calculmontant == true) return (sprintf(\"%.2f\", $this->article[$numserie]['montantTTC']));\n else return 0;\n }", "public function testSavedUrsprungPlan($mesic,$rok){\n $hasData = 0;\n $sql = \"select persnr from dzeitsoll2 where MONTH(datum)='$mesic' and YEAR(datum)='$rok'\";\n $result = $this->db->query($sql);\n if(count($result)>0)\n $hasData = 1;\n return $hasData;\n }", "public function _validarHelado()\n {\n $listaHelados = Helado::_traerHelados();\n //Son distintos, pasa la validación.(Si y solo si se queda en este valor)\n $retorno = -1;\n if($this->_precio < 0 || $this->_tipo != \"agua\" && $this->_tipo != \"crema\" || $this->_cantidad < 0)\n {\n return 1;\n }\n foreach($listaHelados as $helado)\n { \n if($this->_sabor == $helado->_sabor && $this->_tipo == $helado->_tipo)\n {\n $helado->_cantidad = $this->_cantidad;\n $helado->_precio = $this->_precio;\n Helado::_actualizarHelado($listaHelados);\n $retorno = 0;\n break;\n }\n }\n return $retorno;\n }", "public function test_pagar_monto_estandar() {\n $tiempo = new Tiempo();\n $tiempo->avanzar( 36000 );\n $medio_boleto = new Tarjeta_Medio_Boleto( Null );\n $colectivo = new Colectivo( 'mixta', '133', 420 );\n $medio_boleto->recargar( 50.0 );\n\t\t$boleto = $medio_boleto->pagarConTarjeta( $colectivo , $tiempo );\n $this->assertEquals( $boleto->getValor(), $this->getCostoMedioBoleto() );\n }", "function fecha_no_paso($dia,$mes,$anio){\r\n$dia_hoy=date(\"d\");\r\n$mes_hoy=date(\"m\");\r\n$anio_hoy=date(\"Y\");\r\n\r\n$dif_en_meses=(($mes-$mes_hoy)+(12*($anio-$anio_hoy)));\r\n\r\nif($dif_en_meses<0){return(0);}\r\nif(($dif_en_meses==0) && ($dia<$dia_hoy)){return(0);}\r\nreturn(1);\r\n}", "function pagoMonedas($precio){\n $pago = 0;\n \n $monedas = array_fill(0,6,0); // ind 0: 1€; ind 1: 0,50€; ind 2: 0,20€; ind 3: 0,10€; ind 4: 0,05€; ind 5: 0,01€;\n \n $vueltas = 0;\n \n while($precio != $pago){\n $vueltas ++;\n echo sprintf(\"vuelta %d - pago %f<br>\",$vueltas, $pago);\n echo sprintf(\"diferencia: %f<br>\",$precio - $pago);\n if($precio - $pago >= 1){\n $monedas[0]++;\n $pago++;\n }\n elseif($precio - $pago >= 0.5){\n $monedas[1]++;\n $pago += 0.5;\n }\n elseif($precio - $pago >= 0.2){\n $monedas[2]++;\n $pago += 0.2;\n }\n elseif($precio - $pago >= 0.1){\n $monedas[3]++;\n $pago += 0.1;\n }\n elseif($precio - $pago >= 0.05){\n $monedas[4]++;\n $pago += 0.05;\n }\n elseif($precio - $pago >= 0.01){\n $monedas[5]++;\n $pago += 0.01;\n }\n else{\n echo 'Precio no válido<br>';\n break;\n }\n \n }\n return $monedas;\n}", "public function testCincoNumerosPorFila(CartonInterface $carton) {\n\t$flag = true;\n\tforeach( $carton->filas() as $fila ){\n\t\t$cont = 0;\n\t\tforeach( $fila as $num ){\n\t\t\tif($num != 0){\n\t\t\t\t$cont++;\n\t\t\t}\n\t\t}\n\t\tif($cont!=5){\n\t\t\t$flag = false;\t\t\n\t\t}\t\t\n\n\t}\n\n\n $this->assertTrue($flag);\n }", "public function isHeavyValues(): bool;", "public function deduction($id, $montant)\n {\n $inventaire = $this->em->getRepository(\"AppBundle:Inventaire\")->findOneBy(['id'=>$id]);\n if ($inventaire){\n\n $deduit = $inventaire->getDeduction() - $montant;\n $inventaire->setDeduction($deduit);\n $this->em->flush();\n\n return true;\n }else{\n return false;\n }\n }", "function meterTomile($e){\n$getTotal = $e*0.000621371;\nreturn $getTotal;\n}", "public function testSetMtPrimeForfait() {\n\n $obj = new HistoPrepPaie();\n\n $obj->setMtPrimeForfait(10.092018);\n $this->assertEquals(10.092018, $obj->getMtPrimeForfait());\n }", "public function hasSpeed(){\r\n return $this->_has(19);\r\n }", "public function testColumnaCompleta(CartonInterface $carton) {\n\t$flag = true;\t\n\tforeach( $carton->columnas() as $col ){\t\n\t\t$cant = 0;\t\n\t\tforeach( $col as $num ){\n\t\t\tif($num != 0){\n\t\t\t$cant++;\t\t\t\n\t\t\t}\n\t\t}\n\t\tif($cant == 3){\n\t\t$flag = false;\n\t\t}\n\t}\n $this->assertTrue($flag);\n }", "function kiemTraChanLe()\n\t{\n\t\tglobal $a;\n\t\t$total = 100; // bien cuc bo\n\t\t// luu y: hay dat cau lenh nay ben tren cac lenh khac truoc khi goi bien do ra su dung\n\t\tif($a % 2 == 0) {\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "public function mezclar() {\n if ($this->cantcartas == -1 || $this->cantcartas == 0)\n return TRUE;\n $inicio = 0;\n $final = $this->cantcartas;\n $mezcla = [];\n $punt = 0;\n for (; $inicio != $final && $inicio < $final; $inicio++, $final--) {\n $mezcla[$punt] = $this->cajita[$final];\n $punt++;\n $mezcla[$punt] = $this->cajita[$inicio];\n $punt++;\n }\n if (($this->cantcartas % 2) == 0)\n $mezcla[$punt] = $this->cajita[$inicio];\n $this->cajita = $mezcla;\n return TRUE;\n }", "public function testPago(){\n $montos = new Montos([\"2\" => \"valor\"],[]);\n $this->assertEquals(null, $montos->montoAPagar(\"0\"));\n $this->assertEquals(\"valor\", $montos->montoAPagar(\"2\"));\n }", "function visites_mensuelles_chiffres($global_jour) {\r\n\tglobal $couleur_foncee, $couleur_claire;\r\n\r\n\t$periode = date('m/y'); // mois /annee en cours (format de $date)\r\n\t$dday = date('j'); // numero du jour\r\n\t$nb_mois = $GLOBALS['actijour']['nbl_mensuel']; // nombre mois affiche\r\n\r\n\t$requete = \"FROM_UNIXTIME(UNIX_TIMESTAMP(date),'%m') AS d_mois, \r\n\t\t\tFROM_UNIXTIME(UNIX_TIMESTAMP(date),'%y') AS d_annee, \r\n\t\t\tFROM_UNIXTIME(UNIX_TIMESTAMP(date),'%m/%y') AS date_unix, \r\n\t\t\tSUM(visites) AS visit_mois \r\n\t\t\tFROM spip_visites WHERE date > DATE_SUB(NOW(),INTERVAL 2700 DAY) \r\n\t\t\tGROUP BY date_unix ORDER BY date DESC LIMIT 0,$nb_mois\";\r\n\r\n\t// calcul du $divis : MAX de visites_mois\r\n\t$r = sql_select($requete);\r\n\t$tblmax = array();\r\n\twhile ($rmx = @sql_fetch($r)) {\r\n\t\t$tblmax[count($tblmax) + 1] = $rmx['visit_mois'];\r\n\t}\r\n\treset($tblmax);\r\n\r\n\tif (count($tblmax) == 0) {\r\n\t\t$tblmax[] = 1;\r\n\t}\r\n\t$divis = max($tblmax) / 100;\r\n\r\n\t//le tableau a jauges horizontales\r\n\t$aff .= debut_cadre_relief(\"\", true)\r\n\t\t. \"<span class='arial2'>\" . _T('actijour:entete_tableau_mois', array('nb_mois' => $nb_mois)) . \"\\n</span>\"\r\n\t\t. \"<table width='100%' cellpadding='2' cellspacing='0' border='0' class='arial2'>\\n\"\r\n\t\t. \"<tr><td align='left'>\" . _T('actijour:mois_pipe')\r\n\t\t. \"</td><td width='50%'>\" . _T('actijour:moyenne_mois') . \"</td>\\n\"\r\n\t\t. \"<td><b>\" . _T('actijour:visites') . \"</b></td></tr>\";\r\n\r\n\t$ra = sql_select($requete);\r\n\twhile ($row = sql_fetch($ra)) {\r\n\t\t$val_m = $row['d_mois'];\r\n\t\t$val_a = $row['d_annee'];\r\n\t\t$date = $row['date_unix'];\r\n\t\t$visit_mois = $row['visit_mois'];\r\n\t\t$idefix = '';\r\n\r\n\t\t//nombre de jours du mois $mois\r\n\t\t$mois = mktime(0, 0, 0, $val_m, 1, $val_a);\r\n\t\t$nbr_jours = intval(date(\"t\", $mois));\r\n\r\n\t\t// nombre de jours, moyenne, si mois en cours\r\n\t\tif ($date != $periode) {\r\n\t\t\t$nbj = $nbr_jours;\r\n\t\t\t$moy_mois = floor($visit_mois / $nbj);\r\n\t\t\t$totvisit = $visit_mois;\r\n\t\t} else {\r\n\t\t\t$nbj = ($dday == 1) ? $dday : $dday - 1;\r\n\t\t\t$moy_mois = floor(($visit_mois - $global_jour) / $nbj);\r\n\t\t\t$totvisit = $visit_mois - $global_jour;\r\n\t\t\t$idefix = \"*\";\r\n\t\t}\r\n\t\t$totvisit = number_format($totvisit, 0, ',', '.');\r\n\r\n\t\t//longeur jauge (ne tiens pas compte du jour en cour)\r\n\t\t$long = floor($visit_mois / $divis);\r\n\r\n\t\t// couleur de jauge pour mois le plus fort\r\n\t\t$color_texte = '';\r\n\t\tif ($long == 100) {\r\n\t\t\t$coul_jauge = $couleur_foncee;\r\n\t\t\t$color_texte = \"style='color:#ffffff;'\";\r\n\t\t} else {\r\n\t\t\t$coul_jauge = $couleur_claire;\r\n\t\t}\r\n\r\n\t\t$aff .= \"<tr><td class='arial2' colspan='3'>\"\r\n\t\t\t. \"<div style='position:relative; z-index:1; width:100%;'>\"\r\n\t\t\t. \"<div class='cell_info_mois'>$date</div>\"\r\n\t\t\t. \"<div class='cell_moymens'>$moy_mois</div>\"\r\n\t\t\t. \"<div class='cell_info_tot' $color_texte><b>$totvisit</b>$idefix</div>\"\r\n\t\t\t. \"</div>\";\r\n\t\t# barre horiz \r\n\t\t$aff .= \"<div class='fond_barre'>\\n\"\r\n\t\t\t. \"<div style='width:\" . $long . \"%; height:11px; background-color:\" . $coul_jauge . \";'></div>\\n\"\r\n\t\t\t. \"</div>\\n\"\r\n\t\t\t. \"</td></tr>\\n\";\r\n\r\n\t}\r\n\t$aff .= \"<tr><td colspan='3'><span class='verdana1'>\"\r\n\t\t. _T('actijour:pied_tableau_mois') . \"</span></td></tr>\\n\"\r\n\t\t. \"</table></span>\\n\";\r\n\t$aff .= fin_cadre_relief(true);\r\n\r\n\treturn $aff;\r\n\r\n}", "public function testSetMtPrime2Chantier() {\n\n $obj = new HistoPrepPaie();\n\n $obj->setMtPrime2Chantier(10.092018);\n $this->assertEquals(10.092018, $obj->getMtPrime2Chantier());\n }", "function minimo( $resultado, $valor) {\n\t$resultado = ($valor < $resultado ) ? $valor : $resultado; \n\treturn $resultado;\n}", "public function testSetSalaireMensuel() {\n\n $obj = new Collaborateurs();\n\n $obj->setSalaireMensuel(10.092018);\n $this->assertEquals(10.092018, $obj->getSalaireMensuel());\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}", "public function hasAddmp(){\r\n return $this->_has(24);\r\n }", "public function hasDifference() {return !!$this->_calculateDifference();}", "public function testColumnaNoVacia(CartonInterface $carton) {\n\t$flag = true;\n\tforeach($carton->columnas() as $col ){\n\t\t$alguno = false;\n\t\tforeach($col as $num){\n\t\t\tif($num != 0){\n\t\t\t\t$alguno = true;\n\t\t\t}\n\t\t}\n\t\tif($alguno == false){\n\t\t\t$flag = false;\n\t\t}\t\n\t}\n $this->assertTrue($flag);\n }", "function CompterNombreDeM($chaine) {\n$nb=0;\n\nfor ($i=0; $i <CompteNombreCaractere($chaine); $i++) { \n\tif (($chaine[$i]=='m') or ($chaine[$i]=='M') ) {\n\t\t$nb=$nb+1;\n}\n\n}\nreturn $nb;\n\n}", "function primo($num) {\n if ($num == 2 || $num == 3 || $num == 5 || $num == 7) {\n return True;\n } else {\n if ($num % 2 != 0) {\n for ($i = 3; $i <= sqrt($num); $i += 2) {\n if ($num % $i == 0) {\n return false;\n }\n }\n return true;\n }\n }\n return false;\n }", "function CalculMontantArticle($numserie, $prix, $qte) {\n\n $this->article[$numserie]['montantHT'] += $prix * $qte;\n $this->article[$numserie]['montantTTC'] += $prix * $qte * (1 + ($this->TVA / 100));\n\n }", "public function testSetMontant() {\n\n $obj = new PointBonTrav();\n\n $obj->setMontant(10.092018);\n $this->assertEquals(10.092018, $obj->getMontant());\n }", "function testMinuscle2($valeurTeste){\r\n return ($valeurTeste>=\"a\" && $valeurTeste<=\"z\");\r\n }", "function isOvertime()\n {\n if($this->jadwalKembali > $this->tanggalKembali){\n return false;\n }else{\n return true;\n }\n }", "public function is_month()\n {\n }", "public function test_pagar_monto_viaje_plus_doble() {\n $tiempo = new Tiempo();\n $tiempo->avanzar( 36000 );\n $medio_boleto = new Tarjeta_Medio_Boleto( Null );\n $colectivo = new Colectivo( 'mixta', '133', 420 );\n $medio_boleto->recargar( 50.0 );\n $medio_boleto->gastarPlus();\n $medio_boleto->gastarPlus();\n $this->assertEquals( $medio_boleto->getViajesPlus(), 0 );\n $boleto = $medio_boleto->pagarConTarjeta( $colectivo , $tiempo );\n $this->assertEquals( $boleto->getValor(), $this->getCostoMedioBoleto() + (2 * $this->getCostoViaje() ) );\n }", "public function test_medio_boleto_viaje_plus(){\n $tiempo = new Tiempo();\n $tiempo->avanzar(36000);\n $medio_boleto = new Tarjeta_Medio_Boleto( Null );\n $colectivo = new Colectivo( 'mixta', '133', 420 );\n\t\t\n $this->assertEquals( $medio_boleto->getViajesPlus(), 2 );\n\t\t\n $medio_boleto->pagarConTarjeta( $colectivo , $tiempo );\n $this->assertEquals( $medio_boleto->getViajesPlus(), 1 );\n\t\t\n $medio_boleto->gastarPlus();\n $this->assertEquals( $medio_boleto->getViajesPlus(), 0 );\n\t\t\n $boleto = $medio_boleto->pagarConTarjeta( $colectivo , $tiempo );\n $this->assertEquals( $boleto->getTipoBoleto(), 'Saldo Insuficiente' );\n }", "public function hasAddmp(){\r\n return $this->_has(21);\r\n }", "public function isThisMonth(){\n\t\tif($this->_month==date('m')&&$this->_year==date('Y')){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function montantTot () {\n\t $montant = 0;\n\t for ($i = 0; $i < count ($_SESSION['panier']['numE']);$i ++) {\n\t\t $montant += $_SESSION['panier']['nbr'][$i] * $_SESSION['panier']['prix'][$i]; \n\t }\n\t return $montant;\n }", "protected function runNewBlackbox()\n\t{\n\t\tif (mt_rand(1, 100) <= self::PERCENT)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\t\t\n\t\treturn FALSE;\n\t}", "public function is_iptu_ano_quitado() {\n\n if ($this->contract == null) {\n return false;\n }\n\n if ($this->contract->imovel == null) {\n return false;\n }\n\n $iptutabela = IPTUTabela\n ::where('imovel_id', $this->contract->imovel->id)\n ->where('ano' , $this->monthrefdate->year)\n ->first();\n\n if ($iptutabela != null && $iptutabela->ano_quitado == true) {\n return true;\n }\n\n return false;\n }", "function retornarSiEsCero ($numeroingresado)\n{\n \n if($numeroingresado == 0)\n {\n return true;\n }\n\n else\n {\n return false;\n }\n echo \"<br>El numeros es: \" .retornarSiEsCero(0);//coloco un numero\n\n}", "public function testSetMontant1() {\n\n $obj = new Employes();\n\n $obj->setMontant1(10.092018);\n $this->assertEquals(10.092018, $obj->getMontant1());\n }", "public function hasUnit() {\n return $this->_has(11);\n }", "public function testSetTauxPensionMilitaire() {\n\n $obj = new Employes();\n\n $obj->setTauxPensionMilitaire(10.092018);\n $this->assertEquals(10.092018, $obj->getTauxPensionMilitaire());\n }", "public function testSetPrimeHComplMaj() {\n\n $obj = new HistoPrepPaie();\n\n $obj->setPrimeHComplMaj(10.092018);\n $this->assertEquals(10.092018, $obj->getPrimeHComplMaj());\n }", "private function compute()\n {\n if ($this->computed) {\n return true;\n }\n\n $this->load('items');\n\n foreach ($this->items as $item) {\n $this->_total += ($item->amount) / 100;\n $this->_gst += ($item->gst) / 100;\n $this->_pst += ($item->pst) / 100;\n }\n\n $this->computed = true;\n }", "public function testCarga(){\n $montos = new Montos([],[\"2\" => \"valor\"]);\n $this->assertEquals(null, $montos->montoACargar(\"0\"));\n $this->assertEquals(\"valor\", $montos->montoACargar(\"2\"));\n }", "private function isMach()\r\n {\r\n return $this->getPaymentMethod() == 15;\r\n }", "public function hasDecSpeeddf(){\r\n return $this->_has(28);\r\n }", "private function convertible(\\DateInterval $step): bool {\n\t\treturn $step->m === 0 && $step->y === 0 && $step->d === 0;\n\t}", "function mois_precedent($mois,$annee){\n\t$mois--;\n\tif($mois==0){\n\t\t$annee--;\n\t\t$mois=12;\n\t}\n\treturn $_SERVER['PHP_SELF'].\"?m=$mois&a=$annee\";\n}", "function imc($masse,$taille)\n\t{\n\t\tif ($taille > 0)\n\t\t{\n\t\t\t$res = $masse / pow($taille,2);\n\t\t\treturn $res;\n\t\t}\n\t\telse\n\t\t\treturn 0;\n\t}", "public function hasDecSpeeddf(){\r\n return $this->_has(25);\r\n }", "public function testPrecioSmsPorMes() {\n $this->assertEqual( $this->ConteoSms->buscarPrecioSms( 0 ), 0.0, \"No corresponde la cantida devuelta cuando el mes es incorrecto\" );\n $this->assertEqual( $this->ConteoSms->buscarPrecioSms(), 0.0, \"No corresponde la cantida devuelta cuando el mes es nulo\" );\n $this->assertLessThanOrEqual( 1.4, $this->ConteoSms->buscarPrecioSms( date( 'n' ) ), \"No corresponde el precio pasado en este mes\" );\n $this->assertLessThanOrEqual( 10.1, $this->ConteoSms->buscarPrecioSms( date( 'n' )-1 ), \"No corresponde el precio respecto al mes anterior\" );\n $this->assertLessThanOrEqual( 0.0, $this->ConteoSms->buscarPrecioSms( date( 'n' )-2 ), \"No corresponde el precio respecto al 2 meses antes\" );\n }", "function fechaPrestacionXLimite($fprestacion, $fprest_limite) {\r\n $pr = ((strtotime($fprest_limite) - strtotime($fprestacion)) / 86400); //limite de la prestacion - fecha prestacion\r\n $ctrl_fechapresta['debito'] = false;\r\n if ($pr < 0) {\r\n\r\n $ctrl_fechapresta['debito'] = true;\r\n $ctrl_fechapresta['id_error'] = 71;\r\n $ctrl_fechapresta['msj_error'] = 'Fecha de Prestacion supera el limite para el periodo liquidado';\r\n }\r\n return $ctrl_fechapresta;\r\n}", "public function testCargaSaldoInvalido()\n {\n $tiempo = new Tiempo;\n $recargable = new Recargable();\n $medio = new Medio(0, $tiempo,$recargable);\n $this->assertFalse($medio->recargar(15));\n $this->assertEquals($medio->obtenerSaldo(), 0);\n }", "public function testInvokeReturnsTrueIfFloatsAreEqual()\n\t{\n $this->assertTrue((new AlmostEquals())(1/10, 0.1));\n \n return;\n\t}", "public function testCmpart()\n {\n $oA = new stdClass();\n $oA->cnt = 10;\n\n $oB = new stdClass();\n $oB->cnt = 10;\n\n $this->assertTrue(cmpart($oA, $oB) == 0);\n\n $oA->cnt = 10;\n $oB->cnt = 20;\n\n $this->assertTrue(cmpart($oA, $oB) == -1);\n }", "function minfas($idkost, $tipe_kost)\r\n{\r\n global $koneksi;\r\n $cost = mysqli_query($koneksi, \"SELECT min(biaya_fasilitas) FROM kamar WHERE id_kost=$idkost\");\r\n $p = mysqli_fetch_array($cost);\r\n if ($tipe_kost == \"Bulan\") {\r\n return $p['min(biaya_fasilitas)'];\r\n } else if ($tipe_kost == \"Tahun\") {\r\n return $p['min(biaya_fasilitas)'] * 12;\r\n }\r\n}", "function aprovados($nota){\n return $nota >= 7;\n}", "public function testMultOne()\n {\n $this\n ->given(\n $one = $this->fromNative(1),\n $number = $this->fromNative($this->randomNativeNumber())\n )\n ->then\n ->boolean(\n $number->mult($one)->equals($number)\n )->isTrue()\n ->boolean(\n $one->mult($number)->equals($number)\n )->isTrue()\n ;\n }", "public function calculateProfit(): bool\n {\n return true;\n }", "public function testTotalMonthlyPrice()\n {\n }", "function precio($precioUnidad, $cantidad, $descuento = 0 ){ // las variables que tenemos son arbitrarias, por lo cual hay que mirar bien si ponerlas en () de la funcion\n\n\n\n$multiplicar = $precioUnidad * $cantidad;\n\n// $descuento es un porcentaje\n\n// $restar = $multiplicar - $descuento; // este descuento debe ir en % por lo cual no es lo mismo que un entero, por lo cual lo colocaremos en entero\n\n\n// si esto fuera un porcentaje entonces seria $multiplicar = $precioUnidad * $cantidad; // $porcentaje = $multiplicar - $descuento; // $solucion = $multiplicar - $porcentaje; lo cual es lo que haremos\n\n$porcentaje = $multiplicar * $descuento;\n\n$solucion = $multiplicar - $porcentaje;\nreturn $solucion;\n// si colocamos todos los datos en solo sitio o una sola linea, sin especificar es e novatos, porque hay que haber un orden\n\n}", "public function getMontantTva() {\n return $this->montantTva;\n }" ]
[ "0.6070071", "0.5996449", "0.5992745", "0.5906089", "0.56496257", "0.5551848", "0.5545179", "0.54639", "0.5450587", "0.54454124", "0.54286385", "0.54113895", "0.5346039", "0.5337798", "0.5330832", "0.5317377", "0.5297047", "0.52750444", "0.5254279", "0.52367663", "0.5228776", "0.52283126", "0.52065116", "0.52062535", "0.52008736", "0.5193502", "0.5193444", "0.51922786", "0.51876414", "0.51693654", "0.5150758", "0.5150123", "0.51444423", "0.51383466", "0.51268566", "0.5120492", "0.5118918", "0.50990605", "0.5080411", "0.50659996", "0.50615156", "0.50591266", "0.50489575", "0.5031352", "0.5027042", "0.50154257", "0.5006802", "0.4999406", "0.49754262", "0.49740753", "0.49723852", "0.4967155", "0.4961779", "0.49333203", "0.4924432", "0.4921298", "0.49173182", "0.49153867", "0.49132916", "0.4908564", "0.49075416", "0.49054524", "0.4901311", "0.48838", "0.48827487", "0.48777774", "0.4876987", "0.48669815", "0.4863357", "0.4863186", "0.4860814", "0.48522687", "0.48519027", "0.4851856", "0.48507416", "0.4850732", "0.48448986", "0.48437673", "0.48388636", "0.48377243", "0.4836487", "0.4827904", "0.48244223", "0.48212463", "0.4820158", "0.48198852", "0.4818126", "0.48149", "0.4810656", "0.48104972", "0.479848", "0.47901517", "0.4788813", "0.47784713", "0.4777709", "0.47750148", "0.4773494", "0.47731924", "0.47721183", "0.47660905", "0.4766038" ]
0.0
-1
Get Domain object by primry key
public function load($id);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract function getObject($objKey);", "protected function objectForKey($key) {\n\t\tif ($this->keyField == 'ID') {\n\t\t\treturn ExternalContent::getDataObjectFor($key);\n\t\t} else {\n\t\t\treturn DataObject::get_one($this->sourceObject, \"\\\"{$this->keyField}\\\" = '\" . Convert::raw2sql($key) . \"'\");\n\t\t}\n\t}", "public function getByKey($key);", "function domain_get($key=NULL){\n if(is_null($key)) return NULL;\n if(is_null($key)) $key = $this->cumd;\n return isset($this->domains[$key])?$this->domains[$key]:NULL;\n }", "public function __get(string $key);", "public function __get($key)\n {\n return $this->getModel($key);\n }", "public function getObject($key) {\n\t\treturn $this->objects[$key];\n\t}", "public function __get($key);", "public function __get($key);", "public function getObject($key)\n\t{\n\t\treturn $this->objects[$key];\n\t}", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "public function get($key);", "abstract public function get($key);", "public function get( $key );", "public function getObjFromCache($key);", "abstract protected function retrieve($key);", "public static function Get($key) {\r\n\t\t$cls = get_called_class();\r\n\t\t$model = new $cls();\r\n\t\t$primary = $model->index('primary');\r\n\t\tif (is_null($primary)) {\r\n\t\t\tthrow new Exception(\"The schema for {$cls} does not identify a primary key\");\r\n\t\t}\r\n\t\tif (!is_array($key)) {\r\n\t\t\tif (count($primary['fields']) > 1) {\r\n\t\t\t\tthrow new Exception(\"The schema for {$cls} has more than one field in its primary key\");\r\n\t\t\t}\r\n\t\t\t$key = array(\r\n\t\t\t\t$primary['fields'][0] => $key\r\n\t\t\t);\r\n\t\t}\r\n\t\tforeach ($primary['fields'] as $field) {\r\n\t\t\tif (!isset($key[$field])) {\r\n\t\t\t\tthrow new Exception(\"No value provided for the {$field} field in the primary key for \" . get_called_class());\r\n\t\t\t}\r\n\t\t\t$model->where(\"{$field} = ?\", $key[$field]);\r\n\t\t}\r\n\t\t//$src = Dbi_Source::GetModelSource($model);\r\n\t\t$result = $model->select();\r\n\t\tif ($result->count()) {\r\n\t\t\tif ($result->count() > 1) {\r\n\t\t\t\tthrow new Exception(\"{$cls} returned multiple records for primary key {$id}\");\r\n\t\t\t}\r\n\t\t\t$record = $result[0];\r\n\t\t} else {\r\n\t\t\t$record = new Dbi_Record($model, null);\r\n\t\t\t$record->setArray($key, false);\r\n\t\t}\r\n\t\treturn $record;\r\n\t}", "public function fetchValue(string $domain, $key = NULL);", "public function get($strKey);", "abstract public function get ($key);", "public function obtenerObjeto($key){\n\t\tif(is_object(self::$objetos[$key])){\n\t\t\treturn self::$objetos[$key];\n\t\t} \n\t}", "public function getObject(string $key): ?object;", "function get($key) {\n return apc_fetch($key);\n }", "public function __get( $key )\n {\n $p = parent::__get( $key );\n if ( !is_null( $p ) ) {\n return $p;\n }\n\n switch ( $key ) {\n case 'oid':\n return $this->scale_no->value;\n break;\n case 'name':\n return $this->scale_name->value;\n break;\n case 'level':\n return $this->level_name->value;\n break;\n case 'start':\n case 't0':\n return $this->early_age->value;\n break;\n case 'end':\n case 't1':\n case 'tf':\n return $this->late_age->value;\n break;\n default:\n throw new \\DomainException( sprintf( 'Invalid property %s', $key ) );\n }\n\n return null;\n }", "public function get(string $key);", "public function get(string $key);", "public function get(string $key);", "public function get(string $key);", "public function get(string $key);", "public function get(string $key);", "public function get(string $key);", "public function get(string $key);", "public static function get($key);", "public static function get($key);", "function get($key) \n {\n return $this->$key;\n \n }", "protected function findPkSimple($key, $con)\n\t{\n\t\t$sql = 'SELECT ID, ROUTEID, PROVIDERID, PROVIDERNAME, NAMEZH, NAMEEN, PATHATTRIBUTEID, PATHATTRIBUTENAME, PATHATTRIBUTEENAME, BUILDPERIOD, DEPARTUREZH, DEPARTUREEN, DESTINATIONZH, DESTINATIONEN, REALSEQUENCE, DISTANCE, GOFIRSTBUSTIME, BACKFIRSTBUSTIME, GOLASTBUSTIME, BACKLASTBUSTIME, OFFPEAKHEADWAY FROM routes_2011 WHERE ID = :p0';\n\t\ttry {\n\t\t\t$stmt = $con->prepare($sql);\n\t\t\t$stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t} catch (Exception $e) {\n\t\t\tPropel::log($e->getMessage(), Propel::LOG_ERR);\n\t\t\tthrow new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n\t\t}\n\t\t$obj = null;\n\t\tif ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$obj = new Routes2011();\n\t\t\t$obj->hydrate($row);\n\t\t\tRoutes2011Peer::addInstanceToPool($obj, (string) $row[0]);\n\t\t}\n\t\t$stmt->closeCursor();\n\n\t\treturn $obj;\n\t}", "public function getPersistentObject($key)\n {\n if (!$this->loaded) {\n $this->load();\n }\n\n return $this->doGetPersistentObject($key);\n }", "function get( $key ){\r\n\t\treturn $this->$key;\r\n\t}", "public function getObject( $key )\r\n\t{\r\n\t\tif( is_object ( self::$objects[ $key ] ) )\r\n\t\t{\r\n\t\t\treturn self::$objects[ $key ];\r\n\t\t}\r\n\t}", "public function get($key)\n {\n return $this->find($key);\n }", "public function getItem($key){}", "public function findByKey($key)\n {\n return Page::where('key', $key)->first();\n }", "function get($key) {\n\t\t\treturn $this->inst->get($key);\n\t\t}", "public function query_get($key) {\n\t\t\treturn \\uri\\query::get($this->object, $key);\n\t\t}", "public function get($key) {\n\t\t\tif(!is_object($this->package) || !($this->package instanceof Object))\n\t\t\t\t$this->package = $this->getPackage();\n\t\t\t\n\t\t\treturn $this->package->get($key);\n\t\t}", "public function getClientByApiKeyAndDomain(string $apikey, string $domain) : ?\\stdClass {\n\t\t$dataOjb = $this->entityClient->getValuesAsObject();\n\t\t$dataOjb->apikey = $apikey;\n\t\tif ($domain !== 'self') {\n\t\t\t$dataOjb->domain = $domain;\n\t\t}\n\t\t$this->entityClient->populateState($dataOjb, true);\n\n\t\treturn $this->entityClient->get($this->entityClient->get('primaryKey')) ? $this->entityClient->getValuesAsObject() : null;\n\t}", "public function __get($key)\n {\n return apc_fetch($key);\n }", "public function getObject($key) {\n $get = $this->get($key);\n $get = unserialize($get);\n\t\treturn $get;\n\t}", "abstract public function getConcrete($key);", "protected function findPkSimple($key, $con)\n\t{\n\t\t$sql = 'SELECT `ID`, `TITULO`, `DURACION`, `FECHA_ESTRENO`, `ESTRENO`, `ACTOR1_NOM`, `ACTOR1_APELL`, `ACTOR2_NOM`, `ACTOR2_APELL`, `CATEGORIA_ID`, `ESTADO`, `SINOPSIS`, `IMAGEN` FROM `pelicula` WHERE `ID` = :p0';\n\t\ttry {\n\t\t\t$stmt = $con->prepare($sql);\n\t\t\t$stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t} catch (Exception $e) {\n\t\t\tPropel::log($e->getMessage(), Propel::LOG_ERR);\n\t\t\tthrow new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n\t\t}\n\t\t$obj = null;\n\t\tif ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$obj = new Pelicula();\n\t\t\t$obj->hydrate($row);\n\t\t\tPeliculaPeer::addInstanceToPool($obj, (string) $key);\n\t\t}\n\t\t$stmt->closeCursor();\n\n\t\treturn $obj;\n\t}", "protected function findPkSimple($key, $con)\n\t{\n\t\t$sql = 'SELECT `ID`, `NAME`, `VALUE`, `REMOTE` FROM `repository` WHERE `ID` = :p0';\n\t\ttry {\n\t\t\t$stmt = $con->prepare($sql);\n\t\t\t$stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t} catch (Exception $e) {\n\t\t\tPropel::log($e->getMessage(), Propel::LOG_ERR);\n\t\t\tthrow new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n\t\t}\n\t\t$obj = null;\n\t\tif ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$obj = new Repository();\n\t\t\t$obj->hydrate($row);\n\t\t\tRepositoryPeer::addInstanceToPool($obj, (string) $row[0]);\n\t\t}\n\t\t$stmt->closeCursor();\n\n\t\treturn $obj;\n\t}", "function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('DataObjects_Especificacion',$k,$v); }", "protected function findPkSimple($key, $con)\n\t{\n\t\t$sql = 'SELECT `ID`, `USER_ID`, `NAME`, `DESCRIPTION`, `BARE_PATH`, `CLONE_PATH`, `FORKED_FROM_ID`, `FORKED_AT`, `CREATED_AT`, `UPDATED_AT` FROM `repository` WHERE `ID` = :p0';\n\t\ttry {\n\t\t\t$stmt = $con->prepare($sql);\n\t\t\t$stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n\t\t\t$stmt->execute();\n\t\t} catch (Exception $e) {\n\t\t\tPropel::log($e->getMessage(), Propel::LOG_ERR);\n\t\t\tthrow new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n\t\t}\n\t\t$obj = null;\n\t\tif ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n\t\t\t$obj = new Repository();\n\t\t\t$obj->hydrate($row);\n\t\t\tRepositoryPeer::addInstanceToPool($obj, (string) $row[0]);\n\t\t}\n\t\t$stmt->closeCursor();\n\n\t\treturn $obj;\n\t}", "public function createDomainObject($key)\n {\n $domainClass = KernelRegistry::getDomainClass($key);\n if (false === $domainClass) {\n return false;\n }\n\n try {\n return new $domainClass();\n } catch (Exception $e) {\n $err = \"object not found for ($key) at ($domainClass)\";\n throw new RunTimeException($err, 0, $e);\n }\n }", "public function getItem($key);", "public function getItem($key);", "public function getItem($key);", "public function getItem($key);", "public function __get($key)\n {\n $method = 'get' . ucfirst($key);\n if (method_exists($this, $method)) {\n return $this->$method();\n }\n\n // If the property is defined in our data object, return it.\n if (isset($this->data->{$key})) {\n return $this->data->{$key};\n }\n\n // Load the full record if needed.\n $this->init();\n\n // If there's a getter method on the UserIdentifiers object\n // (getBarcode, getPrimaryId), call it.\n if (method_exists($this->identifiers, $method)) {\n return $this->identifiers->$method();\n }\n\n // Re-check if there's a property on our data object\n if (isset($this->data->{$key})) {\n return $this->data->{$key};\n }\n }", "public function get($name) {\n\t\t$arguments = func_get_args();\n\t\t$raw = array_shift($arguments);\n\t\t$exploded = explode(':', $name);\n\t\tif (count($exploded) == 2 && intval($exploded[1]) > 0) {\n\t\t\t// likelihood: DomainObject with UID as string representation - detect further\n\t\t\t$uid = intval(array_pop($exploded));\n\t\t\t$name = array_pop($exploded);\n\t\t\t$argument = $this->get('Tx_Extbase_MVC_Controller_Argument', 'content', $raw);\n\t\t\t$instance = $argument->setValue($uid)->getValue(); // hopefully a transformation to an object\n\t\t\tif ($object instanceof Tx_Extbase_DomainObject_DomainObjectInterface) {\n\t\t\t\t// certainty; is DomainObject - return it\n\t\t\t\treturn $instance;\n\t\t\t}\n\t\t} else if (count($arguments) == 1 && strpos($name, '_Domain_Model_')) {\n\t\t\t$arg = array_shift($arguments);\n\t\t\tif (is_array($arg) && count($arg) > 0) {\n\t\t\t\t// likelihood: $arg is an array of UIDs - detect further. Instanciate \n\t\t\t\t// an ObjectStorage in case we need to attach loaded candidates.\n\t\t\t\t$objectStorage = $this->get('Tx_WildsideExtbase_Persistence_ObjectStorage');\n\t\t\t\t$isUidArray = TRUE;\n\t\t\t\tforeach ($arg as $possibleUid) {\n\t\t\t\t\t// absolutely only positive integers are accepted - a single value which is not \n\t\t\t\t\t// a positive integer means this is NOT an array of UIDs\n\t\t\t\t\tif (intval($possibleUid) < 1) {\n\t\t\t\t\t\t$isUidArray = FALSE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($isUidArray) {\n\t\t\t\t\t// certainty: UID array specified. Load the instances we can. Respect Repository\n\t\t\t\t\t// for loading - storagePid etc also. Repository with wrong/missing storagePid\n\t\t\t\t\t// returns empty QueryResult; this method with wrong/missing storagePid returns\n\t\t\t\t\t// empty ObjectStorage\n\t\t\t\t\tforeach ($arg as $uid) {\n\t\t\t\t\t\t$instance = $this->get($name, $uid);\n\t\t\t\t\t\tif ($instance) {\n\t\t\t\t\t\t\t$objectStorage->attach($instance);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn $objectStorage;\n\t\t\t\t} else {\n\t\t\t\t\treturn $this->get($name, $arg);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$uid = intval($arg);\n\t\t\tif ($uid > 0) {\n\t\t\t\t// is DomainObject and possible UID was only argument; retry as string representation\n\t\t\t\treturn $this->get(\"{$name}:{$uid}\");\n\t\t\t}\n\t\t}\n\t\treturn $this->objectContainer->getInstance($name, $arguments);\n\t}", "public function __get($childKey);", "public function __get($key){\n return $this->get($key);\n }", "function get($key);", "function &get($key) {\n\t\tif ($key=='_id')\n\t\t\treturn $this->id;\n\t\tif (array_key_exists($key,$this->document))\n\t\t\treturn $this->document[$key];\n\t\tuser_error(sprintf(self::E_Field,$key),E_USER_ERROR);\n\t}", "public function retrieve($key) {\n return apc_fetch($key);\n }", "public function __get($key)\n\t{\n\t\t// See if we are requesting a foreign key\n\t\tif (isset($this->_data[$key.'_id']))\n\t\t{\n\t\t\tif (isset($this->_lazy[$key])) // See if we've lazy loaded it\n\t\t\t{\n\t\t\t\t$model = AutoModeler::factory($key);\n\t\t\t\t$model->process_load($this->_lazy[$key]);\n\t\t\t\t$model->process_load_state();\n\t\t\t\treturn $model;\n\t\t\t}\n\n\t\t\t// Get the row from the foreign table\n\t\t\treturn AutoModeler::factory($key, $this->_data[$key.'_id']);\n\t\t}\n\t\telse if (isset($this->_data[$key]))\n\t\t\treturn $this->_data[$key];\n\t}", "protected function findPkSimple($key, $con)\n {\n $sql = 'SELECT ID, PARENT_ID, CIVILITY_ID, SERVICE_ID, ROLE, TITLE, FIRST_NAME, LAST_NAME, MAIDEN_NAME, COMPLEMENT_NAME, NAME, SHORT_NAME, ZONE_ID, ADDRESS1, ADDRESS2, CITY, POSTAL_CODE, COUNTRY, PHONE, FAX, MOBILE, EMAIL, WEB, COMMENT, HIDDEN_COMMENT, BIRTH_DATE, BIRTH_PLACE, BIRTH_PLACE_CODE, IS_ARCHIVE, ARCHIVE_DATE, ARCHIVE_COMMENT, SECU_NUMBER, SIRET, SIREN, NAF_CODE, APE_CODE, TYPE, CREATED_AT, CREATED_BY, UPDATED_AT, UPDATED_BY FROM sfc_abk_contact WHERE ID = :p0';\n try {\n $stmt = $con->prepare($sql);\n\t\t\t$stmt->bindValue(':p0', $key, PDO::PARAM_INT);\n $stmt->execute();\n } catch (Exception $e) {\n Propel::log($e->getMessage(), Propel::LOG_ERR);\n throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);\n }\n $obj = null;\n if ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n $cls = ContactPeer::getOMClass($row, 0);\n $obj = new $cls();\n $obj->hydrate($row);\n ContactPeer::addInstanceToPool($obj, (string) $key);\n }\n $stmt->closeCursor();\n\n return $obj;\n }", "public function __get($key)\n {\n \tassert(null !== $key);\n \t\n $keyLower = strtolower($key);\n if ('uid' === $keyLower)\n {\n return $this->getUIDAsProperty();\n }\n if (!array_key_exists($keyLower, $this->data))\n return null;\n return $this->data[$keyLower];\n }", "public function fetch($key);", "public function fetch($key);", "public function fetch($key);", "public function findFirstByKey($key);", "abstract public function getKey();", "abstract public function getKey();", "public function get(string $key): mixed;" ]
[ "0.699394", "0.6757122", "0.67072475", "0.6671864", "0.6461263", "0.6456062", "0.64468956", "0.6444349", "0.6444349", "0.64203864", "0.6341895", "0.6341895", "0.6341895", "0.6341895", "0.6341895", "0.6341895", "0.6341895", "0.6341895", "0.6341895", "0.6341895", "0.6341895", "0.6341895", "0.6341895", "0.6341895", "0.6341895", "0.6341895", "0.6341895", "0.6341895", "0.6341895", "0.6341895", "0.6341895", "0.6341895", "0.6341895", "0.6341895", "0.6341895", "0.6341895", "0.6341895", "0.6341895", "0.6311274", "0.6299188", "0.62751603", "0.6264303", "0.62566674", "0.625502", "0.62522846", "0.62465054", "0.62141466", "0.62098944", "0.6186617", "0.617735", "0.6166387", "0.6166387", "0.6166387", "0.6166387", "0.6166387", "0.6166387", "0.6166387", "0.6166387", "0.61539197", "0.61539197", "0.6147499", "0.6118509", "0.6107563", "0.6098002", "0.60886925", "0.60885864", "0.6088564", "0.60828656", "0.6077164", "0.60760415", "0.6075637", "0.60704154", "0.6064799", "0.60563236", "0.60423756", "0.60403574", "0.60329413", "0.6004042", "0.597699", "0.59741294", "0.59689724", "0.59689724", "0.59689724", "0.59689724", "0.5968694", "0.59658295", "0.59603316", "0.59471464", "0.5942361", "0.59401006", "0.5931678", "0.592814", "0.5924192", "0.5916098", "0.5910929", "0.5910929", "0.5910929", "0.590355", "0.5900536", "0.5900536", "0.5892805" ]
0.0
-1
Get all records from table
public function queryAll();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getAllRecords();", "function get_all_records(){\n\t\tglobal $db;\n\t\t$sql=\"SELECT * FROM $this->table order by id asc\";\n\t\t$db->query($sql);\n\t\t$row=$db->fetch_assoc_all();\n\t\treturn $row;\n\t}", "public function getAll()\n {\n $sql = \"SELECT * FROM `%s`\";\n $this->_sql[] = sprintf($sql, $this->_table);\n $this->_parameters[] = array();\n return $this->run();\n }", "public function table_get_all($table);", "public function getAll()\n {\n $sql = \"SELECT * FROM $this->table\";\n $req = Database::getBdd()->prepare($sql);\n $req->execute();\n return $req->fetchAll();\n }", "public static function all()\n {\n self::select(self::tableName());\n return self::fetchAll();\n }", "public function getAll()\n {\n return $this->db->table($this->tableName)->select('*')->findAll();\n }", "public function getAll() {\n return $this->db->getAllFromTable($this->table);\n }", "public function queryAll() {\r\n $sql = \"SELECT * FROM $this->table\";\r\n $stmt = ConnectionFactory::prepare($sql);\r\n $stmt->execute();\r\n return $stmt->fetchAll();\r\n }", "public function getAll(){\n\t\treturn $this->db->get($this->table);\n\t}", "public function all()\r\n {\r\n return $this->db->table($this->table)->get();\r\n }", "public function getAll()\n {\n $sql = \"SELECT * FROM \".$this->table;\n $req = Database::getBdd()->prepare($sql);\n $req->execute();\n return $req->fetchAll(PDO::FETCH_OBJ);\n \n }", "public function all()\n {\n $sql = \"SELECT * FROM {$this->table()}\";\n return $this->db->query($sql)->fetchAll();\n }", "public static function getAll(){\n\t\t$sql = \"select * from \".self::$tablename;\n\t\t$query = Executor::doit($sql);\n\t\treturn Model::many($query[0],new TemparioData());\n\t}", "public function getAll()\n {\n return $this->prepare(DB::findAll($this->table));\n }", "public function getAll()\n {\n $sql = \"SELECT * FROM \" . self::table . \";\";\n\n $conn = $this->dbc->Get();\n $statement = $conn->prepare($sql);\n $statement->execute();\n $data = $statement->fetchAll();\n $conn = null;\n\n return $data;\n }", "function get_all()\n {\n return $this->db->get($this->table)->result();\n }", "public function fetchAll()\n { \n $resultSet = $this->tableGateway->select();\n return $resultSet;\n }", "public function fetchAll(){\n $resultSet = $this->tableGateway->select();\n return $resultSet;\n }", "public function fetchAll() {\n\t\t$queryBuilder = $this->db->createQueryBuilder();\n\t\t$queryBuilder\n\t\t\t->select('*')\n\t\t\t->from($this->table_name, 't1')\n\t\t;\n\t\t$result = $queryBuilder->execute()->fetchAll();\n\n\t\treturn $result;\n\t}", "public function all(): ResultSetContract;", "public function All()\n {\n $query = \"SELECT * FROM $this->table\";\n $result = $this->query($query);\n return $this->convertArray($result);\n }", "public function fetchRecords() {\n return self::all();\n }", "function get_all(){\r\n\t\t$rows = array();\r\n\t\twhile($row = $this->get_row()){\r\n\t\t\t$rows[] = $row;\r\n\t\t}\r\n\t\treturn $rows;\r\n\t}", "public function fetchAll()\n {\n return $this->tableGateway->select();\n }", "public function fetchAll()\n {\n return $this->tableGateway->select();\n }", "public function getRecords()\n {\n $result = $this->fetchAll($this->select()->order('id ASC'))->toArray();\n return $result;\n }", "public function getAll()\r\n {\r\n $stmt = $this->conn->prepare(\"SELECT * FROM $this->table ORDER BY id DESC\");\r\n $stmt->execute();\r\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n }", "public function getAll()\n\t{\n\t\t$args = array('order' => 't.id');\n \t$records = $this->record->findAll($args);\n \treturn $this->model->populateModels($records, 'id');\n\t}", "public function findAll(){\n \n\t\t$sql = 'SELECT * FROM ' . self::TABLENAME;\n\n \t$db = new Database(); // se creeaza conexiunea la baza de date\n\t\t$stmt = $db->getConnection()->prepare($sql);\n\t\t$stmt->execute();\n\t\t$results = $stmt->fetchAll();\n\t\n\t\treturn $results; \n }", "public function findAll(){\n \n\t\t$sql = 'SELECT * FROM ' . self::TABLENAME;\n\n \t$db = new Database(); // se creeaza conexiunea la baza de date\n\t\t$stmt = $db->getConnection()->prepare($sql);\n\t\t$stmt->execute();\n\t\t$results = $stmt->fetchAll();\n\t\n\t\treturn $results; \n }", "public static function getAll() {\n $conn = self::connect();\n $row = $conn->getAll(self::baseQuery());\n return $row;\n }", "public function all()\n {\n $records = R::findAll( $this->table_name(), \" order by id \");\n\n $object = array_map( function($each_record) {\n return $this->map_reford_to_object( $each_record );\n },\n $records\n );\n\n return array_values( $object );\n }", "public abstract function fetchAll($table);", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM recibo';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public static function find_all()\n {\n return self::find_by_sql(\"SELECT * from \".self::$table_name);\n }", "public function getAll()\r\n {\r\n $data = $this->select()\r\n ->from($this->_name);\r\n return $this->fetchAll($data);\r\n }", "public static function find_all() {\r\n\t\treturn self::find_by_sql(\"SELECT * FROM \".self::$table_name);\r\n\t}", "public function getAll($table){\n\t\treturn $this->db->get($table);\n\t}", "protected function getAll()\n {\n $statement = $this->connection->query($this->sqlToString());\n return $this->fetchAll($statement);\n }", "function selectAll() {\n $query = $this->getStatement(\n \"SELECT * FROM `$this->table` WHERE 1 ORDER BY id\"\n );\n $query->execute();\n return $query->fetchAll();\n }", "public function get_all(){\n\t\t$this->db->select('*');\n\t\t$this->db->from($this->TABLENAME);\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}", "public function fetchAll(){\n $adapter = $this->adapter;\n $sql = new Sql($this->adapter);\n $select = $sql->select();\n $select->from('flota');\n $selectString = $sql->getSqlStringForSqlObject($select);\n $data = $adapter->query($selectString, $adapter::QUERY_MODE_EXECUTE);\n \n return $data;\n }", "public function fetchAll()\r\n {\r\n $sql = new Sql($this->dbAdapter);\r\n $select = $sql->select();\r\n $select\r\n ->from(array('a_s' => $this->table))\r\n ->order('a_s.sector_order ASC');\r\n \r\n $selectString = $sql->getSqlStringForSqlObject($select);\r\n $execute = $this->dbAdapter->query($selectString, Adapter::QUERY_MODE_EXECUTE);\r\n $result = $execute->toArray();\r\n return $result;\r\n }", "public function getAll(){\n $adapter = $this->createAdapter();\n $results = $adapter->query($this->getSelectStatement());\n return $results;\n $adapter = null;\n }", "public function findAll() {\r\n $sql = \"SELECT * FROM $this->tabela\";\r\n $stm = DB::prepare($sql);\r\n $stm->execute();\r\n return $stm->fetchAll();\r\n }", "public function all()\r\n {\r\n return new IteratorResult(R::findAll($this->table),'redbean');\r\n }", "public function fetchAll()\n {\n // LEFT JOIN patient ON patient.patientId = doc_calendar.patientId\n $select = new \\Zend\\Db\\Sql\\Select ;\n $select->from('doc_calendar');\n $user_session = new Container('user');\n\n $select->where(\" doc_calendar.doctorId = '{$user_session['user']->getId()}'\");\n $select->join(array(\"p\" => \"patient\"), \"doc_calendar.patientId = p.patientId\");\n\n $dbAdapter = $this->tableGateway->getAdapter();\n $statement = $dbAdapter->createStatement();\n\n $select->prepareStatement($dbAdapter, $statement);\n $driverResult = $statement->execute(); // execute statement to get result\n\n $resultSet = new ResultSet();\n $resultSet->initialize($driverResult);\n $rows = array();\n foreach($resultSet as $row) {\n $rows[] = $row->getArrayCopy();\n }\n\n return $rows;\n }", "public static function findAll()\n\t\t{\n\t\t\t$tb = self::get('tabla') ;\n\t\t\t\n\t\t\treturn Database::getInstance()\n\t\t\t\t\t->query(\"SELECT * FROM $tb ;\")\n\t\t\t\t\t->getObjects(get_called_class()) ;\n\t\t}", "function all($table)\n {\n $sql = \"SELECT * FROM $table\";\n $statement = $this->pdo->prepare($sql);\n $statement->execute();\n $results = $statement->fetchAll(PDO::FETCH_ASSOC);\n\n return $results;\n }", "public function fetchAll()\r\n {\r\n $this->query();\r\n return $this->sth->fetchAll();\r\n }", "function getallrecord()\n\t{\n\t\treturn $this->db->get(\"tblteman\");\n\t\t// fungsi get(\"namatable\") adalah active record ci\n\t}", "function get_all()\n {\n $this->db->order_by($this->id, $this->order);\n return $this->db->get($this->table)->result();\n }", "public function getAll()\n {\n $records = $this->getRecordsModel()->getAll();\n \n return $records;\n }", "function readAll(){\n\n\t\t$query = \"SELECT * FROM \" . $this->table_name .\"\";\n\t\t$stmt = $this->conn->prepare($query);\n\t\t$stmt->execute();\n\t\treturn $stmt;\n\t}", "public function fetchAll();", "public function fetchAll();", "public function fetchAll();", "public function fetchAll();", "function getAllData($table){\n\t\ttry {\n\t\t\t$sql = \"SELECT * FROM $table\";\n\t\t\t$query = $this->executeQuery($sql);\n\t\t\t$list = $query->fetchAll(PDO::FETCH_ASSOC);\n\t\t}catch(Exception $e){\n\t\t\t$this->logger->error($sql, $e->getMessage());\n\t\t\tthrow $e;\n\t\t}\n\t\treturn $list;\n\t}", "public function getAll($table){\n $query = $this->pdo->prepare(\"SELECT * FROM {$table}\");\n $query->execute();\n return $query->fetchAll(\\PDO::FETCH_OBJ);\n }", "public static function get_all_records() {\n\t\tglobal $wpdb;\n\n\t\t$query = 'select * from ' . self::TABLE_NAME . ' order by email asc;';\n\n\t\t$results = $wpdb->get_results( $query, ARRAY_A );\n\n\t\tif ( ! is_array( $results ) ) {\n\t\t\t$results = array();\n\t\t\treturn $results;\n\t\t}\n\n\t\treturn $results;\n\t}", "public static function find_all(){\n global $database;\n $result_set = static::find_by_sql(\"SELECT * FROM \".static::$table_name);\n return $result_set;\n }", "public function getAll(): array\n {\n $this->setReqSql(\"SELECT * FROM {$this->table}\");\n return $this->outCast($this->fetchAll());\n }", "public function getRecords($table, $where=false){// method getRecords body start\n\t\t\n\t\tif($where){\n\t\t\t$where = $this->makeWhere($where);\n\t\t}\n\t\t$query = \"SELECT * FROM $table \".$where;\n\t\treturn $this->exeQuery($query);\n\t\t\n\t}", "public function getAll()\n {\n return $this->queryBuilder->select($this->table);\n }", "public function fetchAll(){\r\n$table=$this->getTable();\r\nreturn $this->fetch_array($this->query(\"SELECT * FROM {$table}\"));\r\n}", "public function queryAll(){\r\n\t\t$sql = 'SELECT * FROM tbl_empleado';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\treturn $this->getList($sqlQuery);\r\n\t}", "public static function all()\n {\n self::getAllByTableName();\n return parent::getAllByTableName();\n }", "protected function getAll(){\n\t\t\n\t\t$connection = DB::connect();\n\t\t\n\t\t$sql = \"SELECT * FROM $this->_tableName\";\n\t\t$result = '';\n\t\t\n\t\ttry {\n\t\t\t$stmt = $connection->query($sql);\n\t\t\t$result = $stmt->fetchAll();\n\t\t\n\t\t\treturn $result;\n\t\t\n\t\t} catch (PDOException $e){\n\t\t\tdie('Error: '.$e->getMessage().'<br/>');\n\t\t}\n\t}", "public function getAll() {\n\t\treturn $this->rows;\n\t}", "public function fetchAll($params = [])\n { \n var_dump($params);\n return $this->table->tableGateway->select();\n }", "public function fetchAll() {\r\n\t\treturn $this->getMapper()->fetchAll();\r\n\t\t\r\n\t}", "function QueryAll()\n\t{\n\t\t$dalSQL = \"select * from \".$this->_connection->addTableWrappers( $this->m_TableName );\n\t\treturn $this->_connection->query( $dalSQL );\n\t}", "public function get(){\n\t\t\t\t\t $this->db->setTablename($this->tablename);\n\t\t\t\t\t ;\n return $this->db->getRows(array(\"where\"=>$condition,\"return_type\"=>\"single\"));\n\t\t\t\t\t }", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM patient_info';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public static function findAll() {\n $cons = \"select * from `\".ApplicationADO::$tableName.\"`\";\n return ApplicationADO::findByQuery( $cons, [] );\n }", "public function fetchAll(string $table)\n {\n $query = \"SELECT * FROM $table\";\n return $this->conn->query($query);\n }", "public function all()\n {\n return $this->db->query('SELECT * FROM '.$this->table.' ORDER by created_at DESC')->get();\n }" ]
[ "0.80387056", "0.8035785", "0.7974995", "0.786513", "0.78617007", "0.7850022", "0.7838028", "0.78341025", "0.781332", "0.7755192", "0.77521724", "0.774303", "0.77249324", "0.7686146", "0.76735526", "0.76643276", "0.76399314", "0.759483", "0.75834936", "0.7570823", "0.753629", "0.7529295", "0.75087214", "0.75008786", "0.7500836", "0.7500836", "0.74910676", "0.74855787", "0.7455125", "0.74538606", "0.74538606", "0.7439278", "0.74373716", "0.7429767", "0.74261826", "0.74128115", "0.74114245", "0.7408748", "0.73747265", "0.7372642", "0.7360126", "0.7356874", "0.73545396", "0.7352505", "0.7342665", "0.7342535", "0.73383886", "0.7337685", "0.7328948", "0.7324207", "0.73203206", "0.73168045", "0.7312664", "0.7307537", "0.7306824", "0.7302053", "0.7302053", "0.7302053", "0.7302053", "0.72920424", "0.72883254", "0.72803986", "0.7277902", "0.72749186", "0.7268368", "0.7236042", "0.72326905", "0.7230895", "0.7220001", "0.72179353", "0.7206436", "0.72048694", "0.7197854", "0.71842855", "0.718207", "0.7178316", "0.7174382", "0.716206", "0.7159574" ]
0.71580786
99
Get all records from table ordered by field
public function queryAllOrderBy($orderColumn);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllPlayersOrderBy($field){\n\t$query = \"SELECT * FROM aquigaza_fsutt_local.players ORDER by \".$field;\n $resource = runQuery($query);\n\treturn ozRunQuery($resource);\n}", "public function orderby(){\n\n $rows = $this\n ->db\n ->order_by(\"title\", \"asc\")\n ->order_by(\"id\", \"random\")\n ->get(\"personel\")\n ->result();\n\n print_r($rows);\n\n }", "function get_all_records(){\n\t\tglobal $db;\n\t\t$sql=\"SELECT * FROM $this->table order by id asc\";\n\t\t$db->query($sql);\n\t\t$row=$db->fetch_assoc_all();\n\t\treturn $row;\n\t}", "public function orderBy($field) {\n\t$this->parseQuery->orderBy($field);\n }", "public function selectRowsOrderByPagging($fields='*', $table='users',$orderByClause='',$order='ASC',$page=1,$perpage=10) {\n\t\tif(is_array($fields))\n\t\t{\n\t\t\t$fields = implode(\",\",$fields);\n\t\t}\n\t\tif($orderByClause=='')\n\t\t{\n\t\t\tdie(\"Order By Clause Should Not Be Blanked\");\n\t\t}\n\t $sql = \"SELECT $fields from $table ORDER BY $orderByClause $order\"; \n $result = DB::select($sql,$page,$perpage,6,2,0);\n\t\t$returnArray = array();\n\t\tif($result[0]>0)\n\t\t{\n\t\t\twhile($row = mysql_fetch_assoc($result[1]))\n\t\t\t{\n\t\t\t\t$returnArray[] = $row;\n\t\t\t}\n\t\t}\n\t\treturn $returnArray;\n }", "function getRecords($table, $fields=\"\", $condition=\"\", $orderby=\"\", $single_row=false) //$condition is array \n\t{\n//\t\tif($fields != \"\")\n//\t\t{\n//\t\t\t$this->db->select($fields);\n//\t\t}\n\n $rs = $this->db->table($table);\n\n\t\tif($orderby != \"\")\n\t\t{\n $rs->orderBy($orderby,'DESC');\n\t\t}\n\n\t\tif($condition != \"\")\n\t\t{\n\t\t\t$rs->getWhere($condition);\n\t\t}\n\t\t\n\t\tif($single_row)\n\t\t{ \n\t\t\treturn $rs->get()->getResultArray();\n\t\t}\n\t\treturn $rs->get()->getResultArray();\n\n\t}", "public function selectRowsOrderBy($fields='*', $table='users' ,$limit=10,$orderByClause='',$order='ASC') {\n\t\tif(is_array($fields))\n\t\t{\n\t\t\t$fields = implode(\",\",$fields);\n\t\t}\n\t\tif($orderByClause=='')\n\t\t{\n\t\t\tdie(\"Order By Clause Should Not Be Blanked\");\n\t\t}\n\t $sql = \"SELECT $fields from $table ORDER BY $orderByClause $order LIMIT $limit\"; \n $result = mysql_query($sql);\n\t\t$returnArray = array();\n\t\twhile($row = mysql_fetch_assoc($result))\n\t\t{\n\t\t\t$returnArray[] = $row;\n\t\t}\n\t\treturn $returnArray;\n }", "public function &getOrderBy();", "public function orderBy($field, $direction = 'ASC');", "public function getRecords()\n {\n $result = $this->fetchAll($this->select()->order('id ASC'))->toArray();\n return $result;\n }", "private static function findAllOrderedBy($value_id, $field) {\n $table = new Cms_Model_Db_Table_Application_Page();\n $select = $table->select(Zend_Db_Table::SELECT_WITH_FROM_PART);\n $select->setIntegrityCheck(false);\n $select->join('cms_application_page_block', 'cms_application_page_block.page_id = cms_application_page.page_id')\n ->join('cms_application_page_block_address', 'cms_application_page_block_address.value_id = cms_application_page_block.value_id')\n ->where(\"cms_application_page.value_id = ?\", $value_id)\n ->order(\"cms_application_page_block_address.\" . $field . \" asc\");\n return $table->fetchAll($select);\n }", "function get_all()\n {\n $this->db->order_by($this->id, $this->order);\n return $this->db->get($this->table)->result();\n }", "public function findAllByOrder()\n {\n return $this->findBy(array(), array('updatedAt'=>'desc', 'createdAt'=>'desc'));\n }", "public function getAllOrderedByName()\n {\n return $this->model->orderBy('name', 'asc')->get();\n }", "public function order($field, $order = 'desc');", "protected function getRecords()\r\n {\r\n $records = null;\r\n $model = $this->controller->reorderGetModel();\r\n $query = $model->newQuery();\r\n\r\n $this->controller->reorderExtendQuery($query);\r\n\r\n if ($this->sortMode == 'simple') {\r\n $query = $query\r\n ->orderBy($model->getSortOrderColumn());\r\n $records = $query->get();\r\n $records = $records->groupBy($model->getGroupColumn());\r\n }\r\n elseif ($this->sortMode == 'nested') {\r\n $records = $query->getNested();\r\n }\r\n\r\n return $records;\r\n }", "protected function get_ordered_records()\n\t{\n\t\t$records = array();\n\n\t\t$ordering = function(array $branch) use(&$ordering, &$records) {\n\n\t\t\tforeach ($branch as $node)\n\t\t\t{\n\t\t\t\t$records[$node->nid] = $node->record;\n\n\t\t\t\tif ($node->children)\n\t\t\t\t{\n\t\t\t\t\t$ordering($node->children);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\t$node = current($this->index);\n\n\t\tif (empty($node->record))\n\t\t{\n\t\t\t$this->populate();\n\t\t}\n\n\t\t$ordering($this->tree);\n\n\t\treturn $records;\n\t}", "function record_sort($records, $field, $reverse=false){\n\n $hash = array();\n \n foreach($records as $key => $record){\n $hash[$record[$field].$key] = $record;\n }\n \n ($reverse)? krsort($hash) : ksort($hash);\n \n $records = array();\n \n foreach($hash as $record){\n $records []= $record;\n }\n \n return $records;\n}", "public function allRecordsByTitle(){\n\t $news = collect(DB::table('news')->get());\n\t return $news->sortBy('title');\n }", "function find($table, $where=\"1=1\", $fields=\"*\", $orderBy=\"1\"){\n\t\tActiveRecord::sql_item_sanizite($table);\n\t\tActiveRecord::sql_sanizite($fields);\n\t\tActiveRecord::sql_sanizite($orderBy);\n\t\t$q = $this->query(\"select $fields from $table where $where order by $orderBy\");\n\t\t$results = array();\n\t\twhile($row=$this->fetch_array($q)){\n\t\t\t$results[] = $row;\n\t\t}\n\t\treturn $results;\n\t}", "function getList($fieldName='', $searchValue='', $orderByField='', $orderByValue='', $offset ='', $limit ='')\r\n\t\t{\r\n\t\t\t$sqlRecord = $this->getTableRecordList($this->table, $fieldName, $searchValue, $orderByField, $orderByValue, $offset, $limit);\r\n\t\t\treturn $sqlRecord;\r\n\t\t\r\n\t\t}", "function getList($fieldName='', $searchValue='', $orderByField='', $orderByValue='', $offset ='', $limit ='')\r\n\t\t{\r\n\t\t\t$sqlRecord = $this->getTableRecordList($this->table, $fieldName, $searchValue, $orderByField, $orderByValue, $offset, $limit);\r\n\t\t\treturn $sqlRecord;\r\n\t\t\r\n\t\t}", "public function it_sorts_by_field_in_ascending_order(): void\n {\n $results = Client::filter([\n 'sorts' => [\n [\n 'column' => 'name',\n 'direction' => 'asc',\n ],\n ],\n ])->get();\n\n self::assertEquals($results->sortBy('name')->pluck('id'), $results->pluck('id'));\n }", "function all($table, $order='DESC')\n{\n return connect()->query(\"SELECT * FROM $table ORDER By id $order\");\n}", "public function orderByAsc($field, $overwrite = false);", "public function queryAllOrderBy($orderColumn){\n\t\t$sql = 'SELECT * FROM recibo ORDER BY '.$orderColumn;\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function orderBy($sql);", "function GetData($Field, $Table, $where = NULL, $and = NULL, $OrderField, $Order = \"DESC\") {\r\n global $con;\r\n $getAll = $con->prepare(\"SELECT $Field FROM $Table $where $and ORDER BY $OrderField $Order\");\r\n $getAll->execute();\r\n $AllData = $getAll->fetchAll();\r\n return $AllData;\r\n }", "public static function find_all(){\n $result = array();\n static::setConnection();\n $keyColumn = static::$keyColumn;\n $table = static::$table;\n $sql = \"SELECT * FROM \".$table.\" ORDER BY \".$keyColumn.\" DESC\";\n $res = mysqli_query(static::$conn,$sql);\n while($row = mysqli_fetch_object($res,get_called_class())){\n $result[] = $row;\n }\n return $result;\n }", "public function getAllFrom($fields,$table,$where=null,$orderby=null,$sort=null,$limit=null,$offset=null,$fetchOne=FALSE){\r\n\r\n $_orderby = !empty($orderby) ? \"order by $orderby\" : \"\";\r\n $_limit = !empty($limit) ? \"limit $limit\" : \"\";\r\n $_offset = !empty($offset) ? \"offset $offset\" : \"\";\r\n\r\n $stmp = $this->connection->prepare(\"SELECT $fields FROM $table $where $_orderby $sort $_limit $_offset\");\r\n \r\n $stmp->execute();\r\n if(!$fetchOne)\r\n return $stmp->fetchAll();\r\n else\r\n return $stmp->fetch();\r\n\r\n }", "public static function get_all_records() {\n\t\tglobal $wpdb;\n\n\t\t$query = 'select * from ' . self::TABLE_NAME . ' order by email asc;';\n\n\t\t$results = $wpdb->get_results( $query, ARRAY_A );\n\n\t\tif ( ! is_array( $results ) ) {\n\t\t\t$results = array();\n\t\t\treturn $results;\n\t\t}\n\n\t\treturn $results;\n\t}", "public function orderByAscending($field) {\n\t$this->parseQuery->orderByAscending($field);\n }", "function selTableDataDesc($table,$optfield=\"\", $pdo){\n $qry = ($optfield!=\"\")? \"SELECT * FROM \".$table.\" ORDER BY \".$optfield.\" DESC\": \"SELECT * FROM \".$table;\n //echo $qry;\n $result = array();\n $stm = $pdo->query($qry);\n $rows = $stm->fetchAll(PDO::FETCH_ASSOC);\n foreach($rows as $row) {\n array_push($result,$row);\n }\n return $result;\n}", "function getListOfRecords(){\n // the orders will be display and the receipts from there \n \n $element = new Order();\n \n $receipts_filter_orders = cisess(\"receipts_filter_orders\");\n \n if ($receipts_filter_orders===FALSE){\n $receipts_filter_orders = \"Abierta\"; // default to abiertas\n }\n \n if (!empty($receipts_filter_orders))\n {\n $element->where(\"status\",$receipts_filter_orders);\n }\n \n \n $element->order_by(\"id\",\"desc\");\n \n $all = $element->get()->all;\n //echo $element->check_last_query();\n ///die();\n $table = $this->entable($all);\n \n return $table;\n \n \n }", "function getAllFromAll($feild , $table , $where = NULL , $and= NULL , $orderBy , $ordering = 'DESC') {\n\n\t\tglobal $con\t;\n\n\t\t$getAll = $con->prepare(\"SELECT $feild FROM $table $where $and ORDER BY $orderBy $ordering\");\n\n\t\t$getAll->execute();\n\n\t\t$all = $getAll->fetchAll();\n\n\t\treturn $all;\n\t}", "function getDataListWhere($table,$fields = null,$where = null,$order = null,$limit_start,$limit_limit) {\r\n\t\t\r\n\t\t$db = self::getDatabaseDataWhere($table,$fields,$where,$order,$limit_start,$limit_limit);\r\n\t\t\r\n\t\t//echo $db->getQuery();\r\n\t\treturn $db->loadAssocList();\r\n\t}", "public function allRecordsByDate(){\n\t\t\t$news = collect(DB::table('news')->get());\n\t\t\treturn $news->sortBy('createdat');\n\t\t}", "public function getAll()\r\n {\r\n $stmt = $this->conn->prepare(\"SELECT * FROM $this->table ORDER BY id DESC\");\r\n $stmt->execute();\r\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n }", "function fPosts($orderCol=\"id\",$orderType=\"DESC\"){\n \n $sql = \"SELECT * FROM post ORDER BY $orderCol $orderType\";\n \n return fetchAll($sql);\n}", "public function queryAllOrderBy($orderColumn){\n\t\t$sql = 'SELECT * FROM patient_info ORDER BY '.$orderColumn;\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function select($table, $fields, $where, $order, $start);", "public function loadFromDb()\n {\n $this->getLogger()->debug(\"Reading {$this->tableName} from DB.\");\n $query = $this->getQueryFactory()->createSelectAllQuery($this->tableName);\n $res = $query->execute();\n $fields = array();\n foreach ($res->fetchAll(\\PDO::FETCH_ASSOC) as $row) {\n $fields[$row['id']] = $row;\n }\n ksort($fields);\n return $fields;\n }", "function get_ordered_all_data($order)\n {\n $this->db->select('*')->from($this->table)->order_by($order);\n $query = $this->db->get();\n return $query->result();\n\n }", "public function orderBy($fields, $overwrite = false);", "public function queryAllOrderBy($orderColumn){\n\t\t$sql = 'SELECT * FROM tbl_journal_lines ORDER BY '.$orderColumn;\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function all()\n {\n return $this->orderBy('id', 'DESC')->fetchAll($this->table);\n }", "public function getAllList(array $fieldsOrderBy)\n {\n }", "public function getListePriorite(){\n $sql = 'SELECT t.*\n FROM '.$this->nameTable.' as t\n ORDER BY id DESC';\n\n $requete = $this->dao->query($sql);\n\n return $this->fecthAssoc_data($requete, $this->name);\n }", "public function queryAllOrderBy($orderColumn){\n\t\t$sql = 'SELECT * FROM timesheet ORDER BY '.$orderColumn;\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function orderBy(array $fields, $order = null);", "public function getAll()\n\t{\n\t\t$args = array('order' => 't.id');\n \t$records = $this->record->findAll($args);\n \treturn $this->model->populateModels($records, 'id');\n\t}", "function getData($orderBys = null)\n{\n global $dbh;\n\n $SQL = $this->getListSQL();\n $SQL .= $this->getOrderBySQL($orderBys);\n\n $result = $dbh->getAll($SQL, DB_FETCHMODE_ASSOC);\n dbErrorCheck($result);\n\n return $result;\n}", "public function getAll($orderBy = ['column' => 'id', 'dir' => 'Asc'])\n {\n return $this->model->orderBy($orderBy['column'], $orderBy['dir'])->get();\n }", "public function queryAllOrderBy($orderColumn){\n\t\t$sql = 'SELECT * FROM cst_hit ORDER BY '.$orderColumn;\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function fetchFields();", "public function orderBy(string $field, string $direction): self;", "function records( $table_name, $where, $order_by = '', $output = OBJECT ) {\n global $wpdb;\n\n $where = self::where( $where );\n\n $sql = <<< SQL\nSELECT * FROM `{$table_name}`\n{$where}\nORDER BY {$order_by}\nSQL;\n $result = $wpdb->get_results( $sql, $output );\n\n return $result;\n\n }", "public function all()\n {\n $records = R::findAll( $this->table_name(), \" order by id \");\n\n $object = array_map( function($each_record) {\n return $this->map_reford_to_object( $each_record );\n },\n $records\n );\n\n return array_values( $object );\n }", "public function get_all($value='', $field='', $order_by='', $field_type='%d', $order_direction='ASC',$only_fields=array()) {\r\n\t \tglobal $wpdb;\r\n\t \t\r\n\t \tif ($field=='')\r\n\t \t\t$field = 'id';\r\n\t \t\r\n\t \t// Special cases for ordering that requires innerjoins\r\n\t \t$extra_sql = '';\r\n\t \t// Special case for categories\r\n\t \tif ($order_by=='term_id') {\r\n\t \t\t// \"left outer join\" is used to take in care the case of category ID \"0\"\r\n\t \t\t$extra_sql = \"left outer join `$wpdb->terms` on (`$wpdb->terms`.term_id=`$this->table`.term_id)\";\r\n\t \t\t$order_by = \"`$wpdb->terms`.name\";\r\n\t \t}\r\n\t \telseif ($order_by!='') {\r\n\t \t\t// Set order by ` where is a simple column\r\n\t \t\t$order_by = \"`$order_by`\";\r\n\t \t}\r\n\t \t\t\r\n\t \tif ($order_by!='') $order_by = \" order by $order_by $order_direction\";\r\n\t \t\r\n\t \t// Specify the fields to return\r\n\t \tif (count($only_fields)==0) {\r\n\t \t\t// Add\r\n\t \t\t$fields_to_return = \"`$this->table`.*\";\r\n\t \t}\r\n\t \telse {\r\n\t \t\t// Only specified\r\n\t \t\t$fields_to_return = \"`$this->table`.\" . implode(\",`$this->table`.\",$only_fields);\t \t\t\r\n\t \t}\r\n\t \t\t\r\n\t \tif ($value!=='' && $value!==null)\r\n\t \t{\r\n\t \t\tif ($field_type=='%d') // %d\r\n\t\t \t\t$query = $wpdb->prepare( \"SELECT $fields_to_return from `$this->table` $extra_sql WHERE `$this->table`.`$field` = %d $order_by\", $value );\r\n\t\t \telse // %s\r\n\t\t \t\t$query = $wpdb->prepare( \"SELECT $fields_to_return from `$this->table` $extra_sql WHERE `$this->table`.`$field` = %s $order_by\", $value );\r\n\t \t}\r\n\t \telse \r\n\t \t\t$query = \"SELECT $fields_to_return from `$this->table` $extra_sql $order_by\";\r\n\t \t\r\n\t \t\r\n\t \t$results = $wpdb->get_results($query);\r\n\t\t\t\r\n\t \t// Parse returned fields to strip slashes\r\n\t \t$parsed_results = array();\r\n\t \tforeach ($results as $result) {\r\n\t \t\t$tmp_result = (array) $result;\r\n\t\t \t$parsed_result = WPPostsRateKeys_Validator::parse_array_output($tmp_result);\r\n\t\t \t$parsed_result = (object) $parsed_result;\r\n\t\t \t\r\n\t\t \t$parsed_results[] = $parsed_result;\r\n\t \t}\r\n\t \t// End: Parse returned fields to strip slashes\r\n\t \t\r\n\t \treturn $parsed_results;\r\n\t }", "function getAllRows($select, $tblName, $where = NULL , $and = NULL , $orderFeild = 'created_at' , $ordering = 'DESC')\n{\n global $conn;\n $rowStmt = $conn->prepare(\"SELECT $select FROM $tblName\n $where $and ORDER BY $orderFeild $ordering\");\n $rowStmt->execute();\n $rows = $rowStmt->fetchAll();\n return $rows;\n}", "public function queryAllOrderBy($orderColumn){\r\n\t\t$sql = 'SELECT * FROM tbl_empleado ORDER BY '.$orderColumn;\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\treturn $this->getList($sqlQuery);\r\n\t}", "function getFields($table,$fields=\"\",$condition=\"\",$limit=\"\",$calculateRows=false,$fastHint=false);", "function getList($fieldName='', $searchValue='', $searchStatus='', $orderByField='', $orderByValue='', $offset ='', $limit ='')\r\n\t\t{\r\n\t\t\t$sqlRecord = $this->getTableRecordList($this->table, $fieldName, $searchValue, $searchStatus, $orderByField, $orderByValue, $offset, $limit);\r\n\t\t\treturn $sqlRecord;\r\n\t\t\r\n\t\t}", "public function queryAllOrderBy($orderColumn){\n\t\t$sql = 'SELECT * FROM aluno ORDER BY '.$orderColumn;\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function all()\n {\n return $this->db->query('SELECT * FROM '.$this->table.' ORDER by created_at DESC')->get();\n }", "public function queryAllOrderBy($orderColumn){\n\t\t$sql = 'SELECT * FROM telefonos ORDER BY '.$orderColumn;\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function queryAllOrderBy($orderColumn){\n\t\t$sql = 'SELECT * FROM tbl_task ORDER BY '.$orderColumn;\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "protected function prepareOrderByStatement() {}", "function wisataone_X1_get_all_order() {\n global $wpdb, $wisataone_X1_tblname;\n $wp_track_table = $wpdb->prefix . $wisataone_X1_tblname;\n\n return $wpdb->get_results( \n \"\n SELECT *\n FROM {$wp_track_table}\n \"\n );\n}", "public function getList()\n\t{\n\t\treturn $this->crud->orderby('id DESC')\n\t\t\t\t\t->read(10)\n\t\t;\t\n\t}", "public function getEntries($table, $fields = '*', $limit = 10, $offset = 0);", "private function sql_orderBy()\n {\n // Get table and field\n list( $table, $field ) = explode( '.', $this->curr_tableField );\n\n // Short var\n $arr_order = null;\n $arr_order = $this->conf_view[ 'filter.' ][ $table . '.' ][ $field . '.' ][ 'order.' ];\n\n // Order field\n switch ( true )\n {\n case( $arr_order[ 'field' ] == 'uid' ):\n $orderField = $this->sql_filterFields[ $this->curr_tableField ][ 'uid' ];\n break;\n case( $arr_order[ 'field' ] == 'value' ):\n default:\n $orderField = $this->sql_filterFields[ $this->curr_tableField ][ 'value' ];\n break;\n }\n // Order field\n // Order flag\n switch ( true )\n {\n case( $arr_order[ 'orderFlag' ] == 'DESC' ):\n $orderFlag = 'DESC';\n break;\n case( $arr_order[ 'orderFlag' ] == 'ASC' ):\n default:\n $orderFlag = 'ASC';\n break;\n }\n // Order flag\n // Get ORDER BY statement\n $orderBy = $orderField . ' ' . $orderFlag;\n\n // RETURN ORDER BY statement\n return $orderBy;\n }", "public function getAllSortByDate()\n\t{\n\t\t$table = \"\";\n\t\t$table = $this->getTableName();\n\t\t$db_connection = get_db_connection();\n\t\t$dataArray = array();\n\t\t\n\t\t$query = \"select * from $table order by year_posted, month_posted\";\t\t\n\t\t$result = mysqli_query($db_connection, $query);\n\t\t$dataArray = $this->getData($result, $db_connection);\n\t\tmysqli_close($db_connection);\n\t\t\n\t\treturn $dataArray;\n\t}", "public function getOrderBy($table_name, $table_key_field, $decision) {\n return $this->db->order_by($table_key_field, $decision)->get($table_name)->result();\n }", "function getAllFrom($tableName, $orderBy){\n global $con;\n\n $getAll = $con->prepare(\"Select * From $tableName ORDER BY $orderBy DESC\");\n\n $getAll->execute();\n\n $all = $getAll->fetchAll();\n\n return $all;\n}" ]
[ "0.6830705", "0.6698041", "0.65617657", "0.639717", "0.6387449", "0.6370943", "0.6366565", "0.6355493", "0.635175", "0.63289535", "0.62955856", "0.6290862", "0.62788767", "0.6241239", "0.62095785", "0.61769307", "0.61670166", "0.61424774", "0.612399", "0.61088115", "0.60892653", "0.60892653", "0.6088091", "0.6085826", "0.60640377", "0.60577345", "0.601285", "0.5993983", "0.5992533", "0.5991536", "0.5970969", "0.59657335", "0.5965461", "0.5963874", "0.5960093", "0.5956269", "0.5945933", "0.5942604", "0.5940195", "0.5933842", "0.59268826", "0.5918698", "0.59184754", "0.59032667", "0.59014046", "0.5862657", "0.58555055", "0.5848069", "0.58398706", "0.5830727", "0.58214605", "0.58056015", "0.58018625", "0.5793238", "0.5783882", "0.5774352", "0.57742643", "0.5772741", "0.57706326", "0.57620776", "0.5759087", "0.5758415", "0.5752959", "0.57500184", "0.57476324", "0.5745553", "0.574202", "0.57294333", "0.5729262", "0.5728126", "0.57241744", "0.57226", "0.5716983", "0.57069266", "0.57045805" ]
0.6559512
28
Delete record from table
public function delete($id_soal_siswa);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete()\n {\n $this->db->delete($this->table, $this->data['id'], $this->key);\n }", "public function deleteRecord()\n { \n $sql = \"DELETE FROM Cubans WHERE Id = :Id\";\n $statement = $this->connect->prepare($sql);\n $statement->bindValue(':Id', $this->id);\n $statement->execute();\n }", "public function delete() {\n global $DB;\n $DB->delete_records($this->get_table_name(), array('id' => $this->id));\n }", "public function delete() {\n\t\tif ($this->checkDependencies() == true ) {\n\t\t\t$sql = \"DELETE FROM \".$this->tablename.\" where \".$this->idcol.\" = \".$this->page->ctrl['record'];\n\t\t\t$this->dbc->exec($sql);\n\t\t}\n\t}", "public function delete() {\n\t\ttry {\n\t\t\tif($this->_state == self::STATE_UNCHANGED) {\n\t\t\t\t$sql = 'DELETE FROM ' . self::sanitize($this->_table->getProperty('name')) . ' WHERE ' . self::sanitize($this->_key_primary->name) . ' = ' . self::sanitize($this->_data[$this->_key_primary->name]);\n\t\t\t\t\\Bedrock\\Common\\Logger::info('Deleting record with query: ' . $sql); echo $sql;\n\t\t\t\t$this->_connection->exec($sql);\n\t\t\t}\n\t\t\telseif($this->_state == self::STATE_CHANGED) {\n\t\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('Unsaved changes found, cannot delete record.');\n\t\t\t}\n\t\t\telse {\n\t\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('Record not found in database.');\n\t\t\t}\n\t\t}\n\t\tcatch(\\PDOException $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('A database error was encountered, the record could not be deleted.');\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('The record could not be deleted.');\n\t\t}\n\t}", "function delete()\n\t{\n\t\tSQL::query(\"delete from {$this->_table} where id = {$this->_data['id']}\");\n\t}", "function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n }", "public function delete()\n {\n Db::getInstance()->delete($this->getTableName(), ['id' => $this->getId()]);\n }", "function deleteRecord($table,$where) \t{\n\t\t$query = \"DELETE FROM \".$this->tablePrefix .$table.' WHERE '.$where ;\n $res = $this->execute($query);\n\n\t}", "protected function delete() {\n $this->db->deleteRows($this->table_name, $this->filter);\n storeDbMsg($this->db);\n }", "public function delete()\n\t{\n\t\tDatabase::query(\"\n\t\t\tDELETE FROM\n\t\t\t\t\". $this->tableName .\"\n\t\t\tWHERE\n\t\t\t\tid = '\". $this->id .\"'\n\t\t\");\n\t}", "public function delete() {\n\t\tif (!empty($this->originalData)) {\n\t\t\t$query = $this->connection->query(\"DELETE FROM {$this->table} WHERE \".self::$primaryKey[$this->table].\"='{$this->originalData[self::$primaryKey[$this->table]]}'\");\n\t\t\t$query = $this->connection->query(\"ALTER TABLE $this->table AUTO_INCREMENT = 1\");\n\t\t\t$this->originalData = array();\n\t\t}\t\n\t\telse \n\t\t\tthrow new Exception('You are trying to delete an inexistent row');\n\t}", "function delete() {\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n\t\t\t// Delete het huidige record.\n\n\t\t\t$deleteQuery = \"DELETE FROM \".$this->table.\" WHERE \".$kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\t\t\t$this->lastQuery = $deleteQuery;\n\n $deleteTable = $this->mysqlConnection->prepare($this->lastQuery);\n $deleteTable->execute();\n\n\t\t}", "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 }", "function delete() {\n $this->db->delete(self::table_name, array('id' => $this->id));\n // need to delete from tag maps too\n // tbd\n }", "public function deleteRow($row);", "function delete_record () { //deletes a record\n\t\t\n\t\t//deletes record\n\t\t$pdo = Database::connect();\n\t\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t$sql = \"DELETE FROM customers WHERE id = ?\";\n\t\t$q = $pdo->prepare($sql);\n\t\t$q->execute(array($_GET['id']));\n\t\tDatabase::disconnect();\n\t\theader(\"Location: customer.php\");\n\t\t\t\n\t}", "public function delete(){\n if (isset($this->content[$this->idField])) {\n\n $sql = \"DELETE FROM {$this->table} WHERE {$this->idField} = {$this->content[$this->idField]};\";\n $delet = new \\AR\\BD\\Delete();\n $delet->ExeDelete($this->table, \"WHERE {$this->idField} = {$this->content[$this->idField]}\", \"\");\n \n }\n }", "public function delete()\n\t{\n\t\tif ($this->data['id'])\n\t\t{\n\t\t\treturn $this->db->delete($this->table_name, array('id' => $this->data['id']));\n\t\t}\n\t}", "public function deleteRecord ($id);", "public function delete() {\n $conexion = StorianDB::connectDB();\n $borrado = \"DELETE FROM cuento WHERE id=\\\"\".$this->id.\"\\\"\";\n $conexion->exec($borrado);\n }", "public function deleteData()\n {\n DB::table($this->dbTable)\n ->where($this->where)\n ->delete();\n }", "public function delete() {\n global $db;\n $this->_predelete();\n $result = $db->query(\"DELETE FROM \".$this->table.\" WHERE \".$this->id_field.\"=?\", array($this->{$this->id_field}));\n $this->_postdelete($result);\n return $result;\n }", "public function delete(){\r\n\t\t$this->db->delete();\r\n\t}", "public function deleteRecord($id){\n\t}", "public function deleteRecord($table ,$where = false){\n\t\tif($where){\n\t\t\t$where = $this->makeWhere($where);\n\t\t}\n\t\t$query = \"DELETE FROM $table \".$where;\n\t\t$this->query($query);\n\t}", "public function delete()\n {\n $class = strtolower(get_called_class());\n $table = self::$_table_name != null ? self::$_table_name : $class . 's';\n\n $pdo = PDOS::getInstance();\n\n $whereClause = '';\n foreach (static::$_primary_keys as $pk)\n $whereClause .= $pk . ' = :' . $pk . ' AND ';\n $whereClause = substr($whereClause, 0, -4);\n $sql = 'DELETE FROM ' . $table . ' WHERE ' . $whereClause;\n $query = $pdo->prepare($sql);\n $attributes = $this->getAttributes(new \\ReflectionClass($this));\n foreach ($attributes as $k => $v)\n {\n if (in_array($k, static::$_primary_keys))\n $query->bindValue(':' . $k, $v);\n }\n $query->execute();\n }", "public function delete($entity){ \n //TODO: Implement remove record.\n }", "public function delete()\n {\n self::deleteById( $this->db, $this->id, $this->prefix );\n\n if( $this->inTransaction )\n {\n //$this->db->commit();\n $this->inTransaction = false;\n }\n }", "public function delete() {\n\t\t$dbh = App::getDatabase()->connect();\n\n\t\t$query = \"DELETE FROM \".$this->getTableName();\n\n\t\t$fl = true;\n\t\tforeach($this as $column => $val) {\n\t\t\tif(in_array($column, $this->getPrimaries())) {\n\t\t\t\t$query .= \"\\n\".(($fl) ? \"WHERE\" : \"AND\").\" \".$column.\" = '\".$val.\"'\";\n\t\t\t\t$fl = false;\n\t\t\t}\n\t\t}\n\n\t\t$res = $dbh->exec($query);\n\t\t$dbh = null;\n\t\treturn $res;\n\t}", "public function delete_record($table,$id)\r\n {\r\n // echo $table.\",\".$id;\r\n\r\n $sql = \"DELETE FROM \".$table.\" WHERE id='\".$id.\"'\";\r\n $query = mysqli_query($this->con,$sql);\r\n if($query)\r\n {\r\n return true;\r\n }\r\n }", "public function delete($table);", "abstract public function deleteRecord($tableName, $where);", "public function delete (){\n\n $table = new simple_table_ops();\n $table->set_id_column('timetable_id');\n $table->set_table_name('timetables');\n $table->delete();\n\n header(\"Location: http://\".WEBSITE_URL.\"/index.php?controller=timetable&action=show&submit=yes&timetable_period_id={$_GET['timetable_period_id']}\");\n }", "public final function delete() {\n\t\t$sql = \"\n\tDELETE FROM\n\t\t\" . $this->table . \"\n\tWHERE\n\t\t\" . $this->primaryField . \" = ?\n\t;\";\n\n\t\t$db = new MySQL();\n\t\t$statement = $db->prepare($sql);\n\t\t$status = $statement->execute(array($this->{$this->primaryField}));\n\t\t$statement = NULL;\n\n\t\treturn $status;\n\t}", "public function delete()\n {\n $stmt = $this->_db->prepare(\"DELETE FROM score;\");\n $stmt->execute();\n }", "function delete() {\n\t\t$sql = \"DELETE FROM cost_detail\n\t\t\t\tWHERE cd_fr_id=?, cd_seq=?\";\n\t\t$this->ffm->query($sql, array($this->cd_fr_id, $this->cd_seq));\n\t}", "public function delete(){\n \t\ttry{\n \t\t\t$db = DB::get();\n \t\t\t$sql = \"UPDATE t_\" . self::$Table . \" \n \t\t\t\t\tSET \" . self::$Table . \"_supprime='1' \n \t\t\t\t\tWHERE \" . self::$Table . \"_id = '\".$this->Id.\"' \";\n \t\t\n \t\t\t$result = $db->query($sql);\n \t\t}\n \t\tcatch(Exception $e){\n \t\t\tvar_dump($e->getMessage());\n \t\t}\n }", "public function delete(){\r\n\t\t// goi den phuong thuc delete cua tableMask voi id cua man ghi hien hanh\r\n\t\t$mask = $this->mask();\r\n\t\treturn $mask->delete(array($mask->idField=>$this->id));\r\n\t\t// $query = \"DELETE FROM $this->tableName WHERE id='$this->id'\";\r\n\t\t// $conn = self::getConnect()->prepare($query);\r\n\t}", "function deleteRecord($id)\n\t{\n\t\t$this->form->deleteRecord($this->tablename, $id);\n\t}", "function delete_data($table, $id){\n\n $query = $this->db->delete($table, array('id' => $id));\n\n }", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function destroy($id)\n {\n //delete specific record\n }", "public function delete() {\n\t\t\t$query = \"DELETE FROM $this->table_name WHERE id=?\";\n\n\t\t\t// prepare biatch\n\t\t\t$stmt = $this->conn->prepare($query);\n\n\t\t\t// bind id biatch\n\t\t\t$stmt->bindParam(1, $this->id);\n\n\t\t\t// execute query\n\t\t\tif ($stmt->execute()) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "function delete($id){\n\t\t$this->db->where('id', $id);\n\t\t$this->db->delete($this->table);\n }", "function row_delete()\n\t{\n\t $this->db->where('id', $id);\n\t $this->db->delete('testimonials'); \n\t}", "public function delete($table, $id)\n {\n $del = \"DELETE FROM $table WHERE id=:id\";\n $stmt = $this->connect(\"student\")->prepare($del);\n $stmt->bindValue(\":id\", $id);\n $exec = $stmt->execute();\n if ($exec) {\n header(\"location:record.php\");\n }\n }", "function doRealDelete()\n {\n $this->assignSingle();\n /* Delete the record */\n DatabaseBean::dbDeleteById();\n }", "function deleteRecord($table_name,$uid,$conn){\n\t\t$sql = \"DELETE FROM $table_name WHERE uid=$uid\";\n\n\t\tif ($conn->query($sql) === TRUE) {\n\t\t echo \"Record deleted successfully\";\n\t\t} else {\n\t\t echo \"Error deleting record: \" . $conn->error;\n\t\t}\n\t}", "public function destroy() {\n\t\t$sql = 'DELETE FROM ' . static::$table . ' WHERE id = ' . $this->get('id') . ';';\n\t\t$query = DBH()->prepare($sql);\n\t\t$query->execute();\n\t}", "public function delete()\n{//delete\n $sql = \"DELETE FROM pefs_database.pef_assessor WHERE ase_id = ?\";\n $this->db->query($sql,array($this->ase_id)); \n}", "public function delete(){\n\t\tglobal $db;\n\t\t$response = array('success' => false);\n\t\t$response['success']=$db->delete($this->table, \"id = $this->id\");\n\t return $response;\n\t}", "public function delete_row($id) { \n $database = new Database();\t\n $sql = NULL;\n $sql .= \"DELETE FROM \" . TABLE_NAME . \" WHERE \" . PRIMARY_KEY . \" = \" . $id; \t\t\n $database->query($sql); \t \n $database->execute();\n $this->move_along(); // move to database class? \n }", "public function delete()\n {\n $database = cbSQLConnect::adminConnect('object');\n if (isset($database))\n {\n return ($database->SQLDelete(self::$table_name, 'id', $this->id));\n }\n }", "public function DELETE() {\n #\n }", "function DeleteRecord($tabel_name='',$where='')\n {\n $param = ['is_delete'=>1];\n $this->db\n ->where($where)\n ->update($tabel_name,$param);\n }", "public function delete(){\n\n $query = 'DELETE FROM ' . $this->table . ' WHERE id=:id';\n $stmt = $this->conn->prepare($query);\n $this->id = htmlspecialchars(strip_tags($this->id));\n $stmt->bindParam(':id', $this->id);\n if($stmt->execute()){\n return true;\n }\n else{\n printf(\"Error: %s.\\n\", $stmt->error);\n return false;\n }\n }", "public function delete() {\r\n\t\t$this->getMapper()->delete($this);\r\n\t}", "public function remove()\n {\n database()->run('DELETE FROM ' . $this->table . ' WHERE ' . $this->primaryKey . ' = ?', [ $this->{$this->primaryKey} ]);\n $this->__destruct();\n }", "public function delete_record($id){\n\t\t$this->db->where('training_id', $id);\n\t\t$this->db->delete('training');\n\t\t\n\t}", "public function deleteRow(Request $request)\n {\n $result=MyRow::where('id',$request->id)->delete();\n if ($result) echo 'Data Deleted';\n }", "public function deleteRecord()\n\t{\n\t\tif($this->user->hasRight($this->getHandler()->getDeleteRight()))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$record = $this->getHandler()->getRecord();\n\t\t\t\t$record->import($this->getRequest());\n\n\t\t\t\t// check owner\n\t\t\t\tif(!$this->isOwner($record))\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception('You are not the owner of the record');\n\t\t\t\t}\n\n\t\t\t\t// check captcha\n\t\t\t\t$this->handleCaptcha($record);\n\n\t\t\t\t// delete\n\t\t\t\t$this->getHandler()->delete($record);\n\n\n\t\t\t\t$msg = new Message('You have successful delete a ' . $record->getName(), true);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t\tcatch(\\Exception $e)\n\t\t\t{\n\t\t\t\t$msg = new Message($e->getMessage(), false);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = new Message('Access not allowed', false);\n\n\t\t\t$this->setResponse($msg, null, $this->user->isAnonymous() ? 401 : 403);\n\t\t}\n\t}", "function delete()\r\n\t{\r\n\t\t// Check for request forgeries\r\n\t\tJRequest::checkToken() or die( 'Invalid Token' );\r\n\t\tglobal $mainframe;\r\n\t\t$model\t= &$this->getModel( 'table' );\r\n\t\t$ids = JRequest::getVar('ids', array(), 'request', 'array');\r\n\t\t$model->deleteRows( $ids );\r\n\t\tif ( JRequest::getVar('format') == 'raw') {\r\n\t\t\tJRequest::setVar( 'view', 'table' );\r\n\t\t\t$this->display();\r\n\t\t} else {\r\n\t\t\t//@TODO: test this\r\n\t\t\t$ref = JRequest::getVar( 'fabrik_referrer', \"index.php\", 'post' );\r\n\t\t\t$mainframe->redirect( $ref, count($ids) . \" \" . JText::_( 'RECORDS DELETED' ) );\r\n\t\t}\r\n\t}", "public function delete () {\n $this->db->delete('emprestimos', array('id_emprestimo' => $this->id_emprestimo));\n }", "public function delete() {}", "public function delete() {}", "public function delete()\n\t{\n\t \tif (!Validate::isTableOrIdentifier($this->identifier) OR !Validate::isTableOrIdentifier($this->table))\n\t \t\tdie(Tools::displayError());\n\n\t\t$this->clearCache();\n\n\t\t/* Database deletion */\n\t\t$result = Db::getInstance()->Execute('DELETE FROM `'.pSQL($this->table).'` WHERE `'.pSQL($this->identifier).'` = '.(int)($this->id));\n\t\tif (!$result)\n\t\t\treturn false;\n\t\t\n\t\treturn $result;\n\t}", "public function delete() {}", "public function delete() {}", "function delete( $id )\n\t{\n\t\t// where clause\n\t\t$this->db->where( $this->primary_key, $id );\n\n\t\t// delete the record\n\t\treturn $this->db->delete( $this->table_name );\n\t\t// print_r($this->db->last_query());die;\n \t}", "public function delete()\n {\n $this->execute(\n $this->syntax->deleteSyntax(get_object_vars($this))\n );\n }", "public function delete($id){\n\t\t$this->db->delete($this->_table_name, array('id'=>$id));\n }", "public function delete() {\n // Create query\n $query = \"DELETE FROM \" . $this->table .\n \" WHERE MID = :mid AND Spot = :spot \";\n \n // Prepare the statement\n $stmt = $this->conn->prepare($query);\n\n // Clean the query\n $this->attr[\"mid\"] = htmlspecialchars(strip_tags($this->attr[\"mid\"]));\n $this->attr[\"spot\"] = htmlspecialchars(strip_tags($this->attr[\"spot\"]));\n\n // Bind the data\n $stmt->bindValue(\":mid\", $this->attr[\"mid\"]);\n $stmt->bindValue(\":spot\", $this->attr[\"spot\"]);\n \n // Execute the prepared statement and check for errors in running it\n return $this->runPrepStmtChkErr($stmt);\n }", "public function delete_record()\n {\n $id = $this->input->get('tpid');\n\n $result = $this->PumpModel->delete_data(array('tpid'=>$id));\n // print_r($result);die;\n redirect(base_url(). 'Pump');\n }", "public function delete( ) {\n\t $query = \"DELETE FROM stat WHERE id=?\";\n\t return $this->db->execute( $query, array($this->id) ); \t\n\t }", "function delete($id) {\r\n $this->db->where('id', $id);\r\n $this->db->delete($this->tbl);\r\n }", "public function deleteMatch(){\n\t\t$this->getDbTable()->delete(\"\");\n\t}", "function delete($table, $field, $key)\n {\n\t\t$this->db->where($field, $key);\n $this->db->delete($table);\n }", "public function delete()\r\n {\r\n $db = Database::getDatabase();\r\n $db->consulta(\"DELETE FROM puesto WHERE idPue = {$this->idPue};\");\r\n }", "public function delete($id){\n\t\t$sql = \"DELETE FROM {$this->table} WHERE {$this->primaryKey} = $id\";\n\t\t$this->db->query($sql);\n\t}", "public function delete(int $id): void{\r\n \r\n $maRequete = $this->pdo->prepare(\"DELETE FROM {$this->table} WHERE id =:id\");\r\n\r\n $maRequete->execute(['id' => $id]);\r\n\r\n\r\n}", "private function delete(){\n\t\t$id = $this->objAccessCrud->getId();\n\t\tif (empty ( $id )) return;\n\t\t// Check if there are permission to execute delete command.\n\t\t$result = $this->clsAccessPermission->toDelete();\n\t\tif(!$result){\n\t\t\t$this->msg->setWarn(\"You don't have permission to delete!\");\n\t\t\treturn;\n\t\t}\n\t\tif(!$this->objAccessCrud->delete($id)){\n\t\t\t$this->msg->setError (\"There was an issue to delete, because this register has some relation with another one!\");\n\t\t\treturn;\n\t\t}\n\t\t// Cleaner all class values.\n\t\t$this->objAccessCrud->setAccessCrud(null);\n\t\t// Cleaner session primary key.\n\t\t$_SESSION['PK']['ACCESSCRUD'] = null;\n\n\t\t$this->msg->setSuccess (\"Delete the record with success!\");\n\t\treturn;\n\t}", "public function delete() {\n\t\t$this->deleted = true;\n\t}", "function delete() {\n\t\t$sql = \"DELETE FROM \".$this->hr_db.\".hr_amphur\n\t\t\t\tWHERE amph_id=?\";\n\t\t$this->hr->query($sql, array($this->amph_id));\n\t}", "public static function delete($id){\n $conexion = new Conexion();\n $sql = $conexion->prepare('DELETE FROM'. self::TABLA .' WHERE id = :id');\n $sql->bindValue(':id', $id);\n $sql->execute();\n return $sql; \n}", "public function delete($table, $id) {\n $sth = $this->prepare(\"DELETE FROM $table WHERE id = $id\");\n $sth->execute();\n }", "function delete() {\n\t\n\t\t$this->getMapper()->delete($this);\n\t\t\n\t}" ]
[ "0.80528164", "0.8038927", "0.8011362", "0.8006034", "0.7851699", "0.784622", "0.7725801", "0.76525426", "0.7643797", "0.7640737", "0.75768113", "0.75688297", "0.75386626", "0.74974877", "0.74665475", "0.74657536", "0.7432057", "0.74077684", "0.7391852", "0.7388047", "0.7366247", "0.7352956", "0.72969276", "0.72947127", "0.72891563", "0.72846055", "0.726875", "0.7259515", "0.7247061", "0.7246635", "0.7236414", "0.7177174", "0.717235", "0.716997", "0.71628636", "0.7149032", "0.71226686", "0.70877016", "0.7035956", "0.7034221", "0.7028812", "0.7025993", "0.7025993", "0.7025993", "0.7025993", "0.7025993", "0.7025993", "0.7025993", "0.7025993", "0.7025993", "0.7025993", "0.7025993", "0.7025993", "0.7025993", "0.7025993", "0.7025993", "0.70218086", "0.7021404", "0.70170605", "0.7004079", "0.69966805", "0.6993408", "0.6976034", "0.69713753", "0.6962677", "0.6959918", "0.6958736", "0.6955724", "0.69525385", "0.69519144", "0.6949007", "0.6948673", "0.6948629", "0.69440335", "0.6942566", "0.69255763", "0.69250077", "0.6924954", "0.6912536", "0.6912536", "0.6912375", "0.69120795", "0.69101125", "0.6906249", "0.6904009", "0.69035304", "0.6903232", "0.68983066", "0.68970907", "0.6896559", "0.6896483", "0.6891029", "0.6885842", "0.68847513", "0.68845004", "0.68833166", "0.6874669", "0.68737686", "0.68734086", "0.687147", "0.68659985" ]
0.0
-1
Insert record to table
public function insert($cbtSoalSiswa);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function insertRecord($tableName, $record);", "public function insert(Table $table, $row);", "protected function _insert()\n {\n \t$metadata = $this->_table->info(Zend_Db_Table_Abstract::METADATA);\n \t\n \tif(isset($metadata['created_at']))\n\t\t\t$this->_data['created_at'] = new Zend_Date ();\n \tif(isset($metadata['updated_at']))\n\t\t\t$this->_data['updated_at'] = new Zend_Date ();\n }", "public function insertRow($row);", "public function recInsert($record) {\n $conn = Query::connect();\n $col = $conn->SelectLimit(\"select*from \".static::getTable(),1);\n $sql = $conn->GetInsertSQL($col,$record);\n $rs = $conn->Execute($sql);\n return $conn->ErrorNo();\n }", "public function insertRecord()\n\t{\n\t\tif($this->user->hasRight($this->getHandler()->getAddRight()))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$record = $this->getHandler()->getRecord();\n\t\t\t\t$record->import($this->getRequest());\n\n\t\t\t\t// check captcha\n\t\t\t\t$this->handleCaptcha($record);\n\n\t\t\t\t// insert\n\t\t\t\t$this->getHandler()->create($record);\n\n\n\t\t\t\t$msg = new Message('You have successful create a ' . $record->getName(), true);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t\tcatch(\\Exception $e)\n\t\t\t{\n\t\t\t\t$msg = new Message($e->getMessage(), false);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = new Message('Access not allowed', false);\n\n\t\t\t$this->setResponse($msg, null, $this->user->isAnonymous() ? 401 : 403);\n\t\t}\n\t}", "protected function insert()\n\t{\n\t\t$query = $this->connection->prepare\n\t\t(\"\n\t\t\tinsert into\n\t\t\t\tBooth (BoothNum)\n\t\t\t\tvalues (?)\n\t\t\");\n\n\t\t$query->execute(array_values($this->fields));\n\n\t}", "function insert_record($data){\n\t$this->db->insert('tblname', $data);\n\t}", "public function insert($tableName, $data);", "public function insert()\n {\n if(empty($this->attributes)){\n return;\n }\n if ($this->isAutoInc) {\n $columlList = \" (\";\n $valuelList = \" (\";\n foreach ($this->attributes as $column => $value) {\n $columlList .= $column . \", \";\n $valuelList .= \":\".$column . \", \";\n }\n $columlList = str_last_replace(\", \", \")\", $columlList);\n $valuelList = str_last_replace(\", \", \")\", $valuelList);\n $sqlQuery = \"INSERT INTO \" . $this->table . $columlList . \" VALUES\" . $valuelList;\n\n Db::instance()->execute($sqlQuery,$this->attributes);\n #println($sqlQuery, \"blue\");\n }\n }", "public function insert(){\r\n\t\tif (!$this->new){\r\n\t\t\tMessages::msg(\"Cannot insert {$this->getFullTableName()} record: already exists.\",Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t$this->beforeCommit();\r\n\t\t\r\n\t\t$vals = array();\r\n\t\t$error = false;\r\n\t\tforeach ($this->values as $name=>$value){\r\n\t\t\tif ($value->isErroneous()){\r\n\t\t\t\tFramework::reportErrorField($name);\r\n\t\t\t\t$error = true;\r\n\t\t\t}\r\n\t\t\t$vals[\"`$name`\"] = $value->getSQLValue();\r\n\t\t}\r\n\t\tif ($error){\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t$sql = 'INSERT INTO '.$this->getFullTableName().' ('.implode(', ',array_keys($vals)).') VALUES ('.implode(', ',$vals).')';\r\n\t\tif (!SQL::query($sql)->success()){\r\n\t\t\tMessages::msg('Failed to insert record into '.$this->getFullTableName().'.',Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t// Get this here, because getPrimaryKey can call other SQL queries and thus override this value\r\n\t\t$auto_id = SQL::getInsertId();\r\n\t\t\r\n\t\t$table = $this->getTable();\r\n\t\t// Load the AUTO_INCREMENT value, if any, before marking record as not new (at which point primary fields cannot be changed)\r\n\t\tforeach ($table->getPrimaryKey()->getColumns() as $name){\r\n\t\t\tif ($table->getColumn($name)->isAutoIncrement()){\r\n\t\t\t\t$this->$name = $auto_id;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->new = false;\r\n\t\t$this->hasChanged = false;\r\n\t\tforeach ($this->values as $value){\r\n\t\t\t$value->setHasChanged(false);\r\n\t\t}\r\n\t\t\r\n\t\t$this->afterCommit();\r\n\t\t\t\r\n\t\treturn self::RES_SUCCESS;\r\n\t}", "public function insert($data);", "public function insertRecord ($sqlString);", "protected function insert()\n\t{\n\t\t$this->autofill();\n\n\t\tparent::insert();\n\n\t}", "public function insert() {\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\r\n\t\t\t$ks_db->beginTransaction ();\r\n\t\t\t\r\n\t\t\t$arrBindings = array ();\r\n\t\t\t$insertCols = '';\r\n\t\t\t$insertVals = '';\r\n\t\t\t\r\n\t\t\tif (isset ( $this->userid )) {\r\n\t\t\t\t$insertCols .= \"lp_userid, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->userid;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->random )) {\r\n\t\t\t\t$insertCols .= \"lp_random, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->random;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->deadline )) {\r\n\t\t\t\t$insertCols .= \"lp_deadline, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->deadline;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//remove trailing commas\r\n\t\t\t$insertCols = preg_replace(\"/, $/\", \"\", $insertCols);\r\n\t\t\t$insertVals = preg_replace(\"/, $/\", \"\", $insertVals);\r\n\t\t\t\r\n\t\t\t$sql = \"INSERT INTO $this->sqlTable ($insertCols)\";\r\n\t\t\t$sql .= \" VALUES ($insertVals)\";\r\n\t\t\t\r\n\t\t\t$ks_db->query ( $sql, $arrBindings );\r\n\r\n\t\t\t//set the id property\r\n\t\t\t$this->id = $ks_db->lastInsertId();\r\n\t\t\t\r\n\t\t\t$ks_db->commit ();\r\n\t\t\t\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_db->rollBack ();\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "public function insert() {\r\n\t\t$this->getMapper()->insert($this);\r\n\t}", "protected function insertRow()\n { \n $assignedValues = $this->getAssignedValues();\n\n $columns = implode(', ', $assignedValues['columns']);\n $values = '\\''.implode('\\', \\'', $assignedValues['values']).'\\'';\n\n $tableName = $this->getTableName($this->className);\n\n $connection = Connection::connect();\n\n $insert = $connection->prepare('insert into '.$tableName.'('.$columns.') values ('.$values.')');\n var_dump($insert);\n if ($insert->execute()) { \n return 'Row inserted successfully'; \n } else { \n var_dump($insert->errorInfo()); \n } \n }", "public function insert()\n {\n $this->id = insert($this);\n }", "private function insert()\n {\n $this->query = $this->pdo->prepare(\n 'INSERT INTO ' . $this->table . ' (' .\n implode(', ', array_keys($this->data)) .\n ' ) VALUES (:' .\n implode(', :', array_keys($this->data)) .\n ')'\n );\n }", "function insert() {\n\t\t$sql = \"INSERT INTO cost_detail (cd_fr_id, cd_seq, cd_start_time, cd_end_time, cd_hour, cd_minute, cd_cost, cd_update, cd_user_update)\n\t\t\t\tVALUES(?, ?, ?, ?, ?, ?, ?, ?, ?)\";\n\t\t$this->ffm->query($sql, array($this->cd_fr_id, $this->cd_seq, $this->cd_start_time, $this->cd_end_time, $this->cd_hour, $this->cd_minute, $this->cd_cost, $this->cd_update, $this->cd_user_update));\n\t\t$this->last_insert_id = $this->ffm->insert_id();\n\t}", "protected function insert() {\n $dbh = $this->getDbh();\n $table = $this->tableName;\n $data = [];\n\n foreach ($this->fillable as $key => $value) {\n $data[$key] = $this->$key;\n }\n\n $query = 'INSERT INTO `' . $table . '` VALUES (NULL,';\n $first = true;\n foreach ($data AS $k => $value) {\n if (!$first)\n $query .= ', ';\n else\n $first = false;\n $query .= ':'.$k;\n }\n $query .= ')';\n\n $msc = microtime(true);\n\n $sth = $dbh->prepare($query);\n $sth->execute($data);\n\n $msc = microtime(true) - $msc;\n $line = \"insert() => \" . $query . \" with \" . implode(\"', '\", $data);\n $this->writeRequestLog($line, $msc);\n\n return true;\n }", "abstract public function insert();", "abstract public function insert(string $table, array $row, array $options = []);", "public abstract function insert();", "public function insert($table, array $data);", "public function insert() {\n $this->observer->idchangemoney = $this->connection->insert(\"ren_change_money\", array(\n \"`change`\" => $this->observer->change,\n \"`year`\" => $this->observer->year,\n \"`idmoney`\" => $this->observer->money->idmoney\n ), $this->user->iduser);\n }", "protected function saveInsert()\n {\n }", "public function insert($table);", "public function insert() {\n \n }", "public function createRecord()\n {\n $sql = sprintf(\n \"INSERT INTO %s (%s) values (%s)\", \"Cubans\",\n implode(\", \", array_keys($this->arrayKeysValues())),\n \":\" . implode(\", :\", array_keys($this->arrayKeysValues()))\n );\n $statement = $this->connect->prepare($sql);\n\t\t$statement->execute($this->arrayKeysValues());\n }", "public static function insertRecord(string $table, array $data)\n {\n try {\n return Capsule::table($table)->insert($data);\n } catch (Exception $ex) {\n logActivity(\"Can not insert data into {$table}, error: {$ex->getMessage()}\");\n }\n }", "public function insert($tblUpdate);", "protected abstract function insertRow($tableName, $data);", "function insert() {\n\t\t$sql = \"INSERT INTO \".$this->hr_db.\".hr_amphur (amph_name, amph_name_en, amph_pv_id, amph_active)\n\t\t\t\tVALUES(?, ?, ?, ?)\";\n\t\t$this->hr->query($sql, array( $this->amph_name, $this->amph_name_en, $this->amph_pv_id, $this->amph_active));\n\t\t$this->last_insert_id = $this->hr->insert_id();\n\t}", "public function insert($connection, $table, $rows);", "protected function _insert()\n {\n \n }", "protected function _insert()\n {\n \n }", "public function insert_student($row)\n\t\t{\n\t\t\t$this->conn->insert($this->create_student($row));\n\t\t}", "function insert($data)\n {\n $this->db->insert($this->table, $data);\n }", "function insert() {\n\t\t$sql = \"INSERT INTO lessons\n\t\t\t\tVALUES (?, ?, ?, ?, ?)\";\n\t\t\n\t\t$this->db->query($sql, array($this->lessons_id, $this->name, $this->date, $this->active, $this->rank));\n\t\t$this->last_insert_id = $this->db->insert_id();\t\t\n\t\t\n\t}", "function insert() {\n\t \t \n\t \t$sql = \"INSERT INTO evs_database.evs_identification (idf_identification_detail_en, idf_identification_detail_th, idf_pos_id, idf_ctg_id)\n\t \t\t\tVALUES(?, ?, ?, ?)\";\n\t\t \n\t \t$this->db->query($sql, array($this->idf_identification_detail_en, $this->idf_identification_detail_th, $this->idf_pos_id, $this->idf_ctg_id));\n\t\n\t }", "public abstract function Insert();", "public function insert(\n SugarBean $bean\n )\n {\n $sql = $this->getHelper()->insertSQL($bean);\n $this->tableName = $bean->getTableName();\n $msg = \"Error inserting into table: \".$this->tableName;\n $this->query($sql,true,$msg);\n }", "protected function _insert()\n\t{\n\t}", "protected function createNew() {\n $this->db->insert($this->tableName, $this->mapToDatabase());\n $this->id = $this->db->insert_id();\n }", "protected function _insert()\n\t{\n\t\t$this->date_added = \\Core\\Date::getInstance(null,\\Core\\Date::SQL_FULL, true)->toString();\n\t\t$this->date_modified = $this->date_added;\n\t\t$this->last_online = $this->date_modified;\n\t\t$this->activity_open = $this->date_modified;\n\t\t$this->language_id = \\Core\\Base\\Action::getModule('Language')->getLanguageId();\n\t}", "public final function insert()\n {\n // Run beforeCreate event methods and stop when one of them return bool false\n if ($this->runBefore('create') === false)\n return false;\n\n // Create tablename\n $tbl = '{db_prefix}' . $this->tbl;\n\n // Prepare query and content arrays\n $fields = array();\n $values = array();\n $keys = array();\n\n // Build insert fields\n foreach ( $this->data as $fld => $val )\n {\n // Skip datafields not in definition\n if (!$this->isField($fld))\n continue;\n\n // Regardless of all further actions, check and cleanup the value\n $val = $this->checkFieldvalue($fld, $val);\n\n // Put fieldname and the fieldtype to the fields array\n $fields[$fld] = $this->getFieldtype($fld);\n\n // Object or array values are stored serialized to db\n $values[] = is_array($val) || is_object($val) ? serialize($val) : $val;\n }\n\n // Add name of primary key field\n $keys[0] = $this->pk;\n\n // Run query and store insert id as pk value\n $this->data->{$this->pk} = $this->db->insert('insert', $tbl, $fields, $values, $keys);\n\n return $this->data->{$this->pk};\n }", "function insert_record () {\n // validate input\n $valid = true;\n if (empty($this->name)) {\n $this->nameError = 'Please enter Name';\n $valid = false;\n }\n\n if (empty($this->email)) {\n $this->emailError = 'Please enter Email Address';\n $valid = false;\n } \n\n if (empty($this->mobile)) {\n $this->mobileError = 'Please enter Mobile Number';\n $valid = false;\n }\n\n // insert data\n if ($valid) {\n $pdo = Database::connect();\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $sql = \"INSERT INTO customers (name,email,mobile) values(?, ?, ?)\";\n $q = $pdo->prepare($sql);\n $q->execute(array($this->name,$this->email,$this->mobile));\n Database::disconnect();\n header(\"Location: customer.php\");\n }\n else {\n $this->create_record();\n }\n }", "public function insert()\n {\n \n }", "public function insert($data)\r\n {\r\n \r\n }", "public function insert_entry()\r\n\t{\r\n\t\t$this->db->insert(\"email_workflow\", $this);\r\n\t}", "public function insert()\n {\n }", "public function insert()\n {\n }", "public static function insert()\n {\n }", "function insert($data)\n {\n $this->db->insert($this->table, $data);\n }", "public function insert(){\n\n global $db;\n\n /** Insert sql query */\n $sql = \"INSERT INTO tbl_calculator (num1, num2, oper, answer)\n VALUES (\" . $this->num1 .\", \" . $this->num2 . \", '\" .$this->oper. \"', \" .$this->answer. \" )\";\n\n /** insert result maintain in log file */ \n error_log($sql);\n\n if ($db->query($sql) === TRUE) {\n error_log(\"New record created successfully\");\n } else {\n error_log(\"Error: \" . $sql . \"<br>\" . $db->error);\n }\n return;\n }", "public function insert($table, array $fields);", "public function insert_into_table(){\n // VALUES ('$this->item_id', '$this->user_id', '$this->project_id', '$this->user2_id', '$this->post_id', '$this->type', '$this->activity', '$this->date_time')\";\n $query = \"INSERT INTO $this->table_name (item_id, user_id, project_id, user2_id, post_id, post_type, date_time) \n VALUES ('$this->item_id', '$this->user_id', '$this->project_id', '$this->user2_id', '$this->post_id', '$this->type', '$this->date_time')\";\n $result = mysql_query($query);\n\n $err = mysql_error();\n if($err){\n $file = 'errors.txt';\n file_put_contents($file, $err, FILE_APPEND | LOCK_EX);\n }\n }", "public function insert(...$field_values);", "public function insertRecords($table, $data) \n {\n \t// setup some variables for fields and values\n \t$fields = \"\";\n $values = \"\";\n\t\t\n // sets attributes and values\n foreach ($data as $f => $v) {\t\t\t\n $fields .= \"`$f`,\";\n $values .= ( is_numeric( $v ) && ( intval( $v ) == $v ) ) ? $v.\",\" : \"'$v',\";\t\t\n }\n\t\t\n // remove last ',' \n \t$setfields = substr($fields, 0, -1);\n \t$setvalues = substr($values, 0, -1);\n \t\n $insert = \"INSERT INTO $table ({$setfields}) VALUES({$setvalues})\";\n $this->executeQuery( $insert );\n return true;\n }", "public function _insert($data)\n {\n $this->insert($data);\n }", "public function insert() {\n\t\t\t\n\t\t\t$insert_array = $this->buildInsertFields();\n\t\t\t$query = \"INSERT INTO \" . $this->table_name . \" (\" . $insert_array['insert_statement'] . \") VALUES (\" . \n\t\t\t\t\t\t\t\t\t$insert_array['values_statement'] . \")\";\n\t\t\treturn $this->query($query, $insert_array['bind_params']);\n\n\t\t}", "public function insert($data)\n {\n if (isset($this->columns[\"created\"])) {\n $data[\"created\"] = date(\"Y-m-d H:i:s\");\n }\n return $this->schema->insert($this->name, $data);\n }", "public function insert(stubObject $entity);", "public function insert($medAccount);", "public function insert()\n {\n $sql = new Sql();\n $result = $sql->select(\"CALL sp_usuario_insert(:LOGIN, :PASSWORD)\", array(\n \":LOGIN\"=>$this->getDeslogin(),\n \":PASSWORD\"=>$this->getDessenha()\n ));\n\n if(count($result) > 0){\n $row = $result[0];\n $this->setIdusuario($row['idusuario']);\n $this->setDeslogin($row['deslogin']);\n $this->setDessenha($row['dessenha']);\n $this->setDataCadastro(new DateTime($row['dataCadastro']));\n }\n }", "function insert($conn,$table,$data)\n {\n }", "public function insert()\n {\n # code...\n }", "function dbase_add_record($dbase_identifier, $record)\n{\n}", "public function insert()\n\t{\n\t\t$crud = $this->crud->data([\n\t\t\t'first_name' => $_POST['first_name'],\n\t\t\t'last_name' => $_POST['last_name'],\n\t\t]);\n\t\t$crud->insert();\n\t\t$this->redirect('crud');\n\t}", "public function insert(){\n\t\t$sql = new Sql();\n\t\t$results = $sql->select(\"CALL sp_insert_usuario(:LOGIN, :PASS)\", array(\n\t\t\t':LOGIN'=>$this->getDeslogin(),\n\t\t\t':PASS'=>$this->getDessenha()\n\t\t));\n\n\t\tif (isset($results[0])) {\n\t\t\t\n\t\t\t$this->setData($results[0]);\n\n\t\t}\n\t}", "function insert() {\n\t\t$sql = \"INSERT INTO \".$this->hr_db.\".hr_person_detail (psd_ps_id, psd_dp_id, psd_tax_no, psd_id_card_no, psd_passport_no, psd_picture, psd_blood_id, psd_reli_id, psd_nation_id, psd_race_id, psd_psst_id, psd_birthdate, psd_birth_pv_id, psd_gd_id, psd_account_no, psd_ba_id, psd_facebook, psd_twitter, psd_website, psd_email, psd_cellphone, psd_phone, psd_ex_phone, psd_work_phone, psd_lodge_id, psd_lodge_no, psd_lodge_phone, psd_addcur_no, psd_addcur_pv_id, psd_addcur_amph_id, psd_addcur_dist_id, psd_addcur_zipcode, psd_addhome_no, psd_addhome_pv_id, psd_addhome_amph_id, psd_addhome_dist_id, psd_addhome_zipcode)\n\t\t\t\tVALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)\";\n\t\t$this->hr->query($sql, array($this->psd_ps_id, $this->psd_dp_id, $this->psd_tax_no, $this->psd_id_card_no, $this->psd_passport_no, $this->psd_picture, $this->psd_blood_id, $this->psd_reli_id, $this->psd_nation_id, $this->psd_race_id, $this->psd_psst_id, $this->psd_birthdate, $this->psd_birth_pv_id, $this->psd_gd_id, $this->psd_account_no, $this->psd_ba_id, $this->psd_facebook, $this->psd_twitter, $this->psd_website, $this->psd_email, $this->psd_cellphone, $this->psd_phone, $this->psd_ex_phone, $this->psd_work_phone, $this->psd_lodge_id, $this->psd_lodge_no, $this->psd_lodge_phone, $this->psd_addcur_no, $this->psd_addcur_pv_id, $this->psd_addcur_amph_id, $this->psd_addcur_dist_id, $this->psd_addcur_zipcode, $this->psd_addhome_no, $this->psd_addhome_pv_id, $this->psd_addhome_amph_id, $this->psd_addhome_dist_id, $this->psd_addhome_zipcode));\n\t\t$this->last_insert_id = $this->hr->insert_id();\n\t}", "protected function insert()\n {\n $insert = 'INSERT INTO users (first_name, last_name, email, password)\n VALUES (:first_name, :last_name, :email, :password)';\n $statement = self::$dbc->prepare($insert);\n unset($this->attributes['id']);\n foreach ($this->attributes as $key => $value) {\n $statement->bindValue(\":$key\", $value, PDO::PARAM_STR);\n }\n $statement->execute();\n $this->attributes['id'] = self::$dbc->lastInsertId();\n }", "public function insert() {\n\t\t$this->insert_user();\n\t}", "public function insert()\n\t{\n\t\treturn $this->getModel()->insert($this);\n\t}", "public function Do_insert_Example1(){\n\n\t}", "public function insertData($table, $data) {\n $this->db->insert($table, $data);\n }", "public function insertRow($table, $data){\n\n\t \t$this->db->insert($table, $data);\n\t \treturn $this->db->insert_id();\n\t}", "public function insertRecord( $table, $record, $updateIfKeyExists=false, $updateSQL=\"\" )\n {\n \t$fields = \"\";\n\t\t$values = \"\";\n\t\t\n\t\t// populate them\n\t\tforeach ($record as $f => $v)\n\t\t{\n\t\t\t$fields .= \"`$f`,\";\n\t\t\t$values .= ( is_numeric( $v ) && ( intval( $v ) === $v ) ) ? $v.\",\" : \"'$v',\";\n\t\t}\n\t\t\n\t\t// remove our trailing ,\n \t$fields = substr( $fields, 0, -1 );\n \t// remove our trailing ,\n \t$values = substr( $values, 0, -1 );\n \t\n\t\t$insert = \"INSERT INTO $table ({$fields}) VALUES({$values})\";\n\t\tif( $updateIfKeyExists )\n\t\t{\n\t\t\t$insert .= \" ON DUPLICATE KEY UPDATE {$updateSQL} \";\n\t\t}\n\t\t$this->executeQuery( $insert );\n\t\treturn true;\n }", "function insert($rowindex) {\r\n $tf = array();\r\n $tv = array();\r\n #~ $value = '';\r\n $um = NULL;\r\n foreach ($this->properties as $colvar=>$col) {\r\n if ($col->colname == '') continue; # a virtual field, usually used for display purpose\r\n $value = $this->ds->{$colvar}[$rowindex];\r\n if ($col->on_insert_callback != '')\r\n $value = eval($col->on_insert_callback);\r\n if ($col->inputtype == 'file' and $col->datatype == 'int') {\r\n if (!$um) $um = instantiate_module('upload_manager');\r\n $value = $um->put_file($colvar, $rowindex, $this->module);\r\n }\r\n\r\n $tf[] = '`'.$col->colname.'`';\r\n if ($value == 'Now()') {\r\n $tv[] = myaddslashes($value);\r\n }\r\n else {\r\n $tv[] = \"'\".myaddslashes($value).\"'\";\r\n }\r\n }\r\n $sql_fields = join(',',$tf);\r\n $sql_values = join(',',$tv);\r\n $sql = 'insert into `'.$this->db_table.'` ('.$sql_fields.') values ('.$sql_values.')';\r\n #~ echo $sql;exit();\r\n $res = mysql_query($sql) or die('<br>'.$sql.'<br>'.mysql_error()); #do to database\r\n $ret = mysql_insert_id(); # new!\r\n return $ret;\r\n }", "public function queryInsert($table, $data) : bool;", "public function insertRecords(){\n // Get the sql statement\n $sql = $this->insertSql();\n // Prepare the query\n $stmt = $this->db->prepare($sql);\n\n foreach ($this->paramsValues as $key=>$value) {\n $stmt->bindParam($this->params['columnNamePdo'][$key], $this->paramsValues[$key]);\n }\n \n $stmt->execute();\n \n return true;\n \n }", "public static function Insert(){\r\n }", "protected function _insert() {\n $def = $this->_getDef();\n if(!isset($def) || !$def){\n return false;\n }\n \n foreach ($this->_tableData as $field) {\n $fields[] = $field['field_name'];\n $value_holder[] = '?';\n $sql_fields[] = '`' . $field['field_name'] . '`';\n $field_name = $field['field_name'];\n \n if(false !== ($overrideKey = $this->_getOverrideKey($field_name))){\n $field_name = $overrideKey;\n }\n \n $$field_name = $this->$field_name;\n \n if($$field_name instanceof \\DateTime){\n $$field_name = $$field_name->format('Y-m-d H:i:s');\n }\n \n if(is_array($$field_name)){\n $$field_name = json_encode($$field_name);\n }\n \n $values[] = $$field_name;\n }\n \n $this->setLastError(NULL);\n \n $sql = \"INSERT INTO `{$this->_table}` (\" . implode(',', $sql_fields) . \") VALUES (\" . implode(',', $value_holder) . \")\";\n $stmt = Database::connection($this->_connection)->prepare($sql, $values);\n $stmt->execute();\n $success = true;\n if ($stmt->error !== '') {\n $this->setLastError($stmt->error);\n $success = false;\n }\n \n $id = $stmt->insert_id;\n \n $stmt->close();\n \n $primaryKey = $this->_getPrimaryKey();\n \n $this->{$primaryKey} = $id;\n \n return $success;\n }", "public function insertRow($table, $data){\n\n\t \t$this->db->insert($table, $data);\n\t \treturn $this->db->last_query();\n\t \t // $this->db->insert_id();\n\t}", "public function insert($loyPrg);", "abstract protected function doInsert($subject, Statement $insertStatement);", "function insert_transaction_record()\n\t{\n\t\t$invoice_id = strtotime('now');\n\t\t\n\t\t$data = array(\n\t\t 'user_id' => $this->user_id,\n\t\t 'invoice_id' => $invoice_id,\n\t\t 'product_id' => $this->auction_id,\t\t \t\t\n\t\t 'credit_debit' => 'DEBIT',\t\t \n\t\t 'transaction_name' =>'Bid Fee For auction ID: '.$this->auction_id,\n\t\t 'transaction_date' => $this->general->get_local_time('time'),\n\t\t 'transaction_type' => 'bid',\n\t\t 'transaction_status' => 'Completed',\t\t \n\t\t 'payment_method' => 'direct',\n\t\t 'amount'=>$this->user_bid_amt,\n\t\t 'pay_type' => $this->payment_type,\n\t \t);\n\t\t\n\t\t$this->db->insert('transaction', $data);\n\t\treturn $this->db->insert_id(); \t\n\t}", "public function insert(array $params);", "public function insert() {\n $sql = \"INSERT INTO contratos (numero_contrato, objeto_contrato, presupuesto, fecha_estimada_finalizacion)\n VALUES (:numero_contrato, :objeto_contrato, :presupuesto, :fecha_estimada_finalizacion)\";\n $args = array(\n \":numero_contrato\" => $this->numeroContrato,\n \":objeto_contrato\" => $this->objetoContrato,\n \":presupuesto\" => $this->presupuesto,\n \":fecha_estimada_finalizacion\" => $this->fechaEstimadaFinalizacion,\n );\n $stmt = $this->executeQuery($sql, $args);\n\n if ($stmt) {\n $this->id = $this->getConnection()->lastInsertId();\n }\n\n return !$stmt ? false : true;\n }", "public function insertRow($table, $data){\n\t\t$this->db->insert($table, $data);\n\t\treturn $this->db->insert_id();\n\t}", "public function Insert(){\n //Instancia conexao com o PDO\n $pdo = Conecta::getPdo();\n //Cria o sql passa os parametros e etc\n $sql = \"INSERT INTO $this->table (idcidade, cidade) VALUES (?, ?)\";\n $consulta = $pdo->prepare($sql);\n $consulta ->bindValue(1, $this->getIdCidade());\n $consulta ->bindValue(2, $this->getCidade());\n $consulta ->execute();\n $last = $pdo->lastInsertId();\n }", "public function insert() {\r\n // Rôle : insérer l'objet courant dans la base de données\r\n // Retour : true / false\r\n // Paramètre : aucun\r\n \r\n // Vérification de l'id\r\n if (!empty($this->getId())) {\r\n debug(get_class($this).\"->insert() : l'objet courant a déjà un id\");\r\n return false;\r\n }\r\n \r\n // Construction de la requête\r\n $sql = \"INSERT INTO `\".$this->getTable().\"` SET \";\r\n $param = [];\r\n $start = true;\r\n \r\n foreach ($this->getChamps() as $nom => $champs) {\r\n if ($nom === $this->getPrimaryKey() or !$champs->getAttribut(\"inBdd\")) {\r\n continue;\r\n }\r\n if ($start) {\r\n $sql .= \"`$nom` = :$nom\";\r\n $start = false;\r\n } else {\r\n $sql .= \", `$nom` = :$nom\";\r\n }\r\n \r\n $param[\":$nom\"] = $champs->getValue();\r\n }\r\n \r\n $sql .= \";\";\r\n \r\n // Préparation de la requête\r\n $req = self::getBdd()->prepare($sql);\r\n \r\n // Exécution de la requête\r\n if (!$req->execute($param)) {\r\n debug(get_class($this).\"->insert() : échec de la requête $sql\");\r\n return false;\r\n }\r\n \r\n // Assignation de l'id\r\n if ($req->rowCount() === 1) {\r\n $this->set($this->getPrimaryKey(), self::getBdd()->lastInsertId());\r\n return true;\r\n } else {\r\n debug(get_class($this).\"->insert() : aucune entrée, ou bien plus d'une entrée, créée\");\r\n return false;\r\n }\r\n }", "private function _insert($data){\n if($lastId = $this->insert($data)){\n return $lastId;\n }else{\n // Error\n Application_Core_Logger::log(\"Could not insert into table {$this->_name}\", 'Error');\n return false;\n } \t\n }", "public function insert(){\n\n }", "public function insert($table, $data, $format = \\null)\n {\n }", "public function insert() {\n\t$stmt = $this->_database->prepare('INSERT INTO planetterrains (planetid, terrainid, x, y) VALUES (?, ?, ?, ?)');\n\t$stmt->bind_param('iiii', $this->planetid, $this->terrainid, $this->x, $this->y);\n\t$stmt->execute();\n\t$this->refid = $this->_database->insert_id;\n\tif (\\is_array($this->deposit) && \\count($this->deposit) > 0) {\n\t $this->deposit[$this->refid]->terrainid = $this->refid;\n\t $this->deposit[$this->refid]->commit();\n\t}\n\telse if (!\\is_array($this->deposit)) {\n\t $this->deposit->terrainid = $this->refid;\n\t $this->deposit->commit();\n\t}\n }", "function insert($table, $data) {\n $respose = false;\n if ($this->db->insert($table, $data)) {\n $respose = true;\n }\n return $respose;\n }", "public function insert()\n {\n $db = new Database();\n $db->insert(\n \"INSERT INTO position (poste) VALUES ( ? )\",\n [$this->poste]\n );\n }", "public function insert($gunBbl);", "public function insert($conn, $data){\n\t\t$sql_fields=\"\";\n\t\t$sql_vals=\"\";\n\t\t$id_included=false;\n\t\t\n\t\tforeach($data as $field => $val){\n\t\t\tif (!array_key_exists($field, $this->fields)){\n\t\t\t\tthrow new Exception(\"Field \" . $field . \" does not exists\");\n\t\t\t}\n\t\t\t\n\t\t\t$field_info=$this->fields[$field];\n\t\t\tif (!$id_included && $field_info[\"id\"]){\n\t\t\t\t$id_included=true;\n\t\t\t}\n\t\t\t\n\t\t\tif ($sql_fields!=\"\"){\n\t\t\t\t$sql_fields = $sql_fields . \", \";\n\t\t\t}\n\t\t\t$sql_fields = $sql_fields . \"`\" . $field . \"`\";\n\t\t\t\n\t\t\tif ($sql_vals!=\"\"){\n\t\t\t\t$sql_vals = $sql_vals . \", \";\n\t\t\t}\n\t\t\t\n\t\t\t$sql_vals = $sql_vals . $this->quote($conn, $val, $field_info[\"type\"]);\n\t\t}\n\t\t\n\t\t$sql=\"INSERT INTO `\" . $this->table_name . \"` (\" . $sql_fields . \") VALUES (\" . $sql_vals . \")\";\n\t\t\n\t\t$res=$conn->exec($sql);\n\t\tif ($res===FALSE){ \n\t\t\treturn $res;\n\t\t}\n\t\tif (!$id_included && $this->id!=\"\"){\n\t\t\tif ($this->fields[$this->id][\"auto\"]){\n\t\t\t\treturn $conn->lastInsertId();\n\t\t\t}\n\t\t}\n\t\treturn TRUE;\n\t}" ]
[ "0.7685388", "0.7316209", "0.7308117", "0.72028816", "0.7151534", "0.71222115", "0.7078297", "0.7018812", "0.69969875", "0.69710904", "0.69630677", "0.6915893", "0.69100106", "0.6899835", "0.6890404", "0.6882674", "0.68491775", "0.673935", "0.6726214", "0.6705877", "0.67035675", "0.6687033", "0.6679439", "0.6671234", "0.66577977", "0.6644069", "0.66361713", "0.6613585", "0.66096133", "0.6604891", "0.6602122", "0.6599409", "0.6597979", "0.6581989", "0.6580863", "0.6580366", "0.6580366", "0.6575646", "0.6572799", "0.65617824", "0.6554051", "0.6545884", "0.6535294", "0.6528425", "0.65136296", "0.6508318", "0.64898586", "0.64891374", "0.64680684", "0.6467333", "0.64620113", "0.6459173", "0.6459173", "0.6448554", "0.64379513", "0.64266825", "0.64249814", "0.6396727", "0.63843304", "0.637384", "0.6369424", "0.6360551", "0.63582766", "0.6353617", "0.63490283", "0.63458145", "0.6344934", "0.6340467", "0.6330202", "0.6329621", "0.63291293", "0.6305872", "0.63023597", "0.6299808", "0.6297611", "0.62903434", "0.62894654", "0.62868357", "0.6286472", "0.6279198", "0.6275431", "0.6275069", "0.62722313", "0.62719005", "0.62696147", "0.6266646", "0.6259413", "0.6256643", "0.6252223", "0.6248319", "0.62482125", "0.6242196", "0.6238284", "0.6221462", "0.6220285", "0.62148225", "0.6208982", "0.62012386", "0.6198071", "0.6197603", "0.61965114" ]
0.0
-1
Update record in table
public function update($cbtSoalSiswa);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function update($record);", "public function updateRecord() \n {\n $str = \"Id = :Id\";\n array_walk($this->arrayKeysValues(), function ($value, $key) use (&$str) {\n $str .= \", $key = :$key\";\n });\n $sql = sprintf(\"UPDATE Cubans SET %s WHERE Id = :Id\", $str);\n $statement = $this->connect->prepare($sql);\n $statement->execute(array_merge([\":Id\" => $this->id], $this->arrayKeysValues()));\n }", "public function updateRow($row);", "private function update()\n {\n $queryString = 'UPDATE ' . $this->table . ' SET ';\n foreach ($this->data as $column => $value) {\n if ($column != self::ID) {\n $queryString .= $column . ' =:' . $column . ',';\n }\n }\n $queryString .= ' updated_at = sysdate() WHERE 1 = 1 AND ' . self::ID . ' =:' . self::ID;\n $this->query = $this->pdo->prepare($queryString);\n }", "public function updateRecord(){\n\t\tglobal $db;\n $data = array('email'=>$this->email);\n\t\t\t\t$response = $db->update($this->table,$data,\"id = $this->id\");\n\t\treturn $response;\n\t}", "abstract public function updateRecord($tableName, $record, $where = '');", "public function update(){\r\n\t\tif (!$this->hasChanged) return self::RES_UNCHANGED;\r\n\t\t$table = $this->getTable();\r\n\t\tif ($this->new){\r\n\t\t\tMessages::msg(\"Cannot update record in {$this->getFullTableName()}, because the record doesn't exist.\",Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\tif (!$table->hasPrimaryKey()){\r\n\t\t\tMessages::msg(\"Cannot update record in {$this->getFullTableName()}, because the table does not have a primary key.\",Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\t$this->beforeCommit();\r\n\t\t\r\n\t\t$vals = array();\r\n\t\t$where = array();\r\n\t\t$changeCount = 0;\r\n\t\t$error = false;\r\n\t\tforeach ($this->values as $name=>$value){\r\n\t\t\tif ($value->isErroneous()){\r\n\t\t\t\tFramework::reportErrorField($name);\r\n\t\t\t\t$error = true;\r\n\t\t\t}\r\n\t\t\tif ($value->hasChanged()){\r\n\t\t\t\t$vals[] = \"`$name` = \".$value->getSQLValue();\r\n\t\t\t\t$changeCount++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($error){\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t\r\n\t\tforeach ($table->getPrimaryKey()->getColumns() as $name){\r\n\t\t\t$where[] = \"`$name` = \".$this->values[$name]->getSQLValue();\r\n\t\t}\r\n\t\t$sql = 'UPDATE '.$this->getFullTableName().' SET '.implode(', ',$vals).' WHERE '.implode(' AND ',$where).' LIMIT 1';\r\n\t\tif (!SQL::query($sql)->success()){\r\n\t\t\tMessages::msg('Failed to update record in '.$this->getFullTableName().'.',Messages::M_CODE_ERROR);\r\n\t\t\treturn self::RES_FAILED;\r\n\t\t}\r\n\t\t$this->hasChanged = false;\r\n\t\tforeach ($this->values as $value){\r\n\t\t\t$value->setHasChanged(false);\r\n\t\t}\r\n\t\t\r\n\t\t$this->afterCommit();\r\n\t\t\r\n\t\treturn self::RES_SUCCESS;\r\n\t}", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",email1=\\\"$this->email1\\\",address1=\\\"$this->address1\\\",lastname=\\\"$this->lastname\\\",phone1=\\\"$this->phone1\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "function update() {\n\t\t\t$updateQuery = \"UPDATE \".$this->table.\" SET \";\n\n\t\t\t$keysAR = array_keys($this->activeRecord);\n\n\t\t\tfor ($loopUp = 0; $loopUp < count($this->activeRecord); $loopUp++) {\n\n $updateQuery .= $keysAR[$loopUp] . \" = ?, \";\n $paramArray[] = $this->activeRecord[$keysAR[$loopUp]];\n\n\t\t\t}\n\n\t\t\t$updateQuery = substr($updateQuery, 0, -2); // Haal de laatste komma weg.\n\n\t\t\t$updateQuery .= \" WHERE \";\n\n\t\t\t// Fetch de primary key van de tabel.\n $fetchPrimary = $this->mysqlConnection->query(\"SHOW INDEX FROM \".$this->table);\n $arrayIndex = $fetchPrimary->fetch(PDO::FETCH_ASSOC);\n $kolomIndex = $arrayIndex['Column_name'];\n\n $updateQuery .= $kolomIndex.\" = \".$this->originalValues[$kolomIndex];\n\n\t\t\t$this->lastQuery = $updateQuery;\n\n $updateTable = $this->mysqlConnection->prepare($this->lastQuery);\n $updateTable->execute($paramArray);\n\n\t\t}", "public function update(){\n\t\t$this->beforeSave();\n\t\t$tableName = $this->tableName();\n\t\t$fields = $this->fields();\n\t\t// Remove fields set as ignored by rules validation.\n\t\t$fields = $this->removeIgnored($fields);\n\t\t// Create PDO placeholders.\n\t\t$params = implode(', ', array_map(fn($name) => $name . ' = :' . $name, $fields));\n\t\t$primaryKey = $this->getPrimaryKey();\n\t\t$where = $primaryKey . ' = :' . $primaryKey;\n\t\t$statement = $this->db->prepare('UPDATE ' . $tableName . ' SET ' . $params . ' WHERE ' . $where);\n\t\t// Bind values to placeholders.\n\t\tforeach($fields as $field){\n\t\t\t$this->binder($statement, ':' . $field, $this->{$field});\n\t\t}\n\t\t$statement->bindValue(':' . $primaryKey, $this->{$primaryKey});\n\t\tif($statement->execute()){\n\t\t\t$this->afterSave();\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function update($entity){ \n //TODO: Implement update record.\n }", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",lastname=\\\"$this->lastname\\\",username=\\\"$this->username\\\",email=\\\"$this->email\\\",kind=\\\"$this->kind\\\",status=\\\"$this->status\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function update($tblUpdate);", "protected function _update() {\n $this->_getDef();\n \n //prepare\n foreach ($this->_tableData as $field) {\n if($field['primary']) {\n $primaryKey = $field['field_name'];\n $primaryValue = $this->$primaryKey;\n continue;\n }\n \n $sql_fields[] = '`' . $field['field_name'] . '` =?';\n \n $field_name = $field['field_name'];\n \n if(false !== ($overrideKey = $this->_getOverrideKey($field_name))){\n $field_name = $overrideKey;\n }\n \n if($this->$field_name instanceof \\DateTime){\n $$field_name = $this->$field_name->format('Y-m-d H:i:s');\n } elseif(is_array($$field_name)){\n $$field_name = json_encode($$field_name);\n } else {\n $$field_name = $this->$field_name;\n }\n \n $values[] = $$field_name;\n }\n \n $values[] = $primaryValue;\n \n $sql = \"UPDATE `{$this->_table}` SET \" . implode(',', $sql_fields) . \" WHERE `{$primaryKey}` =?\";\n $stmt = Database::connection($this->_connection)->prepare($sql, $values);\n $stmt->execute();\n $this->setLastError(NULL);\n if($stmt->error !== ''){\n $this->setLastError($stmt->error);\n }\n \n $stmt->close();\n \n return $this->getLastError() === NULL ? true : false;\n }", "protected function update() {\n $this->db->updateRows($this->table_name, $this->update, $this->filter);\n storeDbMsg($this->db,ucwords($this->form_ID) . \" successfully updated!\");\n }", "public function update() {\n\t\tif (isset($this->params['updated'])) {\n\t\t\t$this->params['updated'] = null;\n\t\t} // 'updated' is an auto timestamp\n\n\t\t$columns = array();\n\t\tforeach (array_keys($this->params) as $key) {\n\t\t\tarray_push($columns, $key . ' = ?');\n\t\t}\n\t\t$bindings = implode(', ', $columns);\n\t\t$sql = 'UPDATE ' . static::$table . ' SET ' . $bindings . ' WHERE id = ' . $this->get('id') . ' ;';\n\t\t$query = DBH()->prepare($sql);\n\t\t$query->execute(array_values($this->params));\n\t}", "function adv_update($table, array $data, array $where);", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function update(Tinebase_Record_Interface $_record) {\n }", "public function update(){\n if(empty($this->attributes)){\n return;\n }\n if ($this->isAutoInc) {\n $fieldsList = \" SET \";\n foreach ($this->attributes as $column => $value) {\n $fieldsList.=$column.\"=\".'\\''.$value.'\\''.\", \";\n }\n $fieldsList = str_last_replace(\", \", \"\", $fieldsList);\n $sqlQuery = \"UPDATE \".$this->table.$fieldsList.\" WHERE \".$this->idName.\"=\".$this->attributes[$this->idName];\n\n Db::instance()->execute($sqlQuery,$this->attributes);\n }\n }", "public function db_update() {}", "function UpdateRecord($tabel_name='',$where='', $param)\n {\n $this->db\n ->where($where)\n ->update($tabel_name, $param);\n }", "public function update($table);", "public function update($table);", "function updateField() {\n DATABASE::INIT_TABLE($this->database, $this->table);\n $fname = $this->urlParam('fname');\n $fvalue = $this->urlParam('fvalue');\n $id = $this->urlParam('id');\n DATABASE::UPDATE($this->table, [$fname], [$fvalue], $id);\n }", "public function update() {\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\r\n\t\t\t$ks_db->beginTransaction ();\r\n\t\t\t\r\n\t\t\t$arrBindings = array ();\r\n\t\t\t\r\n\t\t\tif (! isset ( $this->id )) { \r\n\t\t\t\techo \"Fatal Error: Id is not set for the object! Please do \\$objA->setId(\\$id); in: \" . __METHOD__;\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t//check if record exists\r\n\t\t\tif(! $this->exists ()) {\r\n\t\t\t\techo \"Fatal Error: No record found with id of ($this->id)\";\r\n\t\t\t\texit ();\r\n\t\t\t}\r\n\r\n\t\t\t$sql = \"UPDATE $this->sqlTable SET \";\r\n\t\t\t\r\n\t\t\tif (isset ( $this->userid )) {\r\n\t\t\t\t$sql .= \"lp_userid = ?, \";\r\n\t\t\t\t$arrBindings[] = $this->userid;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->random )) {\r\n\t\t\t\t$sql .= \"lp_random = ?, \";\r\n\t\t\t\t$arrBindings[] = $this->random;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->deadline )) {\r\n\t\t\t\t$sql .= \"lp_deadline = ?, \";\r\n\t\t\t\t$arrBindings[] = $this->deadline;\r\n\t\t\t}\r\n\r\n\t\t\t$sql = preg_replace ( '/, $/', '', $sql);\r\n\t\t\t$sql .= \" WHERE lp_id = ?\";\r\n\t\t\t$arrBindings[] = $this->id;\r\n\t\t\t\r\n\t\t\t$ks_db->query ( $sql, $arrBindings );\r\n\t\r\n\t\t\t$ks_db->commit ();\r\n\t\t\t\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_db->rollBack ();\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __CLASS__ . '::' . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}", "function update($idMedicalRecord) // Implementation \r\n\t\t{\r\n\t\t\t$this->idMedicalRecord = $idMedicalRecord;\r\n\t\t\t$dbo = database::getInstance(); // pass back that database object already created perhaps\r\n\t\t\t$sql = $this->buildQuery('update'); // what we want to do (update records)\r\n\r\n\t\t\t$dbo->doQuery($sql); // execute query statement\r\n\t\t}", "public function updateRecord ($sqlString);", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",comments=\\\"$this->comments\\\",price=\\\"$this->price\\\",brand=\\\"$this->brand\\\",model=\\\"$this->model\\\",y=\\\"$this->y\\\",link=\\\"$this->link\\\",in_existence=\\\"$this->in_existence\\\",is_public=\\\"$this->is_public\\\",is_featured=\\\"$this->is_featured\\\",category_id=\\\"$this->category_id\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "public function SQL_UPDATE() {\r\n\t}", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set name=\\\"$this->name\\\",short_name=\\\"$this->short_name\\\",is_active=\\\"$this->is_active\\\" where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "protected function update()\n\t{\n\t\t//append ID to fields\n\t\t$query = $this->connection->prepare\n\t\t(\"\n\t\t\tupdate Booth\n\t\t\tset BoothNum = ?\n\t\t\twhere BoothID = ?\n\t\t\");\n\n\t\t$query->execute(array_values($this->fields));\n\n\t}", "private function _update() {\n\n $this->db->replace(XCMS_Tables::TABLE_USERS, $this->getArray());\n $this->attributes->save();\n\n }", "public function update(){\n $sql = \"update \".self::$tablename.\" set correlativo=\\\"$this->correlativo\\\",nombre_instalador=\\\"$this->nombre_instalador\\\",nombre_proyecto=\\\"$this->nombre_proyecto\\\",localizacion=\\\"$this->localizacion\\\",contrato_orden_trabajo=\\\"$this->contrato_orden_trabajo\\\",sector_trabajo=\\\"$this->sector_trabajo\\\",area_aceptada=\\\"$this->area_aceptada\\\",fecha_proyecto=\\\"$this->fecha_proyecto\\\" where id_usuario=$this->id_usuario\";\n Executor::doit($sql);\n }", "protected function updateRow()\n { \n $tableName = $this->getTableName($this->className);\n $assignedValues = $this->getAssignedValues();\n $updateDetails = [];\n\n for ($i = 0; $i < count($assignedValues['columns']); $i++) { \n array_push($updateDetails, $assignedValues['columns'][$i] .' =\\''. $assignedValues['values'][$i].'\\'');\n }\n\n $connection = Connection::connect();\n\n $allUpdates = implode(', ' , $updateDetails);\n $update = $connection->prepare('update '.$tableName.' set '. $allUpdates.' where id='.$this->resultRows[0]['id']);\n \n if ($update->execute()) { \n return 'Row updated';\n } else { \n throw new Exception(\"Unable to update row\"); \n }\n }", "function updateRecord($table_name,$uid,$update_field,$update_value,$conn){\n\t\t$update_echo = '';\n\n\t\tfor($i=0;$i<count($update_field);$i++){\n\n\t\t\tif ($i==(count($update_field)-1)) {\n\t\t\t\t$update_echo = $update_echo.$update_field[$i].\"='\".$update_value[$i].\"'\";\n\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$update_echo = $update_echo.$update_field[$i].\"='\".$update_value[$i].\"', \";\n\t\t\t}\n\t\t\t\n\t\t}\n\n\t\t$sql = \"UPDATE $table_name SET $update_echo WHERE uid=$uid\";\n\n\t\techo $sql;\n\t\t\n\t\tif ($conn->query($sql) === TRUE) {\n\t\t echo \"Record updated successfully\";\n\t\t} else {\n\t\t echo \"Error updating record: \" . $conn->error;\n\t\t}\n\t}", "function update( \\gb\\domain\\DomainObject $object ) {\n //$this->updateStmt->execute( $values );\n }", "function EditRow() {\r\n\t\tglobal $Security, $Language;\r\n\t\t$sFilter = $this->KeyFilter();\r\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\r\n\t\t$conn = &$this->Connection();\r\n\t\t$this->CurrentFilter = $sFilter;\r\n\t\t$sSql = $this->SQL();\r\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\r\n\t\t$rs = $conn->Execute($sSql);\r\n\t\t$conn->raiseErrorFn = '';\r\n\t\tif ($rs === FALSE)\r\n\t\t\treturn FALSE;\r\n\t\tif ($rs->EOF) {\r\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // Set no record message\r\n\t\t\t$EditRow = FALSE; // Update Failed\r\n\t\t} else {\r\n\r\n\t\t\t// Save old values\r\n\t\t\t$rsold = &$rs->fields;\r\n\t\t\t$this->LoadDbValues($rsold);\r\n\t\t\t$rsnew = array();\r\n\r\n\t\t\t// Nro_Serie\r\n\t\t\t$this->Nro_Serie->SetDbValueDef($rsnew, $this->Nro_Serie->CurrentValue, \"\", $this->Nro_Serie->ReadOnly || $this->Nro_Serie->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// SN\r\n\t\t\t$this->SN->SetDbValueDef($rsnew, $this->SN->CurrentValue, NULL, $this->SN->ReadOnly || $this->SN->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Cant_Net_Asoc\r\n\t\t\t$this->Cant_Net_Asoc->SetDbValueDef($rsnew, $this->Cant_Net_Asoc->CurrentValue, NULL, $this->Cant_Net_Asoc->ReadOnly || $this->Cant_Net_Asoc->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_Marca\r\n\t\t\t$this->Id_Marca->SetDbValueDef($rsnew, $this->Id_Marca->CurrentValue, 0, $this->Id_Marca->ReadOnly || $this->Id_Marca->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_Modelo\r\n\t\t\t$this->Id_Modelo->SetDbValueDef($rsnew, $this->Id_Modelo->CurrentValue, 0, $this->Id_Modelo->ReadOnly || $this->Id_Modelo->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_SO\r\n\t\t\t$this->Id_SO->SetDbValueDef($rsnew, $this->Id_SO->CurrentValue, 0, $this->Id_SO->ReadOnly || $this->Id_SO->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Id_Estado\r\n\t\t\t$this->Id_Estado->SetDbValueDef($rsnew, $this->Id_Estado->CurrentValue, 0, $this->Id_Estado->ReadOnly || $this->Id_Estado->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// User_Server\r\n\t\t\t$this->User_Server->SetDbValueDef($rsnew, $this->User_Server->CurrentValue, NULL, $this->User_Server->ReadOnly || $this->User_Server->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Pass_Server\r\n\t\t\t$this->Pass_Server->SetDbValueDef($rsnew, $this->Pass_Server->CurrentValue, NULL, $this->Pass_Server->ReadOnly || $this->Pass_Server->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// User_TdServer\r\n\t\t\t$this->User_TdServer->SetDbValueDef($rsnew, $this->User_TdServer->CurrentValue, NULL, $this->User_TdServer->ReadOnly || $this->User_TdServer->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Pass_TdServer\r\n\t\t\t$this->Pass_TdServer->SetDbValueDef($rsnew, $this->Pass_TdServer->CurrentValue, NULL, $this->Pass_TdServer->ReadOnly || $this->Pass_TdServer->MultiUpdate <> \"1\");\r\n\r\n\t\t\t// Cue\r\n\t\t\t// Fecha_Actualizacion\r\n\r\n\t\t\t$this->Fecha_Actualizacion->SetDbValueDef($rsnew, ew_CurrentDate(), NULL);\r\n\t\t\t$rsnew['Fecha_Actualizacion'] = &$this->Fecha_Actualizacion->DbValue;\r\n\r\n\t\t\t// Usuario\r\n\t\t\t$this->Usuario->SetDbValueDef($rsnew, CurrentUserName(), NULL);\r\n\t\t\t$rsnew['Usuario'] = &$this->Usuario->DbValue;\r\n\r\n\t\t\t// Call Row Updating event\r\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\r\n\t\t\tif ($bUpdateRow) {\r\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\r\n\t\t\t\tif (count($rsnew) > 0)\r\n\t\t\t\t\t$EditRow = $this->Update($rsnew, \"\", $rsold);\r\n\t\t\t\telse\r\n\t\t\t\t\t$EditRow = TRUE; // No field to update\r\n\t\t\t\t$conn->raiseErrorFn = '';\r\n\t\t\t\tif ($EditRow) {\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\r\n\r\n\t\t\t\t\t// Use the message, do nothing\r\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\r\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\r\n\t\t\t\t\t$this->CancelMessage = \"\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\r\n\t\t\t\t}\r\n\t\t\t\t$EditRow = FALSE;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Call Row_Updated event\r\n\t\tif ($EditRow)\r\n\t\t\t$this->Row_Updated($rsold, $rsnew);\r\n\t\tif ($EditRow) {\r\n\t\t\t$this->WriteAuditTrailOnEdit($rsold, $rsnew);\r\n\t\t}\r\n\t\t$rs->Close();\r\n\t\treturn $EditRow;\r\n\t}", "private function update(){\n\t\t$id = $this->objAccessCrud->getId();\n\t\tif (empty ( $id )) return;\n\t\t// Check permission to update.\n\t\t$result = $this->clsAccessPermission->toUpdate();\n\t\tif(!$result){\n\t\t\t$this->msg->setWarn(\"You don't have permission to update!\");\n\t\t\treturn;\n\t\t}\n\t\t// Execute Update.\n\t\tif (! $this->objAccessCrud->update ()) {\n\t\t\t$this->msg->setError (\"There were issues on update the record!\");\n\t\t\treturn;\n\t\t}\n\t\t$this->msg->setSuccess (\"Updated the record with success!\");\n\t\treturn;\n\t}", "function update_record () {\n\t\t\n\t\t// validate input\n $valid = true;\n if (empty($this->name)) {\n $this->nameError = 'Please enter Name';\n $valid = false;\n }\n\n if (empty($this->email)) {\n $this->emailError = 'Please enter Email Address';\n $valid = false;\n } \n\n\n if (empty($this->mobile)) {\n $this->mobileError = 'Please enter Mobile Number';\n $valid = false;\n }\n\n // update data\n if ($valid) {\n $pdo = Database::connect();\n $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n $sql = \"UPDATE customers SET name = ?, email = ?, mobile = ? WHERE id=\".$_GET['id'];\n $q = $pdo->prepare($sql);\n $q->execute(array($this->name,$this->email,$this->mobile));\n Database::disconnect();\n header(\"Location: customer.php\");\n }\n else {\n $this->update();\n }\n\t\n\t}", "public function update($table, array $data, array $identifier);", "function updateRecord()\n\t{\n\t\t$data['roleName'] = $this->roleName;\n\t\t$data['roleDesc'] = $this->roleDesc;\n\t\t\n\t $this->db->where('roleID', $this->roleID);\n\t\t$this->db->update('roles', $data); \n\t\t\n\t\tif ($this->db->_error_message())\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}", "public function update_tranasction_record()\n\t{\n\t\t$data = array(\n\t\t 'amount'\t\t\t\t=> $this->user_bid_amt,\t\n\t\t 'pay_type' => $this->payment_type,\t\t \t\t\t \n\t\t 'transaction_date'\t=> $this->general->get_local_time('time'),\t\t \n\t \t);\n\t\t\n\t\t$this->db->where('user_id', $this->user_id);\n\t\t$this->db->where('product_id', $this->auction_id);\n\t\t$this->db->where('transaction_type', 'bid');\n\t\t$this->db->where('transaction_status', 'Completed');\n\t\t$this->db->where('payment_method', 'direct');\n\t\t$this->db->update('transaction', $data);\n\t}", "function updateData($table,$data,$id){\n\t\treturn $this->db->update($table,$data,$id);\n\t}", "public function update($row)\n\t{\n\t\t$this->db->where('tournamentId', $row['tournamentId']);\n\t\treturn $this->db->update('tournaments', $row);\n\t}", "public function updateRow(Request $request)\n {\n $result=MyRow::where('id',$request->id)->update([$request->column_name=>$request->value]);\n if ($result) echo 'Data Updated';\n }", "public function update() {\n\t\t$dbh = App::getDatabase()->connect();\n\n\t\t$query = \"UPDATE \".$this->getTableName().\"\n\t\t\t\t SET \";\n\n\t\t$fl = true;\n\t\tforeach($this as $column => $val) {\n\t\t\tif(!in_array($column, $this->getPrimaries())) {\n\t\t\t\t$query .= (($fl) ? \"\" : \", \").$column.\" = \".((is_bool($val)) ? (($val) ? \"TRUE\" : \"FALSE\") : ((is_null($val)||($val === \"\")) ? \"null\" : \"'\".$val.\"'\"));\n\t\t\t\t$fl = false;\n\t\t\t}\n\t\t}\n\n\t\t$fl = true;\n\t\tforeach($this as $column => $val) {\n\t\t\tif(in_array($column, $this->getPrimaries())) {\n\t\t\t\t$query .= \"\\n\".(($fl) ? \"WHERE\" : \"AND\").\" \".$column.\" = '\".$val.\"'\";\n\t\t\t\t$fl = false;\n\t\t\t}\n\t\t}\n\n\t\t$res = $dbh->exec($query);\n\t\t$dbh = null;\n\t\treturn $res;\n\t}", "public final function update() {\n\t\t$properties = self::getProperties($this);\n\t\t$columns = array_keys($properties);\n\t\t$values = array_values($properties);\n\n\t\t$setArray = array();\n\t\tfor ($i = 0; $i < count($properties); $i++) {\n\t\t\t$column = $columns[$i];\n\t\t\tif (strcmp($column, $this->primaryField) == 0 ||\n\t\t\t\tin_array($column, $this->uniqueFields)\n\t\t\t) {\n\t\t\t\t// Remove the value for binding\n\t\t\t\tunset($values[$i]);\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$setArray[] = $column . \" = ?\";\n\t\t}\n\n\t\t$sql = \"\n\tUPDATE\n\t\t\" . $this->table . \"\n\tSET\n\t\t\" . implode(\", \", $setArray) . \"\n\tWHERE\n\t\t\" . $this->primaryField . \" = ?\n\t;\";\n\t\t// Adds the primary key binding\n\t\t$values[] = $this->{$this->primaryField};\n\n\t\t$db = new MySQL();\n\t\t$statement = $db->prepare($sql);\n\t\t$status = $statement->execute($values);\n\t\t$statement = NULL;\n\n\t\treturn $status;\n\t}", "public function update(){\n static::setConnection();\n $table = static::$table;\n $keyColumn = static::$keyColumn;\n $sql = \"UPDATE \".$table.\" SET \";\n foreach($this as $k=>$v){\n $sql .= $k.\" = '\".$v.\"',\";\n }\n $sql = trim($sql, ',');\n $sql .= \" WHERE \".$keyColumn.\" = \".$this->keyColumn;\n mysqli_query(static::$conn, $sql);\n }", "function update($record)\n\t{\n\t\t// convert object from associative array, if needed\n\t\t$record = (is_array($record)) ? (object) $record : $record;\n\t\t// update the collection appropriately\n\t\t$key = $record->{$this->_keyfield};\n\t\tif (isset($this->_data[$key]))\n\t\t{\n\t\t\t$this->_data[$key] = $record;\n\t\t\t$this->store();\n\t\t}\n\t}", "function my_update_record( $table_name , $primary_key , $data_id , $datas ){\r\n\r\n\tglobal $connection;\r\n\r\n\t$build_query = \" UPDATE `\".$table_name .\"` SET \" ;\r\n\tforeach( $datas as $field => $value ){\r\n\t\r\n\t\t$build_query .= \"`\".$field .\"` = \". $value . \", \";\r\n\t\r\n\t}\r\n\t\r\n\t$query = rtrim( trim($build_query) , \",\" );\r\n\t\r\n\t$update_query = $query .\" WHERE `\".$primary_key.\"` = \". $data_id ; \r\n \r\n\t$result = my_query( $update_query );\r\n\t \r\n\treturn $connection->affected_rows ; \r\n\r\n}", "function UpdateRecord($id,$param) {\n $this->db->where('id_form_bd',$id);\n $this->db->update('form_bd',$param);\n }", "public function update_record_by_id($table, $data, $where)\n {\n $query = $this->db->update($table, $data, $where);\n return $this->db->affected_rows();\n }", "public function update_record($data, $id){\n\t\t$this->db->where('training_id', $id);\n\t\tif( $this->db->update('training',$data)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\t\t\n\t}", "abstract protected function updateModel();", "public function update(){\n\t\t$sql = \"update \".self::$tablename.\" set nombre=\\\"$this->name\\\", razon_social=\\\"$this->razon\\\", status=$this->is_active where id_banco=$this->id_banco\";\n\t\tExecutor::doit($sql);\n\t}", "public function updateData()\n {\n try {\n// echo \"<pre>\";\n// print_r($this->where);\n// print_r($this->insertUpdateArray);\n// exit;\n DB::table($this->dbTable)\n ->where($this->where)\n ->update($this->insertUpdateArray);\n } catch (Exception $ex) {\n throw new Exception($ex->getMessage(), 10024, $ex);\n }\n }", "function update(){\n\t\t$this->model->update();\n\t}", "public function updateRecord()\n\t{\n\t\tif($this->user->hasRight($this->getHandler()->getEditRight()))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$record = $this->getHandler()->getRecord();\n\t\t\t\t$record->import($this->getRequest());\n\n\t\t\t\t// check owner\n\t\t\t\tif(!$this->isOwner($record))\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception('You are not the owner of the record');\n\t\t\t\t}\n\n\t\t\t\t// check captcha\n\t\t\t\t$this->handleCaptcha($record);\n\n\t\t\t\t// update\n\t\t\t\t$this->getHandler()->update($record);\n\n\n\t\t\t\t$msg = new Message('You have successful edit a ' . $record->getName(), true);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t\tcatch(\\Exception $e)\n\t\t\t{\n\t\t\t\t$msg = new Message($e->getMessage(), false);\n\n\t\t\t\t$this->setResponse($msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$msg = new Message('Access not allowed', false);\n\n\t\t\t$this->setResponse($msg, null, $this->user->isAnonymous() ? 401 : 403);\n\t\t}\n\t}", "function updateOneFieldFromTable($table, $field, $value, $id)\n{\n $result = DatabaseHandler::Execute(\"UPDATE `$table` SET `$field` = '\" . $value . \"' WHERE `id` = $id ;\");\n if($result)\n {\n return true;\n }\n else\n {\n return false;\n }\n \n}", "public function update(){\n\t\techo $sql = \"update \".self::$tablename.\" set title=\\\"$this->title\\\",description=\\\"$this->description\\\",skills=\\\"$this->skills\\\",area_id=$this->area_id,jobtype_id=$this->jobtype_id,jobperiod_id=$this->jobperiod_id,duration=$this->duration,is_public=$this->is_public,is_finished=$this->is_finished,created_at=$this->created_at where id=$this->id\";\n\t\tExecutor::doit($sql);\n\t}", "function update($id, $data)\n {\n $this->db->where($this->id,$id);\n $this->db->update($this->table, $data);\n }", "public function DoUpdate()\n\t{\n\n\t\treturn db_update_records($this->fields, $this->tables, $this->values, $this->filters);\n\t}", "public function update() {\n // Get the values that are currently in the database\n $curr_vals = $this->read_single();\n\n // Set the values that will be added to the table\n foreach ($curr_vals as $key => $value) {\n // Convert key from the Database's capitalization to\n // this model's attribute capitalization style (all lowercase)\n $local_key = strtolower($key);\n // If user didn't specify property\n if (($this->attr[$local_key] === \"\") || ($this->attr[$local_key] === null)){\n // Then use the value that's already in the database\n $this->attr[$local_key] = $curr_vals[$key];\n }\n }\n\n // Create query\n $query = \"UPDATE \" . $this->table .\n \" SET = \" .\n \" WHERE MID = :mid AND Spot = :spot \";\n\n // Prepare statement\n $stmt = $this->conn->prepare($query);\n\n // Clean the data (reduce malicious SQL injection, etc.)\n foreach ($this->attr as $key => $value) {\n $this->attr[$key] = htmlspecialchars(strip_tags($value));\n }\n \n // Bind the data to a variable for an SQL attribute\n foreach ($this->attr as $key => $value) {\n $stmt->bindValue((\":\" . $key), $value);\n }\n\n // Execute the prepared statement and check for errors in running it\n return $this->runPrepStmtChkErr($stmt);\n }", "public function update($data) {}", "public function update($data) {}", "public function update() {\n global $DB;\n $record = array(\n 'sortorder' => $this->sortorder,\n 'criterion' => $this->criterion,\n 'addinfo' => json_encode($this->addinfo)\n );\n if ($this->id) {\n $record['id'] = $this->id;\n $DB->update_record($this->get_table_name(), $record);\n } else {\n $record['instantquizid'] = $this->instantquiz->id;\n $this->id = $DB->insert_record($this->get_table_name(), $record);\n }\n }", "function update_data($where,$data,$table){\n\t\t$this->db->where($where);\n\t\t$this->db->update($table,$data);\n\t}", "function update_data($where,$data,$table){\n $this->db->where($where);\n $this->db->update($table,$data);\n }", "abstract function update (\\Database\\Query\\Query $query);", "public function update_student($row)\n\t\t{\n\t\t\t$student = new Student();\n\t\t\t$student->setId($row['id']);\n\t\t\t$student->setFirstName($row['firstName']);\n\t\t\t$student->setLastName($row['lastName']);\n\t\t\t$student->setGender($row['gender']);\n\t\t\t$student->setAge($row['age']);\n\t\t\t$student->setGroup($row['sgroup']);\n\t\t\t$student->setFaculty($row['faculty']);\n\t\t\t$this->conn->update($student);\n\t\t}", "protected function update() {\n if ($this->_isLoaded()) {\n $this->db->where('id', $this->id);\n $this->db->update($this->tableName, $this->mapToDatabase());\n } else {\n throw new Exception(\"Model is not loaded\");\n }\n }", "public function testUpdate()\n {\n $id = $this->tester->grabRecord('common\\models\\Comentario', ['id_receita' => 2]);\n $receita = Comentario::findOne($id);\n $receita->descricao = 'novo Comentario';\n $receita->update();\n $this->tester->seeRecord('common\\models\\Comentario', ['descricao' => 'novo Comentario']);\n }", "function updateRowById ($tablename, $idField, $updatedRow)\n\t{\n\t\t$this->updateSetWhere($tablename, $updatedRow, \n\t\t\tnew SimpleWhereClause($idField, '=', $updatedRow[$idField]));\n\t}", "public function queryUpdate($table, $data, $where) : int;", "public function update() {\n\t\tTournamentDBClient::update($this);\n\t}", "function update($tbl, $where, $data)\n {\n $this->db->where($where);\n $this->db->update($tbl, $data);\n $affectedRows = $this->db->affected_rows();\n if ($affectedRows) {\n return true;\n } else {\n return $this->db->error();\n }\n }", "public function updateRecord($table = NULL , $columns = NULL, $where = NULL)\n\t{\n\t//echo $table;die;\n\t\t\tif($table == NULL || $columns == NULL)\n\t\t\t{\n\t\t\t\treturn ;\n\t\t\t}\n\t\t\t\n\t\t if($where){\n\t\t\t $this->db->where($where);\n\t\t }\n\t\t \n\t\t //print_r($this->db->last_query()). '<hr>';\n\t\t $result = $this->db->update($table, $columns);\n\t\t return $result;\n\t\t$this->db->close();\t\t\n\t}", "function update($taak)\n {\n $this->db->where('id', $taak->id);\n $this->db->update('taak', $taak);\n }", "function UpdateRecord($values)\n {\n $databasename = $this->databasename;\n $tablename = $this->tablename;\n $path = $this->path;\n //dprint_r($_FILES);\n if ( !isset($values[$this->primarykey]) )\n return false;\n $unirecid = $values[$this->primarykey];\n return $this->UpdateRecordBypk($values,$this->primarykey,$values[$this->primarykey]);\n }", "public function put()\n {\n $this->layout = 'ajax';\n\n $this->Row->id = $this->request->data['id'];\n\n //if the row has a feed that belongs to the user\n $this->Feed->id = $this->Row->field('feed_id');\n\n // check if row belongs to the user\n if ($this->Auth->user('id') != $this->Feed->field('user_id')) {\n die('ERROR');\n }\n $this->Row->saveField(trim($this->request->data['columnName']), $this->request->data['value']);\n\n die($this->data['value']); // datatables wants this\n }", "function EditRow() {\n\t\tglobal $Security, $Language;\n\t\t$sFilter = $this->KeyFilter();\n\t\t$sFilter = $this->ApplyUserIDFilters($sFilter);\n\t\t$conn = &$this->Connection();\n\t\t$this->CurrentFilter = $sFilter;\n\t\t$sSql = $this->SQL();\n\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t$rs = $conn->Execute($sSql);\n\t\t$conn->raiseErrorFn = '';\n\t\tif ($rs === FALSE)\n\t\t\treturn FALSE;\n\t\tif ($rs->EOF) {\n\t\t\t$this->setFailureMessage($Language->Phrase(\"NoRecord\")); // Set no record message\n\t\t\t$EditRow = FALSE; // Update Failed\n\t\t} else {\n\n\t\t\t// Save old values\n\t\t\t$rsold = &$rs->fields;\n\t\t\t$this->LoadDbValues($rsold);\n\t\t\t$this->featured_image->OldUploadPath = \"../uploads/product/\";\n\t\t\t$this->featured_image->UploadPath = $this->featured_image->OldUploadPath;\n\t\t\t$rsnew = array();\n\n\t\t\t// cat_id\n\t\t\t$this->cat_id->SetDbValueDef($rsnew, $this->cat_id->CurrentValue, 0, $this->cat_id->ReadOnly || $this->cat_id->MultiUpdate <> \"1\");\n\n\t\t\t// company_id\n\t\t\t$this->company_id->SetDbValueDef($rsnew, $this->company_id->CurrentValue, 0, $this->company_id->ReadOnly || $this->company_id->MultiUpdate <> \"1\");\n\n\t\t\t// pro_model\n\t\t\t$this->pro_model->SetDbValueDef($rsnew, $this->pro_model->CurrentValue, NULL, $this->pro_model->ReadOnly || $this->pro_model->MultiUpdate <> \"1\");\n\n\t\t\t// pro_name\n\t\t\t$this->pro_name->SetDbValueDef($rsnew, $this->pro_name->CurrentValue, NULL, $this->pro_name->ReadOnly || $this->pro_name->MultiUpdate <> \"1\");\n\n\t\t\t// pro_description\n\t\t\t$this->pro_description->SetDbValueDef($rsnew, $this->pro_description->CurrentValue, NULL, $this->pro_description->ReadOnly || $this->pro_description->MultiUpdate <> \"1\");\n\n\t\t\t// pro_condition\n\t\t\t$this->pro_condition->SetDbValueDef($rsnew, $this->pro_condition->CurrentValue, NULL, $this->pro_condition->ReadOnly || $this->pro_condition->MultiUpdate <> \"1\");\n\n\t\t\t// pro_features\n\t\t\t$this->pro_features->SetDbValueDef($rsnew, $this->pro_features->CurrentValue, NULL, $this->pro_features->ReadOnly || $this->pro_features->MultiUpdate <> \"1\");\n\n\t\t\t// post_date\n\t\t\t$this->post_date->SetDbValueDef($rsnew, ew_CurrentDateTime(), NULL);\n\t\t\t$rsnew['post_date'] = &$this->post_date->DbValue;\n\n\t\t\t// ads_id\n\t\t\t$this->ads_id->SetDbValueDef($rsnew, $this->ads_id->CurrentValue, NULL, $this->ads_id->ReadOnly || $this->ads_id->MultiUpdate <> \"1\");\n\n\t\t\t// pro_base_price\n\t\t\t$this->pro_base_price->SetDbValueDef($rsnew, $this->pro_base_price->CurrentValue, NULL, $this->pro_base_price->ReadOnly || $this->pro_base_price->MultiUpdate <> \"1\");\n\n\t\t\t// pro_sell_price\n\t\t\t$this->pro_sell_price->SetDbValueDef($rsnew, $this->pro_sell_price->CurrentValue, NULL, $this->pro_sell_price->ReadOnly || $this->pro_sell_price->MultiUpdate <> \"1\");\n\n\t\t\t// featured_image\n\t\t\tif ($this->featured_image->Visible && !$this->featured_image->ReadOnly && strval($this->featured_image->MultiUpdate) == \"1\" && !$this->featured_image->Upload->KeepFile) {\n\t\t\t\t$this->featured_image->Upload->DbValue = $rsold['featured_image']; // Get original value\n\t\t\t\tif ($this->featured_image->Upload->FileName == \"\") {\n\t\t\t\t\t$rsnew['featured_image'] = NULL;\n\t\t\t\t} else {\n\t\t\t\t\t$rsnew['featured_image'] = $this->featured_image->Upload->FileName;\n\t\t\t\t}\n\t\t\t\t$this->featured_image->ImageWidth = 875; // Resize width\n\t\t\t\t$this->featured_image->ImageHeight = 665; // Resize height\n\t\t\t}\n\n\t\t\t// folder_image\n\t\t\t$this->folder_image->SetDbValueDef($rsnew, $this->folder_image->CurrentValue, \"\", $this->folder_image->ReadOnly || $this->folder_image->MultiUpdate <> \"1\");\n\n\t\t\t// pro_status\n\t\t\t$tmpBool = $this->pro_status->CurrentValue;\n\t\t\tif ($tmpBool <> \"Y\" && $tmpBool <> \"N\")\n\t\t\t\t$tmpBool = (!empty($tmpBool)) ? \"Y\" : \"N\";\n\t\t\t$this->pro_status->SetDbValueDef($rsnew, $tmpBool, \"N\", $this->pro_status->ReadOnly || $this->pro_status->MultiUpdate <> \"1\");\n\n\t\t\t// branch_id\n\t\t\t$this->branch_id->SetDbValueDef($rsnew, $this->branch_id->CurrentValue, NULL, $this->branch_id->ReadOnly || $this->branch_id->MultiUpdate <> \"1\");\n\n\t\t\t// lang\n\t\t\t$this->lang->SetDbValueDef($rsnew, $this->lang->CurrentValue, \"\", $this->lang->ReadOnly || $this->lang->MultiUpdate <> \"1\");\n\t\t\tif ($this->featured_image->Visible && !$this->featured_image->Upload->KeepFile) {\n\t\t\t\t$this->featured_image->UploadPath = \"../uploads/product/\";\n\t\t\t\t$OldFiles = ew_Empty($this->featured_image->Upload->DbValue) ? array() : array($this->featured_image->Upload->DbValue);\n\t\t\t\tif (!ew_Empty($this->featured_image->Upload->FileName) && $this->UpdateCount == 1) {\n\t\t\t\t\t$NewFiles = array($this->featured_image->Upload->FileName);\n\t\t\t\t\t$NewFileCount = count($NewFiles);\n\t\t\t\t\tfor ($i = 0; $i < $NewFileCount; $i++) {\n\t\t\t\t\t\t$fldvar = ($this->featured_image->Upload->Index < 0) ? $this->featured_image->FldVar : substr($this->featured_image->FldVar, 0, 1) . $this->featured_image->Upload->Index . substr($this->featured_image->FldVar, 1);\n\t\t\t\t\t\tif ($NewFiles[$i] <> \"\") {\n\t\t\t\t\t\t\t$file = $NewFiles[$i];\n\t\t\t\t\t\t\tif (file_exists(ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $file)) {\n\t\t\t\t\t\t\t\t$OldFileFound = FALSE;\n\t\t\t\t\t\t\t\t$OldFileCount = count($OldFiles);\n\t\t\t\t\t\t\t\tfor ($j = 0; $j < $OldFileCount; $j++) {\n\t\t\t\t\t\t\t\t\t$file1 = $OldFiles[$j];\n\t\t\t\t\t\t\t\t\tif ($file1 == $file) { // Old file found, no need to delete anymore\n\t\t\t\t\t\t\t\t\t\tunset($OldFiles[$j]);\n\t\t\t\t\t\t\t\t\t\t$OldFileFound = TRUE;\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ($OldFileFound) // No need to check if file exists further\n\t\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t\t$file1 = ew_UploadFileNameEx($this->featured_image->PhysicalUploadPath(), $file); // Get new file name\n\t\t\t\t\t\t\t\tif ($file1 <> $file) { // Rename temp file\n\t\t\t\t\t\t\t\t\twhile (file_exists(ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $file1) || file_exists($this->featured_image->PhysicalUploadPath() . $file1)) // Make sure no file name clash\n\t\t\t\t\t\t\t\t\t\t$file1 = ew_UniqueFilename($this->featured_image->PhysicalUploadPath(), $file1, TRUE); // Use indexed name\n\t\t\t\t\t\t\t\t\trename(ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $file, ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $file1);\n\t\t\t\t\t\t\t\t\t$NewFiles[$i] = $file1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->featured_image->Upload->DbValue = empty($OldFiles) ? \"\" : implode(EW_MULTIPLE_UPLOAD_SEPARATOR, $OldFiles);\n\t\t\t\t\t$this->featured_image->Upload->FileName = implode(EW_MULTIPLE_UPLOAD_SEPARATOR, $NewFiles);\n\t\t\t\t\t$this->featured_image->SetDbValueDef($rsnew, $this->featured_image->Upload->FileName, \"\", $this->featured_image->ReadOnly || $this->featured_image->MultiUpdate <> \"1\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Call Row Updating event\n\t\t\t$bUpdateRow = $this->Row_Updating($rsold, $rsnew);\n\t\t\tif ($bUpdateRow) {\n\t\t\t\t$conn->raiseErrorFn = $GLOBALS[\"EW_ERROR_FN\"];\n\t\t\t\tif (count($rsnew) > 0)\n\t\t\t\t\t$EditRow = $this->Update($rsnew, \"\", $rsold);\n\t\t\t\telse\n\t\t\t\t\t$EditRow = TRUE; // No field to update\n\t\t\t\t$conn->raiseErrorFn = '';\n\t\t\t\tif ($EditRow) {\n\t\t\t\t\tif ($this->featured_image->Visible && !$this->featured_image->Upload->KeepFile) {\n\t\t\t\t\t\t$OldFiles = ew_Empty($this->featured_image->Upload->DbValue) ? array() : array($this->featured_image->Upload->DbValue);\n\t\t\t\t\t\tif (!ew_Empty($this->featured_image->Upload->FileName) && $this->UpdateCount == 1) {\n\t\t\t\t\t\t\t$NewFiles = array($this->featured_image->Upload->FileName);\n\t\t\t\t\t\t\t$NewFiles2 = array($rsnew['featured_image']);\n\t\t\t\t\t\t\t$NewFileCount = count($NewFiles);\n\t\t\t\t\t\t\tfor ($i = 0; $i < $NewFileCount; $i++) {\n\t\t\t\t\t\t\t\t$fldvar = ($this->featured_image->Upload->Index < 0) ? $this->featured_image->FldVar : substr($this->featured_image->FldVar, 0, 1) . $this->featured_image->Upload->Index . substr($this->featured_image->FldVar, 1);\n\t\t\t\t\t\t\t\tif ($NewFiles[$i] <> \"\") {\n\t\t\t\t\t\t\t\t\t$file = ew_UploadTempPath($fldvar, $this->featured_image->TblVar) . $NewFiles[$i];\n\t\t\t\t\t\t\t\t\tif (file_exists($file)) {\n\t\t\t\t\t\t\t\t\t\tif (@$NewFiles2[$i] <> \"\") // Use correct file name\n\t\t\t\t\t\t\t\t\t\t\t$NewFiles[$i] = $NewFiles2[$i];\n\t\t\t\t\t\t\t\t\t\tif (!$this->featured_image->Upload->ResizeAndSaveToFile($this->featured_image->ImageWidth, $this->featured_image->ImageHeight, EW_THUMBNAIL_DEFAULT_QUALITY, $NewFiles[$i], TRUE, $i)) {\n\t\t\t\t\t\t\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UploadErrMsg7\"));\n\t\t\t\t\t\t\t\t\t\t\treturn FALSE;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$NewFiles = array();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$OldFileCount = count($OldFiles);\n\t\t\t\t\t\tfor ($i = 0; $i < $OldFileCount; $i++) {\n\t\t\t\t\t\t\tif ($OldFiles[$i] <> \"\" && !in_array($OldFiles[$i], $NewFiles))\n\t\t\t\t\t\t\t\t@unlink($this->featured_image->OldPhysicalUploadPath() . $OldFiles[$i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($this->getSuccessMessage() <> \"\" || $this->getFailureMessage() <> \"\") {\n\n\t\t\t\t\t// Use the message, do nothing\n\t\t\t\t} elseif ($this->CancelMessage <> \"\") {\n\t\t\t\t\t$this->setFailureMessage($this->CancelMessage);\n\t\t\t\t\t$this->CancelMessage = \"\";\n\t\t\t\t} else {\n\t\t\t\t\t$this->setFailureMessage($Language->Phrase(\"UpdateCancelled\"));\n\t\t\t\t}\n\t\t\t\t$EditRow = FALSE;\n\t\t\t}\n\t\t}\n\n\t\t// Call Row_Updated event\n\t\tif ($EditRow)\n\t\t\t$this->Row_Updated($rsold, $rsnew);\n\t\t$rs->Close();\n\n\t\t// featured_image\n\t\tew_CleanUploadTempPath($this->featured_image, $this->featured_image->Upload->Index);\n\t\treturn $EditRow;\n\t}", "public function modifyRecords(){\n \n // Get the sql statement\n $sql = $this->updateSql();\n // Prepare the query\n $stmt = $this->db->prepare($sql);\n\n foreach ($this->requestUpdateValues as $key => $value) {\n $stmt->bindParam($this->params['columnName_Pdo'][$key], $this->requestUpdateValues[$key]);\n }\n \n $stmt->execute();\n \n return true;\n \n }", "function _update($entity)\n {\n $key = $this->object->get_primary_key_column();\n return $this->object->_wpdb()->update($this->object->get_table_name(), $this->object->_convert_to_table_data($entity), array($key => $entity->{$key}));\n }", "public function update() {\n $Sql = \"UPDATE \" . $this->tableName[0] . \" SET \";\n foreach ($this->fieldListArray as $Key_ => $Value_) {\n $Sql = $Sql . \"$Key_='$Value_', \";\n }\n $Sql = substr($Sql, 0, strlen($Sql) - 2);\n $Sql = $Sql . \" WHERE \";\n foreach ($this->conditionArray as $Key_ => $Value_) {\n $Sql = $Sql . \"$Key_='$Value_' AND \";\n }\n $Sql = substr($Sql, 0, strlen($Sql) - 4);\n //echo $Sql;\n return mysqli_query($this->dataBaseConnect->getConnection(), $Sql);\n }", "public function update_data($where,$data,$table){\r\n $this->db->where($where);\r\n $this->db->update($table,$data);\r\n }", "public function updateRow($data)\r\n\t{\r\n\t\t$data = (array)$data;\r\n\t\t$data = $this->cleanupFieldNames($data);\r\n\t\t\r\n\t\t// Build SQL\r\n\t\t$sql = 'UPDATE `'.$this->name.'` SET ';\r\n\t\t$values = array();\r\n\t\t$pkFound = false;\r\n\t\tforeach($data as $key => $val)\r\n\t\t{\r\n\t\t\t// Ignore if field is not in table\r\n\t\t\tif (!$this->hasField($key))\r\n\t\t\t{\r\n\t\t\t\tunset($data[$key]);\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\r\n\t\t\t// Include value, but not if primary key and table has auto-incr PK\r\n\t\t\t$include = true;\r\n\t\t\tif ($key == $this->primaryKey)\r\n\t\t\t{\r\n\t\t\t\tif ($this->primaryKeyIsAutoIncrement)\r\n\t\t\t\t{\r\n\t\t\t\t\t$include = false;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Found non-empty primary key\r\n\t\t\t\tif (!empty($val))\r\n\t\t\t\t{\r\n\t\t\t\t\t$pkFound = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// Include and process special value\r\n\t\t\tif ($include)\r\n\t\t\t{\r\n\t\t\t\tif ($val === 'NULL')\r\n\t\t\t\t{\r\n\t\t\t\t\t$values[] = \"`$key` = NULL\";\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$values[] = \"`$key` = :$key\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\t// Quit if has no primary key\r\n\t\tif (!$pkFound)\r\n\t\t{\r\n\t\t\tthrow new \\Exception('Cannot update: The supplied data does not contain a primary key');\r\n\t\t}\r\n\t\r\n\t\t// No fields were found - update makes no sense\r\n\t\tif (count($values) == 0)\r\n\t\t{\r\n\t\t\tthrow new \\Exception('No fields were added to the UPDATE query');\r\n\t\t}\r\n\t\t\t\r\n\t\t// Add values to query\r\n\t\t$sql .= implode(', ', $values);\r\n\t\r\n\t\t// Add where\r\n\t\t$sql .= ' WHERE `'.$this->primaryKey.'` = :' . $this->primaryKey;\r\n\r\n\t\t// Execute\r\n\t\t$result = $this->db->runQuery($sql, $data);\r\n\t\t\r\n\t\treturn $this->db->getAffectedRows();\r\n\t}", "private function crud_put($record = null)\n {\n $key = $record['id'];\n // Make sure the new record has an ID\n if (!isset($key))\n {\n $this->response(array('error' => 'Update: No item specified'), 406);\n return;\n }\n // make sure the item is real\n if (!$this->supplies->exists($key))\n {\n $this->response(array('error' => 'Update: Item ' . $key . ' not found'), 406);\n return;\n }\n // proceed with update\n $this->supplies->update($record);\n // check for DB errors\n $oops = $this->db->error();\n if (empty($oops['code']))\n $this->response(array('ok'), 200);\n else\n $this->response($oops, 400);\n }", "public function update($tables,$data,$pk,$id){\n $this->db->where($pk,$id);\n $this->db->update($tables,$data);\n }", "public function update($tables,$data,$pk,$id){\n $this->db->where($pk,$id);\n $this->db->update($tables,$data);\n }", "public function update($tables,$data,$pk,$id){\n $this->db->where($pk,$id);\n $this->db->update($tables,$data);\n }", "public function update_record($data, $id){\n\t\t$this->db->where('award_id', $id);\n\t\tif( $this->db->update('awards',$data)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\t\t\n\t}", "public function update( $sql, $params=array());", "function editRecord($rec)\r\n\t\t{\r\n\t\t\t// Create associative array of key fields and data values\r\n\t\t\t$data = array(\"idMedicalRecord\"=>$rec[0],\"medicalRec_weight\"=>$rec[1],\"medicalRec_height\"=>$rec[2],\"medicalRec_bloodPressure\"=>$rec[3],\"medicalRec_temperature\"=>$rec[4],\"medicalRec_bloodIronLevel\"=>$rec[5],\"medicalRec_time\"=>$rec[6],\"medicalRec_date\"=>$rec[7],\"medicalRec_medicalHistory\"=>$rec[8],\"medicalRec_rejectionReason\"=>$rec[9]);\r\n\t\t\t// Bind values to object's attributes\r\n\t\t\t$this->bind($data);\r\n\t\t\t// Add new updated values to table in database to location of given Primary key\r\n\t\t\t$this->update($rec[0]);\r\n\t\t}", "function update_data($where,$data,$table){\n $this->db->where($where);\n $this->db->update($table,$data);\n }", "public function update():void\n {\n $id = $this->id;\n $first_name = $this->first_name;\n $last_name = $this->last_name;\n $image = $this->image;\n $user_type = $this->user_type;\n $address = $this->address;\n\t\t$phone = $this->phone;\n $this->fetch(\n 'UPDATE user\n SET first_name = ?,\n last_name = ?,\n image = ?,\n user_type = ?,\n address=?,\n phone=?\n WHERE id = ?;',\n [$first_name, $last_name,$image, $user_type,$address ,$phone , $id]\n );\n }", "public function updateRecord($arrDatos) {\n\t\t\t\t$data = array(\n\t\t\t\t\t$arrDatos [\"column\"] => $arrDatos [\"value\"]\n\t\t\t\t);\n\t\t\t\t$this->db->where($arrDatos [\"primaryKey\"], $arrDatos [\"id\"]);\n\t\t\t\t$query = $this->db->update($arrDatos [\"table\"], $data);\n\t\t\t\tif ($query) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t}", "private function update_record($table, Array $columns, Array $records, Array $where_columns, Array $where_records, $printSQL = false) {\n\t\treturn $this->get_database_utils ()->update_record ( $table, $columns, $records, $where_columns, $where_records, $printSQL );\n\t}", "private function update_record($table, Array $columns, Array $records, Array $where_columns, Array $where_records, $printSQL = false) {\n\t\treturn $this->get_database_utils ()->update_record ( $table, $columns, $records, $where_columns, $where_records, $printSQL );\n\t}", "private function update_record($table, Array $columns, Array $records, Array $where_columns, Array $where_records, $printSQL = false) {\n\t\treturn $this->get_database_utils ()->update_record ( $table, $columns, $records, $where_columns, $where_records, $printSQL );\n\t}", "public function Save()\r\n\t\t{\r\n\t\t\tif ($this->id == -1) {\r\n\t\t\t\tunset($this->columns[\"id\"]);\r\n\t\t\t\t$sqlCol = null;\r\n\t\t\t\t$sqlKey = null;\r\n\t\t\t\tforeach ($this->columns as $column => $value) {\r\n\t\t\t\t\t$data[$column] = $this->$column;\r\n\t\t\t\t\t$sqlCol .= \",\" . $column;\r\n\t\t\t\t\t$sqlKey .= \",:\" . $column;\r\n\t\t\t\t}\r\n\t\t\t\t$sqlCol = ltrim($sqlCol, \",\");\r\n\t\t\t\t$sqlKey = ltrim($sqlKey, \",\");\r\n\t\t\t\t$query = $this->db->prepare(\r\n\t\t\t\t\t\"INSERT INTO \" . $this->table . \" (\" . $sqlCol . \")\r\n\t\t\t\t\t\tVALUES (\" . $sqlKey . \") ;\"\r\n\t\t\t\t);\r\n\t\t\t\t$query->execute($data);\r\n\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\t// Sinon faire un update dynamique\r\n\t\t\t\t$sqlSet = null;\r\n\t\t\t\tforeach ($this->columns as $column => $value) {\r\n\t\t\t\t\t$data[$column] = $this->$column;\r\n\t\t\t\t\t$sqlSet[] .= $column . \"=:\" . $column;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// Suppression de la mise à jour de la date d'update \r\n\t\t\t\t// la mise à jour des dates est maintenant faites en BDD.\r\n\t\t\t\t$query = $this->db->prepare(\r\n\t\t\t\t\t\"UPDATE \" . $this->table . \" SET \r\n\t\t\t\t\t\t\" . implode(\",\", $sqlSet) . \"\r\n\t\t\t\t\t\tWHERE id=:id;\"\r\n\t\t\t\t);\r\n\r\n\t\t\t\t$query->execute($data);\r\n\t\t\t}\r\n\t\t}" ]
[ "0.79042345", "0.77664155", "0.74877346", "0.72845757", "0.7220152", "0.72146136", "0.71019787", "0.7017114", "0.6999028", "0.6981327", "0.6949352", "0.69181615", "0.6915977", "0.6895396", "0.68547875", "0.68230116", "0.681958", "0.67935467", "0.6790511", "0.6779492", "0.67596304", "0.67510855", "0.67374414", "0.67374414", "0.6715787", "0.6701779", "0.66925573", "0.6691368", "0.6689188", "0.6681201", "0.66229224", "0.6616671", "0.66120833", "0.6609063", "0.66025317", "0.6577835", "0.65717655", "0.6569056", "0.65670323", "0.65649295", "0.65454364", "0.65235615", "0.6512063", "0.6506478", "0.6499202", "0.6491762", "0.6488132", "0.6483528", "0.6482787", "0.6475009", "0.64622545", "0.6458547", "0.64541674", "0.644366", "0.64408785", "0.6431788", "0.6423489", "0.6419601", "0.6419021", "0.64178133", "0.6407153", "0.6403231", "0.6396207", "0.6390887", "0.6385937", "0.6385937", "0.6383919", "0.63825786", "0.637033", "0.6367925", "0.63678765", "0.6367509", "0.63649154", "0.63473564", "0.63439286", "0.6341738", "0.6341637", "0.63295114", "0.63248646", "0.6318097", "0.6311667", "0.63027847", "0.6302308", "0.63000894", "0.6298572", "0.62913114", "0.6287568", "0.6276772", "0.62749934", "0.62749934", "0.62749934", "0.6272395", "0.6264955", "0.626488", "0.6262422", "0.62436", "0.6242292", "0.6237878", "0.6237878", "0.6237878", "0.62355506" ]
0.0
-1
Transform a guest account into a registered customer account
public function processGuestToCustomer() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function _ensureCustomer()\n {\n if ( $this->_isGuestOrder() && Mage::helper('gueststorecredit')->canConvertGuest() ) {\n $customer = Mage::helper('gueststorecredit')->createNewCustomerFromOrder($this->getOrder());\n\n $this->getCreditMemo()->setCustomerId($customer->getId());\n\n $this->setCustomerId($customer->getId())\n ->setCustomer($customer);\n\n $this->setIsFromGuestFlag(true);\n }\n\n parent::_ensureCustomer();\n }", "public function testCustomerGuestTest()\n {\n $customerId = 0;\n $customer = $this->customerOrderService->getCustomer($customerId);\n\n $this->assertTrue(\"Guest\" == $customer->first_name);\n }", "public function getCustomerIsGuest();", "public function getCustomer();", "public function createCustomer(Customer $customer): Customer;", "function ciniki_poma_customerAccountGet($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'),\n 'customer_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Customer'),\n 'order_id'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Order'),\n 'sections'=>array('required'=>'no', 'blank'=>'yes', 'type'=>'list', 'name'=>'Return Orders'),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n\n //\n // Check access to tnid as owner, or sys admin.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'poma', 'private', 'checkAccess');\n $rc = ciniki_poma_checkAccess($ciniki, $args['tnid'], 'ciniki.poma.customerAccountGet');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Load poma maps\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'poma', 'private', 'maps');\n $rc = ciniki_poma_maps($ciniki);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $maps = $rc['maps'];\n\n //\n // Load tenant settings\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'intlSettings');\n $rc = ciniki_tenants_intlSettings($ciniki, $args['tnid']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $intl_timezone = $rc['settings']['intl-default-timezone'];\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'users', 'private', 'dateFormat');\n $date_format = ciniki_users_dateFormat($ciniki, 'php');\n\n $rsp = array('stat'=>'ok', 'customer_details'=>array(), 'orders'=>array());\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryArrayTree');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'customers', 'hooks', 'customerDetails');\n\n //\n // Get the customer details\n //\n if( isset($args['sections']) && in_array('details', $args['sections']) ) {\n $rc = ciniki_customers_hooks_customerDetails($ciniki, $args['tnid'], array('customer_id'=>$args['customer_id']));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['details']) ) {\n $rsp['customer_details'] = $rc['details'];\n }\n if( isset($rc['customer']['member_status_text']) && $rc['customer']['member_status_text'] != '' ) {\n if( isset($rc['customer']['member_lastpaid']) && $rc['customer']['member_lastpaid'] != '' ) {\n $rsp['customer_details'][] = array('detail'=>array(\n 'label'=>'Membership',\n 'value'=>$rc['customer']['member_status_text'] . ' <span class=\"subdue\">[' . $rc['customer']['member_lastpaid'] . ']</span>',\n ));\n } else {\n $rsp['customer_details'][] = array('detail'=>array(\n 'label'=>'Membership',\n 'value'=>$rc['customer']['member_status_text'],\n ));\n }\n }\n\n //\n // Get the current account balance\n //\n $strsql = \"SELECT ciniki_poma_customer_ledgers.id, \"\n . \"ciniki_poma_customer_ledgers.description, \"\n . \"ciniki_poma_customer_ledgers.transaction_date, \"\n . \"ciniki_poma_customer_ledgers.transaction_type, \"\n . \"ciniki_poma_customer_ledgers.customer_amount, \"\n . \"ciniki_poma_customer_ledgers.balance \"\n . \"FROM ciniki_poma_customer_ledgers \"\n . \"WHERE customer_id = '\" . ciniki_core_dbQuote($ciniki, $args['customer_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"ORDER BY transaction_date DESC \"\n . \"LIMIT 15 \"\n . \"\";\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.poma', array(\n array('container'=>'entries', 'fname'=>'id', \n 'fields'=>array('id', 'description', 'transaction_date', 'transaction_type', 'customer_amount', 'balance'),\n 'utctotz'=>array('transaction_date'=>array('timezone'=>$intl_timezone, 'format'=>$date_format)),\n ),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $rsp['recent_ledger'] = array();\n if( isset($rc['entries']) ) {\n foreach($rc['entries'] as $entry) {\n if( !isset($balance) ) {\n $balance = $entry['balance'];\n }\n if( $entry['transaction_type'] == 10 ) {\n $entry['amount'] = '$' . number_format($entry['customer_amount'], 2);\n } elseif( $entry['transaction_type'] == 30 ) {\n $entry['amount'] = '-$' . number_format($entry['customer_amount'], 2);\n } elseif( $entry['transaction_type'] == 60 ) {\n $entry['amount'] = '$' . number_format($entry['customer_amount'], 2);\n }\n $entry['balance_text'] = ($entry['balance'] < 0 ? '-':'') . '$' . number_format(abs($entry['balance']), 2);\n// array_unshift($rsp['recent_ledger'], $entry);\n }\n if( isset($balance) ) {\n $rsp['customer_details'][] = array('detail'=>array(\n 'label'=>'Account',\n 'value'=>($balance < 0 ? '-' : '') . '$' . number_format(abs($balance), 2),\n ));\n // if( $balance < 0 && $balance != $rsp['order']['balance_amount'] ) {\n // $rsp['order']['default_payment_amount'] = abs($balance);\n // }\n // if( $balance < 0 ) {\n // $rsp['checkout_account'] = array(\n // array('label'=>'Account Balance Owing', 'status'=>'red', 'value'=>'$' . number_format(abs($balance), 2)),\n // );\n // }\n }\n }\n }\n\n //\n // Get the orders\n //\n if( isset($args['sections']) && in_array('orders', $args['sections']) ) {\n $strsql = \"SELECT orders.id, \"\n . \"orders.customer_id, \"\n . \"orders.order_number, \"\n . \"orders.order_date, \"\n . \"orders.status, \"\n . \"orders.status AS status_text, \"\n . \"orders.payment_status, \"\n . \"orders.payment_status AS payment_status_text, \"\n . \"orders.billing_name, \"\n . \"orders.total_amount \"\n . \"FROM ciniki_poma_orders AS orders \"\n . \"WHERE orders.customer_id = '\" . ciniki_core_dbQuote($ciniki, $args['customer_id']) . \"' \"\n . \"AND orders.tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"ORDER BY orders.order_date DESC \"\n . \"\";\n $rc = ciniki_core_dbHashQueryArrayTree($ciniki, $strsql, 'ciniki.poma', array(\n array('container'=>'orders', 'fname'=>'id', 'fields'=>array('id', 'customer_id', 'order_number', 'order_date', \n 'status', 'status_text', 'payment_status', 'payment_status_text', 'billing_name', 'total_amount'),\n 'utctotz'=>array('order_date'=>array('timezone'=>'UTC', 'format'=>$date_format)),\n 'maps'=>array('status_text'=>$maps['order']['status'],\n 'payment_status_text'=>$maps['order']['payment_status']),\n ),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['orders']) ) {\n $rsp['orders'] = $rc['orders'];\n foreach($rsp['orders'] as $oid => $order) {\n $rsp['orders'][$oid]['total_amount_display'] = '$' . number_format($order['total_amount'], 2);\n }\n }\n }\n\n //\n // Get the records for the account\n //\n if( isset($args['sections']) && in_array('records', $args['sections']) ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'poma', 'private', 'accountRecords');\n $rc = ciniki_poma_accountRecords($ciniki, $args['tnid'], array('customer_id'=>$args['customer_id']));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $rsp['records'] = isset($rc['records']) ? $rc['records'] : array();\n }\n\n //\n // Get the order\n //\n $rsp['order_messages'] = array();\n if( isset($args['order_id']) && $args['order_id'] > 0 ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'poma', 'private', 'orderLoad');\n $rc = ciniki_poma_orderLoad($ciniki, $args['tnid'], $args['order_id']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['order']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.poma.28', 'msg'=>'Unable to find order'));\n }\n $rsp['order'] = $rc['order'];\n// $rsp['order']['default_payment_amount'] = $rc['order']['balance_amount'];\n\n //\n // Build the nplists\n //\n// foreach($rsp['order']['items'] as $item) {\n// $rsp['nplists']['orderitems'][] = $item['id'];\n// }\n //\n // Check if there are any messages for this order\n //\n if( isset($ciniki['tenant']['modules']['ciniki.mail']) ) {\n ciniki_core_loadMethod($ciniki, 'ciniki', 'mail', 'hooks', 'objectMessages');\n $rc = ciniki_mail_hooks_objectMessages($ciniki, $args['tnid'], array('object'=>'ciniki.poma.order', 'object_id'=>$args['order_id']));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $rsp['order_messages'] = isset($rc['messages']) ? $rc['messages'] : array();\n } \n }\n\n return $rsp;\n}", "public function getOrCreateCustomer();", "public function getAccount();", "protected function gigyaCreateUser($resultRedirect, $gigya_user_account) {\n try {\n // $address = $this->extractAddress();\n // $addresses = $address === null ? [] : [$address];\n\n $customer = $this->customerExtractor->extract('customer_account_create', $this->_request);\n\n $this->gigyaSetCustomerFields($customer, $gigya_user_account);\n\n /// $password = $this->getRequest()->getParam('password');\n // $confirmation = $this->getRequest()->getParam('password_confirmation');\n $password = $this->_objectManager->create('Gigya\\GigyaM2\\Helper\\Data')->generatePassword();\n $redirectUrl = $this->session->getBeforeAuthUrl();\n // $this->checkPasswordConfirmation($password, $confirmation);\n\n $customer = $this->accountManagement\n ->createAccount($customer, $password, $redirectUrl);\n\n if ($this->getRequest()->getParam('is_subscribed', false)) {\n $this->subscriberFactory->create()->subscribeCustomerById($customer->getId());\n }\n\n $this->_eventManager->dispatch(\n 'customer_register_success',\n ['account_controller' => $this, 'customer' => $customer]\n );\n\n $confirmationStatus = $this->accountManagement->getConfirmationStatus($customer->getId());\n if ($confirmationStatus === AccountManagementInterface::ACCOUNT_CONFIRMATION_REQUIRED) {\n $email = $this->customerUrl->getEmailConfirmationUrl($customer->getEmail());\n // @codingStandardsIgnoreStart\n $this->messageManager->addSuccess(\n __(\n 'You must confirm your account. Please check your email for the confirmation link or <a href=\"%1\">click here</a> for a new link.',\n $email\n )\n );\n // @codingStandardsIgnoreEnd\n $url = $this->urlModel->getUrl('*/*/index', ['_secure' => true]);\n $resultRedirect->setUrl($this->_redirect->success($url));\n } else {\n $this->session->setCustomerDataAsLoggedIn($customer);\n $this->messageManager->addSuccess($this->getSuccessMessage());\n $resultRedirect = $this->accountRedirect->getRedirect();\n }\n return $resultRedirect;\n } catch (StateException $e) {\n $url = $this->urlModel->getUrl('customer/account/forgotpassword');\n // @codingStandardsIgnoreStart\n $message = __(\n 'There is already an account with this email address. If you are sure that it is your email address, <a href=\"%1\">click here</a> to get your password and access your account.',\n $url\n );\n // @codingStandardsIgnoreEnd\n $this->messageManager->addError($message);\n } catch (InputException $e) {\n $this->messageManager->addError($this->escaper->escapeHtml($e->getMessage()));\n foreach ($e->getErrors() as $error) {\n $this->messageManager->addError($this->escaper->escapeHtml($error->getMessage()));\n }\n } catch (\\Exception $e) {\n $this->messageManager->addException($e, __('We can\\'t save the customer.'));\n }\n\n $this->session->setCustomerFormData($this->getRequest()->getPostValue());\n $defaultUrl = $this->urlModel->getUrl('*/*/create', ['_secure' => true]);\n $resultRedirect->setUrl($this->_redirect->error($defaultUrl));\n return $resultRedirect;\n }", "function user_make_account($first_name, $last_name, $email){\n\t\t$queryText = 'INSERT INTO user_accounts (first_name, last_name, email) VALUES (:first_name, :last_name, :email)';\n\t\t\n\t\t$query = $this->connection->prepare($queryText);\n\t\t$query->execute(array(':first_name'=>$first_name, ':last_name'=>$last_name, ':email'=>$email));\n\t\t\n\t\treturn array(\"uid\"=>strval($this->connection->lastInsertId()));\n\t}", "public function getUser(): AccountInterface;", "protected function createStripeCustomer()\n {\n return BaseCustomer::create([\n 'email' => $this->user->email\n ]);\n }", "private function _serializeCustomer($record)\n {\n $customer = new Customer();\n $customer->CustomerID = $record['CustomerID'];\n $customer->CompanyName = $record['CompanyName'];\n $customer->ContactName = $record['ContactName'];\n $customer->ContactTitle = $record['ContactTitle'];\n $customer->Phone = $record['Phone'];\n $customer->Fax = $record['Fax']; \n $customer->Address = new Address();\n $customer->Address->StreetName = ($record['Address']);\n $customer->Address->City = $record['City'];\n $customer->Address->Region = $record['Region'];\n $customer->Address->PostalCode = $record['PostalCode'];\n $customer->Address->Country = $record['Country'];\n //Set alternate address\n $customer->Address->AltAddress = new Address();\n $customer->Address->AltAddress->StreetName = 'ALT_' . $customer->Address->StreetName;\n $customer->Address->AltAddress->City = 'ALT_' . $customer->Address->City;\n $customer->Address->AltAddress->Region = 'ALT_' . $customer->Address->Region;\n $customer->Address->AltAddress->PostalCode = 'ALT_' . $customer->Address->PostalCode;\n $customer->Address->AltAddress->Country = 'ALT_' . $customer->Address->Country;\n $customer->EmailAddresses = array();\n for ($i = 1; $i < 4; $i++) {\n $customer->EmailAddresses[] = $customer->CustomerID . $i . '@live.com'; \n }\n\n $customer->OtherAddresses = array();\n for ($i = 0; $i < 2; $i++) {\n $customer->OtherAddresses[$i] = new Address();\n $this->_copyAddress($customer->Address, $customer->OtherAddresses[$i], $i + 1);\n }\n\t\t\n return $customer;\n }", "protected function _addCustomer($object) {\n\t\t$format = Mage::getStoreConfig('tax/avatax/cust_code_format', $object->getStoreId());\n\t\t$customer = Mage::getModel('customer/customer');\n\t\t$customerCode = '';\n\t\t\n\t\tif($object->getCustomerId()) {\n\t\t\t$customer->load($object->getCustomerId());\n\t\t\t$taxClass = Mage::getModel('tax/class')->load($customer->getTaxClassId())->getOpAvataxCode();\n \t$this->_request->setCustomerUsageType($taxClass);\n\t\t}\n\t\t\n\t\tswitch($format) {\n\t\t\tcase OnePica_AvaTax_Model_Source_Customercodeformat::LEGACY:\n\t\t\t\tif($customer->getId()) {\n\t\t\t\t\t$customerCode = $customer->getName() . ' (' . $customer->getId() . ')';\n\t\t\t\t} else {\n $address = $object->getBillingAddress() ? $object->getBillingAddress() : $object;\n\t\t\t\t\t$customerCode = $address->getFirstname() . ' ' . $address->getLastname() . ' (Guest)';\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase OnePica_AvaTax_Model_Source_Customercodeformat::CUST_EMAIL:\n\t\t\t\t$customerCode = $object->getCustomerEmail() ? $object->getCustomerEmail() : $customer->getEmail();\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t// New code by David Dzimianski - CSH 2013\n\t\t\tcase OnePica_AvaTax_Model_Source_Customercodeformat::CUST_MAS_ID:\n\t\t\t\t$customerCode = $object->getData('mas_id') ? '00' . $object->getData('mas_id') : '00' . $customer->getData('mas_id');\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase OnePica_AvaTax_Model_Source_Customercodeformat::CUST_ID:\n\t\t\tdefault:\n\t\t\t\t$customerCode = $object->getCustomerId() ? $object->getCustomerId() : 'guest-'.$object->getId();\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\t$this->_request->setCustomerCode($customerCode);\n\t}", "public function createFromRemote() {\n $edit = array(\n 'mail' => $this->email,\n 'name' => $this->email,\n 'pass' => $this->password,\n 'status' => 1,\n 'created' => REQUEST_TIME,\n );\n\n $dob = new DateObject($this->remote_account->DOB);\n $fields = array(\n 'birthdate' => $dob->format(DATE_FORMAT_DATE),\n 'first_name' => $this->remote_account->Name,\n 'country' => variable_get('dosomething_user_address_country'),\n 'user_registration_source' => DOSOMETHING_CANADA_USER_SOURCE,\n );\n dosomething_user_set_fields($edit, $fields);\n\n try {\n $account = user_save('', $edit);\n }\n catch (Exception $e) {\n watchdog_exception(DOSOMETHING_CANADA_WATCHDOG, $e);\n return FALSE;\n }\n\n $this->local_account = $account;\n return $this->local_account;\n }", "private function createCustomer()\n {\n try {\n $createCustomer = \\Stripe\\Customer::create([\n \"description\" => \"Customer for\" . Auth::user()->email,\n \"email\" => Auth::user()->email\n ]);\n RecruiterProfile::updateCustomerId($createCustomer['id']);\n $this->response['success'] = true;\n $this->response['data'] = $createCustomer;\n $this->response['message'] = trans('messages.customer_created');\n } catch (\\Exception $e) {\n Log::error($e->getMessage());\n $this->response['success'] = false;\n $this->response['message'] = $e->getMessage();\n }\n return $this->response;\n }", "public function customer()\n {\n return $this->morphTo(__FUNCTION__, 'customer_type', 'customer_uuid')->withoutGlobalScopes();\n }", "function createCustomerProfile($email)\n{\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName(MERCHANT_LOGIN_ID);\n $merchantAuthentication->setTransactionKey(TRANSACTION_KEY);\n\n // Set the transaction's refId\n $refId = 'ref' . time();\n\n // Create a Customer Profile Request\n // 1. (Optionally) create a Payment Profile\n // 2. (Optionally) create a Shipping Profile\n // 3. Create a Customer Profile (or specify an existing profile)\n // 4. Submit a CreateCustomerProfile Request\n // 5. Validate Profile ID returned\n\n\n // Create the payment object for a payment nonce\n $opaqueData = new AnetAPI\\OpaqueDataType();\n $opaqueData->setDataDescriptor($_POST['descriptor']);\n $opaqueData->setDataValue($_POST['value']);\n $paymentOpaque = new AnetAPI\\PaymentType();\n $paymentOpaque->setOpaqueData($opaqueData);\n\n\n // Create the Bill To info for new payment type\n $billTo = new AnetAPI\\CustomerAddressType();\n $billTo->setFirstName($_POST['firstName']);\n $billTo->setLastName($_POST['lastName']);\n $billTo->setCompany($_POST['company']);\n $billTo->setAddress($_POST['address']);\n $billTo->setCity($_POST['city']);\n $billTo->setState($_POST['state']);\n $billTo->setZip($_POST['zip']);\n $billTo->setCountry($_POST['country']);\n $billTo->setPhoneNumber($_POST['phone']);\n\n\n // Create a new CustomerPaymentProfile object\n $paymentProfile = new AnetAPI\\CustomerPaymentProfileType();\n $paymentProfile->setCustomerType('individual');\n $paymentProfile->setBillTo($billTo);\n $paymentProfile->setPayment($paymentOpaque);\n $paymentProfile->setDefaultpaymentProfile(true);\n $paymentProfiles[] = $paymentProfile;\n\n\n // Create a new CustomerProfileType and add the payment profile object\n $customerProfile = new AnetAPI\\CustomerProfileType();\n $customerProfile->setDescription(\"Customer 2 Test PHP\");\n $customerProfile->setEmail($email);\n $customerProfile->setpaymentProfiles($paymentProfiles);\n\n\n // Assemble the complete transaction request\n $request = new AnetAPI\\CreateCustomerProfileRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setProfile($customerProfile);\n\n // Create the controller and get the response\n $controller = new AnetController\\CreateCustomerProfileController($request);\n $response = $controller->executeWithApiResponse(\\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\"))\n {\n echo \"Succesfully created customer profile : \" . $response->getCustomerProfileId() . \"<br>\";\n $paymentProfiles = $response->getCustomerPaymentProfileIdList();\n echo \"SUCCESS:<br>PAYMENT PROFILE ID : \" . $paymentProfiles[0] . \"<br>\";\n echo \"<br>Validating payment:<br>\";\n validateCustomerPaymentProfile($response->getCustomerProfileId(),$paymentProfiles[0]);\n }\n else\n {\n echo \"ERROR : Invalid response<br>\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"<br>\";\n }\n return $response;\n}", "protected function create()\n {\n return $this->proxyStripeExceptions(function () {\n return Customer::create([\n 'email' => $this->user->email,\n 'metadata' => [\n 'first_name' => $this->user->first_name,\n 'last_name' => $this->user->last_name,\n ],\n ]);\n });\n }", "protected function createUserAccount() {\n\t\treturn new UserAccount();\n\t}", "function get_guest() {\n return get_complete_user_data('username', 'guest');\n}", "function getCustomeruuid()\n {\n return $this->customer_uuid;\n }", "public function getCustomerId();", "public function getCustomerId();", "public function getCustomerId();", "public function convert()\n {\n if (isset($this->mapped[$this->index][$this->value])) {\n $account = Auth::user()->accounts()->find($this->mapped[$this->index][$this->value]);\n\n return $account;\n } else {\n if (strlen($this->value) > 0) {\n $account = $this->findAccount();\n if (!is_null($account)) {\n return $account;\n }\n }\n\n return $this->value;\n }\n }", "public function customerProvider()\n {\n $existing = (new CustomerBuilder())\n ->withFirstName('Henry')\n ->withLastName('GanttSr')\n ->withEmailAddress(uniqid('dues').'@teamgantt.com')\n ->withPaymentMethod(new Nonce('fake-valid-nonce'))\n ->build();\n\n $new = (new CustomerBuilder())\n ->withFirstName('Henry')\n ->withLastName('GanttJr')\n ->withEmailAddress(uniqid('dues').'@teamgantt.com')\n ->withPaymentMethod(new Nonce('fake-valid-nonce'))\n ->build();\n\n return [\n 'existing customer' => [fn ($dues) => $dues->createCustomer($existing)],\n 'new customer' => [fn () => $new],\n ];\n }", "protected function createCustomerProfile($_customer, $payment=null) {\r\n\t\tif( $this->_debug ) Mage::log('createCustomerProfile()', null, 'authnetcim.log');\r\n\t\t\r\n\t\ttry {\r\n\t\t\t$email \t= $_customer->getEmail();\r\n\t\t\t$uid \t= $_customer->getEntityId();\r\n\r\n\t\t\t/**\r\n\t\t\t * If not logged in, we must be checking out as a guest--try to grab their info.\r\n\t\t\t */\r\n\t\t\tif( empty($email) || $uid < 2 ) {\r\n\t\t\t\t$sess = Mage::getSingleton('core/session')->getData();\r\n\r\n\t\t\t\tif( $payment != null && $payment->getQuote() != null ) {\r\n\t\t\t\t\t$email \t= $payment->getQuote()->getCustomerEmail();\r\n\t\t\t\t\t$uid \t= is_numeric($payment->getQuote()->getCustomerId()) ? $payment->getQuote()->getCustomerId() : 0;\r\n\t\t\t\t}\r\n\t\t\t\telseif( $payment != null && $payment->getOrder() != null ) {\r\n\t\t\t\t\t$email \t= $payment->getOrder()->getCustomerEmail();\r\n\t\t\t\t\t$uid \t= is_numeric($payment->getOrder()->getCustomerId()) ? $payment->getOrder()->getCustomerId() : 0;\r\n\t\t\t\t}\r\n\t\t\t\telseif( isset($sess['visitor_data']) && !empty($sess['visitor_data']['quote_id']) ) {\r\n\t\t\t\t\t$quote \t= Mage::getModel('sales/quote')->load( $sess['visitor_data']['quote_id'] );\r\n\r\n\t\t\t\t\t$email \t= $quote->getCustomerEmail();\r\n\t\t\t\t\t$uid \t= is_numeric($quote->getCustomerId()) ? $quote->getCustomerId() : 0;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$_customer->setEmail( $email );\r\n\t\t\t\t$_customer->setEntityId( $uid );\r\n\t\t\t}\r\n\r\n\t\t\t/**\r\n\t\t\t * Failsafe: We must have some email to go through here. The data might not\r\n\t\t\t * actually be available.\r\n\t\t\t */\r\n\t\t\tif( empty($email) ) {\r\n\t\t\t\tMage::log(\"No customer email found; can't create a CIM profile.\", null, 'authnetcim.log');\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\t$this->cim->setParameter( 'email', $email );\r\n\t\t\t$this->cim->setParameter( 'merchantCustomerId', $uid );\r\n\t\t\t$this->cim->createCustomerProfile();\r\n\t\t\t\r\n\t\t\t$profile_id = $this->cim->getProfileID();\r\n\t\t\t\r\n\t\t\t$this->checkCimErrors();\r\n\r\n\t\t\t/**\r\n\t\t\t * Handle 'duplicate' errors\r\n\t\t\t */\r\n\t\t\tif( strpos($this->cim->getResponse(), 'duplicate') !== false ) {\r\n\t\t\t\t$profile_id = preg_replace( '/[^0-9]/', '', $this->cim->getResponse() );\r\n\t\t\t}\r\n\t\t\t\r\n\r\n\t\t\t$_customer->setAuthnetcimProfileId( $profile_id );\r\n\t\t\tif( $_customer->getData('entity_id') > 0 ) {\r\n\t\t\t\t$_customer->save();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn $profile_id;\r\n\t\t}\r\n\t\tcatch (AuthnetCIMException $e) {\r\n\t\t\tMage::log( $e->getMessage(), null, 'authnetcim.log', true );\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function customer()\n {\n return $this->belongsTo('App\\Guest');\n }", "public function getCustomerName();", "public function getCustomerAccountDetails($data) {\n\t\t// provide the EziDebit API endpoint\n\t\t$soapclient = new SoapClient($this->pci);\n\n\t\t$params = [\n\t\t\t\t'DigitalKey' => $this->digitalKey,\n\t\t\t\t'EziDebitCustomerID' => $data['eziDebitCID'],\n\t\t\t\t'YourSystemReference' => $data['systemRef']\n\t\t];\n\n\t\treturn $response = $soapclient->getCustomerAccountDetails($params);\n\t}", "function eralha_crowdfunding_account(){\n\t\t\t\n\t\t}", "public function getCustomerEmail();", "public function getCustomerEmail();", "public function getCustomerEmail();", "public function customerCreate(): Customer\n {\n $cst = new Customer();\n $cst->setfirstName($_POST['firstName']);\n $cst->setlastName($_POST['lasttName']);\n $cst->setEmail($_POST['email']);\n $cst->setuserName($_POST['userName']);\n $cst->setAddress($_POST['address']);\n $cst->setzipCode($_POST['zip']);\n $cst->setcity($_POST['city']);\n $cst->setPhoneNumber($_POST['phoneNumber']);\n if (isset($_POST['password'])) {\n $pass = password_hash($_POST['password'], PASSWORD_DEFAULT);\n $cst->setPassword($pass);\n }\n return $cst;\n }", "public function setCustomerIsGuest($customerIsGuest);", "public function getSubAccountId(): string;", "protected function setCustomerFromAccountOrUser(): self\n {\n return $this->setCustomer($this->getCustomerFromAccountOrUser());\n }", "public function createCustomer($data = array()){\n\n $email = $data['account']['email'];\n\n /** @var $customer Mage_Customer_Model_Customer */\n $customer = Mage::getModel('customer/customer');\n\n // load user if exist\n $customer->setWebsiteId(Mage::app()->getStore()->getWebsiteId());\n $customer->loadByEmail($email);\n\n $isNew = true;\n if($customer->getId() > 0){\n $isNew = false;\n }\n\n if($isNew){\n $customer->setData($data['account']);\n }else{\n $customer->setFirstname($data['account']['firstname']);\n $customer->setLastname($data['account']['lastname']);\n }\n\n foreach (array_keys($data['address']) as $index) {\n $address = Mage::getModel('customer/address');\n\n $addressData = array_merge($data['account'], $data['address'][$index]);\n\n // Set default billing and shipping flags to address\n // TODO check if current shipping info is the same than current default one, and avoid create a new one.\n $isDefaultBilling = isset($data['account']['default_billing'])\n && $data['account']['default_billing'] == $index;\n $address->setIsDefaultBilling($isDefaultBilling);\n $isDefaultShipping = isset($data['account']['default_shipping'])\n && $data['account']['default_shipping'] == $index;\n $address->setIsDefaultShipping($isDefaultShipping);\n\n $address->addData($addressData);\n\n // Set post_index for detect default billing and shipping addresses\n $address->setPostIndex($index);\n\n $customer->addAddress($address);\n }\n\n // Default billing and shipping\n if (isset($data['account']['default_billing'])) {\n $customer->setData('default_billing', $data['account']['default_billing']);\n }\n if (isset($data['account']['default_shipping'])) {\n $customer->setData('default_shipping', $data['account']['default_shipping']);\n }\n if (isset($data['account']['confirmation'])) {\n $customer->setData('confirmation', $data['account']['confirmation']);\n }\n\n if (isset($data['account']['sendemail_store_id'])) {\n $customer->setSendemailStoreId($data['account']['sendemail_store_id']);\n }\n\n if($isNew){\n doLog('creating user');\n $customer\n ->setPassword($data['account']['password'])\n ->setForceConfirmed(true)\n ->save();\n $customer->cleanAllAddresses();\n }else{\n doLog('updating user');\n $customer->save();\n\t $customer->setConfirmation(null);\n\t $customer->save();\n }\n\n return $customer;\n }", "public function createCreditCardProfile(int $authNetCustId, CreditCardInterface $creditCard);", "public function customer_create($data){\t\t\t\t\t\t\t\t\n\t\t$params = array(\n\t\t\t'name' => $data['name'],\n\t\t\t'email' => $data['email'],\n\t\t\t'externalId' => $data['externalId']\n\t\t);\t\t\n\t\ttry {\n\t\t\t$flow = $this->send('customer/create', $params, 'POST');\t\n\t\t\t$response = array(\n\t\t\t\t'customerId' => $flow['customerId'], // (string) | Identificador del cliente\n\t\t\t\t'created' => $flow['created'], // (string) | <yyyy-mm-dd hh:mm:ss> | La fecha de creación\n\t\t\t\t'email' => $flow['email'], // (string) | email del cliente\n\t\t\t\t'name' => $flow['name'], // (string) | nombre del cliente\n\t\t\t\t'pay_mode' => $flow['pay_mode'], // (string) | \"auto\" (cargo automático) || \"manual\" (cobro manual)\n\t\t\t\t'creditCardType' => $flow['creditCardType'], // (string) | La marca de la tarjeta de crédito registrada\n\t\t\t\t'last4CardDigits' => $flow['last4CardDigits'], // (string) | Los últimos 4 dígitos de la tarjeta de crédito registrada\n\t\t\t\t'externalId' => $flow['externalId'], // (string) | El identificador del cliente en su negocio\n\t\t\t\t'status' => $flow['status'], // (string) | \"0\" (eliminado) || \"1\" (activo)\n\t\t\t\t'registerDate' => $flow['registerDate'], // (string) | <yyyy-mm-dd hh:mm:ss> | La fecha en que el cliente registro su tarjeta de crédito.\n\t\t\t);\t\t\t\n\t\t\treturn $response;\n\t\t} catch (Exception $e) { return $e->getCode().\" - \".$e->getMessage(); }\n\t}", "public function getCustomerIdentity()\n {\n return $this->customerIdentity;\n }", "private function _populateDealerAccount()\n {\n return $this->dealer_account->create(\n $this->dealerAccountData['name'], \n $this->dealerAccountData['branch_ID'],\n $this->dealerAccountData['promotor_ID']\n ); \n }", "public function toUser($data){\n\t\t\t$this->email=$data['email'];\n\t\t\t$this->password=$data['password'];\n\t\t\t$this->nombre=$data['nombre'];\n\t\t\t$this->apellido=$data['apellido'];\n\t\t}", "public function update_customer_profile($host_obj, $customer, $data)\n\t\t{\n\t\t\t/* This method is never called in the transparent redirect scenario */\n\t\t}", "public function registers(FrontUserRequest $request)\n {\n\n $user = User::create($request->except('password') + ['type' => 'customer']);\n $user['password'] = bcrypt($request->password);\n Auth::login($user, true);\n\n\n return redirect('/');\n\n\n }", "protected function updateCustomerGuestId()\n {\n if (isset($this->context->cookie->kb_push_guest_id)) {\n $id_guest = $this->context->cookie->kb_push_guest_id;\n $updated_id_guest = $this->context->cookie->id_guest;\n $guestSubscriber = KbPushSubscribers::getPushSubscriber($id_guest);\n if (!empty($guestSubscriber)) {\n $kbsubscriber = new KbPushSubscribers($guestSubscriber['id_subscriber']);\n if (!empty($kbsubscriber->id_subscriber)) {\n if (!empty($updated_id_guest) && $updated_id_guest != 0) {\n $kbsubscriber->id_guest = $updated_id_guest;\n if ($kbsubscriber->update()) {\n DB::getInstance()->execute('UPDATE '._DB_PREFIX_.'kb_web_push_product_subscriber_mapping set id_guest='.(int)$updated_id_guest.' WHERE id_guest='.(int)$id_guest);\n }\n }\n unset($this->context->cookie->kb_push_guest_id);\n }\n }\n }\n \n return true;\n }", "abstract public function createContract(): ProviderCustomer;", "function cs_wc_save_extra_register_fields( $customer_id ) {\r\n if ( isset( $_POST['billing_first_name'] ) ) {\r\n // WordPress default first name field.\r\n update_user_meta( $customer_id, 'first_name', sanitize_text_field( $_POST['billing_first_name'] ) );\r\n // WooCommerce billing first name.\r\n update_user_meta( $customer_id, 'billing_first_name', sanitize_text_field( $_POST['billing_first_name'] ) );\r\n }\r\n if ( isset( $_POST['billing_last_name'] ) ) {\r\n // WordPress default last name field.\r\n update_user_meta( $customer_id, 'last_name', sanitize_text_field( $_POST['billing_last_name'] ) );\r\n // WooCommerce billing last name.\r\n update_user_meta( $customer_id, 'billing_last_name', sanitize_text_field( $_POST['billing_last_name'] ) );\r\n }\r\n}", "public function Create_Account($p_CompanyName, $p_UserName, $p_Password, $p_Email){\n $acc_info=new Account_Info();\n $acc_info->AccountId = $this->GetGUID();//GUID Creation\n $acc_info->CompanyName = $p_CompanyName;\n $acc_info->Status = AccountStatus::Trail;//Enum Data Type Creation\n print_r($acc_info->Status);\n $acc_info->AccountType = AccountType::Starter;//Enum Data Type Creation\n $acc_info->ExpiryDate = date('Y-m-d', strtotime('+15 days'));\n \t $acc_info->CreatedDate = date('Y-m-d');\n \t $acc_info->Email = $p_Email;\n $acc_info->Insert();\n \t $usr_info = new User_Info();\n $usr_info->UserId = $this->GetGUID();\n \t $usr_info->AccountId =\"$acc_info->AccountId\";\n $usr_info->Email = $p_Email;\n \t $usr_info->UserName =$p_UserName;\n \t $usr_info->Password = $p_Password; \n \t $usr_info->Role = UserRole::Admin;//Enum Data Type Creation\n $usr_info->Insert();\n }", "public function saveCustomer($user)\n {\n return Stripe\\Customer::create(array(\n 'description' => $user->id.\" \".$user->first_name.' '.$user->last_name,\n 'email' => $user->email\n ));\n }", "public function customerProfile()\n {\n $profile = User::where('id', \\Auth::user()->id)->with('customer')->firstOrFail();\n // return $profile;\n return view('customer.customer_profile')->withProfile($profile);\n }", "public function convert() {\n $this->user->convert();\n }", "public static function isGuestCustomer()\n {\n return self::getProfile() ? self::getProfile()->getAnonymous() : true;\n }", "public function customer()\n {\n return Customer::retrieve($this->customer);\n }", "function web_customer_data($data){\n try{\n $exist = Braintree_Customer::find($data['username']);\n \n $customer = new stdClass;\n $customer->customer = $exist->paymentMethods;\n return $customer;\n } catch(Braintree_Exception_NotFound $e){\n if($e){\n $result = Braintree_Customer::create([\n 'id' => $data['username'],\n 'firstName' => $data['firstname'],\n 'lastName' => $data['lastname'],\n 'company' => $data['company'],\n 'email' => $data['email'],\n 'phone' => $data['phone'],\n 'paymentMethodNonce' => $data['paymentMethodNonce']\n //,\n // 'billing' => [\n // 'countryCodeAlpha2' => $data->country\n // ]\n ]);\n\n if ($result->success) {\n // echo($result->customer->id);\n // echo($result->customer->paymentMethods[0]->token);\n // $subscription = [\n // \"paymentMethodToken\" => $result->customer->paymentMethods[0]->token,\n // \"planId\" => $data->planId\n // ];\n // $subscription = (object)$subscription;\n // $this->create_subscription($subscription);\n return $result;\n\n } else {\n $error = \"\";\n foreach($result->errors->deepAll() AS $error) {\n $error .= $error->code . \": \" . $error->message . \"\\n\";\n //echo($error->code . \": \" . $error->message . \"\\n\");\n }\n return $error;\n }\n } \n }\n }", "public function getLoggedInUserAccount() {\n\t\tLoggerRegistry::debug('CustomerModule::getLoggedInUserAccount()');\n\t\t$account = null;\n\t\t$email = $this->getEngine()->getUserManager()->getLoggedInUserEmail();\n\t\tif (!is_null($email)) {\n\t\t\t$account = $this->getRepository('Account')->findOneBy(array( 'email' => '[email protected]' ));\n\t\t\tif (is_null($account)) {\n\t\t\t\t$account = new Account();\n\t\t\t\t$account->setEmail($email);\n\t\t\t\t$this->getEngine()->doctrine()->getEntityManager()->persist($account);\n\t\t\t}\n\t\t}\n\t\treturn $account;\n\t}", "private function GenerateBankAccount()\r\n\t{\r\n\t\t/* Existing bank account */\r\n\t\t$bank_account = \"\";\r\n\t\t\r\n\t\t// Generate bank account \r\n\t\t// while he will be unique in DB\r\n\t\tdo\r\n\t\t{\r\n\t\t\t$bank_account = $this->BankAccountGenerator();\r\n\t\t}\r\n\t\twhile ($this->CheckBankAccountInDB($bank_account) == 0);\r\n\t\t\r\n\t\treturn $bank_account;\r\n\t}", "public function getExtCustomerId();", "public function createCustodyAccount($user_email, $user_name, $token_symbol, $token_count, $jwt_token) {\n $body = [ \n 'data' => [ \n 'type' => 'account', \n 'attributes' => [\n 'account-type' => 'custodial',\n 'name' => $user_name,\n 'authorized-signature' => $user_name,\n 'token_symbol' => $token_symbol,\n 'token_count' => $token_count,\n 'owner' => [\n 'contact-type' => 'natural_person',\n 'name' => 'John Doe',\n 'email' => $user_email,\n 'date-of-birth' => '1980-06-09',\n 'sex' => 'male',\n 'tax-id-number' => '123123123',\n 'tax-country' => 'US',\n 'primary-phone-number' => [\n 'country' => 'US',\n 'number' => '7026912020',\n 'sms' => true,\n ],\n 'primary-address' => [\n 'street-1' => '330 S. Rampart',\n 'street-2' => 'Apt 260',\n 'postal-code' => '89145',\n 'city' => 'Las Vegas',\n 'region' => 'NV',\n 'country' => 'US',\n ]\n ]\n ]\n ]\n ];\n\n $res = $this->doRequest($this->base_URL.'v2/accounts', 'post', [ 'body' => json_encode($body) ], $jwt_token, 'Bearer');\n\n return $this->extractData($res, true);\n }", "function wooc_save_extra_register_fields( $customer_id ) {\n if ( isset( $_POST['billing_first_name'] ) ) {\n // WordPress default first name field.\n update_user_meta( $customer_id, 'first_name', sanitize_text_field( $_POST['billing_first_name'] ) );\n // WooCommerce billing first name.\n update_user_meta( $customer_id, 'billing_first_name', sanitize_text_field( $_POST['billing_first_name'] ) );\n }\n if ( isset( $_POST['billing_last_name'] ) ) {\n // WordPress default last name field.\n update_user_meta( $customer_id, 'last_name', sanitize_text_field( $_POST['billing_last_name'] ) );\n // WooCommerce billing last name.\n update_user_meta( $customer_id, 'billing_last_name', sanitize_text_field( $_POST['billing_last_name'] ) );\n }\n}", "public function createSubscriptionCustomer($name,$address,$email,$payment_method)\n {\n $customer = \\Stripe\\Customer::create([\n 'name' => $name,\n 'address' => $address,\n 'email' => $email,\n 'payment_method' => $payment_method,\n 'invoice_settings' => [\n 'default_payment_method' => $payment_method,\n ],\n ]);\n\n // Update stripe customer id in users table\n $user = Auth::user();\n $user->stripe_id = $customer->id;\n $user->save();\n\n return $customer;\n }", "public function newCustomerAccount($customerId) {\n return new SlCustomerAccount([\n 'sl_customer_id' => $customerId,\n 'debt_amount' => 0,\n 'flag_delete' => false\n ]);\n }", "protected function getCustomerFromAccountOrUser(): ?CustomerContract\n {\n $customer = $this->account->getProfessional()->getCustomer();\n\n // If not found => from user\n if (!$customer && $this->user):\n return $this->user->toCustomer();\n endif;\n\n return $customer;\n }", "private static function redactCustomerUserAccess(CustomerUserAccess $customerUserAccess)\n {\n if ($customerUserAccess->hasInviterUserEmailAddress()) {\n $customerUserAccess->setInviterUserEmailAddress(self::REDACTED_STRING);\n }\n if ($customerUserAccess->hasEmailAddress()) {\n $customerUserAccess->setEmailAddress(self::REDACTED_STRING);\n }\n return $customerUserAccess;\n }", "public function getCustomer()\n {\n return \\tabs\\api\\core\\Customer::create($this->getCusref());\n }", "function get_customer_data($data){\n try{\n $exist = Braintree_Customer::find($data->username);\n \n $customer = new stdClass;\n $customer->customer = $exist->paymentMethods;\n // Status\n // 1 - created\n // 2 - exist\n $customer->exist = 2;\n return $customer;\n } catch(Braintree_Exception_NotFound $e){\n if($e){\n\n $result = Braintree_Customer::create([\n 'id' => $data->username,\n 'firstName' => $data->firstname,\n 'lastName' => $data->lastname,\n 'company' => $data->company,\n 'email' => $data->email,\n 'phone' => $data->phone,\n 'paymentMethodNonce' => $data->paymentMethodNonce\n // ,\n // 'billing' => [\n // 'countryCodeAlpha2' => $data->country\n // ]\n ]);\n\n if ($result->success) {\n try{\n $address = Braintree_Address::create([\n 'customerId' => $data->username,\n 'countryCodeAlpha2' => $data->country\n ]);\n }catch(Braintree_Exception_NotFound $n){\n \n }\n // 1 - created\n // 2 - exist\n $result->exist = 1;\n\n // echo($result->customer->id);\n // echo($result->customer->paymentMethods[0]->token);\n // $subscription = [\n // \"paymentMethodToken\" => $result->customer->paymentMethods[0]->token,\n // \"planId\" => $data->planId\n // ];\n // $subscription = (object)$subscription;\n // $this->create_subscription($subscription);\n return $result;\n\n } else {\n // $error = \"\";\n foreach($result->errors->deepAll() AS $error) {\n // $error .= $error->code . \": \" . $error->message . \"\\n\";\n echo($error->code . \": \" . $error->message . \"\\n\");\n }\n //return $error;\n }\n } \n }\n }", "public function customer()\n {\n \n // Sustomer is stil step 0\n $this->set_step(0);\n\n\n\n // You are logged in, you dont have access here\n if($this->current_user)\n {\n $this->set_step(1);\n redirect( NC_ROUTE. '/checkout/billing');\n }\n\n\n\n // Check to see if a field is available\n if( $this->input->post('customer') )\n {\n\n $input = $this->input->post();\n switch($input['customer'])\n {\n case 'register':\n $this->session->set_userdata('nitrocart_redirect_to', NC_ROUTE .'/checkout/billing');\n redirect('users/register');\n break;\n case 'guest':\n $this->session->set_userdata('user_id', 0);\n $this->set_step(1);\n redirect( NC_ROUTE. '/checkout/billing');\n break;\n default:\n break;\n }\n //more like an system error!\n $this->session->set_flashdata( JSONStatus::Error , 'Invalid selection');\n redirect( NC_ROUTE . '/checkout');\n }\n\n $this->set_step(0);\n\n $this->template\n ->title(Settings::get('shop_name'), 'Account') \n ->set_breadcrumb('User Account')\n ->build( $this->theme_layout_path . 'customer');\n }", "public function storeCustomerData($obj){\n if($obj){\n Customer::create(array(\n 'name' => $obj-> name,\n 'address' => $obj-> address,\n 'checked' => $obj-> checked,\n 'description' => $obj-> description,\n 'interest' => $obj-> interest,\n 'date_of_birth' => $obj-> date_of_birth,\n 'email' => $obj-> email,\n 'account' => $obj-> account,\n 'credit_card' => $this->storeCreditCard($obj-> credit_card) \n ));\n }\n \n }", "public function testCreateCustomerProfile()\n {\n $options = array('description' => (string)randStr());\n\n $cusProfile = new Mercantile_Gateways_AuthNetCim_CustomerProfile($options);\n\n $response = $this->gateway->createCustomerProfile($cusProfile);\n\n $this->customerProfileId = $response->getCustomerProfileId();\n\n $this->assertTrue($response->isSuccess());\n }", "public function getCustomerEmail(){\n return $this->customer_email;\n }", "function register_wordpress_user($convers8_user, $secret) {\r\n\t$wp_user_id = wp_insert_user(array(\r\n\t\t'user_pass' => md5($convers8_user[\"id\"] . $secret),\r\n\t\t'user_login' => $convers8_user[\"id\"],\r\n\t\t// make sure no illegal characters occur in user_nicename, since it is also in the member's URL\r\n\t\t'user_nicename' => sanitize_title_with_dashes($convers8_user[\"firstName\"] . '-' . $convers8_user[\"lastName\"]),\r\n\t\t'display_name' => $convers8_user[\"firstName\"] . ' ' . $convers8_user[\"lastName\"],\r\n\t\t'nickname' => $convers8_user[\"firstName\"] . ' ' . $convers8_user[\"lastName\"],\r\n\t\t'first_name' => $convers8_user[\"firstName\"],\r\n\t\t'last_name' => $convers8_user[\"lastName\"],\r\n\t\t'user_email' => $convers8_user[\"id\"] . '-' . get_option('convers8_websiteid') . '-' . md5($convers8_user[\"id\"] . $secret) . '@users.convers8.eu'\r\n\t));\t\r\n\r\n\treturn $wp_user_id;\r\n}", "function createCustomerObject($post){\n\t$country = 'Canada';\n\t$customer = new Customer();\n\t$customer->setFirstName($post['firstName']);\n\t$customer->setLastName($post['lastName']);\n\t$customer->setBusinessPhone($post['businessPhone']);\n\t$customer->setHomePhone($post['homePhone']);\n\t$customer->setAddress($post['address2'] . ' - ' . $post['address1']);\n\t$customer->setCity($post['city']);\n\t$customer->setProvince($post['province']);\n\t$customer->setPostal($post['zip']);\n\t$customer->setCountry($country);\n\t$customer->setEmail($post['email']);\n\treturn $customer;\n}", "protected function getFrontendBackendUser() {}", "public function getAccountName()\n {\n return $this->phone;\n }", "function create_customer_card($customer_instance, $customer_id, $nonce) {\n\t\t$card_body = apply_filters('id_square_card_params',\n\t\t\tarray(\n\t\t\t\t'card_nonce' => $nonce,\n\t\t\t)\n\t\t);\n\t\t$card_body = apply_filters('id_square_card_params', $card_body);\n\t\ttry {\n\t\t\t$customer_card = $customer_instance->createCustomerCard($customer_id, $card_body);\n\t\t // $result = $api_instance->createCustomerCard($customer_id, $body);\n\t\t} catch (\\SquareConnect\\ApiException $e) {\n\t\t\t// #devnote fail here\n\t\t\t$message = $e->getMessage().' '.__LINE__;\n\t\t\tprint_r(json_encode(array('response' => __('failure', 'memberdeck'), 'message' => $message)));\n\t\t\texit;\n\t\t}\n\t\treturn $customer_card;\n\t}", "public static function addCustomer() {\n \n // We get appointment information then set up our validator\n $info = Session::get('appointmentInfo');\n $validator = Validator::make(\n array(\n 'first_name' => $info['fname'],\n 'last_name' => $info['lname'],\n 'email' => $info['email']\n ),\n array(\n 'first_name' => 'exists:customers,first_name',\n 'last_name' => 'exists:customers,last_name',\n 'email' => 'exists:customers,email'\n )\n );\n \n // If the validator fails, that means the user does not exist\n // If any of those three variables don't exist, we create a new user\n // This is so that families can use the same e-mail to book, but\n // We stil create a new user for them in the database.\n if ($validator->fails()) {\n // Registering the new user\n return Customer::create(array(\n 'first_name' => $info['fname'],\n 'last_name' => $info['lname'],\n 'contact_number' => $info['number'],\n 'email' => $info['email'],\n 'wants_updates' => Session::get('updates')\n ))->id;\n } else {\n return Customer::where('email', $info['email'])->pluck('id');\n }\n \n }", "public static function getCurrentAccount() {\n $billing_account = FALSE;\n $uid = \\Drupal::currentUser()->id();\n if ($uid > 0) {\n $billing_account = self::getUserAccount($uid);\n }\n return $billing_account;\n }", "function proAccount($ar){\n if (!$this->customerIsPro())\n return;\n $this->wtscallback();\n $this->modcustomer->proMyAccount($ar);\n }", "function ts3client_createIdentity(&$result) {}", "public function billingCustomer()\n {\n $customer = new Customer();\n $this->setBilling($customer);\n\n return $customer;\n }", "public function getCustomerProfile(Customer $customer)\n {\n return response()->json(['status' => 'truw', 'customer' => $customer]);\n }", "function edd_stripe_zip_and_country() {\n\n\t$logged_in = is_user_logged_in();\n\t$customer = EDD()->session->get( 'customer' );\n\t$customer = wp_parse_args( $customer, array( 'address' => array(\n\t\t'line1' => '',\n\t\t'line2' => '',\n\t\t'city' => '',\n\t\t'zip' => '',\n\t\t'state' => '',\n\t\t'country' => ''\n\t) ) );\n\n\t$customer['address'] = array_map( 'sanitize_text_field', $customer['address'] );\n\n\tif( $logged_in ) {\n\t\t$existing_cards = edd_stripe_get_existing_cards( get_current_user_id() );\n\t\tif ( empty( $existing_cards ) ) {\n\n\t\t\t$user_address = edd_get_customer_address( get_current_user() );\n\n\t\t\tforeach( $customer['address'] as $key => $field ) {\n\n\t\t\t\tif ( empty( $field ) && ! empty( $user_address[ $key ] ) ) {\n\t\t\t\t\t$customer['address'][ $key ] = $user_address[ $key ];\n\t\t\t\t} else {\n\t\t\t\t\t$customer['address'][ $key ] = '';\n\t\t\t\t}\n\n\t\t\t}\n\t\t} else {\n\t\t\tforeach ( $existing_cards as $card ) {\n\t\t\t\tif ( false === $card['default'] ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$source = $card['source'];\n\t\t\t\t$customer['address'] = array(\n\t\t\t\t\t'line1' => $source->address_line1,\n\t\t\t\t\t'line2' => $source->address_line2,\n\t\t\t\t\t'city' => $source->address_city,\n\t\t\t\t\t'zip' => $source->address_zip,\n\t\t\t\t\t'state' => $source->address_state,\n\t\t\t\t\t'country' => $source->address_country,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t}\n?>\n\t<fieldset id=\"edd_cc_address\" class=\"cc-address\">\n\t\t<legend><?php _e( 'Billing Details', 'edds' ); ?></legend>\n\t\t<p id=\"edd-card-country-wrap\">\n\t\t\t<label for=\"billing_country\" class=\"edd-label\">\n\t\t\t\t<?php _e( 'Billing Country', 'edds' ); ?>\n\t\t\t\t<?php if( edd_field_is_required( 'billing_country' ) ) { ?>\n\t\t\t\t\t<span class=\"edd-required-indicator\">*</span>\n\t\t\t\t<?php } ?>\n\t\t\t</label>\n\t\t\t<span class=\"edd-description\"><?php _e( 'The country for your billing address.', 'edds' ); ?></span>\n\t\t\t<select name=\"billing_country\" id=\"billing_country\" class=\"billing_country edd-select<?php if( edd_field_is_required( 'billing_country' ) ) { echo ' required'; } ?>\"<?php if( edd_field_is_required( 'billing_country' ) ) { echo ' required '; } ?> autocomplete=\"billing country\">\n\t\t\t\t<?php\n\n\t\t\t\t$selected_country = edd_get_shop_country();\n\n\t\t\t\tif( ! empty( $customer['address']['country'] ) && '*' !== $customer['address']['country'] ) {\n\t\t\t\t\t$selected_country = $customer['address']['country'];\n\t\t\t\t}\n\n\t\t\t\t$countries = edd_get_country_list();\n\t\t\t\tforeach( $countries as $country_code => $country ) {\n\t\t\t\t echo '<option value=\"' . esc_attr( $country_code ) . '\"' . selected( $country_code, $selected_country, false ) . '>' . $country . '</option>';\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</select>\n\t\t</p>\n\t\t<p id=\"edd-card-zip-wrap\">\n\t\t\t<label for=\"card_zip\" class=\"edd-label\">\n\t\t\t\t<?php _e( 'Billing Zip / Postal Code', 'edds' ); ?>\n\t\t\t\t<?php if( edd_field_is_required( 'card_zip' ) ) { ?>\n\t\t\t\t\t<span class=\"edd-required-indicator\">*</span>\n\t\t\t\t<?php } ?>\n\t\t\t</label>\n\t\t\t<span class=\"edd-description\"><?php _e( 'The zip or postal code for your billing address.', 'edds' ); ?></span>\n\t\t\t<input type=\"text\" size=\"4\" name=\"card_zip\" id=\"card_zip\" class=\"card-zip edd-input<?php if( edd_field_is_required( 'card_zip' ) ) { echo ' required'; } ?>\" placeholder=\"<?php _e( 'Zip / Postal Code', 'edds' ); ?>\" value=\"<?php echo $customer['address']['zip']; ?>\"<?php if( edd_field_is_required( 'card_zip' ) ) { echo ' required '; } ?> autocomplete=\"billing postal-code\" />\n\t\t</p>\n\t</fieldset>\n<?php\n}", "public function asPaystackCustomer()\n {\n $this->assertCustomerExists();\n\n Paystack::setApiKey(config('paystacksubscription.secret', env('PAYSTACK_SECRET')));\n\n return PaystackCustomer::fetch($this->paystack_id);\n }", "protected function _involveNewCustomer()\n {\n $customer = $this->getQuote()->getCustomer();\n if ($customer->isConfirmationRequired()) {\n $customer->sendNewAccountEmail('confirmation', '', $this->getQuote()->getStoreId());\n $url = Mage::helper('customer')->getEmailConfirmationUrl($customer->getEmail());\n $this->getCustomerSession()->addSuccess(\n Mage::helper('customer')->__('Account confirmation is required. Please, check your e-mail for confirmation link. To resend confirmation email please <a href=\"%s\">click here</a>.', $url)\n );\n } else {\n $customer->sendNewAccountEmail('registered', '', $this->getQuote()->getStoreId());\n $this->getCustomerSession()->loginById($customer->getId());\n }\n return $this;\n }", "private function createAccount($username, $password, $acctype) {\n\t\t$newPass = password_hash($password, PASSWORD_DEFAULT);\n\t\t$queryInsert = $this->conn->prepare(\"INSERT INTO accounts (username, password, acc_status, acc_type) VALUES (?, ?, 'Active', ?)\");\n\t\t$queryInsert->bindParam(1, $username);\n\t\t$queryInsert->bindParam(2, $newPass);\n\t\t$queryInsert->bindParam(3, $acctype);\n\t\t$queryInsert->execute();\n\t\t$querySearch = $this->conn->prepare(\"SELECT acc_id FROM accounts WHERE username=?\");\n\t\t$querySearch->bindParam(1, $username);\n\t\t$querySearch->execute();\n\t\t$row = $querySearch->fetch();\n\t\t$newUsername = $username.$row['acc_id'];\n\t\t$getaccid = $row['acc_id'];\n\t\t$queryUpdate = $this->conn->prepare(\"UPDATE accounts SET username=? WHERE username=?\");\n\t\t$queryUpdate->bindParam(1, $newUsername);\n\t\t$queryUpdate->bindParam(2, $username);\n\t\t$queryUpdate->execute();\n\t\treturn $getaccid;\n\t}", "public function createTerminalAccount($vprovidername, $serviceID, $url, $login,\n $password, $aid, $currency, $email, $fname,\n $lname, $dayphone, $evephone, $addr1, $addr2,\n $city, $country, $province,\n $zip, $userID, $birthdate, $fax, $occupation,\n $sex, $alias, $casinoID, $ip, $mac, $downloadID,\n $clientID, $putInAffPID, $calledFromCasino,\n $hashedPassword,$agentID,$currentPosition,\n $thirdPartyPID, $capiusername, $capipassword,\n $capiplayername, $capiserverID,$isVIP='',$usermode='')\n {\n //check if this will be created to MG\n switch (true){\n case strstr($vprovidername, \"MG\"):\n $casinoApiHandler = $this->configureMG($serviceID, $url, $capiusername,\n $capipassword, $capiplayername,\n $capiserverID);\n if($usermode == 1){\n $createTerminalResult = array(\"IsSucceed\"=>true); \n }\n else{\n $createTerminalResult = $casinoApiHandler->CreateTerminalAccount($login, $password,\n $aid, $currency, $email, $fname, $lname, $dayphone, $evephone,\n $addr1, $addr2, $city, $country, $province, $zip, $userID,\n $birthdate, $fax, $occupation, $sex, $alias, $casinoID, $ip,\n $mac, $downloadID, $clientID, $putInAffPID, $calledFromCasino,\n $hashedPassword, $agentID, $currentPosition, $thirdPartyPID);\n }\n \n break;\n case strstr($vprovidername, \"RTG\"):\n if($usermode == 1){\n $createTerminalResult = array(\"IsSucceed\"=>true); \n }\n else{\n $isplayerAPI = 1;\n $casinoApiHandler = $this->configureRTG($serviceID, $url, $isplayerAPI,$usermode);\n $createTerminalResult = $casinoApiHandler->CreateTerminalAccount($login, $password,\n $aid, $currency, $email, $fname, $lname, $dayphone, $evephone,\n $addr1, $addr2, $city, $country, $province, $zip, $userID,\n $birthdate, $fax, $occupation, $sex, $alias, $casinoID, $ip,\n $mac, $downloadID, $clientID, $putInAffPID, $calledFromCasino,\n $hashedPassword, $agentID, $currentPosition, $thirdPartyPID);\n }\n \n break;\n case strstr($vprovidername, \"PT\"):\n \n $casinoApiHandler = $this->configurePT($url, $capiusername, $capipassword);\n \n// $createTerminalResult = $casinoApiHandler->CreateTerminalAccount($login, $password,\n// $aid, $currency, $email, $fname, $lname, $dayphone, $evephone,\n// $addr1, $addr2, $city, $country, $province, $zip, $userID,\n// $birthdate, $fax, $occupation, $sex, $alias, $casinoID, $ip,\n// $mac, $downloadID, $clientID, $putInAffPID, $calledFromCasino,\n// $hashedPassword, $agentID, $currentPosition, $thirdPartyPID,$isVIP);\n \n \n //always pass true in order to mapped PT casino in a\n //specific terminal\n $createTerminalResult = array(\"IsSucceed\"=>true); \n break;\n default:\n echo 'Invalid Casino Name.';\n break;\n }\n return $createTerminalResult;\n }", "private static function redactCustomerUserAccessInvitation(\n CustomerUserAccessInvitation $customerUserAccessInvitation\n ) {\n if (!empty($customerUserAccessInvitation->getEmailAddress())) {\n $customerUserAccessInvitation->setEmailAddress(self::REDACTED_STRING);\n }\n return $customerUserAccessInvitation;\n }", "public function insertUserCustomer($fields) {\r\n $this->db->trans_start();\r\n\r\n try {\r\n $fieldsUser = array(\r\n 'name' => $fields['name'],\r\n 'phone' => $fields['phone'],\r\n 'email' => $fields['email'],\r\n 'password' => $fields['password'],\r\n 'address' => $fields['address']\r\n );\r\n $this->db->insert(USERS, $fieldsUser);\r\n\r\n $idUser = $this->db->insert_id();\r\n\r\n $fieldsCustomer = array(\r\n 'id' => $idUser,\r\n 'group' => $fields['group']\r\n );\r\n $this->db->insert(CUSTOMERS, $fieldsCustomer);\r\n\r\n $fieldsCustomerProvider = array(\r\n 'id_customer' => $idUser,\r\n 'id_provider' => $fields['id_provider'],\r\n 'since' => $fields['since']\r\n );\r\n\r\n $this->db->insert(CUSTOMERS_BY_PROVIDER, $fieldsCustomerProvider);\r\n } catch (Exception $exc) {\r\n echo $exc->getTraceAsString();\r\n }\r\n\r\n $this->db->trans_complete();\r\n\r\n return $this->db->trans_status() ? $idUser : false;\r\n }", "public function createCustomer(FortnoxCustomer $customer)\n {\n $responseString = $this->apiCall('POST', 'customers', $customer->__toString());\n try\n {\n $responseObject = $this->parseResponse($responseString);\n return $responseObject->Customer;\n }\n catch(Exception $e)\n {\n echo 'Can`t parse API response: '.$e->getMessage;\n return false;\n }\n }", "function createVirtualAccount($useridnumber, $username, $userid)\n\t{\n\t\t$rel_url = \"virtual_accounts\";\n\t\t$post = array(\n\t\t\t\t\t\t'receivers' => array('types' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'bank_account'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t'description' \t => $username,\n\t\t\t\t\t\t'notes' \t\t => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t'idnumber' => $useridnumber,\n\t\t\t\t\t\t\t\t\t\t\t\t\t'id'\t => $userid,\n\t\t\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t );\n\t\t$virtualAccount = $this->postDataToServerUsingCurl( $post, $rel_url );\n\t\treturn $virtualAccount;\n\t}", "function Generate($objInvoice, $objAccount)\n \t{\n \t\t\n \t}", "public static function chooseUserAccount() {\n $listeUser = Utilisateur::all();\n $vue = new VueConnexion(\"invite\", $listeUser);\n $vue->render(\"\");\n }", "public function createCustomer($email, $password) {\n require_once 'PassHash.php';\n\n // First check if user already existed in db\n if (!$this->isCustomerExists($email)) {\n // Generating password hash\n $password_hash = PassHash::hash($password);\n\n // Generating API key\n $api_key = $this->generateApiKey();\n\n $sql_query = \"INSERT INTO customer(email, password, api_key, status) values(?, ?, ?, \". USER_NOT_ACTIVATE. \")\";\n\n // insert query\n if ($stmt = $this->conn->prepare($sql_query)) {\n $stmt->bind_param(\"sss\", $email, $password_hash, $api_key);\n\n $result = $stmt->execute();\n } else {\n var_dump($this->conn->error);\n }\n\n $stmt->close();\n\n // Check for successful insertion\n if ($result) {\n // User successfully inserted\n return USER_CREATED_SUCCESSFULLY;\n } else {\n // Failed to create user\n return USER_CREATE_FAILED;\n }\n } else {\n // User with same email already existed in the db\n return USER_ALREADY_EXISTED;\n }\n }", "public function store(Request $request)\n {\n if (customer::where('email', $request->email)->exists()) {\n return json_encode([\n 'status' => 'error',\n 'type' => 'email',\n 'message' => 'Account Already Exists! Please sign in.'\n ]);\n } else {\n $name = $request->fname. ' ' .$request->lname;\n $createCusAcc = new customer;\n $createCusAcc->name = $name;\n $createCusAcc->email = $request->email;\n $createCusAcc->phone = $request->phone;\n $createCusAcc->address1 = $request->address1;\n $createCusAcc->address2 = $request->address2;\n $createCusAcc->city = $request->city;\n $createCusAcc->state = $request->state;\n\n // return $createCusAcc;\n if($createCusAcc->save()){\n $customerid = $createCusAcc->id;\n // return $customerid;\n if($request->password != \"\"){\n $this->creatUser($name, $request->email, $customerid, $request->password);\n }\n return json_encode([\n 'status' => 'success',\n 'message' => 'Customer Account Created.'\n ]);\n // $customerid = customer::where('email',$request->email)->first(); //Need reconstruction\n // $orderid = $this->save_order($customerid);\n // return '/order-details/' . $orderid;\n }else{\n return json_encode([\n 'status' => 'error',\n 'type' => 'something',\n 'message' => 'Customer Account Could not be Created.'\n ]);\n // return redirect('/process-checkout')->with('error','An error occured!, Try again later');\n }\n }\n \n }", "function check_customer($email) {\n\n\tglobal $cxn;\n\t\n\t$the_id=0;\n\t\n\t$sql=\"select id from customers where email='$email'\";\n\t$query=$cxn->query($sql);\n\t$count=$query->num_rows;\n\tif($count>0)\n\t{\n\t\t//echo \"hello\";\n\t\t$row=$query->fetch_object();\n\t\t$the_id=$row->id;\n\t}\n\telse\n\t{\n\t\t\n\t$first_name=$cxn->real_escape_string(trim($_POST['first_name']));\n\t$last_name=$cxn->real_escape_string(trim($_POST['last_name']));\n\t$street_address_one=$cxn->real_escape_string(trim($_POST['street_address_one']));\n\t$street_address_two=$cxn->real_escape_string(trim($_POST['street_address_two']));\n\t$city=$cxn->real_escape_string(trim($_POST['city']));\n\t$state=$cxn->real_escape_string(trim($_POST['state']));\n\t$zip=$cxn->real_escape_string(trim($_POST['zip']));\n\t$cell_phone=$cxn->real_escape_string(trim($_POST['cell_phone']));\n\t$billing_first_name=$cxn->real_escape_string(trim($_POST['billing_first_name']));\n\t$billing_last_name=$cxn->real_escape_string(trim($_POST['billing_last_name']));\n\t$billing_street_address_one=$cxn->real_escape_string(trim($_POST['billing_street_address_one']));\n\t$billing_street_address_two=$cxn->real_escape_string(trim($_POST['billing_street_address_two']));\n\t$billing_city=$cxn->real_escape_string(trim($_POST['billing_city']));\n\t$billing_state=$cxn->real_escape_string(trim($_POST['billing_state']));\n\t$billing_zip=$cxn->real_escape_string(trim($_POST['billing_zip']));\n\t$email=$cxn->real_escape_string(trim($_POST['email_address']));\n\t$password=$cxn->real_escape_string(trim($_POST['password']));\n\t\n\t$sql=\"INSERT into customers (first_name, last_name, street_one, street_two, city, state, zip, shipping_first_name, shipping_last_name, shipping_address_one, shipping_address_two, shipping_city, shipping_state, shipping_zip, cell_phone, email, password) VALUES ('$billing_first_name', '$billing_last_name', '$billing_street_address_one', '$billing_street_address_two', '$billing_city', '$billing_state', '$billing_zip', '$first_name', '$last_name', '$street_address_one', '$street_address_two', '$city', '$state', '$zip', '$cell_phone', '$email', '$password')\";\n\t\tif(!$query=$cxn->query($sql))\n\t\t{\n\t\t\t$err='query_failure:'\n\t\t\t.'ERRNO: '\n\t\t\t.$mysqli->errno\n\t\t\t.'ERROR: '\n\t\t\t.$mysqli->error\n\t\t\t.PHP_EOL\n\t\t\t.' QUERY: '\n\t\t\t.$query\n\t\t\t.PHP_EOL;\n\t\t\ttrigger_error($err, E_USER_WARNING);\n\t\t}\n\t\n\t$the_id = $cxn->insert_id;\n\t\t\n\t}\n\t\n\treturn $the_id;\n}", "public function __toSwissPost(Mage_Customer_Model_Customer $customer, $mapping = 'customer')\n {\n // Load mapping\n $mapping = Mage::helper('swisspost_api')->getMapping('customer');\n // Apply mapping\n $account_values = Mage::helper('swisspost_api')->__toSwissPost($customer, $mapping);\n // Attach default values\n $default_values = Mage::helper('swisspost_api')->extractDefaultValues(self::XML_CONFIG_PATH_DEFAULT_VALUES);\n foreach ($default_values as $key => $value) {\n $account_values[$key] = $value;\n }\n //object customer\n /**\n *\n * 2. Accounts & Addresses:\n * 2.1 \"When there is ONLY one address on the account, use it also as the account address.\n *\n * When there are both \"Default billing address\" and \"Default shipping address\" USE the \"Default billing address\"\n */\n if (!isset($account_values['account_gender'])) {\n $account_values['account_gender'] = $customer->getGender() == 1 ? 'male'\n : ($customer->getGender() == 2 ? 'female' : 'other');\n }\n if (!isset($account_values['account_email'])) {\n $account_values['account_email'] = $customer->getEmail();\n }\n if (!isset($account_values['account_address_type'])) {\n $account_values['account_address_type'] = 'default';\n }\n if (!isset($account_values['account_website'])) {\n $account_values['account_website'] = $customer->getWebsiteId();\n }\n // Custom behavior\n if (!isset($account_values['account_function'])) {\n if ($customer->getData('concordat_number')) {\n $account_values['account_function'] = $customer->getData('concordat_number');\n }\n }\n if (!isset($account_values['account_maintag'])) {\n $account_values['account_maintag'] = 'b2c';\n }\n if (!isset($account_values['account_title'])) {\n $account_values['account_title'] = Mage::helper('swisspost_api')->__toTitle($customer->getPrefix());\n }\n // load address\n $address_id = $customer->getDefaultBilling();\n if ((int)$address_id) {\n $address = Mage::getModel('customer/address')->load($address_id);\n if (!isset($account_values['account_company'])) {\n $account_values['account_company'] = $address->getCompany();\n }\n if (!isset($account_values['account_street'])) {\n $account_values['account_street'] = $address->getStreet1();\n }\n //account_street_no\n if (!isset($account_values['account_zip'])) {\n $account_values['account_zip'] = $address->getPostcode();\n }\n if (!isset($account_values['account_city'])) {\n $account_values['account_city'] = $address->getCity();\n }\n if (!isset($account_values['account_country'])) {\n $account_values['account_country'] = $address->getCountry();\n }\n if (!isset($account_values['account_phone'])) {\n $account_values['account_phone'] = $address->getTelephone();\n }\n if (isset($account_values['account_zip'])) {\n $account_values['account_zip'] = Epoint_SwissPost_Api_Helper_Address::fixZipCode(\n $account_values['account_zip'], $account_values['account_country']\n );\n }\n if (!isset($account_values['account_street2'])) {\n //$account_values['account_street2'] = $address->getStreet2();\n $account_values['account_street2'] = $address->getDepartment();\n }\n // Custom behavior\n if (!isset($account_values['account_function'])) {\n if ($address->getData('concordat_number')) {\n $account_values['account_function'] = $address->getData('concordat_number');\n }\n }/*\n if (!isset($account_values['account_mobile'])) {\n $account_values['account_mobile'] = $address->getTelephone();\n }*/\n if (!isset($account_values['account_fax'])) {\n $account_values['account_fax'] = $address->getFax();\n }\n if (!isset($account_values['account_po_box'])) {\n $account_values['account_po_box'] = $address->getPobox();\n }\n }\n // attach group.\n $groupName = self::__toSwissPostGroup($customer->getId());\n if ($groupName) {\n $account_values['account_categories'][] = $groupName;\n }\n $language_code = self::__toSwissPostLanguage($customer->getOrderStoreId() ? $customer->getOrderStoreId() : $customer->getStoreId());\n if ($language_code) {\n $account_values['account_lang'] = $language_code;\n }\n $account_values['active'] = true;\n // When deleting a customer from Magento send an update with \"active\" = FALSE\n if ($customer->getData('deleting')) {\n $account_values['active'] = false;\n }\n\n return $account_values;\n }", "public function create_customer( $zipcode ){\n\t\t\t$card_holder = new HpsCardHolder();\n\t\t\t$address = new HpsAddress();\n\t\t\t$address->zip = $zipcode;\n\t\t\t$card_holder->address = $address;\n\n\t\t\treturn $card_holder;\n\t\t}", "public function transformUsers() {\n $saUsers = $this->kalturaUser->getAll();\n foreach ($saUsers as $key => $saUser){\n /**\n * @var $saUser KalturaUser\n */\n $dwUser = new DwUser();\n $dwUser->setId(\n $this->anonymize->anonymizeUser($saUser->getKalturaUserId())\n );\n $dwUser->setType(\n $this->typeOfUser($saUser->getKalturaUserId())\n );\n $dwUser->setCreatedAt($saUser->created_at);\n $dwUser->setUpdatedAt($saUser->updated_at);\n try{\n $dwUser->save();\n } catch (Exception $e) {\n var_dump($e->getMessage());\n die;\n }\n };\n }" ]
[ "0.58083355", "0.5459748", "0.5429084", "0.5285046", "0.52352834", "0.5162257", "0.5152354", "0.5134056", "0.5104716", "0.509612", "0.5053748", "0.5052017", "0.5040172", "0.5035832", "0.5032828", "0.5029079", "0.50276136", "0.5021984", "0.5013735", "0.5010318", "0.4989265", "0.49872112", "0.49804467", "0.49804467", "0.49804467", "0.49758163", "0.49676985", "0.49673277", "0.49635476", "0.49562147", "0.4955005", "0.4935175", "0.4932082", "0.4932082", "0.4932082", "0.49166816", "0.4916261", "0.49143884", "0.49116895", "0.49023482", "0.4897745", "0.48846638", "0.48626617", "0.4841798", "0.4837418", "0.48272136", "0.48108575", "0.4805894", "0.47932106", "0.478914", "0.47861034", "0.4785108", "0.4771002", "0.47679672", "0.47642836", "0.4755655", "0.4755213", "0.4749567", "0.47352174", "0.47282347", "0.47282338", "0.4727794", "0.4724138", "0.47187507", "0.47104615", "0.4709652", "0.47074938", "0.47072846", "0.4706941", "0.47063646", "0.47052425", "0.46984196", "0.46914756", "0.46913502", "0.46857476", "0.46844405", "0.46806556", "0.46804404", "0.46776497", "0.4670553", "0.46675926", "0.46622503", "0.46580416", "0.4646806", "0.4641638", "0.46368346", "0.46342993", "0.46341342", "0.46299848", "0.46296027", "0.46293372", "0.4627562", "0.4623972", "0.46224818", "0.46224546", "0.461916", "0.46121192", "0.46049199", "0.46025345", "0.4601542" ]
0.6598422
0
Toggle the newsletter flag
public function processChangeNewsletterVal() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static public function setSendAsNewsletter()\n\t{\n\t\tself::$_sendAsNewsletter = true;\n\t}", "public function setShowNewsletter($blShow)\n {\n $this->_iNewsStatus = $blShow;\n }", "function activateNewsletter() {\n\t\t$hash = t3lib_div::_GP('nlAuth');\n\t\t$userID = t3lib_div::_GP('u');\n\n\t\t// get the whole row\n\t\t$row = current($GLOBALS['TYPO3_DB']->exec_SELECTgetRows( '*', 'fe_users', 'uid=' . $userID ));\n\t\t$realHash = substr(sha1(serialize($row)), 1, 6); // first 6 letters from hash\n\t\tif ( $row['disable'] && ($realHash == $hash) ) { // hash matches\n\t\t\t// enable the user\n\t\t\t$GLOBALS['TYPO3_DB']->exec_UPDATEquery( 'fe_users', 'uid=' . $userID, array(\n\t\t\t\t'uid' => $userID,\n\t\t\t\t'disable' => '0' ) );\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function toggle_link($notify) {\n\n if ($notify == TRUE) {\n return FALSE;\n } elseif ($notify == FALSE) {\n return TRUE;\n }\n}", "private function activateMailChimpNewsletter()\n\t{\n\t\t$service = MailChimp_Newsletter::instance();\n\n\t\tif ($this->is_configured && $service->isConfigured()) {\n\n\t\t\t$service->setEnvironment($this->environment);\n\t\t\t$service->setVersion($this->version);\n\n\t\t\t// adding the ability to render the checkbox on another screen of the checkout page.\n\t\t\t$render_on = $service->getOption('mailchimp_checkbox_action', 'woocommerce_after_checkout_billing_form');\n\n\t\t\t$this->loader->add_action($render_on, $service, 'applyNewsletterField', 10);\n\n\t\t\t$this->loader->add_action('woocommerce_ppe_checkout_order_review', $service, 'applyNewsletterField', 10);\n\t\t\t$this->loader->add_action('woocommerce_register_form', $service, 'applyNewsletterField', 10);\n\n\t\t\t$this->loader->add_action('woocommerce_checkout_order_processed', $service, 'processNewsletterField', 10, 2);\n\t\t\t$this->loader->add_action('woocommerce_ppe_do_payaction', $service, 'processPayPalNewsletterField', 10, 1);\n\t\t\t$this->loader->add_action('woocommerce_register_post', $service, 'processRegistrationForm', 10, 3);\n\t\t}\n\t}", "public function toggleDoSpamFlag()\n {\n $response = $this->sendCommand(static::RCMD_DOSPAM);\n return $response->getData() === 'Spamming is now: On';\n }", "public function wishlist_toggle()\n\t{\n\t\t// no return needed as page is reloaded\n\t\t$this->EE->job_wishlists->wishlist_toggle();\t\t\n\t}", "public function toggleThreadNotificationObject()\n\t{\n\t\tglobal $ilUser;\n\n\t\tif ($this->objCurrentTopic->isNotificationEnabled($ilUser->getId()))\n\t\t{\n\t\t\t$this->objCurrentTopic->disableNotification($ilUser->getId());\n\t\t\tilUtil::sendInfo($this->lng->txt('forums_notification_disabled'), true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->objCurrentTopic->enableNotification($ilUser->getId());\n\t\t\tilUtil::sendInfo($this->lng->txt('forums_notification_enabled'), true);\n\t\t}\n\t\t\n\t\t$this->viewThreadObject();\n\t\t\n\t\treturn true;\n\t}", "public function isNewsletterPopUpEnable() \n {\n return (bool) Mage::getStoreConfig(self::XML_PATH_ENABLE);\n }", "public function setNewsLetter(bool $newsLetter)\n {\n $this->newsLetter = $newsLetter;\n\n return $this;\n }", "public function sUpdateNewsletter($status, $email, $customer = false)\n {\n if (!$status) {\n // Delete email address from database\n $this->db->delete(\n 's_campaigns_mailaddresses',\n ['email = ?' => $email]\n );\n $this->eventManager->notify(\n 'Shopware_Modules_Admin_Newsletter_Unsubscribe',\n ['email' => $email]\n );\n } else {\n // Check if mail address is already subscribed, return\n if ($this->db->fetchOne(\n 'SELECT id FROM s_campaigns_mailaddresses WHERE email = ?',\n [$email]\n )) {\n return false;\n }\n\n $optInNewsletter = $this->config->get('optinnewsletter');\n if ($optInNewsletter) {\n $hash = Random::getAlphanumericString(32);\n $data = serialize(['newsletter' => $email, 'subscribeToNewsletter' => true]);\n\n $link = $this->front->Router()->assemble([\n 'sViewport' => 'newsletter',\n 'action' => 'index',\n 'sConfirmation' => $hash,\n 'module' => 'frontend',\n ]);\n\n $this->sendMail($email, 'sOPTINNEWSLETTER', $link);\n\n $this->db->insert(\n 's_core_optin',\n [\n 'datum' => new Zend_Date(),\n 'hash' => $hash,\n 'data' => $data,\n 'type' => 'swNewsletter',\n ]\n );\n\n return true;\n }\n\n $groupID = $this->config->get('sNEWSLETTERDEFAULTGROUP');\n if (!$groupID) {\n $groupID = '0';\n }\n\n // Insert email into database\n if (!empty($customer)) {\n $this->db->insert(\n 's_campaigns_mailaddresses',\n ['customer' => 1, 'email' => $email, 'added' => $this->getCurrentDateFormatted()]\n );\n } else {\n $this->db->insert(\n 's_campaigns_mailaddresses',\n ['groupID' => $groupID, 'email' => $email, 'added' => $this->getCurrentDateFormatted()]\n );\n }\n\n $this->eventManager->notify(\n 'Shopware_Modules_Admin_sUpdateNewsletter_Subscribe',\n ['email' => $email]\n );\n }\n\n return true;\n }", "public function showNewsletter()\n {\n if ($this->_iNewsStatus === null) {\n return 1;\n }\n\n return $this->_iNewsStatus;\n }", "public function toggle_published() {\n $will_be_published = !$this->post->is_published();\n $this->post->toggle_published();\n redirect(\n '/backend/posts/edit',\n ['notice' => $will_be_published ? 'Published' : 'Unpublished'],\n ['id' => $this->post->id]\n );\n }", "public function toggle()\n {\n $this->isDone = !$this->isDone;\n }", "public function isRelatedToNewsletter(): bool\n {\n return false;\n }", "public function isNewsLetter()\n {\n return $this->newsLetter;\n }", "function unsubscribe($entity){\n\t\tif($entity instanceof ElggUser){\n\t\t\treturn $entity->setMetaData('isSubscribedNewsletter',false);\n\t\t}else{\n\t\t\tregister_error(elgg_echo('vazco_newsletter:notanuser'));\n\t\t\treturn false;\n\t\t}\n\t}", "public function toggleEnabled()\n {\n $this->bean->enabled = ! $this->bean->enabled;\n R::store($this->bean);\n }", "public function setUnread($toggle = true);", "public function toggleStatus()\n {\n $pageId = Tools::getValue('id_page');\n\n Db::getInstance()->update(\n $this->module->table_name,\n ['active' => !$this->module->getHTMLPageStatus($pageId)],\n 'id_page = ' . $pageId\n );\n }", "protected function toggleDisableAction() {}", "function subscribe($entity){\n\t\tif($entity instanceof ElggUser){\n\t\t\treturn $entity->setMetaData('isSubscribedNewsletter',true);\n\t\t}else{\n\t\t\tregister_error(elgg_echo('vazco_newsletter:notanuser'));\n\t\t\treturn false;\n\t\t}\n\t}", "function toggle_icon($notify) {\n\n if ($notify == TRUE) {\n return '_on';\n } elseif ($notify == FALSE) {\n return '_off';\n }\n}", "function aaModelSetManualImail ($imail_toggle) {\r\n\r\n\tglobal $pdo_conn, $pdo_t;\r\n\r\n\t$imail_toggle = (isset($imail_toggle)) ? 1 : 0;\r\n\t\r\n\t$sql = \"UPDATE \".$pdo_t['t_settings'].\" SET Imail_Manual = :imail_toggle LIMIT 1\";\r\n\t\r\n\t$q = $pdo_conn->prepare($sql);\r\n\t$q->execute(array('imail_toggle' => $imail_toggle));\r\n\t\r\n\t// redirect to general settings section\r\n\theader('Location: '.$_SERVER['REQUEST_URI']);\r\n\texit;\r\n\r\n}", "function LaunchNewsletter()\n{\n\tglobal $xoopsModule, $xoopsConfig, $dateformat;\n\txoops_cp_header();\n\tadminmenu(5);\n\n\tif (file_exists(XOOPS_ROOT_PATH.'/modules/news/language/'.$xoopsConfig['language'].'/newsletter.php')) {\n\t\tinclude_once XOOPS_ROOT_PATH.'/modules/news/language/'.$xoopsConfig['language'].'/newsletter.php';\n\t} else {\n\t\tinclude_once XOOPS_ROOT_PATH.'/modules/news/language/english/newsletter.php';\n\t}\n\techo \"<br />\";\n\t$story = new NewsStory();\n\t$exportedstories=array();\n\t$topiclist='';\n\t$removebr=false;\n\tif(isset($_POST['removebr']) && intval($_POST['removebr'])==1) {\n\t\t$removebr=true;\n\t}\n\t$date1=$_POST['date1'];\n\t$date2=$_POST['date2'];\n\t$timestamp1=mktime(0,0,0,intval(substr($date1,5,2)), intval(substr($date1,8,2)), intval(substr($date1,0,4)));\n\t$timestamp2=mktime(0,0,0,intval(substr($date2,5,2)), intval(substr($date2,8,2)), intval(substr($date2,0,4)));\n\tif(isset($_POST['export_topics'])) {\n\t\t$topiclist=implode(\",\",$_POST['export_topics']);\n\t}\n\t$tbltopics=array();\n\t$exportedstories=$story->NewsExport($timestamp1, $timestamp2, $topiclist, 0, $tbltopics);\n $newsfile=XOOPS_ROOT_PATH.'/uploads/newsletter.txt';\n\tif(count($exportedstories)) {\n\t\t$fp=fopen($newsfile,'w');\n\t\tif(!$fp) {\n\t\t\tredirect_header('index.php',4,sprintf(_AM_NEWS_EXPORT_ERROR,$newsfile));\n\t\t}\n\n\t\tforeach($exportedstories as $onestory)\n\t\t{\n\t\t\t$content=$newslettertemplate;\n\t\t\t$content=str_replace('%title%',$onestory->title(),$content);\n\t\t\t$content=str_replace('%uname%',$onestory->uname(),$content);\n\t\t\t$content=str_replace('%created%',formatTimestamp($onestory->created(),$dateformat),$content);\n\t\t\t$content=str_replace('%published%',formatTimestamp($onestory->published(),$dateformat),$content);\n\t\t\t$content=str_replace('%expired%',formatTimestamp($onestory->expired(),$dateformat),$content);\n\t\t\t$content=str_replace('%hometext%',$onestory->hometext(),$content);\n\t\t\t$content=str_replace('%bodytext%',$onestory->bodytext(),$content);\n\t\t\t$content=str_replace('%description%',$onestory->description(),$content);\n\t\t\t$content=str_replace('%keywords%',$onestory->keywords(),$content);\n\t\t\t$content=str_replace('%reads%',$onestory->counter(),$content);\n\t\t\t$content=str_replace('%topicid%',$onestory->topicid(),$content);\n\t\t\t$content=str_replace('%topic_title%',$onestory->topic_title(),$content);\n\t\t\t$content=str_replace('%comments%',$onestory->comments(),$content);\n\t\t\t$content=str_replace('%rating%',$onestory->rating(),$content);\n\t\t\t$content=str_replace('%votes%',$onestory->votes(),$content);\n\t\t\t$content=str_replace('%publisher%',$onestory->uname(),$content);\n\t\t\t$content=str_replace('%publisher_id%',$onestory->uid(),$content);\n\t\t\t$content=str_replace('%link%',XOOPS_URL.'/modules/news/article.php?storyid='.$onestory->storyid(),$content);\n\t\t\tif($removebr) {\n\t\t\t\t$content=str_replace('<br />',\"\\r\\n\",$content);\n\t\t\t}\n\t\t\tfwrite($fp,$content);\n\t\t}\n\t\tfclose($fp);\n\t\t$newsfile=XOOPS_URL.'/uploads/newsletter.txt';\n\t\tprintf(_AM_NEWS_NEWSLETTER_READY,$newsfile,XOOPS_URL.'/modules/news/admin/index.php?op=deletefile&amp;type=newsletter');\n\t} else {\n\t\tprintf(_AM_NEWS_NOTHING);\n\t}\n}", "protected function set_activation_flag( bool $network_wide = false ): bool {\n\t\tif ( $network_wide ) {\n\t\t\treturn update_site_option( self::OPTION_SHOW_ACTIVATION_NOTICE, '1' );\n\t\t}\n\n\t\treturn update_option( self::OPTION_SHOW_ACTIVATION_NOTICE, '1', false );\n\t}", "public function toggle(Request $request)\n {\n $this->validate($request, [\n \"id\" => \"exists:bill_receives,id\"\n ]);\n\n $bill_receive = auth()->user()->bill_receives()->findOrFail($request->id);\n $bill_receive->update(['status' => !$bill_receive->status]);\n \n return response()->json(['status' => 'success', 'message' => 'Conta a receber atualizada com sucesso']);\n }", "public function enableToggleFullTime($a_title,$a_checked)\n\t{\n\t\t$this->toggle_fulltime_txt = $a_title;\n\t\t$this->toggle_fulltime_checked = $a_checked;\t\t\n\t\t$this->toggle_fulltime = true;\n\t}", "private function publishToggle(Request $request){\n\t\t$class ='\\App\\\\'.$request->class;\n\t\t$data = $class::find($request->id);\n\t\t$data->published = !$data->published;\n\t\t$data->save();\n\t}", "protected function toggleEmailFeatureValue($value)\n {\n $key = Configuration::getConfigKeyByName('feature_enabled');\n\n $configManager = $this->getContainer()->get('oro_config.manager');\n $configManager->set($key, (bool) $value);\n $configManager->flush();\n\n $featureChecker = $this->getContainer()->get('oro_featuretoggle.checker.feature_checker');\n $featureChecker->resetCache();\n }", "public function setIsSendLink($isSendLink)\n {\n $this->isSendLink = $isSendLink;\n }", "public function actionNewsLetter() {\n if (Yii::$app->request->isAjax) {\n $exist = \\common\\models\\NewsLetter::find()->where(['email' => $_POST['email']])->one();\n if (empty($exist)) {\n $model = new \\common\\models\\NewsLetter();\n $model->email = $_POST['email'];\n $model->date = date('Y-m-d');\n if ($model->save()) {\n// $this->sendNewsLetterMail($model);\n echo 1;\n exit;\n } else {\n echo 0;\n exit;\n }\n } else {\n echo 2;\n exit;\n }\n }\n }", "function activateHTTPS($activate)\n {\n\n // define all the global variables\n global $database, $message, $settings;\n\n if ($activate) {\n // check if already activated\n if ($settings->isHTTPS()) {\n return false;\n }\n\n $sql = \"UPDATE \" . TBL_SETTINGS . \" SET value = '1' WHERE field = '\" . TBL_SETTINGS_FORCE_HTTPS . \"'\";\n\n // get the sql results\n if (!$result = $database->getQueryResults($sql)) {\n return false;\n }\n\n //if no error then set the success message\n $message->setSuccess(\"You have activated ssl across your script\");\n return true;\n } else {\n // check if already de-activated\n if (!$settings->isHTTPS()) {\n return false;\n }\n\n $sql = \"UPDATE \" . TBL_SETTINGS . \" SET value = '0' WHERE field = '\" . TBL_SETTINGS_FORCE_HTTPS . \"'\";\n\n // get the sql results\n if (!$result = $database->getQueryResults($sql)) {\n return false;\n }\n\n //if no error then set the success message\n $message->setSuccess(\"You have de-activated ssl across your script\");\n return true;\n }\n }", "function setFlagForLinkView()\r\n {\r\n \r\n \t\t\tif($_SESSION['linkFlag']==1)\r\n\t\t\t{\r\n\t\t\t echo \"false\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$_SESSION['linkFlag']=1;\r\n\t\t\t\techo \"true\";\r\n\t\t\t}\r\n }", "public function togglePublished()\n {\n if ($this->isActive()) {\n $this->is_published = false;\n } else {\n $this->is_published = true;\n }\n\n return $this->save();\n }", "function Newsletters()\n\t{\n\t\t$this->PopupWindows[] = 'sendpreviewdisplay';\n\t\t$this->PopupWindows[] = 'checkspamdisplay';\n\t\t$this->PopupWindows[] = 'viewcompatibility';\n\t\t$this->LoadLanguageFile();\n\t}", "public function toggleSetting($channel, $state)\n {\n $user_notification_channel = $this->getNotificationChannel($channel);\n\n if ($state) { //Toggle is on so the user wants the notifications active\n if ($user_notification_channel->muted) { //If the channel is muted\n Log::info(\"Updating the $channel notification toggle for User Id $this->id to be muted\");\n $user_notification_channel->muted_at = null;\n $user_notification_channel->save();\n }\n } else { //Stats is off so the user wants the notifications muted\n if (! $user_notification_channel->muted) { //If the channel is muted\n Log::info(\"Updating the $channel notification toggle for User Id $this->id to be active\");\n $user_notification_channel->muted_at = Carbon::now();\n $user_notification_channel->save();\n }\n }\n }", "public function toggleShowTimer(): void\n {\n $this->showTimer = !$this->showTimer;\n }", "function DisplayEditNewsletter($newsletterid=0)\n\t{\n\t\t$newsletter = $this->GetApi();\n\t\t$newslettercontents = array('text' => '', 'html' => '');\n\n\t\t$user = &GetUser();\n\n\t\t$GLOBALS['FromPreviewEmail'] = $user->Get('emailaddress');\n\n\t\t$GLOBALS['DisplayAttachmentsHeading'] = 'none';\n\n\t\t$tpl = GetTemplateSystem();\n\n\n\t\tif ($newsletterid > 0) {\n\t\t\t$GLOBALS['SaveAction'] = 'Edit&SubAction=Save&id=' . $newsletterid;\n\t\t\t$GLOBALS['Heading'] = GetLang('EditNewsletter');\n\t\t\t$GLOBALS['Intro'] = GetLang('EditNewsletterIntro_Step2');\n\t\t\t$GLOBALS['Action'] = 'Edit&SubAction=Complete&id=' . $newsletterid;\n\t\t\t$GLOBALS['CancelButton'] = GetLang('EditNewsletterCancelButton');\n\n\t\t\t$newsletter->Load($newsletterid);\n\t\t\t$GLOBALS['IsActive'] = ($newsletter->Active()) ? ' CHECKED' : '';\n\t\t\t$GLOBALS['Archive'] = ($newsletter->Archive()) ? ' CHECKED' : '';\n\t\t\t$newslettercontents['text'] = $newsletter->GetBody('text');\n\t\t\t$newslettercontents['html'] = $newsletter->GetBody('html');\n\n\t\t\t$GLOBALS['Subject'] = htmlspecialchars($newsletter->subject, ENT_QUOTES, SENDSTUDIO_CHARSET);\n\t\t} else {\n\t\t\t$GLOBALS['SaveAction'] = 'Create&SubAction=Save&id=' . $newsletterid;\n\t\t\t$GLOBALS['Heading'] = GetLang('CreateNewsletter');\n\t\t\t$GLOBALS['Intro'] = GetLang('CreateNewsletterIntro_Step2');\n\t\t\t$GLOBALS['Action'] = 'Create&SubAction=Complete';\n\t\t\t$GLOBALS['CancelButton'] = GetLang('CreateNewsletterCancelButton');\n\n\t\t\t$GLOBALS['IsActive'] = ' CHECKED';\n\t\t\t$GLOBALS['Archive'] = ' CHECKED';\n\t\t}\n\n\t\tif (!SENDSTUDIO_ALLOW_ATTACHMENTS) {\n\t\t\t$tpl->Assign('ShowAttach', false);\n\t\t\t$GLOBALS['DisplayAttachments'] = 'none';\n\t\t\t$user = IEM::getCurrentUser();\n\t\t\tif($user) {\n\t\t\t\tif ($user->isAdmin()) {\n\t\t\t\t\t$GLOBALS['AttachmentsMsg'] = GetLang('NoAttachment_Admin');\n\t\t\t\t} else {\n\t\t\t\t\t$GLOBALS['AttachmentsMsg'] = GetLang('NoAttachment_User');\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$tpl->Assign('ShowAttach', true);\n\t\t\t$attachmentsarea = strtolower(get_class($this));\n\t\t\t$attachments_list = $this->GetAttachments($attachmentsarea, $newsletterid);\n\t\t\t$GLOBALS['AttachmentsList'] = $attachments_list;\n\t\t}\n\n\t\t$GLOBALS['PreviewID'] = $newsletterid;\n\t\t// we don't really need to get/set the stuff here.. we could use references.\n\t\t// if we do though, it segfaults! so we get and then set the contents.\n\t\t$session_newsletter = IEM::sessionGet('Newsletters');\n\t\t$session_newsletter['id'] = (int)$newsletterid;\n\n\t\tif (isset($session_newsletter['TemplateID'])) {\n\t\t\t$templateApi = $this->GetApi('Templates');\n\t\t\tif (is_numeric($session_newsletter['TemplateID'])) {\n\t\t\t\t$templateApi->Load($session_newsletter['TemplateID']);\n\t\t\t\t$newslettercontents['text'] = $templateApi->textbody;\n\t\t\t\t$newslettercontents['html'] = $templateApi->htmlbody;\n\t\t\t} else {\n\t\t\t\t$newslettercontents['html'] = $templateApi->ReadServerTemplate($session_newsletter['TemplateID']);\n\t\t\t}\n\t\t\tunset($session_newsletter['TemplateID']);\n\t\t}\n\n\t\t$session_newsletter['contents'] = $newslettercontents;\n\t\tIEM::sessionSet('Newsletters', $session_newsletter);\n\t\t$editor = $this->FetchEditor();\n\t\t$GLOBALS['Editor'] = $editor;\n\n\t\t$user = &GetUser();\n\t\tif ($user->Get('forcespamcheck')) {\n\t\t\t$GLOBALS['ForceSpamCheck'] = 1;\n\t\t}\n\n\t\t$tpl->ParseTemplate('Newsletter_Form_Step2');\n\t}", "function deactivate(){\n wp_clear_scheduled_hook('cp_email_notification');\n}", "public function toggleStickinessObject()\n\t{\n\t\tglobal $ilAccess;\n\t\t\n\t\tif ($ilAccess->checkAccess('moderate_frm', '', $_GET['ref_id']))\n\t\t{\n\t\t\tif ($this->objCurrentTopic->isSticky())\n\t\t\t{\n\t\t\t\t$this->objCurrentTopic->unmakeSticky();\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->objCurrentTopic->makeSticky();\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->viewThreadObject();\n\t\t\n\t\treturn true;\n\t}", "function og_simplenews_manager_add_newsletter($form, &$form_state) {\n $name = $form_state['values']['newsletters']['new'];\n if (!empty($name)) {\n og_simplenews_new_group_newsletter($form_state['node'], $name);\n }\n}", "public function toggleDefault()\n {\n $this->language->default = ! $this->language->default;\n }", "public function setIsBlocked($bool);", "public function newsletter($mobile,$email)\n\t{\n\t\t$result = mysql_query(\"Update users set email = '$email' where mobile = '$mobile'\");\n\t\t\n\t\tif($result){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "public function edit(Newsletter $newsletter) {\n //\n }", "public function setIsClickable(bool $flag)\n {\n $this->isClickable = $flag;\n }", "public function request( $notes, $toggle ) {\n\t\t// already requested?\n\t\tif ( $this->feedback->isRequested() ) {\n\t\t\t$this->error = 'articlefeedbackv5-invalid-feedback-state';\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->feedback->aft_request = 1;\n\t\t$this->feedback->aft_decline = 0;\n\t\t$this->logId = $this->log( __FUNCTION__, $this->feedback->aft_page, $this->feedback->aft_id, $notes, $this->user );\n\n\t\t// autohide if not yet hidden\n\t\tif ( !$this->feedback->isHidden() ) {\n\t\t\t/*\n\t\t\t * We want to keep track of hides/unhides, but also autohides.\n\t\t\t * Feedback will be hidden when hide + autohide > unhide\n\t\t\t */\n\t\t\t$this->feedback->aft_hide = 1;\n\t\t\t$this->feedback->aft_autohide = 1;\n\t\t\t$this->log( 'autohide', $this->feedback->aft_page, $this->feedback->aft_id, 'Automatic hide', $this->user );\n\t\t}\n\n\t\t// send an email to oversighter(s)\n\t\t$this->sendOversightEmail( $notes );\n\n\t\treturn true;\n\t}", "public function setStatus($sticky, $announcement) {\n\t\t$sql = \"UPDATE\twbb\".WBB_N.\"_thread\n\t\t\tSET \tisSticky = \".$sticky.\",\n\t\t\t\tisAnnouncement = \".$announcement.\"\n\t\t\tWHERE\tthreadID = \".$this->threadID;\n\t\tWCF::getDB()->registerShutdownUpdate($sql);\n\t}", "public function toggle_tweet(){\n //Get id from view\n $twid = Input::get(\"twid\");\n \n //Define response array\n $response = array(\n \"success\" => false,\n \"message\" => \"\",\n \"data\"=>array()\n );\n \n $tweet = Tweet::find($twid);\n \n //Checking if tweet exist in database\n if( !$tweet instanceof Tweet){\n $response[\"message\"] =trans(\"app.tweet_no_exist\");\n return Response::json($response);\n }\n \n if( Auth::user()->id != $tweet->user_id ){\n $response[\"message\"] = trans(\"app.no_owner_tweet\");\n return Response::json($response);\n }\n \n //toggle flag hidden\n if( $tweet->is_hidden ){\n $tweet->is_hidden = 0;\n $response[\"message\"] = trans(\"app.tweet_show\");\n }else{\n $tweet->is_hidden = 1;\n $response[\"message\"] = trans(\"app.tweet_hide\");\n }\n $tweet->save();\n \n //Set and return object\n \n $response[\"success\"] = true;\n $response[\"data\"] = $tweet->toArray();\n return Response::json($response);\n }", "public static function subscribe_member( $email_address, $newsletter_member_id = false ) {\n\n\t\t// check they're not already subscribed.\n\t\t$already_subscribed = false;\n\t\tif ( $newsletter_member_id ) {\n\t\t\t$newsletter_member = get_single( 'newsletter_member', 'newsletter_member_id', $newsletter_member_id );\n\t\t\tif ( $newsletter_member && $newsletter_member['join_date'] && $newsletter_member['join_date'] != '0000-00-00' ) {\n\t\t\t\t// they're already subscribed.\n\t\t\t\t$already_subscribed = true;\n\t\t\t}\n\t\t}\n\n\t\t// send double opt in?\n\t\tif ( ! $already_subscribed && module_config::c( 'newsletter_double_opt_in', 1 ) ) {\n\n\t\t\t// add this new member to the blacklist, this will be removed when they confirm.\n\t\t\tmodule_newsletter::unsubscribe_member_via_email( $email_address, 'doubleoptin' );\n\n\t\t\t$template = module_template::get_template_by_key( 'member_subscription_double_optin' );\n\t\t\t$template->assign_values( array(\n\t\t\t\t'email' => $email_address,\n\t\t\t\t'link' => self::double_optin_confirmation_link( $email_address ),\n\t\t\t) );\n\t\t\t$html = $template->render( 'html' );\n\n\t\t\t$email = module_email::new_email();\n\t\t\t$email->replace_values = array(\n\t\t\t\t'email' => $email_address,\n\t\t\t\t'link' => self::double_optin_confirmation_link( $email_address ),\n\t\t\t);\n\t\t\t$email->set_to_manual( $email_address );\n\t\t\t$email->set_from_manual( module_config::c( 'newsletter_default_from_email', module_config::c( 'admin_email_address' ) ), module_config::c( 'newsletter_default_from_name', module_config::c( 'admin_system_name' ) ) );\n\t\t\t$email->set_subject( module_config::c( 'newsletter_double_opt_in_subject', 'Please confirm your newsletter subscription' ) );\n\t\t\t// do we send images inline?\n\t\t\t$email->set_html( $html );\n\n\t\t\tif ( $email->send() ) {\n\t\t\t\t// it worked successfully!!\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\n\t\t\t// remove them from a blacklist and remove any bounce counters that could prevent us sending them emails.\n\t\t\tmodule_newsletter::unsubscribe_member_via_email( $email_address, 'new_subscribe', true );\n\t\t\tif ( $newsletter_member_id ) {\n\t\t\t\t$sql = \"UPDATE `\" . _DB_PREFIX . \"newsletter_member` SET bounce_count = 0, receive_email = 1, unsubscribe_send_id = 0 WHERE newsletter_member_id = \" . (int) $newsletter_member_id . \" LIMIT 1\";\n\t\t\t\tquery( $sql );\n\t\t\t\tif ( ! $already_subscribed ) {\n\t\t\t\t\t$sql = \"UPDATE `\" . _DB_PREFIX . \"newsletter_member` SET join_date = NOW() WHERE newsletter_member_id = \" . (int) $newsletter_member_id . \" LIMIT 1\";\n\t\t\t\t\tquery( $sql );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true; // dont need to do anything.\n\t\t}\n\t}", "public static function toggle()\n {\n if ( empty($_REQUEST['mgb_rating_id']) || empty($_REQUEST['mgb_rating_state']) ) return;\n $state = ($_REQUEST['mgb_rating_state'] === 'true') ? 'false' : 'true';\n $id = (int) $_REQUEST['mgb_rating_id'];\n\n Database::query(\n \"UPDATE ?\n SET state=${state}\n WHERE id=${id}\"\n );\n }", "function updatenotifier_activate() {\n\t// clear any existing schedules first\n\twp_clear_scheduled_hook( 'updatenotifier_sendmail' );\n\t// schedule daily check\n\twp_schedule_event( time(), 'daily', 'updatenotifier_sendmail' );\n\n\t$current = get_option( 'updatenote_options' );\n\t$defaults = array(\n\t\t'secondemail' => '', 'plugins' => 'No', 'themes' => 'No',\n\t\t'emailadmin' => false, 'version' => '1.4.1'\n\t);\n\n\tif ( ! $current )\n\t\tadd_option( 'updatenote_options', $defaults );\n\telse\n\t\tupdatenotifier_upgrade( $current, $defaults );\n}", "public function edit(Newsletter $newsletter)\n {\n //\n }", "public function edit(Newsletter $newsletter)\n {\n //\n }", "public function edit(Newsletter $newsletter)\n {\n //\n }", "function setAnnounceEmail($email) {\r\n if(strpos($email, '@')) {\r\n $this->announceEmail = $email;\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public function ajaxToggleFavorite()\r\n {\r\n $result = array(\r\n 'status' => false,\r\n );\r\n\r\n $result['status'] = $this->app->jbfavorite->toggleState($this->getItem());\r\n\r\n $this->app->jbajax->send($result, true);\r\n }", "public function show(Newsletter $newsletter) {\n //\n }", "public function change_email_sent()\n {\n $this->_render();\n }", "function ActionNewsletters($newsletterids=array(), $action='')\n\t{\n\t\tif (!is_array($newsletterids)) {\n\t\t\t$newsletterids = array($newsletterids);\n\t\t}\n\n\t\tif (empty($newsletterids)) {\n\t\t\t$GLOBALS['Error'] = GetLang('NoNewslettersToAction');\n\t\t\t$GLOBALS['Message'] = $this->ParseTemplate('ErrorMsg', true, false);\n\t\t\t$this->ManageNewsletters();\n\t\t\treturn;\n\t\t}\n\n\t\t$action = strtolower($action);\n\n\t\tif (!in_array($action, array('approve', 'disapprove', 'archive', 'unarchive'))) {\n\t\t\t$GLOBALS['Error'] = GetLang('InvalidNewsletterAction');\n\t\t\t$GLOBALS['Message'] = $this->ParseTemplate('ErrorMsg', true, false);\n\t\t\t$this->ManageNewsletters();\n\t\t\treturn;\n\t\t}\n\n\t\t$user = &GetUser();\n\n\t\t$newsletterapi = $this->GetApi();\n\n\t\t$update_ok = $update_fail = $update_not_done = 0;\n\t\tforeach ($newsletterids as $p => $newsletterid) {\n\t\t\t$newsletterapi->Load($newsletterid);\n\n\t\t\t$save_newsletter = true;\n\n\t\t\tswitch ($action) {\n\t\t\t\tcase 'approve':\n\t\t\t\t\t$allow_attachments = $this->CheckForAttachments($newsletterid, 'newsletters');\n\t\t\t\t\tif ($allow_attachments) {\n\t\t\t\t\t\t$langvar = 'Approved';\n\t\t\t\t\t\t$newsletterapi->Set('active', $user->Get('userid'));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$update_not_done++;\n\t\t\t\t\t\t$save_newsletter = false;\n\t\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\t\tcase 'disapprove':\n\t\t\t\t\t$langvar = 'Disapproved';\n\t\t\t\t\t$newsletterapi->Set('active', 0);\n\t\t\t\tbreak;\n\t\t\t\tcase 'archive':\n\t\t\t\t\t$langvar = 'Archived';\n\t\t\t\t\t$newsletterapi->Set('archive', 1);\n\t\t\t\tbreak;\n\t\t\t\tcase 'unarchive':\n\t\t\t\t\t$langvar = 'Unarchived';\n\t\t\t\t\t$newsletterapi->Set('archive', 0);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ($save_newsletter) {\n\t\t\t\t$status = $newsletterapi->Save();\n\t\t\t\tif ($status) {\n\t\t\t\t\t$update_ok++;\n\t\t\t\t} else {\n\t\t\t\t\t$update_fail++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$msg = '';\n\n\t\tif ($update_not_done > 0) {\n\t\t\tif ($update_not_done == 1) {\n\t\t\t\t$GLOBALS['Error'] = GetLang('NewsletterActivateFailed_HasAttachments');\n\t\t\t} else {\n\t\t\t\t$GLOBALS['Error'] = sprintf(GetLang('NewsletterActivateFailed_HasAttachments_Multiple'), $this->FormatNumber($update_not_done));\n\t\t\t}\n\t\t\t$msg .= $this->ParseTemplate('ErrorMsg', true, false);\n\t\t}\n\n\t\tif ($update_fail > 0) {\n\t\t\tif ($update_fail == 1) {\n\t\t\t\t$GLOBALS['Error'] = GetLang('Newsletter_Not' . $langvar);\n\t\t\t} else {\n\t\t\t\t$GLOBALS['Error'] = sprintf(GetLang('Newsletters_Not' . $langvar), $this->FormatNumber($update_fail));\n\t\t\t}\n\t\t\t$msg .= $this->ParseTemplate('ErrorMsg', true, false);\n\t\t}\n\n\t\tif ($update_ok > 0) {\n\t\t\tif ($update_ok == 1) {\n\t\t\t\t$msg .= $this->PrintSuccess('Newsletter_' . $langvar);\n\t\t\t} else {\n\t\t\t\t$msg .= $this->PrintSuccess('Newsletters_' . $langvar, $this->FormatNumber($update_ok));\n\t\t\t}\n\t\t}\n\n\t\t$GLOBALS['Message'] = $msg;\n\n\t\t$this->ManageNewsletters();\n\t}", "public function show(Newsletter $newsletter)\n {\n //\n }", "public function show(Newsletter $newsletter)\n {\n //\n }", "private function toggleTunnel(){\n\t\tif(isset($_POST['tunnelid']) && is_numeric($_POST['tunnelid'])){\n\t\t\tforeach($this->data->tunnels->tunnel as $tunnel){\n\t\t\t\tif((string)$tunnel['id'] == $_POST['tunnelid']){\n\t\t\t\t\t\n\t\t\t\t\tif((string)$tunnel['enable'] == 'true'){\n\t\t\t\t\t\t$tunnel['enable'] = 'false';\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$tunnel['enable'] = 'true';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this->config->saveConfig();\n\t\t\t\t\techo '<reply action=\"ok\"/>';\n\t\t\t\t\treturn true;\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tthrow new Exception('The specified tunnel could not be found');\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tthrow new Exception('An invalid tunnel identifier was submitted');\n\t\t}\n\t}", "public function actionNewsletter()\n\t{\n\t\t$model=new Newsletter('default');\n\t\t\n\t\tif(isset($_POST['ajax']) && $_POST['ajax']==='newsletter')\n\t\t{\n\t\t\techo CActiveForm::validate($model);\n\t\t\tYii::app()->end();\n\t\t}\n\n\t\telse if (isset($_POST['Newsletter']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Newsletter'];\n\t\t\t$model->date_enrolled = new CDbExpression('now()');\n\t\t\t\n\t\t\tif($model->save())\n\t\t\t{\n\t\t\t\tYii::app()->user->setFlash('newsletter','Thank you for subscribing to our newsletter! Please add .... to your contacts to ensure you get our emails.');\n\t\t\t\t$this->refresh();\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->render(\n\t\t\t'newsletter',\n\t\t\tarray (\n\t\t\t\t'model' => $model,\n\t\t\t)\n\t\t);\n\t}", "function toggleMessageStatus($messageId){\r\n //$GLOBALS['link'] = connect();\r\n mysqli_query($GLOBALS['link'], 'update messages set `status`=NOT(`status`) where `id`='. $messageId .';') or die(mysqli_error($GLOBALS['link']));\r\n\r\n return mysqli_affected_rows($GLOBALS['link']);\r\n}", "public function setNewsSubscription( $blSubscribe, $blSendOptIn ){\n\t\t\t$blSuccess = parent::setNewsSubscription($blSubscribe, false);\n\t\t\t\n\t\t\tif($blSuccess){\n\t\t\t\n\t\t\t\t$api = new MCAPI(MC_APIKEY);\n\t\t\t\t$oSubscription = $this->getNewsSubscription();\n\n\t\t\t\tif($blSubscribe){\n\t\t\t\t\t$merge_vars = array('FNAME'=>$oSubscription->oxnewssubscribed__oxfname->value, 'LNAME'=>$oSubscription->oxnewssubscribed__oxlname->value);\t\t\t\n\t\t\t\t\t$retval = $api->listSubscribe( MC_LISTID, $oSubscription->oxnewssubscribed__oxemail->value, $merge_vars );\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t$retval = $api->listUnsubscribe( MC_LISTID, $oSubscription->oxnewssubscribed__oxemail->value );\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\tif ($api->errorCode){\n\t\t\t\t\t//oxUtilsView::addErrorToDisplay('#'.$api->errorCode.': '.$api->errorMessage);\t\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn $blSuccess;\n\t\t}", "function toggleActivated () {\n if (!isset($_SESSION['admin_auth']) OR empty($_SESSION['admin_auth']))\n\treturn false;\n\n // get name and type\n $type = (isset($_GET['type']) and $_GET['type'] == 'app')\n\t? 'app' : 'style';\n $name = (isset($_GET['name'])) ? $_GET['name'] : '';\n if (empty($name)) {\n\t$_SESSION['admin_error'] = 'TOGGLEACTIVATED__ERROR';\n\treturn false;\n }\n\n // get object\n $Obj = NULL;\n switch ($type) {\n case 'app':\n\t$Obj = new App($name);\n\tbreak;\n case 'style':\n\t$Obj = new Style($name);\n\tbreak;\n default:\n\t$_SESSION['admin_error'] = 'TOGGLEACTIVATED__ERROR';\n\treturn false;\n }\n\n // Toggle\n if (!$Obj->toggleActivated()) {\n\t// error\n\t$_SESSION['admin_error'] = 'TOGGLEACTIVATED__ERROR';\n\treturn false;\n }\n\n $_SESSION['admin_info'] = 'TOGGLEACTIVATED__INFO';\n header('Location:?event=show'.(($type == 'app') ? 'Apps' : 'Styles'));\n exit;\n}", "public function ajax_toggle_fav() { \n }", "function fbComments_deactivate() {\n\tglobal $fbc_options;\n\t\n\t$to = get_bloginfo('admin_email');\n\t$subject = \"[Facebook Comments for WordPress] Your current XID\";\n\n\t$message = \"Thanks for trying out Facebook Comments for WordPress!\\n\\n\" .\n\t\t\t \"We just thought you'd like to know that your current XID is: {$fbc_options['xid']}.\\n\\n\" .\n\t\t\t \"This should be saved in your website's database, but in case it gets lost, you'll need this unique key to retrieve your comments should you ever choose to activate this plugin again.\\n\\n\" .\n\t\t\t \"Have a great day!\";\n\n\t// Wordwrap the message and strip slashes that may have wrapped quotes\n\t$message = stripslashes(wordwrap($message, 70));\n\n\t$headers = \"From: Facebook Comments for WordPress <$to>\\r\\n\" .\n\t\t\t \"Reply-To: $to\\r\\n\" .\n\t\t\t \"X-Mailer: PHP\" . phpversion();\n\n\t// Send the email notification\n\tfbComments_log(\"Sending XID via email to $to\");\n\tif (wp_mail($to, $subject, $message, $headers)) {\n\t\tfbComments_log(sprintf(' Sent XID via email to %s', $to));\n\t} else {\n\t\tfbComments_log(sprintf(' FAILED to send XID via email to %s', $to));\n\t}\n}", "public function setToggle() {\n $session = Gdn::session();\n if (!$session->isValid()) {\n return;\n }\n\n $showAllCategories = getIncomingValue('ShowAllCategories', '');\n if ($showAllCategories != '') {\n $showAllCategories = $showAllCategories == 'true' ? true : false;\n $showAllCategoriesPref = $session->getPreference('ShowAllCategories');\n if ($showAllCategories != $showAllCategoriesPref) {\n $session->setPreference('ShowAllCategories', $showAllCategories);\n }\n\n redirectTo('/'.ltrim(Gdn::request()->path(), '/'));\n }\n }", "function Newsletter()\n{\n global $xoopsDB;\n include_once XOOPS_ROOT_PATH.\"/class/xoopsformloader.php\";\n xoops_cp_header();\n adminmenu(5);\n echo \"<br />\";\n\t$sform = new XoopsThemeForm(_AM_NEWS_NEWSLETTER, \"newsletterform\", XOOPS_URL.'/modules/news/admin/index.php', 'post');\n\t$dates_tray = new XoopsFormElementTray(_AM_NEWS_NEWSLETTER_BETWEEN);\n\t$date1 = new XoopsFormTextDateSelect('', 'date1',15,time());\n\t$date2 = new XoopsFormTextDateSelect(_AM_NEWS_EXPORT_AND, 'date2',15,time());\n\t$dates_tray->addElement($date1);\n\t$dates_tray->addElement($date2);\n\t$sform->addElement($dates_tray);\n\n\t$topiclist=new XoopsFormSelect(_AM_NEWS_PRUNE_TOPICS, 'export_topics','',5,true);\n\t$topics_arr=array();\n\t$xt = new NewsTopic();\n\t$allTopics = $xt->getAllTopics(false);\t\t\t\t// The webmaster can see everything\n\t$topic_tree = new XoopsObjectTree($allTopics, 'topic_id', 'topic_pid');\n\t$topics_arr = $topic_tree->getAllChild(0);\n\tif(count($topics_arr)) {\n\t\tforeach ($topics_arr as $onetopic) {\n\t\t\t$topiclist->addOption($onetopic->topic_id(),$onetopic->topic_title());\n\t\t}\n\t}\n\t$topiclist->setDescription(_AM_NEWS_EXPORT_PRUNE_DSC);\n\t$sform->addElement($topiclist,false);\n\t$sform->addElement(new XoopsFormHidden('op', 'launchnewsletter'), false);\n\t$sform->addElement(new XoopsFormRadioYN(_AM_NEWS_REMOVE_BR, 'removebr',1),false);\n\t$button_tray = new XoopsFormElementTray('' ,'');\n\t$submit_btn = new XoopsFormButton('', 'post', _SUBMIT, 'submit');\n\t$button_tray->addElement($submit_btn);\n\t$sform->addElement($button_tray);\n\t$sform->display();\n}", "public function actionNewsletterInline()\n\t{\n\t\t$model=new Newsletter('inline');\n\t\t\n\t\tif(isset($_POST['ajax']) && $_POST['ajax']==='newsletter')\n\t\t{\n\t\t\techo CActiveForm::validate($model);\n\t\t\tYii::app()->end();\n\t\t}\n\n\t\telse if (isset($_POST['Newsletter']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Newsletter'];\n\t\t\t$model->date_enrolled = new CDbExpression('now()');\n\t\t\t\n\t\t\tif($model->save())\n\t\t\t{\n\t\t\t\tYii::app()->user->setFlash('newsletter','Thank you for subscribing to our newsletter! Please add .... to your contacts to ensure you get our emails.');\n\t\t\t\t$this->refresh();\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->render(\n\t\t\t'newsletter',\n\t\t\tarray (\n\t\t\t\t'model' => $model,\n\t\t\t)\n\t\t);\n\t}", "function send_news_letter() {\n $this->load->view('includes/header');\n $this->load->view('includes/top_header');\n $this->load->view('includes/left_panel');\n\n $data['template'] = $this->news_letter_model->get_news_letter_template();\n $this->load->view('news_letter/edit_news_letter', $data);\n\n $this->load->view('includes/footer');\n }", "function upgrade_1767() {\n $table = table_by_key('fetchmail');\n db_query_parsed(\"UPDATE $table SET active='{BOOL_TRUE}'\");\n}", "public static function member_opened_newsletter( $send_id, $newsletter_member_id, $open_type = false, $open_id = false ) {\n\n\t\t// we also clear any bounce_count on the newsletter_member\n\t\t// this is the only way we can reset the bounce count reliably.\n\t\t$sql = \"UPDATE `\" . _DB_PREFIX . \"newsletter_member` SET bounce_count = 0 WHERE newsletter_member_id = \" . (int) $newsletter_member_id . \" LIMIT 1\";\n\t\tquery( $sql );\n\n\t\t$sql = \"UPDATE `\" . _DB_PREFIX . \"newsletter_send_member` SET open_time = '\" . time() . \"' WHERE newsletter_member_id = \" . (int) $newsletter_member_id . \" AND send_id = '\" . (int) $send_id . \"' AND open_time = 0 LIMIT 1\";\n\t\tquery( $sql );\n\t\tswitch ( $open_type ) {\n\t\t\tcase 'link':\n\t\t\t\tif ( $open_id > 0 ) {\n\t\t\t\t\tupdate_insert( 'link_open_id', 'new', 'newsletter_link_open', array(\n\t\t\t\t\t\t'link_id' => $open_id,\n\t\t\t\t\t\t'newsletter_member_id' => $newsletter_member_id,\n\t\t\t\t\t\t'send_id' => $send_id,\n\t\t\t\t\t\t'timestamp' => time(),\n\t\t\t\t\t) );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'image':\n\t\t\t\tif ( $open_id > 0 ) {\n\t\t\t\t\t// we're not tracking which images have been opened.\n\t\t\t\t\t// but we could do this down the track to see what percentage of members have images enabled.\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}", "function notificationEnabled(){\n\t\treturn false;\n\t}", "public function client_active_toggle($id){\r\n $client = $this->get_clients($id);\r\n\r\n if($client['is_active'] == 1){\r\n $sql = \"UPDATE clients SET is_active = 0 WHERE id = '$id'\";\r\n return $this->db->query($sql);\r\n }else{\r\n $sql = \"UPDATE clients SET is_active = 1 WHERE id = '$id'\";\r\n return $this->db->query($sql);\r\n }\r\n }", "public function comment_flag_enable() {\n\t\t\t$enabled = $this->is_enabled();\n\t\t\t?>\n\t\t\t<label for=\"<?php echo esc_attr( $this->_plugin_prefix ); ?>_enabled\">\n\t\t\t\t<input name=\"<?php echo esc_attr( $this->_plugin_prefix ); ?>_enabled\" id=\"<?php echo esc_attr( $this->_plugin_prefix ); ?>_enabled\" type=\"checkbox\" value=\"1\" <?php checked( $enabled ); ?> />\n\t\t\t\t<?php esc_html_e( \"Allow your visitors to flag a comment as inappropriate.\" ); ?>\n\t\t\t</label>\n\t\t\t<?php\n\t\t}", "function toggleClientList()\n\t{\n\t\tif ($this->setup->ini->readVariable(\"clients\",\"list\"))\n\t\t{\n\t\t\t$this->setup->ini->setVariable(\"clients\",\"list\",\"0\");\n\t\t\t$this->setup->ini->write();\n\t\t\tilUtil::sendInfo($this->lng->txt(\"list_disabled\"),true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->setup->ini->setVariable(\"clients\",\"list\",\"1\");\n\t\t\t$this->setup->ini->write();\n\t\t\tilUtil::sendInfo($this->lng->txt(\"list_enabled\"),true);\n\t\t}\n\n\t\tilUtil::redirect(\"setup.php\");\n\t}", "function simple_set_toggle( $pFeature, $pPackageName = NULL ) {\n\t// make function compatible with {html_checkboxes}\n\tif( isset( $_REQUEST[$pFeature][0] ) ) {\n\t\t$_REQUEST[$pFeature] = $_REQUEST[$pFeature][0];\n\t}\n\ttoggle_preference( $pFeature, ( isset( $_REQUEST[$pFeature] ) ? $_REQUEST[$pFeature] : NULL ), $pPackageName );\n}", "public function togglePreceptorAction()\n {\n $preceptor = \\Fisdap\\EntityUtils::getEntity(\"PreceptorLegacy\", $this->_getParam(\"preceptor\"));\n $site = \\Fisdap\\EntityUtils::getEntity(\"SiteLegacy\", $this->_getParam(\"site\"));\n $return = false;\n \n if ($preceptor) {\n $assoc = $preceptor->getAssociationByProgram($this->view->program->id);\n $assoc->active = (!$assoc->active);\n $assoc->save();\n $return = true;\n }\n \n $this->_helper->json($return);\n }", "private function toggle($toggle = '', $transientKey = '') {\n if (in_array($toggle, ['enable', 'disable']) && Gdn::session()->validateTransientKey($transientKey)) {\n if ($toggle == 'enable' && Gdn::addonManager()->isEnabled('embedvanilla', \\Vanilla\\Addon::TYPE_ADDON)) {\n throw new Gdn_UserException('You must disable the \"Embed Vanilla\" plugin before continuing.');\n }\n\n // Do the toggle\n saveToConfig('Garden.Embed.Allow', $toggle == 'enable' ? true : false);\n return true;\n }\n return false;\n }", "public function flag( $notes, $toggle ) {\n\t\t$flag = $this->isSystemCall() ? 'autoflag' : 'flag';\n\t\t$this->feedback->{\"aft_$flag\"}++;\n\t\t$this->logId = $this->log( $flag, $this->feedback->aft_page, $this->feedback->aft_id, $notes, $this->isSystemCall() ? null : $this->user );\n\n\t\tglobal $wgArticleFeedbackv5HideAbuseThreshold;\n\n\t\t// auto-hide after [threshold] flags\n\t\tif ( $this->feedback->aft_flag + $this->feedback->aft_autoflag > $wgArticleFeedbackv5HideAbuseThreshold &&\n\t\t\t!$this->feedback->isHidden() ) {\n\t\t\t/*\n\t\t\t * We want to keep track of hides/unhides, but also autohides.\n\t\t\t * Feedback will be hidden when hide + autohide > unhide\n\t\t\t */\n\t\t\t$this->feedback->aft_hide = 1;\n\t\t\t$this->feedback->aft_autohide = 1;\n\t\t\t$this->log( 'autohide', $this->feedback->aft_page, $this->feedback->aft_id, 'Automatic hide', $this->user );\n\t\t}\n\n\t\treturn true;\n\t}", "function pro_bottom_newsletter()\n{\n\t$pro = get_option('up_themes_betty_commerce_wordpress_theme');\n\t\n\tif( !empty( $pro['bottom_newsletter_optin'] ) )\n\t{\n\t\treturn $pro['bottom_newsletter_optin'];\n\t}\n\treturn false;\n}", "public function switchOn();", "public function handle_dashboard_toggle() {\n\t\t\tif ( isset( $_GET['woocart-dashboard'] ) ) {\n\t\t\t\t$woocart_dashboard = empty( $_GET['woocart-dashboard'] ) ? 'no' : 'yes';\n\t\t\t\tupdate_option( '_hide_woocart_dashboard', $woocart_dashboard );\n\t\t\t\twp_redirect( admin_url() );\n\t\t\t\texit;\n\t\t\t}\n\t\t}", "public function getNewsletterUrl()\n {\n return $this->urlBuilder->getUrl('walleycheckout/newsletter');\n }", "public function UpdateFlagViewed(){\n\t\t\tinclude 'dbconnect.php';\n\t\t\t$Changeflag = 1; $flag =0;\n\t\t\t$Sql = $Connection->prepare(\"UPDATE InviteLinks SET flag =:Flag WHERE AdminID=:tempAdminID AND userID=:tempUserId AND flag=:tempFlag AND RoomID=:tempRoomID\");\n\t\t\t$Sql->execute(array('Flag' => $Changeflag, 'tempAdminID' => $this->getAdminID(), 'tempUserId' => $this->getInvitedID(), 'tempFlag' => $flag,'tempRoomID' => $this->getRoomID()));\n\t\t\t$Connection = null;\n\t\t}", "function send_email_to_member() {\r\n global $wpdb;\r\n\r\n if ( $_REQUEST['check_key'] != $_SESSION['check_key'] )\r\n die('error1');\r\n\r\n $send_id = $_REQUEST['send_id'];\r\n //get data of newsletter\r\n $send_data = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM {$this->tb_prefix}enewsletter_send WHERE send_id = %d\", $send_id ), \"ARRAY_A\");\r\n\r\n $send_member = $wpdb->get_row( $wpdb->prepare( \"SELECT * FROM {$this->tb_prefix}enewsletter_send_members WHERE send_id = %d AND status = 'waiting_send' LIMIT 0, 1\", $send_id ), \"ARRAY_A\");\r\n\r\n if ( ! $send_member ) {\r\n if ( ! wp_next_scheduled( 'e_newsletter_cron_check_bounces_1' . $wpdb->blogid ) )\r\n wp_schedule_single_event( time() + 60, 'e_newsletter_cron_check_bounces_1' . $wpdb->blogid );\r\n\r\n die('end');\r\n }\r\n\r\n $member_data = $this->get_member( $send_member['member_id'] );\r\n\r\n require_once( $this->plugin_dir . \"email-newsletter-files/phpmailer/class.phpmailer.php\" );\r\n\r\n $newsletter_data = $this->get_newsletter_data( $send_data['newsletter_id'] );\r\n\r\n $unsubscribe_code = $member_data['unsubscribe_code'];\r\n\r\n $siteurl = get_option( 'siteurl' );\r\n\r\n $mail = new PHPMailer();\r\n\r\n $mail->CharSet = 'UTF-8';\r\n\r\n //Set Sending Method\r\n switch( $this->settings['outbound_type'] ) {\r\n case 'smtp':\r\n $mail->IsSMTP();\r\n $mail->Host = $this->settings['smtp_host'];\r\n $mail->SMTPAuth = ( strlen( $this->settings['smtp_user'] ) > 0 );\r\n if( $mail->SMTPAuth ){\r\n $mail->Username = $this->settings['smtp_user'];\r\n $mail->Password = $this->settings['smtp_pass'];\r\n }\r\n break;\r\n\r\n case 'mail':\r\n $mail->IsMail();\r\n break;\r\n\r\n case 'sendmail':\r\n $mail->IsSendmail();\r\n break;\r\n }\r\n\r\n $contents = $send_data['email_body'];\r\n //Replace content of template\r\n $contents = str_replace( \"{OPENED_TRACKER}\", '<img src=\"' . $siteurl . '/wp-admin/admin-ajax.php?action=check_email_opened&send_id=' . $send_id . '&member_id=' . $member_data['member_id'] . '\" width=\"1\" height=\"1\" style=\"display:none;\" />', $contents );\r\n\r\n $contents = str_replace( \"{UNSUBSCRIBE_URL}\", $siteurl . '/newsletter-professional/unsubscribe/' . $unsubscribe_code . $member_data['member_id'] . '/', $contents );\r\n\r\n $mail->From = $newsletter_data['from_email'];\r\n $mail->FromName = $newsletter_data['from_name'];\r\n $mail->Subject = $newsletter_data[\"subject\"];\r\n\r\n $mail->MsgHTML( $contents );\r\n\r\n $mail->AddAddress( $member_data[\"member_email\"] );\r\n\r\n $mail->MessageID = 'Newsletters-' . $send_member['member_id'] . '-' . $send_id . '-'. md5( 'Hash of bounce member_id='. $send_member['member_id'] . ', send_id='. $send_id );\r\n\r\n if( ! $mail->Send() ) {\r\n// return \"Mailer Error: \" . $mail->ErrorInfo;\r\n die('error');\r\n } else {\r\n //write info of Sent in DB\r\n $result = $wpdb->query( $wpdb->prepare( \"UPDATE {$this->tb_prefix}enewsletter_send_members SET status = 'sent' WHERE send_id = %d AND member_id = %d\", $send_id, $send_member['member_id'] ) );\r\n if ( $result )\r\n die('ok');\r\n else\r\n die('error');\r\n }\r\n }", "public function changeSubmitBox()\n {\n $post = WordPress::getPost();\n\n if ($post->post_type == 'lbwp-nl') {\n // Check if the newsletters sent flag needs to be reset\n $this->checkSendReset($post);\n\n // Check if the hourly cron must be executed immediately\n $this->checkSendImmediately($post);\n\n // Get the newsletter (whose data ight be altered previously)\n $newsletter = $this->getNewsletter($post->ID);\n\n // If the newsletter is already sent, add some css/js do alter the box\n if ($newsletter->sent == 1) {\n echo '\n <script type=\"text/javascript\">\n jQuery(function() {\n jQuery(\"#submitpost a\").remove();\n jQuery(\"#major-publishing-actions\").remove();\n // Create info\n var info = jQuery(\"<div/>\");\n info.addClass(\"misc-pub-section\");\n info.css(\"font-weight\", \"bold\");\n info.text(\"Der Newsletter wurde bereits an den Dienst gesendet und eingeplant.\");\n var link = jQuery(\"<div/>\");\n link.addClass(\"misc-pub-section\");\n link.html(\\'<a href=\"\\' + document.location.href + \\'&resetSent\">Zurücksetzen und erneut einplanen</a>\\');\n jQuery(\"#misc-publishing-actions\").after(link).after(info);\n });\n </script>\n ';\n }\n }\n }", "public function toggle(Site $site, Channel $channel)\n {\n if ($channel->refreshes === 'yes') {\n $channel->refreshes = 'no';\n flash()->warning('Auto Refresh turned <strong>off</strong>.');\n } else {\n $channel->refreshes = 'yes';\n flash()->success('Auto Refresh turned <strong>on</strong>.');\n }\n\n $channel->save();\n\n return redirect()->back();\n }", "public function toggle_status( WP_REST_Request $data ) {\n\n\t\t$this->security_check( $data );\n\n\t\t$response = $this->sql->get_by( array( 'id' => $data['id'] ) );\n\t\t$response = (array) $response[0];\n\t\t$id_user = $response['id_user'];\n\t\t$title = $response['title'];\n\n\t\tif ( $response['status'] === 'open' ) {\n\t\t\t$toggle = $this->sql->update(\n\t\t\t\tarray( 'status' => 'close' ),\n\t\t\t\tarray( 'id' => $data['id'] )\n\t\t\t);\n\n\t\t\t$this->send_email( $id_user, $title, $this->closed );\n\n\t\t\treturn $toggle;\n\t\t}\n\n\t\tif ( $response['status'] === 'close' ) {\n\t\t\t$toggle = $this->sql->update(\n\t\t\t\tarray( 'status' => 'open' ),\n\t\t\t\tarray( 'id' => $data['id'] )\n\t\t\t);\n\n\t\t\t$this->send_email( $id_user, $title, $this->opened );\n\n\t\t\treturn $toggle;\n\t\t}\n\t}", "public function toggle(){\n \n $taskId = $this->request->data('id');\n\n $task = $this->Task->find('first', array(\n 'contain' => array(),\n 'conditions' => array(\n 'Task.id' => $taskId\n )\n ));\n\n if(empty($task))\n throw new NotFoundException('This task does not exist');\n\n $this->Task->id = $taskId;\n $result = $this->Task->save(array(\n 'Task' => array(\n 'completed' => ($task['Task']['completed'] ? '0' : '1')\n )\n ));\n\n if(!$result)\n throw new InternalErrorException('Failed to update task');\n\n $task = $this->Task->read(null, $taskId); \n\n $this->set(array(\n 'isCompleted' => $task['Task']['completed'],\n 'completedOn' => date('M j, g:i a', strtotime($task['Task']['updated'])),\n '_serialize' => array(\n 'isCompleted',\n 'completedOn'\n )\n ));\n }", "public function show(Newsletter $newsletter)\n {\n // READ D'UNE LIGNE\n }", "function simplenews_admin_newsletter_form($form, &$form_state, SimplenewsNewsletter $newsletter = NULL) {\n if (is_null($newsletter)) {\n $newsletter = entity_create('simplenews_newsletter', array());\n }\n\n $form_state['newsletter'] = $newsletter;\n // Check whether we need a deletion confirmation form.\n if (isset($form_state['confirm_delete']) && isset($form_state['values']['newsletter_id'])) {\n $newsletter = simplenews_newsletter_load($form_state['values']['newsletter_id']);\n return simplenews_admin_newsletter_delete($form, $form_state, $newsletter);\n }\n $form['newsletter_id'] = array(\n '#type' => 'value',\n '#value' => $newsletter->newsletter_id,\n );\n $form['name'] = array(\n '#type' => 'textfield',\n '#title' => t('Name'),\n '#default_value' => $newsletter->name,\n '#maxlength' => 255,\n '#required' => TRUE,\n );\n $form['description'] = array(\n '#type' => 'textfield',\n '#title' => t('Description'),\n '#default_value' => $newsletter->description,\n );\n $form['weight'] = array(\n '#type' => 'hidden',\n '#value' => $newsletter->weight,\n );\n $form['subscription'] = array(\n '#type' => 'fieldset',\n '#title' => t('Subscription settings'),\n '#collapsible' => FALSE,\n );\n\n // Subscribe at account registration time.\n $options = simplenews_new_account_options();\n $form['subscription']['new_account'] = array(\n '#type' => 'select',\n '#title' => t('Subscribe new account'),\n '#options' => $options,\n '#default_value' => $newsletter->new_account,\n '#description' => t('None: This newsletter is not listed on the user registration page.<br />Default on: This newsletter is listed on the user registion page and is selected by default.<br />Default off: This newsletter is listed on the user registion page and is not selected by default.<br />Silent: A new user is automatically subscribed to this newsletter. The newsletter is not listed on the user registration page.'),\n );\n\n // Type of (un)subsribe confirmation\n $options = simplenews_opt_inout_options();\n $form['subscription']['opt_inout'] = array(\n '#type' => 'select',\n '#title' => t('Opt-in/out method'),\n '#options' => $options,\n '#default_value' => $newsletter->opt_inout,\n '#description' => t('Hidden: This newsletter does not appear on subscription forms. No unsubscription footer in newsletter.<br /> Single: Users are (un)subscribed immediately, no confirmation email is sent.<br />Double: When (un)subscribing at a subscription form, anonymous users receive an (un)subscription confirmation email. Authenticated users are (un)subscribed immediately.'),\n );\n\n // Provide subscription block for this newsletter.\n $form['subscription']['block'] = array(\n '#type' => 'checkbox',\n '#title' => t('Subscription block'),\n '#default_value' => $newsletter->block,\n '#description' => t('A subscription block will be provided for this newsletter. Anonymous and authenticated users can subscribe and unsubscribe using this block.'),\n );\n\n $form['email'] = array(\n '#type' => 'fieldset',\n '#title' => t('Email settings'),\n '#collapsible' => FALSE,\n );\n // Hide format selection if there is nothing to choose.\n // The default format is plain text.\n $format_options = simplenews_format_options();\n if (count($format_options) > 1) {\n $form['email']['format'] = array(\n '#type' => 'radios',\n '#title' => t('Email format'),\n '#default_value' => $newsletter->format,\n '#options' => $format_options,\n );\n }\n else {\n $form['email']['format'] = array(\n '#type' => 'hidden',\n '#value' => key($format_options),\n );\n $form['email']['format_text'] = array(\n '#markup' => t('Newsletter emails will be sent in %format format.', array('%format' => $newsletter->format)),\n );\n }\n // Type of hyperlinks.\n $form['email']['hyperlinks'] = array(\n '#type' => 'radios',\n '#title' => t('Hyperlink conversion'),\n '#description' => t('Determine how the conversion to text is performed.'),\n '#options' => array(t('Append hyperlinks as a numbered reference list'), t('Display hyperlinks inline with the text')),\n '#default_value' => $newsletter->hyperlinks,\n '#states' => array(\n 'visible' => array(\n ':input[name=\"format\"]' => array(\n 'value' => 'plain',\n ),\n ),\n ),\n );\n\n $form['email']['priority'] = array(\n '#type' => 'select',\n '#title' => t('Email priority'),\n '#default_value' => $newsletter->priority,\n '#options' => simplenews_get_priority(),\n );\n $form['email']['receipt'] = array(\n '#type' => 'checkbox',\n '#title' => t('Request receipt'),\n '#return_value' => 1,\n '#default_value' => $newsletter->receipt,\n );\n\n // Email sender name\n $form['simplenews_sender_information'] = array(\n '#type' => 'fieldset',\n '#title' => t('Sender information'),\n '#collapsible' => FALSE,\n );\n $form['simplenews_sender_information']['from_name'] = array(\n '#type' => 'textfield',\n '#title' => t('From name'),\n '#size' => 60,\n '#maxlength' => 128,\n '#default_value' => $newsletter->from_name,\n );\n\n // Email subject\n $form['simplenews_subject'] = array(\n '#type' => 'fieldset',\n '#title' => t('Newsletter subject'),\n '#collapsible' => FALSE,\n );\n if (module_exists('token')) {\n $form['simplenews_subject']['token_help'] = array(\n '#title' => t('Replacement patterns'),\n '#type' => 'fieldset',\n '#collapsible' => TRUE,\n '#collapsed' => TRUE,\n );\n $form['simplenews_subject']['token_help']['browser'] = array(\n '#theme' => 'token_tree',\n '#token_types' => array('simplenews-newsletter', 'node', 'simplenews-subscriber'),\n );\n }\n\n $form['simplenews_subject']['email_subject'] = array(\n '#type' => 'textfield',\n '#title' => t('Email subject'),\n '#size' => 60,\n '#maxlength' => 128,\n '#required' => TRUE,\n '#default_value' => $newsletter->email_subject,\n );\n\n // Email from address\n $form['simplenews_sender_information']['from_address'] = array(\n '#type' => 'textfield',\n '#title' => t('From email address'),\n '#size' => 60,\n '#maxlength' => 128,\n '#required' => TRUE,\n '#default_value' => $newsletter->from_address,\n );\n\n $form['actions'] = array('#type' => 'actions');\n $form['actions']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save'),\n '#weight' => 50,\n );\n\n if ($newsletter->newsletter_id) {\n $form['actions']['delete'] = array(\n '#type' => 'submit',\n '#value' => t('Delete'),\n '#weight' => 55,\n );\n }\n return $form;\n}", "function ci_theme_show_newsletter_widget($atts)\n{\n\textract(shortcode_atts( array(\n\t\t'title' => '',\n\t\t'description' => '',\n\t\t'button_text' => __('Subscribe', 'ci_theme')\n\t), $atts ));\n\n\n\tob_start();\n\t\n\tif(ci_setting('newsletter_action')!=''):\n\t\t?>\n\t\t<div class=\"widget ci-newsletter bg bs\">\n\t\t\t<?php if( !empty($title) ): ?>\n\t\t\t\t<h3><?php echo $title; ?></h3>\n\t\t\t<?php endif; ?>\n\t\t\t<?php if( !empty($description) ): ?>\n\t\t\t\t<?php echo wpautop($description); ?>\n\t\t\t<?php endif; ?>\n\n\t\t\t<form class=\"newsletter-form\" action=\"<?php ci_e_setting('newsletter_action'); ?>\">\n\t\t\t\t<p>\n\t\t\t\t\t<input type=\"text\" id=\"<?php ci_e_setting('newsletter_email_id'); ?>\" name=\"<?php ci_e_setting('newsletter_email_name'); ?>\" placeholder=\"<?php echo esc_attr(__('Your Email', 'ci_theme')); ?>\">\n\t\t\t\t\t<input type=\"submit\" class=\"btn\" value=\"<?php echo esc_attr($button_text); ?>\">\n\t\t\t\t</p>\n\t\t\t\t<?php\n\t\t\t\t\t$fields = ci_setting('newsletter_hidden_fields');\n\t\t\t\t\tif(is_array($fields) and count($fields) > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor( $i = 0; $i < count($fields); $i+=2 )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(empty($fields[$i]))\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\techo '<input type=\"hidden\" name=\"'.esc_attr($fields[$i]).'\" value=\"'.esc_attr($fields[$i+1]).'\" />';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</form>\n\t\t</div>\n\t\t<?php\n\tendif;\n\t\n\t$output = ob_get_clean();\n\treturn $output;\n\n}", "public function setAsDraft();", "public function setFlag(): void\n {\n $this->session->setData(ConfigProvider::SESSION_FLAG, true);\n }", "function do_double_opt_in( $member_id ){\r\n $message = '';\r\n if( isset( $this->settings['double_opt_in'] ) && $this->settings['double_opt_in'] ) {\r\n\r\n $siteurl = get_option( 'siteurl' );\r\n\r\n $member_data = $this->get_member( $member_id );\r\n\r\n $email_to = $member_data['member_email'];\r\n $email_from = $this->settings['from_email'];\r\n $email_from_name = $this->settings['from_name'];\r\n $email_subject = ( isset( $this->settings['double_opt_in_subject'] ) ) ? $this->settings['double_opt_in_subject'] : 'Confirm newsletter subscription';\r\n $email_contents = file_get_contents( $this->plugin_dir . \"email-newsletter-files/emails/double_optin.html\" );\r\n\r\n $replace = array(\r\n \"from_name\"=>$email_from_name,\r\n \"CONFIRM_SUBSCRIPTION\"=> $siteurl . '/wp-admin/admin-ajax.php?action=confirm_subscibe&member_id=' . $member_id .'&hash='.md5( \"sometext123\" . $member_id ) . '',\r\n \"first_name\"=>$member_data['member_fname'],\r\n \"last_name\"=>$member_data['member_lname'],\r\n \"email\"=>$member_data['member_email'],\r\n );\r\n\r\n foreach( $replace as $key=>$val ) {\r\n if( is_array( $val ) )continue;\r\n $email_contents = preg_replace( '/\\{'.strtoupper( preg_quote( $key,'/' ) ).'\\}/', $val, $email_contents );\r\n }\r\n if( !$this->send_email( $email_from_name, $email_from, $email_to, $email_subject, $email_contents ) ) {\r\n $message .= \"Failed to send opt-in email, please contact us to inform us of this error. \";\r\n }else{\r\n }\r\n }\r\n\r\n }" ]
[ "0.6902423", "0.6899355", "0.63957596", "0.6337664", "0.6250422", "0.6209277", "0.6051416", "0.5944239", "0.5896932", "0.5843212", "0.5803025", "0.5760682", "0.57449025", "0.5739433", "0.5717598", "0.56701994", "0.5665886", "0.5634194", "0.56235", "0.5613127", "0.5573245", "0.5562252", "0.5546162", "0.5531277", "0.551703", "0.5500369", "0.5495126", "0.546193", "0.5445006", "0.54372805", "0.54176426", "0.54145414", "0.54097074", "0.54043704", "0.54032356", "0.5377811", "0.53607655", "0.5357172", "0.53272915", "0.5313695", "0.5309919", "0.53098834", "0.5308803", "0.5305241", "0.52914137", "0.5284053", "0.52753544", "0.52624154", "0.52560127", "0.5254097", "0.52496684", "0.5243887", "0.52398187", "0.52392584", "0.52392584", "0.52392584", "0.5233765", "0.5221393", "0.5207437", "0.51888376", "0.5182522", "0.51799184", "0.51799184", "0.51744723", "0.5168309", "0.51671463", "0.51536405", "0.5150844", "0.51501316", "0.51282114", "0.5126391", "0.51214945", "0.511822", "0.5096253", "0.50912535", "0.50885415", "0.5083467", "0.5077468", "0.50748324", "0.5072907", "0.5062302", "0.50434226", "0.5042856", "0.50411165", "0.5040087", "0.5034737", "0.50330245", "0.50329405", "0.50307876", "0.50303054", "0.50264394", "0.5021015", "0.5003697", "0.4997046", "0.49944326", "0.49929398", "0.49905568", "0.49890003", "0.49888828", "0.49854678" ]
0.53506756
38
Toggle newsletter optin flag
public function processChangeOptinVal() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function maybe_push_optin_notice() {\n\t\tif ( self::get_optIn_state() == false && apply_filters( 'xl_optin_notif_show', self::$should_show_optin ) ) {\n\t\t\tdo_action( 'maybe_push_optin_notice_state_action' );\n\t\t}\n\t}", "public static function block_optin() {\n\t\tupdate_option( 'xlp_is_opted', 'no', false );\n\t}", "public function isNewsletterPopUpEnable() \n {\n return (bool) Mage::getStoreConfig(self::XML_PATH_ENABLE);\n }", "function got_chosen_intg_activation() {\n $default_opts = array('gcid' => '', 'feedkey' => '', 'shareable' => true, 'commentable' => true, 'pub_minifeed_default' => true, 'webcurtain' => true, 'webcurtain_compat' => false );\n update_option('got_chosen_intg_settings', $default_opts);\n}", "public function updatedOptIn()\n {\n $this->updateValue(\n 'opt_in',\n $this->optIn,\n \"You have updated the customer's marketing email subscription.\"\n );\n }", "function do_double_opt_in( $member_id ){\r\n $message = '';\r\n if( isset( $this->settings['double_opt_in'] ) && $this->settings['double_opt_in'] ) {\r\n\r\n $siteurl = get_option( 'siteurl' );\r\n\r\n $member_data = $this->get_member( $member_id );\r\n\r\n $email_to = $member_data['member_email'];\r\n $email_from = $this->settings['from_email'];\r\n $email_from_name = $this->settings['from_name'];\r\n $email_subject = ( isset( $this->settings['double_opt_in_subject'] ) ) ? $this->settings['double_opt_in_subject'] : 'Confirm newsletter subscription';\r\n $email_contents = file_get_contents( $this->plugin_dir . \"email-newsletter-files/emails/double_optin.html\" );\r\n\r\n $replace = array(\r\n \"from_name\"=>$email_from_name,\r\n \"CONFIRM_SUBSCRIPTION\"=> $siteurl . '/wp-admin/admin-ajax.php?action=confirm_subscibe&member_id=' . $member_id .'&hash='.md5( \"sometext123\" . $member_id ) . '',\r\n \"first_name\"=>$member_data['member_fname'],\r\n \"last_name\"=>$member_data['member_lname'],\r\n \"email\"=>$member_data['member_email'],\r\n );\r\n\r\n foreach( $replace as $key=>$val ) {\r\n if( is_array( $val ) )continue;\r\n $email_contents = preg_replace( '/\\{'.strtoupper( preg_quote( $key,'/' ) ).'\\}/', $val, $email_contents );\r\n }\r\n if( !$this->send_email( $email_from_name, $email_from, $email_to, $email_subject, $email_contents ) ) {\r\n $message .= \"Failed to send opt-in email, please contact us to inform us of this error. \";\r\n }else{\r\n }\r\n }\r\n\r\n }", "function handle_opt_in_form() {\n\tif ( isset( $_POST['altis_telemetry_opt_in'] ) && check_admin_referer( 'altis_telemetry_opt_in' ) ) {\n\t\topt_in( true );\n\t}\n\tif ( isset( $_POST['altis_telemetry_opt_out'] ) && check_admin_referer( 'altis_telemetry_opt_in' ) ) {\n\t\topt_in( false );\n\t}\n}", "public function optIn() {\n return !empty($this->args['send_optin']);\n }", "public function setShowNewsletter($blShow)\n {\n $this->_iNewsStatus = $blShow;\n }", "static public function setSendAsNewsletter()\n\t{\n\t\tself::$_sendAsNewsletter = true;\n\t}", "public static function Allow_optin() {\n\t\tupdate_option( 'xlp_is_opted', 'yes', false );\n\n\t\t//try to push data for once\n\t\t$data = self::collect_data();\n\n\t\t//posting data to api\n\t\tXL_API::post_tracking_data( $data );\n\t}", "public function comment_flag_enable() {\n\t\t\t$enabled = $this->is_enabled();\n\t\t\t?>\n\t\t\t<label for=\"<?php echo esc_attr( $this->_plugin_prefix ); ?>_enabled\">\n\t\t\t\t<input name=\"<?php echo esc_attr( $this->_plugin_prefix ); ?>_enabled\" id=\"<?php echo esc_attr( $this->_plugin_prefix ); ?>_enabled\" type=\"checkbox\" value=\"1\" <?php checked( $enabled ); ?> />\n\t\t\t\t<?php esc_html_e( \"Allow your visitors to flag a comment as inappropriate.\" ); ?>\n\t\t\t</label>\n\t\t\t<?php\n\t\t}", "function blondcoin_donation_activation() {\r\n $options_array = array(\r\n 'blondcoin_account' => '',\r\n 'target' => '_blank'\r\n );\r\n if (get_option('blondcoin_donation_options') !== false) {\r\n update_option('blondcoin_donation_options', $options_array);\r\n } else {\r\n add_option('blondcoin_donation_options', $options_array);\r\n }\r\n}", "function pro_bottom_newsletter()\n{\n\t$pro = get_option('up_themes_betty_commerce_wordpress_theme');\n\t\n\tif( !empty( $pro['bottom_newsletter_optin'] ) )\n\t{\n\t\treturn $pro['bottom_newsletter_optin'];\n\t}\n\treturn false;\n}", "function chch_popup_pro_agile_set_adapter() {\n if(!empty($_POST['_chch_pop_up_pro_newsletter_adapter'])) {\n $_POST['_chch_pop_up_pro_newsletter_adapter'] = 'AgileCRM';\n }\n}", "public function add_activate_switch()\n {\n if (OptinCampaignsRepository::is_split_test_variant($this->optin_campaign_id)) return;\n\n $input_value = OptinCampaignsRepository::is_activated($this->optin_campaign_id) ? 'yes' : 'no';\n $checked = ($input_value == 'yes') ? 'checked=\"checked\"' : null;\n $tooltip = __('Toggle to activate and deactivate optin.', 'mailoptin');\n\n $switch = sprintf(\n '<input id=\"mo-optin-activate-switch\" type=\"checkbox\" class=\"tgl tgl-light\" value=\"%s\" %s />',\n $input_value,\n $checked\n );\n\n $switch .= '<label id=\"mo-optin-active-switch\" for=\"mo-optin-activate-switch\" class=\"tgl-btn\"></label>';\n $switch .= '<span title=\"' . $tooltip . '\" class=\"mo-tooltipster dashicons dashicons-editor-help\" style=\"margin: 9px 5px;font-size: 18px;cursor: pointer;\"></span>';\n ?>\n <script type=\"text/javascript\">\n jQuery(function () {\n jQuery('#customize-header-actions').prepend(jQuery('<?php echo $switch; ?>'));\n });\n </script>\n <?php\n }", "public function setToggle() {\n $session = Gdn::session();\n if (!$session->isValid()) {\n return;\n }\n\n $showAllCategories = getIncomingValue('ShowAllCategories', '');\n if ($showAllCategories != '') {\n $showAllCategories = $showAllCategories == 'true' ? true : false;\n $showAllCategoriesPref = $session->getPreference('ShowAllCategories');\n if ($showAllCategories != $showAllCategoriesPref) {\n $session->setPreference('ShowAllCategories', $showAllCategories);\n }\n\n redirectTo('/'.ltrim(Gdn::request()->path(), '/'));\n }\n }", "function toggle_link($notify) {\n\n if ($notify == TRUE) {\n return FALSE;\n } elseif ($notify == FALSE) {\n return TRUE;\n }\n}", "function activateNewsletter() {\n\t\t$hash = t3lib_div::_GP('nlAuth');\n\t\t$userID = t3lib_div::_GP('u');\n\n\t\t// get the whole row\n\t\t$row = current($GLOBALS['TYPO3_DB']->exec_SELECTgetRows( '*', 'fe_users', 'uid=' . $userID ));\n\t\t$realHash = substr(sha1(serialize($row)), 1, 6); // first 6 letters from hash\n\t\tif ( $row['disable'] && ($realHash == $hash) ) { // hash matches\n\t\t\t// enable the user\n\t\t\t$GLOBALS['TYPO3_DB']->exec_UPDATEquery( 'fe_users', 'uid=' . $userID, array(\n\t\t\t\t'uid' => $userID,\n\t\t\t\t'disable' => '0' ) );\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function simple_set_toggle( $pFeature, $pPackageName = NULL ) {\n\t// make function compatible with {html_checkboxes}\n\tif( isset( $_REQUEST[$pFeature][0] ) ) {\n\t\t$_REQUEST[$pFeature] = $_REQUEST[$pFeature][0];\n\t}\n\ttoggle_preference( $pFeature, ( isset( $_REQUEST[$pFeature] ) ? $_REQUEST[$pFeature] : NULL ), $pPackageName );\n}", "public function provide_newsletter_options() {\n\t\twp_add_inline_script(\n\t\t\t'civil-first-fleet-admin-js',\n\t\t\tsprintf(\n\t\t\t\t'var civilNewsletterOptions = %1$s;',\n\t\t\t\twp_json_encode( $this->get_newsletter_options_for_gutenberg() )\n\t\t\t)\n\t\t);\n\t}", "private function activateMailChimpNewsletter()\n\t{\n\t\t$service = MailChimp_Newsletter::instance();\n\n\t\tif ($this->is_configured && $service->isConfigured()) {\n\n\t\t\t$service->setEnvironment($this->environment);\n\t\t\t$service->setVersion($this->version);\n\n\t\t\t// adding the ability to render the checkbox on another screen of the checkout page.\n\t\t\t$render_on = $service->getOption('mailchimp_checkbox_action', 'woocommerce_after_checkout_billing_form');\n\n\t\t\t$this->loader->add_action($render_on, $service, 'applyNewsletterField', 10);\n\n\t\t\t$this->loader->add_action('woocommerce_ppe_checkout_order_review', $service, 'applyNewsletterField', 10);\n\t\t\t$this->loader->add_action('woocommerce_register_form', $service, 'applyNewsletterField', 10);\n\n\t\t\t$this->loader->add_action('woocommerce_checkout_order_processed', $service, 'processNewsletterField', 10, 2);\n\t\t\t$this->loader->add_action('woocommerce_ppe_do_payaction', $service, 'processPayPalNewsletterField', 10, 1);\n\t\t\t$this->loader->add_action('woocommerce_register_post', $service, 'processRegistrationForm', 10, 3);\n\t\t}\n\t}", "protected function set_activation_flag( bool $network_wide = false ): bool {\n\t\tif ( $network_wide ) {\n\t\t\treturn update_site_option( self::OPTION_SHOW_ACTIVATION_NOTICE, '1' );\n\t\t}\n\n\t\treturn update_option( self::OPTION_SHOW_ACTIVATION_NOTICE, '1', false );\n\t}", "public function toggleDoSpamFlag()\n {\n $response = $this->sendCommand(static::RCMD_DOSPAM);\n return $response->getData() === 'Spamming is now: On';\n }", "public function wishlist_toggle()\n\t{\n\t\t// no return needed as page is reloaded\n\t\t$this->EE->job_wishlists->wishlist_toggle();\t\t\n\t}", "function setting_admin_email() {\n\t$options = get_option('nrelate_admin_options');\n\t$checked = (isset($options['admin_email_address']) && $options['admin_email_address']=='on') ? ' checked=\"checked\" ' : '';\n\techo \"<input \".$checked.\" name='nrelate_admin_options[admin_email_address]' type='checkbox' />\";\n}", "function filter_posts_toggle() {\n\n\t\t$is_private_filter_on = isset( $_GET['private_posts'] ) && 'private' == $_GET['private_posts'];\n\n\t\t?>\n\n\t\t<select name=\"private_posts\">\n\t\t\t<option <?php selected( $is_private_filter_on, false ); ?> value=\"public\">Public</option>\n\t\t\t<option <?php selected( $is_private_filter_on, true ); ?> value=\"private\">Private</option>\n\t\t</select>\n\n\t\t<?php\n\n\t}", "private function toggleTunnel(){\n\t\tif(isset($_POST['tunnelid']) && is_numeric($_POST['tunnelid'])){\n\t\t\tforeach($this->data->tunnels->tunnel as $tunnel){\n\t\t\t\tif((string)$tunnel['id'] == $_POST['tunnelid']){\n\t\t\t\t\t\n\t\t\t\t\tif((string)$tunnel['enable'] == 'true'){\n\t\t\t\t\t\t$tunnel['enable'] = 'false';\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\t$tunnel['enable'] = 'true';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$this->config->saveConfig();\n\t\t\t\t\techo '<reply action=\"ok\"/>';\n\t\t\t\t\treturn true;\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tthrow new Exception('The specified tunnel could not be found');\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tthrow new Exception('An invalid tunnel identifier was submitted');\n\t\t}\n\t}", "protected function toggleDisableAction() {}", "function user_profile_options( WP_User $user ) : void {\n\t?>\n\t<table class=\"form-table\">\n\t\t<tr>\n\t\t\t<th>\n\t\t\t\t<label for=\"altis_telemetry_opt_in\"><?php esc_html_e( 'Altis Telemetry', 'altis' ); ?></label>\n\t\t\t</th>\n\t\t\t<td>\n\t\t\t\t<input type=\"checkbox\" name=\"altis_telemetry_opt_in_toggle\" id=\"altis_telemetry_opt_in\" <?php checked( is_user_opted_in( $user ) ) ?> value=\"1\" />\n\t\t\t\t<label for=\"altis_telemetry_opt_in\"><?php esc_html_e( 'Opt in to Altis Telemetry', 'altis' ); ?></label>\n\t\t\t\t<p class=\"description\"><?php esc_html_e( 'To help us develop Altis, we would like to collect data on your usage of the software. This will help us build a better product for you.', 'altis' ); ?></p>\n\t\t\t</td>\n\t\t</tr>\n\t</table>\n\t<?php\n}", "function aaModelSetManualImail ($imail_toggle) {\r\n\r\n\tglobal $pdo_conn, $pdo_t;\r\n\r\n\t$imail_toggle = (isset($imail_toggle)) ? 1 : 0;\r\n\t\r\n\t$sql = \"UPDATE \".$pdo_t['t_settings'].\" SET Imail_Manual = :imail_toggle LIMIT 1\";\r\n\t\r\n\t$q = $pdo_conn->prepare($sql);\r\n\t$q->execute(array('imail_toggle' => $imail_toggle));\r\n\t\r\n\t// redirect to general settings section\r\n\theader('Location: '.$_SERVER['REQUEST_URI']);\r\n\texit;\r\n\r\n}", "function ghactivity_app_settings_privacy_callback() {\n\t$options = (array) get_option( 'ghactivity' );\n\tprintf(\n\t\t'<input type=\"checkbox\" name=\"ghactivity[display_private]\" value=\"1\" %s />',\n\t\tchecked( true, (bool) ( isset( $options['display_private'] ) ? $options['display_private'] : false ), false )\n\t);\n}", "public function away_mode_enabled() {\n\n\t\t//disable the option if away mode is in the past\n\t\tif ( isset( $this->settings['enabled'] ) && $this->settings['enabled'] === true && ( $this->settings['type'] == 1 || ( $this->settings['end'] > current_time( 'timestamp' ) || $this->settings['type'] === 2 ) ) ) {\n\t\t\t$enabled = 1;\n\t\t} else {\n\t\t\t$enabled = 0;\n\t\t}\n\n\t\t$content = '<input type=\"checkbox\" id=\"itsec_away_mode_enabled\" name=\"itsec_away_mode[enabled]\" value=\"1\" ' . checked( 1, $enabled, false ) . '/>';\n\t\t$content .= '<label for=\"itsec_away_mode_enabled\"> ' . __( 'Enable away mode', 'it-l10n-ithemes-security-pro' ) . '</label>';\n\n\t\techo $content;\n\n\t}", "public function handle_dashboard_toggle() {\n\t\t\tif ( isset( $_GET['woocart-dashboard'] ) ) {\n\t\t\t\t$woocart_dashboard = empty( $_GET['woocart-dashboard'] ) ? 'no' : 'yes';\n\t\t\t\tupdate_option( '_hide_woocart_dashboard', $woocart_dashboard );\n\t\t\t\twp_redirect( admin_url() );\n\t\t\t\texit;\n\t\t\t}\n\t\t}", "function add_enable_disable_section_to_email_column( $email ) {\n\n $get_option_id = $email->get_option_id();\n $get_option_value = get_option( $get_option_id );\n\n if ( isset( $get_option_value['is_enable'] ) ) {\n if ( $get_option_value['is_enable'] == 'yes' ) {\n $is_enable = ' checked';\n }\n } else {\n $is_enable = '';\n }\n $can_not_be_disabled = apply_filters( 'email_settings_enable_filter', [\n 'erp_email_settings_new-leave-request',\n 'erp_email_settings_approved-leave-request',\n 'erp_email_settings_rejected-leave-request',\n 'erp_email_settings_employee-asset-request',\n 'erp_email_settings_employee-asset-approve',\n 'erp_email_settings_employee-asset-reject',\n 'erp_email_settings_employee-asset-overdue'\n ] );\n if ( in_array( $get_option_id, $can_not_be_disabled ) ) {\n echo '<td class=\"erp-settings-table-is_enable\">\n <label class=\"\"> &nbsp; </label>\n </td>';\n } else {\n echo '<td class=\"erp-settings-table-is_enable\">\n <label class=\"cus_switch\"><input type=\"checkbox\" name=\"isEnableEmail['. esc_attr( $get_option_id ) .']\" ' . esc_attr( $is_enable ) . '><span class=\"cus_slider cus_round\"></span></label>\n </td>';\n }\n /*echo '<td class=\"erp-settings-table-is_enable\">\n <label class=\"cus_switch\"><input type=\"checkbox\" name=\"isEnableEmail['. $get_option_id .']\" ' . $is_enable . '><span class=\"cus_slider cus_round\"></span></label>\n </td>';*/\n}", "public function _settings_field_ssl() {\n global $zendesk_support;\n $ssl = (bool) $zendesk_support->settings['ssl'];\n ?>\n <?php if ( $ssl ): ?>\n <span class=\"description\"><?php _e( 'Your account is using SSL', 'zendesk' ); ?></span>\n <?php else: ?>\n <span class=\"description\"><?php _e( 'Your account is <strong>not</strong> using SSL', 'zendesk' ); ?></span>\n <?php endif; ?>\n <?php\n }", "public function togglePreceptorAction()\n {\n $preceptor = \\Fisdap\\EntityUtils::getEntity(\"PreceptorLegacy\", $this->_getParam(\"preceptor\"));\n $site = \\Fisdap\\EntityUtils::getEntity(\"SiteLegacy\", $this->_getParam(\"site\"));\n $return = false;\n \n if ($preceptor) {\n $assoc = $preceptor->getAssociationByProgram($this->view->program->id);\n $assoc->active = (!$assoc->active);\n $assoc->save();\n $return = true;\n }\n \n $this->_helper->json($return);\n }", "function enable_forget_code_email_callback($options){\n echo '<input name=\"sigma_options[enable_forget_code_email]\" type=\"checkbox\"\n value=\"true\" ' . checked($options['enable_forget_code_email'], true, false) . ' >';\n echo ' <label class=\"description\" for=\"sigma_options[enable_forget_code_email]\" >'\n . __('Enable Email instead Display.', 'se') . '</label>';\n}", "function pm_toggle_walled_garden_callback($args) {\n $options = get_option('pm_display_options'); \n \n // Next, we update the name attribute to access this element's ID in the context of the display options array \n // We also access the show_header element of the options collection in the call to the checked() helper function \n $html = '<input type=\"checkbox\" id=\"walled_garden\" name=\"pm_display_options[walled_garden]\" value=\"1\" ' . checked(1, $options['walled_garden'], false) . '/>'; \n\n // Here, we'll take the first argument of the array and add it to a label next to the checkbox \n $html .= '<label for=\"walled_garden\"> ' . $args[0] . '</label>'; \n \n echo $html; \n \n}", "function setFlagForLinkView()\r\n {\r\n \r\n \t\t\tif($_SESSION['linkFlag']==1)\r\n\t\t\t{\r\n\t\t\t echo \"false\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$_SESSION['linkFlag']=1;\r\n\t\t\t\techo \"true\";\r\n\t\t\t}\r\n }", "function toggleActivated () {\n if (!isset($_SESSION['admin_auth']) OR empty($_SESSION['admin_auth']))\n\treturn false;\n\n // get name and type\n $type = (isset($_GET['type']) and $_GET['type'] == 'app')\n\t? 'app' : 'style';\n $name = (isset($_GET['name'])) ? $_GET['name'] : '';\n if (empty($name)) {\n\t$_SESSION['admin_error'] = 'TOGGLEACTIVATED__ERROR';\n\treturn false;\n }\n\n // get object\n $Obj = NULL;\n switch ($type) {\n case 'app':\n\t$Obj = new App($name);\n\tbreak;\n case 'style':\n\t$Obj = new Style($name);\n\tbreak;\n default:\n\t$_SESSION['admin_error'] = 'TOGGLEACTIVATED__ERROR';\n\treturn false;\n }\n\n // Toggle\n if (!$Obj->toggleActivated()) {\n\t// error\n\t$_SESSION['admin_error'] = 'TOGGLEACTIVATED__ERROR';\n\treturn false;\n }\n\n $_SESSION['admin_info'] = 'TOGGLEACTIVATED__INFO';\n header('Location:?event=show'.(($type == 'app') ? 'Apps' : 'Styles'));\n exit;\n}", "function toggleClientList()\n\t{\n\t\tif ($this->setup->ini->readVariable(\"clients\",\"list\"))\n\t\t{\n\t\t\t$this->setup->ini->setVariable(\"clients\",\"list\",\"0\");\n\t\t\t$this->setup->ini->write();\n\t\t\tilUtil::sendInfo($this->lng->txt(\"list_disabled\"),true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->setup->ini->setVariable(\"clients\",\"list\",\"1\");\n\t\t\t$this->setup->ini->write();\n\t\t\tilUtil::sendInfo($this->lng->txt(\"list_enabled\"),true);\n\t\t}\n\n\t\tilUtil::redirect(\"setup.php\");\n\t}", "public static function toggle()\n {\n if ( empty($_REQUEST['mgb_rating_id']) || empty($_REQUEST['mgb_rating_state']) ) return;\n $state = ($_REQUEST['mgb_rating_state'] === 'true') ? 'false' : 'true';\n $id = (int) $_REQUEST['mgb_rating_id'];\n\n Database::query(\n \"UPDATE ?\n SET state=${state}\n WHERE id=${id}\"\n );\n }", "function cg_activate() {\n\tadd_option('cg-option_3', 'any_value');\n}", "public function setoptinchoice($bid)\n {\n $optchoice = $this->input->post('optin');\n $values = array(\n 'OPTEDIN' => $optchoice,\n 'OPT_FLAG' => 'Y'\n );\n\n $this->db->where('BEACHID', $bid);\n $this->db->update('USERS', $values);\n\n if ($optchoice == 1) {\n echo '<p class=\"alert alert-success\" style=\"margin:20px;\"><strong>Your profile is now searchable in the FREE system.</strong></p>';\n } else {\n echo '<p class=\"alert alert-warning\" style=\"margin:20px;\"><strong>Your profile is now unsearchable in the FREE system.</strong></p>';\n }\n }", "function wpvideocoach_hide_introduction()\r\n{\r\n\tglobal $wpvideocoach_introduction;\r\n\tif($wpvideocoach_introduction == 1){\r\n\t\techo \"checked='checked'\";\r\n\t}\r\n}", "public function setNewsSubscription( $blSubscribe, $blSendOptIn ){\n\t\t\t$blSuccess = parent::setNewsSubscription($blSubscribe, false);\n\t\t\t\n\t\t\tif($blSuccess){\n\t\t\t\n\t\t\t\t$api = new MCAPI(MC_APIKEY);\n\t\t\t\t$oSubscription = $this->getNewsSubscription();\n\n\t\t\t\tif($blSubscribe){\n\t\t\t\t\t$merge_vars = array('FNAME'=>$oSubscription->oxnewssubscribed__oxfname->value, 'LNAME'=>$oSubscription->oxnewssubscribed__oxlname->value);\t\t\t\n\t\t\t\t\t$retval = $api->listSubscribe( MC_LISTID, $oSubscription->oxnewssubscribed__oxemail->value, $merge_vars );\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t$retval = $api->listUnsubscribe( MC_LISTID, $oSubscription->oxnewssubscribed__oxemail->value );\n\t\t\t\t}\t\t\t\t\n\t\t\t\t\n\t\t\t\tif ($api->errorCode){\n\t\t\t\t\t//oxUtilsView::addErrorToDisplay('#'.$api->errorCode.': '.$api->errorMessage);\t\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn $blSuccess;\n\t\t}", "function wpopal_themer_enable_faq_callback()\r\n{\r\n\t$options = get_option( 'wpopal_themer_posttype' );\r\n printf(\r\n '<input type=\"checkbox\" id=\"enable_faq\" name=\"wpopal_themer_posttype[enable_faq]\" %s />',\r\n isset( $options['enable_faq'] ) && $options['enable_faq'] ? 'checked=\"checked\"' : ''\r\n );\r\n}", "function blogslog_switch_options() {\n $arr = array(\n 'on' => esc_html__( 'Enable', 'blogslog' ),\n 'off' => esc_html__( 'Disable', 'blogslog' )\n );\n return apply_filters( 'blogslog_switch_options', $arr );\n }", "function on_activate()\n\t{\n\t\t// Disable buggy sitewide activation in WPMU and WP 3.0\n\t\tif ((is_multisite() && isset($_GET['sitewide'])) || ($this->is_network_mode() && isset($_GET['networkwide'])))\n\t\t\t$this->network_activate_error();\n\t\t\n\t\t// Default options\n\t\tupdate_option('ld_http_auth', 'none');\n\t\tupdate_option('ld_hide_wp_admin', 'no');\n\t}", "function not_approved_menu() {\n\t\tadd_options_page(\n\t\t\t'AdControl',\n\t\t\t'AdControl',\n\t\t\t'manage_options',\n\t\t\t'adcontrol',\n\t\t\tarray( $this, 'userdash_not_approved' )\n\t\t);\n\t}", "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 enable()\n {\n add_settings_field(\n 'enable',\n apply_filters($this->plugin_name . 'label-enable', esc_html__('Enable', $this->plugin_name)),\n [$this->builder, 'checkbox'],\n $this->plugin_name,\n $this->plugin_name . '-general',\n [\n 'description' => 'Serve ' . get_site_url() . '/.well-known/security.txt on your WordPress site.',\n 'id' => 'enable',\n 'value' => isset($this->options['enable']) ? $this->options['enable'] : false,\n ]\n );\n }", "function subway_bypassing_option_form() {\n\n\techo \"<p class='description'>\";\n\n\techo sprintf(\n\n\t\t__(\n\t\t\t\"Use the following link to bypass the log-in page \n\t\tand go directly to your website's wp-login URL (http://yoursiteurl.com/wp-login.php): \n\t\t<br><br> <strong>%s</strong>\", 'subway'\n\t\t),\n\t\tsite_url( 'wp-login.php?no_redirect=true' )\n\t);\n\n\techo '</p>';\n\n\treturn;\n}", "function enable_tracker_get_callback($options){\n echo '<input name=\"sigma_options[enable_tracker_get]\" type=\"checkbox\"\n value=\"true\" ' . checked($options['enable_tracker_get'], true, false) . ' >';\n echo ' <label class=\"description\" for=\"sigma_options[enable_tracker_get]\" >'\n . __('Use GET method for the tracker.', 'se') . '</label>';\n}", "public function checkOptIn(Checkout $event)\n {\n // Ignore steps that are not cart, address or payment.\n switch ($event->getStepKey()) {\n case 'cart':\n case 'address':\n case 'payment':\n $data = $event->getDataKey('mailchimp_opt_in');\n if ($data === 'on') {\n $order = $event->getOrder();\n $order->setProperty('mailchimp_opt_in', true);\n $order->save();\n }\n }\n }", "private function toggle($toggle = '', $transientKey = '') {\n if (in_array($toggle, ['enable', 'disable']) && Gdn::session()->validateTransientKey($transientKey)) {\n if ($toggle == 'enable' && Gdn::addonManager()->isEnabled('embedvanilla', \\Vanilla\\Addon::TYPE_ADDON)) {\n throw new Gdn_UserException('You must disable the \"Embed Vanilla\" plugin before continuing.');\n }\n\n // Do the toggle\n saveToConfig('Garden.Embed.Allow', $toggle == 'enable' ? true : false);\n return true;\n }\n return false;\n }", "protected function enableToggle()\n\t{\n\t\t$loginMethod = \\IPS\\Login\\Handler::load( \\IPS\\Request::i()->id );\n\t\t\n\t\tif ( \\IPS\\Request::i()->status )\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$loginMethod->testSettings();\n\t\t\t}\n\t\t\tcatch ( \\Exception $e )\n\t\t\t{\n\t\t\t\t\\IPS\\Output::i()->redirect( \\IPS\\Http\\Url::internal( \"app=core&module=settings&controller=login&do=form&id={$loginMethod->id}\" ) );\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_disableCheck( $loginMethod );\n\t\t}\n\n\t\t/* Clear caches */\n\t\tunset( \\IPS\\Data\\Store::i()->loginMethods );\n\t\t\\IPS\\Data\\Cache::i()->clearAll();\n\n\t\t/* Toggle */\n\t\treturn parent::enableToggle();\n\t}", "public function toggleDefault()\n {\n $this->language->default = ! $this->language->default;\n }", "function tcf_activate() {\n\t$default = array(\n\t\t'logo' => TFC_URL . '/img/logo.png',\n\t\t'auto_rotate' => '',\n\t\t'auto_rotate_speed' => 7000,\n\t\t'transition_type' => 'slide'\n\t);\n\n\t$tfc = get_option('tfc');\n\n\tif(empty($tfc)) {\n\t\tupdate_option($tfc, $default);\n\t}\n}", "public function enableToggleFullTime($a_title,$a_checked)\n\t{\n\t\t$this->toggle_fulltime_txt = $a_title;\n\t\t$this->toggle_fulltime_checked = $a_checked;\t\t\n\t\t$this->toggle_fulltime = true;\n\t}", "public function maybe_add_is_in_visible_test_mode_option() {\n $current_version = get_option( 'laterpay_version' );\n if ( version_compare( $current_version, '0.9.11', '<' ) ) {\n return;\n }\n\n if ( get_option( 'laterpay_is_in_visible_test_mode' ) === false ) {\n add_option( 'laterpay_is_in_visible_test_mode', 0 );\n }\n }", "public function toggleViewmode()\n {\n $viewmode = ee()->input->cookie('ee_cp_viewmode');\n\n // If it doesn't exist, or it's set to classic, flip the sidebar off.\n if (empty($viewmode) || $viewmode == 'classic') {\n $viewmode = 'jumpmenu';\n } else {\n $viewmode = 'classic';\n }\n\n ee()->input->set_cookie('ee_cp_viewmode', $viewmode, 31104000);\n\n ee()->functions->redirect(ee('CP/URL')->make('homepage'));\n }", "public function hide_backend_enabled() {\n\n\t\tif ( ( get_option( 'permalink_structure' ) == '' || get_option( 'permalink_structure' ) == false ) && ! is_multisite() ) {\n\n\t\t\t$adminurl = is_multisite() ? admin_url() . 'network/' : admin_url();\n\n\t\t\t$content = sprintf( '<p class=\"noPermalinks\">%s <a href=\"%soptions-permalink.php\">%s</a> %s</p>', __( 'You must turn on', 'it-l10n-ithemes-security-pro' ), $adminurl, __( 'WordPress permalinks', 'it-l10n-ithemes-security-pro' ), __( 'to use this feature.', 'it-l10n-ithemes-security-pro' ) );\n\n\t\t} else {\n\n\t\t\tif ( isset( $this->settings['enabled'] ) && $this->settings['enabled'] === true ) {\n\t\t\t\t$enabled = 1;\n\t\t\t} else {\n\t\t\t\t$enabled = 0;\n\t\t\t}\n\n\t\t\t$content = '<input type=\"checkbox\" id=\"itsec_hide_backend_enabled\" name=\"itsec_hide_backend[enabled]\" value=\"1\" ' . checked( 1, $enabled, false ) . '/>';\n\t\t\t$content .= '<label for=\"itsec_hide_backend_enabled\"> ' . __( 'Enable the hide backend feature.', 'it-l10n-ithemes-security-pro' ) . '</label>';\n\n\t\t}\n\n\t\techo $content;\n\n\t}", "function admin_invert_opt_out($id) {\n $this->Subscription->id = $id;\n $subscribed = $this->Subscription->read();\n \n if($subscribed['Subscription']['opt_out_date']) {\n $this->Subscription->saveField('opt_out_date', null);\n } else {\n $this->Subscription->saveField('opt_out_date', date('Y-m-d H:i:s'));\n }\n \n $subscribed = $this->Subscription->read();\n $this->layout = 'clean';\n $this->set('subscription', $subscribed);\n }", "private function SetRequestEnableSettings() { \n if($_GET[\"enable\"] == '1') {\n $query = \"update [|PREFIX|]order_review_config set `sendrequest`= '1' where id = '1' \";\n $GLOBALS['ISC_CLASS_DB']->Query($query);\n echo \"1\";\n exit;\n }\n else {\n $query = \"update [|PREFIX|]order_review_config set `sendrequest`= '0' where id = '1' \";\n $GLOBALS['ISC_CLASS_DB']->Query($query);\n echo \"0\";\n exit;\n }\n }", "public function setIsBlocked($bool);", "function affiliatewp_dlt_plugin_activate() {\n\tadd_option( 'affwp_dlt_activated', true );\n}", "public static function activate_plugin(){\n\t\t\tadd_option('breakingnews_area_title', __('Breaking news', 'text-domain'));\n\t\t\tadd_option('breakingnews_text_color', '#F0F0F0');\n\t\t\tadd_option('breakingnews_bg_color', '#333333');\n\t\t\tadd_option('breakingnews_autoinsert', '1');\n\t\t}", "public function toggleShowTimer(): void\n {\n $this->showTimer = !$this->showTimer;\n }", "function wpvideocoach_hide_toolbar_link()\r\n{\r\n\tglobal $wpvideocoach_toolbar_link;\r\n\tif( $wpvideocoach_toolbar_link == 1){\r\n\t\techo \"checked='checked'\";\r\n\t}\r\n}", "function tz_toggle( $atts, $content = null ) {\n\t\n extract(shortcode_atts(array(\n\t\t'title' \t => 'Title goes here',\n\t\t'state'\t\t => 'open'\n ), $atts));\n\n\t$out = '';\n\t\n\t$out .= \"<div data-id='\".$state.\"' class=\\\"toggle\\\"><h4>\".$title.\"</h4><div class=\\\"toggle-inner\\\">\".do_shortcode($content).\"</div></div>\";\n\t\n return $out;\n\t\n}", "function updatenotifier_activate() {\n\t// clear any existing schedules first\n\twp_clear_scheduled_hook( 'updatenotifier_sendmail' );\n\t// schedule daily check\n\twp_schedule_event( time(), 'daily', 'updatenotifier_sendmail' );\n\n\t$current = get_option( 'updatenote_options' );\n\t$defaults = array(\n\t\t'secondemail' => '', 'plugins' => 'No', 'themes' => 'No',\n\t\t'emailadmin' => false, 'version' => '1.4.1'\n\t);\n\n\tif ( ! $current )\n\t\tadd_option( 'updatenote_options', $defaults );\n\telse\n\t\tupdatenotifier_upgrade( $current, $defaults );\n}", "function add_custom_post_order_option_value_on_activation(){\n\n\tadd_option( 'dd_custom_post_order_on_off', 'on' );\n\n}", "public function set_elementor_flag() {\n\t\tupdate_option( 'hestia_had_elementor', 'no' );\n\t}", "function unhide_kitchensink( $args ) {\n$args['wordpress_adv_hidden'] = false;\nreturn $args;\n}", "function enable_tracker_post_callback($options){\n echo '<input name=\"sigma_options[enable_tracker_post]\" type=\"checkbox\"\n value=\"true\" ' . checked($options['enable_tracker_post'], true, false) . ' >';\n echo ' <label class=\"description\" for=\"sigma_options[enable_tracker_post]\" >'\n . __('Use POST method for the tracker.', 'se') . '</label>';\n}", "public function setIsSendLink($isSendLink)\n {\n $this->isSendLink = $isSendLink;\n }", "public function switch_flags($v=false) {\n\t\tif (sizeof($this->links)>0) {\n\t\t\tforeach($this->links as $link) {\n\t\t\t\t$flag = trim($link['flag']);\n\t\t\t\tif ($flag!='') if ((!$v||($flag==$v))) {\n\t\t\t\t\tif (CMS::navigation()->is_flag($flag)) $link->select(); else $link->deselect();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($link->sublinks) $link->sublinks->switch_flags($v);\n\t\t\t}\n\t\t}\n\t}", "public function optIn($listID, $subscriberID, $mode)\n\t{\n\n\t\t$command = \"Command=Subscriber.OptIn\";\n\t\t$listID = \"ListID=\".$listID;\n\t\t$subscriberID = \"SubscriberID=\".$subscriberID;\n\t\t$mode = \"Mode=\".$mode;\n\t\t\n\t\t$apiPath = $command\n\t\t\t\t\t\t.'&'.$listID\n\t\t\t\t\t\t.'&'.$subscriberID\n\t\t\t\t\t\t.'&'.$mode\n\t\t;\n\n\t\treturn SessionData::getSession()->getResponse($apiPath);\n\n\t}", "function update_cart_button() {\n //global $uqc_options;\n $uqc_options = get_option('uqc_settings_options');\n $enabled = $uqc_options['enabled'] === '1';\n if ($enabled) {\n echo '<a id=\"updateQuantitiesButton\" href=\"#\" class=\"button\">Update Cart</a>';\n }\n}", "function friendly_shortcode_toggles() {\n\t// Don't bother doing this stuff if the current user lacks permissions\n\tif ( ! current_user_can('edit_posts') && ! current_user_can('edit_pages') )\n\t\treturn;\n\t \n\t// Add only in Rich Editor mode\n\tif ( get_user_option('rich_editing') == 'true') {\n\t\t// filter the tinyMCE buttons and add our own\n\t\tadd_filter(\"mce_external_plugins\", \"add_friendly_tinymce_plugin_toggles\");\n\t\tadd_filter('mce_buttons', 'register_friendly_toggles');\n\t}\n}", "public function plugin_activate() {\r\n\t\tupdate_option( $this->options_name, $this->options);\r\n\t}", "public function toggle_activeness( $curr ) { // param type: int\n\t\t$bypass_list = self::get_option( 'bypass_list' , array() );\n\t\tif ( in_array( $curr, $bypass_list ) ) { // when the ith opt was off / in the bypassed list, turn it on / remove it from the list\n\t\t unset( $bypass_list[ array_search( $curr, $bypass_list ) ] );\n\t\t\t$bypass_list = array_values( $bypass_list );\n\t\t\tself::update_option( 'bypass_list', $bypass_list );\n\t\t\treturn true;\n\t\t} else { \t// when the ith opt was on / not in the bypassed list, turn it off / add it to the list\n\t\t\t$bypass_list[] = ( int ) $curr;\n\t\t\tself::update_option( 'bypass_list', $bypass_list );\n\t\t\treturn false;\n\t\t}\n\t}", "public function is_double_optin()\n {\n $optin_campaign_id = absint($this->extras['optin_campaign_id']);\n\n $setting = $this->get_integration_data('SendinblueConnect_enable_double_optin');\n\n return apply_filters('mo_connections_sendinblue_is_double_optin', $setting === true, $optin_campaign_id);\n }", "public function noClickmenu($flag = true)\n {\n $this->noClickmenu = (bool) $flag;\n }", "public function toggleEnabled()\n {\n $this->bean->enabled = ! $this->bean->enabled;\n R::store($this->bean);\n }", "public function SetBpActivateKey()\n\t{\n\t\tif ($_POST['gr_bp_checkbox'] == 1 && ! empty($_POST['signup_email']))\n\t\t{\n\t\t\t$email = $_POST['signup_email'];\n\t\t\t$emails = get_option($this->GrOptionDbPrefix . 'bp_registered_emails');\n\t\t\t$emails_array = unserialize($emails);\n\t\t\tif ( ! empty($emails_array))\n\t\t\t{\n\t\t\t\tif (is_array($emails_array))\n\t\t\t\t{\n\t\t\t\t\t$emails = array_merge($emails_array, array($email));\n\t\t\t\t\tupdate_option($this->GrOptionDbPrefix . 'bp_registered_emails', serialize($emails));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tupdate_option($this->GrOptionDbPrefix . 'bp_registered_emails', serialize(array($email)));\n\t\t\t}\n\t\t}\n\t}", "function tp_comm_comments_enable() {\r\n\tglobal $tp_comm_comments_form;\r\n\t$tp_comm_comments_form = true;\r\n}", "function wpvideocoach_hide_toolbar_disable_field()\r\n{\r\n\tglobal $wpvideocoach_toolbar_link;\r\n\tif($wpvideocoach_toolbar_link == 1){\r\n\t\techo \"disabled='disabled'\";\r\n\t}\r\n}", "public function isShowActivator() {\n\t\t$cache = WP_Helper::getCache();\n\t\tif ( $cache->get( 'wdf_isActivated', false ) == 1 ) {\n\t\t\treturn 0;\n\t\t}\n\t\tif ( get_site_transient( 'wp_defender_free_is_activated' ) == 1 ) {\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\tif ( get_site_option( 'wp_defender_free_is_activated' ) == 1 ) {\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\t$keys = [\n\t\t\t'wp_defender',\n\t\t\t'wd_scan_settings',\n\t\t\t'wd_hardener_settings',\n\t\t\t'wd_audit_settings',\n\t\t\t'wd_2auth_settings',\n\t\t\t'wd_masking_login_settings'\n\t\t];\n\t\tforeach ( $keys as $key ) {\n\t\t\t$option = get_site_option( $key );\n\t\t\tif ( is_array( $option ) ) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn 1;\n\t}", "public function _settings_field_contact_form_anonymous() {\n global $zendesk_support;\n ?>\n <input id=\"zendesk_contact_form_anonymous\" type=\"checkbox\" name=\"zendesk-settings[contact_form_anonymous]\"\n value=\"1\" <?php checked( (bool) $zendesk_support->settings['contact_form_anonymous'] ); ?> />\n <label\n for=\"zendesk_contact_form_anonymous\"><?php _e( 'Check this to allow users without Zendesk accounts to submit requests.', 'zendesk' ); ?></label>\n <br/>\n <span\n class=\"description\"><?php _e( 'If disabled, users will need to login to Zendesk to submit requests.', 'zendesk' ); ?></span>\n <?php\n }", "function pt_checkbox_autoplay_render()\n\t\t{ \n\t\t\t$options = get_option( 'pt_settings' );\n\t\t\t?>\n\t\t\t<input type='checkbox' name='pt_settings[pt_checkbox_field_autoplay]' value=\"1\" <?php checked( @$options['pt_checkbox_field_autoplay'], 1 ); ?>>\n\t\t\t<?php\n\t\t}", "function deactivate(){\n\n\t\t//update_option( WPC_OPTIONS, array() );\n\t\t//update_option( WPC_OPTIONS_COMMENTS, array() );\n\t\t//update_option( WPC_OPTIONS_LIKE_BUTTON, array() );\n\n\t}", "function method_optout($request)\n{\n $log = Loggermanager::getLogger('swim.optout');\n \n checkSecurity($request, false, true);\n \n RequestCache::setNoCache();\n \n if (!$request->hasQueryVar('section'))\n {\n $log->warn('No section specified.');\n displayNotFound($request);\n return;\n }\n \n $section = FieldSetManager::getSection($request->getQueryVar('section'));\n if (($section === null) || ($section->getType() !== 'mailing'))\n {\n $log->warn('No valid section specified.');\n displayNotFound($request);\n return;\n }\n \n if (!$request->hasQueryVar('email'))\n {\n $log->warn('No email specified.');\n displayNotFound($request);\n return;\n }\n \n $email = $request->getQueryVar('email');\n $items = Item::findItems($section, null, null, 'emailaddress', $email);\n if (count($items) == 0)\n {\n $log->warn('Email '.$email.' not found.');\n displayNotFound($request);\n return;\n }\n \n if (count($items) > 1)\n $log->warn('More than one contact with the same email address.');\n \n foreach ($items as $itemversion)\n {\n $newversion = $itemversion->getVariant()->createNewVersion($itemversion);\n $newversion->setFieldValue('optedin', false);\n $newversion->setComplete(true);\n $newversion->setCurrent(true);\n }\n\n if ($request->hasQueryVar('redirect'))\n redirect($request->getQueryVar('redirect'));\n else\n redirect($request->getNested());\n}", "function notify_addon_enabled_from_admin_panel() {\n return ( (!!qa_opt('qw_enable_email_notfn')) &&\n (\n (!!qa_opt('qw_notify_cat_followers')) ||\n (!!qa_opt('qw_notify_tag_followers')) ||\n (!!qa_opt('qw_notify_user_followers'))\n )\n );\n }", "public static function activate()\n\t{\n\t\t// Create some testimonials for demonstration\n\t\tif(get_option('jststm_testimonials') === false)\n\t\t{\n\t\t\tupdate_option('jststm_testimonials', array(\n\t\t\t\tarray(\n\t\t\t\t\t'author' => 'Bender Rodriguez',\n\t\t\t\t\t'message' => 'Fortune, endurance, and malaria. Lord, old death! Aw, evil furner. you won\\'t fear the pacific ocean.',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'author' => 'Professor Hubert',\n\t\t\t\t\t'message' => 'Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper.',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'author' => 'Amy Wong',\n\t\t\t\t\t'message' => 'Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui.',\n\t\t\t\t),\n\t\t\t));\n\t\t}\n\t}", "function activateHTTPS($activate)\n {\n\n // define all the global variables\n global $database, $message, $settings;\n\n if ($activate) {\n // check if already activated\n if ($settings->isHTTPS()) {\n return false;\n }\n\n $sql = \"UPDATE \" . TBL_SETTINGS . \" SET value = '1' WHERE field = '\" . TBL_SETTINGS_FORCE_HTTPS . \"'\";\n\n // get the sql results\n if (!$result = $database->getQueryResults($sql)) {\n return false;\n }\n\n //if no error then set the success message\n $message->setSuccess(\"You have activated ssl across your script\");\n return true;\n } else {\n // check if already de-activated\n if (!$settings->isHTTPS()) {\n return false;\n }\n\n $sql = \"UPDATE \" . TBL_SETTINGS . \" SET value = '0' WHERE field = '\" . TBL_SETTINGS_FORCE_HTTPS . \"'\";\n\n // get the sql results\n if (!$result = $database->getQueryResults($sql)) {\n return false;\n }\n\n //if no error then set the success message\n $message->setSuccess(\"You have de-activated ssl across your script\");\n return true;\n }\n }", "function add_enable_disable_option_save() {\n if ( ! isset( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( sanitize_key( $_REQUEST['_wpnonce'] ), 'erp-nonce' ) ) {\n // die();\n }\n\n if ( isset( $_POST['save_email_enable_or_disable'] ) && $_POST['save_email_enable_or_disable'] == 'save_email_enable_or_disable' ) {\n $registered_email = array_keys( wperp()->emailer->get_emails() );\n foreach( $registered_email as $remail ) {\n $cur_email_init = wperp()->emailer->get_email( $remail );\n $cur_email_id = 'erp_email_settings_'.$cur_email_init->id;\n $cur_email_option = get_option( $cur_email_id );\n if ( isset( $cur_email_option['is_enable'] ) ) {\n unset( $cur_email_option['is_enable'] );\n update_option( $cur_email_id, $cur_email_option );\n }\n }\n if ( isset( $_POST['isEnableEmail'] ) ) {\n\n $is_enable_email = array_map( 'sanitize_text_field', $_POST['isEnableEmail'] ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.MissingUnslash\n $is_enable_email = array_map( 'wp_unslash', $is_enable_email );\n foreach ($is_enable_email as $key => $value) {\n $email_arr = get_option($key);\n $email_arr['is_enable'] = 'yes';\n update_option( $key, $email_arr );\n }\n }\n }\n}", "public function setFlag(): void\n {\n $this->session->setData(ConfigProvider::SESSION_FLAG, true);\n }", "function KemiSitemap_notice(){\n echo '<div class=\"notice notice-warning\"><p>' . __( 'Please deactivate Kemi Sitemap before activting Kemi Sitemap.', 'KemiSitemap' ) . '</p></div>';\n\n if( isset( $_GET['activate'] ) ) {\n unset( $_GET['activate'] );\n }\n }" ]
[ "0.6169931", "0.604949", "0.6014225", "0.6012066", "0.5958008", "0.5932836", "0.5908826", "0.59078795", "0.58699644", "0.5859047", "0.5842876", "0.58191085", "0.5770223", "0.57077956", "0.5650516", "0.56402004", "0.56226206", "0.56145847", "0.5608757", "0.5547412", "0.5539582", "0.5538702", "0.551803", "0.5512845", "0.55119795", "0.55043983", "0.5482752", "0.5465533", "0.5433601", "0.5421953", "0.5410589", "0.53801876", "0.5377569", "0.5370165", "0.53670305", "0.5341156", "0.53210694", "0.53084487", "0.53040653", "0.5294822", "0.52864397", "0.5282143", "0.5269043", "0.52681327", "0.526604", "0.5258863", "0.5257765", "0.5244934", "0.523287", "0.5221109", "0.52143705", "0.51984257", "0.5190643", "0.5190627", "0.5189708", "0.5189534", "0.51855093", "0.51709574", "0.5169843", "0.5167627", "0.5156959", "0.51542044", "0.51532525", "0.5150124", "0.51477295", "0.51377857", "0.5130236", "0.5120333", "0.5117995", "0.5117243", "0.5111941", "0.5111083", "0.5100168", "0.50961983", "0.508645", "0.50850433", "0.508031", "0.5076081", "0.50748795", "0.5071427", "0.5060042", "0.5059401", "0.505237", "0.50514835", "0.5050297", "0.5049702", "0.50482863", "0.5039694", "0.50380194", "0.50367737", "0.50288856", "0.50229436", "0.502083", "0.50173455", "0.50153977", "0.5008806", "0.50072694", "0.5007046", "0.49984455", "0.49960953", "0.4989819" ]
0.0
-1
add to $this>content the result of Customer::SearchByName (encoded in json)
public function ajaxProcessSearchCustomers() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function rest_search() {\n\t\t// return json elements here\n\t}", "function get_customer_list_json()\n\t{\n\t $output = $this->invm->get_customer_list_search(strtolower($this->uri->segment(4)));\n\t echo json_encode($output);\n\t}", "function customer_search() {\n $suggestions = $this->Customer->get_customer_search_suggestions($this->input->post('term'), 100);\n echo json_encode($suggestions);\n }", "public function actionFindCustomer($q)\r\n {\r\n $out = [];\r\n if ($q) {\r\n $customers = Customer::find()\r\n ->filterWhere(['like', 'firstname', $q])\r\n ->all();\r\n $out = [];\r\n foreach ($customers as $d) {\r\n $out[] = [\r\n 'id' => $d->id,\r\n 'value' => $d->fullname,\r\n 'name' => $d->id . ' - ' . $d->fullname\r\n ];\r\n }\r\n }\r\n echo Json::encode($out);\r\n }", "function customer_search()\n {\n $suggestions = $this->Customer->get_customer_search_suggestions($this->input->post('term'),100);\n echo json_encode($suggestions);\n }", "private function new_search()\n {\n $this->template = FALSE;\n \n $articulo = new articulo();\n $codfamilia = '';\n if( isset($_REQUEST['codfamilia']) )\n {\n $codfamilia = $_REQUEST['codfamilia'];\n }\n \n $con_stock = isset($_REQUEST['con_stock']);\n $this->results = $articulo->search($this->query, 0, $codfamilia, $con_stock);\n \n /// añadimos la busqueda\n foreach($this->results as $i => $value)\n {\n $this->results[$i]->query = $this->query;\n $this->results[$i]->dtopor = 0;\n }\n \n header('Content-Type: application/json');\n echo json_encode($this->results);\n }", "public function search(){\n if(isset($_POST['text_search'])){\n $title = trim($this->input->post('text_search') , ' ');\n $data = $this->base_model->search_data('deal' , 'customer' , 'deal.* , customer.fullname , unit.name' ,'deal.customer_id = customer.id' , 'left' , array('customer.fullname'=>$title) , NULL , array('deal.id' , 'DESC') , NULL , array('unit','deal.money_id = unit.id'));\n echo json_encode($data);\n }else{\n show_404();\n }\n }", "public function search()\n\t{\n\t\tif(isset($_GET['term']))\n\t\t{\n\t\t\t$result = $this->Busca_Model->pesquisar($_GET['term']);\n\t\t\tif(count($result) > 0) {\n\t\t\tforeach ($result as $pr)$arr_result[] = $pr->nome;\n\t\t\t\techo json_encode($arr_result);\n\t\t\t}\n\t\t}\n\t}", "public function search()\n {\n return response()->json(\n [\n 'product_all' => $this->product->all(),\n 'products' => $this->product->search(),\n 'brands' => $this->brands->all(),\n 'categories' => $this->categories->all()\n ]\n );\n }", "public function customers(Request $request)\n {\n $user = $request->user();\n $currentCompany = $user->currentCompany();\n\n $search = $request->search;\n\n if($search == ''){\n $customers = Customer::findByCompany($currentCompany->id)->limit(5)->get();\n }else{\n $customers = Customer::findByCompany($currentCompany->id)->where('display_name', 'like', '%' .$search . '%')->limit(5)->get();\n }\n\n $response = collect();\n foreach($customers as $customer){\n $response->push([\n \"id\" => $customer->id,\n \"text\" => $customer->display_name,\n \"currency\" => $customer->currency,\n \"billing_address\" => $customer->displayLongAddress('billing'),\n \"shipping_address\" => $customer->displayLongAddress('shipping'),\n ]);\n }\n\n return response()->json($response);\n }", "protected function getContent()\n {\n $query = $this->get('query');\n $page = 1;\n $limit = SEARCH_LIMIT;\n $offset = 0;\n if($this->get('limit') && $this->get('offset')) {\n $limit = clsCommon::isInt($this->get('limit'));\n $offset = clsCommon::isInt($this->get('offset'));\n } else {\n $page = clsCommon::isInt($this->post('page'));\n $page = !empty($page) ? $page : 1;\n $offset = ($page-1) * $limit;\n }\n\n if (!empty($query)) {\n $this->parser->products = clsSearch::getInstance()->searchProducts($query, $limit, $offset);\n $this->parser->productsCount = clsSearch::getInstance()->searchProductsCount($query);\n \n $this->parser->limit = SEARCH_LIMIT;\n $this->parser->query = $query;\n $this->parser->pageUrl = clsCommon::compileDefaultItemHref('Search', array('query' => $query));\n \n if(clsCommon::isAjax()) {\n $productsArr = array();\n foreach($this->parser->products as $v) {\n $productsArr[] = $v->getArrayCopy();\n }\n return json_encode(\n array(\n 'products' => $productsArr,\n 'need_more' => ($this->parser->productsCount > $offset)\n )\n );\n //render page\n } else {\n return $this->parser->render('@main/pages/search.html');\n }\n } else {\n clsCommon::redirect404();\n }\n }", "public function actionCustomerSearch()\t\r\n {// for autocomplete will do DB search for Customers and Lands\r\n\t\t\r\n\t\tif (isset($_GET['term'])) { // first search that \r\n // if user arabic name \r\n // or english name \r\n // or miobile number match\r\n \r\n \r\n $keyword = $_GET[\"term\"];\r\n\r\n $searchCriteria=new CDbCriteria;\r\n // the new library \r\n if (isset($_GET['term'])) \r\n if ($keyword != '') {\r\n $keyword = @$keyword;\r\n $keyword = str_replace('\\\"', '\"', $keyword);\r\n\r\n $obj = new ArQuery();\r\n $obj->setStrFields('CustomerNameArabic');\r\n $obj->setMode(1);\r\n\r\n $strCondition = $obj->getWhereCondition($keyword);\r\n } \r\n\r\n\r\n//\t\t\t$qtxt = 'SELECT CustomerID, Nationality, CustomerNameArabic from CustomerMaster WHERE ('.$strCondition.' OR CustomerNameEnglish LIKE :name OR MobilePhone Like :name) limit 25';\r\n//\t\t\t$command = Yii::app()->db->createCommand($qtxt);\r\n//\t\t\t$command->bindValue(':name','%'.$_GET['term'].'%',PDO::PARAM_STR);\r\n//\t\t\t$res = $command->queryAll();\r\n// if( count($res)<1){//run if no customer found \r\n //search DB if Land ID matches\r\n\r\n $qtxt = 'SELECT LandID lnd from LandMaster WHERE LandID Like :name';\r\n $command = Yii::app()->db->createCommand($qtxt);\r\n $command->bindValue(':name','%'.$_GET['term'].'%',PDO::PARAM_STR);\r\n $res = $command->queryColumn();\r\n\r\n// }\r\n\t\t}\r\n\t\tprint CJSON::encode($res);\r\n \r\n // die ($strCondition);\r\n\t}", "function getSearch()\n\t{\n\t\t$search = $this->input->post('search');\n\t\t$response = $this->mapi->getSearch($search);\n\n\t\techo json_encode($response);\n\t}", "public function suggest() {\n // Set the content type to json\n $this->response->type('application/json');\n $result = $this->searchPlace();\n $this->set('result', $result);\n }", "public function autocomplete_search() {\n\tif (!empty($this->request->query['term'])) {\n\t $model = Inflector::camelize(Inflector::singularize($this->request->params['controller']));\n\t $my_models = $this->$model->find('all', array(\n\t\t 'conditions' => array($model . '.name LIKE' => $this->request->query['term'] . '%'),\n\t\t 'limit' => 10,\n\t\t 'contain' => false,\n\t\t\t ));\n\t $json_array = array();\n\t foreach ($my_models as $my_model) {\n\t\t$json_array[] = $my_model[$model];\n\t }\n\t $json_str = json_encode($json_array);\n\t $this->autoRender = false;\n\t return $json_str;\n\t}\n }", "public function get_json_results() {\n }", "public function searchAction()\n {\n $collection = $this->search($this->getRequest());\n return $this->toJson($collection->toArray());\n }", "public function initContent()\n {\n /**\n * !!! Do not call parent::initContent().\n * Use it only for collections.\n * Custom output do not have an id and will generate error.\n */\n\n foreach ($this->sql as $key => $query) {\n try {\n $result = Db::getInstance()->executeS($query);\n if (isset($result)) {\n $this->jsonContent[$key] = $result[0][$key];\n }\n } catch (PrestaShopDatabaseException $exception) {\n ClaroLogger::errorLog(__METHOD__ . ' : DBException: ' . $exception->getMessage()\n . ' at line ' . $exception->getLine());\n\n $this->jsonContent = [\n 'status' => 'error',\n 'error' => $exception->getMessage()\n ];\n die(json_encode($this->jsonContent));\n }\n }\n die(json_encode($this->jsonContent));\n }", "public function actionSearch()\n {\n //el asunto esta en que no hay datos confiables en la base. Hay que tocar el modelo de registro para que guarde un par de cosas mas.\n $tarifa= new TarifasModelo();\n\n $agenciaModel= new AgenciaModelo();\n $result = $agenciaModel->GetInfoAgencia(null,null,null,null,null,null,null,null);\n //for ($i = 0; $i < $length; $i++)\n //{\n \t\n //}\n $i=-1;\n foreach ($result as $value)\n {\n $i++;\n \tif($value[\"DireccionCoordenada\"] !=null){ // asi no vamos a buscar las tarifas de remiserias que no se van a mostrar\n //array_push($value,$tarifa->GetInfoTarifas(null,null,$value[\"AgenciaID\"],null,null,null,null)) ;\n $result[$i]['Tarifa'] = $tarifa->GetInfoTarifas(null,null,$value[\"AgenciaID\"],null,null,null,null)[0]; //casos en los que tienen mas de una tarifa, nose por que\n }\n }\n \n $this->setHeader(200);\n Yii::$app->response->format = Response::FORMAT_JSON;\n return Json::encode($result);\n \n }", "public static function loadAllCustomerBySearch() {\n\t}", "public function resultSearch(){\n return $this->returnHTML($this->searchProduct());\n }", "public function searchjson(){\n\t\t//para que no de problemas\n\t\t$term = null;\n\t\t//si cogemos la variable term de search.js\n\t\tif(!empty($this->request->query['term'])){\n\t\t\t$term = $this->request->query['term'];\n\t\t\t//coge nuestro termino de busqueda \n\t\t\t//lo que va hacer es dividir cada uno de nuestro termino y lo divide\n\t\t\t//en cadenas\n\t\t\t$terms = explode(' ', trim($term));\n\t\t\t//usamos el metodo array_diff para haciendo una comparacion con arrays\n\t\t\t$terms = array_diff($terms, array(''));\n\n\t\t\tforeach ($terms as $term) {\n\t\t\t\t//aqui busca las palabras en base a sus 3 caracteres\n\t\t\t\t$conditions[] = array('Platillo.nombre LIKE' => '%'. $term . '%');\n\t\t\t\t//aqui nos hace un recorrido correcto \n\t\t\t\t$platillos = $this->Platillo->find('all', array('recursive' => -1, 'fields' => \n\t\t\t\t\tarray('Platillo.id', 'Platillo.nombre' , 'Platillo.foto', 'Platillo.foto_dir'), 'conditions' => \n\t\t\t\t\t$conditions, 'limit' => 20));\n\t\t\t}\n\t\t\techo json_encode($platillos);\n\t\t\t$this->autoRender = false;\n\n\t\t}\n\n\t}", "public function dynamic_customer_creation(){\r\n\t\t\r\n\t\t$data['results']=$this->Common_model->dynamic_customer_creation();\r\n\t\techo json_encode($data['results']);\r\n\t}", "public function content() {\n $config = \\Drupal::config('webspark_isearch.settings');\n $solr = $config->get('solr');\n $client = \\Drupal::httpClient();\n $query= \\Drupal::request()->getQueryString();\n\n $url = $solr . '?' . urldecode($query);\n\n $request = $client->get($url);\n $status = $request->getStatusCode();\n $content = $request->getBody()->getContents();\n $file_contents = json_decode($content);\n\n return new JsonResponse($file_contents);\n }", "public function search($name)\n {\n //\n $objects = Object::where('name','LIKE',\"%$name%\")->get(['id','name']);\n return response()->json( $objects );\n }", "public function index() {\r\n $conditions = array();\r\n $data = empty($this->request->data)?$this->request->params['named']:$this->request->data;\r\n if(!empty($data))\r\n { $conditions = array('Customer.nome ilike'=>'%'.$data['search'].'%'); }\r\n \r\n $this->Customer->recursive = 0;\r\n $this->set('customers', $this->paginate('Customer', $conditions));\r\n $this->set('args', $data);\r\n }", "public function searchAction()\n { \n $request = Request::createFromGlobals();\n \n $search = $request->query->get('search');\n \n $em = $this->getDoctrine()->getManager();\n \n $addresses = $em->getRepository('comemNewsroomBundle:Ad')->search($search);\n \n $response = new Response(json_encode($addresses));\n \n $response->headers->set('Content-Type', 'application/json');\n \n return $response;\n }", "public function ajaxCustomerSearch(Request $request)\n {\n// $term = $request->has('term') ? $request->input('term') : null ;\n// $query = $request->has('query') ? $request->input('query') : $term;\n\n// if ( $query )\n\n if ($request->has('customer_id'))\n {\n $search = $request->customer_id;\n\n $customers = Customer::\n // select('id', 'name_fiscal', 'name_commercial', 'identification', 'sales_equalization', 'payment_method_id', 'currency_id', 'invoicing_address_id', 'shipping_address_id', 'shipping_method_id', 'sales_rep_id', 'invoice_sequence_id')\n with('currency')\n ->with('addresses')\n ->find( $search );\n\n $customers->invoice_sequence_id = $customers->getInvoiceSequenceId();\n $customers->shipping_method_id = $customers->getShippingMethodId();\n\n// return $customers;\n// return Product::searchByNameAutocomplete($query, $onhand_only);\n// return Product::searchByNameAutocomplete($request->input('query'), $onhand_only);\n// response( $customers );\n// return json_encode( $customers );\n return response()->json( $customers );\n }\n\n if ($request->has('term'))\n {\n $search = $request->term;\n\n $customers = Customer::select('id', 'name_fiscal', 'name_commercial', 'identification', 'reference_external', 'sales_equalization', 'payment_method_id', 'currency_id', 'invoicing_address_id', 'shipping_address_id', 'shipping_method_id', 'sales_rep_id')\n ->where( 'name_fiscal', 'LIKE', '%'.$search.'%' )\n ->orWhere( 'name_commercial', 'LIKE', '%'.$search.'%' )\n ->orWhere( 'identification', 'LIKE', '%'.$search.'%' )\n ->isNotBlocked()\n ->with('currency')\n ->with('addresses')\n ->take( intval(Configuration::get('DEF_ITEMS_PERAJAX')) )\n ->get();\n\n// return $customers;\n// return Product::searchByNameAutocomplete($query, $onhand_only);\n// return Product::searchByNameAutocomplete($request->input('query'), $onhand_only);\n// response( $customers );\n// return json_encode( $customers );\n return response()->json( $customers );\n }\n\n // Otherwise, die silently\n return json_encode( [ 'query' => '', 'suggestions' => [] ] );\n \n }", "function search()\n\t{\n\t\t$search = $this->input->post('search') != '' ? $this->input->post('search') : null;\n\t\t$limit_from = $this->input->post('limit_from');\n\t\t$lines_per_page = $this->Appconfig->get('lines_per_page');\n\n\t\t$suppliers = $this->Supplier->search($search, $lines_per_page, $limit_from);\n\t\t$total_rows = $this->Supplier->get_found_rows($search);\n\t\t$links = $this->_initialize_pagination($this->Supplier, $lines_per_page, $limit_from, $total_rows);\n\t\t$data_rows = get_supplier_manage_table_data_rows($suppliers, $this);\n\n\t\techo json_encode(array('total_rows' => $total_rows, 'rows' => $data_rows, 'pagination' => $links));\n\t}", "public function autocomplete() {\n \n //Término de búsqueda con comodines\n $palabro = '%'.$this->request->query['term'].'%';\n \n //Búsqueda de coincidencias\n $resultados = $this->Funeraria->find('all', array(\n 'conditions' => array(\n 'Funeraria.nombre LIKE' => $palabro,\n ),\n 'fields' => array(\n 'Funeraria.id', 'Funeraria.cif', 'Funeraria.nombre'\n ),\n 'limit' => 20,\n ));\n \n //Procesamiento y codificación en JSON\n $items = array();\n \n if (empty($resultados)) {\n array_push($items, array(\"label\"=>\"No hay coincidencias\", \"value\"=>\"\"));\n }\n else {\n foreach($resultados as $resultado) {\n array_push($items, array(\"label\" => $resultado['Funeraria']['nombre'] . \" - \" . $resultado['Funeraria']['cif'], \"value\" => $resultado['Funeraria']['id']));\n }\n }\n \n $this->layout = 'ajax';\n $this->autoRender = false;\n \n echo json_encode($items);\n }", "public function search() {\r\n\t\t$mintURL = $this->Configuration->findByName('Mint URL');\r\n\t\t$queryURL = $mintURL['Configuration']['value'];\r\n\t\t$query = '';\r\n\t\tif (isset($this->params['url']['query'])) {\r\n\t\t\t$query = $this->params['url']['query'];\r\n\t\t}\r\n\r\n\t\t$queryURL = $queryURL.\"/Parties_People/opensearch/lookup?searchTerms=\".$query;\r\n\t\t$queryResponse = \"error\";\r\n\n\t\t$ch = curl_init();\r\n\t\t$timeout = 5;\r\n\t\tcurl_setopt($ch,CURLOPT_URL,$queryURL);\r\n\t\tcurl_setopt($ch,CURLOPT_RETURNTRANSFER,1);\r\n\t\tcurl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);\r\n\t\t$queryResponse = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\r\n\t\t$this->autoRender = false;\r\n\t\t$this->response->type('json');\r\n\r\n\t\t$this->response->body($queryResponse);\r\n\t}", "public function getCustomerAction()\n {\n $data = $this->Request()->getParams();\n\n /** @var Shopware_Components_CustomerInformationHandler $customerInformationHandler */\n $customerInformationHandler = Shopware()->CustomerInformationHandler();\n\n //Checks if the user used the live search or selected a customer from the drop down list\n if (isset($data['filter'][0]['value'])) {\n $result = $customerInformationHandler->getCustomerList($data['filter'][0]['value']);\n } else {\n $search = $this->Request()->get('searchParam');\n $result = $customerInformationHandler->getCustomer($search);\n }\n\n foreach ($result as $i => $customer) {\n $result[$i] = $this->extractCustomerData($customer);\n }\n\n $total = count($result);\n\n $this->view->assign(\n [\n 'data' => $result,\n 'total' => $total,\n 'success' => true\n ]\n );\n }", "public function searchAction()\n {\n $request = $this->get('request');\n $word = $request->query->get('search');\n $ajax = $request->query->get('ajax');\n\n \n $movies = $this->helper->search($word);\n\n if(!$ajax){\n if(isset($movies['movie']) && is_object($movies['movie'])){\n $movies = $movies['movie']->getArray();\n }\n return $this->render('CinheticPublicBundle:Api:search.html.twig', array(\n 'movies' => $movies\n ));\n }else{\n\n $results_final = array();\n if (!empty($movies))\n if(isset($movies['movie']) && is_object($movies['movie'])){\n foreach ($movies['movie'] as $movie)\n $results_final[] = array(\n 'nom' => utf8_encode($movie['originalTitle'])\n );\n }\n\n return new JsonResponse($results_final);\n }\n }", "public function jsonstoreAction()\n {\n $this->_helper->layout->disableLayout();\n $this->_helper->viewRenderer->setNoRender(true);\n $items = $this->_model->fetchAllActiveProducts();\n $data = new Zend_Dojo_Data('product_id', $items);\n $data->setLabel('name');\n $this->_helper->autoCompleteDojo($data);\n }", "public function fetchCustomerData()\n\t{\n\t\t$result = array('data' => array());\n\n\t\t$data = $this->model_customers->getCustomerData();\n\t\tforeach ($data as $key => $value) {\n\n\t\t\t// button\n\t\t\t$buttons = '';\n\n\t\t\tif(in_array('viewBrand', $this->permission)) {\n\t\t\t\t$buttons .= '<button type=\"button\" class=\"btn btn-default\" onclick=\"editCustomer('.$value['id'].')\" data-toggle=\"modal\" data-target=\"#editCustomerModal\"><i class=\"fa fa-pencil\"></i></button>';\t\n\t\t\t}\n\t\t\t\n\t\t\tif(in_array('deleteBrand', $this->permission)) {\n\t\t\t\t$buttons .= ' <button type=\"button\" class=\"btn btn-default\" onclick=\"removeCustomer('.$value['id'].')\" data-toggle=\"modal\" data-target=\"#removeCustomerModal\"><i class=\"fa fa-trash\"></i></button>\n\t\t\t\t';\n\t\t\t}\t\t\t\t\n\n\t\t\t$status = ($value['active'] == 1) ? '<span class=\"label label-success\">Active</span>' : '<span class=\"label label-warning\">Inactive</span>';\n\n\t\t\t$result['data'][$key] = array(\n\t\t\t\t$value['id'],\n\t\t\t\t$value['customer_name'],\n\t\t\t\t$value['customer_email'],\n\t\t\t\t$value['customer_phone'],\n\t\t\t\t$value['customer_address'],\n\t\t\t\t$status,\n\t\t\t\t$buttons\n\t\t\t);\n\t\t} // /foreach\n\n\t\techo json_encode($result);\n\t}", "public function autocomplete()\n {\n\n $hotel_name = Input::get('name');\n\n $hotels = Hotel::select(array('id', 'name'))\n ->where('name', 'like', \"%$hotel_name%\")\n ->where('status', '=', 1)\n ->get();\n\n $hotels_array = array();\n\n foreach($hotels as $hotel) {\n $hotels_array[] = $hotel->toArray();\n }\n\n return Response::json( $hotels_array );\n }", "public function ajaxSearch()\r\n {\r\n $this->load->model('book_model', 'bookManager');\r\n\r\n $books = array();\r\n $search = $this->input->get('search');\r\n $idCustomer = $this->session->userdata('member-id');\r\n $dataBooks = $this->bookManager->getBooksSearch($search);\r\n \r\n $k = 0;\r\n foreach ($dataBooks as $data) {\r\n if (stripos($data->author, trim($search))) {\r\n $books['list'][$k]['name'] = $data->author;\r\n $k++;\r\n }\r\n if (stripos($data->title, trim($search))) {\r\n $books['list'][$k]['name'] = $data->title;\r\n $k++;\r\n }\r\n if (stripos($data->genre, trim($search))) {\r\n $books['list'][$k]['name'] = $data->genre;\r\n $k++;\r\n }\r\n \r\n if ($k > 7) {\r\n break;\r\n }\r\n }\r\n\r\n echo json_encode($books);\r\n die;\r\n }", "public function search(){\n //includes google maps script for place autocomplete and to get experiences\n \t$this->set('jsIncludes',array('http://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&language=fr&libraries=places','places_autocomplete','get_experiences','logo_fly','jquery.dropdown','cookies'));\n \n //sets motives, schools and departments by alphbetical order\n $this->__set_motives_schools_and_departments();\n }", "public function index()\n\t{\n\t\t$search = Input::get('search', 0);\n\t\t$active = Input::get('active', 0);\n\n\t\t$customers = $this->repo;\n\n\t\tif ($search == 1) {\n\t\t\t$term = Input::get('term');\n\t\t\t$customers = $customers->where(function ($query) use ($term)\n\t\t\t{\n\t\t\t\t$query->where('first_name', 'like', \"%$term%\")\n\t\t\t\t\t\t->orWhere('last_name', 'like', \"%$term%\");\n\t\t\t});\n\t\t}\n\n\t\tif ($active == 1) {\n\t\t\t$customers = $customers->where('active', '=', 1);\n\t\t}\n\t\t\n\t\t$customers = $customers->with('user', 'addresses')->get();\n\t\treturn $this->rest->response(200, $customers);\n\t}", "public function search()\n {\n $data = [];\n if ($this->request->is('ajax')) {\n $term = $this->request->getQuery('term');\n $this->loadModel('Airobjects');\n $data = $this->Airobjects\n ->find('all')\n ->where(\n [\n 'OR' => [ \n \"code LIKE\" => $term . '%', \n \"city_name LIKE\" => $term . '%', \n \"airport_name LIKE\" => $term . '%', \n ],\n 'AND' => [\n \"code <> \\\"\\\"\" \n ]\n ]\n )\n ->limit(10)\n ->order('code')\n ->toArray(); \n }\n\n $this->set(compact('data'));\n $this->set('_serialize', 'data');\n }", "public function view_Customer($asal){\n $search = $_POST['search']['value'];\n $limit = $_POST['length'];\n $start = $_POST['start'];\n \n // $tanggal,$bulan,$tahun\n $order_index = $_POST['order'][0]['column'];\n $order_field = $_POST['columns'][$order_index]['data'];\n $order_ascdesc = $_POST['order'][0]['dir'];\n $sql_total = $this->model_home->count_all_Customer($asal);\n $sql_data = $this->model_home->filter_Customer($asal,$search, $limit, $start, $order_field, $order_ascdesc);\n $sql_filter = $this->model_home->count_filter_Customer($asal,$search);\n $data = array();\n for($i=0;$i<count($sql_data);$i++){\n array_push($data, $sql_data[$i]);\n }\n $no = $start + 1;\n for($i=0;$i<count($data);$i++){\n $data[$i]['nomor'] = $no; \n $no++;\n }\n $callback = array(\n 'draw' => $_POST['draw'],\n 'recordsTotal' => $sql_total,\n 'recordsFiltered' => $sql_filter,\n 'data' => $data\n );\n\n header('Content-Type: application/json');\n echo json_encode($callback);\n }", "public function keywordSearch()\n {\n $input = Request::all();\n $validator = Validator::make($input, ['keyword' => 'required']);\n if ($validator->fails()) {\n return ApiResponse::validation($validator);\n }\n\n $keyword = ine($input, 'keyword') ? $input['keyword'] : '';\n $limit = isset($input['limit']) ? $input['limit'] : config('jp.pagination_limit');\n $customers = Customer::where('customers.company_id', config('company_scope_id'))\n ->leftJoin('addresses', function ($join) {\n $join->on('customers.address_id', '=', 'addresses.id');\n })\n ->leftJoin('customer_contacts', function ($join) {\n $join->on('customers.id', '=', 'customer_contacts.customer_id');\n })\n ->with('phones', 'address', 'jobs')\n ->keywordSearch($keyword, $this->scope->id())\n ->select('customers.*')\n ->groupBy('customers.id')\n ->paginate($limit);\n\n $transformer = (new CustomersTransformer)->setDefaultIncludes([\n 'count',\n 'address',\n 'phones'\n ]);\n\n return ApiResponse::success(\n $this->response->paginatedCollection($customers, $transformer)\n );\n }", "public function all_customers() {\n\t\tif($this->input->is_ajax_request()) {\n\t\t\techo json_encode($this->customers->get_all());\n\t\t} else {\n\t\t\tredirect('cms/customers', 'refresh');\n\t\t}\n\t}", "public function searchAction() {\n\t\n\t if($this->getRequest()->isXmlHttpRequest()){\n\t\n\t $term = $this->getParam('term');\n\t $id = $this->getParam('id');\n\t\n\t if(!empty($term)){\n\t $term = \"%$term%\";\n\t $records = Invoices::findbyCustomFields(\"formatted_number LIKE ? OR number LIKE ?\", array($term, $term));\n\t die(json_encode($records));\n\t }\n\t\n\t if(!empty($id)){\n\t $records = Invoices::find($id);\n\t if($records){\n\t $records = $records->toArray();\n\t }\n\t die(json_encode(array($records)));\n\t }\n\t\n\t $records = Invoices::getAll();\n\t die(json_encode($records));\n\t }else{\n\t die();\n\t }\n\t}", "public function makeAutocompleteSearch($data) {\n $arr = [];\n foreach ($data as $key => $value) {\n $arr[] = $value->fname;\n }\n\n $autocomplete = json_encode($arr);\n // dd($autocomplete);\n return $autocomplete;\n }", "public function findByName() { \n\n $term = Request::input('term');\n $cities = []; \n if (($term) && ($term !== '')) {\n $search_term = Helpers::accentToRegex($term);\n $query_term = '/.*' . $search_term . '*/i';\n $cities = Cities::where('properties.nome_municipio', 'regexp', $query_term)->\n orderBy('properties.nome_municipio')->\n get(array('properties.geo_codigo', 'properties.nome_municipio', 'properties.sigla')); \n }\n\n return Response::json($cities); \n }", "public function toJson(){\n return json_encode($this->content);\n }", "public function search($request) {\n $query = Convert::raw2sql($request->getVar('q'));\n $limit = $this->config()->search_limit;\n $addresses = NZStreetAddress::get()->filter('FullAddress:StartsWith', $query)\n ->limit($limit);\n $output = [];\n foreach($addresses as $address) {\n $output[] = [\n 'AddressID' => $address->AddressID,\n 'FullAddress' => $address->FullAddress,\n 'AddressLine1' => sprintf(\"%s %s\",\n $address->FullAddressNumber,\n $address->FullRoadName\n ),\n 'Suburb' => $address->SuburbLocality,\n 'City' => $address->TownCity\n ];\n }\n\n return json_encode($output);\n }", "public function results($name);", "public function echoJson() {\r\n header(\"Content-type: application/json;\");\r\n echo $this->getResult();\r\n }", "public function search(string $name): JsonResponse\n {\n try {\n $products = Product::query()->where('name', 'like', '%'.$name.'%')->get();\n\n return response()->json([\n 'data' => $products,\n 'success' => true\n ]);\n } catch (Throwable $error) {\n return response()->json([\n 'data' => null,\n 'success' => false,\n 'message' => $error->getMessage()\n ]);\n }\n }", "public function getCustomerList($search)\n {\n $builder = $this->getCustomerQueryBuilder();\n\n /**\n * adding where statements\n * concats the first name and the last name to a full name for the search (uses the billing table)\n */\n $builder->where(\n $builder->expr()->like(\n $builder->expr()->concat(\n 'billing.firstName',\n $builder->expr()->concat($builder->expr()->literal(' '), 'billing.lastName')\n ),\n $builder->expr()->literal($search)\n )\n )\n ->orWhere('billing.company LIKE :search')\n ->orWhere('shipping.company LIKE :search')\n ->orWhere('billing.number LIKE :search')\n ->orWhere('customers.email LIKE :search')\n ->setParameter('search', $search)\n ->groupBy('customers.id')\n ->orderBy('billing.firstName');\n\n $result = $builder->getQuery()->getArrayResult();\n\n /**\n * maps data for the customer drop down search field\n */\n foreach ($result as &$customer) {\n $customer['customerCompany'] = $customer['billing']['company'];\n $customer['customerNumber'] = $customer['billing']['number'];\n $customer['customerName'] = $customer['billing']['firstName'] . ' ' . $customer['billing']['lastName'];\n }\n\n return $result;\n }", "public function getCity($search = null)\n {\n // $name = Input::get('e10_2');\n // return city::select(array('id', DB::raw('concat(name) as text')))->where(DB::raw('concat(name)'),'like', \"%$name%\")->get(); \n // return json_encode(array($input));\n\n $search_text = $search;\n if ($search_text==NULL) {\n $data= city::all();\n } else {\n $data=city::where('name','LIKE', '%'.$search_text.'%')->get();\n }\n\n return response()->json(array($data));\n\n\n // return view('home')->with('results',$data);\n\n }", "public function getSearch();", "public function actionpSearchProperty()\t{// method not in use \r\n // this is a test commit// j comiited\r\n\t\tif(isset($_POST[\"data\"])) //check that this action is only called using POST.. not get, not regular.\r\n {\r\n\t\t\t$searchstring = json_decode($_POST[\"data\"]); \r\n\t\t\t$searchCriteria=new CDbCriteria;\r\n\t\t\t$searchCriteria->condition = 'CustomerNameArabic LIKE :searchstring OR MobilePhone LIKE :searchstring OR Nationality LIKE :searchstring';\r\n\t\t\t$searchCriteria->params = array(':searchstring'=> $searchstring);\r\n\t\t\t$searchCriteria->order = 'CustomerNameArabic';\r\n// $searchCriteria->limit = '0,300';\r\n\t\t\r\n\t\t\tif (CustomerMaster::model()->count($searchCriteria)>0)\r\n\t {\r\n\t\t\t\t$customerResult = CustomerMaster::model()->findAll($searchCriteria);\r\n $customerPropertyResult = \"123\";LandMaster::model()->findAllByAttributes(array(\"LandID\"=>$customerResult[0][\"CustomerID\"]));\r\n $customerResult[0][\"customerResultProperty\"] = $customerPropertyResult;\r\n\t\t\t}\r\n\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$lands = LandMaster::model()->findAllByAttributes(array(\"LandID\"=>$searchstring));\r\n\t\t\t\t$deed = DeedMaster::model()->findAllByAttributes(array(\"LandID\"=>$searchstring));\r\n\t\t\t\tprint CJSON::encode($lands);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t}\t\r\n\t\t\r\n\t}", "public function search(){}", "private function _getCompanySelector()\n {\n $sSearch = getValue('q');\n if(empty($sSearch))\n return json_encode(array());\n\n $oDB = CDependency::getComponentByName('database');\n\n $sQuery = 'SELECT * FROM company WHERE status = 1 AND lower(company_name) LIKE '.$oDB->dbEscapeString('%'.strtolower($sSearch).'%').' ORDER BY company_name desc';\n $oDbResult = $oDB->ExecuteQuery($sQuery);\n $bRead = $oDbResult->readFirst();\n if(!$bRead)\n return json_encode(array());\n\n $asJsonData = array();\n while($bRead)\n {\n $asData['name'] = $oDbResult->getFieldValue('company_name');\n $asJsonData[] = json_encode($asData);\n $bRead = $oDbResult->readNext();\n }\n echo '['.implode(',', $asJsonData).']';\n }", "public function get_results()\n {\n }", "public function get_results()\n {\n }", "public function outputJSON () { \r\n \r\n echo '{'; // begin the object \r\n echo '\"customers\":'; \r\n echo '['; // begin the array \r\n \r\n\t\t//Connect\r\n $pdo = Database::connect(); \r\n $sql = 'SELECT * FROM registrations ORDER BY id DESC'; \r\n \r\n $str = ''; \r\n\t\t//For each listed\r\n foreach ($pdo->query($sql) as $row) { \r\n $str .= '{'; \r\n $str .= '\"id\":\"'. $row['id'] . '\", '; \r\n $str .= '\"name\":\"'. $row['class'] . '\",'; \r\n\t\t\t$str .= '\"name\":\"'. $row['startTime'] . '\",'; \r\n $str .= '\"email\":\"'. $row['endTime'] . '\",'; \r\n $str .= '\"mobile\":\"'. $row['day']. '\"';; \r\n $str .= '},'; \r\n } \r\n\t\t\r\n $str = substr($str, 0, -1); // remove last comma \r\n echo $str; \r\n //Disconnect\r\n Database::disconnect(); \r\n echo ']'; // close the array \r\n echo '}'; // close the object \r\n }", "function get_customer_shipto($customer_id =\"\")\n {\n if(!empty($customer_id)){\n $output = $this->invm->get_customer_shipto($customer_id);\n }\n echo json_encode($output);\n }", "function showSearch () {\n\t\t$template['list'] = $this->cObj->getSubpart($this->templateCode,'###TEMPLATE_SEARCH###');\n\t\t$subpartArray = array();\n\t\t$markerArray = $this->helperGetLLMarkers(array(), $this->conf['search.']['LL'], 'search');\n\n\t\t// hide the radisus search by using a subpart\n\t\tif ($this->config['search']['radiusSearch'] != 1) {\n\t\t\t$subpartArray['###HIDE_RADIUSSEARCH###'] = '';\n\t\t}\n\n\t\t$markerArray['###DEFAULT_COUNTRY###'] = $this->config['defaultCountry']; // set the default country\n\t\t$markerArray['###DEFAULT_ZIP###'] = htmlspecialchars($this->piVars['zip']);\n\t\t$markerArray['###AUTOSUBMIT###'] = ($this->piVars['zip'] == '') ? '//' : '';\n\n\t\t// fetch the allowed categories as option list\n\t\t$markerArray['###CATEGORY###'] = $this->helperGetRecursiveCat($this->config['categories']);\n\n\t\t$content = $this->cObj->substituteMarkerArrayCached($template['list'], $markerArray, $subpartArray);\n\t\treturn $content;\n\t}", "function get_customer_data($customer_id =\"\")\n {\n $output = array('result'=>'');\n if(!empty($customer_id)){\n $output['result'] = $this->invm->get_customer_data($customer_id);\n\t\t//var_dump($output);exit;\n }\n echo json_encode($output);\n }", "function get_item_list_json()\n {\n $output = $this->invm->get_item_list_search(strtolower($this->uri->segment(4)));\n echo json_encode($output);\n }", "function getsearch_get(){\n $keyword = $this->get('keyword');\n $result = $this->lecturers_model->getsearch_all($keyword);\n $this->response($result); \n\n }", "public function filterCheckCustomerName($name)\n {\n $modelCustomer = new QcCustomer();\n $dataCustomer = $modelCustomer->infoFromSuggestionName($name);\n if (count($dataCustomer) > 0) {\n $result = array(\n 'status' => 'exist',\n 'content' => $dataCustomer\n );\n } else {\n $result = array(\n 'status' => 'notExist',\n 'content' => \"null\"\n );\n }\n die(json_encode($result));\n }", "public function ajaxGetCustomer()\n {\n $customers = $this->FacturasQueries->getClientes();\n $array = $customers->toArray();\n return response()->json($array); \n }", "function autoComplete()\n\t{\n\t\t\t\n\t\t$aUsers = array();\n\n\t\t$sql=\"SELECT title FROM products_table\";\n\t\t$obj = new Bin_Query();\n\t\t$obj->executeQuery($sql);\n\t\t//echo \"<pre>\";\n\t\t//print_r($obj->records);\n\t\t$count=count($obj->records);\n\t\tif($count!=0)\n\t\t{\n\t\t\tfor($i=0;$i<$count;$i++)\n\t\t\t\t$aUsers[]=$obj->records[$i]['title'];\n\t\t}\n\t\telse\n\t\t\t$aUsers[]='0 Results';\t\t\n\t\n\t\n\t\t$input = strtolower( $_GET['input'] );\n\t\t$len = strlen($input);\n\t\t$limit = isset($_GET['limit']) ? (int) $_GET['limit'] : 0;\n\t\t\n\t\t\n\t\t$aResults = array();\n\t\t$count = 0;\n\t\t\n\t\tif ($len)\n\t\t{\n\t\t\tfor ($i=0;$i<count($aUsers);$i++)\n\t\t\t{\n\t\t\t\t// had to use utf_decode, here\n\t\t\t\t// not necessary if the results are coming from mysql\n\t\t\t\t//\n\t\t\t\tif (strtolower(substr(utf8_decode($aUsers[$i]),0,$len)) == $input)\n\t\t\t\t{\n\t\t\t\t\t$count++;\n\t\t\t\t\t$aResults[] = array( \"id\"=>($i+1) ,\"value\"=>htmlspecialchars($aUsers[$i]));\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($limit && $count==$limit)\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\theader (\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\"); // Date in the past\n\t\theader (\"Last-Modified: \" . gmdate(\"D, d M Y H:i:s\") . \" GMT\"); // always modified\n\t\theader (\"Cache-Control: no-cache, must-revalidate\"); // HTTP/1.1\n\t\theader (\"Pragma: no-cache\"); // HTTP/1.0\n\t\t\n\t\t\n\t\t\n\t\tif (isset($_REQUEST['json']))\n\t\t{\n\t\t\theader(\"Content-Type: application/json\");\n\t\t\n\t\t\techo \"{\\\"results\\\": [\";\n\t\t\t$arr = array();\n\t\t\tfor ($i=0;$i<count($aResults);$i++)\n\t\t\t{\n\t\t\t\t$arr[] = \"{\\\"id\\\": \\\"\".$aResults[$i]['id'].\"\\\", \\\"value\\\": \\\"\".$aResults[$i]['value'].\"\\\"}\";\n\t\t\t}\n\t\t\techo implode(\", \", $arr);\n\t\t\techo \"]}\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader(\"Content-Type: text/xml\");\n\t\n\t\t\techo \"<?xml version=\\\"1.0\\\" encoding=\\\"utf-8\\\" ?><results>\";\n\t\t\tfor ($i=0;$i<count($aResults);$i++)\n\t\t\t{\n\t\t\t\techo \"<rs id=\\\"\".$aResults[$i]['id'].\"\\\" >\".$aResults[$i]['value'].\"</rs>\";\n\t\t\t}\n\t\t\techo \"</results>\";\n\t\t}\n\t\t\t\t\t\n\t}", "public static function search() {\n global $p;\n if (check_posts(['lat', 'lng'])) {\n $pharmacies = new pharmacies();\n $pharmacies->placeLat = $p['lat'];\n $pharmacies->placeLong = $p['lng'];\n $list = $pharmacies->get_place_by_latlng($p['distance'], 10);\n $r = [];\n\n foreach ($list['result'] as $place) {\n $f = new files($place['placeImg']);\n $place['placeImg'] = $f->placeOnServer;\n $r[] = $place;\n }\n $result['status'] = TRUE;\n $result['count'] = $list['nums'];\n $result['list'] = $r;\n } else {\n\n $result['status'] = FALSE;\n $result['error'] = 'invalid lat and lng';\n }\n\n// echo json_encode($p);\n// exit;\n if (@$p['post'] == 'post')\n $result['post'] = $p;\n echo json_encode($result);\n }", "function page_content() {\n\n require_once(\"/home/N4927/db-config/CustomerDb.php\");\n $customerObj = new CustomersDb();\n $tyhja_hakusana = '';\n $hakusana = '';\n\n if (!isset($_POST['searchSubmit'])) {\n $customers = $customerObj->getCustomers($tyhja_hakusana);\n } else {\n $hakusana = $_POST['search'];\n $customers = $customerObj->getCustomers($hakusana);\n \n }\n \n if (count($customers)>=1) {\n echo do_html_table($customers);\n } else { \n echo \"<p>Ei tuloksia hakusanalla {$hakusana}.</p>\";\n }\n // var_dump($customers); // ks. tarvittaessa\n}", "public function getServiceByName() {\n $term = Request::input('term', '');\n\n $results = array();\n $queries = Service::where('name', 'LIKE', '%'.$term.'%')\n ->take(10)->get();\n foreach ($queries as $query)\n $results[] = ['id' => $query->id,\n 'value' => $query->name];\n return response()->json($results);\n }", "function search(){\n if ( $this->RequestHandler->isAjax() ) {\n Configure::write ( 'debug', 0 );\n $this->autoRender=false;\n $users=$this->User->find('all',array('conditions'=>array('User.name LIKE'=>'%'.$_GET['term'].'%')));\n $i=0;\n foreach($users as $user){\n $response[$i]['value']=$user['User']['name'];\n $response[$i]['label']=$user['User']['name'];\n $i++;\n }\n echo json_encode($response);\n }else{\n if (!empty($this->data)) {\n $this->set('users',$this->paginate(array('User.name LIKE'=>'%'.$this->data['User']['name'].'%')));\n }\n }\n }", "public function jsonSerialize()\n {\n return parent::jsonSerialize() + ['text' => $this->text];\n }", "public function listContent() {\n\n\t\ttry {\n\n\t\t\t$search_content_type_id = Request::input('search_content_type_id');\n\n\t\t\tif ($search_content_type_id == ContentType::GetClientInfoContentTypeID()) {\n\t\t\t\treturn $this->listClients();\n\t\t\t}\n\n\t\t\t$contents = ConnectContent::where('station_id', '=', \\Auth::User()->station->id)->where('content_type_id', '=', $search_content_type_id)->where('is_temp', '=', 0);\n\n\t\t\t$search_content_sub_type_id = Request::input('search_content_sub_type_id');\n\t\t\t$search_content_rec_type = Request::input('search_content_rec_type');\n\t\t\t$search_ad_length = Request::input('search_ad_length');\n\t\t\t$search_atb_date = Request::input('search_atb_date');\n\t\t\t$search_line_number = Request::input('search_line_number');\n\t\t\t$search_start_date = Request::input('search_start_date');\n\t\t\t$search_end_date = Request::input('search_end_date');\n\t\t\t$search_ad_key = Request::input('search_ad_key');\n\t\t\t$search_ad_key = cleanupAdKey($search_ad_key);\n\n\t\t\t$search_manager_user_id = Request::input('search_manager_user_id');\n\t\t\t$search_agency_id = Request::input('search_agency_id');\n\t\t\t$search_content_client = Request::input('search_content_client');\n\t\t\t$search_content_product = Request::input('search_content_product');\n\t\t\t$search_created_date = Request::input('search_created_date');\n\n\t\t\t$search_content_version = Request::input('search_content_version');\n\n\t\t\t$search_session_name = Request::input('search_session_name');\n\t\t\t$search_start_time = Request::input('search_start_time');\n\t\t\t$search_end_time = Request::input('search_end_time');\n\t\t\t$search_content_weekdays = Request::input('search_content_weekdays');\n\t\t\t$search_content_who = Request::input('search_content_who');\n\t\t\t$search_content_what = Request::input('search_content_what');\n\n\t\t\tif ($search_content_type_id == ContentType::GetTalkContentTypeID()) {\n\n\t\t\t\tif (!empty($search_session_name)) {\n\t\t\t\t\t$contents = $contents->where('session_name', '=', $search_session_name);\n\t\t\t\t}\n\n\t\t\t\tif (!empty($search_start_time)) {\n\t\t\t\t\t$contents = $contents->where('start_time', '=', $search_start_time . ':00');\n\t\t\t\t}\n\n\t\t\t\tif (!empty($search_end_time)) {\n\t\t\t\t\t$contents = $contents->where('end_time', '=', $search_end_time . ':00');\n\t\t\t\t}\n\n\t\t\t\tif (!empty($search_content_who)) {\n\t\t\t\t\t$contents = $contents->where('who', '=', $search_content_who);\n\t\t\t\t}\n\n\t\t\t\tif (!empty($search_content_what)) {\n\t\t\t\t\t$contents = $contents->where('what', '=', $search_content_what);\n\t\t\t\t}\n\n\t\t\t\tif (!empty($search_content_weekdays)) {\n\t\t\t\t\t$whereRaw = '';\n\t\t\t\t\tforeach($search_content_weekdays as $key => $val) {\n\t\t\t\t\t\t$val = $val == 'false' ? false : true;\n\t\t\t\t\t\tif ($val) {\n\t\t\t\t\t\t\tif ($whereRaw != '') $whereRaw .= ' OR ';\n\t\t\t\t\t\t\t$whereRaw .= 'content_weekday_' . $key . '=1';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t/*if ($whereRaw == '') {\n\t\t\t\t\t\tfor ($i = 0; $i < 7; $i++) {\n\t\t\t\t\t\t\tif ($whereRaw != '') $whereRaw .= ' AND ';\n\t\t\t\t\t\t\t$whereRaw .= 'content_weekday_' . $i . '=0';\n\t\t\t\t\t\t}\n\t\t\t\t\t}*/\n\n\t\t\t\t\tif ($whereRaw != '') {\n\t\t\t\t\t\t$contents = $contents->whereRaw('(' . $whereRaw . ')');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!empty($search_content_sub_type_id)) {\n\t\t\t\t$contents = $contents->where('content_subtype_id', '=', $search_content_sub_type_id);\n\t\t\t}\n\n\n\t\t\tif (!empty($search_content_rec_type)) {\n\t\t\t\t$contents = $contents->where('content_rec_type', '=', $search_content_rec_type);\n\t\t\t}\n\n\t\t\tif (!empty($search_ad_length)) {\n\t\t\t\t$contents = $contents->where('ad_length', '=', $search_ad_length);\n\t\t\t}\n\n\t\t\tif (!empty($search_atb_date)) {\n\t\t\t\t$contents = $contents->where('atb_date', '=', $search_atb_date);\n\t\t\t}\n\n\t\t\tif (!empty($search_line_number)) {\n\t\t\t\t$contents = $contents->where('content_line_number', '=', $search_line_number);\n\t\t\t}\n\n\t\t\t/*if (!empty($search_start_date)) {\n\t\t\t\t$contents = $contents->where('start_date', '=', parseDateToMySqlFormat($search_start_date));\n\t\t\t}\n\t\t\t\n\t\t\tif (!empty($search_end_date)) {\n\t\t\t\t$contents = $contents->where('end_date', '=', parseDateToMySqlFormat($search_end_date));\n\t\t\t}*/\n\n\t\t\tif (!empty($search_start_date)) {\n\t\t\t\tif ($search_content_type_id == ContentType::GetTalkContentTypeID()) {\n\t\t\t\t\t$contents = $contents->where('start_date', '=', parseDateToMySqlFormat($search_start_date));\n\t\t\t\t} else {\n\t\t\t\t\t$contents = $contents->whereHas('contentDates', function($q) use ($search_start_date) {\n\t\t\t\t\t\t$q->where('start_date', '=', parseDateToMySqlFormat($search_start_date));\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!empty($search_end_date)) {\n\t\t\t\tif ($search_content_type_id == ContentType::GetTalkContentTypeID()) {\n\t\t\t\t\t$contents = $contents->where('end_date', '=', parseDateToMySqlFormat($search_end_date));\n\t\t\t\t} else {\n\t\t\t\t\t$contents = $contents->whereHas('contentDates', function($q) use ($search_end_date) {\n\t\t\t\t\t\t$q->where('end_date', '=', parseDateToMySqlFormat($search_end_date));\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\tif (!empty($search_ad_key)) {\n\t\t\t\t$contents = $contents->where('ad_key', '=', $search_ad_key);\n\t\t\t}\n\n\t\t\tif (!empty($search_manager_user_id)) {\n\t\t\t\t$contents = $contents->where('content_manager_user_id', '=', $search_manager_user_id);\n\t\t\t}\n\n\t\t\tif (!empty($search_agency_id)) {\n\t\t\t\t$contents = $contents->where('content_agency_id', '=', $search_agency_id);\n\t\t\t}\n\n\t\t\tif (!empty($search_content_client)) {\n\t\t\t\t$contents = $contents->whereHas('contentClient', function($q){\n\t\t\t\t\t$q->where('client_name', '=', Request::input('search_content_client'));\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (!empty($search_content_product)) {\n\t\t\t\t$contents = $contents->whereHas('contentProduct', function($q){\n\t\t\t\t\t$q->where('product_name', '=', Request::input('search_content_product'));\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (!empty($search_created_date)) {\n\t\t\t\t$search_created_date = parseDateToMySqlFormat($search_created_date);\n\t\t\t\t$contents = $contents->where('created_at', '>=', $search_created_date . ' 00:00:00')\n\t\t\t\t\t->where('created_at', '<=', $search_created_date . ' 23:59:59');\n\t\t\t}\n\n\t\t\tif (!empty($search_content_version)) {\n\t\t\t\t$contents = $contents->where('content_version', '=', $search_content_version);\n\t\t\t}\n\n\n\t\t\tif ($search_content_type_id == ContentType::findContentTypeIDByName('Material Instruction')) {\n\t\t\t\t$contents = $contents->with('contentClient')->with('contentProduct')->get();\n\t\t\t} else if ($search_content_type_id == ContentType::findContentTypeIDByName('Ad')) {\n\t\t\t\t$contents = $contents->with('contentDates')->get();\n\t\t\t} else {\n\t\t\t\t$contents = $contents->get();\n\t\t\t}\n\n\n\n\t\t\t$resultData = array();\n\n\t\t\tforeach ($contents as $content) {\n\n\t\t\t\t//if (!empty($content->content_parent_id)) continue;\n\n\t\t\t\t$newRow = array();\n\n\t\t\t\t/*$newRow['start'] = empty($content->start_date) ? '' : date(\"d-M\", strtotime($content->start_date));\n\t\t\t\t$newRow['end'] = empty($content->end_date) ? '' : date(\"d-M\", strtotime($content->end_date));*/\n\n\t\t\t\tif ($content->contentDates) {\n\t\t\t\t\t$startDateHTML = '';\n\t\t\t\t\t$endDateHTML = '';\n\t\t\t\t\tforeach ($content->contentDates as $content_date) {\n\t\t\t\t\t\t$startDateHTML .= date(\"d-M\", strtotime($content_date->start_date)) . '<br/>';\n\t\t\t\t\t\t$endDateHTML .= date(\"d-M\", strtotime($content_date->end_date)) . '<br/>';\n\t\t\t\t\t}\n\t\t\t\t\t$newRow['start'] = $startDateHTML;\n\t\t\t\t\t$newRow['end'] = $endDateHTML;\n\t\t\t\t} else {\n\t\t\t\t\t$newRow['start'] = '';\n\t\t\t\t\t$newRow['end'] = '';\n\t\t\t\t}\n\n\n\t\t\t\t//$newRow['type'] = empty(ContentType::$CONTENT_TYPES[$content->content_type_id]) ? '' : ContentType::$CONTENT_TYPES[$content->content_type_id];\n\n\t\t\t\t$newRow['type'] = (empty(ContentType::$CONTENT_SUB_TYPES[$content->content_type_id]) || empty(ContentType::$CONTENT_SUB_TYPES[$content->content_type_id][$content->content_subtype_id])) ? '' : ContentType::$CONTENT_SUB_TYPES[$content->content_type_id][$content->content_subtype_id];\n\n\t\t\t\t$newRow['content_rec_type'] = empty(ConnectContent::$CONTENT_REC_TYPE_LIST[$content->content_rec_type]) ? '' : ConnectContent::$CONTENT_REC_TYPE_LIST[$content->content_rec_type];\n\t\t\t\t$newRow['who'] = '<div class=\"twoline-ellipse\">' . $content->who . '</div>';\n\t\t\t\t$newRow['what'] = '<div class=\"twoline-ellipse\">' .$content->what . '</div>';\n\t\t\t\t$newRow['key'] = $content->ad_key;\n\t\t\t\t$newRow['duration'] = $content->ad_length;\n\n\t\t\t\t$newRow['audio_enabled'] = getEnabledSymbolHTML($content->audio_enabled);\n\t\t\t\t$newRow['text_enabled'] = getEnabledSymbolHTML($content->text_enabled);\n\t\t\t\t$newRow['image_enabled'] = getEnabledSymbolHTML($content->image_enabled);\n\t\t\t\t$newRow['action_enabled'] = getEnabledSymbolHTML($content->action_enabled);\n\t\t\t\t$newRow['is_ready'] = getCheckEnabledSymbolHTML($content->is_ready, $content->id);\n\n\t\t\t\tif ($search_content_type_id == ContentType::findContentTypeIDByName('Material Instruction')) {\n\n\t\t\t\t\t$newRow['client'] = empty($content->contentClient) ? '' : $content->contentClient->client_name;\n\t\t\t\t\t$newRow['product'] = empty($content->contentProduct) ? '' : $content->contentProduct->product_name;\n\n\t\t\t\t\t$newRow['atb_date'] = $content->atb_date;\n\t\t\t\t\t$newRow['line_number'] = $content->content_line_number;\n\t\t\t\t\t$newRow['created'] = date(\"d-M H:i\", strtotime($content->created_at));\n\n\t\t\t\t\t$newRow['version'] = ConnectContent::GetContentVersionString($content->content_version);\n\t\t\t\t}\n\n\t\t\t\t$newRow['start_time'] = $content->start_time;\n\t\t\t\t$newRow['end_time'] = $content->end_time;\n\n\t\t\t\t$resultData[] = $newRow;\n\n\t\t\t}\n\n\t\t\treturn response()->json(array('data' => $resultData));\n\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('data' => array()));\n\t\t}\n\n\t}", "public function searchJugador()\n\t{\n\t\t$searchJugador = json_decode($_POST[\"searchJugador\"], false);\n\t\t$jugadoresResponse = $this->Model_Jugador->getSearchJugador($searchJugador);\n\t\techo json_encode($jugadoresResponse);\n\t}", "public function result()\n {\n \n $output=\"\";\n\n if($_SERVER[\"REQUEST_METHOD\"] == \"POST\"){\n\n $_POST=filter_var_array($_POST,FILTER_SANITIZE_STRING);\n\n $search_query=$_POST[\"search_query\"];\n\n $post_obj=$this->model_objs[\"post_obj\"];\n\n $fetch_searched_posts=$post_obj->select(array(\n \"column_name\"=>\"posts.post_title\",\n \"where\"=>\"posts.post_title LIKE '%{$search_query}%'\"\n ));\n\n $output=$fetch_searched_posts[\"fetch_all\"];\n\n echo json_encode($output);\n \n\n }elseif($_SERVER[\"REQUEST_METHOD\"] == \"GET\"){\n\n $_GET=filter_var_array($_GET,FILTER_SANITIZE_STRING);\n\n if(isset($_GET[\"search_query\"]) && $_GET[\"search_query\"] !== \"\"){\n \n\n if(isset($this->data[\"common_info\"][\"nf_info\"]) && $this->data[\"common_info\"][\"nf_info\"][\"unread\"] > 0){\n\n $this->data[\"title_tag\"]= \"({$this->data[\"common_info\"][\"nf_info\"][\"unread\"]}) {$_GET['search_query']} | Lobster\";\n \n }else{\n \n $this->data[\"title_tag\"]= \"{$_GET['search_query']} | Lobster\";\n }\n\n //store the searched query\n $this->data[\"search_query\"] = $_GET['search_query'];\n\n //store the search_query index from $_GET\n $search_query=$_GET[\"search_query\"];\n\n //include all required models\n $post_obj=$this->model_objs[\"post_obj\"];;\n \n $fetch_result=$post_obj->select(array(\n \"column_name\"=>\"\n posts.post_id,\n posts.post_title,\n posts.post_content,\n posts.post_author,\n posts.post_date,\n posts.post_read,\n posts.post_link,\n post_files.pfile_name,\n post_files.pfile_ext,\n users.user_name,\n user_files.ufile_name,\n user_files.ufile_ext\n \",\n \"join\"=>array(\n \"users\"=>\"users.user_id = posts.post_author\",\n \"user_files\"=>\"user_files.user_id = posts.post_author\",\n \"post_files\"=>\"post_files.post_id = posts.post_id\"\n ),\n \"where\"=>\"posts.post_title LIKE '%{$search_query}%' OR posts.post_content LIKE '%{$search_query}%'\"\n ));\n\n if($fetch_result[\"status\"] == 1 && $fetch_result[\"num_rows\"] > 0){\n\n $this->data[\"total_results\"]=$fetch_result[\"num_rows\"];\n\n $this->data[\"results\"]=$fetch_result[\"fetch_all\"];\n \n }else{\n\n $this->data[\"total_results\"]=$fetch_result[\"num_rows\"];\n }\n\n // echo \"<pre>\";\n // print_r($this->data);\n // echo \"</pre>\";\n \n \n //use the function to show all search resutls\n $this->view(\"pages/result\",$this->data);\n \n\n }else{\n\n header(\"Location:{$this->config->domain()}\");\n }\n\n }\n }", "function item_search()\n {\n session_write_close();\n $suggestions = $this->Item->get_item_search_suggestions($this->input->get('term'), 'unit_price', 100);\n echo json_encode($suggestions);\n }", "public function extract_data_get()\r\n {\r\n if(isset($this->id)){\r\n $search = $this->Ajax->extract($this->id);\r\n foreach ($search as $row) {\r\n echo $row['word'].'<br>';\r\n }\r\n }\r\n }", "public function index() {\r\n\r\n $datums = Company::selectRaw('name AS value')\r\n ->addSelect('id', 'address_id', 'type');\r\n\r\n if (Input::get('q')) {\r\n $queryTokens = explode(' ', Input::get('q'));\r\n\r\n foreach ($queryTokens as $queryToken) {\r\n $datums = $datums->where(function($query) use ($queryToken) {\r\n $query->where('name', 'like', '%' . $queryToken . '%')\r\n ->orWhere('type', 'like', '%' . $queryToken . '%');\r\n });\r\n }\r\n }\r\n\r\n $datums = $datums->distinct()->take(50)->get();\r\n\r\n foreach ($datums as $datum) {\r\n\r\n $datum->tokens = array_merge(explode(' ', $datum->value), [$datum->value]);\r\n $address = $datum->address()->first();\r\n\r\n if ($address) {\r\n $datum->email = $address->email;\r\n $country = $address->country()->first();\r\n $datum->country = $country->name;\r\n }\r\n\r\n }\r\n\r\n return Response::json($datums);\r\n }", "public function searchKeyword (){\n $this->res = $this->daoJson->searchKeywordDate($this->keyword, $this->from, $this->to);\n }", "public function index() {\n $this->response->type('application/json');\n // Search the places\n $result = $this->searchPlace();\n // Set the result to the view\n $this->set(\"result\", $result);\n // Finally return the default view\n return;\n }", "public function autocomplete() {\n $a_like = explode(' | ', $_GET['q']);\n $like_barang = isset($a_like[1]) ? $a_like[1] : (isset($a_like[0]) ? $a_like[0] : 'unknown');\n $list = Barang::select('id', 'nama')->where('nama', 'like', '%'. $like_barang .'%')->orderBy('nama')->get();\n \n $rows = array();\n foreach($list as $item) {\n //$rows[] = $item->nama;\n $rows[] = $item->id . ' | ' . $item->nama;\n }\n \n return response()->json($rows);\n }", "public function getSearchableContent()\n\t{\n\t\treturn [\n\t\t\t$this->Title,\n\t\t\t$this->Content\n\t\t];\n\t}", "private function searchMaster() {\n $id = intval($_POST['query']);\n $data = $this->system->getDB()->query(\"SELECT * FROM master WHERE id=?\", array($id));\n echo(json_encode($data[0]));\n }", "public function search_cif_by_account_deposit()\n\t{\n\t\t$keyword = $this->input->post('keyword');\n\t\t$data = $this->model_transaction->search_cif_by_account_deposit($keyword);\n\n\t\techo json_encode($data);\n\t}", "public function autoCompleteList(){\n $this->layout='ajax';\n $this->autoRender =false;\n if($this->request->is('ajax')){\n $result = $this->Technology->find('list');\n echo json_encode($result);\n }\n }", "private function setSearchstring(){\n $search_req = $this->main->getArrayFromSearchString($_GET['content_search']);\n\n $searchstring = '';\n\n foreach($search_req as $key => $val){\n if(strlen($val) > 0){\n $searchstring .= \"`name` LIKE '%\".DB::quote($val).\"%' OR \";\n };\n };\n\n $searchstring .= \"`name` LIKE '%\".DB::quote($_GET['content_search']).\"%'\";\n\n return $searchstring;\n }", "public static function listData()\n\t{\n\t\t\n\t\t$customers = RestController::getAdminData('customers');\n\t\treturn CHtml::listData($customers, 'id', 'customerName');\n\t}", "public function autocompleteAction() {\n $suggestions = array(\n 'Application',\n 'Big',\n 'Computer',\n 'Development',\n 'Environment',\n 'Failure',\n 'Green',\n 'Hope',\n 'Injection',\n 'Java',\n 'Kilo'\n );\n\n $this->_helper->viewRenderer->setNoRender(true);\n $this->_helper->layout()->disableLayout();\n\n echo json_encode($suggestions);\n }", "public function searchResult()\r\n {\r\n // Setting the page title\r\n $this->set(\"title_for_layout\",\"Search Results\");\r\n \r\n // Getting all the categories\r\n $categoryList = $this->Category->getCategoryList();\r\n \r\n // Passing the categories list to views\r\n $this->set('categoryList', $categoryList);\r\n \r\n // initialising the variable\r\n $whereCondition = '';\r\n $search_keyword = '';\r\n // if any search keyword then setting into variable.\r\n if (isset($this->data['Product']['keywords']) && !empty($this->data['Product']['keywords']))\r\n {\r\n $search_keyword = $this->data['Product']['keywords'];\r\n \r\n if(!empty($whereCondition))\r\n {\r\n $whereCondition .= \" AND \";\r\n }\r\n \r\n $whereCondition .= \" (Product.product_name LIKE '%\".$search_keyword.\"%') OR (Product.product_desc LIKE '%\".$search_keyword.\"%') \";\r\n }\r\n \r\n $conditions[] = $whereCondition;\r\n \r\n // Getting the products and categories list agianst search criteria\r\n $productList = $this->Product->getSearchResults($conditions);\r\n \r\n // Passing for first product images by default.\r\n $this->set('productList', $productList);\r\n \r\n // Passing the search keywords to views\r\n $this->set('search_keyword', $search_keyword);\r\n \r\n }", "public function extObjContent() {}", "public function extObjContent() {}", "function get_kelas1c_json() {\n header('Content-Type: application/json');\n echo $this->bagikelas_model->get_all_kelas1c();\n }", "public function search_course()\n {\n \n $search_content = $this->input->get(\"search\");\n if($search_content==\"\"){\n \n }else{\n $search_content = $this->security->xss_clean($search_content);\n $search_content = htmlspecialchars($search_content);\n $data = $this->admin_student_courses_mdl->search_course($search_content);\n print json_encode($data);\n }\n\n }", "public function index()\n {\n $result = parent::index();\n $customer = $this->simiObjectManager->get('Magento\\Customer\\Model\\Session')->getCustomer();\n $addresses = $result['addresses'];\n foreach ($addresses as $index => $address) {\n $addressModel = $this->loadAddressWithId($address['entity_id']);\n $addresses[$index] = array_merge($address, $this->simiObjectManager\n ->get('Simi\\Simiconnector\\Helper\\Address')->getAddressDetail($addressModel, $customer));\n }\n $result['addresses'] = $addresses;\n return $result;\n }", "public function search()\n {\n $query = Input::get('query');\n $users = Patient::where('name','like','%'.$query.'%')->get();\n return response()->json($users);\n }", "function search()\n\t{\n\t\t$search=$this->input->post('search');\n\t\t\t$data_rows=get_temp_manage_table_data_rows1($this->Giftcard->search($search),$this);\n\t\t\techo $data_rows;\n\t}", "public function index(Request $request): JsonResponse\n {\n $customers = Customer::query();\n\n if ($request['query']) {\n $customers->where('name', 'like', '%' . $request['query'] . '%')\n ->orWhere('phone', 'like', '%' . $request['query'] . '%')\n ->orWhere('organization', 'like', '%' . $request['query'] . '%')\n ->orWhere('address', 'like', '%' . $request['query'] . '%')\n ->orWhere('feedback', 'like', '%' . $request['query'] . '%')\n ->orWhere('id', 'like', '%' . $request['query'] . '%');\n }\n if ($request['feedback']) {\n $customers->where('feedback', 'like', '%' . $request['feedback'] . '%');\n }\n\n $customers->orderBy('id', 'DESC');\n\n $customers = $customers->paginate($request->limit ? $request->limit : 20);\n\n\n $res['customers'] = CustomerResource::collection($customers);\n $res['total'] = $customers->total();\n\n return response()->json($res);\n }", "public function GetSearchNameList(){\n if($this->get_request_method()!= \"POST\"){\n $this->response('',406);\n }\n $type = $_POST['type'];\n $user_auth_key = $_POST['user_auth_key'];\n $format = $_POST['format'];\n $db_access = $this->dbConnect();\n $conn = $this->db;\n $res = new getService();\n if(!empty($type) && !empty($user_auth_key)){\n $result = $res->CheckAuthentication('', $user_auth_key, $conn);\n if($result != false){\n $res->get_search_name_list($type, $conn);\n $this->dbClose();\n }\n else{\n $this->dbclose();\n $error = array('status' => \"0\", \"msg\" => \"Not Authorised To get detail\");\n ($_REQUEST['format']=='xml')?$this->response($this->xml($error), 200):$this->response($res->json($error), 200);\n }\n }\n else{\n $error = array('status' => \"0\", \"msg\" => \"Fill All Fields\");\n ($_REQUEST['format']=='xml')?$this->response($this->xml($error), 200):$this->response($res->json($error), 200);\n }\n }", "public function searchSubContent()\n {\n # Set tables to search to a variable.\n $tables = $this->getTables();\n # Set fields to search to a variable.\n $fields = $this->getFields();\n # Set branch to search to a variable.\n $branch = $this->getSearchBranch();\n # Set search terms to a variable.\n $search_terms = $this->getSearchTerms();\n # Perform search.\n $this->performSearch($search_terms, $tables, $fields, $branch);\n }" ]
[ "0.6270609", "0.61887777", "0.60406697", "0.5962297", "0.5947368", "0.5911611", "0.57932943", "0.5776509", "0.5754771", "0.5719731", "0.56770664", "0.55908644", "0.55882204", "0.55829716", "0.5574771", "0.5563331", "0.5537312", "0.5535981", "0.552357", "0.5516162", "0.55085933", "0.5476943", "0.545749", "0.54568094", "0.5440355", "0.54218465", "0.53994626", "0.5396302", "0.5383111", "0.5380709", "0.5378699", "0.53696537", "0.5363047", "0.53582233", "0.5330048", "0.53145397", "0.5310372", "0.52963597", "0.52960944", "0.52915287", "0.5282737", "0.527278", "0.5267612", "0.5260032", "0.52568793", "0.525543", "0.5252708", "0.52436143", "0.5239781", "0.52280205", "0.5222768", "0.52207106", "0.52116805", "0.52078074", "0.5207282", "0.52071077", "0.5200105", "0.5198955", "0.5196909", "0.5184371", "0.51831925", "0.51774096", "0.5152359", "0.51511234", "0.5149596", "0.514778", "0.5142019", "0.5140957", "0.5139437", "0.5133325", "0.51312304", "0.51301074", "0.512396", "0.51166254", "0.5116", "0.50829816", "0.5082228", "0.50816995", "0.5081618", "0.50746155", "0.5070311", "0.506689", "0.5065724", "0.50636315", "0.50583637", "0.50506586", "0.50475776", "0.50417215", "0.50396514", "0.503682", "0.50288516", "0.5028265", "0.50237775", "0.5021395", "0.5013484", "0.5012996", "0.50059915", "0.5002411", "0.5001616", "0.49951097" ]
0.5544636
16
Uodate the customer note
public function ajaxProcessUpdateCustomerNote() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getCustomerNote();", "public function setCustomerNote($customerNote);", "public function getCustomerNoteNotify();", "private function setPurchaseNote() {\n $this->product->set_purchase_note($this->wcData->getPurchaseNote());\n }", "function cust_note_insert(){\r\n\t}", "function dbToUIdate() {\r\n\t\t\r\n\t\t$year = substr($this->event_date_time, -19, 4);\r\n\t\t$month = substr($this->event_date_time, -14, 2);\r\n\t\t$day = substr($this->event_date_time, -11, 2);\r\n\r\n\t\t$this->date = $month . \"/\" . $day . \"/\" . $year;\r\n\t\r\n\t}", "public function getUserNote()\n {\n return $this->user_note;\n }", "public function getCustomerNotes()\n {\n if (array_key_exists(\"customerNotes\", $this->_propDict)) {\n return $this->_propDict[\"customerNotes\"];\n } else {\n return null;\n }\n }", "public function note() { return $this->_m_note; }", "public function setAuFinalizeDate($oid){ \n $dt = new DateTime();\n $time = time();\n $fTime = $time + ($dt::WEEK * 2);\n \n $this->upd(\"orders\", array(\"auto_finalize\" => $fTime), \n array(\"order_id\" => $oid));\n \n return $fTime;\n }", "public function getCustomerDob();", "function generate_receipt_no()\n {\n return m_setting('evaluation.receipt_prefix') . date('dmyHis');\n }", "public function noteAdd(){\n $user = $this->_ap_right_check();\n if(!$user){\n return;\n } \n $this->Notes->add($user);\n }", "public function noteAdd(){\n $user = $this->_ap_right_check();\n if(!$user){\n return;\n }\n $this->Notes->add($user);\n }", "public function getFormattedPaymentDate(): string;", "function __editNotes()\n {\n\n //profiling\n $this->data['controller_profiling'][] = __function__;\n\n //get the note\n $this->__viewNotes();\n\n //visibility\n $this->data['visible']['wi_my_note_edit'] = 1;\n $this->data['visible']['wi_my_note_view'] = 0;\n\n }", "public function getNUCRate()\n {\n return $this->nUCRate;\n }", "function display_notes() {\n\t\t?>\n\t\t<style>\n\t #adminmenuwrap,\n\t #screen-meta,\n\t #screen-meta-links,\n\t #adminmenuback,\n\t #wpfooter,\n\t #wpadminbar{\n\t display: none !important;\n\t }\n\t #wpbody-content{\n\t \tpadding: 0;\n\t }\n\t html{\n\t padding-top: 0 !important;\n\t }\n\t #wpcontent{\n\t margin: 0 !important;\n\t }\n\t #wc-crm-page{\n\t margin: 15px !important;\n\t }\n </style>\n <input type=\"hidden\" id=\"customer_user\" name=\"customer_user\" value=\"<?php echo $this->user_id; ?>\">\n\t\t<div id=\"side-sortables\" class=\"meta-box-sortables\">\n\t\t\t\t<div class=\"postbox \" id=\"woocommerce-customer-notes\">\n\t\t\t\t\t\t<div class=\"inside\">\n\t\t\t\t\t\t<ul class=\"order_notes\">\n\t\t\t\t\t\t\t<?php $notes = $this->get_customer_notes(); ?>\n\t\t\t\t\t\t\t\t\t<?php if ( $notes ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tforeach( $notes as $note ) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li rel=\"<?php echo absint( $note->comment_ID ) ; ?>\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div class=\"note_content\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php echo wpautop( wptexturize( wp_kses_post( $note->comment_content ) ) ); ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<p class=\"meta\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<abbr class=\"exact-date\" title=\"<?php echo $note->comment_date_gmt; ?> GMT\"><?php printf( __( 'added %s ago', 'wc_customer_relationship_manager' ), human_time_diff( strtotime( $note->comment_date_gmt ), current_time( 'timestamp', 1 ) ) ); ?></abbr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php if ( $note->comment_author !== __( 'WooCommerce', 'wc_customer_relationship_manager' ) ) printf( ' ' . __( 'by %s', 'wc_customer_relationship_manager' ), $note->comment_author ); ?>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<a href=\"#\" class=\"delete_customer_note\"><?php _e( 'Delete note', 'wc_customer_relationship_manager' ); ?></a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\techo '<li>' . __( 'There are no notes for this customer yet.', 'wc_customer_relationship_manager' ) . '</li>';\n\t\t\t\t\t\t\t\t\t\t\t\t} ?>\n\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t\t<div class=\"add_note\">\n\t\t\t\t\t\t\t\t\t\t\t<h4>Add note</h4>\n\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t<textarea rows=\"5\" cols=\"20\" class=\"input-text\" id=\"add_order_note\" name=\"order_note\" type=\"text\"></textarea>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t<a class=\"add_note_customer button\" href=\"#\">Add</a>\n\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t</div>\n\t\t<?php\n\t}", "public function getCustpo()\n {\n return $this->custpo;\n }", "public function getNote() : string\n {\n return $this->note;\n }", "function getPatientNote($appointmentRecord)\n{\n // only show dentist note, viewing details like crown and carries requires clicking edit\n // then viewing notes edit page with all data filled in\n if (!isset($appointmentRecord['ProgressNotes'])) {\n return null;\n }\n $progressNotes = $appointmentRecord['ProgressNotes'];\n if (!is_array($progressNotes)) {\n return null;\n }\n\n $date = getDefaultDate();\n if (isset($appointmentRecord['AppointmentDate'])) {\n if (dateIsCorrupted($appointmentRecord['AppointmentDate'])) {\n $appointmentRecord['AppointmentDate'] = $date; // set to default\n } else { // otherwise\n $date = $appointmentRecord['AppointmentDate'];\n }\n }\n // set supported date format for date input(yyyy-mm-dd)\n $appointmentRecord['AppointmentDate'] = getNiceDate($date, 'Y-m-d');\n\n // set value for date column to format Dec 31, 2021\n $date = getNiceDate($date);\n $appointmentRecord['Date'] = $date;\n $appointmentRecord['ProgressNotes'] = $progressNotes;\n $appointmentRecord['Note'] = isset($progressNotes['Note']) ? $progressNotes['Note'] : 'edit to add notes';\n return $appointmentRecord;\n /* use commented array if keys in appointment record are not similar to keys required\n by calling method\n * [\n 'PatientName' => $appointmentRecord['PatientName'],\n 'DentistName' => $appointmentRecord['DentistName'],\n 'PatientNo' => $appointmentRecord['PatientNo'],\n 'FileNumber' => $appointmentRecord['FileNumber'],\n 'DOB' => $appointmentRecord['DOB'],\n 'Date' => $date,\n 'Note' => $progressNotes['Note'],\n 'AppointmentDate' => $appointmentRecord['AppointmentDate'],\n 'FirebaseId' => $appointmentRecord['FirebaseId'],\n 'ProgressNotes' => $progressNotes,\n ]*/\n}", "function get_customer_notes() {\n\t\tglobal $woocommerce, $post;\n\t\t$notes = array();\n\n\t\t$args = array(\n\t\t\t#'post_id' \t=> 0,\n\t\t\t'approve' \t=> 'approve',\n\t\t\t'type' \t\t=> 'customer_note',\n\t\t\t'meta_key' => 'customer_id',\n\t\t\t'meta_value' => $this->user_id,\n\t\t);\n\t\tremove_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );\n\t\tif( defined( 'WC_VERSION') && floatval(WC_VERSION) >= 2.2 ){\n\t\t\tremove_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_webhook_comments' ), 10, 1 );\n\t\t}\n\n\t\t$comments = get_comments($args);\n\n\t\tadd_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );\n\t\tif( defined( 'WC_VERSION') && floatval(WC_VERSION) >= 2.2 ){\n\t\t\tadd_filter( 'comments_clauses', array( 'WC_Comments', 'exclude_webhook_comments' ), 10, 1 );\n\t\t}\n\n\t\t#print_r($comments);\n\n\t\tforeach ( $comments as $comment ) {\n\t\t\t\t$comment->comment_content = make_clickable( $comment->comment_content );\n\t\t\t\t$notes[] = $comment;\n\t\t}\n\n\t\treturn (array) $notes;\n\n\t}", "private function _consolideDate(){\n\t\t$this->_mktime();\n\t\t$this->_setDate();\n\t}", "function createNote();", "public function getNote()\r\n {\r\n return $this->note;\r\n }", "public function setNotes(): Documents\r\n {\r\n $notes = $this->order->get_customer_order_notes();\r\n\r\n if (!empty($notes)) {\r\n foreach ($notes as $index => $note) {\r\n $this->notes .= $note->comment_content;\r\n if ($index !== count($notes) - 1) {\r\n $this->notes .= '<br>';\r\n }\r\n }\r\n }\r\n\r\n return $this;\r\n }", "public function setCustomerNoteNotify($customerNoteNotify);", "function cust_note_purge(){\r\n\t}", "protected function NotesText() {\n\t$out = NULL;\n \n\t$sPkgNotes = $this->Value('PkgNotes');\n\tif (!is_null($sPkgNotes)) {\n\t $out .= '<b>Pkg</b>: '.$sPkgNotes;\n\t}\n\t\n\t$sOrdNotes = $this->Value('OrdNotes');\n\tif (!is_null($sOrdNotes)) {\n\t $out .= '<b>Ord</b>: '.$sOrdNotes;\n\t}\n\t\n\treturn $out;\n }", "public static function possibly_add_note() {\n\t\t/**\n\t\t * Filter to allow for disabling sales record milestones.\n\t\t *\n\t\t * @since 3.7.0\n\t\t *\n\t\t * @param boolean default true\n\t\t */\n\t\t$sales_record_notes_enabled = apply_filters( 'woocommerce_admin_sales_record_milestone_enabled', true );\n\n\t\tif ( ! $sales_record_notes_enabled ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$yesterday = gmdate( 'Y-m-d', current_time( 'timestamp', 0 ) - DAY_IN_SECONDS );\n\t\t$total = self::sum_sales_for_date( $yesterday );\n\n\t\t// No sales yesterday? Bail.\n\t\tif ( 0 >= $total ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$record_date = get_option( self::RECORD_DATE_OPTION_KEY, '' );\n\t\t$record_amt = floatval( get_option( self::RECORD_AMOUNT_OPTION_KEY, 0 ) );\n\n\t\t// No previous entry? Just enter what we have and return without generating a note.\n\t\tif ( empty( $record_date ) ) {\n\t\t\tupdate_option( self::RECORD_DATE_OPTION_KEY, $yesterday );\n\t\t\tupdate_option( self::RECORD_AMOUNT_OPTION_KEY, $total );\n\t\t\t\treturn;\n\t\t}\n\n\t\t// Otherwise, if yesterdays total bested the record, update AND generate a note.\n\t\tif ( $total > $record_amt ) {\n\t\t\tupdate_option( self::RECORD_DATE_OPTION_KEY, $yesterday );\n\t\t\tupdate_option( self::RECORD_AMOUNT_OPTION_KEY, $total );\n\n\t\t\t$formatted_yesterday = gmdate( 'F jS', strtotime( $yesterday ) );\n\t\t\t$formatted_total = html_entity_decode( wp_strip_all_tags( wc_price( $total ) ) );\n\t\t\t$formatted_record_date = gmdate( 'F jS', strtotime( $record_date ) );\n\t\t\t$formatted_record_amt = html_entity_decode( wp_strip_all_tags( wc_price( $record_amt ) ) );\n\n\t\t\t$content = sprintf(\n\t\t\t\t/* translators: 1 and 4: Date (e.g. October 16th), 2 and 3: Amount (e.g. $160.00) */\n\t\t\t\t__( 'Woohoo, %1$s was your record day for sales! Net Sales was %2$s beating the previous record of %3$s set on %4$s.', 'woocommerce' ),\n\t\t\t\t$formatted_yesterday,\n\t\t\t\t$formatted_total,\n\t\t\t\t$formatted_record_amt,\n\t\t\t\t$formatted_record_date\n\t\t\t);\n\n\t\t\t$content_data = (object) array(\n\t\t\t\t'old_record_date' => $record_date,\n\t\t\t\t'old_record_amt' => $record_amt,\n\t\t\t\t'new_record_date' => $yesterday,\n\t\t\t\t'new_record_amt' => $total,\n\t\t\t);\n\n\t\t\t// We only want one sales record note at any time in the inbox, so we delete any other first.\n\t\t\tNotes::delete_notes_with_name( self::NOTE_NAME );\n\n\t\t\t$report_url = '?page=wc-admin&path=/analytics/revenue&period=custom&compare=previous_year&after=' . $yesterday . '&before=' . $yesterday;\n\n\t\t\t// And now, create our new note.\n\t\t\t$note = new Note();\n\t\t\t$note->set_title( __( 'New sales record!', 'woocommerce' ) );\n\t\t\t$note->set_content( $content );\n\t\t\t$note->set_content_data( $content_data );\n\t\t\t$note->set_type( Note::E_WC_ADMIN_NOTE_INFORMATIONAL );\n\t\t\t$note->set_name( self::NOTE_NAME );\n\t\t\t$note->set_source( 'woocommerce-admin' );\n\t\t\t$note->add_action( 'view-report', __( 'View report', 'woocommerce' ), $report_url );\n\t\t\t$note->save();\n\t\t}\n\t}", "function getNote()\n {\n return $this->note;\n }", "public function getNote();", "function uiToDBdate() {\r\n\r\n\t\t$month = (int) substr($this->date, -10, 2);\r\n\t\t$day = (int) substr($this->date, -7, 2);\r\n\t\t$year = (int) substr($this->date, -4, 4);\r\n\r\n\t\t$formattedDate = $year . \"-\" . $month . \"-\" . $day;\r\n\r\n\t\t$this->date = $formattedDate;\r\n\t}", "public function setCustomerNotes($val)\n {\n $this->_propDict[\"customerNotes\"] = $val;\n return $this;\n }", "public function getNote()\n {\n return $this->note;\n }", "public function getNote()\n {\n return $this->note;\n }", "public function getNote()\n {\n return $this->note;\n }", "public function getNote()\n {\n return $this->note;\n }", "public function getNote()\n {\n return $this->note;\n }", "public function getNote()\n {\n return $this->note;\n }", "public function getNote()\n {\n return $this->note;\n }", "public function getNote()\n {\n return $this->note;\n }", "public function getNote()\n {\n return $this->note;\n }", "public function getNote()\n {\n return $this->note;\n }", "public function getNote()\n {\n return $this->note;\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 function setNotes($value) {\n\t\tif ($value == NULL) {\n\t\t\t$this->_notes = \"\";\n\t\t} else {\n\t\t\t$this->_notes = $value;\n\t\t}\n\t}", "function setNoteText(){\n $html = \"\";\n \n $this->aFields[\"note\"]->editable = true;\n $this->aFields[\"note\"]->value = $html;\n }", "function getNote() {\n return $this->note;\n }", "public function getPurchaseDateCreated() {\n return $this->purchaseDateCreatedDate;\n }", "public static function add_payment_note() {\n\n check_ajax_referer( 'sumo-pp-add-payment-note' , 'security' ) ;\n\n $note = _sumo_pp_add_payment_note( $_POST[ 'content' ] , $_POST[ 'post_id' ] , 'pending' , __( 'Admin Manually Added Note' , _sumo_pp()->text_domain ) ) ;\n\n if ( $note = _sumo_pp_get_payment_note( $note ) ) {\n ?>\n <li rel=\"<?php echo absint( $note->id ) ; ?>\" class=\"<?php echo isset( $note->meta[ 'comment_status' ] ) ? implode( $note->meta[ 'comment_status' ] ) : 'pending' ; ?>\">\n <div class=\"note_content\">\n <?php echo wpautop( wptexturize( wp_kses_post( $note->content ) ) ) ; ?>\n </div>\n <p class=\"meta\">\n <abbr class=\"exact-date\" title=\"<?php echo _sumo_pp_get_date_to_display( $note->date_created ) ; ?>\"><?php echo _sumo_pp_get_date_to_display( $note->date_created ) ; ?></abbr>\n <?php printf( ' ' . __( 'by %s' , _sumo_pp()->text_domain ) , $note->added_by ) ; ?>\n <a href=\"#\" class=\"delete_note\"><?php _e( 'Delete note' , _sumo_pp()->text_domain ) ; ?></a>\n </p>\n </li>\n <?php\n }\n die() ;\n }", "public function getRecord()\n {\n return '04'\n . $this->formatters->getBankgiroFormatter()->format($this->creditor)\n . $this->formatters->getPayerNumberFormatter()->format($this->debtor)\n . $this->debtor->getAccount()->to16()\n . $this->formatters->getIdFormatter()->format($this->debtor)\n . str_repeat(' ', 24);\n }", "function render_notes_meta() {\n\t\tglobal $post;\n\t\t$details = get_post_meta( $post->ID, 'country_details', true );\n\t\t?>\n\t\t<textarea cols=\"50\" rows=\"5\" name=\"country_details\"><?php echo $details; ?></textarea>\n\t\t<?php\n\t}", "public function setCustomerCommentDelivery($observer)\r\n {\r\n try{\r\n $order = $observer->getEvent()->getOrder();\r\n $order_id = $order->getData('increment_id') ;\r\n $orderComment = $this->_getRequest()->getPost('suvery');\r\n if(trim($orderComment)!= 'other'){\r\n $orderComment = trim($orderComment);\r\n }else{\r\n $orderComment = trim($this->_getRequest()->getPost('suvery_other'));\r\n }\r\n //save suvery to database\r\n $resource = Mage::getSingleton('core/resource');\r\n $writeConnection = $resource->getConnection('core_write');\r\n $query = \"INSERT INTO \".Mage::getConfig()->getTablePrefix().\"onepagecheckout_suvery VALUES ('','\".$order_id.\"','\".$orderComment.\"','','')\";\r\n $writeConnection->query($query);\r\n //save delivery to datbase\r\n $delivery_date = $this->_getRequest()->getPost('delivery_date');\r\n $delivery_time = $this->_getRequest()->getPost('delivery_time');\r\n $resource = Mage::getSingleton('core/resource');\r\n $writeConnection = $resource->getConnection('core_write');\r\n $query = \"INSERT INTO \".Mage::getConfig()->getTablePrefix().\"onepagecheckout_delivery VALUES ('','\".$order_id.\"','\".$delivery_date.\"','\".$delivery_time.\"','','')\";\r\n $writeConnection->query($query);\r\n }catch(exception $e){\r\n \r\n }\r\n }", "function getDateNotified() {\n\t\treturn $this->getData('dateNotified');\n\t}", "public function onInvoicePostWrite(ViewEvent $event): void\n {\n $result = $event->getControllerResult();\n $method = $event->getRequest()->getMethod();\n\n if ($result instanceof Invoice === false || $method !== 'POST') {\n return;\n }\n\n /**\n * @var User $user\n */\n $user = $this->security->getUser();\n\n $this->em->getRepository(Invoice::class)->setIncrementedChrono($user);\n }", "public function getNewCustomerInvoice(){\n\t\t// $invoice_counter = \\DB::table('appsetting')->where('name','invoice_counter')->first()->value;\n\t\t// $invoice_number = 'INV/' . date('Y') . '/000' . $invoice_counter++;\n\t\t// // update invoice counter\n\t\t// \\DB::table('appsetting')->where('name','invoice_counter')->update(['value'=>$invoice_counter]);\n\n\t\treturn Helper::GenerateCustomerInvoiceNumber();\n\t}", "function ooffice_write_etablissement( $record ) {\r\n // initial string;\r\n\t\tglobal $odt;\r\n\t\tif ($record){\r\n\t\t\t$id = trim( $record->id );\r\n\t\t\t$num_etablissement = trim( $record->num_etablissement);\r\n\t\t\t$nom_etablissement = recode_utf8_vers_latin1(trim( $record->nom_etablissement));\r\n\t\t\t$adresse_etablissement = recode_utf8_vers_latin1(trim( $record->adresse_etablissement));\r\n\t\t\t$logo=$record->logo_etablissement;\r\n\t\t\t\r\n\t\t\t// $odt->SetFont('Arial','I',10);\r\n\t\t\t// $texte=get_string('etablissement','referentiel').' <b>'.$nom_etablissement.'</b><br />'.get_string('num_etablissement','referentiel').' : <i>'.$num_etablissement.'</i> <br />'.$adresse_etablissement;\r\n\t\t\t$texte='<b>'.$nom_etablissement.'</b><br />'.get_string('num_etablissement','referentiel').' : <i>'.$num_etablissement.'</i> <br />'.$adresse_etablissement;\r\n\t\t\t$texte=recode_utf8_vers_latin1($texte);\r\n\t\t\t$odt->WriteParagraphe(0,$texte);\r\n\t\t\treturn true;\r\n }\r\n\t\treturn false;\r\n}", "public function formatedBookingDate()\n {\n $timezone = app('UtillRepo')->getTimezone($this->user->timezone);\n $date = \\Carbon\\Carbon::createFromFormat('Y-m-d H:i:s', $this->created_at)->timezone($timezone); \n return $date->format('D d-M-Y').' at '. $date->format(' h:i A');\n }", "function insertNote($prj_id, $customer_id, $note)\n {\n $stmt = \"INSERT INTO\n \" . APP_DEFAULT_DB . \".\" . APP_TABLE_PREFIX . \"customer_note\n (\n cno_prj_id,\n cno_customer_id,\n cno_created_date,\n cno_updated_date,\n cno_note\n ) VALUES (\n \" . Misc::escapeInteger($prj_id) . \",\n \" . Misc::escapeInteger($customer_id) . \",\n '\" . Date_Helper::getCurrentDateGMT() . \"',\n '\" . Date_Helper::getCurrentDateGMT() . \"',\n '\" . Misc::escapeString($note) . \"'\n )\";\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 } else {\n return 1;\n }\n }", "public function add_note()\n {\n\n $cols = \"`desc`\";\n\n $value =\n \" '\" . $this->obj->all_data->notes->get_desc() . \"' \";\n\n\n $insert = $this->obj->insert(\"notes\", $cols, $value);\n return $insert;\n }", "public function created(Note $note): void\n {\n if (auth()->user()->client_id) {\n $mail = $this->mailQueue->create($note->notable, [\n 'to' => [$note->notable->user->email],\n 'cc' => [config('bt.mailDefaultCc')],\n 'bcc' => [config('bt.mailDefaultBcc')],\n 'subject' => trans('bt.note_notification'),\n 'body' => $note->formatted_note,\n 'attach_pdf' => config('bt.attachPdf'),\n ]);\n\n $this->mailQueue->send($mail->id);\n }\n }", "protected function convertDateUser()\n{\n$jour = substr($this->getDateUtilisateur(), 0, 2);\n$mois= substr($this->getDateUtilisateur(), 3, 2);\n$annee= substr($this->getDateUtilisateur(), 6, 4);\n$dateSys = $annee.\"-\".$mois.\"-\".$jour;\nreturn $dateSys;\n}", "function AddNote(){\n global $wpdb;\n $id = esc_attr($_REQUEST['order_id']);\n $data = array('note' => $_REQUEST['note']);\n if(isset($_REQUEST['admin'])) $data['admin'] = 1;\n if(isset($_REQUEST['seller'])) $data['seller'] = 1;\n if(isset($_REQUEST['customer'])) $data['customer'] = 1;\n if(isset($_REQUEST['file'])) $data['file'] = $_REQUEST['file'];\n\n if(Order::add_note($id, $data)) {\n\n $copy = array();\n if(isset($data['admin'])) $copy[] = '<input type=checkbox checked=checked disabled=disabled /> Admin &nbsp; ';\n if(isset($data['seller'])) $copy[] = '<input type=checkbox checked=checked disabled=disabled /> Seller &nbsp; ';\n if(isset($data['customer'])) $copy[] = '<input type=checkbox checked=checked disabled=disabled /> Customer &nbsp; ';\n $copy = implode(\"\", $copy);\n ?>\n\n <div class=\"panel panel-default\">\n <div class=\"panel-body\">\n <?php $note = wpautop(strip_tags(stripcslashes($data['note']),\"<a><strong><b><img>\")); echo preg_replace('/((http|ftp|https):\\/\\/[\\w-]+(\\.[\\w-]+)+([\\w.,@?^=%&amp;:\\/~+#-]*[\\w@?^=%&amp;\\/~+#-])?)/', '<a target=\"_blank\" href=\"\\1\">\\1</a>', $note); ?>\n </div>\n <?php if(isset($_REQUEST['file'])){ ?>\n <div class=\"panel-footer text-right\">\n <?php foreach($_REQUEST['file'] as $file){ ?>\n <a href=\"#\" style=\"margin-left: 10px\"><i class=\"fa fa-paperclip\"></i> <?php echo $file; ?></a> &nbsp;\n <?php } ?>\n </div>\n <?php } ?>\n <div class=\"panel-footer text-right\"><small><em><i class=\"fa fa-clock-o\"></i> <?php echo date(get_option('date_format') . \" h:i\", time()); ?></em></small>\n <div class=\"pull-left\"><small><em><?php if($copy!='') echo \"Copy sent to \".$copy; ?></em></small></div>\n </div>\n </div>\n <?php }\n else\n echo \"error\";\n }", "public function receiptFor(Email $email): string;", "public function setNote($note);", "public function getAddressNote()\n {\n return (string) $this->json()->address_note;\n }", "public function getCustomCustomerDescriptionToProduct(): string;", "private function date()\n {\n $pubDate = $this->article->Journal->JournalIssue->PubDate;\n \n if (isset($pubDate->MedlineDate)) {\n $date = (string)$pubDate->MedlineDate;\n } else {\n $date = implode(' ', (array)$pubDate);\n }\n \n return $date;\n }", "public function getDateAdmin()\n {\n return '<strong>' . $this->created_at->format(Config::get('settings.date_format')) . '</strong><br>' . $this->created_at->format(Config::get('settings.time_format'));\n }", "function get_aut_idautor(){return $this->aut_idautor;}", "public function getIdDetail()\n {\n \treturn \"AVD-03-\". date(\"Y\") . sprintf('%05d', $this->id_actadocumentacion);\n }", "function getCustomerNo() {\n return $this->customerNo;\n }", "protected function save_subscription_meta( $order_id, $customer_id ) {\n\t\tupdate_post_meta( $order_id, '_simplify_customer_id', wc_clean( $customer_id ) );\n\t}", "function write_customer_trans($trans_type, $trans_no, $debtor_no, $BranchNo,\n $date_, $reference, $Total, $discount = 0, $Tax = 0, $Freight = 0, $FreightTax = 0,\n $sales_type = 0, $order_no = 0, $ship_via = 0, $due_date = \"\",\n $AllocAmt = 0, $rate = 0, $dimension_id = 0, $dimension2_id = 0,\n $payment_terms = null, $tax_included = 0, $prep_amount = 0,$inv_trans_total=0,$is_paper_edit=false)\n{\n\n $display_customer = $_SESSION['Items']->display_customer;\n $customer_trn = $_SESSION['Items']->customer_trn;\n $customer_mobile = $_SESSION['Items']->customer_mobile;\n $customer_email = $_SESSION['Items']->customer_email;\n $customer_ref = $_SESSION['Items']->customer_ref;\n $barcode = $_SESSION['Items']->barcode;\n\n $credit_card_charge = $_SESSION['credit_card_charge'];\n $payment_method = $_SESSION['payment_method'];\n unset($_SESSION['credit_card_charge']);\n unset($_SESSION['payment_method']);\n\n $created_by = $_SESSION['wa_current_user']->user;\n\n $new = $trans_no == 0;\n $curr = get_customer_currency($debtor_no);\n if ($rate == 0)\n $rate = get_exchange_rate_from_home_currency($curr, $date_);\n\n $SQLDate = date2sql($date_);\n if ($due_date == \"\")\n $SQLDueDate = \"0000-00-00\";\n else\n $SQLDueDate = date2sql($due_date);\n\n if ($trans_type == ST_BANKPAYMENT)\n $Total = -$Total;\n\n if ($new || !exists_customer_trans($trans_type, $trans_no)) {\n if ($new) {\n $trans_no = get_next_trans_no($trans_type);\n\n if($trans_type == 10 && !$is_paper_edit) {\n $reference = get_next_invoice_ref($dimension_id);\n $_SESSION['Items']->reference = $reference;\n }\n\n }\n\n $sql = \"INSERT INTO \" . TB_PREF . \"debtor_trans (\n\t\ttrans_no, type,\n\t\tdebtor_no, branch_code,\n\t\ttran_date, due_date,\n\t\treference, tpe,\n\t\torder_, ov_amount, ov_discount,\n\t\tov_gst, ov_freight, ov_freight_tax,\n\t\trate, ship_via, alloc,\n\t\tdimension_id, dimension2_id, payment_terms, tax_included, prep_amount,\n\t\tdisplay_customer,customer_trn,customer_mobile,customer_email,customer_ref,barcode,\n\t\tcredit_card_charge,payment_method,inv_total,created_by \n\t\t) VALUES (\" . db_escape($trans_no) . \", \" . db_escape($trans_type) . \",\n\t\t\" . db_escape($debtor_no) . \", \" . db_escape($BranchNo) . \",\n\t\t'$SQLDate', '$SQLDueDate', \" . db_escape($reference) . \",\n\t\t\" . db_escape($sales_type) . \", \" . db_escape($order_no) . \", $Total, \" . db_escape($discount) . \", $Tax,\n\t\t\" . db_escape($Freight) . \",\n\t\t$FreightTax, $rate, \" . db_escape($ship_via) . \", $AllocAmt,\n\t\t\" . db_escape($dimension_id) . \", \" . db_escape($dimension2_id) . \", \n\t\t\" . db_escape($payment_terms, true) . \", \n\t\t\" . db_escape($tax_included) . \", \n\t\t\" . db_escape($prep_amount) . \",\n\t\t\" . db_escape($display_customer) . \",\n\t\t\" . db_escape($customer_trn) . \",\n\t\t\" . db_escape($customer_mobile) . \",\n\t\t\" . db_escape($customer_email) . \",\n\t\t\" . db_escape($customer_ref) . \",\n\t\t\" . db_escape($barcode) . \",\n\t\t\" . db_escape($credit_card_charge) . \",\n\t\t\" . db_escape($payment_method) . \",\n\t\t$inv_trans_total,$created_by)\";\n } else { // may be optional argument should stay unchanged ?\n $sql = \"UPDATE \" . TB_PREF . \"debtor_trans SET\n\t\tdebtor_no=\" . db_escape($debtor_no) . \" , branch_code=\" . db_escape($BranchNo) . \",\n\t\ttran_date='$SQLDate', due_date='$SQLDueDate',\n\t\treference=\" . db_escape($reference) . \", tpe=\" . db_escape($sales_type) . \", order_=\" . db_escape($order_no) . \",\n\t\tov_amount=$Total, \n\t\tinv_total=$inv_trans_total, \n\t\tov_discount=\" . db_escape($discount) . \", ov_gst=$Tax,\n\t\tov_freight=\" . db_escape($Freight) . \", ov_freight_tax=$FreightTax, rate=$rate,\n\t\tship_via=\" . db_escape($ship_via) . \", alloc=$AllocAmt,\n\t\t\n\t\tdimension2_id=\" . db_escape($dimension2_id) . \",\n\t\tpayment_terms=\" . db_escape($payment_terms, true) . \",\n\t\ttax_included=\" . db_escape($tax_included) . \",\n\t\tprep_amount =\" . db_escape($prep_amount) . \",\n\t\tdisplay_customer =\" . db_escape($display_customer) . \",\n\t\tcustomer_trn =\" . db_escape($customer_trn) . \",\n\t\tcustomer_mobile =\" . db_escape($customer_mobile) . \",\n\t\tcustomer_email =\" . db_escape($customer_email) . \",\n\t\tcustomer_ref =\" . db_escape($customer_ref) . \" \n\t\tWHERE trans_no=\" . db_escape($trans_no) . \" AND type=\" . db_escape($trans_type);\n }\n db_query($sql, \"The debtor transaction record could not be inserted\");\n\n\n// display_error(print_r($display_customer ,true));\n\n\n if ($trans_type != ST_JOURNAL) // skip for journal entries\n add_audit_trail($trans_type, $trans_no, $date_, $new ? '' : trans(\"Updated.\"));\n\n return $trans_no;\n}", "public function getDateString(){\n $date = Carbon::parse($this->created_at);\n $date->timezone = 'America/Montreal';\n return $date->format('d/m/Y');\n //return $date->format('m/d/Y');\n }", "public function getUdt()\n {\n return $this->udt;\n }", "function cilien_autoriser(){}", "function wv_get_commission_date($oid,$pid){\n \n $displayDate = get_post_meta($oid,'woo_commision_date_'.$pid,TRUE);\n $displayDate = ($displayDate ==\"\")?\"Commission is due.\":date(\"dM, Y, g:i a\",strtotime($displayDate));;\n return $displayDate;\n }", "public function getAuthorUpdatedDate();", "public function get_autor()\n {\n return $this->_autor;\n }", "function date_modif_manuelle_autoriser() {\n}", "public function receiptInfo($value) {\n $this->annotations['receipt_info'] = $value;\n return $this;\n }", "function set_comment_on_receipt() {\n $this->sale_lib->set_comment_on_receipt($this->input->post('show_comment_on_receipt'));\n }", "function Receipt ($Amt, $Cust, $Disc, $Narr, $id, $GLCode, $PayeeBankDetail, $CustomerName, $tag){\n\t\t$this->Amount =$Amt;\n\t\t$this->Customer = $Cust;\n\t\t$this->CustomerName = $CustomerName;\n\t\t$this->Discount = $Disc;\n\t\t$this->Narrative = $Narr;\n\t\t$this->GLCode = $GLCode;\n\t\t$this->PayeeBankDetail=$PayeeBankDetail;\n\t\t$this->ID = $id;\n\t\t$this->tag = $tag;\n\t}", "public function leaveNotes()\n {\n $this->validate(['notes' => 'required']);\n\n $this->order->update(['notes' => $this->notes]);\n\n $this->notify([\n 'title' => __('Notes added'),\n 'message' => __('Your note has been added and will be emailed to the user on their order.'),\n ]);\n }", "public function setNotes(string $notes = null) : CNabuDataObject\n {\n $this->setValue('nb_icontact_prospect_notes', $notes);\n \n return $this;\n }", "public function update(Request $request)\n {\n\n // set database\n $database = Auth::user()->getDatabase();\n\n //change database\n $owner = new Owner;\n $owner->changeConnection($database);\n\n //change database\n $note = new Note;\n $note->changeConnection($database);\n\n // get logged in user\n $user = Auth::user()->name;\n $now = Carbon\\Carbon::now('Africa/Cairo')->toDateTimeString();\n\n // get inputs\n $strKey = $request->input('strKey');\n $strIdentity = $request->input('strIdentity');\n $strOwners = $request->input('strOwners');\n\n $homePhone = $request->input('strHomePhoneNo');\n $workPhone = $request->input('strWorkPhoneNo');\n $cellPhone = $request->input('strCellPhoneNo');\n $email = $request->input('EMAIL');\n $note = $request->input('note');\n $newnote = $request->input('newnote');\n\n $strStreetNo = $request->input('strStreetNo');\n $strStreetName = $request->input('strStreetName');\n\n $followup = $request->input('followup');\n $date = \"\";\n if (strLen($followup) > 0) {\n $date = Carbon\\Carbon::createFromFormat('Y-m-d', $followup);\n }\n\n try {\n\n // update personal details\n // $owner = Owner::on( $database )->where('strIDNumber', $strIdentity)->update(array('strCellPhoneNo' => $cellPhone,\n // 'strHomePhoneNo' => $homePhone,\n // 'strWorkPhoneNo' => $workPhone,\n // 'EMAIL' => $email,\n // 'updated_at'=> $now\n // ));\n\n $properties = Property::on($database)->where('strKey', $strKey)->update(array('strStreetNo' => $strStreetNo, 'numStreetNo' => $strStreetNo, 'strStreetName' => $strStreetName));\n\n//dd($properties);\n\n //update owner details\n\n $owner = Owner::on($database)->where('strIDNumber', $strIdentity)->first();\n\n $owner->strHomePhoneNo = $homePhone;\n $owner->strCellPhoneNo = $cellPhone;\n $owner->strWorkPhoneNo = $workPhone;\n $owner->EMAIL = $email;\n\n $owner->save();\n\n // check if there is a new note\n if (strlen($newnote) > 0) {\n // if a previous note exists add a carrige return and new note\n if (strlen($note) > 0) {\n $updatednote = ltrim(rtrim($note)) . \"\\n\" . $now . \" \" . $user . \" wrote: \" . \"\\n\" . $newnote;\n } else {\n // add just the new note\n $updatednote = $now . \" \" . $user . \" wrote: \" . \"\\n\" . $newnote;\n }\n\n // update the note\n $affected = Note::on($database)->where('strKey', $strKey)->update(array('memNotes' => $updatednote, 'followup' => $date, 'updated_at' => $now));\n }\n\n Note::on($database)->where('strKey', $strKey)->update(array('followup' => $date, 'updated_at' => $now));\n\n } catch (exception $e) {\n\n Session::flash('flash_message', 'Error ' . $e->getMessage());\n Session::flash('flash_type', 'alert-danger');\n\n return Redirect::back();\n\n }\n\n Session::flash('flash_message', 'Updated ' . $strOwners . ' at ' . $now);\n Session::flash('flash_type', 'alert-success');\n\n return Redirect::back();\n\n }", "public function update(Request $request)\n {\n\n // set database\n $database = Auth::user()->getDatabase();\n\n //change database\n $owner = new Owner;\n $owner->changeConnection($database);\n\n //change database\n $note = new Note;\n $note->changeConnection($database);\n\n // get logged in user\n $user = Auth::user()->name;\n $now = Carbon\\Carbon::now('Africa/Cairo')->toDateTimeString();\n\n // get inputs\n $strKey = $request->input('strKey');\n $strIdentity = $request->input('strIdentity');\n $strOwners = $request->input('strOwners');\n\n $homePhone = $request->input('strHomePhoneNo');\n $workPhone = $request->input('strWorkPhoneNo');\n $cellPhone = $request->input('strCellPhoneNo');\n $email = $request->input('EMAIL');\n $note = $request->input('note');\n $newnote = $request->input('newnote');\n\n $strStreetNo = $request->input('strStreetNo');\n $strStreetName = $request->input('strStreetName');\n\n $followup = $request->input('followup');\n $date = \"\";\n if (strLen($followup) > 0) {\n $date = Carbon\\Carbon::createFromFormat('Y-m-d', $followup);\n }\n\n try {\n\n // update personal details\n // $owner = Owner::on( $database )->where('strIDNumber', $strIdentity)->update(array('strCellPhoneNo' => $cellPhone,\n // 'strHomePhoneNo' => $homePhone,\n // 'strWorkPhoneNo' => $workPhone,\n // 'EMAIL' => $email,\n // 'updated_at'=> $now\n // ));\n\n $properties = Property::on($database)->where('strKey', $strKey)->update(array('strStreetNo' => $strStreetNo, 'numStreetNo' => $strStreetNo, 'strStreetName' => $strStreetName));\n\n//dd($properties);\n\n //update owner details\n\n $owner = Owner::on($database)->where('strIDNumber', $strIdentity)->first();\n\n $owner->strHomePhoneNo = $homePhone;\n $owner->strCellPhoneNo = $cellPhone;\n $owner->strWorkPhoneNo = $workPhone;\n $owner->EMAIL = $email;\n\n $owner->save();\n\n // check if there is a new note\n if (strlen($newnote) > 0) {\n // if a previous note exists add a carrige return and new note\n if (strlen($note) > 0) {\n $updatednote = ltrim(rtrim($note)) . \"\\n\" . $now . \" \" . $user . \" wrote: \" . \"\\n\" . $newnote;\n } else {\n // add just the new note\n $updatednote = $now . \" \" . $user . \" wrote: \" . \"\\n\" . $newnote;\n }\n\n // update the note\n $affected = Note::on($database)->where('strKey', $strKey)->update(array('memNotes' => $updatednote, 'followup' => $date, 'updated_at' => $now));\n }\n\n Note::on($database)->where('strKey', $strKey)->update(array('followup' => $date, 'updated_at' => $now));\n\n } catch (exception $e) {\n\n Session::flash('flash_message', 'Error ' . $e->getMessage());\n Session::flash('flash_type', 'alert-danger');\n\n return Redirect::back();\n\n }\n\n Session::flash('flash_message', 'Updated ' . $strOwners . ' at ' . $now);\n Session::flash('flash_type', 'alert-success');\n\n return Redirect::back();\n\n }", "function footer_credit_footer_note( $content ) {\n\t$content .= '<footer class=\"footer-credit-footer-note\">Website is powered by <a href=\"https://twitter.com/ocen_chris\" title=\"chris\">Chris Ocen</a></footer>';\n\treturn $content;\n}", "public function toISOLocalDate() : string\n {\n if ($this->timezoneIsLocal) {\n return $this->format('Y-m-d');\n }\n return $this->cloneToMutable()->setTimezone(static::$timezoneLocal)->format('Y-m-d');\n }", "function getId_note() {\r\n\t\treturn $this->id_note;\r\n\t}", "protected function _update()\n {\n $this->oxnews__oxdate->setValue(oxRegistry::get(\"oxUtilsDate\")->formatDBDate($this->oxnews__oxdate->value, true));\n\n\n parent::_update();\n }", "public function getCreationDate() {\n\n return $this->u_creationdate;\n\n }", "public function getFormattedExpirationDate();", "public function addNote($userId, $note) {\n $this->clearCache($userId);\n $user = $this->db->findOne(array('_id' => $this->_toMongoId($userId)));\n \n if (!$user) return 'Invalid user id.';\n \n $note = $this->clean($note);\n \n if (empty($note)) return 'Invalid note.';\n \n $this->db->update(array('_id' => $this->_toMongoId($userId)), \n array('$push' => array(\n 'notes' => array(\n 'user' => MongoDBRef::create('users', Session::getVar('_id')),\n 'date' => time(),\n 'text' => substr($note, 0, 160)\n ))));\n }", "public function getPurchaseDateModified() {\n return $this->PurchaseDateModified;\n }", "public static function unsnooze_notes() {\n\t\t$data_store = \\WC_Data_Store::load( 'admin-note' );\n\t\t$raw_notes = $data_store->get_notes(\n\t\t\tarray(\n\t\t\t\t'status' => array( WC_Admin_Note::E_WC_ADMIN_NOTE_SNOOZED ),\n\t\t\t)\n\t\t);\n\t\t$now = new \\DateTime();\n\n\t\tforeach ( $raw_notes as $raw_note ) {\n\t\t\t$note = new WC_Admin_Note( $raw_note );\n\t\t\t$date_reminder = $note->get_date_reminder( 'edit' );\n\n\t\t\tif ( $date_reminder < $now ) {\n\t\t\t\t$note->set_status( WC_Admin_Note::E_WC_ADMIN_NOTE_UNACTIONED );\n\t\t\t\t$note->set_date_reminder( null );\n\t\t\t\t$note->save();\n\t\t\t}\n\t\t}\n\t}", "public function getSubscriberDob()\n {\n $dob = parent::getSubscriberDob();\n return $dob;\n }", "function Uzasadnienie($dbh, $un, $ud, $up, $roszczenia, $no)\r\n\t\t\t{\r\n\t\t\t\t$uzasadnienie=\"Powodowie prowadzą działalność gospodarczą pod nazwą NETICO Spółka Cywilna M.Borodziuk, M.Pielorz, K.Rogacki. Powodowie dnia $ud zawarli z Pozwanym(ą) umowę abonencką nr $un o świadczenie usług telekomunikacyjnych.\\n Termin płatności został określony w Umowie do $up dnia danego miesiąca. \\n Za świadczone usługi w ramach prowadzonej przez siebie działalności gospodarczej Powodowie wystawili Pozwanemu(ej) następujące faktury VAT:\\n \";\r\n\t\t\t\t\r\n\t\t\t\t$n=1;\r\n\t\t\t\t$suma=0;\r\n\t\t\t\tforeach ($roszczenia as $n => $v)\r\n\t\t\t\t{\r\n\t\t\t\t\t$oznaczenie=$roszczenia[$n][\"oznaczenie\"];\r\n\t\t\t\t\t$kwota=$roszczenia[$n][\"wartosc\"];\r\n\t\t\t\t\t$pozostalo=$roszczenia[$n][\"pozostalo\"];\r\n\t\t\t\t\t$d=$n;\r\n\t\t\t\t $kwota=number_format(round($kwota,2), 2,',','');\r\n\t\t\t\t\tif ( $pozostalo>0)\r\n\t\t\t\t\t\t{ \r\n\t\t\t\t\t\t\t$suma+=$pozostalo;\r\n\t\t\t\t\t\t\t$pozostalo=number_format($pozostalo, 2,',','');\r\n\t\t\t\t\t\t\t$uzasadnienie.=\"$oznaczenie na kwotę $kwota zł, pozostało do zapłaty $pozostalo zł. \\n\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t$uzasadnienie.=\"$oznaczenie na kwotę $kwota zł; \\n\";\r\n\t\t\t\t\t\t$suma+=$kwota;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t/*\t\r\n\t\t\t\tif (!empty($no))\r\n\t\t\t\t{\r\n\t\t\t\t\t$uzasadnienie.=\"W zwiazku z nie regulowaniem przez Pozwanego(ą) płatności wynikających z warunków Umowy Powodowie rozwiązali Umowę i wystawili Pozwanemu(ej) następujące noty obciążaniowe: \";\r\n\t\t\t\t\t$n=1;\r\n\t\t\t\t\tforeach ($no as $n => $v)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$oznaczenie=$no[$n][\"oznaczenie\"];\r\n\t\t\t\t\t\t$kwota=$no[$n][\"wartosc\"];\r\n\t\t\t\t\t\t$d=$n;\r\n\t\t\t\t\t\t$kwota=number_format($kwota,2), 2,',','');\r\n\t\t\t\t\t\t$uzasadnienie.=\"$oznaczenie na kwotę $kwota zł; \\n\";\r\n\t\t\t\t\t\t$suma+=$kwota;\r\n\t\t\t\t\t}\r\n\t\t\t\t}*/\r\n\t\t\t\t\r\n\t\t\t\t$suma=number_format(round($suma,2), 2,',','');\r\n\t\t\t\t$uzasadnienie.=\"Razem $suma zł.\\n\";\r\n\t\t\t\t$uzasadnienie.=\"Pomimo wezwań do zapłaty Pozwany(a) nie uregulował należności.\";\r\n\t\t\t\treturn($uzasadnienie);\r\n\t\t\t}" ]
[ "0.64560443", "0.58381635", "0.58098584", "0.5614441", "0.54944235", "0.5488741", "0.5483813", "0.5385629", "0.53834593", "0.53512853", "0.5295019", "0.5226333", "0.52056384", "0.5197897", "0.519386", "0.5157896", "0.5132205", "0.50845456", "0.5064908", "0.5039941", "0.49867326", "0.4985652", "0.49851534", "0.49843773", "0.49839795", "0.49815658", "0.49779353", "0.4977132", "0.49705863", "0.49642342", "0.49627912", "0.4939836", "0.49353784", "0.49336854", "0.49330258", "0.49330258", "0.49330258", "0.49330258", "0.49330258", "0.49330258", "0.49330258", "0.49330258", "0.49330258", "0.49330258", "0.49330258", "0.49296036", "0.4921235", "0.4907866", "0.4890198", "0.4885142", "0.4866171", "0.4865721", "0.48505422", "0.48470008", "0.48415536", "0.48267063", "0.48256302", "0.48190382", "0.4811511", "0.47985938", "0.47944254", "0.47888714", "0.4784068", "0.47685653", "0.47589996", "0.47584027", "0.47510654", "0.47470853", "0.4743864", "0.47378266", "0.4736302", "0.4732384", "0.47305506", "0.4730377", "0.47299615", "0.47249782", "0.47206637", "0.47182938", "0.47169536", "0.47136897", "0.47110584", "0.4709085", "0.47077173", "0.47069126", "0.47053555", "0.4704254", "0.46968335", "0.46941233", "0.46941233", "0.46915457", "0.46828824", "0.4667529", "0.4665152", "0.46643442", "0.46621156", "0.46585923", "0.46585897", "0.4656263", "0.4656056", "0.46548074" ]
0.51744837
15
Session constructor Starts the session with session_start() Note: that if the session has already started, session_start() does nothing
function Session () { session_start(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function __construct()\r\n {\r\n // session_set_save_handler(\r\n // array(&$this, \"sessionOpen\"),\r\n // array(&$this, \"sessionClose\"),\r\n // array(&$this, \"sessionRead\"),\r\n // array(&$this, \"sessionWrite\"),\r\n // array(&$this, \"sessionDestroy\"),\r\n // array(&$this, \"sessionGarbageCollector\")\r\n // );\r\n \r\n session_name(SESSION_NAME);\r\n session_start();\r\n }", "public static function start()\r\n {\r\n if (!self::isStarted())\r\n session_start();\r\n }", "private function __construct () {\n // start the session\n session_start();\n }", "public static function startSession();", "public function __construct()\n {\n if (!self::$_started) {\n session_start();\n self::$_started = true;\n if (!isset($_SESSION['__DEFAULT__'])) {\n $_SESSION['__DEFAULT__'] = array();\n }\n }\n }", "public function startSession() {}", "function __construct(){\n $this->startSession();\n }", "public function start()\n {\n if (self::$sessionStarted) {\n return;\n }\n\n // use this object as the session handler\n session_set_save_handler(\n array($this, 'sessionDummy'), // open\n array($this, 'sessionDummy'), // close\n array($this, 'sessionRead'),\n array($this, 'sessionDummy'), // write\n array($this, 'sessionDestroy'),\n array($this, 'sessionDummy') // gc\n );\n\n parent::start();\n }", "public function startSession()\n\t{\n\t\t// Let's start the session\n\t\tif (session_id() == '')\n\t\t{\n\t\t\tsession_start();\n\t\t}\n\t}", "public function __construct()\n {\n if (!session_id()) {\n session_start();\n }\n }", "public function __construct()\n {\n if(!session_id()) {\n session_start();\n }\n }", "public static function sessionStart()\n\t{\n\t\t{\n\t\t\tsession_start();\n\t\t}\n\t}", "public static function init()\n {\n if (self::$sessionStarted == false) {\n session_start();\n self::$sessionStarted = true;\n }\n }", "function __construct() {\n\t\t$this->time = time();\n\t\t$this->startSession();\n\t}", "public function startSession() {\n\n session_start(); //Tell PHP to start the session\n\n /* Determine if user is logged in */\n $this->logged_in = $this->checkLogin();\n\n /**\n * Set guest value to users not logged in, and update\n * active guests table accordingly.\n */\n if (!$this->logged_in) {\n $this->username = $_SESSION['username'] = GUEST_NAME;\n $this->userlevel = GUEST_LEVEL;\n $this->connection->addActiveGuest($_SERVER['REMOTE_ADDR'], $this->time);\n }\n /* Update users active timestamp */ else {\n $this->connection->addActiveUser($this->username, $this->time);\n }\n\n /* Remove inactive visitors from database */\n $this->connection->removeInactiveUsers();\n $this->connection->removeInactiveGuests();\n\n /* Set referrer page */\n if (isset($_SESSION['url'])) {\n $this->referrer = $_SESSION['url'];\n } else {\n $this->referrer = \"/\";\n }\n\n /* Set current url */\n $this->url = $_SESSION['url'] = $_SERVER['PHP_SELF'];\n }", "private function initSession()\n {\n // Start the session\n session_start();\n\n // Create session id constant\n define('SID', session_id());\n }", "public function __construct(){\n session_set_save_handler(\n array($this, \"_open\"),\n array($this, \"_close\"),\n array($this, \"_read\"),\n array($this, \"_write\"),\n array($this, \"_destroy\"),\n array($this, \"_clean\")\n );\n \n // Start the session\n session_start();\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t\n\t\tif ( isset($this->configuration['Session']['CacheExp']) and is_int($this->configuration['Session']['CacheExp']) )\n\t\t\tsession_cache_expire($this->configuration['Session']['CacheExp']);\n\t\t\n\t\tif (!session_id())\n\t\t\tsession_start();\n\t}", "public function __construct()\n\t{\n\t\t\n\t\t//ini_set('register_globals',1);//set to on (generate err in off mode)\n\t\t\n\t\tif (!isset($_SESSION['session']))//session not started\n\t\t{\n\t\t\tsession_start();\n\t\t\t$_SESSION['session']=\"sarted!\";\n\t\t}\n\t\tGSMS::$class['system_log']->log('DEBUG','Session class Initialized');\n\t\t//session function list in php extention on php 5.2.3\n\t\t/*\n\t\tsession_cache_expire\n\t\tsession_cache_limiter\n\t\tsession_commit\n\t\tsession_decode\n\t\tsession_destroy\n\t\tsession_encode\n\t\tsession_get_cookie_params\n\t\tsession_id\n\t\tsession_is_registered\n\t\tsession_module_name\n\t\tsession_name\n\t\tsession_regenerate_id\n\t\tsession_register\n\t\tsession_save_path\n\t\tsession_set_cookie_params\n\t\tsession_set_save_handler\n\t\tsession_start\n\t\tsession_unregister\n\t\tsession_unset\n\t\tsession_write_close\n\t\t*/\n\t}", "function __construct() {\n if (session_status() == PHP_SESSION_NONE || session_id() == '') { session_start();\t}\n # check existing login\n $this->_checkLogin();\n }", "public function __construct() {\n\t\tsession_start();\n\t}", "public function initSession() {\n\n\n\n if (session_id() == '') {\n\n // session isn't started\n\n session_start();\n }\n }", "public function __construct() {\n global $conn;\n $this->connection = $conn;\n $this->time = time();\n $this->startSession();\n }", "private static function startSession() {\n if (session_status() == PHP_SESSION_NONE) {\n session_start();\n }\n }", "public function createSession()\n {\n session_start();\n }", "public function __construct() {\n $this->session = new Session();\n }", "function __construct() {\n parent::__construct();\n session_start();\n }", "function __construct() {\n parent::__construct();\n session_start();\n }", "public function __construct()\n {\n $this->prefix = config('app.session_prefix');\n\n if (session_status() !== PHP_SESSION_ACTIVE) {\n $this->started = session_start();\n }\n session_regenerate_id(true);\n }", "function __construct() {\n if (!isset($_SESSION)) {\n session_start(); // Inicia a sessão caso não exista sessao\n }\n }", "public static function init() {\n\t\t\t\n\t\t\t/* Run session */\n\t\t\tsession_start();\n\t\t\t\n\t\t}", "public static function initSession(){\n \n self::setSessionIni(); \n self::setSessionHandler();\n session_start();\n self::checkSystemCookie();\n\n // if 'started' is set for previous request\n //we truely know we are in 'in_session'\n if (isset($_SESSION['started'])){\n $_SESSION['in_session'] = 1;\n }\n\n // if not started we do not know for sure if session will work\n // we destroy 'in_session'\n if (!isset($_SESSION['started'])){\n $_SESSION['started'] = 1;\n $_SESSION['in_session'] = null;\n }\n\n // we set a session start time\n if (!isset($_SESSION['start_time'])){\n $_SESSION['start_time'] = time();\n }\n }", "public function __construct()\n {\n // Construct session place\n if(!array_key_exists(self::SESSION_KEY, $_SESSION)) {\n $_SESSION[self::SESSION_KEY] = array();\n }\n }", "private function __construct()\n {\n // suppress notice that session has already started\n $e = error_reporting('E_NONE');\n session_start();\n error_reporting($e);\n\n // initialize storage\n if (! isset($_SESSION[self::KEY])) $_SESSION[self::KEY] = array();\n if (! isset($_SESSION[self::ERRORS])) $_SESSION[self::ERRORS] = array();\n if (! isset($_SESSION[self::NOTICE])) $_SESSION[self::NOTICE] = self::EMPTY_STRING;\n }", "private function initSession() :void\n {\n if (session_status() === PHP_SESSION_NONE) {\n session_start();\n }\n }", "public static function init()\n {\n if (session_id() == '') {\n session_start();\n }\n }", "public static function init()\n {\n if (session_id() == '') {\n session_start();\n }\n }", "function __construct() {\n\t \tparent::__construct();\n\t \t// session_start();\n }", "protected function initializeSession() {}", "public final function start() \n\t{\n\t\tif (isset($_SESSION)) return;\n\t\tsession_start();\n\t}", "public function __construct()\n {\n ini_set('session.use_cookies', 1);\n ini_set('session.use_only_cookies', 1);\n ini_set('session.use_trans_sid', 0);\n ini_set('session.save_handler', 'files');\n ini_set('session.gc_maxlifetime', 3600);\n\n session_name($this->sessionName);\n session_set_cookie_params(\n $this->sessionMaxLifeTime,\n $this->sessionPath,\n $this->sessionDomain,\n $this->sessionSSL,\n $this->sessionHTTPOnly\n );\n session_save_path($this->sessionSavePath);\n\n /*\n * very important : so read, write \n * can use them form my class not from SessionHandler\n * */\n session_set_save_handler($this, true);\n }", "public function __construct()\n {\n try {\n session_start();\n } catch(\\Exception $e) {\n echo $e->getMessage();\n }\n }", "public function __construct() {\n parent::__construct();\n session_start();\n }", "static function start()\n {\n if (session_status() == PHP_SESSION_NONE) {\n session_start();\n }\n }", "public function __construct() {\n //no session under cli\n if (php_sapi_name() === 'cli') {\n return false;\n }\n\n //100 minutes expire time , php default value is 180\n session_cache_expire(100);\n session_start();\n session_regenerate_id(TRUE); //每次从新加载都会产生一个新的session id\n int_set(\"session.use_only_cookies\", 1); //表示只使用cookies存放session id,这可以避免session固定攻击\n }", "public function __construct()\n {\n //Konstruktoraufruf der Parent-Klassen\n parent::__construct();\n //Starten der Session damit diese verwendet werden kann\n session_start();\n\n }", "protected function initSession() {\n\t\tSession::init($this);\n\t}", "public function SessionStart ();", "public static function startSession() {\n ob_clean();\n session_start();\n\n self::$isStarted = true;\n }", "public function session_init()\n {\n // session started (Installer?)\n if (session_id())\n return;\n\n $sess_name = $this->config->get('session_name');\n $sess_domain = $this->config->get('session_domain');\n $lifetime = $this->config->get('session_lifetime', 0) * 60;\n\n // set session domain\n if ($sess_domain) {\n ini_set('session.cookie_domain', $sess_domain);\n }\n // set session garbage collecting time according to session_lifetime\n if ($lifetime) {\n ini_set('session.gc_maxlifetime', $lifetime * 2);\n }\n\n ini_set('session.cookie_secure', rcube_ui::https_check());\n ini_set('session.name', $sess_name ? $sess_name : 'roundcube_sessid');\n ini_set('session.use_cookies', 1);\n ini_set('session.use_only_cookies', 1);\n ini_set('session.serialize_handler', 'php');\n\n // use database for storing session data\n $this->session = new rcube_session($this->get_dbh(), $this->config);\n\n $this->session->register_gc_handler(array($this, 'temp_gc'));\n $this->session->register_gc_handler(array($this, 'cache_gc'));\n\n // start PHP session (if not in CLI mode)\n if ($_SERVER['REMOTE_ADDR'])\n session_start();\n\n // set initial session vars\n if (!$_SESSION['user_id'])\n $_SESSION['temp'] = true;\n\n // restore skin selection after logout\n if ($_SESSION['temp'] && !empty($_SESSION['skin']))\n $this->config->set('skin', $_SESSION['skin']);\n }", "public function startSession() {\n if (ini_set('session.use_only_cookies', 1) === FALSE) {\n return;\n }\n //session_name('');\n session_start();\n session_regenerate_id();\n }", "public function __construct(){\n session_start();\n }", "public function __construct() {\n session_start();\n $this->check_stored_login();\n }", "public static function instance(){\n\t\t\tif(!Session::session_started()){\n\t\t\t\tSession::session_start();\n\t\t\t}\n\t\t}", "private function initSessionIfNecessary() {\n if (\\session_status() === \\PHP_SESSION_NONE) {\n // use cookies to store session IDs\n \\ini_set('session.use_cookies', 1);\n // use cookies only (do not send session IDs in URLs)\n \\ini_set('session.use_only_cookies', 1);\n // do not send session IDs in URLs\n \\ini_set('session.use_trans_sid', 0);\n\n // start the session (requests a cookie to be written on the client)\n//\t\t\t@Session::start();\n }\n }", "private static function init(){\n\t\t\tif (session_status() != PHP_SESSION_ACTIVE) {\n\t\t\t\tsession_start();\n\t\t\t}\n\t\t}", "protected function _startSession()\n\t{\n\t\tif (is_null($this->_client))\n\t\t{\n\t\t\t$this->_client = new SoapClient($this->config['url']);\t\t\t\n\t\t}\n\t\tif (is_null($this->_session))\n\t\t{\n\t\t\t$this->_session = $this->_client->login($this->config['apiuser'], $this->config['apikey']);\t\t\t\n\t\t}\t\t\n\t\tpr($this->_client->__getFunctions());\n\t}", "public function setSession()\n\t{\n\t\t$this->session = Session::getInstance();\n\t\t$this->session->start();\n\t}", "function wpdev_session_start() {\n session_start();\n }", "public function __construct()\n {\n session_start();\n $this->id = session_id();\n }", "public function __construct(){\n\t\tsession_start();\n\t\tif(!self::$_singleton instanceof self){\n\t\t\t$this->setInstance();\n\t\t}\n\t}", "public static function session_start(){\n\t\t\tif(getenv('HTTPS')){\n\t\t\t\t// Use secure cookies if available.\n\t\t\t\tini_set('session.cookie_secure', 1);\n\t\t\t}\n\n\t\t\t// Since we don't allow Sessions to be stored in the Database...\n\t\t\tini_set('session.serialize_handler', 'php');\n\t\t\tini_set('session.cookie_path', '/');\n\n\t\t\t// Attempt to save sessions in /tmp/sessions\n\t\t\tif(is_dir(TMP_PATH . 'sessions')){\n\t\t\t\tini_set('session.save_path', TMP_PATH . DS . 'sessions');\n\t\t\t}\n\t\t\t\n\t\t\tini_set('session.use_cookies', 1);\n\t\t\tini_set('session.cookie_lifetime', Config::read('Session.timeout'));\n\t\t\tini_set('session.use_trans_sid', 0);\n\t\t\tini_set('url_rewriter.tags', '');\n\n\t\t\tif(!isset($_SESSION)){\n\t\t\t\tsession_cache_limiter('must-revalidate');\n\t\t\t\tsession_start();\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t}", "public static function start(): void\n {\n if (session_status() === PHP_SESSION_NONE) {\n ini_set('session.use_strict_mode', true);\n $options = [\n 'expires' => 0,\n 'path' => HTTPRequest::root(),\n 'secure' => HTTPRequest::isHTTPS(),\n 'httponly' => true,\n 'samesite' => Cookie::SAMESITE_STRICT\n ];\n if (($timeout = Formwork::instance()->option('admin.session_timeout')) > 0) {\n $options['expires'] = time() + $timeout * 60;\n }\n session_name(self::SESSION_NAME);\n session_start();\n if (!isset($_COOKIE[self::SESSION_NAME]) || $options['expires'] > 0) {\n // Send session cookie if not already sent or timeout is set\n Cookie::send(self::SESSION_NAME, session_id(), $options, true);\n } elseif ($_COOKIE[self::SESSION_NAME] !== session_id()) {\n // Remove cookie if session id is not valid\n unset($_COOKIE[self::SESSION_NAME]);\n Cookie::send(self::SESSION_NAME, '', ['expires' => time() - 3600] + $options, true);\n }\n }\n }", "function __construct() {\t\t\n\t\t\t// start the session\n\t\t\tself::start();\n\t\t\t\n\t\t\t// get session expire time\n\t\t\t$expiretime = self::get('expiretime');\n\t\t\t\n\t\t\t//check session\t\t\n\t\t\tif(isset($expiretime)) {\n\t\t\t\tif(self::get('expiretime') < time()) {\n\t\t\t\t\tself::destroy();\t\t\t\t\t\t\n\t\t\t\t}\t\t\t\n\t\t\t}\t\n\t\t\t\n\t\t\t//session time\n\t\t\t$minutes = SESSION_TIMEOUT;\n\t\t\t\n\t\t\t//set session time out\t\t\n\t\t\tself::set('expiretime', time() + ($minutes * 60));\n\t\t}", "public function __construct()\n\t{\n\t\tsession_start();\n\t\t$this->timer = microtime();\n\t}", "function __construct() {\n\t\t\tsession_start();\n\t\t\t$this->check_login();\n\t\t}", "private function __construct(){\n // 1800 seconds = 30 minutes\n session_set_cookie_params(1800, \"/\");\n\n session_start();\n\n if(!empty($_SESSION[\"username\"])){\n self::$is_logged_in = true;\n self::$logged_user = array(\n \"user_id\" => $_SESSION[\"user_id\"],\n \"username\" => $_SESSION[\"username\"],\n );\n }\n }", "function MySessionStart() {\n\tif (defined('SET_SESSION_NAME')) session_name(SET_SESSION_NAME);\n\t\n\tif (TRACKPOINT_ISSETUP) {\n\t\tif (!defined('TABLEPREFIX')) define('TABLEPREFIX', TRACKPOINT_TABLEPREFIX);\n\t\t$ses_class = new Session();\n\t\tsession_set_save_handler(\n\t\t\tarray(&$ses_class, '_open'),\n\t\t\tarray(&$ses_class, '_close'),\n\t\t\tarray(&$ses_class, '_read'),\n\t\t\tarray(&$ses_class, '_write'),\n\t\t\tarray(&$ses_class, '_destroy'),\n\t\t\tarray(&$ses_class, '_gc')\n\t\t);\n\t} else {\n\t\tini_set('session.save_handler', 'files');\n\t\tif (defined('TEMP_DIRECTORY') && is_writable(TEMP_DIRECTORY)) ini_set('session.save_path', TEMP_DIRECTORY);\n\t}\n\tsession_start();\n}", "public function __construct(){\n\t\t// Démarre la session\n\t\t@session_start();\n\t\t\n\t\t// Récupère les clés du tableau de session\n\t\t$this->keys = array_keys($_SESSION);\n\t}", "function __construct () {\n\t\tif (!isset($_SESSION)) {\n\t\t\tsession_start();\n\t\t}\n\t\t$this->check_login();\n\t}", "public function __construct($id=0){\n parent::__construct($id);\n if (session_status() == PHP_SESSION_NONE) {\n session_start();\n }\n }", "public function initializeSession() {\n\t\t$this->objectContainer->initializeSession();\n\t\t$this->sessionInitialized = TRUE;\n\t}", "public function start()\n {\n $path = ini_get('session.cookie_path');\n if (!strlen($path)) {\n $path = '/';\n }\n\n $secure = false;\n\n if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https') {\n $secure = true;\n } else {\n $secure = (empty($_SERVER[\"HTTPS\"]) || ($_SERVER[\"HTTPS\"] === 'off')) ? false : true;\n }\n\n session_set_cookie_params(ini_get('session.cookie_lifetime'), $path, ini_get('session.cookie_domain'), $secure);\n\n if (version_compare(PHP_VERSION, '7.0.0') >= 0) {\n $this->close_session_locks = true;\n }\n\n if ($this->close_session_locks) {\n $result = $this->session_read();\n } else {\n $result = $this->session_open();\n }\n if ($result) {\n $this->flash = new Phpr_Flash();\n if ($this->flash) {\n if (array_key_exists('flash_partial', $_POST) && strlen($_POST['flash_partial'])) {\n $this->flash['system'] = 'flash_partial:' . $_POST['flash_partial'];\n }\n }\n }\n\n return $result;\n }", "public function startSession()\n {\n $this->oSession = Session::getInstance();\n return $this;\n }", "public function __construct()\n {\n $this->session = Kazinduzi::session();\n }", "function __construct() {\n\t\t\t// Suppress the automatic garbage collection bug thats detailed \n\t\t\t// at: http://jed.mu/5Z7I\n\t\t\t@session_start();\n\t\t\t$this->check_login();\n\t\t}", "function start_session() {\n if(!session_id()) {\n session_start();\n }\n}", "public function instantiateSession()\n {\n session_start();\n\n if (isset($_SESSION['instanceID']) === false && defined('DOING_CRON') === false) {\n $this->generateDemoInstance();\n } else {\n $this->instanceID = $_SESSION['instanceID'];\n }\n }", "public function start()\n\t{\n\t\t$path = ini_get('session.cookie_path');\n\t\tif (!strlen($path))\n\t\t\t$path = '/';\n\n\t\t$secure = false;\n\n\t\tif (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https')\n\t\t\t$secure = true;\n\t\telse\n\t\t\t$secure = (empty($_SERVER[\"HTTPS\"]) || ($_SERVER[\"HTTPS\"] === 'off')) ? false : true;\n\t\t\t\n\t\tsession_set_cookie_params(ini_get('session.cookie_lifetime') , $path, ini_get('session.cookie_domain'), $secure);\n\t\t\n\t\tif ($result = session_start())\n\t\t{\n\t\t\t$this->flash = new Flash();\n\t\t\tif ($this->flash)\n\t\t\t{\n\t\t\t\tif (array_key_exists('flash_partial', $_POST) && strlen($_POST['flash_partial']))\n\t\t\t\t\t$this->flash['system'] = 'flash_partial:'.$_POST['flash_partial'];\n\t\t\t}\n\t\t}\n\t\t\t\n\t\treturn $result;\n\t}", "public function __construct()\n {\n // ejecutamos el metodo constructor del la clase Controllers\n parent::__construct();\n session_start();\n }", "public static function start(){\n\t\treturn session_start();\n\t}", "private function openSession() {\n $this->sessionId = isset($_POST['key']) ? $_POST['key'] : (isset($_GET['key']) ? $_GET['key'] : 'null');\n\n if($this->sessionId == 'null' || strlen($this->sessionId) === 0) {\n $this->sessionId = rand(0, 999999999);\n }\n\n session_id($this->sessionId);\n session_name(\"gibSession\");\n session_start();\n }", "public function maybeStartSession() {\n if (session_status() == PHP_SESSION_NONE) {\n session_start();\n }\n }", "private static function configureSession()\n {\n if(!isset($_SESSION))\n {\n session_start();\n }\n }", "public function newSession();", "function StartSession()\n\t{\n\t\t// Check if application configuration require SSL and if connection uses it\n\t\tif(IS_SECURE && $_SERVER['HTTPS'] != 'on')\n\t\t{\n\t\t\t// Make a notice log about non-ssl connection attempt\n\t\t\terror_log('[NOTICE] Non-SSL connection attempt;');\n\t\t\t// Redirect to the same page using https \n\t\t\tRedirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);\n\t\t}\n\t\t\n\t\t// Set custom session id\n\t\t$sessionName = SESSION_NAME;\n\t\t// Get secure status\n\t\t$isSecure = IS_SECURE;\n\t\t// Stop JavaScript being able to access the session id\n\t\t$isHttpOnly = true;\n\t\t\n\t\t// Force cookies usage to store the session id on the client side; Check if setting was done\n\t\tif (ini_set('session.use_only_cookies', 1) === FALSE)\n\t\t{\n\t\t\t// Make an error log about impossibility of cookies usage to store the session id on the client side\n\t\t\terror_log('[ERROR] Cannot force cookies use to store the session id on the client side; Could not initiate a safe session;');\n\t\t\t// Redirect to the error page using \n\t\t\tRedirect('error.php?error=Could not initiate a safe session.');\n\t\t}\n\t\t\n\t\t// Get current session cookies parameters\n\t\t$cookieParams = session_get_cookie_params();\n\t\t// Set current session cookies parameters (last two)\n\t\tsession_set_cookie_params($cookieParams['lifetime'], $cookieParams['path'], $cookieParams['domain'], $isSecure, $isHttpOnly);\n\t\t\n\t\t// Set specified current session name\n\t\tsession_name($sessionName);\n\t\t// Start new or resume existing session\n\t\tsession_start();\n\t\t// Update the current session id with a newly generated one\n\t\tsession_regenerate_id(); \n\t}", "final public function __construct()\n {\n // Sure that session is initialized for saving somethings.\n if (!session_id()) {\n if (headers_sent()) {\n $this->throwException('Session is not initialized. Please sure that session_start(); was called at the top of the script.');\n }\n session_start();\n }\n\n $this->request = $this->createRequest();\n $this->request->useCurl(false);\n }", "public function start()\n {\n if (!$this->enabled) {\n return;\n }\n if (!$this->isStarted()) {\n $this->configure();\n session_start();\n if ($this->lifetimeMode == 'reset') {\n $cookie = new Cookie($this->getName(), $this->getId());\n $cookie->setLifetime($this->lifetime);\n $cookie->send();\n }\n $this->expiration->start();\n $this->fingerprint->start();\n }\n if ($this->expiration->isObsolete()) {\n $this->refresh();\n }\n if ($this->fingerprint->isInitiated()\n && !$this->fingerprint->hasValidFingerprint()) {\n throw new SessionException(SessionException::ERROR_INVALID_FINGERPRINT);\n }\n }", "private function __construct()\n\t{\n $registry = Zend_Registry::getInstance();\n $config = $registry->get('config');\n \n\t\t$this->_lifetime = (isset($config->sessionLifetime))\n\t\t\t\t\t\t\t? $config->sessionLifetime\n\t\t\t\t\t\t\t: (int) ini_get('session.gc_maxlifetime');\n\t\t$this->_objSession = new Model_Session();\n\t\t\n\t}", "public function __construct() {\n\t\tself::_sess_init();\n\t}", "public function __construct(){\n\t\tparent::__construct();\n\t\t$this->_checkSession();\n\t}", "public function start()\n {\n session_name($this->getConfigVariable('name'));\n ini_set(\"session.use_only_cookies\", $this->getConfigVariable('use_only_cookies'));\n ini_set(\"session.cookie_secure\", $this->getConfigVariable('cookie_secure'));\n ini_set(\"session.hash_function\", $this->getConfigVariable('hash_function'));\n // create a private session directory so that another script\n // with a lower lifetime doesn't clean up our session\n $path = $this->getConfigVariable('save_path');\n if (!empty($path) and\n is_dir($path) and\n is_writable($path)\n ) {\n ini_set('session.save_path', $this->getConfigVariable('save_path'));\n }\n //When to destroy sessions on the filesystem\n ini_set('session.gc_maxlifetime', $this->getConfigVariable('gc_maxlifetime'));\n ini_set('session.gc_probability', $this->getConfigVariable('gc_probability'));\n ini_set('session.gc_divisor', $this->getConfigVariable('gc_divisor'));\n\n //session_set_cookie_params (lifetime,path,domain,secure)\n session_set_cookie_params(\n $this->getConfigVariable('cookie_lifetime'),\n $this->getConfigVariable('cookie_path'),\n $this->getConfigVariable('cookie_domain'),\n $this->getConfigVariable('cookie_secure')\n );\n\n //the session_cache_limiter cache-control line is there to kill a bug in\n //IE that causes the PDF not to be cached over ssl.\n //these lines allow the caching and let the file be downloaded.\n //This bug doesn't seem to affect the preview\n //it was present in IE6 and IE7\n session_cache_limiter('must-revalidate');\n\n session_start();\n //do a very small check to see if the browser is the same as the originating browser\n //this canbe fooled easily, but provides a bit of security\n if (empty($_SESSION)) {\n $this->setup();\n } elseif (empty($_SESSION['security']) or\n $_SESSION['security']['user-agent'] != md5(\n empty($_SERVER['HTTP_USER_AGENT']) ? '' : $_SERVER['HTTP_USER_AGENT']\n )\n ) {\n $this->restart();\n }\n }", "public static function start() {\t\t\t\n\t\t\t// get session id\n $sessionid = Functions::encrypt_decrypt('encrypt', \"Bengalathon\");\n \n //set session name\n\t\t\tini_set('session.name', $sessionid.'_SESID');\n \t\t\t\n //set session name\n\t\t\tini_set('session.name', base64_encode(BASE_PATH).'_SESID');\n \n //set session path\n\t\t\tini_set('session.cookie_path', \"/\");\n\t\t\t \t\t\t\n //set session domain\n ini_set('session.cookie_domain', $_SERVER['HTTP_HOST']);\n \n //set session httponly\n ini_set('session.cookie_httponly', true);\n \n //set session secure https\n ini_set('session.cookie_secure', false);\n \n\t\t\t// start the session\n\t\t\t@session_start();\t\t\n\t\t\t\n\t\t\t// get session token\n\t\t\t$token = self::get('token');\n\t\t\t\n\t\t\t// set session token\n\t\t\tif (empty($token)) {\n\t\t\t\tif (function_exists('mcrypt_create_iv')) {\n\t\t\t\t\tself::set('token', bin2hex(mcrypt_create_iv(32, MCRYPT_DEV_URANDOM)));\n\t\t\t\t} else {\n\t\t\t\t\tself::set('token', bin2hex(openssl_random_pseudo_bytes(32)));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// return session id\t\t\t\n\t\t\treturn session_id();\n\t\t}", "function startSession()\n {\n $this->session_data = $this->_openSession($this->service_link, $this->username, $this->password,\n $this->calling_program, $this->calling_program_version,\n $this->target_dbms, $this->target_dbms_version,\n $this->connection_technology, $this->connection_technology_version,\n $this->interactive);\n\n if (isset($this->session_data) && ($this->session_data != null)\n && ($this->session_data->target != $this->url)) {\n // Reopens the service on the new URL that was provided\n $url = $this->session_data->target;\n $this->startService();\n }\n }", "function __construct($sessionName=\"SESSID\") {\n $this->sendNoCacheHeader();\n \n // force 4 hash bits per character for session_id\t// Sascha Hofmann (2005-10-19)\n\t\tini_set(\"session.hash_bits_per_character\",\"4\");\n\t\t\n // Session-Namen setzen, Session initialisieren \n session_name(isset($sessionName)\n ? $sessionName\n : session_name());\n\n @session_start();\n \n // Prüen ob die Session-ID die Standardlänge\n // von 32 Zeichen hat,\n // ansonsten Session-ID neu setzen \n if (strlen(session_id()) < 32)\n {\n mt_srand ((double)microtime()*1000000);\n session_id(md5(uniqid(mt_rand())));\n }\n \n // Prüfen, ob eine Session-ID übergeben wurde\n // (über Cookie, POST oder GET)\n $IDpassed = false;\n if ( isset($_COOKIE[session_name()]) &&\n @strlen($_COOKIE[session_name()]) >= 32\n ) $IDpassed = true;\n\n if ( isset($_POST[session_name()]) &&\n @strlen($_POST[session_name()]) >= 32\n ) $IDpassed = true;\n\n if ( isset($_GET[session_name()]) &&\n @strlen($_GET[session_name()]) >= 32\n ) $IDpassed = true;\n \n if (!$IDpassed) \n { \n // Es wurde keine (gültige) Session-ID übergeben.\n // Script-Parameter der URL zufügen\n \n $query = @$_SERVER[\"QUERY_STRING\"] != \"\" ? \"?\".$_SERVER[\"QUERY_STRING\"] : \"\";\n \n header(\"Status: 302 Found\");\n \n // Script terminiert\n $this->redirectTo($_SERVER[\"PHP_SELF\"].$query);\n }\n \n // Wenn die Session-ID übergeben wurde, muss sie\n\t\t\t\t// nicht unbedingt gültig sein!\n \n // Für weiteren Gebrauch merken\n $this->usesCookies =\n (isset($_COOKIE[session_name()]) &&\n @strlen($_COOKIE[session_name()])\n >= 32);\n }", "public function __construct($config) \n\t{\n\t\tparent::__construct($config);\n\t\t$this->_startSession();\n\t}", "function startSession()\n{\n if ( !isset( $_SESSION ) ) { @session_start() ; }\n}", "public function __construct($key = null)\n\t{\n\t\tif (isset($key)) $this->key = $key;\n\n\t\t$this->startSession();\n\t}", "function create() \n\t{\n\t\t//If this was called to destroy a session (only works after session started)\n\t\t$this->clear();\n\n\t\t//If there is a class to handle CRUD of the sessions\n\t\tif($this->session_database) \n\t\t{\n if (is_php('5.4'))\n {\n // -- User for php > 5.4 --\n session_set_save_handler($this, TRUE);\n }\n else\n {\n session_set_save_handler(\n array($this, 'open'),\n array($this, 'close'),\n array($this, 'read'),\n array($this, 'write'),\n array($this, 'destroy'),\n array($this, 'gc')\n );\n register_shutdown_function('session_write_close');\n }\n // Create connect to database\n $this->_conn = DbConnection::getInstance();\n\t\t}\n\n\t\t// Start the session!\n\t\tsession_start();\n\n\t\t//Check the session to make sure it is valid\n\t\tif(!$this->check())\n\t\t{\n\t\t\t//Destroy invalid session and create a new one\n\t\t\treturn $this->create();\n\t\t}\n\t}", "function start_session() {\n\tsession_start();\t\n\tif($status == PHP_SESSION_NONE){\n\t\t//There is no active session\n\t\tsession_start();\n\t}else\n\tif($status == PHP_SESSION_DISABLED){\n\t\t//Sessions are not available\n\t}else\n\tif($status == PHP_SESSION_ACTIVE){\n\t\t//Destroy current and start new one\n\t\tsession_destroy();\n\t\tsession_start();\n\t}\n\t\n}" ]
[ "0.8317754", "0.81646913", "0.81560093", "0.8090449", "0.80224776", "0.7999849", "0.79678804", "0.7944556", "0.7784239", "0.7754642", "0.77519965", "0.7709456", "0.7708583", "0.76719195", "0.7666165", "0.76571494", "0.76511633", "0.7650385", "0.764247", "0.7630709", "0.7629082", "0.761563", "0.7606024", "0.7604398", "0.7567267", "0.75606555", "0.75586575", "0.75586575", "0.7538938", "0.7534176", "0.7520053", "0.75156957", "0.74166846", "0.7400268", "0.7389981", "0.7383532", "0.7383532", "0.7383374", "0.73825777", "0.73703307", "0.7358987", "0.73587793", "0.73551214", "0.7354109", "0.73424304", "0.73221195", "0.73164153", "0.72868043", "0.7269303", "0.72507066", "0.7243916", "0.7226832", "0.72213143", "0.7220626", "0.7196774", "0.71906066", "0.7184133", "0.7168764", "0.71527576", "0.7144116", "0.71374536", "0.7130565", "0.7120681", "0.71182317", "0.7109324", "0.7101135", "0.7095952", "0.70877594", "0.7060315", "0.7053327", "0.70424426", "0.70353997", "0.70199484", "0.70062894", "0.69990265", "0.6997217", "0.698559", "0.6970824", "0.6962018", "0.6951752", "0.69438064", "0.6934331", "0.6930983", "0.69293636", "0.6916831", "0.69134533", "0.69102824", "0.689137", "0.68748367", "0.687445", "0.68721026", "0.6870918", "0.6852973", "0.685239", "0.68487525", "0.6834327", "0.6820327", "0.6790028", "0.6787321", "0.6785024" ]
0.7317497
46
Sets a session variable
function set ($name,$value) { $_SESSION[$name]=$value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setSessionVariable($variable, $value){\n\t\t$_SESSION[$variable] = $value;\n\t}", "function set($variable, $value) {\n\t\t$_SESSION[$variable] = $value;\n\t}", "public function setVar($var, $value)\n\t{\n\t\t$_SESSION[$var] = $value;\n\t}", "protected function set_session($sKey,$sValue){$_SESSION[$sKey]=$sValue;}", "function setLocalSessionVariable($localVarName,$varName, $value) {\n $_SESSION[$localVarName.\"_\".$varName] = $value;\n }", "function setSessionModuleVar( $module, $var, $val=NULL ) {\n Session::set(esf_Extensions::MODULE.'.'.$module.'.'.$var, $val);\n}", "function setSessionVariable($localVarName,$varName, $value) {\n $_SESSION[$this->local_current_module.\"_\".$localVarName.\"_\".$varName] = $value;\n}", "public function set_session($var,$cont=NULL){\r\n $this->session->set_userdata($var, $cont);\r\n }", "public static function setVar($varname, $varvalue){\n $_SESSION[sha1(Engine::getAppName())][$varname] = $varvalue;\n }", "public function set_var($k, $v)\n\t{\n \t$_SESSION[$k] = $v;\n\t}", "public function __set( $name , $value ){\n\n \tif ( $this->sessionState == self::SESSION_NOT_STARTED ){\n \t\tself::$instance->startSession();\n \t}\n\n $_SESSION[$name] = $value;\n }", "public function set($key, $value)\n {\n $this->session->set($key,$value);\n }", "public function set(string $name, $value) {\n //$this->open();\n $_SESSION[$name] = $value;\n }", "public function set($name, $value) {\n $_SESSION[$name] = $value;\n }", "public function set($what, $value) {\n $_SESSION[$what] = $value;\n }", "public static function set($key, $value){\n\t\t$_SESSION[$key] = $value;\n\t}", "public function __set($name, $value)\n {\n $_SESSION[$name] = $value;\n }", "public function __set($name, $value)\n {\n $_SESSION[$name] = $value;\n }", "public static\r\n function set($name, $value) {\r\n if(session_status() != PHP_SESSION_ACTIVE) {\r\n session_start();\r\n }\r\n if(!isset($name)) {\r\n session_register($name);\r\n }\r\n $_SESSION[\"\" . $name . \"\"] = $value;\r\n session_write_close();\r\n //define($name, $value);\r\n }", "public function setSessionValue($key, $value) \n {\n $_SESSION[$key] = $value;\n }", "public function setVariableSession($varName, $value) {\n\t\t$_SESSION[$varName] = $value;\n\t}", "public function set($key,$value) {\n\t\t$this->getFrontendUser()->setKey('ses', self::SESSIONNAMESPACE.$key, $value);\n\t\t$this->getFrontendUser()->storeSessionData();\n return true;\n\t}", "public function set ($key, $value) {\n\t\t$_SESSION[$key] = $value;\n\t}", "public function setSession($value)\n\t{\n\t\t$_SESSION[$this->getKey()] = serialize($value);\n\t}", "public function set($key, $value) {\n \n $this->start();\n $_SESSION[$key] = $value;\n \n }", "public static function set($name, $value) {\n $_SESSION[$name] = $value;\n }", "public function setSession(){\n if( $this->status === True ){\n $_SESSION['username'] = $this->username;\n $_SESSION['userlvl'] = $this->userlevel;\n $_SESSION['status'] = True;\n }else{\n $_SESSION['status'] = False;\n }\n }", "public static function sessionSet($key, $value) {\n $_SESSION[$key] = $value;\n }", "public function set($key, $value)\n {\n $_SESSION[$key] = $value;\n }", "public function set ($k, $v) {\n $_SESSION[$k] = $v;\n }", "public static function set($name, $value)\n {\n $_SESSION[$name] = $value;\n }", "public function set( $name, $value ){\n\t\t\tif( !$this->isStarted() ){\n\t\t\t\t$this->startAll();\n\t\t\t}\n\n\t\t\t$_SESSION[ $name ] = $value;\n\t\t}", "public function __set($name, $value) {\n $_SESSION[$this->myedb_session_key][$name] = $value;\n }", "public function set($key, $value)\n\t{\n\t\t$_SESSION[$key] = $value;\n\t}", "public function setSession($name, $value) {\n $_SESSION[$name] = $value;\n }", "public function setSession($sessionID)\r\n {\r\n $this->$sessionID = $sessionID;\r\n }", "public function set($name, $value) {\n Session::set($name, $value);\n }", "public static function set($name, $value)\n {\n $_SESSION[$name] = $value;\n }", "private function setSESSIONvariables() {\n $_SESSION['pqz_configuration'] = $this->configuration;\n $_SESSION['pqz_question'] = $this->question;\n }", "final public function set($name, $value)\n {\n $key = $this->getSessionKey($name);\n\n $_SESSION[$key] = $value;\n }", "protected function setSessionValue($name, $value)\r\n {\r\n if (!isset($_SESSION)) { session_start(); }\r\n \r\n $_SESSION[$name] = $value;\r\n }", "public function set(string $key, mixed $value)\n {\n $_SESSION[$key] = $value;\n }", "public function set(string $key, mixed $value)\n {\n $_SESSION[$key] = $value;\n }", "public static function set($key, $value)\r\n {\r\n $_SESSION[$key] = $value;\r\n }", "public static function set($key, $value)\n {\n $_SESSION[$key] = $value;\n }", "public static function set($key, $value) {\n $_SESSION[$key] = $value;\n }", "public function set_session($name,$val)\n { \n $_SESSION[$name] = $val; \n }", "function set_session($session_name, $session_value) {\n clear_session($session_name);\n $_SESSION[APP_ID . $session_name] = $session_value;\n return $_SESSION[APP_ID . $session_name];\n}", "public function setFlag(): void\n {\n $this->session->setData(ConfigProvider::SESSION_FLAG, true);\n }", "public function set($key, $value) {\n $key_name = $this->getSessionKeyName($key);\n Session::put($key_name, $value);\n }", "public static function set($key, $value)\n {\n $_SESSION[$key] = $value;\n }", "public function set(string $name, $value)\n {\n $_SESSION[$this->prefix]['vars'][$name] = $value;\n }", "public static function setValue($name,$value)\n {\n $_SESSION[$name] = $value;\n }", "public function __set($name,$value){\n\t\treturn $_SESSION[$name] = $value;\n\t}", "public static function set(string $key, $value)\n {\n $_SESSION[$key] = $value;\n }", "public static function set($key, $value) {\n\t\t\t$_SESSION[base64_encode(BASE_PATH).'_'.$key] = $value;\n\t\t}", "function setSessValue($k, $v){\n $k = _APPNAME .'#'.$k;\n $_SESSION[$k] = $v;\n }", "function SetSession($param_name, $param_value){\n $_SESSION[$param_name] = $param_value;\n}", "public function set($key, $value)\n {\n $this->session->write($this->getSessionKey($key), $value);\n }", "static public function set($key, $value)\n {\n if ($value != null)\n {\n $_SESSION[$key] = $value;\n }\n else\n {\n unset($_SESSION[$key]);\n }\n }", "public function set($name, $value){\n\t\t$_SESSION['tmobi'][$name] = $value;\n\t}", "protected function setSessionCookie() {}", "public function set($name, $value = null)\n\t{\n\t\tif ( $value === null )\n\t\t\tunset($_SESSION[$name]);\n\t\telse\n\t\t\t$_SESSION[$name] = $value;\n\t}", "private function namespaceSet($var, $value) {\r\n\t\t$_SESSION[self::SESSION_NAMESPACE][$var] = $value;\r\n\t}", "public function __set($name, $value)\n {\n $_SESSION[$this->prefix][$name] = $value;\n }", "function updateScoreSession($variable, $value){\n $this->session->set_userdata($variable, $value);\n }", "protected function setSessionParameter($name, $value)\n {\n $this->getRequest()->getSession()->set($name, $value);\n }", "public function setVariable($varName, $value) {\n\t\t$this->variables[$varName] = $value;\n\t\t$_SESSION[\"flashVariable\"][$varName] = $value;\n \t}", "protected function setSessionVars($vars)\n {\n $GLOBALS[\"BE_USER\"]->setAndSaveSessionData($this->extensionName, $vars);\n }", "public function set(\n string $key,\n $value,\n ): void {\n $this->start();\n\n $_SESSION[$this->getSessionName($key)] = $value;\n }", "public function set($param, $value)\n {\n $this->session->set($param, $value);\n }", "function SetSessionDropDownValue($sv, $parm) {\n\t\t$_SESSION['sv_deals_details_' . $parm] = $sv;\n\t}", "protected function setSessionData()\n {\n $responseData = $this->response->getBody();\n if (strlen($responseData) > 0) {\n $contents = str_replace('$SID', $this->session->getName() . '=' . $this->session->getId(), $responseData);\n $contents = str_replace('$SESSION_NAME', $this->session->getName(), $contents);\n $this->response->replaceBody(str_replace('$SESSION_ID', $this->session->getId(), $contents));\n }\n }", "public static function setSessionData($name, $value) {\n if (isset(self::$_session)) {\n self::$_session[$name] = $value;\n } else {\n $_SESSION[$name] = $value;\n }\n }", "public static function set(string $key, $value): void\n {\n static::start();\n $_SESSION[$key] = $value;\n }", "protected function _setVar($name, $value)\n {\n $store = $this->_getVariableStore();\n\n if ($store instanceof \\Zend_Session_Namespace) {\n $store->__set($name, $value);\n } else {\n $store->offsetSet($name, $value);\n }\n }", "function set_id ($id)\r\n {\r\n $_SESSION[\"id\"] = $id;\r\n }", "public function __set($key, $value) {\n $_SESSION[$key] = serialize($value);\n }", "public function set(string $key, $value): void\n {\n $this->ensureStarted();\n $_SESSION[$key] = $value;\n }", "public function setSession()\n\t{\n\t\t$this->session = Session::getInstance();\n\t\t$this->session->start();\n\t}", "public function setTypeSession($value){\n\t\t\t$this->typeSession = $value;\n\t\t}", "private function setSessionVarsToView($view) {\n\t\t$session = new SessionManager();\n\t\t$session->sessionLoad();\n\t\t$view->isLogdin = $session->getIsLogdin();\n\t\t$view->userName = $session->username;\n\t}", "public function setSessionData(): void\n {\n $this->response->getSession()->set(\n config('form.session_key'),\n [\n $this->form->getID() => [\n 'data' => $this->body,\n 'messages' => $this->errors\n ]\n ]\n );\n }", "public static function set($key, $value): void\n {\n $_SESSION[$key] = $value;\n }", "public function set ($name, $val)\n\t{\n\t\t$_SESSION[$name]\t= $val;\n\t}", "function set_name ($name)\r\n {\r\n $_SESSION[\"name\"] = $name;\r\n }", "public function setToSession($data) {\n $this->_setSession($data);\n }", "public function setSession($name, $value=null)\n {\n if (is_array($name)) {\n $this->_session = $name;\n } else {\n $this->_session[$name] = $value;\n }\n }", "public function setSession($name, $value=null)\n {\n // Set by name or all at once\n if (is_string($name)) {\n $this->_session[$name] = $value;\n } elseif (is_array($name)) {\n $this->_session = $name;\n }\n }", "protected function set_session_id() {\n $this->sessionid = static::$sessionidmockup;\n }", "function SetSessionParam($ParamName, $ParamValue) {\t \n \n $_SESSION[$ParamName] = $ParamValue;\n}", "public static function set ($key, $val){\r\n\t\t\t\t$_SESSION[$key]=$val;\r\n\t\t\t}", "public static function setSession($session) {\n self::$_session = $session;\n }", "function SetSessionDropDownValue($sv, $parm) {\n\t\t$_SESSION['sv_dealers_reports_' . $parm] = $sv;\n\t}", "public function __set($key, $value)\n {\n if (is_object($value)) {\n $_SESSION[$key.'__OBJECT'] = true;\n $value = serialize($value);\n }\n $_SESSION[$key] = $value;\n }", "public function set($varname, $value)\n {\n $value = base64_encode(serialize($value));\n \n // Does the variable exist?\n $sql = 'SELECT COUNT(name) FROM session_vars '.\n 'WHERE container=\"'.$this->container_id.'\" AND name=\"'.$varname.'\"';\n $num_vars = $this->db->querySingle($sql);\n \n if($num_vars > 0) {\n $sql = 'UPDATE session_vars '.\n 'SET value=\"'.$this->db->escapeString($value).'\" '.\n 'WHERE container=\"'.$this->container_id.'\" AND name=\"'.$varname.'\"';\n } else {\n $sql = 'INSERT INTO session_vars(container, name, value) '.\n 'VALUES(\"'.$this->container_id.'\", \"'.$this->db->escapeString($varname).'\", \"'.\n $this->db->escapeString($value).'\")';\n }\n \n $this->db->exec($sql);\n\n return $value;\n }", "public function setSession(string $sessionVarName, $sessionVarValue)\n {\n $_SESSION[$sessionVarName] = $sessionVarValue;\n }", "public static function set($key, $value = null)\n {\n self::$session[$key] = $value;\n }", "function set_session_value($params){\n if($params['name'] && $params['value']){\n $_SESSION[$params['name']] = $params['value'];\n }\n}", "public static function set(string $key, $data)\n {\n $_SESSION[$key] = $data;\n }" ]
[ "0.77034324", "0.75105065", "0.7415154", "0.73690116", "0.7349455", "0.7343107", "0.7338232", "0.73121345", "0.7311642", "0.7302322", "0.72558206", "0.7218227", "0.71923655", "0.7184526", "0.7161671", "0.71487886", "0.7138521", "0.7138521", "0.71308315", "0.71167713", "0.71130943", "0.71058226", "0.71050054", "0.70868844", "0.7073844", "0.70642567", "0.7058434", "0.7046318", "0.7043354", "0.704226", "0.70390373", "0.7034421", "0.7017854", "0.7015503", "0.7014328", "0.70132184", "0.70092726", "0.7008097", "0.70071214", "0.7006259", "0.6999565", "0.69900674", "0.69900674", "0.6971461", "0.696797", "0.6965882", "0.6957941", "0.69372046", "0.69339055", "0.6932512", "0.6932225", "0.69303566", "0.6923699", "0.6918418", "0.6901028", "0.6897687", "0.68962175", "0.6895773", "0.6889579", "0.68789655", "0.6854703", "0.6854624", "0.68291897", "0.6827945", "0.68226826", "0.68182355", "0.6813759", "0.6811901", "0.6800823", "0.6798616", "0.67886025", "0.6779957", "0.67762893", "0.6775934", "0.6754573", "0.6751336", "0.67444134", "0.6743523", "0.67339236", "0.67217", "0.6718686", "0.6715725", "0.6707649", "0.6705217", "0.67011094", "0.67007095", "0.66974956", "0.6693308", "0.668258", "0.6673417", "0.6672872", "0.6672055", "0.66691524", "0.66681784", "0.6654501", "0.66516006", "0.6649011", "0.66356295", "0.66212636", "0.66203713" ]
0.7477444
2
Fetches a session variable
function get ($name) { if ( isset ( $_SESSION[$name] ) ) return $_SESSION[$name]; else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function get()\n\t{\n\t\treturn Session::instance()->get(Message_Core::SESSION_VAR, FALSE);\n\t}", "function returnSessionVariable($key){\n\t\tif (!empty($_SESSION[\"{$key}\"])) {\n\t\t\treturn $_SESSION[$key];\n\t\t}\n\t}", "public function get($key) {\n \n $this->start();\n return isset($_SESSION[$key]) ? $_SESSION[$key] : null;\n \n }", "function getSessionVar($key) {\n\tif (isset($_SESSION[$key])) {\n\t\treturn $_SESSION[$key];\n\t} else {\n\t\treturn null;\n\t}\n}", "public static function get($name) {\n return $_SESSION[$name];\n }", "public static function get($key)\n {\n if (isset($_SESSION[$key])){\n return $_SESSION[$key];\n }\n }", "public function __get( $name){\n\t\tif ( isset($_SESSION[$name])){\n\t\t\treturn $_SESSION[$name];\n\t\t}\n\t}", "public static function get(string $key)\n {\n static::start();\n if (static::has($key)) {\n return $_SESSION[$key];\n }\n }", "public static function get($name){\n return $_SESSION[$name];\n }", "public function __get( $name ){\n\n if ( isset($_SESSION[$name])) {\n return $_SESSION[$name];\n }\n }", "public function get_session() {\n return $_SESSION['login'];\n }", "public static function get ($key){\r\n\t\t\t\tif (isset($_SESSION[$key])) {\r\n\t\t\t\t\t# code...\r\n\t\t\t\t\treturn $_SESSION[$key];\r\n\t\t\t\t}else {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}", "public function get($name) {\n if(!empty($_SESSION[$name])) return $_SESSION[$name];\n }", "function getSessionVariable($key){\n\t\tif (!empty($_SESSION[\"{$key}\"])) {\n\t\t\tprint($_SESSION[$key]);\n\t\t}\n\t}", "function phpAds_SessionDataFetch()\n{\n global $session;\n $dal = new MAX_Dal_Admin_Session();\n\n // Guard clause: Can't fetch a session without an ID\n\tif (empty($_COOKIE['sessionRPID'])) {\n return;\n }\n\n $serialized_session = $dal->getSerializedSession($_COOKIE['sessionRPID']);\n // This is required because 'sessionRPID' cookie is set to new during logout.\n // According to comments in the file it is because some servers do not\n // support setting cookies during redirect.\n if (empty($serialized_session)) {\n return;\n }\n\n $loaded_session = unserialize($serialized_session);\n\tif (!$loaded_session) {\n // XXX: Consider raising an error\n return;\n }\n\t$session = $loaded_session;\n $dal->refreshSession($_COOKIE['sessionRPID']);\n}", "public static function get(string $name) {\n return $_SESSION[$name];\n }", "public static function get($name) {\n return $_SESSION[$name];\n }", "public function get($key)\n\t{\n\t\treturn $_SESSION[$key] ?? null;\n\t}", "public function get( $key ) {\n if (isset($_SESSION[$key])){\n $out = $_SESSION[$key];\n }else{\n $out = false;\n }\n return $out;\n }", "static function get($key)\n {\n if(isset($_SESSION[$key]))\n return $_SESSION[$key];\n\n return null;\n }", "public static function get($key){\t\t\n\t\treturn (isset($_SESSION[$key])) ? $_SESSION[$key] : false;\n\t}", "public function __get( $name )\n {\n if (isset($_SESSION[$name])) {\n return $_SESSION[$name];\n }\n }", "function getLocalSessionValue($key)\n{\n if (isset($_SESSION[$key])) {\n return $_SESSION[$key];\n } else {\n return \"\";\n }\n}", "public static function getVar($varname) {\n return $_SESSION[sha1(Engine::getAppName())][$varname];\n }", "public function value($key) {\n return isset($_SESSION[$key]) ? $_SESSION[$key] : null;\n }", "public function getSessionValue($key) \n {\n return isset($_SESSION[$key]) ? $_SESSION[$key] : null;\n }", "public function __get($name){\n\t\treturn isset($_SESSION[$name]) ? $_SESSION[$name] : null;\n\t}", "public function get($param) {\n\t\t\tif (isset($_SESSION[$param])) {\n\t\t\t\treturn $_SESSION[$param];\n\t\t\t} else {\n\t\t\t\t$this->response->throwErr(\"$param not found in session, initialise it or check your spelling\");\n\t\t\t}\n\t\t}", "public function fetchSessionData() {}", "public static function get($name)\n {\n return $_SESSION[$name];\n }", "public function get($key)\n {\n return $this->session->read($this->getSessionKey($key));\n }", "public function get($var)\n {\n if(isset($_SESSION[$var])) {\n return $_SESSION[$var];\n } else {\n return null;\n }\n }", "public function get_var( $name )\n\t{\n\t\tif( isset( $_SESSION[$name] ) )\n\t\t{\n\t\t\treturn $_SESSION[$name];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public function get($what) {\n if(isset($_SESSION[$what])) return $_SESSION[$what];\n else return false;\n }", "public function get($key)\n {\n return $this->session->get($key);\n }", "public function get(string $name) {\n return $this->has($name) ? $_SESSION[$name] : false;\n }", "public function get ($key) {\n\t\treturn isset($_SESSION[$key]) ? $_SESSION[$key] : false;\n\t}", "public static function get($name)\n {\n if(isset($_SESSION[$name]))\n {\n return $_SESSION[$name];\n }\n }", "public static function get($key) {\n $sessionValue = null;\n if (!empty($_SESSION[$key])) {\n $sessionValue = $_SESSION[$key];\n } else {\n Logger::getLogger()->LogDebug(\"Attempting to get invalid item \n from Session with key : \".$key);\n }\n return $sessionValue;\n }", "public function get(string $key)\n {\n return $_SESSION[$key] ?? false;\n }", "function getValue()\r\n {\r\n $sessionVar = $this->_options['sessionVar'];\r\n\r\n return (!empty($_SESSION[$sessionVar]))\r\n ? $_SESSION[$sessionVar]->getPhrase()\r\n : null;\r\n }", "function loadSession() {}", "#[Pure]\n public function get(string $key) : mixed\n {\n return $_SESSION[$key] ?? null;\n }", "public function get()\n {\n return $this->transmission->request(\"session-get\", array());\n }", "public static function get(string $key)\n {\n return $_SESSION[$key] ?? false;\n }", "public function get($key)\n {\n if(isset($_SESSION[$this->sess_name][$key]))\n return $_SESSION[$this->sess_name][$key];\n else\n return null;\n }", "static function getSession($name){\n return $_SESSION[$name];\n }", "public static function get($key) {\t\t\t\n\t\t\tif(isset($_SESSION[base64_encode(BASE_PATH).'_'.$key]))\n\t\t\treturn $_SESSION[base64_encode(BASE_PATH).'_'.$key];\n\t\t}", "public function get ($k) {\n return isset($_SESSION[$k]) ? $_SESSION[$k] : null;\n }", "protected function retrieveSessionToken() {}", "protected function retrieveSessionToken() {}", "protected function retrieveSessionToken() {}", "protected function retrieveSessionToken() {}", "public function __get($key) {\n \n return isset($_SESSION[$key]) ? unserialize($_SESSION[$key]) : null;\n }", "public function get($key) {\n\t\t$sessionData = $this->getFrontendUser()->getKey('ses', self::SESSIONNAMESPACE.$key);\n\t\treturn $sessionData;\n\t}", "function auth_get()\n{\n return session_get(auth_namespace(), true);\n}", "function get_session($var) {\n if (isset($_SESSION[$var])) {\n return $_SESSION[$var];\n } else {\n return null;\n }\n}", "public static function fetch($name)\n\t{\n // check it's set before going for the offset (to prevent notice)\n return isset($_SESSION[$name]) ? $_SESSION[$name] : null;\n\t}", "function getUserFromSession() {\n\tsession_start();\n\treturn $_SESSION;\n}", "function GetSessionValue(&$sv, $sn) {\n\t\tif (isset($_SESSION[$sn]))\n\t\t\t$sv = $_SESSION[$sn];\n\t}", "function GetSessionValue(&$sv, $sn) {\n\t\tif (isset($_SESSION[$sn]))\n\t\t\t$sv = $_SESSION[$sn];\n\t}", "public function get ($name)\n\t{\n\t\t\n\t\tif (array_key_exists ($name, $_SESSION))\n\t\t{\n\t\t\treturn $_SESSION[$name];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t}", "public static\r\n function get($name) {\r\n if(isset($_SESSION[$name])) {\r\n $valor = $_SESSION[$name];\r\n session_write_close();\r\n return $valor;\r\n }\r\n return \"\";\r\n }", "public function getSession()\r\n {\r\n return $this->sessionID;\r\n }", "public static function get($key)\n {\n if (!self::keyExists($key)) {\n return false;\n }\n\n return $_SESSION[$key];\n }", "function session_GET($key, $default_value = null) {\n\tif ( !isset($_SESSION) )\n\t\treturn $default_value;\n\treturn common_param_GET($_SESSION, $key, $default_value);\n}", "protected function _getSession() {\n /**\n * Return session value\n */\n return Mage::getSingleton ( 'core/session' );\n }", "public function getSession() \r\n\t{\t\t\t\r\n\t\t$this->url = $this->server . \"/X?op=login_request\" .\r\n\t\t\t\"&user_name=\" . $this->username .\r\n\t\t\t\"&user_password=\" . $this->password;\r\n\r\n\t\t// get login_response from Metalib\r\n\r\n\t\t$this->xml = $this->getResponse($this->url, $this->timeout);\r\n\t\t\r\n\t\t// extract session ID\r\n\t\t\r\n\t\t$objSession = $this->xml->getElementsByTagName(\"session_id\")->item(0);\r\n\t\treturn $objSession->nodeValue;\r\n\t}", "public static function pull($key)\n {\n if (isset($_SESSION[$key])) {\n $value = $_SESSION[$key];\n unset($_SESSION[$key]);\n return $value;\n }\n return null;\n }", "public function __get($name)\n {\n return isset($_SESSION[$name]) ? $_SESSION[$name] : null;\n }", "public static function get($key)\n {\n // Check whether logged in\n if (!self::isLoggedIn()) {\n return false;\n }\n\n // Return the value of the Session get, which deals\n // with null values or unset keys by itself\n return Session::get(self::SESSION_PREFIX . $key);\n }", "public static function get(): ?string\n {\n return Session::has(self::SESSION_KEY) ? Session::get(self::SESSION_KEY) : null;\n }", "public static function get($name)\n {\n return self::exists($name) ? $_SESSION[$name] : null;\n }", "function get_id ()\r\n {\r\n return $_SESSION[\"id\"];\r\n }", "public static function get($key=\"\")\n\t{\n\t\tif(empty($key)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif(self::exists($key)) {\n\t\t\treturn$_SESSION[$key];\n\t\t}\n\t\treturn \"\";\n\t}", "public function get_session()\n\t\t{\n\t\t\t\tif( file_exists( $this->session_file ) )\n\t\t\t\t{\n\t\t\t\t\t\t$session = file_get_contents( $this->session_file );\n\t\t\t\t\t\tif( !empty( $session ) )\n\t\t\t\t\t\t\treturn $session;\n\t\t\t\t}\n\t\t\t\t$post_data = [ 'params' => json_encode( [ 'user' => $this->api_user, 'password' => $this->api_pass ] ) ];\n\t\t\t\t$response \t= $this->curl( 'Session/login', $post_data );\n\t\t\t\t$json \t\t\t= json_decode( $response );\n\t\t\t\t$session \t = $json->session_id;\n\t\t\t\t$this->save_session( $session );\n\t\t\treturn $session;\n\t\t}", "public function __get($name) {\n\t\t$result = null;\n\t\tif ($name == null)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\tif (array_key_exists($name, $this->session))\n\t\t{\n\t\t\t$result = $this->session[$name];\n\t\t}\n\t\telse if (array_key_exists($name, $_SESSION))\n\t\t{\n\t\t\t$result = $_SESSION[$name];\n\t\t}\n\n\t\treturn $result;\n\t}", "abstract protected function retrieveSessionToken() ;", "function get_name ()\r\n {\r\n return $_SESSION[\"name\"];\r\n }", "function getSession() {\n\t\treturn $this->get('_session', $this->get('session'));\n\t}", "function getSession( $name ) #version 1\n{\n if ( isset($_SESSION[$name]) ) \n {\n return $_SESSION[$name];\n }\n return \"\";\n}", "public static function getSessionValue($name, $value_if_missing=NULL, $decrypt=FALSE)\n {\n $fullname = CONST_NM_RAPTOR_CONTEXT.'_'.$name;\n if(isset($_SESSION[$fullname]))\n {\n if(!$decrypt)\n {\n $result = $_SESSION[$fullname];\n } else {\n $result = self::getFastUnscrambled($_SESSION[$fullname]);\n }\n } else {\n $result = $value_if_missing;\n }\n return $result;\n }", "public function get($id = '') {\n\t\tif($id == '') {\n\t\t\t$id = $this->id;\n\t\t}\n\t\t$sess = ORM::for_table($this->session_type)->find_one($id);\n\t\treturn $sess;\n\t}", "public function get(string $section)\n {\n return $_SESSION[$section];\n }", "public function getUserSession(){\n return $this->getParam('user-data', 'auth');\n }", "public static function Get()\r\n {\r\n $data = Session::Exists(self::NAME) ? Session::Get(self::NAME) : null;\r\n Session::Remove(self::NAME);\r\n return $data;\r\n }", "public function get($key) {\n\n if (!$this->sessionStarted()) {\n throw new \\DomainException(\"Cant retrieve value from NULL session\");\n }\n\n if (\\array_key_exists($key, $_SESSION)) {\n\n return $_SESSION[$key];\n }\n return '';\n }", "public final function get($property) \n\t{\n\t\tif (isset($_SESSION[$property])) return $_SESSION[$property];\n\t\treturn null;\n\t}", "function SessionVar($name, $default_value = false) {\r\n if (!isset($_SESSION)) {\r\n return $default_value;\r\n } else if (isset($_SESSION[$name])) {\r\n return $_SESSION[$name];\r\n }\r\n return $default_value;\r\n}", "public static function value($name)\n {\n if (isset($_SESSION[$name]))\n {\n return $_SESSION[$name];\n }\n else\n {\n return null;\n }\n }", "public static function getSessionid();", "static public function get($key, $default = null)\n {\n $ret = (array_key_exists($key, $_SESSION)) ? $_SESSION[$key] : $default;\n\n return $ret;\n }", "static public function get($namespace){\n return SessionNamespace::exists($namespace) ? Session::get_data($namespace) : null;\n }", "public function getSessionID();", "public static function getValue($key) {\n return $_SESSION[self::$appSessionName][$key];\n }", "function getSession($key){\n return Yii::app()->getSession()->get($key);\n}", "function get_login ()\r\n {\r\n return $_SESSION[\"login\"];\r\n }", "function getSession($name) {\r\n if(isset($_SESSION[$name])) {\r\n return $_SESSION[$name];\r\n }\r\n else {\r\n return null;\r\n }\r\n}", "public function get_session()\n\t{\n\t\t$query=$this->db->get('session');\n\t\treturn $query->result();\n\t}", "public function get(/*string*/ $key) /*mixed*/\n {\n if (isset($_SESSION[self::KEY][$key])) {\n return $_SESSION[self::KEY][$key];\n } else {\n return self::EMPTY_STRING;\n }\n }" ]
[ "0.6889549", "0.6860835", "0.68048483", "0.67780316", "0.6750348", "0.6749337", "0.6739891", "0.6729463", "0.6710426", "0.6684079", "0.66824603", "0.6675215", "0.6668897", "0.663146", "0.66166824", "0.66120195", "0.66077524", "0.6595721", "0.658783", "0.6584235", "0.65681374", "0.6550158", "0.6547727", "0.6547412", "0.6543335", "0.65333545", "0.6533306", "0.6532905", "0.652168", "0.65193146", "0.6514764", "0.65131253", "0.64923096", "0.6484397", "0.64841264", "0.6481244", "0.6480062", "0.64769465", "0.6462713", "0.64611554", "0.64589757", "0.64380896", "0.64369065", "0.64329636", "0.64329165", "0.642237", "0.6417379", "0.6408262", "0.6402787", "0.63855493", "0.63855493", "0.6383549", "0.6383549", "0.6372731", "0.6371105", "0.6369405", "0.6369369", "0.63634944", "0.6361329", "0.6356771", "0.6356771", "0.6355519", "0.6353932", "0.63342637", "0.6330324", "0.6293627", "0.6275037", "0.6270542", "0.6269796", "0.62682635", "0.62675893", "0.6267432", "0.62569755", "0.6252492", "0.62301016", "0.6219213", "0.62147987", "0.62048495", "0.61944604", "0.6182474", "0.617301", "0.61665756", "0.6166065", "0.6155262", "0.6144503", "0.61444247", "0.6135987", "0.61320627", "0.6126175", "0.6124016", "0.61152315", "0.60980654", "0.60962224", "0.608832", "0.6083908", "0.60789603", "0.6073719", "0.6070086", "0.6068668", "0.6067236" ]
0.66431344
13
Deletes a session variable
function del ($name) { if ( isset ( $_SESSION[$name] ) ) { unset ( $_SESSION[$name] ); return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function deleteSessionValue($key) \n {\n unset($_SESSION[$key]);\n }", "function deleteSession($varname){\n\t\tglobal $TIMEOUT_SYNTAX;\n\t\tif(isset($_SESSION[$varname])){\n\t\t\tunset($_SESSION[$varname]);\n\t\t}\n\t\tif(isset($_SESSION[$varname.$TIMEOUT_SYNTAX])){\n\t\t\tunset($_SESSION[$varname.$TIMEOUT_SYNTAX]);\n\t\t}\n\t}", "function destroy()\r\n {\r\n unset($_SESSION[$this->_options['sessionVar']]);\r\n }", "static function delete($var) {\n\t\tif (array_key_exists($var, $_SESSION)) {\n\t\t\t$ret = $_SESSION[$var];\n\t\t\tunset($_SESSION[$var]);\n\t\t\t\n\t\t\t// Remove key too\n\t\t\t$new_session = array();\n\t\t\tforeach ($_SESSION as $key => $value)\n\t\t\t\tif ($key !== $var)\n\t\t\t\t\t$new_session[$key] = $value;\n\t\t\t$_SESSION = $new_session;\n\t\t\treturn $ret;\n\t\t}\n\t\treturn NULL;\n\t}", "public static function del($key) {\t\t\t\n\t\t\tif(isset($_SESSION[base64_encode(BASE_PATH.'_'.$key)]))\n\t\t\tunset($_SESSION[base64_encode(BASE_PATH.'_'.$key)]);\n\t\t}", "public function deleteSession(): void {\n\t\tunset($_SESSION[self::SESSION_NAME]);\n\t}", "function deleteSession()\n{\n\tif (!$this->sessName) return;\n\t$this->app->deleteSession($this->sessName);\n}", "public function remove($varname)\n {\n return $this->db->exec(\n 'DELETE FROM session_vars '.\n 'WHERE container=\"'.$this->container_id.'\" '.\n 'AND name=\"'.$this->db->escapeString($varname).'\"');\n }", "public function delete($key)\n\t{\n\t\tunset($_SESSION[$key]);\n\t}", "public static function delete(string $key)\n {\n if (isset($_SESSION[$key])) {\n unset($_SESSION[$key]);\n }\n }", "public function delete() {\n $this->logger->debug(\"Deleting session\");\n $this->repository->removeByKey($this->getKeys());\n self::$instance = null;\n }", "public static function delete($name) {\n if(self::exists($name)) {\n unset($_SESSION[$name]);\n }\n }", "public static function delete($name)\n {\n unset($_SESSION[$name]);\n }", "public static function unsetVar($varname) {\n if(isset($_SESSION[sha1(Engine::getAppName())][$varname]))\n unset($_SESSION[sha1(Engine::getAppName())][$varname]);\n }", "function delete_session()\n{\n\t$_SESSION['data_inserimento_rm_spettroscopica'] = NULL;\n\t$_SESSION['flag_aggiorna'] = NULL;\n\t$_SESSION['te'] = NULL;\n\t$_SESSION['spettro'] = NULL;\n\t$_SESSION['naa'] = NULL;\n\t$_SESSION['valore_naa_cr'] = NULL;\n\t$_SESSION['valore_cho_cr'] = NULL;\n\t$_SESSION['lipidi_lattati'] = NULL;\n\t$_SESSION['mioinositolo'] = NULL;\n}", "public function destory()\n\t{\n\t\t$key = $this->getKey();\n\t\tif ( isset($_SESSION[$key]) ) unset($_SESSION[$key], $key);\n\t}", "public static function delete($name)\r\n\t{\r\n\t\tif (self::exists($name)) {\r\n\t\t\tunset($_SESSION[$name]);\r\n\t\t}\r\n\t}", "function deleteSession()\n{\n if(isset($_SESSION['username']))\n {\n unset($_SESSION['username']);\n }\n}", "public function removeSessionData(): void\n {\n $this->response->getSession()->remove(config('form.session_key'));\n }", "public static function del($name)\n {\n if(self::exists($name)) {\n unset($_SESSION[$name]);\n }\n }", "private function removeSessionUser() { \n unset($_SESSION[Constants::USER_SESSION_VAR]);\n }", "public function remove($key)\n\t{\n\t\t$this->check();\n\n\t\tif (!isset($_SESSION[$key]))\n\t\t\treturn;\n\n\t\t$var = $_SESSION[$key];\n\t\tunset($_SESSION[$key], $var);\n\t}", "public static function delete(string $key): void {\n\t\tself::$sessionInstance->delete ( $key );\n\t}", "public function delete($key) {\n $key_name = $this->getSessionKeyName($key);\n\n Session::forget($key_name);\n }", "function delete_session()\n{\n\t$_SESSION['data_inserimento_rm_morfologica'] = NULL;\n\t$_SESSION['extrassiale_rm'] = NULL;\n\t$_SESSION['intrassiale_rm'] = NULL;\n\t$_SESSION['t2_flair'] = NULL;\n\t$_SESSION['flair_3d'] = NULL;\n\t$_SESSION['calcolo_volume_neo'] = NULL;\n\t$_SESSION['dwi'] = NULL;\n\t$_SESSION['dwi_ristretta'] = NULL;\n\t$_SESSION['adc'] = NULL;\n\t$_SESSION['valore_adc'] = NULL;\t\t\t\n\t$_SESSION['tipo_adc'] = NULL;\t\n\t$_SESSION['ce'] = NULL;\n\t$_SESSION['tipo_ce'] = NULL;\n\t$_SESSION['flag_aggiorna'] = NULL;\n}", "public function removeSessionData() {}", "public function delete($variable);", "public static function delete($name)\n {\n if (self::exists($name)) {\n unset($_SESSION[$name]);\n }\n }", "public function remove(string $key)\n {\n unset($_SESSION[$key]);\n }", "protected function unset_session_var($key) {\n\t\t\tunset($_SESSION[$key]);\n\t\t}", "public function unsetSession();", "public function del($name) {\n Session::clear($name);\n }", "public static function clear()\n\t{\n\t\tSession::instance()->delete(Message::SESSION_VAR);\n\t}", "public function remove($name) {\n unset($_SESSION[$name]);\n }", "public static function delete($key)\n {\n $sessionPrefix = Box::getConfig()->framework['sessionPrefix'];\n if (isset($_SESSION[$sessionPrefix . $key])) {\n $value = $_SESSION[$sessionPrefix . $key];\n unset($_SESSION[$sessionPrefix . $key]);\n return $value;\n }\n\n return null;\n }", "public function destroy($id = '') {\n\t\tif($id == '') {\n\t\t\t$id = $this->id;\n\t\t}\n\t\t$sess = ORM::for_table($this->session_type)->find_one($id);\n\t\tif($sess != false) {\n\t\t\t$sess->delete();\n\t\t}\n\t}", "function delete_error(){\n\t$_SESSION[\"error\"] = null;\n\n\tsession_unset();\n}", "public static function delete($key = \"\")\n\t{\n\t\tif(empty($key)) {\n\t\t\treturn false;\n\t\t}\n\t\tif(self::exists($key)) {\n\t\t\tunset($_SESSION[$key]);\n\t\t}\n\t}", "public function delete($key) {\n\n $this->start();\n unset($_SESSION[$key]);\n\n }", "public function remove($name) {\n\t if( isset( $_SESSION[$name] ) )\n\t {\n\t \tunset($_SESSION[$name]);\n\t }\n\t}", "function deleteSession($name){\n\t\n\tif(isset($_SESSION[$name]) )\n\t{ \n\t\tsession_destroy();\n\t\tsunset($_SESSION[$name]);\n\t} \n}", "public function delete($sKey)\n {\n session()->forget($sKey);\n }", "public static function remove($key) {\n if (!is_null(Session::get($key))) {\n unset($_SESSION[$key]);\n }\n }", "public static function remove($key)\n {\n unset($_SESSION[$key]);\n }", "public function delete($key)\n {\n unset($_SESSION[$key]);\n return;\n }", "private function removeEntryIdFromSession()\n {\n Session::forget($this->session_key);\n }", "function phpAds_SessionDataDestroy()\n{\n $dal = new MAX_Dal_Admin_Session();\n\n\tglobal $session;\n $dal->deleteSession($_COOKIE['sessionRPID']);\n\n MAX_cookieAdd('sessionRPID', '');\n MAX_cookieFlush();\n\n\tunset($session);\n\tunset($_COOKIE['sessionRPID']);\n}", "function deleteSession() {\n session_start();\n unset($_SESSION['firstName']);\n unset($_SESSION['lastName']);\n unset($_SESSION['username']);\n unset($_SESSION['profilePicture']);\n session_destroy();\n echo json_encode(array('response' => 'Successful termination of the session'));\n }", "public function remove($key) {\n unset($_SESSION[static::$storageKey][$key]);\n }", "public function deleteValue($name) {\n if (strpos($name, '->')) {\n $name = explode('->', $name, 2);\n unset($_SESSION[$name[0]][$name[1]]);\n } else unset($_SESSION[$name]);\n }", "function destroySession($a_session_id)\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\tif(!is_array($a_session_id))\n\t\t{\n\t\t\t$q = \"DELETE FROM usr_sess_istorage WHERE session_id = \".\n\t\t\t\t$ilDB->quote($a_session_id, \"text\");\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$q = \"DELETE FROM usr_sess_istorage WHERE \".\n\t\t\t\t$ilDB->in(\"session_id\", $a_session_id, \"\", \"text\");\n\t\t}\n\n\t\t$ilDB->manipulate($q);\n\t}", "function MyApp_Session_SID_Delete($sid)\n {\n $this->SetCookie(\"SID\",\"\",time()-$this->CookieTTL);\n $this->Sql_Delete_Items\n (\n array\n (\n \"SID\" => $sid,\n ),\n $this->GetSessionsTable()\n );\n }", "function drush_variable_realm_del($realm_name, $realm_key, $variable_name) {\n variable_realm_del($realm_name, $realm_key, $variable_name);\n drush_print('Variable deleted.');\n}", "public static function delete(string $name): void {\n if (self::exists($name)) {\n unset($_SESSION[$name]);\n }\n }", "public function delete($key)\n {\n $this->session->delete($this->getSessionKey($key));\n }", "function deleteCart() {\n\t\tunset($_SESSION['cart']);\t\t\n\t}", "public function destruir(){\n session_unset(); \n // destroy the session \n session_destroy(); \n }", "public function remove(string $key)\n {\n if (isset($_SESSION[$key])) {\n $_SESSION[$key] = '';\n unset($_SESSION[$key]);\n }\n }", "public function delete($sessionID, $audience);", "protected function _unsetVar($name)\n {\n $store = $this->_getVariableStore();\n\n if ($store instanceof \\Zend_Session_Namespace) {\n $store->__unset($name);\n } else {\n if ($store->offsetExists($name)) {\n $store->offsetUnset($name);\n }\n }\n }", "public static function deleteSession($name){\n if (isset($_SESSION[$name])) {\n $_SESSION[$name] = null;\n unset($_SESSION[$name]);\n }\n\n return $name;\n }", "public function variable_del($name) {\n // TODO\n variable_del($name);\n }", "public function destroySession() {}", "public static function destroySession();", "public function delete(string $key): void\n {\n $this->ensureStarted();\n unset($_SESSION[$key]);\n }", "public function remove($key)\n {\n $this->session->remove((string)$key);\n }", "public function cleanup(){\n\t\n\t\t$this->_p->user->setSessionVal($this->_session_var_name);\n\t\n\t}", "public static function erase($s)\n\t{\n\t\tif (isset($_SESSION['Session_Master'][self::$s_name_space][$s]))\n\t\t{\n\t\t\tunset($_SESSION['Session_Master'][self::$s_name_space][$s]);\n\t\n\t\t}\n\t}", "public function remove()\n {\n if ($this->cookies->has('RMU')) {\n $this->cookies->get('RMU')->delete();\n }\n if ($this->cookies->has('RMT')) {\n $this->cookies->get('RMT')->delete();\n }\n\n $this->session->remove('auth-identity');\n $this->session->remove('subdomain-child');\n }", "public function deleteIdentity ()\n\t{\n\t\tif ($this->session->has('user')) {\n\n\t\t\t$this->session->remove('user');\n\t\t}\n\n\t}", "public static function deleteCookie(){\n func::runSession();\n setcookie('username', '', time() - 1, '/');\n setcookie('userid', '', time() - 1, '/');\n setcookie('token', '', time() - 1, '/');\n setcookie('serial', '', time() - 1, '/');\n session_destroy();\n }", "private function deleteSession() {\n session_start();\n\n $_SESSION = array();\n\n if (ini_get('session.use_cookies')) {\n $params = session_get_cookie_params();\n setcookie(\n session_name(),\n '',\n time() - 42000,\n $params['path'],\n $params['domain'],\n $params['secure'],\n $params['httponly']\n );\n }\n\n session_destroy();\n }", "public function destroy($var = null)\n {\n // Destroy single session variable\n if(!is_null($var)) {\n if(isset($_SESSION[$var])) {\n $_SESSION[$var] = null;\n unset($_SESSION[$var]);\n } else {\n return false;\n }\n return true;\n }\n else\n {\n // Destroy entire session\n session_destroy();\n return true;\n }\n }", "public function dropSession()\n\t{\n\n\t\tYii::app()->session->remove(\"wizard-{$this->uniqueId}\");\n\t}", "public static function destroy(){\n unset($_SESSION[self::$appSessionName]);\n }", "function delete_session_register_by_user_logout()\n{\n $token = $_COOKIE[\"sessionToken\"];\n\n $conn = new mysqli(\n $_ENV['onlinenotes_database_server_name'],\n $_ENV['onlinenotes_database_username'],\n $_ENV['onlinenotes_database_password'],\n $_ENV['onlinenotes_database_name']\n );\n\n if ($conn->connect_error) {\n die(\"Database connection failed: \" . $conn->connect_error);\n }\n\n if ($stmt = $conn->prepare(\"DELETE FROM SESSION WHERE token = ?\")) {\n $stmt->bind_param(\n \"s\",\n $token\n );\n\n $stmt->execute();\n $stmt->close();\n }\n\n $conn->close();\n}", "public function destroy($session_id) {\n\t}", "public function remove()\n {\n if ($this->cookies->has('RMU')) {\n\t $this->cookies->get('RMU')->delete();\n }\n if ($this->cookies->has('RMT')) {\n\t $this->cookies->get('RMT')->delete();\n }\n\n $this->session->remove('auth-i');\n $this->session->destroy(true);\n }", "public function remove($variable_key)\n {\n return @shm_remove_var($this->getResource(), $variable_key);\n }", "public function destroy(){\n\t\tsession_unset();\n\t\t$id = $this->getId();\n\t\tif (!empty($id)) {\n\t\t\tsession_destroy();\n\t\t}\n\t}", "public function removeAttribute($name)\n {\n unset($_SESSION[$name]);\n }", "public function __unset($name) {\n // echo \"Unsetting '$name'\\n\";\n unset($_SESSION[$this->myedb_session_key][$name]);\n }", "function removeSelectedUser(){\n if($_SESSION['selectedUser']){\n unset($_SESSION['selectedUser']);\n }\n}", "public static function delete($key)\n\t{\n\t\tforeach (func_get_args() as $key)\n\t\t{\n\t\t\tunset($_SESSION[(string)$key]);\n\t\t}\n\t}", "function borrar_session(){\n\t\t$this->session->set_userdata('cliente_id','');\n\t\tredirect(base_url());\n\t}", "static public function deleteSession($ssoSessionId) {\n\t\t\n\t\t$sessionMapping = self::getSSOSessionMapping();\n\t\t\n\t\tif(empty($sessionMapping[$ssoSessionId])){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t$appSessionId = $sessionMapping[$ssoSessionId];\n\t\t\n\t\tself::removeSSOSessionMapping($ssoSessionId);\n\t\t\n\t\tif (!empty($appSessionId)){\n\t\t\n\t\t\t$f = 'sessions/' . $appSessionId . '.txt';\n\t\t\n\t\t\tif (file_exists($f))\n\t\t\t\treturn unlink($f);\t\n\t\t}\n\t}", "public static function destroy(): void\n {\n Session::remove(self::SESSION_KEY);\n }", "public static function killSession (){\n\n $db = new db();\n $db->delete('system_cookie', 'cookie_id', @$_COOKIE['system_cookie']);\n \n setcookie (\"system_cookie\", \"\", time() - 3600, \"/\");\n unset($_SESSION['id'], $_SESSION['admin'], $_SESSION['super'], $_SESSION['account_type']);\n session_destroy();\n }", "public static function delete($name){\n\t\t\tif(Session::check($name)){\n\t\t\t\t$var = & $_SESSION;\n\t\t\t\t$path = explode('.', $name);\n\t\t\t\tforeach($path as $i => $key){\n\t\t\t\t\tif($i === count($path) - 1){\n\t\t\t\t\t\tunset($var[$key]);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif(!isset($var[$key])){\n\t\t\t\t\t\t\treturn Session::check($name);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$var = & $var[$key];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn !Session::check($name);\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "public function delete($id)\n{\n //faut recupere la qty de l id\n $cart=$this->session->get('cart',[]);\n unset($cart[$id]);\n return $this->session->set('cart', $cart);\n}", "public static function remove(string $key): void\n {\n static::start();\n if (static::has($key)) {\n unset($_SESSION[$key]);\n }\n }", "public function unset($key) {\n\t\t\tif (!isset($_SESSION)) {\n\t\t\t\t$this->response->throwErr(\"There's no active session\");\n\t\t\t\texit();\n\t\t\t}\n\t\t\tif (is_array($key)) {\n\t\t\t\tforeach ($key as $field) {\n\t\t\t\t\t$this->unset_session_var($field);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->unset_session_var($key);\n\t\t\t}\n\t\t}", "public function __unset($name) {\n unset($_SESSION[$name]);\n }", "function removeSession()\r\n\t{\r\n\t\t$sessionModel =& $this->getModel( 'formsession' );\r\n\t\t$sessionModel->setFormId( JRequest::getInt( 'form_id', 0 ) );\r\n\t\t$sessionModel->setRowId( JRequest::getVar( 'rowid', '' ) );\r\n\t\t$sessionModel->remove();\r\n\t\t$this->display();\r\n\t}", "public function destroy($id){\n $sess_id = $this->sess_id_prefix.$id;\n $deleteResult = $this->coll->deleteOne(array('sess_id'=>$sess_id ));\n return true;\n }", "public function sessionDestroy($id,$session_id=null) {\n if (!empty($session_id)) $id = $session_id;\n $modelSession = new \\App\\Models\\Session;\n //$user_id = $this->repo->find($id,$modelSession)->user_id;\n if ($this->repo->delete($id,$modelSession)) {\n //la colonna non viene cancellata perchè è inserita fra i campi hidden del model\n // per motivi di sicurezza.\n //$this->repo->update($user_id, ['remember_token' => null]);\n return redirect()->back()->withSuccess('Sessione cancellata correttamente');\n }\n return redirect()->back();\n }", "function unsetSessValue($k){\n $k = _APPNAME .'#'.$k;\n unset($_SESSION[$k]);\n }", "function _destroy($sessionid=false) {\n\t\t$qry = \"DELETE FROM \" . TABLEPREFIX . \"sessions WHERE sessionid='\" . addslashes($sessionid) . \"'\";\n\t\t$result = $this->DbConnection->Query($qry);\n\t\treturn $result;\n\t}", "function del ($session_id = null) {\n\t\treturn (bool)$this->del_internal($session_id);\n\t}", "function _destroy($ses_id) {\n\t\t#$sessionPath = $_SERVER['DOCUMENT_ROOT'] . '/phpSession';\n\t\t$sessionPath = dirname(__FILE__).\"/../phpSession\";\n\t\t$query = \"Delete from phpSession where id = '$ses_id'\";\n\t\t$result = mysql_query($query, $this->db);\n\t\t$this->recursiveDelete (\"$sessionPath/$ses_id\");\n\t\tprint (\"deleting session\");\n\t\treturn true;\n\t}" ]
[ "0.74837303", "0.7243719", "0.72244453", "0.70889974", "0.7045956", "0.7010141", "0.7002107", "0.6994966", "0.69764125", "0.69143534", "0.6899834", "0.6868403", "0.6820333", "0.67598575", "0.67445993", "0.669063", "0.66855913", "0.6678815", "0.66779876", "0.6672041", "0.66352624", "0.6630615", "0.66303813", "0.6612696", "0.6601906", "0.6588666", "0.65782464", "0.6544155", "0.65438974", "0.6534208", "0.65013814", "0.64915526", "0.648935", "0.6488311", "0.648785", "0.64724123", "0.64703554", "0.64688915", "0.6467782", "0.6461273", "0.6450864", "0.6448478", "0.6442604", "0.6434696", "0.64337623", "0.6429346", "0.6429312", "0.6406506", "0.6386199", "0.63818073", "0.63727826", "0.63653284", "0.6351842", "0.63436323", "0.63316345", "0.63207966", "0.63152826", "0.6288864", "0.6278425", "0.627191", "0.62681067", "0.62182105", "0.621551", "0.6205643", "0.6179895", "0.6168809", "0.6166959", "0.616189", "0.6159134", "0.61564827", "0.61490875", "0.6137887", "0.61296564", "0.6126655", "0.6114849", "0.6108867", "0.609533", "0.608572", "0.6061662", "0.6058473", "0.6050053", "0.60468864", "0.60462403", "0.6042559", "0.60425186", "0.60423917", "0.6039764", "0.60140663", "0.6012571", "0.60122985", "0.6007368", "0.5999599", "0.59972334", "0.59927607", "0.5991676", "0.5988031", "0.5987056", "0.5980807", "0.5977521", "0.59707296" ]
0.64708775
36
Destroys the whole session
function destroy () { $_SESSION = array(); session_destroy(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function destroy()\n {\n session_unset();\n session_destroy();\n }", "public function destroySession() {}", "public function destroy()\n {\n session_destroy();\n }", "public function destroy() {\n $this->closeSession();\n\n $_SESSION = array();\n\n session_destroy();\n\n // Reset cookies\n setcookie(session_name(), '', time()-3600, Route::getDir());\n }", "public function destroy()\n\t{\n\t\tif (!session_id())\n\t\t\tsession_start();\n\n\t\t$_SESSION = array();\n\t\tsession_destroy();\n\t}", "public static function destroy(): void\n {\n Session::remove(self::SESSION_KEY);\n }", "public static function destroy()\n {\n $_SESSION = [];\n session_destroy();\n }", "public final function destroy() \n\t{\n\t\tsession_destroy();\n\t}", "public static function destroy(): void\n {\n session_destroy();\n }", "public static function destroy(): void\n {\n session_destroy();\n }", "public function destroy(){\n\t\tsession_unset();\n\t\t$id = $this->getId();\n\t\tif (!empty($id)) {\n\t\t\tsession_destroy();\n\t\t}\n\t}", "public static function destroySession();", "public function destroy(): void\n {\n if (!empty($_SESSION)) {\n $_SESSION = [];\n session_unset();\n session_destroy();\n }\n }", "public function destroy()\n {\n $this->session_open();\n $_SESSION = array();\n session_destroy();\n }", "function destroy()\r\n {\r\n unset($_SESSION[$this->_options['sessionVar']]);\r\n }", "public static function destroy() {\t\t\t\n\t\t\tself::start();\n\t\t\tsession_regenerate_id(true); \n\t\t\t\n\t\t\tunset($_SESSION);\n\t\t\tsession_destroy();\n\t\t}", "private function destroySession () : void {\n unset($_SESSION);\n session_destroy();\n }", "function destroySession(){\n\t\t//@session_destroy();\n\t\t//unset($_SESSION);\n\t\t$this->unsetSession('User');\n\t}", "public static function destroy()\r\n {\r\n if (self::isStarted())\r\n {\r\n session_unset();\r\n session_destroy();\r\n }\r\n }", "public static function destroy()\n\t{\n\t\tsession_destroy();\n\t}", "public static function destroy(){\n unset($_SESSION[self::$appSessionName]);\n }", "public static function destroy()\n {\n if (session_id() != '') {\n session_destroy();\n }\n }", "public function destroy()\n {\n // no need to destroy new or destroyed sessions\n if ($this->tokenExpiry === null || $this->destroyed === true) {\n return;\n }\n\n // remove session file\n $this->sessions->store()->destroy($this->tokenExpiry, $this->tokenId);\n $this->destroyed = true;\n $this->writeMode = false;\n $this->needsRetransmission = false;\n\n // remove cookie\n if ($this->mode === 'cookie') {\n Cookie::remove($this->sessions->cookieName());\n }\n }", "static function destroy() {\n\t\tsession_unset();\n\t\tsession_destroy();\n\t\tsession_write_close();\n\t}", "public static function destroy()\n {\n if(!isset($_SESSION)){\n session_start();\n }\n session_destroy();\n }", "public static function destroy() {\n if ('' !== session_id()) {\n $_SESSION = array();\n // If it's desired to kill the session, also delete the session cookie.\n // Note: This will destroy the session, and not just the session data!\n if (ini_get(\"session.use_cookies\")) {\n $params = session_get_cookie_params();\n setcookie(session_name(), '', time() - 42000,\n $params[\"path\"], $params[\"domain\"],\n $params[\"secure\"], $params[\"httponly\"]\n );\n }\n session_destroy();\n }\n }", "public function destruir(){\n session_unset(); \n // destroy the session \n session_destroy(); \n }", "public function destroy() {\n\t\t\t$this->session->unset('user');\n\t\t}", "public function destroy()\n {\n $_SESSION = [];\n setcookie(session_name(), '', 1);\n unset($_COOKIE[session_name()]);\n @session_destroy();\n }", "public function destroy() {\n\t\t\tif (isset($_SESSION)) {\n\t\t\t\tsession_destroy();\n\t\t\t} else {\n\t\t\t\t$this->response->throwErr(\"There's no active session\");\n\t\t\t\texit();\n\t\t\t}\n\t\t}", "public function logoutxxx()\n {\n $this->getSession()->destroy();\n }", "public function deleteSession(): void {\n\t\tunset($_SESSION[self::SESSION_NAME]);\n\t}", "public function destroy()\n {\n unset($_SESSION[$this->_sGroup]);\n }", "public function logout(){\n session_destroy();\n unset($_SESSION);\n }", "public function unsetSession();", "public static function destroySession()\n {\n $_SESSION = array();\n // Finally, destroy the session.\n session_destroy();\n }", "public function logout()\n {\n $session = new SessionContainer($this->getStorage()->getNameSpace());\n $session->getManager()->destroy();\n $this->getStorage()->forgetMe();\n\n $storage = $this->getStorage()->read();\n\n if (isset($storage['identity'])) {\n unset($storage['identity']);\n }\n }", "public function delete() {\n $this->logger->debug(\"Deleting session\");\n $this->repository->removeByKey($this->getKeys());\n self::$instance = null;\n }", "public function logout(){\n session_destroy();\n unset($_SESSION['user_session']);\n }", "public function destory()\n\t{\n\t\t$key = $this->getKey();\n\t\tif ( isset($_SESSION[$key]) ) unset($_SESSION[$key], $key);\n\t}", "public function logout()\n {\n $this->deleteSession();\n }", "public function destroy()\n\t{\n\t\tif ($this->userdata['session_id'] === 0)\n\t\t{\n\t\t\t// just to be sure\n\t\t\t$this->fetch_guest_data();\n\t\t\treturn;\n\t\t}\n\n\t\tee()->db->where('session_id', $this->userdata['session_id']);\n\t\tee()->db->delete(array('sessions', 'security_hashes'));\n\n\t\t// Really should redirect after calling this\n\t\t// method, but if someone doesn't - we're safe\n\t\t$this->fetch_guest_data();\n\n\t\tee()->remember->delete();\n\t\tee()->input->delete_cookie($this->c_session);\n\t\tee()->input->delete_cookie($this->c_anon);\n\t\tee()->input->delete_cookie('tracker');\n\t}", "public function logout()\n {\n session_unset();\n // deletes session file\n session_destroy();\n }", "public static function destroy(){\r\n\t\t\t\tsession_destroy();\r\n\t\t\t\tsession_unset();\r\n\t\t\t\theader(\"location: login.php\");\r\n\t\t\t}", "public static function killSession (){\n\n $db = new db();\n $db->delete('system_cookie', 'cookie_id', @$_COOKIE['system_cookie']);\n \n setcookie (\"system_cookie\", \"\", time() - 3600, \"/\");\n unset($_SESSION['id'], $_SESSION['admin'], $_SESSION['super'], $_SESSION['account_type']);\n session_destroy();\n }", "public function logout() {\n $s = Session::getInstance();\n $key = $this->sessionId;\n unset($s->$key);\n $this->setAuthed(false);\n }", "public function logout() {\r\n\t\tSession::delete($this->_sessionName);\r\n\t}", "public static function DestroySession(){\n\t\tself::$_leuser=NULL; \n\t\t//unset(User::$_leuser);\n\t\tunset($_SESSION['user']);\n\t}", "public function sess_destroy() {\n\t\tsession_unset();\n\t\tif (isset($_COOKIE[session_name()])) {\n\t\t\tsetcookie(session_name(), '', time()-42000, '/');\n }\n session_destroy();\n }", "function phpAds_SessionDataDestroy()\n{\n $dal = new MAX_Dal_Admin_Session();\n\n\tglobal $session;\n $dal->deleteSession($_COOKIE['sessionRPID']);\n\n MAX_cookieAdd('sessionRPID', '');\n MAX_cookieFlush();\n\n\tunset($session);\n\tunset($_COOKIE['sessionRPID']);\n}", "public function CleanSession()\n {\n unset($_SESSION[SESSION_ENTRY]);\n }", "function session_clean()\n {\n session_unset();\n }", "public function destroy()\n\t{\n\t\t$params = session_get_cookie_params();\n\t\tsetcookie(session_name(), '', time() - 42000,\n\t\t\t$params[\"path\"], $params[\"domain\"],\n\t\t\t$params[\"secure\"], $params[\"httponly\"]\n\t\t);\n\n\t\t$_SESSION = array();\n\n\t\t// Destroy the session\n\t\tsession_destroy();\n\t}", "public function logout(){\n\t\t\t// remove all session variables\n\t\t\tsession_unset();\n\t\t\t// destroy the session\n\t\t\tsession_destroy(); \n\t\t}", "function destroy()\r\n\t{\r\n\t\tif (ini_get(\"session.use_cookies\")) {\r\n\t\t $params = session_get_cookie_params();\r\n\t\t setcookie(session_name(), '', time() - 42000,\r\n\t\t $params[\"path\"], $params[\"domain\"],\r\n\t\t $params[\"secure\"], $params[\"httponly\"]\r\n\t\t );\r\n\t\t}\r\n\t\tsession_destroy();\r\n\t}", "function destroySession(){\n\t\tforeach ($_SESSION as $key => $value) {\n\t\t\t$_SESSION[$key] = \"\";\n\t\t}\n\t\tsession_unset();\n\t\tsession_destroy();\n\t}", "public function logout()\r\n {\r\n session_unset();\r\n session_destroy(); \r\n }", "public function logout(){\n session_unset();\n session_destroy();\n }", "public static function logout()\n {\n foreach ($_SESSION as $key => $value) {\n unset($_SESSION[$key]);\n }\n session_destroy();\n }", "public function purge()\n {\n $this->_session->purge();\n }", "public static function sessionDestroy() {\n if(session_id()) {\n session_unset();\n setcookie(session_name(), session_id(), time() - 86400, '/');\n session_destroy();\n }\n }", "public function destroySession(){\r\n\t\t//the facebook either sets the domain for cookie, or doesn't...\r\n\t\tsetcookie('fbsr_'.$this->facebook_obj->getAppId(), '', time() - 3600, '/');\r\n\t\t\r\n\t\tsetcookie('fbsr_'.$this->facebook_obj->getAppId(), '', time() - 3600, '/', Config::$cookie_domain);\r\n\t\tsetcookie('PHPSESSID', '', time() - 3600, '/');\r\n\r\n\t\tunset($_SESSION['fb_' . $this->facebook_obj->getAppId() . '_code']);\r\n\t\tunset($_SESSION['fb_' . $this->facebook_obj->getAppId() . '_access_token']);\r\n\t\tunset($_SESSION['fb_' . $this->facebook_obj->getAppId() . '_user_id']);\r\n\t}", "public function destroy()\r\n\t\t{\r\n\t\t\t\tsession_unset();\r\n\t\t\t\tsession_destroy();\r\n\t\t\t\t$scriptName = getScriptName() . '.php';\r\n\t\t\t\tif ($scriptName != self::SESSION_END_URL)\r\n\t\t\t\t\t\theader('Location: ' . self::SESSION_END_URL);\r\n\t\t}", "public function logout()\n\t\t {\n\t\t \t\n\t\t\tsession_destroy();\n\t\t\tunset($this->id);\n\t\t }", "public function destroy()\n {\n session_start();\n session_destroy();\n $this->view->mostrarsesionExpirada();\n die();\n }", "function sess_destroy ()\n {\n if (isset($_COOKIE[session_name()])) {\n setcookie(session_name(), '', (time()-42000), '/');\n }\n\n //Destroy the Session Array\n $_SESSION = array();\n\n //Destroy the userdata array - in case any further calls after the destory session is called, \"stale\" information is not called upon.\n $this->userdata = array();\n\n //Complete the session destory process by calling PHP's native session_destroy() function\n session_destroy();\n }", "public function killSession()\n {\n $this->session->invalidate();\n }", "public function destroy()\r\n {\r\n if (session_id()) {\r\n session_destroy();\r\n }\r\n return $this->clear();\r\n }", "private function deleteSession() {\n session_start();\n\n $_SESSION = array();\n\n if (ini_get('session.use_cookies')) {\n $params = session_get_cookie_params();\n setcookie(\n session_name(),\n '',\n time() - 42000,\n $params['path'],\n $params['domain'],\n $params['secure'],\n $params['httponly']\n );\n }\n\n session_destroy();\n }", "public function logout()\n {\n $this->user = null;\n $this->synchronize();\n unset($_SESSION);\n }", "function clearSession(){\n\t\t\n\t\t$this->dm->session->sess_destroy();\n }", "public function logout()\n\t{\n\t\t$this->user = null;\n\n\t\t$this->session->forget(static::$key);\n\t}", "function payswarm_clear_session() {\n // clear existing stored session\n $session = payswarm_get_session();\n if($session !== false) {\n delete_transient('ps_sess_' . $session['id']);\n }\n\n // clear cookie\n payswarm_clear_session_cookie();\n}", "function EndSession(){\n session_unset(); \n // destroy the session \n session_destroy(); \n }", "public function logout()\n {\n $this->session->end();\n }", "public function logout()\r\n\t{\r\n\t\t$_SESSION = array();\r\n\t\tsession_destroy();\r\n\t\treturn;\r\n\t}", "function deleteSession()\n{\n\tif (!$this->sessName) return;\n\t$this->app->deleteSession($this->sessName);\n}", "public function logout() {\n unset($_SESSION['user_id']);\n unset($_SESSION['user_email']);\n unset($_SESSION['user_name']);\n session_destroy();\n redirect('');\n }", "public function logout() {\n unset($_SESSION['ccUser']);\n session_destroy();\n }", "public function kill()\n {\n session_regenerate_id();\n $_SESSION[CCID] = array(); // session_unset();\n session_destroy();\n }", "public function logout() \n {\n unset($_SESSION['is_logged_in']);\n unset($_SESSION['user_id']);\n unset($_SESSION['time_logged_in']);\n\n session_destroy();\n }", "public function destroySession()\n {\n $_SESSION = [];\n $this->executeGcNotificationCallback($this->getSessionId(), time());\n session_destroy();\n }", "public function clear()\n {\n $this->session->sess_destroy();\n }", "public function sessionEnd (){\n $this->load->library( 'nativesession' );\n $this->load->helper('url');\n\n //delete session data\n $this->nativesession->delete('userid');\n $this->nativesession->delete('userLevel');\n\n session_destroy();\n\n redirect(\"../../../iris/dashboard\");\n\t}", "public function logout()\n {\n if (!is_null($this->token)) {\n $this->token->delete();\n }\n if (isset($_SESSION['uuid'])) {\n unset($_SESSION['uuid']);\n session_destroy();\n setcookie('token', '', time() - 3600, '/', getenv('DOMAIN'));\n }\n }", "public function destroy()\n\t{\n\t\t\\Session::forget('google.session');\n\t\t\\Session::forget('google.access_token');\n\t}", "public function logOut(){\n $_SESSION=[];\n session_destroy();\n }", "public function Logout() \n {\n session_unset();\n session_destroy();\n }", "public function cerrar2()\n {\n Session::destroy();\n }", "static function logout()\n {\n session_destroy();\n }", "public function killUserSession(){\t\n\t\t@session_unset();\n\t\t@session_destroy();\n\t}", "public function logout() {\n @session_start();\n session_destroy();\n }", "function deleteSession() {\n session_start();\n unset($_SESSION['firstName']);\n unset($_SESSION['lastName']);\n unset($_SESSION['username']);\n unset($_SESSION['profilePicture']);\n session_destroy();\n echo json_encode(array('response' => 'Successful termination of the session'));\n }", "public function logout()\n {\n $_SESSION = array();\n\n // If it's desired to kill the session, also delete the session cookie.\n // Note: This will destroy the session, and not just the session data!\n if (ini_get(\"session.use_cookies\")) {\n $params = session_get_cookie_params();\n setcookie(session_name(), '', time() - 42000,\n $params[\"path\"], $params[\"domain\"],\n $params[\"secure\"], $params[\"httponly\"]\n );\n }\n\n // Finally, destroy the session.\n session_destroy();\n }", "public function logout() { \n \n session_destroy(); \n }", "public static function logout(): void\n {\n // Remove from the session (user object)\n unset($_SESSION['user']);\n }", "public function logout()\n\t{\n\t\t@session_start();\n\t\t// Unset all of the session variables.\n\t\t$_SESSION = array();\n\t\t// If it's desired to kill the session, also delete the session cookie.\n\t\t// Note: This will destroy the session, and not just the session data!\n\t\tif ( ini_get( \"session.use_cookies\" ) ) {\n\t\t\t$params = @session_get_cookie_params();\n\t\t\t@setcookie( session_name(), '', time() - 42000,\n\t\t\t\t$params[\"path\"], $params[\"domain\"],\n\t\t\t\t$params[\"secure\"], $params[\"httponly\"]\n\t\t\t);\n\t\t}\n\t\t// Finally, destroy the session.\n\t\t@session_destroy();\n\t\t@session_start();\n\t\t\n\t\t$this->logout_related_sites();\n\t}", "static function logout() {\n self::forget(self::currentUser());\n unset($_SESSION['userId']);\n session_destroy();\n }", "private static function logout() {\n\t\t$key = Request::getCookie('session');\n\t\t$session = Session::getByKey($key);\n\t\tif ($session)\n\t\t\t$session->delete();\n\t\tOutput::deleteCookie('session');\n\t\tEnvironment::getCurrent()->notifySessionChanged(null);\n\t\tself::$loggedOut->call();\n\t}", "public function logout(){\r\n session_start();\r\n unset($_SESSION['id']);\r\n unset($_SESSION['username']);\r\n unset($_SESSION['email']);\r\n unset($_SESSION['coin']);\r\n unset($_SESSION['success']);\r\n $_SESSION = array();\r\n session_destroy();\r\n header('Location: /user/login');\r\n exit();\r\n }" ]
[ "0.8527173", "0.8486895", "0.84699136", "0.8408251", "0.84008116", "0.8398972", "0.83875346", "0.8367741", "0.83676666", "0.83676666", "0.83594656", "0.834767", "0.83441645", "0.8340786", "0.8334366", "0.829486", "0.82784665", "0.82586527", "0.823827", "0.8235006", "0.8230746", "0.8191619", "0.8166392", "0.81496805", "0.8148249", "0.8134445", "0.8110876", "0.810893", "0.81040233", "0.80991805", "0.80497456", "0.80323005", "0.8030676", "0.79397213", "0.793346", "0.7924923", "0.792218", "0.7897793", "0.78781366", "0.787684", "0.787063", "0.7865298", "0.78636295", "0.7854382", "0.7841921", "0.7839781", "0.7836342", "0.782003", "0.7808672", "0.7804456", "0.7803481", "0.78017354", "0.7799763", "0.7797501", "0.7789686", "0.7785917", "0.77587163", "0.7743445", "0.7740041", "0.7727704", "0.77156025", "0.7699843", "0.76939577", "0.76894444", "0.76792496", "0.7678608", "0.76344585", "0.76263875", "0.7607846", "0.7606901", "0.76036847", "0.76008457", "0.75938016", "0.75742996", "0.75657254", "0.7561645", "0.75602067", "0.75584465", "0.75522447", "0.7548294", "0.7540997", "0.75402546", "0.7535299", "0.7529747", "0.7506008", "0.7483545", "0.7482899", "0.7482091", "0.7473241", "0.7472921", "0.7461878", "0.74598366", "0.7451812", "0.7431963", "0.74119484", "0.73982525", "0.73913556", "0.7390738", "0.7381298", "0.73781854" ]
0.82938373
16
Required. Total number of shards. When any physical devices are selected, the number must be >= 1 and = 1 and int32 num_shards = 1;
public function getNumShards() { return $this->num_shards; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getShardsCount()\n {\n return $this->shards_count;\n }", "public function getTotalShards()\n {\n return (int)$this->data['totalShards'];\n }", "public function setNumShards($var)\n {\n GPBUtil::checkInt32($var);\n $this->num_shards = $var;\n\n return $this;\n }", "public function shards(int $number): Fluent\n {\n return $this->settingCommand('number_of_shards', $number);\n }", "public function setShardsCount($var)\n {\n GPBUtil::checkInt32($var);\n $this->shards_count = $var;\n\n return $this;\n }", "public function getNumShardsSkipped()\n {\n return (int)$this->data['numShardsSkipped'];\n }", "protected function setShards()\n {\n // Clear shards first\n $this->shards = [];\n\n foreach ($this->getState()[ClusterState::SHARDS_PROP] as $shardName => $shardState) {\n $this->shards[$shardName] = new ShardState([$shardName => $shardState], $this->liveNodes);\n }\n }", "public function getSmashIdxCount()\n {\n return $this->count(self::_SMASH_IDX);\n }", "public function numDocs()\n {\n return $this->index->numDocs();\n }", "public function findShards()\r\n\t{\r\n\t\t$result = $this -> connection -> setTable($this -> entity)\r\n\t\t\t\t\t\t\t\t\t -> fetch();\r\n\t\treturn $result;\r\n\t}", "public function getCount() {\n return count($this->indices);\n }", "public function setShardSize($shard_size)\n {\n return $this->setParam('shard_size', $shard_size);\n }", "public function numberOfHostEntries()\n {\n return (int)$this->prepareRequest()->GetHostNumberOfEntries();\n }", "public function getShelfCapacity() : int\n {\n return $this->shelfCapacity;\n }", "private function checkForNumberOfHits()\n {\n // Get number of hits per page\n $hits = $this->app->request->getGet(\"hits\", 4);\n\n if (!(is_numeric($hits) && $hits > 0 && $hits <= 8)) {\n $hits = 4;\n }\n return $hits;\n }", "public function count(): int\n {\n return count($this->resources);\n }", "public function getIncludeShardKeyBounds()\n {\n return $this->include_shard_key_bounds;\n }", "function searchSize()\t{\n\t\treturn $this->getRandomSize();\n\t}", "public function numNodes() {\r\n return $this->nodeCount;\r\n }", "public function getNumberOfAvailableForGet()\n {\n return ($this->shelfs[0]->count() + $this->shelfs[1]->count() + $this->shelfs[2]->count());\n }", "public function setNumCopies($numCopies) {}", "public function getMinReplicas(): int {\n return $this->minReplicas;\n }", "public function size()\n {\n $count = 0;\n foreach ($this->identityMap as $documentSet) {\n $count += count($documentSet);\n }\n return $count;\n }", "final public function count(): int\n {\n return count($this->index);\n }", "public function setNumberOfHMetrics($value) {}", "public function count(): int\n {\n return $this->nodes->count();\n }", "public function getMaxReplicas(): int {\n return $this->maxReplicas;\n }", "public function isUsingShard()\n {\n return $this->currentShardId !== null;\n }", "public function getWorkerCount(): int;", "function NumQueries() {\n\t\t\treturn $this->querycount;\n\t\t}", "public function getNumberOfWorks()\n {\n return $this->createQueryBuilder('w')\n ->select('COUNT(w)')\n ->getQuery();\n }", "public function numRows() : int\n {\n return count($this->samples);\n }", "public function count(): int\n {\n return count($this->store);\n }", "public function getShardIds()\n {\n return array_keys($this->connections);\n }", "public function size(): int {\n\t\treturn $this->count();\n\t}", "public function getNumResultsStored() : int{\n return $this->numResults;\n }", "public function getQuerycount() : int\n {\n return $this->queryCount;\n }", "public function get_limit() {\n\t\t// This matches the maximum number of indexables created by this action.\n\t\treturn 4;\n\t}", "public function hasTotalHits() {\n return $this->_has(2);\n }", "public function hasTotalHits() {\n return $this->_has(2);\n }", "public function getInstances(): int;", "public function getCurrentShardId()\n {\n return $this->currentShardId;\n }", "public function getNumTables() {}", "public function getNumTables() {}", "public function getNumTables() {}", "public function get_total_unindexed() {\n\t\t$indexables_to_create = $this->query();\n\n\t\treturn \\count( $indexables_to_create );\n\t}", "public function count(){\n\t\treturn count($this->nodes);\n\t}", "public function count() {\n\t\treturn count($this->store);\n\t}", "public function getNumQueries()\n {\n return $this->numQueries;\n }", "abstract public function NumQueries();", "public function replicas(int $number): Fluent\n {\n return $this->settingCommand('number_of_replicas', $number);\n }", "public function count(): int\n\t{\n\t\treturn $this->paginator->count();\n\t}", "function get_num_queries()\n {\n }", "public static function getNumberOfWorkers();", "public function count()\n {\n return sizeof($this->allStates);\n }", "public function getChildDocumentsCount() {}", "public function getNumberOfHMetrics() {}", "public function testNumberOfSearchCriteria()\n {\n\n $searchCriteria = $this->criteriaCreator->getSearchCriteria($this->getMockedRequestQueryData());\n\n $this->assertEquals(3, count($searchCriteria));\n\n }", "public function getNumberOfDocuments(): int\n {\n\n return $this->numberofDocuments;\n\n }", "public function getNumRows(){\n\t\treturn $this->instance->getNumRows();\n\t}", "public function getNbResults(): int\n {\n return $this->adapter->getTotalHits();\n }", "public function count()\n {\n $db = $this->dbConnect();\n $req = $db->query('SELECT COUNT(*) AS nbRows FROM regions');\n $result = $req->fetch();\n\n return $totalNbRows = $result['nbRows'];\n }", "public function size()\n {\n return $this->map->size();\n }", "public function countTriples()\n {\n $count = 0;\n foreach ($this->index as $resource) {\n foreach ($resource as $values) {\n $count += count($values);\n }\n }\n return $count;\n }", "public function getNumTotalQueryResults() : int{\n return $this->numTotalQueryResults;\n }", "public function getNumberOfIndexedDocuments()\n {\n $index = $this->service->getIndex();\n $status = $index->getStatus()->getData();\n\n $numberDocsInIndex = -1; // flag value for not yet indexed\n if (isset($status['indices']['elastica_ss_module_test_en_us']['docs'])) {\n $numberDocsInIndex = $status['indices']['elastica_ss_module_test_en_us']['docs']['num_docs'];\n }\n\n $this->assertGreaterThan(-1, $numberDocsInIndex);\n\n return $numberDocsInIndex;\n }", "public function count(): int\n {\n if ($this->numberOfResults === null) {\n $this->initialize();\n if ($this->queryResult !== null) {\n $this->numberOfResults = count($this->queryResult ?? []);\n } else {\n parent::count();\n }\n }\n\n return $this->numberOfResults;\n }", "function CountDevicesInRack($site) {\tglobal $devices, $racks;\n\n\t$rack = array();\n\t$max = 0;\n\t\n\tforeach($devices as $device_name => $installed_rack) {\n\t\tif ($racks[$installed_rack] == $site) {\n\t\t\tif (isset($rack[$installed_rack])) {\n\t\t\t\t$rack[$installed_rack]++;\n\t\t\t} \n\t\t\telse {\n\t\t\t\t$rack[$installed_rack]=1;\n\t\t\t}\n\t\t\tif ($rack[$installed_rack] > $max) {\n\t\t\t\t$max = $rack[$installed_rack];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $max;\n}", "public function CountRow()\n\t{\n\treturn HDB::hus()->Hcount(\"mtrbundle\");\n\t}", "public function getNumFound()\n {\n return $this->numberOfFoundDocuments;\n }", "public function count (): int {\n return count($this->clients);\n }", "public function get_sections_count()\n\t{\n\t\t$sections = $this->get_sections();\n\t\treturn count($sections);\n\t}", "public function getMappingCount()\n {\n return $this->count(self::mapping);\n }", "public function size()\n\t{\n\t\t$this->init();\n\t\treturn shmop_size($this->shmId);\n\t}", "function NumRows() {}", "public function getNumber_hits()\n {\n return $this->number_hits;\n }", "public function count() {\n\t\treturn $this->sets[':default']->count();\n\t}", "public function getNbResults()\n {\n $this->sphinxQL->execute();\n\n $helper = Helper::create($this->sphinxQL->getConnection());\n $meta = $helper->showMeta()->execute()->fetchAllAssoc();\n\n foreach ($meta as $item) {\n if ('total_found' === $item['Variable_name']) {\n return (int) $item['Value'];\n }\n }\n\n return 0;\n }", "public function getQueryCount()\n {\n return $this->query_count;\n }", "function solr_total_count($doctype=1)\n\t{\n\t\t$query = $this->solr_client->createSelect();\n\t\t$query->setQuery('doctype:'.$doctype);\n\t\t$query->createFilterQuery('published')->setQuery('published:1');\n\t\t$query->setStart(0)->setRows(0);\n\t\t$resultset = $this->solr_client->select($query);\n\t\treturn $resultset->getNumFound();\n\t}", "public function count($filters = array()) {\n\n return 1000;\n }", "public function getHostNumberOfEntries()\n {\n $result = $this->client->GetHostNumberOfEntries();\n if ($this->errorHandling($result, 'Could not get number of host entries from FRITZ!Box')) {\n return;\n }\n\n return $result;\n }", "public function getQueryCount()\n\t{\n\t\treturn $this->query_count;\n\t}", "public function count(): int\n\t{\n\t\treturn count($this->all());\n\t}", "public function getNumberOfStudents()\n {\n return count($this->students);\n }", "public function totalParts() {\n return sizeof($this->all());\n }", "public function count() {\r\n\r\n return $this->total_size;\r\n\r\n }", "public function count(): int\n {\n $query = $this->database->table('instances');\n\n if (func_num_args() > 0) {\n $query = $query->where(...func_get_args());\n }\n\n return $query->count();\n }", "public function numberOfRecords(): int\n {\n return $this->number_of_records;\n }", "function RowCount() {}", "public function count(): int\n {\n return count($this->storage);\n }", "public function count()\n {\n return $this->size();\n }", "public function count()\n {\n return $this->queryResult->getSize();\n }", "public function countAllDevices()\n\t{\n\t\t $criteria = new CDbCriteria();\n\t\t $criteria->select = '*';\n\t\t $devices = Devices::model()->findAll($criteria);\n\t\t return count($devices);\n\t}", "function countHit() {\n\n $this->saveField('hits', $this->data['Ringsite']['hits']+1, false);\n }", "function getAllNumNodes(){\n\t\t$clase=$this->nmclass;\n\t\t$u=$this->cant_nodos;\n\t\treturn $u;\n\t}", "public function getNbPages(): int;", "public function count()\n\t{\n\t\treturn count($this->getListByKey());\n\t}", "public function getTotalNumberOfResults();", "public function count(): int\n {\n return $this->makeQuery()->count();\n }" ]
[ "0.77530587", "0.74255246", "0.7311514", "0.68055606", "0.6617849", "0.62268084", "0.57737255", "0.54278", "0.5226933", "0.51572603", "0.513165", "0.50968295", "0.5050214", "0.49984208", "0.49721453", "0.49708915", "0.4936657", "0.48678342", "0.48409212", "0.48269108", "0.48212686", "0.48081523", "0.4796623", "0.4782933", "0.4781362", "0.4774378", "0.47710347", "0.4763671", "0.475518", "0.47459573", "0.47448695", "0.47352755", "0.4727142", "0.47258678", "0.47223914", "0.47096777", "0.47068673", "0.4699584", "0.46930298", "0.46930298", "0.46868676", "0.46823615", "0.46803656", "0.46803656", "0.46803656", "0.465695", "0.46557912", "0.4651476", "0.46511778", "0.4649162", "0.4647863", "0.46340808", "0.46248743", "0.46006405", "0.460058", "0.45999575", "0.4598223", "0.45923555", "0.45884672", "0.45875457", "0.45827082", "0.45823187", "0.45725453", "0.45707107", "0.45683557", "0.45554426", "0.45534915", "0.45483127", "0.45480385", "0.4545743", "0.45438826", "0.4543291", "0.45399448", "0.45381635", "0.45341805", "0.4530575", "0.45267177", "0.4522993", "0.45121878", "0.4501908", "0.45009202", "0.44997957", "0.44977272", "0.4490145", "0.44886646", "0.4488118", "0.44825172", "0.44802618", "0.44797727", "0.4477407", "0.44773984", "0.44717717", "0.44709358", "0.4468679", "0.4466453", "0.4459229", "0.44581613", "0.4448778", "0.4448753", "0.44475356" ]
0.8122758
0
Required. Total number of shards. When any physical devices are selected, the number must be >= 1 and = 1 and int32 num_shards = 1;
public function setNumShards($var) { GPBUtil::checkInt32($var); $this->num_shards = $var; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getNumShards()\n {\n return $this->num_shards;\n }", "public function getShardsCount()\n {\n return $this->shards_count;\n }", "public function getTotalShards()\n {\n return (int)$this->data['totalShards'];\n }", "public function shards(int $number): Fluent\n {\n return $this->settingCommand('number_of_shards', $number);\n }", "public function setShardsCount($var)\n {\n GPBUtil::checkInt32($var);\n $this->shards_count = $var;\n\n return $this;\n }", "public function getNumShardsSkipped()\n {\n return (int)$this->data['numShardsSkipped'];\n }", "protected function setShards()\n {\n // Clear shards first\n $this->shards = [];\n\n foreach ($this->getState()[ClusterState::SHARDS_PROP] as $shardName => $shardState) {\n $this->shards[$shardName] = new ShardState([$shardName => $shardState], $this->liveNodes);\n }\n }", "public function getSmashIdxCount()\n {\n return $this->count(self::_SMASH_IDX);\n }", "public function numDocs()\n {\n return $this->index->numDocs();\n }", "public function findShards()\r\n\t{\r\n\t\t$result = $this -> connection -> setTable($this -> entity)\r\n\t\t\t\t\t\t\t\t\t -> fetch();\r\n\t\treturn $result;\r\n\t}", "public function getCount() {\n return count($this->indices);\n }", "public function setShardSize($shard_size)\n {\n return $this->setParam('shard_size', $shard_size);\n }", "public function numberOfHostEntries()\n {\n return (int)$this->prepareRequest()->GetHostNumberOfEntries();\n }", "public function getShelfCapacity() : int\n {\n return $this->shelfCapacity;\n }", "private function checkForNumberOfHits()\n {\n // Get number of hits per page\n $hits = $this->app->request->getGet(\"hits\", 4);\n\n if (!(is_numeric($hits) && $hits > 0 && $hits <= 8)) {\n $hits = 4;\n }\n return $hits;\n }", "public function count(): int\n {\n return count($this->resources);\n }", "public function getIncludeShardKeyBounds()\n {\n return $this->include_shard_key_bounds;\n }", "function searchSize()\t{\n\t\treturn $this->getRandomSize();\n\t}", "public function numNodes() {\r\n return $this->nodeCount;\r\n }", "public function getNumberOfAvailableForGet()\n {\n return ($this->shelfs[0]->count() + $this->shelfs[1]->count() + $this->shelfs[2]->count());\n }", "public function setNumCopies($numCopies) {}", "public function getMinReplicas(): int {\n return $this->minReplicas;\n }", "public function size()\n {\n $count = 0;\n foreach ($this->identityMap as $documentSet) {\n $count += count($documentSet);\n }\n return $count;\n }", "final public function count(): int\n {\n return count($this->index);\n }", "public function setNumberOfHMetrics($value) {}", "public function count(): int\n {\n return $this->nodes->count();\n }", "public function getMaxReplicas(): int {\n return $this->maxReplicas;\n }", "public function isUsingShard()\n {\n return $this->currentShardId !== null;\n }", "public function getWorkerCount(): int;", "function NumQueries() {\n\t\t\treturn $this->querycount;\n\t\t}", "public function getNumberOfWorks()\n {\n return $this->createQueryBuilder('w')\n ->select('COUNT(w)')\n ->getQuery();\n }", "public function numRows() : int\n {\n return count($this->samples);\n }", "public function getShardIds()\n {\n return array_keys($this->connections);\n }", "public function count(): int\n {\n return count($this->store);\n }", "public function size(): int {\n\t\treturn $this->count();\n\t}", "public function getNumResultsStored() : int{\n return $this->numResults;\n }", "public function getQuerycount() : int\n {\n return $this->queryCount;\n }", "public function get_limit() {\n\t\t// This matches the maximum number of indexables created by this action.\n\t\treturn 4;\n\t}", "public function hasTotalHits() {\n return $this->_has(2);\n }", "public function hasTotalHits() {\n return $this->_has(2);\n }", "public function getInstances(): int;", "public function getCurrentShardId()\n {\n return $this->currentShardId;\n }", "public function getNumTables() {}", "public function getNumTables() {}", "public function getNumTables() {}", "public function get_total_unindexed() {\n\t\t$indexables_to_create = $this->query();\n\n\t\treturn \\count( $indexables_to_create );\n\t}", "public function count(){\n\t\treturn count($this->nodes);\n\t}", "public function count() {\n\t\treturn count($this->store);\n\t}", "public function getNumQueries()\n {\n return $this->numQueries;\n }", "abstract public function NumQueries();", "public function replicas(int $number): Fluent\n {\n return $this->settingCommand('number_of_replicas', $number);\n }", "public function count(): int\n\t{\n\t\treturn $this->paginator->count();\n\t}", "function get_num_queries()\n {\n }", "public function getChildDocumentsCount() {}", "public function count()\n {\n return sizeof($this->allStates);\n }", "public static function getNumberOfWorkers();", "public function getNumberOfHMetrics() {}", "public function testNumberOfSearchCriteria()\n {\n\n $searchCriteria = $this->criteriaCreator->getSearchCriteria($this->getMockedRequestQueryData());\n\n $this->assertEquals(3, count($searchCriteria));\n\n }", "public function getNumberOfDocuments(): int\n {\n\n return $this->numberofDocuments;\n\n }", "public function getNumRows(){\n\t\treturn $this->instance->getNumRows();\n\t}", "public function count()\n {\n $db = $this->dbConnect();\n $req = $db->query('SELECT COUNT(*) AS nbRows FROM regions');\n $result = $req->fetch();\n\n return $totalNbRows = $result['nbRows'];\n }", "public function getNbResults(): int\n {\n return $this->adapter->getTotalHits();\n }", "public function size()\n {\n return $this->map->size();\n }", "public function countTriples()\n {\n $count = 0;\n foreach ($this->index as $resource) {\n foreach ($resource as $values) {\n $count += count($values);\n }\n }\n return $count;\n }", "public function getNumTotalQueryResults() : int{\n return $this->numTotalQueryResults;\n }", "public function getNumberOfIndexedDocuments()\n {\n $index = $this->service->getIndex();\n $status = $index->getStatus()->getData();\n\n $numberDocsInIndex = -1; // flag value for not yet indexed\n if (isset($status['indices']['elastica_ss_module_test_en_us']['docs'])) {\n $numberDocsInIndex = $status['indices']['elastica_ss_module_test_en_us']['docs']['num_docs'];\n }\n\n $this->assertGreaterThan(-1, $numberDocsInIndex);\n\n return $numberDocsInIndex;\n }", "public function count(): int\n {\n if ($this->numberOfResults === null) {\n $this->initialize();\n if ($this->queryResult !== null) {\n $this->numberOfResults = count($this->queryResult ?? []);\n } else {\n parent::count();\n }\n }\n\n return $this->numberOfResults;\n }", "function CountDevicesInRack($site) {\tglobal $devices, $racks;\n\n\t$rack = array();\n\t$max = 0;\n\t\n\tforeach($devices as $device_name => $installed_rack) {\n\t\tif ($racks[$installed_rack] == $site) {\n\t\t\tif (isset($rack[$installed_rack])) {\n\t\t\t\t$rack[$installed_rack]++;\n\t\t\t} \n\t\t\telse {\n\t\t\t\t$rack[$installed_rack]=1;\n\t\t\t}\n\t\t\tif ($rack[$installed_rack] > $max) {\n\t\t\t\t$max = $rack[$installed_rack];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $max;\n}", "public function CountRow()\n\t{\n\treturn HDB::hus()->Hcount(\"mtrbundle\");\n\t}", "public function getNumFound()\n {\n return $this->numberOfFoundDocuments;\n }", "public function get_sections_count()\n\t{\n\t\t$sections = $this->get_sections();\n\t\treturn count($sections);\n\t}", "public function count (): int {\n return count($this->clients);\n }", "public function getMappingCount()\n {\n return $this->count(self::mapping);\n }", "public function size()\n\t{\n\t\t$this->init();\n\t\treturn shmop_size($this->shmId);\n\t}", "function NumRows() {}", "public function getNumber_hits()\n {\n return $this->number_hits;\n }", "public function count() {\n\t\treturn $this->sets[':default']->count();\n\t}", "public function getNbResults()\n {\n $this->sphinxQL->execute();\n\n $helper = Helper::create($this->sphinxQL->getConnection());\n $meta = $helper->showMeta()->execute()->fetchAllAssoc();\n\n foreach ($meta as $item) {\n if ('total_found' === $item['Variable_name']) {\n return (int) $item['Value'];\n }\n }\n\n return 0;\n }", "public function getQueryCount()\n {\n return $this->query_count;\n }", "function solr_total_count($doctype=1)\n\t{\n\t\t$query = $this->solr_client->createSelect();\n\t\t$query->setQuery('doctype:'.$doctype);\n\t\t$query->createFilterQuery('published')->setQuery('published:1');\n\t\t$query->setStart(0)->setRows(0);\n\t\t$resultset = $this->solr_client->select($query);\n\t\treturn $resultset->getNumFound();\n\t}", "public function getHostNumberOfEntries()\n {\n $result = $this->client->GetHostNumberOfEntries();\n if ($this->errorHandling($result, 'Could not get number of host entries from FRITZ!Box')) {\n return;\n }\n\n return $result;\n }", "public function count($filters = array()) {\n\n return 1000;\n }", "public function getQueryCount()\n\t{\n\t\treturn $this->query_count;\n\t}", "public function count(): int\n\t{\n\t\treturn count($this->all());\n\t}", "public function getNumberOfStudents()\n {\n return count($this->students);\n }", "public function totalParts() {\n return sizeof($this->all());\n }", "public function count() {\r\n\r\n return $this->total_size;\r\n\r\n }", "public function count(): int\n {\n $query = $this->database->table('instances');\n\n if (func_num_args() > 0) {\n $query = $query->where(...func_get_args());\n }\n\n return $query->count();\n }", "public function numberOfRecords(): int\n {\n return $this->number_of_records;\n }", "function RowCount() {}", "public function count(): int\n {\n return count($this->storage);\n }", "public function count()\n {\n return $this->size();\n }", "public function count()\n {\n return $this->queryResult->getSize();\n }", "public function countAllDevices()\n\t{\n\t\t $criteria = new CDbCriteria();\n\t\t $criteria->select = '*';\n\t\t $devices = Devices::model()->findAll($criteria);\n\t\t return count($devices);\n\t}", "function countHit() {\n\n $this->saveField('hits', $this->data['Ringsite']['hits']+1, false);\n }", "function getAllNumNodes(){\n\t\t$clase=$this->nmclass;\n\t\t$u=$this->cant_nodos;\n\t\treturn $u;\n\t}", "public function getNbPages(): int;", "public function count()\n\t{\n\t\treturn count($this->getListByKey());\n\t}", "public function getTotalNumberOfResults();", "public function count(): int\n {\n return $this->makeQuery()->count();\n }" ]
[ "0.8122551", "0.7752701", "0.74254733", "0.68059826", "0.6616719", "0.62265486", "0.5774065", "0.5426894", "0.52257705", "0.5158809", "0.5129874", "0.5097663", "0.5049716", "0.4996997", "0.4971291", "0.49697027", "0.49375162", "0.48663527", "0.4839452", "0.48257554", "0.4821564", "0.48077273", "0.47957072", "0.47810072", "0.47803375", "0.4772789", "0.4769592", "0.4764318", "0.47538754", "0.47448137", "0.47430593", "0.47344276", "0.47263137", "0.47261122", "0.47213265", "0.47086763", "0.47058487", "0.46978593", "0.4692386", "0.4692386", "0.46859938", "0.46824723", "0.46793106", "0.46793106", "0.46793106", "0.46553662", "0.46548906", "0.4651003", "0.4650176", "0.4648364", "0.4647266", "0.4632652", "0.4624228", "0.459985", "0.4599314", "0.45991963", "0.45974568", "0.45912698", "0.45875236", "0.45868438", "0.458132", "0.45807615", "0.4571918", "0.4569368", "0.4567031", "0.4554236", "0.45521298", "0.45479962", "0.45471883", "0.4545076", "0.45428583", "0.4542594", "0.4539072", "0.45378816", "0.45332405", "0.45290458", "0.4525646", "0.4521579", "0.45114982", "0.4501633", "0.44993755", "0.44991824", "0.44969645", "0.44891736", "0.44876194", "0.44871593", "0.4481547", "0.4479426", "0.44790766", "0.4476092", "0.44760373", "0.44709146", "0.4470197", "0.44684502", "0.44657668", "0.4457853", "0.4457142", "0.444799", "0.44477427", "0.44464383" ]
0.73112917
3
Funcion que devuelve la pagina a cargar dependiendo del id del perfil del usuario. Por defecto, va a la pagina de login.
function getOnLoad($id){ $datos=new Dsession(); $onload="/restbar/view.php?page=comidaRest"; $rs=$datos->getOnLoad($id); if ($rs->getRecordCount()>0){ $rs->next(); $onload=$rs->getString('onload'); } return $onload; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Cuenta_perfil($id='')\n {\n if ($this->session->userdata('login')) {\n $id_user = $this->session->userdata('id');\n $userName = $this->session->userdata('userName');\n $correo = $this->session->userdata('email');\n $nivel = $this->session->userdata('nivel');\n $img = $this->session->userdata('img');\n $dataUser = array('nombre' => $userName, 'correo' => $correo, 'nivel' => $nivel, 'img' => $img);\n\n\n $this->load->model('Perfil_model');\n $fila = $this->Perfil_model->getPerfilCuenta($id);\n\n $dataPerfil = array('consulta' => $fila, 'id_user' => $id_user);\n\n $data = array('title' => 'Perfil de ' . $fila->user );\n\n $this->load->view(\"header/Header\", $data);\n $this->load->view(\"nav/Nav\", $dataUser);\n $this->load->view(\"perfil/Perfil\",$dataPerfil);\n //------------------------------------\n $this->load->view(\"footer/Footer\");\n\n\n\n\n }else {\n $data = array('title' => 'Login');\n $this->load->view(\"login/Login\" , $data);\n }\n }", "function loadPerfil(){\n\t\t$r = $this->dper->getPerfilById($this->id);\n\t\tif($r != -1){\n\t\t\t$this->nombre = $r[\"nombre\"];\n\t\t}else{\n\t\t\t$this->nombre = \"\";\n\t\t}\n\t}", "public function perfil() {\n require_once 'views/usuarios/perfil.php';\n }", "function login_user($user,$pass,$activo=false,$h=false){\n $c = ($h)?$pass:md5($pass);\n $sql = sprintf(\"SELECT * FROM `login` WHERE `email` = %s AND `contrasena` = %s AND `cloud` = %s LIMIT 1\",\n varSQL($user),\n varSQL($c),\n varSQL(__sistema));\n $datos = consulta($sql,true);\n if($datos != false){\n $_SESSION['usuario'] = $datos['resultado'][0]['id'];\n $_SESSION['session_key']= md5($pass);\n //obtener los datos adicionales del usuario en cuestion de acuerdo al perfil de usuario que pertenesca\n $sql = sprintf(\"SELECT * FROM `%s` WHERE `id_login` = %s\",(obtener_campo(sprintf(\"SELECT `tabla` FROM `usuarios_perfiles_link` WHERE `id_perfil` = %s\",varSQL($datos['resultado'][0]['perfil'])))),varSQL($datos['resultado'][0]['id']));\n $datos1 = consulta($sql,true);\n if($datos1!=false){\n unset($datos1['resultado'][0]['id']);\n $d = array_merge($datos['resultado'][0],$datos1['resultado'][0]);\n $_SESSION['data_login'] = $d;\n }else{\n $_SESSION['data_login'] = $datos['resultado'][0];\n }\n //obteniendo los detalles de los modulos disponibles para cada usuario\n $con = sprintf(\"SELECT * FROM `componentes_instalados` WHERE `id` IN(SELECT `id_componente` FROM `usuarios_perfiles_permisos` WHERE `id_perfil` = %s)\",varSQL($datos['resultado'][0]['perfil']));\n $r = consulta($con,true);\n //detalles del perfil\n $p = consulta(sprintf(\"SELECT `nombre`,`p` FROM `usuarios_perfiles` WHERE `id` = %s\",varSQL($datos['resultado'][0]['perfil'])),true);\n $_SESSION['usuario_perfil'] = $p['resultado'][0];\n $_SESSION['usuario_componentes'] = $r['resultado'];\n $detalles = array(\"estado\"=>\"ok\",\"detalles\"=>\"\");\n }else{\n $_SESSION['usuario']='';\n $_SESSION['session_key']='';\n $detalles = array(\"estado\"=>\"error\",\"detalles\"=>\"no_log_data\",\"mensaje\"=>\"Nombre de usuario o contrase&ntilde;a incorrecta\");\n }\n return $detalles;\n}", "private function iniciar_perfil(){\n\t\t// if(!isset($_SESSION['id_user'])){\n\t\t// \theader('location : index.php');\n\t\t// }\n\n\t\trequire_once 'inc/clases/procesos/fechas.class.php';\n\t\trequire_once 'inc/clases/perfil/usuarios.class.php';\t\t\t//clase usuarios\n\t\t$this->Modulos = new Modulos();\t\n\t\t$this->Usuario = new Usuarios();\t\t\t\n\t}", "public function profilUser() \n {\n require_once('Models/userMdl.php');\n //juste pour le test nous mettons \n $id = 1;\n $data = userMdl::profilUser($id);\n \n require_once(\"./Views/profilView.php\");\n }", "public function showPerfil(){\n\n $idUsuario = Auth::id();\n $OTasignadas=ot_orden_trabajo::where('OT_USER_ENCARGADO',$idUsuario)->paginate(5);\n $OTcreadas=ot_orden_trabajo::where('OT_USER_ID_CREADOR',$idUsuario)->paginate(5);\n // $buscarReporte=rep_reporte::where('REP_USER_ID', $idUsuario)->get();\n // $imagenes=ft_fotos::all();\n $fotoPerfil=user::where('id',$idUsuario)->get();\n // dd($fotoPerfil);\n // $ordenDeTrabajo = DB::table('OT_ORDEN_TRABAJO')->get();\n\n return view('PERFIL.inicioPerfil', compact('OTasignadas','OTcreadas','fotoPerfil' ));\n }", "function perfil (){\n \t $dato=$_SESSION['Usuarios'];\n\t\t $datos = Usuario::mostrar($dato);\n \t require \"app/Views/Perfil.php\";\n }", "public function perfil($id)\n {\n $empresa = User::findOrFail($id);\n return view('asesor.empresa.perfil',compact('empresa'));\n }", "function verPerfilUsuario($id)\n {\n $this->db->select(\"idUsuario,upper(concat(nombres,' ',apellidos)) nombre, curriculum,fechaNacimiento,genero,estadoCivil,email,pais,departamento,ciudad,direccion,foto,skype,estado\");\n $this->db->from(\"usuario\");\n $this->db->where(\"idUsuario\",$id);\n $data[\"datosUsuario\"]=$this->db->get()->result()[0];\n $dataNav[\"mensajesPendientes\"]=$this->MMensajes->obtenerMensajesEmpresa();\n $dataNav[\"usuarioSinVer\"]=$this->MMensajes->obtenerusuariosSinVer();\n $this->load->view('home/header');\n $this->load->view('home/asidenav',$dataNav);\n $this->load->view(\"empresa/verPerfilUsuario-Admin\", $data);\n $this->load->view('home/footer');\n }", "public function profil()\n {\n\n $pseudo = $_SESSION['user_profil']['pseudo'];\n $datas = $this->userManager->getUserInformation($pseudo);\n $data_page = [\n \"page_description\" => \"Page de profil\",\n \"page_title\" => \"Page de profil\",\n \"userInfo\" => $datas,\n \"view\" => \"views/users/profil.view.php\",\n \"template\" => \"views/common/template.php\"\n ];\n $this->generatePage($data_page);\n }", "public function get_usuario_por_id($id_usuario){\r\n $conectar=parent::conexion();// hacemos nuestra conexion\r\n parent::set_names(); // este es para no tener probllemas con las tilde \r\n $sql=\"select * from usuario where id =?\";\r\n $sql=$conectar->prepare($sql); //HACE UNA CONSULTA EN TODOS LOS CAMPOS\r\n $sql->bindValue(1,$id_usuario);\r\n $sql->execute();\r\n return $resultado=$sql->fetchAll(PDO::FETCH_ASSOC);\r\n }", "public function lista2() { // Aqui define o ação: /users/lista\n $usuarios = new Users(); // Aqui carrega o model: Users\n $dados['usuarios'] = $usuarios->getUsuarios();\t\n if(isset($_GET['id']) && !empty($_GET['id'])) {\t\n $this->loadTemplate('usuario', $dados);\n }\n }", "function perfilProducto($id)\n\t{\n\t\tif (isset($this->session->userdata['logged_in'])) {//Ingresa solo si el usuario inició sesion\n\t\t\t$data['seccion'] = $this->session->userdata['logged_in'];\n\t\t\t$data['calificaciones'] = $this->Comprador_model->get_calificacion_producto_usuarioId($id, $this->session->userdata['logged_in']['users_id']);\n\t\t} else {\n\t\t\t$data['seccion'] = false;\n\t\t}\n\t\t$data['producto_id'] = $id;\n\t\t$data['producto'] = $this->Comprador_model->get_producto_id($id);\n\t\t$data['calificaciones_table'] = $this->Comprador_model->get_calificaciones_productos($id);\n\t\t$data['galeria'] = $this->Comprador_model->get_galerias($id);\n\t\t$data['calificacion'] = $this->calificacionProducto($id);\n\t\t$data['message_display'] = $this->mensaje;\n\t\t$data['error_message'] = $this->error;\n\t\t$data['_view'] = 'comprador/perfilProducto';\n\t\t$this->load->view('layouts/main', $data);\n\t}", "public function UsuariosPorId()\n{\n\tself::SetNames();\n\t$sql = \" select * from usuarios where codigo = ? \";\n\t$stmt = $this->dbh->prepare($sql);\n\t$stmt->execute( array(base64_decode($_GET[\"codigo\"])) );\n\t$num = $stmt->rowCount();\n\tif($num==0)\n\t{\n\t\techo \"\";\n\t}\n\telse\n\t{\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$this->p[] = $row;\n\t\t\t}\n\t\t\treturn $this->p;\n\t\t\t$this->dbh=null;\n\t\t}\n\t}", "public function get_usuario_por_id($id_usuario)\n\t{\n\t\ttry\n\t\t{\n\t\t\t$sql = \"SELECT * FROM usuarios \n\t\t\t\t\tWHERE id_usuario = :id_usuario\";\n\n\t\t\t$resultado = $this->db->prepare($sql);\n\t\t\t$resultado->bindValue(\":id_usuario\", $id_usuario);\n\n\t\t\t// Failed query\n\t\t\tif(!$resultado->execute())\n\t\t\t{\n\t\t\t\theader(\"Location:index.php?usuarios&m=1\");\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// if user exists then we need to return data\n\t\t\t\tif($resultado->rowCount() > 0)\n\t\t\t\t{\n\t\t\t\t\twhile($reg = $resultado->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->usuario_por_id[] = $reg;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn $this->usuario_por_id;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Else: return m : error message to file usuarios.php\n\t\t\t\t\theader(\"Location:index.php?usuarios&m=2\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\tthrow $e;\n\t\t}\n\t}", "function constroe_seguidor_usuario($dados, $modo){\n\n// separa dados\n$idusuario = $dados['idusuario'];\n$idamigo = $dados['idamigo'];\n$data = $dados['data'];\n\n// valida idamigo\nif($idusuario == null or $idamigo == null){\n\n// retorno nulo\nreturn null;\n\n};\n\n// valida modo\nif($modo == 2){\n\n$idamigo = $idusuario;\n\n};\n\n// url de perfil de usuario\n$url_perfil_usuario = retorne_url_perfil_usuario($idamigo);\n\n// imagem de usuario\n$imagem_usuario = constroe_imagem_perfil($idamigo, false);\n\n// nome do usuario\n$nome_usuario = retorne_nome_usuario($idamigo);\n$nome_usuario = \"<a href='$url_perfil_usuario' title='$nome_usuario'>$nome_usuario</a>\";\n\n// campo seguir\n$campo_seguir = campo_seguir_usuario($idamigo);\n\n// codigo html\n$codigo_html = \"\n<div class='classe_div_seguidor_usuario'>\n\n<div class='classe_div_seguidor_usuario_imagem'>\n$imagem_usuario\n</div>\n\n<div class='classe_div_seguidor_usuario_nome'>\n$nome_usuario\n</div>\n\n<div class='classe_div_seguidor_usuario_botao'>\n$campo_seguir\n</div>\n\n</div>\n\";\n\n// retorno\nreturn $codigo_html;\n\n}", "function show($id){\n\n\t\trequire('config.inc');\n\t\t$conexion = new mysqli($servidor,$usuario,$pass,$bd);\n\t\tif($conexion -> connect_errno){\n\t\t\techo \"Hubo un error\";\n\t\t\techo \"<br>$conexion->connect_errno\";\n\t\t}\n\n\t\t$consulta = \"SELECT *\n\t\t\t\t FROM usuario \n\t\t\t\t WHERE idUsuario = '\".$id.\"'\";\n\t\t//Ejecuto el QUERY para datos de usuario\n\t\t$resultado = $conexion->query($consulta);\n\t\t$resultado = $resultado->fetch_row();\n\t\t\n\n\t\tif($resultado!= NULL){\n\t\t\t$this->nombre = $resultado[3].\" \".$resultado[4];\n\t\t\t$this->imgPerfil = $resultado[9];\t\t\n\t\t\t$this->descripcion = $resultado[7];\n\t\t\t$this->idDestacado = $resultado[10];\n\t\t\t\n\n\t\t\t//Ejecuto el QUERY para libro destacado de usuario\n\t\t\t$consultadestacado = \"SELECT titulo , imagen_portada, idLibros\n\t\t\t\t\t FROM libros \n\t\t\t\t\t WHERE idLibros = '\".$this->idDestacado.\"'\";\n\t\t\t\t\t\n\t\t\t$resultadoD = $conexion->query($consultadestacado);\n\t\t\t$resultadoD = $resultadoD->fetch_row();\n\n\t\t\tif($resultadoD!=NULL){\n\t\t\t\t//var_dump($resultadoD);\n\t\t\t\t\t$this->librodestacado = $resultadoD[0];\n\t\t\t\t\t$this->imgLdestacado = $resultadoD[1];\n\t\t\t\t\t$this->idDestacado = $resultadoD[2];\n\n\n\t\t\t\t\t//Ejecuto el QUERY para Librero\n\t\t\t\t\t$consultalibrero = \"SELECT L.titulo , L.imagen_portada , UHL.status , L.idLibros\n\t\t\t\t\t\t\t\t\t\tFROM usuario_has_libros UHL \n\t\t\t\t\t\t\t\t\t\tJOIN libros L on L.idLibros = UHL.idLibros\n\t\t\t\t\t\t\t\t\t\tWHERE UHL.idUsuario = \\\"$id\\\" \";\n\n\t\t\t\t\t$resultadoL = $conexion->query($consultalibrero);\n\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\tif($resultadoL!=NULL){\n\t\t\t\t\t\twhile($fila=$resultadoL->fetch_assoc()){\n\t\t\t\t\t\t//var_dump($fila);\n\t\t\t\t\t\t$this->titulos[] = $fila[\"titulo\"];\n\t\t\t\t\t\t$this->portadas[] = $fila[\"imagen_portada\"];\n\t\t\t\t\t\t$this->estado[] = $fila[\"status\"];\n\t\t\t\t\t\t$this->id[] = $fila[\"idLibros\"];\n\t\t\t\t\t}\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\n\t\t$conexion->close();\n\t\t\n\t}", "public function MyProfil() {\n // without an id we just redirect to the error page as we need the post id to find it in the database\n if (!isset($_COOKIE['login']))\n return call('pages', 'error404');\n\n // we use the given id to get the right post\n $schools = School::findProfil($_COOKIE['login']);\n require_once('views/school/show.php');\n }", "public function getUsuarios(){\n\t\t$filasPagina = 7;//registros mostrados por página\n\n\t\tif(isset($_GET['pagina'])){//si le pasamos el valor \"pagina\" de la url (si el usuario da click en la paginación)\n\t\t\t\tif($_GET['pagina']==1){\n\t\t\t\t$pagina=1; \n\t\t\t\theader(\"Location: principal.php?c=controlador&a=muestraUsuarios\");\n\t\t\t\t}else{\n\t\t\t\t\t$pagina=$_GET['pagina'];//índice que indica página actual\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$pagina=1;//índice que indica página actual\n\t\t\t}\n\n\t\t\t$empezarDesde = ($pagina-1) * $filasPagina;\n\n\t\t\t$sql = \" SELECT * FROM usuarios \";\n\n\t\t\t$resultado = $this->db->query($sql);\n\n\t\t\t$resultado->execute(array());\n\n\t\t\t$numFilas = $resultado->rowCount();//número de registos totales de la consulta\n\n\t\t\t//ceil — Redondear fracciones hacia arriba\n\t\t\t$totalPaginas = ceil($numFilas / $filasPagina);//calcula cuántas páginas serán en total para mostrar todos los registros\n\n\t\t\t$resultado->closeCursor();\n\n\t\t//------------------------- Consulta para mostrar los resultados ---------------------------\n\n\t\t\t$sql_limite = \" SELECT * FROM usuarios LIMIT $empezarDesde , $filasPagina \";\n\n\t\t\t$resultado = $this->db->query($sql_limite);//ejecutando la consulta con la conexión establecida\n\n\t\t\twhile($row = $resultado->fetch(PDO::FETCH_ASSOC)){\n\t\t\t\t$this->objeto[] = $row;//llenando array con valores de la consulta\n\t\t\t}\n\n\t\treturn $this->objeto;\n\t}", "public function cargarImagen() {\n\n $id = $_REQUEST[\"id\"];\n\n echo $this->usuario->getCampo($id,'imagen');\n\n }", "public function show($id)\n {\n $user=User::findOrFail($id);\n \n if($user->rol_id=='3'){ \n return \\view('plantilla.contenido.perfil.perfilEmpleado',compact('user'));\n }\n \n if($user->rol_id=='2'){ \n $tienda=Tienda::with('imagen')->with('tiendaCuentaBancaria')->findOrFail($user->tienda->id);\n \n return \\view('plantilla.contenido.tienda.perfil.perfilTienda',compact('tienda'),compact('user'));\n }\n\n\n }", "public function mostrarUsuarios($pag) {\n $this->cantidadMostrar = 10;\n $this->pagina = $pag;\n $this->cantidadTotalRegistros = $this->con->query(\"SELECT * FROM usuarios\");\n $this->redondeoFinal = ceil($this->cantidadTotalRegistros->num_rows/$this->cantidadMostrar);\n \n $this->consultaMostrar = \"SELECT * FROM usuarios ORDER BY idUsuario DESC LIMIT \".(($this->pagina-1)*$this->cantidadMostrar).\",\".$this->cantidadMostrar;\n $this->consulta= $this->con->query($this->consultaMostrar);\n \n //$this->consulta=$this->con->query(\"SELECT * FROM usuarios ORDER BY apellido ASC, nombre ASC\");\n $this->i=1;\n while($this->datos= $this->consulta->fetch_array()) {\n ?>\n <tr>\n <td>\n <b><?php echo $this->i;?></b>\n <img src=\"fotos/<?php echo $this->datos['idUsuario'];?>\" width=\"50px\"> \n </td>\n <td><?php echo $this->datos['apellido'].\", \".$this->datos['nombre'];?></td>\n <td><?php echo $this->datos['usuario'];?></td>\n <td><?php echo $this->datos['dni'];?></td>\n <td><?php echo $this->datos['edad'];?></td>\n <td><?php echo $this->datos['domicilio'].\", \".$this->datos['localidad'].\", \".$this->datos['provincia'].\", \".$this->datos['nacionalidad'];?></td>\n <td><?php echo $this->datos['telefono'];?></td>\n <td><?php echo $this->datos['email'];?></td>\n <td><?php echo $this->datos['sexo'];?></td>\n <td><?php echo $this->datos['privilegio'];?></td>\n <td>\n <div class=\"row\">\n <a class=\"btn btn-success btn-sm\" href=\"formmodificar.php?idUsuario=<?php echo $this->datos['idUsuario'];?>\"><i class=\"material-icons\">create</i></a>\n <a class=\"btn btn-danger btn-sm\" onclick=\"return confirm('¿Desea eliminar este registro?')\" href=\"formeliminar.php?idUsuario=<?php echo $this->datos['idUsuario'];?>\"><i class=\"material-icons\">delete</i></a>\n </div>\n </td>\n </tr> \n <?php \n $this->i++; \n \n }\n ?>\n <tr>\n <td colspan=\"12\" class=\"text-center\">\n <nav>\n <ul class=\"pagination\">\n <li <?php if($this->pagina==1) {echo \"class='disabled'\";} ?> ><a href=\"index.php?pagina=1\"><i class=\"material-icons\">chevron_left</i></a></li>\n <?php \n for($this->j=1; $this->j<= $this->redondeoFinal; $this->j++) {\n ?>\n <li <?php if($this->pagina== $this->j){echo \"class='active'\";} ?>>\n <a class=\"waves-effect\" href=\"index.php?pagina=<?php echo $this->j; ?>\"><?php echo $this->j; ?></a>\n </li>\n <?php\n } \n ?>\n <li <?php if($this->pagina==($this->j-1)) {echo \"class='disabled'\";} ?> >\n <a href=\"index.php?<?php echo $this->j-1 ;?>\"><i class=\"material-icons\">chevron_right</i></a>\n </li> \n </ul>\n </nav>\n </td>\n </tr> \n <?php \n $this->con->close();\n }", "public function perfil($id = '')\r\n\t{\r\n\t\t//Perfil del proveedor\r\n\r\n\t\t//Carga de BD de datos del proveedor\r\n\t\t$this->proveedor = (New Proveedor)->find($id); //Crear el acceso a ->perfil($id)\r\n\t\t$this->comunas = (New Comunas)->find_all_by_proveedor_id($id);\r\n\t\t$this->ventas = (New Ventas)->find_by_proveedor_id($id);\r\n\t\tif($id == null){\r\n\t\t\t//Si la identidad es nula entonces redireccionar al Login\r\n\t\t\tRedirect::to('proveedor/entrar');\r\n\t\t}\r\n\r\n\t}", "function idperfil($nombre){\n //busca en la tabla usuarios los campos donde el alias sea igual a lo que recibe del controlaor si no encuentra nada devuelve null\n $usuario = R::findOne('usuarios', 'alias=?', [\n $nombre\n ]);\n //guardo en una sesion la variable usuario y se retorna esa variable al controlador Usuarios.php linea 169 dentro de la carpeta usuario\n $_SESSION['idusuario']=$usuario->id;\n return $usuario;\n }", "public function profil(){\n $where = $this->session->userdata('id_user');\n $data['user'] = $this->db->get_where('tb_user',$where);\n \n $this->load->view('admintemplates/header');\n $this->load->view('admintemplates/sidebar');\n $this->load->view('admin/profil',$data);\n $this->load->view('admintemplates/footer');\n }", "function mostrarDatos(){\n\t\t$dato=$_GET['no'];\n\t\t$datos = Usuario::mostrarEditar($dato);\n\t\trequire 'app/Views/editarPerfil.php';\n\t}", "public function accionPerfilRestaurante(){\n // (si es que hay alguno logueado)\n $sw = false;\n $codRole = 0;\n \n if(Sistema::app()->Acceso()->hayUsuario()){\n $sw = true;\n \n $nick = Sistema::app()->Acceso()->getNick();\n $codRole = Sistema::app()->ACL()->getUsuarioRole($nick);\n \n }\n \n // Si el usuario que intenta acceder es un artista, administrador\n // o simplemente no hay usuario validado, lo mando a una página de\n // error. Los restaurantes tienen el rol 6\n if(!$sw || $codRole != 6){\n Sistema::app()->paginaError(403, \"No tiene permiso para acceder a esta página.\");\n exit();\n }\n \n // Una vez comprobado que está accediendo un restaurante, procedo a\n // obtener los datos del restaurante\n $res = new Restaurantes();\n \n // El nick del usuario es el correo electrónico. Es un valor\n // único, por lo que puedo buscar el restaurante por\n // su dirección de correo\n if(!$res->buscarPor([\"where\"=>\"correo='$nick'\"])){\n \n Sistema::app()->paginaError(300,\"Ha habido un problema al encontrar tu perfil.\");\n return;\n \n }\n \n $imagenAntigua = $res->imagen;\n $nombre=$res->getNombre();\n \n // Si se modifican los datos del restaurante, esta variable\n // pasará a true para notificar a la vista\n $resModificado = false;\n if (isset($_POST[$nombre]))\n {\n $hayImagen = true;\n // Si ha subido una nueva imagen, recojo su nombre\n if($_FILES[$nombre][\"name\"][\"imagen\"]!=\"\"){\n $_POST[$nombre][\"imagen\"] = $_FILES[$nombre][\"name\"][\"imagen\"];\n }\n else{\n $hayImagen = false;\n $_POST[\"nombre\"][\"imagen\"] = $res->imagen;\n }\n \n // El coreo es una clave foránea, así que tengo\n // que cambiar el correo en la tabla ACLUsuarios\n Sistema::app()->ACL()->setNick($nick, $_POST[\"nombre\"][\"correo\"]);\n \n $res->setValores($_POST[$nombre]);\n \n if ($res->validar())\n {\n // Si se ha guardado correctamente, actualizo la imagen de perfil\n // e inicio sesión con el nuevo correo automáticamente\n if ($res->guardar()){\n $resModificado = true;\n if($hayImagen){\n // Obtengo la carpeta destino de la imagen\n $carpetaDestino = $_SERVER['DOCUMENT_ROOT'].\"/imagenes/restaurantes/\";\n // Elimino la imagen antigua\n unlink($carpetaDestino.$imagenAntigua);\n \n // Y guardo la nueva\n move_uploaded_file($_FILES['nombre']['tmp_name']['imagen'], $carpetaDestino.$_POST[\"nombre\"][\"imagen\"]);\n }\n Sistema::app()->Acceso()->registrarUsuario(\n $_POST[\"nombre\"][\"correo\"],\n mb_strtolower($res->nombre),\n 0,\n 0,\n [0,0,0,0,0,1,1,1,1,1]);\n }\n \n }\n }\n \n $this->dibujaVista(\"perfilRestaurante\",\n [\"res\"=>$res, \"resModificado\"=>$resModificado],\n \"Perfil\");\n \n }", "public function get_rol_usuario(){\n\t\t$rol_user=$_SESSION[\"sesion_perfil\"];\n\t\t$sql=mysqli_query(Conecta::conx(),\"SELECT PERFIL FROM perfiles WHERE ID_PERFIL='$rol_user'\") or die('Error en la consulta del perfil de usuario:' . $sql . mysqli_errno(Conecta::conx()));\n\t\tif($reg=mysqli_fetch_assoc($sql)){\n\t\t\t$this->perfil[]=$reg;\n\t\t}\n\t\treturn $this->perfil;\n\t\t\n\t}", "public function editar_perfil()\n\t{\n\t\t//Se valida la existencia de los datos del usuario que inicio sesion dentro de la session\n\t\tif($this->session->userdata('id_usuario_prueba') != null){\n\t\t\t$data = [\n\t\t\t\t\"page\" => \"Perfil\"\n\t\t\t];\n\t\t\t$this->load->view('layout/layout_open');\n\t\t\t$this->load->view('layout/layout_menu', $data);\n\t\t\t$this->load->view('usuarios/editar_perfil');\n\t\t\t$this->load->view('layout/layout_close');\n\t\t}else{\n\t\t\theader(\"Location:\" . base_url());\n\t\t}\n\t}", "public static function paginado_usuario(){\n\t\t $page = 1; //inicializamos la variable $page a 1 por default\n\t\t if(array_key_exists('pg', $_GET)){\n\t\t $page = $_GET['pg']; //si el valor pg existe en nuestra url, significa que estamos en una pagina en especifico.\n\t\t }\n\t\t //ahora que tenemos en que pagina estamos obtengamos los resultados:\n\t\t // a) el numero de registros en la tabla\n\t\t $mysqli = new mysqli(\"localhost\",\"root\",\"slam2018\",\"corgran\");\n\t\t if ($mysqli->connect_errno) {\n\t\t\t\tprintf(\"Connect failed: %s\\n\", $mysqli->connect_error);\n\t\t\t\texit();\n\t\t\t}\n\n\n\t\t $conteo_query = $mysqli->query(\"SELECT COUNT(*) as conteo FROM usuarios\");\n\t\t $conteo = \"\";\n\t\t if($conteo_query){\n\t\t \twhile($obj = $conteo_query->fetch_object()){ \n\t\t \t \t$conteo =$obj->conteo; \n\t\t \t}\n\t\t }\n\t\t $conteo_query->close(); \n\t\t unset($obj); \n \t\t\n\t\t //ahora dividimos el conteo por el numero de registros que queremos por pagina.\n\t\t $max_num_paginas = intval($conteo/10); //en esto caso 10\n\t\t\t\n\t\t // ahora obtenemos el segmento paginado que corresponde a esta pagina\n\t\t $segmento = $mysqli->query(\"SELECT * FROM usuarios LIMIT \".(($page-1)*10).\", 10 \");\n $resultado=[];\n\t\t //ya tenemos el segmento, ahora le damos output.\n\t\t if($segmento){\n\t\t\t // echo '<table>';\n\t\t\t while($obj2 = $segmento->fetch_object())\n\t\t\t {\n\t\t\t \t$obj_usu = new usuario($obj2->id_usuario,$obj2->tipo_usu,$obj2->nombre,$obj2->clave);\n $resultado[]=$obj_usu;\n\t\t\t /* echo '<tr>\n\t\t\t <td>'.$obj2->id_usuario.'</td>\n\t\t\t <td>'.$obj2->tipo_usu.'</td>\n\t\t\t <td>'.$obj2->nombre.'</td>\n\t\t\t </tr>'; \n\t\t\t */ }\n\t\t\t // echo '</table><br/><br/>';\n\t\t\t}\n\t\n\t\t //ahora viene la parte importante, que es el paginado\n\t\t //recordemos que $max_num_paginas fue previamente calculado.\n\t\t for($i=0; $i<$max_num_paginas;$i++){\n\n\t\t echo '<a href=\"index.php?pg='.($i+1).'\">'.($i+1).'</a> | ';\n\t\t \n\t\t } \n\t\t echo '<div>-------------------------- PAginacion------------------------------------------------</div>'; \n return $resultado; \n \n }", "public function getPerfilById($id)\r\n\t{\r\n \t$sql = new Sql($this->dbAdapter);\r\n\t\t$select = $sql->select();\r\n\t\t$select->from('users');\r\n\t\t$select->columns(array('id','email','password'));\r\n\t\r\n\t\t$select->join(array('i_u'=>'users_details'),'users.id = i_u.id_user',array('id_user','name','surname', 'campus', 'phone', 'addres','image','pin','key_inventory'), 'Left');\r\n\t\t$select->where(array('users.id' =>$id ));\r\n\r\n\t\t$selectString = $sql->getSqlStringForSqlObject($select);\r\n $execute = $this->dbAdapter->query($selectString, Adapter::QUERY_MODE_EXECUTE);\r\n $result=$execute->toArray(); \r\n\r\n\t\t//echo \"<pre>\";print_r($result);exit;\r\n\t\treturn $result;\r\n\r\n\t}", "public function buscar_Usuario2($id){\n\t\t$sql = \"select Documento, Nombres, Apellidos, Usuario, Password, Pregunta, Respuesta,\n\t\t\tTipo_Documento,Ciudad, Direccion, Edad,Foto,Telefono,Correo_Electronico,\n\t\t\tGenero,perfiles_Nombre \n\t\t\tfrom usuarios where Documento='$id'\";\n\t\t$registros = $this->bd->consultar($sql);\n\t\tif($reg=mysql_fetch_array($registros)){\n\t\t\t$this->usuario->set_Nid($reg['Documento']);\n\t\t\t$this->usuario->set_Usuario($reg['Usuario']);\n\t\t\t$this->usuario->set_Password($reg['Password']);\n\t\t\t$this->usuario->set_Nombres($reg['Nombres']);\n\t\t\t$this->usuario->set_Apellidos($reg['Apellidos']);\n\t\t\t$this->usuario->set_TipoId($reg['Tipo_Documento']);\n\t\t\t$this->usuario->set_Ciudad($reg['Ciudad']);\n\t\t\t$this->usuario->set_Direccion($reg['Direccion']);\n\t\t\t$this->usuario->set_Email($reg['Correo_Electronico']);\n\t\t\t$this->usuario->set_Pregunta($reg['Pregunta']);\n\t\t\t$this->usuario->set_Respuesta($reg['Respuesta']);\n\t\t\t$this->usuario->set_Celular($reg['Telefono']);\n\t\t\t$this->usuario->set_Edad($reg['Edad']);\n\t\t\t$this->usuario->set_Foto($reg['Foto']);\n\t\t\t$this->usuario->set_Genero($reg['Genero']);\n\t\t\t$this->usuario->set_Perfil($reg['perfiles_Nombre']);\n\n\t\t}\n\t}", "public function index()\n {\n $user = Auth::user();\n\n if(!$user == null)\n {\n\n $id_opcion = 9010;\n $idperfil = auth()->user()->id_perfil;\n $emailclien = auth()->user()->email;\n $perfiles = Opcperfil::where('id_perfil', '=', $idperfil)\n ->where('id_opcion','=', $id_opcion)->get();\n \n $operfiles = Perfil::orderBy('id_perfil')\n ->paginate(5);\n // ->get();\n return view('perfiles.t_perfiles', compact('perfiles', 'operfiles'));\n } else {\n return Redirect::to('home'); \n }\n\n }", "public function usuario($id = NULL) {\n\t\tif ($id != NULL) {\n\t\t\t// Hago consulta;\n\t\t\t$this->buscarUsuario ( $id );\n\t\t}\n\t}", "public function getUsuarioCadeco($id_usuario);", "public function getPerfil()\n {\n return User::find(Auth::user()->id);\n }", "function view($id = null) {\n\t\tglobal $usuario;\n\t\t$usuario = find('usuario', $id);\n\t}", "public function verperfil (){\n extract($_REQUEST);\n\n $db=new clasedb();//instanciando clasedb\n $conex=$db->conectar();//conectando con la base de datos\n\n \n \t$sql=\"SELECT avatar,nombre, correo, pregunta, respuesta FROM usuarios WHERE usuarios.id=\".$_SESSION['id_usuario'];;//query\n \n\t\t\t\n\n //ejecutando query\n if ($res=mysqli_query($conex,$sql)) {\n //echo \"entro\";\n $campos=mysqli_num_fields($res);//cuantos campos trae la consulta \n $filas=mysqli_num_rows($res);//cuantos registro trae la consulta\n $i=0;\n $datos[]=array();//inicializando array\n //extrayendo datos\n while($data=mysqli_fetch_array($res)){\n for ($j=0; $j <$campos ; $j++) { \n $datos[$i][$j]=$data[$j];\n }\n $i++;\n }\n \n header(\"Location: ../Vistas/config/perfil.php?filas=\".$filas.\"&campos=\".$campos.\"&data=\".serialize($datos));\n\n } else {\n echo \"Error en la BD....\";\n }\n \n}", "public function Perfil(){\n $pvd = new tutoria();\n\n //Se obtienen los datos del tutoria.\n if(isset($_REQUEST['persona_id'])){\n $pvd = $this->model->Obtener($_REQUEST['persona_id']);\n }\n\n //Llamado de las vistas.\n require_once '../Vista/Tutoria/perfil-tutoria.php';\n\t}", "public function showAction($id) {\n $this->get('session')->getFlashBag()->clear();\n\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('UsuarioBundle:Perfil')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha podido encontrar la entidad Perfil.');\n }\n\n return $this->render('UsuarioBundle:Perfil:show.html.twig', array(\n 'entity' => $entity,\n ));\n }", "function listuser(){\n\t\t\tif(!empty($_GET['paginado'])){\n\t\t\t\t$pag = $_GET['paginado'];\n\t\t\t\t$list = $this -> model -> selectuser($pag);\n\t\t\t}else{\n\t\t\t\t$list = $this -> model -> selectuser();\n\t\t\t}\n\t\t\t$this -> ajax_set($list);\n\t\t}", "public function getPerfilByUserId($id)\n {\n return Perfil::where('user_id', $id)->first();\n }", "public function listarPorId(){\n $query = \"select * from usuario where idusuario=?\";\n\n //preparando a consulta para a execução\n $stmt=$this->conn->prepare($query);\n\n //vamos fazer um blind(ligação) do id pesquisado\n //com o paramêtro da consulta, neste caso é o \n //ponto de interrogação\n $stmt ->bindParam(1,$this->idusuario);\n\n //executar efetivamente a consulta \n $stmt ->execute();\n\n //Organizar os dados retornados da consulta para \n // a exibição em formato de json\n // Vamos usar uma variavel e um array para associar \n // os campos da tabela\n $linha = $stmt->fetch(PDO::FETCH_ASSOC);\n\n //organizar no objeto usuario(aqrquivo usuario.php)\n //os dados retornados\n //da tabela usuario que está no banco de dados\n \n $this->email = $linha['email'];\n $this->senha = $linha['senha'];\n $this->nome = $linha['nome'];\n $this->cpf = $linha['cpf'];\n $this->telefone = $linha['telefone'];\n $this->foto = $linha['foto'];\n\n }", "public function get_usuario_por_id($id_usuario)\n {\n\n $conectar = parent::conexion();\n parent::set_names();\n\n $sql = \"select * from usuarios where id_usuario=?\";\n\n $sql = $conectar->prepare($sql);\n\n $sql->bindValue(1, $id_usuario);\n $sql->execute();\n\n return $resultado = $sql->fetchAll();\n }", "public function show($id)\n\t{\n\t\treturn \"Profil de l'utilisateur \" . $id;\n\t}", "public function actualizarperfil($id,$nombre,$primer_apellido,$segundo_apellido,$ano,$email,$telefono,$alias,$foto)\n {\n \n //busca en la tabla usuarios los campos donde el id sea el que le ha pasado el controlador\n $usuarios = R::load('usuarios',$id);\n \n //sobreescribe los campos\n $usuarios->nombre=$nombre;\n $usuarios->primer_apellido=$primer_apellido;\n $usuarios->segundo_apellido=$segundo_apellido;\n $usuarios-> fecha_nacimiento=$ano;\n $usuarios->email=$email;\n $usuarios->telefono=$telefono;\n $usuarios->alias=$alias;\n //si la foto exite se guarda en la base de datos se guarda el campo extension como png si la foto no exite se guarda como null\n $sustitutuirespaciosblancos = str_replace(\" \",\"_\",$alias);\n $directorio = \"assets/fotosperfil/usuario-\".$sustitutuirespaciosblancos.\".png\";\n $existefichero = is_file( $directorio );\n \n \n \n if($foto!=null){\n \n if ( $existefichero==true ){\n $extension=\"png\";\n }else{\n \n \n \n \n \n \n \n }}\n $usuarios->foto = $extension;\n // almacena los datos en la tabla usuarios de la base de datos\n R::store($usuarios);\n //rdirege al controlador Usuarios/Bienvenidos_u\n \n redirect(base_url().\"usuario/Usuarios/perfil_usuario\");\n \n \n }", "function get_usuario( $id ) {\n\t\t$condicion = array(\n\t\t\t'IdUsuario' => $id,\n\t\t);\n\t\t\n\t\t$consulta = $this->db->get_where( 'ab_usuarios', $condicion, 1 ); \n\t\t\n\t\treturn $consulta;\n\t}", "public function show($id)\n {\n\t\tif(Auth::user()->rol->permisos->contains(5))\n\t\t{\n\t\t\t$prmUsuario = Usuario::findOrFail($id);\t\t\n\t\t\treturn view('admin.usuario.show',compact('prmUsuario'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn abort(401);\n\t\t}\n }", "private function usuarios(){\n\t\tif ($_SERVER['REQUEST_METHOD'] != \"GET\") {\n\t\t\t# no se envian los usuarios, se envia un error\n\t\t\t$this->mostrarRespuesta($this->convertirJson($this->devolverError(1)), 405);\n\t\t}//es una petición GET\n\t\t//se realiza la consulta a la bd\n\t\t$query = $this->_conn->query(\n\t\t\t\"SELECT id, nombre, email \n\t\t\t FROM usuario\");\n\t\t//cantidad de usuarios\n\t\t$filas = $query->fetchAll(PDO::FETCH_ASSOC); \n \t$num = count($filas);\n \t//si devolvio un resultado, se envia al cliente\n \tif ($num > 0) { \n\t $respuesta['estado'] = 'correcto'; \n\t $respuesta['usuarios'] = $filas; \n\t $this->mostrarRespuesta($this->convertirJson($respuesta), 200); \n\t } //se envia un error \n\t $this->mostrarRespuesta($this->devolverError(2), 204);\n\t}", "function cl_db_usuariosrhlota() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"db_usuariosrhlota\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }", "public function accionPerfilArtista(){\n // (si es que hay alguno logueado)\n $sw = false;\n $codRole = 0;\n \n if(Sistema::app()->Acceso()->hayUsuario()){\n $sw = true;\n \n $nick = Sistema::app()->Acceso()->getNick();\n $codRole = Sistema::app()->ACL()->getUsuarioRole($nick);\n \n }\n \n // Si el usuario que intenta acceder es un restaurante, administrador\n // o simplemente no hay usuario validado, lo mando a una página de\n // error. Los artistas tienen el rol 5\n if(!$sw || $codRole != 5){\n Sistema::app()->paginaError(403, \"No tiene permiso para acceder a esta página.\");\n exit();\n }\n \n // Una vez comprobado que está accediendo un artista, procedo a\n // obtener los datos del artista\n $art = new Artistas();\n \n // El nick del usuario es el correo electrónico. Es un valor\n // único, por lo que puedo buscar al artista por\n // su dirección de correo\n if(!$art->buscarPor([\"where\"=>\"correo='$nick'\"])){\n \n Sistema::app()->paginaError(300,\"Ha habido un problema al encontrar tu perfil.\");\n return;\n \n }\n \n $imagenAntigua = $art->imagen;\n $nombre=$art->getNombre();\n \n // Si se modifican los datos del artista, esta variable\n // pasará a true para notificar a la vista\n $artistaModificado = false;\n if (isset($_POST[$nombre]))\n {\n $hayImagen = true;\n // Si ha subido una nueva imagen, recojo su nombre\n if($_FILES[\"nombre\"][\"name\"][\"imagen\"]!=\"\"){\n $_POST[\"nombre\"][\"imagen\"] = $_FILES[\"nombre\"][\"name\"][\"imagen\"];\n }\n else{\n $hayImagen = false;\n $_POST[\"nombre\"][\"imagen\"] = $art->imagen;\n }\n // El coreo es una clave foránea, así que tengo\n // que cambiar el correo en la tabla ACLUsuarios\n Sistema::app()->ACL()->setNick($nick, $_POST[\"nombre\"][\"correo\"]);\n \n $art->setValores($_POST[$nombre]);\n \n if ($art->validar())\n {\n // Si se ha guardado correctamente, actualizo la imagen de perfil\n // e inicio sesión con el nuevo correo automáticamente\n if ($art->guardar()){\n $artistaModificado = true;\n if($hayImagen){\n // Obtengo la carpeta destino de la imagen\n $carpetaDestino = $_SERVER['DOCUMENT_ROOT'].\"/imagenes/artistas/\";\n // Elimino la imagen antigua\n unlink($carpetaDestino.$imagenAntigua);\n \n // Y guardo la nueva\n move_uploaded_file($_FILES['nombre']['tmp_name']['imagen'], $carpetaDestino.$_POST[\"nombre\"][\"imagen\"]);\n }\n Sistema::app()->Acceso()->registrarUsuario(\n $_POST[\"nombre\"][\"correo\"],\n mb_strtolower($art->nombre),\n 0,\n 0,\n [1,1,1,1,1,0,0,0,0,0]);\n }\n \n }\n }\n \n $this->dibujaVista(\"perfilArtista\",\n [\"art\"=>$art, \"artistaModificado\"=>$artistaModificado],\n \"Perfil\");\n \n }", "public function verusuario(){\nUtils::administador(); \nif(isset($_GET['id'])){\n$id = $_GET['id'];\n$usuario = new User();\n$usuario->setId($id);\n$usuarios = $usuario->find();\n} \n\nrequire_once 'views/administrador/verusuario.php';\n}", "private function consultar_usuario_por_id() {\n\n if (is_numeric($this->referencia_a_buscar)) {\n $id_a_buscar = intval($this->referencia_a_buscar);\n $sentencia = \"select id,nombrecompleto ,correo,token from usuario u where u.id= {$id_a_buscar};\";\n $this->respuesta = $this->obj_master_select->consultar_base($sentencia);\n } else {\n $this->respuesta = null;\n }\n }", "function deletInfoUser($id){\n $deletInfUser = new \\Project\\Models\\InformationsUsersManager();\n $deletInfoUsers = $deletInfUser->deletUserInfos($id);\n\n require 'app/views/front/accueil.php';\n }", "private function obtenerPerfiles ($idUser = \"\") {\n\n if ($idUser != \"\") {\n $this->id_usuario = $idUser;\n }\n\n if (count($this->perfiles) < 1) {\n $query = $this->stringConsulta() . \" where a.id_usuario=$this->id_usuario\";\n $data = $this->bd->ejecutarQuery($query);\n\n if ($data instanceof \\Countable and count($data) > 1) {\n throw new Exception(\"No se han obtenido los perfiles del usuario\", 1);\n }\n\n while ($perfil = $this->bd->obtenerArrayAsociativo($data)) {\n $this->perfiles[$perfil['clave_perfil']] = $perfil['clave_perfil'];\n }\n\n }\n else {\n $this->perfiles[] = 'UsuarioPublico';\n }\n\n }", "function getUsuarioEmpresaById($id)\n{\n global $conn, $hashids;\n\n $id = $hashids->decrypt($id);\n $id = isset($id[0]) ? $id[0] : null;\n\n if (empty($id))\n return 'ID inválido';\n\n $sql = \"SELECT usr_nome, usr_nome_fantasia\n FROM `\".TP.\"_usuario`\n LEFT JOIN `\".TP.\"_usuario_produto`\n ON upr_usr_id=usr_id\n AND upr_status=1\n WHERE usr_status=1\n AND usr_id=?\n GROUP BY usr_id\";\n if (!$res = $conn->prepare($sql))\n echo __FUNCTION__.$conn->error;\n else {\n\n $res->bind_param('i', $id);\n $res->bind_result($nome, $nomeFantasia);\n $res->execute();\n $res->fetch();\n $res->close();\n\n return (empty($nomeFantasia) ? $nome : $nomeFantasia);\n }\n}", "public function show($id)\n {\n try {\n $user = User::where('id', $id)->where('permissao', 'P')\n ->with(['albuns' => function ($query) {\n $query->select('albums.id', 'albums.titulo', 'albums.capa as url', 'albums.descricao',\n 'albums.categoria', 'albums.user_id as artist', 'albums.user_id', 'albums.created_at');\n }])\n ->select('users.id', 'users.name', 'users.email', 'users.img_perfil', 'users.descricao')\n ->first();\n if (!empty($user)) {\n return response()->json([\"data\" => $user]);\n } else {\n return response()->json([\"error\" => true, \"message\" => \"Erro ao encontrar instrutor\"], 404);\n }\n } catch (\\Exception $exception) {\n return response()->json(['error' => true, 'message:' => $exception->getMessage()], 500);\n }\n }", "public function loadPage()\n {\n /*if(!isset(self::$user_id)) {\n self::$user_id = $_GET['user_id'];\n self::$id_wp_user = $_GET['id_wp_page'];\n self::$id_post = $_GET['id_post'];\n self::$nonce_img_upload = \"<input type='hidden' id='nonce_img_upload' name='nonce_img_upload' value='{$_GET['nonce_img_upload']}'>\n <input type='hidden' name='_wp_http_referer' value='/stomshop/'>\";\n self::$nonce_img_del = \"<input type='hidden' id='nonce_img_del' name='nonce_img_del' value='{$_GET['nonce_img_del']}'>\n <input type='hidden' name='_wp_http_referer' value='/stomshop/'>\";\n Profile_user::getUserListGods($_GET['id_wp_page']);\n self::$list = Profile_user::$page;\n self::$profile = Profile_user::getUserProfileObject($_GET['id_wp_page'])[0];\n }\n $page = $_GET['page']??0;\n $this->get_page($page = parent::$list[$page]);*/\n }", "public function perfil($id){\n $user = User::find($id);\n /*var_dump($user->name);\n die();*/\n return view('user.perfil', [\n 'user' => $user\n ]);\n }", "function getUsuario($id){\n $conex=Conexion::getInstance();\n $sql=\"SELECT * FROM usuarios where usuarios.id=$id\";\n // Especificamos el fetch mode antes de llamar a fetch()\n $stmt = $conex->dbh->prepare($sql);\n $stmt->setFetchMode(PDO::FETCH_ASSOC);\n // Excecute\n $stmt->execute();\n // solo hay uno o ninguno\n $row = $stmt->fetch();\n if (!$row) {\n $oferta=NULL;\n }\n else {\n \n $oferta=['id'=> $row['id'],'usuario'=>$row['usuario'],'nombre'=>$row['nombre'],\n 'admin'=>$row['admin'], 'password'=>$row['password']];\n }\n return $oferta;\n}", "public function get_login($data=array()){\n if(array_key_exists('username', $data)){\n $this->query = \" SELECT t1.cod_usuario,CONCAT(t1.nom_usuario,' ',t1.ape_usuario) as nom_usuario,t1.email_usuario,t1.tel_usuario,t1.tw_usuario,\n t1.fb_usuario,t1.intro_usuario,t1.linkid_usuario,t1.usuario_usuario,\n t1.cod_estado,concat('modules/sistema/adjuntos/',t1.img_usuario) as img_usuario,t2.cod_perfil,t2.des_perfil,t1.cod_proveedores\n FROM sys_usuario as t1, sys_perfil as t2\n WHERE t1.cod_perfil=t2.cod_perfil\n AND usuario_usuario = '\" .$data['username']. \"'\n AND password_usuario = '\" .md5($data['password']). \"'\";\n $this->get_results_from_query();\n }\n if(count($this->rows) == 1){\n foreach ($this->rows[0] as $propiedad=>$valor) {\n Session::set(str_replace('_usuario','',$propiedad), $valor);\n }\n if(Session::get('cod_estado') != 'AAA'){\n $this->msj = 'La sesi&oacute;n esta desactivada, consulte al administrador. ';\n $this->err = '1';\n return false;exit();\n }\n\n if( Session::get('cod_perfil')=='2'\n && Session::get('cod_perfil')=='6'\n && Session::get('cod_perfil')=='7'\n && Session::get('cod_perfil')=='8'\n && Session::get('cod_perfil')=='9'){\n $this->msj = 'El usuario no tiene permisos para accder, consulte al administrador. ';\n $this->err = '1';\n if(!Session::get('usuario'))\n redireccionar(array('modulo'=>'sistema','met'=>'cerrar'));\n\n return false;\n }\n return true;\n }else{\n $this->msj = 'Informaci&oacute;n incorrecta, revise los datos. ';\n $this->err = '0';\n return false;exit();\n }\n }", "function getById(){\n //query to read single user\n $query = \"SELECT u.id, u.username, u.password, u.estado, (CASE u.estado WHEN '1' THEN 'ACTIVO' WHEN '0' THEN 'INACTIVO' END)\n AS valor_estado, u.fecha_creacion, p.id AS id_perfil, p.nombre AS nombre_perfil FROM \". $this->table_name .\" u\n INNER JOIN perfil p ON u.id_perfil = p.id AND u.id=? LIMIT 0,1\";\n\n //prepare query statement\n $stmt = $this->conn->prepare($query);\n\n //bind id of user to be updated\n $stmt->bindParam(1, $this->id);\n\n //execute query\n $stmt->execute();\n\n //get retrieved row\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n //set values to object properties\n $this->username = $row['username'];\n $this->password = $row['password'];\n $this->estado = $row['estado'];\n $this->valor_estado = $row['valor_estado'];\n $this->fecha_creacion = $row['fecha_creacion'];\n $this->id_perfil = $row['id_perfil'];\n $this->nombre_perfil = $row['nombre_perfil'];\n }", "public function get_usuario($id_login){\n return $this->db->query(\"select * from usuarios where ID_USUARIO=$id_login\"); \n \n }", "public function modPerfil()\n\t{\n\t\t$this->Admin_Usuarios->modificarEstado($this->input->get('id'));\n\t\tredirect(base_url('index.php/Administrador/Usuarios'));\n\t}", "public function usuarios()\n {\n $usuariomaquinaria= tipoUsuario::find(1)->where('descripcion','usuariomaquinaria')->first();\n \n\n $region=Auth::user()->obtenerregion();\n \n $usuarios=User::where('user_id', Auth::user()->obtenerId())->paginate(4);\n\n if(Auth::user()->gerentemaquinaria()){\n $usuarios=User::Where('region_id', $region)\n ->Where('tipoUsuario_id', $usuariomaquinaria->id)\n ->orWhere('user_id', Auth::user()->obtenerId())\n ->paginate(4); \n }\n\n \n $pdf=new PDF();\n $pdf=PDF::loadview('admin.usuarios.informe',compact('usuarios'));\n return $pdf->stream('archivo.pdf');\n\n }", "public function Perfil(){\n $pvd = new alumno();\n\n //Se obtienen los datos del alumno.\n if(isset($_REQUEST['persona_id'])){\n $pvd = $this->model->Obtener($_REQUEST['persona_id']);\n }\n\n //Llamado de las vistas.\n require_once '../Vista/Alumno/perfil-alumno.php';\n\t}", "public function getUsuarioUni($idusuario) {\n }", "public function enlazarPagina()\n\t\t{\n\t\t\t//Se obtiene la accion por medio de paso de variable y entonces se incluye la vista segun sea la accion\n\t\t\tif(isset($_GET['action']))\n\t\t\t{\n\t\t\t\t$enlace = $_GET['action'];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$enlace = 'inicio';\n\t\t\t}\n\n\t\t\t$respuesta = Informacion::enlazador($enlace);\n\t\t\tinclude($respuesta);\n\t\t}", "public function editar($id){\r\n $usuario = User::find($id);\r\n if(count($usuario)){\r\n if($_SESSION[\"inicio\"] == true){\r\n return Vista::crear('admin.usuario.crear',array(\r\n \"usuario\"=>$usuario,\r\n ));\r\n }\r\n }\r\n return redirecciona()->to(\"usuario\");\r\n }", "public function verPagosUsuario($id){\n $local = Local_User::findorfail($id);\n\n //Validación Encargado, Premium, Bloqueado\n $locales = Local_User::where('user_id', Auth::user()->id)\n ->where('estado', '!=', 'Desvinculado')\n ->where('local_id', $local->local_id)\n ->where('rol', 'Encargado')\n ->first();\n\n if (empty($locales)) {\n session()->flash('danger', 'Usted no tiene privilegios suficientes.');\n return redirect()->action('HomeController@index');\n }elseif($locales->Local->cuenta != 'Premium'){\n session()->flash('danger', 'Opción sólo para locales premium.');\n return redirect()->action('UsuarioController@empaques', ['id' => $local->local_id]);\n }elseif($locales->Local->estado == 'Bloqueado'){\n session()->flash('danger', 'El local se encuentra temporalmente bloqueado.');\n return redirect()->action('UsuarioController@misLocales');\n }\n //fin validación\n\n\n\n $pagos = Pago::where('local_user_id', $id)->orderBy('pagoHasta', 'desc')->paginate(10);\n\n\n if($pagos->count() == 0) {\n session()->flash('danger', 'Aún no se registran pagos');\n return redirect()->route('usuario.local.empaques', ['id' => $local->local_id]);\n //return redirect()->action('UsuarioController@misLocales');\n }else{\n //Query para obtener la última fecha pagada\n $lastPagoHasta = Pago::select('pagoHasta')->where('local_user_id', $id)->orderBy('pagoHasta', 'desc')->take(1)->get();\n\n //editamos la fecha\n $lastPagoHasta = $lastPagoHasta[0]['pagoHasta'] . ' 00:00:00';\n\n //verificamos si la persona tomó un turno después de la última fecha pagada\n $deuda=Planilla_Turno_User::where('local_user_id', $id)->where('created_at', '>', $lastPagoHasta)->count();\n\n //si count es arriba de 0 es porque tomó un turno y aún no paga\n if($deuda > 0 && $local->Local->cuenta == 'Premium'){\n $deuda = \"Si\";\n }else{\n $deuda = \"No\";\n }\n\n $meses = array('Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic');\n $months = array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');\n\n foreach ($pagos as $pago){\n $pago->fechaPago= date('d-m-Y', strtotime($pago->fechaPago));\n $pago->pagoDesde= str_replace($months, $meses, date('d-M-Y', strtotime($pago->pagoDesde)));\n $pago->pagoHasta= str_replace($months, $meses, date('d-M-Y', strtotime($pago->pagoHasta)));\n }\n return view ('usuario.ver-pagos')\n ->with('pagos', $pagos)\n ->with('local', $local)\n ->with('deuda', $deuda);\n }\n }", "public function profil(){\n\t\t//TODO : verifications si le mec à les droits pour accéder à ce profil (en gros si c'est un particpan auth et pas un orga ou un visiteur)\n\n\n\t\t$response = $this->client->get(\"organisateurs/\".$_SESSION['id'].\"\"); \n\t\t$body = $response->getBody();\n\t\tif ($response->getStatusCode() == \"200\"){ //si la ressource existe bien\n\t\t\t$body = json_decode($body, true);\n\t\t\t$organisateur = $body['organisateur'];\n\t\t\t$links = $body['links'];\n\n\t\t\t//récupérer les évènements liés au organisateur\n\t\t\t$response = $this->client->get($links['href']); \n\t\t\tif ($response->getStatusCode() == \"200\"){\n\t\t\t\t$body = $response->getBody();\n\t\t\t\t$body = json_decode($body, true);\n\t\t\t\t$events = $body['evenements'];\n\n\t\t\t\t$event = array();\n\t\t\t\tforeach ($events as $value){\n\t\t\t\t\t$event[] = $value['evenement'];\n\n\t\t\t\t\t/*foreach ($value['links'] as $key => $rel) {\n\t\t\t\t\t\tif($rel['rel'] == 'self'){\n\t\t\t\t\t\t\t$evenementLinkResponse = $client->get($rel['href']); \n\t\t\t\t\t\t\t$evenementLink = json_decode($evenementLinkResponse->getBody(),true);\n\t\t\t\t\t\t\t$all['linkEvent'] = $organisateurLink;\n\t\t\t\t\t\t}\n\t\t\t\t\t}*/\n\t\t\t\t}\n\n\n\t\t\t}else{\n\t\t\t\t$message = \"aucun evenement\";\n\t\t\t\t$v = new view\\ViewError($message);\n\t\t\t\t$v->display();\n\t\t\t}\n\n\t\t\t$v = new view\\ViewProfilOrganisateur($organisateur,$event);\n\t\t\t$v->display();\n\t\t}else{\n\t\t\t$message = \"Ressource n'existe pas\";\n\t\t\t$v = new view\\ViewError($message);\n\t\t\t$v->display();\n\t\t}\n\t}", "public function getPerfilUsuario($usuarioId, $valor = 'id')\n {\n $dql = \"SELECT up.perfilId, p.perPerfil\n FROM sgiiBundle:TblUsuarioPerfil up\n JOIN sgiiBundle:TblPerfil p WITH p.id = up.perfilId\n WHERE up.usuarioId =:usuario\";\n $query = $this->em->createQuery($dql);\n $query->setParameter('usuario', $usuarioId);\n $perfilUser = $query->getResult();\n \n $perfil = false;\n if ($valor == 'id') {\n $perfil = ($perfilUser) ? $perfilUser[0]['perfilId'] : 0;\n }\n elseif ($valor == 'nombre') {\n $perfil = ($perfilUser) ? $perfilUser[0]['perPerfil'] : 0;\n }\n return $perfil;\n }", "public static function login() {\n \n $identificado = Login::get();\n \n echo \"<section class='container st-login'>\";\n echo \"<div class='row'>\";\n echo \"<div class='col-md-12'>\";\n echo \"<div class='login'>\";\n echo $identificado ?\n \"Hola <a href='/usuario/show/$identificado->id' class='logname'>$identificado->usuario</a>|\n <a href='/login/logout' class='logout'>salir</a>\" :\n \"<a href='/login' class='regis-link'>Identifícate</a><a class='regis-link' href='/usuario/create'>Regístrate</a>\";\n \n echo \"</div>\";\n \n echo \"</div>\";\n echo \"</div>\";\n echo \"</section>\";\n \n }", "public function listProById()\n {\n\n // obtener el perfil por id\n $id = 3985390143818633;\n print_r($this->getProfile($id)); \n\n }", "function listado_usuarios(){\n if($this->session->userdata('session') === TRUE ){\n $id_perfil=$this->session->userdata('id_perfil');\n\n $coleccion_id_operaciones= json_decode($this->session->userdata('coleccion_id_operaciones')); \n if ( (count($coleccion_id_operaciones)==0) || (!($coleccion_id_operaciones)) ) {\n $coleccion_id_operaciones = array();\n } \n\n\n\n switch ($id_perfil) { \n case 1:\n ob_start();\n $this->paginacion_ajax_usuario(0);\n $initial_content = ob_get_contents();\n ob_end_clean(); \n $data['table'] = \"<div id='paginacion'>\" . $initial_content . \"</div>\" ;\n $this->load->view( 'paginacion/paginacion',$data); \n \n break;\n case 2:\n case 3:\n case 4:\n if (in_array(3, $coleccion_id_operaciones)) { \n ob_start();\n $this->paginacion_ajax_usuario(0);\n $initial_content = ob_get_contents();\n ob_end_clean(); \n $data['table'] = \"<div id='paginacion'>\" . $initial_content . \"</div>\" ;\n $this->load->view( 'paginacion/paginacion',$data); \n } \n break;\n\n\n default: \n redirect('/');\n break;\n }\n }\n else{ \n redirect('/'); //index\n }\n\t}", "public function show($id)\n {\n //iniciada ya la sesion\n //entra a la pagina del usuario\n switch (Auth::user()->rol){\n case 'tecnico':\n $incidencia = Incidencia::find($id);\n $vehiculo = Vehiculo::find($incidencia->vehiculo_id);\n $cliente = Cliente::find($incidencia->cliente_id);\n $tecnico = Tecnico::where('usuarios_id', Auth::user()->id)->get();\n $comentarios = Comentario::where('incidencia_id', $incidencia->id)->get();\n return view('usuario/tecnico-incidencias-show', ['incidencia' => $incidencia, 'cliente' => $cliente, 'vehiculo' => $vehiculo, 'tecnico' => $tecnico[0], 'comentarios' => $comentarios,'usuario' => Auth::user()]);\n break;\n default:\n // coger incidencias para mostrar en una paginacion\n $incidencia = Incidencia::find($id);\n $cliente = Cliente::find($incidencia->cliente_id);\n $vehiculo = Vehiculo::find($incidencia->vehiculo_id);\n $comentarios = Comentario::where('incidencia_id', $incidencia->id)->get();\n return view('usuario/resto-incidencia-show', ['incidencia' => $incidencia, 'cliente' => $cliente, 'vehiculo' => $vehiculo, 'comentarios' => $comentarios, 'hideMap' => request('hideMap'), 'usuario' => Auth::user()]);\n }\n }", "function listarPerfilPrivilegios($url, $id = 0){\n\t\t$s = 'SELECT p.oid,p.nomb,prv.oid AS oidp,prv.id, prv.nomb AS bnom, COALESCE(upp.visi,0) AS visi\n\t\t\t\tFROM space.privilegio prv\n\t\t\t\tJOIN space.menu_accion ma ON prv.para=ma.url\n\t\t\t\tJOIN space.perfil_privilegio pp ON pp.oidpr=prv.oid\n\t\t\t\tJOIN space.perfil p ON p.oid=pp.oidp\n\t\t\t\tLEFT JOIN space.usuario_perfil up on p.oid=up.oidp\n\t\t\t\tLEFT JOIN space.usuario u ON u.id=up.oidu\n\t\t\t\tLEFT JOIN space.usuario_perfil_privilegio upp ON \n\t\t\t\tupp.oidu = u.id AND\n\t\t\t\tupp.oidp = p.oid AND\n\t\t\t\tupp.oidpr = prv.oid\n\t\t\t\tWHERE ma.url=\\'' . $url . '\\' AND u.id=' . $id;\n\n\t\t\n\t\t//echo $s;\n\t\t$obj = $this->DBSpace->consultar($s);\n\n\t\t$lst = array();\n\t\t$lstp = array();\n\t\tif($obj->cant == 0 ){\n\t\t\t$s = 'SELECT p.oid,p.nomb,prv.oid AS oidp,prv.id, prv.nomb AS bnom, prv.visi\n\t\t\t\tFROM space.privilegio prv\n\t\t\t\tJOIN space.menu_accion ma ON prv.para=ma.url\n\t\t\t\tJOIN space.perfil_privilegio pp ON pp.oidpr=prv.oid\n\t\t\t\tJOIN space.perfil p ON p.oid=pp.oidp\n\t\t\t\tWHERE ma.url=\\'' . $url . '\\'';\n\t\t\t$obj = $this->DBSpace->consultar($s);\n\t\t\tif($obj->cant == 0 )return $lst;\n\t\t}\n\t\t\n\t\t$perfil = $obj->rs[0]->nomb;\n\t\tforeach ($obj->rs as $clv => $v) {\n\t\t\tif($perfil != $v->nomb){\n\t\t\t\t$lst[$perfil] = $lstp;\n\t\t\t\t$perfil = $v->nomb;\n\t\t\t\t$lstp = null;\n\t\t\t}\n\t\t\t$lstp[] = array(\n\t\t\t\t'oidp' => $v->oid,\n\t\t\t\t'cod'=> $v->oidp,\n\t\t\t\t'nomb' => $v->bnom,\n\t\t\t\t'visi' => $v->visi\n\t\t\t);\n\t\t}\n\t\t$lst[$perfil] = $lstp;\n\t\t\n\t\treturn $lst;\n\t}", "public function getServicioMedicoUsuario($id){\n $sql=\"SELECT * FROM servicio_medico WHERE ID_Mt_Ctl= ?\";//Se hace la consulta para validar los datos\n $consulta=$this->db->connect()->prepare($sql);//se asigna una variable para usar el metodo prepare\n $consulta->execute(array($id)); \n \n return !empty($consulta) ? $fila = $consulta->fetch(PDO::FETCH_ASSOC) : false;\n }", "public function view_editar_usuario($id=''){\n\t\tif (is_numeric($id)) {\n\t\t$data['usuarios']=$this->musuario->select($id);\n\t\t$this->load->view('editar_usuarios',$data);\n\t\t}else{\n\t\tshow_404();\n\t\t}\n\t\t\n\t}", "function traerUsuarioPorId($db, $id) {\n $consulta = \"SELECT * FROM usuarios\n WHERE id_usuario = \" . $id;\n $res = mysqli_query($db, $consulta);\n $fila = mysqli_fetch_assoc($res);\n return $fila;\n}", "function listarUsuariosId($id){\n\t\t$activo = true;\n\t\t$query = \"SELECT * FROM usuarios WHERE idUsuario='$id' and activo='$activo'\";\n\t\t$link = conectar(); //llama a la funcion conectar de conex.php\n\t\t$resultdb = $link->query($query); //envia el query a la BD\n\t\tif ($resultdb->num_rows == 1) {\n\t\t\t$usuario = $resultdb->fetch_assoc();\n\t\t}\n\t\t$link->close();//cierro conex\n\t\techo json_encode($usuario);//imprimo un JSON con los datos de la consulta\n\t}", "public function profil()\n {\n // J'appelle toutes les variables dont j'ai besoin par défaut dans la buildview\n $login = $this->request->getSession()->getAttribut(\"login\"); // recupere le login\n $id = $this->request->getSession()->getAttribut(\"idUser\"); // récupère l'id\n $newpassword = $this->request->getParameterByDefault('newpassword');\n $newpasswordverif = $this->request->getParameterByDefault('newpasswordverif');\n $msgs = [];\n\n\n // j'arrive en post car des données sont saisies dans le formulaire\n if($newpassword && $newpasswordverif)\n {\n\n if($newpassword != $newpasswordverif)\n {\n $msgs[] = \"Les mots de passe ne correspondent pas.\";\n }\n\n else\n {\n $this->user->newPassword($newpassword, $id);\n $msgs[] = \"Le mot de passe a bien été mis à jour.\";\n }\n }\n\n // j'arrive sur la vue en POST mais le champs newpassword ou le champs newpasswordverif n'est pas saisi\n // j'affiche des erreurs insérées dans un tableau.\n else if($_SERVER['REQUEST_METHOD'] === 'POST')\n {\n if(!$newpassword)\n {\n $msgs[] = \"Le nouveau mot de passe n'a pas été saisi correctement.\";\n }\n\n if(!$newpasswordverif)\n {\n $msgs[] = \"La confirmation du nouveau mot de passe n'a pas été saisi correctement.\";\n }\n }\n\n // j'arrive sur la vue en Get\n $this->buildView(array('id' => $id, 'login' => $login, 'msgs' => $msgs));\n\n }", "function obtener_post_profile($post_por_pagina, $conexion) {\n $sentencia = $conexion->prepare(\"SELECT * FROM imagenes WHERE idUser = :idUser ORDER BY idImg DESC\" );\n $sentencia->execute(array(':idUser' => $_GET['id']));\n return $sentencia->fetchAll();\n}", "function ShowData($id,$accion)\n{\n\tif ($id!=''){\n\t$users = new users();\n\t$elements=$users->getUsers(\" AND username='\".$id.\"'\");\n\t}\n\t?>\n<div class=\"ui-state-highlight ui-corner-all\" style=\"padding: 0 .7em 20px 15px; margin-bottom: 20px\"> \n<h2>Datos del Usuario</h2>\n<form id=\"formData\" name=\"formData\" method=\"post\" action=\"?page=user&act=<?php echo $accion;?>&amp;id=<?php echo $id;?>&amp;accion2=ok\">\n<table cellspacing=\"0\" cellpadding=\"5px\">\n <tr>\n <td width=\"150px\" valign=\"top\"><label for=\"username\">Usuario:</label></td>\n <td>\n <input type=\"text\" readonly=\"readonly\" class=\"input-disabled\" Size=\"40\" id=\"username\" name=\"username\" value=\"<?php echo $elements[0]['username'];?>\"/> \n\t <input type=\"hidden\" name=\"id\" value=\"<?php echo $elements[0]['username'];?>\" /> \n <span id=\"user-alert\" class=\"alert-message\"></span> \n\t</td>\n </tr>\n <tr>\n <td valign=\"top\"><label for=\"user_password\">Nueva Contraseña:</label></td>\n <td>\n <input type=\"password\" Size=\"40\" id=\"user_password\" name=\"user_password\" value=\"\"/> \n <span id=\"password-alert\" class=\"alert-message\"></span>\n\t</td>\n </tr>\n <tr>\n <td valign=\"top\"><label for=\"user_repassword\">Re-Nueva Contraseña:</label></td>\n <td>\n <input type=\"password\" Size=\"40\" id=\"user_repassword\" name=\"user_repassword\" value=\"\"/> \n <span id=\"repassword-alert\" class=\"alert-message\"></span>\n\t</td>\n </tr> \n <tr>\n <td>&nbsp;</td>\n <td><input type=\"button\" class=\"yui-btn\" id=\"form-submit\" name=\"form-submit\" value=\"Modificar contraseña\" /></td>\n </tr>\n</table>\n</form>\n</div>\n<?php\n}", "function editarPerfil(){\n \t//Llamo a la vista editar perfil\n \trequire \"app/Views/EditarPerfil.php\";\n \t\t$usuario = new Usuario();\n\t\t//Paso datos\n \t\t$usuario->nombre=$_POST['nombre'];\n \t\t$usuario->apellidoPaterno=$_POST['apellido_p'];\n \t\t$usuario->apellidoMaterno=$_POST['apellido_m'];\n \t\t$usuario->nombreUsuario=$_POST['nom_usuario'];\n \t\t$usuario->correo=$_POST['correo'];\n \t\t$usuario->contrasenia=$_POST['contrasenia'];\n \t\t$usuario->sexo=$_POST['sexo'];\n \t\t$usuario->descripcion=$_POST['descripcion'];\n \t\t$usuario->id=$_POST['id'];\n \t\t$usuario->contrasenia['password'];\n \t\t$usuario->editarUsuario();\n header(\"Location:/Proyecto/index.php?controller=Publicaciones&action=home\");\t\n }", "function listado_directorios_usuario($id_usuario) {\n\t\t\n\t\t$query = \"SELECT * FROM repositorio_directorios WHERE id_usuario='$id_usuario'\";\n\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t$result = mysql_query($query); \n\t\t\n\t\t$numrows = mysql_num_rows($result);\n\t\tmysql_close($connection);\t\n\t\t// COMPROBAMOS QUE HAYA RESULTADOS\n\t\t// SI EL NUMERO DE RESULTADOS ES 0 SIGNIFICA QUE NO HAY REGISTROS CON ESOS DATOS\n\t\tif ($numrows == 0) {\n\t\t\treturn $result;\n\t\t}\n\t\telse {\n\t\t\treturn $result;\n\t\t}\n\t}", "public function getDatosDeUsuarioById($usuario_id)\r\n {\r\n \r\n include \"sesion/seguridad/open_conn.php\";\r\n $conn = mysql_connect(\"$host\", \"$username\", \"$password\")or die(\"cannot connect\"); \r\n mysql_select_db(\"$db_name\")or die(\"cannot select DB\");\r\n //comprobamos la conección de la base de datos\r\n $ssql2 =\"SELECT * FROM datosusuario d where d.id_usuario = '$usuario_id'\";\r\n //variable que almacenará los datos del usuario\r\n $usuario = mysql_fetch_assoc(mysql_query($ssql2,$conn)); \r\n return $usuario; \r\n }", "function login($user,$pass){\n \n try{\n include(\"../conexion/mysql.php\");\n\n $consulta=\"SELECT * FROM tbl_usuario WHERE usuario='$user' AND clave='$pass'\";\n \n $resultado= mysqli_query($link ,$consulta)or die('Error al consultar usuario');\n \n $perfil=null;\n $contador=0;\n while ($registro = mysqli_fetch_array($resultado)){\n $perfil=$registro[\"perfil\"];\n $contador++;\n }\n\n \n \n if($contador){\n \n $_SESSION[\"perfil\"]=$perfil;\n\t\t\t\t\t $_SESSION[\"usuario\"]=$user;//se almacena la sesion del usuario \n return true;\n }else{\n return false;\n }\n }catch(Exception $e){\n echo \"ERROR\" . $e->getMessage();\n }\n \n }", "function pagina($modulo) {\n\t\t\t$rs_menu =$this->usuarios->menu_usuario();\n\t\t\t$data_menu=\"\";\n\n\t\t\t$nombrefuncion=\"\";\n\t\t\tforeach ($rs_menu->result_array() as $fila)\n\t\t\t{\n\t\t\t\t$activo='';\n\t\t\t\tif($fila['archivo']==$modulo)\n\t\t\t\t{\n\t\t\t\t\t$activo='class=\"current-page\"';\n\t\t\t\t\t$nombrefuncion=$fila['descripcion'];\n\t\t\t\t}\n\t\t\t\tif($fila['visible']==1)\n\t\t\t\t{\n\t\t\t\t\t$data_menu=$data_menu.\n\t\t\t\t\t'<li '.$activo.'>\n\t\t\t\t\t\t<a href=\"'. site_url(array('user',$fila['archivo'])).'\"> <i class=\"'.$fila['icono'].'\"></i> '.$fila['descripcion'].' </a>\n\t\t\t\t\t</li>';\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\t$nombre=$this->session->userdata['nombre'];\n\t\t\t$miniatura=$this->session->userdata['miniatura'];\n\n\t\t\t$rs_mensajes = $this->mensajes->registros(5);\n\t\t\t$datamensaje = array();\n\t\t\tforeach ($rs_mensajes->result_array() as $mensaje) {\n\t\t\t\t$datamensaje[] = array(\n\t\t\t\t\t\t\t'miniatura'\t=> $mensaje['miniatura'],\n\t\t\t\t\t\t\t'mensaje'\t=> $mensaje['mensaje'],\n\t\t\t\t\t\t\t'asunto'\t=> $mensaje['asunto'],\n\t\t\t\t\t\t\t'usuario'\t=> $mensaje['usuario'],\n\t\t\t\t\t\t\t'fechahora'\t=> nice_date($mensaje['fechahora'],'d-m-Y h:m:i: a')\n\t\t\t\t\t\t\t);\n\t\t\t}\n\n\n\t\t\treturn array('menu'=>$data_menu,'titulo'=>'Módulos','nombre'=>$nombre,'miniatura'=>$miniatura,'nombrefuncion'=>$nombrefuncion,'datamensaje'=>$datamensaje);\n\t\t}", "public function pagar($id)\n {\n $idUsuario = session()->get('Usuario_Id');\n\n $notificaciones = Notificaciones::obtenerNotificaciones(\n $idUsuario\n );\n\n $cantidad = Notificaciones::obtenerCantidadNotificaciones(\n $idUsuario\n );\n\n $datos = Usuarios::findOrFail($idUsuario);\n \n $proyecto = Proyectos::obtenerProyecto($id);\n $empresaProyecto = Empresas::findOrFail($proyecto->PRY_Empresa_Id);\n $informacion = FacturasCobro::obtenerDetalleFactura($id);\n $idEmpresa = Empresas::obtenerEmpresa()->id;\n $empresa = Empresas::findOrFail($idEmpresa);\n $total = FacturasCobro::obtenerTotalFactura($id);\n \n foreach ($informacion as $info) {\n $factura = $info->id;\n }\n \n $datosU = [\n 'proyecto'=>$proyecto, \n 'informacion'=>$informacion, \n 'factura'=>$factura, \n 'fecha'=>Carbon::now()->toFormattedDateString(),\n 'total'=>$total,\n 'empresa'=>$empresa,\n 'empresaProyecto'=>$empresaProyecto\n ];\n\n return view(\n 'cliente.pagar',\n compact(\n 'datos',\n 'datosU',\n 'notificaciones',\n 'cantidad'\n )\n );\n }", "public function listarUser() {\n if(IDUSER) {\n $eval = \"SELECT id,nombre,apellidos,email FROM users\";\n $peticion = $this->db->prepare($eval);\n $peticion->execute();\n $resultado = $peticion->fetchAll(PDO::FETCH_OBJ);\n exit(json_encode($resultado));\n } else {\n http_response_code(401);\n exit(json_encode([\"error\" => \"Fallo de autorizacion\"])); \n }\n }", "function view_perm_users()\n\t{\n\t\t//-----------------------------------------\n\t\t// Check for a valid ID\n\t\t//-----------------------------------------\n\n\t\tif ($this->ipsclass->input['id'] == \"\")\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Нельзя произвести изменения в масках доступа этому ID, пожалуйста, попытайтесь еще раз\");\n\t\t}\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'forum_perms', 'where' => \"perm_id=\".intval($this->ipsclass->input['id']) ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\tif ( ! $perms = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Нельзя произвести изменения в масках доступа этому ID, пожалуйста, попытайтесь еще раз\");\n\t\t}\n\n\t\t//-----------------------------------------\n\t\t// Get all members using that ID then!\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Сведения о пользователе\" , \"50%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Действие\" , \"50%\" );\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= \"<script language='javascript' type='text/javascript'>\n\t\t\t\t\t\t <!--\n\t\t\t\t\t\t function pop_close_and_stop( id )\n\t\t\t\t\t\t {\n\t\t\t\t\t\t \topener.location = \\\"{$this->ipsclass->base_url}&section=content&act=mem&code=doform&mid=\\\" + id;\n\t\t\t\t\t\t \tself.close();\n\t\t\t\t\t\t }\n\t\t\t\t\t\t //-->\n\t\t\t\t\t\t </script>\";\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Используется пользователями: \" . $perms['perm_name'] );\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => 'id, name, email, posts, org_perm_id',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'members',\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => \"(org_perm_id IS NOT NULL AND org_perm_id != '')\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t 'order' => 'name' ) );\n\t\t$outer = $this->ipsclass->DB->simple_exec();\n\n\t\twhile( $r = $this->ipsclass->DB->fetch_row($outer) )\n\t\t{\n\t\t\t$exp_pid = explode( \",\", $r['org_perm_id'] );\n\n\t\t\tforeach( explode( \",\", $r['org_perm_id'] ) as $pid )\n\t\t\t{\n\t\t\t\tif ( $pid == $this->ipsclass->input['id'] )\n\t\t\t\t{\n\t\t\t\t\tif ( count($exp_pid) > 1 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$extra = \"<li>Также используются: <em style='color:red'>\";\n\n\t\t\t\t\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'forum_perms', 'where' => \"perm_id IN (\".$this->ipsclass->clean_perm_string($r['org_perm_id']).\") AND perm_id <> {$this->ipsclass->input['id']}\" ) );\n\t\t\t\t\t\t$this->ipsclass->DB->simple_exec();\n\n\t\t\t\t\t\twhile ( $mr = $this->ipsclass->DB->fetch_row() )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$extra .= $mr['perm_name'].\",\";\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$extra = preg_replace( \"/,$/\", \"\", $extra );\n\n\t\t\t\t\t\t$extra .= \"</em>\";\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$extra = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<div style='font-weight:bold;font-size:11px;padding-bottom:6px;margin-bottom:3px;border-bottom:1px solid #000'>{$r['name']}</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <li>Сообщений: {$r['posts']}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <li>Email: {$r['email']}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t $extra\" ,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"&#149;&nbsp;<a href='{$this->ipsclass->base_url}&amp;{$this->ipsclass->form_code}&amp;code=remove_mask&amp;id={$r['id']}&amp;pid=$pid' title='Удалить эту маску доступа у пользователя (без удаления других масок доступа)'>Удалить эту маску</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <br />&#149;&nbsp;<a href='{$this->ipsclass->base_url}&amp;{$this->ipsclass->form_code}&amp;code=remove_mask&amp;id={$r['id']}&amp;pid=all' title='Удалить все дополнительные маски'>Удалить все дополнительные маски</a>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t <br /><br />&#149;&nbsp;<a href='javascript:pop_close_and_stop(\\\"{$r['id']}\\\");'>Изменить пользователя</a>\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t) );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\n\t\t$this->ipsclass->admin->print_popup();\n\t}", "public function show($id)\n {\n\n //\n/*Relacionamento de 1 para 1\n if($user){\n echo \"<h1>Deu bom</h1>\";\n echo \"<p>Nome: {$user->name} Email: {$user->email}</p>\";\n }\n\n $postagem = $user->posts()->first();\n\n if($postagem){\n echo \"Titulo: {$postagem->usuario}\";\n }\n\n*/\n $user = User::where('id', $id)->first();\n\n\n $posts = $user->posts()->get();\n\n if($posts){\n return view('site.perfil', compact('posts'));\n }\n\n }", "public function estePerfil(){\n\t\tif (isset( $_SESSION[\"usu\"] )) {\n\t\t\t$usu = $_SESSION[\"usu\"];\n\t\t\treturn $usu->getPerfilusuarios_id();\n\t\t}\n\t\treturn \"\";\n\t}", "function PesquisaUsuarioPorId($id){\n\t\t\t\n\t\t\ttry{\n\t\t\t\t$conn = Banco::ConectaBanco();\n\t\t\t\t$statm = $conn->prepare(\"SELECT * FROM Usuario WHERE usuario_id = :id AND usuario_ativo = TRUE\");\n\t\t\t\t$statm->bindValue(\":id\", $id);\n\t\t\t\t$statm->execute();\n\t\t\t\t$conn = NULL;\n\t\t\t\treturn $row = $statm->fetch(PDO::FETCH_ASSOC);\n\t\t\t}catch(Exception $e){\n\t\t\t\techo $e->getMessage();\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\t\n\t\t}", "function modulos($acceso){\n\t$acceso->objeto->ejecutarSql(sql(\"perfil ORDER BY nombreperfil\"));\t\t\n\treturn seguridadPerfil($acceso);\n}", "public function profil()\n\t{\n $data_profil = $this->m_data->tampil_data('profil')->result();\n\n // di parsing ke view\n $data = array(\n 'profil' => $data_profil, \n );\n\n // menampilkan view index\n\t\t$this->load->view('profil',$data);\n }", "public function loadChangePass()\n {\n $this->global['pageTitle'] = 'Ubah Profil';\n $userId = $this->session->userdata('userId');\n $data['roles'] = $this->user_model->getUserRoles();\n $data['jabatan'] = $this->user_model->getUserJabatanInfo();\n $data['pangkat'] = $this->user_model->getUserPangkat();\n $data['userInfo'] = $this->user_model->getUserInfoAll($userId);\n $this->load->view('includes/header', $this->global);\n $this->load->view('user/changePassword', $data);\n $this->load->view('includes/footer');\n }", "public function VerPerfilC(){\n\n $tablaBD = \"usuarios\";\n $id = $_SESSION[\"id\"];\n\n $respuesta = UsuariosM::VerPerfilM($tablaBD, $id);\n\n echo '<tr>\n\n <td>'.$respuesta[\"usuario\"].'</td>\n <td>'.$respuesta[\"clave\"].'</td>';\n \n if ($respuesta[\"foto\"] != \"\"){\n\n echo '<td>\n <img src=\"'.$respuesta[\"foto\"].'\" class=\"user-image\" alt=\"User-Image\" width=\"40px;\">\n </td>';\n }else{\n echo '<td>\n <img src=\"Vistas/img/usuarios/defecto.png\" class=\"user-image\" alt=\"User-Image\" width=\"40px;\">\n </td>';\n }\n \n echo '<td>\n <div class=\"btn-group\">\n <button class=\"btn btn-success EditarU\" Uid=\"'.$respuesta[\"id\"].'\"><i class=\"fa fa-pencil\" data-toggle=\"modal\" data-target=\"#EditarU\"></i></button>\n \n </div>\n </td>\n </tr>';\n\n }", "public function accionIndex(){\n \n if(!Sistema::app()->acceso()->hayUsuario()){\n Sistema::app()->paginaError(400,\"Solos los usuarios registrados pueden acceder\");\n exit;\n }\n\n //llega el pase de la pelicula\n $codPase = intval($_GET[\"id\"]);\n \n //obtener las entradas compradas para ese pase, esa pelicula y esa hora\n $entUsuarios = new Entradas_usuarios();\n $pasePelicula = new Pases_peliculas();\n $sala = new Salas();\n $asientos = new Asientos();\n $entAnonimos = new Entradas_anonimos();\n \n \n $pasePelicula->buscarPorId($codPase);//CONTROLAR QUE EXISTE.\n //CONTROLAR TAMBIEN SI HA CADUCADO.\n \n //obtengo la sala donde se proyecta ese pase\n $sala->buscarPorId($pasePelicula->cod_sala);\n \n \n $opFil[\"select\"] = \"cod_asiento, fila, columna\";\n $opFil[\"where\"] = \"t.cod_sala =\".$pasePelicula->cod_sala;\n $opFil[\"order by\"] = \"fila, columna\";\n \n $totalAsientos = $asientos->buscarTodos($opFil);\n \n //tengo todos las entradas para ese pase.\n $opFiltrado[\"where\"] = \"t.cod_pase_pelicula = \".$codPase;\n $entradasUsu = $entUsuarios->buscarTodos($opFiltrado);\n $entradasAnon = $entAnonimos->buscarTodos($opFiltrado);\n \n $filas = $sala->n_filas;\n $columnas = $sala->n_columnas;\n $capacidad = $sala->capacidad;\n \n \n $asientosOcupados = [];\n \n //Si no hay entradas compreadas para este pase, no se ejecuta ---\n \n if(!empty($entradasUsu)||!empty($entradasAnon)){\n $asientosOcupados = $this->asientosOcupados($entradasUsu, $entradasAnon);\n }\n \n //if(!empty($entradasAnonimos)){\n // $asientosOcupados2 = $this->asientosOcupados($entradasAnonimos);\n // var_dump($asientosOcupados2);\n //}\n \n if(isset($_POST[\"butacas\"])){\n \n //llega el imput que almacena en un string creado en js\n //con un string con todos los asientos seleccionados\n $asientosSel = explode(\",\", $_POST[\"butacas\"]);\n \n Sistema::app()->sesion()->set(\"butacas\",$asientosSel);\n Sistema::app()->sesion()->set(\"codPase\",$codPase);\n \n Sistema::app()->irAPagina(array(\"entradasUsuarios\",\"mostrarResumen\"));\n exit;\n }\n \n \n $this->dibujaVista(\"mostrarCine\",array(\"asientosOcupados\"=>$asientosOcupados,\n \"filas\"=>$filas,\n \"cols\"=>$columnas,\n \"codPase\"=>$codPase,\n \"codAsientos\"=>$totalAsientos\n ),\n \"CINES MELERO\");\n \n \n \n }" ]
[ "0.69410473", "0.67047215", "0.66088307", "0.65915745", "0.6557436", "0.6528494", "0.6503006", "0.64578867", "0.64520466", "0.6423299", "0.63647103", "0.63582855", "0.6291712", "0.62829137", "0.62614506", "0.62409025", "0.62408006", "0.6237193", "0.62371725", "0.6233524", "0.62089217", "0.618571", "0.6183872", "0.61726815", "0.6167905", "0.6166699", "0.616348", "0.61490244", "0.61361945", "0.61288863", "0.6125219", "0.6096407", "0.60836214", "0.60717237", "0.60563797", "0.60511994", "0.60466594", "0.6033575", "0.6033331", "0.60217226", "0.6020345", "0.60202396", "0.6007286", "0.59947354", "0.59897697", "0.59769595", "0.59762126", "0.5961474", "0.5960936", "0.595946", "0.5944007", "0.59401774", "0.5932024", "0.59292555", "0.5920632", "0.5914467", "0.59140575", "0.5909491", "0.5908211", "0.590235", "0.5896397", "0.5895007", "0.5893057", "0.5889287", "0.5877273", "0.58702147", "0.5868506", "0.5859189", "0.58548826", "0.5852335", "0.5842619", "0.58425033", "0.58413804", "0.58271486", "0.58143854", "0.58067", "0.5805881", "0.5800508", "0.5797887", "0.57952404", "0.57924515", "0.57865506", "0.57815975", "0.578019", "0.57765657", "0.5766864", "0.57605225", "0.5755213", "0.57485676", "0.5740555", "0.5732191", "0.57310474", "0.57274854", "0.5726111", "0.57259923", "0.5719433", "0.5716819", "0.5715137", "0.57099473", "0.57063824", "0.57050145" ]
0.0
-1
Comprueba si el usuario asignado a un perfil tiene permiso para ver esa pagina.
function is_allowed($page){ $datos=new Dsession(); $result=false; if($page=='slgrid' || $page=='message_box'|| $page=='print_factura') $result=true; else { $rs=$datos->is_allowed_hotel($this->id_perfil, $page); if ($rs->getRecordCount()>0){ $rs->next(); $result=$rs->getInt('permiso'); } } return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function verificarPermisos($permiso)\n{\n try\n {\n if (logged_user()->tipo != \"A\")\n {\n if (logged_user()->$permiso != 1)\n {\n echo \"No tiene permisos para esta accion\";\n die();\n } else\n {\n return true;\n }\n } else\n {\n return true;\n }\n } catch (Exception $ex)\n {\n Session::instance()->setFlash('ERROR: ' . $ex->getMessage());\n }\n}", "private function userHasAccess()\n {\n $required_perm = $this->route['perm'];\n $user_group = $_SESSION['user_group'];\n if ($required_perm == 'all') {\n return true;\n } elseif ($user_group == $required_perm) {\n return true;\n }\n return false;\n }", "public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n return $this->user()->can('Crear Departamentos');\n\n }", "function es_superadmin()\n{\n if(Auth::user()->perfil_id == 4)\n {\n return true;\n }else{\n return false;\n }\n}", "private function userHasAccessToPages() {\n\t\t$configurationProxy = tx_oelib_configurationProxy::getInstance('realty');\n\n\t\t$objectsPid = $configurationProxy->getAsInteger(\n\t\t\t'pidForRealtyObjectsAndImages'\n\t\t);\n\t\t$canWriteObjectsPage = $GLOBALS['BE_USER']->doesUserHaveAccess(\n\t\t\tt3lib_BEfunc::getRecord('pages', $objectsPid), 16\n\t\t);\n\n\t\t$auxiliaryPid = $configurationProxy->getAsInteger(\n\t\t\t'pidForAuxiliaryRecords'\n\t\t);\n\t\t$canWriteAuxiliaryPage = $GLOBALS['BE_USER']->doesUserHaveAccess(\n\t\t\tt3lib_BEfunc::getRecord('pages', $auxiliaryPid), 16\n\t\t);\n\n\t\tif (!$canWriteObjectsPage) {\n\t\t\t$this->storeErrorMessage('objects_pid', $objectsPid);\n\t\t}\n\t\tif (!$canWriteAuxiliaryPage) {\n\t\t\t$this->storeErrorMessage('auxiliary_pid', $auxiliaryPid);\n\t\t}\n\n\t\treturn $canWriteObjectsPage && $canWriteAuxiliaryPage;\n\t}", "public function authorize()\n {\n return session('role') == 'administrador';\n }", "public function authorize()\n {\n if ($this->user()->parent_id == NULL) { //Solo si es Cacique puede agregar indios. Sino, 403!\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n $member = auth()->user()->member;\n return auth()->user()->can('pdg', $member) || auth()->user()->can('manager', $member);\n }", "public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }", "public function authorize()\n {\n $user = User::find($this->id);\n\n if (!$user) {\n $user = User::where('no_ahli', $this->no_ahli)->first();\n }\n if ($user && $user->id == auth()->user()->id) return true;\n if (auth()->user()->is('admin')) return true;\n\n return false;\n }", "private function wf_user_permission(){\n\t\t$current_user = wp_get_current_user();\n\t\t$user_ok = false;\n\t\tif ($current_user instanceof WP_User) {\n\t\t\tif (in_array('administrator', $current_user->roles) || in_array('shop_manager', $current_user->roles)) {\n\t\t\t\t$user_ok = true;\n\t\t\t}\n\t\t}\n\t\treturn $user_ok;\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }", "public function authorize()\n {\n return \\Auth::user()->canDo('ADD_PORTFOLIOS');\n }", "public function authorize()\n { \n if($this->user()->hasRole(['unidadeEnsino', 'articulador', 'superadministrador']))\n {\n return true;\n }else {\n $this->error = 'Desculpe, voce nao possui permissão para adicionar espaços';\n return false;\n }\n }", "public function authorize()\n {\n $usuario = Auth::User();\n //se ele e master\n if($usuario->tipo_usuario_id!=8){\n return false; \n }\n return true;\n }", "public function authorize()\n {\n if($this->path() == 'profile/create')\n {\n return true;\n } else {\n return false;\n }\n }", "public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }", "private function _validate_user() {\n\t\treturn (current_user_can(\"edit_posts\") && current_user_can(\"edit_pages\") && !empty($this->buttons));\n\t}", "public function isAuthorized($user)\n {\n if (parent::isAuthorized($user) === true) {\n return true;\n } else if ($user['actif'] != true) {\n // Les comptes non activés n'ont aucun droit\n return false;\n } else if ($user['permanent'] == 1) {\n // Seuls les membres permanents ont des droits sur les fichiers, pour commencer\n\n $action = $this->request->getParam('action');\n $fichier_slug = $this->request->getParam('pass.0');\n\n if ($fichier_slug && ($action === 'edit' || $action === 'delete')) {\n // Fichier existant : seul son owner peut l'edit / delete\n $fichier = $this->Fichiers->findById($fichier_slug)->first();\n return $user['id'] === $fichier['membre_id'];\n }\n }\n return false;\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 return request()->user() != null;\n }", "public function authorize()\n {\n return Auth::user()->data_confirmacao != null;\n }", "public function authorize()\n {\n return Auth::user() && Auth::user()->hasPermissionTo('create-users');\n }", "public function isAuthorized($usuario) {\n switch ($usuario['grupo_id']) {\n case 1: // SuperAdministradores\n case 2: // Administradores\n {\n return true;\n break;\n }\n case 3: // Publicadores\n {\n switch ($this->request->params['action']) {\n case 'administracion_index':\n case 'administracion_add':\n case 'administracion_edit':\n case 'administracion_publicar':\n case 'administracion_despublicar': {\n return true;\n break;\n }\n }\n }\n case 4: // Pintores\n {\n switch ($this->request->params['action']) {\n case 'view': {\n return true;\n break;\n }\n default: {\n return false;\n break;\n }\n }\n break;\n }\n }\n return false;\n }", "public function authorize()\n {\n $position = Position::findOrFail($this->position_id);\n $project = $position->Project;\n $position_application_count = Application::where('user_id', auth()->user()->id)->where('position_id', $this->position_id)->count();\n if ($position_application_count == 0 && $project->user_id != auth()->user()->id && $position->status == 1) {\n //daca nu este proiectul meu si daca nu mai am aplicatii la aceasta pozitie si daca statusul positiei este 1\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user() != null;\n }", "public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }", "public function authorize()\n {\n return $this->user() && $this->user()->role === Constants::USER_ROLE_ADMIN;\n }", "function check_has_permissions() {\n $details = $this->get_user_details('1');\n\t\treturn 0 != strcmp(strtoupper($details['StatusInfo']), '\"ACCESS DENIED\"');\n\t}", "function userCanEditPage()\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->pageEdit(Yawp::authUsername(), $this->area, \n\t\t\t$this->page);\n\t}", "function checkPermissions() {\n \t//If blog owner or super user\n \t$current_user = wp_get_current_user();\n\t\tif(is_super_admin() || (get_bloginfo('admin_email') === $current_user->user_email)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function authorize()\n {\n if ($this->user && ($this->user->hasPermission('manage_pages_contents') ) ) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $user = Auth::user();\n return $user && $user->rol == 'admin';\n }", "public static function currentUserHasAccess() {\n return current_user_can('admin_access');\n }", "public function authorize()\n {\n return $this->user()->can(\"Crear Nómina\");\n }", "public static function TienePermiso($permiso)\n\t\t{\n\t\t\tif(!Usuario::EstaIdentificado()) return false;\n\t\t\t\n\t\t\t$identificador = $_SESSION[\"usuario\"];\n\t\t\t\n\t\t\t\n\t\t\t// si no coincide el hash no damos permisos\n\t\t\tif( md5($identificador[\"usuario_id\"].RESCATE_CLAVE) != $identificador[\"hash\"] )\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//$usuario = new Usuario(intval($identificador[\"usuario_id\"]));\n\n\t\t\t\t//return $usuario->rol->ComprobarPermiso($permiso);\n\t\t\t\t\n\t\t\t\t$bd = BD::Instancia();\n\t\n\t\t\t\t// si tiene el rol de administrador siempre tiene permiso\n\t\t\t\t$consulta = \"SELECT COUNT(*) FROM usuario WHERE usuario_id= '\". intval($identificador[\"usuario_id\"]) .\"' AND usuario_rol_id = '1' \";\n\t\t\t\tif ( $bd->ContarFilas($consulta) > 0 )\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// si no pertenece al rol de administrador miramos si tiene el permiso\n\t\t\t\t$consulta = \"SELECT COUNT(*) FROM usuario LEFT JOIN rolpermiso ON usuario_rol_id=rolpermiso_rol_id LEFT JOIN permiso on permiso_id=rolpermiso_permiso_id WHERE permiso_nombreinterno = '\".$permiso.\"' AND usuario_id='\". intval($identificador[\"usuario_id\"]) .\"'\";\n\t\t\t\t\n\t\t\t\tif ( $bd->ContarFilas($consulta) > 0 )\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function isAllowed() {\n\t\tif (!$this->session->has('auth')) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$user = User::findFirst(array('username' => $this->session->get('auth')));\n\n\t\treturn $user->getSuperUser() ? true : false;\n\t}", "public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }", "function isUsersAccessable($path)\n\t{\n\t\t$AllArray =array('user/index',\n\t\t\t\t\t\t'user/listing',\n\t\t\t\t\t\t'user/add',\n\t\t\t\t\t\t'user/edit',\n\t\t\t\t\t\t'project/index',\n\t\t\t\t\t\t'project/listing',\n\t\t\t\t\t\t'project/add',\n\t\t\t\t\t\t'project/edit',\n\t\t\t\t\t\t'customer/index',\n\t\t\t\t\t\t'customer/listing',\n\t\t\t\t\t\t'customer/add',\n\t\t\t\t\t\t'customer/edit',\n\t\t\t\t\t\t'question/index',\n\t\t\t\t\t\t'question/listing',\n\t\t\t\t\t\t'question/add',\n\t\t\t\t\t\t'question/edit',\n\t\t\t\t\t\t'customer/index',\n\t\t\t\t\t\t'customer/listing',\n\t\t\t\t\t\t'customer/edit',\n\t\t\t\t\t\t'customer/surveys',\n\t\t\t\t\t\t'customer/survey',\n\t\t\t\t\t\t'question/index',\n\t\t\t\t\t\t'question/listing',\n\t\t\t\t\t\t'question/edit',\n\t\t\t\t\t\t'results/index',\n\t\t\t\t\t\t'results/listing',\n\t\t\t\t\t\t'results/general',\n\t\t\t\t\t\t'results/single',\n\t\t\t\t\t\t'generador/index',\n\t\t\t\t\t\t'generador/publish'\n\t\t\t\t\t\t);\n\t\t$customerArray =array(\n\t\t\t\t\t\t'customer/index',\n\t\t\t\t\t\t'customer/listing',\n\t\t\t\t\t\t'customer/edit',\n\t\t\t\t\t\t'customer/surveys',\n\t\t\t\t\t\t'customer/survey',\n\t\t\t\t\t\t'question/index',\n\t\t\t\t\t\t'question/listing',\n\t\t\t\t\t\t'question/edit',\n\t\t\t\t\t\t'results/index',\n\t\t\t\t\t\t'results/listing',\n\t\t\t\t\t\t'results/general',\n\t\t\t\t\t\t'results/single',\n\t\t\t\t\t\t'generador/index',\n\t\t\t\t\t\t'generador/publish'\n\t\t\t\t\t\t);\n\t\t\n\t\tif($_SESSION[\"SESS_USER_ROLE\"] == \"administrador\")\n\t\t{\n// \t\t\tif(!in_array($path,$AllArray))\n// \t\t\t{\n// \t\t\t\t$this->wtRedirect($_SESSION[\"ROLE_PATH\"]); \n// \t\t\t}\n\t\t}\n\t\t\n\t\telseif($_SESSION[\"SESS_USER_ROLE\"] == \"cliente\" )\n\t\t{\n\t\t\t//SI no esta en el arreglo, se redirecciona a su path original Controller home\n\t\t\tif(!in_array($path,$customerArray))\n\t\t\t{\n\t\t\t\t$this->wtRedirect($_SESSION[\"ROLE_PATH\"]); \n\t\t\t}\n\t\t}\n\t}", "static function tieneAlgunPermiso($permisos){\n\n \n\n if(is_array($permisos) && is_array(F3::get('SESSION.permiso'))){\n foreach ($permisos as $permiso) {\n\t\t if(array_search($permiso,F3::get('SESSION.permiso'))!==false){\n\t\t return true;\n\t\t }\n\t\t}\n\t }else if(is_array($permisos) && !is_array(F3::get('SESSION.permiso'))){\n\n if(array_search(F3::get('SESSION.permiso'),$permisos)!==false){\n\t\t return true;\n\t\t }else{\n\t\t return false;\n\t\t }\n\t }else if(!is_array($permisos) && is_array(F3::get('SESSION.permiso'))){\n if(array_search($permisos,F3::get('SESSION.permiso'))!==false){\n\n\t\t return true;\n\t\t }else{\n //echo \"no entra\";\n\t\t return false;\n\t\t }\n\t }else{\n if(F3::get('SESSION.permiso')==$permisos){\n\t return true;\n\t\t }\n\t }\n\t return false;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\n return $this->user() !== null;\n }", "public function authorize()\n {\t//para ver si el usuario tiene acceso a este metodo\n //return false;\n return true;\n }", "public function authorize()\n {\n return $this->user()->can('update_users');\n }", "public function authorize()\n {\n return (\\Auth::user()->hasRole('admin')) || (\\Auth::user()->hasRole('editor')) || \\Auth::user()->canDo('UPDATE_POLLS');\n }", "public function isAllowedForUser(){\n\t\treturn true;\n\t}", "public function isAuthorized($user=null){\n\t\tif($user['role']=='user'){\n\t\t\tif(in_array($this->action,array('add','index','view'))){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->Session->setFlash('No puede acceder, NO TIENES PERMISOS!', 'default', array('class'=>'alert alert-danger'));\n\t\t\t\t$this->redirect(array('controller' =>'produccions','action'=>'index'));\n\n\t\t\t\t}\n\t\t\t}\n\t\tif($user['role']=='view'){\n\t\t\tif(in_array($this->action,array('index','view'))){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$this->Session->setFlash('No puede acceder, NO TIENES PERMISOS!', 'default', array('class'=>'alert alert-danger'));\n\t\t\t\t$this->redirect(array('controller' =>'produccions','action'=>'index'));\n\n\t\t\t\t}\n\t\t\t}\n\t\treturn parent::isAuthorized($user);\n\t}", "public function authorize()\n\t{\n\t\t// La autorización siempre será true por que cualquier usuario podrá\n\t\t// crear álbumes y nosotros se los asociaremos al usuario\n\t\t// que tiene la sesión creada.\n\t\treturn true;\n\t}", "public function authorize()\n {\n return $this->user()->rol == 'admin' ? true : false;\n }", "public function authorize()\n {\n return (Auth::user()->type === User::VENDEDOR);\n }", "public function isAuthorize(){\n $userPlan = $this->request->session()->get('userPlan');\n return ($userPlan >= 1)? true : abort(404) ;\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 }", "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 }", "protected function userIsAdmin ()\n {\n $tokenHeader = apache_request_headers();\n $token = $tokenHeader['token'];\n $datosUsers = JWT::decode($token, $this->key, $this->algorithm);\n\n if($datosUsers->nombre==\"admin\")\n {\n return true;\n }\n else\n {\n return false;\n } \n }", "public function authorize()\n {\n return request()->loggedin_role === 1;\n }", "public static function hf_user_permission() {\n $current_user = wp_get_current_user();\n $current_user->roles = apply_filters('hf_add_user_roles', $current_user->roles);\n $current_user->roles = array_unique($current_user->roles);\n $user_ok = false;\n\n $wf_roles = apply_filters('hf_user_permission_roles', array('administrator', 'shop_manager'));\n if ($current_user instanceof WP_User) {\n $can_users = array_intersect($wf_roles, $current_user->roles);\n if (!empty($can_users)) {\n $user_ok = true;\n }\n }\n return $user_ok;\n }", "public static function hf_user_permission() {\n $current_user = wp_get_current_user();\n $current_user->roles = apply_filters('hf_add_user_roles', $current_user->roles);\n $current_user->roles = array_unique($current_user->roles);\n $user_ok = false;\n\n $wf_roles = apply_filters('hf_user_permission_roles', array('administrator', 'shop_manager'));\n if ($current_user instanceof WP_User) {\n $can_users = array_intersect($wf_roles, $current_user->roles);\n if (!empty($can_users)) {\n $user_ok = true;\n }\n }\n return $user_ok;\n }", "public static function hf_user_permission() {\n $current_user = wp_get_current_user();\n $current_user->roles = apply_filters('hf_add_user_roles', $current_user->roles);\n $current_user->roles = array_unique($current_user->roles);\n $user_ok = false;\n\n $wf_roles = apply_filters('hf_user_permission_roles', array('administrator', 'shop_manager'));\n if ($current_user instanceof WP_User) {\n $can_users = array_intersect($wf_roles, $current_user->roles);\n if (!empty($can_users)) {\n $user_ok = true;\n }\n }\n return $user_ok;\n }", "public static function hf_user_permission() {\n $current_user = wp_get_current_user();\n $current_user->roles = apply_filters('hf_add_user_roles', $current_user->roles);\n $current_user->roles = array_unique($current_user->roles);\n $user_ok = false;\n\n $wf_roles = apply_filters('hf_user_permission_roles', array('administrator', 'shop_manager'));\n if ($current_user instanceof WP_User) {\n $can_users = array_intersect($wf_roles, $current_user->roles);\n if (!empty($can_users)) {\n $user_ok = true;\n }\n }\n return $user_ok;\n }", "private function permissible($userId)\n {\n $authUser = Auth::user();\n return $authUser->role==config('USER.ROLE.ADMIN')||$authUser->id==$userId;\n }", "public function authorize()\n {\n return !is_null($this->user());\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 performPermission()\n {\n // User Role flags\n // Admin = 20\n // Editor = 40\n // Author = 60 (deprecated)\n // Webuser = 100 (deprecated)\n //\n // Webuser dont have access to edit node data\n //\n if($this->controllerVar['loggedUserRole'] > 40)\n {\n return false;\n }\n\n return true;\n }", "public function isAuthorized(){\n\t\t// Check that username is not empty and exists\n\t\t;return ($username = $_SERVER['PHP_AUTH_USER']) && array_key_exists($username, $this->users_pwds)\n\t\t// Check passord validity\n\t\t&& $this->users_pwds[$username] === $_SERVER['PHP_AUTH_PW']\n\t\t;\n\t}", "function userIsPageAdmin() {\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->pageAdmin(Yawp::authUsername(), $this->area, $this->page);\n\t}", "public function isAuthorized($user) {\n if (isset($user['role']) && $user['role'] === 'admin') {\n return true;\n }\n\tif ($this->action === 'list_download') {\n return true;\n }\n\tif ($this->action === 'retrieve_download') {\n return true;\n }\n // Default deny\n return false;\n}", "public function authorize()\n {\n if(\\Auth::guest())\n {\n return false;\n } else {\n // Action 1 - Check if authenticated user is a superadmin\n if(\\Auth::User()->hasRole('superadmin'))\n return true;\n\n // Action 2 - Find UUID from request and compare to authenticated user\n $user = User::where('uuid', $this->user_uuid)->firstOrFail();\n if($user->id == \\Auth::User()->id)\n return true;\n\n // Action 3 - Fail request\n return false;\n }\n }", "function olc_check_permission($pagename)\n{\n\tif (CUSTOMER_IS_ADMIN)\n\t{\n\t\tif ($pagename!='index')\n\t\t{\n\t\t\t$access_permission_query = olc_db_query(SELECT . $pagename . SQL_FROM . TABLE_ADMIN_ACCESS .\n\t\t\tSQL_WHERE.\"customers_id = '\" .CUSTOMER_ID . APOS);\n\t\t\t$access_permission = olc_db_fetch_array($access_permission_query);\n\t\t\t$return=$access_permission[$pagename] == '1';\n\t\t\t//\t} else {\n\t\t\t//\t\tolc_redirect(olc_href_link(FILENAME_LOGIN));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$return=true;\n\t\t}\n\t}\n\treturn $return;\n}", "public function authorize(): bool\n {\n return $this->user() !== null;\n }", "public function isAuthorized($user){\n /*\n * \n 1 \tAdmin\n 2 \tOfficer / Manager\n 3 \tRead Only\n 4 \tStaff\n 5 \tUser / Operator\n 6 \tStudent\n 7 \tLimited\n */\n \n //managers can add / edit\n if (in_array($this->request->action, ['delete','add','edit','reorder'])) {\n if ($user['group_id'] <= 4) {\n return true;\n }\n }\n \n \n //Admins have all\n return parent::isAuthorized($user);\n }", "public function authorize()\n {\n if (!\\Auth::guest()) {\n $user = \\Auth::getUser();\n if ($user->type == User::USER_TYPE_ADMIN) {\n return true;\n }\n }\n\n return false;\n }", "public function isAuthorized($user){ //takes in the current user as argument\t \n\t //for now, if you login, give them all authorization\t \n\t return true; \n\t}", "public function authorize()\n {\n /**\n * @var User $user\n * @var Document $document\n */\n $user = Auth::user();\n $document = $this->route('document');\n\n return (int)$user->id === (int)$document->user_id;\n }", "public function permissions()\n\t{\n\t\t// add any additional custom permission checking here and \n\t\t// return FALSE if user doesn't have permission\n\t\n\t\treturn TRUE;\n\t}", "public function authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }", "function checkPermissions() {\n\t\t$current_user = wp_get_current_user();\n\t\tif(current_user_can('manage-lepress') || is_super_admin() || (get_bloginfo('admin_email') === $current_user->user_email)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "protected function isPermissionCorrect() {}", "public function authorize()\n {\n return !empty(Auth::user()) && ($this->user()->isAnAdmin() || $this->user()->hasRole('user'));\n }", "public static function isSecretary()\n {\n $permissions = [\"Segreteria\", \"Vice direzione\", \"Direzione\"];\n return in_array($_SESSION[\"permission\"], $permissions);\n }", "public function authorize()\n {\n return Auth::user()->hasAnyRole(['kuchar', 'manager']);\n }", "public function havePermission($permission){\n $roles_user = $this->roles;\n\n //recorro cada rol y lo comparo\n foreach ($roles_user as $role) {\n //si tiene full acceso a los permisos regreso true\n if ($role['full-access'] == 'Si') {\n return true;\n }\n //recorro los permisos correspondientes al rol\n foreach ($role->permissions as $permission_user) {\n //verifico si tiene entre sus permisos el permiso a verificar en la function\n //si lo tiene regreso true\n if ($permission_user->slug == $permission) {\n return true;\n }\n }\n }\n //sino tiene ningun permiso regreso false\n return false;\n }", "function hasPermission($perm)\n {\n switch ($perm) {\n case Horde_Perms::EDIT: return false;\n case Horde_Perms::DELETE: return false;\n default: return true;\n }\n }", "public function isAuthorized($user) {\n if ($this->action === 'index') {\n return true;\n }\n\n if (in_array($this->action, array('upload','update','view'))) {\n if ($user['role']=='registrado') {\n return true;\n }\n }\n\n if (in_array($this->action, array('upload','update','view'))) {\n if ($user['role']=='director') {\n return true;\n }\n }\n\n if (in_array($this->action, array('upload','download','update','view','delete'))) {\n if ($user['role']=='administrator') {\n return true;\n }\n }\n\n\n if (in_array($this->action, array('upload','download','update','view','delete'))) {\n if ($user['role']=='sadmin') {\n return true;\n }\n }\n\n }", "public function authorize()\n {\n return Auth::guard()->user()->role == 'admin';\n }", "public function isAuthorized($user){\n $this->set('current_user', $this->Auth->user());\n\n if ($this->action === 'add' || $this->action === 'about') {\n return true;\n }\n \n if(in_array($this->action, array('edit', 'delete'))){\n if($this->request->params['pass'][0] == $user['id'] || $user['role'] === 'admin'){ \n return true;\n } \n }\n return parent::isAuthorized($user); //gives permission to the admin to access everything\n }", "public function isAuthorized($user) {\n if ($this->action === 'apply' || $this->action === 'saveProject'){\n if($user['role'] == 'student' || $user['role'] == 'staff'){\n return true; \n } \n }\n \n if ($this->action === 'applied' || $this->action === 'saved'){\n if($user['role'] == 'student' || $user['role'] == 'staff'){\n return true; \n }\n }\n \n if ($this->action === 'add' || $this->action === 'applicants') {\n if($user['role'] == 'research'){\n return true;\n }\n }\n \n if ($this->action === 'projects') {\n if($user['role'] == 'research'){\n return true;\n }\n }\n\n if (in_array($this->action, array('edit', 'delete'))) {\n $projectId = (int) $this->request->params['pass'][0];\n if ($this->Project->isOwnedBy($projectId, $user['id'])) {\n return true;\n }\n }\n\n return parent::isAuthorized($user);\n}", "function user_has_permission() {\r\n\tglobal $wp_query;\r\n\r\n\tif ( is_posttype( 'itinerary', POSTTYPE_ARCHIVEORSINGLE ) ) {\r\n\t\treturn current_user_can( 'ind_read_itinerary' );\r\n\t}\r\n\r\n\tif ( is_posttype( 'magazine', POSTTYPE_SINGLEONLY ) ) {\r\n\t\t// Check if this is the most recent post somehow\r\n\t}\r\n\r\n\tif ( is_posttype( 'magazine', POSTTYPE_ARCHIVEONLY ) ) {\r\n\t\treturn true;\r\n\t\t$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;\r\n\t\t$current = ( $paged == 1 && $wp_query->current_post == 0 );\r\n\t\treturn ( current_user_can( 'ind_read_magazine_archive' ) ||\r\n\t\t\t( $current /* && current_user_can( 'ind_read_magazine' ) */ ) );\r\n\t}\r\n\t\r\n\tif ( is_posttype( 'restaurant', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'shop', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'activity', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'article', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'insidertrip' ) ) {\r\n\t\tif ( current_user_can( 'ind_read_itinerary' ) ) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\t$counter_show = \\indagare\\cookies\\Counters::getPageCountGroup( 'restricted' );\r\n\t\tif ( $counter_show > INDG_PREVIEW_COUNT_MAX ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\r\n\treturn true;\r\n}", "public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}", "public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }", "public static function isAllowed() {\r\n\t\treturn TodoyuAuth::isAdmin();\r\n\t}", "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 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 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 function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }", "public function authorize()\n {\n return $this->user()->can('update', $this->route('user'));\n }", "public function verPerfil()\n\t{\n try{\n //Verificación de los permisos del usuario para poder realizar esta acción\n $permisos = [];\n $usuario_actual = Auth::user();\n $roles = $usuario_actual->roles()->get();\n foreach($roles as $rol){\n $permisos = $rol->perms()->get();\n }\n $si_puede = false;\n foreach($permisos as $permiso){\n if(($permiso->name) == 'ver_perfil'){\n $si_puede = true;\n }\n }\n\n if($si_puede) {// Si el usuario posee los permisos necesarios continua con la acción\n\n $data['errores'] = '';\n $data['datos'] = Participante::where('id_usuario', '=', $usuario_actual->id)->get(); // Se obtienen los datos del participante\n $data['email']= User::where('id', '=', $usuario_actual->id)->get(); // Se obtiene el correo principal del participante;\n// dd($data['datos']);\n\n return view('participantes.ver-perfil', $data);\n\n }else{ // Si el usuario no posee los permisos necesarios se le mostrará un mensaje de error\n\n return view('errors.sin_permiso');\n }\n }\n catch (Exception $e) {\n\n return view('errors.error')->with('error',$e->getMessage());\n }\n\t}", "function hasPermission($uriPermission){\n\tif(Auth::check() && Auth::user()->hasAnyPermission($uriPermission))\n return true;\n else\n return false;\n}" ]
[ "0.7302327", "0.7177671", "0.6812378", "0.6807805", "0.67976606", "0.67739433", "0.67588925", "0.6756899", "0.67545027", "0.6748333", "0.6741428", "0.6735859", "0.6712728", "0.6712728", "0.66829133", "0.66829133", "0.66806954", "0.6677254", "0.66636235", "0.66423523", "0.66413414", "0.6624923", "0.6610473", "0.6601492", "0.6595495", "0.65940386", "0.6592075", "0.6589263", "0.6582525", "0.65694076", "0.6557303", "0.6551309", "0.6535777", "0.65344775", "0.6519953", "0.6514603", "0.64976156", "0.6493577", "0.6492174", "0.64880025", "0.6487761", "0.64872247", "0.6481445", "0.6473899", "0.6470791", "0.6470791", "0.64700943", "0.6466059", "0.64614826", "0.645887", "0.64572334", "0.6455162", "0.6447573", "0.64472", "0.6446256", "0.64456236", "0.64456236", "0.64439964", "0.64398825", "0.6438634", "0.6438634", "0.6438634", "0.6438634", "0.64342827", "0.6432771", "0.64205426", "0.64101124", "0.64085376", "0.6404106", "0.63965815", "0.6394523", "0.6390814", "0.6389487", "0.6387443", "0.63846165", "0.6375954", "0.6373516", "0.6364807", "0.63626796", "0.6359258", "0.63583446", "0.6353134", "0.6350888", "0.63508004", "0.633837", "0.63341755", "0.6330641", "0.63301504", "0.6328523", "0.632578", "0.63086706", "0.6308409", "0.6305377", "0.630502", "0.6304035", "0.6302471", "0.6300752", "0.62897724", "0.6289377", "0.6283971", "0.6280117" ]
0.0
-1
Remplace tous les espaces.
public function enleveEspaces(string $str): string { return str_replace(" ", "-", $str); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function squish(){\n\t\t$out = $this->trim();\n\t\treturn $out->gsub('/\\s+/',' ');\n\t}", "public function trimSpaces() {\r\n $this->contents = preg_replace('/ {2,}/', ' ', trim($this->contents));\r\n }", "private function positionAfterWhitespace()\n {\n }", "function valEspacios( $texto )\n{\n $texto = trim( $texto );\n \n while( strpos( $texto, \" \" ) > 0 )\n $texto = str_replace( \" \", \" \", $texto );\n \n return $texto;\n}", "function espace($valeur){\r\n\t$chaine = substr(\"$valeur\",0,-4).\" \".substr(\"$valeur\",4);\r\n\treturn $chaine;\r\n}", "function vire_espace ($t) {\n\t$chaine = \"\";\n\n\tfor ($i=0; $i < strlen($t); $i++) {\n\t\t$c = substr($t, $i, 1);\n\t\tif ($c != \" \") {\n\t\t\t$chaine .= $c;\n\t\t}\n\t}\n\treturn ($chaine);\n}", "function minifyKeepSpaces($element) {\n\t\treturn preg_replace('/\\s+/', ' ', $element);\n\t}", "protected function delete_space($start, $size = 2)\n {\n $sql = \"UPDATE $this->_table_name\n SET\n $this->left_column = ($this->left_column - $size)\n WHERE\n $this->left_column >= $start\n AND $this->scope_column = $this->scope\n \";\n $this->_db->exec($sql);\n\n $sql = \"UPDATE $this->_table_name\n SET\n $this->right_column = ($this->right_column - $size)\n WHERE\n $this->right_column >= $start\n AND $this->scope_column = $this->scope\n \";\n $this->_db->exec($sql);\n }", "function spaces() {\n return str_pad('', $this->currentIndention, ' ', STR_PAD_LEFT);\n }", "protected function skipSpaces() : void\n {\n while($this->pos < strlen($this->src)\n && $this->isSpace($this->src[$this->pos]))\n {\n $this->pos++;\n }\n }", "protected function linear_whitespace()\n {\n }", "public function clearEmbargo();", "public function presetEditorPosition()\n {\n $editor = $this->format;\n\n $editor->shiftCurrentXposition($this->shape->getBorderWidth() / 2);\n\n // if there is no space left on the right of the convas to shift to,\n // we update the y axis to shift down to the next line\n if ($editor->getWidth() - $editor->getCurrentXposition() < $this->shape->getWidth(true)\n && $editor->getHeight() - $editor->getCurrentYposition() >= $this->shape->getHeight(true)) {\n\n $editor->shiftCurrentYposition($editor->biggestYpostion());\n $editor->resetCurrentXposition($this->shape->getBorderWidth() / 2);\n\n }\n }", "public function space( $space){\n\t\t\t\t\n\t\t\t\t$this->_spacing += $space;\n\t\t\t\n\t\t}", "private function blank(): void\n {\n $width = $this->getRenderWidth();\n $height = $this->getRenderHeight();\n\n for ($h = 0; $h <= $this->height && $h < $height; ++$h) {\n $this->cli->jump($this->pos['x'], $this->pos['y'] + $h);\n $this->cli->write(str_repeat(' ', $width));\n }\n }", "public function getAlternateSpace() {}", "public function clean() {\n $this->data = \"\";\n $this->currentRow = 1;\n $this->curPosition = 0;\n }", "protected function __rm_align__(){\n\t\t$this->align(\"normal\");\n\t}", "private function getAvaibleSpaces(){\n\t\t$spaces = array();\n\t\tfor ($i = 0;$i < count($this->gato[0]);++$i) {\n\t\t\tfor ($j = 0;$j < count($this->gato[0]);++$j) {\n\t\t\t\tif(strcmp($this->gato[$i][$j],'') == 0){\n\t\t\t\t\t//error_log(\"Free: \".$i.\",\".$j);\n\t\t\t\t\tarray_push($spaces, array($i,$j));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $spaces;\n\t}", "private function _spaceRemover($args)\r\n {\r\n if (isset($args[1]) && $args[1] != '') { // 0.func\r\n return $args[1].' .'.$args[2];\r\n } elseif (isset($args[4])){\r\n return ' ';\r\n } else return '';\r\n }", "public function tiltUpCamaraPresidencia() {\n\n self::$presidencia->moverArriba();\n\n }", "function g()\r\n\t{\r\n\t\t$this->str_html = str_replace(array(\"\\r\\n\",\"\\n\",\"\\r\",\"\\t\"), ' ', $this->str_html);\r\n\t\t$this->str_html = preg_replace(\"/(\\s{2,})/\", ' ', $this->str_html);\r\n\t\treturn $this->replace_vars($this->str_html, $this->html_a, 1);\r\n#\t\treturn $this->str_html;\r\n\t}", "public function updateEditotPosition()\n {\n $this->format->shiftCurrentXposition($this->shape->getWidth() + ($this->shape->getBorderWidth() / 2));\n }", "function replace_leading_spaces($string)\n{\n return preg_replace('/\\G /', '&nbsp;', $string);\n}", "public static function unspace($s) // {{{\n {\n return preg_replace(\"/\\\\s\\\\s*/ms\", \" \", $s);\n }", "static function eliminarEspacios($texto) {\n return (is_string($texto)) ? str_replace(\" \", \"\", $texto) : $texto;\n }", "public function movePostFromEndToTheMiddle() {}", "private function offset()\n {\n $this->strA = ' ' . $this->strA;\n $this->strB = ' ' . $this->strB;\n }", "public function trimWhitespace() {\r\n $arr = $this->toArray();\r\n $newContents = \"\";\r\n foreach($arr as $line) {\r\n $newLine = preg_replace('/\\s\\s+/', ' ', trim($line)).\"\\n\";\r\n if ($newLine != \"\\n\") $newContents .= $newLine;\r\n }\r\n $this->contents = $newContents;\r\n }", "protected function create_space($start, $size = 2)\n {\n $sql = \"UPDATE $this->_table_name\n SET\n $this->left_column = ($this->left_column + $size)\n WHERE\n $this->left_column >= $start\n AND $this->scope_column = $this->scope\n \";\n $this->_db->exec($sql);\n\n $sql = \"UPDATE $this->_table_name\n SET\n $this->right_column = ($this->right_column + $size)\n WHERE\n $this->right_column >= $start\n AND $this->scope_column = $this->scope\n \";\n $this->_db->exec($sql);\n }", "public function tiltUpCamaraAlumnos2() {\n\n self::$alumnos2->moverArriba();\n\n }", "public function clean_space()\n {\n for ($i = 0; $i < strlen($this->main_str); $i++) {\n if ($this->main_str[$i] == ' ') {\n $this->main_str[$i] = '';\n }\n }\n return $this->main_str;\n }", "public function zeroize()\n {\n for ($i = $this->count() - 1; $i >= 0; --$i) {\n $this->offsetSet($i, 0);\n }\n }", "private function _resetBoard()\n {\n $this->curPos = 0;\n $this->curRow = 0;\n $this->_createBoard();\n }", "public function expand()\n {\n $oldTable = clone $this;\n\n if ($this->cap < 1024) $this->cap *= 2;\n else $this->cap += ($this->cap >> 2);\n\n $this->reset();\n\n foreach ($oldTable as $key => $value) {\n $this->set($key, $value);\n }\n }", "public function ClearDoubleSpace($Text) {\n\t\treturn str_replace(\" \", \" \", $Text);\n\t\t\n\t}", "public function emptyBoard()\n {\n $this->board = array_fill(0, $this->boardSize, array_fill(0, $this->boardSize, ''));\n }", "public static function cleanSpaces($input)\n {\n $nonbreaking_space = chr(0xC2) . chr(0xA0);\n $search_spaces = ['<p>&nbsp;</p>', '&nbsp;', $nonbreaking_space, ' '];\n $replace_spaces = ['', ' ', ' ', ' '];\n $out = str_replace($search_spaces, $replace_spaces, $input);\n $out = trim(preg_replace('/\\s{2,}/', ' ', $out));\n return $out;\n }", "protected function tempPosition()\n {\n $this->{$this->getPositionColumn()} = static::$insanePosition;\n $this->save();\n }", "public function tiltUpCamaraAlumnos1() {\n\n self::$alumnos1->moverArriba();\n\n }", "public function restoreIndentation()\n {\n if ( count( $this->indentationStack ) == 0 )\n {\n throw new ezcTemplateInternalException( \"Indentation stack is empty, cannot restore last indentation.\" );\n }\n\n $this->currentIndentation = array_pop( $this->indentationStack );\n if ( $this->currentIndentation > 0 )\n {\n $this->indentationText = str_repeat( \" \", $this->currentIndentation );\n }\n else\n {\n $this->indentationText = \"\";\n }\n }", "public function reset()\n\t\t{\n\t\t\t$this->styles = [];\n\t\t}", "private function cleanUp(float $leftover) : void\n {\n if($leftover >= 0 || empty($this->columns))\n {\n return;\n }\n\n $col = array_pop($this->columns);\n \n $col->setValue($col->getValue() + $leftover);\n }", "public function panLeftCamaraAlumnos2() {\n\n self::$alumnos2->moverALaIzquierda();\n }", "function MoveRep($drive,$space) { // deplace le repertoire de sauvegarde $drive vers $space\n\t$cmd=\"/usr/bin/sudo /usr/share/se3/scripts/move_rep_backuppc.sh \".$drive.\" \".$space;\n\texec($cmd);\n}", "function __ommit_nbsp($matches){\n return $matches[1].str_replace('&nbsp;', ' ', $matches[2]).$matches[3];\n}", "function __ommit_nbsp($matches){\n return $matches[1].str_replace('&nbsp;', ' ', $matches[2]).$matches[3];\n}", "function __ommit_nbsp($matches){\n return $matches[1].str_replace('&nbsp;', ' ', $matches[2]).$matches[3];\n}", "function __ommit_nbsp($matches){\n return $matches[1].str_replace('&nbsp;', ' ', $matches[2]).$matches[3];\n}", "function __ommit_nbsp($matches){\n return $matches[1].str_replace('&nbsp;', ' ', $matches[2]).$matches[3];\n}", "function gc_sermon_before_after($content)\n{\n\t$content = strip_tags($content);\n\t$content = str_replace(\"\\xc2\\xa0\", ' ', $content);\n\t$content = preg_replace('/<p>/', '<span class=\"gc-right-col\">', $content);\n\t$content = preg_replace('/<\\/p>/', '</span>', $content);\n\treturn $content;\n}", "function moveLeft()\n {\n $this->position--;\n if ($this->position < 0) {\n $this->position++;\n array_unshift($this->line, '_');\n }\n }", "function minifyHard($element) {\n\t\t$element = preg_replace('/\\s+/', ' ', $element);\n\t\t$element = trim($element);\n\t\treturn trim($element);\n\t}", "public function resetCurrent(): void\n {\n $this->current = $this->lastPart = '';\n }", "function infy_tab($spaces = 4)\n {\n return str_repeat(' ', $spaces);\n }", "private function init()\n\t{\n\t\tfor ($i = 0 ; $i < $this->row ; $i++) {\n\t\t\tfor($j = 0 ; $j < $this->col ; $j++) {\n\t\t\t\t$this->arr[$i][$j] = \" \";\n\t\t\t}\n\t\t}\n\t}", "protected function cleanup()\n {\n $this->internalInliner->setHTML('');\n $this->internalInliner->setCSS('');\n }", "function remake($s)\n{\n $s = str_replace('&nbsp;',' ',$s);\n $s = str_replace(\"&nbsp;\",' ',$s);\n $s = html_entity_decode(strip_tags($s,ENT_COMPAT));\n $s = str_replace('&nbsp;',' ',$s);\n $s = str_replace(\"&nbsp;\",' ',$s);\n return $s;\n}", "private function RemoveWhiteSpace() {\n\t\twhile (in_array($this->ReadChar(), $this->whiteSpace));\n\t\t$this->ReturnCharToFile(1);\n\t}", "public static function swapMultipleSpacesForOne(string $string): string {\n return strlen($string) >= 2 ? preg_replace('!\\s+!', ' ', $string) : $string;\n }", "public function resetDelimiters() {\n\t\t$this->setColumnDelimiter('');\n\t\t$this->setEnclosure('');\n\t\t$this->setEscape(null);\n\t}", "function EliminarEspaciosInncesarios($str, $bControlTabReturn=false)\n{\n if( $bControlTabReturn ){\n $str = preg_replace('/[\\n\\r\\t]+/', '', $str);\n }\n return preg_replace('/\\s{2,}/', ' ', $str);\n}", "function clearTrim($trim)\n\t{\n\t\t$trim1 = trim($trim,'m');\n\t\techo \"Chuỗi { $trim } sau khi xóa bỏ m : \".$trim1.\"<br>\";\n\t\t$trim2 = strrev($trim);\n\t\t$trim2 = ltrim($trim2,'m');\n\t\techo \"Chuỗi sau khi đảo ngược và dùng ltrim xóa m : $trim2\";\n\t}", "public function resetTokens() {\n\t\t$this->tokens = $this->initialMarking;\n\t}", "public function panLeftCamaraPresidencia() {\n\n self::$presidencia->moverALaIzquierda();\n }", "public function justifyText() {\n $positions = array();\n for ($i = 0; $i < count($this->textToPrint); $i++) { // do this for each line of text\n\n $lineByLine = str_word_count($this->textToPrint[$i],1,self::CHARLIST);\n\n for ($j = 0; $j < count($lineByLine)-1; $j++) { // pad all words but last with trailing whitespace\n $lineByLine[$j] = $lineByLine[$j]. \" \";\n }\n $whiteSpaces = count($lineByLine) - 1; \n \n // this wasn't getting calculated correctly if there were multiple spaces, such as after a period in a sentence\n $localLength = 0;\n foreach ($lineByLine as $key => $value) {\n $localLength += strlen($value);\n }\n $spacesNeeded = $this->width - $localLength;\n \n if ($whiteSpaces > 0) { // dont' do this for a line containing only one word.\n \n $middle = (int) (($whiteSpaces+1)/2); // need to find middle of array\n $whereToInsert = $middle;\n $lkey = 1;\n $rkey = 1;\n $linc = 2;\n $rinc = 2;\n $rinit = $rkey;\n $linit = $lkey;\n\n if ($whiteSpaces % 2 == 0) { // if there are an even number of whitespaces, then we don't have a true middle, start at the right\n $side = \"right\";\n } else {\n $side = \"middle\";\n }\n\n while ($spacesNeeded > 0) {\n \n // insert to middle, then increment keys\n if ($side == \"middle\") {\n array_splice( $lineByLine, $whereToInsert, 0, \" \" );\n $lkey++;\n $rkey++;\n }\n \n if($side == \"right\") {\n $whereToInsert = $middle+$rkey;\n if ($whereToInsert >= count($lineByLine)) { // reached the end of array -- need to reset right side\n $rkey = $rinit;\n $whereToInsert = $middle+$rkey;\n }\n array_splice( $lineByLine, $whereToInsert, 0, \" \" );\n $rkey+=$rinc;\n } else if ($side == \"left\") {\n $whereToInsert = $middle-$lkey;\n if ($whereToInsert <= 0) { //reached the end of array -- need to reset left side\n $lkey = $linit;\n $whereToInsert = $middle-$lkey;\n }\n array_splice( $lineByLine, $whereToInsert, 0, \" \" );\n $lkey+=$linc;\n }\n \n $middle = (int) (count($lineByLine)/2);\n $side = ($side == \"right\" ? \"left\" : \"right\");\n $spacesNeeded--;\n }\n $this->textToPrint[$i] = implode(\"\", $lineByLine);\n }\n }\n }", "function _fillLeft()\n {\n return $this->_left + $this->_padding['left'];\n }", "function removemultiplespaces($str, $betweenquotes=true) {\n //preg_replace(\"/[[:blank:]]+/m\", \" \", $string);\n return preg_replace(\"/\\s+/S\", \" \", $str);\n }", "public function moveTagFromEndToTheMiddle() {}", "public static function spaced()\n {\n return self::generate(' ');\n }", "public function panLeftCamaraAlumnos1() {\n\n self::$alumnos1->moverALaIzquierda();\n\n }", "public function whiteSpace()\n {\n while (ctype_space($this->currentCharacter)){\n $this->consume();\n }\n }", "function lwreplace($lwchar){\n return(str_replace(' ','',$lwchar));\n}", "function trim_space($s)\n {\n $s = mb_ereg_replace('^( | )+', '', $s);\n $s = mb_ereg_replace('( | )+$', '', $s);\n\n return $s;\n }", "function replace_puce(){\n\tstatic $puce;\n\tif (!isset($puce))\n\t\t$puce = \"\\n<br />\".definir_puce().\"&nbsp;\";\n\treturn $puce;\n}", "function get_spaces(){\r\n\t\treturn apply_filters('em_booking_get_spaces',$this->spaces,$this);\r\n\t}", "public function ws()\n {\n while(ctype_space($this->c)) {\n $this->consume();\n }\n }", "function shortcode_empty_paragraph_fix($content) { \n\n\t\t $array = array (\n\t\t '<p>[' => '[',\n\t\t ']</p>' => ']',\n\t\t ']<br />' => ']',\n\t\t ']<br>' => ']'\n\t\t );\n\t\t \n\t\t $content = strtr($content, $array);\n\t\t \n\t\t return $content;\n\t\t}", "function init_map($longeur,$largeur)\n{\n $wordl = array();//init tableau\n for($x = 0 ; $x < $largeur ; $x++)\n {\n for($y = 0 ; $y < $longeur ; $y++)\n { \n \n $wordl[$x][$y] =\" . \";//ajout valeur par défaut & &nbsp; = espace vide\n }\n }\n return $wordl; //important le return de la map\n}", "public function xmlIndent(): void\n {\n $x = new \\DOMXPath($this);\n $nodeList = $x->query(\"//text()[not(ancestor-or-self::*/@xml:space = 'preserve')]\");\n foreach ($nodeList as $node) {\n // 1. \"Trim\" each text node by removing its leading and trailing spaces and newlines.\n $node->nodeValue = preg_replace(\"/^[\\s\\r\\n]+/\", '', $node->nodeValue);\n $node->nodeValue = preg_replace(\"/[\\s\\r\\n]+$/\", '', $node->nodeValue);\n // 2. Resulting text node may have become \"empty\" (zero length nodeValue) after trim. If so, remove it from the dom.\n if (mb_strlen($node->nodeValue) == 0) {\n $node->parentNode->removeChild($node);\n }\n }\n // 3. Starting from root (documentElement), recursively indent each node.\n $this->xmlIndentRecursive($this->documentElement, 0);\n }", "function carr_move_media_menu() {\n\tglobal $menu;\n\n\t$menu[24] = $menu[10];\n\tunset( $menu[10] );\n}", "public function fillUp($boxes)\n\t{\n\t\tif( !is_array($boxes) ) return $this;\n\n\t\tforeach ($this->boxes as $pos => $box) {\n\t\t\tif( $box === 'empty' ){\n\t\t\t\t$this->boxes[$pos] = array_shift($boxes);\n\t\t\t\t$this->boxes[$pos]->setPosition($pos);\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}", "public function clear()\n {\n $this->_id = null;\n $this->_title = null;\n $this->_positions = [];\n $this->_isDefault = null;\n }", "public function reset()\n {\n $this->values[self::_HERO_SPLIT_ENDING] = null;\n }", "function replaceWhitespace($str) {\n $result = $str;\n foreach (array(\n \" \", \" \\t\", \" \\r\", \" \\n\",\n \"\\t\\t\", \"\\t \", \"\\t\\r\", \"\\t\\n\",\n \"\\r\\r\", \"\\r \", \"\\r\\t\", \"\\r\\n\",\n \"\\n\\n\", \"\\n \", \"\\n\\t\", \"\\n\\r\",\n ) as $replacement) {\n $result = str_replace($replacement, $replacement[0], $result);\n }\n return $str !== $result ? replaceWhitespace($result) : $result;\n}", "function truncate()\n\t{\n\t\t$this->data = array();\n\t\t;\n\t}", "public function clean()\n {\n\n $this->tokens = [];\n $this->rawMatches = [];\n\n }", "public function fix() {}", "public function reset() {\n\t\t$this->start = $this->end = [];\n\t}", "public function fix() {}", "private function reset(){\n\n\t\tforeach($this as $k=>$v) unset($this->$k);\n\n\t\t$this::$map = $this->maper();\n\n\t\t$this->name = \"\";\n\n\t\t$this->address = [];\n\n\t\t$this->tableclass();\n\n\t}", "function phppage2readeable($t){\n\n return str_replace(\" \", \"&nbsp;\",preg_replace(\"/\\.php$/\", \"\", str_replace(\"_\", \"&nbsp;\", $t)));\n}", "public function collapseWhitespace()\n {\n return $this->regexReplace('[[:space:]]+', ' ')->trim();\n }", "function limpieza($str){\n \n $str = preg_replace(\"[\\n|\\r|\\t|\\n\\r]\", ' ', $str);\t//elimino el salto de linea\n $str = str_replace(' ',' ',$str);\n $str = str_replace(' ',' ',$str);\n $str = str_replace(' ',' ',$str);\n $str = str_replace(' ',' ',$str);\n $str = str_replace(' ',' ',$str);\n $str = str_replace(' ',' ',$str); \n $str = trim($str);\n\t\treturn $str;\n \n }", "public function fixContentPadding($document = null)\n\t{\n\n\t}", "function clean_spaces($var) {\n\treturn str_replace(' ', '', $var);\n}", "function _rfixed($string,$len=25) {\r\n\r\n $l=strlen($string);\r\n if ($l<$len) \r\n $de=str_repeat(\"&nbsp;\",($len-$l));\r\n \r\n return \"$string{$de}\";\r\n}", "public static function clear_name_space()\n\t{\n\t\t$_SESSION['Session_Master'][self::$s_name_space] = array();\n\t}", "public function panRightCamaraPresidencia() {\n\n self::$presidencia->moverALaDerecha();\n\n }", "function my_spaces2nbsp($s_string)\r\n{\r\n\t$sRet=\"\";\r\n\t$sRet = str_replace(SPACE_STRING,NBSP_STRING,$s_string);\r\n\r\n \treturn $sRet;\r\n}", "function s_m_put_txt_data_order_rows($rows, $width){\r\n // $width is containing the width for eacht column\r\n if(count($rows) == 0){\r\n echo \"Error, no rows\";\r\n die();\r\n }\r\n // add space\r\n $rows_new = array();\r\n for($r = 0; $r < count($rows); $r++){\r\n $k = 0;\r\n foreach ($rows[$r] as $key => $value) {\r\n $rows_new[$r][$key] = $rows[$r][$key] . str_repeat(\" \", $width[$k] - strlen($rows[$r][$key]));\r\n $k++;\r\n }\r\n }\r\n return $rows_new;\r\n}" ]
[ "0.5759457", "0.55674624", "0.5405632", "0.5403419", "0.51203746", "0.5117419", "0.5111738", "0.5026243", "0.50230396", "0.5021192", "0.4991821", "0.49074906", "0.48638064", "0.48347202", "0.48105904", "0.47935843", "0.4753197", "0.47508395", "0.4744266", "0.4708067", "0.4695409", "0.4693214", "0.46851894", "0.46778676", "0.46279994", "0.46276695", "0.46037143", "0.45926082", "0.45909947", "0.45862123", "0.45538458", "0.45514414", "0.45500353", "0.45483315", "0.45464745", "0.45305204", "0.4524069", "0.45101753", "0.4500241", "0.4494866", "0.44646767", "0.44549295", "0.44525647", "0.4449026", "0.4446329", "0.44425577", "0.44425577", "0.44425577", "0.44425577", "0.44425577", "0.442747", "0.44252715", "0.44229108", "0.44110817", "0.4406444", "0.43951735", "0.43938455", "0.4389762", "0.4382515", "0.43792415", "0.43771714", "0.4372142", "0.43686613", "0.4368005", "0.43591186", "0.43572062", "0.4355751", "0.43447775", "0.43391228", "0.4318372", "0.43036312", "0.42913914", "0.42827886", "0.42792767", "0.4277411", "0.4273763", "0.42484343", "0.42431414", "0.42408797", "0.4240522", "0.42345774", "0.42342383", "0.42338786", "0.4225161", "0.4223228", "0.42162552", "0.42159656", "0.42124176", "0.42124036", "0.42119065", "0.4209719", "0.42084852", "0.42069495", "0.42037633", "0.42016634", "0.42008314", "0.41980565", "0.41973966", "0.41890886", "0.41822466", "0.41788492" ]
0.0
-1
Display a listing of the resource.
public function index() { return view('contentmanagement::Faculty.index') ->withFaculty($this->faculty->all()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { return view('contentmanagement::Faculty.create'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(StoreRequest $request) { $data = $request->except('attachment'); $imageFile = $request->attachment; if($imageFile) { $extension = strrchr($imageFile->getClientOriginalName(), '.'); $new_file_name = "faculty_" . time(); $attachment = $imageFile->move($this->destinationpath, $new_file_name.$extension); $data['attachment'] = isset($attachment) ? $new_file_name . $extension : NULL; } $faculty = $this->faculty->create($data); if($faculty){ return redirect()->route('admin.content-management.faculty.index') ->withSuccessMessage('Faculty is added successfully.'); } return redirect()->back() ->withInput() ->withWarningMessage('Faculty can not be added.'); }
{ "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
Show the specified resource.
public function show() { }
{ "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 }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\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 }", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\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 show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function show($id) {}", "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 show(Question $question) // the show part requires an id (default)\n {\n //Show function does Route Model Binding, is the simple way of telling that this\n // function provides the id of the question by default\n return new QuestionResource($question);\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 return auth()->user()->getResource();\n }", "public function show($id)\n { \n \n }", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show($id)\n {\n // ..\n }", "public function show(Resena $resena)\n {\n }", "public function show($id)\n {\n $obj = Obj::where('id',$id)->first();\n \n $this->authorize('view', $obj);\n if($obj)\n return view('appl.'.$this->app.'.'.$this->module.'.show')\n ->with('obj',$obj)->with('app',$this);\n else\n abort(404);\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 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)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n // Code Goes Here\n }", "public function show(Show $show)\n {\n $this->authorize('basicView', $show);\n\n if (Auth::user()->can('view', $show)) {\n return $show->with(['hosts', 'invitees'])->first();\n }\n\n return new ShowResource($show);\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 }", "public function show($id) {\n\n\t}", "public function show($id){\n \n }", "public function show($id) {\n }", "public function show($id)\n {\n\n }", "public function show($id) {\n //\n }", "public function show($id) {\n //\n }", "public function show($id) {\n //\n }", "public function show($id) {\r\n //\r\n }", "public function show($id) {\r\n //\r\n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "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 }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n \n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show($id)\r\r\n {\r\r\n //\r\r\n }", "public function show($id)\r\r\n {\r\r\n //\r\r\n }", "public function show($id)\r\n {\r\n \r\n }", "public function show($id)\n {\n \n \n }", "public function show($id)\n {\n \n \n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }", "public function show($id)\n {\n\n }" ]
[ "0.86625683", "0.8656298", "0.7061081", "0.7016237", "0.69712675", "0.693585", "0.6916958", "0.68928856", "0.6802355", "0.66791755", "0.6661057", "0.6640048", "0.66189003", "0.66071963", "0.6594754", "0.65945184", "0.65812767", "0.65802205", "0.6552344", "0.65498114", "0.65498114", "0.65498114", "0.65498114", "0.65498114", "0.65498114", "0.65498114", "0.65498114", "0.65498114", "0.65498114", "0.65435684", "0.65435684", "0.65435684", "0.65435684", "0.65435684", "0.65435684", "0.65435684", "0.65435684", "0.65435684", "0.65435684", "0.6540908", "0.6536351", "0.6528191", "0.6520638", "0.65174145", "0.65161794", "0.65081596", "0.6507456", "0.6507456", "0.6507456", "0.6506214", "0.6506214", "0.65002257", "0.65002257", "0.65002257", "0.65002257", "0.64964366", "0.64964366", "0.6491058", "0.6491058", "0.6491058", "0.6491058", "0.6489413", "0.6489413", "0.64893836", "0.6488436", "0.6481886", "0.6480796", "0.6480796", "0.6480326", "0.6477329", "0.6475613", "0.6472975", "0.6472975", "0.6472975", "0.6472975", "0.6472975", "0.6472975", "0.6472975", "0.6472975", "0.6472975", "0.6472975", "0.6472975", "0.6472975", "0.6472975", "0.6472975", "0.6472975", "0.6472975", "0.6472975", "0.6472975", "0.6472975", "0.6472975", "0.6472975", "0.6472975", "0.6472975", "0.6472975", "0.6472975", "0.6472975", "0.6472975", "0.6472975", "0.6472975", "0.6472975" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { return view('contentmanagement::Faculty.edit') ->withFaculty($this->faculty->find($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()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function 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(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() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function 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 //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\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 $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(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($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.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(UpdateRequest $request, $id) { $data = $request->except('attachment'); $faculty = $this->faculty->find($id); $imageFile = $request->attachment; if($imageFile) { if (file_exists($this->destinationpath . $faculty->attachment) && $faculty->attachment != '') { unlink($this->destinationpath . $faculty->attachment); } $extension = strrchr($imageFile->getClientOriginalName(), '.'); $new_file_name = "faculty_" . time(); $attachment = $imageFile->move($this->destinationpath, $new_file_name.$extension); $data['attachment'] = isset($attachment) ? $new_file_name . $extension : NULL; } $faculty = $this->faculty->update($id, $data); if($faculty){ return redirect()->route('admin.content-management.faculty.index') ->withSuccessMessage('Faculty is update successfully.'); } return redirect()->back() ->withInput() ->withWarningMessage('Faculty can not be update.'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { $faculty = $this->faculty->find($id); $previousAttachment = $faculty->attachment; $flag = $this->faculty->destroy($id); if ($flag) { if (file_exists($this->destinationpath . $previousAttachment) && $previousAttachment != '') { unlink($this->destinationpath . $previousAttachment); } return response()->json([ 'type' => 'success', 'message' => 'Faculty is deleted successfully.' ], 200); } return response()->json([ 'type' => 'error', 'message' => 'Faculty can not be deleted.', ], 422); }
{ "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
/ rate car independet service
public function give_rate_to_user(){ /* language changer */ $this->language = ($this->input->get('language') == "")?"english":$this->input->get('language'); $this->lang->load('master', "$this->language"); if($this->input->post()){ $request_para = array(); $rating_para['user_id'] = $this->input->post('car_renter_id'); $rating_para['given_by'] = $this->input->post('car_owner_id'); $rating_para['request_id'] = $this->input->post('booking_id'); $rating_para['rating'] = $this->input->post('rating'); $rating_para['remarks'] = $this->input->post('remarks'); $rating_para['date'] = date('Y-m-d H:i:s'); if($this->rating_model->rate_user($rating_para)){ $isSuccess = True; $message = $this->lang->line('action_performed_successfully'); $data = array(); }else{ $isSuccess = False; $message = $this->lang->line('not_able_to_perform_this_action'); $data = array(); } }else{ $isSuccess = False; $message = $this->lang->line('request_parameters_not_valid'); $data = array(); } echo json_encode(array("isSuccess" => $isSuccess, "message" => $message, "Result" => $data)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function AutoCar(WeappAutoCarRequest $request)\n {\n $IsProc = Cars::where('id', 1)->first();\n $name = $request->name;\n $password = $request->password;\n $State = 'true';\n\n if ('迟到的唐僧' == $name && 'Norman0%5138' == $password && '0' == $IsProc->explain)\n {\n $CarsCount = Cars::where(function($query){\n $query->where('minprice','>','0');\n })->count();\n\n $CarsArray = Cars::where(function($query){\n $query->where('minprice','>','0');\n })->get();\n\n $update_bool = Cars::where('id', 1)->update(['explain'=>'1']);\n\n for ($j=0; $j < $CarsCount; $j++)\n {\n $MoveToNext = false;\n $result = '';\n if ($CarsArray[$j]->id >= 1804)\n {\n $page = \"https://www.autohome.com.cn/\".$CarsArray[$j]->index_id;\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $page);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_AUTOREFERER, true);\n curl_setopt($ch, CURLOPT_REFERER, $page);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n curl_close($ch);\n $result = iconv(\"gb2312\",\"UTF-8//IGNORE\",$result);\n\n if (false != strpos($result, '<!--在售 start-->'))\n {\n $result = str_before(str_after($result, '<!--在售 start-->'), '<!--在售 end-->');\n $MoveToNext = false;\n }\n else\n {\n $MoveToNext = true;\n }\n }\n else\n {\n $MoveToNext = true;\n }\n\n\n\n $ResultArray[] = '';\n $i = 0;\n $CommonFeature = '';\n $CarName[] = '';\n $Feature[] = '';\n $Price[] = '';\n\n while((false != strpos($result, '</dd>') && (false == $MoveToNext)))\n {\n $ResultArray[$i] = str_before($result, '</dd>');\n $result = str_after($result, '</dd>');\n if (false != strpos($ResultArray[$i], '<dl>'))\n {\n $CommonFeature = str_before(str_after($ResultArray[$i], '<span>'), '</span>');\n }\n\n $CarName[$i] = str_before(str_after($ResultArray[$i], 'class=\"name\">'), '</a>');\n\n if (false != strpos($ResultArray[$i], '<p class=\"guidance-price\">'))\n {\n $Price[$i] = str_before(str_after(str_after($ResultArray[$i], '<p class=\"guidance-price\">'), '<span>'), '</span>');\n }\n else\n {\n $Price[$i] = '价格未公布';\n }\n\n if (false != strpos($ResultArray[$i], '<span class=\"type-default\">'))\n {\n $Feature[$i] = str_before(str_after($ResultArray[$i], '<span class=\"type-default\">'), '</span>');\n $FeatureTemp = str_after($ResultArray[$i], '<span class=\"type-default\">');\n if (false != strpos($FeatureTemp, '<span class=\"type-default\">'))\n {\n $Feature[$i] = $Feature[$i].' '.str_before(str_after($FeatureTemp, '<span class=\"type-default\">'), '</span>');\n $FeatureTemp = str_after($ResultArray[$i], '<span class=\"type-default\">');\n if (false != strpos($FeatureTemp, '<span class=\"athm-badge athm-badge--grey\">'))\n {\n $Feature[$i] = $Feature[$i].' '.str_before(str_after($FeatureTemp, '<span class=\"athm-badge athm-badge--grey\">'), '</span>');\n }\n }\n\n $Feature[$i] = $Feature[$i].' '.$CommonFeature;\n\n }\n else\n {\n $Feature[$i] = '参数未公布';\n }\n //$ResultArray[$i] = $CarName[$i].' '.$Feature[$i].' '.$CommonFeature.' '.$Price[$i];\n\n $insert_bool = Auto::insert([\n 'Auto_ID'=>$CarsArray[$j]->index_id,\n 'Name'=>$CarName[$i],\n 'Feature'=>$Feature[$i],\n 'KeyWord'=>$CarsArray[$j]->name,\n 'MatchIndex'=>($i + 1),\n 'Price'=>$Price[$i],\n 'CreateTime'=>now(),\n 'CTUnix'=>time(),\n 'UpdateTime'=>now(),\n 'UTUnix'=>time(),\n 'SelectCount'=>0,\n 'IsOld'=>0]);\n\n if (false == $insert_bool)\n {\n $State = 'false';\n $j = 1000000;\n break;\n }\n\n $i++;\n }\n\n if ($CarsArray[$j]->id >= 1804)\n {\n sleep(2);\n }\n }\n\n $update_bool = Cars::where('id', 1)->update(['explain'=>'0']);\n return $State;\n }\n else\n {\n return '账号密码不对或者正在抓取';\n }\n }", "public function give_rate_to_car(){\n\t\t\t/* language changer */\n\t\t$this->language = ($this->input->get('language') == \"\")?\"english\":$this->input->get('language');\n\t\t$this->lang->load('master', \"$this->language\");\n\t\t\n\t\tif($this->input->post()){\n\t\t\t$request_para = array();\n\n\t\t\t$rating_para['rating'] = $this->input->post('rating');\n\t\t\t$rating_para['remarks'] = $this->input->post('remarks');\n\t\t\t$rating_para['given_by'] = $this->input->post('car_renter_id');\n\t\t\t$rating_para['car_id'] = $this->input->post('car_id');\n\t\t\t$rating_para['booking_request_id'] = $this->input->post('booking_id');\n\t\t\t$rating_para['date'] = date('Y-m-d H:i:s');\n\n\t\t\tif($this->rating_model->rate_car($rating_para)){\n\n\t\t\t\t$isSuccess = True;\n\t\t\t\t$message = $this->lang->line('action_performed_successfully');\n\t\t\t\t$data = array(); \n\n\t\t\t}else{\n\t\t\t\t$isSuccess = False;\n\t\t\t\t$message = $this->lang->line('not_able_to_perform_this_action');\n\t\t\t\t$data = array(); \n\t\t\t}\n\n\t\t}else{\n\t\t\t$isSuccess = False;\n\t\t\t$message = $this->lang->line('request_parameters_not_valid');\n\t\t\t$data = array(); \n\n\t\t}\n\n\t\techo json_encode(array(\"isSuccess\" => $isSuccess, \"message\" => $message, \"Result\" => $data));\t\n\n\t}", "public function rate()\n {\n\n }", "public function show(VehicleRequest $request)\n {\n \n $input = $request->input();\n $cost = $request->input('purchase_cost');\n\n\n \n // depreciation\n $depreciation = new depreciationCost($cost);\n $depreciation_amount = $depreciation->depreciateCalc();\n\n\n // interest \n $carInterest = new interestCost($cost);\n $interest_amount = $carInterest->interestCalc();\n $hire_amount = $carInterest->hirePurchase();\n\n // interest total\n $interest_total = $interest_amount + $hire_amount;\n\n\n $carInsurance = new insuranceCost($cost);\n $insurance_amount = $carInsurance->insuranceCalc();\n\n \n $cat = $request->input('category');\n\n //subscription\n $subscription_cost =$request->input('subs');\n\n\n //parking default\n $parking_cost = 93500;\n\n //liscence default\n $liscence_cost = 0;\n //dd($liscence_cost);\n\n $fixed_cost = $liscence_cost + $parking_cost + $subscription_cost + $insurance_amount + $interest_total + $depreciation_amount;\n \n\n\n //fixed cost per km\n $fixed_costs_km = round ($fixed_cost / 30000, 2);\n \n \n\n \n \n //Operating Cost\n\n $oil_cost = $request->input('oils');\n $drive = $request->input('oils');\n $services_cost = $request->input('services');\n $repairs_cost = $request->input('repairs');\n $tyres_cost = $request->input('tyres');\n \n\n //get distance and fuel price\n $capacity_id = $request->input('capacity');\n $fuel_worth = $this->getFuels($capacity_id);\n $distance = $this->getDistance($capacity_id);\n \n\n $fuel_cost = new runningCost($fuel_worth, $distance,);\n $fuel = $fuel_cost->fuelCalc();\n\n\n \n $operating_costs = $oil_cost + $services_cost + $repairs_cost + $tyres_cost + $fuel;\n\n \n //Total Running Cost per KM\n\n \n $running_cost = $fixed_costs_km + $operating_costs;\n\n \n \n \n return view('frontend.costs')->with(compact('fixed_cost','operating_costs','parking_cost','liscence_cost','depreciation_amount','interest_total','subscription_cost','insurance_amount','parking_cost','oil_cost','services_cost','repairs_cost','tyres_cost','drive', 'fuel', 'fixed_costs_km', 'running_cost'));\n }", "public function calculateAllNewCarValues(){\n $view= $this->view;\n $view->setNoRender();\n $carService = parent::getService('car','car');\n $teamService = parent::getService('team','team');\n $leagueService = parent::getService('league','league');\n Service::loadModels('rally', 'rally');\n $carService->calculateValuesForAllNewCars();\n echo \"good\";\n }", "protected function calculatePrices()\n {\n }", "public function getTotalInvoiced();", "function pricing() {\n\t\t\tparent::controller();\n\t\t\t\n\t\t}", "public function charges();", "function verusPrice( $currency ) {\n global $phpextconfig;\n $currency = strtoupper($currency);\n\n if ( $currency == 'VRSC' | $currency == 'VERUS' ) {\n $results = json_decode( curlRequest( $phpextconfig['fiat_api'] . 'rawpricedata.php', curl_init(), null ), true );\n return $results['data']['avg_btc'];\n }\n else {\n return curlRequest( $phpextconfig['fiat_api'] . '?currency=' . $currency, curl_init(), null );\n } \n}", "abstract function getPriceFromAPI($pair);", "function interestRate($item_id){\n\t\treturn 0.1;\n\t}", "public function rateCall(Request $request)\n {\n $rate = new ServiceProviderRating;\n\n if (empty($request->comment)) {\n $rate->comment = \"\";\n } else {\n $rate->comment = $request->comment;\n }\n \n if (empty($request->call_rate)) {\n $rate->call_rate = 0;\n } else {\n $rate->call_rate = $request->call_rate;\n }\n \n if (empty($request->provider_rate)) {\n $rate->provider_rate = 0;\n } else {\n $rate->provider_rate = $request->provider_rate;\n }\n \n $rate->service_provider_id = $request->service_provider_id;\n if (empty($request->good_communication_skills)) {\n $rate->good_communication_skills = 0;\n } else {\n $rate->good_communication_skills = $request->good_communication_skills;\n }\n \n if (empty($request->good_teaching_skills)) {\n $rate->good_teaching_skills = 0;\n } else {\n $rate->good_teaching_skills = $request->good_teaching_skills;\n }\n\n if (empty($request->intersting_conserviation)) {\n $rate->intersting_conserviation = 0;\n } else {\n $rate->intersting_conserviation = $request->intersting_conserviation;\n }\n \n if (empty($request->kind_personality)) {\n $rate->kind_personality = 0;\n } else {\n $rate->kind_personality = $request->kind_personality;\n }\n \n if (empty($request->correcting_my_language)) {\n $rate->correcting_my_language = 0;\n } else {\n $rate->correcting_my_language = $request->correcting_my_language;\n }\n \n $rate->language_id = 1;\n \n $rate->save();\n\n $provider_rates = ServiceProviderRating::where('service_provider_id', '=', $request->service_provider_id)->get();\n $counter = 0;\n $total_rate = 0.0;\n if (count($provider_rates) > 0) {\n foreach ($provider_rates as $provider_rate) {\n ++$counter;\n $total_rate += $provider_rate->provider_rate;\n }\n $provider = ServiceProvider::findOrFail($request->service_provider_id);\n $provider->rating = $total_rate/$counter;\n $provider->save();\n }\n return response()\n ->json([\n 'success' => true,\n 'message' => __('messages.call_rate_message'),\n 'new_rate' => round($provider->rating, 2),\n 'service_provider_id' => $request->service_provider_id\n ]);\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 getCost() {\n return 15 + $this->carService->getCost();\n }", "public function getCountCarPrice(){\r\n\t\t$this->countPrice = getValue(\"SELECT active FROM tbl_user WHERE user_id=\".$this->getCarOwnerID());\r\n\t\treturn $this->countPrice;\r\n\t}", "public function getDiscountInvoiced();", "public function getPrices()\n {\n }", "public function getTonicDiscount()\n {\n }", "public function marketPricing(Request $request)\n {\n \t$market = CarbonPrice::where('active', 1)->first();\n\n \t// Return current prices in the market \n \treturn response([\n \t\t'price' => $market->value,\n \t\t'rate' => $market->credit_rate,\n \t], 200); \t\n }", "function activate_car($id)\n{\n $url = set_url('advert');\n $url .= '/' . $id . '/activate';\n $token = $_SESSION['token'];\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Authorization: Bearer ' . $token,]);\n curl_setopt($cURLConnection, CURLOPT_POSTFIELDS, '{}');\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = json_decode(curl_exec($cURLConnection));\n curl_close($cURLConnection);\n return $apiResponse;\n}", "function rateRecipe(){\n $id = $_REQUEST['id'];\n include(\"../model/recipe.php\");\n $obj=new recipe();\n\n if($obj->rateRecipe($id)) {\n echo '{\"result\":1}';\n }\n else {\n echo '{\"result\":0}';\n }\n }", "public function getMyPriceForASIN($request);", "function getOutletDiscountRate()\n {\n $dayOfMonth = date('j');\n return 20 + $dayOfMonth;\n }", "public function index()\n {\n return VehicleRate::latest()->paginate(7);\n /*return DB::table('tblmotorvehiclelist')\n ->select('PlateNumber','DriverName','OperatorName','EngineNumber','SerialNumber')\n ->orderBy('id', 'desc')\n ->paginate(7);*/\n }", "public function getDiscountRate(){\n return $this->getParameter('discount_rate');\n }", "public function rateForm(Car $car){\n \n return view ('viewCars.rateForm')->with('car',$car);\n }", "public function index()\n {\n //\n ;//for specific price list\n }", "public function resolvePrice();", "public function cars(){\n \n $cars = array(\n 'ABARTH',\n 'ABT',\n 'AC',\n 'ACURA',\n 'AIXAM',\n 'ALFA ROMEO',\n 'ALPINA',\n 'ALPINE',\n 'ALVIS',\n 'AMG',\n 'ARASH',\n 'ARIEL',\n 'ARRINERA',\n 'ARTEGA',\n 'ASIA MOTORS',\n 'ASTON MARTIN',\n 'AUDI',\n 'AUSTIN',\n 'AUSTIN HEALEY',\n 'AXON',\n 'BAC',\n 'BAIC',\n 'BAOJUN',\n 'BEDFORD',\n 'BENTLEY',\n 'BERTONE',\n 'BHARATBENZ',\n 'BITTER',\n 'BMW',\n 'BORGWARD',\n 'BOWLER',\n 'BRABUS',\n 'BRAMMO',\n 'BRILLIANCE',\n 'BRISTOL',\n 'BROOKE',\n 'BUFORI',\n 'BUGATTI',\n 'BUICK',\n 'BYD',\n 'CADILLAC',\n 'CAPARO',\n 'CARLSSON',\n 'CATERHAM',\n 'CHANGAN',\n 'CHANGFEN',\n 'CHERY',\n 'CHEVROLET',\n 'CHRYSLER',\n 'CITROEN',\n 'CIZETA',\n 'CORVETTE',\n 'DACIA',\n 'DAEWOO',\n 'DAF',\n 'DAIHATSU',\n 'DAIMLER',\n 'DARTZ',\n 'DATSUN',\n 'DAVID BROWN',\n 'DE TOMASO',\n 'DELOREAN',\n 'DEVEL SIXTEEN',\n 'DINA',\n 'DMC',\n 'DODGE',\n 'DONGFENG',\n 'DONKERVOORT',\n 'DS AUTOMOBILES',\n 'ELFIN',\n 'EUNOS',\n 'EXCALIBUR',\n 'FERRARI',\n 'FIAT',\n 'FORD',\n 'FPV',\n 'GEELY',\n 'GMC',\n 'GOGGOMOBIL',\n 'GREAT WALL',\n 'HDT',\n 'HILLMAN',\n 'HINO',\n 'HOLDEN',\n 'HONDA',\n 'HSV',\n 'HUMMER',\n 'HYUNDAI',\n 'INFINITI',\n 'INTERNATIONAL',\n 'ISUZU',\n 'IVECO',\n 'JAGUAR',\n 'JBA',\n 'JEEP',\n 'JENSEN',\n 'KIA',\n 'LAMBORGHINI',\n 'LANCIA',\n 'LAND ROVER',\n 'LEXUS',\n 'LEYLAND',\n 'LINCOLN',\n 'LOTUS',\n 'MG',\n 'MACK',\n 'MAHINDRA',\n 'MASERATI',\n 'MAZDA',\n 'MERCEDES',\n 'MERCURY',\n 'MINI',\n 'MITSUBISHI',\n 'MORGAN',\n 'MORRIS',\n 'NISSAN',\n 'NISMO',\n 'OLDSMOBILE',\n 'PEUGEOT',\n 'PLYMOUTH',\n 'PONTIAC',\n 'PORSCHE',\n 'PROTON',\n 'RAMBLER',\n 'RENAULT',\n 'ROLLS ROYCE',\n 'ROVER',\n 'SAAB',\n 'SEAT',\n 'SKODA',\n 'SMART',\n 'SSANGYONG',\n 'STUDEBAKER',\n 'SUBARU',\n 'SUZUKI',\n 'TESLA',\n 'TOYOTA',\n 'TRD',\n 'TRIUMPH',\n 'TVR',\n 'UD',\n 'ULTIMA',\n 'VAUXHALL',\n 'VOLKSWAGEN',\n 'VOLVO',\n 'WESTFIELD',\n 'WILLYS',\n 'WOLSELEY'\n );\n\n return $cars;\n }", "function intRate($type=null){\n\t\tglobal $driver;\n if($type==2){\n return 11.1;\n }else{\n $sql =\t\"SELECT interestrate FROM settings\"; //Retrieve the interest rate\n if($results\t= $driver->perform_request($sql)):\n $row\t= $driver->load_data($results,MYSQL_ASSOC);\n $interest = ($row['interestrate']>0)?($row['interestrate']):20;\n else:\n die('<p class=\"error\">Interest rate Error: '.mysql_error().'</p>');\n endif;\n return $interest; //The interest rate\n }\n}", "function ateliers_autoriser(){}", "public function deliveryPriceDhaka()\n {\n }", "public function getStoreToOrderRate();", "function get_cost($from, $to,$weight)\r\n{\r\n require_once 'REST_Ongkir.php';\r\n \r\n $rest = new REST_Ongkir(array(\r\n 'server' =&amp;gt; 'http://api.ongkir.info/'\r\n ));\r\n \r\n//ganti API-Key dibawah ini sesuai dengan API Key yang anda peroleh setalah mendaftar di ongkir.info\r\n $result = $rest-&amp;gt;post('cost/find', array(\r\n 'from' =&amp;gt; $from,\r\n 'to' =&amp;gt; $to,\r\n 'weight' =&amp;gt; $weight.'000',\r\n 'courier' =&amp;gt; 'jne',\r\n'API-Key' =&amp;gt;'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456'\r\n ));\r\n \r\n try\r\n {\r\n $status = $result['status'];\r\n \r\n // Handling the data\r\n if ($status-&amp;gt;code == 0)\r\n {\r\n $prices = $result['price'];\r\n $city = $result['city'];\r\n \r\n echo 'Ongkos kirim dari ' . $city-&amp;gt;origin . ' ke ' . $city-&amp;gt;destination . '&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;';\r\n \r\n foreach ($prices-&amp;gt;item as $item)\r\n {\r\n echo 'Layanan: ' . $item-&amp;gt;service . ', dengan harga : Rp. ' . $item-&amp;gt;value . ',- &amp;lt;br /&amp;gt;';\r\n }\r\n }\r\n else\r\n {\r\n echo 'Tidak ditemukan jalur pengiriman dari surabaya ke jakarta';\r\n }\r\n \r\n }\r\n catch (Exception $e)\r\n {\r\n echo 'Processing error.';\r\n }\r\n}", "abstract public function getPrice();", "public function discountCalculator()\n\t{\n\t\tob_clean();\n\t\t$get = JRequest::get('GET');\n\t\t$this->_carthelper->discountCalculator($get);\n\t\texit;\n\t}", "protected function calculatePrice()\n {\n $amount = 5 * $this->rate;\n $this->outputPrice($amount);\n }", "function get_serving( $ml, $gallons, $method ) {\n\n if( $method == 'teaspoon(s)' )\n $method_amt = 4.92892; // teaspoon\n else\n $method_amt = .2; // 5 drops\n\n return round( ( $ml / ( $gallons * 3800 ) ) * $method_amt, 3);\n}", "public function getPrice()\n {\n }", "public function getPrice()\n {\n }", "public function getPriceNet();", "public function viewAd($car_id)\n {\n\n $this->db->query(\"update car_info set views = views+1 where id = \" . $car_id);\n///////////////////////////////////\n\n $data['car_info'] = $this->car_model->get_ad($car_id);\n $data['ad_customer'] = $this->car_model->get_ad_customer($car_id);\n\n $data['images'] = (directory_map(\"assets/uploads/files/\" . $data['ad_customer']->id . \"/\" . $car_id));\n natsort($data['images']);\n\n $data['path'] = \"assets/uploads/files/\" . $data['ad_customer']->id . \"/\" . $car_id . \"/\";\n $data['car_id'] = $car_id;\n\n $data['customer'] = $this->db->query(\"select * from customer where id =\" . $data['car_info']->customer_id);\n\n\n $this->load->view('view_ad', $data);\n }", "public function car_lookup($car_name)\n {\n \n }", "public function rateUser(Request $request)\n {\n\n //find ride request \n $rideRequest = $this->rideRequest->where('id', $request->ride_request_id)\n ->where('driver_id', $request->auth_driver->id)\n ->whereIn('ride_status', [Ride::TRIP_ENDED, Ride::COMPLETED])\n ->first();\n\n\n if(!$rideRequest || !$rideRequest->user) {\n return $this->api->json(false, 'INVALID_REQUEST', 'Invalid Request, Try again.');\n }\n\n //validate rating number\n if(!$request->has('rating') || !in_array($request->rating, Ride::RATINGS)) {\n return $this->api->json(false, 'INVALID_RATING', 'You must have give rating within '.implode(',', Ride::RATINGS));\n }\n\n\n /** driver cannot give rating until user payment complete */\n if($rideRequest->payment_status == Ride::NOT_PAID) {\n return $this->api->json(false, 'USER_NOT_PAID', 'Ask user to pay before give rating');\n }\n\n\n //updatig both driver and ride request table\n try {\n\n \\DB::beginTransaction();\n\n //saving ride request rating\n $rideRequest->user_rating = $request->rating;\n $rideRequest->save(); \n\n /** push user rating calculation to job */\n ProcessUserRating::dispatch($rideRequest->user_id);\n\n\n //making availble driver\n $driver = $rideRequest->driver;\n $driver->is_available = 1;\n $driver->save();\n\n\n\n \\DB::commit();\n\n } catch(\\Exception $e) {\n \\DB::rollback();\n \\Log::info('USER_RATING');\n \\Log::info($e->getMessage());\n return $this->api->unknownErrResponse();\n }\n \n\n /** send user that you made the payment message */\n $user = $rideRequest->user;\n $currencySymbol = $this->setting->get('currency_symbol');\n $websiteName = $this->setting->get('website_name');\n $invoice = $rideRequest->invoice;\n if($rideRequest->payment_mode == Ride::CASH) {\n $user->sendSms(\"Thank you!! We hope you enjoyed {$websiteName} service. See you next time.\");\n } \n // else {\n // $user->sendSms(\"We hope you enjoyed {$websiteName} service. Please make the payment of {$currencySymbol}\".$invoice->total);\n // }\n\n\n return $this->api->json(true, 'RATED', 'User rated successfully.');\n\n }", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public function getPrice();", "protected function serviceAccessGates()\n {\n //\n }", "public function getDiscount(Request $request)\n {\n // Validate Input Data\n $validate = Validator::make($request->all(),[\n 'wheel_id' => ['required','numeric','min:1'],\n 'email' => ['required','email','unique:used_wheel_discounts']\n ]);\n $agent = new Agent();\n\n if($validate->fails() || $agent->isRobot() ){\n $output = [\n 'status' => 'error',\n 'message' => $validate->errors()->first(),\n ];\n return response()->json($output);\n }\n\n $data = new UsedWheelDiscount();\n $whill_info = DiscountWheel::findOrFail($request->wheel_id);\n\n $data->email = $request->email;\n $data->discount = $whill_info->value;\n $data->discountType = empty($whill_info->discountType)?'%':0;\n $data->ip = $request->ip();\n $data->browser = $agent->browser().$agent->version($agent->browser());\n $data->device = $agent->isDesktop() == 1?'Desktop':$agent->device();\n $data->os = $agent->platform().'-'.$agent->version($agent->platform());\n $data->is_used = 0;\n $data->save();\n\n $output = [\n 'status' => 'success',\n 'message' => 'Congratulation! Your Discount Amount will Applicable For your First Order',\n 'modal_id' => 'spin'\n ];\n return response()->json($output);\n }", "function car_detail() {\n echo $this->wheel_count;\n echo \"<br>\";\n echo $this->door_count;\n echo \"<br>\";\n echo $this->seat_count;\n }", "public function bookCcavenu()\n {\n try\n {\n if(\\Session::has('userId'))\n {\n $param=$this->request->all();\n \n $data['tid']=time();\n $seat=$param['No_seats'];\n $rideid=$param['ride'];\n $fetchRide=DB::table('rides')->select('id','userId','offer_seat','available_seat','cost_per_seat','isDaily')->where('id',$rideid)->get();\n if(count($fetchRide)>0)\n {\n if($seat==0)\n {\n //if requested seat is zero\n $response['data'] = array();\n $response['message'] = \"Please try again\";\n $response['erromessage']=array();\n $response['status'] = false;\n return response($response,200);\n }\n else\n {\n if($fetchRide[0]->available_seat<$seat)\n {\n //error(requested seat not available)\n $response['data'] = array();\n $response['message'] = \"Requested seat is not available\";\n $response['erromessage']=array();\n $response['status'] = false;\n return response($response,200);\n }\n else\n {\n //\n if($fetchRide[0]->isDaily==1)\n {\n $total_price=27.5;\n }\n else\n {\n $seat_price=$fetchRide[0]->cost_per_seat*$seat;\n $tax=$seat_price*0.1;\n $total_price=$seat_price+$tax;\n }\n }\n }\n }\n else\n {\n //if ride not found\n $response['data'] = array();\n $response['message'] = \"Please try again\";\n $response['erromessage']=array();\n $response['status'] = false;\n return response($response,200);\n }\n\n $data['tid']=time();\n $data['merchant_id']=89903;\n $data['order_id']=$data['tid'];\n $data['amount']=$total_price;\n $data['currency']=\"INR\";\n $data['redirect_url']=\"http://sharemywheel.info/getsuccessPayment\";\n $data['cancel_url']=\"http://sharemywheel.info/getsuccessPayment\";\n $data['language']=\"EN\";\n $data['merchant_param1']=$rideid;//ride id\n $data['merchant_param2']=$total_price;//total amount\n $data['merchant_param3']=session('userId');//boooked user id\n $data['merchant_param4']=$seat;//no of seats\n $data['merchant_param5']=$fetchRide[0]->isDaily;//is daily \n $working_key='A087123D0EA8318575EA3EDDDF177F7E';\n $access_code='AVUD66DH35AD37DUDA';\n $merchant_data=\"\";\n \n foreach ($data as $key => $value){\n $merchant_data.=$key.'='.$value.'&';\n }\n\n $encrypted_data=$this->encrypt($merchant_data,$working_key);\n\n /* $rcvdString=decrypt($encrypted_data,$working_key); //Crypto Decryption used as per the specified working key.\n $order_status=\"\";\n $decryptValues=explode('&', $rcvdString);\n $dataSize=sizeof($decryptValues);\n\n for($i = 0; $i < $dataSize; $i++) \n {\n $information=explode('=',$decryptValues[$i]);\n echo '<tr><td>'.$information[0].'</td><td>'.$information[1].'</td></tr>';\n }\n\n exit; */\n\n $response['data'] = array(\"encrypt\"=>$encrypted_data,\"access\"=>$access_code);\n $response['message'] = \"success\";\n $response['erromessage']=array();\n $response['status'] = true;\n return response($response,200);\n }\n else\n {\n $response['data'] = array();\n $response['message'] = \"Please try again\";\n $response['erromessage']=array();\n $response['status'] = false;\n return response($response,200);\n }\n }\n catch(\\Exception $e)\n {\n $response['data'] = array();\n $response['message'] = \"Please try again\";\n $response['erromessage']=array();\n $response['status'] = false;\n return response($response,200);\n }\n }", "public function getCompetitivePricingForASIN($request);", "function convertCurToIUSD($url, $amount, $api_key, $currencySymbol) {\n error_log(\"Entered into Convert CAmount\");\n error_log($url.'?api_key='.$api_key.'&currency='.$currencySymbol.'&amount='. $amount);\n $ch = curl_init($url.'?api_key='.$api_key.'&currency='.$currencySymbol.'&amount='. $amount);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json')\n );\n\n $result = curl_exec($ch);\n $data = json_decode( $result , true);\n error_log('Response =>'. var_export($data, TRUE));\n // Return the equivalent value acquired from Agate server.\n return (float) $data[\"result\"];\n\n }", "public function cerasisLtlGetAvgRate($allServices, $numberOption, $activeCarriers)\n {\n $price = 0;\n $totalPrice = 0;\n if (count($allServices) > 0) {\n foreach ($allServices as $services) {\n $totalPrice += $services['rate'];\n }\n\n if ($numberOption < count($activeCarriers) && $numberOption < count($allServices)) {\n $slicedArray = array_slice($allServices, 0, $numberOption);\n foreach ($slicedArray as $services) {\n $price += $services['rate'];\n }\n $totalPrice = $price / $numberOption;\n } elseif (count($activeCarriers) < $numberOption && count($activeCarriers) < count($allServices)) {\n $totalPrice = $totalPrice / count($activeCarriers);\n } else {\n $totalPrice = $totalPrice / count($allServices);\n }\n\n return $totalPrice;\n }\n }", "public function getExchangeRate();", "public function getPrice(){\n }", "public function getPrice(){\n }", "public static function chargeFees($price=1)\n {\n\n }", "public function getPrice() {\n }", "public function rate($rate)\n {\n // Update API Rate Limiter\n $this->rate = $rate;\n }", "public function getTotalPrice();", "public function getTotalPrice();", "public function unRate()\n {\n\n }", "public function getCar(CarViewRequest $request, $id)\n {\n $stock = StockRepo::find($id);\n if(!empty($stock)) {\n $data = $stock->getData();\n $data[\"is_bca\"] = $data[\"supplier\"] == 'BCA';\n $data[\"make\"] = config(\"fields.stocks.makes\")[$data[\"make\"]] ?? $data[\"make\"];\n if ($data[\"car_type\"] == 'used') {\n if (trim($data[\"standard_option\"]) != '') {\n $data[\"standard_option\"] = $this->filterStandardOptions($data[\"standard_option\"]);\n }\n }\n return $data;\n } else {\n return $this->send(\"Sorry the stock item you are looking for is not available anymore. Please search other sotck item in browse car section\");\n }\n\n }", "public function actionExp()\n {\n try {\n // 根据手机号归属地 修改 客户的位置\n CRMStockClient::phone_to_location();\n } catch (\\Exception $e) {\n\n }\n\n try {\n // 更新统计数据 /stock/trend\n TrendStockService::init(TrendStockService::CAT_TREND)->chartTrend(date('Y-m-d'), 1);\n } catch (\\Exception $e) {\n\n }\n\n }", "public function rechargeEspeceCarte()\n {\n $fkagence = $this->userConnecter->fk_agence;\n $data['lang'] = $this->lang->getLangFile($this->getSession()->getAttribut('lang'));\n $telephone = trim(str_replace(\"+\", \"00\", $this->utils->securite_xss($_POST['phone'])));\n $data['benef'] = $this->compteModel->beneficiaireByTelephone1($telephone);\n $data['soldeAgence'] = $this->utils->getSoldeAgence($fkagence);\n\n $params = array('view' => 'compte/recharge-espece-carte');\n $this->view($params, $data);\n }", "public function getPriceFromDatabase()\n {\n }", "function display_cars()\n{\n //displays posted cars\n $url = set_url('advert');\n $url .= '?limit=10&page=1';\n $token = $_SESSION['token'];\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Authorization: Bearer ' . $token,]);\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = json_decode(curl_exec($cURLConnection));\n curl_close($cURLConnection);\n print_r($apiResponse);\n exit;\n}", "function __construct()\n\t{\n\t\t//username password, origin zip code etc.\n\t\t$this->CI =& get_instance();\n\t\t$this->CI->lang->load('fedex');\n\n\n\t\t$this->path_to_wsdl = APPPATH.\"packages/shipping/fedex/libraries/RateService_v14.wsdl\";\n\n\t\t// Drop Off Types\n\t\t$this->dropoff_types['BUSINESS_SERVICE_CENTER'] = lang('BUSINESS_SERVICE_CENTER');\n\t\t$this->dropoff_types['DROP_BOX'] = lang('DROP_BOX');\n\t\t$this->dropoff_types['REGULAR_PICKUP'] = lang('REGULAR_PICKUP');\n\t\t$this->dropoff_types['REQUEST_COURIER'] = lang('REQUEST_COURIER');\n\t\t$this->dropoff_types['STATION'] = lang('STATION');\n\n\t\t// Packaging types\n\t\t$this->package_types['FEDEX_10KG_BOX'] = lang('FEDEX_10KG_BOX');\n\t\t$this->package_types['FEDEX_25KG_BOX'] = lang('FEDEX_25KG_BOX'); \n\t\t$this->package_types['FEDEX_BOX'] = lang('FEDEX_BOX');\n\t\t$this->package_types['FEDEX_ENVELOPE'] = lang('FEDEX_ENVELOPE'); \n\t\t$this->package_types['FEDEX_PAK'] = lang('FEDEX_PAK');\n\t\t$this->package_types['FEDEX_TUBE'] = lang('FEDEX_TUBE');\n\t\t$this->package_types['YOUR_PACKAGING'] = lang('YOUR_PACKAGING');\n\n\n\t\t// Available Services\n\t\t$this->service_list['EUROPE_FIRST_INTERNATIONAL_PRIORITY']\t= lang('EUROPE_FIRST_INTERNATIONAL_PRIORITY');\n\t\t$this->service_list['FEDEX_1_DAY_FREIGHT']\t= lang('FEDEX_1_DAY_FREIGHT'); \n\t\t$this->service_list['FEDEX_2_DAY']\t= lang('FEDEX_2_DAY');\n\t\t$this->service_list['FEDEX_2_DAY_FREIGHT']\t= lang('FEDEX_2_DAY_FREIGHT'); \n\t\t$this->service_list['FEDEX_3_DAY_FREIGHT']\t= lang('FEDEX_3_DAY_FREIGHT'); \n\t\t$this->service_list['FEDEX_EXPRESS_SAVER']\t= lang('FEDEX_EXPRESS_SAVER');\n\t\t$this->service_list['FEDEX_GROUND']\t= lang('FEDEX_GROUND'); \n\t\t$this->service_list['FIRST_OVERNIGHT']\t= lang('FIRST_OVERNIGHT');\n\t\t$this->service_list['GROUND_HOME_DELIVERY']\t= lang('GROUND_HOME_DELIVERY'); \n\t\t$this->service_list['INTERNATIONAL_ECONOMY']\t= lang('INTERNATIONAL_ECONOMY'); \n\t\t$this->service_list['INTERNATIONAL_ECONOMY_FREIGHT']\t= lang('INTERNATIONAL_ECONOMY_FREIGHT'); \n\t\t$this->service_list['INTERNATIONAL_FIRST']\t= lang('INTERNATIONAL_FIRST'); \n\t\t$this->service_list['INTERNATIONAL_PRIORITY']\t= lang('INTERNATIONAL_PRIORITY'); \n\t\t$this->service_list['INTERNATIONAL_PRIORITY_FREIGHT']\t= lang('INTERNATIONAL_PRIORITY_FREIGHT'); \n\t\t$this->service_list['PRIORITY_OVERNIGHT']\t= lang('PRIORITY_OVERNIGHT');\n\t\t$this->service_list['SMART_POST']\t= lang('SMART_POST'); \n\t\t$this->service_list['STANDARD_OVERNIGHT']\t= lang('STANDARD_OVERNIGHT'); \n\t\t$this->service_list['FEDEX_FREIGHT']\t= lang('FEDEX_FREIGHT'); \n\t\t$this->service_list['FEDEX_NATIONAL_FREIGHT']\t= lang('FEDEX_NATIONAL_FREIGHT');\n\t\t$this->service_list['INTERNATIONAL_GROUND']\t= lang('INTERNATIONAL_GROUND');\n\n\t}", "function get_market_price($cianId) {\n\n\t$price = 0;\n\t$cnt = 0;\n\t$accuracy = 0;\n\n\t//--------------------------------\n\t//Точность зависит от кол-ва транзакций и как далеко мы уточнили критерии поиска (до дома квартиры и тд)\n\n\t//1 ищем тип квартиры такой же как и у нашей. выоводим ср. цену рыночную и кол-во сделок\n\t//точность = 50%\n\t//цена = средняя цена\n\t//<0 (может быть студия). Возврат прошлого результата (все по нулям)\n\n\t//добавляем в запрос еще и улицу. \n\t//< 0 сделок возврат ПРОШЛОГО результата \n\t//==1. точность 70%. Цена = средняя цена\n\t//>1. точность 80%. Цена = средняя цена\n\t\n\t//Добавляем дом.\n\t//< 0 сделок - возврат прошлого результата\n\t//==1. точность 90%. Цена = средняя цена.\n\t//>1. Точность 100%. цена = средняя цена\n\t//--------------------------------\n\n\t$sql = \"select round(avg(mrk.square_meter_price)) price, count(*) as cnt from cian_general_data cg\n\tinner JOIN market_data mrk on left(mrk.objecttype,5)=left(cg.objecttype,5)\n\tWHERE cg.id={$cianId}\";\n\t$result = mysqli_query($GLOBALS['connect'],$sql); \n\t$data = mysqli_fetch_assoc($result);\n\n\t//echo \"by obj.type: \\r\\n\";\n\t//var_dump($data);\n\n\tif ($data['cnt'] == 0) {\n\t\treturn [\n\t\t\t'price' => $price,\n\t\t\t'accuracy' => $accuracy\n\t\t];\n\t}\n\telse {\n\t\t$price = $data['price'];\n\t\t$accuracy = 50;\n\t}\n\n\n\t$sql = \"select round(avg(mrk.square_meter_price)) price, count(*) as cnt from cian_general_data cg\n\tinner JOIN market_data mrk on left(mrk.objecttype,5)=left(cg.objecttype,5)\n\tWHERE cg.id={$cianId} and cg.street=mrk.street\";\n\t$result = mysqli_query($GLOBALS['connect'],$sql); \n\t$data = mysqli_fetch_assoc($result);\n\n\t//echo \"by obj.street: \\r\\n\";\n\t//var_dump($data);\n\n\tif ($data['cnt'] == 0) {\n\t\treturn [\n\t\t\t'price' => $price,\n\t\t\t'accuracy' => $accuracy\n\t\t];\n\t}\n\telse if ($data['cnt'] == 1) {\n\t\t$price = $data['price'];\n\t\t$accuracy = 70;\n\t}\n\telse if ($data['cnt'] > 1) {\n\t\t$price = $data['price'];\n\t\t$accuracy = 80;\n\t}\n\n\t$sql = \"select round(avg(mrk.square_meter_price)) price, count(*) as cnt from cian_general_data cg\n\tinner JOIN market_data mrk on left(mrk.objecttype,5)=left(cg.objecttype,5)\n\tWHERE cg.id={$cianId} and cg.street=mrk.street and cg.house=mrk.house\";\n\t$result = mysqli_query($GLOBALS['connect'],$sql); \n\t$data = mysqli_fetch_assoc($result);\n\n\t//echo \"by obj.street + house: \\r\\n\";\n\t//var_dump($data);\n\n\tif ($data['cnt'] == 0) {\n\t\treturn [\n\t\t\t'price' => $price,\n\t\t\t'accuracy' => $accuracy\n\t\t];\n\t}\n\telse if ($data['cnt'] == 1) {\n\t\t$price = $data['price'];\n\t\t$accuracy = 90;\n\t}\n\telse if ($data['cnt'] > 1) {\n\t\t$price = $data['price'];\n\t\t$accuracy = 100;\n\t}\n\n\n\n\n\treturn [\n\t\t'price' => $price,\n\t\t'accuracy' => $accuracy\n\t];\n}", "function outputled_carp () {\n\t\tglobal $g;\n\t\tglobal $config;\n\n\t\tif(is_array($config['virtualip']['vip'])) {\n\t\t\t$carpint = 0;\n\t\t\tforeach($config['virtualip']['vip'] as $carp) {\n\t\t\t\tif ($carp['mode'] != \"carp\") {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$carp_int = find_carp_interface($carp['subnet']);\n\t\t\t\t$status = get_carp_interface_status($carp_int);\n\t\t\t\tswitch($status) {\n\t\t\t\t\tcase \"MASTER\":\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"BACKUP\":\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t}", "public function getPrice(){ return $this->price_rur; }", "public function auto()\n {\n $niz=PomFunkResource::getAllCars();\n return view('auto.auto',['niz'=>$niz]);\n }", "public function find_purchase_car_info($pus_id=Null)\n\t{\n\t\tif($res= $this->Purchase_model->purchase_car_full_deatils($pus_id)){\n\t\t\techo json_encode($res);\n\t\t}else{\n\t\t\techo 0;\n\t\t}\n\t}", "public function getDiscountTaxCompensationInvoiced();", "private function purchaseRestrictionsAwal($ins) {\n \n $dateNow = date('Y-m-d'); // date now\n \n // cek total volume pengisian selama hari ini, apakah >= 100 liter\n $totalVolumeFill = $this->db->query(\"SELECT SUM(liter) AS `total_volume` FROM {$this->transaction_kendaraan} WHERE no_pol = '{$ins['no_pol']}' AND tgl = '{$dateNow}' \")\n ->row_array()['total_volume'];\n \n $lastTotalVolume = floatval($ins['liter']) + floatval($totalVolumeFill);\n \n if($lastTotalVolume > 200) {\n\t $response = [\n\t \"status\" => \"error\", \n\t \"message\" => \"Customer tidak dapat mengisi lebih dari 200 liter ({$lastTotalVolume} liter) dalam satu hari yang sama\"\t \n\t // \"message\" => \"Customer tidak dapat mengisi lebih dari 200 liter ({$lastTotalVolume} liter) dalam pembelian ke - {$ins['numOfBuy']}\", \n\t ];\n\t echo json_encode($response);\n\t \n } else if(floatval($ins['liter']) > 75) {\n\t \n\t $response = [\n\t \"status\" => \"approval\", \n\t \"message\" => \"Customer ingin mengisi lebih dari 75 liter ({$ins['liter']} liter) dalam pembelian {$ins['numOfBuy']}\", \n\t \"question\" => \"Apakah anda setuju melakukan pengisian lebih dari 75 liter ({$ins['liter']} liter) ?\"\n\t ];\n\t echo json_encode($response);\n\t \n } else {\n\t $response = [\n\t \"status\" => \"ok\", \n\t \"message\" => \"Customer ingin mengisi biosolar dengan volume {$ins['liter']} liter pada pembelian ke - {$ins['numOfBuy']}\"\n\t ];\n\t echo json_encode($response);\t \n } \n }", "public function getServAssocRate($value)\n\t\t{\n\t\t\t$id=explode(',',$value);\n\t\t\t\n\t\t\t$serList=\\DB::table('ser_assoc_rate')->join('associate','ser_assoc_rate.Assoc_ID','=','associate.Assoc_ID')\n\t\t\t->join('ser_services', 'ser_services.SerServ_ID','=','ser_assoc_rate.SerServ_ID')\n\t\t\t->where('ser_assoc_rate.SerServ_ID', $id[0])\n\t\t\t->where('ser_assoc_rate.Pattern',$id[1])\n\t\t\n\t\t\t->select('ser_assoc_rate.Assoc_ID','ser_assoc_rate.Pattern','ser_assoc_rate.Rate','associate.Assoc_FirstName','associate.Assoc_MiddleName','associate.Assoc_LastName','ser_assoc_rate.Current_Date','ser_assoc_rate.Expiry_Date','ser_services.SerServ_Name')\n\t\t\t\t->orderby('ser_assoc_rate.Rate')\n\t\t\t->get();\n\t\t\t$listResp=array('success'=>true, $serList);\n\t\treturn $listResp;\n\t\t}", "public function fetchAudi()\n {\n $url = 'https://www.polovniautomobili.com/putnicka-vozila/pretraga?brand=38&price_from=40000&without_price=1&showOldNew=all';\n\n $html = file_get_contents($url);\n $dom = FluentDOM::QueryCss($html, 'text/html');\n\n $cars = \\Helpers::get_cars($dom);\n\n if (count($cars)) {\n // Now we need to save external cars to database\n foreach ($cars as $car) {\n $car['category'] = 'Audi';\n $car['added_by'] = auth()->id();\n $car['approved'] = 1;\n // We need to check if this car already exists so we use firstOrCreate instead of create method\n /**\n * TODO: maybe exclude image_path before we call create method and use firstOrNew to add image_path and then save(),\n * because each time image_path is unique and we will always get new instance of Vehicle even if everything else is same,\n * or maybe you wanted to clear Audi vehicles each time and add new, updated cars?\n */\n $vehicle = Vehicle::firstOrCreate($car);\n\n // We will probably call this method over AJAX and update category view over JavaScript\n // that's why we will just return json of added cars\n $vehicles[] = $vehicle;\n }\n\n // Now we need to create pagination of this vehicles\n $vehicles_pagination = \\Helpers::create_pagination($vehicles, config('pagination.per_page'));\n\n $carousel_images = [];\n\n foreach ($vehicles_pagination as $vehicle) {\n array_push($carousel_images, $vehicle->image_path);\n }\n\n return \\View::make('partials.ajax_vehicles', ['vehicles' => $vehicles_pagination, 'carousel_images' => $carousel_images, 'category' => 'Audi']);\n }\n }", "public function getSubtotalInvoiced();", "private function rateIt()\n {\n try\n {\n $request = $_POST;\n\n $types = array('videos','video','v','photos','photo','p','collections','collection','cl','users','user','u');\n\n //check if type sent\n if( !isset($request['type']) || $request['type']==\"\" )\n throw_error_msg(\"type not provided\");\n\n //check valid type\n if(!in_array($request['type'], $types))\n throw_error_msg(\"invalid type\");\n\n //check id \n if( !isset($request['id']) || $request['id']==\"\" )\n throw_error_msg(\"id not provided\"); \n\n //check valid id \n if( !is_numeric($request['id']) )\n throw_error_msg(\"invalid id\"); \n\n //check rating \n if( !isset($request['rating']) || $request['rating']==\"\" )\n throw_error_msg(\"rating not provided\"); \n\n //check valid rating \n if( !is_numeric($request['rating']) )\n throw_error_msg(\"invalid rating\");\n\n $type = mysql_clean($request['type']);\n $id = mysql_clean($request['id']);\n $rating = mysql_clean($request['rating']);\n \n switch($type)\n {\n case \"videos\":\n case \"video\":\n case \"v\":\n {\n global $cbvid;\n $rating = $rating*2;\n $result = $cbvid->rate_video($id,$rating);\n }\n break;\n\n case \"photos\":\n case \"photo\":\n case \"p\":\n {\n global $cbphoto;\n $rating = $rating*2;\n $result = $cbphoto->rate_photo($id,$rating);\n }\n break;\n\n case \"collections\":\n case \"collection\":\n case \"cl\":\n {\n global $cbcollection;\n $rating = $rating*2;\n $result = $cbcollection->rate_collection($id,$rating);\n }\n break;\n\n case \"users\":\n case \"user\":\n case \"u\":\n {\n global $userquery;\n $rating = $rating*2;\n $result = $userquery->rate_user($id,$rating);\n }\n break;\n }\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $data = array('code' => \"204\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => $result);\n $this->response($this->json($data)); \n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage()); \n }\n\n }", "public function getPriceMode();", "public function getRefreshRate() { return 0; }", "function mobile_recharge_api($operator_id, $mobile, $amount) {\n\t\t$operator_id = $operator_id;\n\t\t$mobile1 = '0' . $mobile;\n\t\t$amount = $amount;\n\t\t$biller_records = $this -> conn -> get_table_row_byidvalue('operator_list', 'operator_id', $operator_id);\n\n\t\t$operator_name = $biller_records['0']['operator_name'];\n\t\t$operator_code = $biller_records['0']['operator_code'];\n\t\tif ($operator_code == 'MTN' || $operator_code == 'VISAF') \n\t{\n\t\t\t$userid = '08092230991';\n\t\t\t$pass = '01fa320f4048f4fa51a34';\n\t\t\t$url = \"http://mobileairtimeng.com/httpapi/?userid=$userid&pass=$pass&network=5&phone=$mobile1&amt=$amount\";\n\t\t\t$str = file_get_contents($url);\n\n\t\t\t$sdk = explode(\"|\", $str);\n\t\t\t$pos = $sdk[0];\n\t\t\treturn $pos;\n\t\t} \n\t\t/*\n\t\telse if ($operator_code == 'ETST' || $operator_code == 'AIRT' || $operator_code == 'Glo' || $operator_code == 'VISAF') {\n\t\t\n\t\t\t\t\t\n\t\t\n\t\t\t\t\tini_set(\"soap.wsdl_cache_enabled\", \"0\");\n\t\t\t\t\t$a = array(\"trace\" => 1, \"exceptions\" => 1);\n\t\t\t\t\t$wsdl = \"http://202.140.50.116/EstelServices/services/EstelServices?wsdl\";\n\t\t\t\t\t$client = new SoapClient($wsdl, $a);\n\t\t\t\t\t$simpleresult = $client -> getTopup(array(\"agentCode\" => 'TPR_EFF', \"mpin\" => 'ECE473FF47C2E97FF3F1D496271A9EB1', \"destination\" => $mobile1, \"amount\" => $amount, \"productCode\" => $operator_code, \"comments\" => \"topup\", \"agenttransid\" => '1234', \"type\" => 'PC'));\n\t\t\n\t\t\t\t\t$soaoresponce = $client -> __getLastResponse();\n\t\t\n\t\t\t\t\t$xml = simplexml_load_string($soaoresponce, NULL, NULL, \"http://schemas.xmlsoap.org/soap/envelope/\");\n\t\t\t\t\t$ns = $xml -> getNamespaces(true);\n\t\t\t\t\t$soap = $xml -> children($ns['soapenv']);\n\t\t\t\t\t$agentCode = $soap -> Body -> children($ns['topupRequestReturn']) -> children($ns['ns1']) -> agentCode;\n\t\t\t\t\t$productcode = $soap -> Body -> children($ns['topupRequestReturn']) -> children($ns['ns5']) -> productcode;\n\t\t\t\t\t$destination = $soap -> Body -> children($ns['topupRequestReturn']) -> children($ns['ns6']) -> destination;\n\t\t\t\t\t$agenttransid = $soap -> Body -> children($ns['topupRequestReturn']) -> children($ns['ns8']) -> agenttransid;\n\t\t\t\t\t$amount = $soap -> Body -> children($ns['topupRequestReturn']) -> children($ns['ns9']) -> amount;\n\t\t\t\t\t$transid = $soap -> Body -> children($ns['topupRequestReturn']) -> children($ns['ns12']) -> transid;\n\t\t\t\t\t$resultdescription = $soap -> Body -> children($ns['topupRequestReturn']) -> children($ns['ns26']) -> resultdescription;\n\t\t\n\t\t\t\t\tif ($resultdescription[0] == 'Transaction Successful') {\n\t\t\t\t\t\t//echo \"transid=\".$transid[0].'<br>';\n\t\t\t\t\t\t$recharge_status = '1';\n\t\t\t\t\t\t$transaction_id = $transid[0];\n\t\t\t\t\t\t$result = $recharge_status . \",\" . $transid[0];\n\t\t\t\t\t\t//$result=array(\"recharge_status\"=>$recharge_status,'transaction_id'=>$transid[0]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$result = \"2\" . \"0\";\n\t\t\t\t\t}\n\t\t\t\t\treturn $result;\n\t\t\t\t}*/\n\t\t\n // corncone api for recharge==================//////////////////==========\n\t\telse if($operator_code == 'AQA' || $operator_code == 'AWA' || $operator_code == 'AQC' || $operator_code == 'ANA'|| $operator_code == 'APA' || $operator_code == 'AEA' || $operator_code == 'ACA' || $operator_code == 'Glo')\n\t\t{\n\t\t\t$phone=$mobile;\n\t\t\t$id=rand('1000','9999');\n\t\t\t$service_id=$operator_code;\n\t\t\t$amt=$amount;\n\t\t\tif($operator_code == 'Glo'|| $operator_code == 'ACA'|| $operator_code == 'AEA')\n\t\t\t{\n\t\t\t\t$arr = array('details' => array('phoneNumber' => $phone, 'amount' => $amt),\n\t\t\t\t\t 'id' => $id,\n\t\t\t\t\t 'paymentCollectorId' => 'CDL',\n\t\t\t\t\t 'paymentMethod' => 'PREPAID',\n\t\t\t\t\t 'serviceId' => $service_id\n\t\t\t\t\t\t);\n\t\t\t\t\n\t\t\t}else\n\t\t\tif($operator_code == 'APA')\n\t\t\t{\n\t\t\t\n\t\t\t\t$arr = array(\n\t\t\t\t\t 'details' => array('accountNumber' => $phone, 'amount' => $amt),\n\t\t\t\t\t 'id' => $id,\n\t\t\t\t\t 'paymentCollectorId' => 'CDL',\n\t\t\t\t\t 'paymentMethod' => 'PREPAID',\n\t\t\t\t\t 'serviceId' => $service_id\n\t\t\t\t\t\t);\n\t\t\t}else \n\t\t\tif($operator_code == 'ANB'|| $operator_code == 'ANA')\n\t\t\t{\n\t\t\t\n\t\t\t\t$arr = array(\n\t\t\t\t\t 'details' => array('customerAccountId' => $phone, 'amount' => $amt),\n\t\t\t\t\t 'id' => $id,\n\t\t\t\t\t 'paymentCollectorId' => 'CDL',\n\t\t\t\t\t 'paymentMethod' => 'PREPAID',\n\t\t\t\t\t 'serviceId' => $service_id\n\t\t\t\t\t\t);\n\t\t\t\t\n\t\t\t}\n\t\t\telse \n\t\t\tif($operator_code == 'AQC')\n\t\t\t{\n\t\n\t\n\t\t\t$arr = array(\n\t\t\t\t\t 'details' => array('productsCodes' => [\"GOTVPLS\"],'customerNumber'=>$phone, 'amount' => $amt,'customerName'=>\"John\nSmith\",'invoicePeriod'=>1),\n\t\t\t\t\t 'id' => $id,\n\t\t\t\t\t 'paymentCollectorId' => 'CDL',\n\t\t\t\t\t 'paymentMethod' => 'PREPAID',\n\t\t\t\t\t 'serviceId' => $service_id\n\t\t\t\t\t\t);\n\t\t\t\n\t\t\t}\n\t\t\telse \n\t\t\tif($operator_code == 'AWA')\n\t\t\t{\n\t\t\t$arr = array(\n\t\t\t\t\t 'details' => array('smartCardNumber' => $phone, 'amount' => $amt),\n\t\t\t\t\t 'id' => $id,\n\t\t\t\t\t 'paymentCollectorId' => 'CDL',\n\t\t\t\t\t 'paymentMethod' => 'PREPAID',\n\t\t\t\t\t 'serviceId' => $service_id\n\t\t\t\t\t\t);\n\t\t\t\t\n\t\t\t}else \n\t\t\tif($operator_code == 'AQA')\n\t\t\t{\n\t\t\t\t$arr = array(\n\t\t\t\t\t 'details' => array('productsCodes' => [\"ACSSW4\",\"ASIADDW\",\"HDPVRW\"\n],'customerNumber'=>$phone, 'amount' => $amt,'customerName'=>\"John\nSmith\",'invoicePeriod'=>1),\n\t\t\t\t\t 'id' => $id,\n\t\t\t\t\t 'paymentCollectorId' => 'CDL',\n\t\t\t\t\t 'paymentMethod' => 'PREPAID',\n\t\t\t\t\t 'serviceId' => $service_id\n\t\t\t\t\t\t);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$requestBody = json_encode($arr);\n\t\t\t$hashedRequestBody = base64_encode(hash('sha256', utf8_encode($requestBody), true));\n\t\t\t$date = gmdate('D, d M Y H:i:s T');\n\t\t\t$signedData = \"POST\" . \"\\n\" . $hashedRequestBody . \"\\n\" . $date . \"\\n\" . \"/rest/consumer/v2/exchange\";\n\t\t\t$token = base64_decode('+uwXEA2F3Shkeqnqmt9LcmALGgkEbf2L6MbKdUJcFwow6X8jOU/D36CyYjp5csR5gPTLedvPQDg1jJGmOnTJ2A==');\n\t\t\t$signature = hash_hmac('sha1', $signedData, $token, true);\n\t\t\t$encodedsignature = base64_encode($signature);\n\n\t\t\t$arr = \n\t\t\tarray(\n\t\t\t\t\"accept: application/json, application/*+json\", \n\t\t\t\t\"accept-encoding: gzip,deflate\", \n\t\t\t\t\"authorization: MSP efficiencie:\" . $encodedsignature, \n\t\t\t\t\"cache-control: no-cache\", \n\t\t\t\t\"connection: Keep-Alive\", \n\t\t\t\t\"content-type: application/json\", \n\t\t\t\t\"host: 136.243.252.209\", \n\t\t\t\t\"x-msp-date:\" . $date\n\t\t\t\t);\n\n\t\t\t\t\t$curl = curl_init();\n\t\t\t\t\tcurl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);\n\t\t\t\t\tcurl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);\n\t\t\t\t\tcurl_setopt_array($curl, array(CURLOPT_URL => \"https://136.243.252.209/app/rest/consumer/v2/exchange\", \n\t\t\t\t\tCURLOPT_RETURNTRANSFER => true, \n\t\t\t\t\tCURLOPT_ENCODING => \"\", \n\t\t\t\t\tCURLOPT_MAXREDIRS => 10, \n\t\t\t\t\tCURLOPT_TIMEOUT => 30, \n\t\t\t\t\tCURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, \n\t\t\t\t\tCURLOPT_CUSTOMREQUEST => \"POST\", \n\t\t\t\t\tCURLOPT_POSTFIELDS => $requestBody, \n\t\t\t\t\tCURLOPT_HTTPHEADER => $arr));\n\t\t\t\t\t$response = curl_exec($curl);\n\t\t\t\t\t$err = curl_error($curl);\n\t\t\t\t\tcurl_close($curl);\n\n\t\t\t\t\tif ($err) {\n\t\t\t\t\t\techo \"cURL Error #:\" . $err;\n\t\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t\t$arr=json_decode($response);\n\t\t\t\t\t\t$transaction_id=$arr->details->exchangeReference;\n\t\t\t\t\t\t $responseMessage=$arr->details->responseMessage;\n\t\t\t\t\t\t $status=$arr->details->status;\n\t\t\t\t\t\t $statusCode=$arr->details->statusCode;\n\t\t\t\t\t\t if($status=='ACCEPTED')\n\t\t\t\t\t\t {\n\t\t\t\t\t\t \t$recharge_status='1';\n\t\t\t\t\t\t \t$result = $recharge_status . \",\" . $transaction_id;\n\t\t\t\t\t\t }else{\n\t\t\t\t\t\t \t$result = \"2\" . \"0\";\n\t\t\t\t\t\t }\n\t\t\t\t\t\t return $result;\n\t\t\t\t\t}\n\t\t\t\n\t\t}\n\n\t}", "function get_indicator_price($price,$vat){\r\n $full_price = $price + ($price * $vat);\r\n return $full_price;\r\n}", "public function getCompetitivePricingForSKU($request);", "public function getMyPriceForSKU($request);", "function cvrapi($vat, $country)\n{\n $vat = preg_replace('/[^0-9]/', '', $vat);\n // Check whether VAT-number is invalid\n if(empty($vat) === true)\n {\n\n // Print error message\n return('Venligst angiv et CVR-nummer.');\n\n } else {\n\n // Start cURL\n $ch = curl_init();\n\n // Set cURL options\n curl_setopt($ch, CURLOPT_URL, 'http://cvrapi.dk/api?vat=' . $vat . '&country=' . 'dk');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_USERAGENT, 'Fetching company information');\n\n // Parse result\n $result = curl_exec($ch);\n\n // Close connection when done\n curl_close($ch);\n\n // Return our decoded result\n return json_decode($result, 1);\n\n }\n}", "function view_voucher($demand_id)\n {\n }", "protected function _drcRequest($service)\r\n\t{\r\t\t$db = Mage::getSingleton('core/resource')->getConnection('core_write');\r\t\t\r\n\t\t$origCountry = Mage::getStoreConfig('shipping/origin/country_id', $this->getStore());\r\n\t\tif ($origCountry != \"AU\") \r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\t\t\r\r\r\n\t\t// TODO: Add some more validations\r\t\t$path_smartsend = \"carriers/smartsend/\";\r\t\t\r\n\t\t//$frompcode = Mage::getStoreConfig('shipping/origin/postcode', $this->getStore());\r\n\t\t//$fromsuburb = Mage::getStoreConfig('shipping/origin/city', $this->getStore());\r\t\t\r\t\t$frompcode = Mage::getStoreConfig($path_smartsend.'post_code', $this->getStore());\r\t\t$fromsuburb = Mage::getStoreConfig($path_smartsend.'suburban', $this->getStore());\r\t\t\r\n\t\t$topcode = $service->getDestPostcode();\r\n\t\t$tosuburb = $service->getDestCity();\r\r\t\tMage::Log($frompcode);\r\t\tMage::Log($fromsuburb);\r\t\t\r\n\t\tif ($service->getDestCountryId()) {\r\n\t\t\t$destCountry = $service->getDestCountryId();\r\n\t\t} \r\r\n\t\telse{\r\n\t\t\t$destCountry = \"AU\";\r\n\t\t}\t\t\r\t\r\n\t\t// Here we get the weight (and convert it to grams) and set some\r\n\t\t// sensible defaults for other shipping parameters.\t\r\r\n\t\t$weight = (int)$service->getPackageWeight();\r\t\t\r\t\t$height = $width = $length = 100;\r\n\t\t$shipping_num_boxes = 1;\r\n\t\t$Description = \"CARTON\";\r\n\t\t$post_url = \"http://api.smartsend.com.au/\"; \r\r\t\r\n \r\t//$result = $db->query(\"SELECT depth,length,height,description,taillift FROM 'smartsend_products'\");\r\t\r\t\r\n $post_param_values[\"METHOD\"] = \"GetQuote\";\r\n $post_param_values[\"FROMCOUNTRYCODE\"] = $origCountry;\r\n $post_param_values[\"FROMPOSTCODE\"] = $frompcode; //\"2000\";\r\n $post_param_values[\"FROMSUBURB\"] = $fromsuburb; //\"SYDNEY\";\r\n $post_param_values[\"TOCOUNTRYCODE\"] = $destCountry;\r\n $post_param_values[\"TOPOSTCODE\"] = $topcode;\r\n $post_param_values[\"TOSUBURB\"] = $tosuburb;\r\r\n\r\t\r\n # tail lift - init \r\n $taillift = array();\r\n $key = 0;\r\r\n\t$freeBoxes = 0;\r\n if ($service->getAllItems()) {\r\n foreach ($service->getAllItems() as $item) {\r\r\n\t/* fetching the values of lenght,weight,height,description in smartsend_products table */\r\t\t\t\t$prod_id = $item->getProduct()->getId();\r\t\t\t\t\r\t\t\t\t\r\n if ($item->getProduct()->isVirtual() || $item->getParentItem()) {\r\r\n continue;\r\r\n }\r\r\n\r\r\n if ($item->getHasChildren() && $item->isShipSeparately()) {\r\r\n foreach ($item->getChildren() as $child) {\r\r\n if ($child->getFreeShipping() && !$child->getProduct()->isVirtual()) {\r\r\n $freeBoxes += $item->getQty() * $child->getQty();\r\r\n }\r\r\n }\r\r\n } elseif ($item->getFreeShipping()) {\r\r\n $freeBoxes += $item->getQty();\r\r\n }\r\t\t\t\t\r\t\t\t\t$prod_id \t= $item->getProduct()->getId();\r\t\t\t\t$result \t= $db->query('Select * from `smartsend_products` where id='.\"'\".$prod_id.\"'\");\r\t\t\t\t$rows \t\t= $result->fetch(PDO::FETCH_ASSOC);\r\t\t\t\t\r\t\t\t\t\r\t\t\t\tif($rows){\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_HEIGHT\"] = $rows['height'];\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_LENGTH\"] = $rows['length'];\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_DEPTH\"] = $rows['depth'];\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_WEIGHT\"] = $weight;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_DESCRIPTION\"] = $rows['description'];\r\t\t\t\t}else{\r\t\t\t\t\t/* default values */\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_HEIGHT\"] = 1;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_LENGTH\"] = 1;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_DEPTH\"] = 1;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_WEIGHT\"] = $weight;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_DESCRIPTION\"] = 'none';\t\t\t\t\r\t\t\t\t}\r\r # tail lift - assigns value\r switch($rows['taillift']){\r case 'none':\r $taillift[] = \"none\";break;\r case 'atpickup':\r $taillift[] = \"atpickup\";break; \r case 'atdestination':\r $taillift[] = \"atdestination\";break; \r case 'both':\r $taillift[] = \"both\";break; \r }\r\t\t\t\t\t\r\t\t\t\t$key++;\r\n }\r\r\n }\r\t\t\r\t\t\r\r\n $this->setFreeBoxes($freeBoxes);\r\t\t\t\t\t\t\t\r/*\r\n $post_value_items[\"ITEM({$key})_HEIGHT\"] = $height;\r\n $post_value_items[\"ITEM({$key})_LENGTH\"] = $length;\r\n $post_value_items[\"ITEM({$key})_DEPTH\"] = $width;\r\n $post_value_items[\"ITEM({$key})_WEIGHT\"] = $width;\r\n $post_value_items[\"ITEM({$key})_DESCRIPTION\"] = $Description;\r*/\r \r \t\t\r\r\n # tail lift - choose appropriate value\r\r\n $post_param_values[\"TAILLIFT\"] = \"none\"; \r\r\n if (in_array(\"none\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"none\"; \r\n if (in_array(\"atpickup\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"atpickup\";\r\n if (in_array(\"atdestination\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"atdestination\";\r\n if (in_array(\"atpickup\", $taillift) && in_array(\"atdestination\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"both\";\r\n if (in_array(\"both\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"both\"; \r\r\n \r\r\n $post_final_values = array_merge($post_param_values,$post_value_items);\r\r\n # POST PARAMETER AND ITEMS VALUE URLENCODE\r\r\n $post_string = \"\";\r\r\n foreach( $post_final_values as $key => $value )\r\n { $post_string .= \"$key=\" . urlencode( $value ) . \"&\"; }\r\n $post_string = rtrim( $post_string, \"& \" );\r\r\n\tif ($service->getFreeShipping() === true || $service->getPackageQty() == $this->getFreeBoxes()) {\r $shippingPrice = '0.00';\r\t\t\t\t\r\r\n $arr_resp['ACK'] = 'Success';\r $arr_resp['QUOTE(0)_TOTAL'] = $shippingPrice;\r $arr_resp['QUOTE(0)_ESTIMATEDTRANSITTIME'] = 'Fixed';\r $arr_resp['QUOTECOUNT'] = 1;\r\r\n }else{\r\r\n \r\r\n # START CURL PROCESS\r\r\n $request = curl_init($post_url); \r\tcurl_setopt($request, CURLOPT_HEADER, 0); \r\tcurl_setopt($request, CURLOPT_RETURNTRANSFER, 1); \r\n curl_setopt($request, CURLOPT_POSTFIELDS, $post_string);\r\n curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE);\r\n $post_response = curl_exec($request); \r\n curl_close ($request); // close curl object \r\r\n\t# parse output\r\n parse_str($post_response, $arr_resp);\r\r\n\t}\r\r\n\treturn $arr_resp;\r\r\n\t}", "public function calculatePayment()\n {\n }", "public function getCars()\n {\n $automoviles = Automovil::get();\n \n return $this->sendResponse($automoviles, 'Completado Correctamente.');\n }", "function pricesAction(){\n\t $this->_helper->layout->disableLayout();\n\t $this->_helper->viewRenderer->setNoRender(TRUE);\n\t \n \t// $session = SessionWrapper::getInstance();\n \t$formvalues = $this->_getAllParams();\n \t// debugMessage($formvalues);\n \t\n \t$where_query = \"\";\n \t$bundled = true;\n \t$commodityquery = false;\n \tif(count($formvalues) == 3){\n \t\techo \"NULL_PARAMETER_LIST\";\n \t\texit();\n \t}\n \tif(isArrayKeyAnEmptyString('commodity', $formvalues) && isArrayKeyAnEmptyString('commodityid', $formvalues) && $this->_getParam('range') != 'all'){\n \t\techo \"COMMODITY_NULL\";\n \t\texit();\n \t}\n \t# commodity query\n \tif((!isArrayKeyAnEmptyString('commodityid', $formvalues) || !isArrayKeyAnEmptyString('commodity', $formvalues)) && $this->_getParam('range') != 'all'){\n \t\t$com = new Commodity();\n \t\t// commodityid specified\n \t\tif(!isEmptyString($this->_getParam('commodityid'))){\n\t \t\t$com->populate($formvalues['commodityid']);\n\t \t\t// debugMessage($com->toArray());\n\t \t\tif(isEmptyString($com->getID()) || !is_numeric($formvalues['commodityid'])){\n\t \t\t\techo \"COMMODITY_INVALID\";\n\t \t\t\texit();\n\t \t\t}\n\t \t\t$comid = $formvalues['commodityid'];\n\t \t\t$where_query .= \" AND d.commodityid = '\".$comid.\"' \";\n \t\t}\n \t\t// commodty name specified\n \t\tif(!isEmptyString($this->_getParam('commodity'))){\n \t\t\t$searchstring = $formvalues['commodity'];\n \t\t\t$islist = false;\n\t \t\tif(strpos($searchstring, ',') !== false) {\n\t\t\t\t\t$islist = true;\n\t\t\t\t}\n\t\t\t\tif(!$islist){\n\t \t\t\t$comid = $com->findByName($searchstring);\n\t \t\t\t$comid_count = count($comid);\n\t \t\t\tif($comid_count == 0){\n\t\t \t\t\techo \"COMMODITY_INVALID\";\n\t\t \t\t\texit();\n\t\t \t\t}\n\t\t \t\tif($comid_count == 1){\n\t\t \t\t\t$where_query .= \" AND d.commodityid = '\".$comid[0]['id'].\"' \";\n\t\t \t\t}\n\t \t\t\tif($comid_count > 1){\n\t \t\t\t\t$ids_array = array();\n\t \t\t\t\tforeach ($comid as $value){\n\t \t\t\t\t\t$ids_array[] = $value['id'];\n\t \t\t\t\t}\n\t \t\t\t\t$ids_list = implode($ids_array, \"','\");\n\t \t\t\t\t// debugMessage($ids_list);\n\t\t \t\t\t$where_query .= \" AND d.commodityid IN('\".$ids_list.\"') \";\n\t\t \t\t}\n\t\t\t\t}\n\t\t\t\tif($islist){\n\t\t\t\t\t$bundled = false;\n\t\t\t\t\t$searchstring = trim($searchstring);\n\t\t\t\t\t$seach_array = explode(',', $searchstring);\n\t\t\t\t\t// debugMessage($seach_array);\n\t\t\t\t\tif(is_array($seach_array)){\n\t\t\t\t\t\t$ids_array = array();\n\t\t\t\t\t\tforeach ($seach_array as $string){\n\t\t\t\t\t\t\t$com = new Commodity();\n\t\t\t\t\t\t\t$comid = $com->findByName($string);\n\t \t\t\t\t\t$comid_count = count($comid);\n\t\t\t\t\t\t\tif($comid_count > 0){\n\t\t\t \t\t\t\tforeach ($comid as $value){\n\t\t\t \t\t\t\t\t$ids_array[] = $value['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(count($ids_array) > 0){\n\t\t\t\t\t\t\t$ids_list = implode($ids_array, \"','\");\n\t\t\t \t\t\t// debugMessage($ids_list);\n\t\t\t\t \t\t$where_query .= \" AND d.commodityid IN('\".$ids_list.\"') \";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo \"COMMODITY_LIST_INVALID\";\n\t\t \t\t\t\texit();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo \"COMMODITY_LIST_INVALID\";\n\t\t \t\t\texit();\n\t\t\t\t\t}\n\t\t\t\t}\n \t\t}\n\t \t\t\n \t\t$commodityquery = true;\n \t\tif($this->_getParam('unbundled') == '1'){\n \t\t\t$bundled = false;\n \t\t}\n \t\t\n \t}\n \t# markets query\n \t$marketquery = false;\n \t\tif(!isArrayKeyAnEmptyString('marketid', $formvalues) || !isArrayKeyAnEmptyString('market', $formvalues)){\n \t\t\t$market = new PriceSource();\n \t\t\tif(!isEmptyString($this->_getParam('marketid'))){\n\t \t\t$market->populate($formvalues['marketid']);\n\t \t\t// debugMessage($market->toArray());\n\t \t\tif(isEmptyString($market->getID()) || !is_numeric($formvalues['marketid'])){\n\t \t\t\techo \"MARKET_INVALID\";\n\t \t\t\texit();\n\t \t\t}\n\t \t\t$makid = $formvalues['marketid'];\n \t\t\t}\n \t\t\tif(!isEmptyString($this->_getParam('market'))){\n \t\t\t\t$makid = $market->findByName($formvalues['market']);\n \t\t\tif(isEmptyString($makid)){\n\t \t\t\techo \"MARKET_INVALID\";\n\t \t\t\texit();\n\t \t\t}\n \t\t\t}\n \t\t$marketquery = true;\n \t\t$where_query .= \" AND d.sourceid = '\".$makid.\"' \";\n \t}\n \t# district query\n \t$districtquery = false;\n \tif(!isArrayKeyAnEmptyString('districtid', $formvalues) || !isArrayKeyAnEmptyString('district', $formvalues)){\n \t\t\t$district = new District();\n \t\t\tif(!isArrayKeyAnEmptyString('districtid', $formvalues)){\n\t \t\t$district->populate($formvalues['districtid']);\n\t \t\t// debugMessage($market->toArray());\n\t \t\tif(isEmptyString($district->getID()) || !is_numeric($formvalues['districtid'])){\n\t \t\t\techo \"DISTRICT_INVALID\";\n\t \t\t\texit();\n\t \t\t}\n\t \t\t$distid = $formvalues['districtid'];\n \t\t\t}\n \t\t\tif(!isArrayKeyAnEmptyString('district', $formvalues)){\n \t\t\t\t$distid = $district->findByName($formvalues['district'], 2);\n \t\t\tif(isEmptyString($distid)){\n\t \t\t\techo \"DISTRICT_INVALID\";\n\t \t\t\texit();\n\t \t\t}\n \t\t\t}\n \t\t$districtquery = true;\n \t\tif($this->_getParam('unbundled') == '1'){\n \t\t\t$bundled = false;\n \t\t}\n \t\t$where_query .= \" AND d2.districtid = '\".$distid.\"' \";\n \t}\n \t# region query \n \t$regionquery = false;\n \tif(!isArrayKeyAnEmptyString('regionid', $formvalues) || !isArrayKeyAnEmptyString('region', $formvalues)){\n \t\t\t$region = new Region();\n \t\t\tif(!isArrayKeyAnEmptyString('regionid', $formvalues)){\n\t \t\t$region->populate($formvalues['regionid']);\n\t \t\t// debugMessage(region->toArray());\n\t \t\tif(isEmptyString($region->getID()) || !is_numeric($formvalues['regionid'])){\n\t \t\t\techo \"REGION_INVALID\";\n\t \t\t\texit();\n\t \t\t}\n\t \t\t$regid = $formvalues['regionid'];\n \t\t\t}\n \t\tif(!isEmptyString($this->_getParam('region'))){\n \t\t\t\t$regid = $region->findByName($formvalues['region'], 1);\n \t\t\tif(isEmptyString($regid)){\n\t \t\t\techo \"REGION_INVALID\";\n\t \t\t\texit();\n\t \t\t}\n \t\t\t}\n \t\t$regionquery = true;\n \t\t$bundled = true;\n \t\tif($this->_getParam('unbundled') == '1'){\n \t\t\t$bundled = false;\n \t\t}\n \t\t$where_query .= \" AND d2.regionid = '\".$regid.\"' \";\n \t}\n \t# all prices query\n \t$allpricesquery = false;\n \tif(!isArrayKeyAnEmptyString('range', $formvalues) && $this->_getParam('range') == 'all'){\n \t\t$allpricesquery = true;\n \t}\n \t// debugMessage($where_query); // exit();\n \t\t\n \t$conn = Doctrine_Manager::connection(); \n \t$query = \"SELECT \n\t\t\t\t\td2.regionid as regionid,\n\t\t\t\t\td2.region as region,\n\t\t\t\t\td2.districtid as districtid,\n\t\t\t\t\td2.district as district,\n \t\t\t\td.datecollected as date, \n\t\t\t\t\tREPLACE(d2.name,' Market','')as market,\n\t\t\t\t\td.sourceid as marketid,\n\t\t\t\t\tc.name as commodity,\n\t\t\t\t\td.commodityid as commodityid,\n\t\t\t\t\tcu.name as unit,\n\t\t\t\t\td.retailprice AS retailprice, \n\t\t\t\t\td.wholesaleprice AS wholesaleprice\n\t\t\t\t\tFROM commoditypricedetails AS d \n\t\t\t\t\tINNER JOIN commodity AS c ON (d.`commodityid` = c.id)\n\t\t\t\t\tLEFT JOIN commodityunit AS cu ON (c.unitid = cu.id)\n\t\t\t\t\tINNER JOIN (\n\t\t\t\t\tSELECT cp.sourceid,\n\t\t\t\t\tp.locationid as districtid,\n\t\t\t\t\tl.name as district,\n\t\t\t\t\tl.regionid as regionid, \n\t\t\t\t\tr.name as region, \n\t\t\t\t\tMAX(cp.datecollected) AS datecollected, \n\t\t\t\t\tp.name FROM commoditypricedetails cp \n\t\t\t\t\tINNER JOIN commoditypricesubmission AS cs1 ON (cp.`submissionid` = cs1.`id` \n\t\t\t\t\tAND cs1.`status` = 'Approved') \n\t\t\t\t\tINNER JOIN pricesource AS p ON (cp.sourceid = p.id AND p.`applicationtype` = 0 )\n\t\t\t\t\tINNER JOIN location AS l ON (p.locationid = l.id AND l.locationtype = 2)\n\t\t\t\t\tINNER JOIN location AS r ON (l.regionid = r.id AND r.locationtype = 1)\n\t\t\t\t\tWHERE cp.`pricecategoryid` = 2 GROUP BY cp.sourceid) AS d2 \n\t\t\t\t\tON (d.`sourceid` = d2.sourceid AND d.`datecollected` = d2.datecollected) \n\t\t\t\t\tWHERE d.`pricecategoryid` = 2 AND d.retailprice > 0 AND d.wholesaleprice > 0 AND date(d.datecollected) >= date(now()-interval 60 day) \".$where_query.\" ORDER BY d2.name\";\n \t\n \t// debugMessage($query);\n \t$result = $conn->fetchAll($query);\n \t$pricecount = count($result);\n \t// debugMessage($result); \n \t// exit();\n \tif($pricecount == 0){\n \t\techo \"RESULT_NULL\";\n \t} else {\n \t\t$feed = '';\n \t\t# format commodity output\n \t\tif($commodityquery && !$marketquery && !$districtquery){\n \t\t\t$feed = '';\n \t\t\tif(!$bundled){\n\t\t\t \tforeach ($result as $line){\n\t\t\t\t \t$feed .= '<item>';\n\t\t\t \t\t$feed .= '<region>'.$line['region'].'</region>';\n\t\t\t \t\t$feed .= '<regionid>'.$line['regionid'].'</regionid>';\n\t\t\t\t \t$feed .= '<district>'.$line['district'].'</district>';\n\t\t\t\t \t$feed .= '<districtid>'.$line['districtid'].'</districtid>';\n\t\t\t\t \t$feed .= '<market>'.$line['market'].'</market>';\n\t\t\t\t \t$feed .= '<marketid>'.$line['marketid'].'</marketid>';\n\t\t\t\t \t$feed .= '<commodity>'.$line['commodity'].'</commodity>';\n\t\t\t\t \t$feed .= '<commodityid>'.$line['commodityid'].'</commodityid>';\n\t\t\t\t \t$feed .= '<unit>' .$line['unit'].'</unit>';\n\t\t\t\t \t$feed .= '<datecollected>'.$line['date'].'</datecollected>';\n\t\t\t\t \t$feed .= '<retailprice>'.$line['retailprice'].'</retailprice>';\n\t\t\t\t\t $feed .= '<wholesaleprice>'.$line['wholesaleprice'].'</wholesaleprice>';\n\t\t\t\t\t $feed .= '</item>';\n\t\t\t \t}\n \t\t\t} else {\n \t\t\t\t$total_rp = 0;\n \t\t\t\t$total_wp = 0;\n \t\t\t\tforeach ($result as $line){\n \t\t\t\t\t$total_rp += $line['retailprice'];\n \t\t\t\t\t$total_wp += $line['wholesaleprice'];\n \t\t\t\t}\n \t\t\t\t$avg_rp = $total_rp/$pricecount;\n \t\t\t\t$avg_rp = ceil($avg_rp / 50) * 50;\n \t\t\t\t$avg_wp = $total_wp/$pricecount;\n \t\t\t\t$avg_wp = ceil($avg_wp / 50) * 50;\n \t\t\t\t\n \t\t\t\t$feed .= '<item>';\n\t\t\t\t \t$feed .= '<commodity>'.$result[0]['commodity'].'</commodity>';\n\t\t\t\t \t$feed .= '<commodityid>'.$result[0]['commodityid'].'</commodityid>';\n\t\t\t\t \t$feed .= '<unit>' .$result[0]['unit'].'</unit>';\n\t\t\t\t \t$feed .= '<datecollected>'.$result[0]['date'].'</datecollected>';\n\t\t\t\t \t$feed .= '<retailprice>'.$avg_rp.'</retailprice>';\n\t\t\t\t $feed .= '<wholesaleprice>'.$avg_wp.'</wholesaleprice>';\n\t\t\t\t $feed .= '<unbundled>1</unbundled>';\n\t\t\t\t $feed .= '</item>';\n \t\t\t}\n \t\t}\n \t\t# format market output\n \t\tif($marketquery){\n \t\t\t$feed = '';\n\t \t\tforeach ($result as $line){\n\t\t\t \t$feed .= '<item>';\n\t\t\t \t$feed .= '<region>'.$line['region'].'</region>';\n\t\t\t \t$feed .= '<regionid>'.$line['regionid'].'</regionid>';\n\t\t\t \t$feed .= '<district>'.$line['district'].'</district>';\n\t\t\t \t$feed .= '<districtid>'.$line['districtid'].'</districtid>';\n\t\t\t \t$feed .= '<market>'.$line['market'].'</market>';\n\t\t\t \t$feed .= '<marketid>'.$line['marketid'].'</marketid>';\n\t\t\t \t$feed .= '<commodity>'.$line['commodity'].'</commodity>';\n\t\t\t \t$feed .= '<commodityid>'.$line['commodityid'].'</commodityid>';\n\t\t\t \t$feed .= '<unit>' .$line['unit'].'</unit>';\n\t\t\t \t$feed .= '<datecollected>'.$line['date'].'</datecollected>';\n\t\t\t \t$feed .= '<retailprice>'.$line['retailprice'].'</retailprice>';\n\t\t\t\t $feed .= '<wholesaleprice>'.$line['wholesaleprice'].'</wholesaleprice>';\n\t\t\t\t $feed .= '</item>';\n\t \t\t}\n \t\t}\n \t\t# format region output\n \t\tif($districtquery){\n \t\t\t$feed = '';\n \t\t\tif(!$bundled){\n\t\t\t \tforeach ($result as $line){\n\t\t\t\t \t$feed .= '<item>';\n\t\t \t\t\t$feed .= '<region>'.$line['region'].'</region>';\n\t\t \t\t\t$feed .= '<regionid>'.$line['regionid'].'</regionid>';\n\t\t\t\t \t$feed .= '<district>'.$line['district'].'</district>';\n\t\t\t\t \t$feed .= '<districtid>'.$line['districtid'].'</districtid>';\n\t\t\t \t\t$feed .= '<market>'.$line['market'].'</market>';\n\t\t\t \t\t$feed .= '<marketid>'.$line['marketid'].'</marketid>';\n\t\t\t\t \t$feed .= '<commodity>'.$line['commodity'].'</commodity>';\n\t\t\t\t \t$feed .= '<commodityid>'.$line['commodityid'].'</commodityid>';\n\t\t\t\t \t$feed .= '<unit>' .$line['unit'].'</unit>';\n\t\t\t\t \t$feed .= '<datecollected>'.$line['date'].'</datecollected>';\n\t\t\t\t \t$feed .= '<retailprice>'.$line['retailprice'].'</retailprice>';\n\t\t\t\t\t $feed .= '<wholesaleprice>'.$line['wholesaleprice'].'</wholesaleprice>';\n\t\t\t\t\t $feed .= '</item>';\n\t\t\t \t}\n \t\t\t} else {\n \t\t\t\t$total_rp = 0;\n \t\t\t\t$total_wp = 0;\n \t\t\t\tforeach ($result as $line){\n \t\t\t\t\t$total_rp += $line['retailprice'];\n \t\t\t\t\t$total_wp += $line['wholesaleprice'];\n \t\t\t\t}\n \t\t\t\t$avg_rp = $total_rp/$pricecount;\n \t\t\t\t$avg_rp = ceil($avg_rp / 50) * 50;\n \t\t\t\t$avg_wp = $total_wp/$pricecount;\n \t\t\t\t$avg_wp = ceil($avg_wp / 50) * 50;\n \t\t\t\t\t\n \t\t\t\t$feed .= '<item>';\n\t\t\t \t$feed .= '<region>'.$result[0]['region'].'</region>';\n\t\t\t \t$feed .= '<regionid>'.$result[0]['regionid'].'</regionid>';\n\t\t\t\t $feed .= '<district>'.$result[0]['district'].'</district>';\n\t\t\t\t $feed .= '<districtid>'.$result[0]['districtid'].'</districtid>';\n\t\t\t\t $feed .= '<commodity>'.$result[0]['commodity'].'</commodity>';\n\t\t\t\t $feed .= '<commodityid>'.$result[0]['commodityid'].'</commodityid>';\n\t\t\t\t $feed .= '<unit>' .$result[0]['unit'].'</unit>';\n\t\t\t\t $feed .= '<datecollected>'.$result[0]['date'].'</datecollected>';\n\t\t\t\t $feed .= '<retailprice>'.$avg_rp.'</retailprice>';\n\t\t\t\t\t$feed .= '<wholesaleprice>'.$avg_wp.'</wholesaleprice>';\n\t\t\t\t\t$feed .= '<unbundled>1</unbundled>';\n\t\t\t\t\t$feed .= '</item>';\n \t\t\t}\n \t\t}\n \t\t# format region output\n \t\tif($regionquery){\n \t\t\t$feed = '';\n \t\t\tif(!$bundled){\n\t\t\t \tforeach ($result as $line){\n\t\t\t\t\t $feed .= '<item>';\n\t\t\t \t\t$feed .= '<region>'.$line['region'].'</region>';\n\t\t\t \t\t$feed .= '<regionid>'.$line['regionid'].'</regionid>';\n\t\t\t\t\t $feed .= '<district>'.$line['district'].'</district>';\n\t\t\t\t\t $feed .= '<districtid>'.$line['districtid'].'</districtid>';\n\t\t\t\t \t$feed .= '<market>'.$line['market'].'</market>';\n\t\t\t\t \t$feed .= '<marketid>'.$line['marketid'].'</marketid>';\n\t\t\t\t\t $feed .= '<commodity>'.$line['commodity'].'</commodity>';\n\t\t\t\t\t $feed .= '<commodityid>'.$line['commodityid'].'</commodityid>';\n\t\t\t\t\t $feed .= '<unit>' .$line['unit'].'</unit>';\n\t\t\t\t\t $feed .= '<datecollected>'.$line['date'].'</datecollected>';\n\t\t\t\t\t $feed .= '<retailprice>'.$line['retailprice'].'</retailprice>';\n\t\t\t\t\t\t$feed .= '<wholesaleprice>'.$line['wholesaleprice'].'</wholesaleprice>';\n\t\t\t\t\t\t$feed .= '</item>';\n\t\t\t \t}\n \t\t\t} else {\n \t\t\t\t$total_rp = 0;\n \t\t\t\t$total_wp = 0;\n \t\t\t\tforeach ($result as $line){\n \t\t\t\t\t$total_rp += $line['retailprice'];\n \t\t\t\t\t$total_wp += $line['wholesaleprice'];\n \t\t\t\t}\n \t\t\t\t$avg_rp = $total_rp/$pricecount;\n \t\t\t\t$avg_rp = ceil($avg_rp / 50) * 50;\n \t\t\t\t$avg_wp = $total_wp/$pricecount;\n \t\t\t\t$avg_wp = ceil($avg_wp / 50) * 50;\n \t\t\t\t\n \t\t\t\t$feed .= '<item>';\n\t\t\t \t$feed .= '<region>'.$result[0]['region'].'</region>';\n\t\t\t \t$feed .= '<regionid>'.$result[0]['regionid'].'</regionid>';\n\t\t\t\t $feed .= '<commodity>'.$result[0]['commodity'].'</commodity>';\n\t\t\t\t $feed .= '<commodityid>'.$result[0]['commodityid'].'</commodityid>';\n\t\t\t\t $feed .= '<unit>' .$result[0]['unit'].'</unit>';\n\t\t\t\t $feed .= '<datecollected>'.$result[0]['date'].'</datecollected>';\n\t\t\t\t $feed .= '<retailprice>'.$avg_rp.'</retailprice>';\n\t\t\t\t\t$feed .= '<wholesaleprice>'.$avg_wp.'</wholesaleprice>';\n\t\t\t\t\t$feed .= '<unbundled>1</unbundled>';\n\t\t\t\t\t$feed .= '</item>';\n \t\t\t}\n \t\t}\n \t\t# format all prices output\n \t\tif($allpricesquery){\n \t\t\t$feed = '';\n \t\t\tforeach ($result as $line){\n\t\t\t \t$feed .= '<item>';\n\t\t\t \t$feed .= '<region>'.$line['region'].'</region>';\n\t\t\t \t$feed .= '<regionid>'.$line['regionid'].'</regionid>';\n\t\t\t \t$feed .= '<district>'.$line['district'].'</district>';\n\t\t\t \t$feed .= '<districtid>'.$line['districtid'].'</districtid>';\n\t\t \t\t$feed .= '<market>'.$line['market'].'</market>';\n\t\t \t\t$feed .= '<marketid>'.$line['marketid'].'</marketid>';\n\t\t\t \t$feed .= '<commodity>'.$line['commodity'].'</commodity>';\n\t\t\t \t$feed .= '<commodityid>'.$line['commodityid'].'</commodityid>';\n\t\t\t \t$feed .= '<unit>' .$line['unit'].'</unit>';\n\t\t\t \t$feed .= '<datecollected>'.$line['date'].'</datecollected>';\n\t\t\t \t$feed .= '<retailprice>'.$line['retailprice'].'</retailprice>';\n\t\t\t\t $feed .= '<wholesaleprice>'.$line['wholesaleprice'].'</wholesaleprice>';\n\t\t\t\t $feed .= '</item>';\n\t \t\t}\n \t\t}\n \t\t\n \t\t# output the xml returned\n \t\tif(isEmptyString($feed)){\n \t\t\techo \"EXCEPTION_ERROR\";\n \t\t} else {\n \t\t\techo '<?xml version=\"1.0\" encoding=\"UTF-8\"?><items>'.$feed.'</items>';\n \t\t}\n\t }\n }", "function getCarteOperation()\n {\n $query_rq_service = \"SELECT numero_carte FROM carte_parametrable WHERE idcarte=2\";\n $service = $this->getConnexion()->prepare($query_rq_service);\n $service->execute();\n $row_rq_service= $service->fetchObject();\n return $row_rq_service->numero_carte;\n }", "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 }", "public function index(Request $request, $modelyear, $make, $model) {\n\n try {\n $rating = $request->input('withRating');\n $client = new Client();\n $res = $client->request('GET', 'https://one.nhtsa.gov/webapi/api/SafetyRatings/modelyear/' . $modelyear . '/make/' . $make . '/model/' . $model);\n\n $vehicles = $res->getBody();\n if ($rating && ($rating == 'true' || $rating == 'True')) {\n\n $vehicles = json_decode($vehicles, true);\n $results = $vehicles['Results'];\n $rating_array = array();\n foreach ($results as $result) {\n\n\n $client = new Client();\n $res = $client->request('GET', 'https://one.nhtsa.gov/webapi/api/SafetyRatings/VehicleId/' . $result['VehicleId']);\n\n $ratings = $res->getBody();\n $ratings = json_decode($ratings, true);\n $rating_array[] = $ratings['Results'][0]['OverallRating'];\n }\n\n $vehicles = array();\n $count = 0;\n \n foreach ($results as $result) {\n $vehicles[] = array(\n 'CrashRating' => $rating_array[$count],\n 'Description' => $result['VehicleDescription'],\n 'VehicleId' => $result['VehicleId']\n );\n $count++;\n }\n\n return array(\n 'Count' => $count,\n 'Message' => 'Results returned successfully',\n 'Results' => $vehicles\n );\n }\n\n\n return $vehicles;\n } catch (\\Exception $e) {\n\n return array(\n 'Count' => 0,\n 'Message' => 'No results found for this request',\n 'Results' => array()\n );\n }\n }", "public function index()\n {\n // return Car::all();\n\n $skip = request()->input('skip', 0);\n $take = request()->input('take', Car::get()->count());\n\n return Car::skip($skip)->take($take)->get();\n }", "public function checkCreditLimit() {\n \n Mage::getModel('storesms/apiClient')->checkCreditLimit(); \n \n }", "function car_detail()\n {\n echo $this->wheel_count;\n echo $this->door_count;\n echo $this->seat_count;\n }", "public function cost(){\n\t\t\n\t\treturn 200;\n\t}" ]
[ "0.5984275", "0.58416975", "0.58329827", "0.5773014", "0.57282686", "0.57066685", "0.56140524", "0.56041324", "0.55659014", "0.551426", "0.54991746", "0.5498739", "0.5445294", "0.54193014", "0.5415721", "0.5404449", "0.5404384", "0.53993237", "0.53804123", "0.5376352", "0.53747314", "0.53744555", "0.53416127", "0.5330744", "0.53131235", "0.5312347", "0.5312151", "0.52967", "0.52925396", "0.5288136", "0.52783036", "0.5263224", "0.52495563", "0.5231776", "0.52136534", "0.52021", "0.5201468", "0.519878", "0.5185854", "0.5179411", "0.5179411", "0.51626194", "0.51378244", "0.5104234", "0.5101557", "0.50987357", "0.50987357", "0.50987357", "0.50987357", "0.50892043", "0.5088266", "0.5085955", "0.5071926", "0.50589216", "0.50559735", "0.50556016", "0.5049441", "0.5047191", "0.5047191", "0.50449896", "0.50442195", "0.5015525", "0.50075865", "0.50075865", "0.50035", "0.5000014", "0.49931055", "0.49921966", "0.49863845", "0.4978977", "0.49755347", "0.49744996", "0.49669608", "0.49654236", "0.4961748", "0.4961159", "0.49607477", "0.49561834", "0.4947094", "0.49470273", "0.49439624", "0.494058", "0.4936428", "0.49293333", "0.49292213", "0.4923396", "0.49207506", "0.49178335", "0.49112037", "0.49091125", "0.4908887", "0.4905955", "0.49052945", "0.49030495", "0.48991102", "0.48898137", "0.4887164", "0.48793343", "0.48760906", "0.48698407", "0.48598817" ]
0.0
-1
/ rate car independet service
public function give_rate_to_car(){ /* language changer */ $this->language = ($this->input->get('language') == "")?"english":$this->input->get('language'); $this->lang->load('master', "$this->language"); if($this->input->post()){ $request_para = array(); $rating_para['rating'] = $this->input->post('rating'); $rating_para['remarks'] = $this->input->post('remarks'); $rating_para['given_by'] = $this->input->post('car_renter_id'); $rating_para['car_id'] = $this->input->post('car_id'); $rating_para['booking_request_id'] = $this->input->post('booking_id'); $rating_para['date'] = date('Y-m-d H:i:s'); if($this->rating_model->rate_car($rating_para)){ $isSuccess = True; $message = $this->lang->line('action_performed_successfully'); $data = array(); }else{ $isSuccess = False; $message = $this->lang->line('not_able_to_perform_this_action'); $data = array(); } }else{ $isSuccess = False; $message = $this->lang->line('request_parameters_not_valid'); $data = array(); } echo json_encode(array("isSuccess" => $isSuccess, "message" => $message, "Result" => $data)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function AutoCar(WeappAutoCarRequest $request)\n {\n $IsProc = Cars::where('id', 1)->first();\n $name = $request->name;\n $password = $request->password;\n $State = 'true';\n\n if ('迟到的唐僧' == $name && 'Norman0%5138' == $password && '0' == $IsProc->explain)\n {\n $CarsCount = Cars::where(function($query){\n $query->where('minprice','>','0');\n })->count();\n\n $CarsArray = Cars::where(function($query){\n $query->where('minprice','>','0');\n })->get();\n\n $update_bool = Cars::where('id', 1)->update(['explain'=>'1']);\n\n for ($j=0; $j < $CarsCount; $j++)\n {\n $MoveToNext = false;\n $result = '';\n if ($CarsArray[$j]->id >= 1804)\n {\n $page = \"https://www.autohome.com.cn/\".$CarsArray[$j]->index_id;\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $page);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_AUTOREFERER, true);\n curl_setopt($ch, CURLOPT_REFERER, $page);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n curl_close($ch);\n $result = iconv(\"gb2312\",\"UTF-8//IGNORE\",$result);\n\n if (false != strpos($result, '<!--在售 start-->'))\n {\n $result = str_before(str_after($result, '<!--在售 start-->'), '<!--在售 end-->');\n $MoveToNext = false;\n }\n else\n {\n $MoveToNext = true;\n }\n }\n else\n {\n $MoveToNext = true;\n }\n\n\n\n $ResultArray[] = '';\n $i = 0;\n $CommonFeature = '';\n $CarName[] = '';\n $Feature[] = '';\n $Price[] = '';\n\n while((false != strpos($result, '</dd>') && (false == $MoveToNext)))\n {\n $ResultArray[$i] = str_before($result, '</dd>');\n $result = str_after($result, '</dd>');\n if (false != strpos($ResultArray[$i], '<dl>'))\n {\n $CommonFeature = str_before(str_after($ResultArray[$i], '<span>'), '</span>');\n }\n\n $CarName[$i] = str_before(str_after($ResultArray[$i], 'class=\"name\">'), '</a>');\n\n if (false != strpos($ResultArray[$i], '<p class=\"guidance-price\">'))\n {\n $Price[$i] = str_before(str_after(str_after($ResultArray[$i], '<p class=\"guidance-price\">'), '<span>'), '</span>');\n }\n else\n {\n $Price[$i] = '价格未公布';\n }\n\n if (false != strpos($ResultArray[$i], '<span class=\"type-default\">'))\n {\n $Feature[$i] = str_before(str_after($ResultArray[$i], '<span class=\"type-default\">'), '</span>');\n $FeatureTemp = str_after($ResultArray[$i], '<span class=\"type-default\">');\n if (false != strpos($FeatureTemp, '<span class=\"type-default\">'))\n {\n $Feature[$i] = $Feature[$i].' '.str_before(str_after($FeatureTemp, '<span class=\"type-default\">'), '</span>');\n $FeatureTemp = str_after($ResultArray[$i], '<span class=\"type-default\">');\n if (false != strpos($FeatureTemp, '<span class=\"athm-badge athm-badge--grey\">'))\n {\n $Feature[$i] = $Feature[$i].' '.str_before(str_after($FeatureTemp, '<span class=\"athm-badge athm-badge--grey\">'), '</span>');\n }\n }\n\n $Feature[$i] = $Feature[$i].' '.$CommonFeature;\n\n }\n else\n {\n $Feature[$i] = '参数未公布';\n }\n //$ResultArray[$i] = $CarName[$i].' '.$Feature[$i].' '.$CommonFeature.' '.$Price[$i];\n\n $insert_bool = Auto::insert([\n 'Auto_ID'=>$CarsArray[$j]->index_id,\n 'Name'=>$CarName[$i],\n 'Feature'=>$Feature[$i],\n 'KeyWord'=>$CarsArray[$j]->name,\n 'MatchIndex'=>($i + 1),\n 'Price'=>$Price[$i],\n 'CreateTime'=>now(),\n 'CTUnix'=>time(),\n 'UpdateTime'=>now(),\n 'UTUnix'=>time(),\n 'SelectCount'=>0,\n 'IsOld'=>0]);\n\n if (false == $insert_bool)\n {\n $State = 'false';\n $j = 1000000;\n break;\n }\n\n $i++;\n }\n\n if ($CarsArray[$j]->id >= 1804)\n {\n sleep(2);\n }\n }\n\n $update_bool = Cars::where('id', 1)->update(['explain'=>'0']);\n return $State;\n }\n else\n {\n return '账号密码不对或者正在抓取';\n }\n }", "public function rate()\n {\n\n }", "public function show(VehicleRequest $request)\n {\n \n $input = $request->input();\n $cost = $request->input('purchase_cost');\n\n\n \n // depreciation\n $depreciation = new depreciationCost($cost);\n $depreciation_amount = $depreciation->depreciateCalc();\n\n\n // interest \n $carInterest = new interestCost($cost);\n $interest_amount = $carInterest->interestCalc();\n $hire_amount = $carInterest->hirePurchase();\n\n // interest total\n $interest_total = $interest_amount + $hire_amount;\n\n\n $carInsurance = new insuranceCost($cost);\n $insurance_amount = $carInsurance->insuranceCalc();\n\n \n $cat = $request->input('category');\n\n //subscription\n $subscription_cost =$request->input('subs');\n\n\n //parking default\n $parking_cost = 93500;\n\n //liscence default\n $liscence_cost = 0;\n //dd($liscence_cost);\n\n $fixed_cost = $liscence_cost + $parking_cost + $subscription_cost + $insurance_amount + $interest_total + $depreciation_amount;\n \n\n\n //fixed cost per km\n $fixed_costs_km = round ($fixed_cost / 30000, 2);\n \n \n\n \n \n //Operating Cost\n\n $oil_cost = $request->input('oils');\n $drive = $request->input('oils');\n $services_cost = $request->input('services');\n $repairs_cost = $request->input('repairs');\n $tyres_cost = $request->input('tyres');\n \n\n //get distance and fuel price\n $capacity_id = $request->input('capacity');\n $fuel_worth = $this->getFuels($capacity_id);\n $distance = $this->getDistance($capacity_id);\n \n\n $fuel_cost = new runningCost($fuel_worth, $distance,);\n $fuel = $fuel_cost->fuelCalc();\n\n\n \n $operating_costs = $oil_cost + $services_cost + $repairs_cost + $tyres_cost + $fuel;\n\n \n //Total Running Cost per KM\n\n \n $running_cost = $fixed_costs_km + $operating_costs;\n\n \n \n \n return view('frontend.costs')->with(compact('fixed_cost','operating_costs','parking_cost','liscence_cost','depreciation_amount','interest_total','subscription_cost','insurance_amount','parking_cost','oil_cost','services_cost','repairs_cost','tyres_cost','drive', 'fuel', 'fixed_costs_km', 'running_cost'));\n }", "public function calculateAllNewCarValues(){\n $view= $this->view;\n $view->setNoRender();\n $carService = parent::getService('car','car');\n $teamService = parent::getService('team','team');\n $leagueService = parent::getService('league','league');\n Service::loadModels('rally', 'rally');\n $carService->calculateValuesForAllNewCars();\n echo \"good\";\n }", "protected function calculatePrices()\n {\n }", "public function getTotalInvoiced();", "function pricing() {\n\t\t\tparent::controller();\n\t\t\t\n\t\t}", "public function charges();", "function verusPrice( $currency ) {\n global $phpextconfig;\n $currency = strtoupper($currency);\n\n if ( $currency == 'VRSC' | $currency == 'VERUS' ) {\n $results = json_decode( curlRequest( $phpextconfig['fiat_api'] . 'rawpricedata.php', curl_init(), null ), true );\n return $results['data']['avg_btc'];\n }\n else {\n return curlRequest( $phpextconfig['fiat_api'] . '?currency=' . $currency, curl_init(), null );\n } \n}", "abstract function getPriceFromAPI($pair);", "function interestRate($item_id){\n\t\treturn 0.1;\n\t}", "public function rateCall(Request $request)\n {\n $rate = new ServiceProviderRating;\n\n if (empty($request->comment)) {\n $rate->comment = \"\";\n } else {\n $rate->comment = $request->comment;\n }\n \n if (empty($request->call_rate)) {\n $rate->call_rate = 0;\n } else {\n $rate->call_rate = $request->call_rate;\n }\n \n if (empty($request->provider_rate)) {\n $rate->provider_rate = 0;\n } else {\n $rate->provider_rate = $request->provider_rate;\n }\n \n $rate->service_provider_id = $request->service_provider_id;\n if (empty($request->good_communication_skills)) {\n $rate->good_communication_skills = 0;\n } else {\n $rate->good_communication_skills = $request->good_communication_skills;\n }\n \n if (empty($request->good_teaching_skills)) {\n $rate->good_teaching_skills = 0;\n } else {\n $rate->good_teaching_skills = $request->good_teaching_skills;\n }\n\n if (empty($request->intersting_conserviation)) {\n $rate->intersting_conserviation = 0;\n } else {\n $rate->intersting_conserviation = $request->intersting_conserviation;\n }\n \n if (empty($request->kind_personality)) {\n $rate->kind_personality = 0;\n } else {\n $rate->kind_personality = $request->kind_personality;\n }\n \n if (empty($request->correcting_my_language)) {\n $rate->correcting_my_language = 0;\n } else {\n $rate->correcting_my_language = $request->correcting_my_language;\n }\n \n $rate->language_id = 1;\n \n $rate->save();\n\n $provider_rates = ServiceProviderRating::where('service_provider_id', '=', $request->service_provider_id)->get();\n $counter = 0;\n $total_rate = 0.0;\n if (count($provider_rates) > 0) {\n foreach ($provider_rates as $provider_rate) {\n ++$counter;\n $total_rate += $provider_rate->provider_rate;\n }\n $provider = ServiceProvider::findOrFail($request->service_provider_id);\n $provider->rating = $total_rate/$counter;\n $provider->save();\n }\n return response()\n ->json([\n 'success' => true,\n 'message' => __('messages.call_rate_message'),\n 'new_rate' => round($provider->rating, 2),\n 'service_provider_id' => $request->service_provider_id\n ]);\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 getCost() {\n return 15 + $this->carService->getCost();\n }", "public function getCountCarPrice(){\r\n\t\t$this->countPrice = getValue(\"SELECT active FROM tbl_user WHERE user_id=\".$this->getCarOwnerID());\r\n\t\treturn $this->countPrice;\r\n\t}", "public function getDiscountInvoiced();", "public function getPrices()\n {\n }", "public function getTonicDiscount()\n {\n }", "public function marketPricing(Request $request)\n {\n \t$market = CarbonPrice::where('active', 1)->first();\n\n \t// Return current prices in the market \n \treturn response([\n \t\t'price' => $market->value,\n \t\t'rate' => $market->credit_rate,\n \t], 200); \t\n }", "function activate_car($id)\n{\n $url = set_url('advert');\n $url .= '/' . $id . '/activate';\n $token = $_SESSION['token'];\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Authorization: Bearer ' . $token,]);\n curl_setopt($cURLConnection, CURLOPT_POSTFIELDS, '{}');\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = json_decode(curl_exec($cURLConnection));\n curl_close($cURLConnection);\n return $apiResponse;\n}", "function rateRecipe(){\n $id = $_REQUEST['id'];\n include(\"../model/recipe.php\");\n $obj=new recipe();\n\n if($obj->rateRecipe($id)) {\n echo '{\"result\":1}';\n }\n else {\n echo '{\"result\":0}';\n }\n }", "public function getMyPriceForASIN($request);", "function getOutletDiscountRate()\n {\n $dayOfMonth = date('j');\n return 20 + $dayOfMonth;\n }", "public function index()\n {\n return VehicleRate::latest()->paginate(7);\n /*return DB::table('tblmotorvehiclelist')\n ->select('PlateNumber','DriverName','OperatorName','EngineNumber','SerialNumber')\n ->orderBy('id', 'desc')\n ->paginate(7);*/\n }", "public function getDiscountRate(){\n return $this->getParameter('discount_rate');\n }", "public function rateForm(Car $car){\n \n return view ('viewCars.rateForm')->with('car',$car);\n }", "public function index()\n {\n //\n ;//for specific price list\n }", "public function resolvePrice();", "public function cars(){\n \n $cars = array(\n 'ABARTH',\n 'ABT',\n 'AC',\n 'ACURA',\n 'AIXAM',\n 'ALFA ROMEO',\n 'ALPINA',\n 'ALPINE',\n 'ALVIS',\n 'AMG',\n 'ARASH',\n 'ARIEL',\n 'ARRINERA',\n 'ARTEGA',\n 'ASIA MOTORS',\n 'ASTON MARTIN',\n 'AUDI',\n 'AUSTIN',\n 'AUSTIN HEALEY',\n 'AXON',\n 'BAC',\n 'BAIC',\n 'BAOJUN',\n 'BEDFORD',\n 'BENTLEY',\n 'BERTONE',\n 'BHARATBENZ',\n 'BITTER',\n 'BMW',\n 'BORGWARD',\n 'BOWLER',\n 'BRABUS',\n 'BRAMMO',\n 'BRILLIANCE',\n 'BRISTOL',\n 'BROOKE',\n 'BUFORI',\n 'BUGATTI',\n 'BUICK',\n 'BYD',\n 'CADILLAC',\n 'CAPARO',\n 'CARLSSON',\n 'CATERHAM',\n 'CHANGAN',\n 'CHANGFEN',\n 'CHERY',\n 'CHEVROLET',\n 'CHRYSLER',\n 'CITROEN',\n 'CIZETA',\n 'CORVETTE',\n 'DACIA',\n 'DAEWOO',\n 'DAF',\n 'DAIHATSU',\n 'DAIMLER',\n 'DARTZ',\n 'DATSUN',\n 'DAVID BROWN',\n 'DE TOMASO',\n 'DELOREAN',\n 'DEVEL SIXTEEN',\n 'DINA',\n 'DMC',\n 'DODGE',\n 'DONGFENG',\n 'DONKERVOORT',\n 'DS AUTOMOBILES',\n 'ELFIN',\n 'EUNOS',\n 'EXCALIBUR',\n 'FERRARI',\n 'FIAT',\n 'FORD',\n 'FPV',\n 'GEELY',\n 'GMC',\n 'GOGGOMOBIL',\n 'GREAT WALL',\n 'HDT',\n 'HILLMAN',\n 'HINO',\n 'HOLDEN',\n 'HONDA',\n 'HSV',\n 'HUMMER',\n 'HYUNDAI',\n 'INFINITI',\n 'INTERNATIONAL',\n 'ISUZU',\n 'IVECO',\n 'JAGUAR',\n 'JBA',\n 'JEEP',\n 'JENSEN',\n 'KIA',\n 'LAMBORGHINI',\n 'LANCIA',\n 'LAND ROVER',\n 'LEXUS',\n 'LEYLAND',\n 'LINCOLN',\n 'LOTUS',\n 'MG',\n 'MACK',\n 'MAHINDRA',\n 'MASERATI',\n 'MAZDA',\n 'MERCEDES',\n 'MERCURY',\n 'MINI',\n 'MITSUBISHI',\n 'MORGAN',\n 'MORRIS',\n 'NISSAN',\n 'NISMO',\n 'OLDSMOBILE',\n 'PEUGEOT',\n 'PLYMOUTH',\n 'PONTIAC',\n 'PORSCHE',\n 'PROTON',\n 'RAMBLER',\n 'RENAULT',\n 'ROLLS ROYCE',\n 'ROVER',\n 'SAAB',\n 'SEAT',\n 'SKODA',\n 'SMART',\n 'SSANGYONG',\n 'STUDEBAKER',\n 'SUBARU',\n 'SUZUKI',\n 'TESLA',\n 'TOYOTA',\n 'TRD',\n 'TRIUMPH',\n 'TVR',\n 'UD',\n 'ULTIMA',\n 'VAUXHALL',\n 'VOLKSWAGEN',\n 'VOLVO',\n 'WESTFIELD',\n 'WILLYS',\n 'WOLSELEY'\n );\n\n return $cars;\n }", "function intRate($type=null){\n\t\tglobal $driver;\n if($type==2){\n return 11.1;\n }else{\n $sql =\t\"SELECT interestrate FROM settings\"; //Retrieve the interest rate\n if($results\t= $driver->perform_request($sql)):\n $row\t= $driver->load_data($results,MYSQL_ASSOC);\n $interest = ($row['interestrate']>0)?($row['interestrate']):20;\n else:\n die('<p class=\"error\">Interest rate Error: '.mysql_error().'</p>');\n endif;\n return $interest; //The interest rate\n }\n}", "function ateliers_autoriser(){}", "public function deliveryPriceDhaka()\n {\n }", "public function getStoreToOrderRate();", "function get_cost($from, $to,$weight)\r\n{\r\n require_once 'REST_Ongkir.php';\r\n \r\n $rest = new REST_Ongkir(array(\r\n 'server' =&amp;gt; 'http://api.ongkir.info/'\r\n ));\r\n \r\n//ganti API-Key dibawah ini sesuai dengan API Key yang anda peroleh setalah mendaftar di ongkir.info\r\n $result = $rest-&amp;gt;post('cost/find', array(\r\n 'from' =&amp;gt; $from,\r\n 'to' =&amp;gt; $to,\r\n 'weight' =&amp;gt; $weight.'000',\r\n 'courier' =&amp;gt; 'jne',\r\n'API-Key' =&amp;gt;'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456'\r\n ));\r\n \r\n try\r\n {\r\n $status = $result['status'];\r\n \r\n // Handling the data\r\n if ($status-&amp;gt;code == 0)\r\n {\r\n $prices = $result['price'];\r\n $city = $result['city'];\r\n \r\n echo 'Ongkos kirim dari ' . $city-&amp;gt;origin . ' ke ' . $city-&amp;gt;destination . '&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;';\r\n \r\n foreach ($prices-&amp;gt;item as $item)\r\n {\r\n echo 'Layanan: ' . $item-&amp;gt;service . ', dengan harga : Rp. ' . $item-&amp;gt;value . ',- &amp;lt;br /&amp;gt;';\r\n }\r\n }\r\n else\r\n {\r\n echo 'Tidak ditemukan jalur pengiriman dari surabaya ke jakarta';\r\n }\r\n \r\n }\r\n catch (Exception $e)\r\n {\r\n echo 'Processing error.';\r\n }\r\n}", "abstract public function getPrice();", "public function discountCalculator()\n\t{\n\t\tob_clean();\n\t\t$get = JRequest::get('GET');\n\t\t$this->_carthelper->discountCalculator($get);\n\t\texit;\n\t}", "protected function calculatePrice()\n {\n $amount = 5 * $this->rate;\n $this->outputPrice($amount);\n }", "function get_serving( $ml, $gallons, $method ) {\n\n if( $method == 'teaspoon(s)' )\n $method_amt = 4.92892; // teaspoon\n else\n $method_amt = .2; // 5 drops\n\n return round( ( $ml / ( $gallons * 3800 ) ) * $method_amt, 3);\n}", "public function getPrice()\n {\n }", "public function getPrice()\n {\n }", "public function getPriceNet();", "public function viewAd($car_id)\n {\n\n $this->db->query(\"update car_info set views = views+1 where id = \" . $car_id);\n///////////////////////////////////\n\n $data['car_info'] = $this->car_model->get_ad($car_id);\n $data['ad_customer'] = $this->car_model->get_ad_customer($car_id);\n\n $data['images'] = (directory_map(\"assets/uploads/files/\" . $data['ad_customer']->id . \"/\" . $car_id));\n natsort($data['images']);\n\n $data['path'] = \"assets/uploads/files/\" . $data['ad_customer']->id . \"/\" . $car_id . \"/\";\n $data['car_id'] = $car_id;\n\n $data['customer'] = $this->db->query(\"select * from customer where id =\" . $data['car_info']->customer_id);\n\n\n $this->load->view('view_ad', $data);\n }", "public function car_lookup($car_name)\n {\n \n }", "public function rateUser(Request $request)\n {\n\n //find ride request \n $rideRequest = $this->rideRequest->where('id', $request->ride_request_id)\n ->where('driver_id', $request->auth_driver->id)\n ->whereIn('ride_status', [Ride::TRIP_ENDED, Ride::COMPLETED])\n ->first();\n\n\n if(!$rideRequest || !$rideRequest->user) {\n return $this->api->json(false, 'INVALID_REQUEST', 'Invalid Request, Try again.');\n }\n\n //validate rating number\n if(!$request->has('rating') || !in_array($request->rating, Ride::RATINGS)) {\n return $this->api->json(false, 'INVALID_RATING', 'You must have give rating within '.implode(',', Ride::RATINGS));\n }\n\n\n /** driver cannot give rating until user payment complete */\n if($rideRequest->payment_status == Ride::NOT_PAID) {\n return $this->api->json(false, 'USER_NOT_PAID', 'Ask user to pay before give rating');\n }\n\n\n //updatig both driver and ride request table\n try {\n\n \\DB::beginTransaction();\n\n //saving ride request rating\n $rideRequest->user_rating = $request->rating;\n $rideRequest->save(); \n\n /** push user rating calculation to job */\n ProcessUserRating::dispatch($rideRequest->user_id);\n\n\n //making availble driver\n $driver = $rideRequest->driver;\n $driver->is_available = 1;\n $driver->save();\n\n\n\n \\DB::commit();\n\n } catch(\\Exception $e) {\n \\DB::rollback();\n \\Log::info('USER_RATING');\n \\Log::info($e->getMessage());\n return $this->api->unknownErrResponse();\n }\n \n\n /** send user that you made the payment message */\n $user = $rideRequest->user;\n $currencySymbol = $this->setting->get('currency_symbol');\n $websiteName = $this->setting->get('website_name');\n $invoice = $rideRequest->invoice;\n if($rideRequest->payment_mode == Ride::CASH) {\n $user->sendSms(\"Thank you!! We hope you enjoyed {$websiteName} service. See you next time.\");\n } \n // else {\n // $user->sendSms(\"We hope you enjoyed {$websiteName} service. Please make the payment of {$currencySymbol}\".$invoice->total);\n // }\n\n\n return $this->api->json(true, 'RATED', 'User rated successfully.');\n\n }", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public function getPrice();", "protected function serviceAccessGates()\n {\n //\n }", "public function getDiscount(Request $request)\n {\n // Validate Input Data\n $validate = Validator::make($request->all(),[\n 'wheel_id' => ['required','numeric','min:1'],\n 'email' => ['required','email','unique:used_wheel_discounts']\n ]);\n $agent = new Agent();\n\n if($validate->fails() || $agent->isRobot() ){\n $output = [\n 'status' => 'error',\n 'message' => $validate->errors()->first(),\n ];\n return response()->json($output);\n }\n\n $data = new UsedWheelDiscount();\n $whill_info = DiscountWheel::findOrFail($request->wheel_id);\n\n $data->email = $request->email;\n $data->discount = $whill_info->value;\n $data->discountType = empty($whill_info->discountType)?'%':0;\n $data->ip = $request->ip();\n $data->browser = $agent->browser().$agent->version($agent->browser());\n $data->device = $agent->isDesktop() == 1?'Desktop':$agent->device();\n $data->os = $agent->platform().'-'.$agent->version($agent->platform());\n $data->is_used = 0;\n $data->save();\n\n $output = [\n 'status' => 'success',\n 'message' => 'Congratulation! Your Discount Amount will Applicable For your First Order',\n 'modal_id' => 'spin'\n ];\n return response()->json($output);\n }", "function car_detail() {\n echo $this->wheel_count;\n echo \"<br>\";\n echo $this->door_count;\n echo \"<br>\";\n echo $this->seat_count;\n }", "public function bookCcavenu()\n {\n try\n {\n if(\\Session::has('userId'))\n {\n $param=$this->request->all();\n \n $data['tid']=time();\n $seat=$param['No_seats'];\n $rideid=$param['ride'];\n $fetchRide=DB::table('rides')->select('id','userId','offer_seat','available_seat','cost_per_seat','isDaily')->where('id',$rideid)->get();\n if(count($fetchRide)>0)\n {\n if($seat==0)\n {\n //if requested seat is zero\n $response['data'] = array();\n $response['message'] = \"Please try again\";\n $response['erromessage']=array();\n $response['status'] = false;\n return response($response,200);\n }\n else\n {\n if($fetchRide[0]->available_seat<$seat)\n {\n //error(requested seat not available)\n $response['data'] = array();\n $response['message'] = \"Requested seat is not available\";\n $response['erromessage']=array();\n $response['status'] = false;\n return response($response,200);\n }\n else\n {\n //\n if($fetchRide[0]->isDaily==1)\n {\n $total_price=27.5;\n }\n else\n {\n $seat_price=$fetchRide[0]->cost_per_seat*$seat;\n $tax=$seat_price*0.1;\n $total_price=$seat_price+$tax;\n }\n }\n }\n }\n else\n {\n //if ride not found\n $response['data'] = array();\n $response['message'] = \"Please try again\";\n $response['erromessage']=array();\n $response['status'] = false;\n return response($response,200);\n }\n\n $data['tid']=time();\n $data['merchant_id']=89903;\n $data['order_id']=$data['tid'];\n $data['amount']=$total_price;\n $data['currency']=\"INR\";\n $data['redirect_url']=\"http://sharemywheel.info/getsuccessPayment\";\n $data['cancel_url']=\"http://sharemywheel.info/getsuccessPayment\";\n $data['language']=\"EN\";\n $data['merchant_param1']=$rideid;//ride id\n $data['merchant_param2']=$total_price;//total amount\n $data['merchant_param3']=session('userId');//boooked user id\n $data['merchant_param4']=$seat;//no of seats\n $data['merchant_param5']=$fetchRide[0]->isDaily;//is daily \n $working_key='A087123D0EA8318575EA3EDDDF177F7E';\n $access_code='AVUD66DH35AD37DUDA';\n $merchant_data=\"\";\n \n foreach ($data as $key => $value){\n $merchant_data.=$key.'='.$value.'&';\n }\n\n $encrypted_data=$this->encrypt($merchant_data,$working_key);\n\n /* $rcvdString=decrypt($encrypted_data,$working_key); //Crypto Decryption used as per the specified working key.\n $order_status=\"\";\n $decryptValues=explode('&', $rcvdString);\n $dataSize=sizeof($decryptValues);\n\n for($i = 0; $i < $dataSize; $i++) \n {\n $information=explode('=',$decryptValues[$i]);\n echo '<tr><td>'.$information[0].'</td><td>'.$information[1].'</td></tr>';\n }\n\n exit; */\n\n $response['data'] = array(\"encrypt\"=>$encrypted_data,\"access\"=>$access_code);\n $response['message'] = \"success\";\n $response['erromessage']=array();\n $response['status'] = true;\n return response($response,200);\n }\n else\n {\n $response['data'] = array();\n $response['message'] = \"Please try again\";\n $response['erromessage']=array();\n $response['status'] = false;\n return response($response,200);\n }\n }\n catch(\\Exception $e)\n {\n $response['data'] = array();\n $response['message'] = \"Please try again\";\n $response['erromessage']=array();\n $response['status'] = false;\n return response($response,200);\n }\n }", "public function getCompetitivePricingForASIN($request);", "function convertCurToIUSD($url, $amount, $api_key, $currencySymbol) {\n error_log(\"Entered into Convert CAmount\");\n error_log($url.'?api_key='.$api_key.'&currency='.$currencySymbol.'&amount='. $amount);\n $ch = curl_init($url.'?api_key='.$api_key.'&currency='.$currencySymbol.'&amount='. $amount);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json')\n );\n\n $result = curl_exec($ch);\n $data = json_decode( $result , true);\n error_log('Response =>'. var_export($data, TRUE));\n // Return the equivalent value acquired from Agate server.\n return (float) $data[\"result\"];\n\n }", "public function cerasisLtlGetAvgRate($allServices, $numberOption, $activeCarriers)\n {\n $price = 0;\n $totalPrice = 0;\n if (count($allServices) > 0) {\n foreach ($allServices as $services) {\n $totalPrice += $services['rate'];\n }\n\n if ($numberOption < count($activeCarriers) && $numberOption < count($allServices)) {\n $slicedArray = array_slice($allServices, 0, $numberOption);\n foreach ($slicedArray as $services) {\n $price += $services['rate'];\n }\n $totalPrice = $price / $numberOption;\n } elseif (count($activeCarriers) < $numberOption && count($activeCarriers) < count($allServices)) {\n $totalPrice = $totalPrice / count($activeCarriers);\n } else {\n $totalPrice = $totalPrice / count($allServices);\n }\n\n return $totalPrice;\n }\n }", "public function getExchangeRate();", "public function getPrice(){\n }", "public function getPrice(){\n }", "public static function chargeFees($price=1)\n {\n\n }", "public function getPrice() {\n }", "public function rate($rate)\n {\n // Update API Rate Limiter\n $this->rate = $rate;\n }", "public function getTotalPrice();", "public function getTotalPrice();", "public function unRate()\n {\n\n }", "public function getCar(CarViewRequest $request, $id)\n {\n $stock = StockRepo::find($id);\n if(!empty($stock)) {\n $data = $stock->getData();\n $data[\"is_bca\"] = $data[\"supplier\"] == 'BCA';\n $data[\"make\"] = config(\"fields.stocks.makes\")[$data[\"make\"]] ?? $data[\"make\"];\n if ($data[\"car_type\"] == 'used') {\n if (trim($data[\"standard_option\"]) != '') {\n $data[\"standard_option\"] = $this->filterStandardOptions($data[\"standard_option\"]);\n }\n }\n return $data;\n } else {\n return $this->send(\"Sorry the stock item you are looking for is not available anymore. Please search other sotck item in browse car section\");\n }\n\n }", "public function actionExp()\n {\n try {\n // 根据手机号归属地 修改 客户的位置\n CRMStockClient::phone_to_location();\n } catch (\\Exception $e) {\n\n }\n\n try {\n // 更新统计数据 /stock/trend\n TrendStockService::init(TrendStockService::CAT_TREND)->chartTrend(date('Y-m-d'), 1);\n } catch (\\Exception $e) {\n\n }\n\n }", "public function rechargeEspeceCarte()\n {\n $fkagence = $this->userConnecter->fk_agence;\n $data['lang'] = $this->lang->getLangFile($this->getSession()->getAttribut('lang'));\n $telephone = trim(str_replace(\"+\", \"00\", $this->utils->securite_xss($_POST['phone'])));\n $data['benef'] = $this->compteModel->beneficiaireByTelephone1($telephone);\n $data['soldeAgence'] = $this->utils->getSoldeAgence($fkagence);\n\n $params = array('view' => 'compte/recharge-espece-carte');\n $this->view($params, $data);\n }", "public function getPriceFromDatabase()\n {\n }", "function display_cars()\n{\n //displays posted cars\n $url = set_url('advert');\n $url .= '?limit=10&page=1';\n $token = $_SESSION['token'];\n $cURLConnection = curl_init($url);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'Authorization: Bearer ' . $token,]);\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = json_decode(curl_exec($cURLConnection));\n curl_close($cURLConnection);\n print_r($apiResponse);\n exit;\n}", "function __construct()\n\t{\n\t\t//username password, origin zip code etc.\n\t\t$this->CI =& get_instance();\n\t\t$this->CI->lang->load('fedex');\n\n\n\t\t$this->path_to_wsdl = APPPATH.\"packages/shipping/fedex/libraries/RateService_v14.wsdl\";\n\n\t\t// Drop Off Types\n\t\t$this->dropoff_types['BUSINESS_SERVICE_CENTER'] = lang('BUSINESS_SERVICE_CENTER');\n\t\t$this->dropoff_types['DROP_BOX'] = lang('DROP_BOX');\n\t\t$this->dropoff_types['REGULAR_PICKUP'] = lang('REGULAR_PICKUP');\n\t\t$this->dropoff_types['REQUEST_COURIER'] = lang('REQUEST_COURIER');\n\t\t$this->dropoff_types['STATION'] = lang('STATION');\n\n\t\t// Packaging types\n\t\t$this->package_types['FEDEX_10KG_BOX'] = lang('FEDEX_10KG_BOX');\n\t\t$this->package_types['FEDEX_25KG_BOX'] = lang('FEDEX_25KG_BOX'); \n\t\t$this->package_types['FEDEX_BOX'] = lang('FEDEX_BOX');\n\t\t$this->package_types['FEDEX_ENVELOPE'] = lang('FEDEX_ENVELOPE'); \n\t\t$this->package_types['FEDEX_PAK'] = lang('FEDEX_PAK');\n\t\t$this->package_types['FEDEX_TUBE'] = lang('FEDEX_TUBE');\n\t\t$this->package_types['YOUR_PACKAGING'] = lang('YOUR_PACKAGING');\n\n\n\t\t// Available Services\n\t\t$this->service_list['EUROPE_FIRST_INTERNATIONAL_PRIORITY']\t= lang('EUROPE_FIRST_INTERNATIONAL_PRIORITY');\n\t\t$this->service_list['FEDEX_1_DAY_FREIGHT']\t= lang('FEDEX_1_DAY_FREIGHT'); \n\t\t$this->service_list['FEDEX_2_DAY']\t= lang('FEDEX_2_DAY');\n\t\t$this->service_list['FEDEX_2_DAY_FREIGHT']\t= lang('FEDEX_2_DAY_FREIGHT'); \n\t\t$this->service_list['FEDEX_3_DAY_FREIGHT']\t= lang('FEDEX_3_DAY_FREIGHT'); \n\t\t$this->service_list['FEDEX_EXPRESS_SAVER']\t= lang('FEDEX_EXPRESS_SAVER');\n\t\t$this->service_list['FEDEX_GROUND']\t= lang('FEDEX_GROUND'); \n\t\t$this->service_list['FIRST_OVERNIGHT']\t= lang('FIRST_OVERNIGHT');\n\t\t$this->service_list['GROUND_HOME_DELIVERY']\t= lang('GROUND_HOME_DELIVERY'); \n\t\t$this->service_list['INTERNATIONAL_ECONOMY']\t= lang('INTERNATIONAL_ECONOMY'); \n\t\t$this->service_list['INTERNATIONAL_ECONOMY_FREIGHT']\t= lang('INTERNATIONAL_ECONOMY_FREIGHT'); \n\t\t$this->service_list['INTERNATIONAL_FIRST']\t= lang('INTERNATIONAL_FIRST'); \n\t\t$this->service_list['INTERNATIONAL_PRIORITY']\t= lang('INTERNATIONAL_PRIORITY'); \n\t\t$this->service_list['INTERNATIONAL_PRIORITY_FREIGHT']\t= lang('INTERNATIONAL_PRIORITY_FREIGHT'); \n\t\t$this->service_list['PRIORITY_OVERNIGHT']\t= lang('PRIORITY_OVERNIGHT');\n\t\t$this->service_list['SMART_POST']\t= lang('SMART_POST'); \n\t\t$this->service_list['STANDARD_OVERNIGHT']\t= lang('STANDARD_OVERNIGHT'); \n\t\t$this->service_list['FEDEX_FREIGHT']\t= lang('FEDEX_FREIGHT'); \n\t\t$this->service_list['FEDEX_NATIONAL_FREIGHT']\t= lang('FEDEX_NATIONAL_FREIGHT');\n\t\t$this->service_list['INTERNATIONAL_GROUND']\t= lang('INTERNATIONAL_GROUND');\n\n\t}", "function get_market_price($cianId) {\n\n\t$price = 0;\n\t$cnt = 0;\n\t$accuracy = 0;\n\n\t//--------------------------------\n\t//Точность зависит от кол-ва транзакций и как далеко мы уточнили критерии поиска (до дома квартиры и тд)\n\n\t//1 ищем тип квартиры такой же как и у нашей. выоводим ср. цену рыночную и кол-во сделок\n\t//точность = 50%\n\t//цена = средняя цена\n\t//<0 (может быть студия). Возврат прошлого результата (все по нулям)\n\n\t//добавляем в запрос еще и улицу. \n\t//< 0 сделок возврат ПРОШЛОГО результата \n\t//==1. точность 70%. Цена = средняя цена\n\t//>1. точность 80%. Цена = средняя цена\n\t\n\t//Добавляем дом.\n\t//< 0 сделок - возврат прошлого результата\n\t//==1. точность 90%. Цена = средняя цена.\n\t//>1. Точность 100%. цена = средняя цена\n\t//--------------------------------\n\n\t$sql = \"select round(avg(mrk.square_meter_price)) price, count(*) as cnt from cian_general_data cg\n\tinner JOIN market_data mrk on left(mrk.objecttype,5)=left(cg.objecttype,5)\n\tWHERE cg.id={$cianId}\";\n\t$result = mysqli_query($GLOBALS['connect'],$sql); \n\t$data = mysqli_fetch_assoc($result);\n\n\t//echo \"by obj.type: \\r\\n\";\n\t//var_dump($data);\n\n\tif ($data['cnt'] == 0) {\n\t\treturn [\n\t\t\t'price' => $price,\n\t\t\t'accuracy' => $accuracy\n\t\t];\n\t}\n\telse {\n\t\t$price = $data['price'];\n\t\t$accuracy = 50;\n\t}\n\n\n\t$sql = \"select round(avg(mrk.square_meter_price)) price, count(*) as cnt from cian_general_data cg\n\tinner JOIN market_data mrk on left(mrk.objecttype,5)=left(cg.objecttype,5)\n\tWHERE cg.id={$cianId} and cg.street=mrk.street\";\n\t$result = mysqli_query($GLOBALS['connect'],$sql); \n\t$data = mysqli_fetch_assoc($result);\n\n\t//echo \"by obj.street: \\r\\n\";\n\t//var_dump($data);\n\n\tif ($data['cnt'] == 0) {\n\t\treturn [\n\t\t\t'price' => $price,\n\t\t\t'accuracy' => $accuracy\n\t\t];\n\t}\n\telse if ($data['cnt'] == 1) {\n\t\t$price = $data['price'];\n\t\t$accuracy = 70;\n\t}\n\telse if ($data['cnt'] > 1) {\n\t\t$price = $data['price'];\n\t\t$accuracy = 80;\n\t}\n\n\t$sql = \"select round(avg(mrk.square_meter_price)) price, count(*) as cnt from cian_general_data cg\n\tinner JOIN market_data mrk on left(mrk.objecttype,5)=left(cg.objecttype,5)\n\tWHERE cg.id={$cianId} and cg.street=mrk.street and cg.house=mrk.house\";\n\t$result = mysqli_query($GLOBALS['connect'],$sql); \n\t$data = mysqli_fetch_assoc($result);\n\n\t//echo \"by obj.street + house: \\r\\n\";\n\t//var_dump($data);\n\n\tif ($data['cnt'] == 0) {\n\t\treturn [\n\t\t\t'price' => $price,\n\t\t\t'accuracy' => $accuracy\n\t\t];\n\t}\n\telse if ($data['cnt'] == 1) {\n\t\t$price = $data['price'];\n\t\t$accuracy = 90;\n\t}\n\telse if ($data['cnt'] > 1) {\n\t\t$price = $data['price'];\n\t\t$accuracy = 100;\n\t}\n\n\n\n\n\treturn [\n\t\t'price' => $price,\n\t\t'accuracy' => $accuracy\n\t];\n}", "function outputled_carp () {\n\t\tglobal $g;\n\t\tglobal $config;\n\n\t\tif(is_array($config['virtualip']['vip'])) {\n\t\t\t$carpint = 0;\n\t\t\tforeach($config['virtualip']['vip'] as $carp) {\n\t\t\t\tif ($carp['mode'] != \"carp\") {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$carp_int = find_carp_interface($carp['subnet']);\n\t\t\t\t$status = get_carp_interface_status($carp_int);\n\t\t\t\tswitch($status) {\n\t\t\t\t\tcase \"MASTER\":\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"BACKUP\":\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t}", "public function getPrice(){ return $this->price_rur; }", "public function auto()\n {\n $niz=PomFunkResource::getAllCars();\n return view('auto.auto',['niz'=>$niz]);\n }", "public function find_purchase_car_info($pus_id=Null)\n\t{\n\t\tif($res= $this->Purchase_model->purchase_car_full_deatils($pus_id)){\n\t\t\techo json_encode($res);\n\t\t}else{\n\t\t\techo 0;\n\t\t}\n\t}", "public function getDiscountTaxCompensationInvoiced();", "private function purchaseRestrictionsAwal($ins) {\n \n $dateNow = date('Y-m-d'); // date now\n \n // cek total volume pengisian selama hari ini, apakah >= 100 liter\n $totalVolumeFill = $this->db->query(\"SELECT SUM(liter) AS `total_volume` FROM {$this->transaction_kendaraan} WHERE no_pol = '{$ins['no_pol']}' AND tgl = '{$dateNow}' \")\n ->row_array()['total_volume'];\n \n $lastTotalVolume = floatval($ins['liter']) + floatval($totalVolumeFill);\n \n if($lastTotalVolume > 200) {\n\t $response = [\n\t \"status\" => \"error\", \n\t \"message\" => \"Customer tidak dapat mengisi lebih dari 200 liter ({$lastTotalVolume} liter) dalam satu hari yang sama\"\t \n\t // \"message\" => \"Customer tidak dapat mengisi lebih dari 200 liter ({$lastTotalVolume} liter) dalam pembelian ke - {$ins['numOfBuy']}\", \n\t ];\n\t echo json_encode($response);\n\t \n } else if(floatval($ins['liter']) > 75) {\n\t \n\t $response = [\n\t \"status\" => \"approval\", \n\t \"message\" => \"Customer ingin mengisi lebih dari 75 liter ({$ins['liter']} liter) dalam pembelian {$ins['numOfBuy']}\", \n\t \"question\" => \"Apakah anda setuju melakukan pengisian lebih dari 75 liter ({$ins['liter']} liter) ?\"\n\t ];\n\t echo json_encode($response);\n\t \n } else {\n\t $response = [\n\t \"status\" => \"ok\", \n\t \"message\" => \"Customer ingin mengisi biosolar dengan volume {$ins['liter']} liter pada pembelian ke - {$ins['numOfBuy']}\"\n\t ];\n\t echo json_encode($response);\t \n } \n }", "public function getServAssocRate($value)\n\t\t{\n\t\t\t$id=explode(',',$value);\n\t\t\t\n\t\t\t$serList=\\DB::table('ser_assoc_rate')->join('associate','ser_assoc_rate.Assoc_ID','=','associate.Assoc_ID')\n\t\t\t->join('ser_services', 'ser_services.SerServ_ID','=','ser_assoc_rate.SerServ_ID')\n\t\t\t->where('ser_assoc_rate.SerServ_ID', $id[0])\n\t\t\t->where('ser_assoc_rate.Pattern',$id[1])\n\t\t\n\t\t\t->select('ser_assoc_rate.Assoc_ID','ser_assoc_rate.Pattern','ser_assoc_rate.Rate','associate.Assoc_FirstName','associate.Assoc_MiddleName','associate.Assoc_LastName','ser_assoc_rate.Current_Date','ser_assoc_rate.Expiry_Date','ser_services.SerServ_Name')\n\t\t\t\t->orderby('ser_assoc_rate.Rate')\n\t\t\t->get();\n\t\t\t$listResp=array('success'=>true, $serList);\n\t\treturn $listResp;\n\t\t}", "public function fetchAudi()\n {\n $url = 'https://www.polovniautomobili.com/putnicka-vozila/pretraga?brand=38&price_from=40000&without_price=1&showOldNew=all';\n\n $html = file_get_contents($url);\n $dom = FluentDOM::QueryCss($html, 'text/html');\n\n $cars = \\Helpers::get_cars($dom);\n\n if (count($cars)) {\n // Now we need to save external cars to database\n foreach ($cars as $car) {\n $car['category'] = 'Audi';\n $car['added_by'] = auth()->id();\n $car['approved'] = 1;\n // We need to check if this car already exists so we use firstOrCreate instead of create method\n /**\n * TODO: maybe exclude image_path before we call create method and use firstOrNew to add image_path and then save(),\n * because each time image_path is unique and we will always get new instance of Vehicle even if everything else is same,\n * or maybe you wanted to clear Audi vehicles each time and add new, updated cars?\n */\n $vehicle = Vehicle::firstOrCreate($car);\n\n // We will probably call this method over AJAX and update category view over JavaScript\n // that's why we will just return json of added cars\n $vehicles[] = $vehicle;\n }\n\n // Now we need to create pagination of this vehicles\n $vehicles_pagination = \\Helpers::create_pagination($vehicles, config('pagination.per_page'));\n\n $carousel_images = [];\n\n foreach ($vehicles_pagination as $vehicle) {\n array_push($carousel_images, $vehicle->image_path);\n }\n\n return \\View::make('partials.ajax_vehicles', ['vehicles' => $vehicles_pagination, 'carousel_images' => $carousel_images, 'category' => 'Audi']);\n }\n }", "public function getSubtotalInvoiced();", "private function rateIt()\n {\n try\n {\n $request = $_POST;\n\n $types = array('videos','video','v','photos','photo','p','collections','collection','cl','users','user','u');\n\n //check if type sent\n if( !isset($request['type']) || $request['type']==\"\" )\n throw_error_msg(\"type not provided\");\n\n //check valid type\n if(!in_array($request['type'], $types))\n throw_error_msg(\"invalid type\");\n\n //check id \n if( !isset($request['id']) || $request['id']==\"\" )\n throw_error_msg(\"id not provided\"); \n\n //check valid id \n if( !is_numeric($request['id']) )\n throw_error_msg(\"invalid id\"); \n\n //check rating \n if( !isset($request['rating']) || $request['rating']==\"\" )\n throw_error_msg(\"rating not provided\"); \n\n //check valid rating \n if( !is_numeric($request['rating']) )\n throw_error_msg(\"invalid rating\");\n\n $type = mysql_clean($request['type']);\n $id = mysql_clean($request['id']);\n $rating = mysql_clean($request['rating']);\n \n switch($type)\n {\n case \"videos\":\n case \"video\":\n case \"v\":\n {\n global $cbvid;\n $rating = $rating*2;\n $result = $cbvid->rate_video($id,$rating);\n }\n break;\n\n case \"photos\":\n case \"photo\":\n case \"p\":\n {\n global $cbphoto;\n $rating = $rating*2;\n $result = $cbphoto->rate_photo($id,$rating);\n }\n break;\n\n case \"collections\":\n case \"collection\":\n case \"cl\":\n {\n global $cbcollection;\n $rating = $rating*2;\n $result = $cbcollection->rate_collection($id,$rating);\n }\n break;\n\n case \"users\":\n case \"user\":\n case \"u\":\n {\n global $userquery;\n $rating = $rating*2;\n $result = $userquery->rate_user($id,$rating);\n }\n break;\n }\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $data = array('code' => \"204\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => $result);\n $this->response($this->json($data)); \n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage()); \n }\n\n }", "public function getPriceMode();", "public function getRefreshRate() { return 0; }", "function mobile_recharge_api($operator_id, $mobile, $amount) {\n\t\t$operator_id = $operator_id;\n\t\t$mobile1 = '0' . $mobile;\n\t\t$amount = $amount;\n\t\t$biller_records = $this -> conn -> get_table_row_byidvalue('operator_list', 'operator_id', $operator_id);\n\n\t\t$operator_name = $biller_records['0']['operator_name'];\n\t\t$operator_code = $biller_records['0']['operator_code'];\n\t\tif ($operator_code == 'MTN' || $operator_code == 'VISAF') \n\t{\n\t\t\t$userid = '08092230991';\n\t\t\t$pass = '01fa320f4048f4fa51a34';\n\t\t\t$url = \"http://mobileairtimeng.com/httpapi/?userid=$userid&pass=$pass&network=5&phone=$mobile1&amt=$amount\";\n\t\t\t$str = file_get_contents($url);\n\n\t\t\t$sdk = explode(\"|\", $str);\n\t\t\t$pos = $sdk[0];\n\t\t\treturn $pos;\n\t\t} \n\t\t/*\n\t\telse if ($operator_code == 'ETST' || $operator_code == 'AIRT' || $operator_code == 'Glo' || $operator_code == 'VISAF') {\n\t\t\n\t\t\t\t\t\n\t\t\n\t\t\t\t\tini_set(\"soap.wsdl_cache_enabled\", \"0\");\n\t\t\t\t\t$a = array(\"trace\" => 1, \"exceptions\" => 1);\n\t\t\t\t\t$wsdl = \"http://202.140.50.116/EstelServices/services/EstelServices?wsdl\";\n\t\t\t\t\t$client = new SoapClient($wsdl, $a);\n\t\t\t\t\t$simpleresult = $client -> getTopup(array(\"agentCode\" => 'TPR_EFF', \"mpin\" => 'ECE473FF47C2E97FF3F1D496271A9EB1', \"destination\" => $mobile1, \"amount\" => $amount, \"productCode\" => $operator_code, \"comments\" => \"topup\", \"agenttransid\" => '1234', \"type\" => 'PC'));\n\t\t\n\t\t\t\t\t$soaoresponce = $client -> __getLastResponse();\n\t\t\n\t\t\t\t\t$xml = simplexml_load_string($soaoresponce, NULL, NULL, \"http://schemas.xmlsoap.org/soap/envelope/\");\n\t\t\t\t\t$ns = $xml -> getNamespaces(true);\n\t\t\t\t\t$soap = $xml -> children($ns['soapenv']);\n\t\t\t\t\t$agentCode = $soap -> Body -> children($ns['topupRequestReturn']) -> children($ns['ns1']) -> agentCode;\n\t\t\t\t\t$productcode = $soap -> Body -> children($ns['topupRequestReturn']) -> children($ns['ns5']) -> productcode;\n\t\t\t\t\t$destination = $soap -> Body -> children($ns['topupRequestReturn']) -> children($ns['ns6']) -> destination;\n\t\t\t\t\t$agenttransid = $soap -> Body -> children($ns['topupRequestReturn']) -> children($ns['ns8']) -> agenttransid;\n\t\t\t\t\t$amount = $soap -> Body -> children($ns['topupRequestReturn']) -> children($ns['ns9']) -> amount;\n\t\t\t\t\t$transid = $soap -> Body -> children($ns['topupRequestReturn']) -> children($ns['ns12']) -> transid;\n\t\t\t\t\t$resultdescription = $soap -> Body -> children($ns['topupRequestReturn']) -> children($ns['ns26']) -> resultdescription;\n\t\t\n\t\t\t\t\tif ($resultdescription[0] == 'Transaction Successful') {\n\t\t\t\t\t\t//echo \"transid=\".$transid[0].'<br>';\n\t\t\t\t\t\t$recharge_status = '1';\n\t\t\t\t\t\t$transaction_id = $transid[0];\n\t\t\t\t\t\t$result = $recharge_status . \",\" . $transid[0];\n\t\t\t\t\t\t//$result=array(\"recharge_status\"=>$recharge_status,'transaction_id'=>$transid[0]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$result = \"2\" . \"0\";\n\t\t\t\t\t}\n\t\t\t\t\treturn $result;\n\t\t\t\t}*/\n\t\t\n // corncone api for recharge==================//////////////////==========\n\t\telse if($operator_code == 'AQA' || $operator_code == 'AWA' || $operator_code == 'AQC' || $operator_code == 'ANA'|| $operator_code == 'APA' || $operator_code == 'AEA' || $operator_code == 'ACA' || $operator_code == 'Glo')\n\t\t{\n\t\t\t$phone=$mobile;\n\t\t\t$id=rand('1000','9999');\n\t\t\t$service_id=$operator_code;\n\t\t\t$amt=$amount;\n\t\t\tif($operator_code == 'Glo'|| $operator_code == 'ACA'|| $operator_code == 'AEA')\n\t\t\t{\n\t\t\t\t$arr = array('details' => array('phoneNumber' => $phone, 'amount' => $amt),\n\t\t\t\t\t 'id' => $id,\n\t\t\t\t\t 'paymentCollectorId' => 'CDL',\n\t\t\t\t\t 'paymentMethod' => 'PREPAID',\n\t\t\t\t\t 'serviceId' => $service_id\n\t\t\t\t\t\t);\n\t\t\t\t\n\t\t\t}else\n\t\t\tif($operator_code == 'APA')\n\t\t\t{\n\t\t\t\n\t\t\t\t$arr = array(\n\t\t\t\t\t 'details' => array('accountNumber' => $phone, 'amount' => $amt),\n\t\t\t\t\t 'id' => $id,\n\t\t\t\t\t 'paymentCollectorId' => 'CDL',\n\t\t\t\t\t 'paymentMethod' => 'PREPAID',\n\t\t\t\t\t 'serviceId' => $service_id\n\t\t\t\t\t\t);\n\t\t\t}else \n\t\t\tif($operator_code == 'ANB'|| $operator_code == 'ANA')\n\t\t\t{\n\t\t\t\n\t\t\t\t$arr = array(\n\t\t\t\t\t 'details' => array('customerAccountId' => $phone, 'amount' => $amt),\n\t\t\t\t\t 'id' => $id,\n\t\t\t\t\t 'paymentCollectorId' => 'CDL',\n\t\t\t\t\t 'paymentMethod' => 'PREPAID',\n\t\t\t\t\t 'serviceId' => $service_id\n\t\t\t\t\t\t);\n\t\t\t\t\n\t\t\t}\n\t\t\telse \n\t\t\tif($operator_code == 'AQC')\n\t\t\t{\n\t\n\t\n\t\t\t$arr = array(\n\t\t\t\t\t 'details' => array('productsCodes' => [\"GOTVPLS\"],'customerNumber'=>$phone, 'amount' => $amt,'customerName'=>\"John\nSmith\",'invoicePeriod'=>1),\n\t\t\t\t\t 'id' => $id,\n\t\t\t\t\t 'paymentCollectorId' => 'CDL',\n\t\t\t\t\t 'paymentMethod' => 'PREPAID',\n\t\t\t\t\t 'serviceId' => $service_id\n\t\t\t\t\t\t);\n\t\t\t\n\t\t\t}\n\t\t\telse \n\t\t\tif($operator_code == 'AWA')\n\t\t\t{\n\t\t\t$arr = array(\n\t\t\t\t\t 'details' => array('smartCardNumber' => $phone, 'amount' => $amt),\n\t\t\t\t\t 'id' => $id,\n\t\t\t\t\t 'paymentCollectorId' => 'CDL',\n\t\t\t\t\t 'paymentMethod' => 'PREPAID',\n\t\t\t\t\t 'serviceId' => $service_id\n\t\t\t\t\t\t);\n\t\t\t\t\n\t\t\t}else \n\t\t\tif($operator_code == 'AQA')\n\t\t\t{\n\t\t\t\t$arr = array(\n\t\t\t\t\t 'details' => array('productsCodes' => [\"ACSSW4\",\"ASIADDW\",\"HDPVRW\"\n],'customerNumber'=>$phone, 'amount' => $amt,'customerName'=>\"John\nSmith\",'invoicePeriod'=>1),\n\t\t\t\t\t 'id' => $id,\n\t\t\t\t\t 'paymentCollectorId' => 'CDL',\n\t\t\t\t\t 'paymentMethod' => 'PREPAID',\n\t\t\t\t\t 'serviceId' => $service_id\n\t\t\t\t\t\t);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$requestBody = json_encode($arr);\n\t\t\t$hashedRequestBody = base64_encode(hash('sha256', utf8_encode($requestBody), true));\n\t\t\t$date = gmdate('D, d M Y H:i:s T');\n\t\t\t$signedData = \"POST\" . \"\\n\" . $hashedRequestBody . \"\\n\" . $date . \"\\n\" . \"/rest/consumer/v2/exchange\";\n\t\t\t$token = base64_decode('+uwXEA2F3Shkeqnqmt9LcmALGgkEbf2L6MbKdUJcFwow6X8jOU/D36CyYjp5csR5gPTLedvPQDg1jJGmOnTJ2A==');\n\t\t\t$signature = hash_hmac('sha1', $signedData, $token, true);\n\t\t\t$encodedsignature = base64_encode($signature);\n\n\t\t\t$arr = \n\t\t\tarray(\n\t\t\t\t\"accept: application/json, application/*+json\", \n\t\t\t\t\"accept-encoding: gzip,deflate\", \n\t\t\t\t\"authorization: MSP efficiencie:\" . $encodedsignature, \n\t\t\t\t\"cache-control: no-cache\", \n\t\t\t\t\"connection: Keep-Alive\", \n\t\t\t\t\"content-type: application/json\", \n\t\t\t\t\"host: 136.243.252.209\", \n\t\t\t\t\"x-msp-date:\" . $date\n\t\t\t\t);\n\n\t\t\t\t\t$curl = curl_init();\n\t\t\t\t\tcurl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);\n\t\t\t\t\tcurl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);\n\t\t\t\t\tcurl_setopt_array($curl, array(CURLOPT_URL => \"https://136.243.252.209/app/rest/consumer/v2/exchange\", \n\t\t\t\t\tCURLOPT_RETURNTRANSFER => true, \n\t\t\t\t\tCURLOPT_ENCODING => \"\", \n\t\t\t\t\tCURLOPT_MAXREDIRS => 10, \n\t\t\t\t\tCURLOPT_TIMEOUT => 30, \n\t\t\t\t\tCURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, \n\t\t\t\t\tCURLOPT_CUSTOMREQUEST => \"POST\", \n\t\t\t\t\tCURLOPT_POSTFIELDS => $requestBody, \n\t\t\t\t\tCURLOPT_HTTPHEADER => $arr));\n\t\t\t\t\t$response = curl_exec($curl);\n\t\t\t\t\t$err = curl_error($curl);\n\t\t\t\t\tcurl_close($curl);\n\n\t\t\t\t\tif ($err) {\n\t\t\t\t\t\techo \"cURL Error #:\" . $err;\n\t\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t\t$arr=json_decode($response);\n\t\t\t\t\t\t$transaction_id=$arr->details->exchangeReference;\n\t\t\t\t\t\t $responseMessage=$arr->details->responseMessage;\n\t\t\t\t\t\t $status=$arr->details->status;\n\t\t\t\t\t\t $statusCode=$arr->details->statusCode;\n\t\t\t\t\t\t if($status=='ACCEPTED')\n\t\t\t\t\t\t {\n\t\t\t\t\t\t \t$recharge_status='1';\n\t\t\t\t\t\t \t$result = $recharge_status . \",\" . $transaction_id;\n\t\t\t\t\t\t }else{\n\t\t\t\t\t\t \t$result = \"2\" . \"0\";\n\t\t\t\t\t\t }\n\t\t\t\t\t\t return $result;\n\t\t\t\t\t}\n\t\t\t\n\t\t}\n\n\t}", "function get_indicator_price($price,$vat){\r\n $full_price = $price + ($price * $vat);\r\n return $full_price;\r\n}", "public function getCompetitivePricingForSKU($request);", "public function getMyPriceForSKU($request);", "function cvrapi($vat, $country)\n{\n $vat = preg_replace('/[^0-9]/', '', $vat);\n // Check whether VAT-number is invalid\n if(empty($vat) === true)\n {\n\n // Print error message\n return('Venligst angiv et CVR-nummer.');\n\n } else {\n\n // Start cURL\n $ch = curl_init();\n\n // Set cURL options\n curl_setopt($ch, CURLOPT_URL, 'http://cvrapi.dk/api?vat=' . $vat . '&country=' . 'dk');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_USERAGENT, 'Fetching company information');\n\n // Parse result\n $result = curl_exec($ch);\n\n // Close connection when done\n curl_close($ch);\n\n // Return our decoded result\n return json_decode($result, 1);\n\n }\n}", "function view_voucher($demand_id)\n {\n }", "protected function _drcRequest($service)\r\n\t{\r\t\t$db = Mage::getSingleton('core/resource')->getConnection('core_write');\r\t\t\r\n\t\t$origCountry = Mage::getStoreConfig('shipping/origin/country_id', $this->getStore());\r\n\t\tif ($origCountry != \"AU\") \r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\t\t\r\r\r\n\t\t// TODO: Add some more validations\r\t\t$path_smartsend = \"carriers/smartsend/\";\r\t\t\r\n\t\t//$frompcode = Mage::getStoreConfig('shipping/origin/postcode', $this->getStore());\r\n\t\t//$fromsuburb = Mage::getStoreConfig('shipping/origin/city', $this->getStore());\r\t\t\r\t\t$frompcode = Mage::getStoreConfig($path_smartsend.'post_code', $this->getStore());\r\t\t$fromsuburb = Mage::getStoreConfig($path_smartsend.'suburban', $this->getStore());\r\t\t\r\n\t\t$topcode = $service->getDestPostcode();\r\n\t\t$tosuburb = $service->getDestCity();\r\r\t\tMage::Log($frompcode);\r\t\tMage::Log($fromsuburb);\r\t\t\r\n\t\tif ($service->getDestCountryId()) {\r\n\t\t\t$destCountry = $service->getDestCountryId();\r\n\t\t} \r\r\n\t\telse{\r\n\t\t\t$destCountry = \"AU\";\r\n\t\t}\t\t\r\t\r\n\t\t// Here we get the weight (and convert it to grams) and set some\r\n\t\t// sensible defaults for other shipping parameters.\t\r\r\n\t\t$weight = (int)$service->getPackageWeight();\r\t\t\r\t\t$height = $width = $length = 100;\r\n\t\t$shipping_num_boxes = 1;\r\n\t\t$Description = \"CARTON\";\r\n\t\t$post_url = \"http://api.smartsend.com.au/\"; \r\r\t\r\n \r\t//$result = $db->query(\"SELECT depth,length,height,description,taillift FROM 'smartsend_products'\");\r\t\r\t\r\n $post_param_values[\"METHOD\"] = \"GetQuote\";\r\n $post_param_values[\"FROMCOUNTRYCODE\"] = $origCountry;\r\n $post_param_values[\"FROMPOSTCODE\"] = $frompcode; //\"2000\";\r\n $post_param_values[\"FROMSUBURB\"] = $fromsuburb; //\"SYDNEY\";\r\n $post_param_values[\"TOCOUNTRYCODE\"] = $destCountry;\r\n $post_param_values[\"TOPOSTCODE\"] = $topcode;\r\n $post_param_values[\"TOSUBURB\"] = $tosuburb;\r\r\n\r\t\r\n # tail lift - init \r\n $taillift = array();\r\n $key = 0;\r\r\n\t$freeBoxes = 0;\r\n if ($service->getAllItems()) {\r\n foreach ($service->getAllItems() as $item) {\r\r\n\t/* fetching the values of lenght,weight,height,description in smartsend_products table */\r\t\t\t\t$prod_id = $item->getProduct()->getId();\r\t\t\t\t\r\t\t\t\t\r\n if ($item->getProduct()->isVirtual() || $item->getParentItem()) {\r\r\n continue;\r\r\n }\r\r\n\r\r\n if ($item->getHasChildren() && $item->isShipSeparately()) {\r\r\n foreach ($item->getChildren() as $child) {\r\r\n if ($child->getFreeShipping() && !$child->getProduct()->isVirtual()) {\r\r\n $freeBoxes += $item->getQty() * $child->getQty();\r\r\n }\r\r\n }\r\r\n } elseif ($item->getFreeShipping()) {\r\r\n $freeBoxes += $item->getQty();\r\r\n }\r\t\t\t\t\r\t\t\t\t$prod_id \t= $item->getProduct()->getId();\r\t\t\t\t$result \t= $db->query('Select * from `smartsend_products` where id='.\"'\".$prod_id.\"'\");\r\t\t\t\t$rows \t\t= $result->fetch(PDO::FETCH_ASSOC);\r\t\t\t\t\r\t\t\t\t\r\t\t\t\tif($rows){\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_HEIGHT\"] = $rows['height'];\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_LENGTH\"] = $rows['length'];\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_DEPTH\"] = $rows['depth'];\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_WEIGHT\"] = $weight;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_DESCRIPTION\"] = $rows['description'];\r\t\t\t\t}else{\r\t\t\t\t\t/* default values */\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_HEIGHT\"] = 1;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_LENGTH\"] = 1;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_DEPTH\"] = 1;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_WEIGHT\"] = $weight;\r\t\t\t\t\t$post_value_items[\"ITEM({$key})_DESCRIPTION\"] = 'none';\t\t\t\t\r\t\t\t\t}\r\r # tail lift - assigns value\r switch($rows['taillift']){\r case 'none':\r $taillift[] = \"none\";break;\r case 'atpickup':\r $taillift[] = \"atpickup\";break; \r case 'atdestination':\r $taillift[] = \"atdestination\";break; \r case 'both':\r $taillift[] = \"both\";break; \r }\r\t\t\t\t\t\r\t\t\t\t$key++;\r\n }\r\r\n }\r\t\t\r\t\t\r\r\n $this->setFreeBoxes($freeBoxes);\r\t\t\t\t\t\t\t\r/*\r\n $post_value_items[\"ITEM({$key})_HEIGHT\"] = $height;\r\n $post_value_items[\"ITEM({$key})_LENGTH\"] = $length;\r\n $post_value_items[\"ITEM({$key})_DEPTH\"] = $width;\r\n $post_value_items[\"ITEM({$key})_WEIGHT\"] = $width;\r\n $post_value_items[\"ITEM({$key})_DESCRIPTION\"] = $Description;\r*/\r \r \t\t\r\r\n # tail lift - choose appropriate value\r\r\n $post_param_values[\"TAILLIFT\"] = \"none\"; \r\r\n if (in_array(\"none\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"none\"; \r\n if (in_array(\"atpickup\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"atpickup\";\r\n if (in_array(\"atdestination\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"atdestination\";\r\n if (in_array(\"atpickup\", $taillift) && in_array(\"atdestination\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"both\";\r\n if (in_array(\"both\", $taillift)) $post_param_values[\"TAILLIFT\"] = \"both\"; \r\r\n \r\r\n $post_final_values = array_merge($post_param_values,$post_value_items);\r\r\n # POST PARAMETER AND ITEMS VALUE URLENCODE\r\r\n $post_string = \"\";\r\r\n foreach( $post_final_values as $key => $value )\r\n { $post_string .= \"$key=\" . urlencode( $value ) . \"&\"; }\r\n $post_string = rtrim( $post_string, \"& \" );\r\r\n\tif ($service->getFreeShipping() === true || $service->getPackageQty() == $this->getFreeBoxes()) {\r $shippingPrice = '0.00';\r\t\t\t\t\r\r\n $arr_resp['ACK'] = 'Success';\r $arr_resp['QUOTE(0)_TOTAL'] = $shippingPrice;\r $arr_resp['QUOTE(0)_ESTIMATEDTRANSITTIME'] = 'Fixed';\r $arr_resp['QUOTECOUNT'] = 1;\r\r\n }else{\r\r\n \r\r\n # START CURL PROCESS\r\r\n $request = curl_init($post_url); \r\tcurl_setopt($request, CURLOPT_HEADER, 0); \r\tcurl_setopt($request, CURLOPT_RETURNTRANSFER, 1); \r\n curl_setopt($request, CURLOPT_POSTFIELDS, $post_string);\r\n curl_setopt($request, CURLOPT_SSL_VERIFYPEER, FALSE);\r\n $post_response = curl_exec($request); \r\n curl_close ($request); // close curl object \r\r\n\t# parse output\r\n parse_str($post_response, $arr_resp);\r\r\n\t}\r\r\n\treturn $arr_resp;\r\r\n\t}", "public function calculatePayment()\n {\n }", "public function getCars()\n {\n $automoviles = Automovil::get();\n \n return $this->sendResponse($automoviles, 'Completado Correctamente.');\n }", "function pricesAction(){\n\t $this->_helper->layout->disableLayout();\n\t $this->_helper->viewRenderer->setNoRender(TRUE);\n\t \n \t// $session = SessionWrapper::getInstance();\n \t$formvalues = $this->_getAllParams();\n \t// debugMessage($formvalues);\n \t\n \t$where_query = \"\";\n \t$bundled = true;\n \t$commodityquery = false;\n \tif(count($formvalues) == 3){\n \t\techo \"NULL_PARAMETER_LIST\";\n \t\texit();\n \t}\n \tif(isArrayKeyAnEmptyString('commodity', $formvalues) && isArrayKeyAnEmptyString('commodityid', $formvalues) && $this->_getParam('range') != 'all'){\n \t\techo \"COMMODITY_NULL\";\n \t\texit();\n \t}\n \t# commodity query\n \tif((!isArrayKeyAnEmptyString('commodityid', $formvalues) || !isArrayKeyAnEmptyString('commodity', $formvalues)) && $this->_getParam('range') != 'all'){\n \t\t$com = new Commodity();\n \t\t// commodityid specified\n \t\tif(!isEmptyString($this->_getParam('commodityid'))){\n\t \t\t$com->populate($formvalues['commodityid']);\n\t \t\t// debugMessage($com->toArray());\n\t \t\tif(isEmptyString($com->getID()) || !is_numeric($formvalues['commodityid'])){\n\t \t\t\techo \"COMMODITY_INVALID\";\n\t \t\t\texit();\n\t \t\t}\n\t \t\t$comid = $formvalues['commodityid'];\n\t \t\t$where_query .= \" AND d.commodityid = '\".$comid.\"' \";\n \t\t}\n \t\t// commodty name specified\n \t\tif(!isEmptyString($this->_getParam('commodity'))){\n \t\t\t$searchstring = $formvalues['commodity'];\n \t\t\t$islist = false;\n\t \t\tif(strpos($searchstring, ',') !== false) {\n\t\t\t\t\t$islist = true;\n\t\t\t\t}\n\t\t\t\tif(!$islist){\n\t \t\t\t$comid = $com->findByName($searchstring);\n\t \t\t\t$comid_count = count($comid);\n\t \t\t\tif($comid_count == 0){\n\t\t \t\t\techo \"COMMODITY_INVALID\";\n\t\t \t\t\texit();\n\t\t \t\t}\n\t\t \t\tif($comid_count == 1){\n\t\t \t\t\t$where_query .= \" AND d.commodityid = '\".$comid[0]['id'].\"' \";\n\t\t \t\t}\n\t \t\t\tif($comid_count > 1){\n\t \t\t\t\t$ids_array = array();\n\t \t\t\t\tforeach ($comid as $value){\n\t \t\t\t\t\t$ids_array[] = $value['id'];\n\t \t\t\t\t}\n\t \t\t\t\t$ids_list = implode($ids_array, \"','\");\n\t \t\t\t\t// debugMessage($ids_list);\n\t\t \t\t\t$where_query .= \" AND d.commodityid IN('\".$ids_list.\"') \";\n\t\t \t\t}\n\t\t\t\t}\n\t\t\t\tif($islist){\n\t\t\t\t\t$bundled = false;\n\t\t\t\t\t$searchstring = trim($searchstring);\n\t\t\t\t\t$seach_array = explode(',', $searchstring);\n\t\t\t\t\t// debugMessage($seach_array);\n\t\t\t\t\tif(is_array($seach_array)){\n\t\t\t\t\t\t$ids_array = array();\n\t\t\t\t\t\tforeach ($seach_array as $string){\n\t\t\t\t\t\t\t$com = new Commodity();\n\t\t\t\t\t\t\t$comid = $com->findByName($string);\n\t \t\t\t\t\t$comid_count = count($comid);\n\t\t\t\t\t\t\tif($comid_count > 0){\n\t\t\t \t\t\t\tforeach ($comid as $value){\n\t\t\t \t\t\t\t\t$ids_array[] = $value['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(count($ids_array) > 0){\n\t\t\t\t\t\t\t$ids_list = implode($ids_array, \"','\");\n\t\t\t \t\t\t// debugMessage($ids_list);\n\t\t\t\t \t\t$where_query .= \" AND d.commodityid IN('\".$ids_list.\"') \";\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\techo \"COMMODITY_LIST_INVALID\";\n\t\t \t\t\t\texit();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo \"COMMODITY_LIST_INVALID\";\n\t\t \t\t\texit();\n\t\t\t\t\t}\n\t\t\t\t}\n \t\t}\n\t \t\t\n \t\t$commodityquery = true;\n \t\tif($this->_getParam('unbundled') == '1'){\n \t\t\t$bundled = false;\n \t\t}\n \t\t\n \t}\n \t# markets query\n \t$marketquery = false;\n \t\tif(!isArrayKeyAnEmptyString('marketid', $formvalues) || !isArrayKeyAnEmptyString('market', $formvalues)){\n \t\t\t$market = new PriceSource();\n \t\t\tif(!isEmptyString($this->_getParam('marketid'))){\n\t \t\t$market->populate($formvalues['marketid']);\n\t \t\t// debugMessage($market->toArray());\n\t \t\tif(isEmptyString($market->getID()) || !is_numeric($formvalues['marketid'])){\n\t \t\t\techo \"MARKET_INVALID\";\n\t \t\t\texit();\n\t \t\t}\n\t \t\t$makid = $formvalues['marketid'];\n \t\t\t}\n \t\t\tif(!isEmptyString($this->_getParam('market'))){\n \t\t\t\t$makid = $market->findByName($formvalues['market']);\n \t\t\tif(isEmptyString($makid)){\n\t \t\t\techo \"MARKET_INVALID\";\n\t \t\t\texit();\n\t \t\t}\n \t\t\t}\n \t\t$marketquery = true;\n \t\t$where_query .= \" AND d.sourceid = '\".$makid.\"' \";\n \t}\n \t# district query\n \t$districtquery = false;\n \tif(!isArrayKeyAnEmptyString('districtid', $formvalues) || !isArrayKeyAnEmptyString('district', $formvalues)){\n \t\t\t$district = new District();\n \t\t\tif(!isArrayKeyAnEmptyString('districtid', $formvalues)){\n\t \t\t$district->populate($formvalues['districtid']);\n\t \t\t// debugMessage($market->toArray());\n\t \t\tif(isEmptyString($district->getID()) || !is_numeric($formvalues['districtid'])){\n\t \t\t\techo \"DISTRICT_INVALID\";\n\t \t\t\texit();\n\t \t\t}\n\t \t\t$distid = $formvalues['districtid'];\n \t\t\t}\n \t\t\tif(!isArrayKeyAnEmptyString('district', $formvalues)){\n \t\t\t\t$distid = $district->findByName($formvalues['district'], 2);\n \t\t\tif(isEmptyString($distid)){\n\t \t\t\techo \"DISTRICT_INVALID\";\n\t \t\t\texit();\n\t \t\t}\n \t\t\t}\n \t\t$districtquery = true;\n \t\tif($this->_getParam('unbundled') == '1'){\n \t\t\t$bundled = false;\n \t\t}\n \t\t$where_query .= \" AND d2.districtid = '\".$distid.\"' \";\n \t}\n \t# region query \n \t$regionquery = false;\n \tif(!isArrayKeyAnEmptyString('regionid', $formvalues) || !isArrayKeyAnEmptyString('region', $formvalues)){\n \t\t\t$region = new Region();\n \t\t\tif(!isArrayKeyAnEmptyString('regionid', $formvalues)){\n\t \t\t$region->populate($formvalues['regionid']);\n\t \t\t// debugMessage(region->toArray());\n\t \t\tif(isEmptyString($region->getID()) || !is_numeric($formvalues['regionid'])){\n\t \t\t\techo \"REGION_INVALID\";\n\t \t\t\texit();\n\t \t\t}\n\t \t\t$regid = $formvalues['regionid'];\n \t\t\t}\n \t\tif(!isEmptyString($this->_getParam('region'))){\n \t\t\t\t$regid = $region->findByName($formvalues['region'], 1);\n \t\t\tif(isEmptyString($regid)){\n\t \t\t\techo \"REGION_INVALID\";\n\t \t\t\texit();\n\t \t\t}\n \t\t\t}\n \t\t$regionquery = true;\n \t\t$bundled = true;\n \t\tif($this->_getParam('unbundled') == '1'){\n \t\t\t$bundled = false;\n \t\t}\n \t\t$where_query .= \" AND d2.regionid = '\".$regid.\"' \";\n \t}\n \t# all prices query\n \t$allpricesquery = false;\n \tif(!isArrayKeyAnEmptyString('range', $formvalues) && $this->_getParam('range') == 'all'){\n \t\t$allpricesquery = true;\n \t}\n \t// debugMessage($where_query); // exit();\n \t\t\n \t$conn = Doctrine_Manager::connection(); \n \t$query = \"SELECT \n\t\t\t\t\td2.regionid as regionid,\n\t\t\t\t\td2.region as region,\n\t\t\t\t\td2.districtid as districtid,\n\t\t\t\t\td2.district as district,\n \t\t\t\td.datecollected as date, \n\t\t\t\t\tREPLACE(d2.name,' Market','')as market,\n\t\t\t\t\td.sourceid as marketid,\n\t\t\t\t\tc.name as commodity,\n\t\t\t\t\td.commodityid as commodityid,\n\t\t\t\t\tcu.name as unit,\n\t\t\t\t\td.retailprice AS retailprice, \n\t\t\t\t\td.wholesaleprice AS wholesaleprice\n\t\t\t\t\tFROM commoditypricedetails AS d \n\t\t\t\t\tINNER JOIN commodity AS c ON (d.`commodityid` = c.id)\n\t\t\t\t\tLEFT JOIN commodityunit AS cu ON (c.unitid = cu.id)\n\t\t\t\t\tINNER JOIN (\n\t\t\t\t\tSELECT cp.sourceid,\n\t\t\t\t\tp.locationid as districtid,\n\t\t\t\t\tl.name as district,\n\t\t\t\t\tl.regionid as regionid, \n\t\t\t\t\tr.name as region, \n\t\t\t\t\tMAX(cp.datecollected) AS datecollected, \n\t\t\t\t\tp.name FROM commoditypricedetails cp \n\t\t\t\t\tINNER JOIN commoditypricesubmission AS cs1 ON (cp.`submissionid` = cs1.`id` \n\t\t\t\t\tAND cs1.`status` = 'Approved') \n\t\t\t\t\tINNER JOIN pricesource AS p ON (cp.sourceid = p.id AND p.`applicationtype` = 0 )\n\t\t\t\t\tINNER JOIN location AS l ON (p.locationid = l.id AND l.locationtype = 2)\n\t\t\t\t\tINNER JOIN location AS r ON (l.regionid = r.id AND r.locationtype = 1)\n\t\t\t\t\tWHERE cp.`pricecategoryid` = 2 GROUP BY cp.sourceid) AS d2 \n\t\t\t\t\tON (d.`sourceid` = d2.sourceid AND d.`datecollected` = d2.datecollected) \n\t\t\t\t\tWHERE d.`pricecategoryid` = 2 AND d.retailprice > 0 AND d.wholesaleprice > 0 AND date(d.datecollected) >= date(now()-interval 60 day) \".$where_query.\" ORDER BY d2.name\";\n \t\n \t// debugMessage($query);\n \t$result = $conn->fetchAll($query);\n \t$pricecount = count($result);\n \t// debugMessage($result); \n \t// exit();\n \tif($pricecount == 0){\n \t\techo \"RESULT_NULL\";\n \t} else {\n \t\t$feed = '';\n \t\t# format commodity output\n \t\tif($commodityquery && !$marketquery && !$districtquery){\n \t\t\t$feed = '';\n \t\t\tif(!$bundled){\n\t\t\t \tforeach ($result as $line){\n\t\t\t\t \t$feed .= '<item>';\n\t\t\t \t\t$feed .= '<region>'.$line['region'].'</region>';\n\t\t\t \t\t$feed .= '<regionid>'.$line['regionid'].'</regionid>';\n\t\t\t\t \t$feed .= '<district>'.$line['district'].'</district>';\n\t\t\t\t \t$feed .= '<districtid>'.$line['districtid'].'</districtid>';\n\t\t\t\t \t$feed .= '<market>'.$line['market'].'</market>';\n\t\t\t\t \t$feed .= '<marketid>'.$line['marketid'].'</marketid>';\n\t\t\t\t \t$feed .= '<commodity>'.$line['commodity'].'</commodity>';\n\t\t\t\t \t$feed .= '<commodityid>'.$line['commodityid'].'</commodityid>';\n\t\t\t\t \t$feed .= '<unit>' .$line['unit'].'</unit>';\n\t\t\t\t \t$feed .= '<datecollected>'.$line['date'].'</datecollected>';\n\t\t\t\t \t$feed .= '<retailprice>'.$line['retailprice'].'</retailprice>';\n\t\t\t\t\t $feed .= '<wholesaleprice>'.$line['wholesaleprice'].'</wholesaleprice>';\n\t\t\t\t\t $feed .= '</item>';\n\t\t\t \t}\n \t\t\t} else {\n \t\t\t\t$total_rp = 0;\n \t\t\t\t$total_wp = 0;\n \t\t\t\tforeach ($result as $line){\n \t\t\t\t\t$total_rp += $line['retailprice'];\n \t\t\t\t\t$total_wp += $line['wholesaleprice'];\n \t\t\t\t}\n \t\t\t\t$avg_rp = $total_rp/$pricecount;\n \t\t\t\t$avg_rp = ceil($avg_rp / 50) * 50;\n \t\t\t\t$avg_wp = $total_wp/$pricecount;\n \t\t\t\t$avg_wp = ceil($avg_wp / 50) * 50;\n \t\t\t\t\n \t\t\t\t$feed .= '<item>';\n\t\t\t\t \t$feed .= '<commodity>'.$result[0]['commodity'].'</commodity>';\n\t\t\t\t \t$feed .= '<commodityid>'.$result[0]['commodityid'].'</commodityid>';\n\t\t\t\t \t$feed .= '<unit>' .$result[0]['unit'].'</unit>';\n\t\t\t\t \t$feed .= '<datecollected>'.$result[0]['date'].'</datecollected>';\n\t\t\t\t \t$feed .= '<retailprice>'.$avg_rp.'</retailprice>';\n\t\t\t\t $feed .= '<wholesaleprice>'.$avg_wp.'</wholesaleprice>';\n\t\t\t\t $feed .= '<unbundled>1</unbundled>';\n\t\t\t\t $feed .= '</item>';\n \t\t\t}\n \t\t}\n \t\t# format market output\n \t\tif($marketquery){\n \t\t\t$feed = '';\n\t \t\tforeach ($result as $line){\n\t\t\t \t$feed .= '<item>';\n\t\t\t \t$feed .= '<region>'.$line['region'].'</region>';\n\t\t\t \t$feed .= '<regionid>'.$line['regionid'].'</regionid>';\n\t\t\t \t$feed .= '<district>'.$line['district'].'</district>';\n\t\t\t \t$feed .= '<districtid>'.$line['districtid'].'</districtid>';\n\t\t\t \t$feed .= '<market>'.$line['market'].'</market>';\n\t\t\t \t$feed .= '<marketid>'.$line['marketid'].'</marketid>';\n\t\t\t \t$feed .= '<commodity>'.$line['commodity'].'</commodity>';\n\t\t\t \t$feed .= '<commodityid>'.$line['commodityid'].'</commodityid>';\n\t\t\t \t$feed .= '<unit>' .$line['unit'].'</unit>';\n\t\t\t \t$feed .= '<datecollected>'.$line['date'].'</datecollected>';\n\t\t\t \t$feed .= '<retailprice>'.$line['retailprice'].'</retailprice>';\n\t\t\t\t $feed .= '<wholesaleprice>'.$line['wholesaleprice'].'</wholesaleprice>';\n\t\t\t\t $feed .= '</item>';\n\t \t\t}\n \t\t}\n \t\t# format region output\n \t\tif($districtquery){\n \t\t\t$feed = '';\n \t\t\tif(!$bundled){\n\t\t\t \tforeach ($result as $line){\n\t\t\t\t \t$feed .= '<item>';\n\t\t \t\t\t$feed .= '<region>'.$line['region'].'</region>';\n\t\t \t\t\t$feed .= '<regionid>'.$line['regionid'].'</regionid>';\n\t\t\t\t \t$feed .= '<district>'.$line['district'].'</district>';\n\t\t\t\t \t$feed .= '<districtid>'.$line['districtid'].'</districtid>';\n\t\t\t \t\t$feed .= '<market>'.$line['market'].'</market>';\n\t\t\t \t\t$feed .= '<marketid>'.$line['marketid'].'</marketid>';\n\t\t\t\t \t$feed .= '<commodity>'.$line['commodity'].'</commodity>';\n\t\t\t\t \t$feed .= '<commodityid>'.$line['commodityid'].'</commodityid>';\n\t\t\t\t \t$feed .= '<unit>' .$line['unit'].'</unit>';\n\t\t\t\t \t$feed .= '<datecollected>'.$line['date'].'</datecollected>';\n\t\t\t\t \t$feed .= '<retailprice>'.$line['retailprice'].'</retailprice>';\n\t\t\t\t\t $feed .= '<wholesaleprice>'.$line['wholesaleprice'].'</wholesaleprice>';\n\t\t\t\t\t $feed .= '</item>';\n\t\t\t \t}\n \t\t\t} else {\n \t\t\t\t$total_rp = 0;\n \t\t\t\t$total_wp = 0;\n \t\t\t\tforeach ($result as $line){\n \t\t\t\t\t$total_rp += $line['retailprice'];\n \t\t\t\t\t$total_wp += $line['wholesaleprice'];\n \t\t\t\t}\n \t\t\t\t$avg_rp = $total_rp/$pricecount;\n \t\t\t\t$avg_rp = ceil($avg_rp / 50) * 50;\n \t\t\t\t$avg_wp = $total_wp/$pricecount;\n \t\t\t\t$avg_wp = ceil($avg_wp / 50) * 50;\n \t\t\t\t\t\n \t\t\t\t$feed .= '<item>';\n\t\t\t \t$feed .= '<region>'.$result[0]['region'].'</region>';\n\t\t\t \t$feed .= '<regionid>'.$result[0]['regionid'].'</regionid>';\n\t\t\t\t $feed .= '<district>'.$result[0]['district'].'</district>';\n\t\t\t\t $feed .= '<districtid>'.$result[0]['districtid'].'</districtid>';\n\t\t\t\t $feed .= '<commodity>'.$result[0]['commodity'].'</commodity>';\n\t\t\t\t $feed .= '<commodityid>'.$result[0]['commodityid'].'</commodityid>';\n\t\t\t\t $feed .= '<unit>' .$result[0]['unit'].'</unit>';\n\t\t\t\t $feed .= '<datecollected>'.$result[0]['date'].'</datecollected>';\n\t\t\t\t $feed .= '<retailprice>'.$avg_rp.'</retailprice>';\n\t\t\t\t\t$feed .= '<wholesaleprice>'.$avg_wp.'</wholesaleprice>';\n\t\t\t\t\t$feed .= '<unbundled>1</unbundled>';\n\t\t\t\t\t$feed .= '</item>';\n \t\t\t}\n \t\t}\n \t\t# format region output\n \t\tif($regionquery){\n \t\t\t$feed = '';\n \t\t\tif(!$bundled){\n\t\t\t \tforeach ($result as $line){\n\t\t\t\t\t $feed .= '<item>';\n\t\t\t \t\t$feed .= '<region>'.$line['region'].'</region>';\n\t\t\t \t\t$feed .= '<regionid>'.$line['regionid'].'</regionid>';\n\t\t\t\t\t $feed .= '<district>'.$line['district'].'</district>';\n\t\t\t\t\t $feed .= '<districtid>'.$line['districtid'].'</districtid>';\n\t\t\t\t \t$feed .= '<market>'.$line['market'].'</market>';\n\t\t\t\t \t$feed .= '<marketid>'.$line['marketid'].'</marketid>';\n\t\t\t\t\t $feed .= '<commodity>'.$line['commodity'].'</commodity>';\n\t\t\t\t\t $feed .= '<commodityid>'.$line['commodityid'].'</commodityid>';\n\t\t\t\t\t $feed .= '<unit>' .$line['unit'].'</unit>';\n\t\t\t\t\t $feed .= '<datecollected>'.$line['date'].'</datecollected>';\n\t\t\t\t\t $feed .= '<retailprice>'.$line['retailprice'].'</retailprice>';\n\t\t\t\t\t\t$feed .= '<wholesaleprice>'.$line['wholesaleprice'].'</wholesaleprice>';\n\t\t\t\t\t\t$feed .= '</item>';\n\t\t\t \t}\n \t\t\t} else {\n \t\t\t\t$total_rp = 0;\n \t\t\t\t$total_wp = 0;\n \t\t\t\tforeach ($result as $line){\n \t\t\t\t\t$total_rp += $line['retailprice'];\n \t\t\t\t\t$total_wp += $line['wholesaleprice'];\n \t\t\t\t}\n \t\t\t\t$avg_rp = $total_rp/$pricecount;\n \t\t\t\t$avg_rp = ceil($avg_rp / 50) * 50;\n \t\t\t\t$avg_wp = $total_wp/$pricecount;\n \t\t\t\t$avg_wp = ceil($avg_wp / 50) * 50;\n \t\t\t\t\n \t\t\t\t$feed .= '<item>';\n\t\t\t \t$feed .= '<region>'.$result[0]['region'].'</region>';\n\t\t\t \t$feed .= '<regionid>'.$result[0]['regionid'].'</regionid>';\n\t\t\t\t $feed .= '<commodity>'.$result[0]['commodity'].'</commodity>';\n\t\t\t\t $feed .= '<commodityid>'.$result[0]['commodityid'].'</commodityid>';\n\t\t\t\t $feed .= '<unit>' .$result[0]['unit'].'</unit>';\n\t\t\t\t $feed .= '<datecollected>'.$result[0]['date'].'</datecollected>';\n\t\t\t\t $feed .= '<retailprice>'.$avg_rp.'</retailprice>';\n\t\t\t\t\t$feed .= '<wholesaleprice>'.$avg_wp.'</wholesaleprice>';\n\t\t\t\t\t$feed .= '<unbundled>1</unbundled>';\n\t\t\t\t\t$feed .= '</item>';\n \t\t\t}\n \t\t}\n \t\t# format all prices output\n \t\tif($allpricesquery){\n \t\t\t$feed = '';\n \t\t\tforeach ($result as $line){\n\t\t\t \t$feed .= '<item>';\n\t\t\t \t$feed .= '<region>'.$line['region'].'</region>';\n\t\t\t \t$feed .= '<regionid>'.$line['regionid'].'</regionid>';\n\t\t\t \t$feed .= '<district>'.$line['district'].'</district>';\n\t\t\t \t$feed .= '<districtid>'.$line['districtid'].'</districtid>';\n\t\t \t\t$feed .= '<market>'.$line['market'].'</market>';\n\t\t \t\t$feed .= '<marketid>'.$line['marketid'].'</marketid>';\n\t\t\t \t$feed .= '<commodity>'.$line['commodity'].'</commodity>';\n\t\t\t \t$feed .= '<commodityid>'.$line['commodityid'].'</commodityid>';\n\t\t\t \t$feed .= '<unit>' .$line['unit'].'</unit>';\n\t\t\t \t$feed .= '<datecollected>'.$line['date'].'</datecollected>';\n\t\t\t \t$feed .= '<retailprice>'.$line['retailprice'].'</retailprice>';\n\t\t\t\t $feed .= '<wholesaleprice>'.$line['wholesaleprice'].'</wholesaleprice>';\n\t\t\t\t $feed .= '</item>';\n\t \t\t}\n \t\t}\n \t\t\n \t\t# output the xml returned\n \t\tif(isEmptyString($feed)){\n \t\t\techo \"EXCEPTION_ERROR\";\n \t\t} else {\n \t\t\techo '<?xml version=\"1.0\" encoding=\"UTF-8\"?><items>'.$feed.'</items>';\n \t\t}\n\t }\n }", "function getCarteOperation()\n {\n $query_rq_service = \"SELECT numero_carte FROM carte_parametrable WHERE idcarte=2\";\n $service = $this->getConnexion()->prepare($query_rq_service);\n $service->execute();\n $row_rq_service= $service->fetchObject();\n return $row_rq_service->numero_carte;\n }", "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 }", "public function index(Request $request, $modelyear, $make, $model) {\n\n try {\n $rating = $request->input('withRating');\n $client = new Client();\n $res = $client->request('GET', 'https://one.nhtsa.gov/webapi/api/SafetyRatings/modelyear/' . $modelyear . '/make/' . $make . '/model/' . $model);\n\n $vehicles = $res->getBody();\n if ($rating && ($rating == 'true' || $rating == 'True')) {\n\n $vehicles = json_decode($vehicles, true);\n $results = $vehicles['Results'];\n $rating_array = array();\n foreach ($results as $result) {\n\n\n $client = new Client();\n $res = $client->request('GET', 'https://one.nhtsa.gov/webapi/api/SafetyRatings/VehicleId/' . $result['VehicleId']);\n\n $ratings = $res->getBody();\n $ratings = json_decode($ratings, true);\n $rating_array[] = $ratings['Results'][0]['OverallRating'];\n }\n\n $vehicles = array();\n $count = 0;\n \n foreach ($results as $result) {\n $vehicles[] = array(\n 'CrashRating' => $rating_array[$count],\n 'Description' => $result['VehicleDescription'],\n 'VehicleId' => $result['VehicleId']\n );\n $count++;\n }\n\n return array(\n 'Count' => $count,\n 'Message' => 'Results returned successfully',\n 'Results' => $vehicles\n );\n }\n\n\n return $vehicles;\n } catch (\\Exception $e) {\n\n return array(\n 'Count' => 0,\n 'Message' => 'No results found for this request',\n 'Results' => array()\n );\n }\n }", "public function index()\n {\n // return Car::all();\n\n $skip = request()->input('skip', 0);\n $take = request()->input('take', Car::get()->count());\n\n return Car::skip($skip)->take($take)->get();\n }", "public function checkCreditLimit() {\n \n Mage::getModel('storesms/apiClient')->checkCreditLimit(); \n \n }", "function car_detail()\n {\n echo $this->wheel_count;\n echo $this->door_count;\n echo $this->seat_count;\n }", "public function cost(){\n\t\t\n\t\treturn 200;\n\t}" ]
[ "0.5984275", "0.58329827", "0.5773014", "0.57282686", "0.57066685", "0.56140524", "0.56041324", "0.55659014", "0.551426", "0.54991746", "0.5498739", "0.5445294", "0.54193014", "0.5415721", "0.5404449", "0.5404384", "0.53993237", "0.53804123", "0.5376352", "0.53747314", "0.53744555", "0.53416127", "0.5330744", "0.53131235", "0.5312347", "0.5312151", "0.52967", "0.52925396", "0.5288136", "0.52783036", "0.5263224", "0.52495563", "0.5231776", "0.52136534", "0.52021", "0.5201468", "0.519878", "0.5185854", "0.5179411", "0.5179411", "0.51626194", "0.51378244", "0.5104234", "0.5101557", "0.50987357", "0.50987357", "0.50987357", "0.50987357", "0.50892043", "0.5088266", "0.5085955", "0.5071926", "0.50589216", "0.50559735", "0.50556016", "0.5049441", "0.5047191", "0.5047191", "0.50449896", "0.50442195", "0.5015525", "0.50075865", "0.50075865", "0.50035", "0.5000014", "0.49931055", "0.49921966", "0.49863845", "0.4978977", "0.49755347", "0.49744996", "0.49669608", "0.49654236", "0.4961748", "0.4961159", "0.49607477", "0.49561834", "0.4947094", "0.49470273", "0.49439624", "0.494058", "0.4936428", "0.49293333", "0.49292213", "0.4923396", "0.49207506", "0.49178335", "0.49112037", "0.49091125", "0.4908887", "0.4905955", "0.49052945", "0.49030495", "0.48991102", "0.48898137", "0.4887164", "0.48793343", "0.48760906", "0.48698407", "0.48598817" ]
0.58416975
1
Display a listing of the resource.
public function index() { $user = Auth::user(); $userid = $user->id; $user->newmsgs = 0; $user->save(); $imsgs = DB::table("messages")->where('to_user_id', $userid)->where('belong_to', true)->join('users', 'users.id', '=', 'messages.from_user_id')->select("messages.*", "users.name")->get(); $omsgs = DB::table("messages")->where('from_user_id', $userid)->where('belong_to', false)->join('users', 'users.id', '=', 'messages.to_user_id')->select("messages.*", "users.name")->get(); $msgs = Message::where('to_user_id', $userid)->where('belong_to', true)->get(); foreach ($msgs as $msg){ $msg->read = true; $msg->save(); } return view("message.index", ['imsgs' => $imsgs, 'omsgs' => $omsgs]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { // }
{ "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) { $msg = Message::find($id); $msg->delete(); return redirect()->action("MessageController@index"); }
{ "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()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function 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(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() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function 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 //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\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 $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(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($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.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
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 update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($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
Check if the admin has access to all the pages
public function testPageIsSuccessful(string $url) { $this->login('[email protected]'); $this->client->request('GET', $this->replaceUrlParameters($url)); $this->assertTrue($this->client->getResponse()->isSuccessful()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function userHasAccessToPages() {\n\t\t$configurationProxy = tx_oelib_configurationProxy::getInstance('realty');\n\n\t\t$objectsPid = $configurationProxy->getAsInteger(\n\t\t\t'pidForRealtyObjectsAndImages'\n\t\t);\n\t\t$canWriteObjectsPage = $GLOBALS['BE_USER']->doesUserHaveAccess(\n\t\t\tt3lib_BEfunc::getRecord('pages', $objectsPid), 16\n\t\t);\n\n\t\t$auxiliaryPid = $configurationProxy->getAsInteger(\n\t\t\t'pidForAuxiliaryRecords'\n\t\t);\n\t\t$canWriteAuxiliaryPage = $GLOBALS['BE_USER']->doesUserHaveAccess(\n\t\t\tt3lib_BEfunc::getRecord('pages', $auxiliaryPid), 16\n\t\t);\n\n\t\tif (!$canWriteObjectsPage) {\n\t\t\t$this->storeErrorMessage('objects_pid', $objectsPid);\n\t\t}\n\t\tif (!$canWriteAuxiliaryPage) {\n\t\t\t$this->storeErrorMessage('auxiliary_pid', $auxiliaryPid);\n\t\t}\n\n\t\treturn $canWriteObjectsPage && $canWriteAuxiliaryPage;\n\t}", "public function page_test() {\n\n\t\tprint_r($this->permissions->check(\"can_view_admin\"));\n\t}", "function user_can_access_admin_page()\n {\n }", "public function canManagePages();", "private function checkPageAllowed() {\n\n if (!$this->user->isPersonnalManager()) {\n\n header('Location: ./index.php');\n exit();\n }\n }", "function userIsPageAdmin() {\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->pageAdmin(Yawp::authUsername(), $this->area, $this->page);\n\t}", "private function hasAccess() {\n\t\tif ($GLOBALS['BE_USER']->isAdmin()) {\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn $this->userHasAccessToPages() && $this->userHasAccessToTables();\n\t}", "public function canAccessPage(){\n\n\t\t\t$nav = $this->getNavigationArray();\n\t\t\t$page = '/' . trim(getCurrentPage(), '/') . '/';\n\n\t\t\t$page_limit = 'author';\n\n\t\t\tforeach($nav as $item){\n\t\t\t\tif(General::in_array_multi($page, $item['children'])){\n\n\t\t\t\t\tif(is_array($item['children'])){\n\t\t\t\t\t\tforeach($item['children'] as $c){\n\t\t\t\t\t\t\tif($c['type'] == 'section' && $c['visible'] == 'no' && preg_match('#^' . $c['link'] . '#', $page)) {\n\t\t\t\t\t\t\t\t$page_limit = 'developer';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif($c['link'] == $page && isset($c['limit'])) {\n\t\t\t\t\t\t\t\t$page_limit\t= $c['limit'];\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\tif(isset($item['limit']) && $page_limit != 'primary'){\n\t\t\t\t\t\tif($page_limit == 'author' && $item['limit'] == 'developer') $page_limit = 'developer';\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\telseif(isset($item['link']) && ($page == $item['link']) && isset($item['limit'])){\n\t\t\t\t\t$page_limit\t= $item['limit'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($page_limit == 'author')\n\t\t\t\treturn true;\n\n\t\t\telseif($page_limit == 'developer' && Administration::instance()->Author->isDeveloper())\n\t\t\t\treturn true;\n\n\t\t\telseif($page_limit == 'primary' && Administration::instance()->Author->isPrimaryAccount())\n\t\t\t\treturn true;\n\n\t\t\treturn false;\n\t\t}", "public function checkAccess()\n {\n $list = $this->getPages();\n\n /**\n * Settings controller is available directly if the $page request variable is provided\n * if the $page is omitted, the controller must be the subclass of Settings main one.\n *\n * The inner $page variable must be in the getPages() array\n */\n return parent::checkAccess()\n && isset($list[$this->page])\n && (\n ($this instanceof \\XLite\\Controller\\Admin\\Settings && isset(\\XLite\\Core\\Request::getInstance()->page))\n || is_subclass_of($this, '\\XLite\\Controller\\Admin\\Settings')\n );\n }", "public function is_admin() {\n return $this->session->get(\"niveau_acces\") >= 2;\n }", "function admin_check(){\n global $user_ID, $tou_settings;\n if (current_user_can('administrator')) \n return;\n\n $current_page = false;\n if ($_SERVER[\"REQUEST_URI\"] and !empty($tou_settings->admin_page)){\n foreach((array)$tou_settings->admin_page as $admin_page){\n if($current_page)\n continue;\n \n $current_page = strpos($_SERVER[\"REQUEST_URI\"], $admin_page);\n }\n }\n \n if(!TouAppHelper::get_user_meta($user_ID, 'terms_and_conditions') and \n (empty($tou_settings->admin_page) or in_array('index.php', (array)$tou_settings->admin_page) or $current_page)){\n \n die(\"<script type='text/javascript'>location='\". admin_url($tou_settings->menu_page) .\"?page=terms-of-use-conditions'</script>\");\n }\n }", "function isAdminPage () {\n\t\tif ($this->getName () == 'admin') {\n\t\t\treturn true;\n\t\t} else {\n\t\t\t$parentPage = $this->getParentPage ();\n\t\t\tif ($parentPage !== null) {\n\t\t\t\treturn $parentPage->isAdminPage ();\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}", "public function checkAccessToPage($path){\n\t\t//Get current authenticated user data\n\t\t$admin = Auth::user();\n\t\t//Get user role\n\t\t$admin_roles = Roles::select('slug', 'access_pages')->where('slug', '=', $admin['role'])->first();\n\t\t//Check for Grant-access rules\n\t\tif($admin_roles->access_pages == 'grant_access'){\n\t\t\treturn true;\n\t\t}\n\n\t\t//Get accesses list for current role (access_pages is forbidden pages list)\n\t\t$forbidden_pages = (array)json_decode($admin_roles->access_pages);\n\t\t//get path for current page\n\t\t$natural_path = $this->getNaturalPath($path);\n\t\t//Get current page data\n\t\t$current_page = AdminMenu::select('id', 'slug')->where('slug', '=', $natural_path)->first();\n\n\t\t//if there is no id of current page in forbidden pages list\n\t\tif(!in_array($current_page->id, array_keys($forbidden_pages))){\n\t\t\treturn true;\n\t\t}else{\n\t\t\t//Check for CRUD restrictions\n\t\t\t$forbidden_pages = json_decode($admin_roles->access_pages);\n\t\t\t$current_page_id = $current_page->id;\n\n\t\t\t//convert current page path to full-slash view\n\t\t\t$path = (substr($path, 0,1) != '/')? '/'.$path: $path;\n\t\t\t//create path to links array\n\t\t\t$path_array = array_values(array_diff(explode('/',$path), ['']));\n\t\t\t//check for action-path\n\t\t\tswitch($path_array[count($path_array) -1]){\n\t\t\t\tcase 'edit':\n\t\t\t\tcase 'update':\n\t\t\t\t\tif(strpos($forbidden_pages->$current_page_id, 'u') !== false){\n\t\t\t\t\t\treturn abort(503);\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase 'create':\n\t\t\t\tcase 'store':\n\t\t\t\t\tif(strpos($forbidden_pages->$current_page_id, 'c') !== false){\n\t\t\t\t\t\treturn abort(503);\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif(strpos($forbidden_pages->$current_page_id, 'r') !== false){\n\t\t\t\t\t\treturn abort(503);\n\t\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t}", "public function check_admin()\n {\n return current_user_can('administrator');\n }", "public function check_admin() {\n return current_user_can('administrator');\n }", "function page_allowed($conn,$conn_admin,$id,$page)\n {\n $sql=\"select cn.id from customer_navbar cn left outer join customer_navbar_corresponding_pages cncp on cn.id=cncp.navbar_id where cn.link='$page' or cncp.link='$page' \";\n $res=$conn_admin->query($sql);\n if($res->num_rows>0)\n {\n $row=$res->fetch_assoc();\n $nid=$row['id'];\n $sql=\"select access from navbar_access where navbar_id=$nid and staff_id=$id\";\n \t\tif($res=$conn->query($sql))\n \t\t{\n \t\t\tif($res->num_rows>0)\n \t\t\t{\n \t\t\t\t$row=$res->fetch_assoc();\n \t\t\t\tif($row['access']!=0)\n \t\t\t\t\treturn true;\n \t\t\t\telse\n \t\t\t\t\treturn false;\n \t\t\t}\n \t\t}\n \t\telse\n \t\t{\n \t\t\t$sql=\"\";\n \t\t\treturn false;\n \t\t}\n }\n\t\telse\n\t\t{\n\t\t\t$sql=\"\";\n\t\t\treturn false;\n\t\t} \n }", "function visible () {\n\t\treturn isadmin();\n\t}", "public static function currentUserHasAccess() {\n return current_user_can('admin_access');\n }", "public static function has_admin_access() {\n\t\treturn current_user_can( 'manage_options' );\n\t}", "public function is_on_admin_page(): bool {\n\t\treturn is_admin() && isset( $_GET['page'] ) && $_GET['page'] === self::ADMIN_PAGE_SLUG;\n\t}", "function VisibleToAdminUser()\n {\n\tinclude (\"dom.php\");\n return $this->CheckPermission($pavad.' Use');\n }", "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 }", "function isAdmin() {\n //FIXME: This needs to (eventually) evaluate that the user is both logged in *and* has admin credentials.\n //Change to false to see nav and detail buttons auto-magically disappear.\n return true;\n}", "public function adminPermissionCheck() {\n \tif(Permission::check('ADMIN')) {\n \t\treturn true;\n \t} else {\n \t\treturn false;\n \t}\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed(\\Eadesigndev\\Pdfgenerator\\Controller\\Adminhtml\\Templates::ADMIN_RESOURCE_VIEW);\n }", "public function authorize()\n {\n if ($this->user && ($this->user->hasPermission('manage_pages_contents') ) ) {\n return true;\n }\n\n return false;\n }", "public static function isAdministration()\n {\n $permissions = [\"Vice direzione\", \"Direzione\"];\n return in_array($_SESSION[\"permission\"], $permissions);\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 }", "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 isAdminPanelVisible() {}", "public function hasAccess()\n\t{\n\t\t/* Check Permissions */\n\t\treturn \\IPS\\Member::loggedIn()->hasAcpRestriction( \"core\",\"members\" );\n\t}", "public function checkAdmin();", "public static function hasRights($request){\r\n \r\n //pages\r\n if(!isset($_SESSION) && empty($_SESSION)){\r\n if (array_key_exists($request, Tools::getPagesNoLogged())) {\r\n return true;\r\n } else {\r\n \r\n return false; \r\n }\r\n } elseif (isset($_SESSION) && @$_SESSION['statut'] == 0){\r\n if (array_key_exists($request, Tools::getPagesLogged())) {\r\n return true;\r\n } else {\r\n \r\n return false; \r\n }\r\n } elseif (isset($_SESSION) && $_SESSION['statut'] == 1){\r\n if (array_key_exists($request, Tools::getPagesAdmin())) {\r\n return true;\r\n } else {\r\n \r\n return false; \r\n }\r\n }\r\n \r\n \r\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 hasPages();", "public function hasPages();", "function olc_check_permission($pagename)\n{\n\tif (CUSTOMER_IS_ADMIN)\n\t{\n\t\tif ($pagename!='index')\n\t\t{\n\t\t\t$access_permission_query = olc_db_query(SELECT . $pagename . SQL_FROM . TABLE_ADMIN_ACCESS .\n\t\t\tSQL_WHERE.\"customers_id = '\" .CUSTOMER_ID . APOS);\n\t\t\t$access_permission = olc_db_fetch_array($access_permission_query);\n\t\t\t$return=$access_permission[$pagename] == '1';\n\t\t\t//\t} else {\n\t\t\t//\t\tolc_redirect(olc_href_link(FILENAME_LOGIN));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$return=true;\n\t\t}\n\t}\n\treturn $return;\n}", "public function checkIsAdmin() {\n\t\treturn Mage::getSingleton('admin/session')->isLoggedIn();\n\t}", "function user_has_permission() {\r\n\tglobal $wp_query;\r\n\r\n\tif ( is_posttype( 'itinerary', POSTTYPE_ARCHIVEORSINGLE ) ) {\r\n\t\treturn current_user_can( 'ind_read_itinerary' );\r\n\t}\r\n\r\n\tif ( is_posttype( 'magazine', POSTTYPE_SINGLEONLY ) ) {\r\n\t\t// Check if this is the most recent post somehow\r\n\t}\r\n\r\n\tif ( is_posttype( 'magazine', POSTTYPE_ARCHIVEONLY ) ) {\r\n\t\treturn true;\r\n\t\t$paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;\r\n\t\t$current = ( $paged == 1 && $wp_query->current_post == 0 );\r\n\t\treturn ( current_user_can( 'ind_read_magazine_archive' ) ||\r\n\t\t\t( $current /* && current_user_can( 'ind_read_magazine' ) */ ) );\r\n\t}\r\n\t\r\n\tif ( is_posttype( 'restaurant', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'shop', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'activity', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'article', POSTTYPE_SINGLEONLY )\r\n\t\t|| is_posttype( 'insidertrip' ) ) {\r\n\t\tif ( current_user_can( 'ind_read_itinerary' ) ) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\t\r\n\t\t$counter_show = \\indagare\\cookies\\Counters::getPageCountGroup( 'restricted' );\r\n\t\tif ( $counter_show > INDG_PREVIEW_COUNT_MAX ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\r\n\treturn true;\r\n}", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin'])) {\n return true;\n } else {\n return false;\n }\n }", "public function getCanPostToPages()\n\t{\n\t\ttry {\n\t\t\tif (!$this->fb) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$permissions = (new FacebookRequest(\n\t\t\t\t$this->fb, 'GET', '/me/permissions'\n\t\t\t))->execute()->getGraphObject();\n\t\t\tforeach($permissions->asArray() as $permission) {\n\t\t\t\tif (($permission->permission == 'publish_actions' || $permission->permission == 'manage_pages') && $permission->status == 'granted') {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// else\n\t\t\treturn false;\n\t\t} catch (Exception $e) {\n\t\t\t// may not be logged in\n\t\t}\n\t}", "function hasAccess(): bool\n {\n return isLoggedInAndHasRole($this->ci, [Role::ROLE_ADMIN]);\n }", "public function checkPageAccess($URL) {\n try {\n if ($this->Session->read('UserDetails.roleId') == 1) {\n $arrActions = array( \n 'Users/agentlist', \n 'Users/customer', \n 'Users/price', \n 'Users/entry', \n 'Users/expense', \n 'Users/add', \n 'Users/edit', \n 'Users/delete', \n 'Users/updateagentstatus', \n 'Users/managerlist', \n 'Users/updatemanagerstatus',\t\t\t\t\t\n );\n if (in_array($URL, $arrActions) && ($this->Session->read('UserDetails.id') > 0)) {\n return true;\n }\n }\n return false;\n } catch (Exception $e) {\n return false;\n }\n }", "function check_access() {\n foreach ($this->children as $child) {\n if ($child->check_access()) {\n return true;\n }\n }\n return false;\n }", "protected function checkAccess() {\n\t\t$hasAccess = static::hasAccess();\n\n\t\tif (!$hasAccess) {\n\t\t\tilUtil::sendFailure($this->pl->txt(\"permission_denied\"), true);\n if (self::version()->is6()) {\n $this->ctrl->redirectByClass(ilDashboardGUI::class, 'jumpToSelectedItems');\n } else {\n\t\t\t$this->ctrl->redirectByClass(ilPersonalDesktopGUI::class, 'jumpToSelectedItems');\n\t\t\t}\n\t\t}\n\t}", "public function checkAdmin()\n {\n // there ..... need\n // END Check\n $auth = false;\n if($auth) {\n return true;\n }\n else{\n return false;\n }\n }", "function admin_check($redirect = \"index.php\")\n\t{\n\t\t// makes sure they are logged in:\n\t\trequire_login($redirect);\n\t\t\n\t\t// makes sure they are admin\n\t\t$sql = sprintf(\"SELECT admin FROM users WHERE uid=%d\", \n\t\t$_SESSION[\"uid\"]);\n\t\t\n\t\t// apologize if they are not.\n\t\t$admin = mysql_fetch_row(mysql_query($sql));\n\t\tif ($admin[0] == 0)\n\t\t\tapologize(\"You do not have administrator priveleges\");\n\t}", "public function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('shopgate_menu/manage');\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed(static::ADMIN_RESOURCE);\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed(static::ADMIN_RESOURCE);\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed(static::ADMIN_RESOURCE);\n }", "public function hasAdmin() {\n\n return database::getInstance()->has(\"staff\",[\"Path[!]\" => null]);\n\n }", "private function checkAdmin()\n {\n $admin = false;\n if (isset($_SESSION['admin'])) {\n F::set('admin', 1);\n $admin = true;\n }\n F::view()->assign(array('admin' => $admin));\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Magestudy_Menu::first_index');\n }", "function check_role_access(){\n if(!is_user_logged_in()){\n return 0;\n }\n //Make sure its not admin\n if(in_array(\"administrator\", wp_get_current_user()->roles)){\n return 0;\n }\n\n\n //Get capabilities\n $allcaps = wp_get_current_user()->allcaps;\n $can_access = array();\n //Get manu slugs user can access from capabilities\n foreach($allcaps as $key=>$value){\n if(strpos($key,$this->wp_user_role_customizer) !== FALSE){\n //Remove wp_user_role_customizer from capability name to get menu-slug\n array_push($can_access, substr($key, strlen($this->wp_user_role_customizer . \"_\"), strlen($key)));\n\n }\n }\n\n if(empty($can_access)){\n return 0;\n }\n\n // array_push($can_access, 'post.php');\n\n\n\n //Get path and query of requested page\n $uri = wp_parse_url($_SERVER['REQUEST_URI']);\n $path = (isset($uri['path']) ? $uri['path'] : null);\n $query = (isset($uri['query']) ? $uri['query'] : null);\n $user_can_access = FALSE;\n //Make sure its wp-admin page\n if(strpos($path, 'wp-admin') !== FALSE){\n //Redirect to dashboard if requested page is either about.php or index.php\n if(strpos($path, '/wp-admin/about.php') !== FALSE || strpos($path, '/wp-admin/index.php') !== FALSE){\n wp_redirect(get_dashboard_url());\n exit();\n }\n\n if( strpos($path,'.php') !== FALSE || $query !== null){\n foreach($can_access as $menu_slug){\n //Access page if user can access requested page\n if($this->check_for_url_access($path,$query,$menu_slug)){\n $user_can_access = TRUE;\n break;\n\n }\n }\n //Exit if user can't access requested page\n if($user_can_access === FALSE){\n wp_die('You Cannot Access This Page', 'Access Denied',['exit'=> true]);\n }\n }\n }\n\n }", "protected function isAdmin()\n\t{\n\t\treturn is_admin();\n\t}", "public function isAdmin();", "public static function pageAuth() {\r\n if (isset($_SESSION['username']) && (($_SESSION['authorized'] == 'ADMIN')\r\n OR ($_SESSION['authorized'] == 'SUPERUSER')\r\n OR ($_SESSION['authorized'] == 'MEMBER')))\r\n return true;\r\n else {\r\n exit();\r\n //header('location:index');\r\n }\r\n }", "function visible_to_admin_user()\n\t{\n\t\treturn true;\n\t}", "function HasAdmin()\n {\n return true;\n }", "public static function isAdmin() {\r\n\r\n return Session::get('admin') == 1;\r\n\r\n }", "public static function isAllowed() {\r\n\t\treturn TodoyuAuth::isAdmin();\r\n\t}", "function check_admin()\n{\n global $app;\n\n if (!is_admin()) {\n $app->render('error.html', [\n 'page' => mkPage(getMessageString('error'), 0, 0),\n 'error' => getMessageString('error_no_access')]);\n }\n}", "function has_admin()\n\t{\n\t\treturn false;\n\t}", "public function hasAccess()\n\t{\n\t\t/* Check Permissions */\n\t\treturn \\IPS\\Member::loggedIn()->hasAcpRestriction( 'core', 'members', 'member_edit' );\n\t}", "public function hasAdminRights() {\n return in_array($this['user_type_id'], [3, 7]);\n }", "public function authorize()\n {\n return auth()->user()->ability('admin','update_pages');\n }", "function checkPageAccess($access=NULL, $redirect=FALSE){\n $CI =& get_instance();\n if($CI->config->item($access)){\n if(!in_array(strtolower($_SESSION['rs_user']['username']), $CI->config->item($access))){\n if($redirect){\n redirect('home/dashboard', 'refresh');\n }else{\n return false;\n }\n }else{\n return true;\n }\n }\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Amasty_XmlSitemap::sitemap');\n }", "public function checkAccess()\n {\n // need to be modified for security\n }", "public function getIsAdmin();", "public function getIsAdmin();", "function valid_action() {\n # of pages that are about that page (i.e. not admin\n # or recent changes)\n global $ACT;\n if($ACT == 'show') { return true; }\n if($ACT == 'edit') { return true; }\n if($ACT == 'revisions') { return true; }\n return false;\n }", "protected function isCurrentUserAdmin() {}", "public function isAdmin() {\n return $this->hasPermission('is_admin');\n }", "protected function isCurrentUserAdmin() {}", "public function canAccessDashboard()\n {\n return $this->isAdmin();\n }", "public function is_admin() {\n if($this->is_logged_in() && $this->user_level == 'a') {\n return true;\n } else {\n // $session->message(\"Access denied.\");\n }\n }", "function wpc_client_checking_page_access() {\r\n global $wpc_client;\r\n //block not logged clients\r\n if ( !is_user_logged_in() ) {\r\n //Sorry, you do not have permission to see this page\r\n do_action( 'wp_client_redirect', $wpc_client->get_login_url() );\r\n exit;\r\n }\r\n\r\n\r\n if ( current_user_can( 'wpc_client' ) || current_user_can( 'administrator' ) )\r\n $client_id = get_current_user_id();\r\n else\r\n return false;\r\n\r\n return $client_id;\r\n }", "public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin', 'hrmanager', 'hruser'])) {\n return true;\n } else {\n return false;\n }\n }", "protected function _isAllowed()\n {\n switch ($this->getRequest()->getActionName()) {\n case 'new':\n case 'save':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserSaveVersion();\n break;\n case 'delete':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserDeleteVersion();\n break;\n case 'massDeleteRevisions':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserDeleteRevision();\n break;\n default:\n return Mage::getSingleton('admin/session')->isAllowed('cms/page');\n break;\n }\n }", "function is_admin(){\r\n if (isset($_SESSION['admin']) && $_SESSION['admin']){\r\n return true;\r\n }\r\n return false;\r\n }", "function AdminVisible(){\n if(!LoggedIn()){\n if(isset($_SESSION['level'])){\n if($_SESSION['level'] == 1){\n return 1;\n }\n }\n }\n }", "private function _checkAccessPermitted ()\r\n {\r\n $this->_getPermitedScripts();\r\n if (array_search(basename($_SERVER['PHP_SELF']), $this->_scriptAccess) === false) {\r\n $ip = (getenv('HTTP_X_FORWARDED_FOR') ? getenv('HTTP_X_FORWARDED_FOR') : getenv('REMOTE_ADDR'));\r\n $sql = \"INSERT INTO `_log` (`date`, `activity`, `info`) VALUES ('$date', 'admin_access_not_granted', 'user={$this->_username};IP={$ip};script=\" . basename($_SERVER['PHP_SELF']) . \"')\";\r\n mysql_query($sql, db_c());\r\n \r\n $this->_dispatchError('zoneError');\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "protected function isAllowed()\n {\n return $this->_authorization->isAllowed('Amasty_XmlSitemap::sitemap');\n }", "public function mustbeadmin()\n {\n if (!$this->hasadmin())\n {\n $this->web()->noaccess();\n }\n }", "protected function isAdmin()\n {\n if($_SESSION['statut'] !== 'admin')\n {\n header('Location: index.php?route=front.connectionRegister&access=adminDenied');\n exit;\n }\n }", "function checkPermissionAdmin() {\n\t\tif ($_SESSION['log_admin']!=='1'){\n\t\t\theader('Location: start.php');\n\t\t\tdie();\n\t\t}\n\t}", "function isRestricted() {\t\n\n\t\tif (isset($_SESSION['logged-in']) && $_SESSION['isAdmin']) {\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader(\"Location: restricted.php\");//Instant Re direct to Restricted due to lack of permissions.\n\t\t}\t\t\t\n\t}", "public function checkLoginAdmin() {\n $this->login = User::loginAdmin();\n $type = UserType::read($this->login->get('idUserType'));\n if ($type->get('managesPermissions')!='1') {\n $permissionsCheck = array('listAdmin'=>'permissionListAdmin',\n 'insertView'=>'permissionInsert',\n 'insert'=>'permissionInsert',\n 'insertCheck'=>'permissionInsert',\n 'modifyView'=>'permissionModify',\n 'modifyViewNested'=>'permissionModify',\n 'modify'=>'permissionModify',\n 'multiple-activate'=>'permissionModify',\n 'sortSave'=>'permissionModify',\n 'delete'=>'permissionDelete',\n 'multiple-delete'=>'permissionDelete');\n $permissionCheck = $permissionsCheck[$this->action];\n $permission = Permission::readFirst(array('where'=>'objectName=\"'.$this->type.'\" AND idUserType=\"'.$type->id().'\" AND '.$permissionCheck.'=\"1\"'));\n if ($permission->id()=='') {\n if ($this->mode == 'ajax') {\n return __('permissionsDeny');\n } else { \n header('Location: '.url('NavigationAdmin/permissions', true));\n exit();\n }\n }\n }\n }", "public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}", "private function userHasAccess()\n {\n $required_perm = $this->route['perm'];\n $user_group = $_SESSION['user_group'];\n if ($required_perm == 'all') {\n return true;\n } elseif ($user_group == $required_perm) {\n return true;\n }\n return false;\n }", "public function per_test(){\n if($_SESSION[C('N_ADMIN_AUTH_KEY')]['permission']!=1){\n echo \"<script>alert('你没有权限!');window.location.href='\" . __MODULE__ . \"/Admin/info.html';</script>\";\n exit;\n }\n }", "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 IsAdmin()\n{\n\treturn false;\n}", "protected function hasAccessOnPublished()\n\t{\n\t\treturn $this->User->hasAccess($GLOBALS['TL_DCA'][$this->strTable]['config']['ptable'] . '::published', 'alexf');\t\t\n\t}", "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 function checkPermission()\n\t{\n\t\tif ($this->User->isAdmin) {\n\t\t\treturn;\n\t\t}\n\n\t\t// TODO\n\t}", "public function adminControl()\n {\n $row = $this->currentUserData();\n if(isset($_SESSION['sess_user_type']) &&\n $_SESSION['sess_user_type'] == 'admin' && $row['user_type'] == 'admin'){\n return true;\n }\n }", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}", "public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}" ]
[ "0.7739812", "0.77158576", "0.771327", "0.76987696", "0.7679724", "0.75136405", "0.7492914", "0.7390161", "0.7324825", "0.7235037", "0.7186789", "0.71834195", "0.7183224", "0.71487105", "0.7117662", "0.7090794", "0.70443386", "0.69952166", "0.69917285", "0.69788414", "0.6947257", "0.69388545", "0.6928209", "0.69270456", "0.69199735", "0.69172645", "0.69108176", "0.68849355", "0.68849355", "0.6839593", "0.68369335", "0.68224025", "0.6804043", "0.6800519", "0.679744", "0.679744", "0.67718697", "0.6763104", "0.6762492", "0.6752243", "0.6748451", "0.6730409", "0.67267996", "0.670928", "0.670826", "0.6708245", "0.67041457", "0.66992134", "0.6696015", "0.6696015", "0.6696015", "0.66955906", "0.6693645", "0.669268", "0.66924965", "0.6688537", "0.6683427", "0.6681628", "0.66782844", "0.66780794", "0.6676565", "0.66689265", "0.66648424", "0.6662657", "0.6655955", "0.66528875", "0.6651945", "0.6622209", "0.6611495", "0.6594436", "0.6593383", "0.6593383", "0.65899724", "0.6588949", "0.6585306", "0.65851456", "0.65800816", "0.6578375", "0.65670526", "0.6564831", "0.6564778", "0.65638894", "0.656181", "0.65611184", "0.65595806", "0.65497977", "0.654949", "0.65448093", "0.65441746", "0.6543722", "0.6542283", "0.65421027", "0.6540426", "0.65270215", "0.65231985", "0.65185094", "0.6517203", "0.65168667", "0.65132767", "0.6502198", "0.6502198" ]
0.0
-1
Create a new controller instance.
public function __construct() { $this->middleware('auth'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createController()\n {\n $this->createClass('controller');\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }", "private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}", "protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }", "protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }", "protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }", "public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }", "public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}", "public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}", "public function createController( ezcMvcRequest $request );", "public function createController() {\n //check our requested controller's class file exists and require it if so\n /*if (file_exists(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\")) {\n require(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\");\n } else {\n throw new Exception('Route does not exist');\n }*/\n\n try {\n require_once __DIR__ . '/../Controllers/' . $this->controllerName . '.php';\n } catch (Exception $e) {\n return $e;\n }\n \n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n \n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\",$parents)) { \n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->endpoint)) {\n return new $this->controllerClass($this->args, $this->endpoint, $this->domain);\n } else {\n throw new Exception('Action does not exist');\n }\n } else {\n throw new Exception('Class does not inherit correctly.');\n }\n } else {\n throw new Exception('Controller does not exist.');\n }\n }", "public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}", "private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }", "public function createController( $controllerName ) {\r\n\t\t$refController \t\t= $this->instanceOfController( $controllerName );\r\n\t\t$refConstructor \t= $refController->getConstructor();\r\n\t\tif ( ! $refConstructor ) return $refController->newInstance();\r\n\t\t$initParameter \t\t= $this->setParameter( $refConstructor );\r\n\t\treturn $refController->newInstanceArgs( $initParameter ); \r\n\t}", "public function create($controllerName) {\r\n\t\tif (!$controllerName)\r\n\t\t\t$controllerName = $this->defaultController;\r\n\r\n\t\t$controllerName = ucfirst(strtolower($controllerName)).'Controller';\r\n\t\t$controllerFilename = $this->searchDir.'/'.$controllerName.'.php';\r\n\r\n\t\tif (preg_match('/[^a-zA-Z0-9]/', $controllerName))\r\n\t\t\tthrow new Exception('Invalid controller name', 404);\r\n\r\n\t\tif (!file_exists($controllerFilename)) {\r\n\t\t\tthrow new Exception('Controller not found \"'.$controllerName.'\"', 404);\r\n\t\t}\r\n\r\n\t\trequire_once $controllerFilename;\r\n\r\n\t\tif (!class_exists($controllerName) || !is_subclass_of($controllerName, 'Controller'))\r\n\t\t\tthrow new Exception('Unknown controller \"'.$controllerName.'\"', 404);\r\n\r\n\t\t$this->controller = new $controllerName();\r\n\t\treturn $this;\r\n\t}", "private function createController($controllerName)\n {\n $className = ucfirst($controllerName) . 'Controller';\n ${$this->lcf($controllerName) . 'Controller'} = new $className();\n return ${$this->lcf($controllerName) . 'Controller'};\n }", "public function createControllerObject(string $controller)\n {\n $this->checkControllerExists($controller);\n $controller = $this->ctlrStrSrc.$controller;\n $controller = new $controller();\n return $controller;\n }", "public function create_controller($controller, $action){\n\t $creado = false;\n\t\t$controllers_dir = Kumbia::$active_controllers_dir;\n\t\t$file = strtolower($controller).\"_controller.php\";\n\t\tif(file_exists(\"$controllers_dir/$file\")){\n\t\t\tFlash::error(\"Error: El controlador '$controller' ya existe\\n\");\n\t\t} else {\n\t\t\tif($this->post(\"kind\")==\"applicationcontroller\"){\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends ApplicationController {\\n\\n\\t\\tfunction $action(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tif(@file_put_contents(\"$controllers_dir/$file\", $filec)){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends StandardForm {\\n\\n\\t\\tpublic \\$scaffold = true;\\n\\n\\t\\tpublic function __construct(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tfile_put_contents(\"$controllers_dir/$file\", $filec);\n\t\t\t\tif($this->create_model($controller, $controller, \"index\")){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($creado){\n\t\t\t Flash::success(\"Se cre&oacute; correctamente el controlador '$controller' en '$controllers_dir/$file'\");\n\t\t\t}else {\n\t\t\t Flash::error(\"Error: No se pudo escribir en el directorio, verifique los permisos sobre el directorio\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$this->route_to(\"controller: $controller\", \"action: $action\");\n\t}", "private function instanceController( string $controller_class ): Controller {\n\t\treturn new $controller_class( $this->request, $this->site );\n\t}", "public function makeController($controller_name)\n\t{\n\t\t$model\t= $this->_makeModel($controller_name, $this->_storage_type);\n\t\t$view\t= $this->_makeView($controller_name);\n\t\t\n\t\treturn new $controller_name($model, $view);\n\t}", "public function create()\n {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<info>Controller Create</info>\");\n }", "protected function createDefaultController() {\n Octopus::requireOnce($this->app->getOption('OCTOPUS_DIR') . 'controllers/Default.php');\n return new DefaultController();\n }", "private function createControllerDefinition()\n {\n $id = $this->getServiceId('controller');\n if (!$this->container->has($id)) {\n $definition = new Definition($this->getServiceClass('controller'));\n $definition\n ->addMethodCall('setConfiguration', [new Reference($this->getServiceId('configuration'))])\n ->addMethodCall('setContainer', [new Reference('service_container')])\n ;\n $this->container->setDefinition($id, $definition);\n }\n }", "public function createController( $ctrlName, $action ) {\n $args['action'] = $action;\n $args['path'] = $this->path . '/modules/' . $ctrlName;\n $ctrlFile = $args['path'] . '/Controller.php';\n // $args['moduleName'] = $ctrlName;\n if ( file_exists( $ctrlFile ) ) {\n $ctrlPath = str_replace( CITRUS_PATH, '', $args['path'] );\n $ctrlPath = str_replace( '/', '\\\\', $ctrlPath ) . '\\Controller';\n try { \n $r = new \\ReflectionClass( $ctrlPath ); \n $inst = $r->newInstanceArgs( $args ? $args : array() );\n\n $this->controller = Citrus::apply( $inst, Array( \n 'name' => $ctrlName, \n ) );\n if ( $this->controller->is_protected == null ) {\n $this->controller->is_protected = $this->is_protected;\n }\n return $this->controller;\n } catch ( \\Exception $e ) {\n prr($e, true);\n }\n } else {\n return false;\n }\n }", "protected function createTestController() {\n\t\t$controller = new CController('test');\n\n\t\t$action = $this->getMock('CAction', array('run'), array($controller, 'test'));\n\t\t$controller->action = $action;\n\n\t\tYii::app()->controller = $controller;\n\t\treturn $controller;\n\t}", "public static function newController($controllerName, $params = [], $request = null) {\n\n\t\t$controller = \"App\\\\Controllers\\\\\".$controllerName;\n\n\t\treturn new $controller($params, $request);\n\n\t}", "private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}", "public function createController($pi, array $params)\n {\n $class = $pi . '_Controller_' . ucfirst($params['page']);\n\n return new $class();\n }", "public function createController() {\n //check our requested controller's class file exists and require it if so\n \n if (file_exists(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\" ) && $this->controllerName != 'error') {\n require(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\");\n \n } else {\n \n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n\n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\", $parents)) {\n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->action)) { \n return new $this->controllerClass($this->action, $this->urlValues);\n \n } else {\n //bad action/method error\n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badview\", $this->urlValues);\n }\n } else {\n $this->urlValues['controller'] = \"error\";\n //bad controller error\n echo \"hjh\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"b\", $this->urlValues);\n }\n } else {\n \n //bad controller error\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n }", "protected static function createController($name) {\n $result = null;\n\n $name = self::$_namespace . ($name ? $name : self::$defaultController) . 'Controller';\n if(class_exists($name)) {\n $controllerClass = new \\ReflectionClass($name);\n if($controllerClass->hasMethod('run')) {\n $result = new $name();\n }\n }\n\n return $result;\n }", "public function createController(): void\n {\n $minimum_buffer_min = 3;\n $token_ok = $this->routerService->ds_token_ok($minimum_buffer_min);\n if ($token_ok) {\n # 2. Call the worker method\n # More data validation would be a good idea here\n # Strip anything other than characters listed\n $results = $this->worker($this->args);\n\n if ($results) {\n # Redirect the user to the NDSE view\n # Don't use an iFrame!\n # State can be stored/recovered using the framework's session or a\n # query parameter on the returnUrl\n header('Location: ' . $results[\"redirect_url\"]);\n exit;\n }\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }", "protected function createController($controllerClass)\n {\n $cls = new ReflectionClass($controllerClass);\n return $cls->newInstance($this->environment);\n }", "protected function createController($name)\n {\n $controllerClass = 'controller\\\\'.ucfirst($name).'Controller';\n\n if(!class_exists($controllerClass)) {\n throw new \\Exception('Controller class '.$controllerClass.' not exists!');\n }\n\n return new $controllerClass();\n }", "protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}", "public function makeTestController(TestController $controller)\r\n\t{\r\n\t}", "static function factory($GET=array(), $POST=array(), $FILES=array()) {\n $type = (isset($GET['type'])) ? $GET['type'] : '';\n $objectController = $type.'_Controller';\n $addLocation = $type.'/'.$objectController.'.php';\n foreach ($_ENV['locations'] as $location) {\n if (is_file($location.$addLocation)) {\n return new $objectController($GET, $POST, $FILES);\n } \n }\n throw new Exception('The controller \"'.$type.'\" does not exist.');\n }", "public function create()\n {\n $general = new ModeloController();\n\n return $general->create();\n }", "public function makeController($controllerNamespace, $controllerName, Log $log, $session, Request $request, Response $response)\r\n\t{\r\n\t\t$fullControllerName = '\\\\Application\\\\Controller\\\\' . (!empty($controllerNamespace) ? $controllerNamespace . '\\\\' : '') . $controllerName;\r\n\t\t$controller = new $fullControllerName();\r\n\t\t$controller->setConfig($this->config);\r\n\t\t$controller->setRequest($request);\r\n\t\t$controller->setResponse($response);\r\n\t\t$controller->setLog($log);\r\n\t\tif (isset($session))\r\n\t\t{\r\n\t\t\t$controller->setSession($session);\r\n\t\t}\r\n\r\n\t\t// Execute additional factory method, if available (exists in \\Application\\Controller\\Factory)\r\n\t\t$method = 'make' . $controllerName;\r\n\t\tif (is_callable(array($this, $method)))\r\n\t\t{\r\n\t\t\t$this->$method($controller);\r\n\t\t}\r\n\r\n\t\t// If the controller has an init() method, call it now\r\n\t\tif (is_callable(array($controller, 'init')))\r\n\t\t{\r\n\t\t\t$controller->init();\r\n\t\t}\r\n\r\n\t\treturn $controller;\r\n\t}", "public static function create()\n\t{\n\t\t//check, if an AccessGroupController instance already exists\n\t\tif(AccessGroupController::$accessGroupController == null)\n\t\t{\n\t\t\tAccessGroupController::$accessGroupController = new AccessGroupController();\n\t\t}\n\n\t\treturn AccessGroupController::$accessGroupController;\n\t}", "public static function buildController()\n\t{\n\t\t$file = CONTROLLER_PATH . 'indexController.class.php';\n\n\t\tif(!file_exists($file))\n\t\t{\n\t\t\tif(\\RCPHP\\Util\\Check::isClient())\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \"Welcome RcPHP!\\n\";\n }\n}';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \\'<style type=\"text/css\">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: \"微软雅黑\"; color: #333;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px }</style><div style=\"padding: 24px 48px;\"> <h1>:)</h1><p>Welcome <b>RcPHP</b>!</p></div>\\';\n }\n}';\n\t\t\t}\n\t\t\tfile_put_contents($file, $controller);\n\t\t}\n\t}", "public function getController( );", "public static function getInstance() : Controller {\n if ( null === self::$instance ) {\n self::$instance = new self();\n self::$instance->options = new Options(\n self::OPTIONS_KEY\n );\n }\n\n return self::$instance;\n }", "static function appCreateController($entityName, $prefijo = '') {\n\n $controller = ControllerBuilder::getController($entityName, $prefijo);\n $entityFile = ucfirst(str_replace($prefijo, \"\", $entityName));\n $fileController = \"../../modules/{$entityFile}/{$entityFile}Controller.class.php\";\n\n $result = array();\n $ok = self::createArchive($fileController, $controller);\n ($ok) ? array_push($result, \"Ok, {$fileController} created\") : array_push($result, \"ERROR creating {$fileController}\");\n\n return $result;\n }", "public static function newInstance($path = \\simpleChat\\Utility\\ROOT_PATH)\n {\n $request = new Request();\n \n \n if ($request->isAjax())\n {\n return new AjaxController();\n }\n else if ($request->jsCode())\n {\n return new JsController();\n }\n else\n {\n return new StandardController($path);\n }\n }", "private function createInstance()\n {\n $objectManager = new \\Magento\\Framework\\TestFramework\\Unit\\Helper\\ObjectManager($this);\n $this->controller = $objectManager->getObject(\n \\Magento\\NegotiableQuote\\Controller\\Adminhtml\\Quote\\RemoveFailedSku::class,\n [\n 'context' => $this->context,\n 'logger' => $this->logger,\n 'messageManager' => $this->messageManager,\n 'cart' => $this->cart,\n 'resultRawFactory' => $this->resultRawFactory\n ]\n );\n }", "function loadController(){\n $name = ucfirst($this->request->controller).'Controller' ;\n $file = ROOT.DS.'Controller'.DS.$name.'.php' ;\n /*if(!file_exists($file)){\n $this->error(\"Le controleur \".$this->request->controller.\" n'existe pas\") ;\n }*/\n require_once $file;\n $controller = new $name($this->request);\n return $controller ;\n }", "public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }", "public static function & instance()\n {\n if (self::$instance === null) {\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Include the Controller file\n require Router::$controller_path;\n\n try {\n // Start validation of the controller\n $class = new ReflectionClass(ucfirst(Router::$controller).'_Controller');\n } catch (ReflectionException $e) {\n // Controller does not exist\n Event::run('system.404');\n }\n\n if ($class->isAbstract() or (IN_PRODUCTION and $class->getConstant('ALLOW_PRODUCTION') == false)) {\n // Controller is not allowed to run in production\n Event::run('system.404');\n }\n\n // Run system.pre_controller\n Event::run('system.pre_controller');\n\n // Create a new controller instance\n $controller = $class->newInstance();\n\n // Controller constructor has been executed\n Event::run('system.post_controller_constructor');\n\n try {\n // Load the controller method\n $method = $class->getMethod(Router::$method);\n\n // Method exists\n if (Router::$method[0] === '_') {\n // Do not allow access to hidden methods\n Event::run('system.404');\n }\n\n if ($method->isProtected() or $method->isPrivate()) {\n // Do not attempt to invoke protected methods\n throw new ReflectionException('protected controller method');\n }\n\n // Default arguments\n $arguments = Router::$arguments;\n } catch (ReflectionException $e) {\n // Use __call instead\n $method = $class->getMethod('__call');\n\n // Use arguments in __call format\n $arguments = array(Router::$method, Router::$arguments);\n }\n\n // Stop the controller setup benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Start the controller execution benchmark\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_execution');\n\n // Execute the controller method\n $method->invokeArgs($controller, $arguments);\n\n // Controller method has been executed\n Event::run('system.post_controller');\n\n // Stop the controller execution benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_execution');\n }\n\n return self::$instance;\n }", "protected function instantiateController($class)\n {\n $controller = new $class();\n\n if ($controller instanceof Controller) {\n $controller->setContainer($this->container);\n }\n\n return $controller;\n }", "public function __construct (){\n $this->AdminController = new AdminController();\n $this->ArticleController = new ArticleController();\n $this->AuditoriaController = new AuditoriaController();\n $this->CommentController = new CommentController();\n $this->CourseController = new CourseController();\n $this->InscriptionsController = new InscriptionsController();\n $this->ModuleController = new ModuleController();\n $this->PlanController = new PlanController();\n $this->ProfileController = new ProfileController();\n $this->SpecialtyController = new SpecialtyController();\n $this->SubscriptionController = new SubscriptionController();\n $this->TeacherController = new TeacherController();\n $this->UserController = new UserController();\n $this->WebinarController = new WebinarController();\n }", "protected function makeController($prefix)\n {\n new MakeController($this, $this->files, $prefix);\n }", "public function createController($route)\n {\n $controller = parent::createController('gymv/' . $route);\n return $controller === false\n ? parent::createController($route)\n : $controller;\n }", "public static function createFrontController()\n {\n return self::createInjectorWithBindings(self::extractArgs(func_get_args()))\n ->getInstance('net::stubbles::websites::stubFrontController');\n }", "public static function controller($name)\n {\n $name = ucfirst(strtolower($name));\n \n $directory = 'controller';\n $filename = $name;\n $tracker = 'controller';\n $init = (boolean) $init;\n $namespace = 'controller';\n $class_name = $name;\n \n return self::_load($directory, $filename, $tracker, $init, $namespace, $class_name);\n }", "protected static function instantiateMockController()\n {\n /** @var Event $oEvent */\n $oEvent = Factory::service('Event');\n\n if (!$oEvent->hasBeenTriggered(Events::SYSTEM_STARTING)) {\n\n require_once BASEPATH . 'core/Controller.php';\n\n load_class('Output', 'core');\n load_class('Security', 'core');\n load_class('Input', 'core');\n load_class('Lang', 'core');\n\n new NailsMockController();\n }\n }", "private static function controller()\n {\n $files = ['Controller'];\n $folder = static::$root.'MVC'.'/';\n\n self::call($files, $folder);\n }", "public function createController()\n\t{\n\t\t$originalFile = app_path('Http/Controllers/Reports/SampleReport.php');\n\t\t$newFile = dirname($originalFile) . DIRECTORY_SEPARATOR . $this->class . $this->sufix . '.php';\n\n\t\t// Read original file\n\t\tif( ! $content = file_get_contents($originalFile))\n\t\t\treturn false;\n\n\t\t// Replace class name\n\t\t$content = str_replace('SampleReport', $this->class . $this->sufix, $content);\n\n\t\t// Write new file\n\t\treturn (bool) file_put_contents($newFile, $content);\n\t}", "public function runController() {\n // Check for a router\n if (is_null($this->getRouter())) {\n \t // Set the method to load\n \t $sController = ucwords(\"{$this->getController()}Controller\");\n } else {\n\n // Set the controller with the router\n $sController = ucwords(\"{$this->getController()}\".ucfirst($this->getRouter()).\"Controller\");\n }\n \t// Check for class\n \tif (class_exists($sController, true)) {\n \t\t// Set a new instance of Page\n \t\t$this->setPage(new Page());\n \t\t// The class exists, load it\n \t\t$oController = new $sController();\n\t\t\t\t// Now check for the proper method \n\t\t\t\t// inside of the controller class\n\t\t\t\tif (method_exists($oController, $this->loadConfigVar('systemSettings', 'controllerLoadMethod'))) {\n\t\t\t\t\t// We have a valid controller, \n\t\t\t\t\t// execute the initializer\n\t\t\t\t\t$oController->init($this);\n\t\t\t\t\t// Set the variable scope\n\t \t\t$this->setViewScope($oController);\n\t \t\t// Render the layout\n\t \t\t$this->renderLayout();\n\t\t\t\t} else {\n\t\t\t\t\t// The initializer does not exist, \n\t\t\t\t\t// which means an invalid controller, \n\t\t\t\t\t// so now we let the caller know\n\t\t\t\t\t$this->setError($this->loadConfigVar('errorMessages', 'invalidController'));\n\t\t\t\t\t// Run the error\n\t\t\t\t\t// $this->runError();\n\t\t\t\t}\n \t// The class does not exist\n \t} else {\n\t\t\t\t// Set the system error\n\t \t\t$this->setError(\n\t\t\t\t\tstr_replace(\n\t\t\t\t\t\t':controllerName', \n\t\t\t\t\t\t$sController, \n\t\t\t\t\t\t$this->loadConfigVar(\n\t\t\t\t\t\t\t'errorMessages', \n\t\t\t\t\t\t\t'controllerDoesNotExist'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n \t\t// Run the error\n\t\t\t\t// $this->runError();\n \t}\n \t// Return instance\n \treturn $this;\n }", "public function controller()\n\t{\n\t\n\t}", "protected function buildController()\n {\n $columns = collect($this->columns)->pluck('column')->implode('|');\n\n $permissions = [\n 'create:'.$this->module->createPermission->name,\n 'edit:'.$this->module->editPermission->name,\n 'delete:'.$this->module->deletePermission->name,\n ];\n\n $this->controller = [\n 'name' => $this->class,\n '--model' => $this->class,\n '--request' => $this->class.'Request',\n '--permissions' => implode('|', $permissions),\n '--view-folder' => snake_case($this->module->name),\n '--fields' => $columns,\n '--module' => $this->module->id,\n ];\n }", "function getController(){\n\treturn getFactory()->getBean( 'Controller' );\n}", "protected function getController()\n {\n $uri = WingedLib::clearPath(static::$parentUri);\n if (!$uri) {\n $uri = './';\n $explodedUri = ['index', 'index'];\n } else {\n $explodedUri = explode('/', $uri);\n if (count($explodedUri) == 1) {\n $uri = './' . $explodedUri[0] . '/';\n } else {\n $uri = './' . $explodedUri[0] . '/' . $explodedUri[1] . '/';\n }\n }\n\n $indexUri = WingedLib::clearPath(\\WingedConfig::$config->INDEX_ALIAS_URI);\n if ($indexUri) {\n $indexUri = explode('/', $indexUri);\n }\n\n if ($indexUri) {\n if ($explodedUri[0] === 'index' && isset($indexUri[0])) {\n static::$controllerName = Formater::camelCaseClass($indexUri[0]) . 'Controller';\n $uri = './' . $indexUri[0] . '/';\n }\n if (isset($explodedUri[1]) && isset($indexUri[1])) {\n if ($explodedUri[1] === 'index') {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($indexUri[1]);\n $uri .= $indexUri[1] . '/';\n }\n } else {\n $uri .= 'index/';\n }\n }\n\n $controllerDirectory = new Directory(static::$parent . 'controllers/', false);\n if ($controllerDirectory->exists()) {\n $controllerFile = new File($controllerDirectory->folder . static::$controllerName . '.php', false);\n if ($controllerFile->exists()) {\n include_once $controllerFile->file_path;\n if (class_exists(static::$controllerName)) {\n $controller = new static::$controllerName();\n if (method_exists($controller, static::$controllerAction)) {\n try {\n $reflectionMethod = new \\ReflectionMethod(static::$controllerName, static::$controllerAction);\n $pararms = [];\n foreach ($reflectionMethod->getParameters() as $parameter) {\n $pararms[$parameter->getName()] = $parameter->isOptional();\n }\n } catch (\\Exception $exception) {\n $pararms = [];\n }\n return [\n 'uri' => $uri,\n 'params' => $pararms,\n ];\n }\n }\n }\n }\n return false;\n }", "public function __construct()\n {\n $this->controller = new DHTController();\n }", "public function createController($controllers) {\n\t\tforeach($controllers as $module=>$controllers) {\n\t\t\tforeach($controllers as $key=>$controller) {\n\t\t\t\tif(!file_exists(APPLICATION_PATH.\"/modules/$module/controllers/\".ucfirst($controller).\"Controller.php\")) {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",\"Create '\".ucfirst($controller).\"' controller in $module\");\t\t\t\t\n\t\t\t\t\texec(\"zf create controller $controller index-action-included=0 $module\");\t\t\t\t\t\n\t\t\t\t}\telse {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",ucfirst($controller).\"' controller in $module already exists\");\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}", "protected function instantiateController($class)\n {\n return new $class($this->routesMaker);\n }", "private function createController($table){\n\n // Filtering file name\n $fileName = $this::cleanToName($table[\"name\"]) . 'Controller.php';\n\n // Prepare the Class scheme inside the controller\n $contents = '<?php '.$fileName.' ?>';\n\n\n // Return a boolean to process completed\n return Storage::disk('controllers')->put($this->appNamePath.'/'.$fileName, $contents);\n\n }", "public function GetController()\n\t{\n\t\t$params = $this->QueryVarArrayToParameterArray($_GET);\n\t\tif (!empty($_POST)) {\n\t\t\t$params = array_merge($params, $this->QueryVarArrayToParameterArray($_POST));\n\t\t}\n\n\t\tif (!empty($_GET['q'])) {\n\t\t\t$restparams = GitPHP_Router::ReadCleanUrl($_SERVER['REQUEST_URI']);\n\t\t\tif (count($restparams) > 0)\n\t\t\t\t$params = array_merge($params, $restparams);\n\t\t}\n\n\t\t$controller = null;\n\n\t\t$action = null;\n\t\tif (!empty($params['action']))\n\t\t\t$action = $params['action'];\n\n\t\tswitch ($action) {\n\n\n\t\t\tcase 'search':\n\t\t\t\t$controller = new GitPHP_Controller_Search();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commitdiff':\n\t\t\tcase 'commitdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Commitdiff();\n\t\t\t\tif ($action === 'commitdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blobdiff':\n\t\t\tcase 'blobdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Blobdiff();\n\t\t\t\tif ($action === 'blobdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'history':\n\t\t\t\t$controller = new GitPHP_Controller_History();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'shortlog':\n\t\t\tcase 'log':\n\t\t\t\t$controller = new GitPHP_Controller_Log();\n\t\t\t\tif ($action === 'shortlog')\n\t\t\t\t\t$controller->SetParam('short', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'snapshot':\n\t\t\t\t$controller = new GitPHP_Controller_Snapshot();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tree':\n\t\t\tcase 'trees':\n\t\t\t\t$controller = new GitPHP_Controller_Tree();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tags':\n\t\t\t\tif (empty($params['tag'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Tags();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'tag':\n\t\t\t\t$controller = new GitPHP_Controller_Tag();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'heads':\n\t\t\t\t$controller = new GitPHP_Controller_Heads();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blame':\n\t\t\t\t$controller = new GitPHP_Controller_Blame();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blob':\n\t\t\tcase 'blobs':\n\t\t\tcase 'blob_plain':\t\n\t\t\t\t$controller = new GitPHP_Controller_Blob();\n\t\t\t\tif ($action === 'blob_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'atom':\n\t\t\tcase 'rss':\n\t\t\t\t$controller = new GitPHP_Controller_Feed();\n\t\t\t\tif ($action == 'rss')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::RssFormat);\n\t\t\t\telse if ($action == 'atom')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::AtomFormat);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commit':\n\t\t\tcase 'commits':\n\t\t\t\t$controller = new GitPHP_Controller_Commit();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'summary':\n\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'project_index':\n\t\t\tcase 'projectindex':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('txt', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'opml':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('opml', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'login':\n\t\t\t\t$controller = new GitPHP_Controller_Login();\n\t\t\t\tif (!empty($_POST['username']))\n\t\t\t\t\t$controller->SetParam('username', $_POST['username']);\n\t\t\t\tif (!empty($_POST['password']))\n\t\t\t\t\t$controller->SetParam('password', $_POST['password']);\n\t\t\t\tbreak;\n\n\t\t\tcase 'logout':\n\t\t\t\t$controller = new GitPHP_Controller_Logout();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'graph':\n\t\t\tcase 'graphs':\n\t\t\t\t//$controller = new GitPHP_Controller_Graph();\n\t\t\t\t//break;\n\t\t\tcase 'graphdata':\n\t\t\t\t//$controller = new GitPHP_Controller_GraphData();\n\t\t\t\t//break;\n\t\t\tdefault:\n\t\t\t\tif (!empty($params['project'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\t} else {\n\t\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t}\n\t\t}\n\n\t\tforeach ($params as $paramname => $paramval) {\n\t\t\tif ($paramname !== 'action')\n\t\t\t\t$controller->SetParam($paramname, $paramval);\n\t\t}\n\n\t\t$controller->SetRouter($this);\n\n\t\treturn $controller;\n\t}", "public function testCreateTheControllerClass()\n {\n $controller = new Game21Controller();\n $this->assertInstanceOf(\"\\App\\Http\\Controllers\\Game21Controller\", $controller);\n }", "public static function createController( MShop_Context_Item_Interface $context, $name = null );", "public function __construct()\n {\n\n $url = $this->splitURL();\n // echo $url[0];\n\n // check class file exists\n if (file_exists(\"../app/controllers/\" . strtolower($url[0]) . \".php\")) {\n $this->controller = strtolower($url[0]);\n unset($url[0]);\n }\n\n // echo $this->controller;\n\n require \"../app/controllers/\" . $this->controller . \".php\";\n\n // create Instance(object)\n $this->controller = new $this->controller(); // $this->controller is an object from now on\n if (isset($url[1])) {\n if (method_exists($this->controller, $url[1])) {\n $this->method = $url[1];\n unset($url[1]);\n }\n }\n\n // run the class and method\n $this->params = array_values($url); // array_values 값들인 인자 0 부터 다시 배치\n call_user_func_array([$this->controller, $this->method], $this->params);\n }", "public function getController();", "public function getController();", "public function getController();", "public function createController($pageType, $template)\n {\n $controller = null;\n\n // Use factories first\n if (isset($this->controllerFactories[$pageType])) {\n $callable = $this->controllerFactories[$pageType];\n $controller = $callable($this, 'templates/'.$template);\n\n if ($controller) {\n return $controller;\n }\n }\n\n // See if a default controller exists in the theme namespace\n $class = null;\n if ($pageType == 'posts') {\n $class = $this->namespace.'\\\\Controllers\\\\PostsController';\n } elseif ($pageType == 'post') {\n $class = $this->namespace.'\\\\Controllers\\\\PostController';\n } elseif ($pageType == 'page') {\n $class = $this->namespace.'\\\\Controllers\\\\PageController';\n } elseif ($pageType == 'term') {\n $class = $this->namespace.'\\\\Controllers\\\\TermController';\n }\n\n if (class_exists($class)) {\n $controller = new $class($this, 'templates/'.$template);\n\n return $controller;\n }\n\n // Create a default controller from the stem namespace\n if ($pageType == 'posts') {\n $controller = new PostsController($this, 'templates/'.$template);\n } elseif ($pageType == 'post') {\n $controller = new PostController($this, 'templates/'.$template);\n } elseif ($pageType == 'page') {\n $controller = new PageController($this, 'templates/'.$template);\n } elseif ($pageType == 'search') {\n $controller = new SearchController($this, 'templates/'.$template);\n } elseif ($pageType == 'term') {\n $controller = new TermController($this, 'templates/'.$template);\n }\n\n return $controller;\n }", "private function loadController($controller)\r\n {\r\n $className = $controller.'Controller';\r\n \r\n $class = new $className($this);\r\n \r\n $class->init();\r\n \r\n return $class;\r\n }", "public static function newInstance ($class)\n {\n try\n {\n // the class exists\n $object = new $class();\n\n if (!($object instanceof sfController))\n {\n // the class name is of the wrong type\n $error = 'Class \"%s\" is not of the type sfController';\n $error = sprintf($error, $class);\n\n throw new sfFactoryException($error);\n }\n\n return $object;\n }\n catch (sfException $e)\n {\n $e->printStackTrace();\n }\n }", "public function create()\n {\n //TODO frontEndDeveloper \n //load admin.classes.create view\n\n\n return view('admin.classes.create');\n }", "private function generateControllerClass()\n {\n $dir = $this->bundle->getPath();\n\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $target = sprintf(\n '%s/Controller/%s/%sController.php',\n $dir,\n str_replace('\\\\', '/', $entityNamespace),\n $entityClass\n );\n\n if (file_exists($target)) {\n throw new \\RuntimeException('Unable to generate the controller as it already exists.');\n }\n\n $this->renderFile($this->skeletonDir, 'controller.php', $target, array(\n 'actions' => $this->actions,\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'dir' => $this->skeletonDir,\n 'bundle' => $this->bundle->getName(),\n 'entity' => $this->entity,\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'format' => $this->format,\n ));\n }", "static public function Instance()\t\t// Static so we use classname itself to create object i.e. Controller::Instance()\r\n {\r\n // Only one object of this class is required\r\n // so we only create if it hasn't already\r\n // been created.\r\n if(!isset(self::$_instance))\r\n {\r\n self::$_instance = new self();\t// Make new instance of the Controler class\r\n self::$_instance->_commandResolver = new CommandResolver();\r\n\r\n ApplicationController::LoadViewMap();\r\n }\r\n return self::$_instance;\r\n }", "private function create_mock_controller() {\n eval('class TestController extends cyclone\\request\\SkeletonController {\n function before() {\n DispatcherTest::$beforeCalled = TRUE;\n DispatcherTest::$route = $this->_request->route;\n }\n\n function after() {\n DispatcherTest::$afterCalled = TRUE;\n }\n\n function action_act() {\n DispatcherTest::$actionCalled = TRUE;\n }\n}');\n }", "public function AController() {\r\n\t}", "protected function initializeController() {}", "public function dispatch()\n { \n $controller = $this->formatController();\n $controller = new $controller($this);\n if (!$controller instanceof ControllerAbstract) {\n throw new Exception(\n 'Class ' . get_class($controller) . ' is not a valid controller instance. Controller classes must '\n . 'derive from \\Europa\\ControllerAbstract.'\n );\n }\n $controller->action();\n return $controller;\n }", "public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }", "private function addController($controller)\n {\n $object = new $controller($this->app);\n $this->controllers[$controller] = $object;\n }", "function Controller($ControllerName = Web\\Application\\DefaultController) {\n return Application()->Controller($ControllerName);\n }", "public function getController($controllerName) {\r\n\t\tif(!isset(self::$instances[$controllerName])) {\r\n\t\t $package = $this->getPackage(Nomenclature::getVendorAndPackage($controllerName));\r\n\t\t if(!$package) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t return $controller;\r\n\t\t //return false;\r\n\t\t }\r\n\r\n\t\t if(!$package || !$package->controllerExists($controllerName)) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t $package->addController($controller);\r\n\t\t } else {\r\n\t\t $controller = $package->getController($controllerName);\r\n\t\t }\r\n\t\t} else {\r\n\t\t $controller = self::$instances[$controllerName];\r\n\t\t}\r\n\t\treturn $controller;\r\n\t}", "public function testInstantiateSessionController()\n {\n $controller = new SessionController();\n\n $this->assertInstanceOf(\"App\\Http\\Controllers\\SessionController\", $controller);\n }", "private static function loadController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t$app_controller = file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t$lib_controller = file_exists(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\n\t\tif ( $app_controller || $lib_controller ) {\n\t\t\tif ($app_controller) {\n\t\t\t\trequire_once(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\t\telse {\n\t\t\t\trequire_once(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\n\t\t\t$controller = new $str();\n\t\t\t\n\t\t\tif (!$controller instanceof Controller) {\n\t\t\t\tthrow new IsNotControllerException();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $controller;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new ControllerNotExistsException($str);\n\t\t}\n\t}", "public function __construct()\n {\n // and $url[1] is a controller method\n if ($_GET['url'] == NULL) {\n $url = explode('/', env('defaultRoute'));\n } else {\n $url = explode('/', rtrim($_GET['url'],'/'));\n }\n\n $file = 'controllers/' . $url[0] . '.php';\n if (file_exists($file)) {\n require $file;\n $controller = new $url[0];\n\n if (isset($url[1])) {\n $controller->{$url[1]}();\n }\n } else {\n echo \"404 not found\";\n }\n }", "protected function _controllers()\n {\n $this['watchController'] = $this->factory(static function ($c) {\n return new Controller\\WatchController($c['app'], $c['searcher']);\n });\n\n $this['runController'] = $this->factory(static function ($c) {\n return new Controller\\RunController($c['app'], $c['searcher']);\n });\n\n $this['customController'] = $this->factory(static function ($c) {\n return new Controller\\CustomController($c['app'], $c['searcher']);\n });\n\n $this['waterfallController'] = $this->factory(static function ($c) {\n return new Controller\\WaterfallController($c['app'], $c['searcher']);\n });\n\n $this['importController'] = $this->factory(static function ($c) {\n return new Controller\\ImportController($c['app'], $c['saver'], $c['config']['upload.token']);\n });\n\n $this['metricsController'] = $this->factory(static function ($c) {\n return new Controller\\MetricsController($c['app'], $c['searcher']);\n });\n }", "public function __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }", "public function controller ($post = array())\n\t{\n\n\t\t$name = $post['controller_name'];\n\n\t\tif (is_file(APPPATH.'controllers/'.$name.'.php')) {\n\n\t\t\t$message = sprintf(lang('Controller_s_is_existed'), APPPATH.'controllers/'.$name.'.php');\n\n\t\t\t$this->msg[] = $message;\n\n\t\t\treturn $this->result(false, $this->msg[0]);\n\n\t\t}\n\n\t\t$extends = null;\n\n\t\tif (isset($post['crud'])) {\n\n\t\t\t$crud = true;\n\t\t\t\n\t\t}\n\t\telse{\n\n\t\t\t$crud = false;\n\n\t\t}\n\n\t\t$file = $this->_create_folders_from_name($name, 'controllers');\n\n\t\t$data = '';\n\n\t\t$data .= $this->_class_open($file['file'], __METHOD__, $extends);\n\n\t\t$crud === FALSE || $data .= $this->_crud_methods_contraller($post);\n\n\t\t$data .= $this->_class_close();\n\n\t\t$path = APPPATH . 'controllers/' . $file['path'] . strtolower($file['file']) . '.php';\n\n\t\twrite_file($path, $data);\n\n\t\t$this->msg[] = sprintf(lang('Created_controller_s'), $path);\n\n\t\t//echo $this->_messages();\n\t\treturn $this->result(true, $this->msg[0]);\n\n\t}", "protected function getController(Request $request) {\n try {\n $controller = $this->objectFactory->create($request->getControllerName(), self::INTERFACE_CONTROLLER);\n } catch (ZiboException $exception) {\n throw new ZiboException('Could not create controller ' . $request->getControllerName(), 0, $exception);\n }\n\n return $controller;\n }", "public function create() {}", "public function __construct()\n {\n $this->dataController = new DataController;\n }", "function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}", "public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }", "private function setUpController()\n {\n $this->controller = new TestObject(new SharedControllerTestController);\n\n $this->controller->dbal = DBAL::getDBAL('testDB', $this->getDBH());\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }" ]
[ "0.82668066", "0.8173394", "0.78115296", "0.77052677", "0.7681875", "0.7659338", "0.74860525", "0.74064577", "0.7297601", "0.7252339", "0.7195181", "0.7174191", "0.70150065", "0.6989306", "0.69835985", "0.69732994", "0.6963521", "0.6935819", "0.68973273", "0.68920785", "0.6877748", "0.68702674", "0.68622285", "0.6839049", "0.6779292", "0.6703522", "0.66688496", "0.66600126", "0.6650373", "0.66436416", "0.6615505", "0.66144013", "0.6588728", "0.64483404", "0.64439476", "0.6429303", "0.6426485", "0.6303757", "0.6298291", "0.6293319", "0.62811387", "0.6258778", "0.62542456", "0.616827", "0.6162314", "0.61610043", "0.6139887", "0.613725", "0.61334985", "0.6132223", "0.6128982", "0.61092585", "0.6094611", "0.60889256", "0.6074893", "0.60660255", "0.6059098", "0.60565156", "0.6044235", "0.60288006", "0.6024102", "0.60225666", "0.6018304", "0.60134345", "0.60124683", "0.6010913", "0.6009284", "0.6001683", "0.5997471", "0.5997012", "0.59942573", "0.5985074", "0.5985074", "0.5985074", "0.5967613", "0.5952533", "0.5949068", "0.5942203", "0.5925731", "0.5914304", "0.5914013", "0.59119135", "0.5910308", "0.5910285", "0.59013796", "0.59003943", "0.5897524", "0.58964556", "0.58952993", "0.58918965", "0.5888943", "0.5875413", "0.5869938", "0.58627135", "0.58594996", "0.5853714", "0.5839484", "0.5832913", "0.582425", "0.58161044", "0.5815566" ]
0.0
-1
Show the application dashboard.
public function dashboard() { $Topic = Topic::count(); $TopicVideo = TopicVideo::count(); $TopicDocument = TopicDocument::count(); $PaidUser = User::where('is_admin',0)->where('is_paid',1)->where('is_new_register',1)->count(); $FreeUser = User::where('is_admin',0)->where('is_paid',0)->where('is_new_register',1)->count(); $RecentComment = Comment::limit(5)->orderBy('created_at','DESC')->get(); return view('Admin.dashboard',compact('Topic','TopicVideo','TopicDocument','RecentComment','PaidUser','FreeUser')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function dashboard()\n {\n\n $pageData = (new DashboardService())->handleDashboardLandingPage();\n\n return view('application', $pageData);\n }", "function dashboard() {\r\n\t\t\tTrackTheBookView::render('dashboard');\r\n\t\t}", "public function showDashboard() { \n\t\n return View('admin.dashboard');\n\t\t\t\n }", "public function showDashboard()\n {\n return View::make('users.dashboard', [\n 'user' => Sentry::getUser(),\n ]);\n }", "public function dashboard()\n {\n return view('backend.dashboard.index');\n }", "public function index() {\n return view(\"admin.dashboard\");\n }", "public function dashboard()\n {\n return $this->renderContent(\n view('dashboard'),\n trans('sleeping_owl::lang.dashboard')\n );\n }", "public function dashboard(){\n return view('backend.admin.index');\n }", "public function showDashBoard()\n {\n \treturn view('Admins.AdminDashBoard');\n }", "public function dashboard()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('admin.dashboard', ['title' => 'Dashboard']);\n }", "public function dashboard() \r\n {\r\n return view('admin.index');\r\n }", "public function dashboard()\n\t{\n\t\t$page_title = 'organizer dashboard';\n\t\treturn View::make('organizer.dashboard',compact('page_title'));\n\t}", "public function dashboard()\n {\n\t\t$traffic = TrafficService::getTraffic();\n\t\t$devices = TrafficService::getDevices();\n\t\t$browsers = TrafficService::getBrowsers();\n\t\t$status = OrderService::getStatus();\n\t\t$orders = OrderService::getOrder();\n\t\t$users = UserService::getTotal();\n\t\t$products = ProductService::getProducts();\n\t\t$views = ProductService::getViewed();\n\t\t$total_view = ProductService::getTotalView();\n\t\t$cashbook = CashbookService::getAccount();\n $stock = StockService::getStock();\n\n return view('backend.dashboard', compact('traffic', 'devices', 'browsers', 'status', 'orders', 'users', 'products', 'views', 'total_view', 'cashbook', 'stock'));\n }", "public function dashboard()\n {\n\n return view('admin.dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function dashboard()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('adm.dashboard');\n }", "public function dashboard()\n {\n $users = \\App\\User::all()->count();\n $roles = \\Spatie\\Permission\\Models\\Role::all()->count();\n $permissions = \\Spatie\\Permission\\Models\\Permission::all()->count();\n $banner = \\App\\Banner::all();\n $categoria = \\App\\Categoria::all();\n $entidadOrganizativa = \\App\\Entidadorganizativa::all();\n $evento = \\App\\Evento::all();\n $fichero = \\App\\Fichero::all();\n $recurso = \\App\\Recurso::all();\n $redsocial = \\App\\Redsocial::all();\n $subcategoria = \\App\\Subcategoria::all();\n $tag = \\App\\Tag::all();\n\n $entities = \\Amranidev\\ScaffoldInterface\\Models\\Scaffoldinterface::all();\n\n return view('scaffold-interface.dashboard.dashboard',\n compact('users', 'roles', 'permissions', 'entities',\n 'banner', 'categoria', 'entidadOrganizativa',\n 'evento', 'fichero', 'recurso', 'redsocial', 'subcategoria', 'tag')\n );\n }", "public function show()\n {\n return view('dashboard');\n }", "public function index()\n\t{\n\t\treturn View::make('dashboard');\n\t}", "public function index() {\n return view('modules.home.dashboard');\n }", "public function show()\n {\n return view('dashboard.dashboard');\n \n }", "public function index()\n {\n return view('admin.dashboard.dashboard');\n\n }", "public function dashboard()\n { \n return view('jobposter.dashboard');\n }", "public function show()\n\t{\n\t\t//\n\t\t$apps = \\App\\application::all();\n\t\treturn view('applications.view', compact('apps'));\n\t}", "public function index()\n {\n return view('pages.admin.dashboard');\n }", "public function indexAction()\n {\n $dashboard = $this->getDashboard();\n\n return $this->render('ESNDashboardBundle::index.html.twig', array(\n 'title' => \"Dashboard\"\n ));\n }", "public function index()\n {\n //\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('admin.dashboard.index');\n }", "public function dashboard()\n {\n return view('pages.backsite.dashboard');\n }", "public function index()\n {\n // return component view('dashboard.index');\n return view('layouts.admin_master');\n }", "public function index()\n {\n\n $no_of_apps = UploadApp::count();\n $no_of_analysis_done = UploadApp::where('isAnalyzed', '1')->count();\n $no_of_visible_apps = AnalysisResult::where('isVisible', '1')->count();\n\n return view('admin.dashboard', compact('no_of_apps', 'no_of_analysis_done', 'no_of_visible_apps'));\n }", "public function getDashboard() {\n return view('admin.dashboard');\n }", "public function index()\n {\n return view('smartcrud.auth.dashboard');\n }", "public function index()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n $this->global['pageTitle'] = 'Touba : Dashboard';\n \n $this->loadViews(\"dashboard\", $this->global, NULL , NULL);\n }", "public function dashboard() {\n $data = ['title' => 'Dashboard'];\n return view('pages.admin.dashboard', $data)->with([\n 'users' => $this->users,\n 'num_services' => Service::count(),\n 'num_products' => Product::count(),\n ]);\n }", "public function index()\n {\n return view('board.pages.dashboard-board');\n }", "public function index()\n {\n return view('admin::settings.development.dashboard');\n }", "public function index()\n {\n return view('dashboard.dashboard');\n }", "public function show()\n {\n return view('dashboard::show');\n }", "public function adminDash()\n {\n return Inertia::render(\n 'Admin/AdminDashboard', \n [\n 'data' => ['judul' => 'Halaman Admin']\n ]\n );\n }", "public function dashboard()\n {\n return view('Admin.dashboard');\n }", "public function show()\n {\n return view('admins\\auth\\dashboard');\n }", "public function index()\n {\n // Report =============\n\n return view('Admin.dashboard');\n }", "public function index()\n {\n return view('bitaac::account.dashboard');\n }", "public function index()\n { \n return view('admin-views.dashboard');\n }", "public function getDashboard()\n {\n return view('dashboard');\n }", "function showDashboard()\n { \n $logeado = $this->checkCredentials();\n if ($logeado==true)\n $this->view->ShowDashboard();\n else\n $this->view->showLogin();\n }", "public function index()\n { \n $params['crumbs'] = 'Home';\n $params['active'] = 'home';\n \n return view('admin.dashboard.index', $params);\n }", "public function index()\n\t{\n\t\treturn view::make('customer_panel.dashboard');\n\t}", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index()\n {\n return view('dashboard');\n }", "public function index() {\n // return view('home');\n return view('admin-layouts.dashboard.dashboard');\n }", "public function index()\r\n {\r\n return view('user.dashboard');\r\n }", "public function index() {\n return view('dashboard', []);\n }", "public function index()\n {\n //\n return view('dashboard.dashadmin', ['page' => 'mapel']);\n }", "public function index()\n {\n return view('back-end.dashboard.index');\n //\n }", "public function index()\n\t{\n\t\t\n\t\t$data = array(\n\t\t\t'title' => 'Administrator Apps With Laravel',\n\t\t);\n\n\t\treturn View::make('panel/index',$data);\n\t}", "public function index() {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('page.dashboard.index');\n }", "public function index()\n {\n\n return view('dashboard');\n }", "public function dashboardview() {\n \n $this->load->model('Getter');\n $data['dashboard_content'] = $this->Getter->get_dash_content();\n \n $this->load->view('dashboardView', $data);\n\n }", "public function index()\n {\n $this->authorize(DashboardPolicy::PERMISSION_STATS);\n\n $this->setTitle($title = trans('auth::dashboard.titles.statistics'));\n $this->addBreadcrumb($title);\n\n return $this->view('admin.dashboard');\n }", "public function action_index()\r\n\t{\t\t\t\t\r\n\t\t$this->template->title = \"Dashboard\";\r\n\t\t$this->template->content = View::forge('admin/dashboard');\r\n\t}", "public function index()\n {\n $info = SiteInfo::limit(1)->first();\n return view('backend.info.dashboard',compact('info'));\n }", "public function display()\n\t{\n\t\t// Set a default view if none exists.\n\t\tif (!JRequest::getCmd( 'view' ) ) {\n\t\t\tJRequest::setVar( 'view', 'dashboard' );\n\t\t}\n\n\t\tparent::display();\n\t}", "public function index()\n {\n $news = News::all();\n $posts = Post::all();\n $events = Event::all();\n $resources = Resources::all();\n $admin = Admin::orderBy('id', 'desc')->get();\n return view('Backend/dashboard', compact('admin', 'news', 'posts', 'events', 'resources'));\n }", "public function index()\n {\n\n return view('superAdmin.adminDashboard')->with('admin',Admininfo::all());\n\n }", "public function index()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n return view('dashboard.index');\n }", "public function index()\n {\n $this->template->set('title', 'Dashboard');\n $this->template->load('admin', 'contents' , 'admin/dashboard/index', array());\n }", "public function index()\n {\n return view('/dashboard');\n }", "public function index()\n {\n \treturn view('dashboard');\n }", "public function index()\n {\n return view('ketua.ketua-dashboard');\n }", "public function index(){\n return View::make('admin.authenticated.dashboardview');\n }", "public function admAmwDashboard()\n {\n return View::make('admission::amw.admission_test.dashboard');\n }", "public function index()\n {\n return view('adminpanel.home');\n }", "public function dashboard()\n\t{\n\t\t$this->validation_access();\n\t\t\n\t\t$this->load->view('user_dashboard/templates/header');\n\t\t$this->load->view('user_dashboard/index.php');\n\t\t$this->load->view('user_dashboard/templates/footer');\n\t}", "public function index()\n {\n return view('dashboard.home');\n }", "public function index()\n {\n $admins = $this->adminServ->all();\n $adminRoles = $this->adminTypeServ->all();\n return view('admin.administrators.dashboard', compact('admins', 'adminRoles'));\n }", "public function index()\n {\n if (ajaxCall::ajax()) {return response()->json($this -> dashboard);}\n //return response()->json($this -> dashboard);\n JavaScript::put($this -> dashboard);\n return view('app')-> with('header' , $this -> dashboard['header']);\n //return view('home');\n }", "public function index()\n {\n $userinfo=User::all();\n $gateinfo=GateEntry::all();\n $yarninfo=YarnStore::all();\n $greyinfo=GreyFabric::all();\n $finishinfo=FinishFabric::all();\n $dyesinfo=DyeChemical::all();\n return view('dashboard',compact('userinfo','gateinfo','yarninfo','greyinfo','finishinfo','dyesinfo'));\n }", "public function actionDashboard(){\n \t$dados_dashboard = Yii::app()->user->getState('dados_dashbord_final');\n \t$this->render ( 'dashboard', $dados_dashboard);\n }", "public function index()\n {\n $user = new User();\n $book = new Book();\n return view('admin.dashboard', compact('user', 'book'));\n }", "public function dashboard() {\n if (!Auth::check()) { // Check is user logged in\n // redirect to dashboard\n return Redirect::to('login');\n }\n\n $user = Auth::user();\n return view('site.dashboard', compact('user'));\n }", "public function dashboard()\n {\n $users = User::all();\n return view('/dashboard', compact('users'));\n }", "public function index()\n {\n $lineChart = $this->getLineChart();\n $barChart = $this->getBarChart();\n $pieChart = $this->getPieChart();\n\n return view('admin.dashboard.index', compact(['lineChart', 'barChart', 'pieChart']));\n }" ]
[ "0.77850926", "0.7760142", "0.7561336", "0.75147176", "0.74653697", "0.7464913", "0.73652893", "0.7351646", "0.7346477", "0.73420244", "0.7326711", "0.7316215", "0.73072463", "0.7287626", "0.72826403", "0.727347", "0.727347", "0.727347", "0.727347", "0.7251768", "0.7251768", "0.7251768", "0.7251768", "0.7251768", "0.7241342", "0.7236133", "0.7235562", "0.7218318", "0.71989936", "0.7197427", "0.71913266", "0.71790016", "0.71684825", "0.71577966", "0.7146797", "0.7133428", "0.7132746", "0.71298903", "0.71249074", "0.71218014", "0.71170413", "0.7110151", "0.7109032", "0.7107029", "0.70974076", "0.708061", "0.7075653", "0.70751685", "0.7064041", "0.70550334", "0.7053102", "0.7051273", "0.70484304", "0.7043605", "0.70393986", "0.70197886", "0.70185125", "0.70139873", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.700917", "0.6992477", "0.6979631", "0.69741416", "0.69741327", "0.6968815", "0.6968294", "0.69677526", "0.69652885", "0.69586027", "0.6944985", "0.69432825", "0.69419175", "0.6941512", "0.6941439", "0.6938837", "0.6937524", "0.6937456", "0.6937456", "0.69276494", "0.6921651", "0.69074917", "0.69020325", "0.6882262", "0.6869339", "0.6867868", "0.68557185", "0.68479055", "0.684518", "0.68408877", "0.6838798", "0.6833479", "0.6832326", "0.68309164", "0.6826798", "0.6812457" ]
0.0
-1
A setter method called when a form is submitted
public function setInfoAttribute($info) { $this->attributes['info'] = serialize($info); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function valiteForm();", "public function\tsetSubmittedValue($submittedValue);", "public function afterSubmit() {\n\t\t$this->setValue($this->serializeData($this->getValue()));\n\t}", "protected function setSubmittedValues()\n {\n if ( $this->setFundraiserId() ) {\n $this->setFundraiserProfile(); \n }\n\n $this->setAmount();\n \n $this->setFirstName();\n $this->setLastName();\n $this->setEmail();\n $this->setTelephone();\n \n $this->setAddress();\n $this->setCity();\n $this->setCountry();\n $this->setRegion();\n $this->setPostalCode();\n \n $this->setAnonymity();\n $this->setHideAmount();\n }", "protected function OnSubmit()\n {\n //tu codigo aqui\n }", "protected function _setForm()\n\t{\t\n\t\t$controller = $this->getActionController();\n\t\t\n\t\t$this->_setViewFormData($controller)\n\t\t\t ->_setViewErrors($controller)\n\t\t\t ->_setViewWarnings($controller);\n\t\t\t\n\t}", "protected function onSubmit()\r {\r }", "public function postProcess() {\n\t\t//\t\t$this->setSubmittedValue(strtoupper($this->getSubmittedValue()));\n\t}", "public function setForm() {\n\t\t$translator = Zend_Registry::get('Zend_Translate');\n\t\t$this->setMethod('post');\n\t\t \n\t\t$this->addEnabled();\n\t\t$this->addRentDueDay();\n\t\t$this->addProrationType();\n\t\t$this->addProrationApplyMonth();\n\t\t$this->addSecondMonthDue();\n\t\t$this->addSubmitButton();\n\n\t\t$this->addDisplayGroup( $this->displayGroupArray, 'updateRentProrationSetting',array('legend' => 'rentProrationSettings'));\n\t\t$this->getDisplayGroup('updateRentProrationSetting')->setDecorators(array(\n 'FormElements',\n 'Fieldset', \n\t\t));\n\t}", "public function form()\n {\n $this->setData();\n }", "function pickup_submit()\n\t{\n\t\t$name = '_f_'.$this->name;\n\t\t$this->value = $GLOBALS[$name];\n\t}", "public function setValue() {\n if (isset($_POST['email'], $_POST['password'])) {\n $this->email = $this->mysqli->real_escape_string($_POST['email']);\n $this->password = md5($this->mysqli->real_escape_string($_POST['password']));\n }\n }", "public function process()\n\t{\n\t\tif(isset($_POST[$this->input_name()])) {\n\t\t\t$this->value = $_POST[$this->input_name()];\n\t\t}\n\t\telse {\n\t\t\t$this->value = false;\n\t\t}\n\t}", "public function populateForm() {}", "function pickup_submit()\n\t{\n\t\t$year = $this->name . '_year';\n\t\t$month = $this->name . '_month';\n\t\t$day = $this->name . '_day';\n\t\tglobal $$year, $$month, $$day;\n\n\t\t$this->value = $$year . \".\" . $$month . \".\" . $$day;\n\t}", "public function updateFromPOST() {\n if ($this->isSubmit()) {\n foreach (Tools::getValue($this->namebase(), array()) as $name => $value) {\n $key = $this->nameify($name);\n $this->input_values[$key] = $value;\n }\n Configuration::updateValue($this->key(), json_encode($this->input_values));\n }\n }", "function populate() {\n // @todo We inject client input directly into the form. What about\n // security issues?\n if (isset($this->form->request['raw_input'][$this->attributes['name']])) {\n // Disabled input elements do not accept new input.\n if (!$this->disabled) {\n $this->value = $this->form->request['raw_input'][$this->attributes['name']];\n }\n }\n }", "abstract protected function _setNewForm();", "protected abstract function fetchSubmitValue();", "public function setFormAction($value) { $this->_formAction = $value; }", "function setValue($value){\r\n\t\t$this->value = $value;\r\n\t}", "abstract function setupform();", "public function setValue( $value ) { \n $this->inputValue = $value; \n $this->value = $value;\n }", "public function form_set($form) {\n\t\t\t\t$this->form = $form;\n\t\t\t}", "public function formAction() {}", "public function onSubmit();", "function setValue($value) {\n $this->value = $value;\n }", "private function store()\n {\n $this->session->set('sergsxm_form_'.$this->formId, $this->parameters);\n }", "public function getSubmittedValue();", "public function getSubmittedValue();", "public function setUserfield($value);", "public function setAsAjaxForm() {\n\t}", "public function mappingFormSubmit(array &$form, FormStateInterface $form_state);", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "function update() {\n\t\tglobal $tpl, $lng;\n\n\t\t$form = $this->initForm(TRUE);\n\t\tif ($form->checkInput()) {\n\t\t\tif ($this->updateElement($this->getPropertiesFromPost($form))) {\n\t\t\t\tilUtil::sendSuccess($lng->txt('msg_obj_modified'), TRUE);\n\t\t\t\t$this->returnToParent();\n\t\t\t}\n\t\t}\n\n\t\t$form->setValuesByPost();\n\t\t$tpl->setContent($form->getHtml());\n\t}", "function onQuickFormEvent($event, $arg, &$caller)\n {\n switch ($event) {\n case 'updateValue':\n // constant values override both default and submitted ones\n // default values are overriden by submitted\n $value = $this->_findValue($caller->_constantValues);\n if (null === $value) {\n $value = $this->_findValue($caller->_submitValues);\n if (null === $value) {\n $value = $this->_findValue($caller->_defaultValues);\n }\n }\n if (!is_array($value)) {\n $value = array('value' => $value);\n }\n if (null !== $value) {\n $this->setValue($value);\n }\n return true;\n break;\n }\n return parent::onQuickFormEvent($event, $arg, $caller);\n\n }", "protected function Form_Run() {}", "function setValue ($value) {\n\t\t$this->_value = $value;\n\t}", "public function getSubmitVar() { return $this->_submitVar; }", "public function configFormSubmit(&$values) {\n if ($author = user_load_by_name($values['author'])) {\n $values['author'] = $author->uid;\n }\n else {\n $values['author'] = 0;\n }\n parent::configFormSubmit($values);\n }", "public function setForm($form){\r\n $this->form=$form;\r\n }", "public function setFormSessionData(): void\n {\n $session = (array) $this->request->getSession()->get(config('form.session_key'));\n\n $formId = $this->form->getID();\n if (array_key_exists($formId, $session)) {\n $data = $session[$formId];\n\n $this->data = array_key('data', $data, []);\n $this->errors = array_key('messages', $data, []);\n }\n array_map(\n function ($name, $message) {\n $this->form->getField($name)->setErrorMessage($message);\n },\n array_keys($this->errors),\n $this->errors\n );\n \n array_key_unset(config('form.csrf_field_name'), $this->data);\n \n $this->form->setValues($this->data);\n $this->removeSessionData();\n }", "public function get_submitted_edit_form_data()\n\t{\n\t\t$this->credits = $_POST['credits'];\n\t\t$this->levelID = $_POST['level'];\t\n\t}", "function AjaxSetForm(&$objResponse)\n\t\t{\n\t\t\t// Kiem tra neu khong dung class thi bo qua\n\t\t\t$sClassName = strtolower(get_class($objResponse));\n\t\t\tif( $sClassName != 'xajaxresponse')\n\t\t\t{\n\t\t\t\treturn(false);\n\t\t\t}\n\t\t\t// Ham gan gia tri cho cac o nhap trong form, du lieu lay tu database\n\t\t\t$arrFields = $this->getAttributeNames();\n\t\t\t// Kien sua :: Fix loi khong lay duoc danh sach field\n\t\t\tif(!is_array($arrFields))\n\t\t\t{\n\t\t\t\t$arrFields = array();\n\t\t\t}\n\t\t\tforeach($arrFields as $key=>$value)\n\t\t\t{\n\t\t\t\tif (in_array($value, $this->arrInputFields))\n\t\t\t\t{\n\t\t\t\t\t$sInputName = (isset($this->arrFieldsMap[$value])) ? $this->arrFieldsMap[$value] : $value;\n\t\t\t\t\t$sInputValue = $this->$value;\n\t\t\t\t\t$objResponse->addAssign($sInputName, 'value', $sInputValue);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn(true);\n\t\t}", "public function set()\n {\n if ( ! $this->value ) {\n $this->generate();\n }\n }", "public function setSessionData(): void\n {\n $this->response->getSession()->set(\n config('form.session_key'),\n [\n $this->form->getID() => [\n 'data' => $this->body,\n 'messages' => $this->errors\n ]\n ]\n );\n }", "public function setValue($value){\n $this->_value = $value;\n }", "public function saveForm()\n\t{\n\t\tparent::saveForm();\n\t\t$this->setNeedReinitRulesFlag();\n\t}", "function WithPost()\n {\n $this->mUsername = $_POST['username'];\n $this->mPassword = $_POST['password'];\n $this->mPasswordConfirm = $_POST['passwordConfirm'];\n }", "function asignar_valores(){\n $this->nombre=$_POST['nombre'];\n $this->prioridad=$_POST['prioridad'];\n $this->etiqueta=$_POST['etiqueta'];\n $this->descripcion=$_POST['descripcion'];\n $this->claves=$_POST['claves'];\n $this->tipo=$_POST['tipo'];\n }", "public function postSetupForm() {\r\n\r\n $l = $this->bootstrap->getLocalization();\r\n // ugyanaz submitnak mint title-nek\r\n $this->form->submit =\r\n $this->controller->toSmarty['title'] = $l('users', 'login_title');\r\n if ( $this->application->getParameter('nolayout') )\r\n $this->controller->toSmarty['nolayout'] = true;\r\n\r\n $this->controller->toSmarty['formclass'] = 'halfbox centerformwrap';\r\n $this->controller->toSmarty['titleclass'] = 'center';\r\n parent::postSetupForm();\r\n\r\n }", "function setFormOb(&$form)\n {\n $this->form = &$form;\n }", "public function hookForm() {\n }", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setAlertForm();", "public function form()\n {\n // 设置隐藏表单,传递用户id\n $check_status = [\n 'no_void' => '正常',\n 'void' => '作废',\n ];\n $this->hidden('id')->value($this->id);\n $this->hidden('status')->value('void');\n\n $this->radio('status', '是否作废')->options($check_status)->default('void');\n $this->textarea('reason', '作废原因');\n }", "protected function setPostData()\n\t{\n\t\t$this->request->addPostFields($this->query->getParams());\n\t}", "protected function valueSubmit($form, FormStateInterface $form_state) {\n // was not set, and the key to the checkbox if it is set.\n // Unfortunately, this means that if the key to that checkbox is 0,\n // we are unable to tell if that checkbox was set or not.\n\n // Luckily, the '#value' on the checkboxes form actually contains\n // *only* a list of checkboxes that were set, and we can use that\n // instead.\n\n $form_state->setValue(['options', 'value'], $form['value']['#value']);\n }", "public function __construct()\n {\n if (isset($_SESSION['formkey'])) {\n $this->oldFormkey = $_SESSION['formkey'];\n }\n }", "function process_form()\n {\n }", "abstract public function setValue($value);", "function setForm(Form $form) {\n $this->form = $form;\n }", "function asignar_valores(){\n\t\t$this->nombre=$_POST['nombre'];\n\t\t$this->prioridad=$_POST['prioridad'];\n\t\t$this->etiqueta=$_POST['etiqueta'];\n\t\t$this->descripcion=$_POST['descripcion'];\n\t\t$this->claves=$_POST['claves'];\n\t\t$this->tipo=$_POST['tipo'];\n\t\t$this->icono=$_POST['icono'];\n\t}", "public function set()\n {\n\t\tif ($this->model->state())\n $this->model->set();\n }", "public function form(){\n\n }", "public function formAction()\n {\n $token = Generator::getRandomString(25);\n $this->set(\"token\", $token);\n $_SESSION['token'] = $token;\n }", "function set_submit_normal()\n\t{\n\t\t$this->_submit_type = \"application/x-www-form-urlencoded\";\n\t}", "function _setSubjectForm() {\n\t\t$this->loadModel('Subject');\n\t\t$subject_opts = array_merge(array(0=> 'Select a Subject'), $this->Subject->find('list'));\n\t\t$this->set('subject_opts', $subject_opts);\n\t}", "function value( $value )\n\t{\n\t\t$this->value = $value;\n\t}", "public function form( &$form )\n\t{\n\t}", "protected abstract function fetchSubmitValueMasschange();", "public function buildForm()\n {\n }", "public static abstract function postSubmit(Form $form);", "public function hookForm() {\n if ($this->isCompanyForm()) {\n $this->setDefaultExpDate();\n $this->makeBillingAreaRequired();\n }\n elseif ($this->isCompanyViewsMultiSearchForm()) {\n $this->form['company_name']['#type'] = 'textarea';\n $this->duplicateField('sort_by');\n }\n }", "function form_init_data()\r\n {\r\n $this->set_element_value(\"Swimmers\", FT_CREATE) ;\r\n $this->set_element_value(\"Swim Meets\", FT_CREATE) ;\r\n $this->set_element_value(\"Swim Teams\", FT_CREATE) ;\r\n }", "public function setValue($value)\n\t{\n\t\tif (parent::getValue() === $value) {\n\t\t\treturn;\n\t\t}\n\n\t\tparent::setValue($value);\n\t\tif ($this->getActiveControl()->canUpdateClientSide() && $this->getHasLoadedPostData()) {\n\t\t\t$this->getPage()->getCallbackClient()->setValue($this, $value);\n\t\t}\n\t}", "function postToVar() {\n foreach ($this->fields() as $f) {\n if ($this->$f === false) $this->$f = $this->input->post($f);\n }\n }", "function setInputValues()\n {\n // Set input type based on GET/POST\n $inputType = ($_SERVER['REQUEST_METHOD'] === 'POST') ? INPUT_POST : INPUT_GET;\n // Init global variables\n global $typeID, $classID, $makeID, $price, $model, $year;\n global $sort, $sortDirection;\n // Set each variable, escape special characters\n $typeID = filter_input($inputType, 'typeID', FILTER_VALIDATE_INT);\n $classID = filter_input($inputType, 'classID', FILTER_VALIDATE_INT);\n $makeID = filter_input($inputType, 'makeID', FILTER_VALIDATE_INT);\n $sort = filter_input($inputType, 'sort', FILTER_VALIDATE_INT);\n $sortDirection = filter_input($inputType, 'sortDirection', FILTER_VALIDATE_INT);\n $price = filter_input($inputType, 'price', FILTER_VALIDATE_INT);\n $year = filter_input($inputType, 'year', FILTER_VALIDATE_INT);\n $model = htmlspecialchars(filter_input($inputType, 'model'));\n }", "public function submitPage() {}", "function openlayers_component_form_type_submit($form, &$form_state) {\n $form_state['item']->factory_service = $form_state['values']['factory_service'];\n}" ]
[ "0.68483067", "0.68077433", "0.67960054", "0.67746896", "0.6742483", "0.6742424", "0.671685", "0.67083424", "0.66895676", "0.66088825", "0.6580982", "0.65792406", "0.6542649", "0.637461", "0.6358088", "0.6301339", "0.6285643", "0.6274543", "0.62502813", "0.621155", "0.6156784", "0.6156036", "0.6122704", "0.6108541", "0.6084323", "0.6048098", "0.6019659", "0.60049236", "0.59919316", "0.59919316", "0.59865516", "0.59780335", "0.59572375", "0.5937653", "0.5937653", "0.59369767", "0.59369767", "0.59369767", "0.59369767", "0.59369767", "0.59369767", "0.59369767", "0.59369767", "0.59369767", "0.59369767", "0.59369767", "0.59278935", "0.5904932", "0.5902523", "0.5855522", "0.58505446", "0.58439934", "0.5820024", "0.58111316", "0.5802815", "0.58018976", "0.57872355", "0.5777282", "0.5774643", "0.57741404", "0.57692647", "0.57651013", "0.57646245", "0.576183", "0.5760118", "0.5751876", "0.5751876", "0.5751876", "0.5751876", "0.5751876", "0.5751876", "0.5751876", "0.5751876", "0.5751876", "0.5751876", "0.5741588", "0.5740371", "0.5723954", "0.5720283", "0.57173973", "0.5713735", "0.5704079", "0.56991667", "0.5695873", "0.5691482", "0.5667278", "0.5662909", "0.56612194", "0.5646196", "0.5633628", "0.56285226", "0.5612275", "0.5612199", "0.5606718", "0.5604579", "0.55975306", "0.5597082", "0.55874354", "0.55820346", "0.5578023", "0.55548054" ]
0.0
-1
A setter method when a form is submitted
public function getInfoAttribute($info) { return unserialize($info); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function valiteForm();", "public function afterSubmit() {\n\t\t$this->setValue($this->serializeData($this->getValue()));\n\t}", "protected function setSubmittedValues()\n {\n if ( $this->setFundraiserId() ) {\n $this->setFundraiserProfile(); \n }\n\n $this->setAmount();\n \n $this->setFirstName();\n $this->setLastName();\n $this->setEmail();\n $this->setTelephone();\n \n $this->setAddress();\n $this->setCity();\n $this->setCountry();\n $this->setRegion();\n $this->setPostalCode();\n \n $this->setAnonymity();\n $this->setHideAmount();\n }", "public function\tsetSubmittedValue($submittedValue);", "public function postProcess() {\n\t\t//\t\t$this->setSubmittedValue(strtoupper($this->getSubmittedValue()));\n\t}", "protected function OnSubmit()\n {\n //tu codigo aqui\n }", "protected function _setForm()\n\t{\t\n\t\t$controller = $this->getActionController();\n\t\t\n\t\t$this->_setViewFormData($controller)\n\t\t\t ->_setViewErrors($controller)\n\t\t\t ->_setViewWarnings($controller);\n\t\t\t\n\t}", "public function setForm() {\n\t\t$translator = Zend_Registry::get('Zend_Translate');\n\t\t$this->setMethod('post');\n\t\t \n\t\t$this->addEnabled();\n\t\t$this->addRentDueDay();\n\t\t$this->addProrationType();\n\t\t$this->addProrationApplyMonth();\n\t\t$this->addSecondMonthDue();\n\t\t$this->addSubmitButton();\n\n\t\t$this->addDisplayGroup( $this->displayGroupArray, 'updateRentProrationSetting',array('legend' => 'rentProrationSettings'));\n\t\t$this->getDisplayGroup('updateRentProrationSetting')->setDecorators(array(\n 'FormElements',\n 'Fieldset', \n\t\t));\n\t}", "public function setValue() {\n if (isset($_POST['email'], $_POST['password'])) {\n $this->email = $this->mysqli->real_escape_string($_POST['email']);\n $this->password = md5($this->mysqli->real_escape_string($_POST['password']));\n }\n }", "public function form()\n {\n $this->setData();\n }", "public function process()\n\t{\n\t\tif(isset($_POST[$this->input_name()])) {\n\t\t\t$this->value = $_POST[$this->input_name()];\n\t\t}\n\t\telse {\n\t\t\t$this->value = false;\n\t\t}\n\t}", "protected function onSubmit()\r {\r }", "function pickup_submit()\n\t{\n\t\t$name = '_f_'.$this->name;\n\t\t$this->value = $GLOBALS[$name];\n\t}", "public function populateForm() {}", "public function updateFromPOST() {\n if ($this->isSubmit()) {\n foreach (Tools::getValue($this->namebase(), array()) as $name => $value) {\n $key = $this->nameify($name);\n $this->input_values[$key] = $value;\n }\n Configuration::updateValue($this->key(), json_encode($this->input_values));\n }\n }", "function pickup_submit()\n\t{\n\t\t$year = $this->name . '_year';\n\t\t$month = $this->name . '_month';\n\t\t$day = $this->name . '_day';\n\t\tglobal $$year, $$month, $$day;\n\n\t\t$this->value = $$year . \".\" . $$month . \".\" . $$day;\n\t}", "abstract protected function _setNewForm();", "function populate() {\n // @todo We inject client input directly into the form. What about\n // security issues?\n if (isset($this->form->request['raw_input'][$this->attributes['name']])) {\n // Disabled input elements do not accept new input.\n if (!$this->disabled) {\n $this->value = $this->form->request['raw_input'][$this->attributes['name']];\n }\n }\n }", "protected abstract function fetchSubmitValue();", "public function form_set($form) {\n\t\t\t\t$this->form = $form;\n\t\t\t}", "public function setValue( $value ) { \n $this->inputValue = $value; \n $this->value = $value;\n }", "public function setFormAction($value) { $this->_formAction = $value; }", "function setValue($value){\r\n\t\t$this->value = $value;\r\n\t}", "abstract function setupform();", "public function formAction() {}", "public function setUserfield($value);", "function setValue($value) {\n $this->value = $value;\n }", "private function store()\n {\n $this->session->set('sergsxm_form_'.$this->formId, $this->parameters);\n }", "public function setAsAjaxForm() {\n\t}", "public function getSubmittedValue();", "public function getSubmittedValue();", "public function mappingFormSubmit(array &$form, FormStateInterface $form_state);", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "public function setValue($value) {}", "function update() {\n\t\tglobal $tpl, $lng;\n\n\t\t$form = $this->initForm(TRUE);\n\t\tif ($form->checkInput()) {\n\t\t\tif ($this->updateElement($this->getPropertiesFromPost($form))) {\n\t\t\t\tilUtil::sendSuccess($lng->txt('msg_obj_modified'), TRUE);\n\t\t\t\t$this->returnToParent();\n\t\t\t}\n\t\t}\n\n\t\t$form->setValuesByPost();\n\t\t$tpl->setContent($form->getHtml());\n\t}", "public function onSubmit();", "function AjaxSetForm(&$objResponse)\n\t\t{\n\t\t\t// Kiem tra neu khong dung class thi bo qua\n\t\t\t$sClassName = strtolower(get_class($objResponse));\n\t\t\tif( $sClassName != 'xajaxresponse')\n\t\t\t{\n\t\t\t\treturn(false);\n\t\t\t}\n\t\t\t// Ham gan gia tri cho cac o nhap trong form, du lieu lay tu database\n\t\t\t$arrFields = $this->getAttributeNames();\n\t\t\t// Kien sua :: Fix loi khong lay duoc danh sach field\n\t\t\tif(!is_array($arrFields))\n\t\t\t{\n\t\t\t\t$arrFields = array();\n\t\t\t}\n\t\t\tforeach($arrFields as $key=>$value)\n\t\t\t{\n\t\t\t\tif (in_array($value, $this->arrInputFields))\n\t\t\t\t{\n\t\t\t\t\t$sInputName = (isset($this->arrFieldsMap[$value])) ? $this->arrFieldsMap[$value] : $value;\n\t\t\t\t\t$sInputValue = $this->$value;\n\t\t\t\t\t$objResponse->addAssign($sInputName, 'value', $sInputValue);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn(true);\n\t\t}", "function onQuickFormEvent($event, $arg, &$caller)\n {\n switch ($event) {\n case 'updateValue':\n // constant values override both default and submitted ones\n // default values are overriden by submitted\n $value = $this->_findValue($caller->_constantValues);\n if (null === $value) {\n $value = $this->_findValue($caller->_submitValues);\n if (null === $value) {\n $value = $this->_findValue($caller->_defaultValues);\n }\n }\n if (!is_array($value)) {\n $value = array('value' => $value);\n }\n if (null !== $value) {\n $this->setValue($value);\n }\n return true;\n break;\n }\n return parent::onQuickFormEvent($event, $arg, $caller);\n\n }", "public function setFormSessionData(): void\n {\n $session = (array) $this->request->getSession()->get(config('form.session_key'));\n\n $formId = $this->form->getID();\n if (array_key_exists($formId, $session)) {\n $data = $session[$formId];\n\n $this->data = array_key('data', $data, []);\n $this->errors = array_key('messages', $data, []);\n }\n array_map(\n function ($name, $message) {\n $this->form->getField($name)->setErrorMessage($message);\n },\n array_keys($this->errors),\n $this->errors\n );\n \n array_key_unset(config('form.csrf_field_name'), $this->data);\n \n $this->form->setValues($this->data);\n $this->removeSessionData();\n }", "function asignar_valores(){\n $this->nombre=$_POST['nombre'];\n $this->prioridad=$_POST['prioridad'];\n $this->etiqueta=$_POST['etiqueta'];\n $this->descripcion=$_POST['descripcion'];\n $this->claves=$_POST['claves'];\n $this->tipo=$_POST['tipo'];\n }", "public function setForm($form){\r\n $this->form=$form;\r\n }", "function setFormOb(&$form)\n {\n $this->form = &$form;\n }", "function setValue ($value) {\n\t\t$this->_value = $value;\n\t}", "public function form()\n {\n // 设置隐藏表单,传递用户id\n $check_status = [\n 'no_void' => '正常',\n 'void' => '作废',\n ];\n $this->hidden('id')->value($this->id);\n $this->hidden('status')->value('void');\n\n $this->radio('status', '是否作废')->options($check_status)->default('void');\n $this->textarea('reason', '作废原因');\n }", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function setValue($value);", "public function get_submitted_edit_form_data()\n\t{\n\t\t$this->credits = $_POST['credits'];\n\t\t$this->levelID = $_POST['level'];\t\n\t}", "function asignar_valores(){\n\t\t$this->nombre=$_POST['nombre'];\n\t\t$this->prioridad=$_POST['prioridad'];\n\t\t$this->etiqueta=$_POST['etiqueta'];\n\t\t$this->descripcion=$_POST['descripcion'];\n\t\t$this->claves=$_POST['claves'];\n\t\t$this->tipo=$_POST['tipo'];\n\t\t$this->icono=$_POST['icono'];\n\t}", "protected function Form_Run() {}", "protected function valueSubmit($form, FormStateInterface $form_state) {\n // was not set, and the key to the checkbox if it is set.\n // Unfortunately, this means that if the key to that checkbox is 0,\n // we are unable to tell if that checkbox was set or not.\n\n // Luckily, the '#value' on the checkboxes form actually contains\n // *only* a list of checkboxes that were set, and we can use that\n // instead.\n\n $form_state->setValue(['options', 'value'], $form['value']['#value']);\n }", "public function set()\n {\n if ( ! $this->value ) {\n $this->generate();\n }\n }", "public function hookForm() {\n }", "public function setSessionData(): void\n {\n $this->response->getSession()->set(\n config('form.session_key'),\n [\n $this->form->getID() => [\n 'data' => $this->body,\n 'messages' => $this->errors\n ]\n ]\n );\n }", "abstract public function setValue($value);", "public function setValue($value){\n $this->_value = $value;\n }", "public function form(){\n\n }", "public function saveForm()\n\t{\n\t\tparent::saveForm();\n\t\t$this->setNeedReinitRulesFlag();\n\t}", "public function setAlertForm();", "function WithPost()\n {\n $this->mUsername = $_POST['username'];\n $this->mPassword = $_POST['password'];\n $this->mPasswordConfirm = $_POST['passwordConfirm'];\n }", "public function getSubmitVar() { return $this->_submitVar; }", "function process_form()\n {\n }", "public function set()\n {\n\t\tif ($this->model->state())\n $this->model->set();\n }", "function postToVar() {\n foreach ($this->fields() as $f) {\n if ($this->$f === false) $this->$f = $this->input->post($f);\n }\n }", "function setForm(Form $form) {\n $this->form = $form;\n }", "protected abstract function fetchSubmitValueMasschange();", "public function configFormSubmit(&$values) {\n if ($author = user_load_by_name($values['author'])) {\n $values['author'] = $author->uid;\n }\n else {\n $values['author'] = 0;\n }\n parent::configFormSubmit($values);\n }", "public function form( &$form )\n\t{\n\t}", "public function __construct()\n {\n if (isset($_SESSION['formkey'])) {\n $this->oldFormkey = $_SESSION['formkey'];\n }\n }", "protected function setPostData()\n\t{\n\t\t$this->request->addPostFields($this->query->getParams());\n\t}", "public function setFormValue($name, $value) {\n $this->values[HVAL_FORMPARAM][$name]= $value;\n }", "function value( $value )\n\t{\n\t\t$this->value = $value;\n\t}", "public function formAction()\n {\n $token = Generator::getRandomString(25);\n $this->set(\"token\", $token);\n $_SESSION['token'] = $token;\n }", "public function postSetupForm() {\r\n\r\n $l = $this->bootstrap->getLocalization();\r\n // ugyanaz submitnak mint title-nek\r\n $this->form->submit =\r\n $this->controller->toSmarty['title'] = $l('users', 'login_title');\r\n if ( $this->application->getParameter('nolayout') )\r\n $this->controller->toSmarty['nolayout'] = true;\r\n\r\n $this->controller->toSmarty['formclass'] = 'halfbox centerformwrap';\r\n $this->controller->toSmarty['titleclass'] = 'center';\r\n parent::postSetupForm();\r\n\r\n }", "public function postHydrate(): void\n {\n if ('invalid' === $this->value) {\n $this->value = 'valid';\n }\n }", "public function hookForm() {\n if ($this->isCompanyForm()) {\n $this->setDefaultExpDate();\n $this->makeBillingAreaRequired();\n }\n elseif ($this->isCompanyViewsMultiSearchForm()) {\n $this->form['company_name']['#type'] = 'textarea';\n $this->duplicateField('sort_by');\n }\n }", "function openlayers_component_form_type_submit($form, &$form_state) {\n $form_state['item']->factory_service = $form_state['values']['factory_service'];\n}", "function asignar_valores(){\n\t\t//$this->ciudad=$_SESSION['ciudad_admin'];\n\t\t$this->nombre=$_POST['nombre'];\n\t\t$this->apellido=$_POST['apellido'];\n\t\t$this->cantidad=$_POST['cantidad'];\n\t\t$this->cedula=$_POST['cedula'];\n\t\t$this->correo=$_POST['correo'];\n\t}", "function setFormKey($key);", "function setInputValues()\n {\n // Set input type based on GET/POST\n $inputType = ($_SERVER['REQUEST_METHOD'] === 'POST') ? INPUT_POST : INPUT_GET;\n // Init global variables\n global $typeID, $classID, $makeID, $price, $model, $year;\n global $sort, $sortDirection;\n // Set each variable, escape special characters\n $typeID = filter_input($inputType, 'typeID', FILTER_VALIDATE_INT);\n $classID = filter_input($inputType, 'classID', FILTER_VALIDATE_INT);\n $makeID = filter_input($inputType, 'makeID', FILTER_VALIDATE_INT);\n $sort = filter_input($inputType, 'sort', FILTER_VALIDATE_INT);\n $sortDirection = filter_input($inputType, 'sortDirection', FILTER_VALIDATE_INT);\n $price = filter_input($inputType, 'price', FILTER_VALIDATE_INT);\n $year = filter_input($inputType, 'year', FILTER_VALIDATE_INT);\n $model = htmlspecialchars(filter_input($inputType, 'model'));\n }", "public function setValue($fieldname, $value);", "public function setForm( $form )\n\t{\n\t\t$this->setAttribute( \"form\", $form );\n\t}", "public static abstract function postSubmit(Form $form);" ]
[ "0.6974413", "0.67495346", "0.67429876", "0.66923237", "0.66862416", "0.6685896", "0.66471505", "0.6633435", "0.6625253", "0.66222143", "0.6608156", "0.65966123", "0.656567", "0.6400839", "0.63646024", "0.63068455", "0.627297", "0.6267735", "0.6242322", "0.615191", "0.6148697", "0.6147061", "0.6139525", "0.61170256", "0.6107694", "0.60908556", "0.60029286", "0.5993448", "0.5993411", "0.5992575", "0.5992575", "0.5985198", "0.5981858", "0.5981858", "0.5981003", "0.5981003", "0.5981003", "0.5981003", "0.5981003", "0.5981003", "0.5981003", "0.5981003", "0.5981003", "0.5981003", "0.5981003", "0.5979975", "0.59770006", "0.59330654", "0.59057355", "0.58993995", "0.58840984", "0.58370394", "0.5821593", "0.581232", "0.5807024", "0.57995313", "0.57995313", "0.57995313", "0.57995313", "0.57995313", "0.57995313", "0.57995313", "0.57995313", "0.57995313", "0.57995313", "0.57950664", "0.5787476", "0.5781081", "0.57776576", "0.57764244", "0.57688993", "0.5762567", "0.5760786", "0.5753454", "0.5751446", "0.575124", "0.57440746", "0.5742071", "0.573254", "0.57281196", "0.57256633", "0.57133394", "0.5699883", "0.5693627", "0.568613", "0.5685564", "0.5673564", "0.56529945", "0.5648991", "0.56248385", "0.5624628", "0.5624517", "0.5614724", "0.56048447", "0.55952954", "0.5592726", "0.55920744", "0.55893564", "0.55871445", "0.55838656", "0.55834657" ]
0.0
-1
this report belongs to a particular vehicle
public function vehicle() { return $this->belongsTo('App\Models\Admin\Vehicle'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function vehicle()\n\t{\n\t\treturn $this->belongsTo('vehicle', 'vehicle_id');\n\t}", "public function vehicle()\n {\n return $this->hasOne('App\\Models\\Vehicletype','id','vehicle_type_id');\n }", "public function show(vehicle $vehicle)\n {\n //\n }", "public function show(Drivervehicle $drivervehicle)\n {\n\n }", "function VehicleDetails(){\n\t\tparent::getVehicleDetails();\n\t\t$this -> addVehicleDetails();\n\t}", "public function show(Vehicle $vehicle)\n {\n //\n }", "public function vehicule()\n {\n return $this->belongsTo(Vehicule::class, 'vehicule');\n }", "public function show(Vehicle $vechile)\n {\n //\n }", "public function vehicule()\n {\n return $this->belongsTo(Vehicule::class, 'vehicule');\n }", "public function product_supply(){ return $this->hasMany(ProductSupply::class,'vehicle_id'); }", "public function show(VehicleIn $vehicleIn)\n {\n //\n }", "public function vehicle()\n {\n return $this->belongsToMany(Vehicle::class, 'nodeVehicle', 'relNodeId', 'relVehicleId')\n ->using(new class extends Pivot {\n use UuidModelTrait;\n });\n }", "public function vehicles()\n {\n return $this->belongsToMany('App\\Vehicle');\n }", "public function show(vehiclereport $vehiclereport)\n {\n //\n }", "function check_own_vehicle($cid)\n\t{\n\t\tglobal $userdata, $template, $db, $SID, $lang, $phpEx, $phpbb_root_path, $garage_config, $board_config;\n\t\n\t\tif (empty($cid))\n\t\t{\n\t \t\tmessage_die(GENERAL_ERROR, $lang['No_vehicle_id_specified'], '', __LINE__, __FILE__);\n\t\t}\n\t\n\t\t$sql = \"SELECT g.member_id FROM \" . GARAGE_TABLE . \" AS g WHERE g.id = $cid \";\n\t\n\t\tif( !($result = $db->sql_query($sql)) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql);\n\t\t}\n\t\n\t\t$vehicle = $db->sql_fetchrow($result); \n\t\t$db->sql_freeresult($result);\n\t\n\t\tif ( $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD )\n\t\t{\n\t\t\t//Allow A Moderator Or Administrator Do What They Want....\n\t\t\treturn;\n\t\t}\n\t\telse if ( $vehicle['member_id'] != $userdata['user_id'] )\n\t\t{\n\t\t\t$message = $lang['Not_Vehicle_Owner'] . \"<br /><br />\" . sprintf($lang['Click_return_garage'], \"<a href=\\\"\" . append_sid(\"garage.$phpEx\") . \"\\\">\", \"</a>\") . \"<br /><br />\" . sprintf($lang['Click_return_index'], \"<a href=\\\"\" . append_sid(\"index.$phpEx\") . \"\\\">\", \"</a>\");\n\t\n\t\t\tmessage_die(GENERAL_MESSAGE, $message);\n\t\t}\n\t\n\t\treturn ;\n\t}", "public function vehicle_details(){\n\t\t// $vehicle_id = $this->input->post('id');\n\t\t$vehicle_id = $this->input->post('id');\n\t\t// echo \"<pre>\";\n\t\t// print_r($vehicle_id);\n\t\t// exit;\n\t\t$data_array = array();\n\t\t//\n\t\t$parameters['join'] = array(\n\t\t\t'company' => 'company.company_id = vehicles.company'\n\t\t);\n\t\t$parameters['where'] = array('id' => $vehicle_id);\n\t\t$parameters['select'] = '*';\n\n\t\t$data = $this->MY_Model->getRows('vehicles',$parameters,'row');\n\t\t$company_id = explode(',',$data->company);\n\n\t\t$company_parameters['where_in'] = array('col' => 'company_id', 'value' => $company_id);\n\t\t$data_company = $this->MY_Model->getRows('company',$company_parameters);\n\n\t\t$data_array['vehicles'] = $data;\n\t\t$data_array['company'] = $data_company;\n\t\tjson($data_array);\n\n\t\t// $parameters['where'] = array('id' => $vehicle_id);\n\t\t// $data['view_edit'] = $this->MY_Model->getRows('vehicles',$parameters,'row');\n\t\t// // echo $this->db->last_query();\n\t\t// echo json_encode($data);\n\t}", "function check_vehicle($conn, $id) {\n\t$sql = \"SELECT * FROM Vehicle WHERE Vehicle_ID = '$id'\";\n\t$result = mysqli_query($conn, $sql);\n\t// happen to have one match, i.e. one unique corrosponding vehicle\n\tif (mysqli_num_rows($result)== 1){\n\t\treturn True;\n\t}else {\n\t\treturn False; // no or multiple corrospondence\n\t}\n}", "public function vehicle();", "public function info($veh){\n $fonction = Auth::user()->fonction;\n if($fonction == 'admin') return redirect('/admin/dashboard');\n if($fonction == 'gest') return redirect('/gest/dashboard');\n //get the id of the vehicule to show it detail\n $vehi = $veh;\n //find the vehicule\n $vehicules['vehicules'] = \\App\\vehicule::find($vehi);\n return view(\"/vehiculeInfo/info\",$vehicules);\n }", "public function assigned_vehicles() {\n return view('clients.client_vehicles');\n /*$user_id = Session::get('user_id');\n $vehicles = User::find($user_id)->vehicles->toArray();\n print_r($vehicles);*/\n }", "public function getTypeOfVehicle();", "public function created(Vehicle $vehicle)\n {\n //\n }", "public function vehicles()\n {\n return $this->belongsToMany('ScreenTec\\Models\\Vehicle')->withTimestamps();\n }", "public function unique_vehicle(){\n\t\t\t\n\t\t\t$type = $this->input->post('vehicle_type');\n\t\t\t$make = $this->input->post('vehicle_make');\n\t\t\t$model = $this->input->post('vehicle_model');\n\t\t\t$email = $this->input->post('trader_email');\n\t\t\t\n\t\t\t$where = array(\n\t\t\t\t'vehicle_type' => $this->input->post('vehicle_type'),\n\t\t\t\t'vehicle_make' => $this->input->post('vehicle_make'),\n\t\t\t\t'vehicle_model' => $this->input->post('vehicle_model'),\n\t\t\t\t'trader_email' => $this->input->post('trader_email'),\n\t\t\t);\n\t\t\t\n\t\t\tif (!$this->Vehicles->unique_vehicle($where))\n\t\t\t{\n\t\t\t\t$this->form_validation->set_message('unique_vehicle', 'You already have this vehicle listed!');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}", "public function getCarid()\n {\n return $this->carid;\n }", "public function vehicule()\n {\n return $this->hasMany(Vehicule::class);\n }", "public function typevehicule()\n {\n return $this->belongsTo(TypeVehicule::class, 'typevehicule_id');\n }", "public function getId() {return $this->id_travel;}", "public function vehicles(){\n\n\t\t\t$vehicles = DB::table('logistics_vehicles')\n\t\t\t\t->join('vehicle_types','logistics_vehicles.type', '=', 'vehicle_types.id')\n\t\t\t\t//->where('logistics_vehicles.tenant_id', Auth::user()->tenant_id)\n\t\t\t\t->where('logistics_vehicles.status', '=', 1)\n\t\t\t\t->orderBy('logistics_vehicles.status', 'DESC')\n\t\t\t\t->orderBy('logistics_vehicles.id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\treturn view('backend.logistics.vehicles', ['vehicles' => $vehicles]);\n\t\t}", "public function getCarierReff()\n {\n return $this->hasOne(MsRefference::className(), ['id' => 'carier_reff_id']);\n }", "public function Vendedor() {\n\t\treturn $this->belongsTo( Vendedores::class, 'vendedor_id');\n\t}", "public function dvehicles(){\n\n\t\t\t$vehicles = DB::table('logistics_vehicles')\n\t\t\t\t->join('vehicle_types','logistics_vehicles.type', '=', 'vehicle_types.id')\n\t\t\t\t//->where('logistics_vehicles.tenant_id', Auth::user()->tenant_id)\n\t\t\t\t->where('logistics_vehicles.status', '=', 0)\n\t\t\t\t->orderBy('logistics_vehicles.status', 'DESC')\n\t\t\t\t->orderBy('logistics_vehicles.id', 'DESC')\n\t\t\t\t->get();\n\n\t\t\treturn view('backend.logistics.vehicles', ['vehicles' => $vehicles]);\n\t\t}", "public function carId()\n {\n return parent::getId();\n }", "public function getCarId()\n {\n return $this->attributes['car_id'];\n }", "public function car()\n {\n return $this->belongsTo('App\\Models\\Car', 'car_id');\n }", "public function car()\n {\n return $this->belongsTo(Car::class, 'car_id', 'id');\n }", "public function getVehicleInMaintenance($id_company = null, $id_vehicle = null) {\n\t\ttry {\n\t\t\tglobal $con;\t\t\t\n\t\t\t/* Statement declaration */\n\t\t\t$sql = \t\"SELECT * \".\n\t\t\t\t\t\"FROM vehicles v, kinds k, brands b, states s, categories c, energies en, models m, sites si, currencies cu, maintenance ma \".\n\t\t\t\t\t\"WHERE v.id_energy = en.id_energy \".\n\t\t\t\t\t\t\"AND v.id_model = m.id_model \".\n\t\t\t\t\t\t\"AND v.id_kind = k.id_kind \".\n\t\t\t\t\t\t\"AND v.id_category = c.id_category \".\n\t\t\t\t\t\t\"AND v.id_state = s.id_state \".\n\t\t\t\t\t\t\"AND v.id_currency = cu.id_currency \".\n\t\t\t\t\t\t\"AND v.id_site = si.id_site \".\n\t\t\t\t\t\t\"AND si.id_company = :id_company \".\n\t\t\t\t\t\t\"AND m.id_brand = b.id_brand \".\n\t\t\t\t\t\t\"AND v.id_vehicle = ma.id_vehicle \".\n\t\t\t\t\t\t\"AND (ma.date_endmaintenance = '0000-00-00' OR ma.date_endmaintenance > CURDATE()) \".\n\t\t\t\t\t\t\"AND v.id_vehicle = :id_vehicle\";\n\t\t\t\t\t\n\t\t\t/* Statement values & execution */\n\t\t\t$stmt = $con->prepare($sql);\n\t\t\t$stmt->bindParam(':id_company', $id_company);\n\t\t\t$stmt->bindParam(':id_vehicle', $id_vehicle);\n\t\t\t\n\t\t\t/* Statement execution */\n\t\t\t$stmt->execute();\n\t\t\t\n\t\t\t/* Handle errors */\n\t\t\tif ($stmt->errno)\n\t\t\t throw new PDOException($stmt->error);\n\t\t\telse\n\t\t\t return $stmt->fetchAll(PDO::FETCH_OBJ);\n\t\t\t\n\t\t\t/* Close statement */\n\t\t\t$stmt->close();\n\t\t} catch(PDOException $e) {\n\t\t\treturn array(\"error\" => $e->getMessage());\n\t\t}\n }", "public function car()\n {\n return $this->hasOne(Car::class);\n }", "public function show( $vehicle)\n {\n //\n $vehicle = Vehicle::find($vehicle);\n if(!$vehicle){\n return $this->notFoundResponse('Vehicle not found');\n }\n\n return $this->formatSuccessResponse('Vehicle details', $vehicle);\n \n }", "public function edit(Vehicle $vehicle)\n {\n //\n }", "public function edit(Vehicle $vehicle)\n {\n //\n }", "public function addVehicle(Vehicle $vehicle)\n {\n if($vehicle instanceof Bicycle)\n {\n echo \"You'r note allowed here\";\n }else{\n $this->currentVehicles[] = $vehicle;\n }\n }", "function getDetailAllVehicleVG($account_id,$DbConnection)\n{\n\t$query=\"SELECT vehicle.vehicle_id,vehicle.vehicle_name FROM vehicle INNER JOIN \".\n \" vehicle_grouping USE INDEX(vg_accountid_status) ON vehicle_grouping.vehicle_id = vehicle.vehicle_id\".\n \" AND vehicle_grouping.account_id='$account_id' AND vehicle.status='1' \";\n \t$result=mysql_query($query,$DbConnection);\t\n\twhile($row=mysql_fetch_object($result))\n\t{\t\t\n\t\t/*$vehicle_id=$row->vehicle_id;\t\n\t\t$vehicle_name=$row->vehicle_name;*/\n\t\t$data[]=array('vehicle_id'=>$row->vehicle_id,'vehicle_name'=>$row->vehicle_name);\t\n\t}\n\treturn $data;\t\n\t\n}", "public function getSource()\n {\n return 'dw_vehicle';\n }", "protected function createVehicles($vehicle)\n {\n $vehicleCount = 0;\n if (isset($vehicle['attributes']['validate'])) {\n foreach ($vehicle['attributes']['validate'] as &$validator) {\n if ($validator['type'] === 'php') {\n if (strpos($validator['source'], ':/') === false && strpos($validator['source'], '/') !== 0) {\n $validator['source'] = $this->tplBase . '/' . $validator['source'];\n }\n }\n }\n }\n if (isset($vehicle['attributes']['resolve'])) {\n foreach ($vehicle['attributes']['resolve'] as &$resolver) {\n if ($resolver['type'] === 'php') {\n if (strpos($resolver['source'], ':/') === false && strpos($resolver['source'], '/') !== 0) {\n $resolver['source'] = $this->tplBase . '/' . $resolver['source'];\n }\n }\n }\n }\n switch ($vehicle['vehicle_class']) {\n case '\\\\Teleport\\\\Transport\\\\xPDOObjectVehicle':\n case 'xPDOObjectVehicle':\n $realClass = $this->modx->loadClass($vehicle['object']['class']);\n if ($realClass === false) {\n $this->request->log(\"Invalid class {$vehicle['object']['class']} specified; skipping vehicle\");\n break;\n }\n $graph = isset($vehicle['object']['graph']) && is_array($vehicle['object']['graph'])\n ? $vehicle['object']['graph'] : array();\n $graphCriteria = isset($vehicle['object']['graphCriteria']) && is_array($vehicle['object']['graphCriteria'])\n ? $vehicle['object']['graphCriteria'] : null;\n if (isset($vehicle['object']['script'])) {\n include $this->tplBase . '/scripts/' . $vehicle['object']['script'];\n } elseif (isset($vehicle['object']['criteria'])) {\n $iterator = $this->modx->getIterator($vehicle['object']['class'], (array)$vehicle['object']['criteria'], false);\n foreach ($iterator as $object) {\n /** @var \\xPDOObject $object */\n if (!empty($graph)) {\n $object->getGraph($graph, $graphCriteria, false);\n }\n if ($this->package->put($object, $vehicle['attributes'])) {\n $vehicleCount++;\n }\n }\n } elseif (isset($vehicle['object']['data'])) {\n /** @var \\xPDOObject $object */\n $object = $this->modx->newObject($vehicle['object']['class']);\n if ($object instanceof $realClass) {\n $object->fromArray($vehicle['object']['data'], '', true, true);\n if ($this->package->put($object, $vehicle['attributes'])) {\n $vehicleCount++;\n }\n }\n }\n $this->request->log(\"Packaged {$vehicleCount} xPDOObjectVehicles for class {$vehicle['object']['class']}\");\n break;\n case '\\\\Teleport\\\\Transport\\\\xPDOCollectionVehicle':\n $objCnt = 0;\n $realClass = $this->modx->loadClass($vehicle['object']['class']);\n $graph = isset($vehicle['object']['graph']) && is_array($vehicle['object']['graph'])\n ? $vehicle['object']['graph'] : array();\n $graphCriteria = isset($vehicle['object']['graphCriteria']) && is_array($vehicle['object']['graphCriteria'])\n ? $vehicle['object']['graphCriteria'] : null;\n if (isset($vehicle['object']['script'])) {\n include $this->tplBase . '/scripts/' . $vehicle['object']['script'];\n } elseif (isset($vehicle['object']['criteria'])) {\n $limit = isset($vehicle['object']['limit']) ? (integer)$vehicle['object']['limit'] : 0;\n if ($limit < 1) {\n $limit = 500;\n }\n $offset = 0;\n $criteria = $this->modx->newQuery($vehicle['object']['class'], (array)$vehicle['object']['criteria'], false);\n if (!isset($vehicle['object']['orderBy']) || !is_array($vehicle['object']['orderBy'])) {\n $pk = (array)$this->modx->getPK($realClass);\n foreach ($pk as &$primaryKey) {\n $primaryKey = $this->modx->escape($primaryKey);\n }\n $orderBy = array_fill_keys($pk, 'ASC');\n } else {\n $orderBy = $vehicle['object']['orderBy'];\n }\n foreach ($orderBy as $by => $direction) {\n $criteria->sortby($by, $direction);\n }\n $set = $this->modx->getCollection($vehicle['object']['class'], $criteria->limit($limit, $offset), false);\n while (!empty($set)) {\n foreach ($set as &$object) {\n /** @var \\xPDOObject $object */\n if (!empty($graph)) {\n $object->getGraph($graph, $graphCriteria, false);\n }\n }\n if (!empty($set) && $this->package->put($set, $vehicle['attributes'])) {\n $vehicleCount++;\n $objCnt = $objCnt + count($set);\n }\n $offset += $limit;\n $set = $this->modx->getCollection($vehicle['object']['class'], $criteria->limit($limit, $offset), false);\n }\n }\n $this->request->log(\"Packaged {$vehicleCount} xPDOCollectionVehicles with {$objCnt} total objects for class {$vehicle['object']['class']}\");\n break;\n case '\\\\Teleport\\\\Transport\\\\MySQLVehicle':\n /* collect table names from classes and grab any additional tables/data not listed */\n $modxDatabase = $this->modx->getOption('dbname', null, $this->modx->getOption('database'));\n $modxTablePrefix = $this->modx->getOption('table_prefix', null, '');\n\n $coreTables = array();\n foreach ($vehicle['object']['classes'] as $class) {\n $coreTables[$class] = $this->modx->quote($this->modx->literal($this->modx->getTableName($class)));\n }\n\n $stmt = $this->modx->query(\"SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA = '{$modxDatabase}' AND TABLE_NAME NOT IN (\" . implode(',', $coreTables) . \")\");\n $extraTables = $stmt->fetchAll(\\PDO::FETCH_COLUMN);\n\n if (is_array($extraTables) && !empty($extraTables)) {\n $excludeExtraTablePrefix = isset($vehicle['object']['excludeExtraTablePrefix']) && is_array($vehicle['object']['excludeExtraTablePrefix'])\n ? $vehicle['object']['excludeExtraTablePrefix'] : array();\n $excludeExtraTables = isset($vehicle['object']['excludeExtraTables']) && is_array($vehicle['object']['excludeExtraTables'])\n ? $vehicle['object']['excludeExtraTables'] : array();\n foreach ($extraTables as $extraTable) {\n if (in_array($extraTable, $excludeExtraTables)) continue;\n\n $instances = 0;\n $object = array(\n 'vehicle_package' => '',\n 'vehicle_class' => '\\\\Teleport\\\\Transport\\\\MySQLVehicle'\n );\n $attributes = array(\n 'vehicle_package' => '',\n 'vehicle_class' => '\\\\Teleport\\\\Transport\\\\MySQLVehicle'\n );\n\n /* remove modx table_prefix if table starts with it */\n $extraTableName = $extraTable;\n if (!empty($modxTablePrefix) && strpos($extraTableName, $modxTablePrefix) === 0) {\n $extraTableName = substr($extraTableName, strlen($modxTablePrefix));\n $addTablePrefix = true;\n } elseif (!empty($modxTablePrefix) || in_array($extraTableName, $excludeExtraTablePrefix)) {\n $addTablePrefix = false;\n } else {\n $addTablePrefix = true;\n }\n $object['tableName'] = $extraTableName;\n $this->request->log(\"Extracting non-core table {$extraTableName}\");\n\n /* generate the CREATE TABLE statement */\n $stmt = $this->modx->query(\"SHOW CREATE TABLE {$this->modx->escape($extraTable)}\");\n $resultSet = $stmt->fetch(\\PDO::FETCH_NUM);\n $stmt->closeCursor();\n if (isset($resultSet[1])) {\n if ($addTablePrefix) {\n $object['drop'] = \"DROP TABLE IF EXISTS {$this->modx->escape('[[++table_prefix]]' . $extraTableName)}\";\n $object['table'] = str_replace(\"CREATE TABLE {$this->modx->escape($extraTable)}\", \"CREATE TABLE {$this->modx->escape('[[++table_prefix]]' . $extraTableName)}\", $resultSet[1]);\n } else {\n $object['drop'] = \"DROP TABLE IF EXISTS {$this->modx->escape($extraTableName)}\";\n $object['table'] = $resultSet[1];\n }\n\n /* collect the rows and generate INSERT statements */\n $object['data'] = array();\n $stmt = $this->modx->query(\"SELECT * FROM {$this->modx->escape($extraTable)}\");\n if (!$stmt) {\n $this->request->log(\"Skipping table {$extraTable} as SELECT query failed\");\n break;\n }\n while ($row = $stmt->fetch(\\PDO::FETCH_ASSOC)) {\n if ($instances === 0) {\n $fields = implode(', ', array_map(array($this->modx, 'escape'), array_keys($row)));\n }\n $values = array();\n foreach ($row as $key => $value) {\n switch (gettype($value)) {\n case 'string':\n $values[] = $this->modx->quote($value);\n break;\n case 'NULL':\n case 'array':\n case 'object':\n case 'resource':\n case 'unknown type':\n $values[] = 'NULL';\n break;\n default:\n $values[] = (string)$value;\n break;\n }\n }\n $values = implode(', ', $values);\n if ($addTablePrefix) {\n $object['data'][] = \"INSERT INTO {$this->modx->escape('[[++table_prefix]]' . $extraTableName)} ({$fields}) VALUES ({$values})\";\n } else {\n $object['data'][] = \"INSERT INTO {$this->modx->escape($extraTable)} ({$fields}) VALUES ({$values})\";\n }\n $instances++;\n }\n }\n\n if (!$this->package->put($object, $attributes)) {\n $this->request->log(\"Could not package rows for table {$extraTable}\");\n } else {\n $this->request->log(\"Packaged {$instances} rows for non-core table {$extraTable}\");\n $vehicleCount++;\n }\n }\n $this->request->log(\"Packaged {$vehicleCount} {$vehicle['vehicle_class']} vehicles for non-core tables\");\n } else {\n $this->request->log(\"No non-core tables found for packaging\");\n }\n break;\n case 'xPDOScriptVehicle':\n if (isset($vehicle['object']['source'])) {\n if (strpos($vehicle['object']['source'], ':/') === false && strpos($vehicle['object']['source'], '/') !== 0) {\n $vehicle['object']['source'] = $this->tplBase . '/' . $vehicle['object']['source'];\n }\n }\n case 'xPDOFileVehicle':\n case 'xPDOTransportVehicle':\n default:\n if (isset($vehicle['object']['script'])) {\n include $this->tplBase . '/scripts/' . $vehicle['object']['script'];\n } else {\n if ($this->package->put($vehicle['object'], $vehicle['attributes'])) {\n $this->request->log(\"Packaged 1 {$vehicle['vehicle_class']}\" . (isset($vehicle['object']['source'])\n ? \" from {$vehicle['object']['source']}\" : \"\"));\n $vehicleCount++;\n }\n }\n break;\n }\n return $vehicleCount;\n }", "public function retireVehicle(Vehicle $vehicle){\n // Because of Route Model Binding,\n // Laravel will automatically inject the model instance that has\n // an ID matching the corresponding value from the request URI.\n\n // get current time\n $dateTimeNow = Carbon::now();\n\n // flag as retired 1 = true\n $vehicle->fldRetired = 1; // we just flag as 'retired'\n $vehicle->updated_at = $dateTimeNow;\n $vehicle->save();\n\n return redirect('vehicles');\n }", "public function visitor()\n {\n return $this->belongsTo(Visitor::class);\n }", "public function car_type()\n {\n return $this->belongsTo('App\\Models\\CarType','car_id','id');\n }", "public function reporte_vinculacion($obj_id){\n $data['vinculacion']=$this->vinculacion_pei_poa($obj_id);\n\n $this->load->view('admin/mestrategico/obj_estrategico/print_vinculacion', $data);\n }", "public function getBaiViet()\n {\n return $this->hasOne(BaiViet::className(), ['id' => 'BaiViet_id']);\n }", "public function driver_bus(){\n return $this->hasOne('App\\Models\\Bus','assistant_1');\n }", "public function getCartouche()\n {\n return $this->hasOne(Cartouche::className(), ['diffuseur_id' => 'id']);\n }", "public function getVisitReport()\n {\n return $this->hasOne(VisitReport::className(), ['id' => 'visit_report_id']);\n }", "function check_incident($conn, $id) {\n\t$sql = \"SELECT * FROM Incident WHERE Incident_ID = '$id'\";\n\t$result = mysqli_query($conn, $sql);\n\t// happen to have one match, i.e. one unique corrosponding vehicle\n\tif (mysqli_num_rows($result)== 1){\n\t\treturn True;\n\t}else {\n\t\treturn False; // no or multiple corrospondence\n\t}\n\t\n}", "public function supplyMov()\n {\n return $this->belongsTo('App\\WMS\\SMovement', 'mvt_reference_id');\n }", "public function getTypeOfVehicles()\n {\n //creating fourWheelerVehicle object\n $fourWheelVehicle = new fourWheelerVehicle(); \n //returning fourWheelVehicle object\n return $fourWheelVehicle; \n }", "public function edit(Vehicle $vechile)\n {\n //\n }", "public function car_type()\n {\n return $this->belongsTo(CarType::class, 'car_type_id');\n }", "public function travel(){\n \treturn $this->hasOne('App\\Models\\Travel', 'eventId');\n }", "function vehicle_properties($conn, $vid) {\n\t$sql = \"SELECT * FROM Vehicle WHERE Vehicle_ID = '$vid';\";\n\t$result = mysqli_query($conn, $sql);\n\t$row = mysqli_fetch_assoc($result);\n\treturn $row;\n}", "public function driver(){\n\n\t\t// belongsTo(RelatedModel, foreignKey = driver_id, keyOnRelatedModel = id)\n\t\treturn $this->belongsTo(Driver::class);\n\t}", "public function agent()\n {\n return $this->belongsTo(Agent::class, 'book_agent');\n }", "public function getVehicle($vehicle_id) {\n $stmt = $this->conn->prepare(\"SELECT vehicle_id, driver_id, type, license_plate,\n license_plate_img, vehicle_img, status, created_at\n FROM vehicle WHERE vehicle_id = ?\");\n\n $stmt->bind_param(\"i\", $vehicle_id);\n\n if ($stmt->execute()) {\n // $user = $stmt->get_result()->fetch_assoc();\n $stmt->bind_result($vehicle_id, $driver_id, $type, $license_plate, $license_plate_img, $vehicle_img, $status, $created_at);\n $stmt->fetch();\n $vehicle = array();\n $vehicle[\"vehicle_id\"] = $vehicle_id;\n $vehicle[\"driver_id\"] = $driver_id;\n $vehicle[\"type\"] = $type;\n $vehicle[\"license_plate\"] = $license_plate;\n $vehicle[\"license_plate_img\"] = $license_plate_img;\n $vehicle[\"vehicle_img\"] = $vehicle_img;\n $vehicle[\"status\"] = $status;\n $vehicle[\"created_at\"] = $created_at;\n $stmt->close();\n return $vehicle;\n } else {\n return NULL;\n }\n }", "public function index($vehicleId = '')\n {\n $vehicles = Vehicle::select('*');\n if (auth()->user()->user_type === 2 && $vehicleId == '') {\n $vehicles = $vehicles->where('vendor_id', auth()->id());\n }\n if($vehicleId != '') {\n $vehicles = $vehicles->where('id', base64_decode($vehicleId)) ;\n }\n $vehicles = $vehicles->with('vehicleType')->get();\n // dd($vehicles);\n $activeVehicles = $vehicles->where('status',1)->count();\n $inActiveVehicles = $vehicles->where('status',0)->count();\n return view('modules.vehicle.vehicles.list', compact('vehicles', 'activeVehicles', 'inActiveVehicles'));\n }", "public function voucher() {\n return $this->belongsTo( 'App\\Http\\Models\\Voucher', 'voucher_id', 'id' );\n }", "public function edit(vehiclereport $vehiclereport)\n {\n // \n }", "public function visitor(): BelongsTo\n {\n return $this->belongsTo(Visitor::class);\n }", "public function show(Vehicle $vehicle)\n {\n // Load relationships to add the data to the JSON response\n $vehicle->load('owner.company', 'model.manufacturer', 'fuelType', 'colour', 'transmission', 'type');\n return compact('vehicle');\n }", "public function drivers(){\n\n // hasMany(RelatedModel, foreignKeyOnRelatedModel = company_id, localKey = id)\n return $this->hasMany(Driver::class);\n }", "public function vendor()\n {\n return $this->belongsTo(Vendor::class, $this->modelVendorKey, 'id');\n }", "function getVehicleIdVehicleNameDetailVehicel($account_id_local1,$vehicle_display_option1,$options_value2,$DbConnection)\n {\n $query=\"SELECT vehicle_id,vehicle_name FROM vehicle WHERE account_id='$account_id_local1' AND $vehicle_display_option1='$options_value2' AND status='1'\";\n\t//echo \"query=\".$query;\n\t$result=mysql_query($query,$DbConnection);\n\t$flag=0;\n\t$vehicle_cnt=0;\n\twhile($row=mysql_fetch_object($result))\n\t{\n\t /*$vehicle_id=$row->vehicle_id; \n $vehicle_name=$row->vehicle_name;*/ \t\t\n $data[]=array('vehicle_id'=>$row->vehicle_id,'vehicle_name'=>$row->vehicle_name);\n\t}\n\treturn $data;\n }", "public function reportTravel($start_date,$end_date){\n\n\t\t$mcoData = new Application_Model_DbTable_McoData();\n\t\t$select = $mcoData->select()->setIntegrityCheck(false);\n\t\t$select ->from(array(\"md\" => \"mco_data\"),array('md.line','md.vehicle_number','md.start_hour','vp.name','md.end_hour',\n\t\t\t'v.plate','md.mid_hour','md.start_roulette',\n\t\t\t'md.mid_roulette','md.end_roulette','md.amount_passenger','md.incident','md.traffic_jam',\n\t\t\t'travel_type' => 'md.type',\n\t\t\t'date_exibition' => 'md.start_date',\n\t\t\t'qtd_passenger_way' => new Zend_Db_Expr('CASE WHEN mid_roulette != 0 THEN mid_roulette-start_roulette END'),\n\t\t\t'qtd_passenger_back' => new Zend_Db_Expr('CASE WHEN mid_roulette != 0 THEN end_roulette-mid_roulette END'),\n\t\t\t'capacity' => new Zend_Db_Expr('(((((vm.width_before_roulette*vm.length_before_roulette)+(vm.width_after_roulette*vm.length_after_roulette))/100)/5)+vm.amount_seats)')))\n\t\t->joinInner(array('vh' => 'vehicle_historic'), 'md.vehicle_number=vh.external_number', array())\n\t\t->joinInner(array('vm' => 'vehicle_measures'), 'vm.id=vh.vehicle_id')\n\t\t->joinInner(array('v' => 'vehicle'), 'v.id=vh.vehicle_id')\n\t\t->joinInner(array('vp' => 'vehicle_pattern'), 'v.pattern=vp.id')\n\t\t->where('md.start_date >= ?', Application_Model_General::dateToUs($start_date))\n\t\t->where('md.end_date <= ?', Application_Model_General::dateToUs($end_date))\n\t\t->where('md.status=1');\n\t\treturn $mcoData->fetchAll($select);\n\t}", "function edit_vehicle($id)\n {\n $vehicle = $this->member_model->vehicle_by_id($id);\n if ($vehicle) {\n echo json_encode(array('status' => TRUE, 'vehicle' => $vehicle));\n } else {\n echo json_encode(array('status' => FALSE, 'msg' => 'Failed getting data'));\n }\n }", "public function shipment_item_vehicle($category,$subcategory)\n\n\t{\n\n\n\n\t\t$data['related_company']=$this->shipping->select_data('shipping_related_website');\n\n\t\t$data['category_id']=$category;\n\n\t\t$data['subcategory_id']=$subcategory;\n\n\t\t$this->load->view('shipment/vehicle-trailer',$data);\n\n\t}", "public function getTypeOfVehicles()\n {\n //creating twoWheelerVehicle object\n $twoWheelVehicle = new twoWheelerVehicle(); \n //returning twoWheelVehicle object\n return $twoWheelVehicle; \n }", "public function getCarRental()\r\n {\r\n return $this->_carRental;\r\n }", "function getVehicleListVehicleGroupingVehicle($parent_admin_id,$DbConnection)\n{\n\t$vehicle_list=array();\t\n\t$query_admin_vehicle=\"SELECT vehicle_grouping.vehicle_id,vehicle.vehicle_name FROM vehicle_grouping USE INDEX(vg_vid_accid_status),vehicle USE INDEX(v_vehicleid_status) WHERE \".\n\t\"vehicle_grouping.account_id = $parent_admin_id AND vehicle_grouping.status=1 AND vehicle.vehicle_id=vehicle_grouping.vehicle_id AND \".\n\t\" vehicle.status=1\";\n\t//echo $query_admin_vehicle;\n\t$result_admin_vehicle = mysql_query($query_admin_vehicle,$DbConnection);\n\twhile($row=mysql_fetch_object($result_admin_vehicle))\n\t{\n\t\t//echo $row->customer_no;\n\t\t$vehicle_list[]=$row->vehicle_name;\t\t\n\t}\n\treturn $vehicle_list;\n}", "public function agent()\n {\n \treturn $this->belongsTo(Agent::class, 'agent_id');\n }", "public function driver(): BelongsTo\n {\n return $this->belongsTo(Driver::class);\n }", "public function getSingleVehicle(): Vehicle\n {\n throw new DownloadException(\n sprintf('Cannot call %s from %s', __METHOD__, static::class)\n );\n }", "public function attorney(){\r\n if($this->attorney_id >0)\r\n return Consultant::find($this->attorney_id);\r\n else\r\n return -1;\r\n }", "public function report()\n {\n return $this->belongsTo(Report::class);\n }", "public function village()\n {\n return $this->belongsTo(Village::class);\n }", "public function updated(Vehicle $vehicle)\n {\n //\n }", "public function vueloOrigen(){\n \treturn $this->hasOne(Vuelo::class,'aeropuertoOrigen_id');\n\t}", "public function getVenta(){\n return $this->belongsTo(Ventas::class,'id_venta');\n }", "public function driver_location()\n {\n return $this->belongsTo('App\\Models\\DriverLocation','driver_id','user_id');\n }", "public function fuel()\n {\n return $this->belongsTo(Fuel::class, 'fuel_id', 'id');\n }", "function jx_vehicle_details()\r\n\t\t{\r\n\t\t\t$user=$this->erpm->auth(PNH_SHIPMENT_MANAGER);\r\n\t\t\t$manifesto_id=$this->input->post('manifesto_id');\r\n\t\t\t$output=array();\r\n\t\t\t$output['vehicle_details']=$this->db->query(\"select hndleby_vehicle_num,start_meter_rate,amount from pnh_m_manifesto_sent_log where id=?\",$manifesto_id)->result_array();\r\n\t\t\techo json_encode($output);\r\n\t\t}", "public function getDatedVehicleJourneyRef()\n {\n return $this->datedVehicleJourneyRef;\n }", "function getVIDINVnameAr($local_account_id,$DbConnection)\n {\n $query =\"SELECT DISTINCT vehicle.vehicle_id, vehicle.vehicle_name, vehicle_assignment.device_imei_no FROM vehicle,vehicle_assignment,\".\n \"vehicle_grouping USE INDEX(vg_accountid_status) WHERE vehicle.vehicle_id = vehicle_assignment.vehicle_id AND vehicle.status='1' AND \".\n \" vehicle_assignment.status = '1' AND vehicle.vehicle_id=vehicle_grouping.vehicle_id AND vehicle_grouping.account_id\".\n \"=$local_account_id AND vehicle_grouping.status=1\"; \n $result = @mysql_query($query, $DbConnection);\t\t \n while($row = mysql_fetch_object($result))\n {\n /*$vid[]= $row->vehicle_id;\n $device[] = $row->device_imei_no;\n $vname[] = $row->vehicle_name;*/\n $data[]=array('vid'=>$row->vehicle_id,'device'=>$row->device_imei_no,'vname'=>$row->vehicle_name);\n } \n return $data;\n }", "public function reservation()\n {\n return $this->belongsTo('Reservation');\n }", "public function car() {\n return $this->hasMany('\\App\\Car');\n }", "public function getBusDriverID(){return $this->bus_driver_ID;}", "public function bookTicket()\n {\n $data = Session::get('key');\n $data1 = Session::get('key2');\n $date2 = Session::get('key3');\n $vehicleTypeS = Session::get('key4');\n $destination = DB::table('destinations')->where('name','=',$data1)->value('image');\n $routes = Route::where([\n ['start_point', '=', $data],\n ['end_point', '=', $data1],\n ])->get();\n $vehicleType = VehicleType::where([\n ['id', '=', $vehicleTypeS],\n ])->get();\n $vehicle = Vehicle::all();\n\n\n return view('bookTicket.bookTicket', compact('routes', 'vehicleType','vehicle','date2','destination'));\n }", "public function visitorBookRoom()\n {\n return $this->hasMany('App\\Models\\VisitorBookRoom');\n }", "public function createVehichle()\n {\n $cities = Cities::OrderBy('id','desc')->get();\n $currencies = Currencies::OrderBy('id','desc')->get();\n $categories = Categories::OrderBy('id','desc')->get();\n $inclusion = Inclusions::OrderBy('id','desc')->get();\n $equiments = Equipments::OrderBy('id','desc')->get();\n $services = AdditionalServices::OrderBy('id','desc')->get();\n return view('admin.vehicles.create',array('page_title'=>\"Admin Dashboard Create Vehicles\",'cities'=>$cities,'currencies'=>$currencies,'categories'=>$categories,'inclusions'=>$inclusion,'equiments'=>$equiments,'services'=>$services));\n }", "public function getTwoWheelerVehicle()\n { \n //creating new twoWheelerVehicle object\n $twoWheelVehicle = new twoWheelerVehicle(); \n $twoWheelVehicle = $twoWheelVehicle->getTwoWheelerVehicle(); // calling getMenus function of VegRestaurant class on vegRestaurant object\n echo \"Here are the two wheeler vechicles which you are looking for\\n \";\n }", "public function vendor()\n {\n // A product can only belong to one vendor\n return $this->belongs_to('Vendor');\n }", "function getDetailAllVisitPerson($common_id1,$DbConnection)\n{ \n\t$query = \"select vehicle_name,vehicle_id from vehicle where vehicle_id IN \".\n\t\"(select vehicle_id from vehicle_grouping USE INDEX(vg_accountid_status) where account_id='$common_id1' and status='1') and status=1\"; \t\t\t\n\t$result=mysql_query($query,$DbConnection); \t\t\t\t\t\t\t\n\twhile($row=mysql_fetch_object($result))\n\t{\n\t /*$person_id=$row->vehicle_id; \n\t $person_name=$row->vehicle_name;*/\n\t \n\t $data[]=array('person_id'=>$row->vehicle_id,'person_name'=>$row->vehicle_name);\t\n\t}\n\treturn $data;\n}" ]
[ "0.6562451", "0.6223954", "0.60183007", "0.5919616", "0.5905894", "0.5781175", "0.569876", "0.5680754", "0.5657009", "0.5564112", "0.55338395", "0.54870284", "0.53878796", "0.5387476", "0.5358703", "0.5332681", "0.53289884", "0.5300689", "0.52865624", "0.52715313", "0.5266619", "0.5255265", "0.52524936", "0.52389693", "0.52313006", "0.5221872", "0.5197457", "0.51912457", "0.5162138", "0.51515174", "0.5145395", "0.5088792", "0.50663906", "0.506174", "0.5035587", "0.50265133", "0.4997715", "0.4996758", "0.49911526", "0.49733984", "0.49733984", "0.49678987", "0.495623", "0.49477005", "0.49413574", "0.48824924", "0.48656988", "0.4861884", "0.48400012", "0.48362768", "0.4825587", "0.48226872", "0.47983754", "0.47922105", "0.47766393", "0.47572318", "0.4753313", "0.47498488", "0.4744299", "0.47376847", "0.47363216", "0.47243714", "0.47195503", "0.47160697", "0.47159594", "0.471021", "0.4708947", "0.4703182", "0.469874", "0.46878597", "0.4684307", "0.4679328", "0.46789584", "0.46771738", "0.46755028", "0.46745792", "0.4673395", "0.46692857", "0.46466136", "0.4632114", "0.4623794", "0.46216518", "0.4618523", "0.46128178", "0.46071482", "0.4591366", "0.45865163", "0.4582597", "0.45743936", "0.4573533", "0.4572644", "0.45682487", "0.45682228", "0.45666835", "0.45595923", "0.45563483", "0.45545998", "0.45512772", "0.45500857", "0.45256352" ]
0.6405491
1
This vehicle report belongs to a user
public function user() { return $this->belongsTo('App\User'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function report_user()\n\t{\n\t\treturn $this->BelongsTo('App\\User', 'report_user_id');\n\t}", "public function AddNew_Report(User $user)\n {\n }", "public function reporting_user()\n\t{\n\t\treturn $this->BelongsTo('App\\User', 'reporting_user_id');\n\t}", "public function user()\n {\n return $this->belongsTo('Poketracker\\Model\\User', 'user_id');\n }", "public function createdbyuser() {\n # Define an inverse one-to-many relationship.\n return $this->belongsTo('\\dsa\\User');\n }", "public function view(User $user, Waiver $waiver)\n {\n return $user->organization_id == $waiver->ticket->order->organization_id;\n }", "public function createdBy($user)\n {\n return ($this->author_id == $user) ? true : false;\n }", "public function get_portfolio_virtual_user();", "public function getEnteredBy()\n {\n return $this->hasOne(User::className(), ['id' => 'EnteredBy']);\n }", "public function getUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'user_id']);\n }", "public function getUserDetail() \r\n {\r\n return $this->hasOne(\\common\\models\\UserDetail::className(), ['user_id'=>'id']);\r\n }", "public function getViewUser()\n {\n return $this->belongsTo('App\\User', 'live_video_viewer_id');\n }", "public function user()\n {\n return $this->belongsTo('App\\Components\\User\\Models\\User', 'created_by');\n }", "public function owner()\n {\n return $this->belongsTo(Jetstream::userModel(), 'user_id');\n }", "public function user()\n {\n return $this->belongsTo('App\\User', 'personnel_no', 'personnel_no');\n }", "public function user()\n {\n return $this->belongsTo('openvidsys\\User','file_user_id');\n }", "public function dashboard_owner($user) {\n return $this->id === auth()->id();\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 setReportedBy($value)\n {\n $this->setItemValue('reported_by', ['id' => (int)$value]);\n }", "public function getCreateBy()\n {\n return $this->hasOne(User::className(), ['id' => 'created_by']);\n }", "public function agencyUser()\n {\n return $this->hasOne('App\\AgentUser');\n }", "public function owner()\n {\n return $this->belongsTo(Scorer::class, 'user_id');\n }", "public function view(User $user, Inventory $inventory)\n {\n return $user->id === $inventory->user->id;\n\n }", "public function getCreatedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'created_user_id']);\n }", "public function getCreatedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'created_user_id']);\n }", "public function getCreatedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'created_user_id']);\n }", "public function getCreatedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'created_user_id']);\n }", "public function getCreatedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'created_user_id']);\n }", "public function getCreatedUser()\n {\n return $this->hasOne(ScrtUser::className(), ['user_id' => 'created_user_id']);\n }", "public function user()\n {\n return $this->belongsTo('Furniture\\User', 'user_id');\n }", "public function reports(){\n return $this->hasMany(Report::class,\"user_reporting\");\n }", "public function user()\n {\n return $this->hasOneThrough(User::class, Client::class, 'user_id', 'id');\n }", "public function getUserstatistic()\n {\n return $this->hasOne(Userstatistic::className(), ['user_id' => 'id']);\n }", "public function buyer() {\n return $this->belongsTo(User::class);\n }", "public function getUser()\n {\n return $this->hasMany(User::className(), ['activity_status' => 'id']);\n }", "public function contractor() {\n return $this->belongsTo('App\\User', 'user_id');\n }", "public function user() {\n \n \treturn $this->belongsTo('User','created_by','id');\n }", "public function owner()\n {\n return $this->belongsTo(User::class, 'created_by');\n }", "public function view(User $user, Vacancy $vacancy)\n {\n if ($user->role === User::ROLE_ADMIN or $user->role === User::ROLE_WORKER or $user->id === $vacancy->employer_id) {\n return true;\n //просто поле подписчиков для рабочего не отображать\n }\n }", "public function addedBy()\n {\n return $this->belongsTo(User::class);\n }", "public function assigned_vehicles() {\n return view('clients.client_vehicles');\n /*$user_id = Session::get('user_id');\n $vehicles = User::find($user_id)->vehicles->toArray();\n print_r($vehicles);*/\n }", "public function allowedView($report, $user)\n {\n if(!$report->overall_score)\n throw new \\Exception(trans('reports.not_found'));\n\n if (!$user->hasRole('admin') && $report->user_id != $user->id) {\n throw new \\Exception(trans('reports.not_found'));\n }\n }", "public function createdBy() {\r\n return $this->belongsTo('User', 'created_by_id');\r\n }", "public function user()\n\t{\n\t\treturn $this->belongs_to('user');\n\t}", "public function user()\n {\n return $this->belongsTo('App\\User', 'created_by');\n }", "public function user()\n {\n return $this->belongsTo(Config::get('odotmedia.advertisements.user.model'));\n }", "public function user()\n {\n return $this->belongsTo('CompassHB\\Www\\Sermon');\n }", "public function project_lead()\n {\n return $this->belongsTo(User::class, 'project_lead_id');\n }", "public function creadaPor()\n {\n return $this->belongsTo('App\\User','created_by');\n }", "public function setCreatedBy($userID);", "public function user() \n\t{\n\t\treturn $this->belongsTo('User', 'object_id')->where('soft_deleted', 0);\n\t}", "public function userObject()\n {\n return $this->belongsTo('App\\User', 'senderUserID');\n }", "function admin_userReports()\n\t{\n\t\t$this->User->recursive = 0;\n\t\t$rol = $this->data['User']['role_id'];\t\n\t\tforeach($this->data['User'] as $indice =>$valor)\n\t\t{\n\t\t\tif($valor==1)\n\t\t\t{\n\t\t\t\t$array[] = $indice;\n\t\t\t}\n\t\t}\n\t\t$reporte = $this->User->find('all', array('fields'=>$array,'conditions'=>array('User.role_id'=>$rol)));\n\t\t$this->set(compact('reporte'));\n\t}", "public function user(){\n\t\t\treturn $this->belongsTo('User', 'user_id');\n\t\t}", "public function getUser()\n {\n return $this->hasOne(User::className(), ['id' => 'user_id'])->inverseOf('waitingLists');\n }", "public function owner(): BelongsTo\n {\n return $this->belongsTo(Hotstream::userModel(), 'user_id');\n }", "public function creadaPor()\n {\n return $this->belongsTo('App\\User','created_by');\n }", "public function user(){\n\t\treturn $this->hasOne(\\App\\Models\\User::class,'id','created_by_user_id');\n\t}", "public function createdBy()\n {\n return $this->belongsTo(User::class, 'created_by_id');\n }", "public function user()\n {\n return $this->belongsTo('App\\Models\\User','created_by');\n }", "public function created_by()\n {\n return $this->belongsTo(User::class);\n }", "public function getCreatedBy() {\n\t\treturn $this->hasOne ( User::className (), [ \n\t\t\t\t'id' => 'created_by_id' \n\t\t] );\n\t}", "public function vendor() {\n return $this->belongsTo(User::class);\n }", "public function view(User $user, Carrito $carrito)\n {\n return $user->id === $carrito->user_id;\n }", "public function user()\n {\n return $this->belongsTo('DSIproject\\User');\n }", "private function participated($report, $user)\n {\n $reviewerParticipated = $this->reportRepository->hasReviewerParticipated($report->id, $user->id);\n\n if($reviewerParticipated)\n {\n throw new \\Exception(trans('reports.no_participation'));\n }\n }", "public function getCreatedBy()\n {\n return $this->hasOne(User::className(), ['id' => 'created_by']);\n }", "public function getCreatedBy()\n {\n return $this->hasOne(User::className(), ['id' => 'created_by']);\n }", "public function getCreatedBy()\n {\n return $this->hasOne(User::className(), ['id' => 'created_by']);\n }", "public function getCreatedBy()\n {\n return $this->hasOne(User::className(), ['id' => 'created_by']);\n }", "public function user()\n {\n return $this->belongsTo('\\Illuminate\\Foundation\\Auth\\User', 'created_by');\n }", "public function user()\n {\n return $this->belongsTo('\\Illuminate\\Foundation\\Auth\\User', 'created_by');\n }", "public function viewedBy()\n {\n return $this->belongsToMany(\n 'App\\Models\\User',\n 'viewed_threads',\n 'thread_id',\n 'user_id'\n )\n ->using('App\\Models\\ViewedThread')\n ->withPivot('timestamp');\n }", "public function cashierUser()\n {\n return $this->belongsTo(\\App\\Models\\User::class, 'cashier_user_id');\n }", "public function created_by() {\n return $this->belongsTo(User::class,'created_by_id');\n }", "public function assignby(){\n return $this->belongsTo(User::class,'assignBy','id');\n }", "public function oneToManyRelation(Request $request){\n $userData = User::all();\n $vehicleData = Vehicle::all(); \n // $vehicleData = Vehicle::with('getUser')->get(); \n return view('pages.one_to_many', compact('userData', 'vehicleData'));\n }", "public function user() {\n\t\t\treturn $this->belongsTo(User::class,'user_id');\n }", "public function closedBy()\n {\n return $this->belongsTo(\\App\\User::class, 'closed_by_id');\n }", "public function actionReportUser()\n {\n $searchModel = new ReportSearch();\n $params = Yii::$app->request->get();\n $searchModel->setAttribute('user_id', Yii::$app->user->id);\n\n /** @var ActiveDataProvider $dataProvider */\n $dataProvider = $searchModel->searchReportUser($params);\n $dataProvider->query->orderBy('report_date DESC');\n\n return $this->render('report-user', [\n 'dataProvider' => $dataProvider,\n 'searchModel' => $searchModel,\n '_params_' => $params\n ]);\n }", "public function owner(){\n\n\t\treturn $this->belongsTo('App\\User', 'user_id');\n\n\t}", "public function getUser()\n {\n return $this->hasOne(Account::className(), ['id' => 'userid']);\n }", "public function getRequesterVpoUserId()\n\t{\n\t\treturn $this->requester_vpo_user_id;\n\t}", "public function user()\n {\n return $this->belongsTo('F3\\Models\\User', 'party_id', 'party_id');\n }", "public function user()\n {\n return $this->belongsTo('LRC\\Data\\Users\\User','user_id');\n }", "public function user()\n\t{\n\t\treturn $this->belongsToMany('Trip');\n\t}", "public function user()\n {\n return $this->pulse_survey->belongsTo(User::class);\n }", "public function user() {\n\t\treturn $this->belongsTo(User::class, 'user_id');\n\t}", "public function user()\n {\n return $this->belongsTo(User::class); //, 'client_id', 'id');\n }", "function userDetails() {\n return $this->hasOne('App\\Models\\User', 'id', 'receiver_user_id')->withTrashed();\n }", "public function setCreatedBy($createdBy);", "public function GetisOwnerThisRecord(){\n return ($this->{$this->nameFieldUserId}==h::userId());\n}", "function quantizer_expenses_user_report($user = null, $start_date= null, $end_date = null)\r\n\t\t{\r\n\t\t\t// ya que sino daria un error al generar el pdf.\r\n\t\t\tConfigure::write('debug',0);\r\n\r\n\t\t\t$resultado = $this->calculateQuantizerUsersExpenses($user, $start_date, $end_date);\r\n\t\t\t\r\n\t\t\t$resultado['Details']['start_date'] = $this->RequestAction('/external_functions/setDate/'.$start_date);\r\n\t\t\t$resultado['Details']['end_date'] = $this->RequestAction('/external_functions/setDate/'.$end_date);\r\n\t\t\t$resultado['Details']['date_today'] = date('d-m-Y H:i:s');\r\n\t\t\t\r\n\t\t\t$user = $this->RequestAction('/external_functions/getDataSession');\r\n\t\t\t\r\n\t\t\t$resultado['Details']['generated_by'] = $user['User']['name'].' '.$user['User']['first_lastname'];\r\n\r\n\t\t\t$this->set('data', $resultado);\r\n\t\t\t$this->layout = 'pdf';\r\n\t\t\t$this->render();\r\n\t\t}", "public function owner()\n {\n return $this->belongsTo('App\\Models\\User', 'user_id');\n }", "function check_own_vehicle($cid)\n\t{\n\t\tglobal $userdata, $template, $db, $SID, $lang, $phpEx, $phpbb_root_path, $garage_config, $board_config;\n\t\n\t\tif (empty($cid))\n\t\t{\n\t \t\tmessage_die(GENERAL_ERROR, $lang['No_vehicle_id_specified'], '', __LINE__, __FILE__);\n\t\t}\n\t\n\t\t$sql = \"SELECT g.member_id FROM \" . GARAGE_TABLE . \" AS g WHERE g.id = $cid \";\n\t\n\t\tif( !($result = $db->sql_query($sql)) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could not query users', '', __LINE__, __FILE__, $sql);\n\t\t}\n\t\n\t\t$vehicle = $db->sql_fetchrow($result); \n\t\t$db->sql_freeresult($result);\n\t\n\t\tif ( $userdata['user_level'] == ADMIN || $userdata['user_level'] == MOD )\n\t\t{\n\t\t\t//Allow A Moderator Or Administrator Do What They Want....\n\t\t\treturn;\n\t\t}\n\t\telse if ( $vehicle['member_id'] != $userdata['user_id'] )\n\t\t{\n\t\t\t$message = $lang['Not_Vehicle_Owner'] . \"<br /><br />\" . sprintf($lang['Click_return_garage'], \"<a href=\\\"\" . append_sid(\"garage.$phpEx\") . \"\\\">\", \"</a>\") . \"<br /><br />\" . sprintf($lang['Click_return_index'], \"<a href=\\\"\" . append_sid(\"index.$phpEx\") . \"\\\">\", \"</a>\");\n\t\n\t\t\tmessage_die(GENERAL_MESSAGE, $message);\n\t\t}\n\t\n\t\treturn ;\n\t}", "public function user()\n {\n return $this->belongsTo(User::class);//relacionamento da ordem 1\n }", "public function user() {\n\t\treturn $this->belongsTo ( User::class );\n\t}", "public function user() {\n\t\treturn $this->belongsTo ( User::class );\n\t}", "public function vehicle_details_create(Request $request) {\n\n $vehicle_details = new UserVehicle;\n \n $vehicle_details->user_id = $request->user_id;\n\n return view('admin.vehicle_details.create')\n ->with('page' , 'vehicle_details')\n ->with('sub_page','vehicle_detials-create')\n ->with('vehicle_details', $vehicle_details); \n }", "public function actionReportuser(){\n $type = htmlentities($_GET['type']);\n $page = preg_replace('/[^-a-zA-Z0-9_]/', '', $type);\n $id = (int) $_GET['id'];\n $reason = htmlentities($_GET['reason']);\n if($type == 'others' && $reason != ''){\n $type = $reason;\n }\n $report = new FlagReports;\n $report->reported_by = \\Yii::$app->user->getId();\n $report->user_id = $id;\n $report->report = $type;\n $report->datetimestamp = date('Y-m-d H:i:s', time());\n if($report->save()){\n echo \"true\";\n }else{\n echo \"false\";\n }\n }", "public function owner()\n {\n return $this->belongsTo(Spark::userModel(), 'owner_id');\n }" ]
[ "0.61480725", "0.5628256", "0.5566684", "0.5557405", "0.5542957", "0.5451535", "0.5439028", "0.5431076", "0.5404796", "0.53811646", "0.536773", "0.53324884", "0.5330861", "0.52952045", "0.52798516", "0.5260259", "0.52552086", "0.52526665", "0.52458996", "0.5230149", "0.5225573", "0.5224375", "0.5213235", "0.52105385", "0.52105385", "0.52105385", "0.52105385", "0.52105385", "0.52105385", "0.5199427", "0.5196875", "0.5196584", "0.51899", "0.5175624", "0.5164322", "0.516053", "0.5158329", "0.51570314", "0.51558733", "0.51501507", "0.51473355", "0.51380765", "0.5126096", "0.51231956", "0.5119231", "0.5118247", "0.51085925", "0.5106901", "0.5103383", "0.510323", "0.5097061", "0.50938946", "0.50931686", "0.50926316", "0.5089729", "0.50814027", "0.50788593", "0.50778234", "0.5072002", "0.5068459", "0.5066073", "0.50638235", "0.5062362", "0.505815", "0.50580466", "0.505455", "0.50506514", "0.50506514", "0.50506514", "0.50506514", "0.50442433", "0.50442433", "0.50441194", "0.50407517", "0.5037503", "0.50335693", "0.5023841", "0.5020905", "0.50183135", "0.50182474", "0.5014976", "0.5008347", "0.50019985", "0.5001882", "0.5000358", "0.49999806", "0.49997285", "0.49945688", "0.4994312", "0.49884394", "0.49881703", "0.49858004", "0.49828678", "0.49827874", "0.49820346", "0.4981178", "0.49808288", "0.49808288", "0.49788782", "0.49760747", "0.4975913" ]
0.0
-1
Get price suggestion optimized for participation
public function priceSuggestionsForParticipation(Participation $participation) { return $this->suggestionListForParticipation($participation, true, false); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function resolvePrice();", "protected function findPrice()\n\t{\n\t\trequire_once(TL_ROOT . '/system/modules/isotope/providers/ProductPriceFinder.php');\n\n\t\t$arrPrice = ProductPriceFinder::findPrice($this);\n\n\t\t$this->arrData['price'] = $arrPrice['price'];\n\t\t$this->arrData['tax_class'] = $arrPrice['tax_class'];\n\t\t$this->arrCache['from_price'] = $arrPrice['from_price'];\n\t\t$this->arrCache['minimum_quantity'] = $arrPrice['min'];\n\n\t\t// Add \"price_tiers\" to attributes, so the field is available in the template\n\t\tif ($this->hasAdvancedPrices())\n\t\t{\n\t\t\t$this->arrAttributes[] = 'price_tiers';\n\n\t\t\t// Add \"price_tiers\" to variant attributes, so the field is updated through ajax\n\t\t\tif ($this->hasVariantPrices())\n\t\t\t{\n\t\t\t\t$this->arrVariantAttributes[] = 'price_tiers';\n\t\t\t}\n\n\t\t\t$this->arrCache['price_tiers'] = $arrPrice['price_tiers'];\n\t\t}\n\t}", "abstract public function getPrice();", "private function getPrices () {\n\t\tlibxml_use_internal_errors(true);\n\t\n\t\t$dom = new DOMDocument();\n\n\t\t@$dom->loadHTML( $this->result );\n\t\t$xpath = new DOMXPath( $dom );\n\t\t\n\t\t$this->prices[] = array(\n\t\t\t'station.from' => $this->getPostField('from.searchTerm'),\n\t\t\t'station.to' => $this->getPostField('to.searchTerm'),\n\t\t\t'station.prices' => $xpath->query($this->config['lookupString'])\n\t\t);\n\t}", "protected function calculatePrices()\n {\n }", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public function getPrice();", "public function requestBestPrices() {\n\t\t/* @var $uploadRequest Dhl_MeinPaket_Model_Xml_Request_ProductDataRequest */\n\t\t$productDataRequest = Mage::getModel ( 'meinpaketcommon/xml_request_dataRequest' );\n\t\t\n\t\t/* @var $client Dhl_MeinPaket_Model_Client_XmlOverHttp */\n\t\t$client = Mage::getModel ( 'meinpaketcommon/client_xmlOverHttp' );\n\t\t\n\t\ttry {\n\t\t\t/* @var $collection Mage_Catalog_Model_Resource_Product_Collection */\n\t\t\t$collection = Mage::getModel ( 'catalog/product' )->getCollection ()->addStoreFilter ( Mage::helper ( 'meinpaketcommon/data' )->getMeinPaketStoreId () );\n\t\t\t\n\t\t\t$collection->addAttributeToFilter ( 'meinpaket_id', array (\n\t\t\t\t\t'neq' => '' \n\t\t\t) );\n\t\t\t$collection->addAttributeToFilter ( 'sync_with_dhl_mein_paket', array (\n\t\t\t\t\t'gt' => '0' \n\t\t\t) );\n\t\t\t\n\t\t\tforeach ( $collection as $productId ) {\n\t\t\t\t$productDataRequest->addBestPriceProduct ( $productId );\n\t\t\t}\n\t\t\treturn $response = $client->send ( $productDataRequest, true );\n\t\t} catch ( Exception $e ) {\n\t\t\tMage::logException ( $e );\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "public function computePriceProvider(){\n\n /*Price once a child is < 4 years full day 0€*/\n yield [Booking::TYPE_DAY, '2019-01-01' , false, 0];\n /*Price once a child is < 4 years full day \"reduce\" 0€*/\n yield [Booking::TYPE_DAY, '2019-01-01', true, 0];\n /*Price once a child is < 4 years half day 0€*/\n yield [Booking::TYPE_HALF_DAY, '2019-01-01', false, 0];\n /*Price once a child is < 4 years half day \"reduce\" 0€*/\n yield [Booking::TYPE_HALF_DAY, '2019-01-01', true, 0];\n\n\n /*Price once a child is 4 - 12 years full day 8€*/\n yield [Booking::TYPE_DAY, '2014-01-01', false, 8];\n /*Price once a child is 4 - 12 years full day \"reduce\" 8€*/\n yield [Booking::TYPE_DAY, '2014-01-01', true, 8];\n /*Price once a child is 4 - 12 years half day 4€*/\n yield [Booking::TYPE_HALF_DAY, '2014-01-01', false, 4];\n /*Price once a child is 4 - 12 years half day \"reduce\" 4€*/\n yield [Booking::TYPE_HALF_DAY, '2014-01-01', true, 4];\n\n\n /*Price normal full day 16€*/\n yield [Booking::TYPE_DAY, '1980-01-01', false, 16];\n /*Price normal full day \"reduce\" 10€*/\n yield [Booking::TYPE_DAY, '1980-01-01', true, 10];\n /*Price normal half day 8€*/\n yield [Booking::TYPE_HALF_DAY, '1980-01-01', false, 8];\n /*Price normal half day \"reduce\" 5€*/\n yield [Booking::TYPE_HALF_DAY, '1980-01-01', true, 5];\n\n\n /*Price senior >60 years full day 12€*/\n yield [Booking::TYPE_DAY, '1955-01-01', false, 12];\n /*Price senior >60 years full day \"reduce\" 10€*/\n yield [Booking::TYPE_DAY, '1955-01-01', true, 10];\n /*Price senior >60 years half day 6€*/\n yield [Booking::TYPE_HALF_DAY, '1955-01-01', false, 6];\n /*Price senior >60 years half day \"reduce\" 5€*/\n yield [Booking::TYPE_HALF_DAY, '1955-01-01', true, 5];\n\n }", "public function getPricingRecommendations()\n {\n return $this->pricingRecommendations;\n }", "public function getBestPrice() {\n\t\ttry {\n\t\t\treturn Mage::getSingleton ( 'meinpaket/service_productData_requestService' )->requestBestPrices ();\n\t\t} catch ( Exception $e ) {\n\t\t\tMage::logException ( $e );\n\t\t}\n\t\treturn null;\n\t}", "private function findRecommendation(){\n $placeModel = new Place();\n $places = $placeModel->getAllCategorized();\n $bestScore = PHP_INT_MAX;\n $idBest = 0;\n\n foreach($places as $place){\n $currScore = 0;\n $currScore += abs($place->heritage - $this->score['heritage'] );\n $currScore += abs($place->relax - $this->score['relax'] );\n $currScore += abs($place->sightseeing - $this->score['sightseeing']);\n $currScore += abs($place->weather - $this->score['weather']) ;\n $currScore += abs($place->populated - $this->score['populated'] );\n\n if($currScore < $bestScore){\n $bestScore = $currScore;\n $idBest = $place->id_plc;\n }\n\n }\n\n return $idBest;\n }", "public function getTaxedPrice();", "abstract function getPriceFromAPI($pair);", "private function recommendation($skill){\n $recommendationPoint=0;\n $recommendationPointMaster=0;\n $recommendationPointFive=0;\n $recommendationPointFour=0;\n $recommendationPointThree=0;\n $recommendationPointTwo=0;\n $recommendationPointOne=0;\n $recommendations=$skill->recommendations;\n foreach($recommendations as $recommendation){\n $recommendator=$recommendation->user;\n $rate=$recommendator->rate;\n if($recommendator->is('influencer')){\n $recommendationPointMaster+=Config::get('rate')['recommendation']['attributes']['master']['value'];\n if($recommendationPointMaster>=Config::get('rate')['recommendation']['attributes']['master']['max_value']){\n $recommendationPointMaster=Config::get('rate')['recommendation']['attributes']['master']['max_value'];\n }\n }elseif($rate==5){\n $recommendationPointFive+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointFive>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointFive=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }elseif($rate==4){\n $recommendationPointFour+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointFour>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointFour=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }elseif($rate==3){\n $recommendationPointThree+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointThree>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointThree=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }elseif($rate==2){\n $recommendationPointTwo+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointTwo>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointTwo=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }elseif($rate==1){\n $recommendationPointOne+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointOne>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointOne=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }\n $recommendationPoint=$recommendationPointMaster+$recommendationPointFive+$recommendationPointFour+$recommendationPointThree+$recommendationPointTwo+$recommendationPointOne;\n }\n //finalize the recommendation calculation points\n if($recommendationPoint>Config::get('rate')['recommendation']['result'][5]){ //5 star\n $calculatedRecommendationPoint=5;\n }elseif($recommendationPoint>Config::get('rate')['recommendation']['result'][4] && $recommendationPoint<=Config::get('rate')['recommendation']['result'][5]){ //4 star\n $calculatedRecommendationPoint=4;\n }elseif($recommendationPoint>Config::get('rate')['recommendation']['result'][3] && $recommendationPoint<=Config::get('rate')['recommendation']['result'][4]){ //3 star\n $calculatedRecommendationPoint=3;\n }elseif($recommendationPoint>Config::get('rate')['recommendation']['result'][2] && $recommendationPoint<=Config::get('rate')['recommendation']['result'][3]){ //2 star\n $calculatedRecommendationPoint=2;\n }elseif($recommendationPoint>=Config::get('rate')['recommendation']['result'][1] && $recommendationPoint<=Config::get('rate')['recommendation']['result'][2]){ //1 star\n $calculatedRecommendationPoint=1;\n }else{ //none star\n $calculatedRecommendationPoint=1;\n }\n $finalRecommendationPoint=$calculatedRecommendationPoint*Config::get('rate')['recommendation']['weight'];\n return $finalRecommendationPoint;\n }", "public function getPrices()\n {\n }", "static function getPrice($procent , $price){\n return $price - ( $price / 100 * $procent);\n }", "public function get_price($q) {\n if (@$this->record->range1) {\n if ($q <= $this->record->range1) {\n return $this->record->price1;\n }\n if ($this->record->range2) {\n if ($q <= $this->record->range2) {\n return $this->record->price2;\n }\n if ($this->record->range3) {\n if ($q <= $this->record->range3) {\n return $this->record->price3;\n }\n if ($this->record->range4) {\n if ($q <= $this->record->range4) {\n return $this->record->price4;\n }\n if ($this->record->range4) {\n if ($q <= $this->record->range4) {\n return $this->record->price4;\n } else {\n return $this->record->price5;\n }\n } else {\n return $this->record->price4;\n }\n } else {\n return $this->record->price4;\n }\n } else {\n return $this->record->price3;\n }\n } else {\n return $this->record->price2;\n }\n } else {\n return @$this->record->price1;\n }\n }", "public function getPrice(): string;", "function getArticlesByPrice($priceMin=0, $priceMax=0, $usePriceGrossInstead=0, $proofUid=1){\n //first get all real articles, then create objects and check prices\n\t //do not get prices directly from DB because we need to take (price) hooks into account\n\t $table = 'tx_commerce_articles';\n\t $where = '1=1';\n\t if($proofUid){\n\t $where.= ' and tx_commerce_articles.uid_product = '.$this->uid;\n\t }\t\n //todo: put correct constant here\n\t $where.= ' and article_type_uid=1';\n\t $where.= $this->cObj->enableFields($table);\n\t $groupBy = '';\n\t $orderBy = 'sorting';\n\t $limit = '';\n\t $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery (\n\t 'uid', $table,\n\t $where, $groupBy,\n\t $orderBy,$limit\n\t );\n\t $rawArticleUidList = array();\n\t while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t $rawArticleUidList[] = $row['uid'];\n\t }\n\t $GLOBALS['TYPO3_DB']->sql_free_result($res);\n\t \n\t //now run the price test\n\t $articleUidList = array();\n\t foreach ($rawArticleUidList as $rawArticleUid) {\n\t\t $tmpArticle = new tx_commerce_article($rawArticleUid,$this->lang_uid);\n\t\t $tmpArticle->load_data();\n\t\t\t $myPrice = $usePriceGrossInstead ? $tmpArticle->get_price_gross() : $tmpArticle->get_price_net();\n\t\t\t if (($priceMin <= $myPrice) && ($myPrice <= $priceMax)) {\n\t\t\t $articleUidList[] = $tmpArticle->get_uid();\n\t\t\t }\n\t\t }\n if(count($articleUidList)>0){\n return $articleUidList;\n }else{\n return false;\n\t }\n\t}", "public function getPrice() {\n }", "function suggest()\n\t{\n\t\t//allow parallel searchs to improve performance.\n\t\tsession_write_close();\n\t\t$params = $this->session->userdata('price_rules_search_data') ? $this->session->userdata('price_rules_search_data') : array('deleted' => 0);\n\t\t$suggestions = $this->Price_rule->get_search_suggestions($this->input->get('term'),$params['deleted'],100);\n\t\techo json_encode(H($suggestions));\n\t}", "public function bestPriceProvider()\n {\n return [\n [0, 100.0, 50.0, 50.0],\n [0, 100.0, 150.0, 100.0],\n [1, 100.0, 50.0, 50.0],\n [1, 100.0, 150.0, 100.0],\n [2, 100.0, 50.0, 100.0],\n [2, 100.0, 150.0, 150.0],\n [3, 100.0, 50.0, 100.0],\n [3, 100.0, 150.0, 150.0],\n [4, 100.0, 50.0, 50.0],\n [4, 100.0, 150.0, 100.0],\n [5, 100.0, 50.0, 50.0],\n [5, 100.0, 150.0, 100.0],\n ];\n }", "public function getPriceFromDatabase()\n {\n }", "public function getCompetitivePricingForSKU($request);", "function get_price($find){\n\t$books=array(\n\t\t\"paris-seoul\"=>599,\n\t\t\"paris-madrid\"=>400,\n\t\t\"paris-marseille\"=>387\n\t)\n\t;\n\n\tforeach ($books as $book => $price) {\n\t\tif($book==$find){\n\t\t\treturn $price;\n\t\t\tbreak;\n\t\t}\n\t}\n}", "public function getPrice(): float;", "public function getPrice(): float;", "public function getMyPriceForSKU($request);", "public function getPriceNet();", "public function getPrice()\n {\n }", "public function getPrice()\n {\n }", "private function suggestionsForParticipation(Participation $participation, bool $isPriceSet, bool $isPayment)\n {\n $qb = $this->em->getConnection()->createQueryBuilder();\n $qb->select(['y.price_value AS value', 'y.description', 'MAX(y.created_at)'])\n ->from('participant_payment_event', 'y')\n ->innerJoin('y', 'participant', 'a', 'y.aid = a.aid')\n ->innerJoin('a', 'participation', 'p', 'a.pid = p.pid')\n ->andWhere($qb->expr()->eq('p.pid', ':pid'))\n ->setParameter('pid', $participation->getPid())\n ->andWhere('y.is_price_set = :is_price_set')\n ->setParameter('is_price_set', (int)$isPriceSet)\n ->andWhere('y.is_price_payment = :is_price_payment')\n ->setParameter('is_price_payment', (int)$isPayment)\n ->groupBy(['y.price_value', 'y.description']);\n $result = $qb->execute()->fetchAll();\n\n $suggestions = [];\n foreach ($result as $payment) {\n if (!isset($suggestions[$payment['value']])) {\n $suggestions[$payment['value']] = [];\n }\n if (!isset($suggestions[$payment['value']][$payment['description']])) {\n $suggestions[$payment['value']][$payment['description']] = 0;\n }\n ++$suggestions[$payment['value']][$payment['description']];\n }\n $suggestionsFlat = [];\n foreach ($suggestions as $value => $descriptions) {\n foreach ($descriptions as $description => $count) {\n $suggestionsFlat[] = [\n 'value' => $value,\n 'description' => $description,\n 'count' => $count,\n ];\n }\n }\n usort(\n $suggestionsFlat, function ($a, $b) {\n if ($a['count'] == $b['count']) {\n return 0;\n }\n return ($a['count'] < $b['count']) ? -1 : 1;\n }\n );\n\n return $suggestionsFlat;\n }", "public function getBestBuyPrice($url) {\n try {\n $price = null;\n\n if ($this->isBlocked($url)) {\n echo \"<div style='color: red'>URL no disponible</div><br>\";\n } else {\n $crawler = $this->client->request('GET', $url);\n\n // Precio actual\n $elements = $crawler->filter('.pb-hero-price')->each(function($node){\n return $node->text();\n });\n\n if (count($elements) < 1) {\n // Precio regular\n $elements = $crawler->filter('.pb-regular-price')->each(function($node){\n return $node->text();\n });\n }\n\n $price = (isset($elements[0])) ? $this->cleanPrice($elements[0]) : null;\n }\n\n return $price;\n } catch (Exception $ex) {\n echo \"<br><div style='color: red;'>\" . $ex->getMessage() . \" \" . $ex->getLine() . \" \" . $ex->getFile() . \"</div><br>\";\n }\n }", "public function getCoppelPrice($url) {\n try {\n $price = null;\n\n if ($this->isBlocked($url)) {\n echo \"<div style='color: red'>URL no disponible</div><br>\";\n } else {\n $crawler = $this->client->request('GET', $url);\n\n // Precio actual\n $elements = $crawler->filter('.pcontado')->each(function ($node) {\n return $node->text();\n });\n\n if (count($elements) < 1) {\n // Precio regular\n $elements = $crawler->filter('.p_oferta')->each(function ($node) {\n return $node->text();\n });\n }\n\n $price = (isset($elements[0])) ? $this->cleanPrice($elements[0]) : null;\n }\n\n return $price;\n } catch (Exception $ex) {\n echo \"<br><div style='color: red;'>\" . $ex->getMessage() . \" \" . $ex->getLine() . \" \" . $ex->getFile() . \"</div><br>\";\n }\n }", "function getPriceSituation($game_id, $round_number, $company_id, $product_number, $region_number, $channel_number){\r\n\t\t\t$prices=new Model_DbTable_Decisions_Mk_Prices();\r\n\t\t\t$result=$prices->getAllDecisions($game_id, $round_number);\r\n\t\t\t$result_company=$result['company_id_'.$company_id];\r\n\t\t\t$result_product=$result_company['product_'.$product_number];\r\n\t\t\t$result_channel=$result_product['channel_'.$channel_number];\r\n\t\t\t$result_region=$result_channel['region_'.$region_number];\r\n\t\t\t$company_price=$result_region;\r\n\t\t\t$max=0;\r\n\t\t\t$min=0;\r\n\t\t\t$min_counter=0;\r\n\t\t\t$companies=$this->getCompaniesInGame($game_id);\r\n\t\t\tforeach ($companies as $company) {\r\n\t\t\t\tif($company['id']!=$company_id){\r\n\t\t\t\t\t$result_company=$result['company_id_'.$company['id']];\r\n\t\t\t\t\t$result_product=$result_company['product_'.$product_number];\r\n\t\t\t\t\t$result_channel=$result_product['channel_'.$channel_number];\r\n\t\t\t\t\t$result_region=$result_channel['region_'.$region_number];\r\n\t\t\t\t\t$price=$result_region;\r\n\t\t\t\t}\r\n\t\t\t\telse $price=$company_price;\r\n\t\t\t\t//var_dump($price);\r\n\t\t\t\tif($min_counter==0){\r\n\t\t\t\t\t$min=$price;\r\n\t\t\t\t\t$min_counter++;\r\n\t\t\t\t}\r\n\t\t\t\tif ($price>$max){\r\n\t\t\t\t\t$max=$price;\r\n\t\t\t\t}\r\n\t\t\t\tif (($price<$min)&&($price!=0)){\r\n\t\t\t\t\t$min=$price;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif($min==$max){\r\n\t\t\t\treturn 100;\r\n\t\t\t}\r\n\t\t\t//$scale=$max-$min;\r\n\t\t\t//$situation=(($company_price*100)/$scale)-$scale;\r\n\t\t\t$situation=(($company_price-$min)/($max-$min))*100;\r\n\t\t\t$array['max']=$max;\r\n\t\t\t$array['min']=$min;\r\n\t\t\t$array['situation']=$situation;\r\n\t\t\treturn $array;\r\n\t\t}", "public function getPriceFor($target)\n {\n $c = new Criteria();\n $pro = $this->getMarketingPackagePrices($c);\n return count($pro) ? $pro[0] : $pro;\n }", "public function getMinPrice();", "public function display_suggested_price( $product = false ) {\r\n\r\n\t\t$product = WC_Name_Your_Price_Helpers::maybe_get_product_instance( $product );\r\n\r\n\t\tif ( ! $product ) {\r\n\t\t\tglobal $product;\r\n\t\t}\r\n\r\n\t\t$suggested_price_html = WC_Name_Your_Price_Helpers::get_suggested_price_html( $product );\r\n\r\n\t\tif ( ! $suggested_price_html && ! WC_Name_Your_Price_Helpers::has_nyp( $product ) ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\techo '<p class=\"price suggested-price\">' . wp_kses_post( $suggested_price_html ) . '</p>';\r\n\r\n\t}", "public function presentPrice(){\n \t\n \treturn money_format('$%i', $this->price / 100);\n }", "function GetPrice($symbol)\n{\n\t//google finance can only handle up to 100 quotes at a time so split up query then merge results\n\tif(count($symbol) > 100)\n\t{\n\t\t$retArr = array();\n\t\tfor($j=0; $j< count($symbol); $j +=100)\n\t\t{\n\t\t\t$arr = LookUpWithFormattedString(FormatString(array_slice($symbol, $j, 100)));\n\t\t\t$retArr = array_merge($retArr, $arr);\n\t\t}\n\t\treturn $retArr;\n\t}\n\telse\n\t\treturn LookUpWithFormattedString(FormatString($symbol));\n}", "public function getOffer_price()\n {\n return $this->offer_price;\n }", "public function get_prices()\n\t{\n\t\t$product_price_old = 0;\n\t\t$product_price_sale = 0;\n\t\t$price = 0;\n\t\t$eco = 0;\n\t\t$taxes = 0;\n\t\t$dataoc = isset($this->request->post['dataoc']) ? $this->request->post['dataoc'] : '';\n\n\t\tif (!empty($dataoc)) {\n\t\t\t$dataoc = str_replace('&quot;', '\"', $dataoc);\n\t\t\t$json = @json_decode($dataoc, true);\n\t\t\t$product_quantity = isset($json['quantity']) ? $json['quantity'] : 0;\n\t\t\t$product_id_oc = isset($json['product_id_oc']) ? $json['product_id_oc'] : 0;\n\t\t\tif ($product_id_oc == 0) $product_id_oc = isset($json['_product_id_oc']) ? $json['_product_id_oc'] : 0;\n\n\t\t\t// get options\n\t\t\t$options = isset($json['option_oc']) ? $json['option_oc'] : array();\n\t\t\tforeach ($options as $key => $value) {\n\t\t\t\tif ($value == null || empty($value)) unset($options[$key]);\n\t\t\t}\n\n\t\t\t// get all options of product\n\t\t\t$options_temp = $this->get_options_oc($product_id_oc);\n\n\t\t\t// Calc price for ajax\n\t\t\tforeach ($options_temp as $value) {\n\t\t\t\tforeach ($options as $k => $option_val) {\n\t\t\t\t\tif ($k == $value['product_option_id']) {\n\t\t\t\t\t\tif ($value['type'] == 'checkbox' && is_array($option_val) && count($option_val) > 0) {\n\t\t\t\t\t\t\tforeach ($option_val as $val) {\n\t\t\t\t\t\t\t\tforeach ($value['product_option_value'] as $op) {\n\t\t\t\t\t\t\t\t\t// calc price\n\t\t\t\t\t\t\t\t\tif ($val == $op['product_option_value_id']) {\n\t\t\t\t\t\t\t\t\t\tif ($op['price_prefix'] == $this->minus) $price -= isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t\t\telse $price += isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} elseif ($value['type'] == 'radio' || $value['type'] == 'select') {\n\t\t\t\t\t\t\tforeach ($value['product_option_value'] as $op) {\n\t\t\t\t\t\t\t\tif ($option_val == $op['product_option_value_id']) {\n\t\t\t\t\t\t\t\t\tif ($op['price_prefix'] == $this->minus) $price -= isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\n\t\t\t\t\t\t\t\t\telse $price += isset($op['price_no_tax']) ? $op['price_no_tax'] : 0;\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// the others have not price, so don't need calc\n\t\t\t\t\t}\n\t\t\t\t\t// if not same -> return.\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$product_prices = $this->get_product_price($product_id_oc, $product_quantity);\n\t\t\t$product_price_old = isset($product_prices['price_old']) ? $product_prices['price_old'] : 0;\n\t\t\t$product_price_sale = isset($product_prices['price_sale']) ? $product_prices['price_sale'] : 0;\n\t\t\t$enable_taxes = $this->config->get('tshirtecommerce_allow_taxes');\n\t\t\tif ($enable_taxes === null || $enable_taxes == 1) {\n\t\t\t\t$taxes = isset($product_prices['taxes']) ? $product_prices['taxes'] : 0;\n\t\t\t\t$eco = isset($product_prices['eco']) ? $product_prices['eco'] : 0;\n\t\t\t} else {\n\t\t\t\t$taxes = 0;\n\t\t\t\t$eco = 0;\n\t\t\t}\n\t\t\t\n\t\t} // do nothing when empty/blank\n\n\t\t// return price for ajax\n\t\techo @json_encode(array(\n\t\t\t'price' => $price, \n\t\t\t'price_old' => $product_price_old, \n\t\t\t'price_sale' => $product_price_sale, \n\t\t\t'taxes' => $taxes,\n\t\t\t'eco' => $eco\n\t\t));\n\t\treturn;\n\t}", "public function getProductPrice()\n {\n }", "public function bestSpecialPriceProvider()\n {\n return [\n [0, 50.0, 100.0, 150.0, 1],\n [0, 100.0, 50.0, 150.0, 2],\n [0, 100.0, 150.0, 50.0, 3],\n [1, 50.0, 100.0, 150.0, 1],\n [1, 100.0, 50.0, 150.0, 2],\n [1, 100.0, 150.0, 50.0, 3],\n [2, 150.0, 50.0, 100.0, 1],\n [2, 50.0, 150.0, 100.0, 2],\n [2, 100.0, 50.0, 150.0, 3],\n [3, 150.0, 50.0, 100.0, 1],\n [3, 50.0, 150.0, 100.0, 2],\n [3, 100.0, 50.0, 150.0, 3],\n [4, 50.0, 100.0, 150.0, 1],\n [4, 100.0, 50.0, 150.0, 2],\n [4, 100.0, 150.0, 50.0, 3],\n [5, 50.0, 100.0, 150.0, 1],\n [5, 100.0, 50.0, 150.0, 2],\n [5, 100.0, 150.0, 50.0, 3],\n ];\n }", "public function getOfficeDepotPrice($url) {\n try {\n $price = null;\n\n if ($this->isBlocked($url)) {\n echo \"<div style='color: red'>URL no disponible</div><br>\";\n } else {\n $crawler = $this->client->request('GET', $url);\n\n // Precio actual\n $elements = $crawler->filter('.big-price')->each(function ($node) {\n return $node->text();\n });\n\n if (count($elements) < 1) {\n // Precio regular\n $elements = $crawler->filter('.discountedPrice')->each(function ($node) {\n return $node->text();\n });\n }\n\n if (count($elements) < 1) {\n // Precio regular\n $elements = $crawler->filter('.pricebefore ')->each(function ($node) {\n return $node->text();\n });\n }\n\n $price = (isset($elements[0])) ? $this->cleanPrice($elements[0]) : null;\n }\n\n return $price;\n } catch (Exception $ex) {\n echo \"<br><div style='color: red;'>\" . $ex->getMessage() . \" \" . $ex->getLine() . \" \" . $ex->getFile() . \"</div><br>\";\n }\n }", "public function getSonyPrice($url) {\n try {\n $price = null;\n\n if ($this->isBlocked($url)) {\n echo \"<div style='color: red'>URL no disponible</div><br>\";\n } else {\n $crawler = $this->client->request('GET', $url);\n\n // Precio actual\n $elements = $crawler->filter('.skuBestPrice')->each(function ($node) {\n return $node->text();\n });\n\n if (count($elements) < 1) {\n // Precio regular\n $elements = $crawler->filter('.skuListPrice')->each(function ($node) {\n return $node->text();\n });\n }\n\n $price = (isset($elements[0])) ? $this->cleanPrice($elements[0]) : null;\n }\n\n return $price;\n } catch (Exception $ex) {\n echo \"<br><div style='color: red;'>\" . $ex->getMessage() . \" \" . $ex->getLine() . \" \" . $ex->getFile() . \"</div><br>\";\n }\n }", "function advancedPrice($data) {\n \tif(Configure::read('App.bidButlerType') == 'advanced') {\n \t\t$auction = $this->Auction->find('first', array('conditions' => array('Auction.id' => $this->data['Bidbutler']['auction_id']), 'contain' => '', 'fields' => array('Auction.price','Auction.reverse')));\n \t\tif ($auction['Auction']['reverse']) {\n \t\t\treturn true;\n \t\t} else {\n\t\t\t\tif($data['minimum_price'] - $auction['Auction']['price'] < 0.01) {\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n \t} else {\n \t\treturn true;\n \t}\n }", "public function getRecommendations();", "public function getPrice(){ return $this->price_rur; }", "public function getEffectivePrice()\n {\n return $this->effective_price;\n }", "private function getSuggestions()\n {\n $category = $this->nodeStorage->load($this->categoryId);\n $secondaryTagIds = $this->getTagIds($category->field_moj_secondary_tags);\n $matchingIds = array_unique($this->getSecondaryTagItemsFor($secondaryTagIds));\n\n if (count($matchingIds) < $this->numberOfResults) {\n $matchingSecondaryTagIds = $this->getAllSecondaryTagItemsFor($secondaryTagIds);\n $matchingIds = array_unique(array_merge($matchingIds, $matchingSecondaryTagIds));\n }\n\n if (count($matchingIds) < $this->numberOfResults) {\n $primaryTagIds = $this->getTagIds($category->field_moj_top_level_categories);\n $matchingPrimaryTagIds = $this->getPrimaryTagItemsFor($primaryTagIds);\n $matchingIds = array_unique(array_merge($matchingIds, $matchingPrimaryTagIds));\n }\n\n $categoryIdIndex = array_search($this->categoryId, $matchingIds);\n\n if ($categoryIdIndex !== false) {\n unset($matchingIds[$categoryIdIndex]);\n }\n\n return $this->loadNodesDetails(array_slice($matchingIds, 0, $this->numberOfResults));\n }", "public function property_price() {\n\n\t\t\t$show_asking_price = get_field( 'show_asking_price' );\n\t\t\t$total_value = get_field( 'total_value' );\n\t\t\t$practice_is_for = get_field( 'practice_is_for' );\n\n\t\t\t$out = ( $show_asking_price == 'yes' )\n\t\t\t\t? '<h3 class=\"asking_price\"> $' . $total_value . '</h3>'\n\t\t\t\t: '<h3 class=\"asking_price\">P.O.A.</h3>';\n\n\t\t\t$out = ( $practice_is_for == 'For Lease' )\n\t\t\t\t? '<h3 class=\"asking_price\">FOR LEASE</h3>'\n\t\t\t\t: $out;\n\n\t\t\treturn $out;\n\t\t}", "function calculatePrice( &$item ) {\r\n\t\r\n\tglobal $db, $site;\r\n\t\r\n\t$resultPrice = $basePrice = $item['price'];\r\n\t\r\n\t$pricing = $db->getAll( 'select * from '. ATTRPRICING_TABLE.\" where product_id='$item[id]' and site_key='$site'\" );\r\n\t\r\n\tforeach ( $pricing as $pidx=>$price ) {\r\n\t\t\r\n\t\t$match = true;\r\n\t\t\r\n\t\tif ( $item['attributes'] )\r\n\t\tforeach( $item['attributes'] as $attr_id=>$attr ) {\r\n\t\t\t\r\n\t\t\t$values = $db->getRow( 'select value1, value2 from '. ATTRPRICEVALUES_TABLE.\" where price_id='$price[id]' and attr_id='$attr_id'\" );\r\n\t\t\t\r\n\t\t\tif ( !$values )\r\n\t\t\t\tcontinue;\r\n\t\t\t\t\r\n\t\t\t$value1 = $values['value1'];\r\n\t\t\t$value2 = $values['value2'];\r\n\t\t\t$value = $attr['value'];\r\n\t\t\r\n\t\t\tswitch( $attr['type'] ) {\r\n\t\t\t\tcase 'number':\r\n/*\t\t\t\t\tif ( strlen( $value1 ) )\r\n\t\t\t\t\t\t$match &= $value >= $value1;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\tif ( strlen( $value2 ) )\r\n\t\t\t\t\t\t$match &= $value <= $value2;\r\n\t\t\t\t\tbreak;\r\n*/\t\t\t\t\t\r\n\t\t\t\tcase 'single-text':\r\n\t\t\t\tcase 'multi-text':\r\n\t\t\t\tcase 'date':\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t$match &= $value == $value1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif ( $match ) {\r\n\t\t\t$resultPrice = getPriceValue( $price, $basePrice );\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn $resultPrice;\r\n\t\r\n}", "function getPrice()\n {\n return $this->price;\n }", "public function getElektraPrice($url) {\n try {\n $price = null;\n\n if ($this->isBlocked($url)) {\n echo \"<div style='color: red'>URL no disponible</div><br>\";\n } else {\n $crawler = $this->client->request('GET', $url);\n\n // Precio actual\n $elements = $crawler->filter('.skuBestPrice')->each(function ($node) {\n return $node->text();\n });\n\n if (count($elements) < 1) {\n // Precio regular\n $elements = $crawler->filter('.skuListPrice')->each(function ($node) {\n return $node->text();\n });\n }\n\n $price = (isset($elements[0])) ? $this->cleanPrice($elements[0]) : null;\n }\n\n return $price;\n } catch (Exception $ex) {\n echo \"<br><div style='color: red;'>\" . $ex->getMessage() . \" \" . $ex->getLine() . \" \" . $ex->getFile() . \"</div><br>\";\n }\n }", "public function get_price(){\n\t\treturn $this->price;\n\t}", "public function getCurrentPrice() : float;", "public function getPrice(){\n }", "public function getPrice(){\n }", "public function getCostcoPrice($url) {\n try {\n $price = null;\n\n if ($this->isBlocked($url)) {\n echo \"<div style='color: red'>URL no disponible</div><br>\";\n } else {\n $crawler = $this->client->request('GET', $url);\n\n // Precio actual\n $elements = $crawler->filter('.productdetail_inclprice')->each(function ($node) {\n return $node->text();\n });\n\n if (count($elements) < 1) {\n // Precio regular\n $elements = $crawler->filter('.productdetail_exclprice')->each(function ($node) {\n return $node->text();\n });\n }\n\n $price = $this->specialCostcoPrice($elements[0]);\n }\n\n return $price;\n } catch (Exception $ex) {\n echo \"<br><div style='color: red;'>\" . $ex->getMessage() . \" \" . $ex->getLine() . \" \" . $ex->getFile() . \"</div><br>\";\n }\n }", "public function getPrice()\n {\n return 0.2;\n }", "public function getCost();", "public function getPrice()\n {\n return parent::getPrice();\n }", "public function getLiverpoolPrice($url) {\n try {\n $price = null;\n $promoprice = null;\n $finalPrice = null;\n\n $text = utf8_decode(file_get_contents($url));\n\n foreach (preg_split(\"/((\\r?\\n)|(\\r\\n?))/\", $text) as $line) {\n\n if (strpos($line, \"requiredpromoprice\") !== false) {\n $promoprice = $this->cleanPrice($line);\n }\n\n if (strpos($line, \"requiredsaleprice\") !== false) {\n $price = $this->cleanPrice($line);\n }\n\n $promoprice = intval($promoprice);\n $price = intval($price);\n\n if($promoprice){\n if($promoprice < $price)\n $finalPrice = $promoprice;\n else\n $finalPrice = $price;\n }\n else\n $finalPrice = $price;\n }\n\n if($finalPrice <= 1)\n $finalPrice = null;\n\n return $finalPrice;\n } catch (Exception $ex) {\n echo \"<br><div style='color: red;'>\" . $ex->getMessage() . \" \" . $ex->getLine() . \" \" . $ex->getFile() . \"</div><br>\";\n }\n }", "public function getPrice(){\n return $this->price;\n }", "public function run()\n {\n $priceList = [\n ['337','5 Refractarios de Vidrio y 5 tapas de plastico Glazé',1],\n ['338','5 Refractarios de Vidrio y 5 tapas de plastico Glazé',2],\n ['339','5 Refractarios de Vidrio y 5 tapas de plastico Glazé',4],\n ['340','5 Refractarios de Vidrio y 5 tapas de plastico Glazé',3],\n ['341','5 Refractarios de Vidrio y 5 tapas de plastico Glazé',1],\n ['369','Abanico de Techo Harbor Breeze',1],\n ['172','abanico de techo harbor breeze.',2],\n ['531','Abanico Harbor',1],\n ['168','Abanico Taurus',1],\n ['175','Abanico Taurus',1],\n ['179','Abanico Taurus',1],\n ['310','alaciadora con placas de ceramica timco.',1],\n ['311','alaciadora con placas de ceramica timco.',1],\n ['312','alaciadora con placas de ceramica timco.',1],\n ['335','Alaciadora Revlon',2],\n ['336','Alaciadora Revlon',3],\n ['152','Alaciadora Taurus.',4],\n ['153','Alaciadora Taurus.',2],\n ['154','Alaciadora Taurus.',3],\n ['155','Alaciadora Taurus.',4],\n ['253','Arrocera c/tapa Tramontina',2],\n ['254','Arrocera c/tapa Tramontina',1],\n ['418','Asador Outdoor trend',3],\n ['360','Aspiradora',1],\n ['423','Aspiradora Dirt Devil',2],\n ['449','Aspiradora Mikel¨S',3],\n ['490','Aspiradora Mikel¨S',2],\n ['134','audifonos stf sound',3],\n ['135','audifonos stf sound',4],\n ['136','audifonos stf sound',2],\n ['137','audifonos stf sound',4],\n ['138','audifonos stf sound',1],\n ['365','Audifonos STF Sound',4],\n ['397','Audifonos STF Sound',3],\n ['406','Audifonos STF Sound',2],\n ['421','Audifonos STF Sound',1],\n ['422','Audifonos STF Sound',3],\n ['558','Audifonos STF Sound',4],\n ['559','Audifonos STF Sound',2],\n ['560','Audifonos STF Sound',4],\n ['178','Azador de Carbón Outdoor Trend',1],\n ['9','Bafle Recargable (Bocina) Concierto mio',2],\n ['352','Bajilla Ebro (12pz)',3],\n ['353','Bajilla Ebro (12pz)',4],\n ['358','Bajilla Santa Anita (16pz)',2],\n ['371','Bandeja Rectangular PYR-O-REY',1],\n ['372','Bandeja Rectangular PYR-O-REY',3],\n ['429','Bandeja Rectangular PYR-O-REY',4],\n ['548','Baño de burbujas para pies Revlon',3],\n ['604','Baño de burbujas Revlon',1],\n ['373','Bateria CINSA (7pz)',2],\n ['534','Bateria CINSA (7pz)',3],\n ['6','Bateria de Cocina (9pz) Ekos',1],\n ['480','Bateria de Cocina (9pz) Ekos',3],\n ['481','Bateria de Cocina (9pz) Ekos',4],\n ['618','Bateria de cocina 20pz Main Stays',1],\n ['619','Bateria de cocina 20pz Main Stays',3],\n ['107','bateria ecko 9 pzs.',2],\n ['308','batidora de imersion sunbeam.',1],\n ['299','batidora de imersion taurus.',3],\n ['300','batidora de imersion taurus.',4],\n ['301','batidora de imersion taurus.',2],\n ['302','batidora de imersion taurus.',1],\n ['303','batidora de imersion taurus.',4],\n ['304','batidora de imersion taurus.',2],\n ['305','batidora de imersion taurus.',4],\n ['306','batidora de imersion taurus.',3],\n ['307','batidora de imersion taurus.',3],\n ['519','Batidora Tradition',1],\n ['367','Batidora Traditions',2],\n ['375','Batidora Traditions',4],\n ['376','Batidora Traditions',4],\n ['165','bocina bafle.',3],\n ['166','bocina bafle.',2],\n ['167','bocina bafle.',1],\n ['91','bocina bafle.?cm',3],\n ['99','bocina bafle.?cm',1],\n ['430','Bocina Bluetooth Kaiser',2],\n ['431','Bocina Bluetooth Kaiser',2],\n ['148','bocina green leaf.',1],\n ['171','bocina green leaf.',2],\n ['444','Bocina green leaf.',1],\n ['8','Bocina Inalambrica Green Leaf',1],\n ['468','Bocina Inalambrica Green Leaf',2],\n ['522','Bocina Logitech',2],\n ['128','bocinas logitech.',3],\n ['510','Bocinas logitech.',4],\n ['580','Bolsa Cosmetic Lab',4],\n ['581','Bolsa Cosmetic Lab',3],\n ['536','Bolsita negra Cosmetic Lab',4],\n ['552','Bolsita negra Cosmetic Lab',2],\n ['586','Bolsita negra Cosmetic Lab',2],\n ['662','Brochas 6pz',3],\n ['664','Brochas 6pz',4],\n ['663','Brochas 8pz',3],\n ['118','brown sunbeam',4],\n ['119','brown sunbeam',3],\n ['120','brown sunbeam',4],\n ['121','brown sunbeam',3],\n ['255','Cable Pasa Corriente 120 a 12 V cc 2.5 m multitop',4],\n ['256','Cable Pasa Corriente 120 a 12 V cc 2.5 m multitop',3],\n ['48','Cafetera Best Home',4],\n ['49','Cafetera Best Home',3],\n ['189','Cafetera Best Home',4],\n ['190','Cafetera Best Home',2],\n ['366','Cafetera Best Home',2],\n ['392','Cafetera Best Home',2],\n ['386','Cafetera Best Home',4],\n ['433','Cafetera Best Home',2],\n ['442','Cafetera Best Home',2],\n ['443','Cafetera Best Home',1],\n ['85','cafetera best home.',2],\n ['110','cafetera best home.',3],\n ['144','cafetera best home.',4],\n ['466','Cafetera de goteo Best Home',2],\n ['216','caja de herramientas 17\" truper.',3],\n ['217','caja de herramientas 17\" truper.',2],\n ['218','caja de herramientas 17\" truper.',4],\n ['489','Calefactor Best Home',1],\n ['57','Calefactor de halógeno Best Home',3],\n ['251','Calentador c/tapa de Vidrio CINSA 1.7 Litros',4],\n ['252','Calentador c/tapa de Vidrio CINSA 1.7 Litros',2],\n ['354','Calentón Best Home',1],\n ['361','Calentón Best Home',4],\n ['507','Calentón Best Home',2],\n ['374','Class Bows (5pz) Libbey',1],\n ['159','cobertor con borrega.',4],\n ['243','Cobertor Fusionado Estampado con Borrega Soft Sensations King Size',2],\n ['244','Cobertor Fusionado Estampado con Borrega Soft Sensations Matrimonial',1],\n ['113','cobijita cuadrada.',4],\n ['196','Colcha con cojin Mainstays',2],\n ['237','Colcha con Cojin Mainstays',2],\n ['229','colchon ortopedico individual master',3],\n ['230','colchon ortopedico individual master',4],\n ['231','Colchón Ortopedico Individual Master',2],\n ['232','Colchón Super Ortopedico Individual Master',1],\n ['233','Colchón Super Ortopedico Individual Master',3],\n ['535','Comedor',1],\n ['124','copa cristar 4 pzs.',2],\n ['125','copa cristar 4 pzs.',2],\n ['504','Copa cristar 4 pzs.',4],\n ['501','Copas cristar (4pz)',2],\n ['364','Copas de Cristal (4pz)',1],\n ['390','Copas de Cristal (4pz)',3],\n ['72','cortadora de cabello taurus',4],\n ['73','cortadora de cabello taurus',2],\n ['74','cortadora de cabello taurus',1],\n ['147','cortadora de cabello taurus',3],\n ['416','Cortadora de cabello taurus',4],\n ['425','cortadora de cabello taurus',2],\n ['426','cortadora de cabello taurus',1],\n ['440','cortadora de cabello taurus',3],\n ['470','Cortadora de cabello taurus',4],\n ['471','Cortadora de cabello taurus',4],\n ['520','Cortadora de cabello taurus',1],\n ['582','Cosmetiquera',3],\n ['583','Cosmetiquera',2],\n ['584','Cosmetiquera',3],\n ['585','Cosmetiquera',2],\n ['653','Cosmetiquera',1],\n ['659','Cosmetiquera',3],\n ['643','Cosmetiquera Cosmetic Lab',3],\n ['599','Cosmetiquera cristalina Cosmetic Lab',2],\n ['600','Cosmetiquera gris con blanco Cosmetic Lab',3],\n ['567','Cosmetiquera rosa Cosmetic Lab',2],\n ['568','Cosmetiquera rosa Cosmetic Lab',2],\n ['569','Cosmetiquera rosa Cosmetic Lab',3],\n ['570','Cosmetiquera rosa Cosmetic Lab',4],\n ['537','Cosmetiquera The Best',1],\n ['84','crock. Pot olla electrica.',3],\n ['546','Cuadro flotante Main Stayns 24 fotos (Blanco)',2],\n ['545','Cuadro flotante Main Stayns 24 fotos (Negro)',3],\n ['417','Cubiertos SK (16pz)',1],\n ['176','Delineadora de Barba Timco',1],\n ['645','Desarmador de trinquete Stanley',3],\n ['641','Desarmadores truper 5pz',1],\n ['642','Desarmadores truper 5pz',2],\n ['434','Duo Cups T-Fal',3],\n ['592','DVD con Karaoke',2],\n ['593','DVD con Karaoke',1],\n ['241','Edredón de Microfibra Matrimonial Mainstays',3],\n ['242','Edredón de Microfibra Matrimonial Mainstays',4],\n ['158','edredon mainstays.',5],\n ['191','Edredon Viajero',2],\n ['195','Edredon Viajero 926',3],\n ['235','Edredón Viajero NANO (1.15 x 1.50) mts beige',4],\n ['236','Edredón Viajero NANO (1.15 x 1.50) mts café',1],\n ['239','Edredrón Doble Vista Individual Essentails Home',2],\n ['240','Edredrón Doble Vista Individual Essentails Home',3],\n ['238','Edredrón Matrimonial Mainstays',4],\n ['414','Escurridor de platos',1],\n ['437','Escurridor de platos Hamilton Beach',2],\n ['438','Escurridor de platos Hamilton Beach',3],\n ['439','Escurridor de platos Hamilton Beach',4],\n ['633','Estuche de brochas 6pz',1],\n ['3','Estufa Acros',2],\n ['108','estufa para bufe black + decker.',3],\n ['1','Estufa Ranger IEM',4],\n ['385','Exprimidor electrico proctor siler',1],\n ['529','Exprimidor electrico proctor siler',2],\n ['530','Exprimidor electrico proctor siler',3],\n ['399','Frasada',1],\n ['400','Frasada',2],\n ['401','Frasada',3],\n ['402','Frasada',4],\n ['403','Frasada',1],\n ['404','Frasada',2],\n ['511','Frazada Main Stayns',3],\n ['538','Frazada Main Stayns',1],\n ['539','Frazada Main Stayns',2],\n ['540','Frazada Main Stayns',3],\n ['541','Frazada Main Stayns',4],\n ['566','Frazada Main Stayns',1],\n ['370','Frazada Mainstays',2],\n ['156','frazada mainstays.',4],\n ['157','frazada mainstays.',1],\n ['163','frazada mainstays.',2],\n ['112','frazada throw',3],\n ['245','Frazada Viajera NANO',4],\n ['219','hielera 12 latas 10.5 litros nyc.',1],\n ['220','hielera 12 latas 10.5 litros nyc.',2],\n ['486','hielera 12 latas nyc.',3],\n ['225','hielera 54 lata 45.5 litros nyc.',4],\n ['223','hielera coleman 34 litros',1],\n ['224','hielera coleman 34 litros',2],\n ['221','hielera igloo 11 litros',3],\n ['222','hielera igloo 11 litros',3],\n ['532','Horno Black and Decker',1],\n ['203','horno de microondas hamilton Beach.',2],\n ['180','Horno Electrico Best Home',3],\n ['487','Horno microondas Hamilton',4],\n ['350','Jarra y Vasos Crisa (5pz)',1],\n ['448','Jarra y Vasos Crisa (5pz)',2],\n ['459','Jarra y Vasos Crisa (7pz)',3],\n ['66','Jarra y Vasos Crisia (5pz)',4],\n ['184','Jarra y Vasos Crisia (7pz)',1],\n ['349','Juedo de Cubiertos Mainstays',2],\n ['26','Juego Crisa (8pz)',3],\n ['461','Juego Crisa (8pz)',3],\n ['602','Juego de 6 llaves pretul',1],\n ['647','Juego de 6 llaves pretul',2],\n ['101','juego de agua bassic',3],\n ['102','juego de agua bassic',4],\n ['379','Juego de Agua Bassic (7pz)',1],\n ['380','Juego de Agua Bassic (7pz)',2],\n ['395','Juego de agua Bassic (7pz)',3],\n ['419','Juego de Agua Bassic (7pz)',4],\n ['12','Juego de Agua Neptuno (7pz)',1],\n ['23','Juego de Agua Neptuno (7pz)',2],\n ['29','Juego de Agua Neptuno (7pz)',4],\n ['75','juego de agua neptuno 7 pzas.',1],\n ['76','juego de agua neptuno 7 pzas.',2],\n ['658','Juego de baño',3],\n ['660','Juego de baño',3],\n ['639','Juego de baño 7pz Aromanice',1],\n ['640','Juego de baño 7pz Aromanice',2],\n ['553','Juego de baño Aromanice',3],\n ['554','Juego de baño Aromanice',4],\n ['555','Juego de baño Aromanice',1],\n ['644','Juego de baño Aromanice',2],\n ['465','Juego de Bar de vidrio (8pz)',4],\n ['485','Juego de Bar de vidrio (8pz)',1],\n ['183','Juego de Bar Libbey (8pz)',1],\n ['505','Juego de Bar Libbey (8pz)',2],\n ['561','Juego de brochas 7pz Xpert Beauty',3],\n ['562','Juego de brochas 7pz Xpert Beauty',4],\n ['563','Juego de brochas 7pz Xpert Beauty',1],\n ['564','Juego de brochas 7pz Xpert Beauty',2],\n ['565','Juego de brochas 7pz Xpert Beauty',4],\n ['608','Juego de brochas 8pz',1],\n ['609','Juego de brochas 8pz',2],\n ['610','Juego de brochas 8pz',1],\n ['188','Juego de Cocina (4pz) Ekco',2],\n ['104','juego de cocina 4 pzs ecko.',4],\n ['405','Juego de Cubiertos (16pz)',1],\n ['257','Juego de Cubiertos (16pz) Mainstays',2],\n ['258','Juego de Cubiertos (16pz) Mainstays',3],\n ['259','Juego de Cubiertos (16pz) Mainstays',4],\n ['260','Juego de Cubiertos (16pz) Mainstays',1],\n ['261','Juego de Cubiertos (16pz) Mainstays',2],\n ['293','juego de cubiertos 16 pcs mainstays.',3],\n ['309','juego de cubiertos 16 pzas simple kitchen.',4],\n ['284','juego de cubiertos 16 pzs gibson.',1],\n ['285','juego de cubiertos 16 pzs gibson.',2],\n ['286','juego de cubiertos 16 pzs gibson.',4],\n ['287','juego de cubiertos 16 pzs gibson.',1],\n ['288','juego de cubiertos 16 pzs gibson.',2],\n ['289','juego de cubiertos 16 pzs gibson.',4],\n ['290','juego de cubiertos 16 pzs gibson.',1],\n ['291','juego de cubiertos 16 pzs gibson.',2],\n ['63','Juego de Cubiertos Sk (16pz)',3],\n ['64','Juego de Cubiertos Sk (16pz)',4],\n ['276','juego de cucharas 5 pzs para cocinar.',1],\n ['277','juego de cucharas 5 pzs para cocinar.',2],\n ['278','juego de cucharas 5 pzs para cocinar.',3],\n ['279','juego de cucharas 5 pzs para cocinar.',4],\n ['280','juego de cucharas 5 pzs para cocinar.',1],\n ['281','juego de cucharas 5 pzs para cocinar.',2],\n ['282','juego de cucharas 5 pzs para cocinar.',3],\n ['283','juego de cucharas 5 pzs para cocinar.',3],\n ['383','Juego de cuchillos top choice',4],\n ['488','Juego de cuchillos 12 piezas Tramontina',1],\n ['262','juego de cuchillos 4 pcs tramontina.',2],\n ['263','juego de cuchillos 4 pcs tramontina.',3],\n ['264','juego de cuchillos 4 pcs tramontina.',4],\n ['265','juego de cuchillos 4 pcs tramontina.',1],\n ['266','juego de cuchillos 4 pcs tramontina.',2],\n ['267','juego de cuchillos 4 pcs tramontina.',3],\n ['268','juego de cuchillos 4 pcs tramontina.',1],\n ['269','juego de cuchillos 4 pcs tramontina.',2],\n ['270','juego de cuchillos 4 pcs tramontina.',3],\n ['271','juego de cuchillos 4 pcs tramontina.',4],\n ['272','juego de cuchillos 4 pcs tramontina.',1],\n ['273','juego de cuchillos 4 pcs tramontina.',2],\n ['274','juego de cuchillos 4 pcs tramontina.',3],\n ['275','juego de cuchillos 4 pcs tramontina.',4],\n ['292','juego de cuchillos 4 pcs tramontina.',1],\n ['44','Juego de cuchillos Top Choice',2],\n ['182','Juego de cuchillos Top Choice',3],\n ['199','Juego de Cuchillos Top Choice',4],\n ['646','Juego de desarmador de puntas',1],\n ['638','Juego de desarmador truper',2],\n ['650','Juego de desatornillador truper',3],\n ['321','juego de herramientas 15 pzas workpro.',4],\n ['427','Juego de herramientas pretul (70pz)',1],\n ['428','Juego de herramientas pretul (70pz)',2],\n ['41','Juego de jarras y vasos crisa',3],\n ['42','Juego de jarras y vasos crisa',4],\n ['607','Juego de maquillaje 37pz',1],\n ['572','Juego de maquillaje 37pz C.L.',2],\n ['573','Juego de maquillaje 37pz C.L.',3],\n ['634','Juego de maquillaje 41pz',4],\n ['635','Juego de maquillaje 41pz',1],\n ['636','Juego de maquillaje 41pz',2],\n ['637','Juego de maquillaje 41pz',3],\n ['318','juego de peluqueria 18 pzas conair.',4],\n ['319','juego de peluqueria 18 pzas conair.',1],\n ['31','Juego de puntas p/desarmador Truper',2],\n ['32','Juego de puntas p/desarmador Truper',3],\n ['411','Juego de puntas y dados Truper (25pz)',4],\n ['193','Juego de recipientes Best Home (3pz)',1],\n ['194','Juego de recipientes Best Home (3pz)',1],\n ['67','Juego de Sartenes (3pz) Ecko',2],\n ['68','Juego de Sartenes (3pz) Ecko',3],\n ['69','Juego de Sartenes (3pz) Ecko',4],\n ['70','Juego de Sartenes (4pz) Ecko',1],\n ['477','Juego de servir Jarra con vaso',2],\n ['469','Juego de vasos (12pz) Main Stayns',3],\n ['478','Juego de vasos (6pz9 glaze',4],\n ['632','Juego de vasos 6pz Glaze',2],\n ['620','Juego de vasos 8pz Main Stays',3],\n ['621','Juego de vasos 8pz Main Stays',4],\n ['622','Juego de vasos 8pz Main Stays',3],\n ['623','Juego de vasos 8pz Main Stays',1],\n ['624','Juego de vasos 8pz Main Stays',2],\n ['625','Juego de vasos 8pz Vsantos',3],\n ['626','Juego de vasos 8pz Vsantos',4],\n ['627','Juego de vasos 8pz Vsantos',1],\n ['467','Juego de vasos de España (10pz) Santos',2],\n ['458','Juego de vasos Vsantos (10pz)',3],\n ['7','Juego de Vasos, Platos y Cucharas (12 pz) Santa Elenita',4],\n ['456','Juego para agua valencia (6pz)',1],\n ['38','Juguera Electrica Hometech',2],\n ['39','Juguera Electrica Hometech',3],\n ['71','Juguera Electrica Hometech',4],\n ['197','Juguera Electrica Hometech',1],\n ['457','Kit de peluqueria Timco (10pz)',2],\n ['116','lampara de buro best home.',3],\n ['435','lampara de buro best home.',3],\n ['4','Lavadora Acros',1],\n ['201','lavadora automatica daewo 14kg.',2],\n ['204','lavadora automatica daewo 19 kg.',3],\n ['200','lavadora automatica daewo 19kg.',4],\n ['143','licuadora americam',2],\n ['10','Licuadora American',1],\n ['20','Licuadora American',2],\n ['21','Licuadora American',1],\n ['22','Licuadora American',2],\n ['34','Licuadora American',3],\n ['36','Licuadora American',1],\n ['37','Licuadora American',2],\n ['462','Licuadora American',3],\n ['89','licuadora american.',4],\n ['142','licuadora oster',3],\n ['151','licuadora oster',1],\n ['177','Licuadora Oster',2],\n ['483','Licuadora Oster',3],\n ['198','Licuadora Taurus',4],\n ['359','Licuadora Taurus',1],\n ['388','Licuadora Taurus',2],\n ['574','Make up collection 89pz',3],\n ['575','Make up collection 89pz',4],\n ['579','Make up collection 89pz',1],\n ['576','Make up collection 96pz',2],\n ['577','Make up collection 96pz',3],\n ['578','Make up collection 96pz',4],\n ['226','maleta etco travel.',3],\n ['227','maleta etco travel.',1],\n ['174','Maleta LQ Chica',2],\n ['173','Maleta LQ Mediana',3],\n ['59','Manta de Polar Mainstays',4],\n ['60','Manta de Polar Mainstays',1],\n ['61','Manta de Polar Mainstays',2],\n ['342','Manta de Polar Mainstays',3],\n ['343','Manta de Polar Mainstays',4],\n ['344','Manta de Polar Mainstays',3],\n ['345','Manta de Polar Mainstays',4],\n ['346','Manta de Polar Mainstays',2],\n ['347','Manta de Polar Mainstays',3],\n ['348','Manta de Polar Mainstays',1],\n ['591','Manta de Polar Mainstays',2],\n ['652','Manta Mainstays azul',3],\n ['651','Manta Mainstays gris',4],\n ['648','Manta polar Azul',1],\n ['657','Manta polar café',2],\n ['656','Manta polar gris',3],\n ['649','Manta polar verde',4],\n ['398','Maquina para el cabello Timco',1],\n ['549','Maquina para palomitas sunbeam',2],\n ['603','Matraka con dados 16pz Santul',3],\n ['105','microondas daewoo.',2],\n ['106','microondas daewoo.',2],\n ['202','microondas daewoo.',2],\n ['249','Olla de Aluminio c/tapa Hometrends 1.9 litros',3],\n ['250','Olla de Aluminio c/tapa Hometrends 1.9 litros',4],\n ['247','Olla de Aluminio c/tapa Hometrends 2.8 litros',1],\n ['248','Olla de Aluminio c/tapa Hometrends 2.8 litros',2],\n ['246','Olla de Aluminio c/tapa Hometrends 4.7 litros',3],\n ['160','olla de coccion lenta black & decker.',4],\n ['492','olla de lento cocimiento Black and decker',1],\n ['473','Olla de lento cocimiento hamilton beach',2],\n ['464','Olla Lento Cocimiento Black Decker',3],\n ['181','Olla Lento Cocimiento Hamilton Beach',4],\n ['378','Olla Lento Cocimiento Hamilton Beach',1],\n ['187','Parrilla Electrica Michel',2],\n ['368','Parrilla Electrica Michel',3],\n ['77','parrilla electrica michel.',4],\n ['149','parrilla electrica taurus',1],\n ['150','parrilla electrica taurus',2],\n ['377','Parrilla Michel',3],\n ['82','parrillera electrica michel.',4],\n ['408','Perfiladora tauros',1],\n ['409','Perfiladora tauros',2],\n ['410','Perfiladora tauros',3],\n ['11','Plancha Black & Decker',4],\n ['14','Plancha Black & Decker',1],\n ['15','Plancha Black & Decker',2],\n ['16','Plancha Black & Decker',3],\n ['17','Plancha Black & Decker',4],\n ['18','Plancha Black & Decker',1],\n ['78','plancha black & decker.',2],\n ['79','plancha black & decker.',3],\n ['80','plancha black & decker.',4],\n ['103','plancha black & decker.',1],\n ['19','Plancha Taurus',2],\n ['122','plancha taurus.',3],\n ['123','plancha taurus.',4],\n ['500','Platos Crisa (12pz)',1],\n ['43','Platos elite (3pz)',2],\n ['450','Platos porcelana elit (3pz)',3],\n ['30','Proctor Silex (exprimidor)',4],\n ['384','Rasuradora timco Men',1],\n ['407','Razones crisa (8pz)',2],\n ['357','Recamara',3],\n ['451','Recipientes Best Home (3pz)',4],\n ['313','recortadora de barba y bigote conair.',1],\n ['314','recortadora de barba y bigote conair.',2],\n ['315','recortadora de barba y bigote conair.',3],\n ['316','recortadora de barba y bigote conair.',4],\n ['317','recortadora de barba y bigote conair.',1],\n ['320','recortadora de barba y bigote conair.',2],\n ['514','Recortadora de barba y bigote conair.',2],\n ['2','Refrigerador Mabe',3],\n ['542','Reloj de pared',4],\n ['590','Reloj Home Trends',1],\n ['322','rizador de cabello taurus.',2],\n ['323','rizador de cabello taurus.',3],\n ['324','rizador de cabello taurus.',4],\n ['325','rizador de cabello taurus.',1],\n ['326','rizador de cabello taurus.',2],\n ['327','rizador de cabello taurus.',3],\n ['328','rizador de cabello taurus.',1],\n ['329','rizador de cabello taurus.',2],\n ['330','rizador de cabello taurus.',3],\n ['331','rizador de cabello taurus.',1],\n ['362','Ropero',2],\n ['50','Sandwichera Black & Decker',4],\n ['62','Sandwichera Black & Decker',4],\n ['81','sandwichera black and decker',3],\n ['40','Santa Elenita (16pz)',2],\n ['52','Sarten electrico Holstein',1],\n ['351','Sarten electrico Holstein',4],\n ['356','Secadora Conair',3],\n ['139','secadora conair.',3],\n ['140','secadora conair.',1],\n ['332','Secadora Mediana Conair',2],\n ['333','Secadora Mediana Conair',3],\n ['334','Secadora Mediana Conair',4],\n ['164','secadora timco.',1],\n ['297','set de accesorios para asar 3 pzas acero inoxidable.',2],\n ['298','set de accesorios para asar 3 pzas acero inoxidable.',3],\n ['296','set de accesorios para asar 3 pzas. Acero inoxidable.',4],\n ['294','set de accesorios para asar 3 pzas. Outdoor trend',1],\n ['295','set de accesorios para asar 3 pzas. Outdoor trend',2],\n ['571','Set de brochas 6pz Cosmetic Lab',3],\n ['543','Set de cubiertos 24 piezas',4],\n ['544','Set de cubiertos 24 piezas',1],\n ['594','Set de cuchillos Acero Inoxidable',2],\n ['595','Set de cuchillos Acero Inoxidable',3],\n ['596','Set de cuchillos Acero Inoxidable',2],\n ['493','Set de tazas (3pz) Main Stayns',1],\n ['192','Set de Tazones (3pz)',2],\n ['513','Set de Tazones (3pz) Main Stayns',3],\n ['598','Set de tazones 3pz',4],\n ['631','Set de tazones 3pz Main Stays',1],\n ['460','Set de Tazones Mainstays (3pz)',2],\n ['661','Set de utencilios Backyard Grill',4],\n ['597','Set de utencilios de bambu',4],\n ['654','Set de utencilios de bambu',3],\n ['655','Set de utencilios de bambu',1],\n ['611','Set de vaso 8 pz Crisa',2],\n ['612','Set de vaso 8 pz Crisa',3],\n ['613','Set de vaso 8 pz Crisa',4],\n ['614','Set de vaso 8 pz Crisa',1],\n ['615','Set de vaso 8 pz Crisa',2],\n ['517','Set Oasis (2pz)',3],\n ['605','Silla mariposa Main Stays',4],\n ['606','Silla mariposa Main Stays',1],\n ['5','Smart TV RCA 40\"',2],\n ['228','sofacama hometrends.',3],\n ['601','Stanley Control Grip 29pz',4],\n ['382','Tablet tech pad \"7\"',1],\n ['387','Tablet tech pad \"7\"',2],\n ['455','Tablet tech pad \"7\"',3],\n ['518','Tablet tech pad \"7\"',4],\n ['129','tablet tech pad 7\"',1],\n ['130','tablet tech pad 7\"',4],\n ['131','tablet tech pad 7\"',3],\n ['132','tablet tech pad 7\"',2],\n ['133','tablet tech pad 7\"',1],\n ['412','tazones crisa',4],\n ['413','tazones crisa',3],\n ['420','Tazones crisa (8pz)',2],\n ['452','Tazones crisa (8pz)',1],\n ['497','Tazones crisa (8pz)',4],\n ['90','tazones crisa 8 pzas.',3],\n ['92','tazones crisa 8 pzas.',2],\n ['56','Tazones de Vidrio Crisa',1],\n ['415','Tazones Maintavs (3pz)',4],\n ['441','Tazones Maintavs (3pz)',3],\n ['498','Tazones Maintays (3pz)',2],\n ['234','Televición Led Smart FHD TV 40\" RCA',1],\n ['215','television orizzonte 43\" smart.',4],\n ['205','television quaroni 32\" led.',3],\n ['206','television quaroni 32\" led.',2],\n ['207','television quaroni 32\" led.',1],\n ['208','television quaroni 32\" led.',2],\n ['209','television quaroni 32\" led.',4],\n ['210','television quaroni 32\" led.',2],\n ['211','television quaroni 32\" led.',3],\n ['212','television quaroni 32\" led.',4],\n ['213','television quaroni 32\" led.',2],\n ['214','television quaroni 32\" led.',4],\n ['111','tetera best home.',1],\n ['33','Tetera Electrica RCA',2],\n ['35','Tetera RCA',1],\n ['169','Tetera RCA',3],\n ['393','Tetera RCA',1],\n ['463','Tetera RCA',2],\n ['117','t-fal duo cups.',2],\n ['355','Tostador Best Home',3],\n ['479','Tostador de pan Taurus',1],\n ['145','tostador taurus',2],\n ['185','Tostador Taurus',3],\n ['186','Tostador Taurus',4],\n ['550','Tres espejos Home creations',1],\n ['551','Tres espejos Home creations',2],\n ['484','Vajilla (12pz) Bormioli',3],\n ['491','Vajilla (12pz) Crisa',4],\n ['51','Vajilla (12pz) Venecia',1],\n ['474','Vajilla (12pz)Bormioli',2],\n ['616','Vajilla 12pz Andalucita',3],\n ['617','Vajilla 12pz Home Gallery',4],\n ['503','Vajilla Bicrila (12pz)',1],\n ['502','Vajilla Crisa (12pz)',2],\n ['556','Vajilla Crisa (12pz)',3],\n ['557','Vajilla Crisa (8pz)',4],\n ['630','Vajilla de porcelana 12pz Home Gallery',1],\n ['628','Vajilla de vidrio 12pz crisa',2],\n ['629','Vajilla de vidrio 12pz crisa',3],\n ['446','Vajilla Ebro (12pz)',3],\n ['447','Vajilla Ebro (12pz)',1],\n ['472','vajilla para 4 personas opal glass',1],\n ['476','Vajilla para 5 personas Bormioli',3],\n ['58','Vajilla Santa Elenita (16pz)',2],\n ['88','vajilla venecia 12 pzas.',1],\n ['93','vajilla venecia 12 pzas.',1],\n ['94','vajilla venecia 12 pzas.',2],\n ['98','vajilla venecia 12 pzas.',3],\n ['516','vajilla venecia 12 pzas.',4],\n ['65','Vajilla Vicria (12pz)',1],\n ['389','Vajilla vicrila (12pz)',2],\n ['432','Vajilla vicrila (12pz)',3],\n ['521','Vajillas Santa Anita (16pz)',4],\n ['127','vallija 12 pzs crisa.',1],\n ['547','Vaporera 5.2 lts Hammilton',2],\n ['496','Vaso Bassic (8pz)',3],\n ['53','Vasos (6pz) Bassic',4],\n ['54','Vasos (6pz) Bassic',2],\n ['55','Vasos (6pz) Bassic',1],\n ['24','Vasos (8pz) Bassic',3],\n ['25','Vasos (8pz) Bassic',1],\n ['13','Vasos (8pz) Crisa',3],\n ['391','Vasos Bassic (6pz)',4],\n ['394','Vasos Bassic (6pz)',3],\n ['396','Vasos Bassic (6pz)',1],\n ['436','Vasos Bassic (8pz)',4],\n ['445','Vasos Bassic (8pz)',4],\n ['515','Vasos Bassic (8pz)',4],\n ['170','vasos bassic 6 pzas.',1],\n ['87','vasos bassic 8 pzas.',2],\n ['95','vasos bassic 8 pzas.',3],\n ['28','Vasos Crisa (8pz)',1],\n ['161','Vasos Crisa (8pz)',2],\n ['162','Vasos Crisa (8pz)',3],\n ['83','vasos crisa 8 pzas.',1],\n ['86','vasos crisa 8 pzas.',2],\n ['96','vasos crisa 8 pzas.',3],\n ['97','vasos crisa 8 pzas.',1],\n ['100','vasos crisa 8 pzas.',1],\n ['146','vasos crisa 8 pzas.',2],\n ['424','Vasos España (10pz)',3],\n ['499','Vasos España (10pz)',1],\n ['509','Vasos España (10pz)',2],\n ['512','Vasos España (10pz)',3],\n ['381','Vasos glaze',1],\n ['453','Vasos Glaze (6pz)',2],\n ['454','Vasos Glaze (6pz)',1],\n ['494','Vasos Glaze (6pz)',2],\n ['495','Vasos Glaze (6pz)',1],\n ['506','Vasos Glaze (6pz)',2],\n ['508','Vasos Glaze (6pz)',1],\n ['523','Vasos glaze (6pz)',4],\n ['524','Vasos glaze (6pz)',3],\n ['525','Vasos glaze (6pz)',2],\n ['526','Vasos glaze (6pz)',3],\n ['527','Vasos glaze (6pz)',4],\n ['528','Vasos glaze (6pz)',2],\n ['533','Vasos Glaze (6pz)',3],\n ['45','Vasos Glazé (6pz)',4],\n ['46','Vasos Glazé (6pz)',2],\n ['47','Vasos Glazé (6pz)',3],\n ['114','vasos glazé 6 pzs',4],\n ['115','vasos glazé 6 pzs',2],\n ['126','vasos glazé 6 pzs',3],\n ['141','vasos glazé 6 pzs',2],\n ['109','vasos vicrila 8 pzas.',3],\n ['363','Ventilador Taurus',2],\n ['27','Vitrolero (3 tLts)',3],\n ['482','Vitrolero practico Jema flex',2],\n ['587','Zapatero 2 niveles',3],\n ['588','Zapatero 2 niveles',2],\n ['589','Zapatero 2 niveles',3],\n ['475','Juego de 6 vasos de cristal',4]\n ];\n\n foreach ($priceList as $key => $priceName) {\n Prize::create([\n 'article_no' => $priceName[0],\n 'name' => $priceName[1],\n 'batch' => $priceName[2],\n ]);\n }\n }", "function getPriceWithDiscount($price)\n {\n if($price<1000) {\n return ($price*0.90);\n }\n else {\n return ($price*0.95);\n }\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getPrice()\n {\n return $this->price;\n }", "public function getSorianaPrice($url) {\n try {\n $price = null;\n\n if ($this->isBlocked($url)) {\n echo \"<div style='color: red'>URL no disponible</div><br>\";\n } else {\n $crawler = $this->client->request('GET', $url);\n\n // Precio actual\n $elements = $crawler->filter('.sale-price')->each(function ($node) {\n return $node->text();\n });\n\n if (count($elements) < 1) {\n // Precio regular\n $elements = $crawler->filter('.original-price')->each(function ($node) {\n return $node->text();\n });\n }\n\n if (count($elements) < 1) {\n // Precio regular\n $elements = $crawler->filter('.big-price')->each(function ($node) {\n return $node->text();\n });\n }\n\n $price = (isset($elements[0])) ? $this->cleanPrice($elements[0]) : null;\n }\n\n return $price;\n } catch (Exception $ex) {\n echo \"<br><div style='color: red;'>\" . $ex->getMessage() . \" \" . $ex->getLine() . \" \" . $ex->getFile() . \"</div><br>\";\n }\n }", "function wpsp_tour_price( $price, $is_promote = false, $percentage ) {\n \n if ( empty( $price ) ) \n return;\n\n $regular_price = $price;\n printf( '<span class=\"label\">%s</span>', esc_html__( 'Per person', 'discovertravel' ) );\n \n if ( $is_promote == 'on' ) {\n \t$discount_price = ($regular_price / 100) * $percentage;\n \t$sale_price = $regular_price - $discount_price;\n \tprintf('<del><span class=\"amount\"><sup>$</sup>%1$s</span></del><ins><span class=\"on-sale\">%2$s</span></ins><ins><span class=\"amount\"><sup>$</sup>%3$s</span></ins>', \n \t\t\t$regular_price,\n \t\t\t$percentage . esc_html__( '% Off', 'discovertravel' ),\n \t\t\t$sale_price\n \t\t);\n } else {\n \tprintf('<ins><span class=\"amount\"><sup>$</sup>%1$s</span></ins>', \n \t\t\t$regular_price\n \t\t);\n }\n}", "function learn_skill ($skill, $price)\r\n {\r\n global $p;\r\n global $sid;\r\n $skill = preg_replace ('/[^0-9]/', '', $skill);\r\n $price = preg_replace ('/[^0-9]/', '', $price);\r\n if ($skill === false) put_error ('неуказан навык');\r\n if ($price === false) put_error ('неуказанa цена');\r\n if (!isset($p['skills'][$skill])) put_error ('такого навыка нету');\r\n if ($p['skills'][$skill]) put_g_error ('вы уже имеете этот навык!');\r\n\t\r\n $mage = array (22, 23, 24, 25, 26, 27, 28, 29, 30);\r\n $warrior = array (7, 8, 9, 10, 41);\r\n $ranger = array (11, 12);\r\n // proverka na klassy:\r\n if ($p['classof'] != 3 && in_array ($skill, $mage)) put_g_error ('только для магов!');\r\n if ($p['classof'] != 1 && in_array ($skill, $warrior)) put_g_error ('только для воина!');\r\n if ($p['classof'] != 2 && in_array ($skill, $ranger)) put_g_error ('только для лучников!');\r\n\t\r\n if ($p['money'] < $price) put_g_error ('у вас нехватает серебра - надо '.$price.' монет!');\r\n if (!$p['stats'][3]) put_g_error ('у вас нету очка навыка!');\r\n\r\n // nelzja vychitq vtoroj navyk iz serii parirovanie - dvuruchnoe - dva\r\n if (($p['skills'][18] || $p['skills'][40] || $p['skills'][41]) && ($skill == 18 || $skill == 40 || $skill == 41)) put_g_error ('нелзя выучить два навыка из серии двуручное - два - парирование. Либо щит, либо двуручное, либо два.');\r\n\r\n // esli vsju proverku proshli, podnimem i zabudem\r\n $p['skills'][$skill] = 1;\r\n $p['stats'][3] -= 1;\r\n $skills = implode ('|', $p['skills']);\r\n $stats = implode ('|', $p['stats']);\r\n $p['money'] -= $price;\r\n do_mysql (\"UPDATE players SET skills = '\".$skills.\"', stats = '\".$stats.\"', money = '\".$p['money'].\"' WHERE id_player = '\".$p['id_player'].\"';\");\r\n $f = gen_header ('навыки');\r\n $f .= '<div class=\"y\" id=\"sodhg\"><b>навыки:</b></div><p>';\r\n include 'modules/sp/sp_skillnames.php';\r\n $f .= 'вы выучили '.$skn[$skill].'!<br/>';\r\n $f .= '<a class=\"blue\" href=\"game.php?sid='.$sid.'\">в игру</a></p>';\r\n $f .= gen_footer ();\r\n exit ($f);\r\n }", "public function getSearsPrice($url) {\n try {\n $price = null;\n\n if ($this->isBlocked($url)) {\n echo \"<div style='color: red'>URL no disponible</div><br>\";\n } else {\n $crawler = $this->client->request('GET', $url);\n\n // Precio actual\n $elements = $crawler->filter('.precio')->each(function ($node) {\n return $node->text();\n });\n\n if (count($elements) < 1) {\n // Precio regular\n $elements = $crawler->filter('.precio_secundario')->each(function ($node) {\n return $node->text();\n });\n }\n\n $price = (isset($elements[0])) ? $this->cleanPrice($elements[0]) : null;\n }\n\n return $price;\n } catch (Exception $ex) {\n echo \"<br><div style='color: red;'>\" . $ex->getMessage() . \" \" . $ex->getLine() . \" \" . $ex->getFile() . \"</div><br>\";\n }\n }", "public function getPriceAll()\n { \n $collection = $this->PostCollectionFactory->create();\n /*$a = $collection->getPrice();*/\n foreach ($collection as $key => $value) {\n $value->getPrice();\n }\n return $value->getPrice();\n }", "public static function get_category_price_ranges($route_id=false, $special_mode=false)\n {\n $search_string=isset($parameters[\"search_string\"])?$parameters[\"search_string\"]:null;\n // zjistime $price category id\n $price_category_value=Service_Product_Price::get_price_category_percentual_value(Service_User::instance()->get_user()->price_category);\n if($price_category_value==0) \n { \n $price_category_code=Service_Product_Price::get_price_category_code(Service_User::instance()->get_user()->price_category);\n }\n else\n {\n // pokud je nastavena sleva procentem, vezmu puvodni cenovou kategorii D0\n $price_category_code=self::$default_price_code;\n } \n $hodnota_procentni_slevy_pro_skupinu=(Service_Product_Price::get_price_category_percentual_value(Service_User::instance()->get_user()->price_category))/100;\n \n $query=DB::select(array(db::expr(\"\n min(\n CASE\n WHEN pc2.price_type_id =1\n THEN\n (\n CASE\n WHEN products.percentage_discount >0\n THEN pcp2.cena * ( 1 - ( products.percentage_discount /100 ) ) \n ELSE pcp2.cena\n END\n )\n WHEN $hodnota_procentni_slevy_pro_skupinu > (products.percentage_discount/100)\n THEN (`price_categories_products`.`cena` * ( 1 - ( $hodnota_procentni_slevy_pro_skupinu ) ) ) \n ELSE (`price_categories_products`.`cena` * ( 1 - ( products.percentage_discount/100) ) )\n END\n )\n \"),\"cena_min\"));\n \n\n $query->join(\"price_categories_products\")->on(\"products.id\",\"=\",\"price_categories_products.product_id\");\n $query->join(\"price_categories\")->on(\"price_categories_products.price_category_id\",\"=\",\"price_categories.id\")->on(\"price_categories.kod\",\"=\",db::expr(\"\\\"D0\\\"\"));\n $query->join(array(\"price_categories_products\",\"pcp2\"))->on(\"products.id\",\"=\",\"pcp2.product_id\");\n $query->join(array(\"price_categories\",\"pc2\"))->on(\"pcp2.price_category_id\",\"=\",\"pc2.id\")->on(\"price_categories.kod\",\"=\",db::expr(\"\\\"\".$price_category_code.\"\\\"\"));\n $query=self::_category_query_base($query, $special_mode);\n $query=self::_category_query_base_condition($query, $route_id, $search_string);\n //die($query);\n $result=$query->as_object()->execute()->current();\n $range[\"price_min\"]=floor(($result->cena_min)?$result->cena_min:0);\n \n $query2=DB::select(array(db::expr(\"\n max(\n CASE\n WHEN pc2.price_type_id =1\n THEN\n (\n CASE\n WHEN products.percentage_discount >0\n THEN pcp2.cena * ( 1 - ( products.percentage_discount /100 ) ) \n ELSE pcp2.cena\n END\n )\n WHEN $hodnota_procentni_slevy_pro_skupinu > (products.percentage_discount/100)\n THEN (`price_categories_products`.`cena` * ( 1 - ( $hodnota_procentni_slevy_pro_skupinu ) ) ) \n ELSE (`price_categories_products`.`cena` * ( 1 - ( products.percentage_discount/100) ) )\n END\n )\n \"),\"cena_max\"));\n \n\n $query2->join(\"price_categories_products\")->on(\"products.id\",\"=\",\"price_categories_products.product_id\");\n $query2->join(\"price_categories\")->on(\"price_categories_products.price_category_id\",\"=\",\"price_categories.id\")->on(\"price_categories.kod\",\"=\",db::expr(\"\\\"D0\\\"\"));\n $query2->join(array(\"price_categories_products\",\"pcp2\"))->on(\"products.id\",\"=\",\"pcp2.product_id\");\n $query2->join(array(\"price_categories\",\"pc2\"))->on(\"pcp2.price_category_id\",\"=\",\"pc2.id\")->on(\"price_categories.kod\",\"=\",db::expr(\"\\\"\".$price_category_code.\"\\\"\"));\n $query2=self::_category_query_base($query2, $special_mode);\n $query2=self::_category_query_base_condition($query2, $route_id, $search_string);\n //die($query);\n $result2=$query2->as_object()->execute()->current();\n $range[\"price_max\"]=ceil(($result2->cena_max)?$result2->cena_max:0);\n\n return $range;\n }", "public function getPricing($data)\n {\n $query = Price::where('sellable_id', '=', (int)$data['sellable_id']);\n $returnData = $query->where('sellable_type', '=', $data['sellable_type'])\n ->get()\n ->toArray();\n if (!empty($returnData)) {\n return $returnData[0];\n } else {\n return null;\n }\n }", "public function getPrice(){\n return $this->price;\n }", "public function getPrice(){\n return $this->price;\n }", "abstract function total_price($price_summary);", "public function bestPriceCalculatedProvider()\n {\n return [\n [0, 500.0, 400.0, 350.0, 500.0],\n [0, 500.0, 400.0, 450.0, 500.0],\n [1, 500.0, 400.0, 350.0, 350.0],\n [1, 500.0, 400.0, 450.0, 400.0],\n [2, 500.0, 20.0, 15.0, 480.0],\n [2, 500.0, 20.0, 25.0, 475.0],\n [3, 500.0, 20.0, 15.0, 400.0],\n [3, 500.0, 20.0, 25.0, 375.0],\n [4, 500.0, 20.0, 15.0, 515.0],\n [4, 500.0, 20.0, 25.0, 520.0],\n [5, 500.0, 20.0, 15.0, 575.0],\n [5, 500.0, 20.0, 25.0, 600.0],\n ];\n }", "function price( )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n return $this->Price;\n }", "public function getMaxPrice();", "function get_price_per_user($price, $product) {\n\tif (!is_user_logged_in()) { return $price; }\n\n\t$user_id = get_current_user_id();\n\t$product_id = $product->id;\n\n\t// Loop through price alteration rows\n\tif (get_field('price_alteration', 'option')) {\n\t\twhile (has_sub_field('price_alteration', 'option')) {\n\t\t\t$users = get_sub_field('user', 'option');\n\t\t\tforeach($users AS $user) {\n\t\t\t\tif ($user['ID'] == $user_id) {\n\t\t\t\t\t$products = get_sub_field('product', 'option');\n\t\t\t\t\tforeach($products AS $curr_product) {\n\t\t\t\t\t\tif ($product_id == $curr_product->ID) {\n\t\t\t\t\t\t\t$price = get_sub_field('adjusted_price', 'option');\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\n\treturn $price;\n}", "public function setBestPrice($product_id) {\n $query = \"SELECT * FROM wp_pwgb_postmeta WHERE post_id=:product_id;\";\n $stm = $this->db->prepare($query);\n $stm->bindValue(\":product_id\", $product_id, PDO::PARAM_INT);\n $stm->execute();\n\n $response = $stm->fetchAll(PDO::FETCH_ASSOC);\n $tag_prices = $this->productPrice();\n $theBest = ['price' => 0];\n $otherPrices = [];\n $hasChanged = false;\n\n // Obtiene el mejor precio anterior\n foreach ($response as $metadata) {\n // Mejor precio\n if (isset($metadata['meta_key']) && $metadata['meta_key'] == 'price_best') {\n $theBest['price'] = $metadata['meta_value'];\n }\n\n // Mejor tienda\n if (isset($metadata['meta_key']) && $metadata['meta_key'] == 'best_shop') {\n $theBest['shop'] = $metadata['meta_value'];\n }\n\n // Obtiene el precio de otras tiendas\n foreach ($tag_prices as $price) {\n if (isset($metadata['meta_key']) && $metadata['meta_key'] == $price) {\n $otherPrices[$price] = (int) $metadata['meta_value'];\n }\n }\n }\n\n $oldPrice = $theBest['price'];\n // Obtiene el nuevo mejor precio\n foreach ($otherPrices as $store => $price) {\n if (($price > 0) && ($price < $theBest['price'])) {\n $theBest['price'] = $price;\n $theBest['shop'] = $store;\n $hasChanged = true;\n }\n }\n\n // Si el mejor precio cambio, lo actualiza y lo guarda en el historial\n if ($hasChanged) {\n $query = \"INSERT INTO dw_historial (product_id, price_old, price_new, created_at) VALUES \n (:product_id, :price_old, :price_new, NOW());\";\n $stm2 = $this->db->prepare($query);\n $stm2->bindValue(\":product_id\", $product_id, PDO::PARAM_INT);\n $stm2->bindValue(\":price_old\", $oldPrice, PDO::PARAM_INT);\n $stm2->bindValue(\":price_new\", $theBest['price'], PDO::PARAM_INT);\n $stm2->execute();\n\n $query = \"UPDATE wp_pwgb_postmeta SET meta_value=:price_new WHERE post_id=:product_id AND meta_key='price_best';\";\n $stm3 = $this->db->prepare($query);\n $stm3->bindValue(\":product_id\", $product_id, PDO::PARAM_INT);\n $stm3->bindValue(\":price_new\", $theBest['price'], PDO::PARAM_INT);\n $stm3->execute();\n\n $query = \"UPDATE wp_pwgb_postmeta SET meta_value=:best_shop WHERE post_id=:product_id AND meta_key='best_shop';\";\n $stm4 = $this->db->prepare($query);\n $stm4->bindValue(\":product_id\", $product_id, PDO::PARAM_INT);\n $stm4->bindValue(\":best_shop\", $theBest['shop'], PDO::PARAM_STR);\n $stm4->execute();\n }\n }", "function get_price_html() {\n\t\t$price = '';\n\t\tif ( $this->has_child() ) :\n\t\t\t\n\t\t\t$min_price = '';\n\t\t\t$max_price = '';\n\t\t\t\n\t\t\tforeach ($this->children as $child) :\n\t\t\t\t$child_price = $child->product->get_price();\n\t\t\t\tif ($child_price<$min_price || $min_price == '') $min_price = $child_price;\n\t\t\t\tif ($child_price>$max_price || $max_price == '') $max_price = $child_price;\n\t\t\tendforeach;\n\t\t\t\n\t\t\t$price .= '<span class=\"from\">' . __('From: ', 'woothemes') . '</span>' . woocommerce_price($min_price);\t\t\n\t\telseif ($this->is_type('variable')) :\n\t\t\n\t\t\t$price .= '<span class=\"from\">' . __('From: ', 'woothemes') . '</span>' . woocommerce_price($this->get_price());\t\n\t\t\n\t\telse :\n\t\t\tif ($this->price) :\n\t\t\t\tif ($this->is_on_sale() && isset($this->data['regular_price'])) :\n\t\t\t\t\t$price .= '<del>'.woocommerce_price( $this->data['regular_price'] ).'</del> <ins>'.woocommerce_price($this->get_price()).'</ins>';\n\t\t\t\telse :\n\t\t\t\t\t$price .= woocommerce_price($this->get_price());\n\t\t\t\tendif;\n\t\t\tendif;\n\t\tendif;\n\t\treturn $price;\n\t}", "private function calculateSearchTermsUseRate()\n {\n foreach ($this->searchTerms as $searchTerm) {\n $this->searchTermsUseRate[$searchTerm['term']] = [\n 'use_rate' => floor($this->totalProductsCount / $searchTerm['count']),\n 'used' => 0\n ];\n }\n }", "function tep_get_productPrice($product_id){\n\tif ($product_id){\n\t\tglobal $languages_id,$pf;\n\t\t$product_query = tep_db_query(\"select p.products_id,p.products_price,products_discount from \" . TABLE_PRODUCTS . \" p where p.products_id=\".(int)$product_id );\n\t\tif (tep_db_num_rows($product_query)) {\n\t\t\t$product = tep_db_fetch_array($product_query);\n\t\t\t$product_price = $product['products_price'];\n\t\t\t$rata = $product['products_discount'] > 0 ? number_format((1/(1-$product['products_discount']/100)),2,'.','') : PRODUCTS_RATE;//( $product['products_discount'] > 0 )? number_format( (1 - ($product['products_discount'] / 100)) , 2) : PRODUCTS_RATE;\n\t\t\t//$retail_price = $product['products_price'] * PRODUCTS_RATE;// * $rata;//\n\t\t\t//echo $rata;\n\t\t\t$pf -> loadProduct($product['products_id'],$languages_id);\n\t\t\t$result = array();\n\t\t\t$result['rsPrice'] = $pf -> getRetailSinglePrice($rata);\n\t\t\t$result['sPrice'] = $pf -> getSinglePrice();\n\t\t\treturn $result;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}else{\n\t\treturn false;\n\t}\n}", "public function getLowestPricedOffersForSKU($request);", "public function suggestPurchaseRequest()\n {\n return Product::select(DB::raw('id, productName as prDescription, reorderAmount - amount as prQty,reorderAmount, \"Write a descriptive Purpose for this request\" as prPurpose'))\n ->whereRaw('amount < reorderAmount and amount > 0')->limit(env('PURCHASE_ORDER_LIMIT'))->get();\n }", "private function corporation($skill){\n $calculatedJobPoint=0;\n $parameterAvg=[];\n $index=0;\n $corporations=$skill->corporations();\n foreach($corporations->where('question_completed',1)->get() as $index=>$corporation){\n $parameters=$corporation->answers->lists('answer');\n $parameterCount=0;\n foreach($parameters as $key=>$parameter){\n if($parameter==1){\n $parameterCount+=Config::get('rate')['corporation']['attributes'][$parameter]['value'];\n }elseif($parameter==2){\n $parameterCount+=Config::get('rate')['corporation']['attributes'][$parameter]['value'];\n }elseif($parameter==3){\n $parameterCount+=Config::get('rate')['corporation']['attributes'][$parameter]['value'];\n }\n elseif($parameter==4){\n $parameterCount+=Config::get('rate')['corporation']['attributes'][$parameter]['value'];\n }\n elseif($parameter==5){\n $parameterCount+=Config::get('rate')['corporation']['attributes'][$parameter]['value'];\n }\n }\n $parameterAvg[$index]=$parameterCount/($key+1); //avg point foreach corporation\n\n }\n $finalAvg=array_sum($parameterAvg)/($index+1)/20; //final avg point foreach skill between 1-5\n $finalCorporationPoint=$finalAvg*Config::get('rate')['corporation']['weight'];\n\n //checking the job num (corporation count)\n $corporationCount=$corporations->count();\n $jobPoint=$corporationCount*Config::get('rate')['job']['attributes']['corporation'];\n if($jobPoint>Config::get('rate')['job']['result'][5]){ //5 star job (corporation num)\n $calculatedJobPoint=5;\n }elseif($jobPoint>Config::get('rate')['job']['result'][4] && $jobPoint<=Config::get('rate')['job']['result'][5]){\n $calculatedJobPoint=4;\n }elseif($jobPoint>Config::get('rate')['job']['result'][3] && $jobPoint<=Config::get('rate')['job']['result'][4]){\n $calculatedJobPoint=3;\n }elseif($jobPoint>Config::get('rate')['job']['result'][2] && $jobPoint<=Config::get('rate')['job']['result'][3]){\n $calculatedJobPoint=2;\n }elseif($jobPoint>=Config::get('rate')['job']['result'][1] && $jobPoint<=Config::get('rate')['job']['result'][2]){\n $calculatedJobPoint=1;\n }\n $finalJobPoint=$calculatedJobPoint*Config::get('rate')['job']['weight'];\n\n return[\n 'finalCorporationPoint'=>$finalCorporationPoint,\n 'finalJobPoint'=>$finalJobPoint\n ];\n }", "public static function price($pair) {\n\t\t\treturn (self::valid($prices = self::prices(array($pair)))) ? $prices->prices[0] : $prices;\n\t\t}", "function get_price( $force_refresh=false ){\r\n\t\tif( $force_refresh || $this->price == 0 ){\r\n\t\t\t//get the ticket, clculate price on spaces\r\n\t\t\t$this->price = $this->get_ticket()->get_price() * $this->spaces;\r\n\t\t}\r\n\t\treturn apply_filters('em_booking_get_prices',$this->price,$this);\r\n\t}", "public function getPrepaidPhoneCreditPricelist($operator_id, $type_id)\n {\n $user = Auth::user();\n $quickbuy = false;\n if ($user->is_store) {\n $quickbuy = true;\n }\n // switch operators\n $operator = 'TELKOMSEL';\n switch ($operator_id) {\n case 2:\n $operator = 'INDOSAT';\n break;\n case 3:\n $operator = 'XL';\n break;\n case 4:\n $operator = 'AXIS';\n break;\n case 5:\n $operator = 'TRI';\n break;\n case 6:\n $operator = 'SMART';\n break;\n }\n\n // switch type\n $type = 'Pulsa';\n if ($type_id == 2) {\n $type = 'Data';\n }\n\n // empty array to be filled with selected operator pricelist data\n $priceArr = [];\n $priceCallArr = []; //Placeholder Paket Telepon & SMS\n // get all Prepaid Pricelist data from Cache if available or fresh fetch from API\n $prepaidPricelist = $this->getAllPrepaidPricelist();\n foreach ($prepaidPricelist['data'] as $row) {\n if ($row['category'] == $type) {\n if ($row['price'] <= 40000) {\n $initPrice = $row['price'] + 50;\n }\n if ($row['price'] > 40000) {\n $initPrice = $row['price'] + 70;\n }\n // Here we add 4% (2% for Profit Sharing Conribution, 2% for Seller's profit)\n // We also round-up last 3 digits to 500 increments, all excess will be Seller's profit\n $addedPrice = $initPrice + ($initPrice * 4 / 100);\n $roundedPrice = round($addedPrice, -2);\n $last3DigitsCheck = substr($roundedPrice, -3);\n $check = 500 - $last3DigitsCheck;\n if ($check == 0) {\n $price = $roundedPrice;\n }\n if ($check > 0 && $check < 500) {\n $price = $roundedPrice + $check;\n }\n if ($check == 500) {\n $price = $roundedPrice;\n }\n if ($check < 0) {\n $price = $roundedPrice + (500 + $check);\n }\n\n if ($row['brand'] == $operator) {\n $priceArr[] = [\n 'buyer_sku_code' => $row['buyer_sku_code'],\n 'desc' => $row['desc'],\n 'seller_price = ($price * 2 / 100)' => ($row['price'] + ($price * 2 / 100)),\n 'price' => $price,\n 'brand' => $row['brand'],\n 'product_name' => $row['product_name'],\n 'seller_name' => $row['seller_name']\n ];\n }\n }\n\n if ($type_id == 2) {\n // Get Paket Telepon & SMS\n if ($row['category'] == 'Paket SMS & Telpon') {\n if ($row['price'] <= 40000) {\n $initPrice = $row['price'] + 50;\n }\n if ($row['price'] > 40000) {\n $initPrice = $row['price'] + 70;\n }\n // Here we add 4% (2% for Profit Sharing Conribution, 2% for Seller's profit)\n // We also round-up last 3 digits to 500 increments, all excess will be Seller's profit\n $addedPrice = $initPrice + ($initPrice * 4 / 100);\n $roundedPrice = round($addedPrice, -2);\n $last3DigitsCheck = substr($roundedPrice, -3);\n $check = 500 - $last3DigitsCheck;\n if ($check == 0) {\n $price = $roundedPrice;\n }\n if ($check > 0 && $check < 500) {\n $price = $roundedPrice + $check;\n }\n if ($check == 500) {\n $price = $roundedPrice;\n }\n if ($check < 0) {\n $price = $roundedPrice + (500 + $check);\n }\n\n if ($row['brand'] == $operator) {\n $priceCallArr[] = [\n 'buyer_sku_code' => $row['buyer_sku_code'],\n 'desc' => $row['desc'],\n 'seller_price = ($price * 2 / 100)' => ($row['price'] + ($price * 2 / 100)),\n 'price' => $price,\n 'brand' => $row['brand'],\n 'product_name' => $row['product_name'],\n 'seller_name' => $row['seller_name']\n ];\n }\n }\n }\n }\n $pricelist = collect($priceArr)->sortBy('price')->toArray();\n $pricelistCall = collect($priceCallArr)->sortBy('price')->toArray();\n\n return view('member.app.shopping.prepaid_pricelist')\n ->with('title', 'Isi Pulsa/Data')\n ->with(compact('pricelist'))\n ->with(compact('pricelistCall'))\n ->with(compact('quickbuy'))\n ->with('type', $type_id);\n }", "public function getPalacioPrice($url) {\n try {\n $price = null;\n\n if ($this->isBlocked($url)) {\n echo \"<div style='color: red'>URL no disponible</div><br>\";\n } else {\n $crawler = $this->client->request('GET', $url);\n\n // Precio actual\n $elements = $crawler->filter('.special-price')->each(function ($node) {\n return $node->text();\n });\n\n if (count($elements) < 1) {\n // Precio regular\n $elements = $crawler->filter('.price')->each(function ($node) {\n return $node->text();\n });\n }\n\n $price = (isset($elements[0])) ? $this->cleanPrice($elements[0]) : null;\n }\n\n return $price;\n } catch (Exception $ex) {\n echo \"<br><div style='color: red;'>\" . $ex->getMessage() . \" \" . $ex->getLine() . \" \" . $ex->getFile() . \"</div><br>\";\n }\n }", "public function getOfferPrice($price, $festiveDiscountPercent = '', $festFlag = NULL) {\r\n if($festFlag != NULL){\r\n \tif ($festiveDiscountPercent) $dis_price = ceil((1 - ($festiveDiscountPercent / 100)) * $price);\r\n } elseif ($this->getFestive()) {\r\n if ($festiveDiscountPercent) $dis_price = ceil((1 - ($festiveDiscountPercent / 100)) * $price);\r\n } \r\n else $dis_price = $price;\r\n return $dis_price;\r\n }", "public function getEmoneyPricelist($operator_id)\n {\n $user = Auth::user();\n $quickbuy = false;\n if ($user->is_store) {\n $quickbuy = true;\n }\n // switch operators\n $operator = 'GO PAY';\n switch ($operator_id) {\n case 22:\n $operator = 'MANDIRI E-TOLL';\n break;\n case 23:\n $operator = 'OVO';\n break;\n case 24:\n $operator = 'DANA';\n break;\n case 25:\n $operator = 'LinkAja';\n break;\n case 26:\n $operator = 'SHOPEE PAY';\n break;\n case 27:\n $operator = 'BRI BRIZZI';\n break;\n case 28:\n $operator = 'TAPCASH BNI';\n break;\n }\n\n // empty array to be filled with selected operator pricelist data\n $priceArr = [];\n // get all Prepaid Pricelist data from Cache if available or fresh fetch from API\n $prepaidPricelist = $this->getAllPrepaidPricelist();\n foreach ($prepaidPricelist['data'] as $row) {\n if ($row['category'] == 'E-Money') {\n $addedPrice = $row['price'] + 1000;\n $last3DigitsCheck = substr($addedPrice, -3);\n $check = 500 - $last3DigitsCheck;\n if ($check == 0) {\n $price = $addedPrice;\n }\n if ($check > 0 && $check < 500) {\n $price = $addedPrice + $check;\n }\n if ($check == 500) {\n $price = $addedPrice;\n }\n if ($check < 0) {\n $price = $addedPrice + (500 + $check);\n }\n\n if ($row['brand'] == $operator) {\n $priceArr[] = [\n 'buyer_sku_code' => $row['buyer_sku_code'],\n 'desc' => $row['desc'],\n 'price' => $price,\n 'brand' => $row['brand'],\n 'product_name' => $row['product_name'],\n 'seller_name' => $row['seller_name']\n ];\n }\n }\n }\n $pricelist = collect($priceArr)->sortBy('price')->toArray();\n $pricelistCall = null;\n\n return view('member.app.shopping.prepaid_pricelist')\n ->with('title', 'Isi Emoney')\n ->with(compact('pricelist'))\n ->with(compact('pricelistCall'))\n ->with(compact('quickbuy'))\n ->with('type', $operator_id);\n }", "public function getPriceAttribute() {\n return BASE_PRICE\n + INGREDIENT_PRICES['salad'] * $this->salad\n + INGREDIENT_PRICES['cheese'] * $this->cheese\n + INGREDIENT_PRICES['meat'] * $this->meat\n + INGREDIENT_PRICES['bacon'] * $this->bacon;\n }" ]
[ "0.66902405", "0.6185576", "0.6161479", "0.61344796", "0.61065596", "0.6051913", "0.6051913", "0.6051913", "0.6051913", "0.60275596", "0.60264635", "0.6017558", "0.600814", "0.5970086", "0.5939211", "0.5832913", "0.5831582", "0.58068347", "0.5799072", "0.5784387", "0.5749018", "0.5742098", "0.574145", "0.5736232", "0.569733", "0.56906646", "0.5676087", "0.56732863", "0.56725127", "0.56725127", "0.5672025", "0.56664735", "0.5656127", "0.5656127", "0.5652863", "0.5641028", "0.56299055", "0.5589296", "0.5583001", "0.5581986", "0.55816007", "0.5580372", "0.5580356", "0.5576118", "0.5574956", "0.55596626", "0.55530506", "0.5547788", "0.5525525", "0.5524051", "0.55201733", "0.5510346", "0.55012125", "0.5499651", "0.54924256", "0.5483332", "0.54828846", "0.5475213", "0.54727423", "0.54721993", "0.5470609", "0.5470609", "0.5469159", "0.5468351", "0.5453958", "0.5446708", "0.54451394", "0.5436656", "0.5430863", "0.5407777", "0.5399936", "0.5399936", "0.53992134", "0.5395774", "0.5392702", "0.5386143", "0.5385993", "0.5384209", "0.53840727", "0.53791267", "0.53791267", "0.53768694", "0.5371764", "0.5366352", "0.5362885", "0.53602254", "0.5359805", "0.53472", "0.5337511", "0.53276294", "0.5325581", "0.53233904", "0.5314112", "0.5312703", "0.5306587", "0.5299384", "0.5288988", "0.52827024", "0.52756613", "0.5265567" ]
0.64579344
1
Get payment suggestion optimized for participation
public function paymentSuggestionsForParticipation(Participation $participation) { $list = new PaymentSuggestionList(); $suggestionForParticipation = $this->suggestionsForParticipation($participation, false, true); foreach ($suggestionForParticipation as $suggestionRaw) { $suggestion = new PaymentSuggestion( ((int)$suggestionRaw['value'])*-1, $suggestionRaw['description'], (int)$suggestionRaw['count'], ['participation'] ); $list->add($suggestion); } return $list; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function suggestionsForParticipation(Participation $participation, bool $isPriceSet, bool $isPayment)\n {\n $qb = $this->em->getConnection()->createQueryBuilder();\n $qb->select(['y.price_value AS value', 'y.description', 'MAX(y.created_at)'])\n ->from('participant_payment_event', 'y')\n ->innerJoin('y', 'participant', 'a', 'y.aid = a.aid')\n ->innerJoin('a', 'participation', 'p', 'a.pid = p.pid')\n ->andWhere($qb->expr()->eq('p.pid', ':pid'))\n ->setParameter('pid', $participation->getPid())\n ->andWhere('y.is_price_set = :is_price_set')\n ->setParameter('is_price_set', (int)$isPriceSet)\n ->andWhere('y.is_price_payment = :is_price_payment')\n ->setParameter('is_price_payment', (int)$isPayment)\n ->groupBy(['y.price_value', 'y.description']);\n $result = $qb->execute()->fetchAll();\n\n $suggestions = [];\n foreach ($result as $payment) {\n if (!isset($suggestions[$payment['value']])) {\n $suggestions[$payment['value']] = [];\n }\n if (!isset($suggestions[$payment['value']][$payment['description']])) {\n $suggestions[$payment['value']][$payment['description']] = 0;\n }\n ++$suggestions[$payment['value']][$payment['description']];\n }\n $suggestionsFlat = [];\n foreach ($suggestions as $value => $descriptions) {\n foreach ($descriptions as $description => $count) {\n $suggestionsFlat[] = [\n 'value' => $value,\n 'description' => $description,\n 'count' => $count,\n ];\n }\n }\n usort(\n $suggestionsFlat, function ($a, $b) {\n if ($a['count'] == $b['count']) {\n return 0;\n }\n return ($a['count'] < $b['count']) ? -1 : 1;\n }\n );\n\n return $suggestionsFlat;\n }", "private function recommendation($skill){\n $recommendationPoint=0;\n $recommendationPointMaster=0;\n $recommendationPointFive=0;\n $recommendationPointFour=0;\n $recommendationPointThree=0;\n $recommendationPointTwo=0;\n $recommendationPointOne=0;\n $recommendations=$skill->recommendations;\n foreach($recommendations as $recommendation){\n $recommendator=$recommendation->user;\n $rate=$recommendator->rate;\n if($recommendator->is('influencer')){\n $recommendationPointMaster+=Config::get('rate')['recommendation']['attributes']['master']['value'];\n if($recommendationPointMaster>=Config::get('rate')['recommendation']['attributes']['master']['max_value']){\n $recommendationPointMaster=Config::get('rate')['recommendation']['attributes']['master']['max_value'];\n }\n }elseif($rate==5){\n $recommendationPointFive+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointFive>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointFive=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }elseif($rate==4){\n $recommendationPointFour+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointFour>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointFour=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }elseif($rate==3){\n $recommendationPointThree+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointThree>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointThree=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }elseif($rate==2){\n $recommendationPointTwo+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointTwo>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointTwo=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }elseif($rate==1){\n $recommendationPointOne+=Config::get('rate')['recommendation']['attributes'][$rate]['value'];\n if($recommendationPointOne>=Config::get('rate')['recommendation']['attributes'][$rate]['max_value']){\n $recommendationPointOne=Config::get('rate')['recommendation']['attributes'][$rate]['max_value'];\n }\n }\n $recommendationPoint=$recommendationPointMaster+$recommendationPointFive+$recommendationPointFour+$recommendationPointThree+$recommendationPointTwo+$recommendationPointOne;\n }\n //finalize the recommendation calculation points\n if($recommendationPoint>Config::get('rate')['recommendation']['result'][5]){ //5 star\n $calculatedRecommendationPoint=5;\n }elseif($recommendationPoint>Config::get('rate')['recommendation']['result'][4] && $recommendationPoint<=Config::get('rate')['recommendation']['result'][5]){ //4 star\n $calculatedRecommendationPoint=4;\n }elseif($recommendationPoint>Config::get('rate')['recommendation']['result'][3] && $recommendationPoint<=Config::get('rate')['recommendation']['result'][4]){ //3 star\n $calculatedRecommendationPoint=3;\n }elseif($recommendationPoint>Config::get('rate')['recommendation']['result'][2] && $recommendationPoint<=Config::get('rate')['recommendation']['result'][3]){ //2 star\n $calculatedRecommendationPoint=2;\n }elseif($recommendationPoint>=Config::get('rate')['recommendation']['result'][1] && $recommendationPoint<=Config::get('rate')['recommendation']['result'][2]){ //1 star\n $calculatedRecommendationPoint=1;\n }else{ //none star\n $calculatedRecommendationPoint=1;\n }\n $finalRecommendationPoint=$calculatedRecommendationPoint*Config::get('rate')['recommendation']['weight'];\n return $finalRecommendationPoint;\n }", "public function suggestPurchaseRequest()\n {\n return Product::select(DB::raw('id, productName as prDescription, reorderAmount - amount as prQty,reorderAmount, \"Write a descriptive Purpose for this request\" as prPurpose'))\n ->whereRaw('amount < reorderAmount and amount > 0')->limit(env('PURCHASE_ORDER_LIMIT'))->get();\n }", "public function getPromoter($param1 = null, $param2 = null, $param3 = null, $param4 = null, $param5 = null, $param6 = null, $param7 = null)\n {\n //$endUseList,$loanType, $amount=null, $loanTenure = null, $companySharePledged= null, $bscNscCode = null,$loanId=null\n $endUseList = $param1;\n $loanType = $param2;\n $loanProduct = $param2;\n $amount = $param3;\n $loanTenure = $param4;\n $companySharePledged = null;\n $bscNscCode = null;\n if (isset($param5) && isset($param6)) {\n $companySharePledged = $param5;\n $bscNscCode = $param6;\n $loanId = $param7;\n } else {\n $loanId = $param5;\n }\n $promotersGenerationType = MasterData::promoterGenrationType();\n $choosenCibil = null;\n $degreeType = MasterData::degreeTypes();\n $noOfFamilyTypes = MasterData::familyType();\n $cities = MasterData::cities();\n $states = MasterData::states();\n $loan = null;\n $model = null;\n $existingPropertyOwned = null;\n $existingLoansMortgageDetails = null;\n $setDisable = null;\n $existingPromoterKycCount = 0;\n $promoter_details = null;\n $isFunded = 0;\n $userProfile = Auth::getUser()->userProfile();\n $user = Auth::getUser();\n $isSME = $user->isSME();\n $setDisable = $this->getIsDisabled($user);\n $isRemoveMandatory = MasterData::removeMandatory();\n $isRemoveMandatory = array_except($isRemoveMandatory, ['']);\n $removeMandatoryHelper = new validLoanUrlhelper();\n $removeMandatory = $removeMandatoryHelper->getMandatory($user, $isRemoveMandatory);\n $validLoanHelper = new validLoanUrlhelper();\n if (isset($loanId)) {\n $validLoan = $validLoanHelper->isValidLoan($loanId);\n if (!$validLoan) {\n return view('loans.error');\n }\n $status = $validLoanHelper->getTabStatus($loanId, 'promoter_details');\n if ($status == 'Y' && $setDisable != 'disabled') {\n $setDisable = 'disabled';\n }\n }\n if (isset($loanId)) {\n $loan = Loan::find($loanId);\n $isFunded = $loan->com_venture_capital_funded;\n if ($isFunded == null) {\n $isFunded = 0;\n }\n $model = $loan->getPromoterDetails()->get()->first();\n if (isset($model)) {\n if ($model->fin_propertiesowned > 0 && $model->fin_propertiesowned != 'None') {\n $existingPropertyOwned = PromoterPropertyDetail::where('loan_id', '=', $loanId)->get()->toArray();\n }\n /* if(isset($existingPropertyOwned)){\n if (in_array($existingPropertyOwned->location_city, $cities)) {\n $existingPropertyOwned->location_city = $existingPropertyOwned->location_city;\n }else{\n $salesAreaDetails->city_name_other = $salesAreaDetails->city_name;\n $salesAreaDetails->city_name = 'Other';\n }\n}*/\n\nif (!isset($endUseList)) {\n $endUseList = $loan->end_use;\n}\nif (!isset($loanType)) {\n $loanType = $loan->type;\n}\nif (!isset($amount)) {\n $amount = $loan->loan_amount;\n}\nif (!isset($loanTenure)) {\n $loanTenure = $loan->loan_tenure;\n}\n}\n$existingPromoterKycDetails = PromoterKycDetails::where('loan_id', '=', $loanId)->get();\n$existingLoanOverdraftDetails = LoanOverdraftKycDetails::where('loan_id', '=', $loanId)->get();\n$existingLoansMortgageDetails = LoansMortgageDetails::where('loan_id', '=', $loanId)->get();\n$existingLoanVechicleDetails = LoanVechicleDetails::where('loan_id', '=', $loanId)->get();\n$existingLoanCreditCardDetails = LoanCreditCardDetails::where('loan_id', '=', $loanId)->get();\n\n}\n\n\n//Promoter Array\nif (isset($existingPromoterKycDetails)) {\n $existingPromoterKycCount = count($existingPromoterKycDetails);\n}\n $maxPromoters = Config::get('constants.CONST_MAX_PROMOTER'); //5\n\n $temp_array = [];\n//$mortgagetemp_array = array();\n for ($i = 0; $i < 5; $i++) {\n if ($i < $existingPromoterKycCount) {\n array_push($temp_array, $existingPromoterKycDetails[$i]->toArray());\n } else {\n array_push($temp_array, \"\");\n }\n }\n\n//Overdraft array\n if (isset($existingLoanOverdraftDetails)) {\n $existingLoanOverdraftCount = count($existingLoanOverdraftDetails);\n }\n $maxoverdrafts = '3';\n\n $temp_array_overdr = [];\n for ($o = 0; $o < 3; $o++) {\n if ($o < $existingLoanOverdraftCount) {\n array_push($temp_array_overdr, $existingLoanOverdraftDetails[$o]->toArray());\n } else {\n array_push($temp_array_overdr, \"\");\n }\n }\n\n//Mortgage array\n if (isset($existingLoansMortgageDetails)) {\n $existingLoansMortgageCount = count($existingLoansMortgageDetails);\n }\n $maxmortgages = '3';\n\n $temp_array_mortgage = [];\n for ($mort = 0; $mort < 3; $mort++) {\n if ($mort < $existingLoansMortgageCount) {\n array_push($temp_array_mortgage, $existingLoansMortgageDetails[$mort]->toArray());\n } else {\n array_push($temp_array_mortgage, \"\");\n }\n }\n\n//Liblities Vechicle Loan\n\n if (isset($existingLoanVechicleDetails)) {\n $existingLoanVechicleCount = count($existingLoanVechicleDetails);\n }\n $maxvehicles = '3';\n $temp_array_vechicle = [];\n for ($vechicle = 0; $vechicle < 3; $vechicle++) {\n if ($vechicle < $existingLoanVechicleCount) {\n array_push($temp_array_vechicle, $existingLoanVechicleDetails[$vechicle]->toArray());\n } else {\n array_push($temp_array_vechicle, \"\");\n }\n\n }\n\n//Liblities Creditcard Loan\n\n if (isset($existingLoanCreditCardDetails)) {\n $existingCreditCardCount = count($existingLoanCreditCardDetails);\n }\n $maxCreditCards = '4';\n $temp_array_creditcard = [];\n for ($creditcard = 0; $creditcard < 3; $creditcard++) {\n if ($creditcard < $existingCreditCardCount) {\n array_push($temp_array_creditcard, $existingLoanCreditCardDetails[$creditcard]->toArray());\n } else {\n array_push($temp_array_creditcard, \"\");\n }\n\n }\n\n\n\n\n\n $deletedQuestionsLoan = $this->getDeletedQuestionLoan($loan, $loanType, $amount);\n $deletedQuestionHelper = new DeletedQuestionsHelper($deletedQuestionsLoan);\n//getting borrowers profile\n if (isset($loanId)) {\n $loan = Loan::find($loanId);\n $loanUser = User::find($loan->user_id);\n $loanUserProfile = $loanUser->userProfile();\n }\n $userPr = UserProfile::where('user_id', '=', $loan->user_id)->first();\n $userProfileFirm = UserProfile::with('user')->find($userPr->id);\n if ($isSME != null) {\n // dd(Auth::getUser()->userProfile()->owner_email);\n //$owner_entity_type = Auth::getUser()->userProfile()->owner_entity_type;\n $owner_entity_type = Auth::getUser()->userProfile();\n }\n $subViewType = 'loans._promoter';\n $formaction = 'Loans\\LoansController@postPromoter';\n return view('loans.createedit', compact(\n 'formaction',\n 'subViewType',\n 'endUseList',\n 'loanType',\n 'amount',\n 'loanTenure',\n 'companySharePledged',\n 'bscNscCode',\n 'loan',\n 'cities',\n 'loanId',\n 'maxPromoters',\n 'maxCreditCards',\n 'maxmortgages',\n 'maxvehicles',\n 'maxoverdrafts',\n 'existingPromoterCreditCardCount',\n 'promotersGenerationType',\n 'degreeType',\n 'noOfFamilyTypes',\n 'temp_array',\n 'userProfile',\n 'states',\n 'setDisable',\n 'deletedQuestionHelper',\n 'existingPromoterKycCount',\n 'existingPropertyOwned',\n 'existingLoansMortgageDetails',\n 'model',\n 'validLoanHelper',\n 'owner_entity_type',\n 'removeMandatory',\n 'loanUserProfile',\n 'userProfileFirm',\n 'isFunded',\n 'isSME',\n 'existingLoanOverdraftCount',\n 'existingLoansMortgageCount',\n 'existingLoanOverdraftDetails',\n 'existingLoanVechicleDetails',\n 'temp_array_overdr',\n 'temp_array_mortgage',\n 'temp_array_vechicle',\n 'temp_array_creditcard',\n 'existingLoanVechicleCount',\n 'existingCreditCardCount'\n ));\n }", "public function getRecommendations();", "private function corporation($skill){\n $calculatedJobPoint=0;\n $parameterAvg=[];\n $index=0;\n $corporations=$skill->corporations();\n foreach($corporations->where('question_completed',1)->get() as $index=>$corporation){\n $parameters=$corporation->answers->lists('answer');\n $parameterCount=0;\n foreach($parameters as $key=>$parameter){\n if($parameter==1){\n $parameterCount+=Config::get('rate')['corporation']['attributes'][$parameter]['value'];\n }elseif($parameter==2){\n $parameterCount+=Config::get('rate')['corporation']['attributes'][$parameter]['value'];\n }elseif($parameter==3){\n $parameterCount+=Config::get('rate')['corporation']['attributes'][$parameter]['value'];\n }\n elseif($parameter==4){\n $parameterCount+=Config::get('rate')['corporation']['attributes'][$parameter]['value'];\n }\n elseif($parameter==5){\n $parameterCount+=Config::get('rate')['corporation']['attributes'][$parameter]['value'];\n }\n }\n $parameterAvg[$index]=$parameterCount/($key+1); //avg point foreach corporation\n\n }\n $finalAvg=array_sum($parameterAvg)/($index+1)/20; //final avg point foreach skill between 1-5\n $finalCorporationPoint=$finalAvg*Config::get('rate')['corporation']['weight'];\n\n //checking the job num (corporation count)\n $corporationCount=$corporations->count();\n $jobPoint=$corporationCount*Config::get('rate')['job']['attributes']['corporation'];\n if($jobPoint>Config::get('rate')['job']['result'][5]){ //5 star job (corporation num)\n $calculatedJobPoint=5;\n }elseif($jobPoint>Config::get('rate')['job']['result'][4] && $jobPoint<=Config::get('rate')['job']['result'][5]){\n $calculatedJobPoint=4;\n }elseif($jobPoint>Config::get('rate')['job']['result'][3] && $jobPoint<=Config::get('rate')['job']['result'][4]){\n $calculatedJobPoint=3;\n }elseif($jobPoint>Config::get('rate')['job']['result'][2] && $jobPoint<=Config::get('rate')['job']['result'][3]){\n $calculatedJobPoint=2;\n }elseif($jobPoint>=Config::get('rate')['job']['result'][1] && $jobPoint<=Config::get('rate')['job']['result'][2]){\n $calculatedJobPoint=1;\n }\n $finalJobPoint=$calculatedJobPoint*Config::get('rate')['job']['weight'];\n\n return[\n 'finalCorporationPoint'=>$finalCorporationPoint,\n 'finalJobPoint'=>$finalJobPoint\n ];\n }", "function getMarketResearchesDirectPayment($game_id,$round_number,$company_id){\r\n\t\t\t$market=new Model_DbTable_Decisions_MarketResearches();\r\n\t\t\t$param_marketresearches=new Model_DbTable_Games_Param_Markets_MarketResearches();\r\n\t\t\t//funcionando correctamente. Estudios de mercado solicitados y costes\r\n\t\t\t$marketresearches_solicited=$market->getMarketResearchesSolicited($game_id, $company_id, $round_number);\r\n\t\t\t$marketresearches_costs=$param_marketresearches->getMarketResearchesCosts($game_id);\r\n\t\t\t\r\n\t\t\t$research_number=1;\r\n\t\t\t$totalCost=0;\r\n\t\t\t\r\n\t\t\t$names[0]=array('value'=>1, 'descriptor'=>'channelResearch');\r\n\t\t\t$names[1]=array('value'=>2, 'descriptor'=>'pricesResearch');\r\n\t\t\t$names[2]=array('value'=>3, 'descriptor'=>'mktResearch');\r\n\t\t\t$names[3]=array('value'=>4, 'descriptor'=>'spectedResearch');\r\n\t\t\t$names[4]=array('value'=>5, 'descriptor'=>'accountResearch');\r\n\t\t\t\r\n\t\t\twhile(isset($marketresearches_costs['marketResearch_number_'.$research_number])) {\t\t\t\t\r\n\t\t\t\t$aux=$marketresearches_solicited[$names[$research_number-1]['descriptor']];\r\n\t\t\t\t$cost=$marketresearches_costs['marketResearch_number_'.$research_number];\r\n\t\t\t\t$totalCost=$totalCost+($aux*$cost);\r\n\t\t\t\t$research_number++;\r\n\t\t\t}\r\n\t\t\treturn $totalCost;\r\n\t\t}", "public function get_deal_suggestion_detail($id,&$data){\n global $g_mc;\n $q = \"SELECT s.*, m.f_name,m.l_name,m.designation,w.name as work_company,t.takeover_name,'banks' as `banks`,'law_firms' as `law_firms` from \".TP.\"transaction_suggestions as s left join \".TP.\"member as m on(s.suggested_by=m.mem_id) left join \".TP.\"company as w on(m.company_id=w.company_id) left join \".TP.\"takeover_type_master as t on(s.takeover_id=t.takeover_id) where s.id='\".$id.\"'\";\n \n $res = mysql_query($q);\n if(!$res){\n return false;\n }\n $data = mysql_fetch_assoc($res);\n //////////////////////////////////////////////////\n\t\t/*****************\n\t\tsng:17/jun/2011\n\t\tnow we get the is_sellside_advisor flag also\n\t\t***********************/\n //banks data\n $data['banks'] = array();\n\t\t\n $q_bank = \"select * from \".TP.\"transaction_suggestions_partners where suggestion_id='\".$id.\"' AND partner_type='bank'\";\n $q_bank_res = mysql_query($q_bank);\n if(!$q_bank_res){\n return false;\n }\n ///////////////////////////\n $q_bank_res_count = mysql_num_rows($q_bank_res);\n for($bank_i=0;$bank_i<$q_bank_res_count;$bank_i++){\n $data['banks'][$bank_i] = mysql_fetch_assoc($q_bank_res);\n }\n //////////////////////////////////////////////////////////\n //law firm data\n $data['law_firms'] = array();\n\t\t\n\t\t$q_law = \"select * from \".TP.\"transaction_suggestions_partners where suggestion_id='\".$id.\"' AND partner_type='law firm'\";\n $q_law_res = mysql_query($q_law);\n if(!$q_law_res){\n return false;\n }\n ///////////////////////////\n $q_law_res_count = mysql_num_rows($q_law_res);\n for($law_i=0;$law_i<$q_law_res_count;$law_i++){\n $data['law_firms'][$law_i] = mysql_fetch_assoc($q_law_res);\n }\n\t\t/***********************************************\n\t\tsng:1/sep/2011\n\t\tThere might be one or more files along with this new deal suggestion.\n\t\tNOTE: we only fetch those that are yet to be associated with a deal\n\t\t\n\t\tsng:22/feb/2012\n\t\twe now use method in transaction_doc to get the docs associated with a transaction suggestion\n\t\t**************************************************/\n\t\trequire_once(\"classes/class.transaction_doc.php\");\n\t\t$trans_doc = new transaction_doc();\n\t\t\n\t\t$data['docs'] = NULL;\n\t\t$temp_count = 0;\n\t\t\n\t\t$ok = $trans_doc->front_get_all_documents_for_deal_suggestion($id,$data['docs'],$temp_count);\n\t\tif(!$ok){\n\t\t\treturn false;\n\t\t}\n return true;\n }", "public function process_payment() {\n\n // Saves a suggestions group\n (new MidrubBasePaymentsCollectionBraintreeHelpers\\Process)->prepare();\n\n }", "public function getPaymentDescription();", "public static function get_suggested_policy_text()\n {\n }", "public function front_set_partners_for_deal($deal_id,$data,$suggestion_mem_id,$deal_add_date_time){\n\t\trequire_once(\"classes/class.company.php\");\n\t\t$comp = new company();\n\t\t/**************\n\t\tbank /law firm names and whether sellside advisor\n\t\t[\"banks\"]=> array(4) { \n\t\t[0]=> string(4) \"Citi\" (bank 1)\n\t\t[1]=> string(8) \"JPMorgan\" (bank 2 sellside)\n\t\t[2]=> string(11) \"BNP Paribas\" (bank 3)\n\t\t[3]=> string(13) \"Credit Suisse\" (bank 4 sellside)\n\t\t} \n\t\t[\"sellside_advisors_2\"]=> string(2) \"on\" \n\t\t[\"sellside_advisors_4\"]=> string(2) \"on\"\n\t\t\n\t\t['bank_is_insignificant_2\"]=>string(2)\t\"on\"\n\t\t['bank_role_id_1']\t6\n\t\t['bank_role_id_2']\t0 (no option selected)\n\t\t['bank_role_id_3']\t0\n\t\t\n\t\t[\"law_firms\"]=> array(4) { \n\t\t[0]=> string(20) \"Mello Jones & Martin\" (firm 1)\n\t\t[1]=> string(0) \"\" (firm 2)\n\t\t[2]=> string(0) \"\" (firm 3)\n\t\t[3]=> string(11) \"Bredin Prat\" (firm 4 sellside)\n\t\t} \n\t\t[\"law_sellside_advisors_4\"]=> string(2) \"on\"\n\t\t************************************************/\n\t\t/*************\n\t\tsng:6/apr/2012\n\t\t************/\n\t\t$suggestion_data_arr = array();\n\t\t\n\t\t$add_bank_validation_passed = false;\n\t\t$err_arr = array();\n\t\t$bank_count = count($data['banks']);\n\t\t$bank_found = false;\n\t\t$bank_id = 0;\n\t\tfor($bank_i=0;$bank_i<$bank_count;$bank_i++){\n\t\t\t//name can be blank so\n\t\t\tif($data['banks'][$bank_i]!=\"\"){\n\t\t\t\t$ok = company_id_from_name($data['banks'][$bank_i],'bank',$bank_id,$bank_found);\n\t\t\t\tif(!$ok){\n\t\t\t\t\tcontinue;\n\t\t\t\t}else{\n\t\t\t\t\tif(!$bank_found){\n\t\t\t\t\t\t//create it\n\t\t\t\t\t\t$ok = $comp->front_quick_create_company_blf($suggestion_mem_id,$data['banks'][$bank_i],'bank',$bank_id);\n\t\t\t\t\t\tif(!$ok){\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//we have bank\n\t\t\t\t\t/****************************\n\t\t\t\t\tsng:14/mar/2012\n\t\t\t\t\twe need to check for sellside advisor flag\n\t\t\t\t\tfor bank[0] it will be sellside_advisors_1: on\n\t\t\t\t\tit may or may not be there\n\t\t\t\t\t\n\t\t\t\t\tsng:23/mar/2012\n\t\t\t\t\tWe no longer need this sellside, since we now have role like 'Advisor, Sellside'\n\t\t\t\t\t\n\t\t\t\t\tsng:16/mar/2012\n\t\t\t\t\tditto for bank[1] bank_is_insignificant_2: on\n\t\t\t\t\tit may or may not be there\n\t\t\t\t\t\n\t\t\t\t\tsng:23/mar/2012\n\t\t\t\t\tWe no longer need this insignificant since we now have role like 'Junior Advisor'\n\t\t\t\t\t\n\t\t\t\t\tfor bank[0] bank_role_id_1: is non zero if the corresponding dropdown is selected\n\t\t\t\t\t*************************/\n\t\t\t\t\t/****************\n\t\t\t\t\tsng:23/mar/2012\n\t\t\t\t\tWe now have role like 'Advisor, Sellside', so we no longer require the\n\t\t\t\t\tsellside flag. We have removed that from the detailed deal submission\n\t\t\t\t\t*********************/\n\t\t\t\t\t/******************\n\t\t\t\t\tsng:23/mar/2012\n\t\t\t\t\tWe now have role like 'Junior Advisor, so we no longer use the checkbox 'Not lead advisor'\n\t\t\t\t\tso let us remove the 'bank_is_insignificant_'\n\t\t\t\t\t*************************/\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$record_arr = array();\n\t\t\t\t\t$record_arr['firm_name'] = $data['banks'][$bank_i];\n\t\t\t\t\t$record_arr['partner_id'] = $bank_id;\n\t\t\t\t\t$record_arr['transaction_id'] = $deal_id;\n\t\t\t\t\t/***********\n\t\t\t\t\twe no longer use is_sellside\n\t\t\t\t\tWe no longer use is_insignificant\n\t\t\t\t\t*************/\n\t\t\t\t\t$record_arr['role_id'] = $data['bank_role_id_'.($bank_i+1)];\n\t\t\t\t\t$this->add_partner($record_arr,'bank',$add_bank_validation_passed,$err_arr);\n\t\t\t\t\t/********************************************\n\t\t\t\t\tsng:6/apr/2012\n\t\t\t\t\tif the partners are added, we keep a record in the suggestion table.\n\t\t\t\t\tThis is part of suggestion tracking where we need to know the original partners submitted with the deal and their roles.\n\t\t\t\t\tJust prepare the array, do not add yet\n\t\t\t\t\t***************/\n\t\t\t\t\tif($add_bank_validation_passed){\n\t\t\t\t\t\t$suggestion_data_arr[] = array('partner_name'=>$data['banks'][$bank_i],'partner_type'=>'bank','role_id'=>$record_arr['role_id']);\n\t\t\t\t\t}\n\t\t\t\t\t/*****************************************************/\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t/*********************************************************/\n\t\t$add_law_firm_validation_passed = false;\n\t\t$err_arr = array();\n\t\t$law_firm_count = count($data['law_firms']);\n\t\t$law_firm_found = false;\n\t\t$law_firm_id = 0;\n\t\tfor($law_firm_i=0;$law_firm_i<$law_firm_count;$law_firm_i++){\n\t\t\tif($data['law_firms'][$law_firm_i]!=\"\"){\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$ok = company_id_from_name($data['law_firms'][$law_firm_i],'law firm',$law_firm_id,$law_firm_found);\n\t\t\t\tif(!$ok){\n\t\t\t\t\tcontinue;\n\t\t\t\t}else{\n\t\t\t\t\tif(!$law_firm_found){\n\t\t\t\t\t\t//create it\n\t\t\t\t\t\t$ok = $comp->front_quick_create_company_blf($suggestion_mem_id,$data['law_firms'][$law_firm_i],'law firm',$law_firm_id);\n\t\t\t\t\t\tif(!$ok){\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t/****************\n\t\t\t\t\tsng:23/mar/2012\n\t\t\t\t\tWe now have role like 'Advisor, Sellside', so we no longer require the\n\t\t\t\t\tsellside flag. We have removed that from the detailed deal submission\n\t\t\t\t\t*********************/\n\t\t\t\t\t\n\t\t\t\t\t$record_arr = array();\n\t\t\t\t\t$record_arr['firm_name'] = $data['law_firms'][$law_firm_i];\n\t\t\t\t\t$record_arr['partner_id'] = $law_firm_id;\n\t\t\t\t\t$record_arr['transaction_id'] = $deal_id;\n\t\t\t\t\t/******\n\t\t\t\t\twe no longer use sellside advisor checkbox\n\t\t\t\t\t*********/\n\t\t\t\t\t$record_arr['role_id'] = $data['law_firm_role_id_'.($law_firm_i+1)];\n\t\t\t\t\t$this->add_partner($record_arr,'law firm',$add_law_firm_validation_passed,$err_arr);\n\t\t\t\t\t/********************************************\n\t\t\t\t\tsng:6/apr/2012\n\t\t\t\t\tif the partners are added, we keep a record in the suggestion table.\n\t\t\t\t\tThis is part of suggestion tracking where we need to know the original partners submitted with the deal and their roles\n\t\t\t\t\t***************/\n\t\t\t\t\tif($add_law_firm_validation_passed){\n\t\t\t\t\t\t$suggestion_data_arr[] = array('partner_name'=>$data['law_firms'][$law_firm_i],'partner_type'=>'law firm','role_id'=>$record_arr['role_id']);\n\t\t\t\t\t}\n\t\t\t\t\t/********************************/\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t/***********\n\t\t6/apr/2012\n\t\t**********/\n\t\trequire_once(\"classes/class.transaction_suggestion.php\");\n\t\t$trans_suggestion = new transaction_suggestion();\n\t\t$trans_suggestion->partners_added_via_deal_submission($deal_id,$suggestion_mem_id,$deal_add_date_time,$suggestion_data_arr);\n\t\t/************************************************************/\n\t\treturn true;\n\t}", "public function priceSuggestionsForParticipation(Participation $participation)\n {\n return $this->suggestionListForParticipation($participation, true, false);\n }", "public static function json_search_sumo_payment_plans() {\n ob_start() ;\n\n $term = ( string ) wc_clean( stripslashes( isset( $_GET[ 'term' ] ) ? $_GET[ 'term' ] : '' ) ) ;\n $exclude = array () ;\n\n if ( isset( $_GET[ 'exclude' ] ) && ! empty( $_GET[ 'exclude' ] ) ) {\n $exclude = array_map( 'intval' , explode( ',' , $_GET[ 'exclude' ] ) ) ;\n }\n\n $args = array (\n 'type' => 'sumo_payment_plans' ,\n 'status' => 'publish' ,\n 'return' => 'posts' ,\n 'order' => 'ASC' ,\n 'orderby' => 'parent title' ,\n 's' => $term ,\n 'exclude' => $exclude ,\n ) ;\n\n $posts = _sumo_pp()->query->get( $args ) ;\n $found_plans = array () ;\n\n if ( ! empty( $posts ) ) {\n foreach ( $posts as $post ) {\n $found_plans[ $post->ID ] = $post->post_title ;\n }\n }\n wp_send_json( $found_plans ) ;\n }", "private function getPaymentOptions()\n {\n $this->setVersionStrings();\n\n $this->load->language('extension/payment/svea_partpayment');\n\n $this->load->model('extension/payment/svea_partpayment');\n $this->load->model('checkout/order');\n\n $order = $this->model_checkout_order->getOrder($this->session->data['order_id']);\n $countryCode = $order['payment_iso_code_2'];\n\n $result = array();\n\n if ($this->config->get($this->paymentString . 'svea_partpayment_testmode_' . $countryCode) !== null) {\n $svea = $this->model_extension_payment_svea_partpayment->getPaymentPlanParams($countryCode);\n } else {\n $result = array(\"error\" => $this->responseCodes(40001, \"The country is not supported for this paymentmethod\"));\n\n return $result;\n }\n\n if (!isset($svea)) {\n $result = array(\"error\" => 'Svea error: '.$this->language->get('response_27000'));\n } else {\n $currency = $order['currency_code'];\n\n $this->load->model('localisation/currency');\n\n $currencies = $this->model_localisation_currency->getCurrencies();\n $decimals = \"\";\n\n foreach ($currencies as $key => $val) {\n if ($key == $currency) {\n if ($key == 'EUR') {\n $decimals = 2;\n } else {\n $decimals = 0;\n }\n }\n }\n\n $formattedPrice = round($this->currency->format(($order['total']), $currency, false, false), $decimals);\n\n try {\n $campaigns = PaymentPlanCalculator::getAllCalculationsFromCampaigns($formattedPrice, $svea->campaignCodes, false, $decimals);\n\n foreach ($campaigns as $campaign) {\n foreach ($svea->campaignCodes as $cc) {\n if ($campaign['campaignCode'] == $cc->campaignCode) {\n $result[] = array(\n \"campaignCode\" => $campaign['campaignCode'],\n \"description\" => $campaign['description'],\n \"monthlyAmountToPay\" => $campaign['monthlyAmountToPay'] . \" \" . $currency . \"/\" . $this->language->get('month'),\n \"paymentPlanType\" => $campaign['paymentPlanType'],\n \"contractLengthInMonths\" => $this->language->get('contractLengthInMonths') . \": \" . $campaign['contractLengthInMonths'] . \" \" . $this->language->get('unit'),\n \"monthlyAnnuityFactor\" => $campaign['monthlyAnnuityFactor'],\n \"initialFee\" => $this->language->get('initialFee') . \": \" . $campaign['initialFee'] . \" \" . $currency,\n \"notificationFee\" => $this->language->get('notificationFee') . \": \" . $campaign['notificationFee'] . \" \" . $currency,\n \"interestRatePercent\" => $this->language->get('interestRatePercent') . \": \" . $campaign['interestRatePercent'] . \"%\",\n \"numberOfInterestFreeMonths\" => $campaign['numberOfInterestFreeMonths'] != 0 ? $this->language->get('numberOfInterestFreeMonths') . \": \" . $campaign['numberOfInterestFreeMonths'] . \" \" . $this->language->get('unit') : 0,\n \"numberOfPaymentFreeMonths\" => $campaign['numberOfPaymentFreeMonths'] != 0 ? $this->language->get('numberOfPaymentFreeMonths') . \": \" . $campaign['numberOfPaymentFreeMonths'] . \" \" . $this->language->get('unit') : 0,\n \"totalAmountToPay\" => $this->language->get('totalAmountToPay') . \": \" . $campaign['totalAmountToPay'] . \" \" . $currency,\n \"effectiveInterestRate\" => $this->language->get('effectiveInterestRate') . \": \" . $campaign['effectiveInterestRate'] . \"%\"\n );\n break;\n }\n }\n }\n } catch (Exception $exception) {\n $this->log->write('Svea: Unable to fetch calculations for campaigns. Exception: ' . $exception->getMessage());\n }\n }\n return $result;\n }", "public function calculatePayment()\n {\n }", "private function suggestionsForEvent(Event $event, bool $isPriceSet, bool $isPayment)\n {\n $qb = $this->em->getConnection()->createQueryBuilder();\n $qb->select(['y.price_value AS value', 'y.description', 'COUNT(*) AS count'])\n ->from('participant_payment_event', 'y')\n ->innerJoin('y', 'participant', 'a', 'y.aid = a.aid')\n ->innerJoin('a', 'participation', 'p', 'a.pid = p.pid')\n ->andWhere($qb->expr()->eq('p.eid', ':eid'))\n ->setParameter('eid', $event->getEid())\n ->andWhere('y.is_price_set = :is_price_set')\n ->setParameter('is_price_set', (int)$isPriceSet)\n ->andWhere('y.is_price_payment = :is_price_payment')\n ->setParameter('is_price_payment', (int)$isPayment)\n ->groupBy(['y.price_value', 'y.description'])\n ->orderBy('count', 'DESC')\n ->setMaxResults(4);\n return $qb->execute()->fetchAll();\n }", "public static function PaymentOptionList()\n {\n \t\n \treturn array(\n \t 'cod'=>t(\"Cash On delivery\"),\n \t 'ocr'=>t(\"Offline Credit Card Payment\"),\n \t 'pyr'=>t(\"Pay On Delivery\"),\n \t 'pyp'=>t(\"paypal\"),\n \t 'stp'=>t(\"stripe\"),\n \t 'mcd'=>t(\"mercapado\"),\n \t 'ide'=>t(\"sisow\"),\n \t 'payu'=>t(\"payumoney\"),\n \t 'pys'=>t(\"paysera\"), \t \n \t 'bcy'=>t(\"Barclay\"),\n \t 'epy'=>t(\"EpayBg\"),\n \t 'atz'=>t(\"Authorize.net\"),\n \t 'obd'=>t(\"Offline Bank Deposit\"),\n \t 'btr' =>t(\"Braintree\")\n \t);\n }", "public function getPaymentRequest(): string;", "public static function get_payment_plan_search_field() {\n\n check_ajax_referer( 'sumo-pp-get-payment-plan-search-field' , 'security' ) ;\n\n wp_send_json( array (\n 'search_field' => _sumo_pp_wc_search_field( array (\n 'class' => 'wc-product-search' ,\n 'action' => '_sumo_pp_json_search_sumo_payment_plans' ,\n 'id' => isset( $_POST[ 'loop' ] ) ? \"selected_{$_POST[ 'col' ]}_payment_plan_{$_POST[ 'rowID' ]}{$_POST[ 'loop' ]}\" : \"selected_{$_POST[ 'col' ]}_payment_plan_{$_POST[ 'rowID' ]}\" ,\n 'name' => isset( $_POST[ 'loop' ] ) ? \"_sumo_pp_selected_plans[{$_POST[ 'loop' ]}][{$_POST[ 'col' ]}][{$_POST[ 'rowID' ]}]\" : \"_sumo_pp_selected_plans[{$_POST[ 'col' ]}][{$_POST[ 'rowID' ]}]\" ,\n 'type' => 'payment_plans' ,\n 'selected' => false ,\n 'multiple' => false ,\n 'placeholder' => __( 'Search for a payment plan&hellip;' , _sumo_pp()->text_domain ) ,\n ) , false ) ,\n ) ) ;\n }", "abstract public function getPaymentMethod();", "function suggest()\n\t{\n\t\t//allow parallel searchs to improve performance.\n\t\tsession_write_close();\n\t\t$params = $this->session->userdata('price_rules_search_data') ? $this->session->userdata('price_rules_search_data') : array('deleted' => 0);\n\t\t$suggestions = $this->Price_rule->get_search_suggestions($this->input->get('term'),$params['deleted'],100);\n\t\techo json_encode(H($suggestions));\n\t}", "function needs_suggestions($obj)\n{\n\t$decision = FALSE;\n\t\n\tif($obj->session->userdata('trigger_suggestions') && $obj->session->userdata('conc_searchresults'))\n\t{\n\t\t$trigger_suggestions = $obj->session->userdata('trigger_suggestions');\n\t\t#Check that there is no confirmed result in the display results before suggesting\n\t\t$display_results = $obj->session->userdata('conc_searchresults');\n\t\t$no_conf = \"Y\";\n\t\tforeach($display_results AS $row)\n\t\t{\n\t\t\tif($row['percentage'] == 'CONF'){\n\t\t\t\t$no_conf = \"N\";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif($no_conf == 'Y' && !empty($trigger_suggestions))\n\t\t{\n\t\t\t$decision = TRUE;\n\t\t}\n\t}\n\t\n\treturn $decision;\n}", "public function get_search_reward_point($reward_point,$limit, $start,$reward = 'pt'){\r\n\t\t$this->db->select(\"t_company.name as company, m_category.category_name as category,t_support.company_reward_id as company_reward_id\");\r\n\t\t$this->db->from(\"t_support\");\r\n\t\t$this->db->join(\"t_company\",\"t_company.cid = t_support.cid\");\r\n\t\t$this->db->join(\"m_category\",\"m_category.category_id = t_company.category_id\");\r\n\t\t$this->db->limit($limit, $start);\r\n\t\tif($reward == 'rate'){\r\n\t\t\t$this->db->where('t_support.reward_point_rate >=',($reward_point*2));//result display in UC-17 ->t_support.reward_point 50%\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$this->db->where('t_support.reward_point >=',($reward_point*2));//result display in UC-17 ->t_support.reward_point 50%\r\n\t\t}\r\n\t\t\r\n\t\t$this->db->where(\" t_support.delete_flg\",0);\r\n\t\t$this->db->where(\" t_support.active_flag\",1);\r\n\t\t$this->db->where(\" t_company.delete_flg\",0);\r\n\t\t// var_dump($this->db->get_compiled_select());exit();\r\n\t\t$query = $this->db->get();\r\n\t\treturn $query->num_rows() > 0 ? $query->result_object() : false;\r\n\t}", "function field_collection_contributions_rules_complete_contribution($order) {\n $order_wrapper = entity_metadata_wrapper('commerce_order', $order);\n foreach ($order_wrapper->commerce_line_items->getIterator() as $delta => $line_item_wrapper) {\n if (!isset($product_wrapper)) {\n isset($line_item_wrapper->commerce_product) ? $product_wrapper = $line_item_wrapper->commerce_product->value() : NULL;\n }\n }\n\n // Go over the price components to figure out donation and fee.\n foreach($order->commerce_order_total['und'][0]['data']['components'] as $delta => $component) {\n if($component['name'] === 'base_price') {\n $donation = $component['price']['amount'];\n }\n if ($component['name'] === 'fee') {\n $fee = $component['price']['amount'];\n }\n }\n\n\n // If the charity is paying the fee take that out of the donation.\n // @todo - Figure out how to automatically calculate the fee with and without the using paying it.\n if (!isset($fee)) {\n $fee = $donation * .1;\n $donation = $donation - $fee;\n }\n $donation = commerce_currency_amount_to_decimal($donation, commerce_default_currency());\n\n // get fields on the product\n // @todo - Ben - Figure out why the product wrapper can't access the field_collection values.\n $meter_item = field_get_items('commerce_product', $product_wrapper, 'field_donation_meter');\n $item_collection = field_collection_field_get_entity($meter_item[0]);\n $meter_wrapper = entity_metadata_wrapper('field_collection_item', $item_collection);\n\n // Add donation to total donations.\n // @todo - Ben - Get field_donation_current as an input from the rule setup.\n $current = $meter_wrapper->field_donation_current->value();\n\n // @todo - Ben - Get field_donation_goal as an input from the rule setup.\n $goal = $meter_wrapper->field_donation_goal->value();\n if (($current + $donation) > $goal) {\n $current = $goal;\n }\n else {\n $current += $donation;\n }\n $meter_wrapper->field_donation_current->set($current);\n $meter_wrapper->save();\n}", "private function findRecommendation(){\n $placeModel = new Place();\n $places = $placeModel->getAllCategorized();\n $bestScore = PHP_INT_MAX;\n $idBest = 0;\n\n foreach($places as $place){\n $currScore = 0;\n $currScore += abs($place->heritage - $this->score['heritage'] );\n $currScore += abs($place->relax - $this->score['relax'] );\n $currScore += abs($place->sightseeing - $this->score['sightseeing']);\n $currScore += abs($place->weather - $this->score['weather']) ;\n $currScore += abs($place->populated - $this->score['populated'] );\n\n if($currScore < $bestScore){\n $bestScore = $currScore;\n $idBest = $place->id_plc;\n }\n\n }\n\n return $idBest;\n }", "public function getPricingRecommendations()\n {\n return $this->pricingRecommendations;\n }", "function tranferFounds($project_id, $returnTotal=false, $adaptivepayments_pay = true) {\n\n App::import('Vendor', 'paypal');\n $this->Paypal = new Paypal();\n\n\n $this->recursive = -1;\n $sponsorships = $this->find('all', array('conditions' => array('Sponsorship.project_id' => $project_id)));\n\n $tranferredSponsorships = array();\n $total = 0;\n foreach ($sponsorships as $sponsorship) {\n $sponsorship_id = $sponsorship[$this->alias]['id'];\n if ($this->getPaymentType($sponsorship) == EXPRESSCHECKOUT) { // all of these payments are already on our paypal account, no tenemos que hacer nada.\n if ($this->isTransferred($sponsorship, EXPRESSCHECKOUT)) { // se marco como trasferido ? \n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n } else {\n $transactionId = $sponsorship[$this->alias]['expresscheckout_transaction_id'];\n if (!empty($transactionId)) {\n $response = $this->Paypal->hashCall('GetTransactionDetails', array('TRANSACTIONID' => $transactionId));\n if ($this->updateExpressCheckoutStatus($sponsorship_id, $transactionId)) {\n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n }\n }\n }\n } elseif ($this->getPaymentType($sponsorship) == PREAPPROVAL) {\n if ($this->isTransferred($sponsorship, PREAPPROVAL)) { // se marco como trasferido ? \n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n } else {\n $preapproval_key = $sponsorship[$this->alias]['preapproval_key'];\n if ($this->updatePreApprovalStatus($sponsorship_id, $preapproval_key)) { // actualizamos el pago | si esta activo ....\n $transferred = true;\n $sponsorship = $this->read(null, $sponsorship_id);\n if (!$this->isTransferred($sponsorship, PREAPPROVAL)) {\n // transferimos el pago a groofi $transferred = true ;\n if ($adaptivepayments_pay == true && $this->adaptivepayments_pay($sponsorship)) { //\n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n } elseif ($adaptivepayments_pay == false) {\n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n }\n } else {\n $total += $sponsorship[$this->alias]['contribution'];\n $tranferredSponsorships[] = $sponsorship;\n $sponsorship[$this->alias]['internal_status'] = SPONSORSHIP_TRANSFERRED;\n $sponsorship[$this->alias]['transferred'] = 1;\n $this->save($sponsorship);\n }\n }\n }\n }\n }\n return $returnTotal ? $total : $tranferredSponsorships;\n }", "function getSuggestPosting() {\n return getAll(\"SELECT a.*,c.name \n FROM posting a \n INNER JOIN member_posting b ON a.id = b.posting_id\n INNER JOIN member c ON c.id = b.member_id\n LIMIT 5\");\n}", "function getPromoList()\n {\n return array(array('reason'=>'test_discount','amount'=>3.5));\n }", "public function searchPayments($searchOptions = array())\n {\n\n $obj = new stdClass();\n // Must be in specific order for checksum ----------\n $obj->Timestamp = $this->getTimeStamp();\n $obj->SessionID = $this->getSessionID();\n $obj->PinCode = $this->getPinCode();\n $obj->UserAgent = $this->getUserAgent();\n $obj->MerchantID = null;\n $obj->PaymentID = null;\n $obj->OrderID = null;\n $obj->Reference = null;\n $obj->Description = null;\n $obj->Status = null;\n $obj->OrderTime1 = null;\n $obj->OrderTime2 = null;\n $obj->PaymentTime1 = null;\n $obj->PaymentTime2 = null;\n $obj->CountryCode = null;\n $obj->CurrencyCode = null;\n $obj->Amount = null;\n $obj->PaymentMethod = null;\n $obj->ConsumerAccountNumber = null;\n $obj->ConsumerName = null;\n $obj->ConsumerAddress = null;\n $obj->ConsumerHouseNumber = null;\n $obj->ConsumerPostCode = null;\n $obj->ConsumerCity = null;\n $obj->ConsumerCountry = null;\n $obj->ConsumerEmail = null;\n $obj->ConsumerPhoneNumber = null;\n $obj->ConsumerIPAddress = null;\n $obj->Page = (int) 1;\n // ------------------------------------------------\n\n if (!empty($searchOptions)) {\n foreach ($searchOptions as $key => $filter) {\n $obj->$key = $filter;\n }\n }\n\n // Generate Checksum\n $obj->Checksum = $this->generateChecksum($obj);\n\n // Properties only used for the Checksum\n unset($obj->PinCode);\n\n // Ask for SearchPayments and get response\n $result = $this->client->SearchPayments($obj);\n $result = $result->SearchPaymentsResult;\n\n $searchResults = isset($result->Payments->Payment) ? $result->Payments->Payment : null;\n\n $obj = new stdClass();\n $obj->Timestamp = $result->Timestamp;\n $obj->SessionID = $this->getSessionID();\n $obj->ReportingPinCode = $this->getPinCode();\n\n if (!is_null($searchResults)) {\n // Assign all properties of the sub object(s) as property of mainObject\n $obj = $this->parseForChecksum($obj, $searchResults, true, array(\n \"Amount\", \"ConsumerAccountNumber\", \"ConsumerAddress\", \"ConsumerHouseNumber\", \"ConsumerName\",\n \"ConsumerPostCode\", \"CountryCode\", \"CurrencyCode\", \"Duration\", \"MerchantID\", \"OrderTime\",\n \"PaymentID\", \"PaymentMethod\", \"PaymentTime\", \"Status\", \"StatusCode\", \"TestMode\"\n ));\n }\n\n // Verify response data by making a new Checksum\n $CheckSum = $this->generateChecksum($obj);\n\n // Compare Checksums\n if ($result->Checksum != $CheckSum)\n throw new Exception('Data could not be verified');\n\n return (array) $searchResults;\n }", "public function get_paid_taxcode() {\n $matches = array();\n $query_string = htmlspecialchars($_POST['q'], ENT_QUOTES, 'UTF-8');\n $result = $this->classtraineemodel->get_paid_user($this->tenant_id, $query_string, '');\n if ($result) {\n foreach ($result as $row) {\n $matches[] = array(\n 'key' => $row->user_id,\n 'label' => $row->tax_code . ' (Name: ' . $row->first_name . ' ' . $row->last_name . ')',\n 'value' => $row->tax_code\n );\n }\n }\n echo json_encode($matches);\n exit();\n }", "public function getPaymentMethod()\n {\n // get pusat\n $pusatCode = m_company::where('c_type', 'PUSAT')->select('c_id')->first();\n $pusatCode = $pusatCode->c_id;\n\n $data = m_paymentmethod::where('pm_isactive', 'Y')\n ->whereHas('getAkun', function ($q) use ($pusatCode) {\n $q->where('ak_comp', $pusatCode);\n })\n ->with('getAkun')\n ->get();\n\n return response()->json([\n 'data' => $data\n ]);\n }", "private function createPaymentRequest()\n {\n $helper = Mage::helper('pagseguro');\n\n // Get references that stored in the database\n $reference = $helper->getStoreReference();\n\n $paymentRequest = new PagSeguroPaymentRequest();\n $paymentRequest->setCurrency(PagSeguroCurrencies::getIsoCodeByName(self::REAL));\n $paymentRequest->setReference($reference . $this->order->getId()); //Order ID\n $paymentRequest->setShipping($this->getShippingInformation()); //Shipping\n $paymentRequest->setSender($this->getSenderInformation()); //Sender\n $paymentRequest->setItems($this->getItensInformation()); //Itens\n $paymentRequest->setShippingType(SHIPPING_TYPE);\n $paymentRequest->setShippingCost(number_format($this->order->getShippingAmount(), 2, '.', ''));\n $paymentRequest->setNotificationURL($this->getNotificationURL());\n $helper->getDiscount($paymentRequest);\n\n //Define Redirect Url\n $redirectUrl = $this->getRedirectUrl();\n\n if (!empty($redirectUrl) and $redirectUrl != null) {\n $paymentRequest->setRedirectURL($redirectUrl);\n } else {\n $paymentRequest->setRedirectURL(Mage::getUrl() . 'checkout/onepage/success/');\n }\n\n //Define Extra Amount Information\n $paymentRequest->setExtraAmount($this->extraAmount());\n\n try {\n $paymentUrl = $paymentRequest->register($this->getCredentialsInformation());\n } catch (PagSeguroServiceException $ex) {\n Mage::log($ex->getMessage());\n $this->redirectUrl(Mage::getUrl() . 'checkout/onepage');\n }\n\n return $paymentUrl;\n }", "private function getSuggest(): Suggestions\n {\n if (!$this->suggest) {\n $this->suggest = new Suggestions(config(\"dadataapi.token\", \"\"));\n $this->suggest->init();\n }\n return $this->suggest;\n }", "private function get_payment_desc($payment_name) {\r\n\t\t$payment_desc = array(\r\n\t\t\t'Credit' \t=> __('Credit', 'ecpay'),\r\n\t\t\t'Credit_3' \t=> __('Credit(3 Installments)', 'ecpay'),\r\n\t\t\t'Credit_6' \t=> __('Credit(6 Installments)', 'ecpay'),\r\n\t\t\t'Credit_12' \t=> __('Credit(12 Installments)', 'ecpay'),\r\n\t\t\t'Credit_18' \t=> __('Credit(18 Installments)', 'ecpay'),\r\n\t\t\t'Credit_24' \t=> __('Credit(24 Installments)', 'ecpay'),\r\n\t\t\t'WebATM' \t=> __('WEB-ATM', 'ecpay'),\r\n\t\t\t'ATM' \t\t=> __('ATM', 'ecpay'),\r\n\t\t\t'CVS' \t\t=> __('CVS', 'ecpay'),\r\n\t\t\t'BARCODE' \t=> __('BARCODE', 'ecpay'),\r\n\t\t\t'ApplePay' \t=> __('ApplePay', 'ecpay')\r\n\t\t);\r\n\t\t\r\n\t\treturn $payment_desc[$payment_name];\r\n\t}", "public function get_paid_trainee() {\n $matches = array();\n $query_string = htmlspecialchars($_POST['q'], ENT_QUOTES, 'UTF-8');\n $result = $this->classtraineemodel->get_paid_user($this->tenant_id, '', $query_string);\n if ($result) {\n foreach ($result as $row) {\n $matches[] = array(\n 'key' => $row->user_id,\n 'label' => $row->first_name . ' ' . $row->last_name . ' (Tax Code: ' . $row->tax_code . ')',\n 'value' => $row->first_name . ' ' . $row->last_name,\n );\n }\n }\n echo json_encode($matches);\n exit();\n }", "public function queueAddRecommendationsToSupportAccount(){\n \t\n \t$main_qry = DB::connection('bk')->table('revenue_organizations as ro')\n \t\t\t\t\t\t\t\t\t->join('organization_portals as op', 'ro.id', '=', 'op.ro_id')\n \t\t\t\t\t\t\t\t ->select('ro.id as ro_id', 'ro.name as ro_name', 'ro.num_of_rec', 'op.id as portal_id')\n \t\t\t\t\t\t\t\t ->groupBy('ro_name')\n \t\t\t\t\t\t\t\t ->where(function($q){\n \t\t\t\t\t\t\t\t \t$q->orWhere('ro.active', '=', DB::raw(1));\n \t\t\t\t\t\t\t\t \t$q->orWhere('ro.id', '=', DB::raw(10));\n \t\t\t\t\t\t\t\t \t$q->orWhere('ro.id', '=', DB::raw(31));\n \t\t\t\t\t\t\t\t })\n \t\t\t\t\t\t\t\t ->where('ro.id', '!=', 1)\n \t\t\t\t\t\t\t\t ->where('ro.id', '!=', 6)\n \t\t\t\t\t\t\t\t ->get();\n\n \t\n \t$cnt = 0;\n\n \tforeach ($main_qry as $key) {\n \t\t\n \t\t$qry = DB::connection('bk')->table('users as u')\n \t\t\t\t\t\t\t\t ->select('u.id as user_id')\n \t\t\t\t\t\t\t\t ->whereNotNull('u.phone')\n ->where('u.phone', '!=', ' ');\n\n \t\t$res = $this->addCustomFiltersForRevenueOrgs($qry, $key->ro_name);\n \t\tif (isset($res['status']) && $res['status'] == \"success\") {\n \t\t\t$qry = $res['qry'];\n \t\t}else{\n \t\t\tcontinue;\n \t\t}\n\n \t\t// Keypath orderby\n \t\tif ($key->ro_id == 10) {\n \t\t\t$qry = $qry->orderByRaw(\"case when (u.country_id = 5 OR u.country_id= 63 OR u.country_id= 68 OR u.country_id= 102 OR u.country_id= 123 OR u.country_id= 147 OR u.country_id= 158 OR u.country_id= 159 OR u.country_id= 218) then 1 else 2 end\");\n \t\t}else{\n \t\t\t$qry = $qry->orderBy(DB::raw(\"RAND()\")); \n \t\t}\n\n \t\t$qry = $qry->leftjoin('recruitment as r', function($q) use($key){\n\t\t\t\t\t\t\t \t\t$q->on('r.user_id', '=', 'u.id');\n\t\t\t\t\t\t\t \t\t$q->on('r.college_id', '=', DB::raw(7916));\n\t\t\t\t\t\t\t \t\t$q->on('r.ro_id', '=', DB::raw($key->ro_id));\n\t\t\t\t\t\t\t })\n \t\t\t ->leftjoin('recruitment_revenue_org_relations as rror', function($q) use($key){\n\t\t\t\t\t\t\t \t\t$q->on('rror.rec_id', '=', 'r.id');\n\t\t\t\t\t\t\t \t\t$q->on('rror.ro_id', '=', DB::raw($key->ro_id));\n\t\t\t\t\t\t\t })\n\t\t\t\t ->WhereNull('rror.id')\n \t\t\t ->whereNull('r.id')\n \t ->where('u.email', '!=', 'none')\n\t\t\t\t ->where('u.is_organization', 0)\n\t\t\t\t ->where('u.is_university_rep', 0)\n\t\t\t\t \n\t\t\t\t ->where('u.is_counselor', 0)\n\t\t\t\t ->where('u.is_aor', 0)\n\t\t\t\t ->where('u.email', 'NOT LIKE', '%els.edu%')\n\t\t\t\t ->where('u.email', 'NOT LIKE', '%shorelight%')\n\t\t\t\t ->where('u.email', 'NOT LIKE', '%test%')\n\t\t\t\t ->where('u.id', '!=', 1024184)\n\t\t\t\t ->where('u.is_ldy', 0)\n\t\t\t\t \n \t ->take($key->num_of_rec)\n \t\t\t ->get();\n\n \t\tforeach ($qry as $k) {\n\t \t\t$rec_qry = Recruitment::on('bk')->where('user_id', $k->user_id)\n\t\t\t\t\t\t\t\t\t\t\t\t ->where('college_id', 7916)\n\t\t\t\t\t\t\t\t\t\t\t\t ->where('ro_id', $key->ro_id)\n\t\t\t\t\t\t\t\t\t\t\t\t ->first();\n\t\t\t\tif (!isset($rec_qry)) {\n\t\t\t\t\t$attr = array('user_id' => $k->user_id, 'college_id' => 7916, 'ro_id' => $key->ro_id);\n\t\t\t\t\t\n\t\t\t\t\t$val = array('user_id' => $k->user_id, 'college_id' => 7916, 'user_recruit' => 1, 'college_recruit' => 0, \n\t\t\t\t\t\t\t\t 'status' => 1, 'type' => 'manual_recommendations', 'email_sent' => 1, 'ro_id' => $key->ro_id);\n\t\t\t\t\t\n\t\t\t\t\t$rec = Recruitment::updateOrCreate($attr, $val);\n\t\t\t\t\t$rec_id = $rec->id;\n\t\t\t\t}else{\n\t\t\t\t\t$arr = array('email_sent' => 1, 'user_recruit' => 0, 'college_recruit' => 0, \n\t\t\t\t \t\t\t\t 'ro_id' => $key->ro_id, 'status' => 1);\n\t\t\t\t\tif (!(strpos($rec_qry->type, 'manual_recommendations') !== true)) {\n\t\t\t\t\t\t$arr['type'] = DB::raw(\"CONCAT(type, ' manual_recommendations')\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tRecruitment::where('id', $rec_qry->id)\n\t \t\t\t\t\t\t\t\t\t ->update($arr);\n\t \t\t\t\t$rec_id = $rec_qry->id;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$attr = array('user_id' => $k->user_id, 'college_id' => 7916, 'org_portal_id' => $key->portal_id);\n\t\t\t\t$val = array('user_id' => $k->user_id, 'college_id' => 7916, 'org_portal_id' => $key->portal_id);\n\t\t\t\tRecruitmentTag::updateOrCreate($attr, $val);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$attr = array('rec_id' => $rec_id, 'ro_id' => $key->ro_id);\n\t\t\t\t$val = array('rec_id' => $rec_id, 'ro_id' => $key->ro_id);\n\n\t\t\t\tRecruitmentRevenueOrgRelation::updateOrCreate($attr, $val);\n\t\t\t\t\n\t\t\t\t$pu_qry = PrescreenedUser::where('user_id', $k->user_id)\n\t\t\t\t\t\t\t\t\t\t ->where('college_id', 7916)\n\t\t\t\t\t\t\t\t\t\t ->whereNull('aor_id')\n\t\t\t\t\t\t\t\t\t\t ->whereNull('org_portal_id')\n\t\t\t\t\t\t\t\t\t\t ->whereNull('aor_portal_id')\n\t\t\t\t\t\t\t\t\t\t ->delete();\n\t\t\t\t\n\t\t\t\t$rva_qry = RecruitmentVerifiedApp::where('user_id', $k->user_id)\n\t\t\t\t\t\t\t\t\t\t ->where('college_id', 7916)\n\t\t\t\t\t\t\t\t\t\t ->whereNull('aor_id')\n\t\t\t\t\t\t\t\t\t\t ->whereNull('org_portal_id')\n\t\t\t\t\t\t\t\t\t\t ->whereNull('aor_portal_id')\n\t\t\t\t\t\t\t\t\t\t ->delete();\n\n\t\t\t\t$rvh_qry = RecruitmentVerifiedHS::where('user_id', $k->user_id)\n\t\t\t\t\t\t\t\t\t\t\t\t ->where('college_id', 7916)\n\t\t\t\t\t\t\t\t\t\t\t\t ->whereNull('aor_id')\n\t\t\t\t\t\t\t\t\t\t\t\t ->whereNull('org_portal_id')\n\t\t\t\t\t\t\t\t\t\t\t\t ->whereNull('aor_portal_id')\n\t\t\t\t\t\t\t\t\t\t\t\t ->delete();\n\t\t\t}\n\n\t\t\t$cnt++;\n \t}\n \n \treturn \"Number of revenue_organizations recommendation added: \". $cnt;\n }", "public function getSuggestion()\n {\n return $this->suggestion;\n }", "function testingPayment(){\n\t\treturn $this->getTestingPayment();\n\t}", "public function postpaidPayment()\n {\n $bio = $this->customerData();\n // return $bio;\n $topups = Payment::where('email', '[email protected]')->get();\n // return $topups;\n $previous_topup = array_flatten(last($topups));\n $prev_tops = 0;\n if ($previous_topup) {\n $prev_top = Transaction::where('payment_id', $previous_topup[0]['id'])->first();\n $prev_tops = $prev_top ? $prev_top->initial_amount : 0;\n }\n // return $previous_topups;\n return view('customer.postpaid-payment', compact('prev_tops'))->withBio($bio);\n }", "public function processPayment();", "abstract public function getPaymentDrivers();", "public function calculate() {\n $price = $this->calculateFirstPayment($user);\n\n $currency = $price->currency;\n\n if ($user == Constants::USER_CLIENT) {\n $credit = ClientTransaction::getCreditBalance(Yii::app()->user->id);\n } else {\n $credit = new Price(0, $currency); //carer can't have credit\n }\n\n $paidCredit = new Price(0, $currency);\n $paidCash = new Price(0, $currency);\n $remainingCreditBalance = new Price(0, $currency);\n\n if ($credit->amount > 0) {\n\n if ($credit->amount >= $price->amount) {\n\n $paidCredit = $price;\n $remainingCreditBalance = $credit->substract($price);\n } else {\n\n $paidCash = $price->substract($credit);\n $paidCredit = $credit;\n }\n } else {\n $paidCash = $price;\n }\n\n return array('toPay' => $price, 'paidCash' => $paidCash, 'paidCredit' => $paidCredit, 'remainingCreditBalance' => $remainingCreditBalance);\n }", "function get_payment_details($app_id) {\r\n\t\t$sql = \"SELECT x.administration_fee, x.doctor_fee, JUMLAH_HARGA_OBAT_BY_APP(z.appointment_number) as med_fee, x.proc_fee, (x.lab_fee + (x.paramita_fee * 1.35)) as lab_fee, x.amc_package_fee, z.appointment_date,\r\n\t\t\t\ty.salutation, CONCAT(y.first_name, ' ' ,y.middle_name, ' ', y.last_name) as full_name, y.nickname\r\n\t\t\t\tFROM tb_billing as x, tb_patient as y, tb_appointment as z\r\n\t\t\t\tWHERE y.mr_no = z.mr_no\t\t\t\t\r\n\t\t\t\tAND z.appointment_number = x.id_appointment\r\n\t\t\t\tAND x.id_appointment = ?\t\t\t\t\r\n\t\t\t\tLIMIT 1\";\r\n\t\t$query = $this->db->query($sql, $app_id);\r\n\t\t/*$sql = \"SELECT SUM(harga)\r\n\t\t\t\tFROM tb_paramita_check_request\r\n\t\t\t\tWHERE id_app =?\";\r\n\t\t$query = $this->db->query($sql,$app_id);*/\r\n\t\tif($query->num_rows() > 0)\r\n\t\t\treturn $query->row();\r\n\t\telse\r\n\t\t\treturn FALSE;\r\n\t}", "public function recommendation()\n {\n }", "function get_payment_detail($payment_request_id){\n //you have to fetch\n\t\n $str_query=\"select p.`payment_request_id`,p.`code`,p.`year`,p.`request_date`,p.`programarea_id`,\n p.`request_status`,p.`financial_year_financial_year_id`,p.`amount`,\n p.`group_id`,p.`verification_document`,p.`liquidationdoc`,p.`owner_id`,\n pa.`programarea_name`,f.`year_name`\n from payment_request p\n join financial_year f on p.`financial_year_financial_year_id`=f.`financial_year_id`\n left join programarea pa on p.`programarea_id`=pa.`programarea_id` \n where p.`payment_request_id`=$payment_request_id\";\n if (!$this->sql_query($str_query)){\n return false;\n }\n \n\t\treturn $this->fetch();\n \n }", "abstract function has_paid_plan();", "public function getExternalPaymentOption()\n {\n $externalOption = new PaymentOption();\n $externalOption->setModuleName($this->name)\n ->setCallToActionText($this->l(''))\n ->setAction($this->context->link->getModuleLink($this->name, 'payment', [], true))\n ->setAdditionalInformation($this->context->smarty->fetch('module:pagoseguro/views/templates/hook/hook_payment_detail.tpl'))\n ->setLogo('https://documentosps.s3.us-east-2.amazonaws.com/logo_green.png');\n //->setLogo(Media::getMediaPath(_PS_MODULE_DIR_.$this->name.'/img/payment_logo.png'));\n\n return $externalOption;\n }", "protected function _getProximate() {\n $responce = array(\n 'type' => 'Select',\n 'name' => 'locationmiles'\n );\n if (Engine_Api::_()->getApi('settings', 'core')->getSetting('sitemember.proximity.search.kilometer', 0)) {\n $responce['label'] = $this->_translate(\"Within Kilometers\");\n $responce['multiOptions'] = array(\n '0' => '',\n '1' => $this->_translate('1 Kilometer'),\n '2' => $this->_translate('2 Kilometers'),\n '5' => $this->_translate('5 Kilometers'),\n '10' => $this->_translate('10 Kilometers'),\n '20' => $this->_translate('20 Kilometers'),\n '50' => $this->_translate('50 Kilometers'),\n '100' => $this->_translate('100 Kilometers'),\n '250' => $this->_translate('250 Kilometers'),\n '500' => $this->_translate('500 Kilometers'),\n '750' => $this->_translate('750 Kilometers'),\n '1000' => $this->_translate('1000 Kilometers'),\n );\n } else {\n $responce['label'] = $this->_translate(\"Within Miles\");\n $responce['multiOptions'] = array(\n '0' => '',\n '1' => $this->_translate('1 Mile'),\n '2' => $this->_translate('2 Miles'),\n '5' => $this->_translate('5 Miles'),\n '10' => $this->_translate('10 Miles'),\n '20' => $this->_translate('20 Miles'),\n '50' => $this->_translate('50 Miles'),\n '100' => $this->_translate('100 Miles'),\n '250' => $this->_translate('250 Miles'),\n '500' => $this->_translate('500 Miles'),\n '750' => $this->_translate('750 Miles'),\n '1000' => $this->_translate('1000 Miles'),\n );\n }\n\n return $responce;\n }", "public static function geoCart_payment_choicesProcess()\n {\n //get the cart\n $cart = geoCart::getInstance();\n\n //get the gateway since this is a static function\n $gateway = geoPaymentGateway::getPaymentGateway(self::gateway_name);\n\n //get invoice on the order\n $invoice = $cart->order->getInvoice();\n $invoice_total = $invoice->getInvoiceTotal();\n\n if ($invoice_total >= 0) {\n //DO NOT PROCESS! Nothing to process, no charge (or returning money?)\n return ;\n }\n //BUILD DATA TO SEND TO GATEWAY TO COMPLETE THE TRANSACTION\n $info = parent::_getInfo();\n\n //create initial transaction\n try {\n //let parent create a new transaction, since it does all that common stuff for us.\n //(including encrypting CC data)\n $transaction = self::_createNewTransaction($cart->order, $gateway, $info, false, true);\n\n //Add the transaction to the invoice\n $transaction->setInvoice($invoice);\n $invoice->addTransaction($transaction);\n\n //save it so there is an id\n $transaction->save();\n } catch (Exception $e) {\n //catch any error thrown by _createNewTransaction\n trigger_error('ERROR TRANSACTION CART PAYFLOW_PRO: Exception thrown when attempting to create new transaction.');\n return;\n }\n\n\n $cart->order->processStatusChange('pending_admin');\n }", "public function joinPaymentInfo();", "private function _proceedPayment()\n {\n $paymentInitModel = $this->_modelFactory->getModel(\n new Shopware_Plugins_Frontend_RpayRatePay_Component_Model_PaymentInit()\n );\n\n $result = $this->_service->xmlRequest($paymentInitModel->toArray());\n if (Shopware_Plugins_Frontend_RpayRatePay_Component_Service_Util::validateResponse(\n 'PAYMENT_INIT',\n $result\n )\n ) {\n Shopware()->Session()->RatePAY['transactionId'] = $result->getElementsByTagName('transaction-id')->item(\n 0\n )->nodeValue;\n $this->_modelFactory->setTransactionId(Shopware()->Session()->RatePAY['transactionId']);\n $paymentRequestModel = $this->_modelFactory->getModel(\n new Shopware_Plugins_Frontend_RpayRatePay_Component_Model_PaymentRequest()\n );\n $result = $this->_service->xmlRequest($paymentRequestModel->toArray());\n if (Shopware_Plugins_Frontend_RpayRatePay_Component_Service_Util::validateResponse(\n 'PAYMENT_REQUEST',\n $result\n )\n ) {\n $uniqueId = $this->createPaymentUniqueId();\n $orderNumber = $this->saveOrder(Shopware()->Session()->RatePAY['transactionId'], $uniqueId, 17);\n $paymentConfirmModel = $this->_modelFactory->getModel(\n new Shopware_Plugins_Frontend_RpayRatePay_Component_Model_PaymentConfirm()\n );\n $matches = array();\n preg_match(\"/<descriptor.*>(.*)<\\/descriptor>/\", $this->_service->getLastResponse(), $matches);\n $dgNumber = $matches[1];\n $result = $this->_service->xmlRequest($paymentConfirmModel->toArray());\n if (Shopware_Plugins_Frontend_RpayRatePay_Component_Service_Util::validateResponse(\n 'PAYMENT_CONFIRM',\n $result\n )\n ) {\n if (Shopware()->Session()->sOrderVariables['sBasket']['sShippingcosts'] > 0) {\n $this->initShipping($orderNumber);\n }\n try {\n $orderId = Shopware()->Db()->fetchOne(\n 'SELECT `id` FROM `s_order` WHERE `ordernumber`=?',\n array($orderNumber)\n );\n Shopware()->Db()->update(\n 's_order_attributes',\n array(\n 'RatePAY_ShopID' => Shopware()->Shop()->getId(),\n 'attribute5' => $dgNumber,\n 'attribute6' => Shopware()->Session()->RatePAY['transactionId']\n ),\n 'orderID=' . $orderId\n );\n } catch (Exception $exception) {\n Shopware()->Log()->Err($exception->getMessage());\n }\n\n //set payments status to payed\n $this->savePaymentStatus(\n Shopware()->Session()->RatePAY['transactionId'],\n $uniqueId,\n 155\n );\n\n /**\n * unset DFI token\n */\n if (Shopware()->Session()->RatePAY['devicefinterprintident']['token']) {\n unset(Shopware()->Session()->RatePAY['devicefinterprintident']['token']);\n }\n\n /**\n * if you run into problems with the redirect method then use the forwarding\n * return $this->forward('finish', 'checkout', null, array('sUniqueID' => $uniqueId));\n **/\n \n $this->redirect(\n Shopware()->Front()->Router()->assemble(\n array(\n 'controller' => 'checkout',\n 'action' => 'finish',\n 'forceSecure' => true\n )\n )\n );\n } else {\n $this->_error();\n }\n } else {\n $this->_error();\n }\n } else {\n $this->_error();\n }\n }", "function payment() {\n\t\t$url = 'https://www.instawallet.org/api/v1/w/' . $wallet_id . '/payment';\n\t\t$json = file_get_contents($url);\n\t\treturn json_decode($json);\n\t}", "function suggest()\n\t{\n\t\t$suggestions = $this->Giftcard->get_search_suggestions($this->input->post('q'),$this->input->post('limit'));\n\t\techo implode(\"\\n\",$suggestions);\n\t}", "function get_recommendations($prefs, $p1){\r\n\t//if he is very similar, then get the books from those that he has not read\r\n\r\n\t//saving the array in a different array\r\n\t$prefsOriginal = $prefs;\r\n\r\n\t//unsetting the person from the array - for whom we are getting the recommendation\r\n\tunset($prefs[$p1]);\r\n\r\n\t//array to save the person and the distance\r\n\t$personDistance = array();\r\n\r\n\t//calculating the similarity of this person with other users\r\n\tforeach($prefs as $k => $v){\r\n\t\t$dist = sim_distance($prefsOriginal, $p1, $k);\r\n\t\t$personDistance[$k] = $dist;\r\n\t}\r\n\r\n\t//sorting the array based on the distance - nearest first\r\n\tarsort($personDistance);\r\n\r\n\t//printing the top recommenders\r\n\t//print_r($personDistance);\r\n\r\n\t//getting the books from the distance people - taking top 3\r\n\t$i = 0;\r\n\t$recommendedBooks = array();\r\n\t$topBooks = array();\r\n\tforeach($personDistance as $k => $v){\r\n\t\t//get the top books for this person\r\n\t\t$topBooks = top_matches($prefs, $k, $v);\r\n\t\tif(sizeof($topBooks) >= 1){\r\n\t\t\t$recommendedBooks[] = $topBooks;\r\n\t\t\t$i += 1;\r\n\t\t}\r\n\t\tif($i > RECOM_NUM) break; //condition to take the recommendations only from the top matches\r\n\t}\r\n\t//printing the combine array\r\n\t//print_r($recommendedBooks);\r\n\r\n\t//echo ('<br><br>');\r\n\r\n\t$recBooks = array();\r\n\r\n\t//merging the arrays based on the RECOM_NUM\r\n\tforeach($recommendedBooks as $rks){\r\n\t\tforeach ($rks as $key => $value) {\r\n\t\t\t//check if the key already exists\r\n\t\t\tif(array_key_exists($key, $recBooks)){\r\n\t\t\t\t//see whether the value that we are going to insert is higher\r\n\t\t\t\tif($recBooks[$key] < $value){\r\n\t\t\t\t\t$recBooks[$key] = $value;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$value = $recBooks[$key];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$recBooks[$key] = $value;\t\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\r\n\r\n\t//getting the name of the books\r\n\t//$recBooks = array_keys($recBooks);\r\n\t//print_r($recBooks);\r\n\r\n\t//subtracting the items that the user has already seen\r\n\tforeach($prefsOriginal[$p1] as $k => $v){\r\n\t\t// echo('kitaab hai = '.$k);\r\n\t\t// echo ('<br>');\r\n\t\tif (in_array($k, $recBooks)){\r\n\t\t\t$key = array_search($k, $recBooks);\r\n\t\t\t//print $key;\r\n\t\t\tunset($recBooks[$key]);\r\n\t\t}\r\n\t}\r\n\r\n\t//getting the order of the books in which to display based on the rating match\r\n\t//sorting the array based on the key\r\n\tarsort($recBooks);\r\n\r\n\t//printing after removing the read books\r\n\t//echo ('<br><br>');\r\n\r\n\treturn $recBooks;\r\n\r\n}", "function ed_charitable_edd_print_payment_donations( $payment_id ) {\n $output = '';\n \n $campaign_donations = Charitable_EDD_Payment::get_instance()->get_campaign_donations_through_payment( $payment_id );\n \n if ( ! $campaign_donations ) {\n return $output;\n }\n \n foreach ( $campaign_donations as $campaign_donation ) {\n\n /** \n * Variables you can use:\n *\n * $campaign_donation->campaign_name = The name of the campaign that received a donation.\n * $campaign_donation->campaign_id = The ID of the campaign that received a donation.\n * $campaign_donation->donation_id = The ID of the donation.\n * $campaign_donation->amount = The amount donated.\n */\n $output .= $campaign_donation->campaign_name . ': ' . charitable_format_money( $campaign_donation->amount ) . PHP_EOL;\n\n }\n \n return $output;\n}", "public function proposals()\r\n {\r\n if (!staff_can('view', 'proposals')) {\r\n $where = get_proposals_sql_where_staff($this->staffId);\r\n $this->CI->db->where($where);\r\n }\r\n $this->CI->db->where_in('status', [1, 4, 6]);\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('proposals');\r\n }", "public function findPairFor(DonorInterface $donor);", "public function getCompetitivePricingForSKU($request);", "abstract public function getPaymentConfig($payment);", "public function get_amount_requested()\n {\n }", "function fetch_payment($type, $param1, $param2='') {\r\n\t\t// $param1; for D -> DATE, for M -> MONTH\r\n\t\t// $param2, for D -> null, for M -> YEAR\r\n\t\t\r\n\t\t// UPDATE FOR MARCH 3, 2011 paramita_fee * 1.35\r\n\t\t$sql = \"SELECT x.appointment_id, x.receipt_no, t.method as payment_method, x.date, \r\n\t\t\t\ty.doctor_fee, y.administration_fee, y.lab_fee, (1.35 * y.paramita_fee) as paramita_fee,\r\n\t\t\t\ty.proc_fee, JUMLAH_HARGA_OBAT_BY_APP(x.appointment_id) as med_fee, y.amc_package_fee, w.appointment_date as app_date,\r\n\t\t\t\tz.nickname, w.patient_type as status, w.service_procedure, v.name as nurse_name, w.other_doctor_name, u.name as doctor_name,\r\n\t\t\t\tx.disc_amount, x.disc_percentage\r\n\t\t\t\tFROM tb_payment_method as t, tb_doctor as u, tb_nurse as v, tb_appointment as w, tb_payment as x, tb_billing as y, tb_patient as z\r\n\t\t\t\tWHERE x.appointment_id = y.id_appointment\r\n\t\t\t\tAND x.appointment_id = w.appointment_number\r\n\t\t\t\tAND w.nurse_id = v.id\r\n\t\t\t\tAND u.id = w.doctor_id\r\n\t\t\t\tAND x.payment_method = t.id\r\n\t\t\t\tAND w.mr_no = z.mr_no\";\r\n\t\tif ($type == 'D'){\r\n\t\t\t$sql .= \" AND x.date = ?\";\r\n\t\t\t$query = $this->db->query($sql, $param1);\r\n\t\t} else {\r\n\t\t\t$sql .= \" AND MONTH(x.date) = ? AND YEAR(x.date) = ?\";\r\n\t\t\t$query = $this->db->query($sql, array($param1,$param2));\r\n\t\t}\r\n\t\t\r\n\t\tif ($query->num_rows() > 0)\r\n\t\t\treturn $query->result();\r\n\t\telse\r\n\t\t\treturn FALSE;\r\n\t}", "function getPayments(){\n $earlyPayment = 0;\n $regularPayment = 0;\n $latePayment = 0;\n \n // Separate fee payments into early, regular, late deadlines\n $this->totalFinAid = 0;\n $payments = payment::getSchoolPayments($this->schoolId);\n for($i = 0; $i < sizeof($payments); $i++){\n $payment = new payment($payments[$i]);\n if($payment->finaid == '1') $this->totalFinAid += $payment->amount;\n if($payment->startedTimeStamp<=generalInfoReader('earlyRegDeadline')){\n $earlyPayment += intval($payment->amount);\n }elseif($payment->startedTimeStamp>generalInfoReader('earlyRegDeadline') && $payment->startedTimeStamp<=generalInfoReader('regularRegDeadline')){\n $regularPayment += intval($payment->amount);\n }elseif($payment->startedTimeStamp>generalInfoReader('regularRegDeadline')){\n $latePayment += intval($payment->amount);\n }\n }\n // Check when school fee was paid\n if($earlyPayment>=generalInfoReader('earlySchoolFee') || $this->numStudents <= 5){\n $this->delegateFee = generalInfoReader('earlyDelegateFee');\n if ($this->numStudents <=30) {\n \t $this->schoolFee = generalInfoReader('earlySchoolFee');\n\t } else {\n\t $this->schoolFee = generalInfoReader('earlyLargeSchoolFee');\n\t }\n }elseif($earlyPayment+$regularPayment>=generalInfoReader('regularSchoolFee')){\n $this->delegateFee = generalInfoReader('regularDelegateFee');\n if ($this->numStudents <= 30) { \n\t $this->schoolFee = generalInfoReader('regularSchoolFee');\n } else {\n\t \t$this->schoolFee = generalInfoReader('regularLargeSchoolFee');\n\t }\n\n\t}elseif($earlyPayment+$regularPayment+$latePayment>=generalInfoReader('lateSchoolFee')){\n $this->delegateFee = generalInfoReader('lateDelegateFee');\n if ($this->numStudents <= 30) {\n\t $this->schoolFee = generalInfoReader('lateSchoolFee');\n\t } else {\n\t \t $this->schoolFee = generalInfoReader('lateLargeSchoolFee');\n\t } \n }else{ // School fee was not paid\n $curTime = time();\n if($curTime<=generalInfoReader('earlyRegDeadline')){\n $this->delegateFee = generalInfoReader('earlyDelegateFee');\n if ($this->numStudents <=30) {\n \t $this->schoolFee = generalInfoReader('earlySchoolFee');\n \t} else {\n\t $this->schoolFee = generalInfoReader('earlyLargeSchoolFee');\n\t }\n }elseif($curTime>generalInfoReader('earlyRegDeadline') && $curTime<=generalInfoReader('regularRegDeadline')){\n\t $this->delegateFee = generalInfoReader('regularDelegateFee');\n if ($this->numStudents <= 30) { \n\t $this->schoolFee = generalInfoReader('regularSchoolFee');\n } else {\n\t \t $this->schoolFee = generalInfoReader('regularLargeSchoolFee');\n\t }\n }elseif($curTime>generalInfoReader('regularRegDeadline')){\n $this->delegateFee = generalInfoReader('lateDelegateFee');\n if ($this->numStudents <= 30) {\n\t $this->schoolFee = generalInfoReader('lateSchoolFee');\n\t } else {\n\t \t $this->schoolFee = generalInfoReader('lateLargeSchoolFee');\n\t } \n }\n }\n\t\n // Small delegations don't pay school fees\n if($this->numStudents <=5 && $this->numAdvisers){\n $this->schoolFee = 0;\n }\n\t\n\t//Chosun doesn't pay\n\tif(strpos(strtolower($this->schoolName),\"chosun\") !== False || strpos(strtolower($this->schoolName),\"worldview\") !== False){\n\t $this->schoolFee = 0;\n\t $this->delegateFee = 0;\n\t}\n\n // Calculating numbers\n $this->totalPaid = $earlyPayment + $regularPayment + $latePayment - $this->totalFinAid;\n $this->delegateFeeTotal = $this->numStudents*$this->delegateFee;\n $mealTicket = new mealTicket($this->schoolId);\n $this->mealTicketTotal = $mealTicket->totalCost;\n \n $this->schoolFeePaid = 0;\n $this->schoolFeeOwed = 0;\n $this->delegateFeePaid = 0;\n $this->delegateFeeOwed = 0;\n $this->mealTicketPaid = 0;\n $this->mealTicketOwed = 0;\n if($this->totalPaid < $this->schoolFee){\n // Haven't paid school fee\n $this->schoolFeePaid = $this->totalPaid;\n $this->schoolFeeOwed = $this->schoolFee - $this->totalPaid;\n $this->delegateFeeOwed = $this->delegateFeeTotal;\n $this->mealTicketOwed = $this->mealTicketTotal;\n }elseif($this->totalPaid + $this->totalFinAid < $this->schoolFee + $this->delegateFeeTotal){\n // Have paid school fee but not delegate fee\n $this->schoolFeePaid = $this->schoolFee;\n $this->delegateFeePaid = $this->totalPaid + $this->totalFinAid - $this->schoolFee;\n $this->delegateFeeOwed = $this->delegateFeeTotal - $this->delegateFeePaid;\n $this->mealTicketOwed = $this->mealTicketTotal;\n }else{\n // Have paid school and delegate fee\n $this->schoolFeePaid = $this->schoolFee;\n $this->delegateFeePaid = $this->delegateFeeTotal;\n $this->mealTicketPaid = min($this->mealTicketTotal, $this->totalPaid + $this->totalFinAid - $this->schoolFee - $this->delegateFeeTotal);\n $this->mealTicketOwed = $this->mealTicketTotal - $this->mealTicketPaid;\n }\n $this->totalFee = $this->schoolFee + $this->delegateFeeTotal + $this->mealTicketTotal;\n $this->totalOwed = $this->totalFee - $this->totalFinAid - $this->totalPaid;\n \n\t//Create formatted versions:\n\t$this->totalFeeFormatted = '$'.money_format('%.2n',$this->totalFee);\n\t$this->totalPaidFormatted = '$'.money_format('%.2n',$this->totalPaid);\n\t$this->totalOwedFormatted = '$'.money_format('%.2n',$this->totalOwed);\n\n\n\t$this->schoolFeeFormatted = '$'.money_format('%.2n',$this->schoolFee);\n\t$this->schoolFeePaidFormatted = '$'.money_format('%.2n',$this->schoolFeePaid);\n\t$this->schoolFeeOwedFormatted = '$'.money_format('%.2n',$this->schoolFeeOwed);\n\t\n\t$this->delegateFeeFormatted = '$'.money_format('%.2n',$this->delegateFee);\n\t$this->delegateFeeTotalFormatted = '$'.money_format('%.2n',$this->delegateFeeTotal);\n\t$this->delegateFeePaidFormatted = '$'.money_format('%.2n',$this->delegateFeePaid);\n\t$this->delegateFeeOwedFormatted = '$'.money_format('%.2n',$this->delegateFeeOwed);\n\n\t$this->totalFinAidFormatted = '$'.money_format('%.2n',$this->totalFinAid);\n\n\n // Calculate Payment Due Date\n if($this->delegateFee == generalInfoReader('earlyDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('earlyRegDeadline');\n if($this->delegateFee == generalInfoReader('regularDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('regularRegDeadline');\n if($this->delegateFee == generalInfoReader('lateDelegateFee'))\n $this->schoolFeeDue = generalInfoReader('lateRegDeadline');\n $this->totalPaymentDue = generalInfoReader('paymentDueDate');\n\t\n }", "public function getAvailablePaymentMethods ();", "private function btn_payments(){\n\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|| ($this->rec['v_status']!= STATUS_YES) \n\t\t\t|| !in_array($this->doing,array('lists','budget',)) \n\t\t\t|| (is_object(VM::$e) && VM::$e->isEventEndorsed())\n\t\t\t)) $this->dbg('not_my_case '.$this->rec['av_lastname']);\n\n bTiming()->cpu(__function__);\n $reply = array();\n foreach(bForm_vm_Visit::_getPolicies($this->rec) as $p=>$descr){\n // The event policy has precedence over the visit policy\n if (!empty(VM::$e) && ($p_e = @VM::$E_V_policies[$p]) && !VM::$e->getPolicy($p_e)) continue;\n if (empty($descr['i'])) continue; \n\n $yes_no = (bool)bForm_vm_Visit::_getPolicy($p,$this->rec);\n $this->dbg(\"$p $descr[i] - \".var_export($yes_no,True),True);\n $icon = '';\n // don't draw useless button for the passed events\n if(!$not_my_case && (($yes_no || ($this->rec['v_end'] > time()-30*86400)))){\n\t$already_paid = Null;\n\tswitch($p){\n\t \n\tcase VM_V_provideOffice:\n\t if (myOrg()->eaMembers()->isMember($this->rec['av_id'])){\n\t $av = loader::getInstance_new('bForm_Avatar_vm',$this->rec['av_id'],array('fatal','nocache'));\n\t if ($av->isE(True) && $av->get_staffOffice()) break;\n\t }\n\t $already_paid = '';\n\t $hasRightTo = 'assign_offices';\n\t $paid = 'provided';\n\t break;\n\n\tcase VM_E_provideLunches:\n\tcase VM_E_conferenceDinner:\n\t if ($already_paid === Null){\n\t $already_paid = '';\n\t b_debug::var_dump($descr['i'],'already_paid===Null');\n\t }\n\t break;\n\n\tcase VM_V_payPerdiem:\n\t if ($already_paid === Null){\n\t $already_paid = (bool)(is_object($this->exp) && $this->exp->scholarshipP(False,False));\n\t $hasRightTo = 'setup_reimbursement';\n\t $paid = 'paid';\n\t }\n\t break;\n\n\tcase VM_V_payTrip:\n\t if ($already_paid === Null){\n\t $already_paid = (bool)(is_object($this->exp) && $this->exp->scholarshipT(False,False));\n\t $hasRightTo = 'setup_reimbursement';\n\t $paid = 'paid';\n\t }\n\t break;\n\n\tdefault:\n\t}\n\t \n\tif ($already_paid !== Null){\n\t // Show either a click-able button or just an icon\n\t $img = @$descr['i'] . ($yes_no ? '_on' : '_off');\n\t $icon = (!$already_paid && VM::hasRightTo($hasRightTo,$this->rec)\n\t\t ? bIcons()->getButton(array('class'=>'form-submit',\n\t\t\t\t\t 'i'=>$img,\n\t\t\t\t\t 'c'=>($yes_no ? 'only_online' : 'only_online opacity_on'),\n\t\t\t\t\t 'd'=>$descr['i'].($yes_no ? '' : ' not').\" to be $paid, click to change\",\n\t\t\t\t\t 'l'=>b_url::same(\"?resetcache_once=1&toggle_once=$p&v_id=\".$this->rec['v_id'],$this->anchor())))\n\t\t : bIcons()->get (array('i'=>$img,\n\t\t\t\t\t 'c'=>($yes_no ? 'only_online' : 'only_online opacity_on'),\n\t\t\t\t\t 'd'=>$descr['i'].($yes_no ? '' :' not').\" $paid\")));\n\t}\n }else{\n\t$this->dbg('too old visit '.$this->rec['av_lastname']);\n }\n $reply[] = $icon;\n }\n bTiming()->cpu();\n return $reply;\n }", "public function advance($advance_no)\n {\n //khai bao bien\n $type = '1';\n $title_vn = '';\n $title_en = '現金借支取款單';\n $SUM_PORT_AMT = 0;\n $SUM_LENDER_AMT = 0;\n $title_sum_money = \"\";\n $INPUT_USER_jobD = \"\";\n $INPUT_DT_jobD = \"\";\n\n $advance = StatisticPayment::advance($advance_no);\n $advance_d = StatisticPayment::advance_D($advance_no);\n $job_d = JobD::getJob($advance->JOB_NO, \"JOB_ORDER\")->whereIn('jd.THANH_TOAN_MK', [null, 'N']);\n foreach ($advance_d as $i) {\n $SUM_LENDER_AMT += $i->LENDER_AMT;\n }\n\n foreach ($job_d as $i) {\n $SUM_PORT_AMT += $i->PORT_AMT + $i->INDUSTRY_ZONE_AMT;\n $INPUT_USER_jobD = $i->INPUT_USER;\n $INPUT_DT_jobD = $i->INPUT_DT;\n }\n if ($SUM_PORT_AMT == 0) {\n $title_sum_money = \"TỔNG TIỀN / TOTAL AMOUNT\";\n }\n if ($advance->LENDER_TYPE == 'T') {\n $title_vn = 'Chi Tạm Ứng';\n $title_en = 'Advance ';\n if ($SUM_LENDER_AMT > $SUM_PORT_AMT) {\n $title_sum_money = \"TỔNG TIỀN TRẢ / TOTAL PAYMENT\";\n } elseif ($SUM_LENDER_AMT < $SUM_PORT_AMT) {\n $title_sum_money = \"TỔNG TIỀN BÙ / TOTAL COMPENSATION\";\n }\n } elseif ($advance->LENDER_TYPE == 'C') {\n $title_vn = 'Chi Trực Tiếp';\n $title_en = 'Applicant';\n $title_sum_money = \"TỔNG TIỀN / TOTAL AMOUNT\";\n } elseif ($advance->LENDER_TYPE == 'U') {\n $title_sum_money = \"TỔNG TIỀN / TOTAL AMOUNT\";\n $title_vn = 'Tạm Ứng';\n $title_en = 'Advance ';\n }\n\n if ($advance) {\n return view('print\\payment\\advance\\index', [\n 'advance' => $advance,\n 'advance_d' => $advance_d,\n 'type' => $type,\n 'title_vn' => $title_vn,\n 'title_en' => $title_en,\n 'SUM_PORT_AMT' => $SUM_PORT_AMT,\n 'SUM_LENDER_AMT' => $SUM_LENDER_AMT,\n 'title_sum_money' => $title_sum_money,\n 'INPUT_USER_jobD' => $INPUT_USER_jobD,\n 'INPUT_DT_jobD' => $INPUT_DT_jobD,\n ]);\n } else {\n return response()->json(\n [\n 'success' => false,\n 'message' => 'PHẢI CHỌN PHIẾU THEO THỨ TỰ NHỎ ĐẾN LỚN'\n ],\n Response::HTTP_BAD_REQUEST\n );\n }\n }", "private function getPayment() {\r\n\r\n\t\t\t$refreshed_token = new Token($this->id, $this->secret, null);\r\n\r\n\t\t\t// Get bill id from URI\r\n\t\t\t$sections = explode(\"/\", $_SERVER['REQUEST_URI']);\r\n\t\t\t$bill_id = $sections[1];\r\n\r\n\t\t\t$payments = $this->user->getPayments($bill_id);\r\n\r\n\t\t\tif($payments) {\r\n\r\n\t\t\t\techo json_encode([\r\n\t\t\t\t\t'code' => 200,\r\n\t\t\t\t\t'message' => 'OK',\r\n\t\t\t\t\t'payments' => $payments,\r\n\t\t\t\t\t'token' => $refreshed_token->getTokenString()\r\n\t\t\t\t]);\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\techo json_encode([\r\n\t\t\t\t\t'code' => 404,\r\n\t\t\t\t\t'message' => 'Not found',\r\n\t\t\t\t\t'payments' => '',\r\n\t\t\t\t\t'token' => $refreshed_token->getTokenString()\r\n\t\t\t\t]);\r\n\r\n\t\t\t}\r\n\r\n\t\t}", "function add_extra_person($billing_person,$data,$product_id,$action_set_id = 0)\n {\n $data['Address2Street1'] = $data['StreetAddress1'];\n $data['Address2Street2'] = $data['StreetAddress2'];\n $data['City2'] = $data['City'];\n $data['State2'] = $data['State'];\n $data['PostalCode2'] = $data['PostalCode'];\n $data['Country2'] = $data['Country'];\n $data['_OrderName'] = $billing_person->FirstName . \" \" . $billing_person->LastName . \" \" . $billing_person->Email;\n $data['_PurchasedBy'] = $billing_person->FirstName . \" \" . $billing_person->LastName;\n $data['_OrderEmail'] = $billing_person->Email;\n\n $contact_id = $this->create_contact($data);\n //Opt Person In\n $this->optIn($data['Email'],'Friend purchased');\n\n //Create Zero Dollar Order\n $affiliate_id = $this->get_current_affiliate($contact_id);\n $invoice_id = $this->blankOrder($contact_id,'Extra: The Matrix Assessment Profile',$this->infuDate(date('d-m-Y')),$affiliate_id,$affiliate_id);\n $this->addOrderItem($invoice_id,$product_id,4,0.00,1,'Friend: ' . $data['_OrderName'] . ' ordered','');\n\n sleep(1); //IS throttling\n\n //Add Notes to the Job/Order Record\n $invoice = $this->dsLoad('Invoice',$invoice_id,array('JobId'));\n $r = $this->dsUpdate('Job',$invoice['JobId'],array('JobNotes' => 'Ordered By: ' . $data['_OrderName']));\n\n sleep(1); //IS throttling\n\n $r = $this->runAS($contact_id,$action_set_id);\n\n $this->achieveGoal('optimalwellness','mapfriendemail',$contact_id);\n\n return $data['FirstName'] . ' ' . $data['LastName'] . ' ID: ' . $contact_id;\n\n }", "public function getTotalPaid();", "public function get_suggested_notes_on_deals_paged($start_offset,$num_to_fetch,&$data_arr,&$data_count){\n global $g_mc;\n $q = \"select r.suggestion,r.id as note_id,r.deal_id,t.company_id,value_in_billion,date_of_deal,deal_cat_name,deal_subcat1_name,deal_subcat2_name,c.name as deal_company_name,m.f_name,m.l_name,m.designation,w.name as work_company from \".TP.\"transaction_note_suggestions as r left join \".TP.\"transaction as t on(r.deal_id=t.id) left join \".TP.\"company as c on(t.company_id=c.company_id) left join \".TP.\"member as m on(r.reported_by=m.mem_id) left join \".TP.\"company as w on(m.company_id=w.company_id) order by t.id desc limit \".$start_offset.\",\".$num_to_fetch;\n $res = mysql_query($q);\n if(!$res){\n return false;\n }\n //////////////////\n $data_count = mysql_num_rows($res);\n if(0==$data_count){\n return true;\n }\n /////////////////\n for($i=0;$i<$data_count;$i++){\n $data_arr[$i] = mysql_fetch_assoc($res);\n $data_arr[$i]['deal_company_name'] = $g_mc->db_to_view($data_arr[$i]['deal_company_name']);\n $data_arr[$i]['suggestion'] = nl2br($g_mc->db_to_view($data_arr[$i]['suggestion']));\n $data_arr[$i]['f_name'] = $g_mc->db_to_view($data_arr[$i]['f_name']);\n $data_arr[$i]['l_name'] = $g_mc->db_to_view($data_arr[$i]['l_name']);\n $data_arr[$i]['work_company'] = $g_mc->db_to_view($data_arr[$i]['work_company']);\n }\n return true;\n }", "public function hookDisplayPaymentEU()\n {\n if (!Currency::exists('EUR', 0)) {\n return null;\n }\n\n try {\n $methods = $this->api->methods->all();\n } catch (Mollie_API_Exception $e) {\n if (Configuration::get(Mollie::MOLLIE_DEBUG_LOG) == Mollie::DEBUG_LOG_ERRORS) {\n Logger::addLog(__METHOD__.' said: '.$e->getMessage(), Mollie::ERROR);\n }\n\n return null;\n }\n\n $paymentOptions = array();\n foreach ($methods as $method) {\n $paymentOptions[] = array(\n 'cta_text' => $this->lang[$method->description],\n 'logo' => $method->image->normal,\n 'action' => $this->context->link->getModuleLink(\n 'mollie', 'payment',\n array('method' => $method->id), true\n ),\n );\n }\n\n return $paymentOptions;\n }", "function pay_on_credit_apply_interest_fee() {\n\n $payment_method = WC()->session->get('chosen_payment_method');\n $payment_duration = WC()->session->get('chosen_payment_duration');\n \n \n\n if ( $payment_method === \"wcpg-pay-on-credit\" ) {\n $label = __( 'Interest Fee', 'wcpg-pay-on-credit' );\n $amount = 0;\n\n switch ($payment_duration) {\n case '4':\n $percentage = 0.05;\n $amount = ( WC()->cart->cart_contents_total + WC()->cart->shipping_total ) * $percentage;\n break;\n\n case '6':\n $percentage = 0.1;\n $amount = ( WC()->cart->cart_contents_total + WC()->cart->shipping_total ) * $percentage;\n break; \n \n default:\n # code...\n break;\n }\n\n WC()->cart->add_fee( $label, $amount, false, '' );\n }\n \n \n}", "public function get_next_answer_for_user($data){\n// $query = $this->db->query($sql, array($email));\n// $answer = $query->row();\n \n $this->db->select('percentage');\n $this->db->from('proximity');\n $this->db->where('level_no', $data['level']);\n $this->db->where('answer', $data['answer']);\n \n $query = $this->db->get();\n $answer = $query->row_array();\n \n if (!$answer['percentage']) {\n $answer['percentage'] = 0;\n }\n //echo \"level\",$answer['percentage'],\"perc\";\n return $answer['percentage'];\n \n }", "public function refuseSuggestedResult($request)\n {\n if (Auth::id() == $this->C_creator_id) {\n\n $Result = Result::where('E_R_OpinionBy', '=' , $this->C_candidate_id)\n ->where('E_R_ConfirmBy', '=' , $this->C_creator_id)\n ->where('E_R_EventId', '=' , $this->id)\n ->update(['E_R_IsFinalResult' => 1, 'E_R_YesOrNo' => 1]);\n\n //$Result->E_R_IsFinalResult = 0;\n //$Result->E_R_YesOrNo = 0 ;\n\n }elseif (Auth::id() == $this->C_candidate_id) {\n\n $Result = Result::where('E_R_OpinionBy', '=' , $this->C_creator_id)\n ->where('E_R_ConfirmBy', '=' , $this->C_candidate_id)\n ->where('E_R_EventId', '=' , $this->id)\n ->update(['E_R_IsFinalResult' => 1, 'E_R_YesOrNo' => 1]);\n //return $Result ;\n\n //$Result->E_R_IsFinalResult = 0;\n //$Result->E_R_YesOrNo = 0 ;\n\n }\n\n //$Result->save();\n\n }", "public function accept_deal_suggestion($deal_suggestion_id,$suggestion_data_arr,&$deal_suggestion_accepted){\n return false;\n }", "function get_payment_for_school($payment_request_id){\n //each scholarhsip payment linked to the school the student is in\n //group the payment by school and return school name, total amount, number of scholarship paymennt in the given request\n //you have to cont the sponsred sudent that belong to this payment request and school\n /*\n $str_query=\"select sp.`schools_school_id`,s.`school_name`,sum(sp.`amount`) as total_amount,count(sp.`scholarship_payment_id`) as payment_number from schools s, \n scholarship_payment sp where (sp.`payment_request_payment_request_id`=$payment_request_id)\n group by sp.schools_school_id,s.`school_name`\";*/\n\n $str_query=\"select sp.`schools_school_id`,s.`school_id`,s.`school_name`,sum(sp.`amount`) as total_amount,count(sp.`scholarship_payment_id`) as payment_number from schools s, \n scholarship_payment sp where (sp.schools_school_id=s.school_id) and (sp.`payment_request_payment_request_id`=$payment_request_id)\n group by sp.schools_school_id,s.`school_name`\";\n\n if (!$this->sql_query($str_query)){\n return false;\n }\n else{\n return true;\n }\n \n }", "public function fetchPayment($reference, $merchant)\n {\n $action = \"FETCH PAYMENT\";\n try {\n // $model ...\n if ($merchant) {\n $bkash = new BkashController($merchant);\n $resp = $bkash->searchTransaction($reference);\n\n if (is_array($resp) && isset($resp['trxID'])) { // Payment information fetched\n\n // Got the payment, Insert in DB\n $payment = new Payment();\n $payment->sender_account_no = isset($resp['customerMsisdn']) ? substr($resp['customerMsisdn'], -11) : '';\n $payment->receiver_account_no = isset($resp['organizationShortCode']) ? substr($resp['organizationShortCode'], -11) : '';\n $payment->amount = isset($resp['amount']) ? (float)$resp['amount'] : '';\n $payment->trx_id = isset($resp['trxID']) ? $resp['trxID'] : '';\n $payment->merchant_id = $merchant->id;\n $payment->currency = isset($resp['currency']) ? $resp['currency'] : '';\n $payment->transaction_datetime = isset($resp['completedTime']) ?\n Carbon::createFromFormat('Y-m-d H:i:s',\n str_replace('T', ' ', str_replace(\":000 GMT+0600\", \"\", $resp['completedTime']))\n )->setTimezone('Asia/Dhaka')->toDateTimeString() : '';\n $payment->transactionType = isset($resp['transactionType']) ? $resp['transactionType'] : '';\n $payment->transactionReference = isset($resp['transactionReference']) ? $resp['transactionReference'] : '';\n $payment->save();\n if ($payment) {\n $this->lg($payment, 'info', $action, 200);\n return Payment::query()->api()->with(array('merchant'=>function($query){\n $query->select('id','name', 'account_no');\n }))->find($payment->id); // fetching successful\n } else {\n $this->lg(\"Payment insertion error\", 'warning', $action, 422, 'internal');\n $this->fetchingError = \"Payment insertion error\";\n }\n } else {\n $this->lg(\"This payment is not available in bKash system, \" . $bkash->getLastError(),\n 'warning', $action, 422, 'internal');\n $this->fetchingError = \"This payment is not available in bKash system, \" . $bkash->getLastError();\n }\n } else {\n $this->lg(\"Merchant info not found\", 'warning', $action, 422, 'internal');\n $this->fetchingError = \"Merchant info not found\";\n }\n } catch (\\Exception $e) {\n $this->lg($e, 'error', $action, 500);\n $this->fetchingError = $this->experDifficulties;\n }\n return false;\n }", "public function getPrepaidPhoneCreditPricelist($operator_id, $type_id)\n {\n $user = Auth::user();\n $quickbuy = false;\n if ($user->is_store) {\n $quickbuy = true;\n }\n // switch operators\n $operator = 'TELKOMSEL';\n switch ($operator_id) {\n case 2:\n $operator = 'INDOSAT';\n break;\n case 3:\n $operator = 'XL';\n break;\n case 4:\n $operator = 'AXIS';\n break;\n case 5:\n $operator = 'TRI';\n break;\n case 6:\n $operator = 'SMART';\n break;\n }\n\n // switch type\n $type = 'Pulsa';\n if ($type_id == 2) {\n $type = 'Data';\n }\n\n // empty array to be filled with selected operator pricelist data\n $priceArr = [];\n $priceCallArr = []; //Placeholder Paket Telepon & SMS\n // get all Prepaid Pricelist data from Cache if available or fresh fetch from API\n $prepaidPricelist = $this->getAllPrepaidPricelist();\n foreach ($prepaidPricelist['data'] as $row) {\n if ($row['category'] == $type) {\n if ($row['price'] <= 40000) {\n $initPrice = $row['price'] + 50;\n }\n if ($row['price'] > 40000) {\n $initPrice = $row['price'] + 70;\n }\n // Here we add 4% (2% for Profit Sharing Conribution, 2% for Seller's profit)\n // We also round-up last 3 digits to 500 increments, all excess will be Seller's profit\n $addedPrice = $initPrice + ($initPrice * 4 / 100);\n $roundedPrice = round($addedPrice, -2);\n $last3DigitsCheck = substr($roundedPrice, -3);\n $check = 500 - $last3DigitsCheck;\n if ($check == 0) {\n $price = $roundedPrice;\n }\n if ($check > 0 && $check < 500) {\n $price = $roundedPrice + $check;\n }\n if ($check == 500) {\n $price = $roundedPrice;\n }\n if ($check < 0) {\n $price = $roundedPrice + (500 + $check);\n }\n\n if ($row['brand'] == $operator) {\n $priceArr[] = [\n 'buyer_sku_code' => $row['buyer_sku_code'],\n 'desc' => $row['desc'],\n 'seller_price = ($price * 2 / 100)' => ($row['price'] + ($price * 2 / 100)),\n 'price' => $price,\n 'brand' => $row['brand'],\n 'product_name' => $row['product_name'],\n 'seller_name' => $row['seller_name']\n ];\n }\n }\n\n if ($type_id == 2) {\n // Get Paket Telepon & SMS\n if ($row['category'] == 'Paket SMS & Telpon') {\n if ($row['price'] <= 40000) {\n $initPrice = $row['price'] + 50;\n }\n if ($row['price'] > 40000) {\n $initPrice = $row['price'] + 70;\n }\n // Here we add 4% (2% for Profit Sharing Conribution, 2% for Seller's profit)\n // We also round-up last 3 digits to 500 increments, all excess will be Seller's profit\n $addedPrice = $initPrice + ($initPrice * 4 / 100);\n $roundedPrice = round($addedPrice, -2);\n $last3DigitsCheck = substr($roundedPrice, -3);\n $check = 500 - $last3DigitsCheck;\n if ($check == 0) {\n $price = $roundedPrice;\n }\n if ($check > 0 && $check < 500) {\n $price = $roundedPrice + $check;\n }\n if ($check == 500) {\n $price = $roundedPrice;\n }\n if ($check < 0) {\n $price = $roundedPrice + (500 + $check);\n }\n\n if ($row['brand'] == $operator) {\n $priceCallArr[] = [\n 'buyer_sku_code' => $row['buyer_sku_code'],\n 'desc' => $row['desc'],\n 'seller_price = ($price * 2 / 100)' => ($row['price'] + ($price * 2 / 100)),\n 'price' => $price,\n 'brand' => $row['brand'],\n 'product_name' => $row['product_name'],\n 'seller_name' => $row['seller_name']\n ];\n }\n }\n }\n }\n $pricelist = collect($priceArr)->sortBy('price')->toArray();\n $pricelistCall = collect($priceCallArr)->sortBy('price')->toArray();\n\n return view('member.app.shopping.prepaid_pricelist')\n ->with('title', 'Isi Pulsa/Data')\n ->with(compact('pricelist'))\n ->with(compact('pricelistCall'))\n ->with(compact('quickbuy'))\n ->with('type', $type_id);\n }", "public function payment(){\n\n\t}", "abstract public function getPaymentInstance($payment, $order = array(), $config = array());", "function getProposals() {\n\t\t$results = \"\";\n\t\t$sql = \"SELECT Proposal.ProposalID, Proposal.CustomerID, Proposal.ServiceID, Proposal.DateCreated, Customer.FirstName, Customer.LastName, Service.Name \".\n\t\t\"FROM Proposal \".\n\t\t\"JOIN Customer ON Proposal.CustomerID = Customer.CustomerID \".\n\t\t\"JOIN Service ON Proposal.ServiceID = Service.ServiceID\";\n\n\t\t$results = queryDB($sql);\n\n\t\treturn $results;\n\t}", "function process_credential_payment($userid = 0, $method = 'account', $answerid = 0, $questionid = 0, $answer = '', $contactname = '', $contactnumber = '', $contactnotes = '')\n {\n global $ilance, $phrase, $page_title, $area_title, $ilconfig, $ilpage;\n $sql = $ilance->db->query(\"\n SELECT verifycost, question\n FROM \" . DB_PREFIX . \"profile_questions\n WHERE questionid = '\" . intval($questionid) . \"'\n AND canverify = '1'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql) > 0)\n {\n $resamount = $ilance->db->fetch_array($sql, DB_ASSOC);\n $question = stripslashes($resamount['question']);\n // fetch amount\n $amount = $resamount['verifycost'];\n $totalamount = $amount;\n // does tax apply?\n $extrainvoicesql = \"totalamount = '\" . sprintf(\"%01.2f\", $amount) . \"',\";\n if ($ilance->tax->is_taxable(intval($userid), 'credential') AND $amount > 0)\n {\n // fetch tax amount to charge for this invoice type\n $taxamount = $ilance->tax->fetch_amount(intval($userid), $amount, 'credential', 0);\n // fetch total amount to hold within the \"totalamount\" field\n $totalamount = ($amount + $taxamount);\n // fetch tax bit to display when we display tax infos\n $taxinfo = $ilance->tax->fetch_amount(intval($userid), $amount, 'credential', 1);\n // #### extra bit to assign tax logic to the transaction \n $extrainvoicesql = \"\n istaxable = '1',\n totalamount = '\" . sprintf(\"%01.2f\", $totalamount) . \"',\n taxamount = '\" . sprintf(\"%01.2f\", $taxamount) . \"',\n taxinfo = '\" . $ilance->db->escape_string($taxinfo) . \"',\n \";\n }\n // payment process via online account balance\n if ($method == 'account')\n {\n $sel_balance = $ilance->db->query(\"\n SELECT available_balance, total_balance\n FROM \" . DB_PREFIX . \"users\n WHERE user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sel_balance) > 0)\n {\n $res_balance = $ilance->db->fetch_array($sel_balance, DB_ASSOC);\n if ($res_balance['available_balance'] < $totalamount)\n {\n $area_title = '{_no_funds_available_in_online_account}';\n $page_title = SITE_NAME . ' - {_no_funds_available_in_online_account}';\n print_notice('{_invoice_payment_warning_insufficient_funds}', '{_were_sorry_this_invoice_can_not_be_paid_due_to_insufficient_funds}' . '<br /><br />' . '{_please_contact_customer_support}', $ilpage['selling'] . '?cmd=profile', '{_selling_profile}');\n exit();\n }\n else\n {\n $area_title = '{_profile_verification_payment_via_online_account}';\n $page_title = SITE_NAME . ' - {_profile_verification_payment_via_online_account}';\n $transactionid = $ilance->accounting_payment->construct_transaction_id();\n $newinvoiceid = $this->insert_transaction(\n 0,\n 0,\n 0,\n intval($userid),\n 0,\n 0,\n 0,\n '{_profile_verification_fee_question} ' . $ilance->db->escape_string($question),\n sprintf(\"%01.2f\", $amount),\n sprintf(\"%01.2f\", $totalamount),\n 'paid',\n 'credential',\n 'account',\n DATETIME24H,\n DATEINVOICEDUE,\n DATETIME24H,\n '{_verification_requested_on} ' . DATETIME24H,\n 0,\n 0,\n 1,\n $transactionid\n );\n // update invoice mark as final value fee invoice type\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET\n\t\t\t\t\t\t\t $extrainvoicesql\n\t\t\t\t\t\t\t isfvf = '0'\n WHERE invoiceid = '\" . intval($newinvoiceid) . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $new_total = ($res_balance['total_balance'] - $totalamount);\n $new_avail = ($res_balance['available_balance'] - $totalamount);\n // update account data \n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"users\n SET available_balance = '\" . sprintf(\"%01.2f\", $new_avail) . \"',\n\t\t\t\t\t\t\t total_balance = '\" . sprintf(\"%01.2f\", $new_total) . \"'\n WHERE user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n // track income spent\n $ilance->accounting_payment->insert_income_spent(intval($userid), sprintf(\"%01.2f\", $totalamount), 'credit');\n // #### REFERRAL SYSTEM TRACKER ############################\n $ilance->referral->update_referral_action('credential', intval($userid));\n $isverified = '0';\n if ($ilconfig['verificationmoderation'] == 0)\n {\n $isverified = '1';\n }\n $expiry = date('Y-m-d H:i:s', (TIMESTAMPNOW + $ilconfig['verificationlength']*24*3600));\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"profile_answers\n SET invoiceid = '\" . intval($newinvoiceid) . \"',\n\t\t\t\t\t\t\t contactname = '\" . $ilance->db->escape_string($contactname) . \"',\n\t\t\t\t\t\t\t contactnumber = '\" . $ilance->db->escape_string($contactnumber) . \"',\n\t\t\t\t\t\t\t contactnotes = '\" . $ilance->db->escape_string($contactnotes) . \"',\n\t\t\t\t\t\t\t isverified = '\" . $isverified . \"',\n\t\t\t\t\t\t\t verifyexpiry = '\" . $expiry . \"'\n WHERE questionid = '\" . intval($questionid) . \"'\n\t\t\t\t\t\t\t AND answerid = '\" . intval($answerid) . \"'\n\t\t\t\t\t\t\t AND user_id = '\" . intval($userid) . \"'\n \", 0, null, __FILE__, __LINE__);\n $existing = array(\n '{{contactname}}' => $contactname,\n '{{contactnumber}}' => $contactnumber,\n '{{contactnotes}}' => $contactnotes,\n '{{expiry}}' => $expiry,\n '{{customer}}' => $_SESSION['ilancedata']['user']['username'],\n '{{transactionid}}' => $transactionid,\n '{{question}}' => $question,\n '{{answer}}' => $answer,\n '{{total_amount_formatted}}' => $ilance->currency->format($totalamount)\n );\n $ilance->email->mail = SITE_EMAIL;\n $ilance->email->slng = fetch_site_slng();\n $ilance->email->get('profile_verification_pending_admin');\t\t\n $ilance->email->set($existing);\n $ilance->email->send();\n $ilance->email->mail = $_SESSION['ilancedata']['user']['email'];\n $ilance->email->slng = $_SESSION['ilancedata']['user']['slng'];\n $ilance->email->get('profile_verification_pending');\t\t\n $ilance->email->set($existing);\n $ilance->email->send();\n print_notice('{_invoice_payment_complete}', '{_your_invoice_has_been_paid_in_full}' . '<br /><br />', $ilpage['selling'] . '?cmd=profile', '{_selling_profile}');\n exit();\n }\n }\n } \n }\n else\n {\n print_notice('{_access_denied}', '{_sorry_your_profile_verification_process_could_not_be_completed}', 'javascript:history.back(1);', '{_back}');\n exit();\n }\n }", "public function get_data() {\n\n\t\t$data = array();\n\t\t$i = 0;\n\t\t// Payment query.\n\t\t$payments = give_get_payments( $this->get_donation_argument() );\n\n\t\tif ( $payments ) {\n\n\t\t\tforeach ( $payments as $payment ) {\n\n\t\t\t\t$columns = $this->csv_cols();\n\t\t\t\t$payment = new Give_Payment( $payment->ID );\n\t\t\t\t$payment_meta = $payment->payment_meta;\n\t\t\t\t$address = $payment->address;\n\n\t\t\t\t// Set columns.\n\t\t\t\tif ( ! empty( $columns['donation_id'] ) ) {\n\t\t\t\t\t$data[ $i ]['donation_id'] = $payment->ID;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['seq_id'] ) ) {\n\t\t\t\t\t$data[ $i ]['seq_id'] = Give()->seq_donation_number->get_serial_code( $payment->ID );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['title_prefix'] ) ) {\n\t\t\t\t\t$data[ $i ]['title_prefix'] = ! empty( $payment->title_prefix ) ? $payment->title_prefix : '';\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['first_name'] ) ) {\n\t\t\t\t\t$data[ $i ]['first_name'] = isset( $payment->first_name ) ? $payment->first_name : '';\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['last_name'] ) ) {\n\t\t\t\t\t$data[ $i ]['last_name'] = isset( $payment->last_name ) ? $payment->last_name : '';\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['email'] ) ) {\n\t\t\t\t\t$data[ $i ]['email'] = $payment->email;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['company'] ) ) {\n\t\t\t\t\t$data[ $i ]['company'] = empty( $payment_meta['_give_donation_company'] ) ? '' : str_replace( \"\\'\", \"'\", $payment_meta['_give_donation_company'] );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['address_line1'] ) ) {\n\t\t\t\t\t$data[ $i ]['address_line1'] = isset( $address['line1'] ) ? $address['line1'] : '';\n\t\t\t\t\t$data[ $i ]['address_line2'] = isset( $address['line2'] ) ? $address['line2'] : '';\n\t\t\t\t\t$data[ $i ]['address_city'] = isset( $address['city'] ) ? $address['city'] : '';\n\t\t\t\t\t$data[ $i ]['address_state'] = isset( $address['state'] ) ? $address['state'] : '';\n\t\t\t\t\t$data[ $i ]['address_zip'] = isset( $address['zip'] ) ? $address['zip'] : '';\n\t\t\t\t\t$data[ $i ]['address_country'] = isset( $address['country'] ) ? $address['country'] : '';\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['comment'] ) ) {\n\t\t\t\t\t$comment = give_get_donor_donation_comment( $payment->ID, $payment->donor_id );\n\t\t\t\t\t$data[ $i ]['comment'] = ! empty( $comment ) ? $comment->comment_content : '';\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donation_total'] ) ) {\n\t\t\t\t\t$data[ $i ]['donation_total'] = give_format_amount( give_donation_amount( $payment->ID ) );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['currency_code'] ) ) {\n\t\t\t\t\t$data[ $i ]['currency_code'] = empty( $payment_meta['_give_payment_currency'] ) ? give_get_currency() : $payment_meta['_give_payment_currency'];\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['currency_symbol'] ) ) {\n\t\t\t\t\t$currency_code = $data[ $i ]['currency_code'];\n\t\t\t\t\t$data[ $i ]['currency_symbol'] = give_currency_symbol( $currency_code, true );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donation_status'] ) ) {\n\t\t\t\t\t$data[ $i ]['donation_status'] = give_get_payment_status( $payment, true );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['payment_gateway'] ) ) {\n\t\t\t\t\t$data[ $i ]['payment_gateway'] = $payment->gateway;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['payment_mode'] ) ) {\n\t\t\t\t\t$data[ $i ]['payment_mode'] = $payment->mode;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['form_id'] ) ) {\n\t\t\t\t\t$data[ $i ]['form_id'] = $payment->form_id;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['form_title'] ) ) {\n\t\t\t\t\t$data[ $i ]['form_title'] = get_the_title( $payment->form_id );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['form_level_id'] ) ) {\n\t\t\t\t\t$data[ $i ]['form_level_id'] = $payment->price_id;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['form_level_title'] ) ) {\n\t\t\t\t\t$var_prices = give_has_variable_prices( $payment->form_id );\n\t\t\t\t\tif ( empty( $var_prices ) ) {\n\t\t\t\t\t\t$data[ $i ]['form_level_title'] = '';\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ( 'custom' === $payment->price_id ) {\n\t\t\t\t\t\t\t$custom_amount_text = give_get_meta( $payment->form_id, '_give_custom_amount_text', true );\n\n\t\t\t\t\t\t\tif ( empty( $custom_amount_text ) ) {\n\t\t\t\t\t\t\t\t$custom_amount_text = esc_html__( 'Custom', 'give' );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$data[ $i ]['form_level_title'] = $custom_amount_text;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$data[ $i ]['form_level_title'] = give_get_price_option_name( $payment->form_id, $payment->price_id );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donation_date'] ) ) {\n\t\t\t\t\t$payment_date = strtotime( $payment->date );\n\t\t\t\t\t$data[ $i ]['donation_date'] = date( give_date_format(), $payment_date );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donation_time'] ) ) {\n\t\t\t\t\t$payment_date = strtotime( $payment->date );\n\t\t\t\t\t$data[ $i ]['donation_time'] = date_i18n( 'H', $payment_date ) . ':' . date( 'i', $payment_date );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['userid'] ) ) {\n\t\t\t\t\t$data[ $i ]['userid'] = $payment->user_id;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donorid'] ) ) {\n\t\t\t\t\t$data[ $i ]['donorid'] = $payment->customer_id;\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donor_ip'] ) ) {\n\t\t\t\t\t$data[ $i ]['donor_ip'] = give_get_payment_user_ip( $payment->ID );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donation_note_private'] ) ) {\n\t\t\t\t\t$comments = Give()->comment->db->get_comments( array(\n\t\t\t\t\t\t'comment_parent' => $payment->ID,\n\t\t\t\t\t\t'comment_type' => 'donation',\n\t\t\t\t\t\t'meta_query' => array(\n\t\t\t\t\t\t\t'relation' => 'OR',\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'key' => 'note_type',\n\t\t\t\t\t\t\t\t'compare' => 'NOT EXISTS',\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'key' => 'note_type',\n\t\t\t\t\t\t\t\t'value' => 'donor',\n\t\t\t\t\t\t\t\t'compare' => '!=',\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$comment_html = array();\n\n\t\t\t\t\tif ( ! empty( $comments ) ) {\n\t\t\t\t\t\tforeach ( $comments as $comment ) {\n\t\t\t\t\t\t\t$comment_html[] = sprintf(\n\t\t\t\t\t\t\t\t'%s - %s',\n\t\t\t\t\t\t\t\tdate( 'Y-m-d', strtotime( $comment->comment_date ) ),\n\t\t\t\t\t\t\t\t$comment->comment_content\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$data[ $i ]['donation_note_private'] = implode( \"\\n\", $comment_html );\n\t\t\t\t}\n\n\t\t\t\tif ( ! empty( $columns['donation_note_to_donor'] ) ) {\n\t\t\t\t\t$comments = Give()->comment->db->get_comments( array(\n\t\t\t\t\t\t'comment_parent' => $payment->ID,\n\t\t\t\t\t\t'comment_type' => 'donation',\n\t\t\t\t\t\t'meta_query' => array(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'key' => 'note_type',\n\t\t\t\t\t\t\t\t'value' => 'donor',\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$comment_html = array();\n\n\t\t\t\t\tif ( ! empty( $comments ) ) {\n\t\t\t\t\t\tforeach ( $comments as $comment ) {\n\t\t\t\t\t\t\t$comment_html[] = sprintf(\n\t\t\t\t\t\t\t\t'%s - %s',\n\t\t\t\t\t\t\t\tdate( 'Y-m-d', strtotime( $comment->comment_date ) ),\n\t\t\t\t\t\t\t\t$comment->comment_content\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$data[ $i ]['donation_note_to_donor'] = implode( \"\\n\", $comment_html );\n\t\t\t\t}\n\n\t\t\t\t// Add custom field data.\n\t\t\t\t// First we remove the standard included keys from above.\n\t\t\t\t$remove_keys = array(\n\t\t\t\t\t'donation_id',\n\t\t\t\t\t'seq_id',\n\t\t\t\t\t'first_name',\n\t\t\t\t\t'last_name',\n\t\t\t\t\t'email',\n\t\t\t\t\t'address_line1',\n\t\t\t\t\t'address_line2',\n\t\t\t\t\t'address_city',\n\t\t\t\t\t'address_state',\n\t\t\t\t\t'address_zip',\n\t\t\t\t\t'address_country',\n\t\t\t\t\t'donation_total',\n\t\t\t\t\t'payment_gateway',\n\t\t\t\t\t'payment_mode',\n\t\t\t\t\t'form_id',\n\t\t\t\t\t'form_title',\n\t\t\t\t\t'form_level_id',\n\t\t\t\t\t'form_level_title',\n\t\t\t\t\t'donation_date',\n\t\t\t\t\t'donation_time',\n\t\t\t\t\t'userid',\n\t\t\t\t\t'donorid',\n\t\t\t\t\t'donor_ip',\n\t\t\t\t);\n\n\t\t\t\t// Removing above keys...\n\t\t\t\tforeach ( $remove_keys as $key ) {\n\t\t\t\t\tunset( $columns[ $key ] );\n\t\t\t\t}\n\n\t\t\t\t// Now loop through remaining meta fields.\n\t\t\t\tforeach ( $columns as $col ) {\n\t\t\t\t\t$field_data = get_post_meta( $payment->ID, $col, true );\n\t\t\t\t\t$data[ $i ][ $col ] = $field_data;\n\t\t\t\t\tunset( $columns[ $col ] );\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Filter to modify Donation CSV data when exporting donation\n\t\t\t\t *\n\t\t\t\t * @since 2.1\n\t\t\t\t *\n\t\t\t\t * @param array Donation data\n\t\t\t\t * @param Give_Payment $payment Instance of Give_Payment\n\t\t\t\t * @param array $columns Donation data $columns that are not being merge\n\t\t\t\t * @param Give_Export_Donations_CSV $this Instance of Give_Export_Donations_CSV\n\t\t\t\t *\n\t\t\t\t * @return array Donation data\n\t\t\t\t */\n\t\t\t\t$data[ $i ] = apply_filters( 'give_export_donation_data', $data[ $i ], $payment, $columns, $this );\n\n\t\t\t\t$new_data = array();\n\t\t\t\t$old_data = $data[ $i ];\n\n\t\t\t\t// sorting the columns bas on row\n\t\t\t\tforeach ( $this->csv_cols() as $key => $value ) {\n\t\t\t\t\tif ( array_key_exists( $key, $old_data ) ) {\n\t\t\t\t\t\t$new_data[ $key ] = $old_data[ $key ];\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$data[ $i ] = $new_data;\n\n\t\t\t\t// Increment iterator.\n\t\t\t\t$i ++;\n\n\t\t\t}\n\n\t\t\t$data = apply_filters( 'give_export_get_data', $data );\n\t\t\t$data = apply_filters( \"give_export_get_data_{$this->export_type}\", $data );\n\n\t\t\treturn $data;\n\n\t\t}\n\n\t\treturn array();\n\n\t}", "public function calculate_active_sdo_personal_gpv($user_id)\n {\n //return $active_do;\n $root = Referral::where('user_id', $user_id)->first();\n $root_wallet = Wallet::where('user_id', $user_id)->first();\n \n $descendants = $root->getDescendants();\n $first_pv_purchased = 0;\n $personal_gpv = 0;\n $first_gpv_purchased= $root_wallet ? $root_wallet->first_purchased:0;\n $right = 0;\n $qualified = array();\n\n foreach ($descendants as $descendant)\n {\n $rank = $this->getUserRankId($descendant->user_id);\n\n if($rank <= 4 && $descendant->rgt > $right)\n {\n $wallet = Wallet::where('user_id', $descendant->user_id)->first();\n\n $first_gpv_purchased = $first_gpv_purchased + ($wallet ? $wallet->first_purchased:0) ;\n $personal_gpv = $personal_gpv + ($wallet ? $wallet->pv:0);//without root personal pv\n $qualified[] = $descendant->toArray();\n }\n elseif ($rank > 4 )\n {\n if($right < $descendant->rgt)\n {\n $right = $descendant->rgt;\n }\n }\n }\n\n $root_wallet = Wallet::where('user_id', $user_id)->first();//root personl pv\n\n $active_do = ActiveDo::where('user_id', $user_id)->first();\n $active_do->personal_gpv = $personal_gpv + ($root_wallet ? $root_wallet->pv:0);\n $active_do->first_gpv_purchased = $first_gpv_purchased;\n $active_do->save();\n }", "public function showPenaltyCalculator()\n {\n return view('developers.installment_account_ledgers.penalty_calculator', compact('ledger_properties','buyer'));\n }", "public function getAllPromoTotal($post)\n { \n\n $language = isset($post['language'])?$post['language']:Raise::$lang; \n $promo_type = isset($post['promo_type'])?$post['promo_type']:'';\n $device = isset($post['device'])?$post['device']:'1';\n $time = time();\n\n $wherQuery = ' AND promo_list.status = 1 and delete_status=0 and promo_list.id = promo_list_display_language.promo_list_id and promo_list_display_language.language_code = \"'.$language.'\" ';\n\n if (!empty($device)) {\n $wherQuery .= ' AND (CASE WHEN promo_list.device != \"\" THEN FIND_IN_SET('.$device.',promo_list.device) ELSE 1 END ) ';\n }\n\n if (!empty($post['player_id'])) {\n\n $player_id = $post['player_id'];\n\n $user = ( isset($post['user_info']) && !empty($post['user_info']) ) ? $post['user_info'] : $this->getUserInfo($player_id);\n\n $affiliate_id = $user['affiliate_id'] ?? 0;\n $player_group_id = $user['player_group_id'] ?? 0;\n $mobile_verification_status = $user['mobile_verification_status'] ?? 0;\n $is__security_pin = $user['is__security_pin'] ?? 0;\n $is__bank = $user['is__bank'] ?? 0;\n $promo_block = $user['promo_block'] ?? 0;\n\n if (!empty($promo_block)) {\n\n return 0;\n //$wherQuery .= ' AND 0 ';\n }\n\n $wherQuery .= ' AND apply_type = 1 AND \n ( CASE \n WHEN promo_list.target_type = 2 THEN FIND_IN_SET(\\''.$affiliate_id.'\\', promo_list.target_list)\n WHEN promo_list.target_type = 3 THEN FIND_IN_SET(\\''.$player_id.'\\', promo_list.target_list) \n ELSE 1 END )';\n \n if(!empty($player_group_id)){\n $wherQuery .= ' AND \n ( CASE \n WHEN promo_list.member_level_list != \"\" THEN FIND_IN_SET(\\''.$player_group_id.'\\', promo_list.member_level_list)\n ELSE 1 END )\n ';\n }\n\n // $wherQuery .= ' AND \n // ( CASE \n // WHEN (promo_list.verify_details != \"\" AND FIND_IN_SET(1, promo_list.verify_details) AND '.$mobile_verification_status.' != 1 )\n // THEN 0 ELSE 1 \n // END )';\n\n // $wherQuery .= ' AND \n // ( CASE \n // WHEN (promo_list.verify_details != \"\" AND FIND_IN_SET(2, promo_list.verify_details) AND '.$is__security_pin.' = 0 )\n // THEN 0 ELSE 1 \n // END )';\n // $wherQuery .= ' AND \n // ( CASE \n // WHEN (promo_list.verify_details != \"\" AND FIND_IN_SET(3, promo_list.verify_details) AND '.$is__bank.' = 0)\n // THEN 0 ELSE 1 \n // END )';\n \n // $getAllAppliedPromos = $this->callSql(\"SELECT GROUP_CONCAT(DISTINCT promo_list_id SEPARATOR ',') FROM promo_activity_list WHERE player_id =\".$player_id.\" \", \"value\");\n\n // $wherFindSet = '';\n\n // if(!empty($getAllAppliedPromos)){\n // $explodeArr = explode(',',$getAllAppliedPromos);\n // $find_setCond = '';\n // foreach ($explodeArr as $key => $value) {\n // if(!empty($find_setCond)){\n // $find_setCond .= ' OR FIND_IN_SET('.$value.',promo_list.conflict_promos) ';\n\n // }\n // else{\n // $find_setCond .= ' FIND_IN_SET('.$value.',promo_list.conflict_promos) ';\n\n // }\n // }\n // if(count($explodeArr) > 1){\n // $wherFindSet .= ' AND ('.$find_setCond.')';\n // }\n // else{\n // $wherFindSet .= ' AND '.$find_setCond.'';\n // }\n // $wherQuery .= ' AND ( CASE \n // WHEN (promo_list.conflict_promos !=\"\" '.$wherFindSet.' ) THEN\n // 0 ELSE 1 \n // END ) ';\n // } \n \n }\n \n if (!empty($promo_type)) { \n if(is_array($promo_type)) {\n $promo_type = join(\",\",$promo_type);\n }\n $wherQuery .= ' AND promo_list.promo_type IN ('.$promo_type.') ';\n }\n \n if (!empty($promo_text)) { \n $wherQuery .= ' AND promo_list.promo_name LIKE \"%'.$promo_type.'%\" ';\n }\n\n $sqlCount = 'SELECT COUNT(*) FROM promo_list,promo_list_display_language WHERE \n ( CASE \n WHEN promo_list.display_time_type = 1 THEN \n ( CASE \n WHEN promo_list.promo_end_time != 0 THEN promo_list.promo_start_time <= '.$time.' AND (promo_list.promo_end_time) >= '.$time.' \n WHEN promo_list.promo_end_time = 0 THEN promo_list.promo_start_time <= '.$time.' \n ELSE 1\n END )\n WHEN promo_list.display_time_type = 2 THEN promo_list.manual_start_status = 1 \n WHEN promo_list.display_time_type = 3 THEN \n ( CASE \n WHEN promo_list.display_end_time != 0 THEN promo_list.display_start_time <= '.$time.' AND (promo_list.display_end_time) >= '.$time.' \n WHEN promo_list.display_end_time = 0 THEN promo_list.display_start_time <= '.$time.' \n ELSE 1\n END )\n ELSE 1\n END ) '.$wherQuery.' ';\n\n $this->query($sqlCount);\n\n $totalCount = $this->getValue();\n\n return $totalCount;\n }", "public function mercanet()\n {\n $paymentRequest = new Mercanet('S9i8qClCnb2CZU3y3Vn0toIOgz3z_aBi79akR30vM9o');\n\n // Indiquer quelle page de paiement appeler : TEST ou PRODUCTION \n $paymentRequest->setUrl(Mercanet::TEST);\n\n // Renseigner les parametres obligatoires pour l'appel de la page de paiement \n $paymentRequest->setMerchantId('211000021310001');\n $paymentRequest->setKeyVersion('1');\n $paymentRequest->setTransactionReference(\"test\" . rand(100000, 999999));\n $paymentRequest->setAmount(100);\n $paymentRequest->setCurrency('EUR');\n if (empty($_SERVER[\"HTTPS\"])) {\n $http = \"http://\";\n } else {\n $http = \"https://\";\n }\n $urlReturn = reponse();\n $paymentRequest->setNormalReturnUrl($urlReturn);\n\n // Renseigner les parametres facultatifs pour l'appel de la page de paiement \n $paymentRequest->setLanguage('fr');\n // $paymentRequest->setCustomerContactEmail('[email protected]');\n // ...\n\n // Verification de la validite des parametres renseignes\n $paymentRequest->validate();\n }", "public function get_search_permastruct()\n {\n }", "function get_payment_requests($financial_year_id=0,$programarea_id=0, $status=0, $owner_id=0){ // i changed 'finacial' to 'financial'\n $filter=\"1\";\n if($status!=0){\n $filter=\"request_status=$status\"; //replace this with the right column\n }\n \n\n if($financial_year_id!=0){ \n $filter.=\" and financial_year_financial_year_id=$financial_year_id\"; //chech the column from payment request \n } // i changed 'finacial' to 'financial' on the line above\n \n\n if($programarea_id!=0){ \n $filter.=\" and p.`programarea_id`=$programarea_id\"; //chech the column from payment request \n }\n \n if($owner_id!=0){\n $filter.=\" and owner_id=$owner_id \"; \n }\n \n $str_query=\"select p.`payment_request_id`,p.`code`,p.`year`,p.`request_date`,p.`programarea_id`,\n p.`request_status`,p.`financial_year_financial_year_id`,p.`amount`,\n p.`group_id`,p.`verification_document`,p.`liquidationdoc`,p.`owner_id`,\n pa.`programarea_name`,f.`year_name` \n from payment_request p\n join financial_year f on p.`financial_year_financial_year_id`=f.`financial_year_id`\n left join programarea pa on p.`programarea_id`=pa.`programarea_id` \n where $filter\"; \n //echo $str_query;\n if (!$this->sql_query($str_query)){\n return false;\n }\n else{\n return true;\n }\n }", "public function recommendations($request, $response)\r\n {\r\n {\r\n $params = array();\r\n\r\n // Available Genres to search by on spotify\r\n $avail_genres = [\r\n \"acoustic\", \"afrobeat\", \"alt-rock\", \"alternative\", \"ambient\", \"anime\", \"black-metal\", \"bluegrass\",\r\n \"blues\", \"bossanova\", \"brazil\", \"breakbeat\", \"british\", \"cantopop\", \"chicago-house\", \"children\", \"chill\",\r\n \"classical\", \"club\", \"comedy\", \"country\", \"dance\", \"dancehall\", \"death-metal\", \"deep-house\", \"detroit-techno\",\r\n \"disco\", \"disney\", \"drum-and-bass\", \"dub\", \"dubstep\", \"edm\", \"electro\", \"electronic\", \"emo\", \"folk\", \"forro\",\r\n \"french\", \"funk\", \"garage\", \"german\", \"gospel\", \"goth\", \"grindcore\", \"groove\", \"grunge\", \"guitar\",\r\n \"happy\", \"hard-rock\", \"hardcore\", \"hardstyle\", \"heavy-metal\", \"hip-hop\", \"holidays\", \"honky-tonk\", \"house\",\r\n \"idm\", \"indian\", \"indie\", \"indie-pop\", \"industrial\", \"iranian\", \"j-dance\", \"j-idol\", \"j-pop\", \"j-rock\",\r\n \"jazz\", \"k-pop\", \"kids\", \"latin\", \"latino\", \"malay\", \"mandopop\", \"metal\", \"metal-misc\", \"metalcore\",\r\n \"minimal-techno\", \"movies\", \"mpb\", \"new-age\", \"new-release\", \"opera\", \"pagode\", \"party\", \"philippines-opm\",\r\n \"piano\", \"pop\", \"pop-film\", \"post-dubstep\", \"power-pop\", \"progressive-house\", \"psych-rock\", \"punk\",\r\n \"punk-rock\", \"r-n-b\", \"rainy-day\", \"reggae\", \"reggaeton\", \"road-trip\", \"rock\", \"rock-n-roll\", \"rockabilly\", \"romance\", \"sad\",\r\n \"salsa\", \"samba\", \"sertanejo\", \"show-tunes\", \"singer-songwriter\", \"ska\", \"sleep\", \"songwriter\", \"soul\",\r\n \"soundtracks\", \"spanish\", \"study\", \"summer\", \"swedish\", \"synth-pop\", \"tango\", \"techno\", \"trance\", \"trip-hop\",\r\n \"turkish\", \"work-out\", \"world-music\"\r\n ];\r\n\r\n $spotify_connected = isset($_SESSION['spotify_active']);\r\n $params['connected'] = $spotify_connected;\r\n\r\n $params['music'] = array();\r\n\r\n if (isset($_SESSION['user']) && $spotify_connected)\r\n {\r\n // User is logged in and connected their Spotify account, use their actual data\r\n\r\n // Get their top artists\r\n $artists = $this->getTopArtists();\r\n\r\n // Using top tracks, create an array of their top genres and artist ids\r\n $genres = array();\r\n $artist_arr = array();\r\n\r\n foreach($artists['items'] as $artist)\r\n {\r\n // Save artist id and name to use for artist recommendations\r\n $artist_arr[$artist['id']] = $artist['name'];\r\n\r\n foreach($artist['genres'] as $genre_name)\r\n {\r\n // Filter genres to genres that is available to search by on Spotify $avail_genres\r\n $name = str_replace(' ', '-', $genre_name);\r\n if (in_array($name, $avail_genres))\r\n {\r\n // Add to array of $genres\r\n if (isset($genres[$name]))\r\n {\r\n $genres[$name] += 1;\r\n }\r\n else\r\n {\r\n $genres[$name] = 1;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Sort list of genres by values\r\n arsort($genres);\r\n\r\n // Slice array to get top 4 genres and artists\r\n $genres = array_slice($genres, 0, 4);\r\n $artist_arr = array_slice($artist_arr, 0 , 4);\r\n }\r\n else\r\n {\r\n // Spotify Account not Account, use defaults genres\r\n $genres = array('r-n-b' => 1, 'pop' => 2, 'hip-hop' => 3, 'indie-pop' => 4);\r\n $artist_arr = array('3TVXtAsR1Inumwj472S9r4' => 'Drake', '0C0XlULifJtAgn6ZNCW2eu' => 'The Killers',\r\n '0MeLMJJcouYXCymQSHPn8g' => 'Sleeping At Last');\r\n }\r\n\r\n $genre_tracks = array();\r\n $artist_tracks = array();\r\n\r\n // Get recommendations based on GENRES\r\n foreach ($genres as $gen => $amount)\r\n {\r\n $view_name = ucwords(str_replace('-', ' ', $gen));\r\n $genre_tracks[$view_name] = $this->getTrackRecommendations('seed_genres', $gen);\r\n }\r\n $params['music']['Genres'] = $genre_tracks;\r\n\r\n // Get recommendations based on ARTISTS\r\n foreach ($artist_arr as $art_id => $art_name)\r\n {\r\n $artist_tracks[$art_name] = $this->getTrackRecommendations('seed_artists', $art_id);\r\n }\r\n $params['music']['Artists'] = $artist_tracks;\r\n\r\n return $this->render('recommendations', $params);\r\n }\r\n }", "public function paid()\n {\n $expenses = Expense::where(\"status\", 'verified')->orderBy('created_at', 'DESC')->get();\n $expenses->map(function ($expense) {\n return $expense->payment_account;\n });\n return response()->json($expenses);\n }", "public function getCreditRequests()\n {\n $search['q'] = request('q');\n\n $partner = auth()->user()->companies->first();\n\n $creditRequests = CreditRequest::search($search['q'])->with('quotation.user','user','credits')->paginate(10);\n\n return $creditRequests;\n /*$creditRequestsPublic = CreditRequest::search($search['q'])->where('public',1)->with('quotation.user','user','shippings')->get()->all();\n \n $creditRequestsPrivate = CreditRequest::search($search['q'])->where('public', 0)->whereHas('suppliers', function($q) use($partner){\n $q->where('shipping_request_supplier.supplier_id', $partner->id);\n })->get()->all();\n\n $creditRequests = array_collapse([$creditRequestsPublic, $creditRequestsPrivate]);\n\n // dd($creditRequests);\n \n \n $paginator = paginate($creditRequests, 10);\n \n return $paginator; */\n \n \n\n \n \n }", "public function suggestedPartners($id)\n {\n $details = DB::table('profiles')\n ->where('user_id','=',$id)\n ->get();\n\n foreach($details as $raw)\n {\n $gender=$raw->gender;\n $age = $raw->age;\n $religion = $raw->religion;\n $motherT = $raw->motherTongue;\n $height= $raw->height;\n $complexion =$raw->complexion;\n $location =$raw->location;\n $languages = $raw->languages;\n\n\n if($gender == 'Male')\n {\n $final=DB::table('profiles')\n ->join('users', 'users.id', '=', 'profiles.user_id')\n ->where('profiles.user_id','!=', Auth::user()->id)\n ->where('profiles.location','=',$location)\n ->where('profiles.religion','=',$religion)\n ->where('profiles.motherTongue','=',$motherT)\n ->where('profiles.gender','!=',$gender)\n ->where('profiles.age','<',$age)\n ->where('profiles.height','<',$height)\n ->where('profiles.complexion','=',$complexion)\n ->where('profiles.languages','=',$languages)\n ->where('users.is_admin','=',0)\n ->where('users.user_activate_state','=','activate')\n ->get();\n }\n else\n {\n $final=DB::table('profiles')\n ->join('users', 'users.id', '=', 'profiles.user_id')\n ->where('profiles.user_id','!=', Auth::user()->id)\n ->where('profiles.location','=',$location)\n ->where('profiles.religion','=',$religion)\n ->where('profiles.motherTongue','=',$motherT)\n ->where('profiles.gender','!=',$gender)\n ->where('profiles.age','>',$age)\n ->where('profiles.height','>',$height)\n ->where('profiles.complexion','=',$complexion)\n ->where('profiles.languages','=',$languages)\n ->where('users.is_admin','=',0)\n ->where('users.user_activate_state','=','activate')\n ->get();\n }\n\n //check if has any results from the query\n if(count($final)<1)\n {\n $final = \"No Result\";\n\n //if query does not have any result return this\n return view('ajax.suggestedPartners')->with('final',$final);\n }\n\n //if query has values return this\n return view('ajax.suggestedPartners')->with('final',$final);\n }\n\n //return (\"Hi\");\n\n }", "public function getPaymentOption() {\r\n $query = $this->db->get('v_combo_payment_method');\r\n \r\n if( $query->num_rows() > 0 ) {\r\n return $query->result();\r\n } else {\r\n return array();\r\n }\r\n }", "public function index(Request $request)\n {\n //\n $setting = Setting::find(1);\n// $commision = $setting->commission;\n//$restaurants = Restaurant::all();\n//foreach ($restaurants as $restaurant){\n//$netApp = 0;\n// $total = 0 ;\n// foreach ($restaurant->orders as $order){\n// $total += $order->total;\n// }\n// $netApp = $commision*$total;\n//\n//}\n// $restaurants = Restaurant::where(function ($q) use ($request) {\n// if ($request->search) {\n// $q->where('name', 'LIKE', '%' . $request->search . '%');\n//\n// }\n// })->paginate(6);\n $payments = Payment::orwhereHas('restaurant', function ($q) use ($request) {\n $q->where('name', 'LIKE', '%' . $request->search . '%');\n })->paginate(6);\n return view('admin.payments.index', compact('payments'));\n\n }", "public function getPaymentRequest()\n {\n $my_groups_id = Group::where('user_id',auth()->user()->id)->pluck('id');\n $requests_collection = BankTransferRequirement::whereIn('group_id', $my_groups_id);\n\n $requests_count = $requests_collection->count();\n $requests = $requests_collection->orderBy('created_at', 'DESC')->get();\n\n return response()->json([\n 'items' => $requests,\n 'message' => __('messages.fetch_data_msg'),\n 'status' => true\n ]);\n\n }", "function allPayments(Request $request)\n {\n $action = \"ALL PAYMENTS\";\n try {\n // Permission check\n if ( !$request->user()->hasAnyPermission(['payments.list','payments.view']) ) {\n $this->lg($this->accessDenied . ', PERMISSIONS: payments.list, payments.view', 'alert', $action, 403);\n return response()->json($this->accessDenied, 403);\n }\n // Columns\n /*$selectedColumns = [\n 'id',\n 'trx_id',\n 'sender_account_no',\n 'amount',\n 'currency',\n 'transaction_datetime',\n 'transactionReference',\n 'merchant_ref',\n 'merchant_id'\n ];*/\n\n $payments = Payment::query()\n ->join('merchants', 'payments.merchant_id', 'merchants.id');\n\n // If user searched for trx_id or sender_account_no\n if (!empty(request()->get(\"search\"))) {\n $search = strip_tags(request()->get(\"search\"));\n// $payments = $payments->whereTrxIdOrSenderAccountNo($search, $search);\n $payments = $payments->where(function($q) use($search) {\n return $q->where('payments.trx_id', $search)\n ->orWhere('payments.sender_account_no', $search)\n ->orWhere('merchants.account_no', $search);\n });\n }\n\n $queryPayments = $payments\n // ->with('merchant_details')\n ->with(array('merchant_details'=>function($query){\n $query->select('merchants.id','merchants.name', 'merchants.account_no');\n }))\n// ->with('reference_added_by')\n ->with(array('reference_added_by' => function($query){\n $query->select('users.id','users.name', 'users.username');\n }))\n ->api()\n ->authorized()\n ->orderBy('payments.id', 'desc')\n ->paginate();\n\n if (!$queryPayments->isEmpty()) {\n $this->lg('Payment found, payment: '. json_encode($queryPayments), 'info', $action, 200);\n return response()->json($queryPayments, 200);\n } else {\n $this->lg('Payment list is not available now', 'warning', $action, 404);\n return response()->json('Payment list is not available now', 404);\n }\n } catch (\\Exception $e) {\n $this->lg($e, 'error', $action, 500);\n return response()->json($this->experDifficulties, 500);\n }\n }", "public function completions() {\n\t\t$completions_calc = $this->_completions/$this->_attempts;\n\t\t// Other NFL QBR specific manipulations\n\t\t$completions_calc -= .3;\n\t\tif ($completions_calc * 5 < 0) {\n\t\t\t$completions_calc = 0;\n\t\t} elseif ($completions_calc * 5 > 2.375) {\n\t\t\t$completions_calc = 2.375;\n\t\t} else {\n\t\t\t$completions_calc *= 5;\n\t\t}\n\t\treturn $completions_calc;\n\t}", "private function getPaymentList(Request $request)\n\t{\n\t\t// $balanceOrderBooking =\n\t\t$query = BalanceOrderBooking::from('BLNC001 as a')\n\t\t\t\t->join('MST001 as b', 'a.mst001_id', '=', 'b.id')\n\t\t\t\t->join('BLNC002 as c', 'a.id', '=', 'c.blnc001_id')\n\t\t\t\t->join('MST020 as d', 'c.mst020_id', '=', 'd.id')\n\t\t\t\t->join('MST004 as e', 'a.mst004_id', '=', 'e.id');\n\n\t\tif($request->has('order_no')){\n\t\t\t$query = $query->where('a.order_no', 'like', $request->order_no);\n\t\t}\n\n\t\tif($request->has('start_date')){\n\t\t\tif(Helpers::isValidDateFormat($request->start_date)){\n\t\t\t\t$query = $query->where('a.order_date', '>=', Helpers::dateFormatter($request->start_date));\n\t\t\t}\n\t\t}\n\n\t\tif($request->has('end_date')){\n\t\t\tif(Helpers::isValidDateFormat($request->end_date)){\n\t\t\t\t$query = $query->where('a.order_date', '<=', Helpers::dateFormatter($request->end_date));\n\t\t\t}\n\t\t}\n\n\t\tif($request->has('agent')){\n\t\t\t$query = $query->where('b.email', '=', $request->agent);\n\t\t}\n\n\t\tif($request->has('hotel')){\n\t\t\t$query = $query->where('d.hotel_name', '=', $request->hotel);\n\t\t}\n\n\t\tif($request->has('status_payment')){\n\t\t\t$query = $query->where('a.status_pymnt', '=', $request->status_payment);\n\t\t}\n\n\t\tif($request->has('status_flag')){\n\t\t\t$query = $query->where('a.status_flag', '=', $request->status_flag);\n\t\t}\n\n\t\t$result = $query->select('a.*', 'd.hotel_name', 'e.curr_code');\n\t\t$result = $query->get();\n\n\t\treturn $result;\n\n\t}" ]
[ "0.61106133", "0.5704759", "0.5695899", "0.55570215", "0.5483363", "0.54832655", "0.5447413", "0.5440009", "0.54122907", "0.54100627", "0.5348099", "0.5339186", "0.5336318", "0.52937603", "0.5281333", "0.52307665", "0.52134395", "0.51516473", "0.51454616", "0.51399595", "0.51362497", "0.5131584", "0.51253915", "0.5105456", "0.5093253", "0.5085672", "0.50806403", "0.506962", "0.50565994", "0.5050455", "0.5029446", "0.5029304", "0.5019803", "0.500054", "0.4991272", "0.4969223", "0.49635985", "0.4955512", "0.49508226", "0.4945319", "0.49354225", "0.49088672", "0.49063602", "0.49044648", "0.4903364", "0.49009743", "0.49008307", "0.48979607", "0.48893967", "0.4889184", "0.4888825", "0.48865357", "0.48857757", "0.4878236", "0.487523", "0.48747864", "0.48628333", "0.48495096", "0.48480207", "0.48411295", "0.4838381", "0.4836384", "0.48347846", "0.48322514", "0.48242626", "0.4819058", "0.4812727", "0.48114622", "0.48112848", "0.48056456", "0.48051965", "0.48002902", "0.47987765", "0.47964907", "0.47949657", "0.47833702", "0.4777261", "0.47725707", "0.4770219", "0.47669545", "0.4763944", "0.4763309", "0.47598293", "0.47589418", "0.47566602", "0.47561443", "0.47496143", "0.47460252", "0.47451863", "0.4744291", "0.47407323", "0.47403583", "0.4739322", "0.47387406", "0.47357264", "0.4727346", "0.47264212", "0.47244015", "0.4723868", "0.4722992" ]
0.60723585
1
Get all latest payment events for participation
private function suggestionsForParticipation(Participation $participation, bool $isPriceSet, bool $isPayment) { $qb = $this->em->getConnection()->createQueryBuilder(); $qb->select(['y.price_value AS value', 'y.description', 'MAX(y.created_at)']) ->from('participant_payment_event', 'y') ->innerJoin('y', 'participant', 'a', 'y.aid = a.aid') ->innerJoin('a', 'participation', 'p', 'a.pid = p.pid') ->andWhere($qb->expr()->eq('p.pid', ':pid')) ->setParameter('pid', $participation->getPid()) ->andWhere('y.is_price_set = :is_price_set') ->setParameter('is_price_set', (int)$isPriceSet) ->andWhere('y.is_price_payment = :is_price_payment') ->setParameter('is_price_payment', (int)$isPayment) ->groupBy(['y.price_value', 'y.description']); $result = $qb->execute()->fetchAll(); $suggestions = []; foreach ($result as $payment) { if (!isset($suggestions[$payment['value']])) { $suggestions[$payment['value']] = []; } if (!isset($suggestions[$payment['value']][$payment['description']])) { $suggestions[$payment['value']][$payment['description']] = 0; } ++$suggestions[$payment['value']][$payment['description']]; } $suggestionsFlat = []; foreach ($suggestions as $value => $descriptions) { foreach ($descriptions as $description => $count) { $suggestionsFlat[] = [ 'value' => $value, 'description' => $description, 'count' => $count, ]; } } usort( $suggestionsFlat, function ($a, $b) { if ($a['count'] == $b['count']) { return 0; } return ($a['count'] < $b['count']) ? -1 : 1; } ); return $suggestionsFlat; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFollowUpEvents($notification)\n {\n $couponsTable = CouponsTable::getTableName();\n $eventsTable = EventsTable::getTableName();\n $eventsPeriodsTable = EventsPeriodsTable::getTableName();\n $customerBookingsEventsPeriods = CustomerBookingsToEventsPeriodsTable::getTableName();\n $eventsProvidersTable = EventsProvidersTable::getTableName();\n $paymentsTable = PaymentsTable::getTableName();\n\n try {\n $notificationType = $notification->getType()->getValue();\n\n $statement = $this->connection->query(\n \"SELECT\n e.id AS event_id,\n e.name AS event_name,\n e.status AS event_status,\n e.bookingOpens AS event_bookingOpens,\n e.bookingCloses AS event_bookingCloses,\n e.recurringCycle AS event_recurringCycle,\n e.recurringOrder AS event_recurringOrder,\n e.recurringUntil AS event_recurringUntil,\n e.maxCapacity AS event_maxCapacity,\n e.price AS event_price,\n e.description AS event_description,\n e.color AS event_color,\n e.show AS event_show,\n e.locationId AS event_locationId,\n e.customLocation AS event_customLocation,\n e.parentId AS event_parentId,\n e.created AS event_created,\n e.notifyParticipants AS event_notifyParticipants,\n e.deposit AS event_deposit,\n e.depositPayment AS event_depositPayment,\n e.depositPerPerson AS event_depositPerPerson,\n \n \n ep.id AS event_periodId,\n ep.periodStart AS event_periodStart,\n ep.periodEnd AS event_periodEnd,\n \n cb.id AS booking_id,\n cb.customerId AS booking_customerId,\n cb.status AS booking_status,\n cb.price AS booking_price,\n cb.info AS booking_info,\n cb.utcOffset AS booking_utcOffset,\n cb.aggregatedPrice AS booking_aggregatedPrice,\n cb.persons AS booking_persons,\n \n p.id AS payment_id,\n p.amount AS payment_amount,\n p.dateTime AS payment_dateTime,\n p.status AS payment_status,\n p.gateway AS payment_gateway,\n p.gatewayTitle AS payment_gatewayTitle,\n p.data AS payment_data,\n \n c.id AS coupon_id,\n c.code AS coupon_code,\n c.discount AS coupon_discount,\n c.deduction AS coupon_deduction,\n c.limit AS coupon_limit,\n c.customerLimit AS coupon_customerLimit,\n c.status AS coupon_status\n FROM {$eventsTable} e\n INNER JOIN {$eventsPeriodsTable} ep ON ep.eventId = e.id\n INNER JOIN {$customerBookingsEventsPeriods} cbe ON cbe.eventPeriodId = ep.id\n INNER JOIN {$this->bookingsTable} cb ON cb.id = cbe.customerBookingId\n LEFT JOIN {$paymentsTable} p ON p.customerBookingId = cb.id\n LEFT JOIN {$couponsTable} c ON c.id = cb.couponId\n LEFT JOIN {$eventsProvidersTable} epr ON epr.eventId = e.id\n LEFT JOIN {$this->usersTable} pu ON pu.id = epr.userId\n WHERE e.notifyParticipants = 1 \n AND cb.status = 'approved' \n AND e.id NOT IN (\n SELECT nl.eventId \n FROM {$this->table} nl \n INNER JOIN {$this->notificationsTable} n ON nl.notificationId = n.id \n WHERE n.name = 'customer_event_follow_up' \n AND n.type = '{$notificationType}'\n )\"\n );\n\n $rows = $statement->fetchAll();\n } catch (\\Exception $e) {\n throw new QueryExecutionException('Unable to find events in ' . __CLASS__, $e->getCode(), $e);\n }\n\n return EventFactory::createCollection($rows);\n }", "public function getProvidersNextDayEvents($notificationType)\n {\n $couponsTable = CouponsTable::getTableName();\n $eventsTable = EventsTable::getTableName();\n $eventsPeriodsTable = EventsPeriodsTable::getTableName();\n $customerBookingsEventsPeriods = CustomerBookingsToEventsPeriodsTable::getTableName();\n $eventsProvidersTable = EventsProvidersTable::getTableName();\n $paymentsTable = PaymentsTable::getTableName();\n\n $startCurrentDate = \"STR_TO_DATE('\" .\n DateTimeService::getCustomDateTimeObjectInUtc(\n DateTimeService::getNowDateTimeObject()->setTime(0, 0, 0)->format('Y-m-d H:i:s')\n )->modify('+1 day')->format('Y-m-d H:i:s') . \"', '%Y-%m-%d %H:%i:%s')\";\n\n $endCurrentDate = \"STR_TO_DATE('\" .\n DateTimeService::getCustomDateTimeObjectInUtc(\n DateTimeService::getNowDateTimeObject()->setTime(23, 59, 59)->format('Y-m-d H:i:s')\n )->modify('+1 day')->format('Y-m-d H:i:s') . \"', '%Y-%m-%d %H:%i:%s')\";\n\n try {\n $statement = $this->connection->query(\n \"SELECT\n e.id AS event_id,\n e.name AS event_name,\n e.status AS event_status,\n e.bookingOpens AS event_bookingOpens,\n e.bookingCloses AS event_bookingCloses,\n e.recurringCycle AS event_recurringCycle,\n e.recurringOrder AS event_recurringOrder,\n e.recurringUntil AS event_recurringUntil,\n e.maxCapacity AS event_maxCapacity,\n e.price AS event_price,\n e.description AS event_description,\n e.color AS event_color,\n e.show AS event_show,\n e.locationId AS event_locationId,\n e.customLocation AS event_customLocation,\n e.parentId AS event_parentId,\n e.created AS event_created,\n e.notifyParticipants AS event_notifyParticipants,\n e.zoomUserId AS event_zoomUserId,\n e.deposit AS event_deposit,\n e.depositPayment AS event_depositPayment,\n e.depositPerPerson AS event_depositPerPerson,\n \n ep.id AS event_periodId,\n ep.periodStart AS event_periodStart,\n ep.periodEnd AS event_periodEnd,\n ep.zoomMeeting AS event_periodZoomMeeting,\n \n pu.id AS provider_id,\n pu.firstName AS provider_firstName,\n pu.lastName AS provider_lastName,\n pu.email AS provider_email,\n pu.note AS provider_note,\n pu.phone AS provider_phone,\n pu.gender AS provider_gender,\n pu.pictureFullPath AS provider_pictureFullPath,\n pu.pictureThumbPath AS provider_pictureThumbPath,\n \n cb.id AS booking_id,\n cb.customerId AS booking_customerId,\n cb.status AS booking_status,\n cb.price AS booking_price,\n cb.customFields AS booking_customFields,\n cb.persons AS booking_persons,\n \n p.id AS payment_id,\n p.amount AS payment_amount,\n p.dateTime AS payment_dateTime,\n p.status AS payment_status,\n p.gateway AS payment_gateway,\n p.gatewayTitle AS payment_gatewayTitle,\n p.data AS payment_data,\n \n c.id AS coupon_id,\n c.code AS coupon_code,\n c.discount AS coupon_discount,\n c.deduction AS coupon_deduction,\n c.limit AS coupon_limit,\n c.customerLimit AS coupon_customerLimit,\n c.status AS coupon_status\n FROM {$eventsTable} e\n INNER JOIN {$eventsPeriodsTable} ep ON ep.eventId = e.id\n INNER JOIN {$customerBookingsEventsPeriods} cbe ON cbe.eventPeriodId = ep.id\n INNER JOIN {$this->bookingsTable} cb ON cb.id = cbe.customerBookingId\n LEFT JOIN {$paymentsTable} p ON p.customerBookingId = cb.id\n LEFT JOIN {$couponsTable} c ON c.id = cb.couponId\n LEFT JOIN {$eventsProvidersTable} epr ON epr.eventId = e.id\n LEFT JOIN {$this->usersTable} pu ON pu.id = epr.userId\n WHERE ep.periodStart BETWEEN {$startCurrentDate} AND {$endCurrentDate}\n AND cb.status = 'approved' \n AND e.id NOT IN (\n SELECT nl.eventId \n FROM {$this->table} nl \n INNER JOIN {$this->notificationsTable} n ON nl.notificationId = n.id \n WHERE n.name = 'provider_event_next_day_reminder' AND n.type = '{$notificationType}'\n )\"\n );\n\n $rows = $statement->fetchAll();\n } catch (\\Exception $e) {\n throw new QueryExecutionException('Unable to find events in ' . __CLASS__, $e->getCode(), $e);\n }\n\n return EventFactory::createCollection($rows);\n }", "function getUpcomingEvents()\n {\n //1. Define the query\n $sql = \"SELECT * FROM events WHERE starttime > CURRENT_DATE && archive != 1 ORDER BY starttime\";\n\n //2. Prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n //4. Execute the query\n $statement->execute();\n\n //5. Process the results (get OrderID)\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }", "static function getPaymentBookingHistory() {\n global $wpdb;\n $resultset = $wpdb->get_results(\n \"SELECT t.reservation_id, t.booking_reference, t.first_name, t.last_name, t.email, t.vendor_tx_code, t.payment_amount, a.auth_status, a.auth_status_detail, a.card_type, a.last_4_digits, a.processed_date\n FROM wp_sagepay_transaction t\n INNER JOIN wp_sagepay_tx_auth a ON t.vendor_tx_code = a.vendor_tx_code\n WHERE t.reservation_id IS NOT NULL\n UNION ALL \n SELECT reservation_id, booking_reference, first_name, last_name, email, vendor_tx_code, \n payment_amount, auth_status, auth_status_detail, card_type, last_4_digits, processed_date\n FROM wp_stripe_transaction\n WHERE processed_date IS NOT NULL\n AND booking_reference IS NOT NULL\n ORDER BY processed_date DESC\n LIMIT 100\" );\n\n if($wpdb->last_error) {\n throw new DatabaseException($wpdb->last_error);\n }\n return $resultset;\n }", "public function getNextEvents(){\n\t\t// get the events\n\t\t$events = $this->getEvents();\n\n\t\t$nextEvents = [];\n\t\t$eventNumber = sizeof($events);\n\n\t\t// extracts the events which has not happened yet, which date is not passed\n\t\tfor ($i = 0; $i < $eventNumber; $i++){\n\t\t\t$event = array_shift($events);\n\t\t\tif($event['is_approved'] == 1 && $event['date'] > date('Y-m-d')){\n\t\t\t\tarray_push($nextEvents, $event);\n\t\t\t}\n\t\t}\n\n\t\treturn $nextEvents;\n\t}", "public function getPaymentHistory(){\r\n\t\t$result = array();\r\n\t\treturn $result;\r\n\t}", "function getCurrentEvents()\n {\n //1. Define the query\n $sql = \"SELECT * FROM events WHERE starttime < CURRENT_DATE && event_complete != 1 ORDER BY starttime\";\n\n //2. Prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n //4. Execute the query\n $statement->execute();\n\n //5. Process the results (get OrderID)\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }", "public function getUpcomingEvents()\n {\n return EventQuery::create()->filterByDate(['min' => new DateTime()])->useEventPersonQuery()->useUserRoleQuery()->filterByUser($this)->endUse()->endUse()->distinct()->find();\n }", "public function getAllUpcomingEvents()\n {\n return $this->createQueryBuilder('d')\n ->having('d.date >= :today')\n ->setParameter('today', date('Y-m-d'))\n ->orderBy('d.date', 'ASC')\n ->getQuery()\n ->getResult();\n }", "public function getEvents()\n {\n $qb = $this->entityManager->getRepository(Event::class)->createQueryBuilder('e')\n ->where('e.deleted = 0')\n ->orderBy('e.eventStartDate', 'DESC');\n return $qb->getQuery();\n }", "public function getUpcomingEvents()\n {\n $now = date('Y-m-d');\n $joinTable = Versioned::get_stage() === Versioned::LIVE ? 'EventPage_Live' : 'EventPage';\n $events = EventDateTime::get()\n ->filter(['Event.ParentID' => $this->ID,])\n ->where(\"(\\\"StartDate\\\" >= '$now') OR (\\\"StartDate\\\" <= '$now' AND \\\"EndDate\\\" >= '$now')\")\n ->innerJoin($joinTable, \"\\\"$joinTable\\\".\\\"ID\\\" = \\\"EventDateTime\\\".\\\"EventID\\\"\");\n\n $this->extend('updateEvents', $events);\n\n return $events;\n }", "function getPastEvents()\n {\n //1. Define the query\n $sql = \"SELECT * FROM events WHERE endtime < CURRENT_DATE AND archive != 1 ORDER BY starttime DESC\";\n\n //2. Prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n //4. Execute the query\n $statement->execute();\n\n //5. Process the results (get OrderID)\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }", "private function getPayments(): Collection\n {\n // Get all of yesterday\n $startOfDay = now()->subDays(1)->startOfDay();\n $endOfDay = now()->subDays(1)->endOfDay();\n\n // Use updated_at because if you return to Square payment after it created a $0 payment it'll update it.\n // Nothing else will update it as far as I can tell.\n return Payment::whereBetween('updated_at', [$startOfDay, $endOfDay])\n ->where('amount', '>', 0)\n ->where('payable_type', DuesTransaction::getMorphClassStatic())\n ->get();\n }", "public function getFollowUpAppointments($notification)\n {\n $couponsTable = CouponsTable::getTableName();\n $customerBookingsExtrasTable = CustomerBookingsToExtrasTable::getTableName();\n $paymentsTable = PaymentsTable::getTableName();\n\n try {\n $notificationType = $notification->getType()->getValue();\n\n $currentDateTime = \"STR_TO_DATE('\" . DateTimeService::getNowDateTimeInUtc() . \"', '%Y-%m-%d %H:%i:%s')\";\n\n $statement = $this->connection->query(\n \"SELECT\n a.id AS appointment_id,\n a.bookingStart AS appointment_bookingStart,\n a.bookingEnd AS appointment_bookingEnd,\n a.notifyParticipants AS appointment_notifyParticipants,\n a.serviceId AS appointment_serviceId,\n a.providerId AS appointment_providerId,\n a.locationId AS appointment_locationId,\n a.internalNotes AS appointment_internalNotes,\n a.status AS appointment_status,\n \n cb.id AS booking_id,\n cb.customerId AS booking_customerId,\n cb.status AS booking_status,\n cb.price AS booking_price,\n cb.info AS booking_info,\n cb.utcOffset AS booking_utcOffset,\n cb.aggregatedPrice AS booking_aggregatedPrice,\n cb.persons AS booking_persons,\n \n p.id AS payment_id,\n p.amount AS payment_amount,\n p.dateTime AS payment_dateTime,\n p.status AS payment_status,\n p.gateway AS payment_gateway,\n p.gatewayTitle AS payment_gatewayTitle,\n p.data AS payment_data,\n \n cbe.id AS bookingExtra_id,\n cbe.extraId AS bookingExtra_extraId,\n cbe.customerBookingId AS bookingExtra_customerBookingId,\n cbe.quantity AS bookingExtra_quantity,\n cbe.price AS bookingExtra_price,\n cbe.aggregatedPrice AS bookingExtra_aggregatedPrice,\n \n c.id AS coupon_id,\n c.code AS coupon_code,\n c.discount AS coupon_discount,\n c.deduction AS coupon_deduction,\n c.limit AS coupon_limit,\n c.customerLimit AS coupon_customerLimit,\n c.status AS coupon_status\n FROM {$this->appointmentsTable} a\n INNER JOIN {$this->bookingsTable} cb ON cb.appointmentId = a.id\n LEFT JOIN {$paymentsTable} p ON p.customerBookingId = cb.id\n LEFT JOIN {$customerBookingsExtrasTable} cbe ON cbe.customerBookingId = cb.id\n LEFT JOIN {$couponsTable} c ON c.id = cb.couponId\n WHERE a.bookingEnd BETWEEN DATE_SUB({$currentDateTime}, INTERVAL 172800 SECOND) AND {$currentDateTime}\n AND DATE_ADD(a.bookingEnd, INTERVAL {$notification->getTimeAfter()->getValue()} SECOND)\n < {$currentDateTime}\n AND a.notifyParticipants = 1 \n AND cb.status = 'approved' \n AND a.id NOT IN (\n SELECT nl.appointmentId \n FROM {$this->table} nl \n INNER JOIN {$this->notificationsTable} n ON nl.notificationId = n.id \n WHERE n.name = 'customer_appointment_follow_up' \n AND n.type = '{$notificationType}'\n )\"\n );\n\n $rows = $statement->fetchAll();\n } catch (\\Exception $e) {\n throw new QueryExecutionException('Unable to find appointments in ' . __CLASS__, $e->getCode(), $e);\n }\n\n return AppointmentFactory::createCollection($rows);\n }", "public function getEvents()\n {\n\n $cached = $this->getFromCache('events_cache');\n if ($cached !== null) {\n return $cached;\n }\n\n // Fetch past and future events (only upcoming contains the current event)\n $events = $this->client->getEvents(\n array(\n 'group_urlname' => $this->group,\n 'status' => 'past,upcoming',\n 'desc' => 'desc'\n )\n );\n\n // Filter out events further in the future than a day\n $dayFromNow = (time() + (24 * 60 * 60)) * 1000;\n $events = $events->filter(function($value) use ($dayFromNow) {\n return ($value['time'] < $dayFromNow)? true : false;\n });\n\n $this->saveInCache('events_cache', $events);\n\n return $events;\n }", "public function getCustomersNextDayEvents($notificationType)\n {\n $couponsTable = CouponsTable::getTableName();\n $paymentsTable = PaymentsTable::getTableName();\n $eventsTable = EventsTable::getTableName();\n\n $eventsPeriodsTable = EventsPeriodsTable::getTableName();\n\n $customerBookingsEventsPeriods = CustomerBookingsToEventsPeriodsTable::getTableName();\n\n $eventsProvidersTable = EventsProvidersTable::getTableName();\n\n $startCurrentDate = \"STR_TO_DATE('\" .\n DateTimeService::getCustomDateTimeObjectInUtc(\n DateTimeService::getNowDateTimeObject()->setTime(0, 0, 0)->format('Y-m-d H:i:s')\n )->modify('+1 day')->format('Y-m-d H:i:s') . \"', '%Y-%m-%d %H:%i:%s')\";\n\n $endCurrentDate = \"STR_TO_DATE('\" .\n DateTimeService::getCustomDateTimeObjectInUtc(\n DateTimeService::getNowDateTimeObject()->setTime(23, 59, 59)->format('Y-m-d H:i:s')\n )->modify('+1 day')->format('Y-m-d H:i:s') . \"', '%Y-%m-%d %H:%i:%s')\";\n\n try {\n $statement = $this->connection->query(\n \"SELECT\n e.id AS event_id,\n e.name AS event_name,\n e.status AS event_status,\n e.bookingOpens AS event_bookingOpens,\n e.bookingCloses AS event_bookingCloses,\n e.recurringCycle AS event_recurringCycle,\n e.recurringOrder AS event_recurringOrder,\n e.recurringUntil AS event_recurringUntil,\n e.maxCapacity AS event_maxCapacity,\n e.price AS event_price,\n e.description AS event_description,\n e.color AS event_color,\n e.show AS event_show,\n e.locationId AS event_locationId,\n e.customLocation AS event_customLocation,\n e.parentId AS event_parentId,\n e.created AS event_created,\n e.notifyParticipants AS event_notifyParticipants,\n e.zoomUserId AS event_zoomUserId,\n e.deposit AS event_deposit,\n e.depositPayment AS event_depositPayment,\n e.depositPerPerson AS event_depositPerPerson,\n \n ep.id AS event_periodId,\n ep.periodStart AS event_periodStart,\n ep.periodEnd AS event_periodEnd,\n ep.zoomMeeting AS event_periodZoomMeeting,\n \n cb.id AS booking_id,\n cb.customerId AS booking_customerId,\n cb.status AS booking_status,\n cb.price AS booking_price,\n cb.customFields AS booking_customFields,\n cb.info AS booking_info,\n cb.utcOffset AS booking_utcOffset,\n cb.aggregatedPrice AS booking_aggregatedPrice,\n cb.persons AS booking_persons,\n \n p.id AS payment_id,\n p.amount AS payment_amount,\n p.dateTime AS payment_dateTime,\n p.status AS payment_status,\n p.gateway AS payment_gateway,\n p.gatewayTitle AS payment_gatewayTitle,\n p.data AS payment_data,\n \n pu.id AS provider_id,\n pu.firstName AS provider_firstName,\n pu.lastName AS provider_lastName,\n pu.email AS provider_email,\n pu.note AS provider_note,\n pu.phone AS provider_phone,\n pu.gender AS provider_gender,\n pu.pictureFullPath AS provider_pictureFullPath,\n pu.pictureThumbPath AS provider_pictureThumbPath,\n \n c.id AS coupon_id,\n c.code AS coupon_code,\n c.discount AS coupon_discount,\n c.deduction AS coupon_deduction,\n c.limit AS coupon_limit,\n c.customerLimit AS coupon_customerLimit,\n c.status AS coupon_status\n FROM {$eventsTable} e\n INNER JOIN {$eventsPeriodsTable} ep ON ep.eventId = e.id\n INNER JOIN {$customerBookingsEventsPeriods} cbe ON cbe.eventPeriodId = ep.id\n INNER JOIN {$this->bookingsTable} cb ON cb.id = cbe.customerBookingId\n LEFT JOIN {$paymentsTable} p ON p.customerBookingId = cb.id\n LEFT JOIN {$eventsProvidersTable} epr ON epr.eventId = e.id\n LEFT JOIN {$this->usersTable} pu ON pu.id = epr.userId\n LEFT JOIN {$couponsTable} c ON c.id = cb.couponId\n WHERE ep.periodStart BETWEEN {$startCurrentDate} AND {$endCurrentDate}\n AND cb.status = 'approved'\n AND e.notifyParticipants = 1 AND\n e.id NOT IN (\n SELECT nl.eventId \n FROM {$this->table} nl \n INNER JOIN {$this->notificationsTable} n ON nl.notificationId = n.id \n WHERE n.name = 'customer_event_next_day_reminder' AND n.type = '{$notificationType}'\n )\"\n );\n\n $rows = $statement->fetchAll();\n } catch (\\Exception $e) {\n throw new QueryExecutionException('Unable to find appointments in ' . __CLASS__, $e->getCode(), $e);\n }\n\n return EventFactory::createCollection($rows);\n }", "public function getEvents(){\n\t\t// prepares the request\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://\" . IP . \"/bde_site/api/event\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: ' . TOKEN));\n\n\t\t// send the request\n\t\t$output = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\n\t\t// decode the reponse of the API\n\t\t$events = json_decode($output, true);\n\n\t\t// format the date\n\t\tforeach ($events as $key => $event) {\n\t\t\t$events[$key]['date'] = explode('T', $event['date'])[0];\n\t\t}\n\n\t\t// if the user is not connected or if he is a student, remove events which are not public\n\t\tif (!isset($_SESSION['status']) || $_SESSION['status'] == 'student'){\n\t\t\t$publicEvents = [];\n\t\t\t$eventNumber = sizeof($events);\n\t\t\tfor($i=0 ; $i < $eventNumber; $i++){\n\t\t\t\t$event = array_shift($events);\n\t\t\t\tif($event['is_public'] == 1){\n\t\t\t\t\tarray_push($publicEvents, $event);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $publicEvents;\n\t\t}\n\n\t\t// return all events\n\t\treturn $events;\n\t}", "public function nextEvents() {\n\t\t$events = $this->client->getGroupEvents( [\n\t\t\t'urlname' => $this->group,\n\t\t\t'scroll' => 'next_upcoming',\n\t\t] );\n\n\t\treturn $events->getData();\n\t}", "public function getArchivedEvents()\n {\n $qb = $this->entityManager->getRepository(Event::class)->createQueryBuilder('e')\n ->where('e.deleted = 1')\n ->orderBy('e.eventStartDate', 'DESC');\n return $qb->getQuery();\n }", "public static function getNextEvents() {\n\n $startDate = Carbon::now() -> format('Y-m-d');\n $endDate = Carbon::now() -> addWeeks(4) -> format('Y-m-d');\n\n $events = Event::all() -> where(\"date\", \">=\", $startDate)\n -> where(\"date\", \"<=\", $endDate);\n\n foreach ($events as $event) {\n $event -> date = Carbon::createFromFormat(\"Y-m-d\", $event -> date)\n -> format(\"d/m/Y\");\n }\n\n return $events;\n\n }", "public function getUncommittedEvents();", "function Fetch_API_Payments($application_id)\n{\n\tsettype($application_id, 'int');\n\n\t$db = ECash::getMasterDb();\n\t$query = '-- /* SQL LOCATED IN file=' . __FILE__ . ' line=' . __LINE__ . ' method=' . __METHOD__ . \" */\n\t\tSELECT\n\t\t\tapi_payment_id,\n\t\t\tname_short event_type,\n\t\t\tamount,\n\t\t\tdate_event\n\t\tFROM\n\t\t\tapi_payment\n\t\t\tJOIN event_type USING (event_type_id)\n\t\tWHERE\n\t\t\tapplication_id = {$application_id}\n\t\tAND\n\t\t\tapi_payment.active_status = 'active'\n\t\";\n\n\t$result = $db->query($query);\n\treturn $result->fetchAll(PDO::FETCH_OBJ);\n\n}", "public function getPendingEvents(): array;", "public function getEvents()\n {\n $startDate = new \\DateTime(\"-1 months\");\n $endDate = new \\DateTime(\"+3 months\");\n\n $repo = EntityUtils::getRepository(\"EventLegacy\");\n\n //Use a different function for getting events for a student\n if ($this->user_context->isStudent()) {\n return $this->getStudentEvents($startDate, $endDate);\n }\n\n $eventResults = $repo->getStudentEventsByProgram($this->user_context->program->id, $startDate, $endDate, $this->filters);\n $quickAddResults = $repo->getStudentQuickAddShiftsByProgram($this->user_context->program->id, $startDate, $endDate, $this->filters);\n\n return ['events' => $eventResults, 'quick_add_shifts' => $quickAddResults];\n }", "private function getEvents () \n\n\t\t{\n\t\t\t $dbs = new DB ( $this->config['database'] );\n $c = $dbs->query (\"SELECT * FROM tbl_events_record WHERE org_id = '\" . $this->c . \"'\");\n\t\t\t if ( count ( $c ) ) {\n\t\t\t\t$this->result['data']['id'] = trim ( $this->c );\n\t\t\t\t$this->result['data']['events'] = $c[0]['events'];\n\t\t\t\t$this->result['data']['date'] = $c[0]['date_rec'];\n\t\t\t } else \n\t\t\t\t$this->result['data']['result'] = \"Not found [error code:100:101]\";\n\n\t\t\t $dbs->CloseConnection ();\n\t\t\t\n\t\t \treturn;\n\t\t}", "public function getEventInfos() {\n // today will be useful \n $today = new \\DateTime(\"today midnight\");\n \n // get all events\n $events = $this->_machine->plugin(\"DB\")->getEventsFromDB(\"AND events.active = 1\");\n \n // retrieve dates with events\n $dates = [];\n foreach ($events as $ev) {\n $from = new \\DateTimeImmutable($ev[\"time_from\"]);\n $to = new \\DateTimeImmutable($ev[\"time_to\"]);\n $date = $from;\n while ($date <= $to) {\n $dates = $this->_insertDate($dates, $date);\n $date = $date->modify(\"+1 day\");\n }\n }\n \n // retrieve events for today\n $today_events = $this->getEventsForRange(\n $today, $today\n );\n \n // retrieve events for next weekend\n $next_weekend_events = $this->getNextWeekendEvents();\n\n $result = [\n \"tot\" => count($events),\n \"dates\" => $dates,\n \"today\" => $today_events,\n \"next_weekend\" => $next_weekend_events,\n \"events\" => $events\n ];\n \n return $result;\n }", "public function events()\n {\n return $this->belongsToMany(Event::class)->withPivot('mobile', 'email')->withTimestamps()->latest('end_date');\n }", "private function getPendingEvents ()\n {\n return EventQueue::pending()->with('event_detail')\n ->orderBy('scheduled_start_time', 'asc')\n ->limit(100)\n ->get();\n }", "function listAllPayment($booking){\n // $records = $this->payments->getAllPaymentByBookingId($booking) ; \n // return $records ; \n $query = \"SELECT distinct(booking_pay_submit_date) as date from booking_pay where booking_pay_ref='$booking' \" ; \n // echo $query;\n $response['records'] = array();\n $res = mysqli_query($this->connection , $query) ;\n while($data = mysqli_fetch_assoc($res) ){\n // var_dump($data['date']);\n \n $paymentDate = $data['date'];\n \n $record = $this->payments->getBookingForDateAndBooking($booking , $paymentDate) ; \n $item =array(\"date\"=>formatDate($paymentDate) , \"payments\"=>$record) ; \n array_push($response['records'] , $item);\n }\n return $response['records'] ;\n }", "public function getProvidersNextDayAppointments($notificationType)\n {\n $couponsTable = CouponsTable::getTableName();\n $customerBookingsExtrasTable = CustomerBookingsToExtrasTable::getTableName();\n $paymentsTable = PaymentsTable::getTableName();\n\n $startCurrentDate = \"STR_TO_DATE('\" .\n DateTimeService::getCustomDateTimeObjectInUtc(\n DateTimeService::getNowDateTimeObject()->setTime(0, 0, 0)->format('Y-m-d H:i:s')\n )->modify('+1 day')->format('Y-m-d H:i:s') . \"', '%Y-%m-%d %H:%i:%s')\";\n\n $endCurrentDate = \"STR_TO_DATE('\" .\n DateTimeService::getCustomDateTimeObjectInUtc(\n DateTimeService::getNowDateTimeObject()->setTime(23, 59, 59)->format('Y-m-d H:i:s')\n )->modify('+1 day')->format('Y-m-d H:i:s') . \"', '%Y-%m-%d %H:%i:%s')\";\n\n try {\n $statement = $this->connection->query(\n \"SELECT\n a.id AS appointment_id,\n a.bookingStart AS appointment_bookingStart,\n a.bookingEnd AS appointment_bookingEnd,\n a.notifyParticipants AS appointment_notifyParticipants,\n a.serviceId AS appointment_serviceId,\n a.providerId AS appointment_providerId,\n a.locationId AS appointment_locationId,\n a.internalNotes AS appointment_internalNotes,\n a.status AS appointment_status,\n a.zoomMeeting AS appointment_zoom_meeting,\n \n cb.id AS booking_id,\n cb.customerId AS booking_customerId,\n cb.status AS booking_status,\n cb.price AS booking_price,\n cb.customFields AS booking_customFields,\n cb.persons AS booking_persons, \n \n p.id AS payment_id,\n p.amount AS payment_amount,\n p.dateTime AS payment_dateTime,\n p.status AS payment_status,\n p.gateway AS payment_gateway,\n p.gatewayTitle AS payment_gatewayTitle,\n p.data AS payment_data,\n \n cbe.id AS bookingExtra_id,\n cbe.extraId AS bookingExtra_extraId,\n cbe.customerBookingId AS bookingExtra_customerBookingId,\n cbe.quantity AS bookingExtra_quantity,\n cbe.price AS bookingExtra_price,\n cbe.aggregatedPrice AS bookingExtra_aggregatedPrice,\n \n c.id AS coupon_id,\n c.code AS coupon_code,\n c.discount AS coupon_discount,\n c.deduction AS coupon_deduction,\n c.limit AS coupon_limit,\n c.customerLimit AS coupon_customerLimit,\n c.status AS coupon_status\n FROM {$this->appointmentsTable} a\n INNER JOIN {$this->bookingsTable} cb ON cb.appointmentId = a.id\n LEFT JOIN {$paymentsTable} p ON p.customerBookingId = cb.id\n LEFT JOIN {$customerBookingsExtrasTable} cbe ON cbe.customerBookingId = cb.id\n LEFT JOIN {$couponsTable} c ON c.id = cb.couponId\n WHERE a.bookingStart BETWEEN $startCurrentDate AND $endCurrentDate\n AND cb.status = 'approved' \n AND a.id NOT IN (\n SELECT nl.appointmentId \n FROM {$this->table} nl \n INNER JOIN {$this->notificationsTable} n ON nl.notificationId = n.id \n WHERE n.name = 'provider_appointment_next_day_reminder' AND n.type = '{$notificationType}'\n )\"\n );\n\n $rows = $statement->fetchAll();\n } catch (\\Exception $e) {\n throw new QueryExecutionException('Unable to find appointments in ' . __CLASS__, $e->getCode(), $e);\n }\n\n return AppointmentFactory::createCollection($rows);\n }", "public function getAll(){\n //old : \n // $events = $this->events;\n // return $events;\n $repo = $this->om->getRepository(Event::class); \n return $repo->findAll();\n }", "function getEvents()\n {\n //1. Define the query\n $sql = \"SELECT * FROM events\";\n\n //2. Prepare the statement\n $statement = $this->_dbh->prepare($sql);\n\n //4. Execute the query\n $statement->execute();\n\n //5. Process the results (get OrderID)\n return $statement->fetchAll(PDO::FETCH_ASSOC);\n }", "public function getUserEvents() {\n $user = Auth::user();\n $userEvents = $user->events()->get();\n $userEvents = $userEvents->concat(Event::where('leader_id', $user->id)->get());\n return Response(EventResource::collection($userEvents), 200);\n }", "function getEvents()\n{\n require_once 'model/dbConnector.php';\n $connexion = openDBConnexion();\n $request = $connexion->prepare('SELECT * FROM bdd_satisfevent.events ORDER BY Date Desc');\n $request->execute(array());\n $result = $request->fetchAll();\n return $result;\n}", "public function get() {\n\t\t$event = $this->app->db->queryRow('SELECT * FROM events WHERE end_time > NOW() ORDER BY start_time ASC LIMIT 1');\n\n\t\t// Fetch proposals waiting to be rated\n\t\t$sessions = $this->app->db->queryAllRows('SELECT * FROM sessions WHERE event_id=%d AND type=%s ORDER BY start_time', $event['id'], 'Session');\n\t\tforeach ($sessions as &$session) {\n\t\t\t$session['stats'] = $this->app->db->queryRow('SELECT SUM(IF(ticket_type IS NOT NULL, 1, 0)) as attending, SUM(IF(invite_date_sent IS NOT NULL AND ticket_type IS NULL, 1, 0)) as invited, SUM(IF(ticket_type IS NULL AND invite_date_sent IS NULL, 1, 0)) as waitlist, AVG(rating) as avgrating FROM attendance a INNER JOIN participation p ON a.person_id=p.person_id WHERE p.session_id=%d', $session['id']);\n\t\t\t$session['proposals'] = $this->app->db->query('SELECT pe.id as person_id, pe.email, pe.org, pa.proposal FROM people pe INNER JOIN participation pa ON pe.id=pa.person_id WHERE pa.session_id=%d AND role=%s AND rating IS NULL', $session['id'], 'Delegate');\n\t\t}\n\n\t\t$this->addViewData(array(\n\t\t\t'event' => $event,\n\t\t\t'sessions' => $sessions,\n\t\t));\n\t\t$this->renderView('admin/rate');\n\t}", "public function getEventList() {\n $response = $this->client->get(\n $this->apiUrl . \"events\");\n return $response->json();\n }", "public function get_all_events()\n {\n // get today date for check past events or not\n $todayData = date(\"m/d/Y\");\n // get option from database\n $past_events_option = get_option('past_events');\n // preparing sql query\n $sql = \"SELECT * FROM $this->tableName \";\n if ($past_events_option != 'yes') {\n $sql .= \"WHERE `date` >= \" . $todayData;\n }\n global $wpdb;\n $allevents = $wpdb->get_results($sql);\n return $allevents;\n }", "public function Upcoming() {\n return $this->get_all_events( 'start_date', 'ASC', true );\n }", "public function getEvents()\n {\n //\n\n return Event::all();\n }", "public function &getTransactionEvents()\n {\n $this->_generateEventLabels();\n return self::$_eventList;\n }", "public function &getTransactionEvents()\n {\n $this->_generateEventLabels();\n return self::$_eventList;\n }", "public function iN_LatestPaymentsSubscriptionsList() {\n\t\t$query = mysqli_query($this->db, \"SELECT DISTINCT\n\t\t\tS.subscription_id, S.iuid_fk, S.subscribed_iuid_fk, S.subscriber_name, S.plan_id, S.plan_amount,S.admin_earning, S.plan_amount_currency, S.created, S.status, U.iuid, U.i_username, U.i_user_fullname\n\t\t\tFROM i_users U FORCE INDEX(ixForceUser)\n\t\t\tINNER JOIN i_user_subscriptions S FORCE INDEX(ix_Subscribe)\n\t\t ON S.subscribed_iuid_fk = U.iuid AND U.uStatus IN('1','3')\n\t\t\tWHERE S.status = 'active' ORDER BY S.subscription_id DESC LIMIT 5\n\t\t\t\") or die(mysqli_error($this->db));\n\t\twhile ($row = mysqli_fetch_array($query)) {\n\t\t\t$data[] = $row;\n\t\t}\n\t\tif (!empty($data)) {\n\t\t\treturn $data;\n\t\t}\n\t}", "public function getEvents();", "public function getEvents();", "public function payments(): Payments\n {\n return self::instance()->runner->payments();\n }", "function eventclass_payments()\n\t{\n\t\t$this->events[\"BeforeMoveNextList\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\n//\tonscreen events\n\n\t}", "public function fetchEvents()\n {\n // TODO: Implement fetchEvents() method.\n }", "function getEvents(){\n \n $query = \"SELECT *\n FROM \" . $this->table_name . \"\n WHERE \n MONTH(date) = MONTH(NOW()) \n OR MONTH(date) = IF(MONTH(NOW()) + 1 = 0, 12, MONTH(NOW()) - 1) \n OR MONTH(date) = IF(MONTH(NOW()) + 1 = 13, 1, MONTH(NOW()) + 1) \n ORDER BY date DESC\";\n \n // prepare the query\n $stmt = $this->conn->prepare( $query );\n \n // execute query\n $stmt->execute();\n\n return $stmt;\n }", "private static function obtenerEventos()\n {\n try {\n \n $consulta = \"SELECT * FROM \" . self::NOMBRE_TABLA_EVENTO . \" E JOIN \" . self::NOMBRE_TABLA_USUARIO . \" U ON U.id_usuario=E.id_usuario\";\n\n // Preparar sentencia\n $sentencia = ConexionBD::obtenerInstancia()->obtenerBD()->prepare($consulta);\n\n\n // Ejecutar sentencia preparada\n if ($sentencia->execute()) {\n http_response_code(200);\n return\n [\n \"estado\" => self::EXITO,\n \"datos\" => $sentencia->fetchAll(PDO::FETCH_ASSOC)\n ];\n } else\n throw new ExcepcionApi(self::ERROR_BDD, \"Se ha producido un error\");\n\n } catch (PDOException $e) {\n throw new ExcepcionApi(self::ERROR_BDD, $e->getMessage());\n }\n }", "public function followingEvent()\n {\n return Event::where('starts_at', '>=', $this->ends_at)\n ->where('type', '=', Event::MEETUP)\n ->first();\n }", "public function getEvents(){\n\t\t$events = Event::where('owner', Auth::user()->id)->where('deleted', 0)->get();\n\t\treturn response()->json(['data' => $events]);\n\t}", "public function getEvents()\n {\n return $this->hasMany('App\\Models\\Event', 'creator_id', 'id');\n }", "private function getUpcomingMeetingList($id) {\n $currentDate = new \\DateTime();\n\n $em = $this->getDoctrine()->getManager();\n\n $q = $em->createQuery(\"SELECT e \"\n . \"FROM \\Acme\\bsceneBundle\\Entity\\Meeting e \"\n . \"WHERE e.account = :id AND e.date >= :date \"\n . \"ORDER BY e.date ASC\")->setParameters(array('date' => $currentDate, 'id' => $id));\n $eventList = $q->getArrayResult();\n\n return $eventList;\n }", "public function getAllEvents(){\n\t\t//$events = EventPage::get()->sort('Date', 'DESC')->limit(5);\n\t\t$limit = 10;\n\n\t\t$items = DataObject::get(\"EventPage\", \"Date > NOW()\", \"Date\", null, $limit);\n\t\treturn $items;\n\n\t}", "public function getAllEvents() {\n\n $stmt = $this->conn->prepare(\"SELECT * FROM events\");\n\n\n\n if ($stmt->execute()) {\n $events = $stmt->get_result();\n $stmt->close();\n return $events;\n } else {\n return NULL;\n }\n }", "function getEvents() {\n return [];\n }", "public function getFutureTournamentsWithEvents($per_page, $offset)\n\t{\n\t\t$date = new DateTime();\n\t\treturn $this->getTournamentsWithEvents($per_page, $offset, $date->format(\"Y-m-d\"));\n\t}", "private function _getEventData()\n {\n $query = $this->app->query->newSelect();\n $query->cols(['*'])\n ->from('events')\n ->orderBy(['event_date desc', 'post_date desc'])\n ->limit(3);\n\n return $this->app->db->fetchAll($query);\n }", "public function getPayments()\n {\n return $this->hasMany(Payment::className(), ['user' => 'id']);\n }", "public function show()\r\n {\r\n $events = DB::table('app_event')\r\n ->orderBy('id', 'desc')\r\n ->paginate(10)->toJson();\r\n\r\n return $events;\r\n }", "public function getOutstandingOrders()\n {\n $order = $this->db->prepare(<<<SQL\nSELECT orders.order_id, orders.order_date, orders.arrival_date, orders.student_number\nFROM orders\nWHERE orders.arrival_date IS NULL\nORDER BY orders.order_date;\nSQL\n );\n $order->execute();\n return $order->fetchAll(\\PDO::FETCH_OBJ);\n }", "public function events() {\n return $this->belongsToMany('EventDCI', 'event_witness', 'witness_id', 'event_id')\n ->withPivot('file', 'dci_status', 'deleted_at')\n ->withTimestamps();\n }", "public function ongoingEvents()\n {\n $now = Carbon::now();\n\n return Event::where('date_start', '<', $now)\n ->where('date_end', '>', $now);\n }", "public function getPayments()\n {\n return $this->hasMany(Payments::className(), ['paymentMethodId' => 'paymentMethodId']);\n }", "function getUpcomingRecurEventsArray($from, $to, $exc_entries) {\n\t\t$select_fields = \t'tx_tdcalendar_events.*';\n\t\t$select_fields .=\t', tx_tdcalendar_categories.title as category';\n\t\t$select_fields .= \t', tx_tdcalendar_categories.color as catcolor';\n\t\t$select_fields .= \t', tx_tdcalendar_locations.location as location_name';\n\t\t$select_fields .= \t', tx_tdcalendar_organizer.name as organizer_name';\n\n\t\t$from_table =\t\t'((tx_tdcalendar_events'; \n\t\t$from_table .= \t\t' INNER JOIN tx_tdcalendar_categories';\n $from_table .= \t\t' ON tx_tdcalendar_events.category = tx_tdcalendar_categories.uid)';\n\t\t$from_table .= \t\t' LEFT JOIN tx_tdcalendar_locations';\n\t\t$from_table .= \t\t' ON tx_tdcalendar_events.location_id = tx_tdcalendar_locations.uid)';\n\t\t$from_table .= \t\t' LEFT JOIN tx_tdcalendar_organizer';\n\t\t$from_table .= \t\t' ON tx_tdcalendar_events.organizer_id = tx_tdcalendar_organizer.uid';\n\n\t\t$where_clause = \t'(event_type > 0 AND (rec_end_date=0 ';\n\t\t$where_clause .= \t\" OR (begin >= '\".$from.\"' AND (begin < '\".$to.\"'))\";\n\t\t$where_clause .= \t\" OR (begin < '\".$from.\"' AND (rec_end_date >= '\".$from.\"' OR end >= '\".$from.\"'))))\";\n\n\t\t$where_clause .= \t$this->enableFieldsCategories;\n\t\t$where_clause .=\t$this->enableFieldsEvents;\n\n\t\tif ($this->conf['currCat'] AND !$this->conf['hideCategorySelection'])\n\t\t\t$where_clause .= ' AND tx_tdcalendar_events.category = '.$this->conf['currCat'];\n\t\telse\n\t\t\t$where_clause .= \t$this->getCategoryQuery('tx_tdcalendar_events.category');\n\n\t\t$where_clause .=\t$this->getPagesQuery();\n\n\t\t$orderBy =\t\t\t'tx_tdcalendar_events.begin, tx_tdcalendar_events.uid';\n\t\t$limit = \t\t\t'';\n\n\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t$select_fields,\n\t\t\t$from_table,\n\t\t\t$where_clause,\n\t\t\t$groupBy='',\n\t\t\t$orderBy,\n\t\t\t$limit\n\t\t);\n\n\t\t$array = array();\n\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {\n\t\t\t$items=array();\n\t\t\t$items = $this->setRecurItemsList($row, $from, $to, $exc_entries);\n\t\t\t$array = array_merge((array)$array, (array)$items);\n\t\t}\n\n\t\tif(is_array($array))\n\t\t\treturn $array;\n\t\telse\n\t\t\treturn array();\n\t}", "public function listAllQuery() {\n \n $dql = \"select e\n from Vibby\\Bundle\\BookingBundle\\Entity\\Event e\n order by e.date_from\n \";\n\n return $this->getEntityManager()->createQuery($dql);\n \n }", "public function getByExpiredUsers($paymentGateway='')\n\t{\n\t\t$today = time();\n\t\t$startat = 1477060836;\n $queryBuilder = $this->createQueryBuilder('s');\n $query = $queryBuilder\n ->select('s')\n ->innerJoin('Api\\\\V1\\\\Entity\\\\User', 'u')\n ->where('u.subscriptionId = s.id')\n ->andWhere('s.paymentGateway = :paymentGateway')\n ->andWhere('u.subscriptionExpireAt > 0')\n ->andWhere('u.subscriptionExpireAt <= :today')\n ->andWhere('u.subscriptionStartAt >= :startat')\n ->andWhere('u.flags <> :status')\n ->setParameter('paymentGateway', $paymentGateway)\n ->setParameter('today', $today)\n ->setParameter('startat', $startat)\n ->setParameter('status', User::STATUS_SUSPENDED)\n\t\t\t->getQuery();\n\t\t/*$sql =\"select * from subscription as s INNER JOIN user as u where u.subscription_id=s.id and u.subscription_start_at>=$start_at and u.subscription_expire_at >0 and u.subscription_expire_at<=$today and u.flags!=1 and s.payment_gateway='$paymentGateway'\";\n\t\t$stmt = $this->getEntityManager()->getConnection()->prepare($sql);\n $stmt->execute();\n\t\t$subscriptions = $stmt->fetchAll();*/\n\t//\t$q=$query->getSQL();\n\t//\terror_log(\"Query: \".$q.\"\\n\" , 3, \"/volumes/log/api/test-log.log\");\n\t//\terror_log(\"Parameters: \".print_r($query->getParameters(), TRUE).\"\\n\" , 3, \"/volumes/log/api/test-log.log\");\n $subscriptions = $query->getResult();\n\n return $subscriptions;\n }", "public function listEvents()\n\t{\n\n\t\t$table=CaseItemModel::getInstance()->getTable();\n $pTable=ProcessModel::getInstance()->getTable();\n $piTable=ProcessItemModel::getInstance()->getTable();\n \n\t\t$status =\"status not in ('Complete','Terminated') \";\n \n\t\t$sql=\"select 'Case Item' as source,id,null as processName, processNodeId,caseId,type,subType,label,timer,timerDue,message,signalName \"\n . \" from $table \"\n . \" where $status\"\n .\" and subType in('timer','message','signal')\";\n\t\t$arr1= $this->db->select($sql);\n\n\t\t$sql=\"select 'Process Item' as source ,p.processName as processName, pi.id as id,pi.processNodeId,null as caseId,pi.type,subType,label,timer,timerDue,message,signalName \"\n . \" from $piTable pi\n join $pTable p on p.processId=pi.processId\n where subType in('timer','message','signal')\";\n \n \n\t\t$arr2= $this->db->select($sql);\n\t\t$results= array_merge($arr1,$arr2);\n\n\t\treturn $results;\n\t}", "public function recent()\n {\n\t\t$payments = array(\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '1',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 5.40,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'completed',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '2',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 100.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'pending',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '3',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 1.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'failed',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '4',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 1.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'refunded',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '5',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 1.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'completed',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '6',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 1.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'verified',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '7',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'mastercard',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 1123.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'completed',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '8',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 1.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'pending',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '9',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'jcb',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 1123.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'failed',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '10',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 1.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'completed',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '11',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 122.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'refunded',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '12',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'paypal',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 5444.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'completed',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '13',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 8.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'failed',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '14',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 1.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'completed',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '15',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 1.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'verified',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '16',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 1.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'completed',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '17',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 1.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'completed',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\t'id'\t\t\t=> '18',\n\t\t\t\t\t\t\t\t\t'date'\t\t\t=> '08/11/2018',\n\t\t\t\t\t\t\t\t\t'client'\t\t=> 'First Name Last Name',\n\t\t\t\t\t\t\t\t\t'tid'\t\t\t=> 6167455112,\n\t\t\t\t\t\t\t\t\t'cardtype'\t=> 'visa',\n\t\t\t\t\t\t\t\t\t'cardnum'\t=> '•••2205',\n\t\t\t\t\t\t\t\t\t'cardexp'\t=> '12/21',\n\t\t\t\t\t\t\t\t\t'currency'\t=> '$',\n\t\t\t\t\t\t\t\t\t'amount'\t=> 1.00,\n\t\t\t\t\t\t\t\t\t'status'\t\t=> 'refunded',\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t);\n\t\t\n return $payments; \n }", "public function events()\n {\n return $this->belongsToMany(Event::class, 'event_participant');\n }", "public function actionlistallfuturesreceivedByMember(){\n \n $model = new ProductHasVendor;\n \n $member_id = Yii::app()->user->id;\n \n //get all the product that a member is a merchant of\n $merchant_products = $model->getAllTheProductThisMemberIsAMerchantOf($member_id);\n \n $all_future_received = [];\n //retrieve all escrow\n $criteria = new CDbCriteria();\n $criteria->select = '*';\n // $criteria->condition='status=:status or (status=:accepted and quote_response_from=:responsefrom';\n // $criteria->params = array(':status'=>'live',':accepted'=>'accepted',':responsefrom'=>$member_id);\n $futures= Futures::model()->findAll($criteria);\n \n foreach($futures as $future){\n if(in_array($future['product_id'],$merchant_products)){\n $all_future_received[] = $future;\n }\n \n \n }\n \n if($future===null) {\n http_response_code(404);\n $data['error'] ='No record found';\n echo CJSON::encode($data);\n } else {\n header('Content-Type: application/json');\n echo CJSON::encode(array(\n \"success\" => mysql_errno() == 0,\n \"futures\" => $all_future_received)\n );\n \n }\n \n }", "public function countAllFutureTournamentsWithEvents()\n\t{\n\t\t$date = new DateTime();\n\t\treturn $this->countAllTournamentsWithEvents($date->format(\"Y-m-d\"));\n\t}", "public function getEvents()\n {\n return json_decode((string) $this->response->getBody())->events;\n }", "private function getTournamentsWithEvents($per_page, $offset, $date = false, $past = false)\n\t{\n\t\t/**\n\t\t * SELECT tournaments.*, COUNT(events.eventId)\n\t\t * FROM tournaments, \n\t\t * events WHERE tournaments.tournamentId = events.tournamentId AND tournaments.tournamentId = 2\n\t\t *GROUP BY tournaments.tournamentId\n\t\t*/\n\t\t\n\t\tif ($offset == 1)\n\t\t{\n\t\t\t$offset = 0;\n\t\t}\n\t\t\n\t\tif ($date != false)\n\t\t{\n\t\t\tif ($past == false)\n\t\t\t{\n\t\t\t\t$logic_operator = \">=\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$logic_operator = \"<\";\n\t\t\t}\n\t\t\t$this->db->where(\"tournaments.end {$logic_operator}\", $date);\n\t\t}\n\t\t\n\t\t$this->db->select('tournaments.*, COUNT(events.eventId)');\n\t\t$this->db->limit($per_page, $offset);\n\t\t$this->db->where(\"tournaments.tournamentId = events.tournamentId\");\n\t\t$this->db->group_by(\"tournaments.tournamentId\"); \n\t\t$query = $this->db->get('tournaments, events');\n\t\t\n\t\treturn $query->result_array();\n\t}", "protected function getEventsToSend()\n {\n return $this->getResource()->getEventsToSend();\n }", "public function getPartialPayments()\n {\n if (!$this->isInDB()) {\n return null;\n }\n\n return Payment::get()\n ->filter('InitialPaymentID', $this->ID)\n ->sort(['Created' => 'DESC', 'ID' => 'DESC']);\n }", "public function getAll()\n {\n return response()->json(['data'=>Event::orderBy('reserved_date')->get()]);\n }", "public function index()\n {\n $results = $this->event->Upcoming()->get();\n\n return Response::json($results);\n }", "public function getPayments()\n {\n return $this->hasMany(Payment::className(), ['cust_id' => 'id']);\n }", "public function getSpecialOfferTransactionPending() {\n $time_stamp = time() - 24*60*60; //1 day\n \n $results = array();\n $qb = $this->createQueryBuilder('t');\n $qb->select('t')\n ->where(' t.transactionType= :transactionType and t.status = :status and t.timeStamp >= :time_stamp ')\n ->setParameter('transactionType', 'PAY_ONCE_OFFER')\n ->setParameter('time_stamp', $time_stamp)\n ->setParameter('status', 'PENDING');\n $results = $qb->getQuery()->getResult();\n return $results;\n }", "public function all()\n {\n $model = new Event();\n $events = $model->readAll();\n return ['events'=>$events];\n }", "public function getRecurringOrders();", "public function getPayments()\n {\n return $this->payments;\n }", "public function getAllEventCallback()\n {\n $response = $this->get(Resources::$Eventcallbackurl);\n if (!$response->success()) {\n $this->throwError('MailjetService:getAllEventCallback() failed', $response);\n }\n return $response->getData();\n }", "public function getEventsAction($start, $repeatingEnd)\n {\n $em = $this->getDoctrine()->getManager();\n\n $events = $em->getRepository('HospiceSiteBundle:Event')->findAllBetweenStartAndRepeatingEndDate($start, $repeatingEnd);\n \t$response = new JsonResponse();\n \n \t$jsonArray = array();\n \n \tforeach ($events as $event) {\n $dateDiff = null;\n $r = $event->getRecurOptions();\n if ($r != null) {\n $firstEventStart;\n $dateStart = new \\DateTime($start);\n $dateEnd = new \\DateTime($repeatingEnd);\n $dateStep = new \\DateInterval(\"P0D\");\n $dateDiff = date_diff($event->getStart(), $dateStart);\n\n $name = $r->getFrequency()->getName();\n if ($name === 'PER_DAY') {\n if ($r->getInterval() > 0) {\n $e = $this->getEventsSeriesStart($dateStart, $event);\n $dateStep->d = $r->getInterval();\n while ($e->getStart() < $dateEnd) {\n \t array_push($jsonArray, $e->toJSON());\n $e->getStart()->add($dateStep);\n $e->getEnd()->add($dateStep);\n }\n }\n } elseif ($name === 'PER_WEEK') {\n if ($r->getInterval() > 0) {\n $firstEventInWeek = $this->getEventsSeriesStart($dateStart, $event);\n\n $eventInWeek = array();\n $flags = intval($r->getIntervalFlags());\n if ($flags != 0) {\n $opts_arr = $this->getPerDayOptions($r->getFrequency());\n $dateStep->d = intval($firstEventInWeek->getStart()->format(\"N\")) - self::DAY_MONDAY;\n $firstEventInWeek->getStart()->sub($dateStep);\n $firstEventInWeek->getEnd()->sub($dateStep);\n if ($flags & $opts_arr[\"ON_MONDAY\"]->getValue()) {\n $e = $this->createEvent($firstEventInWeek, 0);\n array_push($eventInWeek, $e);\n }\n if ($flags & $opts_arr[\"ON_TUSEDAY\"]->getValue()) {\n $e = $this->createEvent($firstEventInWeek, 1);\n array_push($eventInWeek, $e);\n }\n if ($flags & $opts_arr[\"ON_WEDNESDAY\"]->getValue()) {\n $e = $this->createEvent($firstEventInWeek, 2);\n array_push($eventInWeek, $e);\n }\n if ($flags & $opts_arr[\"ON_THURSDAY\"]->getValue()) {\n $e = $this->createEvent($firstEventInWeek, 3);\n array_push($eventInWeek, $e);\n }\n if ($flags & $opts_arr[\"ON_FRIDAY\"]->getValue()) {\n $e = $this->createEvent($firstEventInWeek, 4);\n array_push($eventInWeek, $e);\n }\n if ($flags & $opts_arr[\"ON_SATURDAY\"]->getValue()) {\n $e = $this->createEvent($firstEventInWeek, 5);\n array_push($eventInWeek, $e);\n }\n if ($flags & $opts_arr[\"ON_SUNDAY\"]->getValue()) {\n $e = $this->createEvent($firstEventInWeek, 6);\n array_push($eventInWeek, $e);\n }\n } else {\n $e = /* clone */ $firstEventInWeek;\n array_push($eventInWeek, $e);\n }\n\n $dateStep->d = $r->getInterval() * 7;\n\n $contFlag = true;\n while ($contFlag) {\n \t foreach ($eventInWeek as $e) {\n if ($e->getStart() > $dateEnd) {\n $contFlag = false;\n break;\n }\n if ($e->getEnd() >= $dateStart) {\n array_push($jsonArray, $e->toJSON());\n }\n $e->getStart()->add($dateStep);\n $e->getEnd()->add($dateStep);\n }\n }\n }\n } elseif ($name === 'PER_MONTH') {\n $e = $this->getEventsSeriesStart($dateStart, $event);\n $dateStep->m = $r->getInterval();\n while ($e->getStart() < $dateEnd) {\n array_push($jsonArray, $e->toJSON());\n $e->getStart()->add($dateStep);\n $e->getEnd()->add($dateStep);\n }\n } elseif ($name === 'PER_YEAR') {\n $e = $this->getEventsSeriesStart($dateStart, $event);\n $dateStep->y = $r->getInterval();\n while ($e->getStart() < $dateEnd) {\n array_push($jsonArray, $e->toJSON());\n $e->getStart()->add($dateStep);\n $e->getEnd()->add($dateStep);\n }\n }\n } else {\n \t array_push($jsonArray, $event->toJSON());\n }\n \t}\n \t$response->setData($jsonArray);\n \t$response->setStatusCode(Response::HTTP_OK);\n \treturn $response;\n\n }", "public function getTimeEventsList(){\n return $this->_get(8);\n }", "function getArrEvents(){\n $conn = $this->conectarBD(); \n $i=0;\n $arrEvents = null; \n $sql = \"SELECT * FROM eventos WHERE id_evento IN\n\t\t\t\t\t\t(SELECT id_evento FROM usuarios_eventos \n\t\t\t\t\t\t\tWHERE id_usuario= \".$this->id_user.\" and fecha >= CURDATE());\";\n\t\t$result = mysqli_query($conn, $sql);\n\t\twhile($row=mysqli_fetch_array($result, MYSQL_ASSOC)){ \n\t\t\t$arrEvents [$i]= array('id' => $row['id_evento'], 'description' => $row['descripcion'], 'date' => $row['fecha']);\n\t\t\t$i++;\n }\n\n $this->desconectarBD($conn);\n return $arrEvents;\n }", "public function getPastEvents(){\n\t\t// get the events\n\t\t$events = $this->getEvents();\n\n\t\t$pastEvents = [];\n\t\t$eventNumber = sizeof($events);\n\n\t\t// extracts the events which has not happened yet, which date is not passed\n\t\tfor ($i = 0; $i < $eventNumber; $i++){\n\t\t\t$event = array_shift($events);\n\t\t\tif($event['is_approved'] == 1 && $event['date'] < date('Y-m-d')){\n\t\t\t\tarray_push($pastEvents, $event);\n\t\t\t}\n\t\t}\n\n\t\treturn $pastEvents;\n\t}", "function get_new_events( $options=array() ){\n\t\t\n\t\tglobal $gamo, $dbh;\n\t\t\n\t\t$error_append = \" CLASS[\".__CLASS__.\"] METHOD[\".__METHOD__.\"] DATE[\".date('Y-m-d H:i:s').\"]\";\n\t\t\n\t\tCore::ensure_defaults(array(\n\t\t\t\t'start' => 0,\n\t\t\t\t'number' => 1\n\t\t\t),\n\t\t$options);\n\t\t\n\t\t$sql = \"SELECT id FROM \" . CORE_DB . \".\" . self::$table_name.\n\t\t\" WHERE active = 1 and hide = 0 ORDER BY date_time ASC LIMIT \".$options['start'].\",\".$options['number'];\n\n\t\t$sth = $dbh->prepare($sql);\n\n\t\t$vevents = array();\n\t\t$sth->execute();\n\n\t\twhile($row = $sth->fetch()) {\n\n\t\t\t$row = Core::r('virtual_events')->get_event(array(\n\t\t\t\t\t'id' => $row['id'],\n\t\t\t\t\t'public_has' => 1,\n\t\t\t\t\t'show_private_has' => 0\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tarray_push($vevents, $row);\n\n\t\t}\n\n\t\treturn $vevents;\n\t\t\n\t}", "public function getOtherEvents();", "public function getEvents() : array\n {\n $events = [];\n\n for ($i = 1; $i <= 2; $i++) {\n for ($j = 1; $j <= 4; $j++) {\n for ($k = 1; $k <= 10; $k++) {\n $events []= new Event('install', $i, $j);\n\n if ($k < 3 || $j == 2)\n $events []= new Event('purchase', $i, $j);\n }\n }\n }\n\n return $events;\n }", "function all(){\n\t\t$query = $this->db->query(\"SELECT * FROM transactions ORDER BY DateTime DESC;\");\n\t\t\n\t\treturn $query->result_array();\n\t}", "public function getPaindingPurchasePayments(){\n\t\t\n\t\t$this->db->select('PP.*, PO.purc_order_number, S.supl_comp');\n\t\t$this->db->from('purchase_order_payments AS PP');\n\t\t$this->db->join(\"purchase_orders AS PO\", \"PP.purc_order_id = PO.purc_order_id\");\n\t\t$this->db->join(\"suppliers AS S\", \"S.supl_id = PP.supplier_id\");\n\t\t$this->db->where(\"PP.status\", 'Pending');\n\t\t$this->db->order_by('PP.reminder_date');\n\t\t$query_pending_payments = $this->db->get();\n\t\t// echo $this->db->last_query();die;\n\t\tif($query_pending_payments->num_rows()>0)\n\t\t{\n\t\t\treturn $query_pending_payments->result_array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn array();\n\t\t}\n\t\t\n\t}", "public function payments()\n {\n return $this->hasMany(Payment::class, 'idRegistrationF', 'idRegistration');\n }", "public function getFulfilledOrders()\n {\n $order = $this->db->prepare(<<<SQL\nSELECT orders.order_id, orders.order_date, orders.arrival_date, orders.student_number\nFROM orders\nWHERE orders.arrival_date IS NOT NULL\nORDER BY orders.order_date;\nSQL\n );\n $order->execute();\n return $order->fetchAll(\\PDO::FETCH_OBJ);\n }", "public function getEvents()\n {\n if ($this->input->get('start') === null || $this->input->get('end') === null) {\n $response = array(\"status\" => false, \"message\" => 'Please provide necessary data.');\n\n $this->send(400, $response);\n }\n\n $reqData = array('start' => $this->input->get('start'), 'end' => $this->input->get('end'));\n\n $events = $this->model->getEvents($reqData);\n\n $this->send(200, $events);\n }", "public function query()\n {\n $query = AffiliatePayout::where(['affiliate_user_id'=>Auth::user()->id])->with('paymentMethod');\n //dd($query->get());\n return $this->applyScopes($query);\n }", "public function getPastTournamentsWithEvents($per_page, $offset)\n\t{\n\t\t$date = new DateTime();\n\t\treturn $this->getTournamentsWithEvents($per_page, $offset, $date->format(\"Y-m-d\"), true);\n\t}", "public function getCustomersNextDayAppointments($notificationType)\n {\n $couponsTable = CouponsTable::getTableName();\n $customerBookingsExtrasTable = CustomerBookingsToExtrasTable::getTableName();\n $paymentsTable = PaymentsTable::getTableName();\n\n $startCurrentDate = \"STR_TO_DATE('\" .\n DateTimeService::getCustomDateTimeObjectInUtc(\n DateTimeService::getNowDateTimeObject()->setTime(0, 0, 0)->format('Y-m-d H:i:s')\n )->modify('+1 day')->format('Y-m-d H:i:s') . \"', '%Y-%m-%d %H:%i:%s')\";\n\n $endCurrentDate = \"STR_TO_DATE('\" .\n DateTimeService::getCustomDateTimeObjectInUtc(\n DateTimeService::getNowDateTimeObject()->setTime(23, 59, 59)->format('Y-m-d H:i:s')\n )->modify('+1 day')->format('Y-m-d H:i:s') . \"', '%Y-%m-%d %H:%i:%s')\";\n\n try {\n $statement = $this->connection->query(\n \"SELECT\n a.id AS appointment_id,\n a.bookingStart AS appointment_bookingStart,\n a.bookingEnd AS appointment_bookingEnd,\n a.notifyParticipants AS appointment_notifyParticipants,\n a.serviceId AS appointment_serviceId,\n a.providerId AS appointment_providerId,\n a.locationId AS appointment_locationId,\n a.internalNotes AS appointment_internalNotes,\n a.status AS appointment_status,\n a.zoomMeeting AS appointment_zoom_meeting,\n \n cb.id AS booking_id,\n cb.customerId AS booking_customerId,\n cb.status AS booking_status,\n cb.price AS booking_price,\n cb.customFields AS booking_customFields,\n cb.info AS booking_info,\n cb.utcOffset AS booking_utcOffset,\n cb.aggregatedPrice AS booking_aggregatedPrice,\n cb.persons AS booking_persons,\n \n p.id AS payment_id,\n p.amount AS payment_amount,\n p.dateTime AS payment_dateTime,\n p.status AS payment_status,\n p.gateway AS payment_gateway,\n p.gatewayTitle AS payment_gatewayTitle,\n p.data AS payment_data,\n \n cbe.id AS bookingExtra_id,\n cbe.extraId AS bookingExtra_extraId,\n cbe.customerBookingId AS bookingExtra_customerBookingId,\n cbe.quantity AS bookingExtra_quantity,\n cbe.price AS bookingExtra_price,\n cbe.aggregatedPrice AS bookingExtra_aggregatedPrice,\n \n c.id AS coupon_id,\n c.code AS coupon_code,\n c.discount AS coupon_discount,\n c.deduction AS coupon_deduction,\n c.limit AS coupon_limit,\n c.customerLimit AS coupon_customerLimit,\n c.status AS coupon_status\n FROM {$this->appointmentsTable} a\n INNER JOIN {$this->bookingsTable} cb ON cb.appointmentId = a.id\n LEFT JOIN {$paymentsTable} p ON p.customerBookingId = cb.id\n LEFT JOIN {$customerBookingsExtrasTable} cbe ON cbe.customerBookingId = cb.id\n LEFT JOIN {$couponsTable} c ON c.id = cb.couponId\n WHERE a.bookingStart BETWEEN $startCurrentDate AND $endCurrentDate\n AND cb.status = 'approved'\n AND a.notifyParticipants = 1 AND\n a.id NOT IN (\n SELECT nl.appointmentId \n FROM {$this->table} nl \n INNER JOIN {$this->notificationsTable} n ON nl.notificationId = n.id \n WHERE n.name = 'customer_appointment_next_day_reminder' AND n.type = '{$notificationType}'\n )\"\n );\n\n $rows = $statement->fetchAll();\n } catch (\\Exception $e) {\n throw new QueryExecutionException('Unable to find appointments in ' . __CLASS__, $e->getCode(), $e);\n }\n\n return AppointmentFactory::createCollection($rows);\n }", "public function index()\n {\n $events = User_Event::all();\n return $this->sendResponse($events->toArray(), 'Partecipations retrieved successfully.');\n }", "public function getLatestInvoices()\r\n {\r\n if ($this->userId != Null) {\r\n $em = $this->entityManager;\r\n $criteria = array(\r\n 'user' => $this->userId\r\n );\r\n $order = array(\r\n 'id' => 'DESC'\r\n );\r\n $limit = 50;\r\n \r\n $transact = $em->getRepository('Transactions\\Entity\\InvoiceUser')->findBy($criteria, $order, $limit);\r\n return $transact;\r\n }\r\n }" ]
[ "0.7051006", "0.6229106", "0.6127656", "0.6112071", "0.5986347", "0.5924505", "0.58744335", "0.58706385", "0.5854524", "0.5848778", "0.58170795", "0.57976335", "0.5769774", "0.57657516", "0.576336", "0.57570493", "0.57392365", "0.5730764", "0.5680437", "0.56705916", "0.56634575", "0.565813", "0.562895", "0.56263024", "0.56057364", "0.5580471", "0.556786", "0.5561535", "0.55550325", "0.5529416", "0.55241317", "0.5520044", "0.5512816", "0.5502607", "0.54826933", "0.5477066", "0.5473527", "0.54593104", "0.5448403", "0.54449284", "0.54449284", "0.542513", "0.5411709", "0.5411709", "0.54082024", "0.5404075", "0.5403602", "0.53987604", "0.5381581", "0.5374514", "0.5373129", "0.5366173", "0.536377", "0.53621554", "0.5343872", "0.5315574", "0.5309156", "0.52942467", "0.52871895", "0.5251584", "0.52506346", "0.52503395", "0.52341247", "0.5232687", "0.521275", "0.5197697", "0.5190439", "0.51872355", "0.51761556", "0.5165938", "0.5165112", "0.5157032", "0.5155497", "0.5154611", "0.5152524", "0.51492316", "0.5147883", "0.5147284", "0.5140464", "0.51371264", "0.51346046", "0.51337343", "0.5131426", "0.51308936", "0.5124685", "0.5120229", "0.51126194", "0.5111313", "0.5102384", "0.50952643", "0.5092057", "0.5090893", "0.5084844", "0.5079728", "0.50787103", "0.5074883", "0.5074134", "0.5072935", "0.50726795", "0.50725913", "0.5072056" ]
0.0
-1
Get suggestions for transmitted event grouped by value and description
private function suggestionsForEvent(Event $event, bool $isPriceSet, bool $isPayment) { $qb = $this->em->getConnection()->createQueryBuilder(); $qb->select(['y.price_value AS value', 'y.description', 'COUNT(*) AS count']) ->from('participant_payment_event', 'y') ->innerJoin('y', 'participant', 'a', 'y.aid = a.aid') ->innerJoin('a', 'participation', 'p', 'a.pid = p.pid') ->andWhere($qb->expr()->eq('p.eid', ':eid')) ->setParameter('eid', $event->getEid()) ->andWhere('y.is_price_set = :is_price_set') ->setParameter('is_price_set', (int)$isPriceSet) ->andWhere('y.is_price_payment = :is_price_payment') ->setParameter('is_price_payment', (int)$isPayment) ->groupBy(['y.price_value', 'y.description']) ->orderBy('count', 'DESC') ->setMaxResults(4); return $qb->execute()->fetchAll(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function eventoni_suggest_events()\n{\n\t// POST-Daten (Inhalt + Titel) auslesen und analysieren\n\t$content = $_POST['content'];\n\t$what = analyse_content($content);\n\n\t// hole Rohdaten zu den Events anhand des analysierten Text-Inhalts\n\t$data = eventoni_fetch('&wt='.$what, true);\n\techo $data['xml'];\n\tdie();\n}", "public function getSuggestData()\n {\n if (is_null($this->_suggestData)) {\n\n $picklistEntries = $this->getPicklistEntries();\n $response = array();\n $data = array();\n $counter = 0;\n\n if (is_array($picklistEntries)) {\n foreach ($picklistEntries as $entry) {\n $_data = array(\n 'value' => $entry->Moniker,\n 'title' => $entry->PartialAddress,\n 'row_class' => (++$counter)%2?'odd':'even'\n );\n array_push($data, $_data);\n }\n } elseif ($picklistEntries && ($picklistEntries->Score > 0)) { // only one result\n $_data = array(\n 'value' => $picklistEntries->Moniker,\n 'title' => $picklistEntries->PartialAddress,\n 'row_class' => (++$counter)%2?'odd':'even'\n );\n array_push($data, $_data);\n }\n\n $this->_suggestData = $data;\n }\n return $this->_suggestData;\n }", "public function getSuggestData()\n {\n \tif(!$this->helper('findologic')->isAlive()){\n \t\treturn parent::getSuggestData();\n \t}\t\n \t\n if (!$this->_suggestData) {\n \t$this->_suggestData = array();\n \t\n\t\t\t$query = $this->helper('catalogsearch')->getQueryText();\n \t$result = $this->helper('findologic')->autocomplete($query);\n\n \tif(isset($result->suggestions)) {\n \t $counter = 0;\n \t $data = array();\n \t \n\t foreach ($result->suggestions as $suggestion) {\n\t \t$suggestion = explode('|', $suggestion);\n\t \t\n\t $_data = array(\n\t 'title' => $suggestion[0],\n\t 'row_class' => ++$counter % 2 ? 'odd' : 'even',\n\t 'num_of_results' => $suggestion[1]\n\t );\n\t\n\t if ($_data['title'] == $query) {\n\t array_unshift($data, $_data);\n\t }\n\t else {\n\t $data[] = $_data;\n\t }\n\t }\n\t $this->_suggestData = $data;\n \t}\n }\n\n\t\treturn $this->_suggestData;\n }", "public function retrieveShortEventDesc()\n {\n $events = Events::all();\n\n $data= $this->eventTrans->transformCollection($events->toArray());\n\n $items = collect($data);\n\n $page = Input::get('page', 1);\n\n $perPage = 2;\n\n $page = new LengthAwarePaginator($items->forPage($page, $perPage),$items->count(), $perPage, $page);\n\n return $this->paginatorHelper->respondWithPagination($page);\n\n\n }", "public function setEventDescription($value)\n {\n return $this->set('EventDescription', $value);\n }", "public function getSuggestions($field, $value, $limit, $userId)\n {\n //TODO\n }", "function suggest() {\n $suggestions = $this->ticket->get_search_suggestions($this->input->get('term'), 100);\n\n echo json_encode($suggestions);\n }", "public function suggests() : array;", "public function getTypeAllowableValues()\n {\n return [\n self::TYPE_NOTIFICATION_BY_SUBSCRIPTION,\n self::TYPE_EVENTS_BY_EVENT_TYPE,\n self::TYPE_NOTIFICATION_BY_EVENT_TYPE,\n self::TYPE_EVENTS_BY_EVENT_TYPE_PER_USER,\n self::TYPE_NOTIFICATION_BY_EVENT_TYPE_PER_USER,\n self::TYPE_EVENTS,\n self::TYPE_NOTIFICATIONS,\n self::TYPE_NOTIFICATION_FAILURE_BY_SUBSCRIPTION,\n self::TYPE_UNPROCESSED_RANGE_START,\n self::TYPE_UNPROCESSED_EVENTS_BY_PUBLISHER,\n self::TYPE_UNPROCESSED_EVENT_DELAY_BY_PUBLISHER,\n self::TYPE_UNPROCESSED_NOTIFICATIONS_BY_CHANNEL_BY_PUBLISHER,\n self::TYPE_UNPROCESSED_NOTIFICATION_DELAY_BY_CHANNEL_BY_PUBLISHER,\n self::TYPE_DELAY_RANGE_START,\n self::TYPE_TOTAL_PIPELINE_TIME,\n self::TYPE_NOTIFICATION_PIPELINE_TIME,\n self::TYPE_EVENT_PIPELINE_TIME,\n self::TYPE_HOURLY_RANGE_START,\n self::TYPE_HOURLY_NOTIFICATION_BY_SUBSCRIPTION,\n self::TYPE_HOURLY_EVENTS_BY_EVENT_TYPE_PER_USER,\n self::TYPE_HOURLY_EVENTS,\n self::TYPE_HOURLY_NOTIFICATIONS,\n self::TYPE_HOURLY_UNPROCESSED_EVENTS_BY_PUBLISHER,\n self::TYPE_HOURLY_UNPROCESSED_EVENT_DELAY_BY_PUBLISHER,\n self::TYPE_HOURLY_UNPROCESSED_NOTIFICATIONS_BY_CHANNEL_BY_PUBLISHER,\n self::TYPE_HOURLY_UNPROCESSED_NOTIFICATION_DELAY_BY_CHANNEL_BY_PUBLISHER,\n self::TYPE_HOURLY_TOTAL_PIPELINE_TIME,\n self::TYPE_HOURLY_NOTIFICATION_PIPELINE_TIME,\n self::TYPE_HOURLY_EVENT_PIPELINE_TIME,\n ];\n }", "function getDataDescriptions() { return $this->m_descs; }", "function getEventList($responseArray, $actionID) {\n $return = array();\n foreach ($responseArray as $value) {\n if (is_array($value) &&\n isset($value['ActionID']) &&\n $value['ActionID'] == $actionID) {\n if (isset($value['Event'])) {\n $return[$value['Event']][] = $value;\n }\n }\n }\n return $return;\n}", "public function suggest() {\n // Set the content type to json\n $this->response->type('application/json');\n $result = $this->searchPlace();\n $this->set('result', $result);\n }", "public function suggest() {\n \n $query = ['query' => ['match_all' => []]];\n if (Request::has('q')) {\n $query = [\n 'query' => [\n 'nested' => [\n 'path' => 'prefLabels',\n 'query' => [\n 'bool' => [\n 'must' => [\n [ 'prefix' => [ 'prefLabels.label' => Request::get('q') ] ],\n [ 'match' => [ 'prefLabels.lang' => 'en' ] ]\n ]\n ]\n ]\n ]\n ]\n ];\n }\n \n $hits = Subject::suggest($query, 'resource');\n return response()\n ->json($hits)\n ->header(\"Vary\", \"Accept\");\n }", "public function getIdeas(){\n\t\t// get the events\n\t\t$events = $this->getEvents();\n\n\t\t$ideas = [];\n\t\t$eventNumber = sizeof($events);\n\n\t\t// extract the ideas from the event list\n\t\tfor ($i = 0; $i < $eventNumber; $i++){\n\t\t\t$event = array_shift($events);\n\t\t\tif($event['is_approved'] == 0){\n\t\t\t\tarray_push($ideas, $event);\n\t\t\t}\n\t\t}\n\n\t\treturn $ideas;\n\t}", "function opdsSearchDescriptor()\n{\n global $app;\n\n $gen = mkOpdsGenerator($app);\n $cat = $gen->searchDescriptor(null, '/opds/searchlist/0/');\n mkOpdsResponse($app, $cat, OpdsGenerator::OPENSEARCH_MIME);\n}", "private function getEvents($type)\r\n {\r\n if ($type == Stat::TYPE_INQUIRY) {\r\n $inqs = $this->container->get('jcs.ds')->getGroup('inquiry');\r\n return !empty($inqs) ? $inqs : [];\r\n }\r\n elseif ($type == Stat::TYPE_FAMILY_HELP) {\r\n $events = $this->container->getParameter('stat_events');\r\n\r\n return isset($events[$type]) ? $events[$type] : [];\r\n }\r\n }", "function tc_get_resend_email_events( $field_name = '', $post_id = '', $multi_select = false ) {\n\n $placeholder = ( $multi_select ) ? __( 'Choose any events', 'tc' ) : '';\n\n $tc_email_settings = get_option('tc_email_setting', false);\n $selected = ( isset( $tc_email_settings['resend_attendees_event_name'] ) ) ? $tc_email_settings['resend_attendees_event_name'] : 'all';\n\n $wp_events_search = new TC_Events_Search( '', '', -1 );\n ?>\n\n <!-- Event Name Field -->\n <select id=\"resend_attendees_event_name\" class=\"regular-text dynamic-field-child\" name=\"tc_email_setting[resend_attendees_event_name]\" data-placeholder=\"<?php echo $placeholder; ?>\">\n <?php foreach ( $wp_events_search->get_results() as $event ) : ?>\n <option value=\"<?php echo (int) $event->ID; ?>\" <?php selected( $event->ID, $selected, true ); ?>><?php echo get_the_title( (int) $event->ID ); ?></option>\n <?php endforeach; ?>\n </select>\n <?php\n}", "function suggest() {\n $suggestions = $this->tour->get_search_suggestions($this->input->post('term'), 100);\n echo json_encode($suggestions);\n }", "public function suggestions(): array\n {\n return $this->suggestions;\n }", "protected static function get_interaction_descriptions() {\n return array();\n }", "public function autocompleteSelect($filter = '') {\n $events = $this->findAll(NULL, '*', 'event_name ASC');\n $result = array();\n foreach($events as $key=>$event){\n $result[$key]['id'] = $event->event_slug;\n $result[$key]['name'] = $event->event_name.' - '.strtoupper($event->event_code);\n $result[$key]['url'] = '';\n }\n \n return $result;\n }", "public function getTags(){\n\t\tif (!is_array($this->_known_tags)){\n\t\t\t$desc = $this->getDescription();\n\t\t}\n\t\treturn $this->_known_tags;\n\t}", "public function getAggregations();", "function getOptionValuesAndDescription($orderby = \"optiontext\") {\t\t\n\t\t$optionvaluesquery = \"SELECT lv.lookupvaluedescription as optiontext, lv.lookuptypevalue as optionvalue FROM lookuptype AS l , \n\t\tlookuptypevalue AS lv WHERE l.id = lv.lookuptypeid AND l.name ='\".$this->getName().\"' ORDER BY \".$orderby;\n\t\treturn getOptionValuesFromDatabaseQuery($optionvaluesquery);\n\t}", "function GetExtendedFilterValues() {\n\t\tglobal $deals_details;\n\n\t\t// Field dealer\n\t\t$sSelect = \"SELECT DISTINCT rep.dealer FROM \" . $deals_details->SqlFrom();\n\t\t$sOrderBy = \"rep.dealer ASC\";\n\t\t$wrkSql = ewrpt_BuildReportSql($sSelect, $deals_details->SqlWhere(), \"\", \"\", $sOrderBy, $this->UserIDFilter, \"\");\n\t\t$deals_details->dealer->DropDownList = ewrpt_GetDistinctValues(\"\", $wrkSql);\n\n\t\t// Field date_start\n\t\t$sSelect = \"SELECT DISTINCT rep.date_start FROM \" . $deals_details->SqlFrom();\n\t\t$sOrderBy = \"rep.date_start ASC\";\n\t\t$wrkSql = ewrpt_BuildReportSql($sSelect, $deals_details->SqlWhere(), \"\", \"\", $sOrderBy, $this->UserIDFilter, \"\");\n\t\t$deals_details->date_start->DropDownList = ewrpt_GetDistinctValues($deals_details->date_start->DateFilter, $wrkSql);\n\n\t\t// Field status\n\t\t$sSelect = \"SELECT DISTINCT rep.status FROM \" . $deals_details->SqlFrom();\n\t\t$sOrderBy = \"rep.status ASC\";\n\t\t$wrkSql = ewrpt_BuildReportSql($sSelect, $deals_details->SqlWhere(), \"\", \"\", $sOrderBy, $this->UserIDFilter, \"\");\n\t\t$deals_details->status->DropDownList = ewrpt_GetDistinctValues(\"\", $wrkSql);\n\t}", "public function getTagsValues() {}", "public function getTagsValues() {}", "public function getTagsValues() {}", "public function getTagsValues() {}", "private function access_keyword_event_list(){\n\t\t//$where_place = '(place = \\'tokyo\\' or k_desc2 like \\'%tokyo%\\') ';\n\t\t$where_place = $this->_get_where_place('tokyo');\n\t\tif (!empty($this->_place_name)) {\n\t\t\t$where_place = $this->_get_where_place($this->_place_name);\n\t\t}\n\t\t/*\n\t\tif (!empty($this->_config['calendar']['country_default']) && is_array($this->_config['calendar']['country_default'])) {\n\t\t\t$this->_checked_countryname = implode(',', $this->_config['calendar']['country_default']);\n\t\t}\n\t\tif (!empty($this->_config['calendar']['know_default']) && is_array($this->_config['calendar']['know_default'])) {\n\t\t\t$this->_checked_know = implode(',', $this->_config['calendar']['know_default']);\n\t\t}\n\t\t*/\n\t\t$index = 0;\n\t\t$country_defaults = array();\n\t\tforeach ($this->_config['calendar']['country_list'] as $one) {\n\t\t\tif ($one['default'] == 'on') {\n\t\t\t\t$country_defaults[] = $index;\n\t\t\t}\n\t\t\t$index++;\n\t\t}\n\t\t$this->_checked_countryname = implode(',', $country_defaults);\n\n\t\t$index = 0;\n\t\t$know_defaults = array();\n\t\tforeach ($this->_config['calendar']['know_list'] as $one) {\n\t\t\tif ($one['default'] == 'on') {\n\t\t\t\t$know_defaults[] = $index;\n\t\t\t}\n\t\t\t$index++;\n\t\t}\n\t\t$this->_checked_know = implode(',', $know_defaults);\n\n\t\t//$yy = date('Y');\n\t\t//$mm = date('n');\n\n\t\tif (isset($_GET['checked_countryname']))\n\t\t{\n\t\t\t$this->_checked_countryname = secure($_GET['checked_countryname']);\n\t\t\t$this->_checked_know = secure($_GET['checked_know']);\n\t\t}\n\n\t\tif (isset($this->_cookies) && $this->_cookies['place_name'] == $this->_place_name) {\n\t\t\t$where_place = $this->_get_where_place($this->_cookies['place_name']);\n\t\t}\n\n\t\t// USE ID/NUM DATE when we come from calendar module or banner id\n\t\tif (!empty($this->_num)) {\n\t\t\t$where_place = $this->_get_where_place($this->_selected_event_info['place']);\n\t\t}\n\n\t\t$where_country = ' ( 1=0';\n\t\t$where_know = ' ( 1=0';\n\n\t\tif (isset($_POST['place-name'])) {\n\t\t\t$this->_selected_day = $_POST['selected_day'];\n\t\t\t$this->_checked_countryname = $this->_checked_know = \"\";\n\n\t\t\t$num = 0;\n\t\t\tforeach ($_POST as $key => $val) {\n\t\t\t\tif (isset($_POST['country-' . $num])) {\n\t\t\t\t\t$this->_checked_countryname .= ',' . $num;\n\t\t\t\t}\n\n\t\t\t\tif (!empty($_POST['know-' . $num])) {\n\t\t\t\t\t$this->_checked_know .= ',' . $num;\n\t\t\t\t}\n\t\t\t\t$num++;\n\n\t\t\t\tif (mb_substr($key, 0, 5) == 'place') {\n\t\t\t\t\t$where_place = $this->_get_where_place($val);\n\t\t\t\t}\n\n\t\t\t\tif (mb_substr($key, 0, 7) == 'country') {\n\t\t\t\t\t//$where_country .= where_country($val);\n\t\t\t\t\t$where_country .= where_multiple($this->_config['calendar']['country_list'], $val);\n\t\t\t\t}\n\n\t\t\t\tif (mb_substr($key, 0, 4) == 'know') {\n\t\t\t\t\t//$where_know .= where_know($val);\n\t\t\t\t\t$where_know .= where_multiple($this->_config['calendar']['know_list'], $val);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//$yy = $_POST['year_date'];\n\t\t\t//$mm = $_POST['month_date'];\n\t\t} else {\n\t\t\t//$where_country .= where_country($this->_checked_countryname);\n\t\t\t//$where_know .= where_know($this->_checked_know);\n\t\t\t$where_country .= where_multiple($this->_config['calendar']['country_list'], $this->_checked_countryname);\n\t\t\t$where_know .= where_multiple($this->_config['calendar']['know_list'], $this->_checked_know);\n\t\t}\n\n\t\tif (isset($this->_cookies)) {\n\t\t\t$number_of_days_forward = 30;\n\t\t\t$cookie_date_days_added = date('Y-n-j', mktime(0, 0, 0, date('n'), (date('j')+$number_of_days_forward), date('Y')));\n\t\t\t//if use cookie at first\n\t\t\tif(empty($_POST['place-name']) && empty($_GET['navigation']))\n\t\t\t{\n\t\t\t\t//keep the same data for cookie when use cookie to display\n\t\t\t\t$array_cookie = array (\n\t\t\t\t\t'place_name' \t\t\t=> $this->_cookies['place_name'],\n\t\t\t\t\t'checked_countryname' \t=> $this->_cookies['checked_countryname'],\n\t\t\t\t\t'checked_know'\t\t\t=> $this->_cookies['checked_know'],\n\t\t\t\t\t'date'\t\t\t\t\t=> $cookie_date_days_added\n\t\t\t\t);\n\t\t\t\t//$this->_place_name = $this->_cookies['place_name'];\n\t\t\t} else {\n\t\t\t\t//set new data for cookie\n\t\t\t\t$array_cookie = array (\n\t\t\t\t\t'place_name' \t\t\t=> $this->_place_name,\n\t\t\t\t\t'checked_countryname' \t=> $this->_checked_countryname,\n\t\t\t\t\t'checked_know'\t\t\t=> $this->_checked_know,\n\t\t\t\t\t'date'\t\t\t\t\t=> $cookie_date_days_added\n\t\t\t\t);\n\t\t\t}\n\t\t\t$data_cookie = base64_encode(serialize($array_cookie));\n\t\t\tsetcookie(\"seminar_choice\", $data_cookie, time()+3600*24*30, \"/\"); //set cookie for 30 hours\n\t\t} else {\n\t\t\t$array_cookie = array (\n\t\t\t\t'place_name' \t\t\t=> $this->_place_name,\n\t\t\t\t'checked_countryname' \t=> $this->_checked_countryname,\n\t\t\t\t'checked_know'\t\t\t=> $this->_checked_know,\n\t\t\t\t'date'\t\t\t\t\t=> date('Y-n-j')\n\t\t\t);\n\t\t\t$data_cookie = base64_encode(serialize($array_cookie));\n\t\t\tsetcookie(\"seminar_choice\", $data_cookie, time()+60*60*24*30, \"/\"); //set cookie for 30 jours\n\t\t\t$this->_cookies = unserialize(base64_decode($_COOKIE['seminar_choice']));\n\t\t}\n\n\t\tif (isset($_GET['navigation'])) {\n\t\t\t$this->_selected_day = secure($_GET['day']);\n\t\t\t$where_place = $this->_get_where_place($this->_place_name);\n\t\t}\n\t\t$where_know .= ' ) ';\n\t\t$where_country .= ' ) ';\n\n\t\t$this->_keyword = \"\";\n\n\t\tif ($where_place != '') {\n\t\t\t$this->_keyword .= ' and ' . $where_place;\n\t\t}\n\t\tif ($where_country != ' ( 1=0 ) ') {\n\t\t\t$this->_keyword .= ' and ' . $where_country;\n\t\t}\n\t\tif ($where_know != ' ( 1=0 ) ') {\n\t\t\t$this->_keyword .= ' and ' . $where_know;\n\t\t}\n\n\t\tif (!empty($this->_config['calendar']['title'])) {\n\t\t\tif (is_array($this->_config['calendar']['title']))\t{\n\t\t\t\tforeach($this->_config['calendar']['title'] as $val)\t{\n\t\t\t\t\tif ($val <> '')\t{\n\t\t\t\t\t\t$this->_keyword .= ' and (k_title1 like \\'%' . $val . '%\\' or k_title2 like \\'%' . $val . '%\\' or k_desc1 like \\'%' . $val . '%\\' or k_desc2 like \\'%' . $val . '%\\')';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->_keyword .= ' and (k_title1 like \\'%' . $this->_config['calendar']['title'] . '%\\' or k_title2 like \\'%' . $this->_config['calendar']['title'] . '%\\' or k_desc1 like \\'%' . $this->_config['calendar']['title'] . '%\\' or k_desc2 like \\'%' . $this->_config['calendar']['title'] . '%\\')';\n\t\t\t}\n\t\t}\n\t\tif (!empty($this->_config['calendar']['title2'])) {\n\t\t\tif (is_array($this->_config['calendar']['title2']))\t{\n\t\t\t\t$this->_keyword .= ' and ( 1 = 0 ';\n\t\t\t\tforeach($this->_config['calendar']['title2'] as $val)\t{\n\t\t\t\t\tif ($val <> '')\t{\n\t\t\t\t\t\t$this->_keyword .= ' or (k_title1 like \\'%' . $val . '%\\' or k_title2 like \\'%' . $val . '%\\' or k_desc1 like \\'%' . $val . '%\\' or k_desc2 like \\'%' . $val . '%\\')';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->_keyword .= ' ) ';\n\t\t\t}else{\n\t\t\t\t$this->_keyword .= ' and (k_title1 like \\'%' . $this->_config['calendar']['title2'] . '%\\' or k_title2 like \\'%' . $this->_config['calendar']['title2'] . '%\\' or k_desc1 like \\'%' . $this->_config['calendar']['title2'] . '%\\' or k_desc2 like \\'%' . $this->_config['calendar']['title2'] . '%\\')';\n\t\t\t}\n\t\t}\n\t\tif (!empty($this->_config['calendar']['keyword'])) {\n\t\t\tif (is_array($this->_config['calendar']['keyword']))\t{\n\t\t\t\tforeach($this->_config['calendar']['keyword'] as $val)\t{\n\t\t\t\t\tif ($val <> '')\t{\n\t\t\t\t\t\t$this->_keyword .= ' and (k_desc2 like \\'%' . $val . '%\\')';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$this->_keyword .= ' and (k_desc2 like \\'%' . $this->_config['calendar']['keyword'] . '%\\')';\n\t\t\t}\n\t\t}\n\t\tif (!empty($this->_config['calendar']['keyword2'])) {\n\t\t\tif (is_array($this->_config['calendar']['keyword2']))\t{\n\t\t\t\t$this->_keyword .= 'and ( 1 = 0 ';\n\t\t\t\tforeach($this->_config['calendar']['keyword2'] as $val)\t{\n\t\t\t\t\tif ($val <> '')\t{\n\t\t\t\t\t\t$this->_keyword .= ' or (k_desc2 like \\'%' . $val . '%\\')';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->_keyword .= ' ) ';\n\t\t\t}else{\n\t\t\t\t$this->_keyword .= ' and (k_desc2 like \\'%' . $this->_config['calendar']['keyword'] . '%\\')';\n\t\t\t}\n\t\t}\n\n\t\tif (!empty($this->_config['start_date'])) {\n\t\t\t$this->_keyword .= ' and \\'' . $this->_config['start_date'] . '\\' <= hiduke ';\n\t\t}\n\t\tif (!empty($this->_config['end_date'])) {\n\t\t\t$this->_keyword .= ' and hiduke <= \\'' . $this->_config['end_date'] . '\\' ';\n\t\t}\n\t\treturn $this->_keyword;\n\t}", "public function getCustomEventTypeAllowableValues()\n {\n return [\n self::CUSTOM_EVENT_TYPE_ADD_TO_CART,\n self::CUSTOM_EVENT_TYPE_REMOVE_FROM_CART,\n self::CUSTOM_EVENT_TYPE_CHECKOUT,\n self::CUSTOM_EVENT_TYPE_CHECKOUT_OPTION,\n self::CUSTOM_EVENT_TYPE_CLICK,\n self::CUSTOM_EVENT_TYPE_VIEW_DETAIL,\n self::CUSTOM_EVENT_TYPE_PURCHASE,\n self::CUSTOM_EVENT_TYPE_REFUND,\n self::CUSTOM_EVENT_TYPE_PROMOTION_VIEW,\n self::CUSTOM_EVENT_TYPE_PROMOTION_CLICK,\n self::CUSTOM_EVENT_TYPE_ADD_TO_WISHLIST,\n self::CUSTOM_EVENT_TYPE_REMOVE_FROM_WISHLIST,\n self::CUSTOM_EVENT_TYPE_IMPRESSION,\n ];\n }", "public function getNewTags()\n\t{\n\t\treturn array_diff($this->getValue(), $this->suggest);\n\t}", "protected function valueSuggestQuery(string $value, string $datatype, array $params = [], int $loop = 0): ?array\n {\n // and has few credits for all module users.\n if ($datatype === 'valuesuggest:geonames:geonames') {\n return $this->valueSuggestQueryGeonames($value, $datatype, $params);\n }\n if (in_array($datatype, [\n // Fake data type: person or corporation (or conference here).\n 'valuesuggest:idref:author',\n 'valuesuggest:idref:person',\n 'valuesuggest:idref:corporation',\n 'valuesuggest:idref:conference',\n ])) {\n return $this->valueSuggestQueryIdRefAuthor($value, $datatype, $params);\n }\n if ($datatype === 'valuesuggest:idref:rameau') {\n return $this->valueSuggestQueryIdRefRameau($value, $datatype, $params);\n }\n\n /** @var \\ValueSuggest\\Suggester\\SuggesterInterface $suggesters */\n static $suggesters = [];\n // static $lang;\n\n if (!isset($suggesters[$datatype])) {\n $suggesters[$datatype] = $this->getServiceLocator()->get('Omeka\\DataTypeManager')\n ->get($datatype)\n ->getSuggester();\n\n // $lang = $this->getParam('language');\n }\n\n try {\n $suggestions = $suggesters[$datatype]->getSuggestions($value);\n } catch (HttpExceptionInterface $e) {\n // Since the exception can occur randomly, a second query is done.\n if ($loop < 1) {\n sleep(10);\n return $this->valueSuggestQuery($value, $datatype, $params, ++$loop);\n }\n // Allow to continue next processes.\n $this->logger->err(\n 'Connection issue: {exception}', // @translate\n ['exception' => $e]\n );\n return null;\n }\n\n return is_array($suggestions)\n ? $suggestions\n : [];\n }", "protected static function get_interaction_descriptions() {\n return array(\n 'Shadow' => 'Dice with both Shadow and Stinger skills can singly attack with any value from the min to ' .\n 'the max of the die (making a shadow attack against a die whose value is greater than or ' .\n 'equal to their own, or a skill attack against a die whose value is lower than or equal to ' .\n 'their own)',\n );\n }", "protected static function get_interaction_descriptions() {\n return array(\n 'Konstant' => 'Dice with both Konstant and Ornery skills retain their current value when rerolled',\n 'Mad' => 'Dice with both Ornery and Mad Swing have their sizes randomized during ornery rerolls',\n 'Mood' => 'Dice with both Ornery and Mood Swing have their sizes randomized during ornery rerolls',\n );\n }", "public static function getSummaryAttributes()\n {\n return array(\n 'id' => array(\n 'name' => 'id',\n 'display' => 'ID',\n 'type' => 'numeric',\n 'link' => 'endpoint',\n ),\n 'event_id' => array(\n 'name' => 'event_id',\n 'display' => 'Event ID',\n 'type' => 'numeric',\n 'hide' => 'all',\n 'link' => 'endpoint2',\n ),\n 'event_start' => array(\n 'name' => 'event_start',\n 'display' => 'Event Start',\n 'type' => 'numeric',\n ),\n 'arena' => array(\n 'name' => 'arena',\n 'display' => 'Arena',\n 'type' => 'alpha',\n 'hide' => 'phone,tablet',\n ),\n 'arena_id' => array(\n 'name' => 'arena_id',\n 'display' => 'Arena ID',\n 'type' => 'numeric',\n 'hide' => 'all',\n 'link' => 'endpoint3',\n ),\n 'location' => array(\n 'name' => 'location',\n 'display' => 'Location',\n 'type' => 'alpha',\n 'hide' => 'phone,tablet',\n ),\n 'location_id' => array(\n 'name' => 'location_id',\n 'display' => 'Location ID',\n 'type' => 'numeric',\n 'hide' => 'all',\n 'link' => 'endpoint4',\n ),\n 'requester_name' => array(\n 'name' => 'requester_name',\n 'display' => 'Requested By',\n 'type' => 'alpha',\n 'hide' => 'phone',\n ),\n 'created_on' => array(\n 'name' => 'created_on',\n 'display' => 'Requested On',\n 'type' => 'alpha',\n 'hide' => 'phone',\n ),\n 'acknowledged_by' => array(\n 'name' => 'acknowledged_by',\n 'display' => 'Acknowledged By',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'acknowledged_on' => array(\n 'name' => 'acknowledged_on',\n 'display' => 'Acknowledged On',\n 'type' => 'numeric',\n 'hide' => 'all'\n ),\n 'accepted_by' => array(\n 'name' => 'accepted_by',\n 'display' => 'Accepted By',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'accepted_on' => array(\n 'name' => 'accepted_on',\n 'display' => 'Accepted On',\n 'type' => 'numeric',\n 'hide' => 'all'\n ),\n 'rejected_by' => array(\n 'name' => 'rejected_by',\n 'display' => 'Rejected By',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'rejected_on' => array(\n 'name' => 'rejected_on',\n 'display' => 'Rejected On',\n 'type' => 'numeric',\n 'hide' => 'all'\n ),\n 'rejected_reason' => array(\n 'name' => 'rejected_reason',\n 'display' => 'Rejection Reason',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'notes' => array(\n 'name' => 'notes',\n 'display' => 'Notes',\n 'type' => 'alpha',\n 'hide' => 'all'\n ),\n 'type' => array(\n 'name' => 'type',\n 'display' => 'Type',\n 'type' => 'alpha',\n ),\n 'status' => array(\n 'name' => 'status',\n 'display' => 'Status',\n 'type' => 'alpha',\n ),\n );\n }", "public function dataProvider_for_createCalendarEvent()\n {\n return [\n 'not_recurring' => [\n [\n 'title' => str_random(16),\n 'start_datetime' => Carbon::parse('2017-08-25 10:00:00'),\n 'end_datetime' => Carbon::parse('2017-08-25 12:00:00'),\n 'description' => str_random(32),\n 'is_recurring' => false,\n 'is_public' => true,\n ],\n ],\n 'recurring' => [\n [\n 'title' => str_random(16),\n 'start_datetime' => Carbon::parse('2017-08-25 10:00:00'),\n 'end_datetime' => Carbon::parse('2017-08-25 12:00:00'),\n 'description' => str_random(32),\n 'is_recurring' => true,\n 'frequence_number_of_recurring' => 1,\n 'frequence_type_of_recurring' => RecurringFrequenceType::WEEK,\n 'is_public' => true,\n ],\n ],\n ];\n }", "private function getSuggestions()\n {\n $category = $this->nodeStorage->load($this->categoryId);\n $secondaryTagIds = $this->getTagIds($category->field_moj_secondary_tags);\n $matchingIds = array_unique($this->getSecondaryTagItemsFor($secondaryTagIds));\n\n if (count($matchingIds) < $this->numberOfResults) {\n $matchingSecondaryTagIds = $this->getAllSecondaryTagItemsFor($secondaryTagIds);\n $matchingIds = array_unique(array_merge($matchingIds, $matchingSecondaryTagIds));\n }\n\n if (count($matchingIds) < $this->numberOfResults) {\n $primaryTagIds = $this->getTagIds($category->field_moj_top_level_categories);\n $matchingPrimaryTagIds = $this->getPrimaryTagItemsFor($primaryTagIds);\n $matchingIds = array_unique(array_merge($matchingIds, $matchingPrimaryTagIds));\n }\n\n $categoryIdIndex = array_search($this->categoryId, $matchingIds);\n\n if ($categoryIdIndex !== false) {\n unset($matchingIds[$categoryIdIndex]);\n }\n\n return $this->loadNodesDetails(array_slice($matchingIds, 0, $this->numberOfResults));\n }", "function suggest()\n {\n // allow parallel searchs to improve performance.\n session_write_close();\n $suggestions = $this->Item->get_manage_items_search_suggestions($this->input->get('term'), 100);\n echo json_encode($suggestions);\n }", "private static function get_events() {\n\t\treturn array(\n\t\t\t'formidable_send_usage' => 'weekly',\n\t\t);\n\t}", "public function getSuggestions()\n {\n return $this->suggestions;\n }", "public function getSuggestions()\n {\n return $this->suggestions;\n }", "public function getSuggestions()\n {\n return $this->suggestions;\n }", "function suggest()\n\t{\n\t\t//allow parallel searchs to improve performance.\n\t\tsession_write_close();\n\t\t$params = $this->session->userdata('price_rules_search_data') ? $this->session->userdata('price_rules_search_data') : array('deleted' => 0);\n\t\t$suggestions = $this->Price_rule->get_search_suggestions($this->input->get('term'),$params['deleted'],100);\n\t\techo json_encode(H($suggestions));\n\t}", "public function getEventInfos() {\n // today will be useful \n $today = new \\DateTime(\"today midnight\");\n \n // get all events\n $events = $this->_machine->plugin(\"DB\")->getEventsFromDB(\"AND events.active = 1\");\n \n // retrieve dates with events\n $dates = [];\n foreach ($events as $ev) {\n $from = new \\DateTimeImmutable($ev[\"time_from\"]);\n $to = new \\DateTimeImmutable($ev[\"time_to\"]);\n $date = $from;\n while ($date <= $to) {\n $dates = $this->_insertDate($dates, $date);\n $date = $date->modify(\"+1 day\");\n }\n }\n \n // retrieve events for today\n $today_events = $this->getEventsForRange(\n $today, $today\n );\n \n // retrieve events for next weekend\n $next_weekend_events = $this->getNextWeekendEvents();\n\n $result = [\n \"tot\" => count($events),\n \"dates\" => $dates,\n \"today\" => $today_events,\n \"next_weekend\" => $next_weekend_events,\n \"events\" => $events\n ];\n \n return $result;\n }", "public function autocompleteTag(Request $request) {\n $matches = [];\n $string = $request->query->get('q');\n // Get matches from default views.\n $views = $this->entityTypeManager()->getStorage('view')->loadMultiple();\n // Keep track of previously processed tags so they can be skipped.\n $tags = [];\n foreach ($views as $view) {\n $view_tag = $view->get('tag');\n foreach (Tags::explode($view_tag) as $tag) {\n if ($tag && !in_array($tag, $tags, TRUE)) {\n $tags[] = $tag;\n if (mb_stripos($tag, $string) !== FALSE) {\n $matches[] = ['value' => $tag, 'label' => Html::escape($tag)];\n if (count($matches) >= 10) {\n break 2;\n }\n }\n }\n }\n }\n\n return new JsonResponse($matches);\n }", "public function getAuditEvents(): array\n {\n return DB::table('audits')\n ->select('event')\n ->distinct('event')\n ->pluck('event')\n ->transform(function($item) {\n return [\n 'key' => $item,\n 'value' => array_key_exists($item, trans('tags')) ? trans('tags.'.$item) : $item,\n ];\n\n })\n ->toArray();\n }", "public function getAutocomplete()\n {\n // get a suggester query instance\n $query = $this->client->createSuggester();\n $query->setQuery(strtolower(Input::get('term')));\n $query->setDictionary('suggest');\n $query->setOnlyMorePopular(true);\n $query->setCount(10);\n $query->setCollate(true);\n\n // this executes the query and returns the result\n $resultset = $this->client->suggester($query);\n\n $suggestions = array();\n\n foreach ($resultset as $term => $termResult) {\n foreach ($termResult as $result) {\n $suggestions[] = $result;\n }\n }\n\n return Response::json($suggestions);\n }", "public function eventsGetEventTypes()\n {\n //check or get oauth token\n OAuthManager::getInstance()->checkAuthorization();\n\n //the base uri for api requests\n $_queryBuilder = Configuration::getBaseUri();\n \n //prepare query string for API call\n $_queryBuilder = $_queryBuilder.'/notification/events/types';\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl($_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => 'ApiMatic-RestClient-2018-5-18 Sdk-Langauge:PHP',\n 'Accept' => 'application/json',\n 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken)\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::GET, $_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::get($_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 $mapper = $this->getJsonMapper();\n\n return $mapper->mapClass($response->body, 'IdfyLib\\\\Models\\\\EventTypeInfo');\n }", "public function valueProvider(): array\n {\n return [\n 'Not supported type triggers exception' => [\n 'foobar',\n true,\n ],\n 'Restrict by Municipality name' => [\n RestrictByTypeFilter::MUNICIPALITY_NAME,\n false,\n ],\n 'Restrict by Street name' => [\n RestrictByTypeFilter::STREETNAME,\n false,\n ],\n 'Restrict by House number' => [\n RestrictByTypeFilter::HOUSENUMBER,\n false,\n ],\n ];\n }", "public function getHistoryEventDescriptionData()\n {\n return array(\n 'trx_method' => static::t($this->getPaymentMethod()->getName()),\n 'trx_type' => static::t($this->getType()),\n 'trx_value' => $this->getOrder()->getCurrency()->roundValue($this->getValue()),\n 'trx_status' => static::t($this->getReadableStatus()),\n );\n }", "private function getAppMentionEventData(): array {\n return [\n 'type' => 'app_mention',\n 'user' => 'W021FGA1Z',\n 'text' => 'You can count on <@U0LAN0Z89> for an honorable mention.',\n 'ts' => '1515449483.000108',\n 'channel' => 'C0LAN2Q65',\n 'event_ts' => '1515449483000108',\n ];\n }", "function getDropifiedEvents($order_events){\n \n $fulfillments_ids = array();\n foreach($order_events['events'] as $event){\n if($event['subject_type'] == 'Order' &&\n $event['author'] == 'Dropified (formerly Shopified App)'&& \n $event['verb'] == 'fulfillment_success'){\n array_push($fulfillments_ids,$event['arguments'][0]);\n }\n }\n return $fulfillments_ids;\n}", "function list_searcheable_acf(){\n $list_searcheable_acf = array(\"google_description\");\n return $list_searcheable_acf;\n}", "public function suggest($count = 1) {\n\n $person = $this->randomItem('Tim Berners-Lee', 'Super Mario', 'Jean-Michel Basquiat', 'Levon Helm', 'Barack Obama', 'Shigeru Miyamoto', 'Eero Aarnio', 'Martin Scorsese', 'Twyla Tharp', 'Edward Tufte');\n\n $safePlaces = array('104 Franklin Street, NYC', 'Grand Central Station', 'Corsica', 'Geneva', 'Portland', 'Tokyo', 'Atlantis', 'Waldo', 'Hot Coffee');\n\n $allPlaces = array_merge($safePlaces, array('Dublin', 'Heaven on Earth'));\n\n $things = array('3d printer', 'planet', 'goat', 'raccoon', 'computer program', 'skyscraper', 'data visualization', 'double-neck guitar', 'vinyl record', 'pdp-11', 'Baobab Tree', 'large hadron collider');\n\n $thingsIncludingIrregulars = array_merge($things, array('arcade game', 'salmon', 'javascript', 'zorbing', 'democracy', 'ARP 2600', 'IBM 701'));\n\n $resourceSearch = $this->randomItem('Find me', 'Search for', 'Get me', 'Run a search for', 'Look for', 'Find');\n\n $randomTypes = array_keys($this->_resourceTypes);\n\n $suggestions = array();\n\n $suggestionCases = array();\n\n for($i = 0; $i < $count; $i++) {\n\n shuffle($randomTypes);\n $type = $randomTypes[0];\n if($type == 'searchImages') {\n $preposition = $this->randomItem('of', 'with');\n } else {\n $preposition = $this->randomItem('of', 'about', 'with');\n }\n if($type == 'searchTweets') {\n $type = \"tweets\"; // No other dignified synonyms\n } else {\n $type = $this->randomItem($this->_resourceTypes[$type]) . 's';\n }\n\n // Don't repeat suggestion types until we have to\n if(count($suggestionCases) < 1) {\n $suggestionCases = range(0, 6);\n }\n shuffle($suggestionCases);\n $suggestionCase = array_shift($suggestionCases);\n\n switch($suggestionCase) {\n case 0:\n $thing = $this->randomItem($things) . 's';\n $number = $this->randomItem('two', 'three', 'four', 'five', 'ten', 'twenty', 'some', 'all the');\n $suggestions[] = implode(' ', array($resourceSearch, $number, $type, $preposition, $thing)) . '.';\n break;\n case 1:\n $thing = $this->randomItem($thingsIncludingIrregulars);\n $number = rand(2, 20);\n $suggestions[] = implode(' ', array($resourceSearch, $number, $thing, $type)) . '.';\n break;\n case 2:\n $suggestions[] = $this->randomItem(\"Define \" . $this->randomItem($thingsIncludingIrregulars) . \".\", \"What is a \" . $this->randomItem($things) . \"?\");\n break;\n case 3:\n $suggestions[] = $this->randomItem('Where is ', 'Where can I find ', 'Locate ') . $this->randomItem($allPlaces) . '?';\n break;\n case 4:\n $suggestions[] = $this->randomItem('Who is ', 'Do you know ') . $person . '?';\n break;\n case 5:\n $suggestions[] = $this->randomItem('How can I ', 'Where can I ') . $this->randomItem('help ', 'donate to ') . $this->randomItem('schools', 'kids', 'teachers') . '?';\n break;\n case 6:\n $suggestions[] = $this->randomItem('Is it safe in', 'Am I safe in', 'How safe is it in') . ' ' . $this->randomItem($safePlaces) . '?';\n }\n }\n return count($suggestions) == 1 ? $suggestions[0] : $suggestions;\n }", "public function getEventNameAllowableValues()\n {\n return [\n self::EVENT_NAME_EMAIL_RECEIVED,\n self::EVENT_NAME_NEW_EMAIL,\n self::EVENT_NAME_NEW_CONTACT,\n self::EVENT_NAME_NEW_ATTACHMENT,\n self::EVENT_NAME_EMAIL_OPENED,\n self::EVENT_NAME_EMAIL_READ,\n self::EVENT_NAME_DELIVERY_STATUS,\n self::EVENT_NAME_BOUNCE,\n self::EVENT_NAME_BOUNCE_RECIPIENT,\n self::EVENT_NAME_NEW_SMS,\n ];\n }", "public function dataProvider_for_generateNextCalendarEvent_notGenerated()\n {\n return [\n [\n [\n 'title' => str_random(16),\n 'start_datetime' => Carbon::parse('2017-08-29 10:00:00'),\n 'end_datetime' => Carbon::parse('2017-08-29 11:00:00'),\n 'description' => str_random(32),\n 'is_recurring' => true,\n 'frequence_number_of_recurring' => 1,\n 'frequence_type_of_recurring' => RecurringFrequenceType::WEEK,\n 'is_public' => true,\n 'end_of_recurring' => '2017-09-04',\n ],\n ],\n [\n [\n 'title' => str_random(16),\n 'start_datetime' => Carbon::parse('2017-08-29 10:00:00'),\n 'end_datetime' => Carbon::parse('2017-08-29 11:00:00'),\n 'description' => str_random(32),\n 'is_recurring' => false,\n 'is_public' => true,\n ],\n ],\n ];\n }", "public function getEventDescription() {\n\t\treturn ($this->eventDescription);\n\t}", "public function getEventTypeAllowableValues()\n {\n return [\n self::EVENT_TYPE_ACCOUNT_CONFIRMED,\n self::EVENT_TYPE_UNKNOWN_ERROR,\n self::EVENT_TYPE_FILE_ERROR,\n self::EVENT_TYPE_SIGN_URL_INVALID,\n self::EVENT_TYPE_SIGNATURE_REQUEST_VIEWED,\n self::EVENT_TYPE_SIGNATURE_REQUEST_SIGNED,\n self::EVENT_TYPE_SIGNATURE_REQUEST_SENT,\n self::EVENT_TYPE_SIGNATURE_REQUEST_ALL_SIGNED,\n self::EVENT_TYPE_SIGNATURE_REQUEST_EMAIL_BOUNCE,\n self::EVENT_TYPE_SIGNATURE_REQUEST_REMIND,\n self::EVENT_TYPE_SIGNATURE_REQUEST_INCOMPLETE_QES,\n self::EVENT_TYPE_SIGNATURE_REQUEST_DESTROYED,\n self::EVENT_TYPE_SIGNATURE_REQUEST_CANCELED,\n self::EVENT_TYPE_SIGNATURE_REQUEST_DOWNLOADABLE,\n self::EVENT_TYPE_SIGNATURE_REQUEST_DECLINED,\n self::EVENT_TYPE_SIGNATURE_REQUEST_REASSIGNED,\n self::EVENT_TYPE_SIGNATURE_REQUEST_INVALID,\n self::EVENT_TYPE_SIGNATURE_REQUEST_PREPARED,\n self::EVENT_TYPE_SIGNATURE_REQUEST_EXPIRED,\n self::EVENT_TYPE_TEMPLATE_CREATED,\n self::EVENT_TYPE_TEMPLATE_ERROR,\n self::EVENT_TYPE_CALLBACK_TEST,\n ];\n }", "private function getPublisherDataList(string $value)\n {\n $ph = new PublisherDBHandler();\n $dl = $ph->getWithLike($value);\n foreach ($dl as $key => $value) {\n $dl[$key] = $value['name'];\n }\n throw new HttpResponseTriggerException(true, $dl);\n }", "function suggest()\n\t{\n\t\t$suggestions = $this->Giftcard->get_search_suggestions($this->input->post('q'),$this->input->post('limit'));\n\t\techo implode(\"\\n\",$suggestions);\n\t}", "public function getGroupsOptions()\n {\n return array(\n 'compulsory' => array(\n array('name' => 'Run Subtitle Spell Check before delivery', 'description' => 'Run Subtitle Spell Check before delivery', 'notice' => 'STOPPER'),\n array('name' => 'Run Subtitle Quality Check (SQC) before delivery', 'description' => 'Run Subtitle Quality Check (SQC) before delivery', 'notice' => 'STOPPER'),\n array('name' => 'Identical Narrative as in English template found', 'description' => 'When the text in the translate file is identical to the English template', 'notice' => 'STOPPER'),\n array('name' => 'Allow Empty Boxes', 'description' => 'Allow users to deliver file with empty boxes (boxes not containing any text)', 'notice' => 'STOPPER'),\n array('name' => 'Maximum Lines Per Box', 'description' => 'The maximum lines allowed in one box', 'notice' => 'STOPPER'),\n array('name' => 'Maximum Characters Per Line (Horizontal, Vertical)', 'description' => 'The maximum number of characters allowed per (horizontal, vertical) line', 'notice' => 'STOPPER'),\n array('name' => 'Main Title tag required', 'description' => 'The main title has not been tagged with a Main Title tag', 'notice' => 'STOPPER'),\n array('name' => 'Non-standard apostrophe used at position (pos)', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'English template revision not acknowledged', 'description' => 'English template revision is not reviewed by a language user by clicking on the blinking red alarm clock', 'notice' => 'STOPPER'),\n array('name' => 'Minimum Box Duration', 'description' => 'The shortest duration allowed for a box. In frames or seconds', 'notice' => 'STOPPER'),\n array('name' => 'Maximum Box Duration', 'description' => 'The longest duration allowed for a box. In frames or seconds', 'notice' => 'STOPPER'),\n array('name' => 'Allow Box Overlap', 'description' => 'Allow users to deliver overlapping boxes', 'notice' => 'STOPPER'),\n array('name' => 'Floating captions found', 'description' => 'Allow caption to touch top or bottom', 'notice' => 'STOPPER'),\n array('name' => 'Teletext Character Set Only', 'description' => 'This is a special requirement for teletext deliveries as this format has restrictions on the characters allowed', 'notice' => 'STOPPER'),\n array('name' => 'Box start time is equal / exceeds its end time', 'description' => 'Timing discrepancy when a file has been imported into the system where the start timecode of a box can be greater than the end timecode of the box', 'notice' => 'STOPPER'),\n array('name' => 'Chapter stop overlaps with subtitle', 'description' => '', 'notice' => 'STOPPER'),\n ),\n \n 'spec' => array(\n array('name' => 'Maximum Lines Per Box', 'description' => 'The maximum lines allowed in one box', 'notice' => 'STOPPER'),\n array('name' => 'Minimum Frame Gap Between Boxes', 'description' => 'Minimal gap allowed between boxes. In frames or seconds', 'notice' => 'STOPPER'),\n array('name' => 'Frame gap violation between consecutive boxes found', 'description' => 'This puts restrictions on the frame gaps allowed between boxes. This is meant to disallow small gaps (under 1 second) between consecutive boxes, a special requirement. Example: 3f;1s mean that gap >= 3 frames and < 1 second not allowed', 'notice' => 'STOPPER'),\n array('name' => 'Allow Italics', 'description' => 'Are italics allowed?', 'notice' => 'STOPPER'),\n array('name' => 'Forced', 'description' => 'Allow Burned-in tag?', 'notice' => 'STOPPER'),\n array('name' => 'Only one sentence per box is allowed', 'description' => 'Only one sentence per subtitle is permitted', 'notice' => 'STOPPER'),\n array('name' => 'Text-heavy box found', 'description' => 'When too much text is present in a box as opposed to the box duration, readability gets affected', 'notice' => 'STOPPER'),\n ),\n \n 'compliance' => array(\n array('name' => 'Rating Allowed', 'description' => 'Is a rating allowed?', 'notice' => 'STOPPER'),\n array('name' => 'Translator Credit Allowed', 'description' => 'Is the translator credit allowed?', 'notice' => 'STOPPER'),\n array('name' => 'Disallowed characters found at start of subtitle', 'description' => 'Subtitle cannot start with any of the entered chars. Input chars as a string, without separators', 'notice' => 'STOPPER'),\n ),\n \n 'special' => array(\n array('name' => 'Allowable unedited auto-translation limit', 'description' => 'This special limit is set for translate jobs to define maximum allowable unedited auto translation in percents', 'notice' => 'STOPPER'),\n array('name' => 'Consecutive text-heavy 2-line subtitle found', 'description' => 'The maximum number of consecutive 2 line subs. Should be more than 1 or Disabled(-1). This is special requirement meant to discourage consecutive text heavy boxes', 'notice' => 'STOPPER'),\n array('name' => 'Space After Hypens Between Words', 'description' => 'Checks for space after or before a hyphen between two words. This is meant for a specific captioning requirement', 'notice' => 'STOPPER'),\n array('name' => 'Do Not Allow \"#\" Symbol', 'description' => 'This prevents users from delivering a file containing the pound symbol. This is a special requirement by some clients or file types', 'notice' => 'STOPPER'),\n array('name' => 'Space After Double Chevron', 'description' => 'Requires a space after a double hyphen. This is meant for specific French captioning requirements', 'notice' => 'STOPPER'),\n array('name' => 'Space After Hyphens', 'description' => 'Set a required space after speaker hyphen. This is meant for a specific captioning requirement', 'notice' => 'STOPPER'),\n array('name' => 'Speaker Hyphens style', 'description' => 'Set a required speaker hyphen style. This is meant for a specific captioning requirement', 'notice' => 'STOPPER'),\n array('name' => 'Disallowed characters found in subtitle', 'description' => 'Subtitle cannot contain any of entered chars. Input chars as a string, without separators', 'notice' => 'STOPPER'),\n array('name' => 'Text contains invalid XML characters', 'description' => '', 'notice' => 'STOPPER'),\n ),\n \n 'captions' => array(\n array('name' => 'Allow 32 Character Lines With Italics', 'description' => 'Is it possible to add 32 character line with italics?', 'notice' => 'STOPPER'),\n array('name' => 'Sound Cue Format', 'description' => 'Examples: \"[music]\", \"(MUSIC)\", ...', 'notice' => 'STOPPER'),\n ),\n \n 'other' => array( \n array('name' => 'Possible acronym should be written without periods and spaces', 'description' => '', 'notice' => 'NOTICE'),\n array('name' => 'Possible acronym should be written without accents', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Semicolon should be removed', 'description' => 'This is one of the SDH system checks only for LAS language', 'notice' => 'STOPPER'),\n array('name' => 'Continuity ellipsis at the end of the box should be removed', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Extra punctuation found', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Double quotation marks should be written without spaces', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Period should be written after a closing quote', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Song box should be fully italicized', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Song box punctuation: only question and exclamation marks allowed at the end of line', 'description' => '', 'notice' => 'STOPPER'), \n array('name' => 'Song box is not translated. Please OMIT box because translation is not required', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Unallowable forward slash in dialog', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'HBO prohibited words', 'description' => 'Prevents the user from delivering a file containing some predefined words: \"A Em Por\", \"Até Entre Porém\", \"Ao Entretanto Quando\", \"Após Lhe Que\", \"Com Uma Se\", \"Como Me Sem\", \"Contudo Nos Sob\", \"Da O Sobre\", \"De Ou Te\", \"Desde Para Todavia\", \"Do Perante Vos\", \"E Pois\". This is a special requirement by some clients or file types', 'notice' => 'STOPPER'),\n array('name' => 'Do Not Allow \"$\" At The Beginning Of Sentence', 'description' => 'This prevents users from delivering a file containing the \"$\" symbol. This is a special requirement by some clients or file types', 'notice' => 'STOPPER'),\n array('name' => 'Positioning not allowed for this overlapped subtitle', 'description' => 'Positioning not allowed for particular overlapped subtitle. (For Japanese only)', 'notice' => 'STOPPER'),\n array('name' => 'Text casing does not match source', 'description' => '', 'notice' => 'NOTICE'),\n array('name' => 'Acceptance suggestion is unresolved', 'description' => 'Flagged for all boxes which are not accepted or declined by the QAer', 'notice' => 'STOPPER'),\n array('name' => 'Text alignment not permitted as per spec', 'description' => 'When text alignment does not match what is in the delivery specs', 'notice' => 'STOPPER'),\n array('name' => 'BRP Disallowed End Words', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'BRP Disallowed Start Words', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Text found on the first cell of the first gridline', 'description' => 'Text resting on the first cell of the first gridline.(i.e. position 0,0) (For CC mode only)', 'notice' => 'NOTICE'),\n array('name' => 'File should contain an EMPTY first box', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Single quaver box should be min 5 secs long and have min 1 sec gap after it', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Italics or Underline found within word', 'description' => 'When italics or underline tags are found inside words. (For CC mode only)', 'notice' => 'STOPPER'), \n array('name' => 'Enter some note for the box with error type: Translation (objective/subjective)', 'description' => 'It forces a QA user to input a note if box error type is Translation: objective/subjective. (For Netflix client only)', 'notice' => 'STOPPER'),\n array('name' => 'Incorrect text formatting (&#60;HTML&#62;|&#60;P&#62;)', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Alignment / Positioning does not match source', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Box should be removed (omitted) according to the \"Texted\" delivery format', 'description' => '', 'notice' => 'NOTICE'),\n array('name' => 'Stand-alone punctuation present', 'description' => 'When any box in a file has only punctuation and no text in it', 'notice' => 'STOPPER'),\n array('name' => 'Double space found at line #(number)', 'description' => '', 'notice' => 'STOPPER'),\n array('name' => 'Error type is not chosen', 'description' => 'When a QAer makes a change but does not select an error category', 'notice' => 'STOPPER'),\n ),\n );\n }", "public function description()\n\t{\n\t\t$txt = array();\n\t\t$txt['wiki'] = \"Displays group events\";\n\t\t$txt['html'] = '<p>Displays group events.</p>';\n\t\t$txt['html'] = '<p>Examples:</p>\n\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t<li><code>[[Groupevent(number=3)]]</code> - Displays the next three group events</li>\n\t\t\t\t\t\t\t\t<li><code>[[Groupevent(title=Group Events, number=2)]]</code> - Adds title above event list. Displays 2 events.</li>\n\t\t\t\t\t\t\t\t<li><code>[[Groupevent(id=123)]]</code> - Displays single group event with ID # 123</li>\n\t\t\t\t\t\t\t</ul>';\n\t\treturn $txt['html'];\n\t}", "private function filterEvents( $filter_string , $events ){\n\t\t$filters = explode(',' , $filter_string );\n\n\t\t$events_filtered = array();\n\t\tforeach ($events as $event) {\n\t\t\tif(isset($event['original']))\n\t\t\t\t$event_text = $event['original'];\n\t\t\telse\n\t\t\t\t$event_text = $event['summary'];\n\t\t\t$fits = FALSE;\n\t\t\tforeach( $filters as $filter ){\n\t\t\t\t$filter_without_semicolons = str_replace([' :',':'], '', $filter );\n\n\t\t\t\tif(stristr($event_text,$filter) || stristr(str_replace(' :',':',$event_text), $filter) || strtolower(substr(trim($event_text), 0, strlen($filter_without_semicolons))) === strtolower($filter_without_semicolons) ){\n\t\t\t\t\t// stripping the category from the title\n\t\t\t\t\t$prefixes = [ $filter , str_replace(':',' :',$filter) ];\n\t\t\t\t\tforeach($prefixes as $prefix){\n\t\t\t\t\t\tif (substr(strtolower($event_text), 0, strlen($prefix)) == strtolower($prefix)) {\n \t\t\t\t\t\t// $event_text = substr($event_text, strlen($prefix));\n \t\t\t\t\t\t// $event['category'] = str_replace(':','',strtolower($prefix));\n \t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// echo 'fits filter '.$filter.'<br>';\n\t\t\t\t\t// $event['summary'] = $event_text;\n\t\t\t\t\t$fits = TRUE;\n\t\t\t\t\t$analyse_summary = Event::filterType($event_text);\n\t\t\t\t\t$event['original'] = $event_text;\n\t\t\t\t\t$event['summary'] = $analyse_summary['summary'];\n\t\t\t\t\t$event['city'] = isset($analyse_summary['city'])?$analyse_summary['city']:'';\n\t\t\t\t\t$event['category'] = isset($analyse_summary['type'])?$analyse_summary['type']:'';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Adding some info to help\n\t\t\tif(!isset($event['start']['dateTime']) && isset($event['start']['date'])){\n\t\t\t\t$event['start']['dateTime'] = $event['start']['date'];\n\t\t\t}\n\t\t\t$datetime = new \\Datetime($event['start']['dateTime']);\n\t\t\t$event['start']['weekday'] = $datetime->format('N');\n\n\t\t\t// Adding the picture\n\t\t\t// $creator_email = isset($event['creator']['email'])?$event['creator']['email']:null;\n\t\t\t$organizer_id = isset($event['extendedProperties']['shared']['organizer_id'])?$event['extendedProperties']['shared']['organizer_id']:null;\n\t\t\t\n\t\t\tif(!is_null($organizer_id) && !isset($event['school'])){\n\t\t\t\t\n\t\t\t\t$school = School::findOne($organizer_id);\n\n\t\t\t\tif($school){\n\t\t\t\t\t$event['email'] = $school->email;\n\t\t\t\t\t$event['school'] = array();\n\t\t\t\t\t$event['school']['picture'] = $school->getPictureUrl();\n\t\t\t\t\t$event['school']['thumb'] = $school->getThumbUrl();\n\t\t\t\t\t$event['school']['name'] = $school->name;\n\t\t\t\t\tif(isset($school->website))\n\t\t\t\t\t\t$event['school']['url'] = $school->website;\n\t\t\t\t\telse if(isset($school->facebook))\n\t\t\t\t\t\t$event['school']['url'] = $school->facebook;\n\t\t\t\t\tif($school->email){\n\t\t\t\t\t\t$event['email'] = $school->email;\n\t\t\t\t\t}\n\t\t\t\t\tif($school->active == false){\n\t\t\t\t\t\t$fits = FALSE;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isset($event['extendedProperties']['shared']['disabled']) && $event['extendedProperties']['shared']['disabled'] == 1){\n\t\t\t\t$fits = FALSE;\n\t\t\t}\n\t\t\tif( $fits == TRUE ){\n\t\t\t\t$events_filtered[$event['id']] = $event;\n\t\t\t}\n\n\t\t}\n\t\treturn $events_filtered;\n\t}", "function getFilterType(){\n\t$data = M('event');\n\t$type_set = Array();\n\t$result = $data->group('type')->order('type asc')->select();\n\tforeach($result as $value)\n\t\tarray_push($type_set, $value['type']);\n\n\treturn $type_set;\n}", "public function values() {\n return array(\n 'settings' => array(\n 'event_type' => 1,\n ),\n );\n }", "public function filter($value)\n {\n $rawData = DoctrineDebug::export($value['rawData'], self::DOCTRINE_DEBUG_LEVEL);\n\n //set some defaults\n $hasBusData = false;\n $regNo = self::UNKNOWN_REG_NO;\n $serviceNo = self::UNKNOWN_SERVICE_NO;\n $origin = self::UNKNOWN_START_POINT;\n $destination = self::UNKNOWN_FINISH_POINT;\n $startDate = self::UNKNOWN_START_DATE;\n\n //if the submission progressed far enough (i.e. beyond xml schema errors), then we will have a data array\n if (is_array($rawData)) {\n //check for a reg no\n if (isset($rawData['licNo']) && isset($rawData['routeNo'])) {\n $hasBusData = true;\n $regNo = $rawData['licNo'] . '/' . $rawData['routeNo'];\n }\n\n //check service no\n if (isset($rawData['serviceNo'])) {\n $hasBusData = true;\n $serviceNo = $rawData['serviceNo'];\n\n if (isset($rawData['otherServiceNumbers']) && is_array($rawData['otherServiceNumbers'])) {\n $serviceNo .= ' (' . implode(', ', $rawData['otherServiceNumbers']) . ')';\n }\n }\n\n //check start point\n if (isset($rawData['startPoint'])) {\n $hasBusData = true;\n $origin = $rawData['startPoint'];\n }\n\n //check finish point\n if (isset($rawData['finishPoint'])) {\n $hasBusData = true;\n $destination = $rawData['finishPoint'];\n }\n\n //check effective date\n if (isset($rawData['effectiveDate'])) {\n $hasBusData = true;\n $startDate = $this->formatDate($rawData['effectiveDate']);\n }\n }\n\n return [\n 'errors' => $value['errorMessages'],\n 'extra_bus_data' => [\n 'submissionDate' => $this->formatDate($value['ebsrSub']->getSubmittedDate()),\n 'submissionErrors' => $value['errorMessages'],\n 'registrationNumber' => $regNo,\n 'origin' => $origin,\n 'destination' => $destination,\n 'lineName' => $serviceNo,\n 'startDate' => $startDate,\n 'hasBusData' => $hasBusData\n ]\n ];\n }", "public function FilterDescription() {\n\t\t$params = $this->parseParams();\n\n\t\t$filters = array();\n\t\tif ($params['tag']) {\n\t\t\t$term = TaxonomyTerm::get_by_id('TaxonomyTerm', $params['tag']);\n\t\t\tif ($term) {\n\t\t\t\t$filters[] = _t('DatedUpdateHolder.FILTER_WITHIN', 'within') . ' \"' . $term->Name . '\"';\n\t\t\t}\n\t\t}\n\n\t\tif ($params['from'] || $params['to']) {\n\t\t\tif ($params['from']) {\n\t\t\t\t$from = strtotime($params['from']);\n\t\t\t\tif ($params['to']) {\n\t\t\t\t\t$to = strtotime($params['to']);\n\t\t\t\t\t$filters[] = _t('DatedUpdateHolder.FILTER_BETWEEN', 'between') . ' '\n\t\t\t\t\t\t. date('j/m/Y', $from) . ' and ' . date('j/m/Y', $to);\n\t\t\t\t} else {\n\t\t\t\t\t$filters[] = _t('DatedUpdateHolder.FILTER_ON', 'on') . ' ' . date('j/m/Y', $from);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$to = strtotime($params['to']);\n\t\t\t\t$filters[] = _t('DatedUpdateHolder.FILTER_ON', 'on') . ' ' . date('j/m/Y', $to);\n\t\t\t}\n\t\t}\n\n\t\tif ($params['year'] && $params['month']) {\n\t\t\t$timestamp = mktime(1, 1, 1, $params['month'], 1, $params['year']);\n\t\t\t$filters[] = _t('DatedUpdateHolder.FILTER_IN', 'in') . ' ' . date('F', $timestamp) . ' ' . $params['year'];\n\t\t}\n\n\t\tif ($filters) {\n\t\t\treturn $this->getUpdateName() . ' ' . implode(' ', $filters);\n\t\t}\n\t}", "private function getSeriesDataList(string $value)\n {\n $ph = new SeriesDBHandler();\n $dl = $ph->getSpecificSeriesWithLike($value);\n foreach ($dl as $key => $value) {\n $dl[$key] = $value['name'];\n }\n throw new HttpResponseTriggerException(true, $dl);\n }", "function suggest()\n\t{\n\t\t$suggestions = $this->Supplier->get_search_suggestions($this->input->post('q'),$this->input->post('limit'));\n\t\techo implode(\"\\n\",$suggestions);\n\t}", "public function suggest(RegistryObject $record)\n {\n $subjects = SubjectProvider::getSubjects($record);\n $subjectValues = collect($subjects)->pluck(\"value\")->toArray();\n if (count($subjectValues) === 0) {\n return [];\n }\n\n // CC-2068. Limit the number of subjects used for suggestion\n $subjectValues = array_slice($subjectValues, 0, 1000);\n\n // do the search and grabbing only the required information\n $query = $this->getSuggestorQuery($subjectValues);\n $searchResult = $this->solr->search([\n 'q' => \"-id:{$record->id} +class:collection +($query)\",\n 'rows' => 50,\n 'start' => 0,\n 'fl' => 'id, title, key, slug, score'\n ]);\n// dd(\"-id:{$record->id} +class:collection +($query)\");\n\n if ($searchResult->errored() || $searchResult->getNumFound() === 0) {\n return [];\n }\n\n // constructing the result\n $result = [];\n foreach ($searchResult->getDocs() as $doc) {\n $result[] = [\n 'id' => $doc->id,\n 'title' => $doc->title,\n 'key' => $doc->key,\n 'slug' => $doc->slug,\n 'RDAUrl' => baseUrl($doc->slug. '/'. $doc->id),\n 'score' => $doc->score\n ];\n }\n\n // normalise the score\n $highest = collect($result)->pluck('score')->max();\n $result = collect($result)->map(function($item) use ($highest){\n $item['score'] = round($item['score'] / $highest, 5);\n return $item;\n });\n $result = $result->sortBy('score')->reverse();\n $result = array_values($result->toArray());\n\n return $result;\n }", "public function getResultsKeys() {\n return ['lines_after_maximum_allowed_lines',\n 'lines_with_non_matching_values',\n 'lines_with_too_many_values',\n 'lines_with_too_few_values',\n 'lines_with_too_many_characters',\n 'lines_with_non_numeric_values',\n 'lines_with_invalid_labeling',\n 'lines_with_non_unique_label'\n ];\n }", "public function descriptors(Request $request) {\n\n $action_code = 'descriptors_index';\n\n $message = usercan($action_code, Auth::user());\n\n if ($message) {\n return Redirect::back()->with('message', $message);\n }\n\n if ($request->ajax()) {//only return data to ajax calls\n $filter = $request->get('term');\n\n $descriptors = Descriptor::select('descriptors.id as descriptor_id', 'descriptors.description as label', 'descriptor_types.description as category', 'descriptors.descriptor_type_id')\n ->join('descriptor_types', 'descriptors.descriptor_type_id', '=', 'descriptor_types.id')\n ->whereRaw(\"LOWER(descriptors.description) like '%\" .\n strtolower($filter) . \"%'\")\n ->orderBy('descriptor_types.id', 'asc')\n ->orderBy('descriptors.description', 'asc')->get();\n\n return response()->json($descriptors);\n } else {\n return response()->make(\"Unable to comply request\", 404);\n }\n }", "public function addDescriptions(\\obiba\\mica\\LocalizedStringDto $value) {\n return $this->_add(3, $value);\n }", "protected function getEvents(ContainerBuilder $container)\r\n {\n $events = array();\n \n foreach ($container->get('synd_metrics.finder')->getConfig() as $groupName => $groupConfig) {\n foreach ($groupConfig['funnel'] as $event) {\r\n $events[] = $event;\r\n }\n }\n\n return $events;\r\n }", "function get_values($labels_list, $error_list, $base_vals, $k) {\n $results = $labels_list;\n $labels = $labels_list;\n foreach ($labels_list as $label) { \n // selecting a random error level to assign to emotion label (ex. ideal, very accurate, etc.)\n reset($error_list);\n $error = key($error_list);\n\n\t$types = array_keys($base_vals[$error]);\n\t$type = $types[mt_rand(0, count($types)-1)];\n $newresult = $base_vals[$error][$type];\n\t$regions = array_keys($newresult);\n\t\t\n //adding jitter\n for ($i = 0; $i < $k; $i++) {\n\t\t\t$first = mt_rand(0, count($regions)-1);\n\t\t\twhile($newresult[$regions[$first]]==0){\n\t\t\t\t$first = mt_rand(0, count($regions)-1);\n\t\t\t}\n\t\t\t$second = $first;\n\t\t\twhile($second == $first){\n\t\t\t\t$second = mt_rand(0, count($regions)-1);\n\t\t\t}\n\t\t $newresult[$regions[$first]]--;\n \t\t $newresult[$regions[$second]]++;\n }\n\n $dict[\"data\"] = $newresult;\n $dict[\"type\"] = $error;\n $dict[\"hill\"] = $type;\n\t\t\n $results[$label] = $dict;\n\n\t\t$error_list[$error] = $error_list[$error] - 1;\n\t\tif ($error_list[$error] === 0) {\n\t\t\tunset($error_list[$error]);\n\t\t}\n \n } \n $return = array();\n foreach ($labels as $item) {\n $return[$item] = $results[$item];\n }\n return $return;\n}", "function getEventPlaces($event, $filter=null)\n{\n\t$str = \"\";\n\tif( $event->has( \"event:place\" ) )\n\t{\n\t\tforeach( $event->all( \"event:place\" ) as $place )\n\t\t{\n\t\t\tif($place->isType(\"http://vocab.deri.ie/rooms#Room\") || $place->isType(\"http://vocab.deri.ie/rooms#Building\") || $place->isType(\"http://www.w3.org/ns/org#Site\"))\n\t\t\t\t$type = \"Place\";\n\t\t\telse\n\t\t\t\t$type = \"Additional Place Info\";\n\t\t\tif(!is_null($filter) && $filter != $type)\n\t\t\t\tcontinue;\n\t\t\t$typel = $type.\": \";\n\t\t\tif($type == \"Place\")\n\t\t\t{\n\t\t\t\t$typel = \"at \";\n\t\t\t}\n\t\t\telseif($type == \"Additional Place Info\")\n\t\t\t{\n\t\t\t\t$style = \"\";\n\t\t\t}\n\t\t\tif($place->label() == '[NULL]')\n\t\t\t{\n\t\t\t\t$str .= \"\\t\\t<div>$typel\".$place->link().\"</div>\\n\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$str .= \"\\t\\t<div>$typel\".getPlaceLabel($place).\"</div>\\n\";\n\t\t\t}\n\t\t}\n\t}\n\treturn $str;\n}", "public function get_event_types()\n {\n return array(0 => 'miscellaneous', 1 => 'appointment', 2 => 'holiday'\n ,3 => 'birthday', 4 => 'personal', 5 => 'education'\n ,6 => 'travel', 7 => 'anniversary', 8 => 'not in office'\n ,9 => 'sick day', 10 => 'meeting', 11 => 'vacation'\n ,12 => 'phone call', 13 => 'business'\n ,14 => 'non-working hours', 50 => 'special occasion'\n );\n }", "function fetchEventDetails($TMeventDetailsResult){\n $eventDetailsResult = array();\n $eventDetailsArray = $TMeventDetailsResult;\n //extract information\n $eventDetailsResult[\"name\"] = array_key_exists('name',$eventDetailsArray)?$eventDetailsArray[\"name\"]:\"\";\n\n //extract dates information\n $eventDetailsResult[\"date\"] = array();\n if(array_key_exists('dates',$eventDetailsArray)){\n if(array_key_exists('start',$eventDetailsArray['dates'])){\n if(array_key_exists('localDate',$eventDetailsArray[\"dates\"][\"start\"])){\n $eventDetailsResult[\"date\"][\"localDate\"] = $eventDetailsArray[\"dates\"][\"start\"][\"localDate\"];\n }\n if(array_key_exists('localDate',$eventDetailsArray[\"dates\"][\"start\"])){\n $eventDetailsResult[\"date\"][\"localTime\"] = $eventDetailsArray[\"dates\"][\"start\"][\"localTime\"];\n }\n }\n }\n\n //extract genre information\n $eventDetailsResult[\"genre\"] = array();\n if(array_key_exists('classification',$eventDetailsArray)){\n foreach($eventDetailsArray[\"classification\"] as $i => $ele){\n if(array_key_exists('segment',$ele)){\n $eventDetailsResult[\"genre\"][$i][\"segment\"] = $ele[\"segemnt\"];\n }\n if(array_key_exists('genre',$ele)){\n $eventDetailsResult[\"genre\"][$i][\"genre\"] = $ele[\"genre\"];\n }\n if(array_key_exists('subGenre',$ele)){\n $eventDetailsResult[\"genre\"][$i][\"subGenre\"] = $ele[\"subGenre\"];\n }\n if(array_key_exists('type',$ele)){\n $eventDetailsResult[\"genre\"][$i][\"type\"] = $ele[\"type\"];\n }\n if(array_key_exists('segment',$ele)) {\n $eventDetailsResult[\"genre\"][$i][\"subType\"] = $ele[\"subType\"];\n }\n }\n }\n\n //extract artist information\n $eventDetailsResult[\"artists\"] = array();\n if(array_key_exists('_embedded',$eventDetailsArray)){\n if(array_key_exists('attractions',$eventDetailsArray[\"_embedded\"])) {\n foreach ($eventDetailsArray[\"_embedded\"][\"attractions\"] as $i => $ele) {\n if(array_key_exists('name',$ele)){\n $eventDetailsResult[\"artists\"][$i][\"name\"] = $ele[\"name\"];\n }\n if(array_key_exists('url',$ele)){\n $eventDetailsResult[\"artists\"][$i][\"url\"] = $ele[\"url\"];\n }\n }\n }\n }\n\n //extract venue information\n $eventDetailsResult[\"venues\"] = array();\n if(array_key_exists(\"_embedded\",$eventDetailsArray)){\n if(array_key_exists(\"venues\",$eventDetailsArray[\"_embedded\"])){\n foreach($eventDetailsArray[\"_embedded\"][\"venues\"] as $i => $ele){\n if(array_key_exists('name',$ele)){\n $eventDetailsResult[\"venues\"][$i][\"name\"] = $ele[\"name\"];\n }\n }\n }\n }\n\n //extract price range\n $eventDetailsResult['priceRange'] = array();\n if(array_key_exists('priceRange',$eventDetailsArray)){\n foreach($eventDetailsArray[\"priceRange\"] as $i => $ele){\n if(array_key_exists('min',$ele)){\n $eventDetailsResult['priceRange'][$i][\"min\"] = $ele[\"min\"];\n }\n if(array_key_exists('max',$ele)){\n $eventDetailsResult['priceRange'][$i][\"max\"] = $ele[\"max\"];\n }\n\n }\n }\n //extract ticketStatus information\n if(array_key_exists('dates',$eventDetailsArray)){\n if(array_key_exists('status',$eventDetailsArray[\"dates\"])){\n if(array_key_exists('code',$eventDetailsArray[\"dates\"][\"status\"])){\n $eventDetailsResult[\"ticketStatus\"] = $eventDetailsArray[\"dates\"][\"status\"][\"code\"];\n }\n }\n }\n //extract seatmap\n if(array_key_exists('seatmap',$eventDetailsArray)){\n if(array_key_exists('staticUrl',$eventDetailsArray[\"seatmap\"])){\n $eventDetailsResult[\"seatmap\"] = $eventDetailsArray[\"seatmap\"][\"staticUrl\"];\n }\n\n }\n //extract buy ticket at url\n if(array_key_exists('url',$eventDetailsArray)){\n $eventDetailsResult[\"buyTicketAt\"] = $eventDetailsArray[\"url\"];\n\n }\n\n return $eventDetailsResult;\n}", "public function testAutoComplete() {\n $account = $this->drupalCreateUser(array('administer monitoring'));\n $this->drupalLogin($account);\n\n // Test with \"C\", which matches Content and Cron.\n $categories = $this->drupalGetJSON('/monitoring-category/autocomplete', array('query' => array('q' => 'C')));\n $this->assertEqual(count($categories), 2, '2 autocomplete suggestions.');\n $this->assertEqual('Content', $categories[0]['label']);\n $this->assertEqual('Cron', $categories[1]['label']);\n\n // Check that a non-matching prefix returns no suggestions.\n $categories = $this->drupalGetJSON('/monitoring-category/autocomplete', array('query' => array('q' => 'non_existing_category')));\n $this->assertTrue(empty($categories), 'No autocomplete suggestions for non-existing query string.');\n }", "public function getEventTypeAllowableValues()\n {\n return [\n self::EVENT_TYPE_CREDIT_CARD,\n self::EVENT_TYPE_CASH,\n self::EVENT_TYPE_THIRD_PARTY_CARD,\n self::EVENT_TYPE_NO_SALE,\n self::EVENT_TYPE_SQUARE_WALLET,\n self::EVENT_TYPE_SQUARE_GIFT_CARD,\n self::EVENT_TYPE_UNKNOWN,\n self::EVENT_TYPE_OTHER,\n ];\n }", "public function getEventTypeAttribute() {\n return $this->eventType()->getResults();\n }", "function message_notify_field_text_list() {\n $options = array(FALSE => '- ' . t('None') . ' -');\n\n\n foreach (field_info_instances('message') as $message_type => $instances) {\n foreach ($instances as $field_name => $instance) {\n if (!empty($options[$field_name])) {\n // Field is already in the options array.\n continue;\n }\n $field = field_info_field($field_name);\n if (!in_array($field['type'], array('text', 'text_long', 'text_with_summary'))) {\n // Field is not a text field.\n continue;\n }\n\n $options[$field_name] = $instance['label'];\n }\n }\n\n return $options;\n}", "public static function getAllEventTypes()\n {\n return [\n 'complete' => 'complete',\n 'fail' => 'fail'\n ];\n }", "function suggest()\n\t{\n\t\tsession_write_close();\n\t\t$suggestions = $this->Item_products->get_search_suggestions($this->input->get('term'),100);\n\t\techo json_encode($suggestions);\n\t}", "private function _descriptionTextModelExpectData()\n {\n return [\n 'type' => 1,\n 'hasEditor' => false\n ];\n }", "function getSupportedFilters() {\n return array('event' => array(\n 'event_type_id' => array(\n 'form_field_name' => 'event_type_id',\n 'operator' => 'IN',\n ))\n );\n }", "function findEventsByTag($events=array(),$tag=null) {\n\t\t$output = array();\n\t\tif (!$events) { \n\t\t\treturn null; \n\t\t} else {\n\t\t\t$x = 0;\n\t\t\tforeach ($events as $event) {\n\t\t\t\tfor ($i = 0; $i < count($event['Tag']); $i++) {\n\t\t\t\t\tif ($event['Tag'][$i]['shortname'] == $tag) {\n\t\t\t\t\t\t$output[$x] = $event;\n\t\t\t\t\t\t$x++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!$output) { \n\t\t\t\treturn null; \n\t\t\t} else {\n\t\t\t\treturn $output;\n\t\t\t}\n\t\t}\n\t}", "function getEvents() {\n\n $events = ['new' => __('New change'),\n 'update' => __('Update of a change'),\n 'solved' => __('Change solved'),\n 'validation' => __('Validation request'),\n 'validation_answer' => __('Validation request answer'),\n 'closed' => __('Closure of a change'),\n 'delete' => __('Deleting a change')];\n\n $events = array_merge($events, parent::getEvents());\n asort($events);\n return $events;\n }", "function suggest_category() {\n $suggestions = $this->ticket->get_category_suggestions($this->input->get('term'));\n echo json_encode($suggestions);\n }", "public function describe() : string\n {\n $type = (string)$this->getEventType();\n $datetime = $this->getDate()->format('d-M-Y');\n if ($this->getTime()) {\n $datetime .= ' at '.$this->getTime()->format('g:i a');\n }\n $return = sprintf('%s %s, %s', $this->getLanguage(), $type, $datetime);\n $more = [];\n if ($this->getJudge()) {\n $more[] = $this->getJudge()->getLastName();\n }\n $docket = $this->getDocket();\n if ($docket) {\n $more[] = $docket;\n }\n if ($more) {\n $return .= sprintf(' (%s)', implode(', ', $more));\n }\n\n return $return;\n }", "function searchEventsDetailsBasicFormating($keyWordParams) {\r\t$resultString = '';\r\t$keyWordParams['websiteConfigID'] = WEB_CONF_ID;\r\tif($keyWordParams['searchTerms']) {\r\t\t$client = new SoapClient(WSDL);\r\t\t$result = $client -> __soapCall('SearchEvents', array('parameters' => $keyWordParams));\r\t\tif(is_soap_fault($result)) {\r\t\t\techo '<h2>Fault</h2><pre>';\r\t\t\tprint_r($result);\r\t\t\techo '</pre>';\r\t\t}\r\n\t\t$eventDetails=\"\";\r\t\tif(empty($result)){\r\t\t\treturn \"No results match the specified terms\";\r\t\t}else {\r\n\t\t\tfor($q=0;$q<count($result->SearchEventsResult->Event);$q++){\r\n\t\t\t\t$resultsObj=$result->SearchEventsResult->Event[$q];\r\n\t\t\t\t$eventDetails.=\"<b>ID: </b>\".$resultsObj->ID.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>Name: </b>\".$resultsObj->Name.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>Date: </b>\".$resultsObj->Date.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>DisplayDate: </b>\".$resultsObj->DisplayDate.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>Venue: </b>\".$resultsObj->Venue.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>City: </b>\".$resultsObj->City.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>StateProvince: </b>\".$resultsObj->StateProvince.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>ParentCategoryID: </b>\".$resultsObj->ParentCategoryID.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>ChildCategoryID: </b>\".$resultsObj->ChildCategoryID.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>GrandchildCategoryID: </b>\".$resultsObj->GrandchildCategoryID.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>MapURL: </b>\".$resultsObj->MapURL.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>VenueID: </b>\".$resultsObj->VenueID.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>StateProvinceID: </b>\".$resultsObj->StateProvinceID.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>VenueConfigurationID: </b>\".$resultsObj->VenueConfigurationID.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>Clicks: </b>\".$resultsObj->Clicks.\"<br>\";\r\n\t\t\t\t$eventDetails.=\"<b>IsWomensEvent: </b>\".$resultsObj->IsWomensEvent.\"<br><br>\";\r\n\t\t\t}\r\n\t\t\tunset($client);\r\n\t\t\treturn $eventDetails;\r\t\t}\r\t}\r}", "public function getAttributeFilterSuggestions()\n {\n return $this->attributeFilterSuggestions;\n }", "function timeconditions_timegroups_list_groups() {\n\tglobal $db;\n\t$tmparray = array();\n\n\t$sql = \"select id, description from timegroups_groups order by description\";\n\t$results = $db->getAll($sql);\n\tif(DB::IsError($results)) {\n\t\t$results = null;\n\t}\n\tforeach ($results as $val) {\n\t\t$tmparray[] = array($val[0], $val[1], \"value\" => $val[0], \"text\" => $val[1]);\n\t}\n\treturn $tmparray;\n}", "function theme_intranet_haarlem_search_events($options = array()){\n\t$defaults = array(\t'past_events' \t\t=> false,\n\t\t\t\t\t\t'count' \t\t\t=> false,\n\t\t\t\t\t\t'offset' \t\t\t=> 0,\n\t\t\t\t\t\t'limit'\t\t\t\t=> EVENT_MANAGER_SEARCH_LIST_LIMIT,\n\t\t\t\t\t\t'container_guid'\t=> null,\n\t\t\t\t\t\t'query'\t\t\t\t=> false,\n\t\t\t\t\t\t'meattending'\t\t=> false,\n\t\t\t\t\t\t'owning'\t\t\t=> false,\n\t\t\t\t\t\t'friendsattending' \t=> false,\n\t\t\t\t\t\t'region'\t\t\t=> null,\n\t\t\t\t\t\t'latitude'\t\t\t=> null,\n\t\t\t\t\t\t'longitude'\t\t\t=> null,\n\t\t\t\t\t\t'distance'\t\t\t=> null,\n\t\t\t\t\t\t'event_type'\t\t=> false,\n\t\t\t\t\t\t'past_events'\t\t=> false,\n\t\t\t\t\t\t'search_type'\t\t=> \"list\"\n\t\t\t\t\t\t\n\t);\n\t\n\t$options = array_merge($defaults, $options);\n\t\n\t$entities_options = array(\n\t\t'type' \t\t\t=> 'object',\n\t\t'subtype' \t\t=> 'event',\n\t\t'offset' \t\t=> $options['offset'],\n\t\t'limit' \t\t=> $options['limit'],\n\t\t'joins' => array(),\n\t\t'wheres' => array(),\n\t\t'order_by_metadata' => array(\"name\" => 'start_day', \"direction\" => 'ASC', \"as\" => \"integer\")\n\t);\n\t\n\tif (isset($options['entities_options'])) {\n\t\t$entities_options = array_merge($entities_options, $options['entities_options']);\n\t}\n\t\n\tif($options[\"container_guid\"]){\n\t\t// limit for a group\n\t\t$entities_options['container_guid'] = $options['container_guid'];\n\t}\n\t\n\tif($options['query']) {\n\t\t$entities_options[\"joins\"][] = \"JOIN \" . elgg_get_config(\"dbprefix\") . \"objects_entity oe ON e.guid = oe.guid\";\n\t\t$entities_options['wheres'][] = event_manager_search_get_where_sql('oe', array('title', 'description'), $options, false);\n\t}\n\t\t\t\t\n\tif(!empty($options['start_day'])) {\n\t\t$entities_options['metadata_name_value_pairs'][] = array('name' => 'start_day', 'value' => $options['start_day'], 'operand' => '>=');\n\t}\n\t\n\tif(!empty($options['end_day'])) {\n\t\t$entities_options['metadata_name_value_pairs'][] = array('name' => 'start_day', 'value' => $options['end_day'], 'operand' => '<=');\n\t}\n\t\n\tif(!$options['past_events']) {\n\t\t// only show from current day or newer\n\t\t$entities_options['metadata_name_value_pairs'][] = array('name' => 'start_day', 'value' => mktime(0, 0, 1), 'operand' => '>=');\n\t}\n\t\n\tif($options['meattending']) {\n\t\t$entities_options['joins'][] = \"JOIN \" . elgg_get_config(\"dbprefix\") . \"entity_relationships e_r ON e.guid = e_r.guid_one\";\n\t\t\n\t\t$entities_options['wheres'][] = \"e_r.guid_two = \" . elgg_get_logged_in_user_guid();\n\t\t$entities_options['wheres'][] = \"e_r.relationship = '\" . EVENT_MANAGER_RELATION_ATTENDING . \"'\";\n\t}\n\t\n\tif($options['owning']) {\n\t\t$entities_options['owner_guids'] = array(elgg_get_logged_in_user_guid());\n\t}\n\t\n\tif($options[\"region\"]){\n\t\t$entities_options['metadata_name_value_pairs'][] = array('name' => 'region', 'value' => $options[\"region\"]);\n\t}\n\t\n\tif($options[\"event_type\"]){\n\t\t$entities_options['metadata_name_value_pairs'][] = array('name' => 'event_type', 'value' => $options[\"event_type\"]);\n\t}\n\t\n\tif($options['friendsattending']){\n\t\t$friends_guids = array();\n\t\t\n\t\tif($friends = elgg_get_logged_in_user_entity()->getFriends(\"\", false)) {\n\t\t\tforeach($friends as $user) {\n\t\t\t\t$friends_guids[] = $user->getGUID();\n\t\t\t}\n\t\t\t$entities_options['joins'][] = \"JOIN \" . elgg_get_config(\"dbprefix\") . \"entity_relationships e_ra ON e.guid = e_ra.guid_one\";\n\t\t\t$entities_options['wheres'][] = \"(e_ra.guid_two IN (\" . implode(\", \", $friends_guids) . \"))\";\n\t\t} else\t{\n\t\t\t// return no result\n\t\t\t$entities_options['joins'] = array();\n\t\t\t$entities_options['wheres'] = array(\"(1=0)\");\n\t\t}\n\t}\n\t\n\tif(($options[\"search_type\"] == \"onthemap\") && !empty($options['latitude']) && !empty($options['longitude']) && !empty($options['distance'])){\n\t\t$entities_options[\"latitude\"] = $options['latitude'];\n\t\t$entities_options[\"longitude\"] = $options['longitude'];\n\t\t$entities_options[\"distance\"] = $options['distance'];\n\t\t$entities = elgg_get_entities_from_location($entities_options);\n\t\t\t\n\t\t$entities_options['count'] = true;\n\t\t$count_entities = elgg_get_entities_from_location($entities_options);\n\t\t\n\t} else {\n\t\t\n\t\t$entities = elgg_get_entities_from_metadata($entities_options);\n\t\t\n\t\t$entities_options['count'] = true;\n\t\t$count_entities = elgg_get_entities_from_metadata($entities_options);\n\t}\n\t\n\t$result = array(\n\t\t\"entities\" \t=> $entities,\n\t\t\"count\" \t=> $count_entities\n\t\t);\n\t\t\n\treturn $result;\n}", "protected function _generateEventLabels()\n {\n if (!self::$_eventList) {\n self::$_eventList = array(\n 'T0000' => Mage::helper('paypalmx')->__('General: Recibir pagos de de tipo no perteneciente a la categoria T00xx'),\n 'T0001' => Mage::helper('paypalmx')->__('Pagos masivos'),\n 'T0002' => Mage::helper('paypalmx')->__('Pagos subscritos, tambien pagos enviados y recibidos'),\n 'T0003' => Mage::helper('paypalmx')->__('Pagos previamente aprovados (BillUser API), ya sean enviados o recividos'),\n 'T0004' => Mage::helper('paypalmx')->__('eBay Auction Payment'),\n 'T0005' => Mage::helper('paypalmx')->__('Pagos Directos del API'),\n 'T0006' => Mage::helper('paypalmx')->__('Express Checkout APIs'),\n 'T0007' => Mage::helper('paypalmx')->__('Pagos regulares de la tienda'),\n 'T0008' => Mage::helper('paypalmx')->__('Pagos de envio ya sea USPS o UPS'),\n 'T0009' => Mage::helper('paypalmx')->__('Pagos de certificados de regalo: compra de un certificado de regalo'),\n 'T0010' => Mage::helper('paypalmx')->__('Auction Payment other than through eBay'),\n 'T0011' => Mage::helper('paypalmx')->__('Pago echos desde un telefono (echos por via telefonica)'),\n 'T0012' => Mage::helper('paypalmx')->__('Pagos por terminal virtual'),\n 'T0100' => Mage::helper('paypalmx')->__('General: sin cuota de pago, no perteneciente a la categoria T01xx'),\n 'T0101' => Mage::helper('paypalmx')->__('Cuota: Web Site Payments Pro Account Monthly'),\n 'T0102' => Mage::helper('paypalmx')->__('Cuota: Retiro foraneo de ACH'),\n 'T0103' => Mage::helper('paypalmx')->__('Cuota: Retiro de WorldLink Check'),\n 'T0104' => Mage::helper('paypalmx')->__('Cuota: solicitud de pagos masivos'),\n 'T0200' => Mage::helper('paypalmx')->__('General de conversion de moneda'),\n 'T0201' => Mage::helper('paypalmx')->__('Conversion de moneda usado por el usuario'),\n 'T0202' => Mage::helper('paypalmx')->__('Conversion de moneda requerido para cubrir el balance negativo'),\n 'T0300' => Mage::helper('paypalmx')->__('Fundacion general de la cuenta PayPal'),\n 'T0301' => Mage::helper('paypalmx')->__('Ayudante del balance PayPal funcion de la cuenta PayPal'),\n 'T0302' => Mage::helper('paypalmx')->__('ACH Fundacion para recuperacion de fondos del balance de la cuenta.'),\n 'T0303' => Mage::helper('paypalmx')->__('Fundacion EFT (Banco aleman)'),\n 'T0400' => Mage::helper('paypalmx')->__('Retiro general de la cuenta de Paypal'),\n 'T0401' => Mage::helper('paypalmx')->__('Limpiado Automático'),\n 'T0500' => Mage::helper('paypalmx')->__('General: Uso de la cuenta Paypal para comprar asi como para recibir pagos'),\n 'T0501' => Mage::helper('paypalmx')->__('Transaccion de Paypal tarjeto de debito virtual'),\n 'T0502' => Mage::helper('paypalmx')->__('Retiros de la tarjeta de debito PayPal del cajero automatico'),\n 'T0503' => Mage::helper('paypalmx')->__('Tranascciones escodndidas de la tarjeta de debito Virtual de PayPal'),\n 'T0504' => Mage::helper('paypalmx')->__('Avanzado Tarjeta de debito de PayPal'),\n 'T0600' => Mage::helper('paypalmx')->__('General: retiro de la cuenta de PayPalt'),\n 'T0700' => Mage::helper('paypalmx')->__('General (Compras con una tarjeta de credito)'),\n 'T0701' => Mage::helper('paypalmx')->__('Balance Negativo'),\n 'T0800' => Mage::helper('paypalmx')->__('General: bonus del tipo no perteneciente a las otras T08xx categories'),\n 'T0801' => Mage::helper('paypalmx')->__('Tarjeta de debito regreso de dinero'),\n 'T0802' => Mage::helper('paypalmx')->__('Bonus a referencias del comerciante'),\n 'T0803' => Mage::helper('paypalmx')->__('Bonus del ayudante'),\n 'T0804' => Mage::helper('paypalmx')->__('Bonus del seguro al comprador PayPal'),\n 'T0805' => Mage::helper('paypalmx')->__('Bonus de proteccion de PayPal'),\n 'T0806' => Mage::helper('paypalmx')->__('Bonus por primer uso de ACH'),\n 'T0900' => Mage::helper('paypalmx')->__('Redención General'),\n 'T0901' => Mage::helper('paypalmx')->__('Certificado de regalo de Redención'),\n 'T0902' => Mage::helper('paypalmx')->__('Points Incentive Redemption'),\n 'T0903' => Mage::helper('paypalmx')->__('Cupon de Redención'),\n 'T0904' => Mage::helper('paypalmx')->__('Reward Voucher Redemption'),\n 'T1000' => Mage::helper('paypalmx')->__('General. Product no longer supported'),\n 'T1100' => Mage::helper('paypalmx')->__('General: reversal of a type not belonging to the other T11xx categories'),\n 'T1101' => Mage::helper('paypalmx')->__('ACH Withdrawal'),\n 'T1102' => Mage::helper('paypalmx')->__('Debit Card Transaction'),\n 'T1103' => Mage::helper('paypalmx')->__('Reversal of Points Usage'),\n 'T1104' => Mage::helper('paypalmx')->__('ACH Deposit (Reversal)'),\n 'T1105' => Mage::helper('paypalmx')->__('Reversal of General Account Hold'),\n 'T1106' => Mage::helper('paypalmx')->__('Account-to-Account Payment, initiated by PayPal'),\n 'T1107' => Mage::helper('paypalmx')->__('Payment Refund initiated by merchant'),\n 'T1108' => Mage::helper('paypalmx')->__('Fee Reversal'),\n 'T1110' => Mage::helper('paypalmx')->__('Hold for Dispute Investigation'),\n 'T1111' => Mage::helper('paypalmx')->__('Reversal of hold for Dispute Investigation'),\n 'T1200' => Mage::helper('paypalmx')->__('General: adjustment of a type not belonging to the other T12xx categories'),\n 'T1201' => Mage::helper('paypalmx')->__('Chargeback'),\n 'T1202' => Mage::helper('paypalmx')->__('Reversal'),\n 'T1203' => Mage::helper('paypalmx')->__('Charge-off'),\n 'T1204' => Mage::helper('paypalmx')->__('Incentive'),\n 'T1205' => Mage::helper('paypalmx')->__('Reimbursement of Chargeback'),\n 'T1300' => Mage::helper('paypalmx')->__('General (Authorization)'),\n 'T1301' => Mage::helper('paypalmx')->__('Reauthorization'),\n 'T1302' => Mage::helper('paypalmx')->__('Void'),\n 'T1400' => Mage::helper('paypalmx')->__('General (Dividend)'),\n 'T1500' => Mage::helper('paypalmx')->__('General: temporary hold of a type not belonging to the other T15xx categories'),\n 'T1501' => Mage::helper('paypalmx')->__('Open Authorization'),\n 'T1502' => Mage::helper('paypalmx')->__('ACH Deposit (Hold for Dispute or Other Investigation)'),\n 'T1503' => Mage::helper('paypalmx')->__('Available Balance'),\n 'T1600' => Mage::helper('paypalmx')->__('Funding'),\n 'T1700' => Mage::helper('paypalmx')->__('General: Withdrawal to Non-Bank Entity'),\n 'T1701' => Mage::helper('paypalmx')->__('WorldLink Withdrawal'),\n 'T1800' => Mage::helper('paypalmx')->__('Buyer Credit Payment'),\n 'T1900' => Mage::helper('paypalmx')->__('General Adjustment without businessrelated event'),\n 'T2000' => Mage::helper('paypalmx')->__('General (Funds Transfer from PayPal Account to Another)'),\n 'T2001' => Mage::helper('paypalmx')->__('Settlement Consolidation'),\n 'T9900' => Mage::helper('paypalmx')->__('General: event not yet categorized'),\n );\n asort(self::$_eventList);\n }\n }", "function culturefeed_agenda_preprocess_culturefeed_event_short_summary(&$variables) {\n\n _culturefeed_agenda_preprocess_agenda($variables);\n _culturefeed_agenda_preprocess_agenda_summary($variables);\n _culturefeed_agenda_preprocess_event($variables);\n\n}", "public function inputToSelectProblems()\n {\n $problems = $this->problem->getKeyValueAllOrderBy('id','name','id');\n foreach ($problems as $problem_id => $problem_name) {\n $problems[$problem_id] = $problem_id . ' - ' . $problem_name;\n }\n return $problems;\n }", "public function facetSuggestAction()\n {\n $suggestBlock = $this->getLayout()->createBlock('smile_elasticsearch/catalog_layer_filter_attribute_suggest');\n $this->getResponse()->setBody($suggestBlock->toHtml());\n }", "public function getDescriptions() {\n return $this->description;\n }" ]
[ "0.553213", "0.5427837", "0.53544545", "0.49343103", "0.48629552", "0.4823641", "0.4740905", "0.47385657", "0.46975017", "0.462215", "0.4614743", "0.4611934", "0.46090177", "0.46059406", "0.46044943", "0.4604063", "0.46017823", "0.45786607", "0.4555357", "0.45505065", "0.4545333", "0.45432764", "0.45215398", "0.45184323", "0.45074674", "0.4507097", "0.4507097", "0.4507097", "0.4507097", "0.44886062", "0.44878054", "0.4478897", "0.44646913", "0.44555676", "0.44549632", "0.44525608", "0.44453967", "0.44453132", "0.4440326", "0.4436252", "0.44305503", "0.44305503", "0.44305503", "0.44166696", "0.44081706", "0.44072917", "0.44050884", "0.44044378", "0.43890896", "0.4387689", "0.4383145", "0.43634498", "0.43581328", "0.4355399", "0.4351796", "0.43477622", "0.4339087", "0.43380126", "0.43376443", "0.4326796", "0.43259057", "0.43210074", "0.43179572", "0.4310023", "0.43029603", "0.4293288", "0.42928421", "0.4274328", "0.42681497", "0.42645824", "0.42594215", "0.425596", "0.4252713", "0.42500407", "0.42495018", "0.42478618", "0.42393446", "0.4233828", "0.4233441", "0.42332843", "0.4229923", "0.4229607", "0.42242998", "0.42235023", "0.4219685", "0.42189148", "0.42163956", "0.42163453", "0.4215371", "0.4215288", "0.42089966", "0.42067796", "0.41972747", "0.41966048", "0.41927385", "0.41885662", "0.418418", "0.41822758", "0.41786498", "0.4176644" ]
0.41969323
93
Award bonus to user
public function give_stage_matching_bonus($amount, $stage, $matching_type) { Log::channel('bonus')->info('Awarding Matching Bonus For User: ' . $this->id); $new_trx = new Transaction(); $new_trx->amount = $amount; $new_trx->status = 'created'; $new_trx->type = 'bonus'; $new_trx->user_id = $this->id; $new_bonus_trx = new Bonus(); $new_bonus_trx->user_id = $this->id; $new_bonus_trx->amount = $amount; $new_bonus_trx->status = 'created'; $new_bonus_trx->type = "{$matching_type}_{$stage}_matching"; $new_bonus_trx->save(); $new_bonus_trx->transaction()->save($new_trx); $new_trx->status = 'completed'; $new_trx->update(); $this->bonus += $new_trx->amount; $this->update(); Log::channel('bonus')->info('Awarding User: ' . $this->id . " {$matching_type} {$stage} " . " Matching Bonus: " . $amount . " Completed"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function set_bonus($bonus) {\n\t\t$this->_bonus = $bonus;\n\t}", "function construct_account_bonus($userid = 0, $mode = 'active')\n\t{\n\t\tglobal $ilance, $phrase, $page_title, $area_title, $ilconfig, $ilpage;\n\t\t$sql = $ilance->db->query(\"\n\t\t\tSELECT first_name, username, email\n\t\t\tFROM \" . DB_PREFIX . \"users\n\t\t\tWHERE user_id = '\" . intval($userid) . \"'\n\t\t\", 0, null, __FILE__, __LINE__);\n\t\tif ($ilance->db->num_rows($sql) > 0)\n\t\t{\n\t\t\t$res = $ilance->db->fetch_array($sql, DB_ASSOC);\n\t\t\t$username = stripslashes($res['username']);\n\t\t\t$firstname = stripslashes($res['first_name']);\n\t\t\t$email = $res['email'];\n\t\t\t$account_bonus = '0.00';\n\t\t\t// let's determine the email sending logic \n\t\t\tif (isset($mode))\n\t\t\t{\n\t\t\t\tswitch ($mode)\n\t\t\t\t{\n\t\t\t\t\tcase 'active':\n\t\t\t\t\t{\n\t\t\t\t\t\t// this is an active member registering so we will:\n\t\t\t\t\t\t// - create a credit transaction\n\t\t\t\t\t\t// - send bonus email to new member\n\t\t\t\t\t\t// - send bonus email to admin\n\t\t\t\t\t\t// - return the account bonus amount to the calling script\n\t\t\t\t\t\tif ($ilconfig['registrationupsell_bonusactive'] AND $ilconfig['registrationupsell_amount'] > 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$account_bonus = sprintf(\"%01.2f\", $ilconfig['registrationupsell_amount']);\n\t\t\t\t\t\t\t$newinvoiceid = $ilance->accounting->insert_transaction(\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\tintval($userid),\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t$ilconfig['registrationupsell_bonusitemname'],\n\t\t\t\t\t\t\t\tsprintf(\"%01.2f\", $ilconfig['registrationupsell_amount']),\n\t\t\t\t\t\t\t\tsprintf(\"%01.2f\", $ilconfig['registrationupsell_amount']),\n\t\t\t\t\t\t\t\t'paid',\n\t\t\t\t\t\t\t\t'credit',\n\t\t\t\t\t\t\t\t'account',\n\t\t\t\t\t\t\t\tDATETIME24H,\n\t\t\t\t\t\t\t\tDATEINVOICEDUE,\n\t\t\t\t\t\t\t\tDATETIME24H,\n\t\t\t\t\t\t\t\t'{_thank_you_for_becoming_a_member_on_our_marketplace_please_enjoy_your_stay}',\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t1,\n\t\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t0\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"invoices\n\t\t\t\t\t\t\t\tSET isregisterbonus = '1'\n\t\t\t\t\t\t\t\tWHERE invoiceid = '\" . intval($newinvoiceid) . \"'\n\t\t\t\t\t\t\t\");\n\t\t\t\t\t\t\t$ilance->email->mail = $email;\n\t\t\t\t\t\t\t$ilance->email->slng = fetch_site_slng();\n\t\t\t\t\t\t\t$ilance->email->get('registration_account_bonus');\t\t\n\t\t\t\t\t\t\t$ilance->email->set(array(\n\t\t\t\t\t\t\t\t'{{user}}' => $firstname,\n\t\t\t\t\t\t\t\t'{{username}}' => $username,\n\t\t\t\t\t\t\t\t'{{bonus_amount}}' => strip_tags($ilance->currency->format($ilconfig['registrationupsell_amount'])),\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\t$ilance->email->send();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tcase 'unverified':\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t} \n\t\t\t\t\tcase 'moderated':\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $account_bonus;\n\t}", "function setReward($points, $rewardArray, $name, $email){\n\t\tif(($rewardArray['500'] != 500) && ($points >= 500)){ //one time award at 500 points\n\t\t\t$rewardArray['100'] += 100;\n\t\t\t$reward = \"100 => \".$rewardArray['100'].\", 250 => \".$rewardArray['250'].\", 500 => 500\";\n\t\t\t$sql = \"UPDATE users SET reward = '$reward' \";\n\t\t\t$result = $this->db->query($sql);\n\n\t\t\t$code = 'Chat_'.RandomString(10);\n\t\t\t$ckey = '';\n\n\t\t\t$this->createCoupon($code, $ckey, $email);\n\t\t\t$this->sendReward('Have an interview with our expert staff and be highlighted on our blog and homepage.', $name, $email, $code);\n\t\t} elseif($points >= $rewardArray['100']){ // every 100\n\t\t\t$rewardArray['100'] += 100;\n\t\t\t$reward = \"100 => \".$rewardArray['100'].\", 250 => \".$rewardArray['250'].\", 500 =>\".$rewardArray['500'];\n\t\t\t$sql = \"UPDATE users SET reward = '$reward' \";\n\t\t\t$result = $this->db->query($sql);\n\n\t\t\t$code = 'rew_'.RandomString(16);\n\t\t\t$ckey = 6;\n\n\t\t\t$this->createCoupon($code, $ckey, $email);\n\t\t\t$this->sendReward('20% off any single non-sale item', $name, $email, $code); \n\t\t}\n\t\t\n\t\tif($points > $rewardArray['250']){ //every 250\n\t\t\t$rewardArray['250'] += 250;\n\t\t\t$reward = \"100 => \".$rewardArray['100'].\", 250 => \".$rewardArray['250'].\", 500 =>\".$rewardArray['500'];\n\t\t\t$sql = \"UPDATE users SET reward = '$reward' \";\n\t\t\t$result = $this->db->query($sql);\n\n\t\t\t$code = 'rew_'.RandomString(16);\n\t\t\t$ckey = 2;//free shipping coupon\n\n\t\t\t$this->createCoupon($code, $ckey, $email);\n\t\t\t$this->sendReward('Free Ground shipping for US domestic or $10 off intenational shipping', $name, $email, $code);\n\t\t}\n\t\t\n\t}", "public function awardExperience(Request $request){\n\t\t$from = Auth::user();\n\t\t$amount = $request->amount;\n\t\t$user = User::find($request->user['id']);\n\n\t\t$user->load('progression'); \n\t\t$user->progression->awardExperience($amount);\n\n\t\treturn $user;\n\t}", "public function updateReward($UserID) { $Rank = $this->rank($UserID);\n $SpecialRank = $this->specialRank($UserID);\n $HasAll = $SpecialRank == MAX_SPECIAL_RANK;\n $Counter = 0;\n $Insert = array();\n $Values = array();\n $Update = array();\n\n $Insert[] = \"UserID\";\n $Values[] = \"'$UserID'\";\n if ($Rank >= 1 || $HasAll) {\n }\n if ($Rank >= 2 || $HasAll) {\n if (isset($_POST['donor_icon_mouse_over_text'])) {\n $IconMouseOverText = db_string($_POST['donor_icon_mouse_over_text']);\n $Insert[] = \"IconMouseOverText\";\n $Values[] = \"'$IconMouseOverText'\";\n $Update[] = \"IconMouseOverText = '$IconMouseOverText'\";\n }\n $Counter++;\n }\n if ($Rank >= 3 || $HasAll) {\n if (isset($_POST['avatar_mouse_over_text'])) {\n $AvatarMouseOverText = db_string($_POST['avatar_mouse_over_text']);\n $Insert[] = \"AvatarMouseOverText\";\n $Values[] = \"'$AvatarMouseOverText'\";\n $Update[] = \"AvatarMouseOverText = '$AvatarMouseOverText'\";\n }\n $Counter++;\n }\n if ($Rank >= 4 || $HasAll) {\n if (isset($_POST['donor_icon_link'])) {\n $CustomIconLink = db_string($_POST['donor_icon_link']);\n if (!Misc::is_valid_url($CustomIconLink)) {\n $CustomIconLink = '';\n }\n $Insert[] = \"CustomIconLink\";\n $Values[] = \"'$CustomIconLink'\";\n $Update[] = \"CustomIconLink = '$CustomIconLink'\";\n }\n $Counter++;\n }\n\n for ($i = 1; $i <= $Counter; $i++) {\n $this->addProfileInfoReward($i, $Insert, $Values, $Update);\n }\n if ($Rank >= MAX_RANK || $HasAll) {\n if (isset($_POST['donor_icon_custom_url'])) {\n $CustomIcon = db_string($_POST['donor_icon_custom_url']);\n if (!Misc::is_valid_url($CustomIcon)) {\n $CustomIcon = '';\n }\n $Insert[] = \"CustomIcon\";\n $Values[] = \"'$CustomIcon'\";\n $Update[] = \"CustomIcon = '$CustomIcon'\";\n }\n $this->updateTitle($UserID, $_POST['donor_title_prefix'], $_POST['donor_title_suffix'], $_POST['donor_title_comma']);\n $Counter++;\n }\n if ($SpecialRank >= 4) {\n if (isset($_POST['second_avatar'])) {\n $SecondAvatar = db_string($_POST['second_avatar']);\n if (!Misc::is_valid_url($SecondAvatar)) {\n $SecondAvatar = '';\n }\n $Insert[] = \"SecondAvatar\";\n $Values[] = \"'$SecondAvatar'\";\n $Update[] = \"SecondAvatar = '$SecondAvatar'\";\n }\n if (isset($_POST['limitedcolor']) && (preg_match('/^#[a-fA-F0-9]{6}$/', $_POST['limitedcolor']) || $_POST['limitedcolor'] == '')) {\n $ColorUsername = db_string($_POST['limitedcolor']);\n $Insert[] = \"ColorUsername\";\n $Values[] = \"'$ColorUsername'\";\n $Update[] = \"ColorUsername = '$ColorUsername'\";\n }\n }\n if ($SpecialRank >= 5) {\n if (isset($_POST['unlimitedcolor']) && (preg_match('/^#[a-fA-F0-9]{6}$/', $_POST['unlimitedcolor']) || $_POST['unlimitedcolor'] == '')) {\n $ColorUsername = db_string($_POST['unlimitedcolor']);\n $Insert[] = \"ColorUsername\";\n $Values[] = \"'$ColorUsername'\";\n $Update[] = \"ColorUsername = '$ColorUsername'\";\n }\n if (isset($_POST['gradientscolor']) && (preg_match('/^#[a-fA-F0-9]{6}(,#[a-fA-F0-9]{6}){1,2}$/', $_POST['gradientscolor']) || $_POST['gradientscolor'] == '')) {\n $GradientsColor = db_string($_POST['gradientscolor']);\n $Insert[] = \"GradientsColor\";\n $Values[] = \"'$GradientsColor'\";\n $Update[] = \"GradientsColor = '$GradientsColor'\";\n }\n }\n $Insert = implode(', ', $Insert);\n $Values = implode(', ', $Values);\n $Update = implode(', ', $Update);\n if ($Counter > 0) {\n $QueryID = $this->db->get_query_id();\n $this->db->query(\"\n\t\t\t\tINSERT INTO donor_rewards\n\t\t\t\t\t($Insert)\n\t\t\t\tVALUES\n\t\t\t\t\t($Values)\n\t\t\t\tON DUPLICATE KEY UPDATE\n\t\t\t\t\t$Update\");\n $this->db->set_query_id($QueryID);\n }\n $this->cache->delete_value(\"donor_profile_rewards_$UserID\");\n $this->cache->delete_value(\"donor_info_$UserID\");\n }", "public function creating(Bonus $bonus)\n {\n $bonus->paid = false;\n }", "public function award_view($user_id,$req_id,$prop_id)\n\t{\n\t\t\n\t\tDB::update('update gigs set request_status=\"1\",giger_id=\"'.$user_id.'\" where gid = ?', [$req_id]);\n\t\t\n\t\tDB::update('update request_proposal set award=\"1\" where prp_id = ?', [$prop_id]);\n\t\treturn redirect()->back()->with('success', 'Great! Freelancers has been awarded successfully!');\n\t\t\n\t}", "public function subHandleBonusIndecated($userId, $amount)\n {\n $wallet = $this->wallet->findWhere(['user_id' => $userId])->first();\n $walletExpire = $this->walletExpire->findWhere(['wallet_id' => $wallet->id])->sortByDesc('id')->first();\n $periodExpire = $this->periodExpire->first();\n $dateExpire = Carbon::now()->addMonths($periodExpire->sum_month);\n if (!$walletExpire) {\n $this->subBonusTransaction($userId, $amount, $dateExpire, $wallet, $periodExpire, StatusConstant::BONUS_TYPE_ADMIN);\n } else {\n // check expire wallet\n if (Carbon::now()->lte($walletExpire->expire_date)) {\n $total = (float) $amount + (float) $walletExpire->amount;\n $this->walletExpire->updateDateExpire($walletExpire->id, $total, $dateExpire, $periodExpire->id);\n $idWalletTrans = $this->walletTrans->createWalletTrans($wallet->id, $amount, StatusConstant::TRANSACTION_TYPE_WALLET_EXPIRE, $walletExpire->id, null, StatusConstant::TRANSACTION_BONUS);\n $this->bonusRepo->createBonus($userId, null, $amount, $idWalletTrans, $walletExpire->id, StatusConstant::BONUS_TYPE_ADMIN);\n } else {\n $this->subBonusTransaction($userId, $amount, $dateExpire, $wallet, $periodExpire, StatusConstant::BONUS_TYPE_ADMIN);\n }\n }\n\n // send notifications when bonus\n $this->noticesService->noticeBonusUser($userId, $amount, $dateExpire);\n }", "public function reward(Request $request)\n {\n $this->user->achievement()->update([\n 'points' => ($this->user->achievement->points - $request->rewardPoints)\n ]);\n $this->user->rewards()->attach($request->rewardId, ['id' => Str::random()]);\n\n return response()->json([\n 'message' => \"Confirmation sent. Just present your reference # to the department office to claim your reward.\\n\\nReference #: {$this->user->rewards->first()->pivot->id}\"\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}", "private function updateBalance()\n {\n if (!auth()->user()->hasRole('admin')) {\n auth()->user()->update([\n 'credit' => auth()->user()->credit - $this->totalCost()\n ]);\n }\n }", "public function get_bonus() {\n\t\treturn $this->_bonus;\n\t}", "public function getBonus()\n {\n return $this->bonus;\n }", "public function getBonus()\n {\n return $this->bonus;\n }", "public function getBonus()\n {\n return $this->bonus;\n }", "public function created(Bonus $bonus)\n {\n $bonus->transaction()->create([\n 'user_id' => $bonus->user_id,\n 'type' => Transaction::TYPE_RECEIPTS_EXTRA,\n 'description' => $bonus->description,\n 'score' => $bonus->score,\n 'current_score' => $bonus->user->score + $bonus->score\n ]);\n $bonus->updateQuietly(['paid' => true]);\n }", "private function giveTriviaReward($username)\n {\n $multiplier = $_SESSION[$this->correctAnswers];\n\n $totalGold = ($this->goldReward * $multiplier);\n\n $totalExp = ($this->expReward * ($multiplier / 2));\n\n $this->userRep->updateUserGold($username, $totalGold);\n $this->userRep->updateUserExp($username, $totalExp);\n\n $this->userDataCalc($username);\n\n $this->notify->info('(Trivia)Reward: '.$totalGold.' gold and '. $totalExp.' exp.');\n }", "public function gainReputation($points)\n {\n $this->increment('reputation', $points);\n }", "public function payForInvitedUsers(){\n \n $userService = parent::getService('user','user');\n \n $refererUsers = $userService->getUsersWithRefererNotPaid();\n foreach($refererUsers as $user):\n // if created at least 30 days ago\n if(strtotime($user['created_at'])>strtotime('-30 days')){\n continue;\n }\n // if logged within last 5 days ago\n if(!(strtotime($user['last_active'])>strtotime('-7 days'))){\n $user->referer_not_active = 1;\n $user->save();\n continue;\n }\n \n $values = array();\n $values['description'] = 'Referencing FastRally to user '.$user['username'];\n $values['income'] = 1;\n \n \n if($user['gold_member_expire']!=null){\n $amount = 100;\n }\n else{\n $amount = 10;\n }\n \n \n $userService->addPremium($user['referer'],$amount,$values);\n $user->referer_paid = 1;\n $user->save();\n endforeach;\n echo \"done\";exit;\n }", "function warquest_daily_bonus() {\r\n\r\n\t/* input */\r\n\tglobal $config;\r\n\t\r\n\t/* output */\r\n\tglobal $player;\r\n\tglobal $page;\r\n\t\t\r\n\tif ($player->holiday_date > date(\"Y-m-d H:i:s\", time())) {\r\n\t\r\n\t\t/* No bonus if holiday is activated! */\r\n\t\treturn;\r\n\t}\r\n\t\t\t\t\r\n\tif (date(\"Y-m-d\",strtotime( $player->bonus_date)) != date(\"Y-m-d\")) {\r\n\t\r\n\t\t/* Update last_login date for player with long session (>24h) */\r\n\t\t$member = warquest_db_member($player->pid);\r\n\t\t$member->last_login = date(\"Y-m-d H:i:s\");\t\t\t\t\r\n\t\twarquest_db_member_update($member);\r\n\t\t\t\t\r\n\t\t/* Add bonus */\r\n\t\t$money = $config[\"init_money\"] * $player->lid * rand(20,40);\r\n\r\n\t\t$player->bonus_date = date(\"Y-m-d H:i:s\");\r\n\t\t$player->money += $money;\r\n\t\t\r\n\t\t$log = 'Daily bonus '.number_format2($money);\t\t\r\n\t\twarquest_user_log($player, $log);\r\n\t\r\n\t\t/* Create message */\r\n \t\tif ($money>0) {\r\n\t\t\t$message = t('HOME_DAILY_BONUS', money_format1($money) );\t\t\r\n\t\t\t$page .= warquest_box_icon(\"info\", $message);\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t/* One year WarQuest bonus */\r\n\t\tif ( date(\"Y-m-d\", strtotime(\"08-02-2012\")) == date(\"Y-m-d\") ) {\r\n\t\t\t\r\n\t\t\t$skill = warquest_db_skill($player->pid);\r\n\t\t\t$skill->skill_points+= 10;\r\n\t\t\twarquest_db_skill_update($skill);\r\n\t\t\t\r\n\t\t\t$bonus = 10000000000;\r\n\t\t\t$player->bank1+=$bonus;\t\t\r\n\t\t\twarquest_db_bank_insert($player->pid, 0, 1, $bonus, $player->bank1, 6);\t\t\t\t\r\n\t\t}\t\r\n\t}\t\t\r\n}", "function awardForCapture($specsOwned, $mugsOwned, $sausageRollsOwned)\n{\n $award = 10 * (($specsOwned * $mugsOwned * $sausageRollsOwned)/2);\n return $award;\n}", "public function updateUserAccountBalance($targetUser, $addedAmt, $userID){\n //get user's accout balance\n $accBal = intval($this->UserAaccBalance($targetUser));\n //add it to the amount funded\n $newBal = $accBal + $addedAmt;\n //update back the user bal\n $newBalFields=[\n 'balance'=>$newBal\n ];\n if(!$this->update($userID, $newBalFields)) //LOG ERROR ACTION\n return false;\n return true;\n }", "public static function redeem($id, $user)\n {\n $reward = Reward::find($id);\n\n if (!$reward) {\n throw SystemException(Lang::get('dma.friends.exceptions.missingReward', ['id' => $id]));\n }\n\n try {\n\n // Check overall inventory\n if ($reward->inventory !== null && $reward->inventory == 0) {\n Session::put('rewardError', Lang::get('dma.friends::lang.rewards.noInventory'));\n return;\n }\n\n // Check a users individual inventory\n $count = $user\n ->rewards()\n ->where('reward_id', $reward->id)\n ->count();\n\n if (!empty($reward->user_redeem_limit) && $count >= $reward->user_redeem_limit) {\n Session::put('rewardError', Lang::get('dma.friends::lang.rewards.alreadyRedeemed'));\n return;\n }\n\n $userExtend = new UserExtend($user);\n\n if ($userExtend->removePoints($reward->points, false)) {\n\n if ($reward->inventory > 0) {\n $reward->inventory--;\n $reward->save();\n }\n \n $user->rewards()->save($reward);\n \n Event::fire('dma.friends.reward.redeemed', [$reward, $user]);\n\n $params = [\n 'user' => $user,\n 'object' => $reward,\n ];\n\n FriendsLog::reward($params);\n // TODO handle printing of reward coupon\n\n Session::put('rewardMessage', Lang::get('dma.friends::lang.rewards.redeemed', ['title' => $reward->title]));\n } else {\n Session::put('rewardError', Lang::get('dma.friends::lang.rewards.noPoints'));\n }\n } catch (Exception $e) {\n throw SystemException(Lang::get('dma.friends.exceptions.rewardFailed'));\n }\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'amount' => 'required|numeric|min:100|regex:/(^([0-9]+$)+)/',\n 'userid' => 'required',\n ]);\n \n $personToPay = user::where('ref_no', $request->upline)->first();\n $bonus = $request->amount*10/100;\n $pendingTransaction = $request->amount - $bonus;\n\n $commit = new bonus;\n $commit->amount = $bonus;\n $commit->payid = $request->userid;\n $commit->receiverid = $personToPay->id;\n $commit->receivername = $personToPay->account_name;\n $commit->receiverphone = $personToPay->phoneprefix.$personToPay->phonenumber;\n $commit->receiverbank = $personToPay->bank;\n $commit->receiveraccount = $personToPay->account_no;\n $commit->save();\n\n return redirect(route('home'))->with('buy_message', 'You have been assigned to pay your upline a bonus of 10% of your donation which is ₦'.$bonus.'. Please make this payment immediately and contact the user for confirmation.');\n }", "public function updateBankerCredit()\n {\n $user = User::whereHas(\"roles\", function($q){$q->where(\"name\", \"Banker\");})->first();\n\n $total = Credit::where('credit_type', 0)->sum('value');\n $user->free_credits = $total;\n $total = Credit::where('credit_type', 1)->sum('value');\n $user->paid_credits = $total;\n $user->save();\n }", "public function redeemGift(Request $request){\n\t\t$user = Auth::user();\n\t\t$user->load(['progression', 'rewards']); \n\t\t$reward_id = request('reward');\n\t\t$pivot_id = request('pivot');\n\t\tLog::info(\"here we go\");\n\t\t$info = $request->all();\n\t\tLog::info($info);\n\t\tLog::info($reward_id);\n\t\tLog::info($request->all());\n\t\tif($reward_id === 5){\n\t\t\t$user->progression->awardExperience(500);\n\t\t\t//announce\n\t\t}\n\t\t$reward = Reward::find($reward_id);\n\t\t//$user->rewards()->having('id', $reward_id)->update(['status' => 'redeemed']);\n\t\t$user->rewards()->wherePivot('id', $pivot_id)->updateExistingPivot($reward_id, ['status' => 'redeemed']);\n\t\t$return = User::find($user->id); \n\t\t$return->load(['progression', 'rewards']);\n\t\treturn $return;\n\n\t}", "public function assignUserAndUpdateParticipants(Mission $mission, User $user, bool $bonus = false): bool\n {\n DB::beginTransaction();\n\n MissionToUser::create([\n 'mission_id' => $mission->id,\n 'user_id' => $user->id,\n 'completed' => false,\n 'accepted_at' => Carbon::now(),\n 'bonus' => $bonus\n ]);\n\n $mission->update(['participants_current' => ($mission->participants_current + 1)]);\n\n if($mission->participants_max === $mission->participants_current || $mission->closed_at <= Carbon::now()) {\n if ($mission->game == 'fortnite') {\n $response = $this->sendInformationToApi($mission);\n\n if($response['status']) {\n DB::commit();\n\n $mission->update(['status' => 'active']);\n return true;\n }\n\n DB::rollBack();\n return false;\n }\n\n if($mission->game === 'dota2') {\n\n $response = $this->sendInformationToApi($mission);\n\n if($response['status']) {\n DB::commit();\n\n $mission->update(['status' => 'active']);\n return true;\n }\n\n DB::rollBack();\n return false;\n }\n\n DB::commit();\n\n $mission->update(['status' => 'active']);\n return true;\n }\n\n DB::commit();\n return true;\n }", "function approveMember($userId) {\r\n $sql = $this->db->prepare(\"UPDATE USER SET type=2 WHERE UserID=:user_id\");\r\n $sql->execute(array('user_id' => $userId));\r\n return true;\r\n }", "public function setAwardAmount($value)\n {\n return $this->set('AwardAmount', $value);\n }", "public function setBonus($bonus)\n {\n $this->bonus = $bonus;\n\n return $this;\n }", "public function setBonus($bonus)\n {\n $this->bonus = $bonus;\n\n return $this;\n }", "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 }", "function rh_award_new_role_mycred( $reply, $request, $mycred ) {\n if ( $reply === false ) return $reply;\n\n // Exclude admins\n if ( user_can( $request['user_id'], 'manage_options' ) ) return $reply;\n\n extract( $request );\n\n $rolechangedarray = rehub_option('rh_award_role_mycred');\n\n $rolechangedarray = explode('PHP_EOL', $rolechangedarray);\n $thresholds = array();\n\n foreach ($rolechangedarray as $key => $value) {\n $values = explode(':', $value);\n if (empty($values[0]) || empty($values[1])) return;\n $roleforchange = trim($values[0]);\n $numberforchange = trim($values[1]); \n $thresholds[$roleforchange] = (int)$numberforchange;\n }\n\n // Get users current balance\n $current_balance = $mycred->get_users_balance( $user_id, $type );\n $current_balance = (int)$current_balance + (int)$amount;\n\n // Check if the users current balance awards a new role\n $new_role = false;\n foreach ( $thresholds as $role => $min ) {\n if ( $current_balance >= $min )\n $new_role = $role;\n }\n\n // Change users role if we have one\n if ( $new_role !== false ){\n if(rehub_option('rh_award_type_mycred') ==1 && function_exists('bp_get_member_type')){\n $roles = bp_get_member_type($user_id, false);\n if(!empty($roles) && is_array($roles)){\n if (!in_array( $new_role, (array) $roles)){\n bp_set_member_type( $user_id, $new_role );\n } \n }else{\n bp_set_member_type( $user_id, $new_role );\n } \n }else{\n $wp_user_object = new WP_User($user_id);\n if(empty($wp_user_object)) return;\n if (!in_array( $new_role, (array) $wp_user_object->roles )){\n $wp_user_object->add_role($new_role);\n } \n }\n }\n return $reply;\n }", "public function credit()\n {\n if (self::hasInvitationCode()) {\n if (!is_null($user = self::whoInvited())) {\n $credit = Credit::where('user_id', $user->id);\n\n if ($credit->count() > 0) {\n $credit->increment('points', 2);\n } else {\n Credit::create([\n 'user_id' => $user->id,\n 'points' => 2\n ]);\n }\n\n return true;\n }\n }\n\n return false;\n }", "public function addUserScore($points, $idUser)\n\t{\n\t\t$user = $this->users->find($idUser);\n\n\t\tif($points === -1) {\n\t\t\t$points = abs($points);\n\t\t\t$score = $user->score - $points;\n\t\t} else {\n\t\t\t$score = $user->score + $points;\n\t\t}\n\t\t$this->db->execute('UPDATE puglife_user SET score = ? WHERE id = ?', [$score, $idUser]);\n\t}", "public function setAwardedBountyAmount($awardedBountyAmount);", "public function addAwardedBountyUser(ShallowUserInterface $awardedBountyUser);", "function awardPoints($type, $member_id){\n\t\trequire('variables.php');\n\t\tif($this->isPublished()){ // check if quiz is published\n\t\t\trequire('quizrooDB.php');\n\t\t\t\t\n\t\t\t// store the current level of the quiz creator\n\t\t\t$creator_old_level = $this->creator('level');\n\t\t\t$creator_old_rank = $this->creator('rank');\n\t\t\t\n\t\t\tswitch($type){\t\t\t\t\n\t\t\t\tcase -2: // penalty deduction for 'dislike' rating\n\t\t\t\t\n\t\t\t\t// check if taker has already disliked\n\t\t\t\tif($this->getRating($member_id) != -1 && $GAME_ALLOW_DISLIKE){ // also check if dislikes are allowed by the system\n\t\t\t\t\t// deduct the quiz score\n\t\t\t\t\tif($this->quiz_score > 0){ // check if quiz score is more than 0\n\t\t\t\t\t\t// deduct the quiz score and increment the dislike count\n\t\t\t\t\t\t$query = sprintf(\"UPDATE q_quizzes SET quiz_score = quiz_score - %d, dislikes = dislikes + 1 WHERE quiz_id = %d\", $GAME_BASE_POINT * 2, $this->quiz_id);\n\t\t\t\t\t\tmysql_query($query, $quizroo) or die(mysql_error());\n\t\t\n\t\t\t\t\t\t// update the creator's points\n\t\t\t\t\t\t$query = sprintf(\"UPDATE s_members SET quizcreator_score = quizcreator_score - %d, quizcreator_score_today = quizcreator_score_today - %d WHERE member_id = %s\", $GAME_BASE_POINT * 2, $GAME_BASE_POINT * 2, $this->fk_member_id);\n\t\t\t\t\t\tmysql_query($query, $quizroo) or die(mysql_error());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// log the id of the awarder\n\t\t\t\t\tif($this->getRating($member_id) != 0){ // check if member has rated before\n\t\t\t\t\t\t// do an update if member has rated this quiz before\n\t\t\t\t\t\t$query = sprintf(\"UPDATE q_store_rating SET rating = %d WHERE fk_quiz_id = %d AND fk_member_id = %s\", -1, $this->quiz_id, $member_id);\n\t\t\t\t\t\tmysql_query($query, $quizroo) or die(mysql_error());\t\t\t\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\t// do an insert if member is rating this quiz for the first time\n\t\t\t\t\t\t$query = sprintf(\"INSERT INTO q_store_rating(fk_member_id, fk_quiz_id, rating) VALUES(%d, %d, %d)\", $member_id, $this->quiz_id, -1);\n\t\t\t\t\t\tmysql_query($query, $quizroo) or die(mysql_error());\t\t\t\t\t\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbreak; // end case -2\n\t\t\t\t\n\t\t\t\tcase -1: // minus the point given during the 'like'\n\t\t\t\t// we make sure quiz was already liked\n\t\t\t\tif($this->getRating($member_id) == 1){\n\t\t\t\t\t// deduct the quiz score\n\t\t\t\t\t$query = sprintf(\"UPDATE q_quizzes SET quiz_score = quiz_score - %d, likes = likes - 1 WHERE quiz_id = %d\", $GAME_BASE_POINT, $this->quiz_id);\n\t\t\t\t\tmysql_query($query, $quizroo) or die(mysql_error());\n\t\t\t\t\t\n\t\t\t\t\t// update the creator's points\n\t\t\t\t\t$query = sprintf(\"UPDATE s_members SET quizcreator_score = quizcreator_score - %d, quizcreator_score_today = quizcreator_score_today - %d WHERE member_id = %s\", $GAME_BASE_POINT, $GAME_BASE_POINT, $this->fk_member_id);\n\t\t\t\t\tmysql_query($query, $quizroo) or die(mysql_error());\n\t\t\t\t\t\n\t\t\t\t\t// update member has rating of this quiz\n\t\t\t\t\t$query = sprintf(\"DELETE FROM q_store_rating WHERE fk_quiz_id = %d AND fk_member_id = %s\", $this->quiz_id, $member_id);\n\t\t\t\t\tmysql_query($query, $quizroo) or die(mysql_error());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbreak; // end case -1\n\t\t\t\t\t\t\t\n\t\t\t\tcase 0:\t// award the base points or bonus award for 'like' rating\t\t\n\t\t\t\tcase 1: // bonus award for 'like' rating\n\t\t\t\tdefault:// default case for no type specified\n\t\t\t\t\n\t\t\t\t// check if taker has already liked\n\t\t\t\tif($this->getRating($member_id) != 1){\n\t\t\t\t\t// precheck the level table to see if there's a levelup\n\t\t\t\t\t$queryCheck = sprintf(\"SELECT id FROM `g_levels` WHERE points <= (SELECT `quiztaker_score`+`quizcreator_score` FROM s_members WHERE member_id = %s)+%s ORDER BY points DESC LIMIT 0, 1\", $this->fk_member_id, $GAME_BASE_POINT);\n\t\t\t\t\t$getCheck = mysql_query($queryCheck, $quizroo) or die(mysql_error());\n\t\t\t\t\t$row_getCheck = mysql_fetch_assoc($getCheck);\n\t\t\t\t\t$creator_new_level = $row_getCheck['id'];\n\t\t\t\t\tmysql_free_result($getCheck);\n\t\t\t\t\t\n\t\t\t\t\t// precheck the rank table to see if there's a leveluo\n\t\t\t\t\t$queryCheck = sprintf(\"SELECT fk_id FROM `g_ranks` WHERE `min` <= %d ORDER BY `min` DESC LIMIT 0, 1\", $creator_new_level);\n\t\t\t\t\t$getCheck = mysql_query($queryCheck, $quizroo) or die(mysql_error());\n\t\t\t\t\t$row_getCheck = mysql_fetch_assoc($getCheck);\n\t\t\t\t\t$creator_new_rank = $row_getCheck['fk_id'];\n\t\t\t\t\tmysql_free_result($getCheck);\n\t\t\t\t\t\n\t\t\t\t\tif($creator_new_level > $creator_old_level){ // a levelup has occurred, update the achievement log\n\t\t\t\t\t\t$queryUpdate = sprintf(\"INSERT INTO g_achievements_log(fk_member_id, fk_achievement_id) VALUES(%d, %d)\", $this->creator('member_id'), $creator_new_level);\n\t\t\t\t\t\tmysql_query($queryUpdate, $quizroo) or die(mysql_error());\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($creator_new_rank > $creator_old_rank){ // a rankup also occurred, update the achievement log\n\t\t\t\t\t\t\t$queryUpdate = sprintf(\"INSERT INTO g_achievements_log(fk_member_id, fk_achievement_id) VALUES(%d, %d)\", $this->creator('member_id'), $creator_new_level);\n\t\t\t\t\t\t\tmysql_query($queryUpdate, $quizroo) or die(mysql_error());\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// update the creator's points and increment the level and rank\n\t\t\t\t\t\t\t$query = sprintf(\"UPDATE s_members SET quizcreator_score = quizcreator_score + %d, quizcreator_score_today = quizcreator_score_today + %d, level = %d, rank = %d WHERE member_id = %s\", $GAME_BASE_POINT, $GAME_BASE_POINT, $creator_new_level, $creator_new_rank, $this->fk_member_id);\n\t\t\t\t\t\t\tmysql_query($query, $quizroo) or die(mysql_error());\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t// update the creator's points and increment the level\n\t\t\t\t\t\t\t$query = sprintf(\"UPDATE s_members SET quizcreator_score = quizcreator_score + %d, quizcreator_score_today = quizcreator_score_today + %d, level = %d WHERE member_id = %s\", $GAME_BASE_POINT, $GAME_BASE_POINT, $creator_new_level, $this->fk_member_id);\n\t\t\t\t\t\t\tmysql_query($query, $quizroo) or die(mysql_error());\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{\n\t\t\t\t\t\t// no levelup, just update the creator's points\n\t\t\t\t\t\t$query = sprintf(\"UPDATE s_members SET quizcreator_score = quizcreator_score + %d, quizcreator_score_today = quizcreator_score_today + %d WHERE member_id = %s\", $GAME_BASE_POINT, $GAME_BASE_POINT, $this->fk_member_id);\n\t\t\t\t\t\tmysql_query($query, $quizroo) or die(mysql_error());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// update the quiz score\n\t\t\t\t\tif($type == 1){ // also increment the like count\n\t\t\t\t\t\t$query = sprintf(\"UPDATE q_quizzes SET quiz_score = quiz_score + %d, likes = likes + 1 WHERE quiz_id = %d\", $GAME_BASE_POINT, $this->quiz_id);\n\t\t\t\t\t\tmysql_query($query, $quizroo) or die(mysql_error());\n\t\t\t\t\t}else{ // just update the score\n\t\t\t\t\t\t$query = sprintf(\"UPDATE q_quizzes SET quiz_score = quiz_score + %d WHERE quiz_id = %d\", $GAME_BASE_POINT, $this->quiz_id);\n\t\t\t\t\t\tmysql_query($query, $quizroo) or die(mysql_error());\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif($type == 1){\t\t\t\n\t\t\t\t\t\t// log the id of the awarder\n\t\t\t\t\t\tif($this->getRating($member_id) != 0){ // check if member has rated before\n\t\t\t\t\t\t\t// do an update if member has rated this quiz before\n\t\t\t\t\t\t\t$query = sprintf(\"UPDATE q_store_rating SET rating = %d WHERE fk_quiz_id = %d AND fk_member_id = %s\", 1, $this->quiz_id, $member_id);\n\t\t\t\t\t\t\tmysql_query($query, $quizroo) or die(mysql_error());\t\t\t\t\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t// do an insert if member is rating this quiz for the first time\n\t\t\t\t\t\t\t$query = sprintf(\"INSERT INTO q_store_rating(fk_member_id, fk_quiz_id, rating) VALUES(%d, %d, %d)\", $member_id, $this->quiz_id, 1);\n\t\t\t\t\t\t\tmysql_query($query, $quizroo) or die(mysql_error());\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tbreak; // end case 0, 1\n\t\t\t}\n\t\t}\n\t}", "public function addUserAward(UserAward $l)\n\t{\n\t\tif ($this->collUserAwards === null) {\n\t\t\t$this->initUserAwards();\n\t\t}\n\t\tif (!in_array($l, $this->collUserAwards, true)) { // only add it if the **same** object is not already associated\n\t\t\tarray_push($this->collUserAwards, $l);\n\t\t\t$l->setUser($this);\n\t\t}\n\t}", "public function rateUser()\n {\n\t\t$userSession = \\Utility\\Singleton::getInstance(\"\\Control\\Session\");\n\t\t$userLog = $userSession->get('username');\n\t\t$user = new \\Foundation\\User();\n\t\t$view = \\Utility\\Singleton::getInstance(\"\\View\\Main\");\n\t\t$username=$view->get('userProfile');\n\t\t\n\t\t$hasAlreadyRated=$this->hasVoted($username, $userLog);\n\t\t$vote=$view->get('vote');\n\t\t\n if(!$hasAlreadyRated)\n {\t\t\t\n $votation=$user->usersVotation($username, $userLog, $vote);\n $reliabilityVotes = $user->getNumberOfReliabilityVotes($username);\n \n $user2=$user->getByUsername($username);\n $user2->updateReliabilityScore($reliabilityVotes,$vote);\n \n $isUpdated=$user->updateReliabilityScore($username,$user2->getReliability());\n\n return $votation; /** @todo add a return for the else statement*/\n\t\t}\n // else return something\n\t}", "public function addBalance(KittyInterface $kitty, UserInterface $user, $balance);", "function update_user_credits_by_amount($id_user='', $amount=''){\t\n\t\ttry{\n\t\t\t$this->db->set('credits','credits+'.$amount, FALSE);\n\t\t\t$this->db->where('id', $id_user);\n\t\t\t$result = $this->db->update('user');\n\t\t\tif($this->db->affected_rows()>0){\n\t\t\t\treturn TRUE;\n\t\t\t}else{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}catch(Exception $e){\n\t\t\tlog_message('debug','Error en la función update_user_credits_by_amount');\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function updateUserBalance($user, $sum){\r\n global $pdo;\r\n $stmt = $pdo->prepare('UPDATE users SET UserBalance = UserBalance + :UserBalance WHERE UserID = :UserID');\r\n $stmt->execute(array(':UserBalance' => $sum, ':UserID' => $user));\r\n}", "public function addBonus($model, $bonus = array()){\n // Sanity check\n if(!isset($model) || trim($model) === '') throw new \\Exception('Specificati modelul');\n if(!isset($bonus) || !is_array($bonus)) throw new \\Exception('$bonus trebuie sa fie un array cu bonusuri');\n\n // Set method and action\n $method = 'products';\n $action = 'addBonus';\n\n // Set data\n $data = array('model' => $model, 'bonus' => $bonus);\n\n // Send request and retrieve response\n $result = Dispatcher::send($method, $action, $data);\n\n return $result;\n }", "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}", "function func_bp_core_activated_user($user_id, $key, $user){\n $args = array( 'field' => 'Are You A Coach', 'user_id' => $user_id); \n $_xprofile_coach_yes_no = bp_get_profile_field_data($args); \n if( $_xprofile_coach_yes_no == 'Yes'){ \n\t//change user role to coach \n\t$wp_user = get_user_by('ID', $user_id); \n\t$wp_user->remove_role('subscriber'); \n\t$wp_user->add_role('coach');\n }\n}", "public function createRewardForBirthEvent(User $user): void\n {\n }", "public function getOilBonus() // 1% expa = 0.3% bonusu\n\t{\n\t\treturn $this->getExperience() * 0.2;\n\t}", "function bonus_devident() {\n hitungDevident();\n}", "public function updateUserGetAward($uid)\n\t{\n\t $sql = \"UPDATE casino_user SET status=1 WHERE status=0 AND uid=:uid \";\n\t $this->_wdb->query($sql,array('uid' => $uid));\n\t}", "public function update_tutor_fee($tid,$fee) {\n\t\t$sql = \"UPDATE profile SET money = money + {$fee} WHERE uid = {$tid} \";\n\t\t$query = $this->db->query($sql);\n\t}", "public function update_referral_balance_and_bonus_records_transaction($referrer_id, $new_user_id)\r\n\t{\r\n\t\t$current_date = $this->general->get_local_time('time');\r\n\t\t\r\n\t\t//update referrers bonus\r\n\t\t$this->db->set('balance', 'balance+'.REFER_BONUS, FALSE);\r\n\t\t$this->db->where('id', $referrer_id);\r\n\t\t$this->db->update('members');\r\n\t\t\r\n\t\t//add transaction to transaction table\r\n\t\t$txn_data = array(\r\n\t\t 'user_id' => $referrer_id,\t\t \t\t\r\n\t\t 'credit_get' => REFER_BONUS,\r\n\t\t 'credit_debit' => 'CREDIT',\r\n\t\t 'transaction_name' => lang('referral_bonus').' :'.$new_user_id,\r\n\t\t 'transaction_date' => $current_date,\r\n\t\t 'transaction_type' => 'referer_bonus',\r\n\t\t 'transaction_status' => 'Completed',\r\n\t\t 'payment_method' => 'direct',\r\n\t\t 'current_balance' => 'current_balance +'.$user_total_balance\r\n\t\t\t);\r\n\t\r\n\t\t$this->db->insert('transaction', $txn_data);\r\n\t\treturn $this->db->insert_id(); \t\r\n\t}", "function AwardCredits($grade_obj) {\n $hunt_division = mysql_result(@mysql_query(\"SELECT `hunt_division` FROM `hunts` WHERE `hunt_id` = '$this->hunt_id'\", $this->ka_db), 0, 'hunt_division');\n if (($this->Allowed('allhunts') == true) || (($this->Allowed('hunts') == true) && ($this->CheckDivision($hunt_division) == true))) {\n require_once 'HTML/Table.php';\n if (!$grade_obj) return \"Error in Grade Object. Was not successfully graded or no grade object passed.\";\n $error = false;\n $hunt_type = new Hunt_Type($this->hunt_type, $this->roster_coder);\n $rewards = $this->GetHuntRewards();\n if ($this->GetDivisionID() == -1) $div = \"KA\";\n else {\n //Gets the division name\n $div_obj = $this->GetDivision();\n $div = $div_obj->GetName();\n }\n $center_attr = array('style' => 'text-align: center');\n if ($this->GetHuntFirst()) {\n $ftheader = array('<b><i>First Place ('.number_format($this->GetHuntFirst()).' ICs)</i></b>');\n //Find the first place submission in the grades array\n $full = $grade_obj->GetCorrect($hunt_type->GetNumAnswers());\n if (isset($full[0])) $first = $full[0]->GetID();\n if (!isset($first)) {\n $table = new HTML_Table();\n $table->addrow( $ftheader,\n array(),\n 'TH');\n $table->addrow(array('-None-'), $center_attr);\n print $table->toHTML();\n } else {\n //Make a submission object\n $sub = new Submission($first, $this->roster_coder);\n //Get the person object\n $person_obj = $sub->GetPerson();\n if (!$person_obj->AddCredits($this->GetHuntFirst(), \"First place in \".$div.\"'s \".$hunt_type->GetName().\" \".$this->GetHuntNum())) $error = 'Error awarding credits. '.$person_obj->Error();\n $ftbody = array($person_obj->GetName().' awarded '.number_format($this->GetHuntFirst()).' ICs for first place.');\n $table = new HTML_Table();\n $table->addrow( $ftheader,\n array(),\n 'TH');\n $table->addrow($ftbody);\n print $table->toHTML();\n }\n }\n //Recurses through all the grades. From full points (total/total) to no points (0/total)\n for($i = 0; $i <= $hunt_type->GetNumAnswers(); $i++) {\n $grbody = array();\n $position = ($hunt_type->GetNumAnswers() - $i).\"/\".$hunt_type->GetNumAnswers();\n $num = $hunt_type->GetNumAnswers() - $i;\n $grheader = array(\"<b><i>\".$position.\" Correct (\".number_format($rewards[$i]).\" ICs)</i></b><br />\");\n $subs = $grade_obj->GetCorrect($num, 1);\n for ($j = 0; $j < count($subs); $j++) {\n $sub = $subs[$j];\n if ($sub->GetID() != $first) { //Make sure its not the first place submission\n $person_obj = $sub->GetPerson();\n if (!$person_obj->AddCredits($rewards[$i], $position.\" in \".$div.\"'s \".$hunt_type->GetName().\" \".$this->GetHuntNum())) $error = 'Error awarding credits. '.$person_obj->Error();\n $grbody[$j] = array($person_obj->GetName().' awarded '.number_format($rewards[$i]).' ICs for a score of '.$position);\n }\n }\n $table = new HTML_Table();\n $table->addrow( $grheader,\n array(),\n 'TH');\n if (count($grbody) > 0) {\n for ($j = 0; $j < count($grbody); $j++) {\n $table->addrow($grbody[$j]);\n }\n } else {\n $table->addrow(array('-None-'), $center_attr);\n }\n print $table->toHTML();\n }\n //No efforts\n unset($grbody, $grheader);\n $grbody = array();\n $grheader = array('<b><i>No effort submissions (0 ICs)</i></b><br />');\n $subs = $grade_obj->GetCorrect(0, 0);\n for ($j = 0; $j < count($subs); $j++) {\n $sub = $subs[$j];\n $person_obj = $sub->GetPerson();\n $grbody[$j] = array($person_obj->GetName().' awarded nothing for his/her no effort submission.');\n }\n $table = new HTML_Table();\n $table->addrow( $grheader,\n array(),\n 'TH');\n if (count($grbody) > 0) {\n for ($j = 0; $j < count($grbody); $j++) {\n $table->addrow($grbody[$j]);\n }\n } else {\n $table->addrow(array('-None-'), $center_attr);\n }\n print $table->toHTML(); // End No efforts\n return $error;\n } else {\n $this->roster_error = \"You do not have access to this function.\";\n return \"No access to the function, coder id was not initialized.\";\n }\n }", "protected function ActionToBalanceDo(&$userinfo, $summ, $type) {\n if (!$userinfo) { return 'No user identifier found!'; }\n if (!@is_numeric($summ)) { return $this->GetText('errorpaycheckpar'); }\n switch ($type) {\n\tcase 'sub':\n\t $userinfo['purcedata']-=$summ;\n\t if ($userinfo['purcedata'] < 0) { $userinfo['purcedata'] = 0.00; }\t \n\tbreak;\n\tcase 'add': $userinfo['purcedata']+=$summ; break;\n\tcase 'set': $userinfo['purcedata'] = $summ; break;\t\n\tdefault: return 'Unknow action type `'.$type.'`';\n }\n //update record\n if (!$this->control->db->UPDATEAction('users', array(\n 'purcedata' => $userinfo['purcedata']\n ), \"iduser='{$userinfo['iduser']}'\", \"1\")) { return 'Error in update balance value on user record!'; }\n return '';\n }", "public function getAwardedBountyAmount();", "protected function addDonationToFundraisersTotalRaise()\n {\n $this->fundraiser_profile->addDonation( $this->data['amount'] );\n $this->fundraiser_profile->update();\n }", "function mark_as_awarded()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tif(!empty($data['list'])) $result = $this->_bid->mark_as_awarded(explode('--',$data['list']));\n\t\t\n\t\t$data['msg'] = !empty($result['boolean']) && $result['boolean']? 'The selected bids have been marked as awarded.': 'ERROR: The selected bids could not be awarded.';\n\t\tif(!empty($result['not_awarded'])) {\n\t\t\t$data['msg'] .= \"<BR><BR>The following bids do not qualify to be awarded: \";\n\t\t\tforeach($result['not_awarded'] AS $row){\n\t\t\t\t$data['msg'] .= \"<BR>\".$row['provider'].\" (\".$row['bid_currency'].format_number($row['bid_amount'],3).\")\";\n\t\t\t}\n\t\t}\n\t\t\n\t\t$data['area'] = 'refresh_list_msg';\n\t\t$this->load->view('addons/basic_addons', $data);\n\t}", "function addCredit($credit, $id) { // user_charge.php, user_charge_package_10.php\r\n\r\n\tglobal $mysqli,$db_table_prefix; \r\n\r\n\t\t$stmt = $mysqli->prepare(\"UPDATE \".$db_table_prefix.\"user_credits\r\n\r\n\t\t\tSET\r\n\r\n\t\t\tcredits = credits + ?\r\n\r\n\t\t\tWHERE\r\n\r\n\t\t\tuser_id = ?\r\n\t\t\t\r\n\t\t\tAND credits >= 0\");\r\n\r\n\t$stmt->bind_param(\"ii\", $credit, $id);\r\n\r\n\t$result = $stmt->execute();\r\n\r\n\t$stmt->close();\t\r\n\r\n\treturn $result;\r\n\r\n}", "public static function sumTargetHealBonus(stdClass $data){\n\t\t//limit max earrings to 2\n\t\tself::limit($data, array('oldEarrings', 'newEarrings'), 2);\n\n\t\tif(!$data->includeTargetBonus){\n\t\t\treturn 0;\n\t\t}\n\n\t\t$bonus = 0;\n\t\t$isMw = ($data->chestEnchant==ENCHANT_MW_NINE OR $data->chestEnchant==ENCHANT_MW_TWELVE);\n\n\t\t//earrings\n\t\t$bonus += $data->oldEarrings * BONUS_EARRING_OLD;\n\t\t$bonus += $data->newEarrings * BONUS_EARRING_NEW;\n\n\t\t//earring bonus stats\n\t\tif($data->earringBonusLeft){\n\t\t\t$bonus += MISC::getEarringBonusValue($data->earringBonusLeft);\n\t\t}\n\t\tif($data->earringBonusRight){\n\t\t\t$bonus += MISC::getEarringBonusValue($data->earringBonusRight);\n\t\t}\n\n\t\t//heart potion\n\t\tif($data->heartPotion){\n\t\t\t$bonus += BONUS_HEART_POTION;\n\t\t}\n\n\t\t//if chest is disabled, stop here\n\t\tif($data->chestType==TYPE_NONE){\n\t\t\treturn $bonus;\n\t\t}\n\n\t\t//base (current only)\n\t\tif($data->chestType==TYPE_CURRENT AND $data->chestBonusBase){\n\t\t\t$bonus += ($isMw ? BONUS_CHEST_OLD_BASE : BONUS_CHEST_OLD_PLAIN);\n\t\t}\n\n\t\t//+0 (current only)\n\t\tif($data->chestType==TYPE_CURRENT AND $data->chestBonusZero){\n\t\t\t$bonus += ($isMw ? BONUS_CHEST_OLD_BASE : BONUS_CHEST_OLD_PLAIN);\n\t\t}\n\n\t\t//plus\n\t\tif($data->chestType==TYPE_CURRENT AND $data->chestBonusPlus AND $data->chestEnchant!=ENCHANT_NONE){\n\t\t\t$bonus += ($isMw ? BONUS_CHEST_OLD : BONUS_CHEST_OLD_PLAIN);\n\t\t}\n\t\telseif($data->chestBonusPlus AND $data->chestEnchant!=ENCHANT_NONE){\n\t\t\t$bonus += ($isMw ? BONUS_CHEST_NEW : BONUS_CHEST_NEW_PLAIN);\n\t\t}\n\n\t\treturn $bonus;\n\t}", "function grade($user) {\n $nid = (int) $this->getInstanceId();\n\n $result = reset(quiz_get_score_data(array($nid), $user->uid));\n if ($result && ($result->percent_score >= $result->percent_pass)) {\n $this->getFulfillment()->setGrade($result->percent_score)->setComplete()->save();\n }\n else {\n $this->getFulfillment()->setGrade($result->percent_score)->save();\n }\n }", "public function insertGoalsInfo($user_id, $goal_id, $goal_amount, $goal_year) {\n\n//\t\t$user_id = 1;\n $userGoalsInfoSql = \"INSERT into goals_score VALUES ('','$user_id','$goal_id','$goal_amount','$goal_year','')\";\n\n //\t$userGoalsInfoSql = \"INSERT into goals_score VALUES ('',$user_id,$goals->goal_id,$goals->goal_score)\";\n\n $connection = Yii::app()->db3;\n $command = $connection->createCommand($userGoalsInfoSql)->execute();\n\n return 1;\n }", "public function run()\n {\n $bonus = new CostBonus();\n $bonus->card_id = 1;\n $bonus->value = \"152\";\n $bonus->save();\n\n }", "public function doApproveUser ($uid) {\n\t\t$userInfo = resolve('userInfo');\n\n\t\tif ($userInfo->usr_role != \"AD\") {\n\t\t\treturn redirect('error');\n\t\t}\n\n\t\t$user = User::getUserById($uid);\n\n\t\tDB::table('users')->where('usr_id', $uid)->update(array('usr_approval'=>'Yes'));\n\t\tLog::doAddLog (\"Approve user\", $uid, $user->usr_firstname.' '.$user->usr_lastname);\n\t\treturn redirect('personnelboard')->with('success', \"User has been approved\");\n\n\t}", "function AddBonus($section) {\n\tglobal $dbconn, $config;\n\n\t$err = array();\n\t\t\n\t$data[\"lc_bonus_percent\"] = trim($_REQUEST[\"lc_bonus_percent\"]);\n\t$data[\"lc_bonus_amount\"] = trim($_REQUEST[\"lc_bonus_amount\"]);\n\n\tif (!$data[\"lc_bonus_percent\"] || !IsPositiveInt($data[\"lc_bonus_percent\"]) || intval($data[\"lc_bonus_percent\"]) > 100) {\n\t\t$err[\"lc_bonus_percent\"] = \"invalid_lc_bonus_percent\";\n\t\t$data[\"lc_bonus_percent\"] = \"\";\n\t}\n\tif (!$data[\"lc_bonus_amount\"] || !IsPositiveFloat($data[\"lc_bonus_amount\"])) {\n\t\t$err[\"lc_bonus_amount\"] = \"invalid_lc_bonus_amount\";\n\t\t$data[\"lc_bonus_amount\"] = \"\";\n\t}\n\tif (count($err) > 0) {\n\t\tListServices($data, $err);\n\t\texit();\n\t}\n\n\t$strSQL = \"SELECT COUNT(id) AS cnt FROM \".BONUS_SETTINGS_TABLE.\" WHERE \".\n\t\t\t \"percent='\".intval($data[\"lc_bonus_percent\"]).\"'\";\n\t$rs = $dbconn->Execute($strSQL);\n\tif ($rs->fields[0] > 0) {\n\t\t$err[\"lc_bonus_percent_dublicate\"] = \"lc_bonus_percent_dublicate\";\n\t\tListServices($data, $err);\n\t}\n\n\t$strSQL = \"INSERT INTO \".BONUS_SETTINGS_TABLE.\" SET \".\n\t\t\t \"percent='\".intval($data[\"lc_bonus_percent\"]).\"', \".\n\t\t\t \"amount='\".floatval($data[\"lc_bonus_amount\"]).\"'\";\n\t$dbconn->Execute($strSQL);\n\n\theader(\"Location: \".$config[\"server\"].$config[\"site_root\"].\"/admin/admin_pay_services.php?sel=list_services&section=$section\");\n\texit();\n}", "function manage_bonus_plans(){}", "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 static function sumHealBonusWeapon(stdClass $data){\n\t\tif($data->weaponType==TYPE_NONE){\n\t\t\treturn 0;\n\t\t}\n\n\t\t$bonus = 0;\n\t\t$isMw = ($data->weaponEnchant==ENCHANT_MW_NINE OR $data->weaponEnchant==ENCHANT_MW_TWELVE);\n\n\t\t//base\n\t\tif($data->weaponType!=TYPE_NEW AND $data->weaponBonusBase){\n\t\t\t$bonus += ($isMw ? BONUS_WEAPON_OLD_BASE : BONUS_WEAPON_OLD_PLAIN);\n\t\t}\n\t\telseif($data->weaponBonusBase){\n\t\t\t$bonus += ($isMw ? BONUS_WEAPON_NEW : BONUS_WEAPON_NEW_PLAIN);\n\t\t}\n\n\t\t//+0 (old and current only)\n\t\tif($data->weaponType!=TYPE_NEW AND $data->weaponBonusZero){\n\t\t\t$bonus += ($isMw ? BONUS_WEAPON_OLD_BASE : BONUS_WEAPON_OLD_PLAIN);\n\t\t}\n\n\t\t//plus\n\t\tif($data->weaponType!=TYPE_NEW AND $data->weaponBonusPlus AND $data->weaponEnchant!=ENCHANT_NONE){\n\t\t\t$bonus += ($isMw ? BONUS_WEAPON_OLD : BONUS_WEAPON_OLD_PLAIN);\n\t\t}\n\t\telseif($data->weaponBonusPlus AND $data->weaponEnchant!=ENCHANT_NONE){\n\t\t\t$bonus += ($isMw ? BONUS_WEAPON_NEW : BONUS_WEAPON_NEW_PLAIN);\n\t\t}\n\n\t\t//fix (current and new only)\n\t\tif($data->weaponType!=TYPE_OLD AND $data->weaponBonusFix AND $data->weaponEnchant!=ENCHANT_NONE){\n\t\t\t$bonus += BONUS_WEAPON_FIX;\n\t\t}\n\n\t\t//mw (current only)\n\t\tif($data->weaponType==TYPE_CURRENT AND $data->weaponBonusMw AND $data->weaponEnchant==ENCHANT_MW_TWELVE){\n\t\t\t$bonus += BONUS_WEAPON_OLD_MW;\n\t\t}\n\n\t\treturn $bonus;\n\t}", "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 show (Request $request, Bonus $bonus)\n {\n $this->authorize('show', $bonus);\n return new ModelResponse($bonus, false);\n }", "public function run()\n {\n $users= User::all();\n foreach($users as $user)\n {\n $bonus=new Bonus;\n $bonus->user_id=$user->id;\n $bonus->total='0';\n $bonus->payment='0';\n $bonus->save();\n }\n }", "function execute($modifier = null)\n {\n $owner = $this->getOwner();\n $target = $this->getTarget();\n\n $originalDamageToDeal = $owner->getStrength() - $target->getDefence();\n\n if($originalDamageToDeal < 0 ) {\n $originalDamageToDeal = 0;\n }\n\n $damageToDeal = $originalDamageToDeal;\n\n $defenseSkills = $target->getDefenceSkills();\n\n foreach ($defenseSkills as $defenseSkill) {\n if(get_class($defenseSkill) != get_class($this)) {\n $defenseSkill->setOwner($target);\n $defenseSkill->setTarget($owner);\n $damageToDeal = $defenseSkill->execute($damageToDeal);\n }\n }\n\n if($target->isLucky()) {\n UI::actionMessage(\" {$this->getTarget()->getName()} got lucky. {$this->getOwner()->getName()} missed \");\n $damageToDeal = 0;\n } else {\n UI::actionMessage(\" {$this->getOwner()->getName()} hit {$this->getTarget()->getName()} for {$damageToDeal} damage\");\n }\n\n $targetOriginalHealth = $target->getHealth();\n $targetNewHealth = $targetOriginalHealth - $damageToDeal;\n\n\n\n $target->setHealth($targetNewHealth);\n\n }", "public function accountActivation($userId,$value)\n\t{\t$user = new User;\n\t\t$user->id=$userId;\n\t\t$user->setAccountDesactivate($value);\n\n\t}", "public function mycred_pro_reward_order_points( $order_id ){\n\n\t\tif ( ! function_exists( 'mycred' ) ) return;\n\n\t\t// Get Order\n\t\t$order = wc_get_order( $order_id );\n\n\t\t$items_number = 0;\n\t\tforeach ( $order->get_items() as $item_id => $item ) {\n\t\t\t$quantity = $item->get_quantity();\n\t\t\t$items_number += $quantity;\n\t\t}\n\n\t\t// Load myCRED\n\t\t$mycred = mycred();\n\n\t\t// Do not payout if order was paid using points\n\t\tif ( $order->get_payment_method() == 'mycred' ) return;\n\n\t\tif ( ! $mycred ) return;\n\n\t\t// Make sure user only gets points once per order\n\t\tif ( $mycred->has_entry( 'reward', $order_id, $order->get_user_id() ) ) return;\n\n\t\t// Reward example 10 * order items in points.\n\t\t$reward = 10 * $items_number;\n\n\t\t// Add reward\n\t\t$mycred->add_creds(\n\t\t\t'reward',\n\t\t\t$order->get_user_id(),\n\t\t\t$reward,\n\t\t\t'Reward for store purchase',\n\t\t\t$order_id,\n\t\t\tarray( 'ref_type' => 'post' )\n\t\t);\n\t}", "public function getAwardedBountyAmount()\n {\n return $this->awardedBountyAmount;\n }", "public function getBonus ($id) {\n\t\t$bonuses = DB::table('users_bonus')\n\t\t\t->where('user_id',$id)\n\t\t\t->orderBy('id','desc')\n\t\t\t->simplePaginate(20);\n\n\t\treturn view('pages.account.partials.bonuspartial')->with('bonuses',$bonuses);\n\t}", "function updateAllowance($post) {\n // traverse all userid's\n foreach ($post as $userid => $map) {\n foreach ($map as $year => $allowance) {\n $allowance = (float) $allowance;\n // does the allowance differ from what we have?\n if ($this->allowance[$userid]['allowance'][$year] != $allowance) {\n // db updates\n if (Db::getConnection()->query(sprintf(\n \"SELECT allowance FROM allowance WHERE userid='%s' AND ayear=%d\",\n $userid, $year))->numRows() != 0) {\n // update\n Db::getConnection()->query(sprintf(\n \"UPDATE `allowance` SET allowance=%f WHERE userid='%s' AND ayear=%d\", $allowance, $userid, $year));\n } else {\n // add\n Db::getConnection()->query(sprintf(\n \"INSERT INTO `allowance` (userid,ayear,allowance) VALUES ('%s',%d,%f)\", $userid, $year, $allowance));\n }\n Messaging::ok(\n sprintf(\"Allowance for <strong>%s</strong> in %d set to %s\", $this->allowance[$userid]['name'],\n $year, round($allowance, 1))\n );\n\n // internal update\n $this->allowance[$userid]['allowance'][$year] = $allowance;\n }\n }\n }\n }", "public function hit()\n {\n $fight = $this->getDamage();\n $fight = $fight + 5;\n $this->setDamage($fight);\n\n }", "function add_points_by_user_id($user_id, $points) \n{\n global $conn;\n \n $q['query'] = \"UPDATE `user_master` SET points=points + $points WHERE user_id = '$user_id'\";\n $q['run'] = $conn->query($q['query']);\n\n return $q['run'];\n}", "public function getUsersCurrentBonus(User $user)\n {\n $currentBonus = $user->userSalaries->last()->bonus_rule_id;\n\n return $currentBonus;\n }", "function userAddPoints($points)\n\t{\n\t\t$pns = $this->DB->database_select('users', 'points', array('username' => session_get('username')), 1);\n\t\t$add_points = $pns['points'] + $points;\n\t\t$gid = $this->user_getgroup();\n\t\t$next_gid = $gid+1;\n\t\t$points_required = $this->DB->database_select('groups', '*', array('gid' => $next_gid), 1); //Has user has acquired enough points to make a new group rank?\n\t\t$points_required = $points_required['points'];\n\t\t$newPnts = $this->DB->database_update('users',\n\t\t\t\t\t\t array('points' => $add_points), array('username' => session_get('username')));\n\t\tif($add_points >= $points_required && $gid < 4) //User has made enough points to progress rank!\n\t\t{\n\t\t\t$this->doPromote = true;\n\t\t\t$this->DB->database_update('users', array('gid' => $next_gid), array('username' => session_get('username')));\n\t\t}\n\t}", "public function addProgressToAchiever($achiever, $points);", "public function grade($user = NULL) { }", "function inform_staff_leader ()\n {\n global $CURUSER;\n global $amount;\n global $payment_status;\n global $currency;\n global $firstname;\n global $lastname;\n global $payer_email;\n if (empty ($_SESSION['message_done']))\n {\n require_once INC_PATH . '/functions_pm.php';\n send_pm (1, 'Username: [url=' . ts_seo ($CURUSER['id'], $CURUSER['username']) . ']' . $CURUSER['username'] . '[/url]\n\nDetails:\nAmount: ' . $amount . '\nStatus: ' . $payment_status . '\nCurrency: ' . $currency . '\nName: ' . $firstname . ' ' . $lastname . '\nEmail: ' . $payer_email . '\n', 'New Donation from ' . $CURUSER['username']);\n sql_query ('INSERT INTO funds (cash, user, added) VALUES (' . sqlesc ($amount) . ', ' . sqlesc (intval ($CURUSER['id'])) . ', NOW())');\n $_SESSION['message_done'] = TIMENOW;\n }\n\n }", "public function addUserAwards(UserAwards $l)\n\t{\n\t\tif ($this->collUserAwardss === null) {\n\t\t\t$this->initUserAwardss();\n\t\t}\n\t\tif (!in_array($l, $this->collUserAwardss, true)) { // only add it if the **same** object is not already associated\n\t\t\tarray_push($this->collUserAwardss, $l);\n\t\t\t$l->setUser($this);\n\t\t}\n\t}", "public static function rewardUser($from, $to, $amount, $fee=0){\n\t\t$fromuser = \\CouchDB::getDoc($from, \"users\");\n\t\tif ($fromuser->wallet->locked < $amount){\n\t\t\t//they don't have the funds\n\t\t\treturn \\Shared\\Error::handleError(\"nofunds\");\n\t\t}\n\t\t$fromuser->wallet->locked -= $amount;\n\t\t$response = \\CouchDB::setDoc($fromuser, \"users\");\n\t\t//send the money\n\t\ttry{\n\t\t\t$response = Dogecoin::move(\"LOCKED-FEE\", $to, $amount);\n\t\t\treturn $amount;\n\t\t}catch(Exception $e){\n\t\t\treturn 0;\n\t\t}\n\t\t//something went wrong, but i have no idea what that might be.\n\t\treturn 0;\n\t}", "function ihc_do_user_approve($uid=0){\n\tif ($uid){\n\t\t$data = get_userdata($uid);\n\t\tif ($data && isset($data->roles) && isset($data->roles[0]) && $data->roles[0]=='pending_user'){\n\t\t\t$default_role = get_option('default_role');\n\t\t\t$user_id = wp_update_user(array( 'ID' => $uid, 'role' => $default_role));\n\t\t\tif ($user_id==$uid){\n\t\t\t\tihc_send_user_notifications($user_id, 'approve_account');\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t}\n\treturn FALSE;\n}", "public function update_user_balance($user_id)\n\t\t{\n\t\t\t$this->is_login();\n\t\t\t$form_field = 'user_balance_'.$user_id;\n\t\t\tif($this->input->post($form_field))\n\t\t\t{\n\t\t\t\t$user_data['credit'] = $this->input->post($form_field);\n\t\t\t\t$this->load->model('user_profiles', 'up');\n\t\t\t\t$this->up->update($user_id, $user_data);\n\t\t\t}\n\t\t\tredirect('/admin/user_list','refresh');\n\t\t}", "function Give_Gold($amount = 0) {\r\n\t\tglobal $character, $gameinstance;\r\n\t\tif(isset($amount) && is_numeric($amount) && $amount >= 0) \r\n\t\t{\r\n\t\t\tdbn(__FILE__,__LINE__,\"update ${gameinstance}_characters set gold = gold + '$amount' where login_id = '$character[login_id]'\");\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\tSystemMessage(CHAR_CANNOT_GIVE_GOLD);\r\n\t\t}\r\n\t}", "public function getBonusAttInstance()\n {\n return new BonusAttribute();\n }", "public function getBonus() {\n return strval($this->bonus);\n }", "private function recordUser($action) {\n $data = array(\n 'class_name' => $this->getClassName(),\n 'object_id' => $this->id,\n 'user_id' => Auth::user()->id,\n 'action' => $action\n );\n $this->user_counters()->updateOrCreate($data, $data);\n }", "public function update_score_table ($score,$user_id) {\n\t\t\n\t\tif ($score > 0) {\n\t\t\t$scores = DB::table('meal_scores')->select('meal_1','meal_2','meal_3','meal_4','meal_5')->where('user_id',$user_id)->get();\n\t\t\t$scores = array_values($scores);\n\t\t\t$mealscores = array($scores[0]->meal_1,$scores[0]->meal_2,$scores[0]->meal_3,$scores[0]->meal_4,$scores[0]->meal_5);\n\t\t\t$count = 0;\n\t\t\t$sum = 0.0;\n\t\t\tforeach ($mealscores as $mealscore){\n\t\t\t\tif ($mealscore > 0) {\n\t\t\t\t\t$sum = $sum + $mealscore;\n\t\t\t\t\t$count = $count + 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$sum = $sum + $score;\n\t\t\t$status = $sum/($count + 1);\n\t\t\tif ($status < 0.5) {\n\t\t\t\t$status = 0.5;\n\t\t\t}\n\t\t\telseif ($status >= 3.5) {\n\t\t\t\t$status = 3.499999;\n\t\t\t}\n\n\t\t\t// Update database table with new meal score value\n\t\t\t$mealscores = array_values($mealscores);\n\t\t\tDB::table('meal_scores')\n ->where('user_id', $user_id)\n ->update(array('meal_1' => $score,'meal_2' => $mealscores[0],'meal_3' => $mealscores[1],'meal_4' => $mealscores[2],'meal_5' => $mealscores[3],'current_status' => $status));\n\t\t} \n\t\telse {\n\t\t\t$status = DB::table('meal_scores')->where('user_id',$user_id)->pluck('current_status');\n\t\t}\n\t\t\n\t\t$status = round($status);\n\t\treturn $status;\n\t}", "public function update(User $user, ContractCost $contractCost)\n {\n return in_array($user->role, self::accessRoles);\n }", "function ff_activate_feature_for_user( $feature, $user_id = 0 )\n\t{\n\t\tff_FeatureFlags::getInstance()->getFeature( $feature )->addToUser( $user_id );\n\t}", "private function sellTrasactionAddsMoney(){\n\n }", "public function recruiting() {\n\n if (empty($this->args[0])) {\n $this->out('Please specify a recipient.');\n CakeLog::write('recruiting', 'ERROR: Recipient not specified.');\n return;\n }\n\n if (empty($this->args[1])) {\n $this->out('Please specify an amount.');\n CakeLog::write('recruiting', 'ERROR: Amount not specified.');\n return;\n }\n\n $steamid_raw = $this->args[0];\n $amount = (int)$this->args[1];\n\n $steamid_parsed = SteamID::Parse($steamid_raw, SteamID::FORMAT_AUTO);\n\n if ($steamid_parsed === false) {\n CakeLog::write('recruiting', \"Unrecognized Steam ID format: $steamid_raw\");\n $this->out('ERROR: Unrecognized Steam ID format.');\n return;\n }\n\n $sender_id = 0; // send as robots\n $user_id = $steamid_parsed->Format(SteamID::FORMAT_S32);\n\n if ($this->Reward->sendCashReward($sender_id, $user_id, 'Reward For Recruiting', $amount)) {\n $message = \"SUCCESS: Reward sent to $steamid_raw ($user_id) for $amount.\";\n } else {\n $message = \"ERROR: Failed to send Reward to $steamid_raw for $amount.\";\n }\n\n $this->out($message);\n CakeLog::write('recruiting', $message);\n }", "function payNOw(){\n $from = $_SESSION['user']['id'];\n $to = $_POST['to_user'];\n $amount = $_POST['amount'];\n $description= $_POST['description'];\n\n //from user money update(-)\n $fromUserDetail = user($from);\n $leftMoney = $fromUserDetail['money']-$amount;\n if($fromUserDetail['money'] >= $amount || $fromUserDetail['money'] >= 0){\n $sql = \"UPDATE users SET money=$leftMoney WHERE id=$from\";\n mysqli_query(con(),$sql);\n\n //to user money update(+)\n $toUserDetail =user($to);\n $newMoney = $toUserDetail['money']+$amount;\n $sql = \"UPDATE users SET money=$newMoney WHERE id=$to\";\n mysqli_query(con(),$sql);\n\n //add to transitoion table\n $sql =\"INSERT INTO transition (from_user,to_user,amount,description) VALUES ('$from','$to','$amount','$description')\";\n run_query($sql);\n }\n else{\n echo alert(\"Error\");\n }\n}", "public function pay_user(Request $request, $id) {\n try {\n // decrypt id and get record\n $id = \\Crypt::decrypt($id);\n\n // find record\n $get_user_record = RentPayout::where('user_id', $id)\n ->where('is_paid', 0);\n\n // check if user record was found\n if ($get_user_record->count() > 0) {\n // record found.\n $new_user_record_payment = [\n 'is_paid' => 1,\n ];\n\n // update user record\n $update_record = $get_user_record->update($new_user_record_payment);\n\n // check if update was successfull\n if ($update_record) {\n // update successful - notify admin\n $notification = [\n 'message' => 'User marked as paid successfully.',\n 'alert-type' => 'success',\n ];\n\n return redirect()\n ->back()\n ->with($notification);\n\n } else {\n // update unsuccessful - notify admin\n $notification = [\n 'message' => 'An error has occured. kindly try again',\n 'alert-type' => 'error',\n ];\n\n return redirect()\n ->back()\n ->with($notification);\n }\n\n } else {\n // no record found - notify admin\n $notification = [\n 'message' => 'User not found.',\n 'alert-type' => 'error',\n ];\n\n return redirect()\n ->back()\n ->with($notification);\n }\n\n } catch (\\Throwable $th) {\n //payload error - notify admin\n $notification = [\n 'message' => 'Invalid user selected.',\n 'alert-type' => 'error',\n ];\n\n return redireet()\n ->back()\n ->with($notification);\n\n }\n }", "public function afterSave()\r\n\t{\r\n\t\tif ($this->_isNewRecord)\r\n\t\t{\r\n\t\t\t$user = Users::model()->findByPk($this->author_id);\r\n\t\t\t$user->setReputation(10);\r\n\t\t}\r\n\r\n\t\treturn parent::afterSave();\r\n\t}", "public function rate($id){\n\t\t// else\n\n\t\tif($this->alreadyRate($id)){\n\t\t\treturn redirect('books/'.$id);\n\t\t}\n\n\t\t$userID = Auth::id();\n\n\t\t$user = User::findOrfail($userID);\n\n\t\t$input = Request::all();\n\t\t$book = Book::findOrFail($id);\n\n\t\t// check user level if level == 0 -> basic user\n\t\t// if level == 1 -> critic user\n\t\t// level 2 -> admin\n\n\t\t// assume it pass data user vote\n\n\t\tif(!$user -> isCritic()) {\n\t\t\t$book->userRating += $input['rating'];\n\t\t\t$book->userRatingCount += 1;\n\t\t\t$book->save();\n\t\t}\n\t\telse{\n\t\t\t$book->criticRating += $input['rating'];\n\t\t\t$book->criticRatingCount += 1;\n\t\t\t$book->save();\n\t\t}\n\n\t\t$rating = new Rating();\n\t\t$rating -> book_id = $book->getKey();\n\t\t$rating -> user_id = $userID;\n\t\t$rating -> save();\n\n\t\treturn redirect($this->getURI().'/'.$id);\n\n\t}" ]
[ "0.6632238", "0.6559366", "0.62848574", "0.62802243", "0.6235146", "0.6159954", "0.61571944", "0.611837", "0.6088172", "0.607086", "0.6020043", "0.5872146", "0.5867832", "0.5867832", "0.5867832", "0.5851823", "0.5839776", "0.58337456", "0.58317405", "0.5820851", "0.58168226", "0.5798244", "0.5768989", "0.57659364", "0.57585007", "0.5673216", "0.56653714", "0.56639767", "0.5658471", "0.5647869", "0.5647869", "0.56389683", "0.56220514", "0.562183", "0.5609666", "0.5594343", "0.5589572", "0.5577846", "0.5577518", "0.5571343", "0.55599517", "0.5540681", "0.5535511", "0.55198324", "0.5494846", "0.548253", "0.5474291", "0.5438417", "0.5429836", "0.54280573", "0.54278994", "0.5421945", "0.5420468", "0.54185206", "0.54062694", "0.5383826", "0.5370127", "0.5354966", "0.53530407", "0.53498304", "0.5327056", "0.532641", "0.52911735", "0.52902544", "0.52878255", "0.52777356", "0.527331", "0.52717984", "0.5270354", "0.5269208", "0.5265178", "0.5264532", "0.52590424", "0.5252308", "0.52509296", "0.5246822", "0.5242523", "0.52318716", "0.5225077", "0.52225083", "0.5221066", "0.5219424", "0.5194534", "0.5190338", "0.51889336", "0.5188352", "0.5184119", "0.5183855", "0.51754", "0.5172473", "0.5162007", "0.51501524", "0.51408803", "0.5132844", "0.5129702", "0.512694", "0.512652", "0.5124997", "0.512382", "0.51223814" ]
0.59833
11
Returns the Singleton instance of this class.
public static function getInstance() { if (null === static::$instance) { static::$instance = new self(); } return static::$instance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getInstance() {\n\n static $instance;\n //If the class was already instantiated, just return it\n if (isset($instance))\n return $instance;\n\n $instance = new self;\n\n return $instance;\n }", "public static function getInstance() {\n\n static $instance;\n\n //If the class was already instantiated, just return it\n if (isset($instance))\n return $instance;\n\n $instance = new self();\n\n return $instance;\n }", "public static function singleton() {\n if(!self::$singletonInstance) {\n $class = get_called_class();\n self::$singletonInstance = new $class();\n }\n return self::$singletonInstance;\n }", "public static function getInstance()\r\n {\r\n // Store a reference of this class if not initiated\r\n if (!isset(self :: $_self))\r\n {\r\n // Singleton creation\r\n self :: $_self = new self;\r\n }\r\n\r\n // Return singleton instance\r\n return self :: $_self;\r\n }", "public static function getInstance() {/*{{{*/\n if (is_null(self::$singleton)) self::$singleton = new self();\n return self::$singleton;\n }", "public static function singleton()\n {\n if (!isset(self::$instance))\n {\n $c = __CLASS__;\n self::$instance = new $c;\n }\n \n return self::$instance;\n }", "public static function singleton() {\r\n\r\n\t\tif ( ! self::$instance ) {\r\n\t\t\tself::$instance = new self();\r\n\t\t}\r\n\r\n\t\treturn self::$instance;\r\n\t}", "public static function singleton() {\n if (!self::$instance) {\n $v = __CLASS__;\n self::$instance = new $v;\n }\n return self::$instance;\n }", "public static function singleton() {\n\t\tif ( ! self::$instance ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function singleton() {\n\t\tif ( ! self::$instance ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function getInstance() {\n\t\tif (static::$singleton === null) {\n\t\t\tstatic::$singleton = new static();\n\t\t}\n\n\t\treturn static::$singleton;\n\t}", "public static function getInstance()\n {\n if (!isset(self::$instance)) {\n $_class = __CLASS__;\n self::$instance = new $_class;\n }\n\n return self::$instance;\n }", "public static function getInstance() {\n if(Singleton::$_instance == null) {\n Singleton::$_instance = new Singleton::$_class;\n }\n \n return Singleton::$_instance;\n }", "public static function getInstance()\n {\n if (is_null(static::$instance)) {\n static::$instance = new static;\n }\n\n return static::$instance;\n }", "public static function getInstance()\n {\n if (is_null(static::$instance)) {\n static::$instance = new static;\n }\n\n return static::$instance;\n }", "public static function getInstance()\n {\n if (is_null(static::$instance)) {\n static::$instance = new static;\n }\n\n return static::$instance;\n }", "public static function getInstance()\n {\n static $instance;\n if (!isset($instance)) {\n $class = __CLASS__;\n $instance = new $class();\n }\n\n return $instance;\n }", "public static function singleton() \n\t{\n\t\tif( !isset(self::$instance) ) {\n\t\t\t$c = __CLASS__;\n\t\t\tself::$instance = new $c;\n\t\t}\n\t\t\n\t\treturn self::$instance;\n\t}", "public static function getInstance()\n /**/\n {\n if (is_null(self::$instance)) {\n self::$instance = new static();\n }\n\n return self::$instance;\n }", "public static function getInstance()\n {\n static $instance;\n if (!isset($instance)) {\n $class = __CLASS__;\n $instance = new $class();\n }\n return $instance;\n }", "public static function singleton() {\n if (!self::$instance) {\n $v = __CLASS__;\n self::$instance = new $v;\n }\n return self::$instance;\n }", "final public static function getInstance()\n {\n if (!isset(self::$instance)) {\n $class = __CLASS__;\n self::$instance = new $class;\n }\n return self::$instance;\n }", "final public static function getInstance()\n {\n if (!isset(self::$instance)) {\n $class = __CLASS__;\n self::$instance = new $class;\n }\n return self::$instance;\n }", "public static function getInstance() {\n if (self::$instance === null) {\n $class = __CLASS__;\n return self::$instance = new $class;\n }\n return self::$instance;\n }", "public static function getInstance() {\n if (self::$instance === null) {\n $class = __CLASS__;\n return self::$instance = new $class;\n }\n return self::$instance;\n }", "public static function getInstance() {\n if (self::$instance === null) {\n $class = __CLASS__;\n return self::$instance = new $class;\n }\n return self::$instance;\n }", "public static function getInstance() {\n if (self::$instance === null) {\n $class = __CLASS__;\n return self::$instance = new $class;\n }\n return self::$instance;\n }", "public static function getInstance() {\n\t\tif (!isset(self::$instance)) {\n\t\t\t$class = __CLASS__;\n\t\t\tself::$instance = new $class;\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function singleton()\n {\n if (!self::$instance) {\n $v = __CLASS__;\n self::$instance = new $v;\n }\n return self::$instance;\n }", "public static function singleton()\n {\n if (!self::$instance) {\n $v = __CLASS__;\n self::$instance = new $v;\n }\n return self::$instance;\n }", "public static function singleton()\n {\n if (!self::$instance) {\n $v = __CLASS__;\n self::$instance = new $v;\n }\n return self::$instance;\n }", "public static function getInstance()\n {\n if (self::$instance == null) {\n \n //make new istance of this class and save it to field for next usage\n $class = __class__;\n self::$instance = new $class();\n }\n\n return self::$instance;\n }", "public static function getInstance()\n {\n if (isset(static::$instance)) {\n return static::$instance;\n }\n\n return static::$instance = new static();\n }", "public static function getInstance()\n {\n if (!isset(static::$instance)) {\n static::$instance = new static;\n }\n\n return static::$instance;\n }", "public static function getInstance()\n {\n if (!isset(self::$instance)) {\n $class = __CLASS__;\n self::$instance = new $class;\n }\n return self::$instance;\n }", "public static function singleton()\r\n\t{\r\n\t\tif( !isset( self::$instance ) )\r\n\t\t{\r\n\t\t\t$obj = __CLASS__;\r\n\t\t\tself::$instance = new $obj;\r\n\t\t}\r\n\t\t\r\n\t\treturn self::$instance;\r\n\t}", "static public function getInstance()\n {\n if (is_null(self::$instance)) {\n self::$instance = new self();\n }\n \n return self::$instance;\n }", "public static function getInstance() {\n if (self::$_instance === null) {\n self::$_instance = new self;\n }\n \n return self::$_instance;\n }", "public static function getInstance() {\n\t\tif (self::$instance === null) {\n\t\t\t$class = __CLASS__;\n\t\t\treturn self::$instance = new $class;\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function getInstance() {\n\t\tif (self::$instance === null) {\n\t\t\t$class = __CLASS__;\n\t\t\treturn self::$instance = new $class;\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function getInstance() {\n\t\tif (self::$instance === null) {\n\t\t\t$class = __CLASS__;\n\t\t\treturn self::$instance = new $class;\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function getInstance() {\n\t\tif (self::$instance === null) {\n\t\t\t$class = __CLASS__;\n\t\t\treturn self::$instance = new $class;\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function getInstance() {\n\t\tif (self::$instance === null) {\n\t\t\t$class = __CLASS__;\n\t\t\treturn self::$instance = new $class;\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function getInstance() {\n\t\tif (self::$instance === null) {\n\t\t\t$class = __CLASS__;\n\t\t\treturn self::$instance = new $class;\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function getInstance() {\n\t\tif (self::$instance === null) {\n\t\t\t$class = __CLASS__;\n\t\t\treturn self::$instance = new $class;\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function getInstance() {\n\t\tif (self::$instance === null) {\n\t\t\t$class = __CLASS__;\n\t\t\treturn self::$instance = new $class;\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function getInstance() {\n if (!self::$instance instanceof self) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public static function getInstance() {\n if (!self::$instance instanceof self) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public static function getInstance() {\n if (!self::$instance instanceof self) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public static function getInstance() {\n if (!self::$instance instanceof self) {\n self::$instance = new self;\n }\n return self::$instance;\n }", "public static function getInstance() {\n if (!(self::$_instance instanceof self)) {\n self::$_instance = new self();\n }\n return self::$_instance;\n }", "public static function getInstance() {\n\t\tif (is_null(self::$instance)) {\n\t\t\tself::$instance = new self();\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function getInstance()\n {\n if (!self::$__instance) {\n \n self::$__instance = new self;\n }\n \n return self::$__instance;\n }", "public static function getInstance()\n {\n if (is_null(self::$instance)) {\n self::$instance = new self();\n }\n return self::$instance;\n }", "public static function get_instance() {\n\n\t\t\t// If the single instance hasn't been set, set it now.\n\t\t\tif ( null == self::$instance ) {\n\t\t\t\tself::$instance = new self;\n\t\t\t}\n\n\t\t\treturn self::$instance;\n\t\t}", "public static function &singleton()\n {\n static $instance;\n\n // If the instance is not there, create one\n if (!isset($instance)) {\n $class = __CLASS__;\n $instance = new $class();\n }\n return $instance;\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 static function get_instance() {\n\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( self::$instance == null ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\t\treturn self::$instance;\n\t}", "public static function getInstance() {\r\n if ( is_null( self::$_instance ) ) {\r\n self::$_instance = new self();\r\n }\r\n return self::$_instance;\r\n }", "static public function getInstance() {\r\n\t\tstatic $instance;\r\n\t\tif (!isset($instance))\r\n\t\t\t$instance = new self();\r\n\t\treturn $instance;\r\n\t}", "static public function getInstance() {\r\n\t\tstatic $instance;\r\n\t\tif (!isset($instance))\r\n\t\t\t$instance = new self();\r\n\t\treturn $instance;\r\n\t}", "public static function getInstance()\n {\n if (is_null(self::$_instance)) {\n self::$_instance = new self();\n }\n return self::$_instance;\n }", "public static function get_instance() {\n\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "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 static function getInstance()\n {\n if (is_null(self::$instance))\n {\n self::$instance = new static();\n }\n return self::$instance;\n }", "public static function getInstance()\n {\n if (null === static::$instance) {\n static::$instance = new static();\n }\n \n return static::$instance;\n }", "public static function getInstance()\n {\n if (null === static::$instance) {\n static::$instance = new static();\n }\n \n return static::$instance;\n }", "public static function getInstance()\n {\n if (null === static::$instance) {\n static::$instance = new static();\n }\n \n return static::$instance;\n }", "public static function getInstance()\n {\n if (null === static::$instance) {\n static::$instance = new static();\n }\n \n return static::$instance;\n }", "public static function getInstance()\n {\n if (null === static::$instance) {\n static::$instance = new static();\n }\n \n return static::$instance;\n }", "public static function getInstance()\n {\n if (null === static::$instance) {\n static::$instance = new static();\n }\n \n return static::$instance;\n }", "public static function getInstance()\n {\n if (null === static::$instance) {\n static::$instance = new static();\n }\n \n return static::$instance;\n }", "public static function getInstance()\n {\n if (null === static::$instance) {\n static::$instance = new static();\n }\n \n return static::$instance;\n }", "public static function getInstance()\n {\n if (null === static::$instance) {\n static::$instance = new static();\n }\n \n return static::$instance;\n }", "public static function getInstance()\n {\n if (null === static::$instance) {\n static::$instance = new static();\n }\n \n return static::$instance;\n }", "public static function getInstance()\n {\n if (empty(self::$instance)) {\n self::$instance = new static();\n }\n\n return self::$instance;\n }", "public static function getInstance()\n {\n self::$instance === null and self::$instance = new self();\n return self::$instance;\n }", "public static function getInstance() {\n if (static::$instance) {\n return static::$instance;\n }\n\n return static::$instance = new static();\n }", "public static function getInstance()\n {\n if (null === self::$_instance) {\n self::$_instance = new self();\n }\n\n return self::$_instance;\n }", "public static function getInstance()\n {\n if (null === self::$_instance) {\n self::$_instance = new self();\n }\n\n return self::$_instance;\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 static function get_instance()\n {\n\n // If the single instance hasn't been set, set it now.\n if (null == self::$instance) {\n self::$instance = new self;\n }\n\n return self::$instance;\n }", "public static function get_instance() {\n\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function get_instance() {\n\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function get_instance() {\n\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function get_instance() {\n\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function get_instance() {\n\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function get_instance() {\n\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function get_instance() {\n\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function get_instance() {\n\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function get_instance() {\n\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function get_instance() {\n\n\t\t// If the single instance hasn't been set, set it now.\n\t\tif ( null == self::$instance ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\n\t\treturn self::$instance;\n\t}", "public static function get_instance() {\n\t\t\t// If the single instance hasn't been set, set it now.\n\t\t\tif ( null == self::$instance ) {\n\t\t\t\tself::$instance = new self;\n\t\t\t}\n\t\t\t\n\t\t\treturn self::$instance;\n\t\t}", "public static function get_instance() {\n\t\t\t// If the single instance hasn't been set, set it now.\n\t\t\tif ( null == self::$instance ) {\n\t\t\t\tself::$instance = new self;\n\t\t\t}\n\t\t\t\n\t\t\treturn self::$instance;\n\t\t}", "public static function get_instance() {\n // If the single instance hasn't been set, set it now.\n if (null == self::$instance) {\n self::$instance = new self;\n }\n\n return self::$instance;\n }", "public static function getInstance()\n {\n if (null === static::$instance) {\n static::$instance = new static();\n }\n\n return static::$instance;\n }", "public static function getInstance()\n {\n if (null === static::$instance) {\n static::$instance = new static();\n }\n\n return static::$instance;\n }", "public static function getInstance()\n {\n if (null === static::$instance) {\n static::$instance = new static();\n }\n\n return static::$instance;\n }", "public static function getInstance()\n {\n if (null === static::$instance) {\n static::$instance = new static();\n }\n\n return static::$instance;\n }", "public static function getInstance()\n {\n if (null === static::$instance) {\n static::$instance = new static();\n }\n\n return static::$instance;\n }" ]
[ "0.90303755", "0.9015241", "0.89738846", "0.8960543", "0.89226884", "0.89053917", "0.8845889", "0.88435376", "0.88376486", "0.88376486", "0.8833401", "0.88319814", "0.8808944", "0.8805666", "0.8805666", "0.8805666", "0.8799985", "0.87978685", "0.8793553", "0.87890357", "0.8787738", "0.8779769", "0.8779769", "0.87712324", "0.87712324", "0.87712324", "0.87712324", "0.8767819", "0.87659425", "0.87659425", "0.87659425", "0.8764918", "0.87643564", "0.87635404", "0.87573564", "0.8756822", "0.8756061", "0.8751156", "0.8746617", "0.8746617", "0.8746617", "0.8746617", "0.8746617", "0.8746617", "0.8746617", "0.8746617", "0.8745429", "0.8745429", "0.8745429", "0.8745429", "0.8741176", "0.8732554", "0.8731655", "0.872868", "0.87241", "0.87232006", "0.8717228", "0.871499", "0.87133056", "0.87124693", "0.87124693", "0.87105304", "0.87094545", "0.8705572", "0.8705491", "0.8704885", "0.8704885", "0.8704885", "0.8704885", "0.8704885", "0.8704885", "0.8704885", "0.8704885", "0.8704885", "0.8704885", "0.870434", "0.8704064", "0.870336", "0.86985075", "0.86985075", "0.86975193", "0.86967534", "0.8694331", "0.8694331", "0.8694331", "0.8694331", "0.8694331", "0.8694331", "0.8694331", "0.8694331", "0.8694331", "0.8694331", "0.86923283", "0.86923283", "0.86920035", "0.86899096", "0.86899096", "0.86899096", "0.86899096", "0.86899096" ]
0.86996037
78
Protected constructor to prevent creating a new instance of the Singleton via the `new` operator from outside of this class.
protected function __construct() { try { $this->connection = new PDO('sqlite:database/LTWProj.db'); $this->connection->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC); $this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); function my_sqlite_regexp($x, $y){ return (int)preg_match('/'.$y.'/', $x); } $this->connection->sqliteCreateFunction('regexp','my_sqlite_regexp',2); } catch (PDOException $e) { die($e->getMessage()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function __construct()\r\n {\r\n // Prevent direct instantiation\r\n }", "private function __construct() { // singleton\n }", "public function __construct() {\n\t\tif ( self::$_instance ) {\n\t\t\t_doing_it_wrong( __FUNCTION__, 'Cheatin&#8217; huh?', '2.0' );\n\t\t}\n\t}", "private function __clone() { /* ... @return Singleton */ }", "private function __construct()\t// Private to prevent object being instantiated outside class\r\n {\r\n // Do nothing\r\n }", "static public function getInstance() {\n return new static();\n }", "public static function inst()\n {\n return new static();\n }", "public static function getInstance(): self;", "final public function __construct()\n\t{\n\t\tthrow new StaticClassException;\n\t}", "public static function getInstance()\n {\n return new static;\n }", "private static function singleton() \n\t{\n\t\tif (! isset ( self::$_instance )) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\t\t\n\t\treturn self::$_instance;\n\t}", "final public function __construct()\n\t{\n\t\tthrow new \\LogicException('Static class cannot be instantiated.');\n\t}", "public function __construct(){\n\t\tsession_start();\n\t\tif(!self::$_singleton instanceof self){\n\t\t\t$this->setInstance();\n\t\t}\n\t}", "final private function __construct() {}", "final private function __construct() {}", "final public function __construct() { throw new WeeboException(\"Cannot instantiate static class!\"); }", "protected function __clone() {\n trigger_error('Cannot clone instance of Singleton pattern ...', E_USER_ERROR);\n }", "public static function new()\n {\n return new static();\n }", "public final function __clone() {\n \n trigger_error('Clone is not allowed for '.get_class($this).' (Singleton)', E_USER_ERROR);\n \n }", "public final function __clone() {\n \n trigger_error('Clone is not allowed for '.get_class($this).' (Singleton)', E_USER_ERROR);\n \n }", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "public static function getInstance() {}", "final public function __construct()\n\t{\n\t\tthrow new /*::*/LogicException(\"Cannot instantiate static class \" . get_class($this));\n\t}", "public static function getInstance()\n {\n return new self();\n }", "public static function instance()\n {\n return new static;\n }", "public static function instance()\n {\n return new static;\n }", "public static function getInstance()\n /**/\n {\n if (is_null(self::$instance)) {\n self::$instance = new static();\n }\n\n return self::$instance;\n }", "public static function initialization()\n {\n return new static();\n }", "public static function new(){\n self::$instance = new self();\n return self::$instance;\n }", "final public function __construct()\n\t{\n\t\tthrow new Kdyby\\StaticClassException;\n\t}", "private function __wakeup() { /* ... @return Singleton */ }", "static function get_instance() {\n\n\t\tif( null === self::$_instance )\n\t\t\tself::$_instance = new self();\n\n\t\treturn self::$_instance;\n\t}", "static function get_instance() {\n\n\t\tif( null === self::$_instance )\n\t\t\tself::$_instance = new self();\n\n\t\treturn self::$_instance;\n\t}", "public static function createInstance()\n {\n return new static();\n }", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "public static function getInstance() {\n return new self();\n }", "public static function instance()\n {\n return new static();\n }", "public static function instance()\n {\n return new static();\n }", "public static function singleton(){\n\t\tif (!isset(self::$instance)) {\n\t\t\t$miclase = __CLASS__;\n\t\t\tself::$instance = new $miclase;\n\t\t}\n\t\treturn self::$instance;\n\t}", "final public function __construct()\r\n\t{\r\n\t\tthrow new \\LogicException(\"Cannot instantiate static class \".get_class($this));\r\n\t}", "public static function getInstance(){\n\n if(!(self::$_instance instanceof self))\n self::$_instance=new self();\n return self::$_instance;\n\n }", "public static function init()\n {\n return new static;\n }", "static function factory()\n {\n if (self::$_instance == NULL) {\n self::$_instance = new self();\n }\n return self::$_instance;\n }", "public static function create(): self\n {\n return new static;\n }", "final public function __construct()\n {\n throw new \\LogicException(\"Cannot instantiate static class \" . get_class($this));\n }", "static public function getInstance() {\n\t\treturn\n\t\t\tself::$instance===null\n\t\t\t\t? self::$instance = new static()//new self()\n\t\t\t\t: self::$instance;\n\t}", "protected final function __construct() {}", "static function Singleton()\n {\n if (!self::$singleton)\n {\n self::$singleton = new self();\n }\n return self::$singleton;\n }", "public static function instance() {\n return new static();\n }", "final public function __construct()\r\n\t{\r\n\t\tthrow new Nette\\StaticClassException;\r\n\t}", "public static function getInstance(){\n\n if(!(self::$_instance instanceof self))\n self::$_instance=new self();\n return self::$_instance;\n\n }", "final public static function getInstance()\n {\n if (null !== static::$_instance) {\n // Instance already exists, return it.\n return static::$_instance;\n }\n // Declare our instance.\n static::$_instance = new static();\n /**\n * Late model binding to get our class name.\n * Useful for when you extend.\n **/\n static::$_class = get_called_class();\n // Execute our _init method.\n static::_init();\n return static::$_instance;\n }", "protected static function __instance()\n {\n return DiPool::getinstance()->getSingleton(static::class);\n }", "public static function create(): self\n {\n return new static();\n }", "static function get_instance() {\n\t\tstatic $instance;\n\t\t$class = __CLASS__;\n\t\tif ( ! is_a( $instance, $class ) ) {\n\t\t\t$instance = new $class;\n\t\t}\n\t\treturn $instance;\n\t}", "public static function instance()\n {\n if (static::$instance !== null) {\n return static::$instance;\n }\n\n return new static;\n }", "public static function getInstance()\n {\n static $instance;\n if ( $instance )\n\n return $instance;\n $class = get_called_class();\n # echo \"new $class\\n\";\n\n return $instance = new $class;\n }", "public static function getInstance() {\n if (static::$instance) {\n return static::$instance;\n }\n\n return static::$instance = new static();\n }", "public static function getInstance() {\n\t\treturn parent::getInstance(__CLASS__);\n\t}", "static function get_instance() {\n\t\tif( self::$_instance === NULL ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\n\t\treturn self::$_instance;\n\t}", "static function get_instance() {\n\t\tif( self::$_instance === NULL ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\n\t\treturn self::$_instance;\n\t}", "final public static function get_instance() {\n\t\treturn isset( static::$instance )\n\t\t\t? static::$instance\n\t\t\t: static::$instance = new static();\n\t}", "final public function __construct()\n\t{\n\t\tthrow new Nette\\StaticClassException;\n\t}", "static public function create()\n\t{\n\t\treturn new static;\n\t}", "public static function getInstance() {\n\t\treturn parent::getInstance(__CLASS__); \n\t}", "public static function createInstance()\n {\n return new self();\n }", "public static function init() {\n\t\treturn self::$instance = new self();\n\t}", "public static function getInstance() {\nstatic $instance;\n// Second call to this function will not get into the if-statement,\n// Because an instance of Singleton is now stored in the $instance\n// variable and is persisted through multiple calls\nif (!$instance) {\n// First call to this function will reach this line,\n// because the $instance has only been declared, not initialized\n$instance = new Singleton();\n} \nreturn $instance;\n}", "final public static function getInstance()\n {\n if (!isset(self::$instance)) {\n $class = __CLASS__;\n self::$instance = new $class;\n }\n return self::$instance;\n }", "final public static function getInstance()\n {\n if (!isset(self::$instance)) {\n $class = __CLASS__;\n self::$instance = new $class;\n }\n return self::$instance;\n }", "public static function getInstance()\n {\n if (isset(static::$instance)) {\n return static::$instance;\n }\n\n return static::$instance = new static();\n }", "public static function getInstance()\n {\n if (static::$instance !== null) {\n return static::$instance;\n }\n\n static::$instance = new static;\n static::$instance->onCreateInstance();\n return static::$instance;\n }", "public static function instance()\n {\n if (is_null(self::$_instance)) {\n self::$_instance = new static(...func_get_args());\n }\n\n return self::$_instance;\n }", "static function getInstance () {\n\t\t\tif (self :: $_instance == null)\n\t\t\t\tself :: $_instance = new self ();\n\t\t\t\t\n\t\t\treturn self :: $_instance;\n\t\t}", "public function __construct()\n {\n if (!self::$instance) {\n self::$instance = $this;\n //echo \"Create new object\";\n return self::$instance;\n } else {\n //echo \"Return old object\";\n return self::$instance;\n }\n }", "static public function create()\n {\n return new static();\n }", "static function getInstance(){\r\n\r\n\t\tif(!isset(self::$instance)) self::$instance = new self();\r\n\t\treturn self::$instance;\r\n\t}", "private final function __construct() {}", "public static abstract function createInstance();", "public static function getNewInstance() {\n \treturn new static();\n\t }", "public static function getInstance()\r\n {\r\n // Store a reference of this class if not initiated\r\n if (!isset(self :: $_self))\r\n {\r\n // Singleton creation\r\n self :: $_self = new self;\r\n }\r\n\r\n // Return singleton instance\r\n return self :: $_self;\r\n }", "public static function getInstance()\n {\n if(null == self::$_inst){\n self::$_inst = new self();\n }\n return self::$_inst; \n }", "public static function getInstance() {\n\n static $instance;\n //If the class was already instantiated, just return it\n if (isset($instance))\n return $instance;\n\n $instance = new self;\n\n return $instance;\n }", "public function __construct()\n\t{\n\t\tself::$instance =& $this;\n\t}", "public static function getInstance()\n\t {\n\t \tif (self::$initialized) return;\n\t \tself::$initialized = true;\n\t }", "public static function getInstance(){\n\t\tif (!isset(self::$_instance)) {\n\t\t\t$c = __CLASS__;\n\t\t\tself::$_instance = new $c;\n\t\t\tself::$_instance->__construct();\n\t\t}\n\t\treturn self::$_instance;\n\t}", "public static function __constructStatic() : void;", "final private function __construct() {\n\t\t\t}", "static public function getInstance()\n\t{\n\t\treturn parent::getInstance();\n\t}", "public static function getInstance(){\r\n\t\treturn ($i = &self::$instance) ? $i : $i = new self;\r\n\t}", "public static function newInstance() {\n if (!self::$instance instanceof self) {\n self::$instance = new self;\n }\n return self::$instance;\n }" ]
[ "0.76877004", "0.73695487", "0.70904857", "0.7060881", "0.69828886", "0.6942144", "0.6910542", "0.68506956", "0.6843444", "0.6838111", "0.6779172", "0.67760247", "0.67618054", "0.67542964", "0.67542964", "0.6733986", "0.67338693", "0.6719051", "0.6716436", "0.6716436", "0.67056096", "0.67056096", "0.67056096", "0.67056096", "0.67052484", "0.67052484", "0.67052484", "0.6704898", "0.6704898", "0.6704898", "0.6703332", "0.6699572", "0.66966134", "0.66966134", "0.66837835", "0.6659325", "0.6655361", "0.6652456", "0.66521245", "0.66514355", "0.66514355", "0.6645627", "0.66329765", "0.66329765", "0.66329765", "0.66255856", "0.6623999", "0.6623999", "0.66171336", "0.6597677", "0.65925545", "0.65913236", "0.65872806", "0.65843564", "0.65753675", "0.6572673", "0.6571648", "0.6571221", "0.65579414", "0.65536964", "0.65532464", "0.65458924", "0.6537834", "0.6536718", "0.6533616", "0.65276873", "0.65262574", "0.65215945", "0.65187395", "0.6516601", "0.6516601", "0.6510165", "0.65096253", "0.6507547", "0.65029466", "0.6502806", "0.64994955", "0.6498052", "0.6496673", "0.6496673", "0.64890254", "0.6488571", "0.6487576", "0.64821213", "0.6480284", "0.6477061", "0.6475866", "0.6468903", "0.6466326", "0.64593863", "0.6453846", "0.6453223", "0.64516646", "0.6448557", "0.64481795", "0.6445304", "0.6437699", "0.64370376", "0.64291686", "0.6425444", "0.64237326" ]
0.0
-1
Private clone method to prevent cloning of the instance of the Singleton instance.
private function __clone() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function __clone() { /* ... @return Singleton */ }", "protected function __clone()\n {\n //no possibility for cloning of singleton class\n }", "public final function __clone() {\n \n trigger_error('Clone is not allowed for '.get_class($this).' (Singleton)', E_USER_ERROR);\n \n }", "public final function __clone() {\n \n trigger_error('Clone is not allowed for '.get_class($this).' (Singleton)', E_USER_ERROR);\n \n }", "protected function __clone() {\n trigger_error('Cannot clone instance of Singleton pattern ...', E_USER_ERROR);\n }", "public function __clone()\n\t{\n\t\tthrow new Exception(\"You are not permitted to clone this singleton object.\");\n\t}", "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() {}", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "final private function __clone() {}", "final private function __clone() {}", "final private function __clone() {}", "final private function __clone() {}", "final public function __clone() {}", "private function __clone () {}", "final private function __clone(){}", "public function __clone()\n {\n throw new LogicException('This Singleton cannot be cloned');\n }", "public function __clone() {\n\t\t$this->_instanceNum = 0;\n\t\t$this->getInstanceNum();\n\t}", "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() { }", "final private function __clone() { }", "private function __clone()\r\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(){}", "protected function __clone()\n {}", "public function __clone() {}", "public function __clone() {}", "public function __clone() {}", "public function __clone() {}", "public function __clone() {\n\t\t// Cloning instances of the class is forbidden\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'elementor' ), '1.0.0' );\n\t}", "protected function __clone() { }", "private function __clone(){ }", "public function __clone() {\n\t\t// Cloning instances of the class is forbidden.\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'talemy' ), '1.0' );\n\t}", "public function __clone(){\n throw new Zend_Exception('Cloning singleton objects is forbidden');\n }", "public function __clone()\n\t{\n\t\tthrow new DomainException(\"Can't clone singleton\");\n\t}", "public function __clone() {\n\t\t// Cloning instances of the class is forbidden.\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'mai-aec' ), '1.0' );\n\t}", "private function __clone() {\n \n }", "private function __clone() {\n \n }", "protected final function __clone()\n {\n }", "final private function __clone() {\n\t}", "private function __clone() {\n }", "private function __clone() {\n }", "private function __clone() {\n }", "private function __clone() {\n }", "private function __clone() {\n }", "public function __clone() {\n // Cloning instances of the class is forbidden\n _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'ninja-forms' ), '2.8' );\n }", "private function __clone() {\r\n }", "protected function __clone(){}", "final private function __clone()\n {\n }", "final private function __clone()\n {\n }", "private function __clone ( ) { }", "final public function __clone()\n {\n return;\n }", "private function __clone() { }", "final public function __clone()\n {\n }" ]
[ "0.9093898", "0.90445626", "0.8776134", "0.8776134", "0.8665638", "0.81710345", "0.81412303", "0.81412303", "0.81412303", "0.81412303", "0.81412303", "0.81412303", "0.81412303", "0.81412303", "0.81412303", "0.81412303", "0.81412303", "0.81412303", "0.81412303", "0.81412303", "0.81412303", "0.81412303", "0.81412303", "0.81412303", "0.81412303", "0.81412303", "0.81412303", "0.81412303", "0.81412303", "0.81412303", "0.81412303", "0.8124442", "0.8124442", "0.8124442", "0.8124442", "0.8124442", "0.8124442", "0.8124442", "0.81162643", "0.81162643", "0.81162643", "0.81162643", "0.81033117", "0.810168", "0.80993587", "0.8091709", "0.8085609", "0.8077134", "0.8077134", "0.8077134", "0.8077134", "0.8077134", "0.8077134", "0.8077134", "0.8077134", "0.8077134", "0.8077134", "0.80631685", "0.80631685", "0.80578464", "0.80388784", "0.80388784", "0.80388784", "0.80388784", "0.80388784", "0.80388784", "0.80388784", "0.80388784", "0.80388784", "0.80388784", "0.80388784", "0.8031247", "0.80305713", "0.80305713", "0.80305713", "0.80305713", "0.8029707", "0.8029047", "0.80172944", "0.7988832", "0.79868215", "0.79829204", "0.7981347", "0.796532", "0.796532", "0.79452425", "0.79339117", "0.7932268", "0.7932268", "0.7932268", "0.7932268", "0.7932268", "0.793131", "0.79299235", "0.7929007", "0.7927154", "0.7927154", "0.79263616", "0.7925273", "0.7914081", "0.7909743" ]
0.0
-1
Private unserialize method to prevent unserializing of the Singleton instance.
private function __wakeup() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function __wakeup() {\n trigger_error('Cannot deserialize instance of Singleton pattern ...', E_USER_ERROR);\n }", "public function __wakeup()\n {\n throw new Exception(\"Cannot unserialize singleton\");\n }", "public function __wakeup()\r\n {\r\n throw new \\Exception(\"Cannot unserialize a singleton.\");\r\n }", "public function __wakeup()\n {\n throw new \\Exception(\"Cannot unserialize singleton\");\n }", "public function __wakeup()\n {\n throw new \\Exception(\"Cannot unserialize a singleton.\");\n }", "public function __wakeup()\n\t{\n\t\tthrow new DomainException(\"Can't unserialize singleton\");\n\t}", "public function unserialize($data) {}", "abstract public function unserialize($serialized);", "public function unserialize($serialized=null){ }", "#[\\ReturnTypeWillChange]\n public function unserialize($data)\n {\n }", "function unserialize ( $data ) {\n return unserialize( $data );\n }", "public function __wakeup() {\n\t\tthrow new \\Exception( 'Cannot serialize singleton' );\n\t}", "public function unserialize($serialized);", "public function unserialize($serialized);", "public function __wakeup() {\r\n\t\t_doing_it_wrong( __FUNCTION__, esc_html__( 'Unserializing instances of this class is forbidden.', 'wc_name_your_price' ), '3.0.0' );\r\n\t}", "public function unserialize($serialized)\n {\n }", "public function __wakeup() {\n _doing_it_wrong( __FUNCTION__, __( \"Unserializing instances is forbidden!\", \"wcwspay\" ), \"4.7\" );\n }", "private function __wakeup() { /* ... @return Singleton */ }", "function unserialize()\r\n {\r\n global $methodCache;\r\n\r\n $owner=$this->readOwner();\r\n\r\n if ($owner!=null)\r\n {\r\n if ($this->inheritsFrom('Component')) $this->ControlState=csLoading;\r\n\r\n $namepath=$this->readNamePath();\r\n //if (isset($_SESSION[$namepath])) $this->newunserialize($_SESSION[$namepath]);\r\n\r\n $myclassName = $this->ClassName();\r\n\r\n if( isset( $methodCache[ $myclassName ] ) )\r\n {\r\n $methods = $methodCache[ $myclassName ];\r\n }\r\n else\r\n {\r\n $refclass=new ReflectionClass( $myclassName );\r\n $methods=$refclass->getMethods();\r\n\r\n $methods = array_filter( $methods, 'filterSet' );\r\n\r\n array_walk( $methods, 'processMethods' );\r\n\r\n $methodCache[ $myclassName ] = $methods;\r\n }\r\n\r\n $ourNamePath = $this->readNamePath();\r\n\r\n foreach( $methods as $methodname )\r\n {\r\n $propname=substr($methodname, 3);\r\n\r\n $fullname = $ourNamePath . '.' . $propname;\r\n if (isset($_SESSION[$fullname]))\r\n {\r\n $this->$methodname($_SESSION[$fullname]);\r\n }\r\n else\r\n {\r\n $propname = 'get' . $propname;\r\n $ob=$this->$propname();\r\n if (is_object($ob))\r\n {\r\n if ($ob->inheritsFrom('Persistent'))\r\n {\r\n $ob->unserialize();\r\n }\r\n }\r\n }\r\n }\r\n\r\n if ($this->inheritsFrom('Component')) $this->ControlState=0;\r\n }\r\n else\r\n {\r\n global $exceptions_enabled;\r\n\r\n if ($exceptions_enabled)\r\n {\r\n throw new Exception('Cannot unserialize a component without an owner');\r\n }\r\n }\r\n }", "public function __wakeup() {\n //Unserializing instances of the class is forbidden\n _doing_it_wrong(__FUNCTION__, __('Word? That aint allowed son!', 'i4'), '0.0.1');\n }", "#[\\ReturnTypeWillChange]\n public function __unserialize($data)\n {\n }", "abstract protected function unSerializeData();", "public function __wakeup()\n {\n throw new LogicException('This Singleton cannot be serialised');\n }", "function unserialize($value)\n {\n return C_NextGen_Serializable::unserialize($value);\n }", "public function __wakeup() {\n // Unserializing instances of the class is forbidden\n _doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'ninja-forms' ), '2.8' );\n }", "function maybe_unserialize($data)\n {\n }", "public function __wakeup() {\n\t\t\t_doing_it_wrong( __FUNCTION__, __( 'Unserializing is forbidden!', 'be-table-ship' ), '4.0' );\n\t\t}", "public function unserialize($serialized)\n{\n list($this->username, $this->password,\n $this->id) = json_decode(\n $serialized);\n}", "public function __wakeup() {\n\t\t// Unserializing instances of the class is forbidden\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'elementor' ), '1.0.0' );\n\t}", "public function __wakeup() {\n\t\t// Unserializing instances of the class is forbidden.\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'talemy' ), '1.0' );\n\t}", "public function __wakeup() {\n\t\t// Unserializing instances of the class is forbidden.\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'textdomain' ), '1.0' );\n\t}", "public function unserialize($serialized)\n{\n list($this->username, $this->password, $this->salt,\n $this->user_roles, $this->id) = \\json_decode(\n $serialized);\n}", "public function unserialize($data)\n {\n list($this->facebookId, $parentData) = unserialize($data);\n parent::unserialize($parentData);\n }", "public function __construct() {\n\n // If we unserialize an object, prevent the magic wakeup from happening.\n ini_set('unserialize_callback_func', '');\n\n }", "public function unserialize($serialized){\n\t\tthrow new Exception(\"Method \".__CLASS__.\"::\".__METHOD__.\" not implemented yet!\");\n\t}", "protected function unserialize($data)\n {\n return unserialize($data);\n }", "function _unserialize( $serial ) {\n\t\tif( function_exists( 'gzinflate' ) ) {\n\t\t\t$decomp = @gzinflate( $serial );\n\t\t\tif( false !== $decomp ) {\n\t\t\t\t$serial = $decomp;\n\t\t\t}\n\t\t}\n\t\treturn unserialize( $serial );\n\t}", "public function __wakeup ();", "public function __wakeup() {\n\t\t\t// Unserializing instances of the class is forbidden\n\t\t\t_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'affiliatewp-direct-link-tracking' ), '1.0' );\n\t\t}", "public function __wakeup() {\n\t\t// Unserializing instances of the class is forbidden.\n\t\t_doing_it_wrong( __FUNCTION__, __( 'Cheatin&#8217; huh?', 'mai-aec' ), '1.0' );\n\t}", "public function __wakeup();", "public function unserialize($serialized)\n {\n $data=unserialize($serialized);\n $this->id=$data['id'];\n\n }", "function __unserialize($sObject) {\n\t$__ret =preg_replace('!s:(\\d+):\"(.*?)\";!e', \"'s:'.strlen('$2').':\\\"$2\\\";'\", $sObject );\n\treturn unserialize($__ret);\n}", "function unserialize_safe($serialized) {\r\r\n // as well as if there is any ws between O and :\r\r\n if (is_string($serialized) && strpos($serialized, \"\\0\") === false) {\r\r\n if (strpos($serialized, 'O:') === false) {\r\r\n // the easy case, nothing to worry about\r\r\n // let unserialize do the job\r\r\n return @unserialize($serialized);\r\r\n } else if (!preg_match('/(^|;|{|})O:[0-9]+:\"/', $serialized)) {\r\r\n // in case we did have a string with O: in it,\r\r\n // but it was not a true serialized object\r\r\n return @unserialize($serialized);\r\r\n }\r\r\n }\r\r\n return false;\r\r\n}", "public function unserialize($data)\n {\n // Interface for convenience.\n $this->__unserialize(unserialize($data));\n }", "public function __unserialize(array $data): void\n {\n $this->__construct($data);\n }", "public function unserialize($serialized)\n {\n list (\n $this->id,\n $this->usuario,\n $this->clave,\n ) = unserialize($serialized);\n }", "abstract protected function unserializeData(array $data);", "public function unserialize($serialized)\n {\n list($this->id, $this->username, $this->password,) = unserialize($serialized);\n }", "public function unserialize($serialized)\n {\n $data = unserialize($serialized);\n\n //TODO load references with id ?\n }", "public function unserialize($serialized)\n {\n list(\n $this->id,\n $this->active,\n $this->username,\n $this->password,\n $this->places,\n $this->roles,\n $this->sharedPlaces\n ) = \\json_decode($serialized);\n }", "function maybe_unserialize( $item ){\n if( is_serialized( $item ) ){\n \n try{\n \n // Try unzerialising\n $output = unserialize( $item );\n \n } catch( Exception $e ){\n \n // If there's an error it might be corrupted, so try uncorrupting then unserializing\n $output = unserialize( serialize_fix( $item ) );\n \n }\n \n return $output;\n \n } else {\n return $item;\n }\n}", "function unserialize($data){\r\n\t\t$data = unserialize($data);\r\n\t\t$this -> firstName = $data['first'];\r\n\t\t$this -> lastName = $data['last'];\r\n\t}", "function unserialize($str)\n{\n}", "function unpack_member_cache( $cache_serialized_array=\"\" )\n\t{\n\t\treturn unserialize( $cache_serialized_array );\n\t}", "public function __wakeup()\n\t{\n\t\tforeach( get_object_vars( $this ) as $k => $v )\n\t\t{\n\t\t\t$this->$k = null;\n\t\t}\n\t\t\n\t\tthrow new Exception(\"Cannot unserialize this object\");\n\t}", "final private function __wakeup()\n {\n }", "public function unserialize($serialized)\n {\n $this->data = unserialize($serialized);\n }", "protected function __wakeup() {}", "protected function __wakeup() {}", "public function unserialize($serialized)\n {\n list (\n $this->id,\n $this->email,\n $this->name,\n $this->password,\n // see section on salt below\n // $this->salt\n ) = unserialize($serialized);\n }", "private function __wakeup() {\n }", "abstract protected function serializeData($unSerializedData);", "private function __wakeup(){}", "private function __wakeup(){}", "public function __construct()\r\n {\r\n $this->_internalObject = new stdClass();\r\n\t\t$a=serialize($this->_internalObject);\r\n\t\t\"echo $a<br>\";\r\n }", "private function __wakeup() {\r\n }", "function unserializeChildren()\r\n {\r\n reset($this->components->items);\r\n while (list($k,$v)=each($this->components->items))\r\n {\r\n $v->unserialize();\r\n }\r\n }", "final private function __wakeup() {\n\t}", "private function __wakeup()\n {\n }", "private function __wakeup(){\n }", "private function __wakeup()\r\n {\r\n }", "public function unserialize($serialized)\n {\n // older data which does not include all properties.\n $data = array_merge(unserialize($serialized), array_fill(0, 2, null));\n\n list($this->email, $this->id) = $data;\n }", "public function unserialize($data)\n {\n $data = @base64_decode($data);\n if ($data === false) {\n trigger_error('Failed to decode serialized data', E_USER_ERROR);\n return;\n }\n $crypt = $this->getCrypt();\n $data = $crypt->decrypt($data);\n $data = @unserialize($data);\n if (!is_array($data)) {\n trigger_error('Failed to decode serialized data', E_USER_ERROR);\n return;\n }\n parent::unserialize($data);\n }", "private function __wakeup() {}", "private function __wakeup() {}", "private function __wakeup() {}", "private function __wakeup() {}", "private function __wakeup() {}", "private function __wakeup() {}", "private function __wakeup() {}", "private function __wakeup() {}", "private function __wakeup() {}", "public function unserialize($serialized)\n {\n $data = unserialize($serialized);\n return self::load($data['uid']);\n }", "function MBunserialize($serial_str)\n{\n $serial_str = preg_replace_callback('!s:(\\d+):\"(.*?)\";!s', function($match){return 's:'.strlen($match['2']).':\"'.$match['2'] . '\";';}, $serial_str);\n $serial_str= str_replace(\"\\r\", \"\", $serial_str);\n return unserialize($serial_str);\n}", "public function __wakeup() {\n\t\t$error = new WP_Error('forbidden', 'Unserializing instances of this class is forbidden.');\n\t\treturn $error->get_error_message();\n }", "private function __wakeup() {\n\t}" ]
[ "0.7673576", "0.7542678", "0.7501776", "0.74158734", "0.7373296", "0.7264367", "0.716406", "0.698899", "0.6962414", "0.6885461", "0.6845852", "0.6836427", "0.68185645", "0.68185645", "0.6808203", "0.6802244", "0.67348343", "0.6628422", "0.6624611", "0.6501449", "0.6495223", "0.64508647", "0.6417815", "0.6413699", "0.63679457", "0.6349085", "0.631636", "0.63055956", "0.62661976", "0.6238261", "0.62361526", "0.6214996", "0.6163301", "0.6150732", "0.61333334", "0.6127179", "0.6126347", "0.61231345", "0.61223483", "0.61184084", "0.6096422", "0.6068475", "0.6063172", "0.60344297", "0.6030142", "0.60200566", "0.6017325", "0.6002522", "0.5960279", "0.5934471", "0.58985376", "0.5897433", "0.5896903", "0.5860025", "0.58558863", "0.5847335", "0.58468324", "0.58382565", "0.5789546", "0.5789546", "0.57879055", "0.57672", "0.5757384", "0.5749468", "0.5749468", "0.5746504", "0.574594", "0.57452834", "0.5740546", "0.5733026", "0.57161534", "0.5696115", "0.569289", "0.5687361", "0.56787044", "0.56787044", "0.56787044", "0.56787044", "0.56787044", "0.56787044", "0.56787044", "0.56787044", "0.56787044", "0.56698877", "0.56678915", "0.5664906", "0.566302" ]
0.57388276
81
Run the database seeds.
public function run() { Article::query()->truncate(); Article::create([ 'title' => 'Cicero', 'slug' => 'cicero', 'content' => '<p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.</p><p>Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</p><p>At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio.</p><p>Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.</p><p>Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt.</p><p>Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?</p><p>At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.</p><p>Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex ea commodi</p>', 'author_id' => 1 ]); Article::create([ 'title' => 'Li Europan lingues ', 'slug' => 'li_europan_lingues', 'content' => '<p>Li Europan lingues es membres del sam familie. Lor separat existentie es un myth. Por scientie, musica, sport etc, litot Europa usa li sam vocabular. Li lingues differe solmen in li grammatica, li pronunciation e li plu commun vocabules. Omnicos directe al desirabilite de un nov lingua franca: On refusa continuar payar custosi traductores. At solmen va esser necessi far uniform grammatica, pronunciation e plu sommun paroles. Ma quande lingues coalesce, li grammatica del resultant lingue es plu simplic e regulari quam ti del coalescent lingues. Li nov lingua franca va esser plu simplic e regulari quam li existent Europan lingues.</p><p>It va esser tam simplic quam Occidental in fact, it va esser Occidental. A un Angleso it va semblar un simplificat Angles, quam un skeptic Cambridge amico dit me que Occidental es. Li Europan lingues es membres del sam familie. Lor separat existentie es un myth. Por scientie, musica, sport etc, litot Europa usa li sam vocabular. Li lingues differe solmen in li grammatica, li pronunciation e li plu commun vocabules. Omnicos directe al desirabilite de un nov lingua franca: On refusa continuar payar custosi traductores. At solmen va esser necessi far uniform grammatica, pronunciation e plu sommun paroles.</p><p>Ma quande lingues coalesce, li grammatica del resultant lingue es plu simplic e regulari quam ti del coalescent lingues. Li nov lingua franca va esser plu simplic e regulari quam li existent Europan lingues. It va esser tam simplic quam Occidental in fact, it va esser Occidental. A un Angleso it va semblar un simplificat Angles, quam un skeptic Cambridge amico dit me que Occidental es. Li Europan lingues es membres del sam familie. Lor separat existentie es un myth. Por scientie, musica, sport etc, litot Europa usa li sam vocabular. Li lingues differe solmen in li grammatica, li pronunciation e li plu commun vocabules.</p><p>Omnicos directe al desirabilite de un nov lingua franca: On refusa continuar payar custosi traductores. At solmen va esser necessi far uniform grammatica, pronunciation e plu sommun paroles. Ma quande lingues coalesce, li grammatica del resultant lingue es plu simplic e regulari quam ti del coalescent lingues. Li nov lingua franca va esser plu simplic e regulari quam li existent Europan lingues. It va esser tam simplic quam Occidental in fact, it va esser Occidental. A un Angleso it va semblar un simplificat Angles, quam un skeptic Cambridge amico dit me que Occidental es. Li Europan lingues es membres del sam familie.</p><p>Lor separat existentie es un myth. Por scientie, musica, sport etc, litot Europa usa li sam vocabular. Li lingues differe solmen in li grammatica, li pronunciation e li plu commun vocabules. Omnicos directe al desirabilite de un nov lingua franca: On refusa continuar payar custosi traductores. At solmen va esser necessi far uniform grammatica, pronunciation e plu sommun paroles. Ma quande lingues coalesce, li grammatica del resultant lingue es plu simplic e regulari quam ti del coalescent lingues. Li nov lingua franca va esser plu simplic e regulari quam li existent Europan lingues.</p><p>It va esser tam simplic quam Occidental in fact, it va esser Occidental. A un Angleso it va semblar un simplificat Angles, quam un skeptic Cambridge amico dit me que Occidental es. Li Europan lingues es membres del sam familie. Lor separat existentie es un myth. Por scientie, musica, sport etc, litot Europa usa li sam vocabular. Li lingues differe solmen in li grammatica, li pronunciation e li plu commun vocabules. Omnicos directe al desirabilite de un nov lingua franca: On refusa continuar payar custosi traductores. At solmen va esser necessi far uniform grammatica, pronunciation e plu sommun paroles.</p><p>Ma quande lingues coalesce, li grammatica del resultant lingue es plu simplic e regulari quam ti del coalescent lingues. Li nov lingua franca va esser plu simplic e regulari quam li existent Europan lingues. It va esser tam simplic quam Occidental in fact, it va esser Occidental. A un Angleso it va semblar un simplificat Angles, quam un skeptic Cambridge amico dit me que Occidental es. Li Europan lingues es membres del sam familie. Lor separat existentie es un myth. Por scientie, musica, sport etc, litot Europa usa li sam vocabular. Li lingues differe solmen in li grammatica, li pronunciation e li plu commun vocabules. Omnicos directe al desirabilite de un nov lingua franca: On refusa continuar payar custosi traductores. At solmen va esser necessi far uniform grammatica, pronunciation e plu sommun paroles. Ma quande lingues coalesce, li grammatica del resultant lingue es plu simplic e regulari quam ti del coalescent lingues. Li nov lingua franca va esser plu simplic e regulari quam li existent Europan lingues. It va esser tam simplic quam Occidental in fact, it va esser Occidental. A un Angleso it va semblar un simplificat Angles, quam un skeptic Cambridge amico dit me que Occidental es. Li Europan</p>', 'author_id' => 3 ]); }
{ "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
Defining the basic scraping function
function scrape_between($data, $start, $end){ $data = stristr($data, $start); // Stripping all data from before $start $data = substr($data, strlen($start)); // Stripping $start $stop = stripos($data, $end); // Getting the position of the $end of the data to scrape $data = substr($data, 0, $stop); // Stripping all data from after and including the $end of the data to scrape return $data; // Returning the scraped data from the function }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract public function scrape();", "abstract public function scrape(): Result;", "function scrap($page)\n {\n \n //For College Name and Location \n $regex = '@class=\"tuple-clg-heading\">\\s*<a[^>]*?>([^<]*?)</a>\\s*<p>\\s*\\|\\s*([^<]*?)</p>@'; //</h2>\\s*(<ul[\\w\\s\\d\";_=<>/,-]*?</ul>)?@';\n preg_match($regex,$page,$match);\n \n \n //For facility if any\n $regex = '@<h3>([^<]*?)</h3>@';\n preg_match_all($regex,$page,$facility); \n $f = mysql_real_escape_string(implode(\"+\",$facility[1]));\n \n \n //For reveiew if any\n $regex = '@<b>(\\d+)</b><a\\s*target=\".*?\"\\s*type=\"reviews\"@';\n preg_match($regex,$page,$review);\n if($review == NULL)\n $r = 0;\n else\n $r = (int)$review[1];\n $name = mysql_real_escape_string($match[1]);\n $location = mysql_real_escape_string($match[2]); \n \n //Insert data into database\n mysql_query(\"INSERT INTO College Values('$name','$location','$f',$r)\") or die(mysql_error());\n }", "public function scrape() {\n $expected_ref = null;\n if(!is_null($this->expected_journo)) {\n $expected_ref = $this->expected_journo->ref;\n }\n\n list($ret,$txt) = scrape_ScrapeURL($this->url, $expected_ref);\n $art_id = null;\n if($ret == 0) {\n // scraped ran\n\n $arts = scrape_ParseOutput($txt);\n if(sizeof($arts)>0) {\n // scraped at least one article\n $this->set_article($arts[0]);\n }\n }\n\n $this->update_status();\n return $txt;\n }", "function parse($url){\n \n echo '[parse] url: ', $url, \"\\n\";\n \n $xpath = get_soup($url);\n \n // get number of reviews in all languages\n $num_reviews = $xpath->query('//span[@class=\"reviews_header_count\"]/text()')[0]->nodeValue; // get text\n $num_reviews = substr($num_reviews, 1, -1); // remove `( )`\n $num_reviews = str_replace(',', '', $num_reviews); // remove `,`\n $num_reviews = (int)$num_reviews; // convert text into integer\n echo '[parse] num_reviews ALL: ', $num_reviews, \"\\n\";\n \n // get number of reviews in English\n //~ $num_reviews = $xpath->query('//div[@data-value=\"en\"]//span/text()')[0]->nodeValue; // get text\n //~ $num_reviews = substr($num_reviews, 1, -1); // remove `( )`\n //~ $num_reviews = str_replace(',', '', $num_reviews); // remove `,`\n //~ $num_reviews = (int)$num_reviews; // convert text into integer\n //~ echo '[parse] num_reviews ENGLISH: ', $num_reviews, \"\\n\";\n \n // create template url for subpages with reviews\n // ie. https://www.tripadvisor.com/Hotel_Review-g562819-d289642-or{}.html\n $url_template = str_replace('.html', '-or{}.html', $url);\n echo '[parse] url_template:', $url_template;\n \n // create subpages urls and parse reviewes.\n // every subpage has 5 reviews and it has url with -or0.html -or5.html -or10.html -or15.html etc.\n \n $items = [];\n \n $offset = 0;\n \n while(True) {\n $subpage_url = str_replace('{}', $offset, $url_template);\n \n $subpage_items = parse_reviews($subpage_url);\n \n if($subpage_items->length == 0) break;\n \n $items += $subpage_items;\n \n $offset += 5;\n\n //~ return $items; // for test only - to stop after first page \n } \n \n return $items;\n}", "public function getDoanhNghiep()\n {\n $number = 102;\n// $client = new \\Goutte\\Client();\n// $crawler = $client->request('GET', 'https://www.lazada.vn/dien-thoai-di-dong/?spm=a2o4n.home.cate_1.1.19056afeWLyiaY');\n// $crawler->filter('div.cpF1IH ul.ant-pagination li');\n// var_dump(($crawler->filter('div.cpF1IH ul.ant-pagination li')));\n// exit;\n \n// $crawler->filter('div.c3gNPq ul li')->each(\n// \n// function (Crawler $node) {\n// var_dump($node->filter('a')->text());\n// exit;\n// }\n// );\n $this->getDoanhNghiepByPage();\n for($i=2;$i<=$number;$i++){\n $this->getPhoneLazadaByPage($i);\n }\n \n }", "function scrap_page_next($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 next url\n $regex = '@<link\\s*rel=\"next\"\\s*href=\"(.*)?\"@';\n preg_match($regex,$page,$u);\n if($u == null)\n return null;\n else \n return $u[1]; \n }", "function scrape() \n {\n\t\t$index = $this->curl_index();\n\t\t$check = preg_match('/id\\=\\\"\\_\\_VIEWSTATE\\\"\\svalue\\=\\\"([^\"]*)\"/', $index, $match); \n\t\tif ($check)\n\t\t{\n\t\t\t$vs = $match[1];\n\t\t\t$check = preg_match('/id\\=\\\"\\_\\_EVENTVALIDATION\\\"\\svalue\\=\\\"([^\"]*)\"/', $index, $match); \n\t\t\tif ($check)\n\t\t\t{\n\t\t\t\t$ev = $match[1];\n\t\t\t\t$search = '_'; // this search will return ALL \n\t\t\t\t$index = $this->curl_index($vs, $ev, $search);\n\t\t\t\t$flag = false;\n\t\t\t\t# need to handle paging here\n\t\t\t\tdo \n\t\t\t\t{\n\t\t\t\t\t# build booking_id array\n\t\t\t\t\t//echo $index;\n\t\t\t\t\t$check = preg_match_all('/btnNormal\\\"\\shref\\=\\\"(.*)\\\"/Uis', $index, $matches);\n\t\t\t\t\tif ( ! $check)\n\t\t\t\t\t\tbreak; // break paging loop\n\t\t\t\t\t$booking_ids = array();\n\t\t\t\t\tforeach($matches[1] as $match)\n\t\t\t\t\t{\n\t\t\t\t\t\t$booking_ids[] = preg_replace('/[^0-9]*/Uis', '', $match);\n\t\t\t\t\t}\n\t\t\t\t\tif (!empty($booking_ids))\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($booking_ids as $booking_id)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$details = $this->curl_details($booking_id);\n\t\t\t\t\t\t\t$extraction = $this->extraction($details, $booking_id);\n\t\t\t if ($extraction == 100) { $this->report->successful = ($this->report->successful + 1); $this->report->update(); }\n\t if ($extraction == 101) { $this->report->other = ($this->report->other + 1); $this->report->update(); }\n\t if ($extraction == 102) { $this->report->bad_images = ($this->report->bad_images + 1); $this->report->update(); }\n\t if ($extraction == 103) { $this->report->exists = ($this->report->exists + 1); $this->report->update(); }\n\t if ($extraction == 104) { $this->report->new_charges = ($this->report->new_charges + 1); $this->report->update(); }\n\t $this->report->total = ($this->report->total + 1); $this->report->update();\n\t\t\t\t\t\t}\n\t\t\t\t\t} else { $flag = true; } // no more pages\n\t\t\t\t\t# need to page here\n\t\t\t\t\t$index = $this->curl_page($index);\n\t\t\t\t\tif($index == false) { $flag = true; }\n\t\t\t\t} while($flag == false);\n\t\t\t\t$this->report->failed = ($this->report->other + $this->report->bad_images + $this->report->exists + $this->report->new_charges);\n\t\t $this->report->finished = 1;\n\t\t $this->report->stop_time = time();\n\t\t $this->report->time_taken = ($this->report->stop_time - $this->report->start_time);\n\t\t $this->report->update();\n\t\t return true; \n\t\t\t} else { return false; } // no event validation found\n\t\t} else { return false; } // no viewstate found\n\t}", "abstract function get_html();", "public function scrape()\n {\n $this->scrapeTeams();\n }", "public function scrape(){\n if($this->localCategoryId == 0){\n return;\n }\n \t// ID vozila, kako bi se izbjegli duplikati\n \t$ids = Vehicle::where('category_id', $this->localCategoryId)->pluck('source_id')->toArray();\n\n // Pojedinacni linkovi\n $links = [];\n // Paginacijski linkovi\n $pages = [];\n\n // Start crawling \n $crawler = Goutte::request('GET', $this->urlVehicles);\n\n // Dobavi paginacijske linkove\n $crawler->filter('#search-results .js-hide-on-filter .uk-pagination a.js-pagination-numeric')->eq(0)->each(function ($node) use (&$pages){\n $pages[] = $this->urlDomain . $node->extract(['href'])[0];\n });\n\n // Dobavi pojedinacne linkove za vozila na pocetnoj\n\t $crawler->filter('#search-results .js-hide-on-filter .single-classified h3 a')->each(function ($node) use (&$links, &$ids){\n $link = $node->extract(['href'])[0];\n $id = explode(\"/\", $link)[2];\n\n // Ako ne postoji taj link, dodaj ga\n if(!in_array($id, $ids)){\n $ids[] = $id;\n $links[$id] = $this->urlDomain . $link;\n }\n\t });\n\n // Za svaki paginacijski link, otvoti stranu i povuci pojedinacne linkove\n foreach($pages as $page){\n $paginatedPage = Goutte::request('GET', $page);\n $paginatedPage->filter('#search-results .js-hide-on-filter .single-classified h3 a')->each(function ($node) use (&$links, &$ids){\n $link = $node->extract(['href'])[0];\n $id = explode(\"/\", $link)[2];\n // Ako ne postoji taj link, dodaj ga\n if(!in_array($id, $ids)){\n $ids[] = $id;\n $links[$id] = $this->urlDomain . $link;\n }\n });\n }\n \n // Posjeti sve linkove i izvuci informacije\n foreach($links as $id => $link){\n $this->scrapeSingle($id,$link);\n }\n }", "function findPageUrls();", "function fetchPageContent($url) {\n $make = $url;\n $content = curl($make);\n $doc = new DOMDocument();\n @$doc->loadHTML($content);\n $xml = simplexml_import_dom($doc); // just to make xpath more simple\n return $xml;\n\n}", "function fetch_info($_url=\"\"){ \n if($_url&&$this-> fetch($_url)){\n $html = str_get_html($this-> html);\n $header = $html->find('head',0);\n $info['title'] = $header ->find('title',0)->plaintext;\n if( $keywords = $header ->find('meta[name=keywords]',0) )\n $info['keywords'] = $keywords->content;\n if( $description = $header ->find('meta[name=description]',0))\n $info['description'] = $description ->content;\n return $info;\n }\n return false;\n }", "function get_soup($url) {\n echo '[get_soup] url: ', $url, \"\\n\";\n\n // for test - to see what you get from server\n // $html = file_get_contents($url);\n // echo $html\n // $doc = new DOMDocument();\n // $doc->loadHTML($html, LIBXML_NOERROR);\n \n // read HTML directly from server and convert to DOMDocument\n $doc = new DOMDocument();\n $doc->loadHTMLFile($url, LIBXML_NOERROR);\n\n // search in HTML using XPath\n $xpath = new DOMXPath($doc);\n \n return $xpath;\n}", "public function crawl(){\n\t\t\t$this->collectUrls();\n\t\t}", "abstract protected function getPage() ;", "function episodeCrawler($urlVar,$resultsVar,$filterVar)\n{\n$html = file_get_contents($urlVar);\n//Create DOM-Obect\n$dom = new DOMDocument();\n@$dom->loadHTML($html);\n//Create DOM XPath\n$xpath = new DOMXPath($dom);\n//Get div-classes with specific ID through DOM XQuery\n$xpath_resultset = $xpath->query(\"//div[@class='$filterVar']\");\n\t//Loop through all the result from previous XPath Query\n\tfor ($i = 0; $i < $xpath_resultset->length; $i++)\n\t{\n\t//Save object into string with HTML-format\n\t$htmlString = $dom->saveHTML($xpath_resultset->item($i));\n\t\t\t//When loop has gone through more than specified value of how many results to show, stop loop\n\t if ($i >= $resultsVar)\n {\n break;\n }\n //If object in result has matching string \"Coming Soon\", do dateCountdownCrawler\n elseif (strpos($htmlString, '- Coming soon') !== false)\n {\n\t\t\t\t//Print out episode/object in result\n $comingSoonEpisode = $htmlString;\n\t\t\t\t//Call dateCountdownCrawler\n\t\t\t\tdateCountdownCrawler($dom,$xpath,$filterVar,$i,$comingSoonEpisode);\n }\n\t\telse\n\t\t{\n\t\t//print results\n\t\techo '<div class=\"customEpisodes\">';\n\t\techo $htmlString;\n\t\techo '</div>';\n\t\t}\n\t}\n}", "public function crawl() {\n $client = Naloader::getHttpClient($this->url);\n $crawler = $client->request('GET', $this->url);\n $this->parseFromCrawler($crawler);\n }", "public function test(){\n \t// it could be a huge performance concern if crawl it.\n \t// so I just choose the \"I\" category of all programs insteaded.\n\n \t// $url_main = \"http://www.humber.ca/program\"; \n \tset_time_limit(1000);\n \t// $url_main = \"http://www.humber.ca/program/listings/b?school=All&credential=All&campus=All&field_program_name_value_1=\";\n\n \t$html_main = file_get_contents($url_main);\n\n\t\t$crawler = new Crawler($html_main);\n\n\t\t$links = array();\n\n\t\t// Simple XPath for this element, so I did not use CssSelector.\n\t\t$crawler->filterXPath('//tbody/tr/td/a')->each(function ($node, $i) use( &$links) {\n\t\t\t\n\t\t\t// the links in website are relative path, so I need to add a prefix to make it absolute.\n\t\t\t$prefix = \"http://humber.ca\";\n\n\t\t\t$existed_programs = Program::all();\n\t\t\t$existed_program_names = array();\n\t\t\tforeach ($existed_programs as $key => $value) {\n\t\t\t\t$existed_program_names[] = $value['program_name'];\n\t\t\t}\n\n\t\t\t// get rid of the duplicated links, no idea why Humber make the program list a mess\n\t\t\tif (strpos($node->text(),',') === false) {\n\t\t\t\t\n\t\t\t\t// get the full link\n\t\t\t\t$link = $prefix . $node->attr('href');\n\t\t\t $link = trim($link);\n\t\t\t // get the text which is the program name\n\t\t\t $text = trim($node->text());\t\t\n\t\t \t\n\t\t \t// put associate name & link to key/value pair array\n\t\t\t if(!in_array($text, $existed_program_names)){\n\t\t\t \t$links[\"$text\"] = $link;\n\t\t\t }\n\t\t \t\t\t\t\n\t\t\t}\n\t\t});\n\n\t\t// an array to store all programs\n\t\t$programs = array();\n\n\t\t// use a loop to crawl individual program webpage by accessing its link in $links array\n\t\tforeach ($links as $key => $value) {\n\n\t\t\t$program_url = $value;\n\n\t\t\t// use curl to get the webpage content\n\t\t\t// it seems file_get_contents() has some issues for these webpage\n\t\t\t// or it's just I made some mistakes\n\t\t\t$curl_handle=curl_init();\n\t\t\tcurl_setopt($curl_handle, CURLOPT_URL,$program_url);\n\t\t\tcurl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2);\n\t\t\tcurl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1);\n\t\t\tcurl_setopt($curl_handle, CURLOPT_USERAGENT, 'Humber College');\n\n\t\t\t\n\n\t\t\t$program_html = curl_exec($curl_handle);\n\t\t\tcurl_close($curl_handle);\n\n\t\t\tif($program_html){\n\t\t\t\t$program_crawler = new Crawler($program_html);\n\t\t\t}\n\n\t\t\t// $program is an array to store the program's information with key/value pair\n\t\t\t$program = array();\n\n\t\t\t// here I used CssSelector to help me translate the XPath.\n\t\t\t// It made me address it without headache.\n\t\t\t$program['program_name'] = trim($key);\n\n\t\t\t$Code = $program_crawler->filterXPath(CssSelector::toXPath('div.container.clearfix>section>div.field-items>div.field-item.even'))->text();\n\t\t\t$program['program_code'] = trim($Code);\n\n\t\t\t$Credential = $program_crawler->filterXPath(CssSelector::toXPath('section.field-name-field-credential>div.field-item>a'))->text();\n\t\t\t$program['program_credential'] = trim($Credential);\n\n\t\t\t$School = $program_crawler->filterXPath(CssSelector::toXPath('section.field-name-field-school>div.field-item>a'))->text();\n\t\t\t$program['program_school'] = trim($School);\n\n\t\t\t// get all the schools from database\n\t\t\t$schools = School::all();\n\n\t\t\t// Because I used School table's id as the foreign key in Program table.\n\t\t\tforeach ($schools as $key1 => $value1) {\n\t \t\tif($program['program_school'] == $value1['school_name']){\n\t \t\t\t$program['program_school_id'] = $value1['id'];\n\t \t\t}\n\t \t}\t\n\n\t \t// getting each courses' name/code\n\t\t\t$courses = array();\n\t\t\t$courses = $program_crawler->filterXPath(CssSelector::toXPath('div.course'))->each(function ($node, $i) {\n\t\t\t\t$course = array();\n\t\t\t\t$course_code = $node->children()->first()->text();\n\t\t\t\t$course_name = $node->children()->last()->text();\n\t\t\t\t$course['course_code'] = $course_code;\n\t\t\t\t$course['course_name'] = $course_name;\n\t\t\t\treturn $course;\n\n\t\t\t});\n\n\t\t\t\n\t\t\t$program['program_courses'] = $courses;\n\t\t\t$programs[] = $program;\n\t\t}\n\n\t\t// store the information from array to database through loops\n\t\t// just in case of accidents, I commented the inserting database code below.\n\t\tforeach ($programs as $key => $value) {\n\t\t\t$one_program = new Program;\n\t\t\t$one_program->program_name = $value['program_name'];\n\t\t\t$one_program->program_code = $value['program_code'];\n\t\t\t$one_program->school_id = $value['program_school_id'];\n\t\t\t$one_program->credential = $value['program_credential'];\n\t\t\t$one_program->save();\n\t\t\techo \"a program is saved to db\" . \"<br>\";\n\t\t\tforeach ($value['program_courses'] as $key2 => $value2) {\n\n\t\t\t\t// Same reason as above, I used Program table's id as foreign key in Course table\n\t\t\t\t$stored_programs = Program::all();\n\t\t\t\t// $stored_programs = $programs;\n\t\t\t\t$course_belongs_id = 0;\n\t\t\t\tforeach ($stored_programs as $key3 => $value3) {\n\t\t \t\tif($value['program_name'] == $value3['program_name']){\n\t\t \t\t\t$course_belongs_id = $value3['id'];\n\t\t \t\t}\n\t\t \t}\n\n\t\t \t$existed_courses = Course::where('program_name', '=', $value['program_name']);\n\t\t\t\t$existed_course_name = array();\n\t\t\t\tforeach ($existed_courses as $key => $value) {\n\t\t\t\t\t$existed_course_name[] = $value['course_name'];\n\t\t\t\t}\t\n\t\t\t\tif(!in_array($value2['course_name'], $existed_course_name)){\n\t\t\t\t\t$one_course = new Course;\n\t\t\t\t\t$one_course->course_name = $value2['course_name'];\n\t\t\t\t\t$one_course->course_code = $value2['course_code'];\n\t\t\t\t\t$one_course->program_id = $course_belongs_id;\n\t\t\t\t\t$one_course->save();\n\t\t\t\t\techo \"a course is saved to db ---- \" . $one_course->program_id . \"<br>\";\n\t\t\t\t}\n\t\t \t\n\n\t\t\t}\n\t\t\techo \"<br>======<br>\";\n\t\t}\n\n\t}", "public function getPage();", "function getProducts($u,$cat){\n global $o;\n $d = new simple_html_dom();\n $d->load(scraperwiki::scrape($u));\n//echo \"Loaded URL: \" . $u . \"\\n\";\n $items = $d->find('li.grid-item');\n if (count($items) > 0) {\n \tforeach ($items as $p) {\n \t\t$prod = $p->find('p.product-name > a',0);\n \t\t$prodname = trim($prod->innertext);\n \t\t$prodURL = $prod->href;\n \t\tif (!is_null($p->find('p.minimal-price',0))) {\n \t\t $prodtype = 1;\n \t\t} else {\n \t\t $prodtype = 0;\n \t\t}\n \t\tfputcsv($o,array($prodname, $prodtype, $cat, $prodURL));\necho $prodname . \"\\n\";\n \t}\n \tif (!is_null($d->find('p.next',0))) {\n \t\tgetProducts($d->find('p.next',0)->href,$cat);\n \t}\n }\n}", "public abstract function get_html();", "protected function getPage() {}", "protected function getPage() {}", "function printHelp()\n {\n echo\n \"\\nWelcome to the Stadium Goods web parsing tool!\nHere you can pass a URL (or multiple separated by spaces) and will be given a csv of the products.\nFor example, running\n\nphp index.php https://www.stadiumgoods.com/adidas \n\nwill return a list of the Product Name and Price of each product on each page with a header followed by each product in the format:\n\n`Product Name`,`Price`\n`Air Jordan 1`, `$940.00`\n`Air Jodan 6 Retro`, `300.00`\n\n\nThe parser will continue to cycle through pages until the list is exhaused\n...\\n\\n\";\n }", "function getInfomationOnThisPage($crawler,$db,$batchId) {\n\t\t$title=\"\";\n\t\t$link=\"\";\n\t\t$cid=\"\";\n\t\t$price=\"\";\n\t\t$odo=\"\";\n\n\t\t// Get title\n\t\t$info = $crawler->filter('.result-item')->each(function ($node) {\n\t\t\t$info=array();\n\n\t\t\t/* Title & Link */\n\t\t\t$tmp=$node->filter(\"h2 a\")->each(function($node_1){\n\t\t\t\t$tmp=array();\n\t\t\t $tmp['title'] = trim(preg_replace(\"/<span.*span>/s\",\"\",$node_1->html()));\n\t\t\t $tmp['link'] = \"http://www.carsales.com.au\".$node_1->attr(\"href\");\n\t\t\t $tmp['cid'] = $node_1->attr('recordid');\n\t\t\t return $tmp;\n\t\t\t});\n\t\t\tif (count($tmp)>0){\n\t\t\t\t$info = array_merge($info,$tmp[0]);\n\t\t\t}\n\t\t\t/* Price */\n\t\t\t$tmp=$node->filter(\".additional-information .price a\")->each(function($node_2){\n\t\t\t\t$tmp=array();\n\t\t\t $tmp['price'] = $node_2->attr('data-price');\n\t\t\t return $tmp;\n\t\t\t});\n\t\t\tif (count($tmp)>0){\n\t\t\t\t$info = array_merge($info,$tmp[0]);\n\t\t\t}\n\t\t\t/* Odometer */\n\t\t\t$tmp = $node->filter(\".vehicle-features .item-odometer\")->each(function($node_2){\n\t\t\t\t$tmp=array();\n\t\t\t $tmp['odo'] = preg_replace(array(\"/<i.*i>/\",\"/,/\",\"/ km$/\"),array(\"\",\"\",\"\"),$node_2->html());\n\t\t\t return $tmp;\n\t\t\t});\n\t\t\tif (count($tmp)>0){\n\t\t\t\t$info = array_merge($info,$tmp[0]);\n\t\t\t}\n\n\t\t\treturn $info;\n\n\t\t});\n\n\t\t$sqls=array();\n\t\tforeach ($info AS $i) {\n\t\t\t$title=isset($i['title'])?$db->real_escape_string($i['title']):\"\";\n\t\t\t$link=isset($i['link'])?$db->real_escape_string($i['link']):\"\";\n\t\t\t$cid=isset($i['cid'])?$db->real_escape_string($i['cid']):\"\";\n\t\t\t$price=isset($i['price'])?$db->real_escape_string($i['price']):\"\";\n\t\t\t$odo=isset($i['odo'])?$db->real_escape_string($i['odo']):\"\";\n\n\t\t\t$sqls[]=\"('$cid','$title','$price','$odo','$batchId','$link')\";\n\t\t}\n\t\t$db->query(\"INSERT INTO subaru_outback (record_id,title,price,odometer,batch_id,link) VALUES \".implode(\",\",$sqls));\n\n\t}", "function findLinks($titleurl, $depth, $maxDepth, $meetings) {\n print \"titleurl\" . $titleurl . \"\\n\";\n $dom = new simple_html_dom();\n $html = scraperwiki::scrape($titleurl);\n $dom->load($html);\n\n print \"depth\" . $depth .\"\\n\";\n print \"maxdepth\" . $maxDepth .\"\\n\";\n \n\n if ( $depth > 1 ) {\n $rows = $dom->find(\"div[id=data1] table tbody tr\");\n }\n else {\n $rows = $dom->find(\"div[id=data] table tbody tr\");\n }\n unset($rows[0]);\n\n if ($depth <= $maxDepth) {\n $count = 0;\n\n # $i=0;\n \n foreach($rows as $row) {\nprint \"row\" . \"\\n\";\n\n/*\n $check0 = $row->find(\"td a\",0);\nprint \"check0\" . $check0 . \"\\n\";\n $check1 = $row->find(\"td a\",1);\nprint \"check1\" . $check1 . \"\\n\";\n if ( (!empty($check0)) && (!empty($check1)) ) {\n print \"both not empty\" . \"\\n\";\n}\n if ( (empty($check0)) && (empty($check1)) ) {\n print \"both empty\" . \"\\n\";\n}\n if ( (!empty($check0)) && (!empty($check1)) ) { \n \n*/\n\n $uribase = \"http://www.fingalcoco.ie/minutes/\";\n #print \"row1\" . $row .\"\\n\";\n #print \"row2\" . $rows[1] .\"\\n\";\n\n if ( $depth > 2 ) {\n $titleurl = $row->find(\"td a\",1);\n }\n else {\n $titleurl = $row->find(\"td a\",0);\n }\n\n\n #$titleurl = $row->find(\"td a\",0);\n #print \"titleurl1\" . $titleurl . \"\\n\";\n #$titleurl = $row->href;\n $title = strip_tags($titleurl);\n #print \"title\" . $title . \"\\n\";\n #print \"titleurl2\" . $titleurl . \"\\n\";\n $titleurl = $uribase . $titleurl->href;\n $titleurl = str_replace('../../minutes/','',$titleurl);\n #$titleurl = $uribase . $titleurl;\n print \"titleurl3\" . $titleurl . \"\\n\";\n\n #year,comittee,meetingdate,minuteref,url\n\n\n if ( $depth == 1 ) {\n $committee = \"\";\n $year = $title;\n $meetingdate = \"\";\n }\n elseif ( $depth == 2 ){\n $committee = $title;\n $year = $meetings[\"year\"];\n #print \"year\" . $meetings[\"year\"];\n $meetingdate = \"\";\n }\n\n elseif ( $depth == 3 ){\n $committee = $meetings[\"committee\"];\n #print \"3committee\" . $meetings[\"committee\"];\n $year = $meetings[\"year\"];\n #print \"3year\" . $meetings[\"year\"];\n $meetingdate = $title;\n }\n\n elseif ( $depth == 4 ){\n $committee = $meetings[\"committee\"];\n #print \"4committee\" . $meetings[\"committee\"];\n $year = $meetings[\"year\"];\n #print \"4year\" . $meetings[\"year\"];\n $meetingdate = $meetings[\"meetingdate\"];\n #print \"4meetingdate\" . $meetings[\"meetingdate\"];\n }\n\n else {\n $committee = \"committeeelse\";\n $year = \"yearelse\";\n $meetingdate = \"meetingdateelse\";\n }\n\nif ( $depth == 4) {\nprint \"yes\";\n\n#$meetingdetails = get_meetingdetails($titleurl);\n\n$meetingdetails = get_extras($titleurl);\nprint \"meetingdetails\" . print_r($meetingdetails) . \"\\n\";\n/*\n$councillors[\"$name\"] = array(\n \"name\" => $meetingdetails[\"name\"],\n \"Url\" => $meetingdetails[\"url\"],\n \"Reply\" => $meetingdetails[\"reply\"],\n \"Question\" => $meetingdetails[\"question\"],\n \"Cllrq\" => $meetingdetails[\"cllrq\"],\n \"Qtype\" => $meetingdetails[\"qtype\"], #, #,\n \"Response\" => $meetingdetails[\"response\"] #, #,\n );\n\n#}\n\n$name = $councillors[\"name\"];\n $url = $councillors[\"url\"];\n $reply = $councillors[\"reply\"];\n $question = $councillors[\"question\"];\n $cllrq = $councillors[\"cllrq\"];\n $qtype = $councillors[\"qtype\"]; \n $response = $councillors[\"response\"];\n\n*/\n\n $reply = $meetingdetails[\"reply\"];\n $question = $meetingdetails[\"question\"];\n $cllrq = $meetingdetails[\"cllrq\"];\n $qtype = $meetingdetails[\"qtype\"]; \n $response = $meetingdetails[\"response\"];\n\n}\nelse \n{\n\n $url = \"urlelse\";\n $reply = \"replyelse\";\n $question = \"questionelse\";\n $cllrq = \"cllrqelse\";\n $qtype = \"qtypeelse\";\n $response = \"responseelse\";\n}\n\n\n $meetings = array ( 'depth' => $depth, 'year' => $year, 'committee' => $committee, 'meetingdate' => $meetingdate, 'title' => $title, \n 'titleurl' => $titleurl,\n 'name' => $name,\n \n 'reply' => $reply,\n 'question' => $question,\n 'cllrq' => $cllrq,\n 'qtype' => $qtype, \n 'response' => $response\n );\n scraperwiki::save(array( 'titleurl','title'), $meetings);\n\n#}\n\n findLinks($titleurl, $depth + 1, $maxDepth, $meetings);\n\n # } \n\n # $i++;\n # if($i==3) break;\n } \n }\n\n}", "function findLinks($titleurl, $depth, $maxDepth, $meetings) {\n print \"titleurl\" . $titleurl . \"\\n\";\n $dom = new simple_html_dom();\n $html = scraperwiki::scrape($titleurl);\n $dom->load($html);\n\n print \"depth\" . $depth .\"\\n\";\n print \"maxdepth\" . $maxDepth .\"\\n\";\n \n\n if ( $depth > 1 ) {\n $rows = $dom->find(\"div[id=data1] table tbody tr\");\n }\n else {\n $rows = $dom->find(\"div[id=data] table tbody tr\");\n }\n unset($rows[0]);\n\n if ($depth <= $maxDepth) {\n $count = 0;\n\n # $i=0;\n \n foreach($rows as $row) {\nprint \"row\" . \"\\n\";\n\n/*\n $check0 = $row->find(\"td a\",0);\nprint \"check0\" . $check0 . \"\\n\";\n $check1 = $row->find(\"td a\",1);\nprint \"check1\" . $check1 . \"\\n\";\n if ( (!empty($check0)) && (!empty($check1)) ) {\n print \"both not empty\" . \"\\n\";\n}\n if ( (empty($check0)) && (empty($check1)) ) {\n print \"both empty\" . \"\\n\";\n}\n if ( (!empty($check0)) && (!empty($check1)) ) { \n \n*/\n\n $uribase = \"http://www.fingalcoco.ie/minutes/\";\n #print \"row1\" . $row .\"\\n\";\n #print \"row2\" . $rows[1] .\"\\n\";\n\n if ( $depth > 2 ) {\n $titleurl = $row->find(\"td a\",1);\n }\n else {\n $titleurl = $row->find(\"td a\",0);\n }\n\n\n #$titleurl = $row->find(\"td a\",0);\n #print \"titleurl1\" . $titleurl . \"\\n\";\n #$titleurl = $row->href;\n $title = strip_tags($titleurl);\n #print \"title\" . $title . \"\\n\";\n #print \"titleurl2\" . $titleurl . \"\\n\";\n $titleurl = $uribase . $titleurl->href;\n $titleurl = str_replace('../../minutes/','',$titleurl);\n #$titleurl = $uribase . $titleurl;\n print \"titleurl3\" . $titleurl . \"\\n\";\n\n #year,comittee,meetingdate,minuteref,url\n\n\n if ( $depth == 1 ) {\n $committee = \"\";\n $year = $title;\n $meetingdate = \"\";\n }\n elseif ( $depth == 2 ){\n $committee = $title;\n $year = $meetings[\"year\"];\n #print \"year\" . $meetings[\"year\"];\n $meetingdate = \"\";\n }\n\n elseif ( $depth == 3 ){\n $committee = $meetings[\"committee\"];\n #print \"3committee\" . $meetings[\"committee\"];\n $year = $meetings[\"year\"];\n #print \"3year\" . $meetings[\"year\"];\n $meetingdate = $title;\n }\n\n elseif ( $depth == 4 ){\n $committee = $meetings[\"committee\"];\n #print \"4committee\" . $meetings[\"committee\"];\n $year = $meetings[\"year\"];\n #print \"4year\" . $meetings[\"year\"];\n $meetingdate = $meetings[\"meetingdate\"];\n #print \"4meetingdate\" . $meetings[\"meetingdate\"];\n }\n\n else {\n $committee = \"committeeelse\";\n $year = \"yearelse\";\n $meetingdate = \"meetingdateelse\";\n }\n\nif ( $depth == 4) {\nprint \"yes\";\n\n#$meetingdetails = get_meetingdetails($titleurl);\n\n$meetingdetails = get_extras($titleurl);\nprint \"meetingdetails\" . print_r($meetingdetails) . \"\\n\";\n/*\n$councillors[\"$name\"] = array(\n \"name\" => $meetingdetails[\"name\"],\n \"Url\" => $meetingdetails[\"url\"],\n \"Reply\" => $meetingdetails[\"reply\"],\n \"Question\" => $meetingdetails[\"question\"],\n \"Cllrq\" => $meetingdetails[\"cllrq\"],\n \"Qtype\" => $meetingdetails[\"qtype\"], #, #,\n \"Response\" => $meetingdetails[\"response\"] #, #,\n );\n\n#}\n\n$name = $councillors[\"name\"];\n $url = $councillors[\"url\"];\n $reply = $councillors[\"reply\"];\n $question = $councillors[\"question\"];\n $cllrq = $councillors[\"cllrq\"];\n $qtype = $councillors[\"qtype\"]; \n $response = $councillors[\"response\"];\n\n*/\n\n $reply = $meetingdetails[\"reply\"];\n $question = $meetingdetails[\"question\"];\n $cllrq = $meetingdetails[\"cllrq\"];\n $qtype = $meetingdetails[\"qtype\"]; \n $response = $meetingdetails[\"response\"];\n\n}\nelse \n{\n\n $url = \"urlelse\";\n $reply = \"replyelse\";\n $question = \"questionelse\";\n $cllrq = \"cllrqelse\";\n $qtype = \"qtypeelse\";\n $response = \"responseelse\";\n}\n\n\n $meetings = array ( 'depth' => $depth, 'year' => $year, 'committee' => $committee, 'meetingdate' => $meetingdate, 'title' => $title, \n 'titleurl' => $titleurl,\n 'name' => $name,\n \n 'reply' => $reply,\n 'question' => $question,\n 'cllrq' => $cllrq,\n 'qtype' => $qtype, \n 'response' => $response\n );\n scraperwiki::save(array( 'titleurl','title'), $meetings);\n\n#}\n\n findLinks($titleurl, $depth + 1, $maxDepth, $meetings);\n\n # } \n\n # $i++;\n # if($i==3) break;\n } \n }\n\n}", "function findLinks($titleurl, $depth, $maxDepth, $meetings) {\n print \"titleurl\" . $titleurl . \"\\n\";\n $dom = new simple_html_dom();\n $html = scraperwiki::scrape($titleurl);\n $dom->load($html);\n\n print \"depth\" . $depth .\"\\n\";\n print \"maxdepth\" . $maxDepth .\"\\n\";\n \n\n if ( $depth > 1 ) {\n $rows = $dom->find(\"div[id=data1] table tbody tr\");\n }\n else {\n $rows = $dom->find(\"div[id=data] table tbody tr\");\n }\n unset($rows[0]);\n\n if ($depth <= $maxDepth) {\n $count = 0;\n\n # $i=0;\n \n foreach($rows as $row) {\nprint \"row\" . \"\\n\";\n\n/*\n $check0 = $row->find(\"td a\",0);\nprint \"check0\" . $check0 . \"\\n\";\n $check1 = $row->find(\"td a\",1);\nprint \"check1\" . $check1 . \"\\n\";\n if ( (!empty($check0)) && (!empty($check1)) ) {\n print \"both not empty\" . \"\\n\";\n}\n if ( (empty($check0)) && (empty($check1)) ) {\n print \"both empty\" . \"\\n\";\n}\n if ( (!empty($check0)) && (!empty($check1)) ) { \n \n*/\n\n $uribase = \"http://www.fingalcoco.ie/minutes/\";\n #print \"row1\" . $row .\"\\n\";\n #print \"row2\" . $rows[1] .\"\\n\";\n\n if ( $depth > 2 ) {\n $titleurl = $row->find(\"td a\",1);\n }\n else {\n $titleurl = $row->find(\"td a\",0);\n }\n\n\n #$titleurl = $row->find(\"td a\",0);\n #print \"titleurl1\" . $titleurl . \"\\n\";\n #$titleurl = $row->href;\n $title = strip_tags($titleurl);\n #print \"title\" . $title . \"\\n\";\n #print \"titleurl2\" . $titleurl . \"\\n\";\n $titleurl = $uribase . $titleurl->href;\n $titleurl = str_replace('../../minutes/','',$titleurl);\n #$titleurl = $uribase . $titleurl;\n print \"titleurl3\" . $titleurl . \"\\n\";\n\n #year,comittee,meetingdate,minuteref,url\n\n\n if ( $depth == 1 ) {\n $committee = \"\";\n $year = $title;\n $meetingdate = \"\";\n }\n elseif ( $depth == 2 ){\n $committee = $title;\n $year = $meetings[\"year\"];\n #print \"year\" . $meetings[\"year\"];\n $meetingdate = \"\";\n }\n\n elseif ( $depth == 3 ){\n $committee = $meetings[\"committee\"];\n #print \"3committee\" . $meetings[\"committee\"];\n $year = $meetings[\"year\"];\n #print \"3year\" . $meetings[\"year\"];\n $meetingdate = $title;\n }\n\n elseif ( $depth == 4 ){\n $committee = $meetings[\"committee\"];\n #print \"4committee\" . $meetings[\"committee\"];\n $year = $meetings[\"year\"];\n #print \"4year\" . $meetings[\"year\"];\n $meetingdate = $meetings[\"meetingdate\"];\n #print \"4meetingdate\" . $meetings[\"meetingdate\"];\n }\n\n else {\n $committee = \"committeeelse\";\n $year = \"yearelse\";\n $meetingdate = \"meetingdateelse\";\n }\n\nif ( $depth == 4) {\nprint \"yes\";\n\n#$meetingdetails = get_meetingdetails($titleurl);\n\n$meetingdetails = get_extras($titleurl);\nprint \"meetingdetails\" . print_r($meetingdetails) . \"\\n\";\n/*\n$councillors[\"$name\"] = array(\n \"name\" => $meetingdetails[\"name\"],\n \"Url\" => $meetingdetails[\"url\"],\n \"Reply\" => $meetingdetails[\"reply\"],\n \"Question\" => $meetingdetails[\"question\"],\n \"Cllrq\" => $meetingdetails[\"cllrq\"],\n \"Qtype\" => $meetingdetails[\"qtype\"], #, #,\n \"Response\" => $meetingdetails[\"response\"] #, #,\n );\n\n#}\n\n$name = $councillors[\"name\"];\n $url = $councillors[\"url\"];\n $reply = $councillors[\"reply\"];\n $question = $councillors[\"question\"];\n $cllrq = $councillors[\"cllrq\"];\n $qtype = $councillors[\"qtype\"]; \n $response = $councillors[\"response\"];\n\n*/\n\n $reply = $meetingdetails[\"reply\"];\n $question = $meetingdetails[\"question\"];\n $cllrq = $meetingdetails[\"cllrq\"];\n $qtype = $meetingdetails[\"qtype\"]; \n $response = $meetingdetails[\"response\"];\n\n}\nelse \n{\n\n $url = \"urlelse\";\n $reply = \"replyelse\";\n $question = \"questionelse\";\n $cllrq = \"cllrqelse\";\n $qtype = \"qtypeelse\";\n $response = \"responseelse\";\n}\n\n\n $meetings = array ( 'depth' => $depth, 'year' => $year, 'committee' => $committee, 'meetingdate' => $meetingdate, 'title' => $title, \n 'titleurl' => $titleurl,\n 'name' => $name,\n \n 'reply' => $reply,\n 'question' => $question,\n 'cllrq' => $cllrq,\n 'qtype' => $qtype, \n 'response' => $response\n );\n scraperwiki::save(array( 'titleurl','title'), $meetings);\n\n#}\n\n findLinks($titleurl, $depth + 1, $maxDepth, $meetings);\n\n # } \n\n # $i++;\n # if($i==3) break;\n } \n }\n\n}", "function findLinks($titleurl, $depth, $maxDepth, $meetings) {\n print \"titleurl\" . $titleurl . \"\\n\";\n $dom = new simple_html_dom();\n $html = scraperwiki::scrape($titleurl);\n $dom->load($html);\n\n print \"depth\" . $depth .\"\\n\";\n print \"maxdepth\" . $maxDepth .\"\\n\";\n \n\n if ( $depth > 1 ) {\n $rows = $dom->find(\"div[id=data1] table tbody tr\");\n }\n else {\n $rows = $dom->find(\"div[id=data] table tbody tr\");\n }\n unset($rows[0]);\n\n if ($depth <= $maxDepth) {\n $count = 0;\n\n # $i=0;\n \n foreach($rows as $row) {\nprint \"row\" . \"\\n\";\n\n/*\n $check0 = $row->find(\"td a\",0);\nprint \"check0\" . $check0 . \"\\n\";\n $check1 = $row->find(\"td a\",1);\nprint \"check1\" . $check1 . \"\\n\";\n if ( (!empty($check0)) && (!empty($check1)) ) {\n print \"both not empty\" . \"\\n\";\n}\n if ( (empty($check0)) && (empty($check1)) ) {\n print \"both empty\" . \"\\n\";\n}\n if ( (!empty($check0)) && (!empty($check1)) ) { \n \n*/\n\n $uribase = \"http://www.fingalcoco.ie/minutes/\";\n #print \"row1\" . $row .\"\\n\";\n #print \"row2\" . $rows[1] .\"\\n\";\n\n if ( $depth > 2 ) {\n $titleurl = $row->find(\"td a\",1);\n }\n else {\n $titleurl = $row->find(\"td a\",0);\n }\n\n\n #$titleurl = $row->find(\"td a\",0);\n #print \"titleurl1\" . $titleurl . \"\\n\";\n #$titleurl = $row->href;\n $title = strip_tags($titleurl);\n #print \"title\" . $title . \"\\n\";\n #print \"titleurl2\" . $titleurl . \"\\n\";\n $titleurl = $uribase . $titleurl->href;\n $titleurl = str_replace('../../minutes/','',$titleurl);\n #$titleurl = $uribase . $titleurl;\n print \"titleurl3\" . $titleurl . \"\\n\";\n\n #year,comittee,meetingdate,minuteref,url\n\n\n if ( $depth == 1 ) {\n $committee = \"\";\n $year = $title;\n $meetingdate = \"\";\n }\n elseif ( $depth == 2 ){\n $committee = $title;\n $year = $meetings[\"year\"];\n #print \"year\" . $meetings[\"year\"];\n $meetingdate = \"\";\n }\n\n elseif ( $depth == 3 ){\n $committee = $meetings[\"committee\"];\n #print \"3committee\" . $meetings[\"committee\"];\n $year = $meetings[\"year\"];\n #print \"3year\" . $meetings[\"year\"];\n $meetingdate = $title;\n }\n\n elseif ( $depth == 4 ){\n $committee = $meetings[\"committee\"];\n #print \"4committee\" . $meetings[\"committee\"];\n $year = $meetings[\"year\"];\n #print \"4year\" . $meetings[\"year\"];\n $meetingdate = $meetings[\"meetingdate\"];\n #print \"4meetingdate\" . $meetings[\"meetingdate\"];\n }\n\n else {\n $committee = \"committeeelse\";\n $year = \"yearelse\";\n $meetingdate = \"meetingdateelse\";\n }\n\nif ( $depth == 4) {\nprint \"yes\";\n\n#$meetingdetails = get_meetingdetails($titleurl);\n\n$meetingdetails = get_extras($titleurl);\nprint \"meetingdetails\" . print_r($meetingdetails) . \"\\n\";\n/*\n$councillors[\"$name\"] = array(\n \"name\" => $meetingdetails[\"name\"],\n \"Url\" => $meetingdetails[\"url\"],\n \"Reply\" => $meetingdetails[\"reply\"],\n \"Question\" => $meetingdetails[\"question\"],\n \"Cllrq\" => $meetingdetails[\"cllrq\"],\n \"Qtype\" => $meetingdetails[\"qtype\"], #, #,\n \"Response\" => $meetingdetails[\"response\"] #, #,\n );\n\n#}\n\n$name = $councillors[\"name\"];\n $url = $councillors[\"url\"];\n $reply = $councillors[\"reply\"];\n $question = $councillors[\"question\"];\n $cllrq = $councillors[\"cllrq\"];\n $qtype = $councillors[\"qtype\"]; \n $response = $councillors[\"response\"];\n\n*/\n\n $reply = $meetingdetails[\"reply\"];\n $question = $meetingdetails[\"question\"];\n $cllrq = $meetingdetails[\"cllrq\"];\n $qtype = $meetingdetails[\"qtype\"]; \n $response = $meetingdetails[\"response\"];\n\n}\nelse \n{\n\n $url = \"urlelse\";\n $reply = \"replyelse\";\n $question = \"questionelse\";\n $cllrq = \"cllrqelse\";\n $qtype = \"qtypeelse\";\n $response = \"responseelse\";\n}\n\n\n $meetings = array ( 'depth' => $depth, 'year' => $year, 'committee' => $committee, 'meetingdate' => $meetingdate, 'title' => $title, \n 'titleurl' => $titleurl,\n 'name' => $name,\n \n 'reply' => $reply,\n 'question' => $question,\n 'cllrq' => $cllrq,\n 'qtype' => $qtype, \n 'response' => $response\n );\n scraperwiki::save(array( 'titleurl','title'), $meetings);\n\n#}\n\n findLinks($titleurl, $depth + 1, $maxDepth, $meetings);\n\n # } \n\n # $i++;\n # if($i==3) break;\n } \n }\n\n}", "function grabHTML($function_host_name, $url)\n{\n\n $ch = curl_init();\n $header=array('GET /1575051 HTTP/1.1',\n \"Host: $function_host_name\",\n 'Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',\n 'Accept-Language:en-US,en;q=0.8',\n 'Cache-Control:max-age=0',\n 'Connection:keep-alive',\n 'User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36',\n );\n\n curl_setopt($ch,CURLOPT_URL,$url);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);\n curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,0);\n curl_setopt( $ch, CURLOPT_COOKIESESSION, true );\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch,CURLOPT_COOKIEFILE,'cookies.txt');\n curl_setopt($ch,CURLOPT_COOKIEJAR,'cookies.txt');\n curl_setopt($ch,CURLOPT_HTTPHEADER,$header);\n\n $returnHTML = curl_exec($ch); \n return $returnHTML; \n curl_close($ch);\n\n}", "function test()\n{\n $username = '[email protected]';\n $password = 'password!';\n $scrape_url = 'http://games.espn.com/ffl/clubhouse?leagueId=93772&teamId=1&seasonId=2018';\n try {\n $espn = new ESPN($username, $password); // initialize class with username and password\n $espn->login(); // do login (and set cookies right)\n $resp = $espn->scrape($scrape_url); // scrape url\n save_response($resp); // save to file to see it better in browser\n } catch (Exception $ex) {\n die($ex->getMessage());\n }\n}", "private function DownloadParsePage() {\n $this->Log(\"Debridage du lien : \".$this->url);\n\t\t$curl = curl_init();\n\t\tcurl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($curl, CURLOPT_USERAGENT, DOWNLOAD_STATION_USER_AGENT);\n\t\tcurl_setopt($curl, CURLOPT_COOKIEFILE, $this->TOUTDEBRID_COOKIE);\n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($curl, CURLOPT_URL, $this->TOUTDEBRID_DEBRID_URL);\n curl_setopt($curl, CURLOPT_POST, TRUE);\n curl_setopt($curl, CURLOPT_POSTFIELDS, 'urllist='.urlencode($this->url).'&captcha=none&');\n\t\t$ret = curl_exec($curl);\n\t\t$this->Log(\"Reponse tout-debrid : \".$ret);\n\t\tcurl_close($curl);\n\t\treturn $ret;\n\t}", "public function collectData(){\n\t\t// Simple HTML Dom is not accurate enough for the job\n\t\t$content = getContents($this->getURI())\n\t\t\tor returnServerError('No results for LWNprev');\n\n\t\tlibxml_use_internal_errors(true);\n\t\t$html = new DOMDocument();\n\t\t$html->loadHTML($content);\n\t\tlibxml_clear_errors();\n\n\t\t$cat1 = '';\n\t\t$cat2 = '';\n\n\t\tforeach($html->getElementsByTagName('a') as $a){\n\t\t\tif($a->textContent === 'Multi-page format'){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$realURI = self::URI . $a->getAttribute('href');\n\t\t$URICounter = 0;\n\n\t\t$edition = $html->getElementsByTagName('h1')->item(0)->textContent;\n\t\t$editionTimeStamp = strtotime(\n\t\t\tsubstr($edition, strpos($edition, 'for ') + strlen('for '))\n\t\t);\n\n\t\tforeach($html->getElementsByTagName('h2') as $h2){\n\t\t\tif($h2->getAttribute('class') !== 'SummaryHL'){\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$item = array();\n\n\t\t\t$h2NextSibling = $h2->nextSibling;\n\t\t\t$this->jumpToNextTag($h2NextSibling);\n\n\t\t\tswitch($h2NextSibling->getAttribute('class')){\n\t\t\tcase 'FeatureByline':\n\t\t\t\t$item['author'] = $h2NextSibling->getElementsByTagName('b')->item(0)->textContent;\n\t\t\t\tbreak;\n\t\t\tcase 'GAByline':\n\t\t\t\t$text = $h2NextSibling->textContent;\n\t\t\t\t$item['author'] = substr($text, strpos($text, 'by '));\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$item['author'] = 'LWN';\n\t\t\t\tbreak;\n\t\t\t};\n\n\t\t\t$h2FirstChild = $h2->firstChild;\n\t\t\t$this->jumpToNextTag($h2FirstChild);\n\t\t\tif($h2FirstChild->nodeName === 'a'){\n\t\t\t\t$item['uri'] = self::URI . $h2FirstChild->getAttribute('href');\n\t\t\t}else{\n\t\t\t\t$item['uri'] = $realURI . '#' . $URICounter;\n\t\t\t}\n\t\t\t$URICounter++;\n\n\t\t\t$item['timestamp'] = $editionTimeStamp + $URICounter;\n\n\t\t\t$h2PrevSibling = $h2->previousSibling;\n\t\t\t$this->jumpToPreviousTag($h2PrevSibling);\n\t\t\tswitch($h2PrevSibling->getAttribute('class')){\n\t\t\tcase 'Cat2HL':\n\t\t\t\t$cat2 = $h2PrevSibling->textContent;\n\t\t\t\t$h2PrevSibling = $h2PrevSibling->previousSibling;\n\t\t\t\t$this->jumpToPreviousTag($h2PrevSibling);\n\t\t\t\tif($h2PrevSibling->getAttribute('class') !== 'Cat1HL'){\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t$cat1 = $h2PrevSibling->textContent;\n\t\t\t\tbreak;\n\t\t\tcase 'Cat1HL':\n\t\t\t\t$cat1 = $h2PrevSibling->textContent;\n\t\t\t\t$cat2 = '';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$h2PrevSibling = null;\n\n\t\t\t$item['title'] = '';\n\t\t\tif(!empty($cat1)){\n\t\t\t\t$item['title'] .= '[' . $cat1 . ($cat2 ? '/' . $cat2 : '') . '] ';\n\t\t\t}\n\t\t\t$item['title'] .= $h2->textContent;\n\n\t\t\t$node = $h2;\n\t\t\t$content = '';\n\t\t\t$contentEnd = false;\n\t\t\twhile(!$contentEnd){\n\t\t\t\t$node = $node->nextSibling;\n\t\t\t\tif(!$node || (\n\t\t\t\t\t\t$node->nodeType !== XML_TEXT_NODE && (\n\t\t\t\t\t\t\t$node->nodeName === 'h2' || (\n\t\t\t\t\t\t\t\t!is_null($node->attributes) &&\n\t\t\t\t\t\t\t\t!is_null($class = $node->attributes->getNamedItem('class')) &&\n\t\t\t\t\t\t\t\tin_array($class->nodeValue, array('Cat1HL', 'Cat2HL'))\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t){\n\t\t\t\t\t$contentEnd = true;\n\t\t\t\t}else{\n\t\t\t\t\t$content .= $node->C14N();\n\t\t\t\t}\n\t\t\t}\n\t\t\t$item['content'] = $content;\n\t\t\t$this->items[] = $item;\n\t\t}\n\t}", "function getProduct($u){\n global $baseurl, $o, $r, $i, $local;\n $path = \"\";\n $d = new simple_html_dom();\n $d->load(scraperwiki::scrape($u));\n if (is_null($d->find('div[id=medproimg]',0))) {\n return 0;\n }\n//echo \"Loaded URL: \" . $u . \"\\n\";\n $imgfileurl = $d->find('div[id=medproimg]',0)->first_child()->href;\n $imgfile = trim(strrchr($imgfileurl,\"/\"),\"/ \");\n $img = \"/\" . substr($imgfile,0,1) . \"/\" . substr($imgfile,1,1) . \"/\" . $imgfile;\n fputcsv($i,array($imgfileurl,$img));\n $catname = \"\";\n $cats = $d->find('div[id=breadcrumb] ul li a');\n foreach ($cats as $cat) {\n $catname .= trim($cat->innertext) . \"/\";\n }\n $catname .= trim($d->find('div[id=breadcrumb] ul a b',0)->innertext);\n if (!is_null($d->find('div[id=prospecsbox]',0))) {\n $description = $d->find('div[id=prospecsbox]',0)->outertext;\n } else {\n $description = \"\";\n }\n if (!is_null($d->find('div[id=ctl00_cphContent_divShippingBilling]',0))) {\n $description .= $d->find('div[id=ctl00_cphContent_divShippingBilling]',0)->outertext;\n }\n if (!is_null($d->find('span[id=ctl00_cphContent_hidebrandid]',0))) {\n $brand = trim($d->find('span[id=ctl00_cphContent_hidebrandid]',0)->first_child()->innertext);\n } else {\n $brand = \"\";\n }\n $data = array(\n trim($d->find('span[id=pskuonly]',0)->innertext),\n \"\",\n \"Default\",\n \"simple\",\n $catname,\n \"Home\",\n \"base\",\n \"12/12/15 22:48\",\n $description,\n \"No\",\n 0,\n $img,\n $brand,\n \"\",\n \"Use config\",\n \"Use config\",\n trim($d->find('div[id=productname]',0)->first_child()->innertext),\n \"Product Info Column\",\n \"1 column\",\n trim($d->find('div[id=proprice]',0)->first_child()->innertext,\"$ \"),\n 0,\n \"\",\n $img,\n 1,\n 2,\n $img,\n \"12/12/15 22:48\",\n \"\",\n \"\",\n 4,\n 1.0000,\n 0,\n 1,\n 1,\n 0,\n 0,\n 1,\n 1,\n 1,\n 0,\n 1,\n 1,\n 1,\n 0,\n 1,\n 0,\n 1,\n 0,\n 1,\n 0,\n 0,\n 88,\n $img,\n $d->find('div[id=medproimg]',0)->first_child()->title,\n 1,\n 0 \n );\n fputcsv($o,$data);\n $thumbs = $d->find('div[id=altvidthmbs] thmbs');\n if (count($thumbs) > 1) {\n for ($x = 0; $x <= (count($thumbs) - 2); $x++) {\n $imgfileurl = $thumbs[$x]->first_child()->href;\n $imgfile = trim(strrchr($imgfileurl,\"/\"),\"/ \");\n $img = \"/\" . substr($imgfile,0,1) . \"/\" . substr($imgfile,1,1) . \"/\" . $imgfile;\n fputcsv($i,array($imgfileurl,$img));\n $data = array(\n \"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\n \"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\n \"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\n \"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\n \"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\"\",\n \"\",\"88\",\n $img,\n $thumbs[$x]->first_child()->title,\n ($x + 2),\n 0\n );\n fputcsv($o,$data);\n }\n }\n $reviews = $d->find('table[id=ctl00_cphContent_datalistReviews] div.pr-review-wrap');\n if (count($reviews) > 0) {\n foreach ($reviews as $rev) {\n $data = array(\n trim($d->find('span[id=pskuonly]',0)->innertext),\n trim($rev->find('p.pr-review-rating-headline span',0)->innertext),\n trim($rev->find('span.pr-rating',0)->innertext),\n trim($rev->find('span[id$=labelUser]',0)->innertext),\n trim($rev->find('span[id$=labelLocation]',0)->innertext),\n trim($rev->find('div.pr-review-author-date',0)->innertext),\n trim($rev->find('span[id$=labelComments]',0)->innertext)\n );\n fputcsv($r,$data);\n }\n }\n echo trim($d->find('div[id=productname]',0)->first_child()->innertext) . \"\\n\";\n return 1;\n}", "function getAllLinks($html){\n $tmp_str=\"\";\n $tmp_links=array();\n if (count($html->find('span[class=pl]'))>0)\n foreach ($html->find('span[class=pl] a') as $ahref)\n {\n $tmp_str=$tmp_str.'<a href=\"http://losangeles.craigslist.org'.$ahref->href.'\">'.$ahref->innertext.'</a><br/>';\n $tmp_links[]='<a href=\"http://losangeles.craigslist.org'.$ahref->href.'\">'.$ahref->innertext.'</a>';\n\n }\n return $tmp_links;\n}", "function do_one($row,$base){\n \n requests::set_referer($base);\n $page = 1;\n while ($page<=50){\n \n $url = $base.'p'.$page.'/';\n $list = requests::get($url);\n \n $lis = selector::select($list, \".hy_companylist li\", \"css\");\n // if ($page==2){var_dump($lis);exit;}\n \n \n if (empty($lis)){\n continue;\n }\n foreach($lis as $li){\n \n //$str = strip_tags($li);\n \n $name = selector::select($li, \"a\", \"css\");\n $tel = selector::select($li, \"span.tel\", \"css\");\n $dds = selector::select($li, \"dd\",'css');////dl/dd[1]/text()\n \n \n if (is_array($dds)){\n $address = strip_tags($dds[0]);\n $pro = strip_tags($dds[1]);\n }else{\n $address = '';\n $pro = strip_tags($dds);\n }\n \n echo implode(\"\\t\", $row).\"\\t\";\n echo $name.\"\\t\".$tel.\"\\t\".trim($address).\"\\t\".trim($pro).\"\\n\";\n// return ['name'=>$name,'$tel'=>$tel,'']\n \n }\n sleep(1);\n \n $page++;\n }\n }", "public function crawl()\n\t{\n \t// truncate any non-existant pages\n\t\t$this->resetIndex();\n\n\t\t// create a temporary table for incrementing counts\n\t\t$this->createTempTable();\n\n\t\t// add initial URL to crawl list\n\t\t$this->addRequest($this->startUrl);\n\n\t\t// begin crawling the url\n\t\t$this->crawlUrls();\n\n\t\t// update url counts and remove the temp table\n\t\t$this->finalizeUrlCounts();\n\t}", "public function initSpider(){\n echo \"<p>Searching: <b>\".$this->keyword.\"</b> and Looking for: <b>\".$this->website.\"</b></p>\";\n echo str_repeat(\" \", 256);\n $contador=0;\n $encontre=false;\n $_GET['weboriginal']=\"\";\n $_GET['webcontador']=\"\";\n $i=10;\n $c=1;\n while($c<=10) { \n echo \"<ul><li><b>Searching in Page: $c</b></li>\"; \n flush();ob_flush();\n $records= $this->getRecordsAsArray($this->url); \n $count=count($records);\n echo \"<ul>\";\n for($k=0;$k<$count;$k++){\n $j=$k+1;\n $link=$records[$k][2];\n $linkOriginal = $link;\n $link=strip_tags($link);\n $link=str_replace(\"http://www.\",\"\",$link);\n $link=str_replace(\"http://\",\"\",$link);\n $link=str_replace(\"www.\",\"\",$link);\n $pos=strpos($link, \"/\");\n $link=trim(substr($link,0,$pos));\n $contador++;\n if($this->website==$link){\n $domain=$this->website;\n $_GET['weboriginal']=$linkOriginal;\n $_GET['webcontador']=$contador;\n echo \"<li><h1>Result was found in Page: $c and Record: $j</h1></li>\";\n echo \"Web original \".$linkOriginal;\n echo \"<div>Congrats, We searched google's top 10 pages for <b>\\\"\".$this->keyword.\"</b>\\\", we found your domain <b>\\\"$domain\\\"</b> listed on page: $c at $j place </div>\";echo \"</ul></ul>\";\n $encontre=true;\n break;\n }\n else{\n echo \"<li>Result not found on Page: $c and Record: $j</li>\";\n } \n }\n if($encontre==true){\n break;\n }\n echo \"</ul></ul>\";\n $c++;\n $this->url = $this->updateUrl($this->keyword, $i,$this->motor);\n }\n echo \"Crawled through all 10 pages.\"; \n \n if($this->page==false){\n $domain=$this->website;\n $keyword=$this->keyword;\n echo \"<div>Sorry, We searched google's top 10 pages for <b>\\\"$keyword\\\"</b>, but was unable to find your domain <b>\\\"$domain\\\"</b> listed anywhere. </div>\";\n }\n else {\n $page=$this->page;\n $records=$this->records;\n $domain=$this->website;\n $keyword=$this->keyword;\n echo \"<div>Congrats, We searched google's top 10 pages for <b>\\\"$keyword\\\"</b>, we found your domain <b>\\\"$domain\\\"</b> listed on page: $page at $record place </div>\";\n }\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 }", "function getUrlDetails($url) {\n $parser = new DomDocumentParser($url);\n \n // retrieve the title from the web page\n $title = getUrlTitle($parser);\n\n // retrieve the descrition and keywords from the web page\n $descAndKeywords = getUrlMeta($parser);\n $description = $descAndKeywords[0];\n $keywords = $descAndKeywords[1];\n\n // make sure we are not double-inserting websites in database\n if (existsInDatabase($url)) {\n echo \"$url already exists <br><br>\";\n }\n else if (insertInDatabase($url, $title, $description, $keywords)) {\n echo \"[SUCCESS] $url <br><br>\";\n }\n else {\n echo \"[ERROR] Failed to insert $url <br><br>\";\n }\n\n getUrlImages($parser, $url);\n}", "function scan_page($content)\n{\n $tidy = new Tidy();\n $content = $tidy->repairString($content);\n $doc = new DOMDocument();\n $doc->loadHtml($content);\n $doc->normalizeDocument();\n\n $divs = $doc->getElementsByTagName('div');\n $length = $divs->length;\n $listing = array();\n\n for ($pos=0; $pos<$length; $pos++)\n {\n $node = $divs->item($pos);\n\n $class = $node->getAttribute('class');\n if ($class == \"sqdetailsDep trow\")\n $listing[] = scan_entry($node);\n }\n return $listing;\n\n}", "function parse_reviews($url) {\n echo '[parse_reviews] url: ', $url, \"\\n\";\n \n $xpath = get_soup($url);\n \n // find hotel name\n $hotel_name = $xpath->query('//h1[@id=\"HEADING\"]/text()')[0]->nodeValue;\n \n $reviews_ids = get_reviews_ids($xpath);\n $xpath = get_more($reviews_ids);\n\n $items = [];\n \n // find all reviews on page \n //foreach($xpath->query('//div[@class=\"review-container\"]') as $review) { # reviews on normal page\n foreach($xpath->query('//div[@class=\"reviewSelector\"]') as $review) { # reviews on normal page\n \n // it has to check if `badgets` (contributions/helpful_vote) exist on page \n $badgets = $xpath->query('.//span[@class=\"badgetext\"]', $review);\n \n if($badgets->length > 1) {\n $contributions = $xpath->query('.//text()', $badgets[0])[0]->nodeValue;\n $helpful_vote = $xpath->query('.//text()', $badgets[1])[0]->nodeValue;\n } elseif($badgets->length > 0) {\n $contributions = $xpath->query('.//text()', $badgets[0])[0]->nodeValue;\n $helpful_vote = 0;\n } else {\n $contributions = 0;\n $helpful_vote = 0; \n };\n \n // it has to check if `user_loc` exists on page\n $user_loc = $xpath->query('.//div[@class=\"userLoc\"]/strong/text()', $review);\n \n if($user_loc->length > 0) {\n $user_loc = $user_loc[0]->nodeValue;\n } else {\n $user_loc = '';\n }\n \n // it has to find value in class name (ie. \"bubble_40\" => \"40\", \"bubble_50\" => \"50\")\n $bubble_rating = $xpath->query('.//span[contains(@class, \"ui_bubble_rating\")]', $review)[0]->getAttribute('class');\n $bubble_rating = end(explode('_', $bubble_rating));\n \n $item = [\n 'hotel_name' => $hotel_name,\n \n 'review_title' => $xpath->query('.//span[@class=\"noQuotes\"]/text()', $review)[0]->nodeValue,\n 'review_body' => $xpath->query('.//p[@class=\"partial_entry\"]/text()', $review)[0]->nodeValue,\n 'review_date' => $xpath->query('.//span[@class=\"ratingDate\"]', $review)[0]->getAttribute('title'),\n \n 'contributions' => $contributions, \n 'helpful_vote' => $helpful_vote,\n \n 'user_name' => $xpath->query('.//div[@class=\"info_text\"]/div/text()', $review)[0]->nodeValue,\n 'user_loc' => $user_loc,\n \n 'bubble_rating' => $bubble_rating,\n ];\n \n $items.push($item);\n \n // display on screen \n echo \"\\n\", '--- review ---', \"\\n\\n\";\n \n foreach($item as $key => $val) {\n echo $key, ': ', $val, \"\\n\";\n }\n \n //~ return; // for test only - to stop after first review\n }\n \n echo \"\\n\"; # empty line after last review\n \n return $items;\n}", "function scrape_detailed_page($pdo, $scrape_page, $job_portal, $counter)\n\t{\n\t\t$website_page_contents = getURLContents($scrape_page);\n\t\t\n\t\t// -------------------------------------\n\t\t// Job Industry\n\t\t$get_start = '<span class=\"job-type__value\">';\n\t\t$get_end = '</span>';\n\t\t\n\t\t$pos = strpos($website_page_contents, $get_start);\n\t\tif ($pos !== false) {\n\t\t\t$website_page_contents_modified = substr_replace($website_page_contents, \"\", $pos, strlen($get_start));\n\t\t}\n\n\t\tif(strpos($website_page_contents_modified, $get_start) > strlen($get_start))\n\t\t{ \n\t\t\t$select_pos_start = strpos($website_page_contents_modified, $get_start) + strlen($get_start);\n\t\t\t$select_pos_end = strpos($website_page_contents_modified, $get_end, $select_pos_start);\n\t\t\t$select_length = $select_pos_end - $select_pos_start;\n\t\t\t\n\t\t\t$job_industry = trim(substr($website_page_contents_modified, $select_pos_start, $select_length));\n\t\t\t$job_industry = str_replace('<dd class=\"col-sm-6\">', \"\", $job_industry);\n\t\t\t$job_industry = trim($job_industry);\n\t\t\t\n\t\t\t//print_r($job_industry.\"\\r\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$job_industry = '';\n\t\t}\n\t\t\n\t\t// -------------------------------------\n\t\t// Job Title\n\t\t$get_start = '<h1 class=\"details-header__title \">';\n\t\t$get_end = '</h1>';\n\n\t\tif(strpos($website_page_contents, $get_start) > strlen($get_start))\n\t\t{ \n\t\t\t$select_pos_start = strpos($website_page_contents, $get_start) + strlen($get_start);\n\t\t\t$select_pos_end = strpos($website_page_contents, $get_end, $select_pos_start);\n\t\t\t$select_length = $select_pos_end - $select_pos_start;\n\t\t\t\n\t\t\t$output_jobTitle = trim(substr($website_page_contents, $select_pos_start, $select_length));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$output_jobTitle = '';\n\t\t}\n\t\t\n\t\t// -------------------------------------\n\t\t// Job Description\n\t\t$get_start = '<div class=\"details-body__content content-text\">';\n\t\t$get_end = '<h3 class=\"details-body__title\">';\n\n\t\tif(strpos($website_page_contents, $get_start) > strlen($get_start))\n\t\t{ \n\t\t\t$select_pos_start = strpos($website_page_contents, $get_start) + strlen($get_start);\n\t\t\t$select_pos_end = strpos($website_page_contents, $get_end, $select_pos_start);\n\t\t\t$select_length = $select_pos_end - $select_pos_start;\n\n\t\t\t$output_jobDescription = strip_tags(trim(substr($website_page_contents, $select_pos_start, $select_length)));\n\t\t\t$output_jobDescription = addslashes(trim(strip_tags($output_jobDescription)));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$output_jobDescription = '';\n\t\t}\n\t\t\n\t\t// -------------------------------------\n\t\t// Email\n\t\t$extractedEmail = extract_email_address($output_jobDescription);\n\t\t$extractedPhone = extract_phone($output_jobDescription);\n\n\t\t$output_email = (!empty($extractedEmail)) ? json_encode($extractedEmail) : NULL;\n\t\t\n\t\t// Phone\n\t\t$output_phone = (!empty($extractedPhone)) ? json_encode($extractedPhone) : NULL;\n\t\t\n\t\t// -------------------------------------\n\t\t// Career Level\n\t\t$get_start = 'xxxxxxxxxxxxxxxxxxx';\n\t\t$get_end = 'xxxxxxxxxxxxxxxxxxx';\n\n\t\tif(strpos($website_page_contents, $get_start) > strlen($get_start))\n\t\t{ \n\t\t\t$select_pos_start = strpos($website_page_contents, $get_start) + strlen($get_start);\n\t\t\t$select_pos_end = strpos($website_page_contents, $get_end, $select_pos_start);\n\t\t\t$select_length = $select_pos_end - $select_pos_start;\n\n\t\t\t$output_careerLevel = trim(substr($website_page_contents, $select_pos_start, $select_length));\n\t\t\t$output_careerLevel = str_replace('<br>', \"\", $output_careerLevel);\n\t\t\t$output_careerLevel = trim($output_careerLevel);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$output_careerLevel = '';\n\t\t}\n\t\t\n\t\t// -------------------------------------\n\t\t// Employment Type\n\t\t$get_start = '<span class=\"job-type__value\">';\n\t\t$get_end = '</span>';\n\n\t\tif(strpos($website_page_contents, $get_start) > strlen($get_start))\n\t\t{ \n\t\t\t$select_pos_start = strpos($website_page_contents, $get_start) + strlen($get_start);\n\t\t\t$select_pos_end = strpos($website_page_contents, $get_end, $select_pos_start);\n\t\t\t$select_length = $select_pos_end - $select_pos_start;\n\n\t\t\t$output_employmentType = trim(substr($website_page_contents, $select_pos_start, $select_length));\n\t\t\t$output_employmentType = str_replace('<br>', \"\", $output_employmentType);\n\t\t\t$output_employmentType = trim($output_employmentType);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$output_employmentType = '';\n\t\t}\n\t\t\n\t\t// -------------------------------------\n\t\t// Minimum Work Experience\n\t\t$get_start = 'xxxxxxxxxxxxxxxxxxx';\n\t\t$get_end = 'xxxxxxxxxxxxxxxxxxx';\n\n\t\tif(strpos($website_page_contents, $get_start) > strlen($get_start))\n\t\t{ \n\t\t\t$select_pos_start = strpos($website_page_contents, $get_start) + strlen($get_start);\n\t\t\t$select_pos_end = strpos($website_page_contents, $get_end, $select_pos_start);\n\t\t\t$select_length = $select_pos_end - $select_pos_start;\n\n\t\t\t$output_MinWorkExperience = trim(substr($website_page_contents, $select_pos_start, $select_length));\n\t\t\t$output_MinWorkExperience = str_replace('<br>', \"\", $output_MinWorkExperience);\n\t\t\t$output_MinWorkExperience = trim($output_MinWorkExperience);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$output_MinWorkExperience = '';\n\t\t}\n\t\t\n\t\t// -------------------------------------\n\t\t// Minimum Education Level\n\t\t$get_start = 'xxxxxxxxxxxxxxxxxxx';\n\t\t$get_end = 'xxxxxxxxxxxxxxxxxxx';\n\n\t\tif(strpos($website_page_contents, $get_start) > strlen($get_start))\n\t\t{ \n\t\t\t$select_pos_start = strpos($website_page_contents, $get_start) + strlen($get_start);\n\t\t\t$select_pos_end = strpos($website_page_contents, $get_end, $select_pos_start);\n\t\t\t$select_length = $select_pos_end - $select_pos_start;\n\n\t\t\t$output_MinEducationLevel = trim(substr($website_page_contents, $select_pos_start, $select_length));\n\t\t\t$output_MinEducationLevel = str_replace('<br>', \"\", $output_MinEducationLevel);\n\t\t\t$output_MinEducationLevel = trim($output_MinEducationLevel);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$output_MinEducationLevel = '';\n\t\t}\n\t\t\n\t\t// -------------------------------------\n\t\t// Monthly Salary Range\n\t\t$get_start = 'xxxxxxxxxxxxxxxxxxx';\n\t\t$get_end = 'xxxxxxxxxxxxxxxxxxx';\n\n\t\tif(strpos($website_page_contents, $get_start) > strlen($get_start))\n\t\t{ \n\t\t\t$select_pos_start = strpos($website_page_contents, $get_start) + strlen($get_start);\n\t\t\t$select_pos_end = strpos($website_page_contents, $get_end, $select_pos_start);\n\t\t\t$select_length = $select_pos_end - $select_pos_start;\n\n\t\t\t$output_monthlySalaryRange = trim(substr($website_page_contents, $select_pos_start, $select_length));\n\t\t\t$output_monthlySalaryRange = str_replace('<br>', \"\", $output_monthlySalaryRange);\n\t\t\t$output_monthlySalaryRange = trim($output_monthlySalaryRange);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$output_monthlySalaryRange = '';\n\t\t}\n\t\t\n\t\t// -------------------------------------\n\t\t// Location\n\t\t$get_start = '<li class=\"listing-item__info--item listing-item__info--item-location\">';\n\t\t$get_end = '</li>';\n\n\t\tif(strpos($website_page_contents, $get_start) > strlen($get_start))\n\t\t{ \n\t\t\t$select_pos_start = strpos($website_page_contents, $get_start) + strlen($get_start);\n\t\t\t$select_pos_end = strpos($website_page_contents, $get_end, $select_pos_start);\n\t\t\t$select_length = $select_pos_end - $select_pos_start;\n\n\t\t\t$output_location = trim(substr($website_page_contents, $select_pos_start, $select_length));\n\t\t\t$output_location = str_replace('<br>', \"\", $output_location);\n\t\t\t$output_location = trim($output_location);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$output_location = '';\n\t\t}\n\t\t\n\t\t// -------------------------------------\n\t\t// Company Name\n\t\t$get_start = '<li class=\"listing-item__info--item listing-item__info--item-company\">';\n\t\t$get_end = '</li>';\n\n\t\tif(strpos($website_page_contents, $get_start) > strlen($get_start))\n\t\t{ \n\t\t\t$select_pos_start = strpos($website_page_contents, $get_start) + strlen($get_start);\n\t\t\t$select_pos_end = strpos($website_page_contents, $get_end, $select_pos_start);\n\t\t\t$select_length = $select_pos_end - $select_pos_start;\n\n\t\t\t$output_companyName = trim(substr($website_page_contents, $select_pos_start, $select_length));\n\t\t\t$output_companyName = trim($output_companyName);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$output_companyName = '';\n\t\t}\n\t\t\n\t\t// -------------------------------------\n\t\t// Company Overview\n\t\t$get_start = 'xxxxxxxxxxxxxxxxxxx';\n\t\t$get_end = 'xxxxxxxxxxxxxxxxxxx';\n\n\t\tif(strpos($website_page_contents, $get_start) > strlen($get_start))\n\t\t{ \n\t\t\t$select_pos_start = strpos($website_page_contents, $get_start) + strlen($get_start);\n\t\t\t$select_pos_end = strpos($website_page_contents, $get_end, $select_pos_start);\n\t\t\t$select_length = $select_pos_end - $select_pos_start;\n\n\t\t\t\n\t\t\t$output_companyOverview = substr($website_page_contents, $select_pos_start, $select_length);\n\t\t\t$output_companyOverview = addslashes(trim(strip_tags($output_companyOverview)));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$output_companyOverview = '';\n\t\t}\n\t\t\n\t\t// -------------------------------------\n\t\t// Company Logo\n\t\t$get_start = '<img class=\"profile__img profile__img-company\" src=\"';\n\t\t$get_end = '\"';\n\n\t\tif(strpos($website_page_contents, $get_start) > strlen($get_start))\n\t\t{ \n\t\t\t$select_pos_start = strpos($website_page_contents, $get_start) + strlen($get_start);\n\t\t\t$select_pos_end = strpos($website_page_contents, $get_end, $select_pos_start);\n\t\t\t$select_length = $select_pos_end - $select_pos_start;\n\n\t\t\t$output_companyLogo = trim(substr($website_page_contents, $select_pos_start, $select_length));\n\t\t\t$output_companyLogo = trim($output_companyLogo);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$output_companyLogo = '';\n\t\t}\n\t\t\t\n\t\t// -------------------------------------\n // Job Date Posted\n $get_start = '<li class=\"listing-item__info--item listing-item__info--item-date\">';\n\t\t$get_end = '</li>';\n \n if(strpos($website_page_contents, $get_start) > strlen($get_start))\n { \n $select_pos_start = strpos($website_page_contents, $get_start) + strlen($get_start);\n $select_pos_end = strpos($website_page_contents, $get_end, $select_pos_start);\n $select_length = $select_pos_end - $select_pos_start;\n \n $output_jobDatePosted = trim(substr($website_page_contents, $select_pos_start, $select_length));\n $output_jobDatePosted_array = explode(\"/\", $output_jobDatePosted);\n\t\t\t\n\t\t\t$output_jobDatePosted = $output_jobDatePosted_array[2].'-'.$output_jobDatePosted_array[1].'-'.$output_jobDatePosted_array[0];\n\t\t\t\n\t\t\t//print_r($output_jobDatePosted.\"\\r\");\n }\n\t\telse\n\t\t{\n\t\t\t$output_jobDatePosted = '';\n\t\t}\n\t\t\n\t\t\n\t\t$output_industry = $job_industry;\n\t\t$output_role = \"\";\n\t\t$output_keyword_skill = \"\";\n\t\t\n\t\t// -------------------------------------\n\t\t\n\t\t\n\t\t//echo '</br>'.$scrape_page;\n\t\t\n\t\t\n\t\t//echo '</br>'.$output_industry.' - '.$output_jobTitle.' - '.$output_jobDescription.' - '.$output_careerLevel.' - '.$output_employmentType.' - '.$output_MinWorkExperience.' - '.$output_MinEducationLevel.' - '.$output_monthlySalaryRange.' || '.$output_location.' || '.$output_companyName. ' - '.$output_jobDatePosted;\n\t\t\n\t\t// --------------------------------------------\n\t\tinsertDBJobDetails(\n\t\t\t\t\t\t\t$pdo,\n\t\t\t\t\t\t\t$job_portal, \n\t\t\t\t\t\t\t$output_industry, \n\t\t\t\t\t\t\t$scrape_page, \n\t\t\t\t\t\t\t$output_jobTitle, \n\t\t\t\t\t\t\t$output_jobDescription, \n\t\t\t\t\t\t\t$output_careerLevel, \n\t\t\t\t\t\t\t$output_employmentType, \n\t\t\t\t\t\t\t$output_MinWorkExperience, \n\t\t\t\t\t\t\t$output_MinEducationLevel, \n\t\t\t\t\t\t\t$output_monthlySalaryRange, \n\t\t\t\t\t\t\t$output_location,\n\t\t\t\t\t\t\t$output_companyName,\n\t\t\t\t\t\t\t$output_companyOverview,\n\t\t\t\t\t\t\t$output_jobDatePosted,\n\t\t\t\t\t\t\t$output_email,\n\t\t\t\t\t\t\t$output_phone,\n\t\t\t\t\t\t\t$output_companyLogo,\n\t\t\t\t\t\t\t$output_role,\n\t\t\t\t\t\t\t$output_keyword_skill\n\t\t\t\t\t\t\t);\n\t\t// --------------------------------------------\n\t\t\n\t}", "public function getPage() {}", "public function getPage() {}", "function get_data($url){\n $ch = curl_init();\n $timeout = 5;\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n curl_setopt($ch, CURLOPT_USERAGENT, \"Mozilla/5.0 (Windows NT 6.1; rv:19.0) Gecko/20100101 Firefox/19.0\");\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n}", "function get_initial_results()\n{\n\tinclude('global_vars_insert.php');\n\n\t////////////////////////////////////////////\n\t/////\tBING INITIAL SEARCH DATA \n\t////////////////////////////////////////////\n\t\n\tinclude('bing_search_initial.php');\n\n ////////////////////////////////////////////\n\t/////\tENTIREWEB INITIAL SEARCH DATA \n\t////////////////////////////////////////////\n \n\tinclude('entireweb_search_initial.php');\n\n\t////////////////////////////////////////////\n\t/////\tBLEKKO INITIAL SEARCH REQUEST \n\t//////////////////////////////////////////// \n\t\n\tinclude('blekko_search_initial.php');\n\t\n\t////////////////////////////////////////////\n\t/////\tCURL MULTI-SESSION DATA \n\t////////////////////////////////////////////\n\n\tinclude('curl.php');\n}", "function dateCountdownCrawler($dom,$xpath,$filterVar,$i,$comingSoonEpisode)\n{\n\t\t\t//Make new XPath Query, filtering out only links\n\t\t\t$xpath_resultset2 = $xpath->query(\"//div[@class='$filterVar']//a/@href\");\n\t\t\t//Save object into string with HTML format\n\t\t\t$htmlString2 = $dom->saveHTML($xpath_resultset2->item($i));\n\t\t\t//Trim result from unnecessary characters that we do not want \"href=\" and \"\"\"\n\t\t\t$htmlString2trimhref = str_replace('href=', \"\", $htmlString2);\n\t\t\t$htmlString2trimquote = str_replace('\"', \"\", $htmlString2trimhref);\n\t\t\t$htmlString3 = trim($htmlString2trimquote);\n\t\t\t//Get entire file into string\n\t\t\t$html3 = file_get_contents($htmlString3);\n\t\t\t//Create new DOM Object with newly created HTML-string\n\t\t\t$dom3 = new DOMDocument();\n\t\t\t@$dom3->loadHTML($html3);\n\t\t\t$xpath3 = new DOMXPath($dom3);\n\t\t\t//XPath Query to get all <script> elements in HTML\n\t\t\t$xpath_resultset3 = $xpath3->query('//body//script[not(@src)]');\n\t\t\t//Save item 2 from XPath Query into string with HTML-format (item2[3]is what we want in this case)\n\t\t\t$htmlString4 = $dom3->saveHTML($xpath_resultset3->item(2));\n\t\t\t//Get the position of the first char that we want to get\n\t\t\t$javascriptPOSVar = strpos($htmlString4, 'ts = new Date')+14;\n\t\t\t//Concatentate all the character from startposition until we got the values we want into one variable/string\n\t\t\t$javascriptVariable = $htmlString4[$javascriptPOSVar] . $htmlString4[$javascriptPOSVar+1] . $htmlString4[$javascriptPOSVar+2] . $htmlString4[$javascriptPOSVar+3] . $htmlString4[$javascriptPOSVar+4] . $htmlString4[$javascriptPOSVar+5] . $htmlString4[$javascriptPOSVar+6] . $htmlString4[$javascriptPOSVar+7] . $htmlString4[$javascriptPOSVar+8] . $htmlString4[$javascriptPOSVar+9] . $htmlString4[$javascriptPOSVar+10] . $htmlString4[$javascriptPOSVar+11] . $htmlString4[$javascriptPOSVar+12];\n\t\t\t?>\n\t\t\t<div class=\"comingSoonEpisode\"><?php echo $comingSoonEpisode;?><div data-countdown=\"<?php date_default_timezone_set('UTC');echo date('Y/m/d H:m:s', $javascriptVariable/1000);?>\"></div></div>\n\t\t\t<?php\n}", "function getValues($url)\r\n {\r\n $ch = curl_init();\r\n curl_setopt($ch,CURLOPT_URL,$url);\r\n curl_setopt($ch, CURLOPT_POST, false);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n $html = curl_exec($ch);\r\n curl_close($ch);\r\n \r\n $DOM=new DOMDocument;\r\n libxml_use_internal_errors(true);\r\n $DOM->loadHTML($html);\r\n $elements=$DOM->getElementsByTagName('p');\r\n $titles=$DOM->getElementsByTagName('title');\r\n\r\n //For Title\r\n for ($i=0; $i < $titles->length; $i++) { \r\n # code...\r\n $s3[$i]=$titles->item($i)->nodeValue;\r\n }\r\n\r\n $title = implode(\"\",$s3); \r\n \r\n if($title == 'The Nation')\r\n {\r\n $title = 'Image News!';\r\n }\r\n\r\n \r\n // For Image\r\n $string_file=file_get_contents($url);\r\n preg_match('/ <img itemprop=\"image\" id=\"news_detail_img_thumb\" name=\"news_detail_img_thumb\" border=\"0\" src=\"(.*?).jpg\" alt=\"epaper\" \\/> / ', $string_file,$img);\r\n \r\n if(!isset($img[0]))\r\n {\r\n preg_match('/ <img id=\"news_detail_img_thumb\" name=\"news_detail_img_thumb\" border=\"0\" src=\"(.*?).jpg\" alt=\"epaper\" \\/> / ', $string_file,$img2);\r\n $image_temp=$img2[0];\r\n }\r\n else\r\n {\r\n $image_temp=$img[0];\r\n }\r\n\r\n $doc = new DOMDocument();\r\n $doc->loadHTML($image_temp);\r\n $imageTags = $doc->getElementsByTagName('img');\r\n $image=\"\";\r\n foreach($imageTags as $images) {\r\n $image = $images->getAttribute('src');\r\n }\r\n \r\n\r\n // For Content\r\n $s = array();\r\n \r\n for ($i=0; $i < $elements->length; $i++) { \r\n # code...\r\n if(preg_match('/[^NIPCO House, 4 - Shaharah e Fatima Jinnah,lahore, Pakistan Tel: +92 42 36367580 | Fax : +92 42 36367005]+/', $elements->item($i)->getAttribute('style'), $match)){\r\n $s[$i] = $elements->item($i)->nodeValue.\" \";\r\n }\r\n }\r\n $content = implode(\"\",$s);\r\n if($content==null)\r\n {\r\n $content = 'No Detailed Content Available! Content is not available in either Newspaper';\r\n }\r\n return array($title,$image,$content);\r\n }", "function getURLContents($this_url)\n\t{\n\t\t$timeout = 8;\n\t\t$retry = 3;\n\t\t$website_page_contents = false;\n\t\t$success_crawl = false;\n\t\t\n\t\twhile (!$success_crawl) {\n\t\t\t// initialize cURL\n\t\t\t$ch = curl_init();\n\n\t\t\tif (strlen($this_url) > 8) {\n\t\t\t\tcurl_setopt($ch, CURLOPT_URL, $this_url);\n\t\t\t\tcurl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n\t\t\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, $timeout);\n\t\t\t\tcurl_setopt($ch, CURLOPT_USERAGENT, \"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.2 (KHTML, like Gecko) Chrome/22.0.1216.0 Safari/537.2\");\n\t\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t\t\tcurl_setopt($ch, CURLOPT_REFERER, \"http://www.facebook.com\");\n\t\t\t\tcurl_setopt($ch, CURLOPT_HEADER, true);\n\t\t\t\tcurl_setopt($ch,CURLOPT_HTTPHEADER,array('HeaderName: HeaderValue'));\n\t\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\t\t\t@curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\t\t\t\t@curl_setopt($ch, CURLOPT_MAXREDIRS, 1);\n\t\t\t\tcurl_setopt($ch, CURLOPT_ENCODING, 'gzip');\n\t\t\t\tcurl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);\n\t\t\t\tcurl_setopt($ch, CURLOPT_FORBID_REUSE, 1);\n\t\t\t\t//curl_setopt($ch, CURLOPT_COOKIEJAR, dirname(__FILE__).'/c00kie.txt');\n\t\t\t\t// get contents\n\t\t\t\t$website_page_contents = curl_exec($ch);\n\n\t\t\t\t// check if there's some error's\n\t\t\t\tif(curl_error($ch))\n\t\t\t\t{\n\t\t\t\t\techo 'Curl error: ' . curl_error($ch) . \".\\n\";\n\t\t\t\t\t$retry--;\n\t\t\t\t\tif($retry < 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$success_crawl = true; // just to stop crawling\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$success_crawl = false;\n\t\t\t\t\t\techo 'Retrying in a second. ' . $retry . ' retries left.' . \"\\n\";\n\t\t\t\t\t\tsleep(1);\n\t\t\t\t\t}\t\t\t\t\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$success_crawl = true;\n\t\t\t\t\t//echo 'curl success!'.\"\\n\";\n\t\t\t\t\t// close cURL\n\t\t\t\t\tcurl_close($ch);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo 'Invalid URL: ' . $this_url . \"\\n\";\n\t\t\t\t$website_page_contents = '';\n\t\t\t\t$retry = 0;\n\t\t\t}\n\t\t}\n\t\t// return the contents\n\t\treturn $website_page_contents;\n\t}", "private function retrieveOnePageSubito($url){\n\t\t// $output = array();\n\t\t$doc = new DOMDocument();\n\t\t$previousSetting = libxml_use_internal_errors(true);// the previuos value of libxml_use_internal_errors\n\t\t$content = preg_replace('/\\<br( )*\\/>/', \" \", file_get_contents($url));\n\n\t\t$doc->loadHTML($content);\n\t\tlibxml_use_internal_errors($previousSetting); // set the initial value of libxml_use_internal_errors\n\t\t\n\t\t$xpath = new DOMXpath($doc);\n\t\t$ads = $xpath->query(\"//*/ul[@class='list']/li\");\n\t\tforeach ($ads as $ad) {\n\t\t\t$adCurrent = new Ad;\n\n\t\t\t$adDivs = $ad->getElementsByTagName(\"div\");\n\t\t\tforeach ($adDivs as $adDiv) {\n\t\t\t\tif($adDiv->hasAttribute('class') && $adDiv->getAttribute('class') == 'date'){\n\t\t\t\t\t$adCurrent->pubdate = formatTime($adDiv->nodeValue);\n\t\t\t\t}\n\t\t\t\tif($adDiv->hasAttribute('class') && $adDiv->getAttribute('class') == 'descr'){\n\t\t\t\t\t$adCurrent->content = trim($adDiv->nodeValue);\n\t\t\t\t\t$links = $adDiv->getElementsByTagName('a');\n\t\t\t\t\tforeach ($links as $link) {\n\t\t\t\t\t\t$adCurrent->url .= $this->url.basename($link->getAttribute('href'));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// echo __METHOD__, ' adding to ads<br/>', PHP_EOL;\n\t\t\t// print_r($adCurrent);\n\t\t\t$this->ads[] = $adCurrent;\n\t\t\t// echo 'ads length: ', count($this->ads), '<br />';\n \t\t}\n\t\t\n\t}", "function getWebPage($url){\n $options = array( \n\t \tCURLOPT_RETURNTRANSFER => true, // to return web page\n CURLOPT_HEADER => true, // to return headers in addition to content\n CURLOPT_FOLLOWLOCATION => true, // to follow redirects\n CURLOPT_ENCODING => \"\", // to handle all encodings\n CURLOPT_AUTOREFERER => true, // to set referer on redirect\n CURLOPT_CONNECTTIMEOUT => 120, // set a timeout on connect\n CURLOPT_TIMEOUT => 120, // set a timeout on response\n CURLOPT_MAXREDIRS => 10, // to stop after 10 redirects\n CURLINFO_HEADER_OUT => true, // no header out\n CURLOPT_SSL_VERIFYPEER => false,// to disable SSL Cert checks\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n );\n\n $handle = curl_init( $url );\n curl_setopt_array( $handle, $options );\n \n \t// additional for storing cookie \n $tmpfname = dirname(__FILE__).'/cookie.txt';\n curl_setopt($handle, CURLOPT_COOKIEJAR, $tmpfname);\n curl_setopt($handle, CURLOPT_COOKIEFILE, $tmpfname);\n\n $raw_content = curl_exec( $handle );\n $err = curl_errno( $handle );\n $errmsg = curl_error( $handle );\n $header = curl_getinfo( $handle ); \n curl_close( $handle );\n \n $header_content = substr($raw_content, 0, $header['header_size']);\n $body_content = trim(str_replace($header_content, '', $raw_content));\n \n \t// extract cookie from raw content for the viewing purpose \n $cookiepattern = \"#Set-Cookie:\\\\s+(?<cookie>[^=]+=[^;]+)#m\"; \n preg_match_all($cookiepattern, $header_content, $matches); \n $cookiesOut = implode(\"; \", $matches['cookie']);\n\n $header['errno'] = $err;\n $header['errmsg'] = $errmsg;\n $header['headers'] = $header_content;\n $header['content'] = $body_content;\n $header['cookies'] = $cookiesOut;\n \treturn $header['content'];\n}", "public function fetchWebPageWithElements()\n {\n if (!$this->_url) {\n /**\n * @uses Parsonline_Exception_ContextException\n */\n require_once(\"Parsonline/Exception/ContextException.php\");\n throw new Parsonline_Exception_ContextException(\"Failed to fetch web page. No URL is specified\");\n }\n $pageURL = $this->_url;\n $result = array(self::ELEMENT_HTML => array());\n $fetcher = $this->getFetcher();\n $htmlPage = $fetcher->fetchURL($pageURL);\n $this->_log(__METHOD__, \"fetched \" . strlen($htmlPage) . \" bytes from the web page '{$pageURL}'\", LOG_DEBUG);\n \n /**\n *@uses Parsonline_Parser_Html\n */\n $parser = new Parsonline_Parser_Html();\n $baseURL = $parser->getDocumentBaseURL($pageURL, $htmlPage);\n if (!$baseURL) {\n /**\n *@uses Parsonline_Exception_ValueException\n */\n require_once('Parsonline/Exception/ValueException.php');\n throw new Parsonline_Exception_ValueException(\n \"Failed to detect the base of the web page from URL. Invalid URL specified: '{$pageURL}'\"\n );\n }\n \n $parsedElementReferences = $this->parseTargetElements($htmlPage);\n \n $result[self::ELEMENT_HTML][$pageURL] = array($pageURL, $htmlPage);\n unset($htmlPage);\n \n $total = count($parsedElementReferences, COUNT_RECURSIVE) - count($parsedElementReferences);\n $this->_log(__METHOD__, \"parsed $total resources from the web page '{$pageURL}'\", LOG_DEBUG);\n $total++; // include the HTML page itself. total is going to be used to notify observers manually\n \n /**\n *@TODO add a public method to notify observers manually, using this total\n * in here. register that method as an observer in the fetcher object \n */\n \n // first download stylesheets, then scripts, then links and images at last\n $elementOrder = array(self::ELEMENT_STYLESHEET, self::ELEMENT_SCRIPT, self::ELEMENT_LINK, self::ELEMENT_IMAGE);\n \n // keep track of downloaded URLs to avoid downloading a URL twice to handle redundant references\n $downloadedURLs = array();\n \n foreach($elementOrder as $element) {\n if ( !isset($parsedElementReferences[$element]) ) {\n continue;\n }\n \n $result[$element] = array();\n $references = $parsedElementReferences[$element];\n $urlsToFetch = array();\n \n foreach($references as $ref) {\n // convert to absolute URL\n if (parse_url($ref, PHP_URL_SCHEME)) {\n $url = $ref;\n } else {\n $url = $parser->convertReferenceToURL($ref, $pageURL, $baseURL);\n }\n \n // handle multiple redundant references\n if ( !isset($result[$element][$url]) ) {\n $result[$element][$url] = array($ref, null);\n }\n \n if ( in_array($url, $downloadedURLs) ) {\n // if we have already downloaded the URL, do not include it\n // int the $urlsToFetch and use previously fetched data\n $result[$element][$url] = array($ref, $downloadedURLs[$url]);\n } else {\n $urlsToFetch[] = $url;\n }\n } // foreach($references ...\n\n if ($urlsToFetch) {\n $this->_log(\n __METHOD__,\n sprintf(\"fetching '%d' resource of '%s' from the web page '%s'\", count($urlsToFetch), $element, $pageURL)\n ,LOG_DEBUG\n );\n\n $fetcher->setURLs($urlsToFetch);\n unset($urlsToFetch);\n\n $fetched = $fetcher->fetch();\n\n // now push the fetched data back to the result strucutre\n foreach($fetched as $fetchedURL => $resourceData) {\n if ( isset($result[$element][$fetchedURL]) ) {\n // fetched URL is the same as the elementURL\n $result[$element][$fetchedURL][1] = $resourceData;\n } else {\n // fetched URL differes from the elementURLs, so we do not\n // know what is the actual element reference\n $result[$element][$fetchedURL] = array(null, $resourceData);\n }\n $downloadedURLs[$fetchedURL] = &$result[$element][$fetchedURL][1];\n }\n }\n \n } // foreach($elementOrder ...\n \n return $result;\n }", "function getPageContent($url) {\r\n // create curl variable\r\n $curl = curl_init(); \r\n // set the url\r\n curl_setopt($curl, CURLOPT_URL, $url);\r\n // return the transfer as a resource\r\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\r\n // $output contains the output string\r\n $output = curl_exec($curl);\r\n // close curl resource to free up system memory\r\n curl_close($curl);\r\n // return the output of the curl\r\n return $output;\r\n}", "protected function getPageCurl()\n\t{\n\t\t// initiate curl with our url\n\t\t$this->curl = curl_init($this->url);\n\n\t\t// set curl options\n\t\tcurl_setopt($this->curl, CURLOPT_HEADER, 0);\n\t\tcurl_setopt($this->curl, CURLOPT_USERAGENT, $this->user_agent);\n\t\tcurl_setopt($this->curl, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($this->curl, CURLOPT_FOLLOWLOCATION, true);\n\t\tcurl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, false);\n\t\tcurl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, false);\n\n\t\t// execute the call to google+\n\t\t$this->html = curl_exec($this->curl);\n\n\t\tcurl_close($this->curl);\n\t}", "function plugin_sandbox_scrape($plugin)\n {\n }", "function geturl($url){\n if($url==\"\"){\n $url = \"http://www.36kr.com/\";\n }\n \n $ch = curl_init();\n\n // set the url to fetch \n curl_setopt($ch, CURLOPT_URL, $url);\n\n //return the transfer (the result of curl_exec()) as a string instead of outputing directly\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n //return the HTTP Response header using the callback function readHeader\n //curl_setopt($ch, CURLOPT_HEADERFUNCTION, 'readHeader');\n\n // execute the curl session\n $output = curl_exec($ch);\n\n // close curl resource to free up system resources \n curl_close($ch);\n\n //the callback function used to retreive the header info\n function readHeader($ch, $string) {\n $length = strlen($string);\n //only display the headers with content\n if (trim($string) != '')\n echo \"<center>Header: $string</center><br />\\n\";\n return $length;\n }\n\n //echo \"<br /><center><b><u>BELOW this line is the content fetched from www.example.com:</u></b></center><br />\";\n return $output;\n}", "function pageLoad () {\n\tglobal $pageBegin, $pageEnd, $tableRow;\n\t$page = page_load (\"search_results.html\");\n\n\t$tableRow = page_split ($page, \"[[\", \"]]\");\n\t$pageBegin = $tableRow[0];\n\t$pageEnd = $tableRow[2];\n\t$tableRow = $tableRow[1];\n}", "private function parse ( ) {\n\t\t\t$this->parse_csv();\n\t\t\t\n\t\t\t// parse out the daily html\n\t\t\t$this->parse_html();\n\t\t\t\n\t\t}", "private function extract_pages(){\r\n $dom = new DOMDocument();\r\n @$dom->loadHTMLFile($this->get_sitemap_url());\r\n $dOMXPath = new DOMXPath($dom);\r\n foreach ($dOMXPath->query(\"//urlset/url/loc\") as $node) {\r\n $this->add_page($node->nodeValue);\r\n }\r\n\t}", "function grab_feed($url){\n\t//open our db connection \n\t$database=\"clscrape\";\n\t$con = mysql_connect('***.***.***.***','****','****');\n\t//our associateive array of magical parsed xml jobs\n\t$arrFeeds = array();\n\t//list of sites we want to search for jobs\n\t$sites = array(\"web/index.rss\",\"eng/index.rss\",\"sof/index.rss\",\"search/crg?query=%20&format=rss\",\"search/cpg?query=%20&format=rss\");\n\tforeach ($sites as $site){\n\t\t\t//lets create a new document\n\t\t\t$doc = new DOMDocument();\n\t\t\t//load our rss url\n\t\t \t$doc->load($url.$site);\n\t\t\t//crete an empty array to feed our items into\n\t\t\t//loop through the RSS XML document grabbing the title, description and link tags as those are the only ones we care about\n\t\t \tforeach ($doc->getElementsByTagName('item') as $node) {\n\t\t \t \t$itemRSS = array ( \n\t\t \t\t'title' => $node->getElementsByTagName('title')->item(0)->nodeValue,\n\t\t \t\t'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue,\n\t\t \t\t'link' => $node->getElementsByTagName('link')->item(0)->nodeValue\n\t\t );\n\t\t\t //push each item onto the feed array\n\t\t \t array_push($arrFeeds, $itemRSS);\n\t\t \t}\n\t}\n\tforeach($arrFeeds as $link)\n\t{\n\t\t$search_terms = array( 'PHP','sysadmin','php');\n\t\tforeach ($search_terms as $keyword)\n\t\t {\n\t\t\t $pos = strpos($link['desc'],$keyword);\n\t\t\t if($pos)\n\t\t\t {\n\t\t\t\tmysql_select_db('clscrape',$con) or die( 'Unable to select database' . mysql_error());\n\t\t\t\t$hash = md5($link['title'].$link['desc'].$link['link']);\n\t\t\t\t$title = mysql_real_escape_string($link['title']);\n\t\t\t\t$desc = mysql_real_escape_string($link['desc']);\n\t\t\t\t$url = mysql_real_escape_string($link['link']);\n\t\t\t\t$query=\"INSERT INTO clscrape.data (data.hash,data.title,data.desc,data.link) VALUES('$hash','$title','$desc','$url')\";\n\t\t\t\tmysql_query($query,$con);\n\t\t\t }\n\t\t }\n\t}\n\t//close our db connection\n\tmysql_close($con);\n\t//return our associative array\n\treturn $arrFeeds;\n}", "function get_industries()\r\n{\r\n\t$url = 'http://clinicaltrials.gov/ct2/search/browse?brwse=spns_cat_INDUSTRY&brwse-force=true';\r\n\t$doc = new DOMDocument();\r\n\tfor ($done = false, $tries = 0; $done == false && $tries < 5; $tries++) \r\n\t{\r\n\t\tif ($tries>0) echo('.');\r\n\t\t@$done = $doc->loadHTMLFile($url);\r\n\t}\r\n\t\r\n\t$divs = $doc->getElementsByTagName('div');\r\n\t$divdata = NULL;\r\n\t\r\n\tforeach ($divs as $div) \r\n\t{\r\n\t\t$ok = false;\r\n\t\tforeach ($div->attributes as $attr) \r\n\t\t{\r\n\t\t\tif ($attr->name == 'id' && $attr->value == 'body-copy-browse')\r\n\t\t\t{\r\n\t\t\t\t$data = $div;\r\n\t\t\t\t$ok = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif ($ok == true) \r\n\t\t{\r\n\t\t\t$divdata = $data;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\t\r\n\tif ($divdata == NULL) \r\n\t{\r\n\t\techo('Nothing to import'. \"\\n<br />\");\r\n\t\texit;\r\n\t}\r\n\r\n\t$data = $divdata->nodeValue;\r\n\r\n\t//replace story and stories from string and prepare an arry with industry names \r\n\t$industries_str = str_replace('See Sponsor/Collaborators by Category > Industry', '', $data);\r\n\t$industries_replaced = preg_replace('/[0-9]{1,4}?\\sstudy|[0-9]{1,4}?\\sstudies/', '{***}', $industries_str);\r\n\t$industries = explode('{***}', $industries_replaced);\r\n\t\r\n\tglobal $NCTcontent;\r\n\tforeach ($industries as $industry) \r\n\t{\r\n\t\t$industry = iconv('UTF-8', 'ISO-8859-1', $industry);\r\n\t\t$industry = trim($industry);\r\n\t\t$NCTcontent .= $industry.PHP_EOL;\r\n\t}\r\n\t\r\n}", "public function run()\n {\n for($page=1;$page<=3;$page++) {\n $pageUrl = \"https://www.knygos.lt/lt/knygos/zanras/fantastika-ir-fantasy/?psl=\" . $page;\n $fetchPage = file_get_contents($pageUrl);\n\n if (!$fetchPage)\n die(\"Unable to fetch the bookstore.\");\n\n $booksDetailsHTML = self::explodeBetween(\"<div class=\\\"product-photo-icon-container product-photo-icons-rb\\\">\", \"</a>\", $fetchPage);\n foreach ($booksDetailsHTML as $bookDetailsHTML) {\n $bookUrl = current(self::explodeBetween('<a href=\"', '\"', $bookDetailsHTML));\n //echo 'https://www.knygos.lt/'.$bookUrl.PHP_EOL;\n usleep(200); // Delay crawling to prevent spam-block\n\n $fetchBookPage = file_get_contents('https://www.knygos.lt/' . $bookUrl);\n\n if (!$fetchBookPage)\n die(\"Unable to fetch the book page.\");\n\n $author = @next(explode('>', current(self::explodeBetween('<a itemprop=\"author\"', '</a>', $fetchBookPage))));\n $year = current(self::explodeBetween('<p class=\"book_details\">Metai: ', '</p>', $fetchBookPage));\n $title = current(self::explodeBetween('<p class=\"book_details\">Originalus pavadinimas: ', '</p>', $fetchBookPage));\n if (empty($title))\n $title = current(self::explodeBetween('<span itemprop=\"name\">', '</span>', $fetchBookPage));\n\n if (empty($title) || strlen($title) > 30){\n continue;\n }\n\n $genre = 'Fantastika';\n\n DB::table('books')->insert([\n 'title' => $title,\n 'year' => $year,\n 'author' => $author,\n 'genre' => $genre,\n 'created_at' => date(\"Y-m-d H:i:s\"),\n 'updated_at' => date(\"Y-m-d H:i:s\"),\n ]);\n\n }\n }\n\n }", "protected function parseV1Content()\n {\n $pages = count(pq('.pagDiv .pagPage'));\n $items = pq('tbody.itemWrapper');\n foreach ($items as $item) {\n $check_if_regular = pq($item)->find('span.commentBlock nobr');\n\n if ($check_if_regular != '') {\n//$array[$i]['array'] = pq($item)->html();\n $array[$i]['num'] = $i + 1;\n $array[$i]['name'] = text_prepare(pq($item)->find('span.productTitle strong a')->html());\n $array[$i]['link'] = pq($item)->find('span.productTitle a')->attr('href');\n $array[$i]['old-price'] = pq($item)->find('span.strikeprice')->html();\n $array[$i]['new-price'] = text_prepare(pq($item)->find('span[id^=\"itemPrice_\"]')->html());\n $array[$i]['date-added'] = text_prepare(str_replace('Added', '', pq($item)->find('span.commentBlock nobr')->html()));\n $array[$i]['priority'] = pq($item)->find('span.priorityValueText')->html();\n $array[$i]['rating'] = pq($item)->find('span.asinReviewsSummary a span span')->html();\n $array[$i]['total-ratings'] = pq($item)->find('span.crAvgStars a:nth-child(2)')->html();\n $array[$i]['comment'] = text_prepare(pq($item)->find('span.commentValueText')->html());\n $array[$i]['picture'] = pq($item)->find('td.productImage a img')->attr('src');\n $array[$i]['page'] = $page_num;\n $array[$i]['ASIN'] = get_ASIN($array[$i]['link']);\n $array[$i]['large-ssl-image'] = get_large_ssl_image($array[$i]['picture']);\n $array[$i]['affiliate-url'] = get_affiliate_link($array[$i]['ASIN']);\n\n $i++;\n }\n }\n }", "public function followLinks($url)\n {\n $parser = new DomDocumentParser($url);\n //这行代码第一次时获取用$startUrl创建的文档对象中的所有<a>标签\n $linkList = $parser->getLinks();\n \n //这里第一次遍历用$startUrl创建的文档对象中的所有URL\n foreach ($linkList as $link) {\n $href = $link->getAttribute('href');\n if ($href == '') {\n continue;\n }\n\n //这里应该是有#就不显示了吧,改成strpos($href, '#') == 0会不会更好呢?\n if (strpos($href, '#') !== false) {\n continue;\n }\n if (substr($href, 0, 11) == 'javascript:') {\n continue;\n }\n if (substr($href, 0, 7) == 'mailto:') {\n continue;\n }\n\n //将网址的相对路径转换为绝对路径\n $href = $this->createLinks($href, $url);\n \n //检查网址有没有被爬取\n /*\n 如果要爬取的网址不在已经爬取的网址数组中,则同时将其添加到已爬取和要爬取的数组中,\n 然后将该网址的信息记录在sites表中,同时将该网址的所有图片信息记录到image表中\n */\n if (!in_array($href, $this->alreadyCrawled)) {\n $this->alreadyCrawled[] = $href;\n $this->crawling[] = $href;\n $this->getDetails($href);\n array_shift($this->crawling);\n }\n \n //下面这行代码在当前网址已被爬取(记录到数据库)时触发,结束该函数的执行。\n //所以说只要遇到一个已爬取过的网址,就停止递归中一个函数的执行\n //添加这行代码可以显著减少要爬取网站的数量\n //else return;\n } //endof foreach \n //这个foreach结束之后,$this->alreadyCrawled和$this->crawing中的值就添加了这个网页中a标签的href属性\n \n\n foreach($this->crawling as $site) {\n $this->followLinks($site);\n }\n }", "private function parsehtml()\n\t{\n\t\t$html = $this->getUrl($this->url);\n\t\t$dom = new \\DOMDocument();\n\t\t@$dom->loadHTML($html);\n\t\t// discard white space\n\t\t$dom->preserveWhiteSpace = false;\n\t\t\n\t\t// get the div with id=\"moviemeter\" which includes the movies\n\t\t$movies = $dom->getElementById(\"moviemeter\");\n\t\tif(!$movies)\n\t\t\treturn null;\n\t\t\n\t\t$charts = [];\n\t\tforeach ($movies->getElementsByTagName(\"div\") as $div) \n\t\t{\n\t\t\t$array = explode(\"#\", $div->nodeValue);\n\t\t\t\t\t\n\t\t\tif(is_array($array) && count($array) == 2)\n\t\t\t{\n\t\t\t\t// get rank\n\t\t\t\t$rank = trim(substr($array[1], 0, 3));\n\t\t\n\t\t\t\t//get was\n\t\t\t\tif( preg_match( '!\\(([^\\)]+)\\)!', $array[1], $match ) )\n\t \t\t\t$was = $match[1];\n\t \t\t\n\t\t\t\t$charts[$rank] = [\"title\"=>trim($array[0]), \"was\"=>$was, \"rank\"=>$rank];\n\t\t\t}\n\t\t}\n\t\tforeach ($charts as $key => $value) \n\t\t\t$temp[$key] = $value[\"rank\"];\n\t\t\n\t\t// sort by rank\n\t\tarray_multisort($temp, SORT_ASC, $charts);\n\n\t\t// return the top <limit>\n\t\treturn array_slice($charts, 0, $this->limit);\t\n\t}", "function parse(){\n\t\t// Pull the next non parsed article from the database, and look for dates in it\n\t\t// Create a DB connection\n\t\tglobal $sess;\n\t\t$db = $sess->db();\n\t\t\n\t\tif(!isset($_SESSION['month'])) $_SESSION['month'] = 1;\n\t\tif(!isset($_SESSION['day'])) $_SESSION['day'] = 1;\n\t\t\n\t\t$this->month = $_SESSION['month'];\n\t\t$this->day = $_SESSION['day'];\n\t\t\n\t\t$url = ucfirst(date(\"F\", mktime(0, 0, 0, $this->month, 10))).'_'.$this->day;\n\t\t\n\t\techo '<h1>'.$url.'</h1>';\n\t\t\n\t\t//* ONLINE\n\t\t// Pull article from Wikipedia\n\t\t$data = json_decode($this->wiki->request($url,'parse','text'),true);\n\t\t\n\t\t$toParse = $data['parse']['text']['*'];\n\t\t\n\t\t//*/\n\t\t\n\t\t/* OFFLINE */\n\t\t//$toParse = file_get_contents('data/march.txt');\n\t\t\n\t\t// Time counter\n\t\t$this->times['download'] = $sess->execTime();\n\t\t\n\t\t// Parser\n\t\t$events = array();\n\t\tpreg_match_all('@\\<li\\>(.+)\\</li\\>@',$toParse,$events);\n\t\t\n\t\t$events = $events[1];\n\t\t\n\t\t$total = count($events);\n\t\tfor($i=0;$i<$total;$i++){\n\t\t\t$p = explode(' – ',$events[$i],2);\n\t\t\tif(count($p)<2) continue;\n\t\t\t\n\t\t\t$year = strip_tags($p[0]);\n\t\t\t$event = strip_tags($p[1]);\n\t\t\t\n\t\t\t$links = array();\n\t\t\tpreg_match_all('@\\<a\\shref=\"([\\w/_\\.-]*(\\?\\S+)?)\"@siU',$p[1],$links, PREG_SET_ORDER);\n\t\t\t\n\t\t\t$found = count($links);\n\t\t\t$tags = array();\t\t\t\n\t\t\tfor($a=0;$a<$found;$a++){ $tags[] = substr($links[$a][1],6); }\n\t\t\t\n\t\t\t// Default type\n\t\t\t$type = 0;\n\t\t\t\n\t\t\t// Entity\n\t\t\t$entity = '';\n\t\t\tif(isset($tags[0])) $entity = $tags[0];\n\t\t\t\n\t\t\t// Detect born/dead dates\n\t\t\t$years = array();\n\t\t\tif(preg_match('@\\(([b|d])\\.\\s(-)?([0-9]{1,4})\\)@',$event,$years)){\n\t\t\t\t// Name of person\n\t\t\t\t$n = explode(',',$event,2);\n\t\t\t\tif(strlen($n[0])>0) $entity = $n[0];\n\t\t\t\t\n\t\t\t\t$type = 3;\n\t\t\t\tif($years[1]=='b') $type = 4;\n\t\t\t}\n\t\t\t/*\n\t\t\t * 0\t->\tNormal event\t(Not in any of the categories below)\n\t\t\t * \t1\t->\tStart of event\t(i.e. Start of a war)\n\t\t\t * \t2\t->\tEnd of event\t(It will refer to the inmediate before)\n\t\t\t * \t3\t->\tStart of entity (birth)\n\t\t\t * \t4\t->\tEnd of entity\t(death)\n\t\t\t */\n\t\t\t\n\t\t\t// Store in local\n\t\t\t$this->add($event,$this->format($year,$this->month,$this->day),$type,$tags,$entity);\n\t\t}\n\t\t\n\t\t//var_dump($events);\n\t\t\n\t\t$this->times['process'] = $sess->execTime() - $this->times['download'];\n\t\t\n\t\t$this->times['import'] = $sess->execTime();\n\t\t\n\t\techo '<hr /><h3>Begin import</h3>';\n\t\t$this->import();\n\t}", "public function scrape($dom) {\n\n\t\t$job = new Job();\n\n\t\tif ($dom->find('link[rel=canonical]')) {\n\t\t\tif ($dom->find('div#content h1')) {\n\t\t\t\tif ($dom->find('table#vakance-view')){\n\n\t\t\t\t\t//Get foreign id\n\t\t\t\t\tforeach($dom->find('comment') as $Link) {\n\t\t\t\t\t\t$startString=\"from \";\n\t\t\t\t\t\t$endString=\" by HTTrack\";\n\t\t\t\t\t\tpreg_match_all (\"|$startString(.*)$endString|U\", $Link, $output, PREG_PATTERN_ORDER);\n\t\t\t\t\t\t$str = substr(strrchr(implode($output[1]), '/'), 1);\n\t\t\t\t\t\t$job->setForeignId('cvvp_nva_gov_lv_' . trim($str));\n\t\t\t\t\t}\n\n\t \t\t\t//Get job title\n\t\t\t\t\tforeach($dom->find('div#content h1') as $Jobtitle) {\n\t\t\t\t\t\t$job->setJobTitle($Jobtitle->plaintext);\n\t\t\t\t\t}\n\n\t\t\t\t\t//Get job description\n\t\t\t\t\tforeach($dom->find('table#vakance-view') as $DESCRIPTION) {\n\t\t\t\t\t\tforeach ($DESCRIPTION->find('script') as $ret) {\n\t\t\t\t\t\t\t$ret->innertext = '';\n\t\t\t\t\t\t\t$ret->outertext = '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$desc = str_replace(\"td\", \"p\", $DESCRIPTION->innertext);\n\n\t\t\t\t\t\t$job->setDescription($desc);\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\t$date = date('Y-m-d');// current date\n\t\t\t\t\t$date = strtotime('+1 week', strtotime($date));\n\t\t\t\t\t$newdate = date ( 'Y-m-j' , $date);\n\n\t\t\t\t\t$outputDate = $newdate.\"T\".date(\"h:i\").\":00Z\";\n\t\t\t\t\t$job->setExpireDate($outputDate);\n\n\t\t\t\t\t$job->addJobLocation(\"Latvia\", false, false, 273742);\t\n\n\t\t\t\t\tforeach($dom->find('comment') as $Link) {\n\t\t\t\t\t\t$startString=\"from \";\n\t\t\t\t\t\t$endString=\" by HTTrack\";\n\t\t\t\t\t\tpreg_match_all (\"|$startString(.*)$endString|U\", $Link, $output, PREG_PATTERN_ORDER);\n\t\t\t\t\t\t$job->setJobRouting(false, \"http://\".implode($output[1]), 2);\n\t\t\t\t\t}\n\n\n\t\t\t\t\treturn $job;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n}", "function scrape_between($data, $start, $end){\n $data = stristr($data, $start); // Stripping all data from before $start\n $data = substr($data, strlen($start)); // Stripping $start\n $stop = stripos($data, $end); // Getting the position of the $end of the data to scrape\n $data = substr($data, 0, $stop); // Stripping all data from after and including the $end of the data to scrape\n return $data; // Returning the scraped data from the function\n}", "public function collectUrls() {\n\t\t\t$this->addUrlsToCrawlArray(self::$seedUrls);\n\t\t\tif (count(self::$crawlXpath) != 0 && self::$dataXpath != \"\") {\n\t\t\t\t$length = count(self::$crawlXpath);\n\t\t\t\tfor($i=0; $i<$length; $i++) {\n\t\t\t\t\t$crawlXpathToUse = self::$crawlXpath[$i];\n\t\t\t\t\t$urlsToCrawlThisRun = self::$urlsToCrawl[$i];\n\t\t\t\t\t$crawledUrlsThisRun = array();\n\t\t\t\t\tforeach ($urlsToCrawlThisRun as $url) {\n\t\t\t\t\t\techo(\"Crawling: \". $url.\"<br>\");\n\t\t\t\t\t\t$xml = $this->getPageHtml($url);\n\t\t\t\t\t\techo\"have page content\".\"<br>\";\n\t\t\t\t\t\t$Xpath = new DOMXpath($xml);\n\t\t\t\t\t\techo\"using xpath: \". $crawlXpathToUse.\"<br>\";\n\t\t\t\t\t\t$urlsFromXpathNodeList = $Xpath->evaluate($crawlXpathToUse);\n\t\t\t\t\t\techo\"xpath evaluated.\";\n\t\t\t\t\t\t$urlsFromXpathArray = array();\n\t\t\t\t\t\t$length = $urlsFromXpathNodeList->length;\n\t\t\t\t\t\tfor($j=0; $j<$length; $j++) {\n\t\t\t\t\t\t\tarray_push($urlsFromXpathArray, $urlsFromXpathNodeList->item($j)->textContent);\n\t\t\t\t\t\t\t$this->addCrawlUrlToDb($urlsFromXpathNodeList->item($j)->textContent);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tarray_push(self::$urlsToCrawl, $urlsFromXpathArray);\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t} else if (count(self::$crawlXpath) == 0 && self::$dataXpath != \"\") {\n\t\t\t\n\t\t\t} else {\n\t\t\t\techo \"Data xPath not provided. Returning.\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t}", "public function GetHTML(){\n\t/*unset($this->url[0]);\n\t\t\t$cnt=1;\n\t\t\tforeach($this->url as $v){\n\t\t\t\tif(count($this->url)==$cnt && $v>0 && is_numeric($v)){\n\t\t\t\t//$this->out_url.=$v.'/';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t$this->out_url.=$v.'/';\n\t\t\t$cnt++;\n\t\t\t}*/\n\t\n\t\t\n\t\n\t$next=$this->list['current']+1;\n\t$prev=$this->list['current']-1;\n\t$limit=($this->page-1)*$this->take+1;\n\t$limit2=$limit+$this->take-1;\n\t\n\tif ($this->page==$this->total_pages)\n\t$limit2=$this->total;\n\t$str='';\n\t$str .=\"\";\n\t\n\n\t$str .=<<<OUT\n\t\t\t<div class=\"pager\">\n\t\t \t<div class=\"hr\"><i></i></div>\n\t\t <ul>\nOUT;\n\tif($prev>0){\n\t$str .=<<<OUT\n\t\t\t<li class=\"prev\"><a href=\"{$this->out_url}{$prev}/\"><i class=\"i\"></i></a></li>\nOUT;\n\t}\n \n\tfor ($i=1; $i < $this->page ; $i++)\n\t\t{\n\t\t\tif ($i>((int)$this->page-(int)$this->half_block)){\n\t\t\t\tif($i==1){\n\t\t\t\t$str .=<<<OUT\n\t\t\t\t<li><a href=\"{$this->out_url}{$this->list[$i]}/\">{$this->list[$i]}</a></li>\nOUT;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t$str .=<<<OUT\n\t\t\t\t<li><a href=\"{$this->out_url}{$this->list[$i]}/\">{$this->list[$i]}</a></li>\nOUT;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\tif($this->total_pages==$this->list['current'])\n\t$str .=\"<li class='last'>\".$this->list['current'].\"</li>\";\n\telse\n\t$str .=\"<li>\".$this->list['current'].\"</li>\";\n\t\n\t$cnt=1;\n\tfor ($i=$this->page+1; $i <= $this->total_pages ; $i++)\n\t\t{\n\t\t\tif($this->total_pages==$i || ($this->half_block-1)==$cnt)\n\t\t\t$classlast=' class=\"last\"';\n\t\t\telse\n\t\t\t$classlast='';\n\t\t\t\n\t\t\tif ($this->half_block==$cnt)\n\t\t\tbreak;\n\t\t\t$str .=<<<OUT\n\t\t\t<li{$classlast}><a href=\"{$this->out_url}{$this->list[$i]}/\">{$this->list[$i]}</a></li>\nOUT;\n\t\t\t$cnt++;\n\t\t}\n\n\tif($this->list['current']<$this->total_pages){\n\t$str .=<<<OUT\n\t\t\t<li class=\"next\"><a href=\"{$this->out_url}{$next}/\"><i class=\"i\"></i></a></li>\nOUT;\n\t}\n\t\n\t$str .=<<<OUT\n \t\t </div>\nOUT;\n\tif ($this->total_pages>1)\n\treturn $str;\n\t\n\t}", "protected function parse()\n {\n\n $crawler = new Crawler($this->originalHTML);\n\n $this->tableOfContents = $crawler->filter('body > nav')->html();\n $this->body = $crawler->filter('body > main')->html();\n\n $this->reformatTableOfContents();\n $this->reformatBody();\n }", "private function getDataByScrapeUrl()\n {\n return file_get_contents($this->url);\n }", "function getPage($url){\n //use curl since we need to set a cookie\n $c = curl_init($url);\n curl_setopt($c, CURLOPT_VERBOSE, 1);\n curl_setopt($c, CURLOPT_COOKIE, $this->cookie);\n curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);\n $page = curl_exec($c);\n curl_close($c);\n $c = null;\n $html = str_get_html($page); //simplehtmldom method\n return $html;\n }", "function getHTML($url,$timeout)\n{\n $ch = curl_init($url); // initialize curl with given url\n curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER[\"HTTP_USER_AGENT\"]); // set useragent\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // write the response to a variable\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // follow redirects if any\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); // max. seconds to execute\n curl_setopt($ch, CURLOPT_FAILONERROR, 1); // stop when it encounters an error\n return @curl_exec($ch);\n}", "public function scrape($dom) {\n\n\t\t$job = new Job();\n\t\t$citylist = $GLOBALS['citylist'];\n\n\t\tif ($dom->find('comment')) {\n\t\t\tif ($dom->find('h2.nafn')) {\n\t\t\t\tif ($dom->find('div.box-left')){\n\n\t\t\t\t\t//Get foreign id\n\t\t\t\t\tforeach($dom->find('comment') as $Link) {\n\t\t\t\t\t\t$startString=\"nr/\";\n\t\t\t\t\t\t$endString=\"/\";\n\t\t\t\t\t\tpreg_match_all (\"|$startString(.*)$endString|U\", $Link, $output, PREG_PATTERN_ORDER);\n\t\t\t\t\t\t$job->setForeignId('vinnumalastofnun_is_' . trim(implode($output[1])));\n\t\t\t\t\t}\n\n\t \t\t\t//Get job title\n\t\t\t\t\tforeach($dom->find('h2.nafn') as $Jobtitle) {\n\t\t\t\t\t\t$job->setJobTitle($Jobtitle->plaintext);\n\t\t\t\t\t}\n\n\t\t\t\t\t//Get job description\n\t\t\t\t\tforeach($dom->find('div.box-left') as $DESCRIPTION) {\n\t\t\t\t\t\t$str = htmlentities($DESCRIPTION->innertext,ENT_NOQUOTES,'UTF-8',false);\n\t\t\t\t\t\t$str = str_replace(array('&lt;','&gt;'),array('<','>'), $str);\n\t\t\t\t\t\t$str = str_replace(array('&amp;lt;','&amp;gt'),array('&lt;','&gt;'), $str);\t\n\t\t\t\t\t\t$job->setDescription($str);\n\t\t\t\t\t}\n\n\t\t\t\t\t$date = date('Y-m-d');// current date\n\t\t\t\t\t$date = strtotime('+1 week', strtotime($date));\n\t\t\t\t\t$newdate = date ( 'Y-m-j' , $date);\n\n\t\t\t\t\t$outputDate = $newdate.\"T\".date(\"h:i\").\":00Z\";\n\t\t\t\t\t$job->setExpireDate($outputDate);\n\n\t\t\t\t\t$job->addJobLocation(\"Iceland\", false, false, 273716);\n\n\t\t\t\t\tforeach($dom->find('link[rel=canonical]') as $Link) {\n\t\t\t\t\t\t$job->setJobRouting(false, $Link->href, false);\n\t\t\t\t\t}\n\n\t\t\t\t\tforeach($dom->find('comment') as $Link) {\n\t\t\t\t\t\t$startString=\"from \";\n\t\t\t\t\t\t$endString=\" by HTTrack\";\n\t\t\t\t\t\tpreg_match_all (\"|$startString(.*)$endString|U\", $Link, $output, PREG_PATTERN_ORDER);\n\t\t\t\t\t\t$job->setJobRouting(false, \"http://\".trim(implode($output[1])), 2);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn $job;\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n}", "public function __construct($url) {\r\n $options = array(\r\n 'http'=>array('method'=>\"GET\", 'header'=>\"User-Agent: crawlBot/0.1\\n\")\r\n );\r\n $context = stream_context_create($options);\r\n \r\n $this->doc = new DomDocument();\r\n @$this->doc->loadHTML(file_get_contents($url, false, $context));\r\n }", "public function sandbox() {\n $reference = 'http://www.trade.bookclub.ua/books/product.html?id=46736';\n @$html = file_get_contents($reference);\n if (empty($html)) {\n dd('fail load reference page');\n }\n\n $dom = new \\DOMDocument();\n @$dom->loadHTML($html);\n $xpath = new \\DOMXpath($dom);\n\n $node = $xpath->query('//div[@class=\"goods-descrp\"]');\n if (count($node)) {\n $book['description'] = (nl2br(trim($node[0]->nodeValue)));\n }\n\n //params\n// $node = $xpath->query('//ul[@class=\"goods-short\"]');\n// $pars = nl2br($node[0]->nodeValue);\n// $book['details']['']\\App\\Import\\Ksd::extract($pars, 'Вес:', '<br');\n\n //image\n $node = $xpath->query('//div[@class=\"goods-image\"]');\n if (count($node)) {\n $img = $node[0]->getElementsByTagName('img');\n if (count($img)) {\n $src = str_replace('/b/', '/', $img[0]->getAttribute('src'));\n $src = str_replace('_b.', '.', $src);\n }\n }\n\n // Author\n $node = $xpath->query('//div[@class=\"autor-text-color\"]');\n if (count($node)) {\n $name = trim($node[0]->getElementsByTagName('h2')[0]->nodeValue);\n $descr = trim($node[0]->getElementsByTagName('p')[0]->nodeValue);\n }\n\n $node = $xpath->query('//div[@class=\"autor-image\"]');\n if (count($node)) {\n $img = $node[0]->getElementsByTagName('img');\n if (count($img)) {\n $src = $img[0]->getAttribute('src');\n dd($src);\n }\n }\n }", "protected function parse($html) {\n $this->crawler->addHtmlContent($html, 'UTF-8');\n return $this->crawler->filterXPath(\"//div[contains(@class,'sr_item')]\")\n ->each(function(Crawler $node, $i){\n return [\n 'hotelid' => $node->attr('data-hotelid'),\n 'score' => $node->attr('data-score'),\n 'name' => $node->filterXPath(\"//span[contains(@class,'sr-hotel__name')]\")->text(),\n 'location' => $node->filterXPath(\"//div[contains(@class,'address')]/a[contains(@class,'district_link')]\")->text(),\n // 'price' => $node->filterXPath(\"//table/tr/td[contains(@class,'roomPrice')]/div[contains(@class,'smart_price_style')]\")->text(),\n ];\n });\n }", "function extract_hotlinks($content) {\n\n\n\n\t}", "function testgetHyperLinks() {\n //Setup \n $pageTest = new INM5001A13_WebTools(\"http://localhost/EquipeRene/Snippets/pagePourTestUnitaireWebTool.html\");\n\n $resultat = $pageTest->getHyperLinks();\n\n\n $this->assertEquals($resultat[\"http://google.ca\"], 'Search GGxxGLE');\n }", "public function harvest() {\n\t\t// CURLOPT_FOLLOWLOCATION => true,\n\t\t// CURLOPT_RETURNTRANSFER => true,\n\t\t// CURLOPT_SSL_VERIFYHOST => false,\n\t\t// CURLOPT_TIMEOUT => 60,\n\t\t// CURLOPT_HTTPHEADER => array (\n\t\t// \"User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36\"\n\t\t// ),\n\t\t// CURLOPT_PROXY => \"http://172.16.2.30:8080\"\n\t\t// );\n\t\t// $curl = curl_init ( $this->base_url . \"/community-list\" );\n\t\t// curl_setopt_array ( $curl, $curl_options );\n\t\t// $response = curl_exec ( $curl );\n\t\t// curl_close ( $curl );\n\t\t// file_put_contents ( \"a.html\", $response );\n\t\t// file_put_contents ( \"b.html\", $response );\n\t\t// exit ( 0 );\n\t\t$response = file_get_contents ( \"a.html\" );\n\t\t// $response = file_get_contents ( \"b.html\" );\n\t\t\n\t\tlibxml_use_internal_errors ( true );\n\t\t$doc = new DOMDocument ();\n\t\t$doc->loadHTML ( $response, LIBXML_BIGLINES | LIBXML_NOWARNING | LIBXML_ERR_NONE );\n\t\tlibxml_clear_errors ();\n\t\t$xpath = new DOMXPath ( $doc );\n\t\t\n\t\t$nodes = $xpath->query ( \"//div[@id='aspect_artifactbrowser_CommunityBrowser_div_comunity-browser']\" );\n\t\t$this->structure = $this->get_structure ( $nodes [0], $xpath );\n\t\t\n\t\tfile_put_contents ( $this->base_folder . \"/structure.json\", json_encode ( $this->structure, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES ) );\n\t\t\n\t\t$this->crawl_items ( $this->structure );\n\t}", "public function fetch($start_page = 2){\n # Track time;\n $this->time = time();\n\n # Get all the cars on a single result page.\n $items = $this->dom->find(\".listing-item\");\n if(!empty($items)){\n $this->results = static::parse_items($items);\n }\n $featured_items = $this->dom->find(\".featured-item\");\n if(!empty($featured_items)){\n $this->results = array_merge($this->results,\n static::parse_items($featured_items));\n }\n if(empty($this->results)){\n return [];\n }\n\n $this->num_results_on_page = count($items);\n\n\n # Get the total number of pages.\n $last_page_query = $this->dom->find('.paging_forward #last_page')->getAttribute(\"href\");\n if(empty($last_page_query)){\n $this->dom->find('.paging_forward a')->outerHtml;\n $anchors = $this->dom->find('.paging_forward a');\n if(isset($anchors[1])){\n $last_page_query = $anchors[1]->getAttribute(\"href\");\n }else{\n $last_page_query = \"\";\n }\n }\n\n preg_match(\"/page=(\\d+)/\", $last_page_query, $num_pages_query);\n if(isset($num_pages_query[0][1])){\n $this->num_pages = intval(explode(\"=\", $num_pages_query[0])[1]);\n }else{\n $this->num_pages = 1;\n }\n\n # Make sure num_results is less than total results\n $this->total_results = $this->num_results_on_page * $this->num_pages;\n if($this->num_results > $this->total_results || $this->num_results == \"all\"){\n $this->num_results = $this->total_results;\n }\n if($this->num_results_on_page > 0){\n $page_needed = intval($this->num_results / $this->num_results_on_page );\n }else{\n $page_needed = 0;\n }\n\n $page_urls = [];\n $base_url = preg_replace(\"/page=(\\d+)/\", \"\", $last_page_query);\n for($i = $start_page; $i <= $page_needed && $i <= $this->num_pages; $i++){\n array_push($page_urls, $this->url.\"&page=$i\");\n }\n\n # Fetch additional pages.\n $this->getOtherPages($page_urls);\n\n $first_page = preg_replace(\"/page=(\\d+)/\", \"page=1\", $last_page_query);\n array_unshift($page_urls, $first_page);\n }", "function getNoOfPages($url,$city)\r\n {\r\n // Fetching URL\r\n $ch = curl_init();\r\n curl_setopt($ch,CURLOPT_URL,$url);\r\n curl_setopt($ch, CURLOPT_POST, false);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n $html = curl_exec($ch);\r\n curl_close($ch);\r\n \r\n $DOM=new DOMDocument;\r\n libxml_use_internal_errors(true);\r\n $DOM->loadHTML($html);\r\n \r\n // Getting value by tag name.\r\n $elements=$DOM->getElementsByTagName('select');\r\n $temp=\"\";\r\n \r\n if(preg_match('/[^<select name=\"epaper_city\" id=\"epaper_edition\" style=\"\">(.*)<\\/select>]+/', $elements->item(1)->getAttribute('name'), $match)){\r\n $temp = $elements->item(1)->nodeValue;\r\n }\r\n \r\n $z=preg_replace('/[^A-Za-z|-]/', '', $temp);\r\n $temp3=explode(\"-\", $z);\r\n $result = array_map('strtolower', $temp3); // Converting to lower\r\n \r\n for ($l=0; $l < count($result); $l++) { \r\n if ($result[$l]=='foreign') {\r\n $result[$l]='';\r\n }\r\n }\r\n $result=array_values(array_filter($result));\r\n // Changing Name to Table name\r\n for ($i=0; $i < count($result) ; $i++) { \r\n # code...\r\n if ($result[$i] == 'frontpage' || $result[$i] == 'national' || $result[$i] == 'backpage' || $result[$i] == 'adguide') {\r\n $result[$i] = 'national';\r\n }\r\n elseif ($result[$i] == 'opinions') {\r\n $result[$i] = 'opinion';\r\n }\r\n elseif ($result[$i] == 'business') {\r\n $result[$i] = 'business';\r\n }\r\n elseif ($result[$i] == 'international') {\r\n $result[$i] = 'international';\r\n }\r\n elseif ($result[$i] == 'city') {\r\n $result[$i] = $city;\r\n }\r\n elseif ($result[$i] == 'sports') {\r\n $result[$i] = 'sports';\r\n }\r\n elseif ($result[$i] == 'lifestyleentertainment') {\r\n $result[$i] = 'lifestyle';\r\n }\r\n elseif ($result[$i] == 'snippets') {\r\n $result[$i] = 'snippet';\r\n }\r\n }\r\n return $result;\r\n }", "private function crawl(){\n\t\t// check if path is allowed by robots.txt\n\t\tif(!$this->robot || $this->robot->crawlAllowed($this->pages[0])){\n\t\t\t// set the file path, extract directory structure, open file\n\t\t\t$path = 'http://'.$this->url.$this->pages[0];\n\t\t\t$this->setCurrentPath();\n\t\t\t$this->doc->loadHTMLFile($path);\n\t\t\t\n\t\t\t// find all <a> tags in the page\n\t\t\t$a_tags = $this->doc->getElementsByTagName('a');\n\t\t\t$link_tags = $this->doc->getElementsByTagName('link');\n\t\t\t$script_tags = $this->doc->getElementsByTagName('script');\n\t\t\t$img_tags = $this->doc->getElementsByTagName('img');\n\t\t\t$form_tags = $this->doc->getElementsByTagName('form');\n\t\t\t// if <a> tags were found, loop through all of them\n\t\t\tif(isset($a_tags) && !is_null($a_tags)){\n\t\t\t\tforeach ($a_tags as $link) {\n\t\t\t\t\t// find the href attribute of each link\n\t\t\t\t\tforeach ($link->attributes as $attrib) {\n\t\t\t\t\t\tif(strtolower($attrib->name) == 'href'){\n\t\t\t\t\t\t\t// make sure its not external, javascript or to an anchor\n\t\t\t\t\t\t\tif(count(explode(':', $attrib->value)) < 2 && count(explode('#', $attrib->value)) < 2){\n\t\t\t\t\t\t\t\t$this->links[$this->pages[0]][] = $this->relativePathFix($attrib->value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// if <link> tags were found, loop through all of them\n\t\t\tif(isset($link_tags) && !is_null($link_tags)){\n\t\t\t\tforeach ($link_tags as $link) {\n\t\t\t\t\t// find the href attribute of each link\n\t\t\t\t\tforeach ($link->attributes as $attrib) {\n\t\t\t\t\t\tif(strtolower($attrib->name) == 'href'){\n\t\t\t\t\t\t\t// make sure its not external, javascript or to an anchor\n\t\t\t\t\t\t\tif(count(explode(':', $attrib->value)) < 2 && count(explode('#', $attrib->value)) < 2){\n\t\t\t\t\t\t\t\t$this->links[$this->pages[0]][] = $this->relativePathFix($attrib->value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// if <script> tags were found, loop through all of them\n\t\t\tif(isset($script_tags) && !is_null($script_tags)){\n\t\t\t\tforeach ($script_tags as $link) {\n\t\t\t\t\t// find the src attribute of each link\n\t\t\t\t\tforeach ($link->attributes as $attrib) {\n\t\t\t\t\t\tif(strtolower($attrib->name) == 'src'){\n\t\t\t\t\t\t\t// make sure its not external, javascript or to an anchor\n\t\t\t\t\t\t\tif(count(explode(':', $attrib->value)) < 2 && count(explode('#', $attrib->value)) < 2){\n\t\t\t\t\t\t\t\t$this->links[$this->pages[0]][] = $this->relativePathFix($attrib->value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// if <img> tags were found, loop through all of them\n\t\t\tif(isset($img_tags) && !is_null($img_tags)){\n\t\t\t\tforeach ($img_tags as $link) {\n\t\t\t\t\t// find the src attribute of each link\n\t\t\t\t\tforeach ($link->attributes as $attrib) {\n\t\t\t\t\t\tif(strtolower($attrib->name) == 'src'){\n\t\t\t\t\t\t\t// make sure its not external, javascript or to an anchor\n\t\t\t\t\t\t\tif(count(explode(':', $attrib->value)) < 2 && count(explode('#', $attrib->value)) < 2){\n\t\t\t\t\t\t\t\t$this->links[$this->pages[0]][] = $this->relativePathFix($attrib->value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// if <form> tags were found, loop through all of them\n\t\t\tif(isset($forms_tags) && !is_null($form_tags)){\n\t\t\t\tforeach ($form_tags as $link) {\n\t\t\t\t\t// find the src attribute of each link\n\t\t\t\t\tforeach ($link->attributes as $attrib) {\n\t\t\t\t\t\tif(strtolower($attrib->name) == 'action'){\n\t\t\t\t\t\t\t// make sure its not external, javascript or to an anchor\n\t\t\t\t\t\t\tif(count(explode(':', $attrib->value)) < 2 && count(explode('#', $attrib->value)) < 2){\n\t\t\t\t\t\t\t\t$this->links[$this->pages[0]][] = $this->relativePathFix($attrib->value);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// merge and sort all arrays\n\t\t$this->arrayShuffle();\n\t}", "function get_movies( $query )\n{\n log_error('get_movies');\n $html = get_html($query);\n\n $results = array();\n\n foreach($html->find('#movie_results .theater') as $div) {\n log_error('found a theatre');\n $result = array();\n\n //$theatre_id = $div->find('h2 a',0)->getAttribute('href');\n $theatre_info = $div->find('.info',0)->innertext;\n\n //$result['theatre_id'] = substr( $theatre_id, (strrpos($theatre_id, 'tid=')+4) );\n $result['theatre_name'] = $div->find('.name',0)->innertext;\n\n $pos_info = strrpos( $theatre_info, '<a');\n if( $pos_info !== false )\n $result['theatre_info'] = substr( $theatre_info, 0, strrpos( $theatre_info, '<a'));\n else\n $result['theatre_info'] = $theatre_info;\n\n $result['movies'] = array();\n foreach($div->find('.movie') as $movie) {\n log_error('found a movie - '.$movie->find('.name a',0)->innertext);\n\n $movie_id = $movie->find('.name a',0)->getAttribute('href');\n $movie_id = substr( $movie_id, (strrpos($movie_id, 'mid=')+4) );\n\n log_error('obtained movie_id: '.$movie_id);\n\n $info_raw = $movie->find('.info',0)->innertext;\n $pos = strpos($info_raw, ' - <a');\n\n if( $pos !== false ){\n $info = substr( $info_raw, 0, $pos);\n\n $trailer = urldecode($movie->find('.info a', 0)->getAttribute('href'));\n $trailer = substr($trailer, 7);\n $trailer = substr($trailer, 0, strpos($trailer, '&'));\n }\n else {\n $trailer = '';\n }\n\n // showtimes\n $times = array();\n // echo 'movie: '.$movie->find('.name a',0)->innertext.'<br>';\n // echo $movie->find('.times',0)->childNodes(0);\n foreach($movie->find('.times > span') as $time) {\n // echo 'time: '.$time->innertext.'<br>';\n // echo 'attr: '.$time->getAttribute('style').'<br>';\n\n if( trim($time->getAttribute('style')) != 'padding:0' )\n {\n $time_strip = strip_tags($time->innertext);\n $time_strip = str_replace('&nbsp', '', $time_strip);\n $time_strip = str_replace(' ', '', $time_strip);\n //$time_strip = html_entity_decode($time_strip);\n //echo 'a:'.$time_strip.'<br>';\n /*$pos_time = false;\n $pos_time = strrpos($time->innertext, '-->');\n if( $pos_time !== false ){\n $showtime = substr($time->innertext, $pos_time+3);\n //echo $showtime.'<br>';\n }*/\n //echo $time;\n array_push( $times, $time_strip );\n }\n }\n\n array_push($result['movies'], array(\n 'id' => $movie_id,\n 'name' => $movie->find('.name a',0)->innertext,\n 'info' => $info, // (does <a> exist) ? (yes) : (no)\n 'time' => $times,\n 'trailer' => $trailer\n ));\n }\n\n $results[] = $result;\n }\n\n return $results;\n}", "public function more(){\n $url = \"https://faucetbox.com/en/list/{$this->site_settings['currency']}\"; \n //set good browser agent\n ini_set('user_agent', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9');\n //load external faucet page - convert links and add referral addy\n $page = \\Web::instance()->request( $url );\n $xml = load_simplexml_page($page['body'] , 'html');\n if($xml){\n $faucets = [];\n foreach($xml->xpath(\"//a[contains(@href , '?url=')]\") as $faucet){\n parse_str(parse_url($faucet['href'] , PHP_URL_QUERY) , $parts);\n $faucets[] = [\n trim((string)$faucet) , //link text\n \"{$parts['url']}?r={$this->fw->get('COOKIE.r')}\"\n ];\n }//end - get faucet links\n $this->fw->set('faucets' , $faucets);\n }else{\n $this->fw->set('SESSION.flash' , ['type' => 'warning' , 'message' => 'Sorry...Unable to load faucets']);\n }\n }", "public static function lorPageElement();", "function fetch($url){\n curl_setopt($this-> ch,CURLOPT_URL, $url);\n curl_setopt($this-> ch,CURLOPT_COOKIE, \"./cookie.txt\"); \n curl_setopt($this-> ch,CURLOPT_FOLLOWLOCATION, true);\n return $this-> html = curl_exec($this-> ch);\n }", "function ariana_services_get_html($data){\n\t$args = array(\n\t\t\"post_type\" => \"ariana-services\",\n\t\t\"order\" => \"ASC\",\n\t\t\"orderby\" => \"menu_order\",\n\t\t\"numberposts\" => -1\n\t);\n\n\tif( isset( $data['rand'] ) && $data['rand'] == true ) {\n\t\t$args['orderby'] = 'rand';\n\t}\n\tif( isset( $data['max'] ) ) {\n\t\t$args['numberposts'] = (int) $data['max'];\n\t}\n if( isset( $data['mode'] ) ) {\n\t\t$theme_mode = $data['mode'];\n\t}else{\n $theme_mode = 'default';\n }\n\n\t//getting all testimonials\n\t$posts = get_posts($args);\n\n\t\tforeach($posts as $post){\n\t\t\t//getting thumb image\n\t\t\t$url_thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post->ID), 'medium');\n\t\t\t$img_markup = '';\n\t\t\tif (!empty($url_thumb)){\n\t\t\t\t$img_markup = '<img src=\"' . $url_thumb[0] . '\" alt=\"' . $post->post_title . '\" class=\"img-responsive\">';\n\t\t\t}else{\n\t\t\t\t$img_markup = '<img src=\"' . ARIANA_WIDGETS_ASSETS_DIR . 'img/post-default.png\" alt=\"' . $post->post_title . '\" class=\"img-responsive\">';\n\t\t\t}\n\n if ( $theme_mode == 'carousel' ):\n echo '<div class=\"item\">';\n echo '<div class=\"item-image\">';\n echo $img_markup;\n echo '</div><!-- end item-image -->';\n echo '<div class=\"item-desc\">';\n echo '<h4><a href=\"' . get_the_permalink($post->ID) . '\" title=\"' . $post->post_title . '\">' . $post->post_title . '</a></h4>';\n // echo '<p>Starting from $50.00</p>';\n echo '</div><!-- end item-desc -->';\n echo '</div><!-- end item -->';\n elseif ( $theme_mode == 'homebox' ):\n\t\t\t\t$post_home_subtitle = get_post_meta( $post->ID, 'post_home_subtitle', true );\n\t\t\t\techo '<div class=\"col-md-3 col-sm-12\">';\n\t\t\t\techo \t\t'<div class=\"item mb-30\">';\n echo \t'<div class=\"item-image\">';\n\t\t\t\techo \t\t\t\t'<a href=\"' . get_the_permalink($post->ID) . '\" title=\"' . $post->post_title . '\">';\n echo \t\t$img_markup;\n\t\t\t\techo \t\t\t\t'</a>';\n echo \t'</div><!-- end item-image -->';\n echo \t'<div class=\"item-desc\">';\n echo \t'<h4><a href=\"' . get_the_permalink($post->ID) . '\" title=\"' . $post->post_title . '\">' . $post->post_title . '</a></h4>';\n echo \t( $post_home_subtitle != '' ) ? '<p>' . $post_home_subtitle . '</p>' : '';\n echo \t'</div><!-- end item-desc -->';\n echo \t\t'</div><!-- end item -->';\n\t\t\t\techo '</div><!-- end col -->';\n\t\t\telse:\n\t\t\t\t$post_home_subtitle = get_post_meta( $post->ID, 'post_home_subtitle', true );\n echo '<div class=\"col-md-3 col-sm-6\">';\n echo '<div class=\"item\">';\n echo '<div class=\"item-image\">';\n echo $img_markup;\n echo '<span class=\"item-icon\"><a href=\"' . get_the_permalink( $post->ID ) . '\"><i class=\"fa fa-link\"></i></a></span>';\n echo '</div><!-- end item-image -->';\n echo '<div class=\"item-desc text-center\">';\n echo '<h4><a href=\"' . get_the_permalink( $post->ID ) . '\" title=\"' . $post->post_title . '\">' . $post->post_title . '</a></h4>';\n echo ( $post_home_subtitle != '' ) ? '<h5><a href=\"' . get_the_permalink( $post->ID ) . '\" title=\"' . $post->post_title . '\">' . $post_home_subtitle . '</a></h5>' : '';\n // echo '<p>' . $post->post_excerpt . '</p>';\n echo '</div><!-- end service-desc -->';\n echo '</div><!-- end seo-item -->';\n echo '</div><!-- end col -->';\n endif;\n\n\t\t}\n}", "function page_func(){\n\t\t?>\n\t\t\t\t<div class=\"wrap\">\n\t\t\t\t\t<div class=\"tablenav\">\n\t\t\t\t\t\t<div class=\"tablenav-pages\">\n\t\t\t\t\t\t\t<span class=\"displaying-num\">\n\t\t\t\t\t\t\t\tDisplaying 1-20 of 69\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span class=\"page-number-current\">1</span>\n\t\t\t\t\t\t\t<a href=\"#\" class=\"page-numbers\">2</a>\n\t\t\t\t\t\t\t<a href=\"#\" class=\"page-numbers\">3</a>\n\t\t\t\t\t\t\t<a href=\"#\" class=\"page-numbers\">4</a>\n\t\t\t\t\t\t\t<a href=\"#\" class=\"page-numbers\">5</a>\n\t\t\t\t\t\t\t<a href=\"#\" class=\"page-numbers\">6</a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t<?php \n\t\t\t}", "public function getInfo($data){\n // From URL to get webpage contents.\n $url = \"https://api.rawg.io/api/games?key=16eeee7089554d7191b4a1a048ccb468&page=2\";\n\n // Initialize a CURL session.\n $ch = curl_init();\n\n // Return Page contents. don't forget to add the proxy for Wheatley\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n //grab URL and pass it to the variable.\n if (isset($data))\n if (true)\n {\n curl_setopt($ch, CURLOPT_URL, $url);\n $result = curl_exec($ch);\n $result = json_decode($result);\n\n if (true) {\n $tmp = [];\n $games=$result->results;\n foreach ($games as $r){\n array_push($tmp, array(\"title\" => \"$r->name\",\n \"cover\" => \"$r->background_image\",\n \"rating\" => \"$r->rating\",\n \"score\" => \"$r->metacritic\",\n \"released\" => \"$r->released\"\n\n ));\n }\n return $tmp;\n }\n }\n curl_close($ch);\n\n }", "function scrap_me($url, $xpath_query = '//div/table/tr/td')\n\t{\n\t\t$html = file_get_contents($url);\n\t\t$scrapme_doc = new DOMDocument();\n\t\t$result = [];\n\n\t\tlibxml_use_internal_errors(TRUE);\n\n\t\tif(!empty($html))\n\t\t{\n\t\t\t$scrapme_doc->loadHTML($html);\n\t\t\tlibxml_clear_errors();\n\n\t\t\t$scrapme_xpath = new DOMXPath($scrapme_doc);\n\t\t\t$scrapme_row = $scrapme_xpath->query($xpath_query);\n\n\t\t\tif($scrapme_row->length > 0)\n\t\t\t{\n\t\t\t\tforeach($scrapme_row as $row)\n\t\t\t\t\t$result[] = preg_replace('/\\s+/', ' ', utf8_decode($row->nodeValue));\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "public function parse_for_items(){\n\n\t\t$fct = $this->add_facilities(execNode(__FILE__,'google.search.main.js',$this->url));\n\t\t//$file = dirname(__FILE__).'/TEST.DATA.json';\n\t\t//$fct = $this->add_facilities(file_get_contents($file));\n\n\t\treturn addslashes('<div><em>'.$fct.'</em> <u>'.ucfirst($this->terms).'</u><br>Providers Located</div>');\n\n\t}", "function checkData($da) {\n global $baseurl, $f, $o, $i, $e, $local;\n $d = new simple_html_dom();\n $u = $baseurl . $da[28];\n// echo \"URL: \" . $u .\"\\n\";\n $d->load(scraperwiki::scrape($u));\n if (is_null($d->find('div[id=medproimg] a',0))) {\n $errstr = \"Error: \" . $da[0] . \". Couldn't find product page.\\n\";\n fwrite($e,$errstr);\n echo $errstr;\n return 0;\n }\n $imgurl = trim($d->find('div[id=medproimg] a',0)->href);\n if ($da[11] == \"///\" || !is_numeric($da[19])) {\n if ($da[11] == \"///\") {\n $imgfile = trim(strrchr($imgurl,\"/\"),\"/ \");\n $img = \"/\" . substr($imgfile,0,1) . \"/\" . substr($imgfile,1,1) . \"/\" . $imgfile;\n if ($img != \"///\") {\n $da[11] = $img;\n $da[22] = $img;\n $da[25] = $img;\n $da[52] = $img;\n } else {\n $errstr = \"Error: \" . $da[0] . \". Couldn't find img filename.\\n\";\n fwrite($e,$errstr);\n echo $errstr;\n return 0;\n }\n }\n if (!is_numeric($da[19])) {\n $price = implode(explode(\",\",trim(strstr(strstr($d->find('div[id=proprice]',0)->innertext,\"$\"),\"<\",true),\"$ \")));\n if (is_numeric($price)) {\n $da[19] = $price;\n } else {\n $errstr = \"Error: \" . $da[0] . \". Couldn't find price.\\n\";\n fwrite($e,$errstr);\n echo $errstr;\n return 0;\n }\n }\n fputcsv($o,$da);\n fputcsv($i,array($imgurl,$da[11]));\n $errstr = \"Success: updated \" . $da[0] . \".\\n\";\n fwrite($e,$errstr);\n echo $errstr;\n checkThumbs($d,$da);\n }\n fputcsv($o,$da);\n fputcsv($i,array($imgurl,$da[11]));\n checkThumbs($d,$da);\n}", "public function scrape(Request $request){\n $url = $request->get('url');\n\n //Init Guzzle\n $client = new Client();\n\n //Get request\n $response = $client->request(\n 'GET',\n $url\n );\n\n $response_status_code = $response->getStatusCode();\n $html = $response->getBody()->getContents();\n\n if($response_status_code==200){\n $dom = HtmlDomParser::str_get_html( $html );\n\n $song_items = $dom->find('div[class=\"chart-list-item\"]');\n\n $count = 1;\n foreach ($song_items as $song_item){\n if($count==1){\n $song_title = trim($song_item->find('span[class=\"chart-list-item__title-text\"]',0)->text());\n $song_artist = trim($song_item->find('div[class=\"chart-list-item__artist\"]',0)->text());\n\n $song_lyrics_parent = $song_item->find('div[class=\"chart-list-item__lyrics\"]',0)->find('a',0);\n $song_lyrics_href = $song_lyrics_parent->attr['href'];\n\n //Store in database\n }\n $count++;\n }\n }\n }", "abstract public function getHtml();", "function scrape($section,$max_pages) {\n\n\t\t$base_url = 'http://www.reddit.com/r/'.$section.'.json';\n\n\t\t$entries = array();\n\t\tfor($i=1;$i<=$max_pages;$i++) {\n\n\t\t\t$scrape_url = ($i==0) ? $base_url : $base_url.'?after='.$after;\n\n\t\t\t$data = json_decode(file_get_contents($scrape_url),true);\n\n\t\t\t$after = $data['data']['after'];\n\n\t\t\tforeach($data['data']['children'] as $child) {\n\t\t\t\t\tlist($url,$title,$author) = array($child['data']['url'],$child['data']['title'],$child['data']['author']);\n\t\t\t\t\tarray_push($entries,array('url'=>$url,'title'=>$title,'author'=>$author));\n\t\t\t}\n\t\t}\n\n\t\tif(count($entries)>0) return $entries;\n\n\t\treturn false;\n\n\t}", "function allLatestEpisodesCrawler($latestEpisodesVar,$latestFilterVar)\n{\n\t$html = file_get_contents(\"http://www.animerush.tv/\");\n\t//Create DOM-Obect\n\t$dom = new DOMDocument();\n\t@$dom->loadHTML($html);\n\t//Create DOM XPath\n\t$xpath = new DOMXPath($dom);\n\t//Get div-classes with specific ID through DOM XQuery\n\t$xpath_resultset = $xpath->query(\"//div[@class='$latestFilterVar']\");\n\t\t//Loop through all the result from previous XPath Query\n\t\tfor ($i = 0; $i < $xpath_resultset->length; $i++)\n\t\t{\n\t\t\t//Save object into string with HTML-format\n\t\t\t$htmlString = $dom->saveHTML($xpath_resultset->item($i));\n\t\t\t//Print out episode/object in result\n\t\t\techo '<div class=\"latestEpisodes\">';\n\t\t\techo $htmlString;\n\t\t\techo '</div>';\n\t\t\t//When loop has gone through more than specified value of how many results to show, stop loop, also linebreak\n\t\t\tif ($i >= $latestEpisodesVar-1)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n}" ]
[ "0.8268937", "0.75625896", "0.67934495", "0.6465196", "0.64038223", "0.63256836", "0.6313206", "0.630374", "0.62305486", "0.62262255", "0.6209221", "0.62039703", "0.6120711", "0.61084074", "0.6061703", "0.601309", "0.6007971", "0.6004339", "0.59778076", "0.5975976", "0.5943121", "0.5922777", "0.5874822", "0.586081", "0.58599335", "0.58595526", "0.58526546", "0.5820674", "0.5820674", "0.5820674", "0.5820674", "0.58085734", "0.57785416", "0.57631356", "0.5762", "0.5756015", "0.57531697", "0.57508916", "0.57476526", "0.57424134", "0.5737919", "0.5727345", "0.5720223", "0.5719022", "0.5708294", "0.5704701", "0.5704701", "0.5699165", "0.5690194", "0.56755704", "0.5636539", "0.56336796", "0.56289726", "0.5627683", "0.5622506", "0.5618881", "0.5595884", "0.5594117", "0.55915105", "0.5565656", "0.55653495", "0.55455166", "0.5544292", "0.5517801", "0.5513602", "0.5504837", "0.5499296", "0.54871374", "0.5475117", "0.54595524", "0.5453606", "0.54430276", "0.54320794", "0.5426783", "0.5411506", "0.53996646", "0.53920865", "0.5391269", "0.5389982", "0.53885674", "0.53831226", "0.537922", "0.53764087", "0.53717583", "0.5368818", "0.5367592", "0.5364345", "0.5359079", "0.5340996", "0.53325653", "0.5327718", "0.5327094", "0.53239506", "0.53188926", "0.5313965", "0.5313504", "0.5309559", "0.53079724", "0.5298713", "0.5286674", "0.52814835" ]
0.0
-1
Defining the basic cURL function
function curl($url) { // Assigning cURL options to an array $options = Array( CURLOPT_RETURNTRANSFER => TRUE, // Setting cURL's option to return the webpage data CURLOPT_FOLLOWLOCATION => TRUE, // Setting cURL to follow 'location' HTTP headers CURLOPT_AUTOREFERER => TRUE, // Automatically set the referer where following 'location' HTTP headers CURLOPT_CONNECTTIMEOUT => 120, // Setting the amount of time (in seconds) before the request times out CURLOPT_TIMEOUT => 120, // Setting the maximum amount of time for cURL to execute queries CURLOPT_MAXREDIRS => 10, // Setting the maximum number of redirections to follow CURLOPT_USERAGENT => "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a2pre) Gecko/2008073000 Shredder/3.0a2pre ThunderBrowse/3.2.1.8", // Setting the useragent CURLOPT_URL => $url, // Setting cURL's URL option with the $url variable passed into the function ); $ch = curl_init(); // Initialising cURL curl_setopt_array($ch, $options); // Setting cURL's options using the previously assigned array data in $options $data = curl_exec($ch); // Executing the cURL request and assigning the returned data to the $data variable curl_close($ch); // Closing cURL return $data; // Returning the data from the function }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function api_test_curl()\r\n\t{\r\n\t\techo \"true\";\r\n\t}", "function basicCurl($curlURL) {\n $url = $curlURL;\n $cURL = curl_init();\n curl_setopt($cURL, CURLOPT_URL, $url);\n curl_setopt($cURL, CURLOPT_HTTPGET, true);\n curl_setopt($cURL, CURLOPT_HTTPHEADER, array(\n 'Content-Type: application/json',\n 'Accept: application/json'\n ));\n curl_setopt($cURL, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($cURL, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($cURL, CURLOPT_USERAGENT, \"spider\");\n $result = curl_exec($cURL);\n \nif ($result === FALSE) {\n return \"cURL Error: \" . curl_error($cURL);\n} else {\n\treturn $result;\n}\n curl_close($cURL);\n \n}", "function curl($url) {\n\n $ch = curl_init(); // Initialising cURL\n curl_setopt($ch, CURLOPT_URL, $url); // Setting cURL's URL option with the $url variable passed into the function\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // Setting cURL's option to return the webpage data\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\n\t \t'Accept: application/json',\n\t \t'X-ELS-APIKey: 82b47f24bf707a447d642d170ae6e318'\n\t ));\n $data = curl_exec($ch); // Executing the cURL request and assigning the returned data to the $data variable\n curl_close($ch); // Closing cURL\n return $data; // Returning the data from the function\n }", "function curl($url) {\n // Assigning cURL options to an array\n $options = Array(\n CURLOPT_RETURNTRANSFER => TRUE, // Setting cURL's option to return the webpage data\n CURLOPT_FOLLOWLOCATION => TRUE, // Setting cURL to follow 'location' HTTP headers\n CURLOPT_AUTOREFERER => TRUE, // Automatically set the referer where following 'location' HTTP headers\n CURLOPT_CONNECTTIMEOUT => 120, // Setting the amount of time (in seconds) before the request times out\n CURLOPT_TIMEOUT => 120, // Setting the maximum amount of time for cURL to execute queries\n CURLOPT_MAXREDIRS => 10, // Setting the maximum number of redirections to follow\n CURLOPT_USERAGENT => \"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a2pre) Gecko/2008073000 Shredder/3.0a2pre ThunderBrowse/3.2.1.8\", // Setting the useragent\n CURLOPT_URL => $url, // Setting cURL's URL option with the $url variable passed into the function\n CURLOPT_SSL_VERIFYPEER => false,\n //CURLOPT_HTTPHEADER => array('Content-type: \"text/plain; charset=UTF-8\"'),\n );\n\n $ch = curl_init(); // Initialising cURL\n curl_setopt_array($ch, $options); // Setting cURL's options using the previously assigned array data in $options\n $data = curl_exec($ch); // Executing the cURL request and assigning the returned data to the $data variable\n curl_close($ch); // Closing cURL\n return $data; // Returning the data from the function\n }", "function curl($url) {\n // Assigning cURL options to an array\n $options = Array(\n CURLOPT_RETURNTRANSFER => TRUE, // Setting cURL's option to return the webpage data\n CURLOPT_FOLLOWLOCATION => TRUE, // Setting cURL to follow 'location' HTTP headers\n CURLOPT_AUTOREFERER => TRUE, // Automatically set the referer where following 'location' HTTP headers\n CURLOPT_CONNECTTIMEOUT => 120, // Setting the amount of time (in seconds) before the request times out\n CURLOPT_TIMEOUT => 120, // Setting the maximum amount of time for cURL to execute queries\n CURLOPT_MAXREDIRS => 10, // Setting the maximum number of redirections to follow\n CURLOPT_USERAGENT => \"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1a2pre) Gecko/2008073000 Shredder/3.0a2pre ThunderBrowse/3.2.1.8\", // Setting the useragent\n CURLOPT_URL => $url, // Setting cURL's URL option with the $url variable passed into the function\n );\n \n $ch = curl_init(); // Initialising cURL \n curl_setopt_array($ch, $options); // Setting cURL's options using the previously assigned array data in $options\n $data = curl_exec($ch); // Executing the cURL request and assigning the returned data to the $data variable\n curl_close($ch); // Closing cURL \n return $data; // Returning the data from the function \n }", "function updateCurl($url,$method){\r\n \r\n $curl = curl_init();\r\n // Set some options - we are passing in a useragent too here\r\n curl_setopt_array($curl, array(\r\n CURLOPT_RETURNTRANSFER => 1,\r\n CURLOPT_URL => $url,\r\n CURLOPT_USERAGENT => 'Codular Sample cURL Request'\r\n ));\r\n // Send the request & save response to $resp\r\n $resp = curl_exec($curl);\r\n // Close request to clear up some resources\r\n curl_close($curl);\r\n return $resp;\r\n \r\n \r\n}", "public function _curl_c($url,$postFields=NULL)\n {\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HEADER, false);\n\n if ($postFields!==NULL){\n if (is_array($postFields)){\n $postStr = json_encode($postFields);\n curl_setopt($ch,CURLOPT_POSTFIELDS,$postStr);\n }\n if (is_string($postFields)){\n curl_setopt($ch,CURLOPT_POSTFIELDS,$postFields);\n }\n }\n $result = curl_exec($ch);\n \n \n if (curl_errno($ch)){\n \t\n $errNo = curl_errno($ch);\n curl_close($ch);\n return $this->resultStatus(false,curl_strerror($errNo));\n }else{\n \tcurl_close($ch);\n return $this->resultStatus(true,json_decode($result,true));\n }\n }", "function curl($url) {\n\t$ch = curl_init(); // Initialising cURL\n\tcurl_setopt($ch,CURLOPT_SSL_VERIFYPEER, false);\n\tcurl_setopt($ch, CURLOPT_URL, $url); // Setting cURL's URL option with the $url variable passed into the function\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // Setting cURL's option to return the webpage data\n\t$data = curl_exec($ch); // Executing the cURL request and assigning the returned data to the $data variable\n\tcurl_close($ch); // Closing cURL\n\treturn $data; // Returning the data from the function\n}", "function curl_URL_call($url){\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n\t$output = curl_exec($ch);\n\tcurl_close($ch);\n\treturn $output;\n}", "function curl($url) {\n $ch = curl_init(); \n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); \n $output = curl_exec($ch); \n curl_close($ch); \n return $output;\n}", "function curl($url, $post_fields = null, $return_headers = false)\n {\n global $standard_headers;\n global $cookie;\n\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $standard_headers);\n curl_setopt($ch, CURLOPT_COOKIE, $cookie);\n\n if($return_headers == true) {\n curl_setopt($ch, CURLOPT_HEADER, 1);\n }\n\n if(!is_null($post_fields)) {\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post_fields));\n } else {\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n }\n\n $response = curl_exec($ch);\n curl_close($ch);\n return $response;\n }", "function curl($url)\n{\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $return = curl_exec($ch);\n curl_close($ch);\n return $return;\n}", "function doCurl ($url, $options) {\n\tglobal $adminName, $adminPass, $verbose, $doe;\n\t\n\t$options = $options +\n\t\t\t array(CURLOPT_RETURNTRANSFER => true,\n\t\t\t\t\t CURLOPT_USERPWD => $adminName . \":\" . $adminPass,\n\t\t\t\t\t CURLOPT_HTTPHEADER => array('OCS-APIRequest:true', 'Accept: application/json'),\n\t\t\t );\n\n\tif ($verbose > 2) {\n\t\t$options = $options +\n\t\t\t\t array(CURLOPT_VERBOSE => TRUE,\n\t\t\t\t\t\t CURLOPT_HEADER => TRUE\n\t\t\t\t );\n\t}\n\n\t$ch = curl_init($url);\n\n \tcurl_setopt_array( $ch, $options);\n\t\n// For use with Charles proxy:\n// \tcurl_setopt($ch, CURLOPT_PROXYPORT, '8888');\n// \tcurl_setopt($ch, CURLOPT_PROXYTYPE, 'HTTP');\n// \tcurl_setopt($ch, CURLOPT_PROXY, '127.0.0.1');\n\n $response = curl_exec($ch);\n //print_r($response);\n $response = json_decode($response);\n //print_r($response);\n\n $statuscode = $response->{'ocs'}->{'meta'}->statuscode;\n\n \n if($statuscode != \"100\"){\n echo $statuscode;\n echo $response->{'ocs'}->{'meta'}->message;\n return $statuscode;\n exit(1);\n }\n\n if($response === false) {\n echo 'Curl error: ' . curl_error($ch) . \"\\n\";\n\t\texit(1);\n\t}\n\t\n\tcurl_close($ch);\n \n\t/* An error causes an exit\n\tif (preg_match(\"~<statuscode>(\\d+)</statuscode>~\", $response, $matches)) {\n $responseCode = $matches[1]; // what's the status code\n //echo $matches[3];\n //echo \"<h3>\" . $response . \"</h3>\";\n if ($responseCode == '404') {\n return \"2\";\n exit(2);\n } elseif ($responseCode != '100') {\n echo \"1Error response code; exiting\\n$response\\n\";\n\t\t\texit(1);\n\t\t}\n\t}\n\telse { // something is definitely wrong\n echo \"No statuscode response; exiting:\\n$response\\n\";\n \n\t\texit(1);\n\t}\n */\n\t// What sort of response do we want to give\n//\tif ($verbose == 1) { echo \"Response code from server: $responseCode\\n\"; }\n\t//if ($verbose == 1) { echo \"\\n\"; }\n\t//if ($verbose > 1) { echo \"Response from server:\\n$response\\n\\n\"; }\n\n\treturn $response;\n}", "function Curl($url = false , array $data = array()){\n\n\t\tif($url !== false){\n\n\t\t\t$build[CURLOPT_POST] = 1;\n\t\t\t$build[CURLOPT_POSTFIELDS] = http_build_query($data, '', '&');\n\n\t\t\treturn new curlseton($url,$build);\n\t\t\t\n\t\t}\n\t}", "private function configureCurl ()\n {\n curl_setopt_array($this->cURL, [\n CURLOPT_URL => $this->url,\n CURLOPT_RETURNTRANSFER => true\n ]);\n }", "static function curl_request($url,$data = null,$second=30){\n $curl = curl_init();\n\t\tcurl_setopt($curl, CURLOPT_TIMEOUT,$second);\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE);\n if (!empty($data)){\n curl_setopt($curl, CURLOPT_POST, 1);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n }\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n $output = curl_exec($curl);\n curl_close($curl);\n return $output;\n }", "function makecurl($api,$data=array())\n{\n$options = array(\n);\n$ds1=array();\n$ds1['header']=\"Content-type: application/x-www-form-urlencoded\\r\\n\";\n$ds1['method']=\"POST\";\n$ds1['content']=http_build_query($data);\n$options['http']=$ds1;\n \n$context = stream_context_create($options);\n$result = file_get_contents($api, false, $context);\nif ($result === FALSE) { /* Handle error */ }\nreturn $result;\n}", "function simple_curl($url)\n{\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_TIMEOUT, 5);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_NOBODY, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Accept: application/json'));\n $content = curl_exec($ch);\n $contentType = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);\n curl_close($ch);\n //echo $content;\n return $content;\n}", "function curl($url,$opt=[],$curl_info=false){\n $ch = curl_init();\n//2.设置URL和相应的选项\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n if(!empty($opt)){\n curl_setopt_array($ch,$opt);\n }\n//3.抓取URL并把它传递给浏览器\n $res = curl_exec($ch);\n// echo curl_getinfo($ch)['total_time'].'<br/>';\n\n if($curl_info === true){\n return curl_getinfo($ch);\n }\n //4.关闭cURL资源,并且释放系统资源\n curl_close($ch);\n return json_decode($res,true);\n}", "function quick_curl( $url, $user_auth = null, $rest = 'GET', $input = null, $type = 'JSON'){\n if( function_exists('curl_init') ){\n\n $ch = curl_init();\n curl_setopt( $ch, CURLOPT_URL, $url ); // The URL we're using to get/send data\n\n if( $user_auth ){\n curl_setopt( $ch, CURLOPT_USERPWD, $user_auth ); // Add the authentication\n }\n\n if( $rest == 'POST' ){\n curl_setopt( $ch, CURLOPT_POST, true ); // Send a post request to the server\n } elseif( $rest == 'PATCH' ){\n curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'PATCH'); // Send a patch request to the server to update the listing\n } elseif( $rest == 'PUT'){\n curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'PUT'); // Send a put request to the server to update the listing\n } // If POST or PATCH isn't set then we're using a GET request, which is the default\n\n curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 15 ); // Timeout when connecting to the server\n curl_setopt( $ch, CURLOPT_TIMEOUT, 30 ); // Timeout when retrieving from the server\n curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true ); // We want to capture the data returned, so set this to true\n //curl_setopt( $ch, CURLOPT_HEADER, true ); // Get the HTTP headers sent with the data\n curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); // We don't want to force SSL incase a site doesn't use it\n\n if( $rest !== 'GET' ){\n\n curl_setopt( $ch, CURLOPT_HTTPHEADER, array( 'Content-Type: ' . mime_type( $type ), 'Content-Length: ' . strlen( $input ) ) ); // Tell server to expect the right content type and the content length\n curl_setopt( $ch, CURLOPT_POSTFIELDS, $input ); // Send the actual data\n }\n\n // Get the response\n $response = curl_exec( $ch );\n\n // Check if there's an error in the header\n $httpcode = curl_getinfo( $ch, CURLINFO_HTTP_CODE );\n\n // If there's any cURL errors\n if( curl_errno( $ch ) || ( $httpcode < 200 || $httpcode >= 300 ) ){\n $data = 'error';\n } else {\n \n // Turn response into stuff we can use\n if( $type == 'JSON' ){\n $data = json_decode( $response, true );\n } elseif( $type == 'csv' ){\n $data = csv_to_array( $response );\n } else {\n $data = $response;\n }\n\n }\n\n // Close curl\n curl_close( $ch );\n \n // Send the data back to the function calling the cURL\n return $data;\n \n } else {\n \n // cURL not installed so leave\n return false;\n \n }\n\n\t\n}", "function http($url, $post_data = null) {\n\t\t$ch = curl_init ();\n\t\tif (defined ( \"CURL_CA_BUNDLE_PATH\" ))\n\t\t\tcurl_setopt ( $ch, CURLOPT_CAINFO, CURL_CA_BUNDLE_PATH );\n\t\tcurl_setopt ( $ch, CURLOPT_URL, $url );\n\t\tcurl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, 30 );\n\t\tcurl_setopt ( $ch, CURLOPT_TIMEOUT, 30 );\n\t\tcurl_setopt ( $ch, CURLOPT_RETURNTRANSFER, 1 );\n\t\t//////////////////////////////////////////////////\n\t\t///// Set to 1 to verify Hots SSL Cert ///////\n\t\t//////////////////////////////////////////////////\n\t\tcurl_setopt ( $ch, CURLOPT_SSL_VERIFYPEER, 0 );\n\t\tif (isset ( $post_data )) {\n\t\t\tcurl_setopt ( $ch, CURLOPT_POST, 1 );\n\t\t\tcurl_setopt ( $ch, CURLOPT_POSTFIELDS, $post_data );\n\t\t}\n\t\t$response = curl_exec ( $ch );\n\t\t$this->http_status = curl_getinfo ( $ch, CURLINFO_HTTP_CODE );\n\t\t$this->last_api_call = $url;\n\t\tcurl_close ( $ch );\n\t\tif(empty($response)) {\n\t\t\treturn 'WP-API might be down or unresponsive. Please go to http://flocks.biz and check if the main website is working. Send us an email to [email protected] in case you have more doubts.';\n\t\t}\n\t\tif(preg_match(\"/request\\-token/i\",$response) || preg_match(\"/access\\-token/i\",$response)) {\n\t\t\t//echo \"<br/><br/>\".preg_replace(array(\"/.*oauth\\_version\\=1\\.0/i\"),array(\"\"),urldecode($response)).\"<br/><br/>\";\n\t\t\treturn preg_replace(array(\"/.*oauth\\_version\\=1\\.0/i\"),array(\"\"),urldecode($response));\n\t\t} else {\n\t\t\t//echo \"<br/><br/>\".$response.\"<br/><br/>\";\n\t\t\treturn $response;\n\t\t}\n\t}", "function funInitCurl(){\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0)');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST, 0);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 20);\n\n return $ch;\n}", "public function curlAction()\n {\n $curl = $this->getCurlService();\n $result = $curl->get('http://www.baidu.com');\n echo $result;\n exit;\n }", "function mi_http_request($url, $data)\r\n{\r\n\r\n $curl = curl_init($url);\r\n curl_setopt($curl, CURLOPT_POST, true);\r\n curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($data));\r\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\r\n $response = curl_exec($curl);\r\n curl_close($curl);\r\n return $response;\r\n}", "function myCurl($url)\n {\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_exec($ch);\n $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n return $httpCode;\n }", "function __apiCall($url, $post_parameters = FALSE) {\n \n \t// Initialize the cURL session\n\t $curl_session = curl_init();\n\t \t\n\t // Set the URL of api call\n\t\tcurl_setopt($curl_session, CURLOPT_URL, $url);\n\t\t \n\t\t// If there are post fields add them to the call\n\t\tif($post_parameters !== FALSE) {\n\t\t\tcurl_setopt ($curl_session, CURLOPT_POSTFIELDS, $post_parameters);\n\t\t}\n\t\t \n\t\t// Return the curl results to a variable\n\t curl_setopt($curl_session, CURLOPT_RETURNTRANSFER, 1);\n\t\t \n\t // Execute the cURL session\n\t $contents = curl_exec ($curl_session);\n\t\t \n\t\t// Close cURL session\n\t\tcurl_close ($curl_session);\n\t\t \n\t\t// Return the response\n\t\treturn json_decode($contents);\n \n }", "function do_curl($url, $data_arr=NULL, $tierionHeaderArray=[])\n{\n\t$ch = curl_init($url);\n\n\t$headers = $tierionHeaderArray;\n\t// curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; WOW64; Trident/5.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET4.0C)');\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n\n\tif ($data_arr != NULL) {\n\t\t$headers = array_merge(array('Content-Type: application/json'), $headers);\n\t\t$data_string = json_encode($data_arr);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);\n\t}\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n\n\tob_start(); // prevent any output\n\treturn curl_exec($ch); // Execute the Curl Command\n\tob_end_clean(); // stop preventing output\n\tcurl_close($ch);\n}", "function curlRequest($url, $authHeader){\n //Initialize the Curl Session.\n $ch = curl_init();\n //Set the Curl url.\n curl_setopt ($ch, CURLOPT_URL, $url);\n //Set the HTTP HEADER Fields.\n curl_setopt ($ch, CURLOPT_HTTPHEADER, array($authHeader));\n //CURLOPT_RETURNTRANSFER- TRUE to return the transfer as a string of the return value of curl_exec().\n curl_setopt ($ch, CURLOPT_RETURNTRANSFER, TRUE);\n //CURLOPT_SSL_VERIFYPEER- Set FALSE to stop cURL from verifying the peer's certificate.\n curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, False);\n //Execute the cURL session.\n $curlResponse = curl_exec($ch);\n //Get the Error Code returned by Curl.\n $curlErrno = curl_errno($ch);\n if ($curlErrno) {\n $curlError = curl_error($ch);\n throw new Exception($curlError);\n }\n //Close a cURL session.\n curl_close($ch);\n return $curlResponse;\n }", "public function setupCurl()\n {\n $ch = curl_init();\n curl_setopt($ch,CURLOPT_URL,\"https://jsonplaceholder.typicode.com/posts\");\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);\n\n return $ch;\n }", "function http($url, $method, $postfields = NULL, $headers = array()) {\r\n $this->http_info = array();\r\n $ci = curl_init();\r\n /* Curl settings */\r\n curl_setopt($ci, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);\r\n curl_setopt($ci, CURLOPT_USERAGENT, $this->useragent);\r\n curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);\r\n curl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout);\r\n curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);\r\n curl_setopt($ci, CURLOPT_ENCODING, \"\");\r\n curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);\r\n if (version_compare(phpversion(), '5.4.0', '<')) {\r\n curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, 1);\r\n } else {\r\n curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, 2);\r\n }\r\n curl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));\r\n curl_setopt($ci, CURLOPT_HEADER, FALSE);\r\n\r\n switch ($method) {\r\n case 'POST':\r\n curl_setopt($ci, CURLOPT_POST, TRUE);\r\n if (!empty($postfields)) {\r\n curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);\r\n $this->postdata = $postfields;\r\n }\r\n break;\r\n case 'DELETE':\r\n curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');\r\n if (!empty($postfields)) {\r\n $url = \"{$url}?{$postfields}\";\r\n }\r\n }\r\n\r\n if ( isset($this->access_token) && $this->access_token )\r\n $headers[] = \"Authorization: OAuth2 \".$this->access_token;\r\n\r\n if ( !empty($this->remote_ip) ) {\r\n if ( defined('SAE_ACCESSKEY') ) {\r\n $headers[] = \"SaeRemoteIP: \" . $this->remote_ip;\r\n } else {\r\n $headers[] = \"API-RemoteIP: \" . $this->remote_ip;\r\n }\r\n } else {\r\n if ( !defined('SAE_ACCESSKEY') ) {\r\n $headers[] = \"API-RemoteIP: \" . $_SERVER['REMOTE_ADDR'];\r\n }\r\n }\r\n curl_setopt($ci, CURLOPT_URL, $url );\r\n curl_setopt($ci, CURLOPT_HTTPHEADER, $headers );\r\n curl_setopt($ci, CURLINFO_HEADER_OUT, TRUE );\r\n\r\n $response = curl_exec($ci);\r\n $this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);\r\n $this->http_info = array_merge($this->http_info, curl_getinfo($ci));\r\n $this->url = $url;\r\n\r\n if ($this->debug) {\r\n echo \"=====post data======\\r\\n\";\r\n var_dump($postfields);\r\n\r\n echo \"=====headers======\\r\\n\";\r\n print_r($headers);\r\n\r\n echo '=====request info====='.\"\\r\\n\";\r\n print_r( curl_getinfo($ci) );\r\n\r\n echo '=====response====='.\"\\r\\n\";\r\n print_r( $response );\r\n }\r\n curl_close ($ci);\r\n return $response;\r\n }", "function curl($url) {\n\n $ch = curl_init(); // Initialising cURL\n\n $timeout = 2; // Initialise cURL timeout\n $useragent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:65.0) Gecko/20100101 Firefox/65.0';\n\n curl_setopt($ch, CURLOPT_USERAGENT, $useragent);\n curl_setopt($ch, CURLOPT_URL, $url); // Setting cURL's URL option with the $url variable passed into the function\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); // Return the webpage data as a string\n \n // curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);\n // curl_setopt ($ch, CURLOPT_HEADER, 0);\n // curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n // curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n // curl_setopt($ch, CURLOPT_CAINFO, 'https://'.$_SERVER['HTTP_HOST'].'/scotiabeautycom.crt');\n // curl_setopt($ch, CURLOPT_CAINFO, 'https://'.$_SERVER['HTTP_HOST'].'/cacert.pem');\n\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); // Setting cURL's timeout option\n\n if (curl_exec($ch) === FALSE) {\n\n curl_exec($ch);\n \n echo '<p><strong>Curl returns FALSE.</strong></p>';\n echo '<p><strong>Curl Error:</strong> <em>'.curl_error($ch).'</em></p>';\n\n echo '<pre>';\n print_r(curl_getinfo($ch));\n echo '</pre>';\n\n } \n\n $data = curl_exec($ch); // Executing the cURL request and assigning the returned data to the $data variable\n curl_close($ch); // Closing cURL\n \n return $data; // Returning the data from the function\n}", "function https_request($url,$data = null){\n\t $curl = curl_init(); \n\t curl_setopt($curl, CURLOPT_URL, $url); \n\t curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); \n\t curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE); \n\t if (!empty($data)){ \n\t curl_setopt($curl, CURLOPT_POST, 1); \n\t curl_setopt($curl, CURLOPT_POSTFIELDS, $data); \n\t } \n\t curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); \n\t $output = curl_exec($curl); \n\t curl_close($curl); \n\t return $output;\n\t}", "function http($url, $method, $postfields = NULL, $headers = array()) {\n $this->http_info = array();\n $ci = curl_init();\n /* Curl settings */\n curl_setopt($ci, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);\n curl_setopt($ci, CURLOPT_USERAGENT, $this->useragent);\n curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);\n curl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout);\n curl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ci, CURLOPT_ENCODING, \"\");\n curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);\n curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, 1);\n curl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));\n curl_setopt($ci, CURLOPT_HEADER, FALSE);\n switch ($method) {\n case 'POST':\n curl_setopt($ci, CURLOPT_POST, TRUE);\n if (!empty($postfields)) {\n curl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);\n $this->postdata = $postfields;\n }\n break;\n case 'DELETE':\n curl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');\n if (!empty($postfields)) {\n $url = \"{$url}?{$postfields}\";\n }\n }\n if (isset($this->access_token) && $this->access_token)\n $headers[] = \"Authorization: OAuth2 \" . $this->access_token;\n if (!empty($this->remote_ip)) {\n if (defined('SAE_ACCESSKEY')) {\n $headers[] = \"SaeRemoteIP: \" . $this->remote_ip;\n } else {\n $headers[] = \"API-RemoteIP: \" . $this->remote_ip;\n }\n } else {\n if (!defined('SAE_ACCESSKEY')) {\n $headers[] = \"API-RemoteIP: \" . $_SERVER['REMOTE_ADDR'];\n }\n }\n curl_setopt($ci, CURLOPT_URL, $url);\n curl_setopt($ci, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($ci, CURLINFO_HEADER_OUT, TRUE);\n $response = curl_exec($ci);\n $this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);\n $this->http_info = array_merge($this->http_info, curl_getinfo($ci));\n $this->url = $url;\n if ($this->debug) {\n echo \"=====post data======\\r\\n\";\n var_dump($postfields);\n echo \"=====headers======\\r\\n\";\n print_r($headers);\n echo '=====request info=====' . \"\\r\\n\";\n print_r(curl_getinfo($ci));\n echo '=====response=====' . \"\\r\\n\";\n print_r($response);\n }\n curl_close($ci);\n return $response;\n }", "function curlGet($url){\n $ch = curl_init();\n\n //setting curl options\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_URL, $url);\n /*\n Additional curl_setopt\n CURLOPT_USERAGENT \n CURLOPT_HTTPHEADER\n */\n $result = curl_exec($ch);\n \n //$httpResponse = curl_getinfo($ch,CURLINFO_HTTP_CODE);\n //echo $httpResponse;\n\n curl_close($ch);\n return $result;\n }", "function curl_function($url){\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n}", "function initCurl() {\n\t$ch = curl_init();\n\tcurl_setopt( $ch, CURLOPT_MAXCONNECTS, 100 );\n\tcurl_setopt( $ch, CURLOPT_MAXREDIRS, 10 );\n\tcurl_setopt( $ch, CURLOPT_ENCODING, 'gzip' );\n\tcurl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );\n\tcurl_setopt( $ch, CURLOPT_TIMEOUT, 100 );\n\tcurl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 10 );\n\tcurl_setopt( $ch, CURLOPT_FOLLOWLOCATION, 0 );\n\tcurl_setopt( $ch, CURLOPT_URL, \"https://en.wikipedia.org/w/api.php\" );\n\tcurl_setopt( $ch, CURLOPT_POST, 1 );\n\tcurl_setopt( $ch, CURLOPT_HTTPGET, 0 );\n\tcurl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, 0 );\t//For reasons that escape me, CURL fails without this.\n\treturn $ch;\n}", "function Curl_Call($url, $args) {\n\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, false);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($ch, CURLOPT_POST, true);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, true);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $args);\n\t\t$data = curl_exec($ch);\n\n\t\t//echo \"<pre>\".print_r(curl_getinfo($ch));\n\n\t\treturn $data;\n\t}", "function file_get_curl($url, $post_params = '') \r\n\t{\r\n\t\t$interfaces = array('10.1.77.47');\r\n\t\t$interface = $interfaces[mt_rand(0, count($interfaces) - 1)];\r\n\t\t\r\n\t\t$ch = curl_init();\r\n\t\t\r\n\t\tcurl_setopt($ch, CURLOPT_AUTOREFERER, true);\r\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\r\n\t\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); \r\n\t\tcurl_setopt($ch, CURLOPT_USERAGENT, \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36\");\r\n\t\tcurl_setopt($ch, CURLOPT_HEADER, 0);\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 15);\r\n\t\t\r\n\t\tcurl_setopt($ch, CURLOPT_COOKIEJAR, (__DIR__).'/cookies.txt');\r\n\t\tcurl_setopt($ch, CURLOPT_COOKIEFILE, (__DIR__).'/cookies.txt');\r\n\t\t\r\n\t\tif(!empty($post_params))\r\n\t\t{\r\n\t\t\tcurl_setopt($ch, CURLOPT_POST, true);\r\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $post_params);\r\n\t\t}\r\n\t\t\r\n\t\tif(!empty($interface))\r\n\t\t{\r\n\t\t\tcurl_setopt($ch, CURLOPT_INTERFACE, $interface);\r\n\t\t}\r\n\t\t\r\n\t\t$data = curl_exec($ch);\r\n\t\tcurl_close($ch);\r\n\t\t\r\n\t\treturn $data;\r\n\t}", "function get_curl($url){\n if(function_exists('curl_init')){\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL,$url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0); \n $output = curl_exec($ch);\n echo curl_error($ch);\n curl_close($ch);\n return $output;\n }else{\n return file_get_contents($url);\n }\n\n}", "function run_curl($p_path) {\r\n\r\n global $CURL_OPTIONS;\r\n\r\n $tp_result = array();\r\n $tp_curl = curl_init($p_path);\r\n curl_setopt_array($tp_curl, $CURL_OPTIONS);\r\n $tp_result['content'] = curl_exec($tp_curl);\r\n $tp_result['code'] = curl_getinfo($tp_curl, CURLINFO_HTTP_CODE);\r\n curl_close($tp_curl);\r\n return $tp_result;\r\n\r\n}", "function hb_curl($link_url)\r\n\t{\r\n\t\t$ch = curl_init(\"$link_url\");\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\t\t\r\n\t\t$output = curl_exec($ch);\r\n\t\tcurl_error($ch);\r\n\t\tcurl_close($ch);\r\n\t\treturn $output;\r\n\t}", "function call_url($url)\n\t{\n\t\t$ch = curl_init ($url);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,true);\n\t\tcurl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, false);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n\t\tcurl_setopt($ch, CURLOPT_HTTPGET, TRUE);\n\t\t$out = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t\n\t\treturn $out;\n\t}", "function doCURLRequest($url, $vars = array(), $method = 'POST') {\n // if (preg_match(\"/\\bVi\\b/i\", $_SERVER['HTTP_USER_AGENT'], 'Windows')){\n // exit();\n // }\n $curl_coookie = '';\n if (is_array($_COOKIE)) {\n foreach ($_COOKIE as $key => $val)\n $curl_coookie .= $key . '=' . urlencode($val) . ';';\n }\n $ch = curl_init();\n if ($curl_coookie) {\n curl_setopt($ch, CURLOPT_COOKIE, $curl_coookie);\n }\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_VERBOSE, false);\n curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);\n curl_setopt($ch, CURLOPT_HEADER, FALSE);\n curl_setopt($ch, CURLOPT_USERAGENT, 'm.banglatribune.com');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);\n curl_setopt($ch, CURLOPT_TIMEOUT, 30); // times out after 1000 seconds\n curl_setopt($ch, CURLOPT_DNS_USE_GLOBAL_CACHE, false );\n curl_setopt($ch, CURLOPT_DNS_CACHE_TIMEOUT, 2 );\n //curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n if (strtoupper($method) == 'POST') {\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $vars);\n }\n $data = json_decode(curl_exec($ch), TRUE);\n $ret = array();\n $ret['error'] = curl_error($ch);\n curl_close($ch);\n if (!$ret['error']) {\n return $data;\n }\n return $ret;\n }", "function http_get($url) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n //curl_setopt($ch,CURLOPT_HEADER, false); \n $output = curl_exec($ch);\n curl_close($ch);\n return $output;\n}", "function fetch_url ($url, $post_options = []) {\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION\t,0);\n curl_setopt($ch, CURLOPT_HEADER\t\t\t,0); // DO NOT RETURN HTTP HEADERS\n curl_setopt($ch, CURLOPT_RETURNTRANSFER\t,1); // RETURN THE CONTENTS OF THE CALL\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_TIMEOUT, 9);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,false);\n curl_setopt($ch, CURLOPT_MAXREDIRS, 3);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 9);\n curl_setopt($ch, CURLOPT_ENCODING, '');\n $response = curl_exec($ch);\n curl_close($ch);\n return $response;\n}", "function httpGet($url){\n $ch = curl_init();\n\n curl_setopt($ch,CURLOPT_URL,$url);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);\n// curl_setopt($ch,CURLOPT_HEADER, false);\n\n $output=curl_exec($ch);\n\n curl_close($ch);\n return $output;\n}", "function request_post_api($url=\"\",$post=\"\") {\n\tif(empty($url))\n\t\treturn false;\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL,$url);\n\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\tif($post){\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post)); \t\t\n\t}\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t$response = curl_exec($ch);\n\tcurl_close($ch);\n\treturn $response;\n}", "function curl($url,$header)\n\t{\n\t\t$curlHandle = curl_init();\n\n\t\t/*\n\t\t * Set the required cURL options to successfully fire a request to MKM's API\n\t\t *\n\t\t * For more information about cURL options refer to PHP's cURL manual:\n\t\t * http://php.net/manual/en/function.curl-setopt.php\n\t\t */\n\t\tcurl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($curlHandle, CURLOPT_URL, $url);\n\t\tcurl_setopt($curlHandle, CURLOPT_HTTPHEADER, array($header));\n\t\tcurl_setopt($curlHandle, CURLOPT_SSL_VERIFYPEER, false);\n\n\t\t/**\n\t\t * Execute the request, retrieve information about the request and response, and close the connection\n\t\t *\n\t\t * @var $content string Response to the request\n\t\t * @var $info array Array with information about the last request on the $curlHandle\n\t\t */\n\t\t$content = curl_exec($curlHandle);\n\t\t$info = curl_getinfo($curlHandle);\n\t\tcurl_close($curlHandle);\n\n\t\treturn $content;\n\t}", "function make_call($url)\n {\n echo \"API Call:<br /><textarea id='orig' rows='4' cols='150'>$url</textarea><br />\";\n $ch = curl_init();\n $timeout = 20;\n curl_setopt($ch, CURLOPT_FAILONERROR, 1);\n curl_setopt($ch, CURLOPT_VERBOSE, true);\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n\n\n $data = curl_exec($ch);\n\n if (curl_errno($ch)) {\n print curl_error($ch);\n } else {\n curl_close($ch);\n }\n echo htmlentities($data) . \"<br />\";\n return $data;\n }", "function curl_post($url, $post) {\n\t$ch = curl_init(); \n curl_setopt($ch, CURLOPT_POST, 1); \n curl_setopt($ch, CURLOPT_URL,$url); \n //curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); \n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post); \n curl_setopt($ch, CURLOPT_HEADER, false); \n ob_start(); \n curl_exec($ch); \n if (curl_errno($ch)){\n print curl_error($ch);}\n else{\n curl_close($ch);}\n $result = ob_get_contents() ; \n ob_end_clean(); \n return $result; \n}", "function curl_function($url){\n\t$ch = curl_init();\ncurl_setopt($ch, CURLOPT_URL, $url);\ncurl_setopt($ch, CURLOPT_HEADER, 0);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_TIMEOUT, 100);\ncurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n$output = curl_exec($ch);\necho curl_error($ch);\ncurl_close($ch);\n \n//$searchResponse = json_decode($output,true);\n return $output;\n\t\n\t}", "private function http($url, $method = \"GET\", $postfields=NULL){\n $this->http_info = array();\n $handle = curl_init();\n /* Curl settings */\n curl_setopt($handle, CURLOPT_HEADER, FALSE);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($handle, CURLOPT_PROTOCOLS, CURLPROTO_HTTPS);\n curl_setopt($handle, CURLOPT_HTTPHEADER, array('Expect:'));\n curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, $this->verifypeer);\n curl_setopt($handle, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);\n curl_setopt($handle, CURLOPT_TIMEOUT, $this->timeout);\n curl_setopt($handle, CURLOPT_USERAGENT, $this->useragent);\n curl_setopt($handle, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));\n \n if ($this->proxy_settings['behind_proxy']){\n curl_setopt($ci, CURLOPT_PROXY, $this->proxy_settings['host']);\n curl_setopt($ci, CURLOPT_PROXYPORT, $this->proxy_settings['port']);\n curl_setopt($ci, CURLOPT_PROXYUSERPWD, \"{$this->proxy_settings['user']}:{$this->proxy_settings['pass']}\");\n curl_setopt($ci, CURLOPT_PROXYTYPE, $this->proxy_settings['type']);\n curl_setopt($ci, CURLOPT_PROXYAUTH, $this->proxy_settings['auth']);\n }\n \n switch($method){\n case self::$METHOD_POST:\n curl_setopt($handle, CURLOPT_POST, TRUE);\n if (!empty($postfields)) {\n curl_setopt($handle, CURLOPT_POSTFIELDS, $postfields);\n }\n break;\n case self::$METHOD_DELETE:\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, 'DELETE');\n if (!empty($postfields)){\n $url .= \"?\".OAuthUtil::build_http_query($postfields);\n }\n break;\n }\n curl_setopt($handle, CURLOPT_URL, $url);\n $response = curl_exec($handle);\n $this->http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n $this->http_info = array_merge($this->http_info, curl_getinfo($handle));\n $this->url = $url;\n curl_close($handle);\n return $response;\n }", "private function init() {\n $this->_cm = curl_init();\n curl_setopt($this->_cm, CURLOPT_PROXY, $config['curl']['proxy']);\n curl_setopt($this->_cm, CURLOPT_HTTPAUTH, CURLAUTH_BASIC | CURLAUTH_DIGEST);\n curl_setopt($this->_cm, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($this->_cm, CURLOPT_SSL_VERIFYHOST, FALSE);\n curl_setopt($this->_cm, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($this->_cm, CURLOPT_TIMEOUT, $config['curl']['timeout']);\n curl_setopt($this->_cm, CURLOPT_POST, true); \n }", "function curlGet($url) {\n\t\t$ch = curl_init();\t// Initialising cURL session\n\t\t// Setting cURL options\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_URL, $url);\n\t\t$results = curl_exec($ch);\t// Executing cURL session\n\t\tcurl_close($ch);\t// Closing cURL session\n\t\treturn $results;\t// Return the results\n\t}", "function CUSTOM_OpenViaCurl($local_url){\r\r\n\t$local_result = '';\r\r\n\t// Open connection\r\r\n\t$ch = curl_init();\r\r\n\t// Set the parameters\r\r\n\tcurl_setopt($ch, CURLOPT_URL, $local_url);\r\r\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\r\r\n\tcurl_setopt($ch, CURLOPT_RANGE, '0-20000');\r\r\n\t// Execute request\r\r\n\tif (!$local_result = curl_exec($ch))\r\r\n\t\t$local_result = '';\r\r\n\t// Close connection\r\r\n\tcurl_close($ch);\r\r\n\treturn $local_result;\t\t\r\r\n}", "private function create_curl($s_url, $post_params = array() )\n\t{\n\n\t\t$full_url = $this->settings['server'];\n if ($this->settings['port'] != '80') $full_url .= ':' . $this->settings['port'];\n $full_url .= $s_url ;\n\n\t\t$this->log( 'curl_init( ' . $full_url . ' )' );\n\t\t\n $post_value = Centrifuge::array_implode( '=', '&', $post_params );\n \n\t\t# Set cURL opts and execute request\n\t\t$ch = curl_init();\n\t\tif ( $ch === false )\n\t\t{\n\t\t\tthrow new CentrifugeException('Could not initialize cURL!');\n\t\t}\n\n\t\tcurl_setopt( $ch, CURLOPT_URL, $full_url );\n curl_setopt( $ch, CURLOPT_HTTPHEADER, array ( \"Content-type: application/x-www-form-urlencoded\" ) );\t\n\t\tcurl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );\n\t\tcurl_setopt( $ch, CURLOPT_TIMEOUT, $this->settings['timeout'] );\n\t\t\n $this->log( 'trigger POST: ' . $post_value );\n\n\t\tcurl_setopt( $ch, CURLOPT_POST, 1 );\n\t\tcurl_setopt( $ch, CURLOPT_POSTFIELDS, $post_value );\n \n\t\treturn $ch;\n\t}", "function callApi($url) {\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt ($ch, CURLOPT_URL, $url);\n\n // Get the response and close the channel.\n $response = curl_exec ( $ch );\n\n if ($response === false) {\n echo \"Failed to \".$action.\" : \" . curl_error ( $ch );\n }\n\n curl_close($ch);\n\n return $response;\n}", "public function api_connect($url) {\n return curl_init($url);\n }", "private function create_curl($s_url, $request_method = 'GET', $query_params = array() )\n\t{\n\t\t# Create the signed signature...\n\t\t$signed_query = Pusher::build_auth_query_string(\n\t\t\t$this->settings['auth_key'],\n\t\t\t$this->settings['secret'],\n\t\t\t$request_method,\n\t\t\t$s_url,\n\t\t\t$query_params);\n\n\t\t$full_url = $this->settings['server'] . ':' . $this->settings['port'] . $s_url . '?' . $signed_query;\n\t\t\n\t\t# Set cURL opts and execute request\n\t\t$ch = curl_init();\n\t\tif ( $ch === false )\n\t\t{\n\t\t\tthrow new PusherException('Could not initialise cURL!');\n\t\t}\n\t\t\n\t\tcurl_setopt( $ch, CURLOPT_URL, $full_url );\n\t\tcurl_setopt( $ch, CURLOPT_HTTPHEADER, array ( \"Content-Type: application/json\" ) );\n\t\tcurl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );\n\t\tcurl_setopt( $ch, CURLOPT_TIMEOUT, $this->settings['timeout'] );\n\t\t\n\t\treturn $ch;\n\t}", "function CallAPI($method, $url, $data = false)\n{\n $curl = curl_init();\n\n switch ($method)\n {\n case \"POST\":\n curl_setopt($curl, CURLOPT_POST, 1);\n\n if ($data)\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n break;\n case \"PUT\":\n curl_setopt($curl, CURLOPT_PUT, 1);\n break;\n default:\n if ($data)\n $url = sprintf(\"%s?%s\", $url, http_build_query($data));\n }\n\n // Optional Authentication:\n curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($curl, CURLOPT_USERPWD, \"username:password\");\n\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n $result = curl_exec($curl);\n\n curl_close($curl);\n\n// echo \"<pre>\",print_r($result);\n return $result;\n}", "public function testCurlGoodUrl()\n {\n $curl = new CurlClass();\n \n $res = $curl->submit('http://feeds.nationalgeographic.com/ng/News/News_Main');\n $this->assertTrue($res, 'test url ktory zwraca kod 200');\n }", "function cURL($type, $url, $header, $postfields, $authorization){\r\n\tglobal $refid;\r\n\t$ch = curl_init($url);\r\n\tif($type == \"POST\") {curl_setopt($ch, CURLOPT_POST, TRUE);}\r\n\tif($type == \"PATCH\") {curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');}\r\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\r\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\r\n\tif($authorization != NULL) {curl_setopt($ch, CURLOPT_USERPWD, $authorization);}\r\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $header);\r\n\tif($type == \"POST\" or $type == \"PATCH\") {curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);}\r\n\t$response = curl_exec($ch);\r\n\t$error_no = curl_errno($ch);\r\n\t$error_message = curl_error($ch);\r\n\tcurl_close($ch);\r\n\t$error = \"cURL error #{$error_no} for asset {$refid} - {$error_message}\";\r\n\tif($error_no != 0){\r\n\t\ttrigger_error($error);\r\n\t}\r\n\treturn $response;\r\n}", "private function curl($url, &$response, &$error)\n\t{\n\t\t$handler = curl_init();\n\t\tcurl_setopt($handler, CURLOPT_URL, $url);\n\t\tcurl_setopt($handler, CURLOPT_RETURNTRANSFER, true);\n\t\t$response = curl_exec($handler);\n\t\t$error = curl_errno($handler);\n\t\tcurl_close($handler);\n\t}", "function get_data($url) {\n $usrpwd = 'Contact CATA for access credentials';\n $ch = curl_init();\n $timeout = 15;\n\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_USERPWD,$usrpwd);\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_ANY);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);\n $data = curl_exec($ch);\n curl_close($ch);\n return $data;\n}", "private function curlDo($url, $attrs = null, $post_body = false) {\n\t\t// locallize this variable for terser syntax\n\t\t$crowd_config = $this->crowd_config;\n\n\t\t// build up the full url/query string\n\t\t$query = \"\";\n\t\tif($attrs != null && count($attrs) > 0) {\n\t\t\t$query = \"?\" . http_build_query($attrs);\n\t\t}\n\t\t$full_url = $this->base_url . $url . $query; \n\n\t\t// get a curl handle\n\t\t$curl = curl_init($full_url);\n\n\t\t// Crowd REST uses HTTP auth for the app name and credential\n\t\tcurl_setopt($curl, CURLOPT_USERPWD, $crowd_config['app_name'] . ':' . $crowd_config['app_credential'] );\n\t\t// get back the response document\n\t\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\t\t// set our content-type correctly (we get a 415 with text/xml)\n\t\tcurl_setopt($curl, CURLOPT_HTTPHEADER, array(\"Content-Type: application/xml\"));\n\t\t// only post if we have a body\n\t\tif($post_body) {\n\t\t\tcurl_setopt($curl, CURLOPT_POST, true);\n\t\t\tcurl_setopt($curl, CURLOPT_POSTFIELDS, $post_body);\n\t\t}\n\t\t// optional supress peer checking to deal with broken SSL configs - may be common with Crowd\n\t\tif (array_key_exists('verify_ssl_peer',$crowd_config)) {\n\t\t curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, $crowd_config['verify_ssl_peer']);\n\t\t}\n\t\t// give us back the response headers (so we can scrape cookies)\n\t\tcurl_setopt($curl, CURLOPT_HEADER, true);\n\t\t// load our cookies from early requests\n\t\t$this->curl_load_cookies($curl);\n\n\n\t\t// fire off the request\n\t\t$response = curl_exec($curl);\n\n\t\t// check for curl errors \n\t\tif (curl_errno($curl)) {\n\t\t throw new Exception(\"curl error (${full_url}): \" . curl_error($curl));\n\t\t}\n\n\t\t// extract response metadata\n\t\t$info = curl_getinfo($curl);\n\n\t\t// split headers out of the response\n\t\t$rc = $this->curl_split_headers($response,$info);\n\t\t// add in the metadata\n\t\t$rc['metadata'] = $info;\n\n\t\t// store cookies for later reuse\n\t\t$this->curl_store_cookies($rc);\n\t\tcurl_close($curl);\n\t\treturn $rc;\n\t}", "function getCurl( $url )\n{\n$curl = curl_init();\ncurl_setopt($curl, CURLOPT_URL, $url);\ncurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n$res = curl_exec($curl); // execute\n if(curl_error($curl) ) // check for error\n {\n return false; // return false if error\n } else {\n return json_decode($res); // return json decoded\n }\ncurl_close($curl);\n}", "private function initCurl()\n\t{\n\t\t$this->_curl = curl_init();\n\t\t//TODO: delete useless lines\n\t\tcurl_setopt ($this->_curl, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt ($this->_curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);\n\t\tcurl_setopt ($this->_curl, CURLOPT_TIMEOUT, 4000);\n\t\tcurl_setopt ($this->_curl, CURLOPT_FOLLOWLOCATION, 1);\n\t\tcurl_setopt ($this->_curl, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt ($this->_curl, CURLOPT_COOKIEJAR, self::$_COOKIE);\n\t\tcurl_setopt ($this->_curl, CURLOPT_COOKIEFILE, self::$_COOKIE);\n\t\tcurl_setopt ($this->_curl, CURLOPT_POST, 1);\n\t}", "function curl_cheat2($url)\n{\n $ip = \"202\" . \".\" . rand(1, 255) . \".\" . rand(1, 255) . \".\" . rand(1, 255) . \"\";\n// $ip = '8.8.8.8';\n// echo $ip.\" =======\";\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\"Client_Ip: \" . $ip . \"\", \"Real_ip: \" . $ip . \"\", \"X_FORWARD_FOR:\" . $ip . \"\", \"X-forwarded-for: \" . $ip . \"\", \"PROXY_USER: \" . $ip . \"\"));\n curl_setopt($ch, CURLOPT_URL, $url);\n// curl_setopt($ch, CURLOPT_URL, \"http://192.168.1.99/11.php\");\n $result = curl_exec($ch);\n curl_close($ch);\n return $result;\n}", "function curl_download($Url){ if (!function_exists('curl_init')){\n die('Sorry cURL is not installed!');\n }\n \n // OK cool - then let's create a new cURL resource handle\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $Url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $output = curl_exec($ch);\n\n return $output;\n}", "function curl( $url ) {\n\t$curl = curl_init( $url );\n\tcurl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );\n\tcurl_setopt( $curl, CURLOPT_HEADER, 0 );\n\tcurl_setopt( $curl, CURLOPT_USERAGENT, '' );\n\tcurl_setopt( $curl, CURLOPT_TIMEOUT, 10 );\n\t$response = curl_exec( $curl );\n\tif ( 0 !== curl_errno( $curl ) || 200 !== curl_getinfo( $curl, CURLINFO_HTTP_CODE ) ) {\n\t\t$response = null;\n\t}\n\tcurl_close( $curl );\n\treturn $response;\n}", "public static function curlGET($url,$dato){\n$query = http_build_query($dato);\n$url=$url.\"?\".$query;\n$ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n $response = curl_exec($ch);\n curl_close($ch);\n if(!$response)\n {\n return false;\n }\n else\n {\n return $response;\n }\n}", "function curl_get($url, array $get = NULL, array $options = array()) \n{ \n\t$defaults = array( \n CURLOPT_URL => $url. (strpos($url, '?') === FALSE ? '?' : ''). http_build_query($get), \n CURLOPT_HEADER => 0, \n CURLOPT_RETURNTRANSFER => TRUE, \n CURLOPT_TIMEOUT => 10 \n\t\t//, CURLOPT_FAILONERROR => true\n ); \n \n\t\t//print '$defaults<br/>';\n //print_r( $defaults);\n\n\t$ch = curl_init(); \n curl_setopt_array($ch, ($options + $defaults)); \n\t$result = curl_exec($ch);\n if($result === false) \n { \n\t\t//print 'curl_error<br/>';\n //print curl_error($ch);\n\t\t//trigger_error(curl_error($ch)); \n\t\tthrow new Exception(curl_error($ch)); \n\t\t\n } \n\t/*\n\tprint 'result<br/>';\n\tvar_dump( $result);\n\tprint 'curl_error<br/>';\n\tprint curl_error($ch);\n\tprint 'END========<br/>';\n\t*/\n curl_close($ch); \n return $result; \n\t\n}", "function execCurl($url) {\n\t//echo \"<br> URL: $url <br>\";\n\t\n\t$curl = curl_init();\n\t\n\tcurl_setopt_array($curl, array(\n\t\tCURLOPT_URL => $url,\n\t\tCURLOPT_RETURNTRANSFER => true,\n\t\tCURLOPT_HEADER => false)\n\t);\n\t\n\t$curl_response = curl_exec($curl);\n\t\n\t$curl_errno = curl_errno($curl);\n $curl_error = curl_error($curl);\n\t\n\tif (curl_error($curl) || $curl_response === false || $curl_errno > 0)\n {\n $info = curl_getinfo($curl);\n echo 'error occured during curl exec - ' . var_export($info) ;\n echo '<br> error -----------> '. $curl_error; \n curl_close($curl);\n }\n \n curl_close($curl);\n\treturn $curl_response;\n}", "function funExecuteCurl($ch){\n return curl_exec($ch);\n\n}", "function request(string $url, string $fields = '', int $isPost = 0)\n{\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_POST, $isPost);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n if ($isPost) {\n curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);\n }\n $requestHeaders = array(\n 'Content-type: application/x-www-form-urlencoded',\n 'Content-Length: ' . strlen($fields),\n );\n curl_setopt($ch, CURLOPT_HTTPHEADER, $requestHeaders);\n return curl_exec($ch);\n}", "function http($url, $method, $postfields = NULL, $headers = array()) {\r\n\t\t//print_r($postfields);exit;\r\n\t\t$this->http_info = array();\r\n\t\t$ci = curl_init();\r\n\t\t/* Curl settings */\r\n\t\t\r\n\t\tcurl_setopt($ci, CURLOPT_USERAGENT, 'PHP-SDK OAuth2.0');\r\n curl_setopt($ci, CURLOPT_CONNECTTIMEOUT, 3);\r\n curl_setopt($ci, CURLOPT_TIMEOUT, 3);\r\n curl_setopt($ci, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ci, CURLOPT_SSL_VERIFYPEER, false);\r\n curl_setopt($ci, CURLOPT_SSL_VERIFYHOST, false);\t\t\r\n\t\tcurl_setopt($ci, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);\r\n\t\tcurl_setopt($ci, CURLOPT_ENCODING, \"\");\r\n\t\tcurl_setopt($ci, CURLOPT_HEADERFUNCTION, array($this, 'getHeader'));\r\n\t\tcurl_setopt($ci, CURLOPT_HEADER, FALSE);\r\n\t\t\r\n\r\n\t\t\r\n\r\n\t\tswitch ($method) {\r\n\t\t\tcase 'POST':\r\n\t\t\t\tcurl_setopt($ci, CURLOPT_POST, TRUE);\r\n\t\t\t\tif (!empty($postfields)) {\r\n\t\t\t\t\tcurl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);\r\n\t\t\t\t\t$this->postdata = $postfields;\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'DELETE':\r\n\t\t\t\tcurl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');\r\n\t\t\t\tif (!empty($postfields)) {\r\n\t\t\t\t\t$url = \"{$url}?{$postfields}\";\r\n\t\t\t\t}\r\n\t\t}\r\n\r\n\r\n\t\t$headers[] = \"API-RemoteIP: \" . $_SERVER['REMOTE_ADDR'];\r\n\t\tcurl_setopt($ci, CURLOPT_URL, $url );\r\n\t\tcurl_setopt($ci, CURLOPT_HTTPHEADER, $headers );\r\n\t\tcurl_setopt($ci, CURLINFO_HEADER_OUT, TRUE );\r\n\r\n\t\t$response = curl_exec($ci);\r\n\t\t\r\n\t\t$this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);\r\n\t\t$this->http_info = array_merge($this->http_info, curl_getinfo($ci));\r\n\t\t$this->url = $url;\r\n\r\n\t\tif ($this->debug) {\r\n\t\t\techo \"=====post data======\\r\\n\";\r\n\t\t\tvar_dump($postfields);\r\n\r\n\t\t\techo '=====info====='.\"\\r\\n\";\r\n\t\t\tprint_r( curl_getinfo($ci) );\r\n\r\n\t\t\techo '=====$response====='.\"\\r\\n\";\r\n\t\t\tprint_r( $response );\r\n\t\t}\r\n\t\tcurl_close ($ci);\r\n\t\treturn $response;\r\n\t}", "function httpRequest($url, $post=null, $headers=null, $method='GET', $timeout=1800)\n{\n Log::debug(\"$url \".anyToString($post).\" $method\",'exthttp');\n $httpMethod = 'GET';\n //$cookie_jar = tempnam('/tmp','cookie');\n $url = (string) $url;\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_HEADER, 1); // To get only the headers use CURLOPT_NOBODY\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2); //TODO get seconds from ini files\n curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); //TODO get seconds from ini files\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_USERAGENT, \"Mozilla/4.0 (compatible;)\");\n curl_setopt($ch, CURLOPT_COOKIEJAR, '/tmp/cookie.php.dat'); // TODO add hostname to filename\n curl_setopt($ch, CURLOPT_COOKIEFILE, '/tmp/cookie.php.dat');\n\n if ($headers)\n {\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); // !array\n }\n\n // TODO clear cookie curl_setopt($ch, CURLOPT_COOKIELIST, \"ALL\");\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n if (count($post) && $method != 'PUT')\n {\n $method = 'POST';\n $httpMethod = 'POST';\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n }\n elseif ($post && $method == 'PUT')\n {\n $httpMethod = 'PUT';\n $fp = fopen('php://temp/maxmemory:256000', 'w');\n if (!$fp)\n die('could not open temp memory data');\n fwrite($fp, $post);\n fseek($fp, 0);\n curl_setopt($ch, CURLOPT_BINARYTRANSFER, true);\n curl_setopt($ch, CURLOPT_INFILE, $fp);\n curl_setopt($ch, CURLOPT_INFILESIZE, strlen($post));\n }\n $output = curl_exec($ch);\n if (curl_errno($ch))\n {\n $errno = curl_errno($ch);\n $error = curl_error($ch).' ('.$errno.')';\n curl_close($ch);\n throw new Exception($error, (int)$errno);\n }\n // {httpcode: 200, url: '/login', effectiveurl: '/account', 'totaltime': 2, data: '<html>', 'headers': [k:v,..], redirectcount: 1, receivedbytes: 1000, 'method': post, 'contenttype': 'html'}\n $meta = array();\n $meta['effectiveurl'] = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL);\n $meta['httpcode'] = (integer) curl_getinfo($ch, CURLINFO_HTTP_CODE); // last\n $meta['totaltime'] = (float) curl_getinfo($ch, CURLINFO_TOTAL_TIME);\n $meta['dnstime'] = (float) curl_getinfo($ch, CURLINFO_NAMELOOKUP_TIME);\n $meta['connecttime'] = (float) curl_getinfo($ch, CURLINFO_CONNECT_TIME);\n $meta['starttransfertime'] = (float) curl_getinfo($ch, CURLINFO_STARTTRANSFER_TIME);\n $meta['redirectcount'] = (integer) curl_getinfo($ch, CURLINFO_REDIRECT_COUNT);\n $meta['receivedbytes'] = (integer) curl_getinfo($ch, CURLINFO_SIZE_DOWNLOAD);\n $meta['contenttype'] = curl_getinfo($ch, CURLINFO_CONTENT_TYPE);\n $headersBytes = (integer) curl_getinfo($ch, CURLINFO_HEADER_SIZE);\n $meta['url'] = $url;\n $meta['method'] = $httpMethod;\n $header = substr($output, 0, $headersBytes);\n $body = substr($output, $headersBytes);\n $headersarray = explode(\"\\r\\n\", $header);\n $headersclean = array();\n foreach ($headersarray as $headervalue)\n {\n $hstruct = explode(':', $headervalue); //$headerkey\n if ($hstruct[0] && $hstruct[1])\n $headersclean[$hstruct[0]] = $hstruct[1];\n }\n $meta['headers'] = $headersclean;\n // cookies\n $pattern = \"#Set-Cookie:\\\\s+(?<cookie>[^=]+=[^;]+)#m\";\n preg_match_all($pattern, $header, $matches);\n $cookiesOut = implode(\"; \", $matches['cookie']);\n foreach (explode(';',$cookiesOut) as $kv)\n {\n list($k,$v) = explode('=',$kv);\n $k = trim($k);\n $v = trim($v);\n $meta['newcookies'][$k] = urldecode($v);\n }\n unset($meta['headers']['Set-Cookie']);\n\n $meta['data'] = $body;\n //unset($body);\n curl_close($ch);\n if ($meta['httpcode'] == 200)\n {\n // $meta['contenttype'] == 'text/html'\n $aa = explode(';', $meta['contenttype']);\n if (count($aa) == 1)\n {\n if ($meta['contenttype'] == 'text/html') $ishtml = true;\n }\n else { // 2 or more\n if ($aa[0] == 'text/html') $ishtml = true;\n $aa[1] = trim($aa[1]);\n //println($aa[1],1,TERM_RED);\n $enc = explode('=', $aa[1]);\n //println($enc);\n if ($enc[0] == 'charset')\n {\n //println($enc[1],1,TERM_YELLOW);\n if ($enc[1] == 'windows-1251')\n {\n $meta['data'] = mb_convert_encoding($meta['data'], \"utf-8\", \"windows-1251\");\n }\n }\n }\n// printlnd($meta['contenttype']);\n if (explode(';', $meta['contenttype'])[0] == 'application/json') $isjson = true;\n\n if ($ishtml) {\n $d = new DOMDocument;\n $d->loadHTML($body);\n $meta['html'] = $d;\n }\n elseif ($isjson)\n {\n\n $meta['json'] = json_decode($body, true);\n }\n }\n return $meta;\n}", "function web_client($url) {\n $post = array();\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 30);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n\n $result = curl_exec($ch);\n \n $response = json_decode($result, true);\n}", "function rest_get_data($url)\n{\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n curl_close($ch);\n return $result;\n}", "private function curl($url, $method = 'get', $header = null, $postdata = null, $timeout = 60)\n\t{\n\t\t$s = curl_init();\n\n\t\tcurl_setopt($s,CURLOPT_URL, $url);\n\t\tif ($header) \n\t\t\tcurl_setopt($s,CURLOPT_HTTPHEADER, $header);\n\n\t\tif ($this->debug)\n\t\t\tcurl_setopt($s,CURLOPT_VERBOSE, TRUE);\n\n\t\tcurl_setopt($s,CURLOPT_TIMEOUT, $timeout);\n\t\tcurl_setopt($s,CURLOPT_CONNECTTIMEOUT, $timeout);\n\t\tcurl_setopt($s,CURLOPT_MAXREDIRS, 3);\n\t\tcurl_setopt($s,CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($s,CURLOPT_FOLLOWLOCATION, 1);\n\t\tcurl_setopt($s,CURLOPT_COOKIEJAR, 'cookie.txt');\n curl_setopt($s,CURLOPT_COOKIEFILE, 'cookie.txt'); \n\t\t \n\t\tif(strtolower($method) == 'post')\n\t\t{\n\t\t\tcurl_setopt($s,CURLOPT_POST, true);\n\t\t\tcurl_setopt($s,CURLOPT_POSTFIELDS, $postdata);\n\t\t}\n\t\telse if(strtolower($method) == 'delete')\n\t\t{\n\t\t\tcurl_setopt($s,CURLOPT_CUSTOMREQUEST, 'DELETE');\n\t\t}\n\t\telse if(strtolower($method) == 'put')\n\t\t{\n\t\t\tcurl_setopt($s,CURLOPT_CUSTOMREQUEST, 'PUT');\n\t\t\tcurl_setopt($s,CURLOPT_POSTFIELDS, $postdata);\n\t\t}\n\t\t\n\t\tcurl_setopt($s,CURLOPT_HEADER, $this->includeheader);\t\t\t \n\t\tcurl_setopt($s,CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1');\n\t\tcurl_setopt($s, CURLOPT_SSL_VERIFYPEER, false);\n\t\t\n\t\t$html = curl_exec($s);\n\t\t$status = curl_getinfo($s, CURLINFO_HTTP_CODE);\n\t\t\n\t\tcurl_close($s);\n\n\t\treturn $html;\n\t}", "function get( $url, $post = null, $auth = null, $progress = false, $timeout = 5, &$error = false, $options = array() ) {\n\n // Create CURL Object\n $CURL = curl_init();\n\n // By using array union we can pre-set/change options from function call\n $curl_opts = $options + array(\n CURLOPT_URL => $url,\n CURLOPT_TIMEOUT => $timeout,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_USERAGENT => 'Mozilla/5.0 (AIO Radio Station Player) AppleWebKit/537.36 (KHTML, like Gecko)',\n CURLOPT_FOLLOWLOCATION => ( ( ini_get( 'open_basedir' ) == false ) ? true : false ),\n CURLOPT_CONNECTTIMEOUT => ( ( $timeout < 6 && $timeout != 0 ) ? 5 : $timeout ),\n CURLOPT_REFERER => 'http' . ( ( $_SERVER[ 'SERVER_PORT' ] == 443 ) ? 's://' : '://' ) . $_SERVER[ 'HTTP_HOST' ] . strtok( $_SERVER[ 'REQUEST_URI' ], '?' ),\n CURLOPT_CAINFO => dirname( __FILE__ ) . '/bundle.crt'\n );\n\n\n // Post data to the URL (expects array)\n if ( isset( $post ) && is_array( $post ) ) {\n\n // Make every just simpler using custom array for options\n $curl_opts = $curl_opts + array(\n CURLOPT_POSTFIELDS => http_build_query( $post, '', '&' ),\n CURLOPT_POST => true,\n CURLOPT_FRESH_CONNECT => true,\n CURLOPT_FORBID_REUSE => true\n );\n\n }\n\n // Use HTTP Authorization\n if ( isset( $auth ) && !empty( $auth ) ) {\n\n $curl_opts = $curl_opts + array( CURLOPT_USERPWD => $auth );\n\n }\n\n // Call anonymous $progress_function function\n if ( $progress !== false && is_callable( $progress ) ) {\n\n $curl_opts = $curl_opts + array(\n CURLOPT_NOPROGRESS => false,\n CURLOPT_PROGRESSFUNCTION => $progress\n );\n\n }\n\n // Before executing CURL pass options array to the session\n curl_setopt_array( $CURL, $curl_opts );\n\n // Finally execute CURL\n $data = curl_exec( $CURL );\n\n // Parse ERROR\n if ( curl_error( $CURL ) ) {\n\n // This must be referenced in-memory variable\n $error = curl_error( $CURL );\n\n // Only works when writeLog function is available\n if ( function_exists( 'writeLog' ) )\n writeLog( 'errors', \"CURL Request \\\"{$url}\\\" failed! LOG: \" . curl_error( $CURL ), dirname( __FILE__ ) . '/./../tmp/logs/' );\n\n }\n\n // Close connection and return data\n curl_close( $CURL );\n return $data;\n\n }", "function curl_fetch($url, $options=array()) {\n\t// 创建curl句柄\n\t$ch = curl_init();\n\t// 设置参数\n\tcurl_setopt($ch, CURLOPT_URL, $url);\n\tcurl_setopt_array($ch, $options);\n\t// 执行句柄\n\t$res = curl_exec($ch);\n\t// 检测错误\n\tif(curl_errno($ch)) {\n\t\techo 'curl error : '.curl_error($ch);\n\t}\n\t// 关闭句柄\n\tcurl_close($ch);\n\treturn $res;\n}", "function _curlRequest( $url, $method, $data = null, $sendAsJSON = true, $auth = true ) {\n\t$curl = curl_init();\n\tif ( $method == 'GET' && $data !== null ) {\n\t\t$url .= '?' . http_build_query( $data );\n\t}\n\tcurl_setopt( $curl, CURLOPT_URL, $url );\n\tif ( $auth ) {\n\t\tcurl_setopt( $curl, CURLOPT_USERPWD, P_SECRET );\n\t}\n\tcurl_setopt( $curl, CURLOPT_CUSTOMREQUEST, $method );\n\tif ( $method == 'POST' && $data !== null ) {\n\t\tif ( $sendAsJSON ) {\n\t\t\t$data = json_encode( $data );\n\t\t\tcurl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen( $data ) ) );\n\t\t}\n\t\tcurl_setopt( $curl, CURLOPT_POSTFIELDS, $data );\n\t}\n\tcurl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );\n\tcurl_setopt( $curl, CURLOPT_HEADER, false );\n\tcurl_setopt( $curl, CURLOPT_SSL_VERIFYPEER, false );\n\tcurl_setopt( $curl, CURLOPT_SSL_VERIFYHOST, false );\n\t$response = curl_exec( $curl );\n\tif ( $response === false ) {\n\t\techo curl_error( $curl );\n\t\tcurl_close( $curl );\n\n\t\treturn false;\n\t}\n\t$httpCode = curl_getinfo( $curl, CURLINFO_HTTP_CODE );\n\tif ( $httpCode >= 400 ) {\n\t\techo curl_error( $curl );\n\t\tcurl_close( $curl );\n\n\t\treturn false;\n\t}\n\tcurl_close( $curl );\n\n\treturn json_decode( $response, true );\n}", "function http($url, $method = 'GET', $postfields = NULL, $headers = array()) {\n\t\t$ci = curl_init();\n\t\t/* Curl settings */\n\t\tcurl_setopt($ci, CURLOPT_CONNECTTIMEOUT, $this->connecttimeout);\n\t\tcurl_setopt($ci, CURLOPT_TIMEOUT, $this->timeout);\n\t\tcurl_setopt($ci, CURLOPT_RETURNTRANSFER, TRUE);\n\t\tcurl_setopt($ci, CURLOPT_HTTPHEADER, array_merge(array('Expect:'),$headers));\n\t\tcurl_setopt($ci, CURLOPT_SSL_VERIFYPEER, $this->ssl_verifypeer);\n\n\t\tswitch ($method) {\n\t\tcase 'POST':\n\t\t\tcurl_setopt($ci, CURLOPT_POST, TRUE);\n\t\t\tif (!empty($postfields)) {\n\t\t\t\tcurl_setopt($ci, CURLOPT_POSTFIELDS, $postfields);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'DELETE':\n\t\t\tcurl_setopt($ci, CURLOPT_CUSTOMREQUEST, 'DELETE');\n\t\t\tif (!empty($postfields)) {\n\t\t\t\t$url = \"{$url}?{$postfields}\";\n\t\t\t}\n\t\t}\n\n\t\tcurl_setopt($ci, CURLOPT_URL, $url);\n\t\t$response = curl_exec($ci);\n\t\t$this->http_code = curl_getinfo($ci, CURLINFO_HTTP_CODE);\n\t\t$this->last_api_call = $url;\n\t\tcurl_close ($ci);\n\t\treturn $response;\n\t}", "public static function connect($XCurlObject)\t{\n\n // Initialisation de la connexion CURL\n $CurlConnection = curl_init();\n\n // Affectation des paramètres d'authentification\n if ($XCurlObject->authentication() != null) {\n $authentication_string = \"Authorization:Basic \".$XCurlObject->authentication();\n $current_header = $XCurlObject->header();\n $current_header[] = $authentication_string;\n $XCurlObject->setHeader($current_header);\n }\n\n // Mise en place des identifiants\n $proxy_ids = \"\";\n if ($XCurlObject->proxy_login() != \"\" && $XCurlObject->proxy_pwd() != \"\") {\n $proxy_ids = $XCurlObject->proxy_login().\":\".$XCurlObject->proxy_pwd().\"@\";\n }\n\n // Paramétrage du proxy\n if ($XCurlObject->proxy() === true) {\n curl_setopt($CurlConnection, CURLOPT_PROXY, $XCurlObject->proxy_protocol().\"://\".$proxy_ids.$XCurlObject->proxy_server().\":\".$XCurlObject->proxy_port());\n }\n\n // Mise en place de la connexion en méthode POST\n if ($XCurlObject->type() == 1) {\n curl_setopt($CurlConnection, CURLOPT_POST, true);\n curl_setopt($CurlConnection, CURLOPT_POSTFIELDS, $XCurlObject->request());\n } else {\n // curl_setopt($CurlConnection, CURLOPT_POST, false);\n }\n\n // Affectation des paramètres\n curl_setopt($CurlConnection, CURLOPT_URL, $XCurlObject->url());\n curl_setopt($CurlConnection, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($CurlConnection, CURLOPT_HTTPHEADER, $XCurlObject->header());\n curl_setopt($CurlConnection, CURLOPT_CONNECTTIMEOUT, $XCurlObject->connection_timeout());\n curl_setopt($CurlConnection, CURLOPT_TIMEOUT, $XCurlObject->request_timeout());\n curl_setopt($CurlConnection, CURLOPT_VERBOSE, $XCurlObject->verbose());\n curl_setopt($CurlConnection, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);\n\n // Exécution de la connexion\n $CurlConnectionResult = curl_exec($CurlConnection);\n\n // Récupération des informations de la connexion\n $CurlConnectionInformations = curl_getinfo($CurlConnection);\n\n // Récupération des erreurs liées à la connexion\n $CurlConnectionErrors = curl_error($CurlConnection);\n\n // Fermeture de la connexion\n curl_close($CurlConnection);\n\n return $CurlConnectionResult;\n\n\t}", "function repetitive_function()\n{\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, \"httpbin/get?key=value\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n $output = curl_exec($ch);\n error_log('Received response: ' . var_export($output, 1));\n curl_close($ch);\n}", "function curl_post($url, $postfields=array(), $headers=array(), $auth=array()) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($postfields));\n curl_setopt($ch,CURLOPT_HTTPHEADER, $headers);\n if(!empty($auth['username']) && !empty($auth['password'])) {\n curl_setopt($ch, CURLOPT_USERPWD, $auth['username'].\":\".$auth[\"password\"]);\n }\n return curl_exec($ch);\n}", "function fetchUrl($url){\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_TIMEOUT, 20);\n $retData = curl_exec($ch);\n curl_close($ch); \n \n return $retData;\n}", "public function access_curl(){\n\t\t$type = $this->_type;\n\n\t\tif($type == false){\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\tswitch($type) {\n\t\t\t\tcase 'domain':\n\t\t\t\t\treturn $this->_checkDomainCURL();\n\t\t\t\tbreak;\n\t\t\t\tcase 'data':\n\t\t\t\t\treturn $this->_ProcessDataCurl();\n\t\t\t\tbreak;\n\t\t\t\tcase 'slice':\n\t\t\t\t\treturn $this->_sliceCurlData();\n\t\t\t\tbreak;\n\t\t\t\tcase 'favicon':\n\t\t\t\t\treturn $this->_getFavicon();\n\t\t\t\tbreak;\n\t\t\t\tcase 'loop-favicon':\n\t\t\t\t\treturn $this->_loopFavicon();\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\treturn $this->_ProcessDataCurl();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "protected function getPageCurl()\n\t{\n\t\t// initiate curl with our url\n\t\t$this->curl = curl_init($this->url);\n\n\t\t// set curl options\n\t\tcurl_setopt($this->curl, CURLOPT_HEADER, 0);\n\t\tcurl_setopt($this->curl, CURLOPT_USERAGENT, $this->user_agent);\n\t\tcurl_setopt($this->curl, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($this->curl, CURLOPT_FOLLOWLOCATION, true);\n\t\tcurl_setopt($this->curl, CURLOPT_SSL_VERIFYPEER, false);\n\t\tcurl_setopt($this->curl, CURLOPT_SSL_VERIFYHOST, false);\n\n\t\t// execute the call to google+\n\t\t$this->html = curl_exec($this->curl);\n\n\t\tcurl_close($this->curl);\n\t}", "function curlGet($url, $headers=null) {\r\n //write_log(\"Function fired\");\r\n $mc = JMathai\\PhpMultiCurl\\MultiCurl::getInstance();\r\n\t\t$ch = curl_init();\r\n\t\tcurl_setopt($ch, CURLOPT_URL,$url);\r\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 4);\r\n curl_setopt($ch, CURLOPT_TIMEOUT, 3);\r\n\t\tcurl_setopt ($ch, CURLOPT_CAINFO, rtrim(dirname(__FILE__), '/') . \"/cert/cacert.pem\");\r\n\t\tif ($headers) curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\r\n\t\t//$result = curl_exec($ch);\r\n\t\t//curl_close ($ch);\r\n $call = $mc->addCurl($ch);\r\n // Access response(s) from your cURL calls.\r\n $result = $call->response;\r\n\t\t//write_log(\"URL is \".$url.\". Result is \".$result);\r\n\t\treturn $result;\r\n\t}", "private function initCurl()\n {\n $this->curlObj = curl_init();\n curl_setopt_array($this->curlObj, array(\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_POST => true,\n CURLOPT_FORBID_REUSE => true,\n CURLOPT_HEADER => false,\n CURLOPT_TIMEOUT => 120,\n CURLOPT_CONNECTTIMEOUT => 2,\n CURLOPT_HTTPHEADER => [\"Connection: Keep-Alive\", \"Keep-Alive: 120\"]\n ));\n }", "private function just_curl_get_data($url,$data)\n {\n \n $json_str = file_get_contents($this->cil_config_file);\n $json = json_decode($json_str);\n \n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json','Content-Length: ' . strlen($doc)));\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');\n curl_setopt($ch, CURLOPT_POSTFIELDS,$data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_USERPWD, $json->readonly_unit_tester);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n $response = curl_exec($ch);\n curl_close($ch);\n return $response;\n\n }", "function curlWrap($url, $json, $action)\n{\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n\tcurl_setopt($ch, CURLOPT_MAXREDIRS, 10 );\n\tcurl_setopt($ch, CURLOPT_URL, ZDURL.$url);\n\tcurl_setopt($ch, CURLOPT_USERPWD, ZDUSER.\"/token:\".ZDAPIKEY);\n\tswitch($action){\n\t\tcase \"POST\":\n\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"POST\");\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $json);\n\t\t\tbreak;\n\t\tcase \"GET\":\n\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"GET\");\n\t\t\tbreak;\n\t\tcase \"PUT\":\n\t\t\tcurl_setopt($ch, CURLOPT_CUSTOMREQUEST, \"PUT\");\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $json);\n\t\tdefault:\n\t\t\tbreak;\n\t}\n\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));\n\tcurl_setopt($ch, CURLOPT_USERAGENT, \"MozillaXYZ/1.0\");\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($ch, CURLOPT_TIMEOUT, 10);\n\t$output = curl_exec($ch);\n\tcurl_close($ch);\n\t$decoded = json_decode($output);\n\treturn $decoded;\n}", "function socialtoaster_curl($url) {\n $curl_handle=curl_init();\n curl_setopt($curl_handle,CURLOPT_URL,$url);\n curl_setopt($curl_handle,CURLOPT_VERBOSE,0);\n curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,10);\n curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);\n $result = curl_exec($curl_handle);\n curl_close($curl_handle);\n\n return $result;\n }", "function new_post($request,$url) {\n ##Data Post\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $request);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n return curl_exec($ch);\n}", "private static function execCurl($full_url, $type,\n $headers, $post_data = null) {\n $curl_request = self::getCurlRequestType($type);\n\n if ($post_data !== null) {\n if ($type !== 'POST') {\n throw new Exception('Cannot post field data with non-POST request!');\n }\n }\n\n $session = curl_init($full_url);\n curl_setopt($session, CURLOPT_SSL_VERIFYPEER, true);\n curl_setopt($session, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($session, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($session, CURLOPT_HTTPHEADER, $headers);\n curl_setopt($session, $curl_request, true);\n if ($post_data !== null) {\n curl_setopt($session, CURLOPT_POSTFIELDS, $post_data);\n }\n\n // Do it\n $server_output = curl_exec($session);\n curl_close($session);\n\n if ($server_output === false) {\n throw new Exception(\"Couldn't make cURL request!\");\n }\n\n return $server_output;\n }", "function fetch_curl($url) {\n $ch = curl_init($url); //initialize the fetch command\n //prevent automatic output to screen\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n // in case of MAMP issues\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n\n $results = curl_exec($ch); //execute the fetch command\n curl_close($ch); //close curl request\n //decode JSON that is returned\n $data = json_decode($results);\n\n return $data;\n}", "function http_response($url, $opts = array()) {\n $url = preg_replace('/ /', '%20', $url);\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_HEADER, FALSE);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_USERAGENT, \"uw_transparancy, toolserver.org wikiproject parser\");\n $output = curl_exec($ch);\n // Check for errors\n if (curl_errno($ch)) {\n wpLog(\"Curl error: \" . curl_error($ch));\n return http_response($url);\n }\n\n curl_close($ch);\n\n return $output;\n}", "function getdata( $url, $authinfo, $javascript_loop = 0, $timeout = 0, $postdata = \"\" ) {\n\n\t\t$url = str_replace( \"&amp;\", \"&\", urldecode(trim($url)) );\n\n\t\t$ch = curl_init();\n\n\n\n\t\t$fields = '';\n\n\t\tif (!empty($postdata)) {\n\n\t\t\tforeach($postdata as $key => $value) { \n\n\t\t\t\t$fields .= ($fields==''?'?':'&').$key . '=' . $value; \n\n\t\t\t}\n\n\n\n\t\t\tcurl_setopt($ch,CURLOPT_POST, count($postdata));\n\n\t\t\tcurl_setopt($ch,CURLOPT_POSTFIELDS, urlencode($fields));\n\n\t\t}\n\n\n\n\t\tcurl_setopt( $ch, CURLOPT_USERAGENT, \"Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1\" );\n\n\t\tcurl_setopt( $ch, CURLOPT_URL, $url);\n\n\t\t\t\n\n\t\tcurl_setopt( $ch, CURLOPT_FOLLOWLOCATION, true );\n\n\t\tcurl_setopt( $ch, CURLOPT_ENCODING, \"\");\n\n\t\tcurl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );\n\n\t\tcurl_setopt( $ch, CURLOPT_AUTOREFERER, true );\n\n\t\tcurl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false ); # required for https urls\n\n\t\tcurl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, $timeout );\n\n\t\tcurl_setopt( $ch, CURLOPT_TIMEOUT, $timeout );\n\n\t\tcurl_setopt( $ch, CURLOPT_MAXREDIRS, 10 );\n\n\t\n\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, TRUE);\n\n\t\t\n\n\t\t$headers = array(\n\n\t\t \"Expect:\",\n\n\t\t \"X-ApiKey: 95074c8fb639b45aa0acc4c23bc7c4d2\",\n\n\t\t \"Authorization: Basic \".$authinfo\n\n\t\t);\n\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers); \n\n\t\t\n\n\t\t$content = curl_exec( $ch );\n\n\t\t$response = curl_getinfo( $ch );\n\n\t\tcurl_close ( $ch );\n\n\t\n\n\t\tif ($response['http_code'] == 301 || $response['http_code'] == 302)\t\t{\n\n\t\t\tini_set(\"user_agent\", \"Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1\");\n\n\t\n\n\t\t\tif ( $headers = get_headers($response['url']) ) {\n\n\t\t\t\tforeach( $headers as $value ) {\n\n\t\t\t\t\tif ( substr( strtolower($value), 0, 9 ) == \"location:\" )\n\n\t\t\t\t\t\treturn get_url( trim( substr( $value, 9, strlen($value) ) ) );\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\n\n\t\tif ( ( preg_match(\"/>[[:space:]]+window\\.location\\.replace\\('(.*)'\\)/i\", $content, $value) || preg_match(\"/>[[:space:]]+window\\.location\\=\\\"(.*)\\\"/i\", $content, $value) ) &&\n\n\t\t\t\t$javascript_loop < 5 ) {\n\n\t\t\treturn getdata( $value[1], $authinfo, $javascript_loop+1 );\n\n\t\t} else {\n\n\t\t\treturn array( $content, $response );\n\n\t\t}\n\n\t}" ]
[ "0.74159765", "0.738097", "0.7366371", "0.7338139", "0.7316899", "0.72567046", "0.72457016", "0.7192875", "0.7076124", "0.7058344", "0.7016917", "0.6966858", "0.69393593", "0.6934675", "0.69264925", "0.6905482", "0.68853563", "0.68820775", "0.68794036", "0.68655366", "0.6865272", "0.68523747", "0.6842007", "0.6840609", "0.68321735", "0.68083185", "0.67907035", "0.67881644", "0.67864895", "0.6785357", "0.6770484", "0.6766009", "0.67501235", "0.6747819", "0.6742604", "0.67334753", "0.6715466", "0.6682844", "0.6677869", "0.6677658", "0.66771775", "0.6671889", "0.6666146", "0.66624594", "0.66604227", "0.665663", "0.66550815", "0.66536963", "0.6650875", "0.6650593", "0.6638124", "0.6622645", "0.66205806", "0.6614879", "0.66134983", "0.6612248", "0.65841293", "0.65836215", "0.6575801", "0.65742004", "0.6568765", "0.6552233", "0.6548279", "0.65422434", "0.65410393", "0.65379757", "0.6536156", "0.6534834", "0.6523705", "0.651596", "0.6513343", "0.6509332", "0.6502158", "0.65012205", "0.6499617", "0.6499452", "0.6494853", "0.6492964", "0.64922404", "0.64903057", "0.6487282", "0.64783", "0.64750046", "0.6462665", "0.64591163", "0.6454215", "0.6442244", "0.6437156", "0.64349985", "0.6434504", "0.6426275", "0.6423987", "0.64157534", "0.6413274", "0.63970906", "0.63734674", "0.6372635", "0.6364295", "0.6363143", "0.63593733" ]
0.72977716
5
DEPEndency injection. StripeBilling class and this object are decoupled. This setup allows for Mock object to be sent
public function __construct(StripeBilling $stripe) { $this->_stripe = $stripe; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setUp()\n {\n $this->_paypal = new Paypal();\n\n $this->_payment = new Payment($this->_paypal);\n }", "public function setUp()\n {\n $this->purchase = new Purchase();\n }", "public function __construct(ChargeBillingRepository $billingRepo)\n {\n $this->billingRepo = $billingRepo;\n }", "public function __construct(BeaconBilling $beacon_billing) {\n $this->beaconBilling = $beacon_billing;\n }", "private function __construct() {\n\t\t$this->_applicationName = 'Billing';\n\t\t$this->_backend = new Billing_Backend_SupplyReceipt();\n\t\t$this->_modelName = 'Billing_Model_SupplyReceipt';\n\t\t$this->_currentAccount = Tinebase_Core::getUser();\n\t\t$this->_purgeRecords = FALSE;\n\t\t$this->_doContainerACLChecks = FALSE;\n\t\t$this->_config = isset(Tinebase_Core::getConfig()->billing) ? Tinebase_Core::getConfig()->billing : new Zend_Config(array());\n\t}", "public function setUp()\n {\n parent::setUp();\n $this->payoutService = $this->app->make(Payout::class);\n }", "protected function setUp()\n {\n $this->object = new Currency();\n }", "protected function setUp()\n {\n parent::setUp();\n $this->_payment = new Response\\Payment();\n }", "private function __construct() {\n $this->_applicationName = 'Billing';\n $this->_backend = new Billing_Backend_StockFlow();\n $this->_modelName = 'Billing_Model_StockFlow';\n $this->_articleSupplyController = Billing_Controller_ArticleSupply::getInstance();\n $this->_currentAccount = Tinebase_Core::getUser();\n $this->_purgeRecords = FALSE;\n $this->_doContainerACLChecks = FALSE;\n $this->_config = isset(Tinebase_Core::getConfig()->billing) ? Tinebase_Core::getConfig()->billing : new Zend_Config(array());\n }", "public function setUp(): void\n {\n parent::setUp();\n $this->api = new PaymentSecupayCreditcardsApi();\n }", "public function setUp()\n {\n if ($this->validatePaymentClass()) {\n $this->getPaymentClass()->setUp();\n }\n\n parent::setUp();\n }", "public function setUp() {\n parent::setUp();\n $this->user = factory(\\App\\User::class)->create();\n $this->client = factory(\\App\\Client::class)->create(['user_id' => $this->user->id]);\n $this->bill = factory(\\App\\Bill::class)->create([\n 'user_id' => $this->user->id,\n 'client_id' => $this->client->id,\n 'other_details' => str_repeat('random string', rand(5, 10))\n ]);\n $this->simpleBill = factory(\\App\\Bill::class)->create([\n 'user_id' => $this->user->id,\n 'client_id' => $this->client->id,\n 'other_details' => ''\n ]);\n }", "protected function setUp() {\n\t\tinclude ('config.php');\n\t\t\n\t\t$transport = getTransport($config);\t\n\t\t$mapper = new XmlMapper();\n\t\t$this->apiConnector = new ApiConnector($config['clientname'], $transport, $mapper);\n\t\t$this->service = $this->apiConnector->getService('Invoice');\n\t\tif (!is_null(self::$invoiceId)) {\n\t\t\t$this->object = $this->service->getById(self::$invoiceId);\n\t\t}\n\t}", "public function setUp()\n {\n $config = [\n 'host' => 'http://dev01.blogic.crcpress.local/',\n 'app_login' => 'www.crcpress.com',\n 'app_pass' => 'overlord',\n 'extra_config' => [\n 'user_agent' => 'CRC PHP Soap client 2.0',\n 'connection_timeout' => 6,\n 'cache_wsdl' => \\WSDL_CACHE_MEMORY,\n 'trace' => true,\n 'soap_version' => \\SOAP_1_1,\n 'encoding' => 'UTF-8'\n ],\n ];\n $ecommerceApi = new EcommerceAPI($config);\n $this->shopperService = $ecommerceApi->getService('Shopper');\n $this->invoiceService = $ecommerceApi->getService('InvoiceManager');\n }", "public function setUp()\n {\n parent::setUp();\n $this->payoutTransactionBuilderService = $this->app->make(PayoutTransactionBuilder::class);\n $this->sourcePublicKey = 'GANCN4SEI56VVZLHAKFXUQBQEQZAJYWNPVU4I6PGQXKY2PVHAFL3MSH6';\n }", "public function setUp()\n {\n $this->Receipt = new Receipt();\n }", "private function __construct() {\n\t\t$this->_applicationName = 'Billing';\n\t\t$this->_receiptController = Billing_Controller_Receipt::getInstance();\n\t\t$this->_supplyReceiptController = Billing_Controller_SupplyReceipt::getInstance();\n\t\t$this->_currentAccount = Tinebase_Core::getUser();\n\t\t$this->_doContainerACLChecks = FALSE;\n\t\t$this->setOutputType();\n\t}", "public function __construct(UserBilling $userbilling)\n\t{\n\t\t$this->userbilling = $userbilling;\n\t}", "public function testBillingSources()\n {\n }", "protected function setUp()\n {\n $this->object = new Discount;\n }", "public function testBillingInvoices()\n {\n }", "public function setUp()\n {\n $this->application = new Application([\n 'donor' => [\n 'name' => [\n 'title' => 'Dr',\n 'first' => 'Ross',\n 'last' => 'Gellar',\n ],\n 'dob' => $this->dateTimeToString(new DateTime('1966-11-02')),\n ],\n 'attorney' => [\n 'name' => [\n 'title' => 'Miss',\n 'first' => 'Monica',\n 'last' => 'Gellar',\n ],\n 'dob' => $this->dateTimeToString(new DateTime('1964-06-15')),\n ],\n 'contact' => [\n 'email' => '[email protected]',\n 'mobile' => '07712 123456',\n ],\n 'verification' => [\n 'case-number' => '123456789',\n 'donor-postcode' => 'AB1 2CD',\n 'attorney-postcode' => 'WX9 8YZ',\n ],\n 'account' => [\n 'name' => 'DR R GELLAR',\n ],\n ]);\n\n $this->payment = new Payment([\n 'amount' => '',\n 'method' => '',\n 'added-date-time' => $this->dateTimeToString(new DateTime()),\n 'processed-date-time' => $this->dateTimeToString(new DateTime()),\n ]);\n }", "public function __construct()\n {\n $this->url = Config::get('wazaar.API_URL');\n $this->payment = app()->make('Cocorium\\Payment\\PaymentInterface');\n }", "public function setup()\n {\n $this->config = new Config($this->emailOrMobileNumber, $this->merchantKey);\n }", "public function __construct()\n {\n $this->middleware('auth');\n \\Stripe\\Stripe::setApiKey(env('STRIPE_SECRET'));\n }", "protected function setUp() {\n $this->object = new SMTP;\n }", "public function setUp()\n {\n // Create a new Laravel container instance.\n $container = new Container;\n\n // Resolve the pricing calculator (and any type hinted dependencies)\n // and set to class attribute.\n $this->priceHolder = $container->make('PAMH\\\\PriceHolder');\n }", "public function setUp()\n\t{\n\t\tparent::setUp();\n\t\t$this->object = new Applicant_Model_FeeBill;\n\t}", "protected function setUp(): void {\n\t\trequire_once( dirname( __FILE__ ) . '/../vendor/aliasapi/frame/client/create_client.php' );\n\t\trequire_once( dirname( __FILE__ ) . '/TestHelpers.php' );\n\t\trequire_once( dirname( __FILE__ ) . '/TestParameters.php' );\n\n\t\tTestHelpers::prepareDatabaseConfigs();\n\t\tClient\\create_client( 'money' );\n\n\t\t$this->http_client = new GuzzleHttp\\Client( [ 'base_uri' => 'http://money/' ] );\n\t\t$this->process_tag = 'refund_purchase_from';\n\t\t$this->tag = 'refund_purchase_to';\n\t}", "private function __construct() {\n $this->_applicationName = 'Billing';\n $this->_backend = new Billing_Backend_SepaMandate();\n $this->_modelName = 'Billing_Model_SepaMandate';\n $this->_currentAccount = Tinebase_Core::getUser();\n $this->_purgeRecords = FALSE;\n $this->_doContainerACLChecks = FALSE;\n $this->_config = isset(Tinebase_Core::getConfig()->billing) ? Tinebase_Core::getConfig()->billing : new Zend_Config(array());\n }", "protected function setUp(): void\n {\n resetLog();\n $this->object = new AmazonFulfillmentOrder('testStore', null, true, null);\n }", "public function __construct() {\n\n $this->loadMerchantInformation();\n }", "public function __construct()\n {\n $this->merchant = [\n 'key' => getenv('MERCHANT_KEY'),\n 'secret' => getenv('MERCHANT_SECRET')\n ];\n }", "protected function setUp() {\n\t\tif (file_exists('../config.php')) {\n\t\t\tinclude ('../config.php');\n\t\t} else {\n\t\t\tinclude ('config.php');\n\t\t}\n\t\t\n\t\t$transport = getTransport($config);\t\n\t\t$mapper = new XmlMapper();\n\t\t$connector = new ApiConnector($config['clientname'], $transport, $mapper);\n\t\t$this->object = $connector->getService('InvoiceProfile');\n\t}", "protected function setUp()\n { \n $settings = require __DIR__ . '/../../../config/settings.php';\n $container = new \\Slim\\Container($settings);\n $container['stockconfig'] = function ($config) {\n $stockconfig =$config['settings']['stockconfig']; \n return $stockconfig;\n };\n $dependencies = new Dependencies($container);\n $dependencies->registerLogger();\n $dependencies->registerDatabase();\n $this->object = new StockResource($container);\n \n }", "protected function setUp()\n {\n $this->object = new Client( $GLOBALS['api_key'] );\n }", "protected function setUp()\n {\n $this->object = new Client( $GLOBALS['api_key'] );\n }", "protected function setUp() {\n $this->object = new LicenseController;\n }", "public function __construct()\n {\n $agency = new \\Bpi\\ApiBundle\\Domain\\Aggregate\\Agency('200100', self::AGENCY_NAME, 'moderator', 'public_key', 'secret');\n\n $repository = $this->getMock('\\Doctrine\\Common\\Persistence\\ObjectRepository');\n $repository->expects($this->once())\n ->method('findOneBy')\n ->will($this->returnValue($agency))\n ;\n\n $om = $this->getMock('\\Doctrine\\Common\\Persistence\\ObjectManager');\n $om->expects($this->once())\n ->method('getRepository')\n ->will($this->returnValue($repository))\n ;\n\n $fsm = $this->getMockBuilder('\\Knp\\Bundle\\GaufretteBundle\\FilesystemMap')\n ->setConstructorArgs(array(array()))\n ->getMock()\n ;\n\n $this->service = new PushService($om, $fsm);\n $this->author = new Author(new AgencyId(1), 1, 'Bush', 'George');\n\n $util = new Util();\n $this->resource = $util->createResourceBuilder()\n ->body('bravo_body')\n ->teaser('bravo_teaser')\n ->title('bravo_title')\n ->ctime(new \\DateTime())\n ;\n }", "public function testGetUnitBillingMethods()\n {\n }", "public function setUp()\n {\n $this->amount = mt_rand(1, 100);\n $this->returnUrl = 'https://test.com/' . uniqid('', true);\n $this->orderNumber = uniqid('order_number_', true);\n $this->currency = 'RUB';\n\n parent::setUp();\n }", "protected function setUp() {\n $this->object = new AccountBalanceValidators;\n }", "protected function setUp()\n {\n $this->instance = new TestProPropertyDTO();\n $this->masterClass = AbstractCSR3PropertyDTO::class;\n $this->reflexClass = TestProPropertyDTO::class;\n }", "public function __construct()\n {\n $this->alipay = new Alipay();\n }", "public function setUp()\r\n {\r\n $this->extra = new \\tabs\\api\\pricing\\Extra(\r\n 'BKFE',\r\n 'Booking Fee',\r\n 20,\r\n 1,\r\n 'compulsory'\r\n );\r\n }", "public function __construct() {\n // Secret key set\n \\Stripe::setApiKey(SEC_KEY);\n }", "protected function setUp()\n {\n $config = array(\n \"accessToken\" => \"accessToken\",\n \"sk_url\" => \"sk_url\",\n \"redirect_url\" => \"redirect_url\",\n \"app_id\" => \"app_id\",\n \"app_secret\" => \"app_secret\"\n );\n\n $this->object = new API($config);\n }", "protected function setUp() {\n $this->object = new KactoosAPI;\n $this->object->apikey('8f14e45fceea167a5a36dedd4bea2543')\n ->country('br')\n ->module('products')\n ->appname('jaydson')\n ->format('xml');\n }", "public function setBilling($billing);", "protected function setUp()\n\t{\n\t\t$this->object = PPCredentialManager::getInstance();\n\t}", "protected function setUp(): void {\n\t\t$this->ethereumApi = new Ethereum();\n\t\t$this->ethereum_address = '0x0000000000000000000000000000000' . rand(100000000, 999999999);\n\n\t\tMockery::globalHelpers();\n\t}", "protected function setup() : void\n {\n $this->subject = new Product(\n 'ACCESS_KEY',\n 'SECRET_KEY',\n 1\n );\n }", "public function __construct()\n {\n if(config('paypal.settings.mode') == 'live'){\n $this->client_id = config('paypal.live_client_id');\n $this->secret = config('paypal.live_secret');\n //$this->plan_id = env('PAYPAL_LIVE_PLAN_ID', '');\n } else {\n $this->client_id = config('paypal.sandbox_client_id');\n $this->secret = config('paypal.sandbox_secret');\n //$this->plan_id = env('PAYPAL_SANDBOX_PLAN_ID', '');\n }\n \n // Set the Paypal API Context/Credentials\n $this->apiContext = new ApiContext(new OAuthTokenCredential($this->client_id, $this->secret));\n $this->apiContext->setConfig(config('paypal.settings'));\n }", "protected function setUp() {\n $this->object = new HttpRequestBuilder();\n }", "private function __construct() {\n\t\t\tif ( ! class_exists( 'WC_Payment_Gateway' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( is_user_logged_in() ) {\n\t\t\t\t$current_user = wp_get_current_user();\n\t\t\t\t$this->omise_customer_id = Omise()->settings()->is_test() ? $current_user->test_omise_customer_id : $current_user->live_omise_customer_id;\n\t\t\t}\n\n\t\t\t$this->customerCard = new OmiseCustomerCard;\n\t\t\t$this->omiseCardGateway = new Omise_Payment_Creditcard();\n\n\t\t\tadd_action( 'woocommerce_after_my_account', array( $this, 'init_panel' ) );\n\t\t\tadd_action( 'wp_ajax_omise_delete_card', array( $this, 'omise_delete_card' ) );\n\t\t\tadd_action( 'wp_ajax_omise_create_card', array( $this, 'omise_create_card' ) );\n\t\t\tadd_action( 'wp_ajax_nopriv_omise_delete_card', array( $this, 'no_op' ) );\n\t\t\tadd_action( 'wp_ajax_nopriv_omise_create_card', array( $this, 'no_op' ) );\n\t\t}", "protected function setUp()\n {\n parent::setUp();\n\n $this->request = new InvoicesRequest;\n }", "protected function setUp()\n {\n $this->object = $this->createMock(AbstractRequest::class, [\n $this->getHttpClient(),\n $this->getHttpRequest(),\n self::TOKEN,\n \\Omnipay\\Rede\\Gateway::TEST_ENDPOINT\n ]);\n }", "protected function setUp()\n {\n $this->object = new User(1);\n $this->object->exchangeArray(array(\n 'apiKey' => 'thisisanapikey',\n 'secretKey' => 'thisisasecretkey',\n 'lastname' => 'mustermann',\n 'firstname' => 'max',\n 'email' => '[email protected]'\n ));\n }", "protected function setUp()\n {\n $this->object = new Client;\n }", "protected function setUp()\n {\n $this->object = new Mailchimp;\n }", "public function testBillingDownloadInvoice()\n {\n }", "public static function useStripe()\n {\n static::$billsUsing = 'stripe';\n\n return new static;\n }", "public function setUp():void\n {\n $this->gateway = $this->createMock(Gateway::class);\n $this->paymentTransactionRepository = $this->createMock(PaymentTransactionRepository::class);\n $this->paymentsService = new PaymentService($this->gateway, $this->paymentTransactionRepository);\n\n $this->customer = $this->createMock(Customer::class);\n $this->item = $this->createMock(Item::class);\n $this->CreditCard = $this->createMock(CreditCard::class);\n }", "public function setUp() : void {\n parent::setUp();\n $controller = payment_method_controller_load('stripe_payment_payment_request');\n $method = entity_create('payment_method', [\n 'controller' => $controller,\n 'controller_data' => $controller->controller_data_defaults,\n ]);\n entity_save('payment_method', $method);\n $this->method = $method;\n }", "protected function setUp() {\n $this->object = new OnlineLookupApiService();\n }", "public function setUp(): void\n {\n $this->proxy = NewInstance::of(Verified::class);\n }", "protected function setUp()\n {\n $this->object = new Crypt;\n }", "protected function setUp(): void\n {\n $this->object = new HydrationOptions();\n }", "public function _before()\n {\n // @codingStandardsIgnoreEnd\n $authentication = $this->authentication\n ->setSecuritySender('31HA07BC8142C5A171745D00AD63D182')\n ->setUserLogin('31ha07bc8142c5a171744e5aef11ffd3')\n ->setUserPassword('93167DE7')\n ->setTransactionChannel('31HA07BC816492169CE30CFBBF83B1D5')\n ->getAuthenticationArray();\n $customerDetails = $this->customerData->getCustomerDataArray();\n\n $EPS = new EPSPaymentMethod();\n $EPS->getRequest()->authentification(...$authentication);\n $EPS->getRequest()->customerAddress(...$customerDetails);\n $EPS->dryRun = true;\n\n $this->paymentObject = $EPS;\n }", "protected function setUp(): void\n {\n $this->request = new CreateDomain();\n }", "protected function setUp()\n {\n $this->session = new \\Yana\\Security\\Sessions\\NullWrapper();\n $this->defaultEvent = array('test');\n $this->object = new \\Yana\\Plugins\\Dependencies\\Container($this->session, $this->defaultEvent);\n }", "protected function setUp()\n {\n $this->slipData = new OrangePaymentSlipData();\n }", "protected function setUp()\n {\n parent::setUp();\n $this->flightInstance = new FlightInstance();\n $db = new Db();\n $cd1 = new Class_Details();\n $cd2 = new Class_Details();\n $cd3 = new Class_Details();\n $cd4 = new Class_Details();\n $aap = new Airport();\n $dap = new Airport();\n $fl = new Flight();\n $fl->setArriveAirport($aap);\n $fl->setDepartAirport($dap);\n $this->flightInstance->setFlight($fl);\n $airplane = new Airplane();\n $airplane->setCd1($cd1);\n $airplane->setCd2($cd2);\n $airplane->setCd3($cd3);\n $airplane->setCd4($cd4);\n $this->flightInstance->setAirplane($airplane);\n }", "public function setUp()\n {\n $this->dependencies = [\n ['dbengine' => 'sqlite', 'path' => ':memory:']\n ];\n\n $this->reflection = new ReflectionClass(DatabaseService::class);\n $this->testObject = $this->reflection->newInstanceArgs($this->dependencies);\n }", "public function setUp()\n {\n $this->purchase = new Purchase();\n // Now, mock the repository so it returns the mock of the purchase repo\n $this->purchaseRepository = $this->createMock(PurchaseRepository::class);\n // Last, mock the EntityManager to return the mock of the repository\n $this->em = $this->getMockBuilder('Doctrine\\ORM\\EntityManager')\n ->disableOriginalConstructor()\n ->setMethods(['getRepository']) // We indicates that a method will be defined\n ->getMock();\n $this->em->method('getRepository')->willReturn($this->purchaseRepository);\n }", "protected function setUp() {\n\t\t$this->objectInstance = tx_saltedpasswords_salts_factory::getSaltingInstance();\n\t}", "public function __construct() {\n $paypal_conf = Config::get('paypal_payment');\n $this->_api_context = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));\n $this->_api_context->setConfig($paypal_conf['settings']);\n }", "public function __construct()\n {\n $pdoDouble = \\Mockery::mock('PDO');\n parent::__construct($pdoDouble);\n }", "protected function setUp() {\n $this->object = new Patientreports;\n }", "public function __construct()\n {\n \n /** setup PayPal api context **/\n $paypal_conf = \\Config::get('paypal');\n $this->_api_context = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));\n $this->_api_context->setConfig($paypal_conf['settings']);\n }", "public function __construct()\n {\n \n /** setup PayPal api context **/\n $paypal_conf = \\Config::get('paypal');\n $this->_api_context = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));\n $this->_api_context->setConfig($paypal_conf['settings']);\n }", "protected function setUp(): void\n {\n $this->response = '{\"id\":\"123456679876543\",\"email\":\"[email protected]\",\"name\":\"Test Testov\"}';\n\n $this->provider = new Mailru([\n 'clientId' => 'mock_client_id',\n 'clientSecret' => 'mock_secret',\n 'redirectUri' => 'https://example.com/redirect',\n ]);\n\n parent::setUp();\n }", "public function testPrepareApiRequest()\n {\n /** @var array $billingData */\n $billingData = [\n 'firstname' => 'Someone',\n 'lastname' => 'Somebody',\n 'telephone' => '555-555-5555',\n 'street' => '630 Allendale Rd',\n 'city' => 'King of Prussia',\n 'region_code' => 'PA',\n 'country' => 'US',\n 'postcode' => '19604',\n ];\n /** @var Mage_Sales_Model_Order_Address $shippingAddress */\n $shippingAddress = Mage::getModel('sales/order_address', ['id' => 1]);\n /** @var Mage_Sales_Model_Order_Address $billingAddress */\n $billingAddress = Mage::getModel('sales/order_address', array_merge($billingData, ['id' => 2]));\n /** @var Mage_Sales_Model_Order $order */\n $order = Mage::getModel('sales/order', [\n 'is_virtual' => true\n ]);\n $order->setShippingAddress($shippingAddress)\n ->setBillingAddress($billingAddress);\n /** @var Mage_Sales_Model_Order_Payment $orderPayment */\n $orderPayment = Mage::getModel('sales/order_payment', ['cc_exp_year' => 2023, 'cc_exp_month' => 8])->setOrder($order);\n\n $mockMethods = [\n 'setIsEncrypted' => null,\n 'setRequestId' => null,\n 'setOrderId' => null,\n 'setPanIsToken' => null,\n 'setCardNumber' => null,\n 'setExpirationDate' => null,\n 'setCardSecurityCode' => null,\n 'setAmount' => null,\n 'setCurrencyCode' => null,\n 'setEmail' => null,\n 'setIp' => null,\n 'setBillingFirstName' => $billingData['firstname'],\n 'setBillingLastName' => $billingData['lastname'],\n 'setBillingPhone' => $billingData['telephone'],\n 'setBillingLines' => $billingData['street'],\n 'setBillingCity' => $billingData['city'],\n 'setBillingMainDivision' => $billingData['region_code'],\n 'setBillingCountryCode' => $billingData['country'],\n 'setBillingPostalCode' => $billingData['postcode'],\n // Expecting shipping setter methods for the request payload to be\n // fill-out with billing data.\n 'setShipToFirstName' => $billingData['firstname'],\n 'setShipToLastName' => $billingData['lastname'],\n 'setShipToPhone' => $billingData['telephone'],\n 'setShipToLines' => $billingData['street'],\n 'setShipToCity' => $billingData['city'],\n 'setShipToMainDivision' => $billingData['region_code'],\n 'setShipToCountryCode' => $billingData['country'],\n 'setShipToPostalCode' => $billingData['postcode'],\n ];\n /** @var ICreditCardAuthRequest $request **/\n $request = $this->getMockForAbstractClass('\\eBayEnterprise\\RetailOrderManagement\\Payload\\Payment\\ICreditCardAuthRequest', [], '', true, true, true, array_keys($mockMethods));\n foreach ($mockMethods as $method => $with) {\n if (is_null($with)) {\n $request->expects($this->once())\n ->method($method)\n ->will($this->returnSelf());\n } else {\n // Using \"with\" only when there's an actual value\n $request->expects($this->once())\n ->method($method)\n ->with($this->identicalTo($with))\n ->will($this->returnSelf());\n }\n }\n /** @var IBidirectionalApi $api */\n $api = $this->getMockForAbstractClass('\\eBayEnterprise\\RetailOrderManagement\\Api\\IBidirectionalApi', [], '', true, true, true, ['getRequestBody']);\n $api->expects($this->once())\n ->method('getRequestBody')\n ->will($this->returnValue($request));\n\n /** @var Radial_CreditCard_Model_Method_Ccpayment $payment */\n $payment = Mage::getModel('radial_creditcard/method_ccpayment');\n\n $this->assertSame($payment, EcomDev_Utils_Reflection::invokeRestrictedMethod($payment, '_prepareAuthRequest', [$api, $orderPayment]));\n }", "public function __construct()\n {\n $this->middleware('referer');\n if (App::getLocale() == \"it\") {\n Moment::setLocale('it_IT');\n }\n\n\n $this->_apiContext = PayPal::ApiContext(\n config('services.paypal.client_id'),\n config('services.paypal.secret'));\n\n\n $this->_apiContext->setConfig(array(\n 'mode' => (getenv('APP_ENV') == \"local\") ? 'sandbox' : 'live',\n 'service.EndPoint' => (getenv('APP_ENV') == \"local\") ? 'https://api.sandbox.paypal.com' : 'https://api.paypal.com',\n 'http.ConnectionTimeOut' => 30,\n 'log.LogEnabled' => false,\n 'log.FileName' => storage_path('logs/paypal.log'),\n 'log.LogLevel' => 'FINE'\n ));\n\n\n }", "protected function setUp(): void\n {\n // O parametro 'true' é passado para o constructor da classe Validator para informar que é o PHPUnit que esta sendo executado\n // Isso serve para que a funcion que valida blacklist não faça uma requisição á API, pois o PHPUnit não permite requisições externas\n $this->_validator = new Validator(true);\n $this->_data_send = new DataSend();\n }", "public function __construct()\n {\n $this->setMerchantD();\n $this->setMerchantKey();\n $this->setBaseUrl();\n $this->setBankTransferUrl();\n $this->setStatus(false);\n }", "protected function setUp() {\n $this->object = new Qrcode;\n }", "public function setUp(): void\n {\n parent::setUp();\n $this->createMockRequest('confirm_payment_response', __DIR__);\n }", "protected function setUp() {\n\t\tob_start ();\n\t\t$this->object = new VirtualDeviceURIBackingInfo ( false, \"TESTS VirtualDeviceURIBackingInfo\" );\n\t}", "public function __construct()\n {\n /** setup PayPal api context **/\n $paypal_conf = \\Config::get('paypal');\n $this->_api_context = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));\n $this->_api_context->setConfig($paypal_conf['settings']);\n }", "public function __construct () {\n // Merchant ID\n $this->_mid = \"\";\n\n // User ID\n $this->_userID = \"\";\n\n // Password\n $this->_password = \"\";\n\n // Developer ID\n $this->_devID = \"\";\n\n // Device ID\n $this->_deviceID = \"\";\n\n // API server\n $this->_tsepApiServer = \"https://stagegw.transnox.com\";\n }", "protected function setUp()\n {\n $this->object = new Ticket(new Mapper());\n }", "public function chargePaymentShouldSetArgumentsInNewChargeObject(): void\n {\n $heidelpay = new Heidelpay('s-priv-123');\n $payment = (new Payment())->setParentResource($heidelpay)->setId('myPaymentId');\n\n /** @var ResourceService|MockObject $resourceSrvMock */\n $resourceSrvMock = $this->getMockBuilder(ResourceService::class)->disableOriginalConstructor()->setMethods(['createResource'])->getMock();\n /** @noinspection PhpParamsInspection */\n $resourceSrvMock->expects($this->once())->method('createResource')\n ->with($this->callback(static function ($charge) use ($payment) {\n /** @var Charge $charge */\n $newPayment = $charge->getPayment();\n return $charge instanceof Charge &&\n $charge->getAmount() === 1.234 &&\n $charge->getCurrency() === 'myTestCurrency' &&\n $charge->getOrderId() === 'orderId' &&\n $charge->getInvoiceId() === 'invoiceId' &&\n $newPayment instanceof Payment &&\n $newPayment === $payment &&\n in_array($charge, $newPayment->getCharges(), true);\n }));\n\n $paymentSrv = $heidelpay->setResourceService($resourceSrvMock)->getPaymentService();\n $returnedCharge = $paymentSrv->chargePayment($payment, 1.234, 'myTestCurrency', 'orderId', 'invoiceId');\n $this->assertEquals([$returnedCharge], $payment->getCharges());\n }", "public function setUp()\n {\n $this->object = new BindParamBuilder();\n }", "protected function setUp() {\n $this->object = new LyvDAL;\n }", "public function setUp()\n\t{\n\t\tparent::setUp();\n\n\t\t$this->user = \\Orchestra\\Model\\User::find(1);\n\t\t$this->stub = \\Orchestra\\Memory::make('user');\n\t}", "public function __construct()\n {\n if ( config('services.paypal.settings.mode') === 'live' ) {\n $this->paypalClientId = config('services.paypal.live_client_id');\n $this->paypalSecret = config('services.paypal.live_secret');\n } else {\n $this->paypalClientId = config('services.paypal.sandbox_client_id');\n $this->paypalSecret = config('services.paypal.sandbox_secret');\n }\n \n // Set the Paypal API Context/Credentials\n $this->paypalApiContext = new \\PayPal\\Rest\\ApiContext(new \\PayPal\\Auth\\OAuthTokenCredential($this->paypalClientId, $this->paypalSecret));\n $this->paypalApiContext->setConfig(config('services.paypal.settings'));\n }", "public function setUp() : void {\n parent::setUp();\n\n $this->companyRepositoryInterface = Mockery::mock(CompanyRepositoryInterface::class);\n $this->app->instance(CompanyRepositoryInterface::class, $this->companyRepositoryInterface);\n\n $this->companyGetService = App::make(CompanyGetService::class);\n }", "protected function setUp() {\n $this->object = new cartInitUnitTest;\n }", "protected function setUp()\n {\n $this->manager = Manager::getInstance()\n ->setEndpoint($this->endpoint)\n ->setProxy($this->proxy);\n }" ]
[ "0.6815441", "0.6656416", "0.6653331", "0.6648101", "0.6602994", "0.6554967", "0.65218765", "0.64062667", "0.63980705", "0.6389277", "0.6344419", "0.63276976", "0.6322218", "0.63045365", "0.6291064", "0.6282035", "0.6265328", "0.6228656", "0.6207399", "0.61981505", "0.61429495", "0.61384916", "0.6120302", "0.6079359", "0.60708696", "0.6059052", "0.60566163", "0.60491705", "0.604308", "0.60280675", "0.60256445", "0.602136", "0.5983513", "0.5975501", "0.5975308", "0.5959611", "0.5959611", "0.59525377", "0.5931676", "0.5926561", "0.5911956", "0.5908424", "0.59025747", "0.59000856", "0.5894706", "0.58626926", "0.58554345", "0.5851945", "0.5850837", "0.5845003", "0.58370924", "0.58337647", "0.5830382", "0.58238286", "0.5812089", "0.5810452", "0.5804638", "0.5803293", "0.5800989", "0.5800765", "0.58004683", "0.57966626", "0.5795223", "0.5794817", "0.57906896", "0.57901037", "0.5787703", "0.57726055", "0.5761122", "0.57608557", "0.5756002", "0.5753319", "0.5751409", "0.57481796", "0.57480997", "0.5743014", "0.5738697", "0.57356423", "0.57327616", "0.5728317", "0.5728317", "0.5727038", "0.5726829", "0.5726751", "0.57258976", "0.5724618", "0.5713117", "0.5710403", "0.5707663", "0.57064885", "0.57038146", "0.5696086", "0.5693302", "0.56869686", "0.56857294", "0.5685147", "0.56830174", "0.5680925", "0.5677075", "0.5676586" ]
0.7422001
0
Get form for columns
public function __construct() { $form = $this->form(Company::class); $model = \Platform\Models\Company::first()->getFillable(); $columns = $form->getFields(); // Remove columns array_forget($columns, [ 'password', 'logo', 'role', 'users', 'projects', 'header1', 'header2', 'header3', 'header4', 'header5', 'header6', 'header7', 'header8', 'header9', 'header10', 'default', 'notes', 'back', 'submit' ]); $table_columns = []; $header_names = []; foreach ($columns as $column_name => $column) { $options = $column->getOptions(); $table_columns[] = $column_name; $header_names[] = $options['label']; } // Add columns for export array_unshift($table_columns, 'id'); array_unshift($header_names, 'ID'); $header_names[] = 'Created at'; $header_names[] = 'Created by'; $header_names[] = 'Updated at'; $header_names[] = 'Updated by'; $table_columns[] = 'created_at'; $table_columns[] = 'created_by'; $table_columns[] = 'updated_at'; $table_columns[] = 'updated_by'; $this->table_columns = $table_columns; $this->header_names = $header_names; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function column()\r\n {\r\n if (!empty($this->configs->column))\r\n return $this->configs->column;\r\n\r\n\r\n $return = [];\r\n \r\n $raws = Form::column();\r\n $columns = [];\r\n foreach ($raws as $key => $item) {\r\n $columns[$key] = $item(new FormDb());\r\n }\r\n foreach ($columns as $key => $item) {\r\n\r\n $return[$key] = function (FormDb $column) use ($key, $item) {\r\n\r\n /** @var FormDb $item */\r\n $column->title = $item->title;\r\n $column->widget = $item->widget;\r\n $column->value = $item->value;\r\n //start: MurodovMirbosit 05.10.2020\r\n $column->data = $item->data;\r\n $column->dbType = $item->dbType;\r\n $column->readonly = $item->readonly;\r\n $column->readonlyWidget = $item->readonlyWidget;\r\n $column->valueWidget = $item->valueWidget;\r\n $column->filterWidget = $item->filterWidget;\r\n $column->dynaWidget = $item->dynaWidget;\r\n $column->options = $item->options;\r\n $column->valueOptions = $item->valueOptions;\r\n $column->filterOptions = $item->filterOptions;\r\n $column->dynaOptions = $item->dynaOptions;\r\n $column->fkTable = $item->fkTable;\r\n $column->fkQuery = $item->fkQuery;\r\n $column->fkOrQuery = $item->fkOrQuery;\r\n $column->fkAttr = $item->fkAttr;\r\n $column->fkAndQuery = $item->fkAndQuery;\r\n $column->fkMulti = $item->fkMulti;\r\n $column->autoValue = $item->autoValue;\r\n $column->auto = $item->auto;\r\n //end 19lines\r\n return $column;\r\n };\r\n }\r\n\r\n\r\n return $return;\r\n\r\n\r\n }", "public function column()\r\n {\r\n if (!empty($this->configs->column))\r\n return $this->configs->column;\r\n\r\n return ZArrayHelper::merge(parent::column(), [\r\n \r\n 'user' => function (Form $column) {\r\n\r\n $column->title = Az::l('Пользователь');\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'amount' => function (Form $column) {\r\n\r\n $column->title = Az::l('Количество потоков');\r\n \r\n return $column;\r\n },\r\n \r\n \r\n \r\n\r\n\r\n\r\n ], $this->configs->replace);\r\n }", "public function form_columns($form_id){\n $columns = 0;\n \treturn $columns;\n\n }", "public function getFormInputView($column)\n {\n ob_start();\n $columnName = $column['name'];\n if (isset($this->formInputView[$columnName])) {\n call_user_func($this->formInputView[$columnName], $column, $this->Model, $this);\n } else {\n $inputType = $column['type'];\n $value = $this->Model[$columnName];\n switch ($inputType) {\n case \"select\":\n $value = isset($this->formInputFiller[$columnName][$value]) ?\n $this->formInputFiller[$columnName][$value] : $value;\n default:\n ?>\n <div class=\"form-content\"><?php echo $value; ?></div>\n <?php\n break;\n }\n }\n $output = ob_get_contents();\n ob_end_clean();\n return $output;\n }", "function make_form_row(){\n\t\tswitch($this->fieldType){\n\t\t\tcase 'id':\n\t\t\t\treturn $this->obo_id();\n\t\t\t\tbreak;\n\t\t\tcase 'term':\n\t\t\t\treturn $this->obo_term();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$form = parent::make_form_row();\n\t\t\n\t\t}\n\t\treturn $form;\n\t\n\t}", "public function form_fields() {\n\t\treturn apply_filters( \"appthemes_{$this->box_id}_metabox_fields\", $this->form() );\n\t}", "public function getForm();", "function make_form_row(){\n\t\t$index = $this->col_index;\n\t\t# remove the * at the start of the first line\n\t\t$this->col_data = preg_replace(\"/^\\*/\",\"\",$this->col_data);\n\t\t# split the lines and remove the * from each. The value in each line goes into the array $values\n\t\t$values = preg_split(\"/\\n\\*?/\", $this->col_data);\n\t\t# pad the values array to make sure there are 3 entries\n\t\t$values = array_pad($values, 3, \"\");\n\t\t\n\t\t/*\n\t\tmake three input boxes. TableEdit takes row input from an input array named field a \n\t\tvalue for a particular field[$index] can be an array\n\t\t\tfield[$index][] is the field name\n\t\t\t40 is the length of the box\n\t\t\t$value is the value for the ith line\n\t\t \n\t\t */\n\t\t $form = ''; #initialize\n\t\t foreach($values as $i => $value){\n\t\t\t$form .= \"$i:\".XML::input(\"field[$index][]\",40,$value, array('maxlength'=>255)).\"<br>\\n\";\n\t\t}\n\t\treturn $form;\n\t\n\t}", "public function formColumn()\n {\n $forms = [\n 'date' => [\n 'label' => trans('postman::dashboard.date'),\n 'rule' => [\n 'required'=> true, 'message'=> 'Please input Activity name', 'trigger'=> 'blur',\n ]\n ],\n 'theme' => [\n 'label' => trans('postman::dashboard.email.theme'),\n ],\n 'text' => [\n 'label' => trans('postman::dashboard.email.text'),\n ],\n 'type' => [\n 'label' => trans('postman::dashboard.mode.name'),\n 'placeholder' => trans('postman::dashboard.mode.placeholder'),\n ],\n 'users' => [\n 'label' => trans('postman::dashboard.users.name'),\n 'placeholder' => trans('postman::dashboard.users.placeholder'),\n ],\n 'statuses' => [\n 'label' => trans('postman::dashboard.statuses.name'),\n 'placeholder' => trans('postman::dashboard.statuses.placeholder'),\n ],\n 'button' => [\n 'success' => trans('postman::dashboard.form.button.success'),\n 'cancel' => trans('postman::dashboard.form.button.cancel'),\n ],\n 'popup' => [\n 'question' => trans('postman::dashboard.popup.question'),\n 'title' => trans('postman::dashboard.popup.title'),\n 'confirmButtonText' => trans('postman::dashboard.popup.confirmButtonText'),\n 'cancelButtonText' => trans('postman::dashboard.popup.cancelButtonText'),\n 'success.message' => trans('postman::dashboard.popup.success.message'),\n 'info.message' => trans('postman::dashboard.popup.info.message'),\n ],\n ];\n\n return response()->json($forms);\n }", "public function get_columns() {\n\t\treturn array(\n\t\t\t'cb' => '<input type=\"checkbox\" />',\n\t\t\t'first_name' => __( 'First Name', 'wdaf' ),\n\t\t\t'last_name' => __( 'Last Name', 'wdaf' ),\n\t\t\t'email' => __( 'Email', 'wdaf' ),\n\t\t\t'present_address' => __( 'Address', 'wdaf' ),\n\t\t\t'phone' => __( 'Phone', 'wdaf' ),\n\t\t\t'created_date' => __( 'Date', 'wdaf' ),\n\t\t);\n\t}", "function getFormHTML()\n\t{\n\t\tstatic $id_num = 1000;\n\n\t\t$type = $this->type;\n\t\t$name = $this->name;\n\t\t$value = $this->_getTypeValue($this->type, $this->value);\n\t\t$default = $this->_getTypeValue($this->type, $this->default);\n\t\t$column_name = 'extra_vars' . $this->idx;\n\t\t$tmp_id = $column_name . '-' . $id_num++;\n\n\t\t$buff = array();\n\t\tswitch($type)\n\t\t{\n\t\t\t// Homepage\n\t\t\tcase 'homepage' :\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '\" value=\"' . $value . '\" class=\"homepage\" />';\n\t\t\t\tbreak;\n\t\t\t// Email Address\n\t\t\tcase 'email_address' :\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '\" value=\"' . $value . '\" class=\"email_address\" />';\n\t\t\t\tbreak;\n\t\t\t// Phone Number\n\t\t\tcase 'tel' :\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '[]\" value=\"' . $value[0] . '\" size=\"4\" maxlength=\"4\" class=\"tel\" />';\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '[]\" value=\"' . $value[1] . '\" size=\"4\" maxlength=\"4\" class=\"tel\" />';\n\t\t\t\t$buff[] = '<input type=\"text\" name=\"' . $column_name . '[]\" value=\"' . $value[2] . '\" size=\"4\" maxlength=\"4\" class=\"tel\" />';\n\t\t\t\tbreak;\n\t\t\t// textarea\n\t\t\tcase 'textarea' :\n\t\t\t\t$buff[] = '<textarea name=\"' . $column_name . '\" rows=\"8\" cols=\"42\">' . $value . '</textarea>';\n\t\t\t\tbreak;\n\t\t\t// multiple choice\n\t\t\tcase 'checkbox' :\n\t\t\t\t$buff[] = '<ul>';\n\t\t\t\tforeach($default as $v)\n\t\t\t\t{\n\t\t\t\t\t$checked = '';\n\t\t\t\t\tif($value && in_array(trim($v), $value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$checked = ' checked=\"checked\"';\n\t\t\t\t\t}\n\n\t\t\t\t\t// Temporary ID for labeling\n\t\t\t\t\t$tmp_id = $column_name . '-' . $id_num++;\n\n\t\t\t\t\t$buff[] =' <li><input type=\"checkbox\" name=\"' . $column_name . '[]\" id=\"' . $tmp_id . '\" value=\"' . htmlspecialchars($v, ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '\" ' . $checked . ' /><label for=\"' . $tmp_id . '\">' . $v . '</label></li>';\n\t\t\t\t}\n\t\t\t\t$buff[] = '</ul>';\n\t\t\t\tbreak;\n\t\t\t// single choice\n\t\t\tcase 'select' :\n\t\t\t\t$buff[] = '<select name=\"' . $column_name . '\" class=\"select\">';\n\t\t\t\tforeach($default as $v)\n\t\t\t\t{\n\t\t\t\t\t$selected = '';\n\t\t\t\t\tif($value && in_array(trim($v), $value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$selected = ' selected=\"selected\"';\n\t\t\t\t\t}\n\t\t\t\t\t$buff[] = ' <option value=\"' . $v . '\" ' . $selected . '>' . $v . '</option>';\n\t\t\t\t}\n\t\t\t\t$buff[] = '</select>';\n\t\t\t\tbreak;\n\t\t\t// radio\n\t\t\tcase 'radio' :\n\t\t\t\t$buff[] = '<ul>';\n\t\t\t\tforeach($default as $v)\n\t\t\t\t{\n\t\t\t\t\t$checked = '';\n\t\t\t\t\tif($value && in_array(trim($v), $value))\n\t\t\t\t\t{\n\t\t\t\t\t\t$checked = ' checked=\"checked\"';\n\t\t\t\t\t}\n\n\t\t\t\t\t// Temporary ID for labeling\n\t\t\t\t\t$tmp_id = $column_name . '-' . $id_num++;\n\n\t\t\t\t\t$buff[] = '<li><input type=\"radio\" name=\"' . $column_name . '\" id=\"' . $tmp_id . '\" ' . $checked . ' value=\"' . $v . '\" class=\"radio\" /><label for=\"' . $tmp_id . '\">' . $v . '</label></li>';\n\t\t\t\t}\n\t\t\t\t$buff[] = '</ul>';\n\t\t\t\tbreak;\n\t\t\t// date\n\t\t\tcase 'date' :\n\t\t\t\t// datepicker javascript plugin load\n\t\t\t\tContext::loadJavascriptPlugin('ui.datepicker');\n\n\t\t\t\t$buff[] = '<input type=\"hidden\" name=\"' . $column_name . '\" value=\"' . $value . '\" />'; \n\t\t\t\t$buff[] =\t'<input type=\"text\" id=\"date_' . $column_name . '\" value=\"' . zdate($value, 'Y-m-d') . '\" class=\"date\" />';\n\t\t\t\t$buff[] =\t'<input type=\"button\" value=\"' . Context::getLang('cmd_delete') . '\" class=\"btn\" id=\"dateRemover_' . $column_name . '\" />';\n\t\t\t\t$buff[] =\t'<script type=\"text/javascript\">';\n\t\t\t\t$buff[] = '//<![CDATA[';\n\t\t\t\t$buff[] =\t'(function($){';\n\t\t\t\t$buff[] =\t'$(function(){';\n\t\t\t\t$buff[] =\t' var option = { dateFormat: \"yy-mm-dd\", changeMonth:true, changeYear:true, gotoCurrent:false, yearRange:\\'-100:+10\\', onSelect:function(){';\n\t\t\t\t$buff[] =\t' $(this).prev(\\'input[type=\"hidden\"]\\').val(this.value.replace(/-/g,\"\"))}';\n\t\t\t\t$buff[] =\t' };';\n\t\t\t\t$buff[] =\t' $.extend(option,$.datepicker.regional[\\'' . Context::getLangType() . '\\']);';\n\t\t\t\t$buff[] =\t' $(\"#date_' . $column_name . '\").datepicker(option);';\n\t\t\t\t$buff[] =\t' $(\"#dateRemover_' . $column_name . '\").click(function(){';\n\t\t\t\t$buff[] =\t' $(this).siblings(\"input\").val(\"\");';\n\t\t\t\t$buff[] =\t' return false;';\n\t\t\t\t$buff[] =\t' })';\n\t\t\t\t$buff[] =\t'});';\n\t\t\t\t$buff[] =\t'})(jQuery);';\n\t\t\t\t$buff[] = '//]]>';\n\t\t\t\t$buff[] = '</script>';\n\t\t\t\tbreak;\n\t\t\t// address\n\t\t\tcase \"kr_zip\" :\n\t\t\t\tif(($oKrzipModel = getModel('krzip')) && method_exists($oKrzipModel , 'getKrzipCodeSearchHtml' ))\n\t\t\t\t{\n\t\t\t\t\t$buff[] = $oKrzipModel->getKrzipCodeSearchHtml($column_name, $value);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t// General text\n\t\t\tdefault :\n\t\t\t\t$buff[] =' <input type=\"text\" name=\"' . $column_name . '\" value=\"' . ($value ? $value : $default) . '\" class=\"text\" />';\n\t\t}\n\t\tif($this->desc)\n\t\t{\n\t\t\t$oModuleController = getController('module');\n\t\t\t$oModuleController->replaceDefinedLangCode($this->desc);\n\t\t\t$buff[] = '<p>' . htmlspecialchars($this->desc, ENT_COMPAT | ENT_HTML401, 'UTF-8', false) . '</p>';\n\t\t}\n\t\t\n\t\treturn join(PHP_EOL, $buff);\n\t}", "public function column()\r\n {\r\n if (!empty($this->configs->column))\r\n return $this->configs->column;\r\n\r\n return ZArrayHelper::merge(parent::column(), [\r\n\r\n 'program' => function (FormDb $column) {\r\n\r\n $column->index = true;\r\n $column->title = Az::l('Программа Обучения');\r\n $column->tooltip = Az::l('Программа Обучения Стипендианта');\r\n $column->dbType = dbTypeString;\r\n $column->data = [\r\n 'intern' => Az::l('Стажировка'),\r\n 'doctors' => Az::l('Докторантура'),\r\n 'masters' => Az::l('Магистратура'),\r\n 'qualify' => Az::l('Повышение квалификации'),\r\n ];\r\n $column->rules = [\r\n [\r\n 'zetsoft\\\\system\\\\validate\\\\ZRequiredValidator',\r\n ],\r\n ];\r\n $column->widget = ZKSelect2Widget::class;\r\n\r\n //start|AlisherXayrillayev|2020-10-16\r\n //$column->ajax = false;\r\n //end|AlisherXayrillayev|2020-10-16\r\n\r\n return $column;\r\n },\r\n\r\n 'currency' => function (FormDb $column) {\r\n\r\n $column->title = Az::l('Валюта');\r\n $column->tooltip = Az::l('Валюта');\r\n $column->dbType = dbTypeString;\r\n $column->data = CurrencyData::class;\r\n $column->widget = ZKSelect2Widget::class;\r\n $column->rules = ZRequiredValidator::class;\r\n //start|AlisherXayrillayev|2020-10-16\r\n $column->ajax = false;\r\n //end|AlisherXayrillayev|2020-10-16\r\n\r\n return $column;\r\n },\r\n\r\n\r\n 'email' => function (FormDb $column) {\r\n\r\n $column->index = true;\r\n $column->title = Az::l('E-mail');\r\n $column->tooltip = Az::l('Электронный адрес стипендианта (E-mail)');\r\n $column->dbType = dbTypeString;\r\n $column->rules = [\r\n [\r\n 'zetsoft\\\\system\\\\validate\\\\ZRequiredValidator',\r\n ],\r\n [\r\n validatorEmail,\r\n ],\r\n [\r\n validatorUnique,\r\n ],\r\n ];\r\n $column->hiddenFromExport = true;\r\n $column->changeSave = true;\r\n return $column;\r\n },\r\n\r\n 'passport' => function (FormDb $column) {\r\n\r\n $column->index = true;\r\n $column->title = Az::l('Серия и номер паспорта');\r\n $column->tooltip = Az::l('Серия и номер паспорта стипендианта');\r\n $column->dbType = dbTypeString;\r\n $column->rules = [\r\n [\r\n 'zetsoft\\\\system\\\\validate\\\\ZRequiredValidator',\r\n ],\r\n [\r\n validatorUnique,\r\n ],\r\n ];\r\n $column->widget = ZInputMaskWidget::class;\r\n $column->options = [\r\n 'config' => [\r\n 'type' => 'ready',\r\n 'ready' => 'AA-9999999',\r\n ],\r\n ];\r\n \r\n return $column;\r\n },\r\n\r\n\r\n 'passport_give' => function (FormDb $column) {\r\n\r\n $column->title = Az::l('Когда и кем выдан');\r\n $column->tooltip = Az::l('Когда и кем выдан пасспорт');\r\n $column->dbType = dbTypeString;\r\n $column->rules = [\r\n [\r\n 'zetsoft\\\\system\\\\validate\\\\ZRequiredValidator',\r\n ],\r\n ];\r\n\r\n return $column;\r\n },\r\n\r\n\r\n 'birthdate' => function (FormDb $column) {\r\n\r\n $column->title = Az::l('Дата рождение');\r\n $column->tooltip = Az::l('Дата рождение стипендианта');\r\n $column->dbType = dbTypeDate;\r\n $column->rules = [\r\n [\r\n 'zetsoft\\\\system\\\\validate\\\\ZRequiredValidator',\r\n ],\r\n ];\r\n $column->auto = true;\r\n $column->value = function (EyufScholar $model) {\r\n return Az::$app->cores->date->fbDate();\r\n };\r\n $column->widget = ZKDatepickerWidget::class;\r\n\r\n return $column;\r\n },\r\n\r\n\r\n 'user_id' => function (FormDb $column) {\r\n\r\n $column->title = Az::l('Пользователь');\r\n $column->tooltip = Az::l('Пользователь');\r\n $column->dbType = dbTypeInteger;\r\n $column->showForm = false;\r\n $column->widget = ZKSelect2Widget::class;\r\n\r\n return $column;\r\n },\r\n\r\n\r\n 'place_country_id' => function (FormDb $column) {\r\n\r\n $column->index = true;\r\n $column->title = Az::l('Страна обучение');\r\n $column->tooltip = Az::l('Страна обучения пользователя');\r\n $column->dbType = dbTypeInteger;\r\n $column->rules = [\r\n [\r\n 'zetsoft\\\\system\\\\validate\\\\ZRequiredValidator',\r\n ],\r\n ];\r\n $column->widget = ZKSelect2Widget::class;\r\n\r\n return $column;\r\n },\r\n\r\n\r\n 'status' => function (FormDb $column) {\r\n\r\n $column->index = true;\r\n $column->title = Az::l('Статус');\r\n $column->tooltip = Az::l('Статус стипендианта');\r\n $column->dbType = dbTypeString;\r\n $column->data = [\r\n 'register' => Az::l('Стипендиант зарегистрирован'),\r\n 'docReady' => Az::l('Все документы загружены'),\r\n 'stipend' => Az::l('Утвержден отделом стипендий'),\r\n 'accounter' => Az::l('Утвержден отделом бухгалтерии'),\r\n 'education' => Az::l('Учеба завершена'),\r\n 'process' => Az::l('Учеба завершена'),\r\n ];\r\n\r\n //start|JakhongirKudratov|2020-10-27\r\n\r\n $column->event = function (EyufScholar $model) {\r\n Az::$app->App->eyuf->scholar->sendNotify($model);\r\n\r\n };\r\n\r\n //end|JakhongirKudratov|2020-10-27\r\n\r\n $column->widget = ZKSelect2Widget::class;\r\n\r\n //start|AlisherXayrillayev|2020-10-16\r\n $column->ajax = false;\r\n //end|AlisherXayrillayev|2020-10-16\r\n\r\n $column->showForm = false;\r\n $column->width = '200px';\r\n $column->hiddenFromExport = true;\r\n /*$column->roleShow = [\r\n 'scholar',\r\n 'user',\r\n 'guest',\r\n 'admin',\r\n 'accounter'\r\n ];*/\r\n\r\n return $column;\r\n },\r\n\r\n 'age' => function (FormDb $column) {\r\n\r\n $column->title = Az::l('Возраст');\r\n $column->tooltip = Az::l('Возраст стипендианта');\r\n $column->dbType = dbTypeInteger;\r\n $column->autoValue = function (EyufScholar $model) {\r\n return Az::$app->App->eyuf->user->getAge($model->birthdate);\r\n };\r\n\r\n $column->rules = [\r\n [\r\n validatorInteger,\r\n ],\r\n ];\r\n\r\n\r\n $column->showForm = false;\r\n\r\n return $column;\r\n },\r\n\r\n\r\n 'edu_start' => function (FormDb $column) {\r\n\r\n $column->title = Az::l('Начала обучения');\r\n $column->tooltip = Az::l('Начала обучения стипендианта');\r\n $column->dbType = dbTypeDate;\r\n $column->widget = ZKDatepickerWidget::class;\r\n $column->options = [\r\n 'config' => [\r\n 'type' => 2,\r\n 'pickerButton' => [\r\n 'icon' => '',\r\n ],\r\n 'pluginOptions' => [\r\n 'autoclose' => true,\r\n 'format' => 'dd-M-yyyy',\r\n ],\r\n 'hasIcon' => true,\r\n ],\r\n ];\r\n\r\n return $column;\r\n },\r\n\r\n\r\n 'edu_end' => function (FormDb $column) {\r\n\r\n $column->title = Az::l('Завершение обучения');\r\n $column->tooltip = Az::l('Завершение обучения стипендианта');\r\n $column->dbType = dbTypeDate;\r\n $column->widget = ZKDatepickerWidget::class;\r\n $column->options = [\r\n 'config' => [\r\n 'type' => 2,\r\n 'pickerButton' => [\r\n 'icon' => '',\r\n ],\r\n 'pluginOptions' => [\r\n 'autoclose' => true,\r\n 'format' => 'dd-M-yyyy',\r\n ],\r\n 'hasIcon' => true,\r\n ],\r\n ];\r\n\r\n return $column;\r\n },\r\n\r\n\r\n 'user_company_id' => function (FormDb $column) {\r\n\r\n $column->index = true;\r\n $column->title = Az::l('Вышестоящая организация');\r\n $column->tooltip = Az::l('Вышестоящая организация');\r\n $column->dbType = dbTypeInteger;\r\n $column->rules = [\r\n [\r\n 'zetsoft\\\\system\\\\validate\\\\ZRequiredValidator',\r\n ],\r\n ];\r\n $column->widget = ZKSelect2Widget::class;\r\n\r\n return $column;\r\n },\r\n\r\n\r\n 'company_type' => function (FormDb $column) {\r\n\r\n $column->title = Az::l('Тип рабочего места');\r\n $column->tooltip = Az::l('Тип рабочего места стипендианта');\r\n $column->dbType = dbTypeString;\r\n\r\n return $column;\r\n },\r\n\r\n\r\n 'edu_area' => function (FormDb $column) {\r\n\r\n $column->title = Az::l('Область знаний');\r\n $column->tooltip = Az::l('Область знаний стипендианта');\r\n $column->dbType = dbTypeString;\r\n\r\n return $column;\r\n },\r\n\r\n\r\n 'edu_sector' => function (FormDb $column) {\r\n\r\n $column->title = Az::l('Сектор образования');\r\n $column->tooltip = Az::l('Сектор образования стипендианта');\r\n $column->dbType = dbTypeString;\r\n\r\n return $column;\r\n },\r\n\r\n\r\n 'edu_type' => function (FormDb $column) {\r\n\r\n $column->title = Az::l('Направление образования');\r\n $column->tooltip = Az::l('Направление образования стипендианта');\r\n $column->dbType = dbTypeString;\r\n\r\n return $column;\r\n },\r\n\r\n\r\n 'speciality' => function (FormDb $column) {\r\n\r\n $column->title = Az::l('Специальность');\r\n $column->tooltip = Az::l('Специальность стипендианта');\r\n $column->dbType = dbTypeString;\r\n\r\n return $column;\r\n },\r\n\r\n\r\n 'edu_place' => function (FormDb $column) {\r\n\r\n $column->title = Az::l('Место обучения(ВУЗ)');\r\n $column->tooltip = Az::l('Место обучения(ВУЗ) стипендианта');\r\n $column->dbType = dbTypeInteger;\r\n\r\n return $column;\r\n },\r\n\r\n\r\n 'finance' => function (FormDb $column) {\r\n\r\n $column->title = Az::l('Источник финансирования');\r\n $column->tooltip = Az::l('Источник финансирования стипендианта');\r\n $column->dbType = dbTypeInteger;\r\n //start|AsrorZakirov|2020-10-25\r\n\r\n $column->showForm = false;\r\n\r\n//end|AsrorZakirov|2020-10-25\r\n\r\n return $column;\r\n },\r\n\r\n\r\n 'address' => function (FormDb $column) {\r\n\r\n $column->title = Az::l('Постоянный адрес проживания');\r\n $column->tooltip = Az::l('Постоянный адрес проживания стипендианта');\r\n $column->dbType = dbTypeString;\r\n $column->hiddenFromExport = true;\r\n\r\n return $column;\r\n },\r\n\r\n\r\n 'phone' => function (FormDb $column) {\r\n\r\n $column->title = Az::l('Сотовый телефон');\r\n $column->tooltip = Az::l('Сотовый телефон стипендианта');\r\n $column->dbType = dbTypeString;\r\n $column->rules = [\r\n [\r\n 'zetsoft\\\\system\\\\validate\\\\ZRequiredValidator',\r\n ],\r\n [\r\n validatorUnique,\r\n ],\r\n ];\r\n $column->widget = ZInputMaskWidget::class;\r\n $column->options = [\r\n 'config' => [\r\n 'ready' => '99-999-99-99',\r\n ],\r\n ];\r\n $column->hiddenFromExport = true;\r\n\r\n return $column;\r\n },\r\n\r\n\r\n 'home_phone' => function (FormDb $column) {\r\n\r\n $column->title = Az::l('Домашний Телефон');\r\n $column->tooltip = Az::l('Домашний Телефон Стипендианта');\r\n $column->dbType = dbTypeString;\r\n $column->widget = ZInputMaskWidget::class;\r\n $column->options = [\r\n 'config' => [\r\n 'ready' => '99-999-99-99',\r\n ],\r\n ];\r\n $column->hiddenFromExport = true;\r\n\r\n return $column;\r\n },\r\n\r\n\r\n 'position' => function (FormDb $column) {\r\n\r\n $column->title = Az::l('Должность');\r\n $column->tooltip = Az::l('Должность стипендианта');\r\n $column->dbType = dbTypeString;\r\n\r\n return $column;\r\n },\r\n\r\n\r\n 'experience' => function (FormDb $column) {\r\n\r\n $column->title = Az::l('Стаж работы (месяц)');\r\n $column->tooltip = Az::l('Стаж работы стипендианта (месяц)');\r\n $column->dbType = dbTypeString;\r\n $column->rules = [\r\n [\r\n 'zetsoft\\\\system\\\\validate\\\\ZRequiredValidator',\r\n ],\r\n [\r\n validatorInteger,\r\n ],\r\n ];\r\n $column->widget = ZKTouchSpinWidget::class;\r\n\r\n return $column;\r\n },\r\n\r\n\r\n 'completed' => function (FormDb $column) {\r\n\r\n $column->title = Az::l('Обучение завершено?');\r\n $column->tooltip = Az::l('Завершено ли обучение стипендианта?');\r\n $column->dbType = dbTypeBoolean;\r\n $column->widget = ZKSwitchInputWidget::class;\r\n\r\n return $column;\r\n },\r\n\r\n\r\n ], $this->configs->replace);\r\n }", "abstract function getForm();", "function get_columns()\n\t{\n\t\t$columns = [\n\t\t\t'cb' => '<input type=\"checkbox\" />',\n\t\t\t'name' => __('Name'),\n\t\t\t'address' => __('Address'),\n\t\t\t'email' => __('Email'),\n\t\t\t'mobileNo' => __('Mobile No'),\n\t\t\t'post' => __('Post Name'),\n\t\t\t'cv' => __('CV'),\n\t\t\t'stime' => __('Submission Date'),\n\t\t];\n\n\t\treturn $columns;\n\t}", "function get_columns()\n {\n $columns = array(\n 'cb' => '<input type=\"checkbox\" />', //Render a checkbox instead of text\n// 'type' => 'Type',\n// 'name' => 'Name',\n 'tag' => 'Shortcode Name',\n 'kind' => 'Kind',\n 'description' => 'Description',\n 'example' => 'Example',\n 'code' => 'Code',\n 'created_datetime' => 'Created Datetime'\n );\n return $columns;\n }", "abstract protected function getForm();", "public static function formrow(){\n\n\n $forms = \"<tr class='row100 body'>\\n\";\n $forms .= \"<td class='cell100 column1'>\";\n return $forms;\n }", "public function get_columns()\n\t{\n\t\treturn array(\n\t\t\t'cb' => '<input type=\"checkbox\" />',\n\t\t\t'data' \t => 'Data',\n\t\t\t'timestamp' => 'Timestamp',\n\t\t);\n\t}", "public function column()\r\n {\r\n if (!empty($this->configs->column))\r\n return $this->configs->column;\r\n\r\n return ZArrayHelper::merge(parent::column(), [\r\n \r\n 'id' => function (Form $column) {\r\n\r\n $column->title = Az::l('№');\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'catalogId' => function (Form $column) {\r\n\r\n $column->title = Az::l('Каталог');\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'name' => function (Form $column) {\r\n\r\n $column->title = Az::l('Магазин');\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'amount' => function (Form $column) {\r\n\r\n $column->title = Az::l('Количество');\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'title' => function (Form $column) {\r\n\r\n $column->title = Az::l('Краткая информация');\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'url' => function (Form $column) {\r\n\r\n $column->title = Az::l('URL');\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'visible' => function (Form $column) {\r\n\r\n $column->title = Az::l('Видимость');\r\n $column->dbType = dbTypeBoolean;\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'image' => function (Form $column) {\r\n\r\n $column->title = Az::l('Логотип');\r\n $column->widget = ZImageWidget::class;\r\n $column->options = [\r\n\t\t\t\t\t\t'config' =>[\r\n\t\t\t\t\t\t\t'width' => '100px',\r\n\t\t\t\t\t\t\t'height' => '100px',\r\n\t\t\t\t\t\t],\r\n\t\t\t\t\t];\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'new_price' => function (Form $column) {\r\n\r\n $column->title = Az::l('Цена');\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'price_old' => function (Form $column) {\r\n\r\n $column->title = Az::l('Старая цена');\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'currency' => function (Form $column) {\r\n\r\n $column->title = Az::l('Валюта');\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'currencyType' => function (Form $column) {\r\n\r\n $column->title = Az::l('Валюта');\r\n $column->data = [\r\n 'before' => Az::l('Перед'),\r\n 'after' => Az::l('После'),\r\n ];\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'cart_amount' => function (Form $column) {\r\n\r\n $column->title = Az::l('Количество');\r\n $column->value = 0;\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'delivery_type' => function (Form $column) {\r\n\r\n $column->title = Az::l('Тип доставки');\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'delivery_price' => function (Form $column) {\r\n\r\n $column->title = Az::l('Цена доставки');\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'review_count' => function (Form $column) {\r\n\r\n $column->title = Az::l('Количество отзывов');\r\n $column->value = 0;\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'measure' => function (Form $column) {\r\n\r\n $column->title = Az::l('Мера');\r\n $column->data = [\r\n 'pcs' => Az::l('шт'),\r\n 'm' => Az::l('м'),\r\n 'l' => Az::l('л'),\r\n 'kg' => Az::l('кг'),\r\n ];\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'measureStep' => function (Form $column) {\r\n\r\n $column->title = Az::l('Шаг измерения');\r\n $column->data = [\r\n 'pcs' => Az::l('1'),\r\n 'm' => Az::l('0.1'),\r\n 'l' => Az::l('0.1'),\r\n 'kg' => Az::l('0.1'),\r\n ];\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'rating' => function (Form $column) {\r\n\r\n $column->title = Az::l('Рейтинг');\r\n $column->widget = ZKStarRatingWidget::class;\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'cash_type' => function (Form $column) {\r\n\r\n $column->title = Az::l('Тип наличных');\r\n\r\n\r\n return $column;\r\n },\r\n \r\n \r\n 'action' => function (Form $column) {\r\n\r\n $column->title = Az::l('Действие');\r\n\r\n\r\n return $column;\r\n },\r\n \r\n\r\n ], $this->configs->replace);\r\n }", "public function get_columns() {\n\t\t$columns = array(\n\t\t\t'cb' => '<input type=\"checkbox\" />',\n\t\t\t'email' => __( 'Requester' ),\n\t\t\t'status' => __( 'Status' ),\n\t\t\t'created_timestamp' => __( 'Requested' ),\n\t\t\t'next_steps' => __( 'Next Steps' ),\n\t\t);\n\t\treturn $columns;\n\t}", "public static function getForm();", "function get_columns() {\r\n\t\t$columns = [\r\n\t\t\t'cb' => '<input type=\"checkbox\" />',\r\n\t\t\t'name' => __( 'Name', 'ac' ),\r\n\t\t\t'address' => __( 'Address', 'ac' ),\r\n\t\t\t'city' => __( 'City', 'ac' )\r\n\t\t];\r\n\r\n\t\treturn $columns;\r\n\t}", "function get_columns(){\n $columns = array(\n 'cb' => '<input type=\"checkbox\" />', //Render a checkbox instead of text\n 'name' => 'Name',\n 'job' => 'Job',\n 'text' => 'Description',\n\t\t\t'job_en' => 'Job in english',\n 'text_en' => 'Description in english',\n\t\t\t'facebook' => 'Facebook Link',\n\t\t\t'linkedin' => 'Linkedin Link',\n\t\t\t'image' => 'Photo'\n\t\t\t\n );\n return $columns;\n }", "public function getFormFiller() {}", "public function getFormFiller() {}", "public function getForms()\n {\n return ['' => 'None']+$this->select('id', 'title')->orderBy('title', 'asc')->pluck('title', 'id')->toArray();\n }", "protected abstract function retrieveFormDisplayFields(Row $row);", "abstract public function getColsFields();", "public function getFormFields() {\n $fields = array(\n 'shapes[]' => array(\n 'type' => 'select',\n 'multiplicate' => '5',\n 'values' => array(\n '-' => '-',\n 'cube' => 'cube',\n 'round' => 'round',\n )\n ),\n 'width[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Width'\n ),\n 'higth[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Higth'\n ),\n 'x_position[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'X position'\n ),\n 'y_position[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Y position'\n ),\n 'red[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Color red',\n ),\n 'green[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Color green',\n ),\n 'blue[]' => array(\n 'type' => 'text',\n 'multiplicate' => '5',\n 'label' => 'Color blue',\n ),\n 'size[]' => array(\n 'type' => 'text',\n 'multiplicate' => '1',\n 'label' => 'Size holst'\n ),\n 'enable[]' => array(\n 'type' => 'checkbox',\n 'multiplicate' => '5',\n 'label' => 'enable'\n )\n );\n return $fields;\n }", "function get_columns() {\n\n\t\treturn $columns = array(\n\t\t\t'cb'\t\t=> '<input type=\"checkbox\" />', //Render a checkbox instead of text\n\t\t\t'title'\t\t=> 'Title',\n\t\t\t'rating'\t=> 'Rating',\n\t\t\t'director'\t=> 'Director'\n\t\t);\n\t}", "function renderFormColumn($model,$natures){\n $name=$model->id;\n if(isset($natures[$name])){\n switch($natures[$name]){\n case 'text':\n return renderFormText($model);\n case 'textarea':\n return renderFormTextarea($model);\n case 'time':\n return renderFormTime($model);\n case 'datetime':\n return renderFormDateTime($model);\n default:\n return renderFormTextarea($model);\n }\n }\n else{\n return renderFormTextarea($model);\n }\n}", "function get_columns()\n {\n $columns = array(\n\n 'cb' => '<input type=\"checkbox\" />', //Render a checkbox instead of text\n 'id' => __('# ID'),\n 'user' => __('Requested From'),\n //'requested_url' => __('Requested URI'),\n 'Ip' => __('From IP'),\n 'connected_at' => __('Requested At'),\n // 'msg' => __('Message'),\n 'on_status' => __('On'), \n 'action_trig' => __('Details')\n );\n\n return $columns;\n }", "public function form(){\n\t\treturn $this->form;\n\t}", "protected function getFiltersForm(){\n $table = ORM::getTable('word');\n $name = $table->getField('name');\n $value = $table->getField('value');\n\n $pseudo = new OrmTable('pseudo_languages');\n $pseudo->addField($name);\n $pseudo->addField($value);\n $form = UI::getFormForTable($pseudo, array(), UI::LAYOUT_BLOCK);\n $form['id'] = 'word_filters';\n $form['fields']['value']['tag'] = UI::TAG_INPUT;\n unset($form['fields']['value']['title']);\n unset($form['fields']['name']['title']);\n $form['fields']['name']['attributes']['onblur'] ='Word.filterTerms()';\n $form['fields']['name']['attributes']['placeholder'] = Word::get('admin','word_name_filter');\n $form['fields']['value']['attributes']['onblur'] = 'Word.filterTerms()';\n $form['fields']['value']['attributes']['placeholder'] = Word::get('admin','word_value_filter');\n return $form;\n }", "public function getEditForm();", "public function get_columns()\r\n {\r\n $columns = array(\r\n 'cb' => '<input type=\"checkbox\" />',\r\n 'name' => 'Name',\r\n 'sku' => 'SKU',\r\n 'price' => 'Price',\r\n 'categories' => 'Categories',\r\n 'date' => 'Date'\r\n );\r\n return $columns;\r\n }", "public function getFields() {\n\t\treturn $this->tca['columns'];\n\t}", "public function getForm()\n {\n RETURN $this->strategy->getForm();\n }", "public function columns()\n {\n return array(\n array(\n 'name' => 'name', \n 'title' => 'Attribute name',\n 'attributes' => array(\n \n ),\n ),\n array(\n 'name' => 'active',\n 'type' => 'toggle',\n 'title' => 'Active', \n 'attributes' => array(\n 'id' => \"active\",\n 'value' => \"{field_id}\"\n ), \n ) \n );\n }", "protected function getFormBuilder(array $columns)\n {\n $form = $this->createFormBuilder();\n foreach ($columns as $param)\n $form = $form->add($param);\n return $form;\n }", "function get_columns() {\n $columns = array(\n 'cb' => '<input type=\"checkbox\" />',\n 'customer' => __( 'Vendor', 'wp-erp-ac' ),\n 'company' => __( 'Company', 'wp-erp-ac' ),\n 'email' => __( 'Email', 'wp-erp-ac' ),\n 'phone' => __( 'Phone', 'wp-erp-ac' ),\n 'open' => __( 'Balance', 'wp-erp-ac' ),\n );\n\n return $columns;\n }", "function getHtmlStep2Form()\r\n\t{\r\n\t\treturn $this->getAdminTableHtml( 2 );\r\n\t}", "function get_columns()\n { // global $hb_current_user_can_ap;\n $columns =\n ['cb' => '<input type=\"checkbox\" />'] + //Render a checkbox instead of text\n //($a ? ['wp_username' => 'User'] : [] )+\n ['date_added' => 'Form submitted on']+ \n //['car_holder_name' => 'Name']+\n ['venue_address' => 'Venue Address']+\n ['suburb' => 'Suburb']+\n ['post_code' => 'Post Code']+\n ['booking_date' => 'Booking Date']+\n ['view_details' => 'View Details']\n ;\n return $columns;\n }", "public function getColumnModel();", "public function get_columns()\n {\n $columns = array(\n 'cb' => '<input type=\"checkbox\" />',\n 'perusahaan' => 'Name',\n 'total_ken' => 'Total Kendaraan',\n 'total_pen' => 'Total Pengemudi',\n 'tanggal' => 'Created Date' \n );\n return $columns;\n }", "public static function generateFormRow($column)\n {\n $row = null;\n\n $name = $column->name;\n switch ($column) {\n case ($name === 'id'):\n $row = null;\n break;\n case ($column->type === 'boolean'):\n case ($name === 'published'):\n case ($name === 'visible'):\n case ($column->type === 'smallint' && $column->size === 1):\n $row = \"'{$name}' => [\n 'type' => Form::INPUT_CHECKBOX,\n ],\";\n break;\n case ($name === 'position'):\n $row = \"'position' => [\n 'type' => Form::INPUT_TEXT,\n ],\";\n break;\n case ($column->type === 'integer'):\n $row = \"'{$name}' => [\n 'type' => Form::INPUT_TEXT,\n ],\";\n break;\n case ($column->type === 'string' && $column->dbType === 'date'):\n $row = \"'{$name}' => [\n 'type' => Form::INPUT_WIDGET,\n 'widgetClass' => DatePicker::className(),\n 'convertFormat' => true,\n 'options' => [\n 'pluginOptions' => [\n 'format' => 'yyyy-mm-dd',\n ],\n ],\n ],\";\n break;\n case ($column->dbType === 'text'):\n $row = \"'{$name}' => [\n 'type' => Form::INPUT_TEXTAREA,\n 'options' => ['rows' => 5]\n ],\";\n break;\n default:\n $row = \"'{$name}' => [\n 'type' => Form::INPUT_TEXT,\n ],\";\n break;\n }\n return $row . \"\\n\";\n }", "function getHtmlStep1Form()\r\n\t{\r\n\t\treturn $this->getAdminTableHtml( 1 );\r\n\t}", "public function get_columns() {\n\n\t\treturn array(\n\t\t\t'cb' => '<input type=\"checkbox\" />',\n\t\t\t'product_id' => __( 'Product ID', 'tuxedo-software-updater' ),\n\t\t\t'user_id' => __( 'User ID', 'tuxedo-software-updater' ),\n\t\t\t'order_id' => __( 'Order ID', 'tuxedo-software-updater' ),\n\t\t\t'activations' => __( 'Activations', 'tuxedo-software-updater' ),\n\t\t\t'expires' => __( 'Expires', 'tuxedo-software-updater' ),\n\t\t\t'created' => __( 'Created', 'tuxedo-software-updater' ),\n\t\t\t'modified' => __( 'Modified', 'tuxedo-software-updater' ),\n\t\t);\n\n\t}", "public function get_columns() {\n\n\t\t\treturn array(\n\n\t\t\t\t'cb' \t\t\t\t\t=> '<input type=\"checkbox\" />',\n\n\t\t\t\t'topic_name' \t\t\t\t=> __( 'Topic Name' ),\n\n\t\t\t\t'bright_cove_video_tag'\t=> __( 'BrightCove Video Tag' ),\n\n\t\t\t\t'description' \t\t\t\t=> __( 'Description' )\n\n\t\t\t);\n\n\t\t}", "public function getFormCustomFields(){\n\t}", "public function get_tabular_form() {\n\t\treturn $this->tabular_form_relation;\n\t}", "private function getInputRow($col) {\n $row = \"\";\n if(isset($this->relnObj->AttribFlags()[$col]['isfunc'])) //This line causing problem with php 5.3(Error: ). Runs on php 5.4.\n return \"\";\n if(isset($this->relnObj->AttribFlags()[$col]['FK'])) {\n $objectType = $this->relnObj->AttribFlags()[$col]['FK'];\n $obj = new $objectType;\n $options = $obj->retrieveRecord();\n $row = \"<tr><td>$col</td>\";\n $row .= \"<td><select name=\\\"\".$col.\"\\\">\";\n foreach($options as $option) {\n $row.= \"<option value=\\\"\".$option[$obj->PrimaryKey()].\"\\\">\".\n (\n isset($this->relnObj->AttribFlags()[$col]['FK_optionAttr'])?\n $option[$this->relnObj->AttribFlags()[$col]['FK_optionAttr']]:\n $option[$obj->primaryKey]\n ).\n \"</option>\";\n }\n $row .= \"</select></td>\";\n $row .= \"</tr>\";\n }\n else {\n $row = \"<tr>\";\n $row .= \"<td>$col</td>\";\n $row .= \"<td><input type=\\\"text\\\" name=\\\"$col\\\"></td>\";\n $row .= \"</tr>\";\n }\n return $row;\n }", "public function getColumns()\n {\n return $this->select_list;\n }", "public function fields(): array\n {\n $fields = $this->getConfig('fields') ?: [];\n $config = $this->getConfig();\n\n $schema = $this->_table()->getSchema();\n $request = $this->_request();\n\n if ($fields) {\n $fields = Hash::normalize($fields);\n } else {\n $filters = $this->_table()->searchManager()->getFilters($config['collection']);\n\n foreach ($filters as $filter) {\n $opts = $filter->getConfig('form');\n if ($opts === false) {\n continue;\n }\n\n $fields[$filter->name()] = $opts ?: [];\n }\n }\n\n foreach ($fields as $field => $opts) {\n $input = [\n 'required' => false,\n 'type' => 'text',\n ];\n\n if (substr($field, -3) === '_id' && $field !== '_id') {\n $input['type'] = 'select';\n }\n\n $input = (array)$opts + $input;\n\n $input['value'] = $request->getQuery($field);\n\n if (empty($input['options']) && $schema->getColumnType($field) === 'boolean') {\n $input['options'] = [__d('crud', 'No'), __d('crud', 'Yes')];\n $input['type'] = 'select';\n }\n\n /** @psalm-suppress PossiblyUndefinedArrayOffset */\n if ($input['type'] === 'select') {\n $input += ['empty' => true];\n }\n\n if (!empty($input['options'])) {\n $input['empty'] = true;\n if (empty($input['class']) && !$config['select2']) {\n $input['class'] = 'no-select2';\n }\n\n $fields[$field] = $input;\n\n continue;\n }\n\n if (empty($input['class']) && $config['autocomplete']) {\n $input['class'] = 'autocomplete';\n }\n\n /** @psalm-suppress PossiblyUndefinedArrayOffset */\n if (\n !empty($input['class'])\n && strpos($input['class'], 'autocomplete') !== false\n && $input['type'] !== 'select'\n ) {\n $input['type'] = 'select';\n\n if (!empty($input['value'])) {\n $input['options'][$input['value']] = $input['value'];\n }\n\n $input += [\n 'data-input-type' => 'text',\n 'data-tags' => 'true',\n 'data-allow-clear' => 'true',\n 'data-placeholder' => '',\n ];\n }\n\n if (!isset($input['data-url'])) {\n $urlArgs = [];\n\n $fieldKeys = $input['fields'] ?? ['id' => $field, 'value' => $field];\n if (is_array($fieldKeys)) {\n foreach ($fieldKeys as $key => $val) {\n $urlArgs[$key] = $val;\n }\n }\n\n $input['data-url'] = Router::url(['action' => 'lookup', '_ext' => 'json', '?' => $urlArgs]);\n }\n\n unset($input['fields']);\n\n $fields[$field] = $input;\n }\n\n return $fields;\n }", "public function getForm(): Form{\n $name = str_replace('[]', '', $this->widget->get_field_name(''));\n $form = new Form($name);\n $form->setDelimiter('[');\n $form->setSuffix(']');\n ($this->formHandler)($form);\n return $form;\n }", "public function form() {\n\t\treturn array();\n\t}", "function form() \r\n {\r\n \t //El formateo va a ser realizado sobre una tabla en la que cada fila es un campo del formulario\r\n $table = &html_table($this->_width,0,2,2);\r\n $table->add_row($this->_showElement(\"Asunto\", '6', \"asunto_de_usuario\", 'Asunto', \"Asunto\", \"left\" )); \r\n $table->add_row($this->_showElement(\"Comentario\", '7', \"comentario\", 'Texto', \"Comentario\", \"left\" )); \r\n \r\n $this->set_form_tabindex(\"Aceptar\", '10'); \r\n $label = html_label( \"submit\" );\r\n $label->add($this->element_form(\"Aceptar\"));\r\n $table->add_row(html_td(\"\", \"left\", $label));\r\n \r\n return $table; \r\n }", "function getForm(){\r\n\t\t$data = [\r\n\t\t\t'EFORM' => [\r\n\t\t\t\t'formName' => $this->formName,\r\n\t\t\t\t'scope' => $this->scope,\r\n\t\t\t\t'_uid' => $this->uid,\r\n\t\t\t\t'elements' => $this->fields->getFormViewFields($this),\r\n\t\t\t\t'errors' => $this->errors,\r\n\t\t\t\t'buttons' => $this->buttons->get()\r\n\t\t\t]\r\n\t\t];\r\n\r\n\t\tif($this->actions){\r\n\t\t\t$data['EFORM']['actions'] = $this->actions->getForSmarty();\r\n\t\t}\r\n\t\tif(!empty($this->statuses)){\r\n\t\t\t$data['EFORM']['fieldStatuses'] = $this->statuses;\r\n\t\t}\r\n\r\n\t\t$view = new ViewElementClass();\r\n\t\t$view->type = 'form_start';\r\n\t\t$view->data = $data;\r\n\t\treturn $view;\r\n\t}", "public function getSearchForm()\n {\n $data = $this->getFilterTableDataForSearchForm();\n\n $selector = $this->getSelector();\n $out = $selector->buildFilterTable($data);\n\n return $out;\n }", "public function get_columns() {\n\t\t$columns = [\n\t\t\t'cb' => '<input type=\"checkbox\" />',\n\t\t\t'post_title' => __( 'Estate', 'text_domain' ),\n\t\t\t'action' => __( 'Action', 'text_domain' ),\n\t\t\t'status' => __( 'Status', 'text_domain' ),\n\t\t\t'date' => __( 'Date', 'text_domain' ),\n\t\t];\n\n\t\treturn $columns;\n\t}", "public function getColumns()\n {\n return [\n 'form' => [\n 'label' => &$GLOBALS['TL_LANG']['tl_module']['iso_order_conditions']['form'],\n 'exclude' => true,\n 'inputType' => 'select',\n 'foreignKey' => 'tl_form.title',\n 'eval' => [\n 'includeBlankOption' => true,\n 'style' => 'width:300px',\n 'chosen' => true,\n 'columnPos' => 'checkout',\n ],\n ],\n 'step' => [\n 'label' => &$GLOBALS['TL_LANG']['tl_module']['iso_order_conditions']['step'],\n 'inputType' => 'select',\n 'options_callback' => ['Isotope\\Backend\\Module\\OrderConditionFields', 'getSteps'],\n 'eval' => [\n 'decodeEntities' => true,\n 'includeBlankOption' => true,\n 'style' => 'width:300px',\n 'columnPos' => 'checkout',\n ],\n ],\n 'position' => [\n 'label' => &$GLOBALS['TL_LANG']['tl_module']['iso_order_conditions']['position'],\n 'default' => 'before',\n 'inputType' => 'select',\n 'options' => ['before', 'after'],\n 'reference' => &$GLOBALS['TL_LANG']['tl_module']['iso_order_conditions']['position'],\n 'eval' => [\n 'style' => 'width:300px',\n 'columnPos' => 'checkout',\n ],\n ],\n 'product_types' => [\n 'label' => &$GLOBALS['TL_LANG']['tl_module']['iso_order_conditions']['product_types'],\n 'inputType' => 'select',\n 'foreignKey' => 'tl_iso_producttype.name',\n 'eval' => [\n 'multiple' => true,\n 'style' => 'width:300px',\n 'columnPos' => 'product_type',\n ],\n ],\n 'product_types_condition' => [\n 'label' => &$GLOBALS['TL_LANG']['tl_module']['iso_order_conditions']['product_types_condition'],\n 'inputType' => 'select',\n 'options' => ['oneAvailable', 'allAvailable', 'onlyAvailable'],\n 'reference' => &$GLOBALS['TL_LANG']['tl_module']['iso_order_conditions']['product_types_condition'],\n 'eval' => [\n 'style' => 'width:300px',\n 'columnPos' => 'product_type',\n ],\n ],\n ];\n }", "public function getAddForm();", "function get_columns() {\n $columns = array(\n 'cb' => '<input type=\"checkbox\" />',\n 'template_name' => __('Name', 'mylisttable'),\n 'template_description' => __('Description', 'mylisttable'),\n 'create_by' => __('Created By', 'mylisttable'),\n 'create_date' => __('Create Date', 'mylisttable')\n );\n return $columns;\n }", "abstract protected function getFormTypeQuery();", "public function get_form() {\n\t\treturn $this;\n\t}", "function get_columns() {\n\t\t$columns = array(\n\t\t\t'cb' => '<input type=\"checkbox\" />',\n\t\t\t'id' => __( 'ID', 'mylisttable' ),\n\t\t\t'date' => __( 'Date', 'mylisttable' ),\n\t\t\t'uploader' => __( 'Uploader (#ID)', 'mylisttable' ),\n\t\t\t'uploader_group' => __( 'Uploader Group\t (#ID)', 'mylisttable' ),\n\t\t\t'site' => __( 'Site #ID', 'mylisttable' ),\n\t\t\t'assessment' => __( 'Assessment #ID', 'mylisttable' ),\n\t\t\t'assessment_result' => __( 'View', 'mylisttable' ),\n\t\t);\n\t\tif ( current_user_can( 'manage_options' ) ) {\n\t\t\t$columns['assessment_result_evaluation'] = __( 'Evaluate', 'mylisttable' );\n\t\t}\n\t\treturn $columns;\n\t}", "function getColumns()\r\n {\r\n $columns = array();\r\n if ($this->_options['generate_columns'] \r\n and $fieldList = $this->_options['fields']) {\r\n \r\n include_once('Structures/DataGrid/Column.php');\r\n \r\n foreach ($fieldList as $field) {\r\n $label = strtr($field, $this->_options['labels']);\r\n $col = new Structures_DataGrid_Column($label, $field, $field);\r\n $columns[] = $col;\r\n }\r\n }\r\n \r\n return $columns;\r\n }", "protected function form()\n {\n return Admin::form(Industry::class, function (Form $form) {\n\n\n $form->text('name',\"名称\");\n $form->number('order_by', \"行业排序\")->value(9);\n $form->display('created_at', '创建时间');\n $form->display('updated_at', '最后修改时间');\n });\n }", "public function buildFormLayout()\n {\n $this->addColumn(6, function(FormLayoutColumn $column) {\n $column->withSingleField('title');\n })->addColumn(6, function(FormLayoutColumn $column) {\n $column->withSingleField('cover');\n $column->withSingleField('description');\n $column->withSingleField('price');\n $column->withSingleField('tags');\n });\n }", "public function getMyFormFields() {\n $aMyFieldsByForm = [];\n\n # Build Query to get User Based Columns\n $oFieldsSel = new Select(CoreEntityModel::$aEntityTables['user-form-fields']->getTable());\n $oFieldsSel->join(['core_field'=>'core_form_field'],'core_field.Field_ID = user_form_field.field_idfs');\n $oFieldsSel->where(['user_idfs'=>$this->getID()]);\n\n # Get My Fields from Database\n $oMyFieldsDB = CoreEntityModel::$aEntityTables['user-form-fields']->selectWith($oFieldsSel);\n\n foreach($oMyFieldsDB as $oField) {\n # Order By Form\n if(!array_key_exists($oField->form,$aMyFieldsByForm)) {\n $aMyFieldsByForm[$oField->form] = [];\n }\n $aMyFieldsByForm[$oField->form][$oField->Field_ID] = $oField;\n }\n\n return $aMyFieldsByForm;\n }", "public function get_mform() {\n return $this->_form;\n }", "function format($form_name, $form_action, $form_method, $table_name, $column_key, $state, $default_value, $label);", "public static function form_fields(){\n\n \treturn [\n [\n \t'id'=> 'description',\n \t'name'=> 'description', \n \t'desc'=> 'Description', \n \t'val'=>\tnull, \n \t'type'=> 'text',\n \t'maxlength'=> 255,\n \t'required'=> 'required',\n ],\n\n [\n \t'id'=> 'rate',\n \t'name'=> 'rate', \n \t'desc'=> 'Discount Rate', \n \t'val'=>\tnull, \n \t'type'=> 'number',\n \t'min'=> 0,\n \t'max'=> 100,\n \t'step'=> '0.01',\n \t'required'=> 'required',\n ],\n\n [\n \t'id'=> 'stat',\n \t'name'=> 'stat', \n \t'desc'=> 'isActive', \n \t'val'=>1, \n \t'type'=> 'checkbox',\n ],\n ];\n\n }", "public function MapperForm()\n {\n $fields = new FieldList(\n CheckboxField::create(\n \"HasHeader\",\n \"This data includes a header row.\",\n true\n )\n );\n if ($this->component->getCanClearData()) {\n $fields->push(\n CheckboxField::create(\n \"ClearData\",\n \"Remove all existing records before import.\"\n )\n );\n }\n $actions = FieldList::create(\n FormAction::create(\"import\", \"Import CSV\")\n ->setUseButtonTag(true)\n ->addExtraClass(\"btn btn-primary btn--icon-large font-icon-upload\"),\n FormAction::create(\"cancel\", \"Cancel\")\n ->setUseButtonTag(true)\n ->addExtraClass(\"btn btn-outline-danger btn-hide-outline font-icon-cancel-circled\")\n );\n\n $form = new Form($this, __FUNCTION__, $fields, $actions);\n\n return $form;\n }", "abstract public function forms();", "public function getForm()\n {\n return $this;\n }", "public function getForm() {\n\t\treturn isset($this->attributes['form'])?$this->attributes['form']:null;\n\t}", "abstract public function get_gateway_form_fields();", "function get_filter_form(Table $table) {\n return $table->renderFilter();\n}", "public function formFields()\n {\n return $this->hasMany('Thorazine\\Hack\\Models\\FormField')\n ->orderBy('drag_order', 'asc')\n ->orderBy('id', 'asc');\n }", "function get_columns() {\n return $columns= array(\n 'col_what'=>__('What','wpwt'),\n 'col_user'=>__('User Name','wpwt'),\n 'col_groupName'=>__('Group Name','wpwt'),\n 'col_application'=>__('Application','wpwt')\n );\n }", "public function retrieveFormFields()\n {\n return $this->start()->uri(\"/api/form/field\")\n ->get()\n ->go();\n }", "function get_columns() {\r\r\n $columns = array(\r\r\n 'cb' \t=> '<input type=\"checkbox\" />',\r\r\n 'title' \t=> __( 'Visitor' , 'sc_chat' ),\r\r\n 'email'\t\t\t=> __( 'E-mail', 'sc_chat' ),\r\r\n 'total_logs'\t=> __( 'Total Logs', 'sc_chat' ),\r\r\n\t\t\t'last_date'\t\t=> __( 'Last Chat Date', 'sc_chat' )\r\r\n );\r\r\n return $columns;\r\r\n }", "public function get_columns(){\n $columns = array(\n 'cb' => '<input type=\"checkbox\" />',\n 'ID' => 'ID',\n 'Orderno' => 'Order No',\n 'Mtid' => 'Mtid',\n 'Userid' => 'User ID',\n 'UserName' => 'User Name',\n 'Prodcode' => 'Product Code',\n 'Status' => 'Status',\n 'Comment' => 'Comment',\n 'Editable' => 'Editable',\n 'Expirytime' => 'Expirytime',\n 'Modifydate' => 'Modifydate'\n );\n\n return $columns;\n }", "private function show_columns() {\n\t\tglobal $wpdb, $utils;\n\t\t$domain = $utils->text_domain;\n\t\t$tables = $wpdb->tables('all');\n\t\tif (!isset($_POST['table'])) {\n\t\t\t$message = __('Table name is not selected.', $domain);\n\t\t\treturn $message;\n\t\t} elseif (!in_array($_POST['table'], $tables)) {\n\t\t\t$message = __('There\\'s no such table.', $domain);\n\t\t\treturn $message;\n\t\t}\telse {\n\t\t\t$table_name = $_POST['table'];\n\t\t\t$results = $wpdb->get_results(\"SHOW COLUMNS FROM $table_name\");\n\t\t\treturn $results;\n\t\t}\n\t}", "public function getFormInputIndexes()\n {\n $indexes = $this->getIndexes();\n ob_start();\n foreach ($indexes as $index) {\n list($tableName, $columnName) = explode(\".\", $index);\n $column = $this->Model->columns[$columnName];\n echo Form::hidden($columnName, null, $column['attributes']);\n }\n $output = ob_get_contents();\n ob_end_clean();\n return $output;\n }", "function get_columns() {\r\n return $columns= array(\r\n 'col_created_on'=>__('Date'),\r\n 'col_type'=>__('Type'),\r\n 'col_ip'=>__('IP'),\r\n 'col_os'=>__('Operating System'),\r\n 'col_browser'=>__('Browser'),\r\n 'col_location'=>__('Location'),\r\n 'col_actions'=>__('Actions')\r\n );\r\n }", "protected function form()\n {\n $grid = Admin::form(SiteModel::class, function(Form $form){\n // Displays the record id\n $form->display('id', 'ID');\n // Add an input box of type text\n $form->url('url', 'Site url')->rules('required');\n $form->text('name', 'Site name')->rules('required');\n $form->switch('official', 'Official?');\n // Add textarea for the describe field\n $form->textarea('describe', 'Description');\n // Add a switch field\n $form->switch('enable', 'Enabled?');\n $form->switch('searcheable', 'Searcheable?');\n $form->url('search_url', 'Search URL');\n $form->text('search_method', 'Search Method');\n $form->text('search_key', 'Search KEY');\n $form->text('search_example', 'Search Example');\n // Add a date and time selection box\n //$form->datetime('release_at', 'release time')->rules('required');\n // Display two time column \n $form->display('created_at', 'Created time');\n $form->display('updated_at', 'Updated time');\n });\n return $grid;\n }", "public function generate()\n {\n switch ($this->sColumn) {\n case 'description':\n $this->oForm->addElement(\n new Textarea(\n t('Description:'),\n $this->sColumn,\n [\n 'id' => $this->getFieldId('str'),\n 'onblur' => 'CValid(this.value,this.id,20,4000)',\n 'value' => $this->sVal,\n 'validation' => new Str(20, 4000),\n 'required' => 1\n ]\n )\n );\n $this->addCheckErrSpan('str');\n break;\n\n case 'punchline':\n $this->oForm->addElement(\n new Textbox(\n t('Punchline/Headline:'),\n 'punchline',\n [\n 'id' => $this->getFieldId('str'),\n 'onblur' => 'CValid(this.value,this.id,5,150)',\n 'value' => $this->sVal,\n 'validation' => new Str(5, 150)\n ]\n )\n );\n $this->addCheckErrSpan('str');\n break;\n\n case 'country':\n $this->oForm->addElement(\n new Country(\n t('Country:'),\n $this->sColumn,\n [\n 'id' => $this->getFieldId('str'),\n 'value' => $this->sVal,\n 'required' => 1\n ]\n )\n );\n break;\n\n case 'city':\n $this->oForm->addElement(\n new Textbox(\n t('City:'),\n $this->sColumn,\n [\n 'id' => $this->getFieldId('str'),\n 'onblur' => 'CValid(this.value,this.id,2,150)',\n 'value' => $this->sVal,\n 'validation' => new Str(2, 150),\n 'required' => 1\n ]\n )\n );\n $this->addCheckErrSpan('str');\n break;\n\n case 'state':\n $this->oForm->addElement(\n new Textbox(\n t('State/Province:'),\n $this->sColumn,\n [\n 'id' => $this->getFieldId('str'),\n 'onblur' => 'CValid(this.value,this.id,2,150)',\n 'value' => $this->sVal,\n 'validation' => new Str(2, 150)\n ]\n )\n );\n $this->addCheckErrSpan('str');\n break;\n\n case 'zipCode':\n $this->oForm->addElement(\n new Textbox(\n t('Postal Code:'),\n $this->sColumn,\n [\n 'id' => $this->getFieldId('str'),\n 'onblur' => 'CValid(this.value,this.id,2,15)',\n 'value' => $this->sVal,\n 'validation' => new Str(2, 15)\n ]\n )\n );\n $this->addCheckErrSpan('str');\n break;\n\n case 'middleName':\n $this->oForm->addElement(\n new Textbox(\n t('Middle Name:'),\n $this->sColumn,\n [\n 'id' => $this->getFieldId('name'),\n 'onblur' => 'CValid(this.value,this.id)',\n 'value' => $this->sVal,\n 'validation' => new Name\n ]\n )\n );\n $this->addCheckErrSpan('name');\n break;\n\n case 'height':\n $this->oForm->addElement(\n new Height(\n t('Height:'),\n $this->sColumn,\n [\n 'value' => $this->sVal\n ]\n )\n );\n break;\n\n case 'weight':\n $this->oForm->addElement(\n new Weight(\n t('Weight:'),\n $this->sColumn,\n [\n 'value' => $this->sVal\n ]\n )\n );\n break;\n\n case 'website':\n case 'socialNetworkSite':\n $sLabel = $this->sColumn === 'socialNetworkSite' ? t('Social Media Profile:') : t('Website:');\n $sDesc = $this->sColumn === 'socialNetworkSite' ? t('The URL of your social profile, such as Facebook, Instagram, Snapchat, LinkedIn, ...') : t('Your Personal Website/Blog (any promotional/affiliated contents will be removed)');\n $this->oForm->addElement(\n new Url(\n $sLabel,\n $this->sColumn, [\n 'id' => $this->getFieldId('url'),\n 'onblur' => 'CValid(this.value,this.id)',\n 'description' => $sDesc,\n 'value' => $this->sVal\n ]\n )\n );\n $this->addCheckErrSpan('url');\n break;\n\n case 'phone':\n $this->oForm->addElement(\n new Phone(\n t('Phone Number:'),\n $this->sColumn,\n array_merge(\n [\n 'id' => $this->getFieldId('phone'),\n 'onblur' => 'CValid(this.value, this.id)',\n 'value' => $this->sVal,\n ],\n self::setCustomValidity(\n t('Enter full number with area code.')\n ),\n )\n )\n );\n $this->addCheckErrSpan('phone');\n break;\n\n default:\n $sLangKey = strtolower($this->sColumn);\n $sClass = '\\PFBC\\Element\\\\' . $this->getFieldType();\n $this->oForm->addElement(new $sClass(t($sLangKey), $this->sColumn, ['value' => $this->sVal]));\n }\n\n return $this->oForm;\n }", "public function getForm()\n {\n return $this->form;\n }", "public function getForm()\n {\n return $this->form;\n }", "public function getForm() {\n return $this->form;\n }", "private static function fnColumnToField($i) {\n if ( $i == 0 )\n return \"c.customers_id\";\n else if ( $i == 1 )\n return \"c.customers_lastname\";\n else if ( $i == 2 )\n return \"c.customers_firstname\";\n else if ( $i == 3 )\n return \"c.customers_group_id\";\n else if ( $i == 4 )\n return \"c.date_account_created\";\n }", "abstract protected function columns();", "function add_futurninews_columns($cols){\n\treturn array(\n\t\t'cb' \t\t=> '<input type=\"checkbox\" />;',\n\t\t'title' \t=> 'Title',\n\t\t'heading'\t=> 'Heading',\n\t\t'date'\t\t=> 'Date'\n\t);\n}", "protected function form()\n {\n $form = new Form(new PointMachine());\n $form->text('name', __('Name'));\n // 所属洗车点查询\n $points = Point::query()->get(['id','name'])->toArray();\n $directors = [];\n foreach ($points as $point){\n $directors[$point['id']] = $point['name'];\n }\n $form->select('point_id', __('Point id'))->options($directors);\n //机器型号\n $form->text('machine_no', __('Machine no'));\n // 1-自助型 2-全自动型\n $directors = [\n 1 => '自助型',\n 2 => '全自动型'\n ];\n $form->select('type', __('Type'))->options($directors);\n $form->number('cost', __('Cost'));\n $form->datetime('cost_at', __('Cost at'))->default(date('Y-m-d H:i:s'));\n $form->datetime('build_at', __('Build at'))->default(date('Y-m-d H:i:s'));\n $form->text('remark', __('Remark'));\n\n return $form;\n }", "public function getPostColumns()\n {\n return array(\n 'post' => 'post', \n 'prefecture' => 'prefecture', \n 'address1' => 'address1', \n 'address2' => 'address2', \n 'tel' => 'tel', \n 'fax' => 'fax',\n 'category' => 'category',\n 'healthCheck' => 'healthCheck'\n );\n }", "public function getFormFields()\n {\n return $this->form->getFields();\n }", "public function getForms()\n {\n return $this->form;\n }", "public function getFormTemplates();", "private function getVisibleColumns(sfBasicSecurityUser $user, sfForm $form, $as_string = false)\n {\n $flds = array('category','collection','taxon', 'collecting_dates', 'type','gtu','gtu_location','gtu_elevation', 'ecology','codes','chrono','ig','acquisition_category',\n 'litho','lithologic','mineral','expedition','type', 'individual_type','sex','state','stage','social_status','rock_form','individual_count',\n 'part', 'object_name', 'part_status', 'amount_males', 'amount_females', 'amount_juveniles', 'building', 'floor', 'room', 'row', 'col' ,'shelf', 'container', 'container_type', 'container_storage', 'sub_container',\n 'sub_container_type' , 'sub_container_storage', 'specimen_count','part_codes', 'col_peoples', 'ident_peoples','don_peoples', 'valid_label', 'loans');\n\n\n\n $flds = array_fill_keys($flds, 'uncheck');\n\n if($form->isBound() && $form->getValue('col_fields') != \"\")\n {\n $req_fields = $form->getValue('col_fields');\n $req_fields_array = explode('|',$req_fields);\n\n }\n else\n {\n $req_fields_array = $user->fetchVisibleCols();\n }\n\n if(empty($req_fields_array))\n $req_fields_array = explode('|', $form->getDefault('col_fields'));\n if($as_string)\n {\n return implode('|',$req_fields_array);\n }\n\n foreach($req_fields_array as $k => $val)\n {\n $flds[$val] = 'check';\n }\n return $flds;\n }" ]
[ "0.7038409", "0.6816248", "0.6737944", "0.64972705", "0.6484038", "0.6346653", "0.63074255", "0.62994236", "0.6297614", "0.6150965", "0.6103503", "0.6096795", "0.6084987", "0.6075274", "0.60370463", "0.60238534", "0.600408", "0.6002554", "0.5995798", "0.5992277", "0.5974846", "0.59641206", "0.59620756", "0.59582514", "0.59582514", "0.5953901", "0.5950999", "0.5949972", "0.594198", "0.5902468", "0.58938", "0.5893003", "0.58420515", "0.5840322", "0.5839337", "0.5837726", "0.58145744", "0.58125496", "0.58047986", "0.580401", "0.5797788", "0.57949054", "0.5789609", "0.57814217", "0.5772601", "0.577167", "0.5770444", "0.5746591", "0.5746275", "0.5712873", "0.5696769", "0.569238", "0.5691089", "0.56750685", "0.56738985", "0.5672506", "0.5667645", "0.5663115", "0.56465024", "0.56432384", "0.5636339", "0.563537", "0.56221277", "0.5617672", "0.5617094", "0.55990094", "0.5598934", "0.5586398", "0.5573399", "0.557191", "0.5568388", "0.55603707", "0.55572003", "0.5556096", "0.5553915", "0.5551949", "0.55499154", "0.5545847", "0.5542918", "0.5538242", "0.5537503", "0.5534157", "0.5531986", "0.55301386", "0.5527934", "0.5525125", "0.5524946", "0.55210704", "0.551963", "0.5518518", "0.5518518", "0.5518039", "0.5510644", "0.55070126", "0.55051047", "0.5500799", "0.54970837", "0.54875064", "0.5479049", "0.5478647", "0.5476479" ]
0.0
-1
Apply plugin modifications to composer See for more about $io Available tags are: [info|comment|question|error]
public function activate( \Composer\Composer $composer, \Composer\IO\IOInterface $io ) { $this->composer = $composer; $this->io = $io; $extra = $composer->getPackage()->getExtra(); if (isset($extra[self::EXTRA_PARAM])) { $files = $extra[self::EXTRA_PARAM]; /* parse configuration files */ if (!is_array($files)) { $this->configFileNames = [$files]; } else { $this->configFileNames = $files; } foreach ($this->configFileNames as $one) { if (file_exists($one)) { $config = new \Praxigento\Composer\Plugin\Templates\Config($one); if ($config->hasData()) { $io->write(__CLASS__ . ": <info>Configuration is read from '$one'.</info>", true); if (is_null(self::$config)) { self::$config = $config; } else { self::$config->merge($config); } } else { $io->writeError(__CLASS__ . ": <error>Cannot read valid JSON from configuration file '$one'. Plugin will be disabled.</error>", true); self::$config = null; break; } } else { $io->writeError(__CLASS__ . ": <error>Cannot open configuration file '$one'. Plugin will be disabled.</error>", true); self::$config = null; break; } } } else { $io->writeError(__CLASS__ . ": <error>Extra parameter '" . self::EXTRA_PARAM . "' is empty. Plugin is disabled.</error>", true); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function activate(Composer $composer, IOInterface $io): void\n {\n $this->composer = $composer;\n $this->io = $io;\n $this->executor = new ProcessExecutor($this->io);\n $this->patches = array();\n $this->installedPatches = array();\n $this->lockFile = new JsonFile(\n static::getPatchesLockFilePath(),\n null,\n $this->io\n );\n $this->locker = new Locker($this->lockFile);\n $this->configuration = [\n 'disable-resolvers' => [\n 'type' => 'list',\n 'default' => [],\n ],\n 'disable-downloaders' => [\n 'type' => 'list',\n 'default' => [],\n ],\n 'disable-patchers' => [\n 'type' => 'list',\n 'default' => [],\n ],\n 'default-patch-depth' => [\n 'type' => 'int',\n 'default' => 1,\n ],\n 'package-depths' => [\n 'type' => 'list',\n 'default' => [],\n ],\n 'patches-file' => [\n 'type' => 'string',\n 'default' => 'patches.json',\n ]\n ];\n $this->configure($this->composer->getPackage()->getExtra(), 'composer-patches');\n }", "public function activate(Composer $composer, IOInterface $io);", "public function activate(Composer $composer, IOInterface $io)\n {\n }", "final public function activate(Composer $composer, IOInterface $io)\n {\n $this->composer = $composer;\n $this->io = $io;\n }", "public function activate(Composer $composer, IOInterface $io) {\n $this->composer = $composer;\n\n $this->io = $io;\n $this->fileSystem = new Filesystem();\n $this->downloadManager = $composer->getDownloadManager();\n $this->installationManager = $composer->getInstallationManager();\n }", "public function activate(Composer $composer, IOInterface $io)\n {\n // TODO: Implement activate() method.\n }", "public function activate(Composer $composer, IOInterface $io) {\n $this->handler = new Handler($composer, $io);\n }", "public function setIo(\\Composer\\IO\\IOInterface $io)\n {\n $this->io = $io;\n }", "public function uninstall(Composer $composer, IOInterface $io)\n {\n }", "protected function configure()\n {\n $name = 'add-plugin';\n $desc = '<warning>Downloads</warning> a <info>YOURLS plugin</info> and add it to your <comment>`user/composer.json`</comment>';\n $def = [ new InputArgument('plugins', InputArgument::IS_ARRAY, 'YOURLS plugin(s) to download') ];\n $help = <<<EOT\nExample: <comment>`composer add-plugin ozh/example-plugin`</comment>\nThis command downloads plugins in the appropriate subfolder of <comment>user/plugins/</comment>, adds them to\nyour <comment>user/composer.json</comment> file, and updates dependencies.\nRead more at https://github.com/yourls/composer-installer/\n\nEOT;\n\n $this->setName($name)\n ->setDescription($desc)\n ->setDefinition($def)\n ->setHelp($help);\n }", "function install_plugin_information()\n {\n }", "public function execute()\n {\n\t $composer = $this->composer;\n\n\t $composer->extra = isset($composer->extra) ? $composer->extra : array('fof' => new \\stdClass());\n\t $composer->extra->fof = isset($composer->extra->fof) ? $composer->extra->fof : new \\stdClass();\n\n\t $info = $composer->extra->fof;\n\n\t if (!is_object($info))\n\t {\n\t\t if (empty($info))\n\t\t {\n\t\t\t $info = new \\stdClass();\n\t\t }\n\t\t else\n\t\t {\n\t\t\t $info = (object) $info;\n\t\t }\n\t }\n\n\t\t// Component Name (default: what's already stored in composer / composer package name)\n\t\t$info->name = $this->getComponentName($composer);\n\n\t\t$files = array(\n\t\t\t'backend' => 'component/backend',\n\t\t\t'frontend' => 'component/frontend',\n\t\t\t'media' => 'component/media',\n\t\t\t'translationsbackend' => 'translations/component/backend',\n\t\t\t'translationsfrontend' => 'translations/component/frontend'\n\t\t);\n\n\t if (!isset($info->paths) || empty($info->paths) || is_null($info->paths))\n\t {\n\t\t $info->paths = array();\n\t }\n\n\t if (is_object($info->paths))\n\t {\n\t\t $info->paths = (array) $info->paths;\n\t }\n\n\t $files = array_merge($files, $info->paths);\n\n\t\tforeach ($files as $key => $default)\n {\n\t\t\t$info->paths[$key] = $this->getPath($composer, $key, $default);\n\t\t}\n\n\t\t// Now check for fof.xml file\n\t\t$fof_xml = getcwd() . '/' . $info->paths['backend'] . '/fof.xml';\n\n\t\tif (file_exists($fof_xml))\n {\n // @todo Read the XML?\n\t\t}\n\n\t // @todo Maybe ask for namespaces?\n\n\t\t// Store back the info into the composer.json file\n\t $composer->extra->fof = $info;\n\t \\JFile::write(getcwd() . '/composer.json', json_encode($composer, JSON_PRETTY_PRINT));\n\n\t\t$this->setDevServer(false);\n\t}", "public function uninstall(Composer $composer, IOInterface $io);", "protected static function writeAddRepository(IOInterface $io, $name)\n {\n if ($io->isVerbose()) {\n $io->write('Adding VCS repository <info>'.$name.'</info>');\n }\n }", "public function add_dependencies(self ...$plugins): static;", "function wp_default_packages_vendor($scripts)\n {\n }", "function wp_update_plugin($plugin, $feedback = '')\n {\n }", "public function configureIO(IO $io) : void;", "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 activate(Composer $composer, IOInterface $io)\n {\n $this->composer = $composer;\n $this->io = $io;\n\n if ($this->isWorkspace()) {\n $workspaceRoot = $this->getWorkspaceRoot();\n\n $workspacePath = getcwd();\n\n $workspace = $workspaceRoot->resolveWorkspace($workspacePath);\n\n if ($workspace === null) {\n throw new RuntimeException('Could not resolve workspace for path \"' . $workspacePath . '\"');\n }\n\n $this->configureWorkspace($workspaceRoot, $workspace, $composer);\n }\n }", "function install_plugins_upload()\n {\n }", "private function refreshMetaData (SymfonyStyle $io)\n {\n $io->section(\"Refreshing the metadata\");\n\n foreach ($this->kernel->getBundles() as $bundle)\n {\n $bundleNamespacePrefix = \"{$bundle->getNamespace()}\\\\\";\n\n $searchItems = $this->metadataGenerator->rebuildMetadata([\n $bundleNamespacePrefix => $bundle->getPath(),\n ]);\n\n if (!empty($searchItems))\n {\n $io->writeln(sprintf(\n \"<fg=blue>%s</>\",\n $bundle->getName()\n ));\n\n foreach ($searchItems as $item)\n {\n $io->writeln(\" {$item->getFqcn()}\");\n }\n\n $io->newLine();\n }\n }\n\n $this->stepDone($io);\n }", "function wp_cli_app_basic_composer( $args, $assoc_args ) {\n\n\t//Check Composer is installed in System\n\tif ( CLI::command_exists( \"composer\" ) === false ) {\n\t\tCLI::error( \"Composer Package Manager is not active in your system, read more : https://getcomposer.org/doc/00-intro.md\" );\n\t\treturn;\n\t}\n\n\t//Check Active Workspace\n\tWorkSpace::is_active_workspace();\n\t$workspace = WorkSpace::get_workspace();\n\n\t//Create Custom Composer Cli\n\t$arg = array();\n\tfor ( $x = 0; $x <= 3; $x ++ ) {\n\t\tif ( isset( $args[ $x ] ) and ! empty( $args[ $x ] ) ) {\n\t\t\t$arg[] = $args[ $x ];\n\t\t}\n\t}\n\n\t//Run command\n\tCLI::run_composer( $workspace['path'], $arg );\n}", "function pmpro_setupAddonUpdateInfo() {\n\tadd_filter( 'plugins_api', 'pmpro_plugins_api', 10, 3 );\n\tadd_filter( 'pre_set_site_transient_update_plugins', 'pmpro_update_plugins_filter' );\n\tadd_filter( 'http_request_args', 'pmpro_http_request_args_for_addons', 10, 2 );\n\tadd_action( 'update_option_pmpro_license_key', 'pmpro_reset_update_plugins_cache', 10, 2 );\n}", "public function generate(IOInterface $io, $base_dir) {\n // General information from drupal/drupal and drupal/core composer.json\n // and composer.lock files.\n $drupalCoreInfo = DrupalCoreComposer::createFromPath($base_dir);\n\n // Exit early if there is no composer.lock file.\n if (empty($drupalCoreInfo->composerLock())) {\n return;\n }\n\n // Run all of our available builders.\n $builders = $this->builders();\n $changed = FALSE;\n foreach ($builders as $builder_class) {\n $builder = new $builder_class($drupalCoreInfo);\n $changed |= $this->generateMetapackage($io, $builder);\n }\n\n // Remind the user not to miss files in a patch.\n if ($changed) {\n $io->write(\"If you make a patch, ensure that the files above are included.\");\n }\n }", "function aione_register_required_plugins() {\n\t/**\n\t * Array of plugin arrays. Required keys are name and slug.\n\t * If the source is NOT from the .org repo, then source is also required.\n\t */\n\t$plugins = array(\n\t\tarray(\n\t\t\t'name' => 'Oxo Core',\n\t\t\t'slug' => 'oxo-core',\n\t\t\t'source' => get_template_directory() . '/framework/plugins/oxo-core.zip',\n\t\t\t'required' => true,\n\t\t\t'version' => '1.8.3',\n\t\t\t'force_activation' => false,\n\t\t\t'force_deactivation' => false,\n\t\t\t'external_url' => '',\n\t\t\t'image_url' => Aione()->get_framework_dir() . '/assets/images/oxo_core.png',\n\t\t),\n\t\tarray(\n\t\t\t'name' => 'LayerSlider WP',\n\t\t\t'slug' => 'LayerSlider',\n\t\t\t'source' => get_template_directory() . '/framework/plugins/LayerSlider.zip',\n\t\t\t'required' => false,\n\t\t\t'version' => '5.6.2',\n\t\t\t'force_activation' => false,\n\t\t\t'force_deactivation' => false,\n\t\t\t'external_url' => '',\n\t\t\t'image_url' => Aione()->get_framework_dir() . '/assets/images/layer_slider.png',\n\t\t),\n\t\tarray(\n\t\t\t'name' => 'Revolution Slider',\n\t\t\t'slug' => 'revslider',\n\t\t\t'source' => get_template_directory() . '/framework/plugins/revslider.zip',\n\t\t\t'required' => false,\n\t\t\t'version' => '5.1.6',\n\t\t\t'force_activation' => false,\n\t\t\t'force_deactivation' => false,\n\t\t\t'external_url' => '',\n\t\t\t'image_url' => Aione()->get_framework_dir() . '/assets/images/rev_slider.png',\n\t\t),\n\t\tarray(\n\t\t\t'name' => 'WooCommerce',\n\t\t\t'slug' => 'woocommerce',\n\t\t\t'required' => false,\n\t\t\t'image_url' => Aione()->get_framework_dir() . '/assets/images/woocommerce.png',\n\t\t),\n\t\tarray(\n\t\t\t'name' => 'bbPress',\n\t\t\t'slug' => 'bbpress',\n\t\t\t'required' => false,\n\t\t\t'image_url' => Aione()->get_framework_dir() . '/assets/images/bbpress.png',\n\t\t),\n\t\tarray(\n\t\t\t'name' => 'The Events Calendar',\n\t\t\t'slug' => 'the-events-calendar',\n\t\t\t'required' => false,\n\t\t\t'image_url' => Aione()->get_framework_dir() . '/assets/images/the_events_calendar.png',\n\t\t),\n\t\tarray(\n\t\t\t'name' => 'Contact Form 7',\n\t\t\t'slug' => 'contact-form-7',\n\t\t\t'required' => false,\n\t\t\t'image_url' => Aione()->get_framework_dir() . '/assets/images/contact_form_7.jpg',\n\t\t),\n\t);\n\n\t// Change this to your theme text domain, used for internationalising strings\n\t$theme_text_domain = 'Aione';\n\n\t/**\n\t * Array of configuration settings. Amend each line as needed.\n\t * If you want the default strings to be available under your own theme domain,\n\t * leave the strings uncommented.\n\t * Some of the strings are added into a sprintf, so see the comments at the\n\t * end of each line for what each argument will be.\n\t */\n\t$config = array(\n\n\t\t'domain' \t=> $theme_text_domain,\n\t\t'default_path' \t=> '',\n\t\t'parent_slug' \t\t=> 'themes.php',\n\t\t'menu' \t=> 'install-required-plugins',\n\t\t'has_notices' \t=> true,\n\t\t'is_automatic' \t=> true,\n\t\t'message' \t=> '',\n\t\t'strings' \t=> array(\n\t\t\t'page_title' => __( 'Install Required Plugins', 'Aione' ),\n\t\t\t'menu_title' => __( 'Install Plugins', 'Aione' ),\n\t\t\t'installing' => __( 'Installing Plugin: %s', 'Aione' ), // %1$s = plugin name\n\t\t\t'oops' => __( 'Something went wrong with the plugin API.', 'Aione' ),\n\t\t\t'notice_can_install_required' => _n_noop( 'This theme requires the following plugin installed or updated: %1$s.', 'This theme requires the following plugins installed or updated: %1$s.', 'Aione' ), // %1$s = plugin name(s)\n\t\t\t'notice_can_install_recommended' => _n_noop( str_replace( '{{system-status}}', admin_url( 'admin.php?page=aione-system-status' ), 'This theme recommends the following plugin installed or updated: %1$s.<br />IMPORTANT: If your hosting plan has low resources, activating additional plugins can lead to fatal \"out of memory\" errors. We recommend at least 128MB of memory. Check your resources on the <a href=\"{{system-status}}\" target=\"_self\">System Status</a> tab.' ), str_replace( '{{system-status}}', admin_url( 'admin.php?page=aione-system-status' ), 'This theme recommends the following plugins installed or updated: %1$s.<br />IMPORTANT: If your hosting plan has low resources, activating additional plugins can lead to fatal \"out of memory\" errors. We recommend at least 128MB of memory. Check your resources on the <a href=\"{{system-status}}\" target=\"_self\">System Status</a> tab.' ), 'Aione' ), // %1$s = plugin name(s)\n\t\t\t'notice_cannot_install' => _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.', 'Aione' ), // %1$s = plugin name(s)\n\t\t\t'notice_can_activate_required' => _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.', 'Aione' ), // %1$s = plugin name(s)\n\t\t\t'notice_can_activate_recommended' => _n_noop( str_replace( '{{system-status}}', admin_url( 'admin.php?page=aione-system-status' ), 'The following recommended plugin is currently inactive: %1$s.<br />IMPORTANT: If your hosting plan has low resources, activating additional plugins can lead to fatal \"out of memory\" errors. We recommend at least 128MB of memory. Check your resources on the <a href=\"{{system-status}}\" target=\"_self\">System Status</a> tab.' ), str_replace( '{{system-status}}', admin_url( 'admin.php?page=aione-system-status' ), 'The following recommended plugins are currently inactive: %1$s.<br />IMPORTANT: If your hosting plan has low resources, activating additional plugins can lead to fatal \"out of memory\" errors. We recommend at least 128MB of memory. Check your resources on the <a href=\"{{system-status}}\" target=\"_self\">System Status</a> tab.' ), 'Aione' ), // %1$s = plugin name(s)\n\t\t\t'notice_cannot_activate' => _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.', 'Aione' ), // %1$s = plugin name(s)\n\t\t\t'notice_ask_to_update' => _n_noop( '<span class=\"oxo-update-heading\" style=\"margin-top:-0.4em\">%1$s Update Required</span>The plugin needs to be updated to its latest version to ensure maximum compatibility with Aione.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.', 'Aione' ), // %1$s = plugin name(s)\n\t\t\t'notice_cannot_update' => _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.', 'Aione' ), // %1$s = plugin name(s)\n\t\t\t'install_link' => _n_noop( 'Go Install Plugin', 'Go Install Plugins', 'Aione' ),\n\t\t\t'activate_link' => _n_noop( 'Go Activate Plugin', 'Go Activate Plugins', 'Aione' ),\n\t\t\t'return' => __( 'Return to Required Plugins Installer', 'Aione' ),\n\t\t\t'plugin_activated' => __( 'Plugin activated successfully.', 'Aione' ),\n\t\t\t'complete' => __( 'All plugins installed and activated successfully. %s', 'Aione' ), // %1$s = dashboard link\n\t\t\t'nag_type' => 'error' // Determines admin notice type - can only be 'updated' or 'error'\n\t\t)\n\t);\n\n\ttgmpa( $plugins, $config );\n}", "function _maybe_update_plugins()\n {\n }", "public function dependencies() {\n\t\tif ($customPath = $this->params['custom']) {\n\t\t\t$this->_paths = [$customPath];\n\t\t} elseif (!empty($this->params['plugin'])) {\n\t\t\t$this->_paths = [CakePlugin::path($this->params['plugin'])];\n\t\t} else {\n\t\t\t$this->_paths = [APP];\n\t\t}\n\n\t\t$this->_findFiles('php');\n\t\tforeach ($this->_files as $file) {\n\t\t\t$this->out(sprintf('Updating %s...', $file), 1, Shell::VERBOSE);\n\n\t\t\t$this->_correctFile($file);\n\n\t\t\t$this->out(sprintf('Done updating %s', $file), 1, Shell::VERBOSE);\n\t\t}\n\t}", "public function installPlugins(){\n\n $listPlugin = $this->sanitizePluginsArray();\n\n foreach ($listPlugin as $Plugin) {\n $command = \"{$this->node} {$this->ltpm} install {$Plugin['filename']}\";\n\n exec($command,$output);\n\n Artisan::call('lt-plugin:update',['--vendor-name'=> $Plugin['vendor'].','.$Plugin['name'], '--silent' => true]);\n\n Artisan::call('lt-migration:up',['--vendor-name'=>$Plugin['vendor'].','.$Plugin['name'], '--silent' => true]);\n }\n }", "protected function composerUpdate()\n {\n $this->runCommand(['composer', 'update'], getcwd(), $this->output);\n }", "protected function patchComposerJson()\n {\n if ( ! $this->fileExists('composer.json')) {\n $this->write('Failed to locate composer.json in local directory', 'error');\n\n return;\n }\n\n $structure = json_decode(file_get_contents($this->path('composer.json')));\n if (json_last_error() !== JSON_ERROR_NONE) {\n $this->write('Failed to parse composer.json', 'error');\n\n return;\n }\n\n $structure->require->{'offline/oc-bootstrapper'} = '^' . VERSION;\n\n $contents = json_encode($structure, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);\n if (file_put_contents($this->path('composer.json'), $contents) === false) {\n $this->write('Failed to write new composer.json', 'error');\n }\n }", "function _add_plugin_file_editor_to_tools()\n {\n }", "public function deactivate(Composer $composer, IOInterface $io)\n {\n }", "public function setUpTheme() {\n parent::setUpPlugin();\n\n $this->composer->addAction( 'edit_post', 'saveMetaBoxes' );\n $this->composer->addAction( 'wp_ajax_wpb_get_element_backend_html', 'elementBackendHtmlJavascript_callback' );\n $this->composer->addAction( 'wp_ajax_wpb_shortcodes_to_visualComposer', 'shortCodesVisualComposerJavascript_callback' );\n $this->composer->addAction( 'wp_ajax_wpb_show_edit_form', 'showEditFormJavascript_callback' );\n $this->composer->addAction('wp_ajax_wpb_save_template', 'saveTemplateJavascript_callback');\n $this->composer->addAction('wp_ajax_wpb_load_template', 'loadTemplateJavascript_callback');\n $this->composer->addAction('wp_ajax_wpb_delete_template', 'deleteTemplateJavascript_callback');\n\n // Add specific CSS class by filter\n $this->addFilter('body_class', 'jsComposerBodyClass');\n $this->addFilter( 'get_media_item_args', 'jsForceSend' );\n\n $this->addAction( 'admin_menu','composerSettings' );\n $this->addAction( 'admin_init', 'composerRedirect' );\n $this->addAction( 'admin_init', 'jsComposerEditPage', 5 );\n\n $this->addAction( 'admin_init', 'registerCss' );\n $this->addAction( 'admin_init', 'registerJavascript' );\n\n $this->addAction( 'admin_print_scripts-post.php', 'editScreen_js' );\n $this->addAction( 'admin_print_scripts-post-new.php', 'editScreen_js' );\n\n /* Create Media tab for images */\n $this->composer->createImagesMediaTab();\n }", "function dev_missing_dependencies() { ?>\n\t<div class=\"error\">\n <p><?php printf( __( 'Awesome Support dependencies are missing. The plugin can’t be loaded properly. Please run %s before anything else. If you don’t know what this is you should <a href=\"%s\" class=\"thickbox\">install the production version</a> of this plugin instead.', 'awesome-support' ), '<a href=\"https://getcomposer.org/doc/00-intro.md#using-composer\" target=\"_blank\"><code>composer install</code></a>', esc_url( add_query_arg( array( 'tab' => 'plugin-information', 'plugin' => 'awesome-support', 'TB_iframe' => 'true', 'width' => '772', 'height' => '935' ), admin_url( 'plugin-install.php' ) ) ) ); ?></p>\n </div>\n<?php }", "private function manipulateComposerJsonWithAllowAutoInstall(): void\n {\n [$json, $manipulator] = Util::getComposerJsonFileAndManipulator();\n\n $manipulator->addSubNode('extra', 'automatic.allow-auto-install', true);\n\n $this->container->get(Filesystem::class)->dumpFile($json->getPath(), $manipulator->getContents());\n }", "function install(){}", "function add_plugin($plugin)\n {\n }", "public function setup()\n {\n $config['plugins'] = array($this->_class);\n $this->_markdown = Solar::factory('Solar_Markdown', $config);\n \n // build the plugin\n $config['markdown'] = $this->_markdown;\n $this->_plugin = Solar::factory($this->_class, $config);\n \n }", "function wp_update_plugins($extra_stats = array())\n {\n }", "private function initRequirePlugin(){\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'Options Framework', // The plugin name\n\t\t 'slug' => 'options-framework', // The plugin slug (typically the folder name)\n\t\t 'required' => true, // If false, the plugin is only 'recommended' instead of required\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'WooCommerce', // The plugin name\n\t\t 'slug' => 'woocommerce', // The plugin slug (typically the folder name)\n\t\t 'required' => true, // If false, the plugin is only 'recommended' instead of required\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'Contact Form 7', // The plugin name\n\t\t 'slug' => 'contact-form-7', // The plugin slug (typically the folder name)\n\t\t 'required' => true, // If false, the plugin is only 'recommended' instead of required\n\t\t 'source'\t\t\t\t => get_stylesheet_directory_uri() . '/sub/plugins/contact-form-7.zip', // The plugin source\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'WPBakery Visual Composer', // The plugin name\n\t\t 'slug' => 'js_composer', // The plugin slug (typically the folder name)\n\t\t 'required' => true,\n\t\t 'source' => get_stylesheet_directory_uri() . '/sub/plugins/js_composer.zip', // The plugin source\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'Revolution Slider', // The plugin name\n 'slug' => 'revslider', // The plugin slug (typically the folder name)\n 'required' => true, // If false, the plugin is only 'recommended' instead of required\n 'source' => get_stylesheet_directory_uri() . '/sub/plugins/revslider.zip', // The plugin source\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'YITH WooCommerce Wishlist', // The plugin name\n 'slug' => 'yith-woocommerce-wishlist', // The plugin slug (typically the folder name)\n 'required' => true\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'YITH Woocommerce Compare', // The plugin name\n 'slug' => 'yith-woocommerce-compare', // The plugin slug (typically the folder name)\n 'required' => true\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'YITH WooCommerce Zoom Magnifier', // The plugin name\n\t\t 'slug' => 'yith-woocommerce-zoom-magnifier', // The plugin slug (typically the folder name)\n\t\t 'required' => true\n\t\t));\n\n\t\t$this->addRequiredPlugin(array(\n\t\t\t'name' => 'MailChimp', // The plugin name\n\t\t 'slug' => 'mailchimp-for-wp', // The plugin slug (typically the folder name)\n\t\t 'required' => true\n\t\t));\n\t}", "public function deactivate(Composer $composer, IOInterface $io);", "public function handle()\n {\n $config = $this->getConfig();\n\n if(!empty($config->lando)){\n $this->info('\"lando\" value found in .no-cry.json. Using that setting.');\n $lando = $config->lando ? 'lando' : '';\n }\n else{\n $lando = $this->option('lando') ? 'lando' : '';\n }\n\n $valet = $this->option('valet') ? 'valet' : '';\n\n // Checkout our branch\n $this->checkoutNewBranchForDate([\n 'ticket' => $this->argument('ticket'), \n 'branch' => $this->option('branch'),\n 'config' => $config\n ]);\n\n // Get current core and plugin versions\n $preUpdatePlugins = $this->getPluginUpdates($lando);\n exec(\"{$lando} wp core version --quiet --skip-themes 2>&1\", $preUpdateCore);\n $preUpdateCoreVersion = $preUpdateCore[count($preUpdateCore)-1];\n\n // Run composer update\n $this->info(\"running '{$valet} composer update'...\");\n exec(\"{$valet} composer update\");\n\n // Get new core and plugin versions\n $postUpdatePlugins = $this->getPluginUpdates($lando);\n exec(\"{$lando} wp core version --quiet --skip-themes 2>&1\", \n $postUpdateCore);\n $postUpdateCoreVersion = $postUpdateCore[count($postUpdateCore)-1];\n\n // Get back list of updated plugins\n $updatedPlugins = $this->getUpdatedPlugins($preUpdatePlugins, $postUpdatePlugins, $lando);\n\n // Get WP Core status\n $wpCoreUpdate = \"\";\n if($postUpdateCoreVersion !== $preUpdateCoreVersion){\n $wpCoreUpdate = \"Wordpress from {$preUpdateCoreVersion} to {$postUpdateCoreVersion}\";\n }\n else{\n exec(\"{$lando} wp core check-update --format=json 2>&1\", $updateCheck);\n if (count($updateCheck)){\n\n $updateResults = $this->getCommandOutput($updateCheck, 'version',\"Something went wrong checking for a Wordpress update.\");\n \n if (!empty($updateResults['version'])){\n\n $this->info(\"Currently on WP {$postUpdateCoreVersion}. Wordpress version {$updateResults['version']} is available. If WP Core is managed by composer update the version requirements to upgrade.\");\n }\n }\n }\n\n // Give results\n $this->outputResults($updatedPlugins, $wpCoreUpdate, $this->argument('ticket'));\n }", "protected function execute(InputInterface $input, OutputInterface $output)\r\n {\r\n $this->generateApiDoc();\r\n\r\n // Generate the .phpstorm.meta.php file\r\n //$this->phpStormMeta();\r\n\r\n // Update composer\r\n $this->updateComposer();\r\n\r\n // @todo Update phpdoc\r\n }", "public function hookUpdate(): void\n {\n $this->say(\"Executing the Plugin's update hook...\");\n $this->_exec(\"php ./src/hook_update.php\");\n }", "public function extract_plugin_update() {\n \n // Extract Plugin Update\n (new MidrubBaseAdminCollectionUpdateHelpers\\Plugins)->extract_update();\n \n }", "public function import_from_tag( $tag ) {\n\t\t$svn_url = $this->get_plugin_svn_url( $tag );\n\n\t\t$files = SVN::ls( $svn_url );\n\t\tif ( ! $files ) {\n\t\t\tthrow new Exception( \"Plugin has no files in {$tag}.\" );\n\t\t}\n\n\t\t$readme_files = preg_grep( '!^readme.(txt|md)$!i', $files );\n\t\tif ( ! $readme_files ) {\n\t\t\tthrow new Exception( 'Plugin has no readme file.' );\n\t\t}\n\n\t\t$readme_file = reset( $readme_files );\n\t\tforeach ( $readme_files as $f ) {\n\t\t\tif ( '.txt' == strtolower( substr( $f, - 4 ) ) ) {\n\t\t\t\t$readme_file = $f;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t$readme_file = \"{$svn_url}{$readme_file}\";\n\t\t$readme = new Parser( $readme_file );\n\n\t\tif ( ! class_exists( '\\PO' ) ) {\n\t\t\trequire_once ABSPATH . '/wp-includes/pomo/po.php';\n\t\t}\n\n\t\t$pot = new PO();\n\t\t$pot->set_header( 'MIME-Version', '1.0' );\n\t\t$pot->set_header( 'Content-Type', 'text/plain; charset=UTF-8' );\n\t\t$pot->set_header( 'Content-Transfer-Encoding', '8bit' );\n\n\t\t$str_priorities = [];\n\n\t\tif ( $readme->name ) {\n\t\t\t$pot->add_entry( new Translation_Entry( [\n\t\t\t\t'singular' => $readme->name,\n\t\t\t\t'extracted_comments' => 'Plugin name.',\n\t\t\t] ) );\n\n\t\t\t$str_priorities[ $readme->name ] = 1;\n\t\t}\n\n\t\tif ( $readme->short_description ) {\n\t\t\t$pot->add_entry( new Translation_Entry( [\n\t\t\t\t'singular' => $readme->short_description,\n\t\t\t\t'extracted_comments' => 'Short description.',\n\t\t\t] ) );\n\n\t\t\t$str_priorities[ $readme->short_description ] = 1;\n\t\t}\n\n\t\tif ( $readme->screenshots ) {\n\t\t\tforeach ( $readme->screenshots as $screenshot ) {\n\t\t\t\t$pot->add_entry( new Translation_Entry( [\n\t\t\t\t\t'singular' => $screenshot,\n\t\t\t\t\t'extracted_comments' => 'Screenshot description.',\n\t\t\t\t] ) );\n\t\t\t}\n\t\t}\n\n\t\t$section_strings = [];\n\n\t\tforeach ( $readme->sections as $section_key => $section_text ) {\n\t\t\tif ( 'changelog' !== $section_key ) { // No need to scan non-translatable version headers in changelog.\n\t\t\t\tif ( preg_match_all( '~<(h[3-4]|dt)[^>]*>([^<].+)</\\1>~', $section_text, $matches ) ) {\n\t\t\t\t\tif ( ! empty( $matches[2] ) ) {\n\t\t\t\t\t\tforeach ( $matches[2] as $text ) {\n\t\t\t\t\t\t\t$section_strings = $this->handle_translator_comment( $section_strings, $text, \"{$section_key} header\" );\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 ( preg_match_all( '|<li>(?!<p>)([\\s\\S]*?)</li>|', $section_text, $matches ) ) {\n\t\t\t\tif ( ! empty( $matches[1] ) ) {\n\t\t\t\t\tforeach ( $matches[1] as $text ) {\n\t\t\t\t\t\t$section_strings = $this->handle_translator_comment( $section_strings, $text, \"{$section_key} list item\" );\n\t\t\t\t\t\tif ( 'changelog' === $section_key ) {\n\t\t\t\t\t\t\t$str_priorities[ $text ] = -1;\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 ( preg_match_all( '|<p>([\\s\\S]*?)</p>|', $section_text, $matches ) ) {\n\t\t\t\tif ( ! empty( $matches[1] ) ) {\n\t\t\t\t\tforeach ( $matches[1] as $text ) {\n\t\t\t\t\t\t$section_strings = $this->handle_translator_comment( $section_strings, trim( $text ), \"{$section_key} paragraph\" );\n\t\t\t\t\t\tif ( 'changelog' === $section_key ) {\n\t\t\t\t\t\t\t$str_priorities[ $text ] = - 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tforeach ( $section_strings as $text => $comments ) {\n\t\t\t$pot->add_entry( new Translation_Entry( [\n\t\t\t\t'singular' => $text,\n\t\t\t\t'extracted_comments' => 'Found in ' . implode( ', ', $comments ) . '.',\n\t\t\t] ) );\n\t\t}\n\n\t\t$tmp_directory = Filesystem::temp_directory( $this->plugin . '-readme-' . $tag );\n\t\t$pot_file = \"{$tmp_directory}/{$this->plugin}-readme.pot\";\n\n\t\t$exported = $pot->export_to_file( $pot_file );\n\t\tif ( ! $exported ) {\n\t\t\tthrow new Exception( 'POT file not extracted.' );\n\t\t}\n\n\t\t$result = $this->set_glotpress_for_plugin( $this->plugin, 'readme' );\n\t\tif ( is_wp_error( $result ) ) {\n\t\t\tthrow new Exception( $result->get_error_message() );\n\t\t}\n\n\t\t$branch = ( 'trunk' === $tag ) ? 'dev-readme' : 'stable-readme';\n\t\t$this->import_pot_to_glotpress_project( $this->plugin, $branch, $pot_file, $str_priorities );\n\t}", "public static function getComposer();", "function itstar_register_required_plugins() {\n\t/*\n\t * Array of plugin arrays. Required keys are name and slug.\n\t * If the source is NOT from the .org repo, then source is also required.\n\t */\n\t$plugins = array(\n\n\t\t// This is an example of how to include a plugin bundled with a theme.\n\t\tarray(\n\t\t\t'name' => 'Image Widget Plugin', // The plugin name.\n\t\t\t'slug' => 'image-widget', // The plugin slug (typically the folder name).\n\t\t\t'source' => get_template_directory() . '/plugins/image-widget.4.2.2.zip', // The plugin source.\n\t\t\t'required' => true\n\t\t\t),\n\t\tarray(\n\t\t\t'name' => 'Kirki', // The plugin name.\n\t\t\t'slug' => 'kirki', // The plugin slug (typically the folder name).\n\t\t\t'source' => get_template_directory() . '/plugins/kirki.2.3.6.zip', // The plugin source.\n\t\t\t'required' => true\n\t\t\t),\n//\t\tarray(\n//\t\t\t'name' => 'Redux Framework', // The plugin name.\n//\t\t\t'slug' => 'redux-framework', // The plugin slug (typically the folder name).\n//\t\t\t'source' => get_template_directory() . '/plugins/redux-framework.3.6.1.zip', // The plugin source.\n//\t\t\t'required' => true\n//\t\t\t),\n array(\n\t\t\t'name' => 'CMB2', // The plugin name.\n\t\t\t'slug' => 'cmb2', // The plugin slug (typically the folder name).\n\t\t\t'source' => get_template_directory() . '/plugins/cmb2.zip', // The plugin source.\n\t\t\t'required' => true\n\t\t\t),\n\n\n//\t\tarray(\n//\t\t\t'name' => 'TGM Example Plugin', // The plugin name.\n//\t\t\t'slug' => 'tgm-example-plugin', // The plugin slug (typically the folder name).\n//\t\t\t'source' => get_template_directory() . '/plugins/tgm-example-plugin.zip', // The plugin source.\n//\t\t\t'required' => false, // If false, the plugin is only 'recommended' instead of required.\n//\t\t\t'version' => '', // E.g. 1.0.0. If set, the active plugin must be this version or higher. If the plugin version is higher than the plugin version installed, the user will be notified to update the plugin.\n//\t\t\t'force_activation' => true, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch.\n//\t\t\t'force_deactivation' => false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins.\n//\t\t\t'external_url' => '', // If set, overrides default API URL and points to an external URL.\n//\t\t\t'is_callable' => '', // If set, this callable will be be checked for availability to determine if a plugin is active.\n//\t\t),\n\n\t\t// This is an example of how to include a plugin from an arbitrary external source in your theme.\n//\t\tarray(\n//\t\t\t'name' => 'TGM New Media Plugin', // The plugin name.\n//\t\t\t'slug' => 'tgm-new-media-plugin', // The plugin slug (typically the folder name).\n//\t\t\t'source' => 'https://s3.amazonaws.com/tgm/tgm-new-media-plugin.zip', // The plugin source.\n//\t\t\t'required' => true, // If false, the plugin is only 'recommended' instead of required.\n//\t\t\t'external_url' => 'https://github.com/thomasgriffin/New-Media-Image-Uploader', // If set, overrides default API URL and points to an external URL.\n//\t\t\t'required' => false,\n//\t\t),\n//\n//\t\t// This is an example of how to include a plugin from a GitHub repository in your theme.\n//\t\t// This presumes that the plugin code is based in the root of the GitHub repository\n//\t\t// and not in a subdirectory ('/src') of the repository.\n//\t\tarray(\n//\t\t\t'name' => 'Adminbar Link Comments to Pending',\n//\t\t\t'slug' => 'adminbar-link-comments-to-pending',\n//\t\t\t'source' => 'https://github.com/jrfnl/WP-adminbar-comments-to-pending/archive/master.zip',\n//\t\t\t'required' => false,\n//\t\t),\n//\n//\t\t// This is an example of how to include a plugin from the WordPress Plugin Repository.\n\t\tarray(\n\t\t\t'name' => 'Regenerate Thumbnails',\n\t\t\t'slug' => 'regenerate-thumbnails',\n\t\t\t'required' => false,\n\t\t),\n//\n//\t\t// This is an example of the use of 'is_callable' functionality. A user could - for instance -\n//\t\t// have WPSEO installed *or* WPSEO Premium. The slug would in that last case be different, i.e.\n//\t\t// 'wordpress-seo-premium'.\n//\t\t// By setting 'is_callable' to either a function from that plugin or a class method\n//\t\t// `array( 'class', 'method' )` similar to how you hook in to actions and filters, TGMPA can still\n//\t\t// recognize the plugin as being installed.\n//\t\tarray(\n//\t\t\t'name' => 'WordPress SEO by Yoast',\n//\t\t\t'slug' => 'wordpress-seo',\n//\t\t\t'is_callable' => 'wpseo_init',\n//\t\t\t'required' => false,\n//\t\t),\n\n\t);\n\n\t/*\n\t * Array of configuration settings. Amend each line as needed.\n\t *\n\t * TGMPA will start providing localized text strings soon. If you already have translations of our standard\n\t * strings available, please help us make TGMPA even better by giving us access to these translations or by\n\t * sending in a pull-request with .po file(s) with the translations.\n\t *\n\t * Only uncomment the strings in the config array if you want to customize the strings.\n\t */\n\t$config = array(\n\t\t'id' => 'itstar', // Unique ID for hashing notices for multiple instances of TGMPA.\n\t\t'default_path' => '', // Default absolute path to bundled plugins.\n\t\t'menu' => 'tgmpa-install-plugins', // Menu slug.\n\t\t'parent_slug' => 'themes.php', // Parent menu slug.\n\t\t'capability' => 'edit_theme_options', // Capability needed to view plugin install page, should be a capability associated with the parent menu used.\n\t\t'has_notices' => true, // Show admin notices or not.\n\t\t'dismissable' => true, // If false, a user cannot dismiss the nag message.\n\t\t'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag.\n\t\t'is_automatic' => false, // Automatically activate plugins after installation or not.\n\t\t'message' => '', // Message to output right before the plugins table.\n\n\t\t/*\n\t\t'strings' => array(\n\t\t\t'page_title' => __( 'Install Required Plugins', 'itstar' ),\n\t\t\t'menu_title' => __( 'Install Plugins', 'itstar' ),\n\t\t\t/* translators: %s: plugin name. * /\n\t\t\t'installing' => __( 'Installing Plugin: %s', 'itstar' ),\n\t\t\t/* translators: %s: plugin name. * /\n\t\t\t'updating' => __( 'Updating Plugin: %s', 'itstar' ),\n\t\t\t'oops' => __( 'Something went wrong with the plugin API.', 'itstar' ),\n\t\t\t'notice_can_install_required' => _n_noop(\n\t\t\t\t/* translators: 1: plugin name(s). * /\n\t\t\t\t'This theme requires the following plugin: %1$s.',\n\t\t\t\t'This theme requires the following plugins: %1$s.',\n\t\t\t\t'itstar'\n\t\t\t),\n\t\t\t'notice_can_install_recommended' => _n_noop(\n\t\t\t\t/* translators: 1: plugin name(s). * /\n\t\t\t\t'This theme recommends the following plugin: %1$s.',\n\t\t\t\t'This theme recommends the following plugins: %1$s.',\n\t\t\t\t'itstar'\n\t\t\t),\n\t\t\t'notice_ask_to_update' => _n_noop(\n\t\t\t\t/* translators: 1: plugin name(s). * /\n\t\t\t\t'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.',\n\t\t\t\t'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.',\n\t\t\t\t'itstar'\n\t\t\t),\n\t\t\t'notice_ask_to_update_maybe' => _n_noop(\n\t\t\t\t/* translators: 1: plugin name(s). * /\n\t\t\t\t'There is an update available for: %1$s.',\n\t\t\t\t'There are updates available for the following plugins: %1$s.',\n\t\t\t\t'itstar'\n\t\t\t),\n\t\t\t'notice_can_activate_required' => _n_noop(\n\t\t\t\t/* translators: 1: plugin name(s). * /\n\t\t\t\t'The following required plugin is currently inactive: %1$s.',\n\t\t\t\t'The following required plugins are currently inactive: %1$s.',\n\t\t\t\t'itstar'\n\t\t\t),\n\t\t\t'notice_can_activate_recommended' => _n_noop(\n\t\t\t\t/* translators: 1: plugin name(s). * /\n\t\t\t\t'The following recommended plugin is currently inactive: %1$s.',\n\t\t\t\t'The following recommended plugins are currently inactive: %1$s.',\n\t\t\t\t'itstar'\n\t\t\t),\n\t\t\t'install_link' => _n_noop(\n\t\t\t\t'Begin installing plugin',\n\t\t\t\t'Begin installing plugins',\n\t\t\t\t'itstar'\n\t\t\t),\n\t\t\t'update_link' \t\t\t\t\t => _n_noop(\n\t\t\t\t'Begin updating plugin',\n\t\t\t\t'Begin updating plugins',\n\t\t\t\t'itstar'\n\t\t\t),\n\t\t\t'activate_link' => _n_noop(\n\t\t\t\t'Begin activating plugin',\n\t\t\t\t'Begin activating plugins',\n\t\t\t\t'itstar'\n\t\t\t),\n\t\t\t'return' => __( 'Return to Required Plugins Installer', 'itstar' ),\n\t\t\t'plugin_activated' => __( 'Plugin activated successfully.', 'itstar' ),\n\t\t\t'activated_successfully' => __( 'The following plugin was activated successfully:', 'itstar' ),\n\t\t\t/* translators: 1: plugin name. * /\n\t\t\t'plugin_already_active' => __( 'No action taken. Plugin %1$s was already active.', 'itstar' ),\n\t\t\t/* translators: 1: plugin name. * /\n\t\t\t'plugin_needs_higher_version' => __( 'Plugin not activated. A higher version of %s is needed for this theme. Please update the plugin.', 'itstar' ),\n\t\t\t/* translators: 1: dashboard link. * /\n\t\t\t'complete' => __( 'All plugins installed and activated successfully. %1$s', 'itstar' ),\n\t\t\t'dismiss' => __( 'Dismiss this notice', 'itstar' ),\n\t\t\t'notice_cannot_install_activate' => __( 'There are one or more required or recommended plugins to install, update or activate.', 'itstar' ),\n\t\t\t'contact_admin' => __( 'Please contact the administrator of this site for help.', 'itstar' ),\n\n\t\t\t'nag_type' => '', // Determines admin notice type - can only be one of the typical WP notice classes, such as 'updated', 'update-nag', 'notice-warning', 'notice-info' or 'error'. Some of which may not work as expected in older WP versions.\n\t\t),\n\t\t*/\n\t);\n\n\ttgmpa( $plugins, $config );\n}", "public function registerPluginTriggersAddPluginWhichSetsPluginIconPathIfIconPathIsGiven() {}", "public function handle(){\n $workingDir = $this->option('working-dir');\n\n $this->comment('Copying composer.json');\n exec(\"cp composer.json $workingDir/composer.json\");\n\n $this->comment('composer update');\n exec(\"composer --working-dir=\\\"$workingDir\\\" update --no-scripts --no-autoloader --quiet\");\n $this->info('composer updated successfully');\n\n $this->comment('overriding vendor');\n exec(\"cp -r $workingDir/vendor ./vendor-new\");\n exec('rm -r vendor');\n exec('mv vendor-new vendor');\n $this->info('vendor overrided successfully');\n\n $this->comment('composer dump-autoload');\n exec('composer dump-autoload --quiet');\n\n $this->comment('composer run post-update-cmd');\n exec('composer run post-update-cmd --quiet');\n\n $this->info('composer:update process finished successfully');\n }", "public static function install(): void\n {\n static::updatePackages();\n static::updatePackages(false);\n static::updateComposerPackages();\n static::updateComposerPackages(false);\n static::updateComposerScripts();\n static::updatePackagesScripts();\n static::updateStyles();\n static::updateBootstrapping();\n static::updateWelcomePage();\n static::updatePagination();\n static::updateLayout();\n static::removeNodeModules();\n }", "public function handle()\n {\n \t//获取参数\n \t$vendor = $this->argument('vendor');\n \t$name = $this->argument('name');\n \t$model = $this->argument('model');\n \t//创建目录\n \t$newPackageDir=base_path(\"packages/\".$vendor.\"/\".$name);\n \tif(!$this->file->exists($newPackageDir)){\n \t\tmkdir($newPackageDir, 0777, true);\n \t\techo \"Package dir created ! \\n\";\n \t}else{\n \t\techo \"The Package dir existed! \\n\";\n \t}\n \t//拷贝包的参考结构\n \t$reference=base_path(\"packages/star2003/tools/pcurd/backend/reference\");\n \t$this->file->copyDirectory($reference,$newPackageDir);\n \techo \"Reference copied ! \\n\";\n \t//修改参考文件内容\n \t$this->helper->init($vendor,$name,$model,$newPackageDir,$this->file);\n \t\n \t//注册composer.json\n \t$content=$this->file->get('composer.json');\n \t$replace='\"psr-4\": {';\n \t$packageInfo=\"\\\"\".ucfirst($vendor).\"\\\\\\\\\".ucfirst($name).\"\\\\\\\\\\\":\\\"packages/\".$vendor.\"/\".$name.\"\\\",\";\n \tif(!strpos($content,$packageInfo)){\n \t\t$content=str_replace($replace,$replace.\"\n \t\t\".$packageInfo,$content);\n \t\t$content=$this->file->put('composer.json',$content);\n \t}else{\n \t\techo \"Info existed in composer.json!\\n\";\n \t}\n \t\n \t//注册config/app.php\n \t$content=$this->file->get('config/app.php');\n \t$replace=\"'providers' => [\";\n \t$providerInfo=ucfirst($vendor).\"\\\\\".ucfirst($name).\"\\\\\".ucfirst($name).\"Provider::class,\";\n \tif(!strpos($content,$providerInfo)){\n \t\t$content=str_replace($replace,$replace.\"\n \t\".$providerInfo,$content);\n \t\t$content=$this->file->put('config/app.php',$content);\n \t}else{\n \t\techo \"Info existed in config/app.php!\\n\";\n \t}\n \t//注册权限\n \tif(!Access::where(\"access\",\"=\",\"admin.$model\")->count()){\n \t\t$access=array(\n \t\t\t\t'name'=>$model,\n \t\t\t\t'access'=>\"admin.$model\",\n \t\t);\n \t\tAccess::create($access);\n \t\t\n \t}\n \t//注册菜单\n \tif(!Menu::where(\"access\",\"=\",\"admin.$model\")->count()){\n \t\t$menu=array(\n \t\t\t'name'=>$model,\n \t\t\t'access'=>\"admin.$model\",\n \t\t\t'url'=>\"admin/$model\",\n \t\t\t'pre_id'=>'1',\n \t\t\t'rank'=>'2',\n \t\t\t'status'=>'1',\n \t\t\t'display'=>'3',\n \t\t\t'icon'=>'',\n\t \t);\n\t \tMenu::create($menu);\n \t}\n \tCache::flush();\n \techo \"Success!\";\n \t\n \t\n }", "private function load_dependencies() {\n\n /**\n * The class responsible for defining options functionality\n * of the plugin.\n */\n include plugin_dir_path(dirname(__FILE__)) . 'envato_setup/envato_setup.php';\n include plugin_dir_path(dirname(__FILE__)) . 'envato_setup/envato_setup_init.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/class-form-fields.php';\n // common functions file\n include plugin_dir_path(dirname(__FILE__)) . 'includes/common-functions.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/careerfy-detail-pages.php';\n \n include plugin_dir_path(dirname(__FILE__)) . 'includes/careerfyframe-end-jsfile.php';\n\n // redux frameworks extension loader files\n include plugin_dir_path(dirname(__FILE__)) . 'admin/redux-ext/loader.php';\n\n // icons manager\n include plugin_dir_path(dirname(__FILE__)) . 'icons-manager/icons-manager.php';\n\n // visual composer files\n include plugin_dir_path(dirname(__FILE__)) . 'includes/vc-support/vc-actions.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/vc-support/vc-shortcodes.php';\n // visual icon files\n include plugin_dir_path(dirname(__FILE__)) . 'includes/vc-icons/icons.php';\n // Mailchimp\n include plugin_dir_path(dirname(__FILE__)) . 'includes/mailchimp/vendor/autoload.php';\n include plugin_dir_path(dirname(__FILE__)) . 'includes/mailchimp/mailchimp-functions.php';\n\n // post types\n include plugin_dir_path(dirname(__FILE__)) . 'includes/post-types/faq.php';\n\n // meta box file\n include plugin_dir_path(dirname(__FILE__)) . 'admin/meta-boxes.php';\n\n // Custom Typography\n include plugin_dir_path(dirname(__FILE__)) . 'includes/custom-typography.php';\n\n // twitter oauth\n include plugin_dir_path(dirname(__FILE__)) . 'includes/twitter-tweets/twitteroauth.php';\n // maintenace mode\n include plugin_dir_path(dirname(__FILE__)) . 'includes/maintenance-mode/maintenance-mode.php';\n\n // redux frameworks files\n include plugin_dir_path(dirname(__FILE__)) . 'admin/ReduxFramework/class-redux-framework-plugin.php';\n include plugin_dir_path(dirname(__FILE__)) . 'admin/ReduxFramework/careerfy-options/options-config.php';\n\n include plugin_dir_path(dirname(__FILE__)) . 'admin/user/user-custom-fields.php';\n\n // instagram admin actions\n include plugin_dir_path(dirname(__FILE__)) . 'admin/instagram.php';\n // load Elementor Extension\n require plugin_dir_path(dirname(__FILE__)) . 'includes/class-careerfy-elementor.php';\n\n }", "function install() {}", "abstract public function register_plugin();", "protected function configure()\n {\n parent::configure();\n\n $this->composer = new Composer($this->preset->filesystem(), $this->preset->basePath());\n }", "public function updater() {\n\t\t// Bail if current user cannot manage plugins.\n\t\tif ( ! current_user_can( 'install_plugins' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Bail if plugin updater is not loaded.\n\t\tif ( ! class_exists( 'Puc_v4_Factory' ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Setup the updater.\n\t\t$updater = Puc_v4_Factory::buildUpdateChecker( 'https://github.com/maithemewp/mai-ads-extra-content/', __FILE__, 'mai-ads-extra-content' );\n\n\t\t// Maybe set github api token.\n\t\tif ( defined( 'MAI_GITHUB_API_TOKEN' ) ) {\n\t\t\t$updater->setAuthentication( MAI_GITHUB_API_TOKEN );\n\t\t}\n\n\t\t// Add icons for Dashboard > Updates screen.\n\t\tif ( function_exists( 'mai_get_updater_icons' ) && $icons = mai_get_updater_icons() ) {\n\t\t\t$updater->addResultFilter(\n\t\t\t\tfunction ( $info ) use ( $icons ) {\n\t\t\t\t\t$info->icons = $icons;\n\t\t\t\t\treturn $info;\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}", "function setup(&$installer, $pkg, $atts, $file)\n {\n }", "function setup(&$installer, $pkg, $atts, $file)\n {\n }", "function installPlugins()\n{\n outputString(PHP_EOL.'Installing plugins', Console::FG_YELLOW);\n $installPluginCmd = './craft install/plugin ';\n foreach (INSTALL_PLUGINS as $pluginHandle) {\n outputString('- installing plugin '.$pluginHandle);\n executeShellCommand($installPluginCmd . $pluginHandle);\n }\n}", "function acf_register_plugin_update($plugin)\n{\n}", "public function install() {\r\n \r\n }", "function get_plugin_update($basename = '', $force_check = \\false)\n {\n }", "public function install()\n {\n }", "public function install()\n {\n }", "private function registerPluginMakeCommand()\n {\n $this->app->bindShared('command.make.plugin', function ($app)\n {\n return new PluginMakeCommand($app['files'], $app['plugins']);\n });\n\n $this->commands('command.make.plugin');\n }", "private function addHelpers() {\n\n $this->info('Adding helpers to composer.json');\n\n $path = base_path('composer.json');\n $contents = file_get_contents($path);\n $manipulator = new JsonManipulator($contents);\n $jsonContents = $manipulator->getContents();\n $decoded = JsonFile::parseJson($jsonContents);\n $datas = isset($decoded['extra']['include_files']) ? $decoded['extra']['include_files'] : [];\n $value = 'vendor/mediactive-digital/medkit/src/helpers.php';\n\n foreach ($datas as $key => $entry) {\n\n if ($entry == $value) {\n\n $value = '';\n\n break;\n }\n }\n\n if ($value) {\n\n $datas[] = $value;\n $manipulator->addProperty('extra.include_files', $datas);\n $contents = $manipulator->getContents();\n\n file_put_contents($path, $contents);\n }\n else {\n\n $this->error(' #ERR1 [SKIP] ' . $path . ' already has helpers');\n }\n }", "public function install(){\n // Create plugin tables\n Project::createTable();\n\n Repo::createTable();\n\n CommitCache::createTable();\n\n MergeRequest::createTable();\n\n MergeRequestComment::createTable();\n\n $htracker = PLugin::get('h-tracker');\n if($htracker && !$htracker->isInstalled()) {\n $htracker->install();\n }\n\n // Create permissions\n Permission::add($this->_plugin . '.access-plugin', 1, 0);\n Permission::add($this->_plugin . '.create-projects', 0, 0);\n }", "public function install() {\n\n\n }", "public function onAfterInstall()\n {\n craft()->db->createCommand()->update(\n 'fields',\n array('type' => 'BetterRedactor'),\n array('type' => 'RichText')\n );\n\n $publicDirectory = craft()->path->appPath . '../../public/redactor_plugins';\n\n if (!IOHelper::folderExists($publicDirectory)) {\n $initialDirectory = craft()->path->getPluginsPath()\n . '/betterredactor/redactor_plugins';\n\n $files = array_filter(\n scandir($initialDirectory),\n function($file) use ($initialDirectory) {\n return is_file(\"$initialDirectory/$file\");\n }\n );\n\n foreach ($files as $file) {\n if (preg_match('((.js|.css)$)i', $file)) {\n IOHelper::copyFile(\n \"$initialDirectory/$file\",\n \"$publicDirectory/$file\"\n );\n }\n }\n }\n }", "public function setup()\n {\n add_action('admin_head', function () {\n echo \"\n <style>\n i.mce-i-raph { font: 400 20px/1 dashicons; background-color: #777; }\n i.mce-i-raph:before { color: #fff!important; }\n </style>\n \";\n });\n add_action('admin_enqueue_scripts', function () {\n wp_localize_script('editor', 'Raph', $this->formData->data());\n });\n add_filter('mce_buttons', function (array $buttons) {\n return array_merge($buttons, ['raphRender']);\n });\n add_filter('mce_external_plugins', function (array $plugins) {\n return array_merge($plugins, ['raphRender' => $this->scriptUrl()]);\n });\n }", "public function getComposerRequires(): array;", "public function install(){\r\n\t\t\r\n\t}", "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 }", "private function manage_plugins( $option = NULL ){\n\t\tif ( 'skip' === $option )\n\t\t\treturn;\n\n\t\t# default plugin set\n\t\t$std_plugin = array(\n\t\t\t'debug-bar',\n\t\t\t'debug-bar-console',\n\t\t\t'debug-bar-cron',\n\t\t\t'debug-bar-extender',\n\t\t\t'developer',\n\t\t\t'log-viewer',\n\t\t\t'monster-widget',\n\t\t\t'piglatin',\n\t\t\t'regenerate-thumbnails',\n\t\t\t'rewrite-rules-inspector',\n\t\t\t'rtl-tester',\n\t\t\t'simply-show-ids',\n\t\t\t'theme-check',\n\t\t\t'theme-test-drive',\n\t\t\t'user-switching',\n\t\t\t'wordpress-importer',\n\t\t\t'wordpress-beta-tester',\n\t\t);\n\n\t\t# wpcom VIP plugin set\n\t\t$vip_plugin = array(\n\t\t\t'grunion-contact-form',\n\t\t\t'jetpack',\n\t\t\t'mp6',\n\t\t\t'polldaddy',\n\t\t\t'vip-scanner',\n\t\t);\n\t\t\n\t\t# plugin developers bundle\n\t\t$dev_plugin = array(\n\t\t\t'log-deprecated-notices',\n\t\t);\n\t\t\n\t\t# debug plugin bundle (author's choice)\n\t\t# please file a pull request to include/exclude plugins\n\t\t$debug_plugin = array(\n\t\t\t'debug-bar-actions-and-filters-addon',\n\t\t\t'debug-bar-constants',\n\t\t\t'debug-my-plugin',\n\t\t\t'debug-objects',\n\t\t\t'uploadplus',\n\t\t);\n\n\t\tswitch ( $option ):\n\t\tcase 'vip':\n\t\t\t\t$plugin_list = array_merge( $std_plugin, $vip_plugin );\n\t\t\t\tbreak;\n\n\t\tcase 'devel':\n\t\t\t\t$plugin_list = array_merge( $std_plugin, $dev_plugin );\n\t\t\t\tbreak;\n\n\t\tcase 'debug':\n\t\t\t\t$plugin_list = array_merge( $std_plugin, $debug_plugin );\n\t\t\t\tbreak;\n\n\t\tcase 'all':\n\t\t\t\t$plugin_list = array_merge( $std_plugin, $vip_plugin, $dev_plugin, $debug_plugin );\n\n\t\tcase 'theme':\n\t\tdefault:\n\t\t\t\t$plugin_list = $std_plugin;\n\t\t\t\tbreak;\n\t\tendswitch;\n\n\t\t$skip_activation = array( 'piglatin', 'wordpress-beta-tester' );\n\t\t# do install\n\t\tforeach ( $plugin_list as $plugin ) :\n\t\t\t$res = WP_CLI::launch( 'wp plugin status '.$plugin, false );\n\t\t\t\n\t\t\tif ( isset( $res ) && $res === 1 ) {\n\t\t\t\t# install plugin (maybe skip piglatin)\n\t\t\t\t$cmdflag = ( in_array( $plugin, $skip_activation ) ) ? '' : ' --activate';\n\t\t\t\tWP_CLI::launch( 'wp plugin install ' . $plugin . $cmdflag );\n\t\t\t} else {\n\t\t\t\t# activate plugin (maybe skip piglatin)\n\t\t\t\tif ( false === in_array( $plugin, $skip_activation ) )\n\t\t\t\t\tWP_CLI::launch( 'wp plugin activate '.$plugin );\n\t\t\t}\n\t\tendforeach;\n\t}", "function install()\n {\n }", "public function postProcess(IO $io);", "public function bootstrap(): void\n {\n $this->addPlugin(MeTools::class);\n }", "public static function _setup_plugin() {\n\t\t\tadd_filter( 'mce_external_plugins', array( __CLASS__, 'mce_external_plugins' ) );\n\t\t\tadd_filter( 'mce_buttons_2', array( __CLASS__, 'mce_buttons_2' ) );\n\t\t\tadd_filter( 'content_save_pre', array( __CLASS__, 'content_save_pre' ), 20 );\n\t\t}", "public abstract function resetComposer();", "private function updateComposerLock(): void\n {\n $composerLockPath = Util::getComposerLockFile();\n $composerJson = \\file_get_contents(Factory::getComposerFile());\n $composer = $this->container->get(Composer::class);\n\n $lockFile = new JsonFile($composerLockPath, null, $this->container->get(IOInterface::class));\n $locker = new Locker(\n $this->container->get(IOInterface::class),\n $lockFile,\n $composer->getRepositoryManager(),\n $composer->getInstallationManager(),\n (string) $composerJson\n );\n\n $lockData = $locker->getLockData();\n $lockData['content-hash'] = Locker::getContentHash((string) $composerJson);\n\n $lockFile->write($lockData);\n }", "private function extendComposer(array $backtrace): void\n {\n foreach ($backtrace as $trace) {\n if (isset($trace['object']) && $trace['object'] instanceof Installer) {\n /** @var \\Composer\\Installer $installer */\n $installer = $trace['object'];\n $installer->setSuggestedPackagesReporter(new SuggestedPackagesReporter(new NullIO()));\n\n break;\n }\n }\n\n foreach ($backtrace as $trace) {\n if (! isset($trace['object']) || ! isset($trace['args'][0])) {\n continue;\n }\n\n if ($trace['object'] instanceof GlobalCommand) {\n self::$isGlobalCommand = true;\n }\n\n if (! $trace['object'] instanceof Application || ! $trace['args'][0] instanceof ArgvInput) {\n continue;\n }\n\n /** @var \\Symfony\\Component\\Console\\Input\\InputInterface $input */\n $input = $trace['args'][0];\n $app = $trace['object'];\n\n try {\n /** @var null|string $command */\n $command = $input->getFirstArgument();\n $command = $command !== null ? $app->find($command)->getName() : null;\n } catch (InvalidArgumentException $e) {\n $command = null;\n }\n\n if ($command === 'create-project') {\n if (\\version_compare(Util::getComposerVersion(), '1.7.0', '>=')) {\n $input->setOption('remove-vcs', true);\n } else {\n $input->setInteractive(false);\n }\n } elseif ($command === 'suggests') {\n $input->setOption('by-package', true);\n }\n\n if ($input->hasOption('no-suggest')) {\n $input->setOption('no-suggest', true);\n }\n\n break;\n }\n }", "function rcomposer() {\n\t\t$this->checkOnce();\n\t\t$deployPath = $this->getVersionPath();\n\t\t//$this->ssh_exec($this->composerCommand.' clear-cache');\n\t\t$this->ssh_exec($this->composerCommand.' config -g secure-http false');\n\t\t$remoteCmd = 'cd '.$deployPath.' && '.$this->composerCommand.' install --ignore-platform-reqs';\n\t\t$this->ssh_exec($remoteCmd);\n\t}", "public function replace_3rd_party_pugins_hooks(){\n }", "public static function install(){\n\t}", "protected static function updateComposerScripts(): void\n {\n if (! file_exists(base_path('composer.json'))) {\n return;\n }\n\n $composer = json_decode(file_get_contents(base_path('composer.json')), true);\n\n $composer['scripts'] = static::updateComposerScriptsArray(\n array_key_exists('scripts', $composer) ? $composer['scripts'] : []\n );\n\n ksort($composer['scripts']);\n\n file_put_contents(\n base_path('composer.json'),\n json_encode($composer, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT).PHP_EOL\n );\n }", "public function hookInstall(): void\n {\n $this->say(\"Executing the Plugin's install hook...\");\n $this->_exec(\"php ./src/hook_install.php\");\n }", "public function registerPluginTriggersAddPluginWhichSetsPluginIconPathIfUsingUnderscoredExtensionNameAndIconPathNotGiven() {}", "function add_options_packages() {\n $this->configure_propack();\n }", "function update_post( $post, $plugin_name, $plugin_info ) {\n echo \"Updating post: \" . $post->ID;\n echo PHP_EOL;\n //echo \"New slug:\" . $plugin_info->\n $parts = explode( '/', $plugin_name );\n $slug = $parts[0];\n echo \"New slug: \" . $slug;\n echo PHP_EOL;\n echo \"New plugin name: \" . $plugin_name;\n echo PHP_EOL;\n echo \"Name: \" . $plugin_info['Name'];\n echo PHP_EOL;\n //echo \"Title: \" . $plugin_info['Title'];\n //echo PHP_EOL;\n //echo \"Desc: \" . $plugin_info['Description'];\n if ( $plugin_info['Name'] !== $plugin_info['Title']) { gob(); }\n\n\n //print_r( $plugin_info );\n\n if ( true ) {\n update_post_meta($post->ID, '_oikp_slug', $slug);\n update_post_meta($post->ID, '_oikp_name', $plugin_name);\n update_post_meta($post->ID, '_oikp_desc', $plugin_info['Name']);\n $plugin_uri = isset( $plugin_info['PluginURI']) ? $plugin_info['PluginURI'] : '';\n update_post_meta($post->ID, '_oikp_uri', $plugin_uri );\n }\n //$_POST['_oikp_slug'] = $this->component;\n //$_POST['_oikp_name'] = $this->get_plugin_file_name();\n // $_POST['_oikp_desc'] = $this->get_plugin_name();\n //$_POST['_oikp_uri'] = $this->get_plugin_uri();\n\n}", "function howes_register_required_plugins(){\n\t\n\t/**\n\t * Array of plugin arrays. Required keys are name and slug.\n\t * If the source is NOT from the .org repo, then source is also required.\n\t */\n\t$plugins = array(\n\t\tarray(\n\t\t\t'name' \t\t\t\t=> 'Revolution Slider', // The plugin name\n\t\t\t'slug' \t\t\t\t=> 'revslider', // The plugin slug (typically the folder name)\n\t\t\t'source' \t\t\t\t=> get_template_directory() . '/inc/plugins/revslider.zip', // The plugin source\n\t\t\t'required' \t\t\t\t=> true, // If false, the plugin is only 'recommended' instead of required\n\t\t\t'version' \t\t\t\t=> '5.4.7.4', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented\n\t\t\t'force_activation' \t\t=> false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch\n\t\t\t'force_deactivation' \t=> false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins\n\t\t\t'external_url' \t\t\t=> '', // If set, overrides default API URL and points to an external URL\n\t\t),\n\t\tarray(\n\t\t\t'name' \t\t\t\t=> 'WPBakery Visual Composer', // The plugin name\n\t\t\t'slug' \t\t\t\t=> 'js_composer', // The plugin slug (typically the folder name)\n\t\t\t'source' \t\t\t\t=> get_template_directory() . '/inc/plugins/js_composer.zip', // The plugin source\n\t\t\t'required' \t\t\t\t=> true, // If false, the plugin is only 'recommended' instead of required\n\t\t\t'version' \t\t\t\t=> '5.4.7', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented\n\t\t\t'force_activation' \t\t=> false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch\n\t\t\t'force_deactivation' \t=> false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins\n\t\t\t'external_url' \t\t\t=> '', // If set, overrides default API URL and points to an external URL\n\t\t),\n\t\tarray(\n\t\t\t'name' \t\t\t\t=> 'CF Post Formats', // The plugin name\n\t\t\t'slug' \t\t\t\t=> 'cf-post-formats', // The plugin slug (typically the folder name)\n\t\t\t'source' \t\t\t\t=> get_template_directory() . '/inc/plugins/cf-post-formats.zip', // The plugin source\n\t\t\t'required' \t\t\t\t=> true, // If false, the plugin is only 'recommended' instead of required\n\t\t\t'version' \t\t\t\t=> '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented\n\t\t\t'force_activation' \t\t=> true, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch\n\t\t\t'force_deactivation' \t=> false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins\n\t\t\t'external_url' \t\t\t=> '', // If set, overrides default API URL and points to an external URL\n\t\t),\n\t\tarray(\n\t\t\t'name' \t\t\t\t=> 'Envato Market', // The plugin name\n\t\t\t'slug' \t\t\t\t=> 'envato-market', // The plugin slug (typically the folder name)\n\t\t\t'source' \t\t\t\t=> get_template_directory() . '/inc/plugins/envato-market.zip', // The plugin source\n\t\t\t'required' \t\t\t\t=> true, // If false, the plugin is only 'recommended' instead of required\n\t\t\t'version' \t\t\t\t=> '', // E.g. 1.0.0. If set, the active plugin must be this version or higher, otherwise a notice is presented\n\t\t\t'force_activation' \t\t=> false, // If true, plugin is activated upon theme activation and cannot be deactivated until theme switch\n\t\t\t'force_deactivation' \t=> false, // If true, plugin is deactivated upon theme switch, useful for theme-specific plugins\n\t\t\t'external_url' \t\t\t=> '', // If set, overrides default API URL and points to an external URL\n\t\t),\n\t\tarray(\n\t\t\t'name' => 'Breadcrumb NavXT',\n\t\t\t'slug' => 'breadcrumb-navxt',\n\t\t\t'required' => true,\n\t\t),\n\t\tarray(\n\t\t\t'name' => 'Contact Form 7',\n\t\t\t'slug' => 'contact-form-7',\n\t\t\t'required' => true,\n\t\t),\n\t\tarray(\n\t\t\t'name' => 'Max Mega Menu',\n\t\t\t'slug' => 'megamenu',\n\t\t\t'required' => false,\n\t\t),\n\t\tarray(\n\t\t\t'name' => 'Easy Pricing Tables Lite by Fatcat Apps',\n\t\t\t'slug' => 'easy-pricing-tables',\n\t\t\t'required' => false,\n\t\t),\n\t);\n\n\t// Change this to your theme text domain, used for internationalising strings\n\t//$theme_text_domain = 'howes';\n\n\t/**\n\t * Array of configuration settings. Amend each line as needed.\n\t * If you want the default strings to be available under your own theme domain,\n\t * leave the strings uncommented.\n\t * Some of the strings are added into a sprintf, so see the comments at the\n\t * end of each line for what each argument will be.\n\t */\n\t$config = array(\n\t\t'domain' \t\t=> 'howes', \t// Text domain - likely want to be the same as your theme.\n\t\t'default_path' \t\t=> '', \t// Default absolute path to pre-packaged plugins\n\t\t//'parent_menu_slug' \t=> 'themes.php', \t\t\t\t// Default parent menu slug\n\t\t//'parent_url_slug' \t=> 'themes.php', \t\t\t\t// Default parent URL slug\n\t\t'menu' \t\t=> 'install-required-plugins', \t// Menu slug\n\t\t'has_notices' \t=> true, \t// Show admin notices or not\n\t\t'is_automatic' \t=> true,\t\t\t\t\t \t// Automatically activate plugins after installation or not\n\t\t'message' \t\t\t=> '',\t\t\t\t\t\t\t// Message to output right before the plugins table\n\t\t'strings' \t\t=> array(\n\t\t\t'page_title' \t\t\t=> __( 'Install Required Plugins', 'howes' ),\n\t\t\t'menu_title' \t\t\t=> __( 'Install Plugins', 'howes' ),\n\t\t\t'installing' \t\t\t=> __( 'Installing Plugin: %s', 'howes' ), // %1$s = plugin name\n\t\t\t'oops' \t\t\t=> __( 'Something went wrong with the plugin API.', 'howes' ),\n\t\t\t'notice_can_install_required' \t\t\t=> _n_noop( 'This theme requires the following plugin: %1$s.', 'This theme requires the following plugins: %1$s.' ), // %1$s = plugin name(s)\n\t\t\t'notice_can_install_recommended'\t\t\t=> _n_noop( 'This theme recommends the following plugin: %1$s.', 'This theme recommends the following plugins: %1$s.' ), // %1$s = plugin name(s)\n\t\t\t'notice_cannot_install' \t\t\t\t\t=> _n_noop( 'Sorry, but you do not have the correct permissions to install the %s plugin. Contact the administrator of this site for help on getting the plugin installed.', 'Sorry, but you do not have the correct permissions to install the %s plugins. Contact the administrator of this site for help on getting the plugins installed.' ), // %1$s = plugin name(s)\n\t\t\t'notice_can_activate_required' \t\t\t=> _n_noop( 'The following required plugin is currently inactive: %1$s.', 'The following required plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s)\n\t\t\t'notice_can_activate_recommended'\t\t\t=> _n_noop( 'The following recommended plugin is currently inactive: %1$s.', 'The following recommended plugins are currently inactive: %1$s.' ), // %1$s = plugin name(s)\n\t\t\t'notice_cannot_activate' \t\t\t\t\t=> _n_noop( 'Sorry, but you do not have the correct permissions to activate the %s plugin. Contact the administrator of this site for help on getting the plugin activated.', 'Sorry, but you do not have the correct permissions to activate the %s plugins. Contact the administrator of this site for help on getting the plugins activated.' ), // %1$s = plugin name(s)\n\t\t\t'notice_ask_to_update' \t\t\t\t\t\t=> _n_noop( 'The following plugin needs to be updated to its latest version to ensure maximum compatibility with this theme: %1$s.', 'The following plugins need to be updated to their latest version to ensure maximum compatibility with this theme: %1$s.' ), // %1$s = plugin name(s)\n\t\t\t'notice_cannot_update' \t\t\t\t\t\t=> _n_noop( 'Sorry, but you do not have the correct permissions to update the %s plugin. Contact the administrator of this site for help on getting the plugin updated.', 'Sorry, but you do not have the correct permissions to update the %s plugins. Contact the administrator of this site for help on getting the plugins updated.' ), // %1$s = plugin name(s)\n\t\t\t'install_link' \t\t\t\t\t \t\t\t=> _n_noop( 'Begin installing plugin', 'Begin installing plugins' ),\n\t\t\t'activate_link' \t\t\t\t \t\t\t=> _n_noop( 'Activate installed plugin', 'Activate installed plugins' ),\n\t\t\t'return' \t\t\t=> __( 'Return to Required Plugins Installer', 'howes' ),\n\t\t\t'plugin_activated' \t\t\t=> __( 'Plugin activated successfully.', 'howes' ),\n\t\t\t'complete' \t\t\t\t\t\t\t\t\t=> __( 'All plugins installed and activated successfully. %s', 'howes' ), // %1$s = dashboard link\n\t\t)\n\t);\n\ttgmpa( $plugins, $config );\n}", "function wpec_authsim_plugin_updater() {\n\t\t$license = get_option( 'wpec_product_'. WPEC_AUTHSIM_PRODUCT_ID .'_license_active' );\n\t\t$key = ! $license ? '' : $license->license_key;\n\t\t// setup the updater\n\t\t$wpec_updater = new WPEC_Product_Licensing_Updater( 'https://wpecommerce.org', __FILE__, array(\n\t\t\t\t'version' \t=> WPEC_AUTHSIM_VERSION, \t\t\t\t// current version number\n\t\t\t\t'license' \t=> $key, \t\t// license key (used get_option above to retrieve from DB)\n\t\t\t\t'item_id' \t=> WPEC_AUTHSIM_PRODUCT_ID \t// id of this plugin\n\t\t\t)\n\t\t);\n\t}", "public function handle()\n {\n if ($this->argument('packagename') != '') {\n $this->namePackage = $this->argument('packagename');\n $this->checkPath();\n } else {\n $this->enterName();\n }\n $data = file_get_contents($this->file);\n file_put_contents($this->directory . '/temp.zip', $data);\n $zip = new \\ZipArchive;\n if ($zip->open($this->directory . '/temp.zip') == true) {\n $zip->extractTo($this->directory . '/');\n $zip->close();\n File::copyDirectory($this->directory . '/evoPackage-master/', $this->directory . '/');\n File::deleteDirectory($this->directory . '/evoPackage-master/');\n unlink($this->directory . '/temp.zip');\n $serviceprovider = file_get_contents($this->directory . '/src/ExampleServiceProvider.php');\n $serviceprovider = str_replace('example', $this->namePackage, $serviceprovider);\n $serviceprovider = str_replace('Example', ucfirst($this->namePackage), $serviceprovider);\n file_put_contents($this->directory . '/src/' . ucfirst($this->namePackage) . 'ServiceProvider.php', $serviceprovider);\n //update composer part\n $composer = file_get_contents($this->directory . '/src/composer.json');\n $composer = str_replace('example', $this->namePackage, $composer);\n $composer = str_replace('Example', ucfirst($this->namePackage), $composer);\n file_put_contents($this->directory . '/src/composer.json', $composer);\n\n unlink($this->directory . '/src/ExampleServiceProvider.php');\n $dirForComposer = 'packages/' . $this->namePackage . '/src/';\n $namespaceForComposer = 'EvolutionCMS\\\\' . ucfirst($this->namePackage) . '\\\\';\n $this->call('package:installautoload', ['key' => $namespaceForComposer, 'value' => $dirForComposer]);\n }\n }", "function lambert_register_required_plugins() {\n /*\n * Array of plugin arrays. Required keys are name and slug.\n * If the source is NOT from the .org repo, then source is also required.\n */\n $plugins = array(\n\n array('name' => esc_html__('WPBakery Page Builder','lambert'),\n // The plugin name.\n 'slug' => 'js_composer',\n // The plugin slug (typically the folder name).\n 'source' => 'http://assets.cththemes.com/plugins/js_composer.zip',\n // The plugin source.\n 'required' => true,\n 'external_url' => esc_url(lambert_relative_protocol_url().'://codecanyon.net/item/visual-composer-page-builder-for-wordpress/242431' ),\n // If set, overrides default API URL and points to an external URL.\n\n 'function_to_check' => '',\n 'class_to_check' => 'Vc_Manager'\n ), \n\n array(\n 'name' => esc_html__('WooCommerce','lambert'),\n // The plugin name.\n 'slug' => 'woocommerce',\n // The plugin slug (typically the folder name).\n 'required' => true,\n // If false, the plugin is only 'recommended' instead of required.\n 'external_url' => esc_url(lambert_relative_protocol_url().'://wordpress.org/plugins/woocommerce/' ), \n // If set, overrides default API URL and points to an external URL.\n\n 'function_to_check' => '',\n 'class_to_check' => 'WooCommerce'\n ), \n\n array('name' => esc_html__('Redux Framework','lambert'),\n // The plugin name.\n 'slug' => 'redux-framework',\n // The plugin source.\n 'required' => true,\n // If false, the plugin is only 'recommended' instead of required.\n 'external_url' => esc_url(lambert_relative_protocol_url().'://wordpress.org/plugins/redux-framework/' ),\n // If set, overrides default API URL and points to an external URL.\n 'function_to_check' => '',\n 'class_to_check' => 'ReduxFramework'\n ), \n\n array(\n 'name' => esc_html__('Contact Form 7','lambert'),\n // The plugin name.\n 'slug' => 'contact-form-7',\n // The plugin slug (typically the folder name).\n 'required' => true,\n // If false, the plugin is only 'recommended' instead of required.\n 'external_url' => esc_url(lambert_relative_protocol_url().'://wordpress.org/plugins/contact-form-7/' ),\n // If set, overrides default API URL and points to an external URL.\n\n 'function_to_check' => 'wpcf7',\n 'class_to_check' => 'WPCF7'\n ), \n\n\n array(\n 'name' => esc_html__('CMB2','lambert'),\n // The plugin name.\n 'slug' => 'cmb2',\n // The plugin slug (typically the folder name).\n 'required' => true,\n // If false, the plugin is only 'recommended' instead of required.\n 'external_url' => esc_url(lambert_relative_protocol_url().'://wordpress.org/support/plugin/cmb2'),\n // If set, overrides default API URL and points to an external URL.\n\n 'function_to_check' => 'cmb2_bootstrap',\n 'class_to_check' => 'CMB2_Base'\n ),\n \n\n array(\n 'name' => esc_html__('Lambert Add-ons','lambert' ),\n // The plugin name.\n 'slug' => 'lambert-add-ons',\n // The plugin slug (typically the folder name).\n 'source' => 'lambert-add-ons.zip',\n // The plugin source.\n 'required' => true,\n // If false, the plugin is only 'recommended' instead of required.\n\n 'force_deactivation' => true,\n\n 'function_to_check' => '',\n 'class_to_check' => 'Lambert_Addons'\n ), \n\n array(\n 'name' => esc_html__('Loco Translate','lambert'),\n // The plugin name.\n 'slug' => 'loco-translate',\n // The plugin slug (typically the folder name).\n 'required' => false,\n // If false, the plugin is only 'recommended' instead of required.\n 'external_url' => esc_url(lambert_relative_protocol_url().'://wordpress.org/plugins/loco-translate/'),\n // If set, overrides default API URL and points to an external URL.\n\n 'function_to_check' => 'loco_autoload',\n 'class_to_check' => 'Loco_Locale'\n ),\n\n \n array(\n 'name' => esc_html__('Envato Market','lambert' ),\n // The plugin name.\n 'slug' => 'envato-market',\n // The plugin slug (typically the folder name).\n 'source' => esc_url(lambert_relative_protocol_url().'://envato.github.io/wp-envato-market/dist/envato-market.zip' ),\n // The plugin source.\n 'required' => true,\n // If false, the plugin is only 'recommended' instead of required.\n 'external_url' => esc_url('//envato.github.io/wp-envato-market/' ),\n // If set, overrides default API URL and points to an external URL.\n\n 'function_to_check' => 'envato_market',\n 'class_to_check' => 'Envato_Market'\n ),\n\n array('name' => esc_html__('One Click Demo Import','lambert'),\n // The plugin name.\n 'slug' => 'one-click-demo-import',\n // The plugin slug (typically the folder name).\n 'required' => false,\n // If false, the plugin is only 'recommended' instead of required.\n 'external_url' => esc_url(lambert_relative_protocol_url().'://wordpress.org/plugins/one-click-demo-import/'),\n // If set, overrides default API URL and points to an external URL.\n\n 'function_to_check' => '',\n 'class_to_check' => 'OCDI_Plugin'\n ),\n\n array('name' => esc_html__('Regenerate Thumbnails','lambert'),\n // The plugin name.\n 'slug' => 'regenerate-thumbnails',\n // The plugin slug (typically the folder name).\n 'required' => false,\n // If false, the plugin is only 'recommended' instead of required.\n 'external_url' => esc_url(lambert_relative_protocol_url().'://wordpress.org/plugins/regenerate-thumbnails/' ),\n // If set, overrides default API URL and points to an external URL.\n\n 'function_to_check' => 'RegenerateThumbnails',\n 'class_to_check' => 'RegenerateThumbnails'\n ),\n\n \n\n\n );\n\n /*\n * Array of configuration settings. Amend each line as needed.\n *\n * TGMPA will start providing localized text strings soon. If you already have translations of our standard\n * strings available, please help us make TGMPA even better by giving us access to these translations or by\n * sending in a pull-request with .po file(s) with the translations.\n *\n * Only uncomment the strings in the config array if you want to customize the strings.\n */\n $config = array(\n 'id' => 'lambert', // Unique ID for hashing notices for multiple instances of TGMPA.\n 'default_path' => get_template_directory() . '/lib/plugins/', // Default absolute path to bundled plugins.\n 'menu' => 'tgmpa-install-plugins', // Menu slug.\n 'has_notices' => true, // Show admin notices or not.\n 'dismissable' => true, // If false, a user cannot dismiss the nag message.\n 'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag.\n 'is_automatic' => false, // Automatically activate plugins after installation or not.\n 'message' => '', // Message to output right before the plugins table.\n\n \n );\n\n tgmpa( $plugins, $config );\n}", "public function afterUpdate()\n {\n ((Settings::get('use_plugin') == FALSE)? $this->update_plugin_versions(TRUE) : $this->update_plugin_versions(FALSE));\n }", "public function register()\r\n {\r\n $this->getContainer()->add('RocketLazyLoadPlugin\\Admin\\ImagifyNotice')\r\n ->withArgument($this->getContainer()->get('template_path'));\r\n }", "private function hooks() {\n\n\t\t$plugin_admin = shortbuild_bu_hooks();\n add_filter( 'advanced_import_demo_lists', array( $plugin_admin, 'add_demo_lists' ), 10, 1 );\n add_filter( 'admin_menu', array( $plugin_admin, 'import_menu' ), 10, 1 );\n add_filter( 'wp_ajax_shortbuild_bu_getting_started', array( $plugin_admin, 'install_advanced_import' ), 10, 1 );\n add_filter( 'admin_enqueue_scripts', array( $plugin_admin, 'enqueue_styles' ), 10, 1 );\n add_filter( 'admin_enqueue_scripts', array( $plugin_admin, 'enqueue_scripts' ), 10, 1 );\n\n /*Replace terms and post ids*/\n add_action( 'advanced_import_replace_term_ids', array( $plugin_admin, 'replace_term_ids' ), 20 );\n }", "function wpaddons_shortcode( $atts ) {\n\n\t// Register and enqueues styles\n\tadd_action( 'wp_enqueue_scripts', array( 'WP_Addons_IO', 'enqueue_styles' ) );\n\n\t$atts = shortcode_atts(\n\t\tarray(\n\t\t\t'debug_mode' => 0,\n\t\t\t'plugin' => '',\n\t\t\t'view' => 'cover-grid-third',\n\t\t),\n\t\t$atts,\n\t\t'wpaddons'\n\t);\n\n\t// Load wpAddons SDK\n\t//require_once plugin_dir_path( __FILE__ ) . '/wpaddons-io-sdk/wpaddons-io-sdk.php';\n\n\t// Set addon parameters\n\t$plugin_data = array(\n\t\t'parant_plugin_slug' => $atts['plugin'],\n\t\t'view' => plugin_dir_path( __FILE__ ) . 'wpaddons-io-sdk/view/' . $atts['view'] . '.php',\n\t);\n\n\t// Initiate addons\n\tnew WP_Addons_IO( $plugin_data );\n\n}", "protected function bootstrapCli(): void\n {\n try {\n $this->addPlugin('Bake');\n } catch (MissingPluginException $e) {\n // Do not halt if the plugin is missing\n }\n\n $this->addPlugin('Migrations');\n\n // Load more plugins here\n }" ]
[ "0.6016796", "0.58867455", "0.58470553", "0.5564594", "0.55156046", "0.54994", "0.54526603", "0.5429389", "0.5371428", "0.5239957", "0.5219345", "0.52148", "0.52141", "0.5208393", "0.5157487", "0.5116476", "0.5105694", "0.50939083", "0.5063629", "0.5048403", "0.5044038", "0.5025825", "0.5008625", "0.4999164", "0.4993139", "0.4988681", "0.49434754", "0.49356872", "0.49343202", "0.49146593", "0.49093485", "0.4890555", "0.48786724", "0.4858943", "0.48174587", "0.48149866", "0.48081854", "0.478736", "0.47812468", "0.47753143", "0.47437528", "0.47423208", "0.47066933", "0.47051376", "0.47043252", "0.4677104", "0.46750405", "0.4674277", "0.46676347", "0.46506542", "0.46501353", "0.46381965", "0.46322772", "0.46298867", "0.4622984", "0.46044272", "0.46034342", "0.458913", "0.45884216", "0.45884216", "0.45785117", "0.45698398", "0.4548481", "0.45342544", "0.4533991", "0.4533991", "0.45338488", "0.45293558", "0.45260412", "0.45234704", "0.45188004", "0.4517468", "0.4516244", "0.4509364", "0.45030892", "0.44971696", "0.4495637", "0.44872665", "0.44847816", "0.44713965", "0.44671956", "0.44623008", "0.44622824", "0.4452853", "0.44512448", "0.4445304", "0.44449252", "0.44412154", "0.44364777", "0.44333845", "0.4427581", "0.44243988", "0.44234404", "0.4413473", "0.4409356", "0.4407304", "0.44063985", "0.44022945", "0.43984833", "0.43926862" ]
0.5934165
1
Returns an array of event names this subscriber wants to listen to. The array keys are event names and the value can be: The method name to call (priority defaults to 0) An array composed of the method name to call and the priority An array of arrays composed of the method names to call and respective priorities, or 0 if unset For instance: array('eventName' => 'methodName') array('eventName' => array('methodName', $priority)) array('eventName' => array(array('methodName1', $priority), array('methodName2'))
public static function getSubscribedEvents() { $result = ['command' => 'onCommand']; return $result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function getSubscribedEvents()\n {\n return [NotificationEvent::NAME => ['handleNotificationEvent', self::getPriority()]];\n }", "public static function getSubscribedEvents()\n {\n return array(\n DefaultEvents::default_pre_index => 'onCustomListener',\n DefaultEvents::default_pre_index => 'onCustomListener',\n OtherEvents::other_pre_index => 'onCustomListener',\n OtherEvents::other_pox_index => 'onCustomListener'\n );\n }", "public function getEventNames(){\n return array($this->getEventName() => array($this,'handle'));\n }", "public static function getSubscribedEvents()\n {\n return array(\n Constants::OMNIPAY_REQUEST_BEFORE_SEND => array('onOmnipayRequestBeforeSend', self::PRIORITY),\n Constants::OMNIPAY_RESPONSE_SUCCESS => array('onOmnipayResponseSuccess', self::PRIORITY),\n Constants::OMNIPAY_REQUEST_ERROR => array('onOmnipayRequestError', self::PRIORITY),\n );\n }", "public function getListeners($eventName): array;", "public static function get_subscribed_events() {\r\n\t\treturn [\r\n\t\t\t'rocket_buffer' => [\r\n\t\t\t\t[ 'extract_ie_conditionals', 1 ],\r\n\t\t\t\t[ 'inject_ie_conditionals', 34 ],\r\n\t\t\t],\r\n\t\t];\r\n\t}", "public static function getSubscribedEvents() {\n return [];\n }", "static public function getSubscribedEvents()\n {\n return array(\n JobEventsMap::STATE_START => array('logJobEvent'),\n JobEventsMap::STATE_FAIL => array('logJobEvent'),\n JobEventsMap::STATE_ERROR => array('logJobEvent'),\n JobEventsMap::STATE_ADD => array('logJobEvent'),\n JobEventsMap::STATE_FINISH => array('logJobEvent'),\n \n WorkerEventsMap::WORKER_START => array('logWorkerEvent'),\n WorkerEventsMap::WORKER_FINISH => array('logWorkerEvent'),\n WorkerEventsMap::WORKER_ERROR => array('logWorkerEvent'),\n \n QueueEventsMap::QUEUE_LIST => array('logQueueListEvent'),\n QueueEventsMap::QUEUE_LOCK => array('logQueueLockEvent'),\n QueueEventsMap::QUEUE_UNLOCK => array('logQueueUnlockEvent'),\n \n QueueEventsMap::QUEUE_LOOKUP => array('logQueueLookupEvent'),\n QueueEventsMap::QUEUE_PURGE => array('logQueuePurgeEvent'),\n QueueEventsMap::QUEUE_PURGE_ACTIVITY => array('logQueuePurgeActivityEvent'),\n QueueEventsMap::QUEUE_QUERY_ACTIVITY => array('logQueueQueryActivityEvent'),\n \n QueueEventsMap::QUEUE_REC => array('logQueueReceiveEvent'),\n QueueEventsMap::QUEUE_REMOVE => array('logQueueRemoveEvent'),\n QueueEventsMap::QUEUE_SENT => array('logQueueSendEvent'),\n \n \n MonitoringEventsMap::MONITOR_COMMIT => array('logMonitorCommitEvent'),\n MonitoringEventsMap::MONITOR_LOCK => array('logMonitorLockEvent'),\n MonitoringEventsMap::MONITOR_QUERY => array('logMonitorQueryEvent'),\n MonitoringEventsMap::MONITOR_RUN => array('logMonitorRunEvent')\n );\n }", "public static function getSubscribedEvents(): array\n {\n return [\n WsServerEvent::HANDSHAKE_SUCCESS => 'handshakeOk',\n WsServerEvent::MESSAGE_RECEIVE => 'messageReceive',\n WsServerEvent::CLOSE_BEFORE => 'messageReceive',\n ];\n }", "public function getEventNames()\n {\n return array_keys($this->events);\n }", "public static function getSubscribedEvents(): array\n\t{\n\t\t// Only subscribe events if the component is installed and enabled\n\t\tif (!ComponentHelper::isEnabled('com_ars'))\n\t\t{\n\t\t\treturn [];\n\t\t}\n\n\t\treturn [\n\t\t\t'onContentPrepare' => 'onContentPrepare',\n\t\t];\n\t}", "public function getSubscribedEvents(): array\n {\n return [\n Events::postLoad,\n Events::onFlush,\n Events::postFlush,\n ];\n }", "public function getSubscribedEvents(): array\n {\n return [\n Events::prePersist,\n Events::preUpdate,\n ];\n }", "public static function getSubscribedEvents(): array\n {\n return [\n ProductEvents::PRODUCT_LOADED_EVENT => 'onProductsLoaded',\n ProductEvents::PRODUCT_WRITTEN_EVENT => 'onProductCreated',\n OrderEvents::ORDER_LOADED_EVENT => 'onOrdersLoaded',\n ];\n }", "public static function getSubscribedEvents()\n {\n return array(\n GetFormDataControllerEvent::NAME => array(\n array('getFormDataNewsController')\n )\n );\n }", "public static function getSubscribedEvents()\n {\n return [\n [\n 'event' => 'serializer.pre_serialize',\n 'method' => 'onPreSerialize',\n ],\n [\n 'event' => 'serializer.post_serialize',\n 'method' => 'onPostSerialize',\n ],\n [\n 'event' => 'serializer.pre_deserialize',\n 'method' => 'onPreDeSerialize',\n ],\n [\n 'event' => 'serializer.post_deserialize',\n 'method' => 'onPostDeSerialize',\n ],\n ];\n }", "public static function getEvents(): array\n {\n return is_array(static::$events) ? static::$events : [static::$events];\n }", "public static function getSubscribedEvents()\n {\n return [\n SubscriptionController::USER_SUBSCRIBED => 'onUserSubscribed',\n ];\n }", "public static function getSubscribedEvents()\n {\n return array(\n ApplicationCreatedEvent::NAME => array(\n array( 'sendConfirmationMail', 0 ),\n array( 'createAdmissionSubscriber', - 2 ),\n ),\n );\n }", "public static function getSubscribedEvents(): array\n {\n return [\n KernelEvents::REQUEST => ['onKernelRequest', 110],\n KernelEvents::RESPONSE => ['onKernelResponse', 10],\n ];\n }", "public function getSubscribedEvents()\n {\n $events = array();\n $self = $this;\n foreach ($this->plugins as $plugin) {\n foreach (array_keys($plugin->getSubscribedEvents()) as $event) {\n if (isset($events[$event])) {\n continue;\n }\n $events[$event] = function() use ($event, $self) {\n $self->handleEvent($event, func_get_args());\n };\n }\n }\n return $events;\n }", "public static function getSubscribedEvents(): array\n {\n return [\n LoginActionEvent::NAME => [\n ['flashLoginEvent', self::FLASH_MESSAGE_PRIORITY],\n ['afterLogin'],\n ]\n ];\n }", "public static function getSubscribedEvents();", "public static function getSubscribedEvents();", "public static function getSubscribedEvents()\n {\n return [\n SetMessageStatusEvent::NAME => 'onSetMessageStatus',\n ];\n }", "public function getEventNames()/*# : array */;", "public static function getSubscribedEvents()\n {\n // event can be dispatch with dispatcher in a controller ...\n return [\n 'user.update' => 'updateUser'\n ];\n }", "public static function get_subscribed_events() {\r\n\t\treturn [\r\n\t\t\t'wp_head' => [ 'preload_fonts' ],\r\n\t\t];\r\n\t}", "private static function get_events() {\n\t\treturn array(\n\t\t\t'formidable_send_usage' => 'weekly',\n\t\t);\n\t}", "public static function getSubscribedEvents()\n {\n return array(\n FixEvents::APPLY => array(\n 'apply', 128\n )\n );\n }", "public static function getSubscribedEvents()\n {\n return array(\n KernelEvents::REQUEST => array('onKernelRequest', 9999),\n KernelEvents::RESPONSE => array('onKernelResponse', 9999),\n //KernelEvents::EXCEPTION => 'onKernelException'\n );\n }", "public static function getSubscribedEvents()\n {\n return [\n //Step 4:Classname::ConstantName or event name 'kernel.request' => 'functionameyouliketocall' - onKernelRequest()\n KernelEvents::REQUEST => 'onKernelRequest',\n ];\n }", "public static function getSubscribedEvents()\n {\n return array(\n KernelEvents::REQUEST => 'onMatchRequest'\n );\n }", "public function getSubscribedEvents()\n {\n return array(\n Events::prePersist,\n Events::onFlush,\n Events::loadClassMetadata\n );\n }", "public static function getSubscribedEvents()\n {\n return [\n KernelEvents::CONTROLLER => \"onKernelController\",\n KernelEvents::EXCEPTION => \"onKernelException\"\n ];\n }", "public static function get_subscribed_events() {\r\n\t\t$slug = rocket_get_constant( 'WP_ROCKET_SLUG', 'wp_rocket_settings' );\r\n\r\n\t\treturn [\r\n\t\t\t'rocket_varnish_ip' => 'set_varnish_localhost',\r\n\t\t\t'rocket_varnish_purge_request_host' => 'set_varnish_purge_request_host',\r\n\t\t\t'rocket_cron_deactivate_cloudflare_devmode' => 'deactivate_devmode',\r\n\t\t\t'after_rocket_clean_domain' => 'auto_purge',\r\n\t\t\t'after_rocket_clean_post' => [ 'auto_purge_by_url', 10, 3 ],\r\n\t\t\t'admin_post_rocket_purge_cloudflare' => 'purge_cache',\r\n\t\t\t'init' => [ 'set_real_ip', 1 ],\r\n\t\t\t'update_option_' . $slug => [ 'save_cloudflare_options', 10, 2 ],\r\n\t\t\t'pre_update_option_' . $slug => [ 'save_cloudflare_old_settings', 10, 2 ],\r\n\t\t\t'admin_notices' => [\r\n\t\t\t\t[ 'maybe_display_purge_notice' ],\r\n\t\t\t\t[ 'maybe_print_update_settings_notice' ],\r\n\t\t\t],\r\n\t\t];\r\n\t}", "protected function getRegisteredEvents() {\n $events = [];\n foreach ($this->loadMultiple() as $rules_config) {\n foreach ($rules_config->getEventNames() as $event_name) {\n $event_name = $this->eventManager->getEventBaseName($event_name);\n if (!isset($events[$event_name])) {\n $events[$event_name] = $event_name;\n }\n }\n }\n return $events;\n }", "public static function getSubscribedEvents()\n {\n return [\n TheliaEvents::ORDER_UPDATE_STATUS => ['implementInvoice', 100]\n ];\n }", "public function getSubscribedEvents()\n {\n return array(\n Events::onFlush,\n Events::loadClassMetadata\n );\n }", "public static function getSubscribedEvents()\n {\n return [\n FOSUserEvents::REGISTRATION_INITIALIZE => [\n ['disableUser', 0],\n ],\n FOSUserEvents::REGISTRATION_SUCCESS => [\n ['registrationFlashMessage', 0],\n ],\n ];\n }", "public static function getSubscribedEvents()\n {\n return array(\n AvisotaMessageEvents::POST_RENDER_MESSAGE_CONTENT => array(\n array('injectGA', -500),\n ),\n\n GetOperationButtonEvent::NAME => array(\n array('prepareButton'),\n ),\n\n BuildDataDefinitionEvent::NAME => array(\n array('injectGALegend'),\n ),\n );\n }", "public static function getListeners() : array\n {\n return Event::$listeners;\n }", "public function getSubscribedEvents(): array\n {\n return [\n Events::onFlush\n ];\n }", "public static function getSubscribedEvents()\n {\n return array(\n EasyAdminEvents::PRE_LIST => 'checkUserRights',\n EasyAdminEvents::PRE_EDIT => 'checkUserRights',\n EasyAdminEvents::PRE_SHOW => 'checkUserRights',\n EasyAdminEvents::PRE_NEW => 'checkUserRights',\n EasyAdminEvents::PRE_DELETE => 'checkUserRights',\n FOSUserEvents::RESETTING_RESET_SUCCESS => 'redirectUserAfterPasswordReset'\n );\n }", "public static function getSubscribedEvents()\n {\n return array(\n ServiceCacheEvents::LOADED => 'onCacheLoaded',\n );\n }", "public static function getEventNames()\n {\n return array(\n self::CREATE_CONNECTION,\n self::DEPLOY_COMMAND_COMPLETE,\n self::DEPLOY_RELEASE,\n self::DEPLOY_RELEASE_COMPLETE,\n self::DEPLOY_RELEASE_FAILED,\n self::GATHER_FACTS,\n self::GET_WORKSPACE,\n self::INITIALIZE,\n self::INSTALL_COMMAND_COMPLETE,\n self::INSTALL_RELEASE,\n self::INSTALL_RELEASE_COMPLETE,\n self::INSTALL_RELEASE_FAILED,\n self::LOG,\n self::PREPARE_DEPLOY_RELEASE,\n self::PREPARE_RELEASE,\n self::PREPARE_WORKSPACE,\n self::ROLLBACK_RELEASE,\n self::ROLLBACK_RELEASE_COMPLETE,\n self::ROLLBACK_RELEASE_FAILED,\n );\n }", "public function getSubscribedEvents(): array\n {\n return [\n Events::prePersist,\n ];\n }", "public static function getSubscribedEvents(): array\n {\n return [\n 'Enlight_Controller_Front_RouteShutdown' => ['handleError', 1000],\n 'Enlight_Controller_Front_PostDispatch' => ['handleError', 1000],\n 'Shopware_Console_Add_Command' => ['handleError', 1000],\n 'Enlight_Controller_Front_DispatchLoopShutdown' => ['handleException', 1000],\n ];\n }", "public static function getSubscribedEvents(): array {\n return array(\n OnBeforeRouteEnterEvent::class => 'onBeforeRouteEnter',\n );\n }", "public function getSubscribedEvents()\n {\n return [\n Events::postUpdate,\n Events::postPersist,\n Events::preRemove\n ];\n }", "public function getSubscribedEvents();", "public function getSubscribedEvents()\n {\n return [\n Events::postPersist,\n Events::postUpdate,\n Events::preRemove,\n ];\n }", "public function getSubscribedEvents(): array\n {\n return [\n 'postPersist',\n 'preUpdate',\n 'preRemove',\n ];\n }", "public function getListeners($event): array;", "public static function getSubscribedEvents()\n {\n return [\n KernelEvents::VIEW => ['onKernelView', 30],\n KernelEvents::RESPONSE => ['onKernelResponse', 30],\n ];\n }", "public function getSubscribedEvents()\n {\n return [\n Events::postPersist,\n Events::postUpdate,\n// Events::preUpdate,\n ];\n\n }", "public function getSubscribedEvents()\n\t{\n\t\treturn [\n\t\t\t'Nette\\Application\\Application::onStartup' => 'appStartup',\n\t\t\t'Nette\\Application\\Application::onRequest' => 'appRequest',\n\t\t];\n\t}", "public function getCallbacks($eventName)\n {\n $eventMap = $this->getEventMap();\n\n if (isset($eventMap[$eventName])) {\n return $eventMap[$eventName];\n }\n\n return array();\n }", "private function registered_events () {\n\n\t\t$triggers = array();\n\n\t\tforeach( get_option( 'nce_triggers' ) as $trigger => $enabled ) {\n\n\t\t\tif( $enabled == \"1\" ) {\n\n\t\t\t\t$triggers[] = $trigger;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn $triggers;\n\n\t}", "public function getSubscribedEvents()\n {\n return array(self::prePersist);\n }", "public function listeners($eventName);", "public function getListeners(): array;", "public function getAllActiveEvents(): array\n {\n $activeEvents = [];\n foreach (self::$eventsMap as $eventName => $eventClass) {\n if (!class_exists($eventClass)) {\n continue;\n }\n\n $activeEvents[] = $eventName;\n }\n\n $listeners = $this->eventDispatcher->getListeners();\n\n // Check if these listeners are part of the new events.\n foreach (array_keys($listeners) as $listenerKey) {\n if (isset(self::$newEventsMap[$listenerKey])) {\n unset($listeners[$listenerKey]);\n }\n\n if (!isset(self::$eventsMap[$listenerKey])) {\n self::$eventsMap[$listenerKey] = $this->getEventClassName($listenerKey);\n }\n }\n\n $activeEvents = array_unique(array_merge($activeEvents, array_keys($listeners)));\n\n asort($activeEvents);\n\n return $activeEvents;\n }", "public function getSubscribedEvents()\n {\n return [\n Events::prePersist,\n Events::postUpdate,\n Events::preRemove,\n ];\n }", "public static function getSubscribedEvents()\n {\n return array(\n Events::PreFlush => 'onPreFlush',\n Events::PostFlush => 'onPostFlush',\n );\n }", "public static function getSubscribedEvents(): array\n {\n return [\n Events::FIGURE_CREATED => 'onFigureCreated',\n ];\n }", "public function getSubscribedEvents()\n {\n return [\n Events::postFlush,\n Events::preRemove\n ];\n }", "public function getListeners($event = NULL)\n\t{\n\t\tif (!empty($event) && array_key_exists($event, static::$events))\n\t\t\treturn static::$events[$event];\n\t\treturn static::$events;\n\t}", "public static function getSubscribedEvents()\n {\n return [\n FOSUserEvents::REGISTRATION_CONFIRM => [\n ['onRegistrationConfirm', -10],\n ],\n ];\n }", "public static function get_subscribed_events() {\r\n\t\t$current_theme = wp_get_theme();\r\n\r\n\t\tif ( 'Bridge' !== $current_theme->get( 'Name' ) ) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\treturn [\r\n\t\t\t'rocket_lazyload_background_images' => 'disable_lazyload_background_images',\r\n\t\t\t'update_option_qode_options_proya' => [ 'maybe_clear_cache', 10, 2 ],\r\n\t\t];\r\n\t}", "public function implementedEvents(): array\n {\n $eventMap = [\n 'Model.beforeMarshal' => 'beforeMarshal',\n 'Model.beforeFind' => 'beforeFind',\n 'Model.beforeSave' => 'beforeSave',\n 'Model.afterSave' => 'afterSave',\n 'Model.afterSaveCommit' => 'afterSaveCommit',\n 'Model.beforeDelete' => 'beforeDelete',\n 'Model.afterDelete' => 'afterDelete',\n 'Model.afterDeleteCommit' => 'afterDeleteCommit',\n 'Model.beforeRules' => 'beforeRules',\n 'Model.afterRules' => 'afterRules',\n ];\n $events = [];\n\n foreach ($eventMap as $event => $method) {\n if (!method_exists($this, $method)) {\n continue;\n }\n $events[$event] = $method;\n }\n\n return $events;\n }", "public static function getSubscribedEvents()\n {\n return array(EventInterface::EXECUTE_DEFINITION => array('executeChainedSteps', -50));\n }", "public static function getSubscribedEvents()\n {\n return array(\n KernelEvents::REQUEST => array('onKernelRequest', 10), // 10 is before Firewall listener.\n );\n }", "function getEvents() {\n return [];\n }", "public static function getSubscribedEvents()\n {\n return array(\n CollectSettingOptionsEvent::NAME => array('handler', 1000),\n );\n }", "public static function getSubscribedEvents()\n {\n return array(\n CollectSettingOptionsEvent::NAME => array('handler', 1000),\n );\n }", "public static function registeredSignals(): array\n {\n return array_keys(self::$callbacks);\n }", "function getEventListeners()\n {\n $listeners = array();\n \n $listener = new Listener($this);\n \n $listeners[] = array(\n 'event' => RoutesCompile::EVENT_NAME,\n 'listener' => array($listener, 'onRoutesCompile')\n );\n\n $listeners[] = array(\n 'event' => GetAuthenticationPlugins::EVENT_NAME,\n 'listener' => array($listener, 'onGetAuthenticationPlugins')\n );\n\n return $listeners;\n }", "public static function getSubscribedEvents(): array\n {\n return array(\n PackageEvents::PRE_PACKAGE_INSTALL => ['loadLockedPatches'],\n PackageEvents::PRE_PACKAGE_UPDATE => ['loadLockedPatches'],\n // The POST_PACKAGE_* events are a higher weight for compatibility with\n // https://github.com/AydinHassan/magento-core-composer-installer and more generally for compatibility with\n // any Composer Plugin which deploys downloaded packages to other locations. In the cast that you want\n // those plugins to deploy patched files, those plugins have to run *after* this plugin.\n // @see: https://github.com/cweagans/composer-patches/pull/153\n PackageEvents::POST_PACKAGE_INSTALL => ['patchPackage', 10],\n PackageEvents::POST_PACKAGE_UPDATE => ['patchPackage', 10],\n );\n }", "function getEvents() {\n\n $events = ['new' => __('New change'),\n 'update' => __('Update of a change'),\n 'solved' => __('Change solved'),\n 'validation' => __('Validation request'),\n 'validation_answer' => __('Validation request answer'),\n 'closed' => __('Closure of a change'),\n 'delete' => __('Deleting a change')];\n\n $events = array_merge($events, parent::getEvents());\n asort($events);\n return $events;\n }", "public static function getSubscribedEvents()\n {\n return [\n AppBundleEvent::QUESTION_REGISTER => 'onQuestionRegister'\n ];\n }", "public function getEvents()\n {\n return $this->eventListeners;\n }", "public static function getSubscribedEvents()\n {\n return array(\n KernelEvents::RESPONSE => 'onKernelResponse',\n KernelEvents::REQUEST => 'onKernelRequest'\n );\n }", "protected static function allowedEvents()\n\t{\n\t\treturn array();\n\t}", "public static function getSubscribedEvents()\n {\n return array(\n KernelEvents::RESPONSE => array('onResponse', 200)\n );\n }", "public static function getSubscribedEvents()\n {\n return array(\n KernelEvents::REQUEST => array('onKernelRequest', 7),\n KernelEvents::RESPONSE => 'onKernelResponse',\n // KernelEvents::CONTROLLER => 'onKernelController'\n );\n }", "public function getEventHandlers($name)\n\t{\n\t\tif(strncasecmp($name,'on',2)===0&&method_exists($this,$name))\n\t\t{\n\t\t\t$name=strtolower($name);\n\t\t\tif(!isset($this->_e[$name]))\n\t\t\t\t$this->_e[$name]=new TPriorityList;\n\t\t\treturn $this->_e[$name];\n\t\t}\n\t\telse if(strncasecmp($name,'fx',2)===0)\n\t\t{\n\t\t\t$name=strtolower($name);\n\t\t\tif(!isset(self::$_ue[$name]))\n\t\t\t\tself::$_ue[$name]=new TPriorityList;\n\t\t\treturn self::$_ue[$name];\n\t\t}\n\t\telse if($this->_m!==null&&$this->_behaviorsenabled)\n\t\t{\n\t\t\tforeach($this->_m->toArray() as $behavior)\n\t\t\t{\n\t\t\t\tif((!($behavior instanceof IBehavior)||$behavior->getEnabled())&&$behavior->hasEvent($name))\n\t\t\t\t\treturn $behavior->getEventHandlers($name);\n\t\t\t}\n\t\t}\n\t\tthrow new TInvalidOperationException('component_event_undefined',get_class($this),$name);\n\t}", "public static function getSubscribedEvents()\n {\n return [\n // PluginEvents::INIT => ['init', PHP_INT_MAX]\n ];\n }", "public static function getSubscribedEvents()\n {\n return array(\n ContaoEvents::CONTROLLER_ADD_TO_URL => 'handleAddToUrl',\n ContaoEvents::CONTROLLER_ADD_ENCLOSURE_TO_TEMPLATE => 'handleAddEnclosureToTemplate',\n ContaoEvents::CONTROLLER_ADD_IMAGE_TO_TEMPLATE => 'handleAddImageToTemplate',\n ContaoEvents::CONTROLLER_GENERATE_FRONTEND_URL => 'handleGenerateFrontendUrl',\n ContaoEvents::CONTROLLER_GET_ARTICLE => 'handleGetArticle',\n ContaoEvents::CONTROLLER_GET_CONTENT_ELEMENT => 'handleGetContentElement',\n ContaoEvents::CONTROLLER_GET_PAGE_DETAILS => 'handleGetPageDetails',\n ContaoEvents::CONTROLLER_GET_TEMPLATE_GROUP => 'handleGetTemplateGroup',\n ContaoEvents::CONTROLLER_LOAD_DATA_CONTAINER => 'handleLoadDataContainer',\n ContaoEvents::CONTROLLER_REDIRECT => 'handleRedirect',\n ContaoEvents::CONTROLLER_RELOAD => 'handleReload',\n ContaoEvents::CONTROLLER_REPLACE_INSERT_TAGS => 'handleReplaceInsertTags',\n );\n }", "public function getSubscribedEvents()\n\t{\n\t\treturn [\n\t\t\tEvents::onFlush\n\t\t];\n\t}", "protected function getRegisteredEvents() {\n// $events = [];\n// foreach ($this->loadMultiple() as $rules_config) {\n// $event = $rules_config->getEvent();\n// if ($event && !isset($events[$event])) {\n// $events[$event] = $event;\n// }\n// }\n// return $events;\n }", "public function getSubscribedEvents()\n {\n return [\n 'postPersist',\n 'postUpdate',\n 'preRemove',\n ];\n }", "public function getSubscribedEvents()\n {\n return [\n 'postPersist',\n 'postUpdate',\n 'preRemove',\n ];\n }", "public function getSubscribedEvents()\n {\n return [\n 'preUpdate',\n 'prePersist',\n 'preRemove',\n 'preFlush',\n 'postFlush',\n 'postPersist',\n 'postUpdate',\n 'postRemove',\n 'postLoad',\n 'onFlush',\n ];\n }", "public function getSubscribedEvents()\n {\n return [\n Events::postLoad,\n Events::prePersist,\n ];\n }", "public function getSubscribedEvents()\n {\n return array(Events::postLoad);\n }", "public static function getSubscribedEvents()\n\t{\n\t\treturn [\n\t\t\tMeetupEvents::MEETUP_JOIN\t=> 'onUserJoins',\n\t\t\tKernelEvents::TERMINATE\t\t=> 'generatePreferences'\n\t\t];\n\t}", "public function getSubscribedEvents(): array\n {\n return [Events::loadClassMetadata, Events::postPersist, Events::postUpdate];\n }", "public static function getSubscribedEvents()\n {\n return [\n FormEvents::PRE_SET_DATA => 'onPreSetData',\n ];\n }", "public static function getSubscribedEvents()\n {\n return [\n FormEvents::PRE_SET_DATA => 'onPreSetData',\n ];\n }" ]
[ "0.7408079", "0.71929526", "0.7041919", "0.70011115", "0.689626", "0.6863996", "0.68291414", "0.6813097", "0.6795053", "0.6774386", "0.6756629", "0.67148554", "0.66607875", "0.66059697", "0.6597897", "0.657932", "0.65720105", "0.6553028", "0.65484715", "0.65460956", "0.65456164", "0.65027153", "0.6502228", "0.6502228", "0.64845026", "0.6463136", "0.6436783", "0.6419676", "0.64010185", "0.63993835", "0.6369362", "0.6349468", "0.63454807", "0.6335921", "0.6334739", "0.63335836", "0.63317394", "0.6322418", "0.631963", "0.6318248", "0.63138616", "0.63114136", "0.6290349", "0.6287602", "0.6279805", "0.6264951", "0.62632746", "0.62611866", "0.6257697", "0.6256157", "0.62559634", "0.62491554", "0.62474924", "0.6244752", "0.6222633", "0.621978", "0.6215321", "0.62103665", "0.6201388", "0.61996704", "0.6198851", "0.61984646", "0.61950094", "0.61927164", "0.6186274", "0.61819786", "0.61797726", "0.61676323", "0.6167477", "0.6162164", "0.6161071", "0.61576045", "0.6155116", "0.61472994", "0.6147164", "0.6147164", "0.61389023", "0.61364555", "0.61347544", "0.6125798", "0.61205995", "0.6101379", "0.6095343", "0.6093451", "0.60875213", "0.6085104", "0.6083107", "0.60664177", "0.6063131", "0.6056086", "0.60531163", "0.60509104", "0.60509104", "0.60491747", "0.60413516", "0.60404724", "0.6031784", "0.6017658", "0.60105324", "0.60105324" ]
0.6127091
79
Process templates on every command.
public function onCommand( \Composer\Plugin\CommandEvent $event ) { if (self::$config) { $templates = self::$config->getTemplates(); $vars = self::$config->getVars(); $hndl = new \Praxigento\Composer\Plugin\Templates\Handler($vars, $this->io); foreach ($templates as $one) { /* process one template */ $hndl->process($one); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function templates()\n\t{\n\t\t$this->ipsclass->input['step']++;\n\t\t$uninstall = ( $this->ipsclass->input['un'] == 1 ) ? \"&amp;un=1\" : \"\";\n\t\t\n\t\t$object = ( $this->tasks['templates'] == 1 ) ? 'Skin Template' : 'Skin Templates';\n\t\t$operation = ( $this->ipsclass->input['un'] ) ? 'removed' : 'created';\n\t\t\n\t\tforeach ( $this->xml_array['templates_group']['template'] as $k => $v )\n\t\t{\n\t\t\t$this->ipsclass->DB->do_delete( 'skin_templates', \"set_id=1 AND group_name='\".$v['group_name']['VALUE'].\"' AND func_name='\".$v['func_name']['VALUE'].\"'\" );\n\t\t\t\n\t\t\tif ( !$this->ipsclass->input['un'] )\n\t\t\t{\n\t\t\t\t$this->_add_template( $v );\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->ipsclass->admin->redirect( \"{$this->ipsclass->form_code}&amp;code=work&amp;mod={$this->ipsclass->input['mod']}&amp;step={$this->ipsclass->input['step']}{$uninstall}&amp;st={$this->ipsclass->input['st']}\", \"{$this->xml_array['mod_info']['title']['VALUE']}<br />{$this->tasks['templates']} {$object} {$operation}....\" );\n\t}", "protected function _parseTemplate() {}", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n DB::unprepared(file_get_contents(database_path('sql' . DIRECTORY_SEPARATOR . 'templates.sql')));\n Schema::enableForeignKeyConstraints();\n return;\n\n $this->setupEmailTemplates();\n $this->setupCommunicationResidentTemplates();\n $this->setupCommunicationServiceTemplates();\n }", "public function run ()\n\t{\n\t\t$dump = template::dump ();\n\n\t\t$head = '';\n\t\tforeach ( $dump ['css'] as $file )\n\t\t{\n\t\t\t$head .= $this->twig->render ( 'system/html/web/snippets/css.twig', [ 'file' => $file, 'defer' => substr ( $file, 0, 2 ) == '//' ] );\n\t\t}\n\n\t\tforeach ( $dump ['js'] as $file )\n\t\t{\n\t\t\t$head .= $this->twig->render ( 'system/html/web/snippets/js.twig', [ 'file' => $file, 'defer' => substr ( $file, 0, 2 ) == '//' ] );\n\t\t}\n\n\t\t$body = '';\n\t\tforeach ( $dump ['templates'] as $template )\n\t\t{\n\t\t\t$body .= $this->twig->render ( $template ['path'], $template ['environment'] );\n\t\t}\n\n\t\t// We do not use die incase some modules need to run after the layout have been generated\n\t\techo $this->twig->render ('system/html/web/base.twig', [\n\t\t\t'head' => $head,\n\t\t\t'body' => $body\n\t\t] );\n\t}", "protected function compile()\n {\n if (TL_MODE == 'BE')\n {\n $this->strTemplate = 'be_wildcard';\n $this->Template = new \\BackendTemplate($this->strTemplate);\n }\n\n if (empty(self::$wrappers))\n {\n return;\n }\n\n foreach (array_pop(self::$wrappers) as $key => $value)\n {\n $this->Template->{$key} = $value;\n }\n }", "function scan_templates_for_translations () {\r\n $this->CI->load->helper( 'file' );\r\n $filename = config_item( 'dummy_translates_filename' );\r\n\r\n // Clean Pattern for new file\r\n $clean_pattern = \"<?php\\n\";\r\n\r\n // Emptying file\r\n write_file( $filename, $clean_pattern );\r\n\r\n $path = realpath( config_item( 'current_template_uri' ) );\r\n $directory = new RecursiveDirectoryIterator( $path );\r\n $iterator = new RecursiveIteratorIterator( $directory );\r\n\r\n // Regex for no deprecated twig templates\r\n $regex = '/^((?!DEPRECATED).)*\\.twig$/i';\r\n $file_iterator = new RegexIterator( $iterator, $regex, RecursiveRegexIterator::GET_MATCH );\r\n\r\n $files = 0;\r\n $arr_strings = array();\r\n\r\n foreach( $file_iterator as $name => $object ) {\r\n $files++;\r\n\r\n // Mega regex for Quoted String tokens with escapable quotes\r\n // http://www.metaltoad.com/blog/regex-quoted-string-escapable-quotes\r\n $pattern = '/{%\\s?trans\\s?((?<![\\\\\\\\])[\\'\"])((?:.(?!(?<![\\\\\\\\])\\1))*.?)\\1/';\r\n $current_file = fopen( $name, 'r' );\r\n\r\n while ( ( $buffer = fgets( $current_file ) ) !== false ) {\r\n if ( preg_match_all( $pattern, $buffer, $matches ) ) {\r\n foreach( $matches[ 2 ] as $match ) {\r\n // Escaping quotes not yet escaped\r\n $match = preg_replace( '/(?<![\\\\\\\\])(\\'|\")/', \"\\'\", $match );\r\n array_push( $arr_strings, \"echo _( '$match' );\\n\" );\r\n }\r\n }\r\n }\r\n\r\n fclose( $current_file );\r\n }\r\n\r\n // Remove duplicates\r\n $arr_strings = array_unique( $arr_strings );\r\n write_file( $filename, implode( $arr_strings ), 'a' );\r\n\r\n $result = array(\r\n 'templates' => $files,\r\n 'strings' => count( $arr_strings ),\r\n 'output' => $filename,\r\n 'lint' => check_php_file_syntax( $filename )\r\n );\r\n\r\n return $result;\r\n }", "private function _prepareTemplate()\r\n {\r\n $this->_template = array();\r\n $this->_prepareTemplateDirectory($this->_templateXml->children(), $this->_template);\r\n }", "public function precompile() {\n\t\tif (isset($this->twig) && $this->twig instanceof \\Twig_Environment) {\n\t\t\t$loader = $this->twig->getLoader();\n\n\t\t\tif (isset($loader) && $loader instanceof \\Twig_Loader_Filesystem) {\n\t\t\t\t$templateDirs = $loader->getPaths(\\Twig_Loader_Filesystem::MAIN_NAMESPACE);\n\n\t\t\t\tforeach ($templateDirs as $templateDir) {\n\t\t\t\t\t$templateDir .= '/';\n\t\t\t\t\t$templates = new \\RecursiveIteratorIterator(\n\t\t\t\t\t\tnew \\RecursiveDirectoryIterator($templateDir),\n\t\t\t\t\t\t\\RecursiveIteratorIterator::LEAVES_ONLY\n\t\t\t\t\t);\n\t\t\t\t\t$templateDir = \\realpath($templateDir);\n\n\t\t\t\t\tforeach ($templates as $template) {\n\t\t\t\t\t\tif ($template->isFile()) {\n\t\t\t\t\t\t\t$templateName = $template->getRealPath();\n\n\t\t\t\t\t\t\tif (\\strpos($templateName, $templateDir) === 0) {\n\t\t\t\t\t\t\t\t$templateName = \\substr($templateName, \\strlen($templateDir));\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// alternative: $templateName = $templates->getSubPathName();\n\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t$this->twig->loadTemplate($templateName);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcatch (\\Twig_Error_Loader $e) {\n\t\t\t\t\t\t\t\tthrow new TemplateNotFoundError($e->getMessage());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcatch (\\Twig_Error_Syntax $e) {\n\t\t\t\t\t\t\t\tthrow new TemplateSyntaxError($e->getMessage(), 0, $e);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcatch (\\Twig_Error_Runtime $e) {\n\t\t\t\t\t\t\t\tthrow new TemplateEvaluationError($e->getMessage(), 0, $e);\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\telse {\n\t\t\t\tthrow new TemplateManagerSetupError();\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new TemplateManagerSetupError();\n\t\t}\n\t}", "public function apply()\n {\n $all_templates = $this->getTemplates($this->configuration);\n\n // Loop templates per $post_type and register templates per $post_type.\n foreach ($all_templates as $post_type => $templates) {\n add_filter(\"theme_{$post_type}_templates\", function($registeredTemplates) use ($templates)\n {\n return array_merge($registeredTemplates, $templates);\n });\n }\n }", "public function template();", "public function initTemplate() {}", "protected function _run()\n {\n $this->strictVars(true);\n\n //assign variables to the template engine\n $vars = get_object_vars($this);\n foreach ($vars as $key => $value) {\n if ('_' != substr($key, 0, 1)) {\n $this->_smarty->assign($key, $value);\n }\n }\n\n //why 'this'?\n //to emulate standard zend view functionality\n //doesn't mess up smarty in any way\n $this->_smarty->assign_by_ref('this', $this);\n\n //smarty needs a template_dir, and can only use templates,\n //found in that directory, so we have to strip it from the filename\n $file = func_get_arg(0);\n\n echo $this->_smarty->fetch($file);\n //process the template (and filter the output)\n }", "function run()\n{\n include config('template_path').'/template.php';\n}", "final public function templateMethod(): void\n {\n $this->baseOperation1();\n $this->requiredOperations1();\n $this->baseOperation2();\n $this->hook1();\n $this->requiredOperation2();\n $this->baseOperation3();\n $this->hook2();\n }", "protected function setupTemplate() {\r\n \r\n }", "public function Setup_Templates_List() : void\n {\n $this->Templates = apply_filters(\"WP_Plugin_virtual_pages_templates\",[\n ...array('page.php', 'index.php' ), ...(array) $this->Template]);\n }", "public function processTemplate($template = '') {\n\t\tif(is_object($this->registry->get('config')) && $this->registry->get('config')->get('embed_mode') == true ){\n\t\t \t//get template if it was set earlier\n\t\t\tif (empty($template)) {\n\t\t\t\t$template = $this->view->getTemplate();\n\t\t\t}\n\t\t\t//only substitute the template for page templates\n\t\t\tif(substr($template, 0, 6) == 'pages/' && substr($template, 0, 6) != 'embed/'){\n\t\t \t//load special headers for embed as no page/layout needed\n\t \t\t$this->addChild('responses/embed/head', 'head');\n\t \t$this->addChild('responses/embed/footer', 'footer');\n\t \t$template = preg_replace('/pages\\//', 'embed/', $template);\t\t\t\n\t\t\t}\n\t\t}\n\t\n\t\tif (!empty($template)) {\n\t\t\t$this->view->setTemplate($template);\n\t\t}\n\t\t$this->view->assign('block_details',$this->block_details);\n\t\t$this->view->assign(\"children_blocks\", $this->getChildrenBlocks());\n\t\t$this->view->enableOutput();\n\t}", "public function run()\n {\n \tfor($itt = 1; $itt < 100; $itt++)\n \t{\n\t\t\tTemplate::create([\n\t\t\t\t'title'\t=>\t'Template '.$itt,\n\t\t\t\t'description'\t=>\t'Template '.$itt.' Description'\n\t\t\t]); \n \t}\n }", "private function renderTemplate(){\n\t\trequire($this->TemplateFile);\n\t}", "protected function setTemplatePaths() {}", "public function page_templates()\n {\n // Single Chiro Quiz page template\n if (is_single() && get_post_type() == $this->token) {\n if (!defined('PLATFORM_FUNNEL')) {\n define('PLATFORM_FUNNEL', 'CHIRO_QUIZ');\n }\n\n include($this->template_path . 'single-quiz.php');\n exit;\n }\n }", "protected function _loadTemplates()\n {\n $this->_tpl = array();\n $dir = Solar_Class::dir($this, 'Data');\n $list = glob($dir . '*.php');\n foreach ($list as $file) {\n \n // strip .php off the end of the file name to get the key\n $key = substr(basename($file), 0, -4);\n \n // load the file template\n $this->_tpl[$key] = file_get_contents($file);\n \n // we need to add the php-open tag ourselves, instead of\n // having it in the template file, becuase the PEAR packager\n // complains about parsing the skeleton code.\n // \n // however, only do this on non-view files.\n if (substr($key, 0, 4) != 'view') {\n $this->_tpl[$key] = \"<?php\\n\" . $this->_tpl[$key];\n }\n }\n }", "protected function compile()\n\t{\n\t\tif (TL_MODE == 'BE')\n\t\t{\n\t\t\t$this->strTemplate = 'be_wildcard';\n\t\t\t$this->Template = new \\BackendTemplate($this->strTemplate);\n\t\t}\n\t}", "abstract public function templates(array $templates);", "function files_handle_on_email_templates(&$templates) {\n $templates[FILES_MODULE] = array(\n new EmailTemplate(FILES_MODULE, 'new_file'), \n new EmailTemplate(FILES_MODULE, 'new_revision')\n );\n }", "public function process_bulk_action() {\n\n if ( ! isset( $_REQUEST[ 'template' ] ) ) {\n return;\n }\n \n switch( strtolower( $this->current_action() ) ){\n case 'activate':\n do_action( 'aal_action_activate_templates', ( array ) $_REQUEST[ 'template' ], true );\n break;\n case 'deactivate':\n do_action( 'aal_action_deactivate_templates', ( array ) $_REQUEST[ 'template' ], true );\n break; \n default:\n return; // do nothing.\n }\n\n // Reload the page.\n exit( \n wp_safe_redirect( \n add_query_arg( \n array(\n 'post_type' => AmazonAutoLinks_Registry::$aPostTypes[ 'unit' ],\n 'page' => AmazonAutoLinks_Registry::$aAdminPages[ 'template' ],\n 'tab' => 'table',\n ), \n admin_url( $GLOBALS[ 'pagenow' ] ) \n )\n )\n );\n \n }", "public function doCommand() {\n $basePath = $this->param('basePath');\n \n $tpl = $basePath . $this->param('template');\n \n if ($this->param('includeContext')) {\n $c = $this->context->toArray();\n extract($c);\n }\n \n if (is_readable($tpl) && is_file($tpl)) {\n // Do we need ob_flush()?\n ob_start();\n include $tpl;\n $str = ob_get_contents();\n ob_end_clean();\n return $str;\n }\n \n return 'Could not read template';\n }", "function template($template=\"simple\"){\n\n\t\t// THE PHYSICAL TEMPLATE SHOULD BE IN THE RESPECTIVE \n\t\t// TEMPLATE/TYPE/$template.php\n\t\t$this->template = $template;\n\t}", "function process_bulk_action() {\n global $catpdf_templates;\n if ('delete' === $this->current_action()) {\n if (count($_POST['template']) > 0) {\n foreach ($_POST['template'] as $template) {\n $catpdf_templates->delete_template($template);\n }\n }\n }\n }", "protected function _content_template() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore \n\t\t$this->content_template();\n\t}", "function parse(){ // parsing template\n\t$loop_count = -1;\n\tif (func_num_args()>= 1){\n\t\t$proc_type = func_get_arg(0);\n\t\t//if (!in_array($proc_type, array(PT_ROOT, PT_IF, PT_FOR, PT_SILENT_IF, PT_SILENT_FOR, PT_FALSE_IF))) system_die('Invalid process type', 'Template->parse');\n\t} else {\n\t\tif ( (PT_COMPILE) && (isset($this->filename)) ) // file parsing\n\t\t{\n\t\t\tif (file_exists($this->filename . '.php'))\n\t\t\t\tif (filemtime($this->filename . '.php') > filemtime($this->filename))\n\t\t\t\t{\n\t\t\t\t\tinclude($this->filename . '.php');\n\t\t\t\t\t$this->result = $r;\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t$nesting = 0;\n\t\t\t$tplc = '<?$r=\\'\\';';\n\t\t\tfor ($i=0; $i<count($this->template); $i++)\n\t\t\t{\n\t\t\t\t// process\n\t\t\t\t$line = trim($this->template[$i]);\n\t\t\t\t$line = preg_replace(PT_COMMENT_TAGS, '', $line); // Remove comments\n\t\t\t\t$result = array();\n\t\t\t\tif (preg_match(PT_START_TAGS, $line, $result))\n\t\t\t\t{\n\t\t\t\t\tif (strcasecmp($result[1], 'FOR') == 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$tplc .= 'for ($i' . $nesting . '=0;$i' . $nesting . '<intval(' . $this->get_var_ref($result[3], $nesting) . ');$i' . $nesting . '++){' . \"\\n\";\n\t\t\t\t\t\t$nesting++;\n\t\t\t\t\t}\n\t\t\t\t\telse // this line is IF opening tag\n\t\t\t\t\t{\n\t\t\t\t\t\t$tplc .= 'if ('.$result[2].'(bool)('.$this->get_var_ref($result[3], $nesting).')){' . \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t} elseif (preg_match(PT_END_TAGS, $line, $result))\n\t\t\t\t{\n\t\t\t\t\t$tplc .= '}' . \"\\n\";\n\t\t\t\t\tif (strcasecmp($result[1], 'FOR') == 0)\n\t\t\t\t\t\t$nesting--;\n\t\t\t\t} elseif (preg_match(PT_MIDDLE_TAGS, $line, $result))\n\t\t\t\t{\n\t\t\t\t\t$tplc .= '}else{' . \"\\n\";\n\t\t\t\t} elseif (preg_match('/<%/', $line, $result))\n\t\t\t\t{\n\t\t\t\t\t$j = 0;\n\t\t\t\t\t$tmp_str = '';\n\t\t\t\t\twhile ($j<strlen($line))\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( ($line[$j] == '<') && ($line[$j+1] == '%') )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (strlen($tmp_str))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$dw = 0;\n\t\t\t\t\t\t\t\t$tplc .= '$r.=' . $this->_process_unk_value($tmp_str, $nesting, $dw) . \";\\n\";\n\t\t\t\t\t\t\t\t$tmp_str = '';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$dw = 0;\n\t\t\t\t\t\t\t$tplc .= '$r.=' . $this->_process_f_value(substr($line, $j), $nesting, $dw) . \";\\n\";\n\t\t\t\t\t\t\t$j += $dw;\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$tmp_str .= $line[$j];\n\t\t\t\t\t\t\t$j++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (strlen($tmp_str))\n\t\t\t\t\t{\n\t\t\t\t\t\t$dw = 0;\n\t\t\t\t\t\t$tplc .= '$r.=' . $this->_process_unk_value($tmp_str, $nesting, $dw) . \";\\n\";\n\t\t\t\t\t}\n\t\t\t\t\tif (strlen($line))\n\t\t\t\t\t\t$tplc .= '$r.=\"\\\\n\";';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (strlen($line))\n\t\t\t\t\t{\n\t\t\t\t\t\t$dw = 0;\n\t\t\t\t\t\t$tplc .= '$r.=' . $this->_process_unk_value($line, $nesting, $dw) . \".\\\"\\\\n\\\";\\n\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$tplc .= '?>';\n\t\t\t\n\t\t\t$fh = fopen($this->filename . '.php', 'wt');\n\t\t\tif ($fh)\n\t\t\t{\n\t\t\t\tfwrite($fh, $tplc);\n\t\t\t\tfclose($fh);\n\t\t\t}\n\t\t\telse\n\t\t\t\tsystem_die('Cannot save compiled template');\n\t\t\tinclude($this->filename . '.php');\n\t\t\t$this->result = $r;\n\t\t\treturn 0;\n\t\t} // if compile and filename\n\t\t$proc_type = PT_ROOT;\n\t\tunset($this->result);\n\t}\n\tif (func_num_args()> 1){\n\t\t$curr_pos = intval(func_get_arg(1));\n\t\tif (($proc_type == PT_FOR) && (func_num_args() < 3)) system_die('Undefined loop count (FOR process)', 'Template->parse');\n\t\tif (func_num_args()> 2) $loop_count = intval(func_get_arg(2));\n\t}\n\telse\n\t\t$curr_pos = 0;\n\t$succ_mode = false;\n\twhile ($curr_pos < sizeof($this->template)){\n\t\t$line = $this->template[$curr_pos]; // current line\n\t\t$line = preg_replace(PT_COMMENT_TAGS, '', $line); // Remove comments\n\t\tif (preg_match(PT_START_TAGS, $line, $result)){ // this line contains one of the START tags\n\t\t\t$result[1] = strtoupper($result[1]);\n\t\t\tif ($result[1] == 'FOR'){\n\t\t\t\tif (!$this->in_vars($result[3]) && ($proc_type < PT_SILENT_IF)){ // invalid FOR variable\n\t\t\t\t\t$error_msg = 'Invalid FOR statement counter named \"'.$result[3].'\"';\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tif ($proc_type <= PT_FOR) $count = intval($this->get_var_val($result[3]));\n\t\t\t\t\t$this->system_vars['cycle_nesting']++;\n\t\t\t\t\t$nesting_saver = $this->system_vars['cycle_nesting'];\n\t\t\t\t\tif ($proc_type> PT_FOR) $last_pos = $this->parse(PT_SILENT_FOR, $curr_pos + 1, 0); // create invisible FOR process\n\t\t\t\t\telse {\n\t\t\t\t\t\tif ($count == 0) $last_pos = $this->parse(PT_SILENT_FOR, $curr_pos + 1, 0); // create invisible FOR process\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tfor ($c = 0; $c < $count; $c++){\n\t\t\t\t\t\t\t\t$this->system_vars['cycle_counters'][$nesting_saver] = $c;\n\t\t\t\t\t\t\t\t$this->system_vars['cycle_nesting'] = $nesting_saver;\n\t\t\t\t\t\t\t\t$last_pos = $this->parse(PT_FOR, $curr_pos + 1, $c); // create visible FOR process in loop\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$curr_pos = $last_pos;\n\t\t\t\t}\n\t\t\t} else { // this line is IF opening tag\n\t\t\t\tif (!$this->in_vars($result[3]) && ($proc_type < PT_SILENT_IF)){\n\t\t\t\t\t$error_msg = 'Invalid IF statement variable named \"'.$result[3].'\"';\n\t\t\t\t\tbreak;\n\t\t\t\t} else {\n\t\t\t\t\tif ($proc_type>PT_FOR) $curr_type = PT_SILENT_IF;\n\t\t\t\t\telse {\n\t\t\t\t\t\t$var = (bool)$this->get_var_val($result[3]);\n\t\t\t\t\t\tif (strlen($result[2])> 0) $var = !$var;\n\t\t\t\t\t\t$curr_type = ($var)?PT_IF:PT_FALSE_IF;\n\t\t\t\t\t}\n\t\t\t\t\tif ($loop_count!=-1) $curr_pos = $this->parse($curr_type, $curr_pos+1, $loop_count); // create new IF process inside the loop\n\t\t\t\t\telse $curr_pos = $this->parse($curr_type, $curr_pos+1); // create new IF process\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif(preg_match(PT_END_TAGS, $line, $result)){\n\t\t\t$result[1] = strtoupper($result[1]);\n\t\t\tif (((($proc_type == PT_FOR) || ($proc_type == PT_SILENT_FOR)) && ($result[1] == 'FOR')) || ((($proc_type == PT_IF) || ($proc_type == PT_SILENT_IF) || ($proc_type == PT_FALSE_IF)) && ($result[1] == 'IF'))) {\n\t\t\t\tif (($proc_type == PT_FOR) || ($proc_type == PT_SILENT_FOR)) $this->system_vars['cycle_nesting']--; // this one was the end of loop block\n\t\t\t\t$succ_mode = true;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\t$error_msg = 'Unexpected end of '.$result[1].' statement';\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} elseif(preg_match(PT_MIDDLE_TAGS, $line, $result)){ // this line contains one of the MIDDLE tags (ELSE probably)\n\t\t\t$result[1] = strtoupper($result[1]);\n\t\t\tif (($proc_type == PT_FALSE_IF) && ($result[1] == 'ELSE')) {\n\t\t\t\t$proc_type = PT_IF;\n\t\t\t} elseif (($proc_type == PT_IF) && ($result[1] == 'ELSE')) {\n\t\t\t\t$proc_type = PT_FALSE_IF;\n\t\t\t} elseif($proc_type != PT_SILENT_IF) { // ELSE inside non IF process or so\n\t\t\t\t$error_msg = 'Unexpected '.$result[1].' statement '.$proc_type;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} elseif ($proc_type <= PT_FOR){ // processing of visible contents\n\t\t\tif (!isset($this->result)) $this->result = '';\n\t\t\t\t$matches = array();\n\t\t\t\t$line_is_control = false;\n\n\t\t\t\tif (preg_match_all(PT_COUNTER_TAGS, $line, $matches)){ // We have counter tags inside\n\t\t\t\t\t$replace = array();\n\t\t\t\t\tforeach ($matches[0] as $key => $val){ // process counters\n\t\t\t\t\t\tif ($loop_count >= 0) $replace[$key] = $loop_count + 1;\n\t\t\t\t\t\telse $replace[$key] = '';\n\t\t\t\t\t}\n\t\t\t\t\t$line = str_replace($matches[0], $replace, $line); // replace'em all\n\t\t\t\t}\n\t\t\t\t// processing variables\n\n\t\t\t\tif (preg_match_all(PT_VARIABLE_TAGS, $line, $matches)){ // Yes! We have some tags inside\n\t\t\t\t\t$replace = array();\n\t\t\t\t\tforeach ($matches[2] as $key => $val){ // go thru the matches\n\t\t\t\t\t\tif (strlen($matches[4][$key])> 0){ // process array variables\n\t\t\t\t\t\t\tif (isset($this->vars[$val]) && is_array($this->vars[$val]) && array_key_exists($matches[4][$key], $this->vars[$val])){\n\t\t\t\t\t\t\t\t\t$replace[$key] = $this->vars[$val][$matches[4][$key]];\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '#')\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = htmlspecialchars($replace[$key]); // escape html entries for # tag\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '+')\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace('+', '%20', urlencode($replace[$key])); // url escape for + tag\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '^')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\\\\", \"\\\\\\\\\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"'\", \"\\\\'\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\r\", \"\\\\r\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\n\", \"\\\\n\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"</script>\", \"</'+'script>\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} elseif (isset($this->vars[$val]) && is_object($this->vars[$val])) {\n\t\t\t\t\t\t\t\t \t$_obj = &$this->vars[$val];\n\t\t\t\t\t\t\t\t\t$_name = $matches[4][$key];\n\t\t\t\t\t\t\t\t\t$replace[$key] = $_obj->$_name;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '#')\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = htmlspecialchars($replace[$key]); // escape html entries for # tag\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '+')\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace('+', '%20', urlencode($replace[$key])); // url escape for + tag\n\t\t\t\t\t\t\t\t\tif ($matches[1][$key] == '^')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\\\\", \"\\\\\\\\\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"'\", \"\\\\'\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\r\", \"\\\\r\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\n\", \"\\\\n\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"</script>\", \"</'+'script>\", $replace[$key]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif ($this->debug_mode) $this->show_notice($val.$matches[3][$key], 4); // show stupid notice\n\t\t\t\t\t\t\t\t$replace[$key] = ''; // and insert complete emptyness\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else{ // process common variables\n\t\t\t\t\t\t\tif (isset($this->vars[$val]))\n\t\t\t\t\t\t\t\t$replace[$key] = $this->get_var_val($val);\n\t\t\t\t\t\t\telseif (preg_match('/\\\\//', $val))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$v_row = $this->Registry->_internal_get_value($val);\n\t\t\t\t\t\t\t\tif ( ($v_row !== false) && (!$v_row->eof()) ) {\n\t\t\t\t\t\t\t\t\t$out = $v_row->Rows[0]->Fields['value'];\n\t\t\t\t\t\t if ($v_row->Rows[0]->Fields['key_type'] == KEY_TYPE_IMAGE)\n\t\t\t\t\t\t\t\t\t\t$out = $GLOBALS['app']->template_vars['REGISTRY_WEB'] . $v_row->Rows[0]->Fields['id_path'] . '/' . $out;\n\t\t\t\t\t\t\t\t\t$replace[$key] = $out;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t$replace[$key] = '';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t$replace[$key] = '';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ($matches[1][$key] == '#')\n\t\t\t\t\t\t\t\t$replace[$key] = htmlspecialchars($replace[$key]); // escape html entries for # tag\n\t\t\t\t\t\t\tif ($matches[1][$key] == '+')\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace('+', '%20', urlencode($replace[$key])); // url escape for + tag\n\t\t\t\t\t\t\tif ($matches[1][$key] == '^')\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\\\\", \"\\\\\\\\\", $replace[$key]);\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"'\", \"\\\\'\", $replace[$key]);\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\r\", \"\\\\r\", $replace[$key]);\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"\\n\", \"\\\\n\", $replace[$key]);\n\t\t\t\t\t\t\t\t$replace[$key] = str_replace(\"</script>\", \"</'+'script>\", $replace[$key]);\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$line = str_replace($matches[0], $replace, $line); // replace'em all\n\t\t\t\t}\n\n\t\t\t\t// processing ternary operators\n\n\t\t\t\tif (preg_match_all(PT_TERNARY_TAGS, $line, $matches)){ // Yes! We have some tags inside\n\t\t\t\t\tforeach ($matches[2] as $key => $val){ // go thru the matches\n\t\t\t\t\t\tif (isset($this->vars[$val])){\n\t\t\t\t\t\t\t$var = (bool)$this->get_var_val($val);\n\t\t\t\t\t\t\tif (strlen($matches[1][$key])> 0) $var = !$var;\n\t\t\t\t\t\t\t$res_num = ($var)?4:6;\n\t\t\t\t\t\t\tif (isset($this->vars[$matches[$res_num][$key]])) {\n\t\t\t\t\t\t\t\t$replace[$key] = $this->get_var_val($matches[$res_num][$key]);\n\t\t\t\t\t\t\t\tif (strlen($matches[$res_num - 1][$key])> 0) $replace[$key] = htmlspecialchars($replace[$key]); // escape html entries\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tif ($this->debug_mode) $this->show_notice($res_var, 1);\n\t\t\t\t\t\t\t\t$result[$key] = '';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else { // we have tag but haven't got variable\n\t\t\t\t\t\t\tif ($this->debug_mode) $this->show_notice($val, 1); // curse them out in debug mode\n\t\t\t\t\t\t\t$replace[$key] = ''; // and insert pretty nothing\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$line = str_replace($matches[0], $replace, $line); // replace'em all\n\t\t\t\t}\n\n\t\t\t\t// processing controls\n\t\t\t\tif (preg_match_all(PT_CONTROL_TAGS, $line, $matches)){ // Yes! This line contains control definition\n\t\t\t\t\t$replace = array();\n\t\t\t\t\tforeach ($matches[1] as $key => $name){ // go through the matches\n\t\t\t\t\t\tif (strlen($matches[3][$key])> 0) $tcontrol = &$GLOBALS['pt_template_factory']->get_object(strtolower($name), strtolower($matches[3][$key])); // here is control with id\n\t\t\t\t\t\telse $tcontrol = &$GLOBALS['pt_template_factory']->get_object(strtolower($name)); // here is control without id\n\t\t\t\t\t\tif (!is_null($tcontrol)){\n\t\t\t\t\t\t\t$tcontrol->parse_vars($matches[5][$key]);\n\t\t\t\t\t\t\tif (!$tcontrol->is_inited)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$tcontrol->on_page_init();\n\t\t\t\t\t\t\t\t$tcontrol->is_inited = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$replace[$key] = $tcontrol->process($loop_count);\n\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t$replace[$key] = '';\n\t\t\t\t\t}\n\t\t\t\t\t$line = str_replace($matches[0], $replace, $line); // replace control statements with control results\n\t\t\t\t}\n\n\t\t\t\t// compress and delete blank lines\n\t\t\t\t$line = preg_replace('/[\\r\\n]*$/', '', trim($line));\n\t\t\t\tif (strlen($line)> 0) $this->result .= $line . \"\\n\";\n\t\t\t}\n\t\t\t$curr_pos++;\n\t\t}\n\n// And what we have here?\n\t\tif (!isset($error_msg) && ($proc_type != PT_ROOT) && !$succ_mode) $error_msg = 'Unexpected end of file'; // invalid template - show error\n\t\tif (isset($error_msg)){\n\t\t\t$error_txt = 'Template parsing error on line '.($curr_pos + 1);\n\t\t\tif (isset($this->filename))\t$error_txt .= ' of file \"'.$this->filename.'\"';\n\t\t\t$error_txt .= ' - '.$error_msg;\n\t\t\tsystem_die($error_txt, 'Template->parse'); // invalid template - show error\n\t\t}\n\t\tif ($proc_type == PT_ROOT)\n\t\t\tif (!isset($this->result))\n\t\t\t\t$this->result = ''; // probably there were one big false IF?\n\t\treturn $curr_pos; // HURRA! HURRA! This one is successfully completed!\n\t}", "public function render() {\n $templates = func_get_args();\n $reserved = array('templates', 'template', 'this', 'key', 'value', 'reserved');\n \n // Give access to the set variables\n if (!empty($this->vars)) {\n foreach ($this->vars as $key => $value) {\n if (!in_array($key, $reserved)) {\n $$key = $value;\n }\n }\n }\n \n // Load the templates\n foreach ($templates as $template) {\n include $this->getThemedFile(\"{$template}.template.php\");\n }\n }", "function handle() {\n\t\t$xgettextArgs = array();\n\t\t$twigTemplates = array();\n\t\t$this->readCommandLineArgs($xgettextArgs, $twigTemplates);\n\t\t$phpTemplates = $this->loadTemplate($twigTemplates);\n\t\t$command = implode(' ', $xgettextArgs);\n\t\t$phpTemplates = implode(' ', $phpTemplates);\n\t\t$command = self::XGETTEXT_PATH . \" $command $phpTemplates\";\n\t\tsystem($command);\n\t}", "public function update_template_manager_callback() {\n\n // Make sure a template was submitted\n if ( ! isset($_POST['templates']) ) {\n return;\n }\n\n // grabe the template being rendered\n $templates = $_POST['templates'];\n\n // Decode the templates for PHP use\n $templates = json_decode( stripslashes( $templates ) );\n\n // Confert to array\n $templates = get_object_vars( $templates );\n\n $sanitized_templates = array();\n foreach ( $templates as $slug => $template ) {\n $sanitized_templates[$slug] = get_object_vars( $template );\n }\n\n // Update the database option\n update_option( 'cv_builder_templates', $sanitized_templates );\n\n die();\n\n }", "protected function _content_template() { // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore\n\t\t$this->content_template();\n\t}", "public function loadTemplate()\n\t\t{\n\t\t}", "private function prepareTemplate() {\r\n $template = $this->iTemplateFactory->createTemplate();\r\n $template->_control = $this->linkGenerator;\r\n $this->setTemplate($template);\r\n }", "protected function content_template() {}", "protected function content_template() {}", "public function forTemplate() {\n\t\treturn; \n\t}", "function scanPmanTemplates()\n {\n $tp = DB_DAtaObject::Factory('core_template');\n \n foreach ($this->modules() as $m){\n //var_dump($m);\n // templates...\n $ar = $this->scanDir(array(\n 'tdir' => \"Pman/$m/templates\",\n 'subdir' => '',\n 'match' => '/\\.(html|txt|abw)$/',\n 'skipdir' => array('images','css','js'),\n \n ));\n // print_r($ar);\n \n foreach($ar as $pg) {\n \n $temp = $tp->syncTemplatePage(array(\n 'base' =>'Pman.'.$m, \n 'template_dir' => \"Pman/$m/templates\",\n 'template' => $pg\n ));\n if ($temp) {\n $ids[] = $temp->id;\n }\n }\n // should clean up old templates..\n // php files..\n $ar = $this->scanDir(array(\n 'tdir' => \"Pman/$m\",\n 'subdir' => '',\n 'match' => '/\\.(php)$/',\n 'skipdir' => array('templates'),\n \n ));\n \n \n foreach($ar as $pg) {\n \n $temp = $tp->syncPhpGetText(array(\n 'base' =>'Pman.'.$m, \n 'template_dir' => \"Pman/$m\",\n 'template' => $pg\n ));\n if ($temp) {\n $ids[] = $temp->id;\n }\n \n }\n \n \n \n \n \n //$tp->syncTemplatePage($pg);\n }\n $del = DB_DataObject::factory('core_template');\n $del->whereAddIn('!id', $ids, 'int');\n $del->whereAddIn('view_name', $this->modules(), 'string');\n $del->whereAddIn('filetype' , array( 'php', 'html' ), 'string');\n $delids = $del->fetchAll('id');\n if ($delids) {\n DB_DataObject::factory('core_template')->query(\n 'update core_template set is_deleted = 1 where id in('. implode(',', $delids). ')'\n );\n }\n \n }", "function index(){\n\t\t$this->template->run();\n\t}", "protected function content_template() {\n\t}", "public function print_templates()\n {\n }", "public function template()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/template', [\n\t\t\t'templates_availables' => $this->templates_availables,\n\t\t]);\n\t}", "protected function postProcessCopyFromTemplate()\n {\n }", "function render_template($template, $settings) {\n $text = file_get_contents($template); \n $text = transform_text($text, $settings);\n return $text;\n }", "static protected function templatePhp(string $template, array $arguments = [])\n {\n //Chemin vers le fichier\n $file = __DIR__ . '/../../templates/' . $template;\n\n extract($arguments);\n\n include $file;\n\n }", "public function processaTemplate() {\n return $this->fetch('ricerca_'.$this->_layout.'.tpl');\n }", "private function render_template() {\n\t\t$template = $this->template;\n\n\t\tif ( ! is_readable( $template ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tinclude $template;\n\t}", "private function registerTemplates()\n {\n if (!isset($this->config['templates']) || !count($this->config['templates'])) {\n return;\n }\n\n $templatesToAdd = [];\n foreach ($this->config['templates'] as $templateName) {\n $templatesToAdd[ sanitize_title_with_dashes($templateName) ] = $templateName;\n }\n\n add_filter('theme_page_templates', function ($templates) use ($templatesToAdd) {\n foreach ($templatesToAdd as $slug => $name) {\n $templates[ $slug ] = $name;\n }\n return $templates;\n });\n }", "protected function runtimeProcessTemplate()\n\t{\n\t// Here we grab the theme to get the javascript and css include file.\n\t\t$theme = new Theme($this->theme);\n\t\t$this->addJSInclude($theme->getUrl('js'));\n\t\t$this->addCssInclude($theme->getUrl('css'));\n\n\t\t$this->preStartupJs[] = 'var baseUrl = ' . json_encode(ActiveSite::getLink()) . ';';\n\n\t\tif(isset($this->menuObjects))\n\t\t\tforeach($this->menuObjects as $name => $menuDisplay)\n\t\t{\n\t\t\t$this->addRegion($name, $menuDisplay->makeDisplay());\n\t\t}\n\n\t// This line ensures that any additional content we add below that requires a fully-functional system doesn't\n\t// choke the installer.\n\t\tif(defined('INSTALLMODE') && INSTALLMODE) return true;\n\n\t// Add the messages to the page.\n\t\tif(count($this->messages) > 0)\n\t\t{\n\t\t\t$outputMessage = new HtmlObject('div');\n\t\t\t$outputMessage->addClass('messageContainer');\n\n\t\t\tforeach($this->messages as $message)\n\t\t\t{\n\t\t\t\t$outputMessage->insertNewHtmlObject('div')->wrapAround($message);\n\t\t\t}\n\t\t\t$this->addRegion('messages', (string) $outputMessage);\n\t\t}\n\t}", "public function renderTemplate();", "protected function setTemplateVariables() {}", "protected function content_template()\n\t{\n\t\t//\n\t}", "protected function compile(): void\n {\n if (System::getContainer()->get('contao.routing.scope_matcher')->isBackendRequest(System::getContainer()->get('request_stack')->getCurrentRequest() ?? Request::create(''))) {\n $this->strTemplate = 'be_wildcard';\n $this->Template = new BackendTemplate($this->strTemplate);\n }\n\n $this->Template->tabsElement = $this->tabs_element;\n }", "public function run()\n\t{\n\t\tif (file_exists('templates/type.html'))\n\t\t{\n\t\t $this->obj->setTemplateName('type');\n\t\t}\n\t\telse\n\t\t{\n\t\t throw new Exception('Template was not found');\n\t\t}\n\t\t$this->creataTypeArray();\n\t}", "protected function _content_template() {\n\t}", "protected function _recompileAssociatedTemplates()\n\t{\n\t\t$templateTitles = array($this->get('template_title'), $this->getExisting('template_title'));\n\t\t$templateModel = $this->_getTemplateModel();\n\n\t\t// keyed by template_map_id\n\t\t$templates = $templateModel->getNamedTemplatesInStyleTreeWithChildren($templateTitles, $this->get('style_id'));\n\t\t$compiledMapIds = $templateModel->compileMappedTemplatesInStyleTree(array_keys($templates));\n\t\t$templateModel->compileMappedTemplatesInStyleTree($templateModel->getIncludingTemplateMapIds($compiledMapIds));\n\t}", "protected function compile() {\n if (TL_MODE == 'BE') {\n $this->genBeOutput();\n } else {\n $this->genFeOutput();\n }\n }", "private function set_templates() {\r\n $this->templates = array();\r\n\r\n foreach ( (array) $this->variations as $variation ) {\r\n $variation = strlen( $variation ) > 0 ? '-' . $variation : '';\r\n $this->templates[] = $this->base . $variation;\r\n }\r\n }", "function customize_themes_print_templates()\n {\n }", "protected function render_template()\n {\n }", "protected function render_template()\n {\n }", "protected function render_template()\n {\n }", "protected function render_template()\n {\n }", "private function generate() {\r\n\t\t$frontend = $this->getFrontend();\r\n\t\t// Clone the Template rendering object since we don't want to influence the processing:\r\n\t\t/** @var $template \\TYPO3\\CMS\\Core\\TypoScript\\TemplateService */\r\n\t\t$template = clone $frontend->tmpl;\r\n\t\t$template->start ( $frontend->sys_page->getRootLine($this->getTemplatePageId($frontend)));\r\n\r\n\t\t$keysToBeCached = array('config.', 'includeLibs.', 'lib.', 'plugin.', 'tt_content', 'tt_content.');\r\n\t\t/** @var $event Tx_Extracache_System_Event_Events_Event */\r\n\t\t$event = GeneralUtility::makeInstance('Tx_Extracache_System_Event_Events_Event', self::EVENT_Generate, $this, $keysToBeCached);\r\n\t\t$this->getEventDispatcher()->triggerEvent($event);\r\n\r\n\t\t$cache = array();\r\n\t\tforeach ($event->getInfos() as $keyToBeCached) {\r\n\t\t\t$cache[$keyToBeCached] = $template->setup[$keyToBeCached];\r\n\t\t}\r\n\r\n\t\t$this->persistCache($cache);\r\n\r\n\t\treturn $cache;\r\n\t}", "public function process( $last )\n {\n $this->result = $this->template->process( $this->templateLocation );\n }", "public function loadTemplates() {\n // Get database hooks.\n $doctrine = $this->container->get('doctrine');\n $slideTemplateRepository = $doctrine->getRepository('Os2DisplayCoreBundle:SlideTemplate');\n $screenemplateRepository = $doctrine->getRepository('Os2DisplayCoreBundle:ScreenTemplate');\n $entityManager = $doctrine->getManager();\n\n // Get parameters.\n $path = $this->container->get('kernel')->getRootDir() . '/../web/';\n $serverAddress = $this->container->getParameter('absolute_path_to_server');\n\n // Locate templates in /web/bundles/\n $templates = $this->findTemplates($path . 'bundles/');\n\n foreach ($templates['slides'] as $config) {\n $dir = explode('/web/', pathinfo($config, PATHINFO_DIRNAME));\n $this->loadSlideTemplate($config, $slideTemplateRepository, $entityManager, $dir[1], $serverAddress, $path);\n }\n\n foreach ($templates['screens'] as $config) {\n $dir = explode('/web/', pathinfo($config, PATHINFO_DIRNAME));\n $this->loadScreenTemplate($config, $screenemplateRepository, $entityManager, $dir[1], $serverAddress, $path);\n }\n\n // Get all templates from the database, and push update to screens.\n $existingTemplates = $screenemplateRepository->findAll();\n $middlewareService = $this->container->get('os2display.middleware.communication');\n foreach ($existingTemplates as $template) {\n foreach ($template->getScreens() as $screen) {\n $middlewareService->pushScreenUpdate($screen);\n }\n }\n }", "function tidyt_template($log = 'log--silent', $render = 'render-templates', $args = array() ){\n\n tidyt_set_global_settings($args);\n\n tidyt_configured();\n\n if( is_404() )\n $templates = array('404.php');\n elseif( is_search() )\n $templates = tidyt_get_simple_feed_templates('search');\n elseif( is_front_page() )\n $templates = tidyt_get_simple_feed_templates('front-page');\n elseif( is_home() )\n $templates = tidyt_get_simple_feed_templates('home');\n elseif( is_post_type_archive() )\n $templates = tidyt_get_post_type_archive_template_functions();\n elseif( is_tax() )\n $templates = tidyt_get_complex_feed_templates('taxonomy');\n elseif( is_attachment() )\n $templates = tidyt_get_attachement_template_functions();\n elseif( is_single() )\n $templates = tidyt_get_single_template_functions();\n elseif( is_page() )\n $templates = tidyt_get_page_template_functions();\n elseif( is_category() )\n $templates = tidyt_get_complex_feed_templates('category');\n elseif( is_tag() )\n $templates = tidyt_get_complex_feed_templates('tag');\n elseif( is_author() )\n $templates = tidyt_get_author_template_functions();\n elseif( is_date() )\n $templates = tidyt_get_simple_feed_templates('date');\n elseif( is_archive() )\n $templates = tidyt_get_archive_template_functions();\n elseif( is_comments_popup() )\n $templates = array('comments-popup');\n\n $templates[] = 'index.php';\n\n tidyt_log_template_hierarchy($log, $templates);\n if( $render !== 'dont-render-templates')\n tidyt_get_template($templates);\n\n}", "function load_templates( $template ) {\n\n if ( is_singular( 'units' ) ) {\n \tif ( $overridden_template = locate_template( 'single-units.php' ) ) {\n\t\t\t $template = $overridden_template;\n\t\t\t } else {\n\t\t\t $template = plugin_dir_path( __file__ ) . 'templates/single-units.php';\n\t\t\t }\n } elseif ( is_archive( 'units' ) ) {\n \tif ( $overridden_template = locate_template( 'archive-units.php' ) ) {\n\t\t\t $template = $overridden_template;\n\t\t\t } else {\n\t\t\t $template = plugin_dir_path( __file__ ) . 'templates/archive-units.php';\n\t\t\t }\n }\n load_template( $template );\n\t}", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "private function _Parsing($template)\n {\n // ДИРЕКТИВЫ\n // Literal\n preg_match_all(\"~{literal}(.+?){/literal}~si\", $template, $match);\n foreach ($match[0] as $key => $val)\n {\n $template = str_replace($val, \"<LITERAL{$key}LITERAL>\", $template);\n }\n\n // подключение шаблонов директивой инклуде {инклуде \"дирнаме/филенаме\"}\n $template = preg_replace_callback(self::PATTERN_INCLUDE, [$this, '_Parsing_Include'], $template);\n // парсинг языковых конструкций\n $template = preg_replace_callback(self::PATTERN_TRANSLATION1, [$this, '_Parsing_Translation1'], $template);\n $template = preg_replace_callback(self::PATTERN_TRANSLATION2, [$this, '_Parsing_Translation2'], $template);\n // парсинг плагинов\n $template = preg_replace_callback(self::PATTERN_PLUGIN, [$this, '_Parsing_Controller'], $template);\n //\n\n // Вырезаем служебные комментарии\n $template = preg_replace('~{#(.*?)#}~s', '', $template);\n\n //\tциклы и логика\n $template = preg_replace('~{((foreach|for|while|if|switch|case|default) .+?)}~si', '<' . '?php $1 { ?' . '>', $template);\n $template = preg_replace('~{(/|/foreach|/for|/while|/if|/switch|/case|/default)}~si', '<' . '?php } ?' . '>', $template);\n $template = preg_replace('~{else if (.+?)}~si', '<' . '?php } else if $1 { ?' . '>', $template);\n $template = preg_replace('~{else}~si', '<' . '?php } else { ?' . '>', $template);\n $template = preg_replace('~{(break|continue)}~si', '<' . '?php $1; ?' . '>', $template);\n //\tпеременные установка\n $template = preg_replace('~{set ([^}]{1,255})}~si', '<' . '?php $1; ?' . '>', $template);\n\n //\tпеременные вывод\n $template = preg_replace('~{(\\$[^}]{1,255})}~si', '<' . '?php echo $1; ?' . '>', $template);\n //\tфункции и константы\n $template = preg_replace('~{([a-z]{1}[^}]{0,150})}~si', '<' . '?php echo $1; ?' . '>', $template);\n\n // Literal\n foreach ($match[1] as $key => $val)\n {\n $template = str_replace(\"<LITERAL{$key}LITERAL>\", trim($val), $template);\n }\n\n // ////\tпеременные вывод\n // $template = preg_replace('~([^{]?){(\\$[^}]{1,255})}([^}]?)~si', '$1<' . '?php echo $2; ?' . '>$3', $template);\n // ////\tфункции и константы\n // $template = preg_replace('~([^{]?){([a-z]{1}[^}]{0,150})}([^}]?)~si', '$1<' . '?php echo $2; ?' . '>$3', $template);\n\n //\n return $template;\n }", "public function onTwigTemplatePaths(): void\n {\n $this->grav['twig']->twig_paths[] = __DIR__ . \"/templates\";\n }", "public function onGetPageTemplates(Event $event)\n {\n $event->types->scanTemplates(__DIR__.\"/templates\");\n }", "public function templates($addon_directory);", "public function template()\n {\n\n include './views/template.php';\n\n }", "public function run()\n\t{\n\t\techo vsprintf($this->template,$this->_contents);\n\t}", "public function makeTemplate($input) {\n\t\t$info = array(\n\t\t\t'{generator_name}' => $input['generator_name'],\n\t\t\t'{module_name_l}' => $this->clean($input['generator_name']),\n\t\t\t'{description}' => $input['description'],\n\t\t\t'{author}' => $input['author'],\n\t\t\t'{website}' => $input['website'],\n\t\t\t'{package}' => $input['package'],\n\t\t\t'{subpackage}' => $input['subpackage'],\n\t\t\t'{copyright}' => $input['copyright'],\n\t\t\t'{frontend}' => $input['frontend'],\n\t\t\t'{backend}' => $input['backend'],\n\t\t\t);\n\t\t$info['{validation_fields}'] = $this->makeValidation($input['fields']);\n\t\t$info['{details_fields}'] = $this->makeDetails($input['fields']);\n\t\t$info['{model_fields}'] = $this->makeModel($input['fields']);\n\t\t$info['{adminform_fields}'] = $this->makeAdminForms($input['fields']);\n\t\t// array of files to replace\n\t\t$filearray = array(\n\t\t\t'config/routes.php',\n\t\t\t'controllers/admin.php',\n\t\t\t'details.php',\n\t\t\t'events.php',\n\t\t\t'language/english/sample_lang.php',\n\t\t\t'models/sample_m.php',\n\t\t\t'plugin.php',\n\t\t\t'views/admin/form.php',\n\t\t\t'views/admin/index.php'\n\t\t\t);\n\t\t// conditional front end controller stuff\n\t\tif ($input['frontend'] == 'true') {\n\t\t\t$filearray[] = 'controllers/sample.php';\n\t\t\t$filearray[] = 'views/index.php';\n\t\t}\n\t\t$url = __DIR__ . '/../public/generated/';\n\t\t$this->cpdir(__DIR__ . '/../generator/module_full', __DIR__ . '/../public/generated/'.$info['{module_name_l}']);\n\t\t// where is the module generated\n\t\t$moduleurl = $url.$info['{module_name_l}'];\n\t\tfor ($i = 0; $i < count($filearray); $i++) {\n\t\t\t$filedestination = $moduleurl.'/'.$filearray[$i];\n\t\t\t// load the template = module_full/targetfile\n\t\t\t$current = file_get_contents($filedestination);\n\t\t\t// replace the template tags\n\t\t\t$current = $this->str_replace_assoc($info, $current);\n\t\t\t// put the contents in the new file\n\t\t\tfile_put_contents($filedestination, $current);\n\t\t}\n\t\t// rename the specific files that are name sensitive\n\t\trename($moduleurl.'/language/english/sample_lang.php', $moduleurl.'/language/english/'.$info['{module_name_l}'].'_lang.php');\n\t\trename($moduleurl.'/models/sample_m.php', $moduleurl.'/models/'.$info['{module_name_l}'].'_m.php');\n\t\tif ($input['frontend'] == 'true') {\n\t\t\t// rename the extra front end stuff if applicable\n\t\t\trename($moduleurl.'/controllers/sample.php', $moduleurl.'/controllers/'.$info['{module_name_l}'].'.php');\n\t\t\trename($moduleurl.'/css/sample.css', $moduleurl.'/css/'.$info['{module_name_l}'].'.css');\n\t\t}\n\t\t// comment out to disable zip compression\n\t\t$this->Zip($url.$info['{module_name_l}'], $url.$info['{module_name_l}'].'.zip');\n\t\treturn $info['{module_name_l}'].'.zip';\n\t}", "function CI_Template() {\n $this->_ci_ob_level = ob_get_level();\n\t\t\n // Copy an instance of CI so we can use the entire framework.\n $this->CI = & get_instance();\n\n // Load the template config file and setup our master template and regions\n include(APPPATH . 'config/template' . EXT);\n if (isset($template)) {\n $this->config = $template;\n $this->set_template($template['active_template']);\n }\n }", "public function load_template_callback() {\n\n // Make sure a template was submitted\n if ( ! isset($_POST['template']) ) {\n return;\n }\n // grabe the template being rendered\n $template = $_POST['template'];\n\n // Activate builder callbacks for the shortcodes\n $this->activate_builder_callbacks();\n\n // Remove inactive shortcodes\n $template = cv_strip_inactive_plugin_shortcodes( $template );\n\n // Display the rendered shortcodes\n echo do_shortcode( stripslashes( $template ) );\n\n die();\n\n }", "function templates_example()\n{\n /* Get post object by its template */\n $post = \\ActiTemplate\\Template::getTemplatePageObject('page-contact.php');\n\n /* Get post ID by its template */\n $postID = \\ActiTemplate\\Template::getTemplatePageId('page-contact.php');\n\n /* Get post url by its template */\n $url = \\ActiTemplate\\Template::getTemplatePageUrl('page-contact.php');\n}", "public function deleteCompiledTemplates() {\n\t\t// templates\n\t\t$filenames = glob(WCF_DIR.'templates/compiled/*_'.$this->languageID.'_*.php');\n\t\tif ($filenames) foreach ($filenames as $filename) @unlink($filename);\n\t\t\n\t\t// acp templates\n\t\t$filenames = glob(WCF_DIR.'acp/templates/compiled/*_'.$this->languageID.'_*.php');\n\t\tif ($filenames) foreach ($filenames as $filename) @unlink($filename);\n\t}", "public function onAfterTwigTemplatesPaths()\n {\n if (!$this->active) {\n return;\n }\n\n Registry::get('Twig')->twig_paths[] = __DIR__ . '/templates';\n }", "function Template()\r\n\t{\t\t\r\n\t\tglobal $_REQUEST;\t\t\r\n\t\t$theme = $this->theme;\r\n\t\t/*** Get Template By Page Id ***/\r\n\t\t$file = $this->get_template();\r\n\t\t\r\n\t\tif($_SETTINGS['debug'] == 1){\r\n\t\t\techo \"TEMPLATE: \".$file.\" <Br>\";\r\n\t\t}\r\n\t\t\r\n\t\t$websitepath = $this->website_path;\r\n\t\t//die(\"FILE: $file\");\r\n\t\t//exit();\r\n\t\tinclude''.$_SERVER['DOCUMENT_ROOT'].$websitepath.'themes/'.$theme.''.$file.'';\r\n\t}", "function install_templates()\n\t{\n\t\t//-----------------------------------------\n\t\t// Get DB\n\t\t//-----------------------------------------\n\t\t\n\t\trequire_once( INS_KERNEL_PATH . 'class_db_' . $this->install->saved_data['sql_driver'] . '.php' );\t\t\n\t\t\n\t\t$this->install->ipsclass->init_db_connection( $this->install->saved_data['db_name'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['db_user'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['db_pass'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['db_host'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['db_pre'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->ipsclass->vars['mysql_codepage'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t $this->install->saved_data['sql_driver'] );\n\t\t//-----------------------------------------\n\t\t// Install settings\n\t\t//-----------------------------------------\n\t\n\t\t$output[] = \"Добавление шаблонов стилей...\";\n\t\t$xml = new class_xml();\n\t\t$xml->lite_parser = 1;\n\t\t\n\t\t$content = implode( \"\", file( INS_DOC_ROOT_PATH . 'resources/ipb_templates.xml' ) );\n\t\t$xml->xml_parse_document( $content );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Install\n\t\t//-----------------------------------------\n\t\t\n\t\tforeach( $xml->xml_array['templateexport']['templategroup']['template'] as $id => $entry )\n\t\t{\n\t\t\t$newrow = array();\n\n\t\t\t$newrow['group_name'] = $entry[ 'group_name' ]['VALUE'];\n\t\t\t$newrow['section_content'] = $entry[ 'section_content' ]['VALUE'];\n\t\t\t$newrow['func_name'] = $entry[ 'func_name' ]['VALUE'];\n\t\t\t$newrow['func_data'] = $entry[ 'func_data' ]['VALUE'];\n\t\t\t$newrow['set_id'] = 1;\n\t\t\t$newrow['updated'] = time();\n\n\t\t\t$this->install->ipsclass->DB->allow_sub_select = 1;\n\t\t\t$this->install->ipsclass->DB->do_insert( 'skin_templates', $newrow );\n\t\t}\n\n\t\t//-------------------------------\n\t\t// GET MACROS\n\t\t//-------------------------------\n\n\t\t$content = implode( \"\", file( INS_DOC_ROOT_PATH . 'resources/macro.xml' ) );\n\t\t$xml->xml_parse_document( $content );\n\n\t\t//-------------------------------\n\t\t// (MACRO)\n\t\t//-------------------------------\n\n\t\tforeach( $xml->xml_array['macroexport']['macrogroup']['macro'] as $id => $entry )\n\t\t{\n\t\t\t$newrow = array();\n\n\t\t\t$newrow['macro_value'] = $entry[ 'macro_value' ]['VALUE'];\n\t\t\t$newrow['macro_replace'] = $entry[ 'macro_replace' ]['VALUE'];\n\t\t\t$newrow['macro_set'] = 1;\n\n\t\t\t$this->install->ipsclass->DB->do_insert( 'skin_macro', $newrow );\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Next...\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->install->template->append( $this->install->template->install_page_refresh( $output ) );\t\n\t\t$this->install->template->next_action = '?p=install&sub=other';\n\t\t$this->install->template->hide_next = 1;\n\t}", "protected function getCurrentParsedTemplate() {}", "protected function _content_template()\n {\n\n }", "public function afterTemplate(){\n\t\t//defaults to empty\n\t}", "protected function initDocumentTemplate() {}", "protected function initDocumentTemplate() {}", "protected function initDocumentTemplate() {}", "protected function initDocumentTemplate() {}", "protected function initTemplate()\n {\n /** @var WorldState $state */\n /** @var ExecHelper $exec */\n $tplPhp = <<<EOS\nWorld. From: <?=\\$state->name?>\n\nExec URL: <?=\\$exec->url( 'someExec', ['a'=>1] )?><?php \\$formBody = \"<input type=\\\"text\\\" name=\\\"someInput\\\" value=\\\"2\\\">\\n\"?>\n\nExec Form:\n<?=\\$exec->wrapForm( 'otherExec', 'POST', \\$formBody ) ?>\nEOS;\n $this->template = new PhpTemplate( $this, null, $tplPhp );\n }", "private function getStatusTemplates() {\n $jsonStatusTemplates = file_get_contents (self::STATUS_TEMPLATES_FILE);\n $this->statusTemplates = json_decode($jsonStatusTemplates, true);\n }" ]
[ "0.67140913", "0.6643134", "0.6282609", "0.62770075", "0.6191048", "0.61902136", "0.61869293", "0.6069673", "0.60592026", "0.60496217", "0.6018417", "0.59873974", "0.5980406", "0.5964622", "0.59553194", "0.5935066", "0.59305775", "0.59155434", "0.589993", "0.5893001", "0.5892757", "0.5884236", "0.58837956", "0.5881557", "0.5875419", "0.5857141", "0.58436984", "0.58359694", "0.5835721", "0.5827807", "0.5810107", "0.58081067", "0.5805219", "0.57955074", "0.5783768", "0.5758174", "0.5754477", "0.57475495", "0.57475495", "0.5741224", "0.572779", "0.57265836", "0.5721779", "0.56890476", "0.5683954", "0.5679392", "0.5676885", "0.56726485", "0.56560844", "0.5655496", "0.5650852", "0.5641519", "0.5624709", "0.5621359", "0.56200314", "0.5618526", "0.5610519", "0.55984473", "0.5592361", "0.55747074", "0.5567871", "0.5560531", "0.55531377", "0.555192", "0.555192", "0.555192", "0.5540719", "0.55324274", "0.55272084", "0.5522208", "0.55117744", "0.5510322", "0.5510322", "0.5510322", "0.5510322", "0.5510322", "0.5510322", "0.5493654", "0.5478725", "0.5478443", "0.5469753", "0.5468244", "0.54675156", "0.5465491", "0.5465356", "0.5459436", "0.54569036", "0.54546005", "0.54537255", "0.5452232", "0.544999", "0.5449193", "0.54404956", "0.5439927", "0.5438699", "0.5438699", "0.5438699", "0.5438699", "0.54277885", "0.54199964" ]
0.6640878
2
Setup attribute on tests.
public function setConfig($config) { self::$config = $config; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setUp()\n {\n $this->fixture = new Parameter();\n }", "public function testSetUserAttributes()\n {\n }", "protected function setUp()\n {\n $this->object = new TestAutoGetSetProps;\n }", "public static function setupBeforeClass()\n {\n FactoryMuffin::setCustomSetter(function ($object, $name, $value) {\n $functionName = camel_case(\"set-\".$name);\n if (method_exists($object, $functionName) && is_callable([$object, $functionName]))\n call_user_func([$object, $functionName], $value);\n else {\n dd(get_class($object).' dont have '.camel_case(\"set-\".$name));\n }\n });\n }", "public function setUp()\n {\n // Start of user code AttributeMappingTest.setUp\n // Place additional setUp code here. \n // End of user code\n }", "public function beforeSetup()\n {\n }", "public function setUp()\n {\n $this->queue = new Attribute\\Queue;\n\n $this->attribute = $this->getMockBuilder( 'Reform\\Attribute\\Attribute' )\n ->setConstructorArgs( array( 'attribute_name', 'attribute_value' ) )\n ->getMock();\n }", "protected function setUp(): void\n {\n parent::setUp();\n\n $this->value = random_int(1, 100000);\n\n $randomValue = md5((string)$this->value);\n\n $this->value1 = $randomValue . '_1';\n $this->value2 = $randomValue . '_2';\n $this->value3 = $randomValue . '_3';\n }", "protected function setUp(): void {\n $this->parser = new PropertyParser();\n }", "protected function setUp()\n {\n $this->getData();\n $this->getDefaultValue();\n\n parent::setUp(); // TODO: Change the autogenerated stub\n }", "protected function setUp()\n {\n $this->_instance = Tinebase_CustomField::getInstance();\n }", "protected function doSetup(): void\n {\n }", "public function testSetAttribs()\n {\n $this->todo('stub');\n }", "public function setUp()\n {\n // create attribute\n $this->attribute = new Attribute();\n // create listener\n $this->listener = new TimestampableListener();\n // prepare test entity manager\n $reader = new AnnotationReader();\n $metadataDriver = new AnnotationDriver($reader, 'Oro\\\\Bundle\\\\FlexibleEntityBundle\\\\Entity');\n $this->em = $this->_getTestEntityManager();\n $this->em->getConfiguration()->setMetadataDriverImpl($metadataDriver);\n }", "protected function setUp()\n {\n parent::setUp();\n $this->testData = ['test' => 'test'];\n }", "public function setUp()\n {\n $this->amount = 500;\n $this->currency = 'RUB';\n $this->sector = 222;\n $this->password = 'qwprc1';\n $this->id = 400;\n\n parent::setUp();\n }", "protected function setUp(): void\n {\n // O parametro 'true' é passado para o constructor da classe Validator para informar que é o PHPUnit que esta sendo executado\n // Isso serve para que a funcion que valida blacklist não faça uma requisição á API, pois o PHPUnit não permite requisições externas\n $this->_validator = new Validator(true);\n $this->_data_send = new DataSend();\n }", "public function testSetAllUserAttributes()\n {\n }", "protected function setUp(): void\n {\n parent::setUp();\n\n $this->entity = factory(Entity::class)->create();\n $set = factory(AttributeSet::class)->create([\n \t'entity_id' => $this->entity->entity_id,\n ]);\n\n $this->entity->default_attribute_set_id = $set->attribute_set_id; \n $this->entity->save();\n }", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}" ]
[ "0.6884488", "0.68294555", "0.68076324", "0.67805773", "0.6707763", "0.667545", "0.66724706", "0.666372", "0.66612095", "0.66430086", "0.6638216", "0.66317177", "0.6627203", "0.6624735", "0.66147184", "0.6610817", "0.66069573", "0.6606914", "0.6605656", "0.65232587", "0.65232587", "0.65232587", "0.65232587", "0.65232587", "0.65232587", "0.65232587", "0.65232587", "0.65232587", "0.65232587", "0.65232587", "0.65232587", "0.65232587", "0.65232587", "0.6523228", "0.6523228", "0.6523228", "0.6523228", "0.6523228", "0.6523228", "0.6523228", "0.6523228", "0.6523228", "0.6523228", "0.6523228", "0.6523228", "0.6523228", "0.6523228", "0.6523228", "0.65230393", "0.65230393", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567" ]
0.0
-1
Setup attribute on tests.
public function setIo(\Composer\IO\IOInterface $io) { $this->io = $io; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function setUp()\n {\n $this->fixture = new Parameter();\n }", "public function testSetUserAttributes()\n {\n }", "protected function setUp()\n {\n $this->object = new TestAutoGetSetProps;\n }", "public static function setupBeforeClass()\n {\n FactoryMuffin::setCustomSetter(function ($object, $name, $value) {\n $functionName = camel_case(\"set-\".$name);\n if (method_exists($object, $functionName) && is_callable([$object, $functionName]))\n call_user_func([$object, $functionName], $value);\n else {\n dd(get_class($object).' dont have '.camel_case(\"set-\".$name));\n }\n });\n }", "public function setUp()\n {\n // Start of user code AttributeMappingTest.setUp\n // Place additional setUp code here. \n // End of user code\n }", "public function beforeSetup()\n {\n }", "public function setUp()\n {\n $this->queue = new Attribute\\Queue;\n\n $this->attribute = $this->getMockBuilder( 'Reform\\Attribute\\Attribute' )\n ->setConstructorArgs( array( 'attribute_name', 'attribute_value' ) )\n ->getMock();\n }", "protected function setUp(): void\n {\n parent::setUp();\n\n $this->value = random_int(1, 100000);\n\n $randomValue = md5((string)$this->value);\n\n $this->value1 = $randomValue . '_1';\n $this->value2 = $randomValue . '_2';\n $this->value3 = $randomValue . '_3';\n }", "protected function setUp(): void {\n $this->parser = new PropertyParser();\n }", "protected function setUp()\n {\n $this->getData();\n $this->getDefaultValue();\n\n parent::setUp(); // TODO: Change the autogenerated stub\n }", "protected function setUp()\n {\n $this->_instance = Tinebase_CustomField::getInstance();\n }", "protected function doSetup(): void\n {\n }", "public function testSetAttribs()\n {\n $this->todo('stub');\n }", "public function setUp()\n {\n // create attribute\n $this->attribute = new Attribute();\n // create listener\n $this->listener = new TimestampableListener();\n // prepare test entity manager\n $reader = new AnnotationReader();\n $metadataDriver = new AnnotationDriver($reader, 'Oro\\\\Bundle\\\\FlexibleEntityBundle\\\\Entity');\n $this->em = $this->_getTestEntityManager();\n $this->em->getConfiguration()->setMetadataDriverImpl($metadataDriver);\n }", "protected function setUp()\n {\n parent::setUp();\n $this->testData = ['test' => 'test'];\n }", "public function setUp()\n {\n $this->amount = 500;\n $this->currency = 'RUB';\n $this->sector = 222;\n $this->password = 'qwprc1';\n $this->id = 400;\n\n parent::setUp();\n }", "protected function setUp(): void\n {\n // O parametro 'true' é passado para o constructor da classe Validator para informar que é o PHPUnit que esta sendo executado\n // Isso serve para que a funcion que valida blacklist não faça uma requisição á API, pois o PHPUnit não permite requisições externas\n $this->_validator = new Validator(true);\n $this->_data_send = new DataSend();\n }", "public function testSetAllUserAttributes()\n {\n }", "protected function setUp(): void\n {\n parent::setUp();\n\n $this->entity = factory(Entity::class)->create();\n $set = factory(AttributeSet::class)->create([\n \t'entity_id' => $this->entity->entity_id,\n ]);\n\n $this->entity->default_attribute_set_id = $set->attribute_set_id; \n $this->entity->save();\n }", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}", "protected function setUp() {}" ]
[ "0.6884488", "0.68294555", "0.68076324", "0.67805773", "0.6707763", "0.667545", "0.66724706", "0.666372", "0.66612095", "0.66430086", "0.6638216", "0.66317177", "0.6627203", "0.6624735", "0.66147184", "0.6610817", "0.66069573", "0.6606914", "0.6605656", "0.65232587", "0.65232587", "0.65232587", "0.65232587", "0.65232587", "0.65232587", "0.65232587", "0.65232587", "0.65232587", "0.65232587", "0.65232587", "0.65232587", "0.65232587", "0.65232587", "0.6523228", "0.6523228", "0.6523228", "0.6523228", "0.6523228", "0.6523228", "0.6523228", "0.6523228", "0.6523228", "0.6523228", "0.6523228", "0.6523228", "0.6523228", "0.6523228", "0.6523228", "0.65230393", "0.65230393", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567", "0.6522567" ]
0.0
-1
/ sets the broker details
public function broker($address, $port, $clientid, $cafile = NULL){ $this->address = $address; $this->port = $port; $this->clientid = $clientid; $this->cafile = $cafile; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function setBroker($broker)\n {\n $this->helperBroker = $broker;\n }", "public static function setAdapterBroker(Broker $broker) \n {\n self::$_adapterBroker = $broker;\n }", "public function addBroker($broker);", "public function __invoke(Broker $broker);", "public function getBroker()\n\t{\n\t\treturn $this->broker;\n\t}", "public function getBroker()\n\t{\n\t\treturn $this->broker;\n\t}", "public function broker()\n {\n \treturn Password::broker('users');\n }", "public function broker()\n {\n return Password::broker('affiliates');\n }", "public function broker()\n {\n return Password::broker('organizers');\n }", "public function broker()\n {\n return Password::broker('admins');\n }", "public function broker()\n\t{\n\t\treturn Password::broker('admins');\n\t}", "public function broker()\n {\n return Password::broker();\n }", "public function broker() {\n return Lyra::broker();\n }", "public function broker()\n {\n return Password::broker('users');\n }", "public function address($broker) {\n\t\t$data = sprintf(self::BROKER_PATH, (int) $broker);\n\t\t$result = $this->zookeeper->get($data);\n\n\t\tif (empty($result)) {\n\t\t\t$result = null;\n\t\t} else {\n\t\t\t$parts = explode(\":\", $result);\n\t\t\t$result = $parts[1] . ':' . $parts[2];\n\t\t}\n\n\t\treturn $result;\n\t}", "private function configure()\n {\n\n $QryStr = \"SELECT SENDER, PORT,HOST, USER_ID,PASSWRD, EMAIL FROM SYSSETTINGS\";\n try {\n $stmt = $this->dbh->dbConn->prepare($QryStr);\n $stmt->execute();\n\n $result = $stmt->fetch(\\PDO::FETCH_OBJ);\n\n $this->sender = $result->sender;\n $this->port = $result->port;\n $this->host = $result->host;\n $this->user_id = $result->user_id;\n $this->password = $result->password;\n $this->sender_mail = $result->email;\n } catch (\\PDOException $ex) {\n $ex->getMessage();\n }\n }", "public function brokerSetupInvoice()\r\n {\r\n $em = $this->entityManager;\r\n $invoiceEntity = $this->invoiceEntity;\r\n $invoiceEntity->setUserId($this->userId);\r\n $invoiceEntity->setGeneratedOn(new \\DateTime());\r\n $invoiceEntity->setAmount($this->amount);\r\n $invoiceEntity->setStatus($em->find('Transactions\\Entity\\InvoiceStatus', UNPAID)); // Paid and Unpaid // set it as unpaid\r\n $invoiceEntity->setInvoiceCategory($em->find('Transactions\\Entity\\InvoiceCategory', 2)); // This is Broker SetUp Invoice\r\n $invoiceEntity->setCurrency($em->find('Settings\\Entity\\Currency', 1)); // tis is set to Naira\r\n try {} catch (\\Exception $e) {\r\n echo 'Invoice generation error';\r\n }\r\n }", "protected function setup() : void\n {\n $this->subject = new Product(\n 'ACCESS_KEY',\n 'SECRET_KEY',\n 1\n );\n }", "public function brokerByID($key = null)\n {\n return self::getConfig($key, null, true);\n }", "private function _setPrimaryValue() {\n try {\n $this->SNS_KEY = 'AKIAIHQJKWDU4LQVV7NA';\n $this->SNS_SECRET = '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';\n $this->SNS_REGION = 'us-east-1';\n\n /*\n * SET ARN VALUES\n * STEP 1.1\n */\n $this->_setARN();\n } catch (Exception $ex) {\n throw new Exception('Error in _setPrimaryValue function - ' . $ex);\n }\n }", "private function __construct() {\n\t\t$this->_applicationName = 'Billing';\n\t\t$this->_backend = new Billing_Backend_SupplyReceipt();\n\t\t$this->_modelName = 'Billing_Model_SupplyReceipt';\n\t\t$this->_currentAccount = Tinebase_Core::getUser();\n\t\t$this->_purgeRecords = FALSE;\n\t\t$this->_doContainerACLChecks = FALSE;\n\t\t$this->_config = isset(Tinebase_Core::getConfig()->billing) ? Tinebase_Core::getConfig()->billing : new Zend_Config(array());\n\t}", "protected function setUp() {\n $this->object = new CrowdFlower_Judgment_Proxy($this->key);\n $this->data[0] = 'mob';\n $job = CrowdFlower::factory('job', $this->key);\n //set the channel to mob\n $resp = $job->channels($this->jobID, $this->data);\n //print_r($resp);\n }", "protected function setup()\r\n {\r\n if (!defined('APNS_SSL_CERTIFICATE_FILE_PATH')\r\n || !file_exists(APNS_SSL_CERTIFICATE_FILE_PATH)\r\n ) {\r\n $this->markTestSuiteSkipped('Credentials missing in config.php');\r\n }\r\n \r\n $this->clientHandler = new Services_Apns_Client_Feedback();\r\n $this->clientHandler->setSslCertificateFilePath(APNS_SSL_CERTIFICATE_FILE_PATH);\r\n \r\n if (defined('APNS_CERTIFICATE_PASSWORD_PHRASE')) {\r\n $this->clientHandler->setPasswordPhrase(APNS_CERTIFICATE_PASSWORD_PHRASE);\r\n }\r\n \r\n if (defined('APNS_ENV')) {\r\n $this->clientHandler->setDefaultEnvironment(APNS_ENV);\r\n }\r\n }", "private function setMerchantD()\n {\n $this->mid = config('gladepay.mid');\n }", "private function setConnection(){\n\n\n\t\t\t$this->apiKey = Settings::get( 'apiKey' );\n\n\t\t\tif( $this->apiKey ){\n\n\t\t\t\t$this->gateway = new MailChimp( $this->apiKey );\n\n\t\t\t}else{\n\n\t\t\t\t//log an error\n\n\t\t\t}\n\n\t\t}", "public function setTopic($topic)\n {\n $this->_topic = $topic;\n }", "public function __construct()\n {\n $this->smsSettings = sms_setting();\n Config::set('twilio-notification-channel.auth_token', $this->smsSettings->auth_token);\n Config::set('twilio-notification-channel.account_sid', $this->smsSettings->account_sid);\n Config::set('twilio-notification-channel.from', $this->smsSettings->from_number);\n \n Config::set('nexmo.api_key', $this->smsSettings->nexmo_api_key);\n Config::set('nexmo.api_secret', $this->smsSettings->nexmo_api_secret);\n Config::set('services.nexmo.sms_from', $this->smsSettings->nexmo_from_number);\n\n Config::set('services.msg91.key', $this->smsSettings->msg91_auth_key);\n Config::set('services.msg91.msg91_from', $this->smsSettings->msg91_from);\n }", "protected function configure()\n {\n $this->setName('scaytrase:sms_delivery:flush');\n $this->setDescription('Flush the delivery service message spool');\n }", "public function setDatabaseConfig()\n {\n $this->_databaseConfig = Core_Model_Config_Json::getModulesDatabaseConfig();\n\n $this->_type = $this->_databaseConfig['type'];\n $this->_host = $this->_databaseConfig['host'];\n $this->_name = $this->_databaseConfig['name'];\n $this->_user = $this->_databaseConfig['user'];\n $this->_pass = $this->_databaseConfig['pass'];\n }", "function __construct() {\n\t\tparent::__construct(\n\t\t\t'broker_widget', // Base ID\n\t\t\t__( 'Broker Options', 'text_domain' ), // Name\n\t\t\tarray( 'description' => __( 'Display Broker Widget', 'text_domain' ), ) // Args\n\t\t);\n\t}", "public function setDataConnection(){\n \n \n }", "private function getPasswordBroker()\n {\n return Password::broker();\n }", "public function __construct()\n {\n $this->smsSettings = sms_setting();\n Config::set('twilio-notification-channel.auth_token', $this->smsSettings->auth_token);\n Config::set('twilio-notification-channel.account_sid', $this->smsSettings->account_sid);\n Config::set('twilio-notification-channel.from', $this->smsSettings->from_number);\n\n Config::set('nexmo.api_key', $this->smsSettings->nexmo_api_key);\n Config::set('nexmo.api_secret', $this->smsSettings->nexmo_api_secret);\n Config::set('services.nexmo.sms_from', $this->smsSettings->nexmo_from_number);\n\n Config::set('services.msg91.key', $this->smsSettings->msg91_auth_key);\n Config::set('services.msg91.msg91_from', $this->smsSettings->msg91_from);\n }", "private function setPurchaseNote() {\n $this->product->set_purchase_note($this->wcData->getPurchaseNote());\n }", "public function setup()\n {\n \t// rtConfig::set('your-key', $your_value);\n }", "private function __construct() {\r\n $this->_applicationName = 'Membership';\r\n $this->_backend = new Membership_Backend_Message();\r\n $this->_modelName = 'Membership_Model_Message';\r\n $this->_currentAccount = Tinebase_Core::getUser();\r\n $this->_purgeRecords = FALSE;\r\n $this->_doContainerACLChecks = FALSE;\r\n $this->_config = isset(Tinebase_Core::getConfig()->brevetation) ? Tinebase_Core::getConfig()->brevetation : new Zend_Config(array());\r\n }", "public function __construct()\n {\n $this->messageBirdClient = new Client(config('carro_messenger.message_bird.access_key'));\n $this->whatsAppchannelId = config('carro_messenger.message_bird.whatsapp_channel_id');\n }", "public function init()\n {\n parent::init();\n $config = \\Yii::$app->params['idBrokerConfig'];\n $this->client = new IdBrokerClient(\n $config['baseUrl'],\n $config['accessToken'],\n [\n IdBrokerClient::TRUSTED_IPS_CONFIG => $config['validIpRanges'] ?? [],\n IdBrokerClient::ASSERT_VALID_BROKER_IP_CONFIG => $config['assertValidBrokerIp'] ?? true,\n 'http_client_options' => [\n 'timeout' => 10, // An (optional) custom HTTP timeout, in seconds.\n ],\n ]\n );\n }", "public function broker(): PasswordBroker\n {\n return Password::broker('admins');\n }", "public function getBrokerFullDetails( $brokerId = null, $mcNumber = null ) {\n\t\t$brokerDetail = $this->BrokersModel->getBrokerInfo($brokerId);\n\t\tif ( !empty($brokerDetail) ) {\n\t\t\t$this->data['brokerDetail'] = $brokerDetail;\n\t\t\t\n\t\t\t$result = $this->index($mcNumber, $this->data['brokerDetail']['DOTNumber'],'sameController');\n\t\t\t$result = json_decode(json_encode($result), true);\n\t\t\t\n\t\t\tif ( !empty($result) ) {\n\t\t\t\tif ( $result['creditResultTypeId']['name'] == 'Credit Request Approved') {\n\t\t\t\t\t$brokerStatus = 'Approved';\n\t\t\t\t} else {\n\t\t\t\t\t$brokerStatus = 'Not Approved';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->data['brokerDetail']['brokerStatus'] = $brokerStatus;\n\t\t\t\t\t\n\t\t\t\t$data = array(\n\t\t\t\t\t'brokerStatus' => $brokerStatus,\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\t$this->BrokersModel->updateBrokerInfo($brokerDetail['id'],$data);\n\t\t\t}\t\n\t\t\t\t\t\n\t\t\t$result = $this->BrokersModel->fetchContractDocuments($brokerDetail['id'], 'broker');\n\t\t\tif ( !empty($result) ) {\n\t\t\t\tfor( $i = 0; $i < count($result); $i++ ) {\n\t\t\t\t\t$fileNameArray = explode('.',$result[$i]['document_name']);\n\t\t\t\t\t$fileName = '';\n\t\t\t\t\tfor ( $j = 0; $j < count($fileNameArray) - 1; $j++ ) {\n\t\t\t\t\t\t$fileName .= $fileNameArray[$j];\n\t\t\t\t\t}\n\t\t\t\t\t$fileName = 'thumb_'.$fileName.'.jpg';\n\t\t\t\t\t\n\t\t\t\t\t$this->data['brokerDocuments'][$i]['doc_name'] = $result[$i]['document_name'];\n\t\t\t\t\t$this->data['brokerDocuments'][$i]['thumb_doc_name'] = $fileName;\n\t\t\t\t\t$this->data['brokerDocuments'][$i]['id'] = $result[$i]['id'];\n\t\t\t\t\t$this->data['brokerDocuments'][$i]['BrokerId'] = $brokerDetail['id'];\n\t\t\t\t\t$this->data['brokerDocuments'][$i]['billType'] = 'broker';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\techo json_encode($this->data);\n\t}", "public function getOrigBrokerName() {}", "public function setup()\n {\n $this->config = new Config($this->emailOrMobileNumber, $this->merchantKey);\n }", "public function broker($name = null)\n {\n $name = $name ?: $this->getDefaultDriver();\n\n return isset($this->brokers[$name])\n ? $this->brokers[$name]\n : $this->brokers[$name] = $this->resolve($name);\n }", "public function setMessage($msg){ \n\t\t\t$this->message = $msg;\n\t\t}", "public function __construct($details)\n {\n $this->details = $details;\n }", "public function __construct($details)\n {\n $this->details = $details;\n }", "public function __construct($details)\n {\n $this->details = $details;\n }", "public function __construct($details)\n {\n $this->details = $details;\n }", "protected function set_up()\n {\n parent::set_up();\n\n $this->Zend_Service_Amazon_Ec2_Keypair = new Zend_Service_Amazon_Ec2_Keypair('access_key', 'secret_access_key');\n\n $adapter = new Zend_Http_Client_Adapter_Test();\n $client = new Zend_Http_Client(null, [\n 'adapter' => $adapter\n ]);\n $this->adapter = $adapter;\n Zend_Service_Amazon_Ec2_Keypair::setHttpClient($client);\n }", "private function _setObjectValue() {\n try {\n $this->SNS_OBJ = Aws\\Sns\\SnsClient::factory(array(\n 'key' => $this->SNS_KEY,\n 'secret' => $this->SNS_SECRET,\n 'region' => $this->SNS_REGION\n ));\n } catch (Exception $ex) {\n throw new Exception('Error in_setObjectValue function - ' . $ex);\n }\n }", "private function setupClient() {\n\t\t$this->client = MeetupKeyAuthClient::factory( [\n\t\t\t'key' => $this->key\n\t\t] );\n\t}", "function setSyncProdDesc()\n {\n }", "protected function storeConnectionMetadata(){\n }", "public function __construct($details)\n {\n $this->details=$details;\n }", "public function setTopic($topic);", "private function __construct() {\n $this->_applicationName = 'Billing';\n $this->_backend = new Billing_Backend_SepaMandate();\n $this->_modelName = 'Billing_Model_SepaMandate';\n $this->_currentAccount = Tinebase_Core::getUser();\n $this->_purgeRecords = FALSE;\n $this->_doContainerACLChecks = FALSE;\n $this->_config = isset(Tinebase_Core::getConfig()->billing) ? Tinebase_Core::getConfig()->billing : new Zend_Config(array());\n }", "public function __construct(){\n\t\t\t$this->con = MDBConnection::getConnection();\n\t\t}", "public function __construct($useFallbackServer = true)\n\t{\n\t\tif (JsMemcache::getInstance()->get(\"mqMemoryAlarmFIRST_SERVER\") == true || JsMemcache::getInstance()->get(\"mqDiskAlarmFIRST_SERVER\") == true || $this->serverConnection('FIRST_SERVER') == false) {\n\t\t\tif (MQ::FALLBACK_STATUS == true && $useFallbackServer == true && JsConstants::$hideUnimportantFeatureAtPeakLoad == 0) {\n\t\t\t\tif (JsMemcache::getInstance()->get(\"mqMemoryAlarmSECOND_SERVER\") == true || JsMemcache::getInstance()->get(\"mqDiskAlarmSECOND_SERVER\") == true || $this->serverConnection('SECOND_SERVER') == false) {\n\t\t\t\t\t$str = \"\\nRabbitMQ Error in producer, Connection to both rabbitmq brokers failed with host-> \" . JsConstants::$rabbitmqConfig['FIRST_SERVER']['HOST'] . \" and \" . JsConstants::$rabbitmqConfig['SECOND_SERVER']['HOST'] . \"\\tLine:\" . __LINE__;\n\t\t\t\t\tRabbitmqHelper::sendAlert($str, \"default\");\n\t\t\t\t\t$this->setRabbitMQServerConnected(0);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$str = \"\\nRabbitMQ Error in producer, Connection to first rabbitmq broker with host-> \" . JsConstants::$rabbitmqConfig['FIRST_SERVER']['HOST'] . \" failed : \\tLine:\" . __LINE__;\n\t\t\t\tRabbitmqHelper::sendAlert($str, \"default\");\n\t\t\t\t$this->setRabbitMQServerConnected(0);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t}\n\t\ttry {\n\t\t\t$this->channel = $this->connection->channel();\n\t\t\t$this->channel->setBodySizeLimit(MQ::MSGBODYLIMIT);\n\t\t} catch (Exception $exception) {\n\t\t\t$str = \"\\nRabbitMQ Error in producer, Channel not formed : \" . $exception->getMessage() . \"\\tLine:\" . __LINE__;\n\t\t\tRabbitmqHelper::sendAlert($str, \"default\");\n\t\t\treturn;\n\t\t}\n\t}", "public function setConfig()\n {\n $config = new Config;\n echo 'const signalingSrvAddr = \"'.$config->signalingServerAddress.'\"; const signalingSrvPort = \"'.$config->signalingServerPort.'\";';\n }", "private function __construct() {\n $this->_applicationName = 'Billing';\n $this->_backend = new Billing_Backend_StockFlow();\n $this->_modelName = 'Billing_Model_StockFlow';\n $this->_articleSupplyController = Billing_Controller_ArticleSupply::getInstance();\n $this->_currentAccount = Tinebase_Core::getUser();\n $this->_purgeRecords = FALSE;\n $this->_doContainerACLChecks = FALSE;\n $this->_config = isset(Tinebase_Core::getConfig()->billing) ? Tinebase_Core::getConfig()->billing : new Zend_Config(array());\n }", "public function testChannelsSetTopic()\n {\n }", "public function __construct( $details)\n {\n $this->details= $details;\n }", "protected function setClient($config)\n {\n $host = array_get($config, 'host');\n $port = array_get($config, 'port');\n $clientId = array_get($config, 'client_id', 'df-client-' . time());\n $username = array_get($config, 'username');\n $password = array_get($config, 'password');\n $useTls = array_get($config, 'use_tls');\n $capath = array_get($config, 'capath');\n if (!$useTls) {\n $capath = null;\n }\n\n $this->client = new MosquittoClient($host, $port, $clientId, $username, $password, $capath);\n }", "public function brokerAll()\n {\n return self::getConfig(null, null, true);\n }", "private function __construct() {\n\t\t$this->_applicationName = 'Billing';\n\t\t$this->_receiptController = Billing_Controller_Receipt::getInstance();\n\t\t$this->_supplyReceiptController = Billing_Controller_SupplyReceipt::getInstance();\n\t\t$this->_currentAccount = Tinebase_Core::getUser();\n\t\t$this->_doContainerACLChecks = FALSE;\n\t\t$this->setOutputType();\n\t}", "protected function assignConnectionParams( $params )\r\n\t{\r\n\t\tparent::assignConnectionParams( $params );\r\n\t\t\r\n\t\t$this->host = $params[\"connInfo\"][0]; //strConnectInfo1\t\t\r\n\t\t$this->port = $params[\"connInfo\"][1]; //strConnectInfo2\r\n\t\t$this->user = $params[\"connInfo\"][2]; //strConnectInfo3\r\n\t\t$this->pwd = $params[\"connInfo\"][3]; //strConnectInfo4\r\n\t\t$this->dbname = $params[\"connInfo\"][4]; //strConnectInfo5\r\n\t}", "private function setBotProvider(): void\n {\n $this->providers[Bot::class] = new MessengerProviderDTO(Bot::class);\n }", "public function setup() {\n echo \"\\n\\nDeclaring Exchanges\\n\";\n foreach ($this->config['exchanges'] as $name => $config) {\n $exchange = $this->getExchange($name);\n $response = null;\n if (!$exchange->getManaged()) {\n echo \"Skipped : \";\n } else {\n $exchange->declareExchange();\n echo \"Declared: \";\n }\n echo $exchange->getName() . \"\\n\" ;\n }\n\n echo \"\\n\\nDeclaring Queues\\n\";\n foreach ($this->config['queues'] as $name => $config) {\n $queue = $this->getQueue($name);\n $response = null;\n if (!$queue->getManaged()) {\n echo \"Skipped : \";\n } else {\n $queue->declareQueue();\n echo \"Declared: \";\n }\n echo $queue->getName() . \"\\n\" ;\n }\n }", "protected function assignConnectionParams( $params )\r\n\t{\r\n\t\tparent::assignConnectionParams( $params );\r\n\t\t\r\n\t\t$this->host = $params[\"connInfo\"][0]; //strConnectInfo1\r\n\t\t$this->user = $params[\"connInfo\"][1]; //strConnectInfo2\r\n\t\t$this->pwd = $params[\"connInfo\"][2]; //strConnectInfo3\r\n\t\t$this->dbname = $params[\"connInfo\"][3]; //strConnectInfo4\r\n\t}", "public function init_config_data($host_obj)\n\t\t{\n\t\t\t$host_obj->order_status = Shop_OrderStatus::get_status_paid()->id;\n\t\t\t$host_obj->port = 5000;\n\t\t}", "public function setup() {\n if ( ! defined( 'MAILCHIMP_API_KEY' ) ) {\n wp_die( 'MailChimp API key is missing. See <a href=\"https://us2.admin.mailchimp.com/account/api/\">https://us2.admin.mailchimp.com/account/api/</a>' );\n }\n if ( ! defined( 'MAILCHIMP_API_ENDPOINT' ) ) {\n define( 'MAILCHIMP_API_ENDPOINT', 'https://' . $this->get_datacenter() . '.api.mailchimp.com/3.0' );\n }\n\n $this->sender_info = [\n 'company' => PEDESTAL_BLOG_NAME,\n 'address1' => PEDESTAL_STREET_ADDRESS,\n 'address2' => '',\n 'city' => PEDESTAL_CITY_NAME,\n 'state' => PEDESTAL_STATE,\n 'zip' => PEDESTAL_ZIPCODE,\n 'country' => 'US',\n 'phone' => '',\n ];\n }", "public function __construct()\n\t{\n\t\t$this->setting = array_merge($this->setting, config('setting_epay', 'sms'));\n\t}", "protected function configure()\n {\n $this\n ->setDescription('Bounce mail handling MDA for fetchmail')\n ->addArgument(\n 'rawmailsource',\n InputArgument::OPTIONAL,\n 'Raw mail source'\n );\n }", "public function brokerage()\n {\n return $this->belongsTo(Brokerage::class);\n }", "public function brokerage()\n {\n return $this->belongsTo(Brokerage::class);\n }", "public function setup() {\r\n touchConfig([\r\n 'notifyOnNewDiscussion.Sender' => c('Garden.Email.SupportAddress'),\r\n 'notifyOnNewDiscussion.Recipient' => c('Garden.Email.SupportAddress')\r\n ]);\r\n $this->structure();\r\n }", "public function BrokerDetails($user_id=\"\"){\n\t\t\t$broker_det = $this->db->prepare(\"SELECT * FROM broker WHERE status = :status AND user_id =:user_id \");\n\t\t\t$broker_det->execute(array(\"status\"=>1,\"user_id\"=>$user_id));\n\t\t\t$row = $broker_det->fetch(PDO::FETCH_ASSOC);\n\t\t\treturn $row; \n\t\t}", "public static function setConnection() {\n\n\t\t$connectionName\t= \"\";\n\t\t$settingName\t= \"\";\n\t\t$settingValue\t= \"\";\n\n\t\tif( func_num_args() < 2 || func_num_args() > 3 ) {\n\t\t\tthrow new Exception( \"Kwerry::setConnection() requires the following arguments: \".\n\t\t\t\t\"connectionName [\\\"default\\\"], settingName, settingValue.\" );\n\t\t}\n\n\t\tif( func_num_args() == 2 ) {\n\t\t\t$connectionName\t= \"default\";\n\t\t\t$settingName\t= func_get_arg( 0 );\n\t\t\t$settingValue\t= func_get_arg( 1 );\n\t\t} else {\n\t\t\t$connectionName\t= func_get_arg( 0 );\n\t\t\t$settingName\t= func_get_arg( 1 );\n\t\t\t$settingValue\t= func_get_arg( 2 );\n\t\t}\n\n\t\tif( ! array_key_exists( $connectionName, Kwerry::$_connectionDetails ) ) {\n\t\t\tKwerry::$_connectionDetails[ $connectionName ] = new stdClass();\n\t\t}\n\n\t\tKwerry::$_connectionDetails[ $connectionName ]->$settingName = $settingValue;\n\t}", "protected function setSubject() {}", "public function autoSet()\n {\n $this->setInfo();\n $this->setParams();\n $this->extractRoutingInfo();\n }", "function set_object_credentials($credentials) {\n\t\t$this->host = \t$credentials['host'];\n\t\t$this->port = \t$credentials['port'];\n\t\t$this->dbName = $credentials['dbname'];\n\t\t$this->user = \t$credentials['user'];\n\t\t$this->passwd = $credentials['password'];\n\t}", "function setCommonInfo()\n\t{\n\t\t$this->configobj = new configclass();\t\t\n\t\t\n\t}", "private function zkConnect()\n {\n if ($this->zk == null) {\n $this->zk = new \\Zookeeper($this->zkConnect);\n $this->brokerMetadata = null;\n }\n }", "abstract protected function setTransport($config);", "public function __construct () {\n // Merchant ID\n $this->_mid = \"\";\n\n // User ID\n $this->_userID = \"\";\n\n // Password\n $this->_password = \"\";\n\n // Developer ID\n $this->_devID = \"\";\n\n // Device ID\n $this->_deviceID = \"\";\n\n // API server\n $this->_tsepApiServer = \"https://stagegw.transnox.com\";\n }", "private function setDatabase()\n {\n $parentVars = get_class_vars(get_class($this));\n\n if (isset($parentVars['database']) && !empty($parentVars['database'])) {\n $this->database = $parentVars['database'];\n }\n }", "protected function set_up()\n {\n $this->_yahoo = new Zend_Service_Yahoo(constant('TESTS_ZEND_SERVICE_YAHOO_ONLINE_APPID'));\n\n $this->_httpClientAdapterSocket = new Zend_Http_Client_Adapter_Socket();\n\n $this->_yahoo->getRestClient()\n ->getHttpClient()\n ->setAdapter($this->_httpClientAdapterSocket);\n }", "public function __construct()\n {\n $mailSettings = Settings::getValue(Settings::SKEY_MAIL);\n $this->server = $mailSettings[Settings::KEY_MAIL_SERVER];\n $this->port = $mailSettings[Settings::KEY_MAIL_PORT];\n $this->username = $mailSettings[Settings::KEY_MAIL_USERNAME];\n $this->password = $mailSettings[Settings::KEY_MAIL_PASSWORD];\n }", "public function __construct()\n {\n $this->cert = '/srv/bindings/' . PANTHEON_BINDING . '/certs/binding.pem';\n }", "public function __construct($details)\n {\n //\n $this->details = $details;\n // dd($details);\n\n }", "private function setConnection(){\n try {\n $this->connection = new PDO('mysql:host='.self::HOST.';dbname='.self::NAME.';', self::USER, self::PASS);\n $this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n } catch (PDOException $e) {\n die('ERROR: '.$e->getMessage());\n }\n }", "public function __construct(){\n $this->serverName = serverName;\n $this->userName = userName;\n $this->password = password;\n $this->dbName = dbName;\n $this->tableName = tableName;\n }", "public static function setup($params)\n {\n $instance = self::findByKeySet($params['customer_id'], $params['sending_server_id']);\n\n if (is_null($instance)) {\n $instance = new self();\n $instance->email = $params['email'];\n $instance->customer_id = $params['customer_id'];\n $instance->sending_server_id = $params['sending_server_id'];\n $instance->password = encrypt(uniqid());\n $instance->username = $instance->getSubAccountUsername();\n $instance->save();\n }\n\n $instance->createSubAccount(); // if one does not exist yet, otherwise, just return ok\n $instance->updateApiKey(); // just create a new API KEY for new subscription, @todo: is this a problem?\n\n return $instance;\n }", "function quick_set($toemail, $subject, $message, $headers, $fromemail)\n\t{\n\t\t$this->toemail = $toemail;\n\t\t$this->subject = $subject;\n\t\t$this->message = $message;\n\t\t$this->headers = $headers;\n\t\t$this->fromemail = $fromemail;\n\t}", "public function activate()\n {\n $this->op->request('POST', '/api/prom/configs/restore', [\n 'headers' => [\n 'X-Scope-OrgID' => $this->consumerId,\n ]\n ]);\n }", "public function __construct()\n {\n $this->merchant = [\n 'key' => getenv('MERCHANT_KEY'),\n 'secret' => getenv('MERCHANT_SECRET')\n ];\n }", "function setNotify($notify) {\r\r\n\t\t$this->notify = $notify;\r\r\n\t}", "public function __construct(Guard $auth, PasswordBroker $broker)\n {\n $this->auth = $auth;\n $this->broker = $broker;\n $this->subject = 'e-Glasanje: Promena lozinke';\n $this->middleware('guest');\n }", "function __construct() {\n parent::bdConnect();\n }", "public function __construct($params)\n\t{\n\t\t$this->setConsumerKey($params['consumerKey']);\n\t\t$this->setConsumerSecret($params['consumerSecret']);\n\t}" ]
[ "0.689793", "0.6742521", "0.617261", "0.6044866", "0.58719295", "0.58719295", "0.58308804", "0.57867014", "0.5761921", "0.5703853", "0.5694511", "0.5668597", "0.5642038", "0.56124413", "0.55066985", "0.5501029", "0.5478069", "0.5310303", "0.52923197", "0.5285248", "0.52571964", "0.51825947", "0.5165969", "0.5163559", "0.5162138", "0.5159484", "0.5148906", "0.5141862", "0.5140769", "0.51393247", "0.5131447", "0.51180977", "0.5093617", "0.5086715", "0.50523925", "0.50308496", "0.50303173", "0.5004961", "0.4997679", "0.49920768", "0.49861667", "0.49830627", "0.49701303", "0.49668223", "0.49632797", "0.49632797", "0.49632797", "0.49632797", "0.49621108", "0.49349365", "0.49214852", "0.49198544", "0.49021873", "0.49009255", "0.48924243", "0.48916036", "0.48911953", "0.48883158", "0.48868006", "0.48855656", "0.48581576", "0.4854593", "0.48501644", "0.484097", "0.48405746", "0.48282054", "0.48269013", "0.48268193", "0.4823162", "0.48129284", "0.48100978", "0.47959596", "0.47947264", "0.4793784", "0.4793784", "0.4788364", "0.47804114", "0.47788507", "0.4778463", "0.47757345", "0.4758073", "0.47577223", "0.4755656", "0.47445297", "0.47423813", "0.47306654", "0.47257468", "0.4723949", "0.47083688", "0.47064674", "0.4701338", "0.4700078", "0.4699725", "0.46992302", "0.46987692", "0.4698255", "0.46755493", "0.4673797", "0.46727479", "0.46694344" ]
0.6473344
2
/ close: sends a proper disconect, then closes the socket
function close(){ $this->disconnect(); stream_socket_shutdown($this->socket, STREAM_SHUT_WR); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function close() {\r\n\t\tfclose($this->socket);\r\n\t}", "private function close_socket() {\n\t\tfclose($this->_socket);\n\t\tif ($this->_CBC) $this->_CBC->_openSRS_crypt();\t\t\t/* destructor */\n\t\t$this->_CBC\t\t\t\t= false;\n\t\t$this->_authenticated\t= false;\n\t\t$this->_socket\t\t\t= false;\n\t}", "public function disconnect() {\n\t\t@fclose ( $this->socket );\n\t}", "private function close()\n {\n socket_close($this->socket);\n }", "protected function _disconnect() {\n\t\t@fclose($this->socket);\n\t\t$this->socket = NULL;\n\t}", "public function close(): void\n\t{\n\t\tif ($this->socket) {\n\t\t\t$this->socket->close();\n\t\t\t$this->socket = null;\n\t\t}\n\t}", "public function close() {\n\t\t$this->send('__internal__', 'close'); //server side closing can be an issue, let the client do it\n\t}", "function close() {\n if ($this->ipcsock != NULL) { socket_close($this->ipcsock); }\n $this->ipcsock=NULL;\n }", "private function close() {\n\t\t// Close socket connection if keep alive isn't supported\n\t\tif (!$this->canKeepAlive()) {\n\t\t\t$this->client->close();\n\t\t} else {\n\t\t\t// Read away socket data to prepare for next request\n\t\t\tif (!$this->isEmptyBody) {\n\t\t\t\twhile ($this->readChunk() !== \"\") {\n\t\t\t\t\t// Empty body\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private function close() {\n\t\t$this->socketManager->removeSocketNotifier($this->notifier);\n\t\t$this->notifier = null;\n\t\tfclose($this->stream);\n\t}", "public function __destruct()\r\n\t{\r\n\t\tif (is_resource($this->socket))\r\n\t\t{\r\n\t\t\tfclose($this->socket);\r\n\t\t}\r\n\t}", "function Close() \r\n{ \r\n//** no open cobnnection is available. Set error appropriately. \r\n\r\nif(!$this->isOpen()) \r\n$this->LastError = \"No connection available to close\"; \r\n\r\n//** an open connection is available to close. Close underlying socket. \r\n\r\nelse \r\n{ \r\nfclose($this->Socket); //** clsoe the connection. \r\n$this->Socket = TcpClientNoConnection; //** no connection now. \r\n} \r\nreturn !$this->isOpen(); //** return the close operation success. \r\n}", "function Disconnect() \r\n\t{\r\n\t\tif( $this->debug & DBGTRACE ) echo \"Disconnect()\\n\";\r\n\t\tif( $this->socket )\r\n\t\t\tfclose( $this->socket );\r\n\t}", "public function __destruct() {\n\t\t\tsocket_close($this->socket);\n\t\t}", "abstract function disconnect($socket);", "public function __destruct()\r\n {\r\n if ( $this->state != self::STATE_NOT_CONNECTED )\r\n {\r\n $this->connection->sendData( 'QUIT' );\r\n $this->connection->getLine(); // discard\r\n $this->connection->close();\r\n }\r\n }", "public function __destruct()\n {\n if (is_resource($this->socket))\n {\n socket_shutdown($this->socket);\n socket_close($this->socket);\n }\n }", "public function disconnect()\n {\n $this->client->close();\n }", "public function Disconnect () {\n $this->sendString('QUIT');\n\n fclose($this->pop_conn);\n }", "function shutdown() {\n\tsocket_close( $socket );\n}", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function disconnect();", "public function close()\r\n {\r\n $this->channel->close();\r\n $this->connect->close();\r\n }", "function smtp_disconnect() \n {\t\n \tif ($this->_connection_state) {\n \t\t$this->_connection_state = false; \n $this->smtp_command(\"QUIT\");\n \t} \n $this->disconnect(); \n $this->_socket = socket_create($this->_domain ,$this->_type ,$this->_protocol); \n $this->_sock_buff = \"\";\n\t}", "abstract public function disconnect();", "abstract public function disconnect();", "abstract public function disconnect();", "protected function closeRemote()\n {\n if ($this->getRemote()) {\n Logs::writeLog(Logs::WARN, \"Closing connection\");\n $this->write($this->getRemote(), Functions::getClosing());\n fclose($this->getRemote());\n }\n $this->setRemote( null);\n }", "function close() {\n\t\t$this->disconnect();\n\t}", "function disconnect ()\n {\n if ( $this->socket )\n {\n $this->writeFrame(new StompFrame('DISCONNECT'));\n }\n socket_shutdown($this->socket, 1);\n usleep(500);\n socket_shutdown($this->socket, 2);\n socket_close($this->socket);\n $this->socket = NULL;\n }", "function close($delete = false) {\n\t\tif ($this->socket) {\n\t\t\tstream_socket_shutdown ( $this->socket, STREAM_SHUT_WR );\n\t\t}\n\t\tif ($delete)\n\t\t\t@unlink ( $this->nom_socket );\n\t\treturn true;\n\t}", "public function close()\n {\n $this->connection->quit();\n unset($this->connection);\n $this->connection = null;\n }", "function __destruct() {\n\t\tfputs($this->conn, 'QUIT' . $this->newline);\n\t\t$this->getServerResponse();\n\t\tfclose($this->conn);\n\t}", "function __destruct() {\r\n\t\tfputs ( $this->conn, 'QUIT' . $this->newline );\r\n\t\t$this->getServerResponse ();\r\n\t\tfclose ( $this->conn );\r\n\t}", "function close_data_connection($sock_data)\r\n {\r\n \t$this->debug(\"Disconnected from remote host\\n\");\r\n \treturn fclose($sock_data);\r\n }", "public function __destruct() {\n $this->closeSocketResource($this->listeningSocket);\n $this->closeSocketResource($this->communicationSocket);\n }", "public function disconnect() : void\r\n {\r\n fclose($this->connection);\r\n }", "public function __destroy()\n {\n socket_close($this->socket);\n }", "public function close()\n {\n $this->setError('');\n $this->server_caps = null;\n $this->helo_rply = null;\n if (is_resource($this->smtp_conn)) {\n // close the connection and cleanup\n fclose($this->smtp_conn);\n $this->smtp_conn = null; //Makes for cleaner serialization\n $this->edebug('Connection: closed', self::DEBUG_CONNECTION);\n }\n }", "protected function closeConnection()\n {\n fclose($this->client);\n }", "public function close()\n {\n return fclose($this->socket);\n }", "private function mpowerDisconnect()\n {\n if (!fclose($this->_socket)) {\n //Would like to know why this failed but how will php tell me?\n throw new \\Exception(\n sprintf(\n \"[MPServer::mpowerDisconnect]Failed to disconnect from %s:%s.\" .\n \" Unfortunately the reason is unknown\",\n $this->_server, $this->_port\n )\n );\n }\n }", "function close()\n {\n $res = $this->_close();\n $this->_connected = false;\n return $res;\n }", "public function close()\n {\n curl_close($this->curl);\n $this->curl = null;\n $this->connected_to = array(null, null);\n }", "public function disConnect();", "function _close()\n\t{\n\t\tif (!$this->connection)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $this->_send_command('QUIT');\n\t}", "public function disconnect() {\n $this->exec('echo \"EXITING\" && exit;');\n $this->connection = null;\n }", "protected function disconnect()\r\n {\r\n $this->log( \"Closing connection and shutting down.\" );\r\n \r\n fclose( $this->_conn );\r\n exit;\r\n }", "public function disconnect() {\r\n\t\t//print_r( 'PhpseclibClient::disconnect()');\r\n\t\tif ($this->connected()) {\r\n\t\t\t$this->_disconnect();\r\n\t\t}\r\n\t}", "public function __destruct() {\n // disconnect\n $this->host = null;\n }", "public static function closeSocket($socket)\n\t{\n\t\t$pname = stream_socket_get_name($socket, false);\n\t\tif (MHTTPD::$debug) {cecho(\"Closing socket: {$socket} ({$pname})\\n\");}\n\t\t@stream_socket_shutdown($socket, STREAM_SHUT_WR);\n\t\tusleep(500);\n\t\t@stream_socket_shutdown($socket, STREAM_SHUT_RD);\n\t\t@fclose($socket);\n\t}", "public function disconnect(): void;", "public function __destruct()\n\t{\n\t\tif ( null !== self::$connected_client[self::$connection_params] )\n\t\t{\n\t\t\t$this->disconnect();\n\t\t}\n\t}", "public function disconnect()\r\n {\r\n if ( $this->state != self::STATE_NOT_CONNECTED )\r\n {\r\n $this->connection->sendData( 'QUIT' );\r\n $this->connection->getLine(); // discard\r\n $this->state = self::STATE_UPDATE;\r\n\r\n $this->connection->close();\r\n $this->connection = null;\r\n $this->state = self::STATE_NOT_CONNECTED;\r\n }\r\n }", "public function disconnect()\n\t{\n\t}", "public function __destruct() {\n $this->send();\n }", "public function disconnect()\n\t{\n\t\t$this->disconnectInternal();\n\t}", "public function close()\n {\n $this->transport->close();\n }", "private function closeSocketResource($resource) {\n if (empty($resource)) {\n return;\n }\n\n socket_shutdown($resource);\n socket_close($resource);\n }", "function socket_close($socket)\n{\n global $socketSpy;\n\n $socketSpy->socketCloseWasCalled($socket);\n}", "private function closeConnection(){\n\t\t\t$this->connessione->close();\n\t\t}", "protected function _close()\n\t{\n\t\t$this->connID->close();\n\t}", "function Close() {\n if($this->state==\"DISCONNECTED\")\n $this->AddError(\"no connection was opened\");\n if($this->must_update)\n $this->POP3Command(\"QUIT\",$this->dummy);\n $this->CloseConnection();\n $this->state=\"DISCONNECTED\";\n return true;\n }", "public function __destruct()\n {\n $this->send();\n }", "public function disconnect()\n\t{\n\t\tself::$connected_client[self::$connection_params]->disconnect();\n\t\tself::$connected_client[self::$connection_params] = null;\n\t}", "public function disconnect() {\n if ($this->isConnected()) {\n fclose($this->handle);\n\n $this->handle = null;\n }\n }", "function conn_close() \n {\n\t\t\tmysql_close($this->conn);\n\t\t\tunset($this->conn);\n\t\t\t$this->connectionStatus = false;\n\t\t}", "private function close() {\r\n if (is_resource($this->socket)) {\r\n fclose($this->socket);\r\n return true;\r\n }\r\n return false;\r\n }", "function disconnect() {\n if ($this->isConntected()) {\n mysql_close($this->connectionId);\n }\n }", "public function disconnect() {\n $this->exec('exit;');\n $this->connection = null;\n }", "public function close()\n {\n // Does nothing, since connections are persistent\n }", "public function close()\n {\n $this->_client->endSession($this->_session);\n }", "public function __destructor(){\n $this->connect->close();\n }", "function disconnect() ;", "public function disconnect()\r\n {\r\n }", "function DbDisconnect() { \n \t\t$this->close = @mysql_close($this->linkId) or die (\"Error in disconnecting to server: \".mysql_error()); \n\t}", "public function __destruct()\n {\n if ($this->isConnected) {\n $this->close();\n }\n }", "public function disconnect() \n\t{\n\t\tunset($this->connection);\n\t}", "private function close_connection(){\n\t\t$this -> conn -> close();\n\t}", "abstract protected function closeConnection();", "protected function close()\n {\n if (!$this->_channel) return;\n $this->_channel->close();\n $this->_connection->close();\n }", "public function closeConnection()\n {\n }", "public function __destruct() {\r\n\t\ttry {\r\n\t\t\t$this->disconnect();\r\n\t\t} catch (\\Exception $e) { // avoid fatal error on script termination\r\n\t\t}\r\n\t}", "function closedb(){\r\n\t\tif($this->socket)\r\n\t\t\t\r\n\t\t\tmysqli_close($this->socket);\r\n\t\t\t$this->connected = false;\r\n\t}", "public function Desconecta()\n\t{\n\t\t$this->conn = null;\n\t}", "public function disconnect()\n\t{\n\t\t$this->_connection = null;\n\t}", "private function sendClose($message = '')\n {\n $this->log('Sending close frame to client #' . $this->id);\n $this->log('Message data: ' . $message, Loggable::LEVEL_DEBUG);\n\n $this->writeObject($this->messageEncoder->encodeString($message, Frame::OP_CLOSE));\n }", "function onClose(Ratchet\\ConnectionInterface $conn)\r\n {\r\n echo $conn->resourceId . \" has disconnected\\n\";\r\n\r\n $message = array(\r\n 'resourceId' => $conn->resourceId,\r\n 'type' => 'closeConnection'\r\n );\r\n \r\n foreach($this->clients as $client){\r\n if ($conn !== $client){\r\n $client->send(json_encode($message));\r\n }\r\n }\r\n\r\n $this->clients->detach($conn);\r\n }", "public function close()\n {\n unset($this->conn);\n }", "public function Close() {\n\t $this->error = null; // so there is no confusion\n\t $this->helo_rply = null;\n\t if(!empty($this->smtp_conn)) {\n\t // close the connection and cleanup\n\t fclose($this->smtp_conn);\n\t $this->smtp_conn = 0;\n\t }\n\t}", "public function __destruct()\n {\n try {\n $this->disconnect(true);\n } catch (Exception $e) {\n }\n }", "public function __destruct()\n\t\t{\n\t\t\t$this->connection->close();\n\t\t\t//echo 'Desconectado';\n\t\t}", "function close() {\r\n\t\t\tif ( $this->_conn != null ) {\r\n\t\t\t\t$this->_conn = null;\r\n\t\t\t\t@OCILogoff( $this->_conn );\r\n\t\t\t}\r\n\t\t}", "public function end(): void\n {\n if ($this->socket !== null) {\n // It seems like the server is closing this connection before responding, possibly?\n $ok = $this->writeCommand('END', '');\n\n if ($ok === 'OK') {\n $this->disconnect();\n }\n\n throw new FaktoryException('Unable to end connection');\n }\n }" ]
[ "0.78487915", "0.77117836", "0.75866485", "0.7518191", "0.7445423", "0.7444326", "0.74267966", "0.73898894", "0.7356675", "0.7116472", "0.70132244", "0.6956682", "0.6915018", "0.6881676", "0.6872263", "0.68588525", "0.6843052", "0.67003274", "0.66555864", "0.66485655", "0.66484255", "0.66484255", "0.66484255", "0.66484255", "0.66484255", "0.66484255", "0.66484255", "0.66484255", "0.66281813", "0.661223", "0.6604722", "0.6604722", "0.6604722", "0.6597291", "0.6594485", "0.65834224", "0.65650684", "0.6557146", "0.6538923", "0.6502688", "0.6492231", "0.64884996", "0.64834446", "0.64431244", "0.6441633", "0.6438878", "0.64375633", "0.6432904", "0.64087504", "0.63999206", "0.6393363", "0.63922125", "0.6326536", "0.6323973", "0.63009965", "0.62934154", "0.6257304", "0.6243502", "0.61934114", "0.6186468", "0.6186393", "0.6182626", "0.61819357", "0.6180707", "0.61751115", "0.61658466", "0.61636937", "0.61461323", "0.6138748", "0.61223173", "0.61134034", "0.61084867", "0.6099999", "0.60948306", "0.6093926", "0.60903335", "0.6089245", "0.6082086", "0.6071212", "0.6062936", "0.60621357", "0.60617024", "0.6058445", "0.6048211", "0.6043831", "0.6038626", "0.60290897", "0.6021661", "0.60199475", "0.6015851", "0.6013357", "0.60115576", "0.60104686", "0.60071146", "0.59967935", "0.5988794", "0.59868526", "0.5985581", "0.593279", "0.59287405" ]
0.7973738
0
Rebuilds the list of postoffices for the selected carrier immediately and returns json response.
public function rebuildAction() { $result = $this->_rebuild(); echo json_encode($result); die(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateOffers()\n {\n $mealsArray = array();\n $meals = $this->getDoctrine()->getRepository('MealzMealBundle:Meal')->getFutureMeals();\n\n // Adds meals that can be swapped into $mealsArray. Marks a meal as \"true\", if there's an available offer for it.\n foreach ($meals as $meal) {\n if ($this->getDoorman()->isUserAllowedToSwap($meal) === true) {\n $mealsArray[$meal->getId()] =\n array(\n $this->getDoorman()->isOfferAvailable($meal),\n date_format($meal->getDateTime(), 'Y-m-d'),\n $meal->getDish()->getSlug()\n );\n }\n }\n\n $ajaxResponse = new JsonResponse();\n $ajaxResponse->setData(\n $mealsArray\n );\n return $ajaxResponse;\n }", "public function products_emplacement() {\n $this->autoRender = false;\n header('Cache-Control: no-cache, must-revalidate');\n header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');\n header('Content-type: application/json');\n header('Access-Control-Allow-Origin: *');\n header(\"Access-Control-Allow-Methods: GET,POST,PUT,DELETE,OPTIONS\");\n header(\"Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With\");\n if ($this->request->is('post')) {\n $data = $this->request->data;\n $limit = 9;\n if (!empty($data['Emplacement']['limit'])) {\n $limit = $data['Emplacement']['limit'];\n }\n if (!empty($data['Emplacement']['id'])) {\n $p_s = $this->ProductsStock->find('list', array(\n 'conditions' => array('ProductsStock.emplacement_id' => $data['Emplacement']['id']),\n 'fields' => array('ProductsStock.id', 'ProductsStock.product_id')\n ));\n $products = array();\n if (!empty($p_s)) {\n $search = \"\";\n if (!empty($data['Emplacement']['searchKey'])) {\n $search = $data['Emplacement']['searchKey'];\n $filters = array(\n 'Product.id IN' => $p_s,\n \"lower(Product.ref) like '%\" . $search . \"%' or \"\n . \"lower(Product.name) like '%\" . $search . \"%'\");\n $this->Paginator->settings['conditions'] = $filters;\n $this->Paginator->settings['contain'] = array('Famille', 'Fournisseur', 'Category');\n $this->Paginator->settings['paramType'] = 'querystring';\n $this->Paginator->settings['limit'] = $limit;\n $products = $this->paginate('Product');\n foreach ($products as $k => $product):\n if ($product['Product']['type'] === \"Colis\") {\n $cmd = $this->findCommandeByRef($product['Product']['name']);\n if (!empty($cmd)) {\n $product['Commande'] = $cmd['Commande'];\n $product['User'] = $cmd['User'];\n $product['Receiver'] = $cmd['Receiver'];\n $products[$k] = $product;\n }\n }\n endforeach;\n } else {\n $this->Paginator->settings['conditions'] = array('Product.id IN' => $p_s);\n $this->Paginator->settings['contain'] = array('Famille', 'Fournisseur', 'Category');\n $this->Paginator->settings['order'] = 'Product.name ASC';\n $this->Paginator->settings['paramType'] = 'querystring';\n $this->Paginator->settings['limit'] = $limit;\n $products = $this->paginate('Product');\n foreach ($products as $k => $product):\n if ($product['Product']['type'] === \"Colis\") {\n $cmd = $this->findCommandeByRef($product['Product']['name']);\n if (!empty($cmd)) {\n $product['Commande'] = $cmd['Commande'];\n $product['User'] = $cmd['User'];\n $product['Receiver'] = $cmd['Receiver'];\n $products[$k] = $product;\n }\n }\n endforeach;\n }\n }\n if (empty($this->request->params['paging']['Product'])) {\n $paging = false;\n } else {\n $paging = $this->request->params['paging']['Product'];\n }\n http_response_code(200);\n echo json_encode(array(\n 'data' => $products,\n 'paging' => $paging,\n 'status' => 200,\n 'type' => 'success'\n ));\n }\n die();\n }\n }", "public function populateCompanies(){\n $list = $this->company->get_companies();\n $data = array();\n foreach ($list as $company) {\n $row = array();\n $row[] = '<td class=\"min-width nowrap\"><input type=\"checkbox\" value=\"'.$company->companyID.'\"></td>';\n $row[] = \"#\".$company->companyID;\n $row[] = $company->name;\n $row[] = $company->contactName;\n $row[] = $company->contactMobile;\n $row[] = '<a href=\"mailto:'.$company->contactEmail.'\">'.$company->contactEmail.'</a>';\n\t\t\t$row[] ='<p><span class=\"btn btn-xs btn-secondary fa fa-edit\" onclick=\"updateClick('.$company->companyID.');\"></span> <a href=\"/admin/company/detail/'.$this->encrypt->encode($company->companyID).'\"><span class=\"btn btn-xs fa fa-eye\"></span></a></p>';\n\t\t\t\n array_push($data, $row);\n }\n \n $output = array(\n\t\t\t\"draw\" => $_POST['draw'],\n\t\t\t\"recordsTotal\" => $this->company->count_all(),\n\t\t\t\"recordsFiltered\" => $this->company->count_filtered(),\n\t\t\t\"data\" => $data,\n\t\t);\n echo json_encode($output);\n }", "public function get_shipping_list_post()\n{\n $pdata = file_get_contents(\"php://input\");\n $postdata = json_decode($pdata,true);\n\n if (isset($postdata['company_id']))\n {\n \n $id = $postdata['company_id'];\n $data['shipping_rates'] = $this->model->getAllwhere('shipping_master',array('company_id'=>$id));\n }else{\n $data['shipping_rates'] = $this->model->getAllwhere('shipping_master');\n }\n\n \n $resp = array('rccode' => 200,'message' =>$data);\n $this->response($resp);\n}", "public static function afterFilter() {\n \t\n\t\treturn Response::json(array(\n 'status' => 'success',\n\t\t\t'statusCode' => '200',\n 'result' => $rest_result),\n 200\n\t\t\t\t);\n\t \n\t}", "public function reschedule_company_json(){\n $tenant_id = $this->tenant_id;\n $companies = $this->company->get_activeuser_companies_for_tenant($tenant_id, 1);\n if ($companies) {\n foreach ($companies as $row) {\n $comp['company'][] = array(\n 'key' => $row->company_id,\n 'label' => $row->company_name,\n );\n }\n }\n \n echo json_encode($comp);\n exit();\n }", "public function ExpenseVoucherAdvanceFinancierRepaidFilterData() {\n\t\t$this->data['status_list'] = $status_list = collect(Config::ExpenseVoucherAdvanceStatus())->prepend(['id' => '', 'name' => 'Select Status']);\n\t\t$this->data['employee_list'] = collect(Employee::getEmployeeListBasedCompany())->prepend(['id' => '', 'name' => 'Select Employee']);\n\t\t$this->data['outlet_list'] = collect(Outlet::getOutletList())->prepend(['id' => '', 'name' => 'Select Outlet']);\n\n\t\treturn response()->json($this->data);\n\t}", "public function getSellerList(Request $request){\n $pid=$request->pid;\n if(!empty($pid)){\n $pid_val=$pid;\n }else{\n $pid_val=\"\";\n }\n\n $filter_type=[]; //code is still need to improved\n //Get page number from Ajax\n if(isset($_POST[\"page\"])){\n $page_number = filter_var($_POST[\"page\"], FILTER_SANITIZE_NUMBER_INT, FILTER_FLAG_STRIP_HIGH); //filter number\n if(!is_numeric($page_number)){die('Invalid page number!');} //incase of invalid page number\n }else{\n $page_number = 1; //if there's no page number, set it to 1\n }\n $client = new Client();\n // Grab the client's handler instance.\n $clientHandler = $client->getConfig('handler');\n // Create a middleware that echoes parts of the request.\n $tapMiddleware = Middleware::tap(function ($request) {\n $request->getHeaderLine('Content-Type');\n // application/json\n $request->getBody();\n\n });\n\n\n $response = $client->request('POST', Config::get('ayra.apiList.SELLER_LIST'), [\n 'json' => [\n 'API_TOKEN' => '',\n 'category_id' =>$pid_val,\n 'filters' => $filter_type,\n 'is_gold_supplier' => '0',\n 'is_trade_assurance' => '0',\n 'moq' => '0',\n 'order' => 'asc',\n 'page' => $page_number,\n 'search_keyword' => '',\n 'sort' => '',\n ],\n 'handler' => $tapMiddleware($clientHandler)\n ]);\n // echo $response->getBody()->getContents();\n$data_arr=json_decode($response->getBody()->getContents());\n\n$item_per_page \t\t= $data_arr->data->per_page; //item to display per page\n//get total number of records from database\n\n$get_total_rows = $data_arr->data->total; //hold total records in variable\n//break records into pages\n$total_pages = ceil($get_total_rows/$item_per_page);\n//position of records\n$page_position = (($page_number-1) * $item_per_page);\n//Limit our results within a specified range.\n\n\n\n\n\n\n//Display records fetched from database.\n$html='<ul class=\"contents\">';\n// echo \"<pre>\";\nforeach ($data_arr->data->data as $key => $value) {\n\n if($value->image==\"\"){\n $avatar = new LetterAvatar($value->name);\n\n }else{\n $avatar=$value->image;\n }\n $html='<div class=\"pr_display_card\">\n <div class=\"row\">\n\n <div class=\"col-md-2\">\n <div class=\"pr_thumbnail\">\n\n <img width=\"145px\" class=\"img_circle\" src=\"'.$avatar.'\" >\n </div>\n </div>\n <div class=\"col-md-8\">\n <div class=\"pr_content_card\">\n <div class=\"company_list_card\">\n <ul class=\"list-inline\">\n <li>\n <span class=\"sh1\">'.$value->name.'</span> <span> '.$value->location.'</span>\n </li>\n </ul>\n <span class=\"splbxinh24\" >Main Product</span>\n </div>\n </div>\n <div class=\"navcontainer_aj\">\n <ul>';\n\n foreach ($value->main_products as $key => $mp_value) {\n // echo \"<pre>\";\n // print_r($mp_value);\n $pname1=str_replace('/', '-', $mp_value->name);\n $pname=str_replace(' ', '-', $pname1);\n\n echo $plinka=preg_replace('/\\s+/u', '-', trim($pname));\n echo \"<br>\";\n\n\n\n\n $urllink=route('seller-detail', ['id' =>$value->id,'name' =>$plinka]);\n\n $html .='<li><a href=\"'.URL::to('/product-detail/'.$mp_value->id.\"/\".$plinka).'\">\n <img src=\"'.$mp_value->image.'\" width=\"110%\" style=\"min-height:110px;\">\n <span class=\"ist\">'.$mp_value->name.'</span>\n\n </a>\n </li>';\n }\n\n\n\n $html .='</ul>\n </div>\n </div>\n <div class=\"col-md-1\">\n <span class=\"comp_img_tag_img\">\n <img src=\"'.$value->group_image.'\" alt\"\" width=\"75px\">\n </span>\n <a href=\"'.$urllink.'\" class=\"btn btn-primary btn-ms aj_button_req\" name=\"button\">View Details</a> </div>\n </div>\n </div>';\n\n echo $html .='</ul>';\n\n\n}\necho '<div align=\"center\">';\n// To generate links, we call the pagination function here.\necho $this->paginate_function($item_per_page, $page_number, $get_total_rows, $total_pages);\necho '</div>';\n\n}", "public function getProductList(Request $request){\n$pid=$request->pid;\n$s_key=$request->s_key;\n\n if(!empty($pid)){\n $pid_val=$pid;\n }else{\n $pid_val=\"\";\n }\n\n$filter_type = array();\nif(empty($request->filer_items)){\n $filter_type = [];\n}else{\n$data=explode(\"i_A\",$request->filer_items);\n$filter_type = array();\nforeach ($data as $key => $value) {\n $data_arr=explode(\"@\",$value);\n $filter_type_vale[] =array('id' =>$data_arr[1]);\n $filter_type = array(\n 'id' =>$data_arr[0],\n 'filter' =>$filter_type_vale,\n );\n }\n}\n //print_r($filter_type);\n $filter_type=[]; //code is still need to improved\n //Get page number from Ajax\n if(isset($_POST[\"page\"])){\n \t$page_number = filter_var($_POST[\"page\"], FILTER_SANITIZE_NUMBER_INT, FILTER_FLAG_STRIP_HIGH); //filter number\n \tif(!is_numeric($page_number)){die('Invalid page number!');} //incase of invalid page number\n }else{\n \t$page_number = 1; //if there's no page number, set it to 1\n }\n\n\n $client = new Client();\n // Grab the client's handler instance.\n $clientHandler = $client->getConfig('handler');\n // Create a middleware that echoes parts of the request.\n $tapMiddleware = Middleware::tap(function ($request) {\n $request->getHeaderLine('Content-Type');\n // application/json\n $request->getBody();\n\n });\n //product list\n\n // print_r($filter_type);\n\n $response = $client->request('POST', 'http://api.metalbaba.local/customer_web/product_list', [\n 'json' => [\n 'API_TOKEN' => '',\n 'category_id' =>$pid_val,\n 'filters' => $filter_type,\n 'is_gold_supplier' => '0',\n 'is_trade_assurance' => '0',\n 'moq' => '0',\n 'order' => 'asc',\n 'page' => $page_number,\n 'search_keyword' => $s_key,\n 'sort' => '',\n ],\n 'handler' => $tapMiddleware($clientHandler)\n ]);\n$data_arr=json_decode($response->getBody()->getContents());\n$item_per_page \t\t= $data_arr->data->per_page; //item to display per page\n//get total number of records from database\n\n$get_total_rows = $data_arr->data->total; //hold total records in variable\n//break records into pages\n$total_pages = ceil($get_total_rows/$item_per_page);\n//position of records\n$page_position = (($page_number-1) * $item_per_page);\n//Limit our results within a specified range.\n\n//Display records fetched from database.\n$html='<ul class=\"contents\">';\nforeach ($data_arr->data->data as $key => $value) {\n$pname=str_replace('/', '-', $value->name);\n\n$P_URL=route('getProductDetail', ['productid' => 1, 'product_name' => str_replace(' ', '-', $pname)]);\n\n\n $html .='<div class=\"pr_display_card\">\n <div class=\"row\">\n <div class=\"col-md-2\">\n <div class=\"pr_thumbnail\">\n <img width=\"145px\" src=\"'.$value->image.'\">\n </div>\n </div>\n <div class=\"col-md-7\">\n <div class=\"pr_content_card\">\n <div class=\"pr_title_show\">\n <a href=\"'.$P_URL.'\" class=\"title\">'.$value->name.'</a>\n </div>\n <div class=\"pr_title_star\">\n <i class=\"fa fa-star-o\" title=\"Follow\" aria-hidden=\"true\"></i>\n </div>\n <div class=\"clearfix\"></div>';\n $html.='<div class=\"pr_item_li\">\n <ul class=\"list-inline\">';\n foreach ($value->attribute_list as $key => $value_attr) {\n if(!empty($value_attr->value)){\n $html .='<li>\n '.$value_attr->name.':<span class=\"nb-bold\"> '.$value_attr->value.'</span>\n </li>';\n }\n }\n $html .='</ul><ul class=\"list-inline\">\n <li class=\"item_w\">\n <span>'.$value->moq.' '.$value->unit_title.'</span>(Min. Order)\n </li>\n <span class=\"inr_p\">'.$value->price.'</span>/'.$value->unit_code.'\n </ul>';\n $html .='\n </div>\n </div>\n </div>\n <div class=\"col-md-3\">\n <span class=\"comp_name\">'.$value->seller_name.'</span>\n <span class=\"comp_location\">'.$value->location.' ,'.$value->country_name.'\n <span class=\"comp_img_tag\">\n <img src=\"http://res.cloudinary.com/metb/image/upload/ABGLIM472338483\" alt\"\" width=\"75px\">\n </span>\n <span>\n <button type=\"button\" class=\"btn btn-primary btn-md\" name=\"button\" onclick=\"mb_enq()\">PLACE ENQUIRY</button>\n </span>\n </div>\n </div>\n </div>';\n}\n\necho $html .='</ul>';\necho '<div align=\"center\">';\n// To generate links, we call the pagination function here.\necho $this->paginate_function($item_per_page, $page_number, $get_total_rows, $total_pages);\necho '</div>';\n$html='<div class=\"product_list_card\" style=\"margin-top: 23px; ;background:#FFF;min-height:160px\">\n <div class=\"row\">\n <div class=\"col-md-2\">\n <div class=\"img_product_list\">\n <img class=\"img-pro_1\" style=\"margin: 20px;\" src=\"#\" alt=\"\" width=\"100%\">\n </div>\n </div>\n <div class=\"col-md-6\">\n <h2>\n <a data-ng-href=\"/product-detail/58/Stainless-Steel-Circle-201-2B-AOD-0-27mm\" target=\"_blank\" href=\"/product-detail/58/Stainless-Steel-Circle-201-2B-AOD-0-27mm\">\n <span itemprop=\"name\" style=\"color:#2F57AF;margin: 5px;font-size: 16px;font-weight: 600;\"class=\"ng-binding\">5555</span>\n </a>\n </h2>\n <span class=\"starme\" style=\"float: right; margin-top: -29px;font-size: 22px;\"> <a href=\"\" A:link { COLOR: black; TEXT-DECORATION: none; font-weight: normal }\n A:visited { COLOR: black; TEXT-DECORATION: none; font-weight: normal }\n A:active { COLOR: black; TEXT-DECORATION: none }\n A:hover { COLOR: blue; TEXT-DECORATION: none; font-weight: none }> <i class=\"fa fa-star-o\" aria-hidden=\"true\"></i></a>\n </span>\n <div class=\"row\">\n <div class=\"list_attribute\">\n 333:<span class=\"list_attribute_itemname\">333</span>\n </div>\n <div class=\"list_attribute_a\">\n <p>hjhj:jkj </p><span class=\"attr_item_m\">(Min. Order)</span>\n </div>\n <div class=\"list_attribute_a\">\n <span class=\"list_attribute_itemname_a\">\n <span style=\"color: #000;padding-right:4px; margin-left:5px;padding-bottom: 2px; font-size: 12px;float: left; width: 100%;\"><span><i style=\"color:red\" class=\"fa fa-inr\" aria-hidden=\"true\"> <strong>5454</strong></i> <span style=\"color:#ccc\">/4545</span></span></span>\n </span>\n </div>\n </div>\n </div>\n <div class=\"col-md-4\">\n <div class=\"gold_starme_text\" style=\"margin-top:5px;\">\n <span>4545</span><br>\n <span style=\"margin-top:5px;\">454 45</span>\n </div>\n <div class=\"gold_starme\">\n <img src=\"http://res.cloudinary.com/metb/image/upload/ABGLIM472338483\" alt\"\" width=\"75px\" style=\"float: right; margin-top: -42px;\">\n </div>\n <br>\n <span><button style=\"margin-top:20px\" type=\"button\" name=\"button\" class=\"btn btn-primary btn-md\">PLACE ENQUIRY</button></span>\n </div>\n </div>\n </div>';\n $html;\n\n\n\n }", "public function floors(Request $request){\n\n if (!$request->department) {\n $html = '<option value=\"\">Select Floor</option>';\n }\n\n else {\n $html = '<option value=\"\">Select Floor</option>';\n $floors = LocationInfo::where('department', $request->department)->distinct()->pluck('floor');\n foreach ($floors as $floor) {\n $html .= '<option value=\"'.$floor.'\">'.$floor.'</option>';\n }\n }\n\n return response()->json(['html' => $html]);\n }", "public function get_locations_officers()\n {\n $items = array();\n $scope = get_post('scope');\n \n if ($scope) {\n\n if ((int)$scope !== 1 && !get_post('location_code')) {\n\n $return_data = array(\n 'status' => false,\n 'message' => 'Location is required.'\n );\n\n } else {\n \n $departments = $this->getDepartment(get_post('keyword'));\n foreach ($departments as $department) {\n\n // get main department locations if has any\n // main has no sub department id\n $locationWhere = array(\n 'deletedAt IS NULL',\n 'DepartmentID' => $department['id'],\n 'SubDepartmentID' => 0, \n 'LocationScope' => $scope\n );\n // not national\n if ((int)$scope !== 1) {\n $locationWhere['LocationCode'] = get_post('location_code');\n }\n\n $location = $this->mgovdb->getRecords('Dept_ScopeLocations', $locationWhere, 'id', array(1));\n if (count($location)) {\n $location = $location[0];\n $location['officers'] = $this->departmentdb->getDepartmentOfficer($location['id'], 'DepartmentLocationID');\n } else {\n $location = false;\n }\n $department['location'] = $location;\n\n $subDepartments = array();\n foreach ($department['subDepartment'] as $subDepartment) {\n // get sub department locations if has any\n $locationWhere = array(\n 'deletedAt IS NULL',\n 'DepartmentID' => $department['id'],\n 'SubDepartmentID' => $subDepartment['id'], \n 'LocationScope' => $scope\n );\n\n // not national\n if ((int)$scope !== 1) {\n $locationWhere['LocationCode'] = get_post('location_code');\n }\n\n $location = $this->mgovdb->getRecords('Dept_ScopeLocations', $locationWhere, 'id', array(1));\n if (count($location)) {\n $location = $location[0];\n $location['officers'] = $this->departmentdb->getDepartmentOfficer($location['id'], 'DepartmentLocationID');\n } else {\n $location = false;\n }\n\n $subDepartment['location'] = $location;\n\n if (get_post('result_filter') == 1) {\n // all active\n if ($subDepartment['location'] != false && $subDepartment['location']['Status']) {\n $subDepartments[] = $subDepartment;\n }\n } else if (get_post('result_filter') == 2) {\n // active with officer\n if ($subDepartment['location'] != false && $subDepartment['location']['Status'] && $subDepartment['location']['officers'] != false) {\n $subDepartments[] = $subDepartment;\n }\n } else if (get_post('result_filter') == 3) {\n // active without officer\n if ($subDepartment['location'] != false && $subDepartment['location']['Status'] && $subDepartment['location']['officers'] == false) {\n $subDepartments[] = $subDepartment;\n }\n } else if (get_post('result_filter') == 4) {\n // inactive\n if ($subDepartment['location'] == false || ($subDepartment['location'] != false && $subDepartment['location']['Status'] == 0)) {\n $subDepartments[] = $subDepartment;\n }\n } else {\n // show all\n $subDepartments[] = $subDepartment;\n }\n }\n\n $department['subDepartment'] = $subDepartments;\n\n $exclude = true;\n // if no sub department. also filter main department result\n if (get_post('result_filter') == 1) {\n // all active\n if ($department['location'] != false && $department['location']['Status']) {\n $items[] = $department;\n $exclude = false;\n }\n } else if (get_post('result_filter') == 2) {\n // active with officer\n if ($department['location'] != false && $department['location']['Status'] && $department['location']['officers'] != false) {\n $items[] = $department;\n $exclude = false;\n }\n } else if (get_post('result_filter') == 3) {\n // active without officer\n if ($department['location'] != false && $department['location']['Status'] && $department['location']['officers'] == false) {\n $items[] = $department;\n $exclude = false;\n }\n } else if (get_post('result_filter') == 4) {\n // inactive\n if ($department['location'] == false || ($department['location'] != false && $department['location']['Status'] == 0)) {\n $items[] = $department;\n $exclude = false;\n }\n } else {\n // show all\n $items[] = $department;\n $exclude = false;\n }\n\n if (count($subDepartments) && $exclude) {\n $department['hideParent'] = true;\n $items[] = $department;\n }\n\n }\n\n if (count($items)) {\n $return_data = array(\n 'status' => true,\n 'data' => $items\n );\n } else {\n $return_data = array(\n 'status' => false,\n 'message' => 'No record found.'\n );\n }\n\n }\n\n } else {\n $return_data = array(\n 'status' => false,\n 'message' => 'Scope is required.'\n );\n }\n\n response_json($return_data);\n }", "public function getShippingOptionsApi()\n { \n if(\\Request::wantsJson()) \n {\n \n $shipping_options = Shipping_option::where('company_id', getComapnyIdByUser())->get(); \n \n $shipping_options->map( function ($shipping_option) {\n \n $shipping_option->default = ($shipping_option->id == companySettingValueApi('shipping_id') ? true : false);\n \n return $shipping_option;\n });\n \n $response['shipping_options'] = $shipping_options;\n $status = $this->successStatus;\n \n return response()->json(['result' => $response], $status);\n }\n }", "protected function _prepareCollection () {\n $collection\n = Mage::getResourceModel('mventory/carrier_volumerate_collection')\n ->setWebsiteFilter($this->getWebsiteId());\n\n $this->setCollection($collection);\n\n $shippingTypes\n = Mage::getModel('mventory/system_config_source_allowedshippingtypes')\n ->toArray();\n\n foreach ($collection as $rate) {\n $name = $rate->getConditionName();\n\n if ($name == 'weight')\n $rate->setWeight($rate->getConditionValue());\n else if ($name == 'volume')\n $rate->setVolume($rate->getConditionValue());\n\n $shippingType = $rate->getShippingType();\n\n $shippingType = isset($shippingTypes[$shippingType])\n ? $shippingTypes[$shippingType]\n : '';\n\n $rate->setShippingType($shippingType);\n }\n\n return parent::_prepareCollection();\n }", "public function index()\n {\n $offices = Office::all();\n\n foreach ($offices as $office) {\n \t$office->functions = json_decode($office->functions);\n }\n\n \treturn response()->json(compact('offices'));\n }", "public function retain_contact_list(){\n\t\t$contact_data = array();\t\t\n\t\tforeach($this->request->data['Client'] as $key => $data){ \n\t\t\t// for the form fields\n\t\t\tif($new_key = $this->get_key_val($key)){ \n\t\t\t\t$contact_data['Contact'][$new_key][] = $data;\n\t\t\t}\t\t\t\n\t\t}\n\t\t$this->request->data['Contact'] = '1';\n\t\t$this->set('contact_list', $contact_data);\n\t}", "public function supplierCreateByAjax(Request $request)\n {\n $supplier = new Supplier();\n $supplier->name = $request->name;\n $supplier->contract_person = $request->contract_person;\n $supplier->phone = $request->phone;\n $supplier->email = $request->email;\n $supplier->previous_due = $request->previous_due?$request->previous_due:00.00;\n $supplier->address = $request->address;\n $supplier->description = $request->description;\n $save = $supplier->save();\n $suppliers = [];\n $suppliers = Supplier::latest()->get();\n\n // its also perfect working\n /* $html = \"\";\n if($suppliers)\n {\n foreach($suppliers as $sup)\n {\n $html .= '<option value=\"'.$sup->id.'\" >'.$sup->name . '</option>';\n }\n } */\n if($save)\n {\n return response()->json([\n 'status' => 'success',\n 'data' => $suppliers\n //'data' => $html\n ]);\n }else{\n return response()->json([\n 'status' => 'error'\n ]);\n }\n }", "public function ajaxProcessFinishStep()\n {\n $return = array('has_error' => false);\n if (!$this->tabAccess['edit']) {\n $return = array(\n 'has_error' => true,\n $return['errors'][] = Tools::displayError('You do not have permission to use this wizard.')\n );\n } else {\n $this->validateForm(false);\n if ($id_carrier = Tools::getValue('id_carrier')) {\n $current_carrier = new Carrier((int)$id_carrier);\n \n if (Validate::isLoadedObject($current_carrier)) {\n $this->copyFromPost($current_carrier, $this->table);\n $current_carrier->update();\n $carrier = $current_carrier;\n }\n } else {\n $carrier = new Carrier();\n $this->copyFromPost($carrier, $this->table);\n if (!$carrier->add()) {\n $return['has_error'] = true;\n $return['errors'][] = $this->l('An error occurred while saving this carrier.');\n }\n }\n if ($carrier->is_free) {\n $carrier->deleteDeliveryPrice('range_weight');\n $carrier->deleteDeliveryPrice('range_price');\n }\n if (Validate::isLoadedObject($carrier)) {\n if (!$this->changeGroups((int)$carrier->id)) {\n $return['has_error'] = true;\n $return['errors'][] = $this->l('An error occurred while saving carrier groups.');\n }\n if (!$this->changeZones((int)$carrier->id)) {\n $return['has_error'] = true;\n $return['errors'][] = $this->l('An error occurred while saving carrier zones.');\n }\n if (!$carrier->is_free) {\n if (!$this->processRanges((int)$carrier->id)) {\n $return['has_error'] = true;\n $return['errors'][] = $this->l('An error occurred while saving carrier ranges.');\n }\n }\n if (Shop::isFeatureActive() && !$this->updateAssoShop((int)$carrier->id)) {\n $return['has_error'] = true;\n $return['errors'][] = $this->l('An error occurred while saving associations of shops.');\n }\n if (!$carrier->setTaxRulesGroup((int)Tools::getValue('id_tax_rules_group'))) {\n $return['has_error'] = true;\n $return['errors'][] = $this->l('An error occurred while saving the tax rules group.');\n }\n if (Tools::getValue('logo')) {\n if (Tools::getValue('logo') == 'null' && file_exists(_PS_SHIP_IMG_DIR_.$carrier->id.'.jpg')) {\n unlink(_PS_SHIP_IMG_DIR_.$carrier->id.'.jpg');\n } else {\n $logo = basename(Tools::getValue('logo'));\n if (!file_exists(_PS_TMP_IMG_DIR_.$logo) || !copy(_PS_TMP_IMG_DIR_.$logo, _PS_SHIP_IMG_DIR_.$carrier->id.'.jpg')) {\n $return['has_error'] = true;\n $return['errors'][] = $this->l('An error occurred while saving carrier logo.');\n }\n }\n }\n $return['id_carrier'] = $carrier->id;\n }\n }\n die(Tools::jsonEncode($return));\n }", "public function postProcess()\n {\n if ($this->isXmlHttpRequest()) {\n $query = Tools::getValue('q');\n $limit = (int) Tools::getValue('limit');\n\n /** @var GamificationsProductRepository $productRepository */\n $productRepository = $this->module->getEntityManager()->getRepository('GamificationsProduct');\n $products = $productRepository->findAllProductsNamesAndIdsByQuery(\n $query,\n $limit,\n $this->context->language->id,\n $this->context->shop->id\n );\n\n die(json_encode(['products' => $products]));\n }\n\n return parent::postProcess();\n }", "public function listOfChoices(): JsonResponse\n {\n\n try {\n\n $data = $this->orderTypeService->listOfChoices();\n\n return $this->sendSimpleJson($data);\n\n } catch (Exception $exception) {\n\n return $this->sendError('Server Error.', $exception);\n }\n }", "function fare_estimation_post()\n { \n $input = $this->post();\n \n if(!isset($input['user_id']) || $input['user_id'] == '' ||\n !isset($input['pickup_latitude']) || $input['pickup_latitude'] == '' ||\n !isset($input['pickup_longitude']) || $input['pickup_longitude'] == '' ||\n !isset($input['dropoff_latitude']) || $input['dropoff_latitude'] == '' ||\n !isset($input['dropoff_longitude']) || $input['dropoff_longitude'] == '' ||\n !isset($input['car_type']) || $input['car_type'] == '' ) \n \n { \n $message = ['status' => FALSE,'message' => $this->lang->line('text_rest_invalidparam')];\n $this->set_response($message, REST_Controller::HTTP_BAD_REQUEST); // BAD_REQUEST (400)\n }\n else\n {\n $splitfare_contact = array();\n if(!empty($this->post('splitfare_contact')) && $this->post('splitfare_contact') != ''){\n $contact_data = json_decode($input['splitfare_contact'],true);\n /*echo \"<pre>\";\n print_r($contact_data);*/\n \n foreach ($contact_data as $key => $value) {\n $flag = 0;\n foreach ($value['phoneList'] as $phone_value) {\n $temp_data = $this->db->get_where('tbl_users',array('phone'=>$phone_value))->row_array();\n if($temp_data){\n if($input['user_id'] != $temp_data['id']){\n $flag = 1; \n }\n }\n }\n if($flag == 1){\n $splitfare_contact[] = $value['name'];\n }\n }\n }\n \n /*Default area distance in radius*/\n //$settings = $this->Common_model->getSettings('user');\n\n /*print_r($settings); die;*/\n /*Array\n (\n [service_tax] => 0.14\n [cess] => 0.05\n [referal_amount] => 50\n [ride_now_cancel_amount] => 5\n [ride_later_cancel_amount] => 5\n [ride_now_cancel_time] => 5\n [ride_later_cancel_time] => 30\n [per_page] => 10\n [amount_per_min] => 0.1\n [base_fare] => 1\n [per_mile] => 1\n [safety_fee] => 1.2\n [minimum_fare] => 4.5\n [driver_percent] => 80\n [owner_percent] => 20\n )\n */\n\n $car_data = $this->db->get_where('tbl_car_type',array('id'=>$input['car_type']))->row_array();\n\n /*print_r($car_data); die;*/\n\n /*Array\n (\n [id] => 1\n [car_type] => Economy\n [car_image] => economy.png\n [base_fare] => 10.00\n [rate_per_km] => 7.00\n [rate_per_min] => 1.00\n [cancellation_amount] => 25.00\n [is_active] => 1\n [insertdate] => 2016-03-23 11:10:02\n )*/\n\n //Calculate estimate time to reach the pickup point--------------------\n $etadata = file_get_contents(\"http://maps.googleapis.com/maps/api/distancematrix/json?origins=\".$input['pickup_latitude'].','.$input['pickup_longitude'].\"&destinations=\".$input['dropoff_latitude'].','.$input['dropoff_longitude'].\"&language=en-EN&sensor=false\");\n \n $etadata = json_decode($etadata); \n \n $time = 0; \n $distance = 0;\n \n foreach($etadata->rows[0]->elements as $road) {\n if($road->status == 'OK'){\n $time = $road->duration->value;\n $distance = $road->distance->value;\n $distance = ($distance/1000);\n /*Convert km to miles*/\n /*$distance *= 0.62137;*/\n $distance = round($distance,2);\n $time = ceil($time/60);\n }\n else{\n $message = ['status' => FALSE,'message' => \"Please enter valid location\"];\n $this->response($message, REST_Controller::HTTP_BAD_REQUEST); // BAD_REQUEST (400) \n }\n }\n\n $data = $input;\n $data['distance'] = (string)$distance;\n $data['time'] = (string)$time;\n $data['base_fare'] = (string)$car_data['base_fare'];\n $amount = $car_data['base_fare'] + ($car_data['rate_per_km'] * $distance) + ($car_data['rate_per_min'] * $time);\n $data['estimate_fare'] = (string)($amount);\n $data['splitfare_contact'] = $splitfare_contact;\n \n $message = ['status' => TRUE,'message' => $this->lang->line('fare_estimation_success'),'data'=>$data];\n $this->set_response($message, REST_Controller::HTTP_OK); // OK (200)\n }\n }", "public function postSetOrder()\n\t{\n if(!$this->checkAuthentication())\n {\n return json_encode(array());\n }\n\n $data = Input::get();\n $building = new Building;\n\n if(isset($data['sort_order']) && isset($data['order_field']) && $data['sort_order'] != '' && $data['order_field'] != ''){\n\t\t\t$building = $building->orderBy($data['order_field'],$data['sort_order']);\n\t\t} else {\n\t\t $building = $building->orderBy('i_order','ASC');\n\t\t}\n\n if(isset($data['search_fields']['v_name']) && $data['search_fields']['v_name']!=\"\"){\n\t\t\t$building = $building->where('buildings.v_name', 'LIKE',\"%\".$data['search_fields']['v_name'].\"%\");\n\t\t}\n\n\t\tif(isset($data['search_fields']['v_city_name']) && $data['search_fields']['v_city_name']!=\"\"){\n\t\t\t$building = $building->where('i_city_id',$data['search_fields']['v_city_name']);\n\t\t}\n if(isset($data['search_fields']['i_floor_number']) && $data['search_fields']['i_floor_number']!=\"\"){\n\t\t\t$building = $building->where('i_floor_number', '=',$data['search_fields']['i_floor_number']);\n\t\t}\n if(isset($data['search_fields']['e_source']) && $data['search_fields']['e_source']!=\"\"){\n\t\t\t$building = $building->where('e_source', $data['search_fields']['e_source']);\n\t\t}\n if(isset($data['search_fields']['i_order']) && $data['search_fields']['i_order']!=\"\"){\n\t\t\t$building = $building->where('i_order', $data['search_fields']['i_order']);\n\t\t}\n\n $building->join('cities', 'cities.id', '=', 'buildings.i_city_id');\n $building->select('cities.id as cities_id','cities.v_name as v_city_name','buildings.*');\n\n $building = $building->get();\n $arrCms = $building->toArray();\n $results = [\n \t 'items' => $arrCms\n \t];\n return json_encode($results);\n\t}", "function process_products_selections()\n\t{\n\t\t$product_ids = $this->input->post('products_lookup_ids');\n\t\t$products = $this->products_model->get_product_selections($product_ids)->result();\n\t\techo json_encode($products);\n\t}", "public function offers() {\n $data = date('Y-m-d');\n $limit = 10;\n $update = true;\n\n // total de ofertas\n $params = array(\n 'Offer' => array(\n 'conditions' => array(\n 'company_id' => $this->Session->read('CompanyLoggedIn.Company.id'),\n 'status ' => '<> DELETE'\n ),\n 'order' => array(\n 'Offer.id' => 'DESC'\n )\n )\n );\n $contador = $this->Utility->urlRequestToGetData('offers', 'count', $params);\n\n $arrayBusca = array(\n 'company_id' => $this->Session->read('CompanyLoggedIn.Company.id'),\n 'status <>' => 'DELETE'\n );\n // verifica se esta sendo feita uma busca\n if (!empty($this->request->data ['busca'])) {\n if ($this->request->data ['calendario-inicio'] != 'Data Inicial' && $this->request->data ['calendario-fim'] != 'Data Final') {\n $dataInicio = $this->Utility->formataData($this->request->data ['calendario-inicio']);\n $dataFinal = $this->Utility->formataData($this->request->data ['calendario-fim']);\n $arrayData = array(\n 'Offer.begins_at >= ' => $dataInicio,\n 'Offer.ends_at <= ' => $dataFinal\n );\n $arrayBusca = array_merge($arrayData, $arrayBusca);\n }\n if ($this->request->data ['titulo'] != 'Titulo') {\n $arrayProduto = array(\n 'Offer.title LIKE' => \"%{$this->request->data['titulo']}%\"\n );\n $arrayBusca = array_merge($arrayProduto, $arrayBusca);\n }\n }\n\n // verifica se esta fazendo uma requisicao ajax\n if (!empty($this->request->data ['limit'])) {\n $render = true;\n $this->layout = '';\n $limit = $_POST ['limit'] + 3;\n if ($limit > $contador) {\n $limit = $contador;\n $update = false;\n }\n }\n\n $params = array(\n 'Offer' => array(\n 'conditions' => $arrayBusca,\n 'order' => array(\n 'Offer.id' => 'DESC'\n ),\n 'limit' => $limit\n )\n );\n $company = $this->Utility->urlRequestToGetData('offers', 'all', $params);\n\n $this->set(compact('company', 'limit', 'contador', 'update'));\n if (!empty($render))\n $this->render('Elements/ajax_ofertas');\n }", "public function index()\n {\n // Alle Hersteller als json-String zurückgeben\n return response()->json(Manufacturer::all());\n }", "public function store(Request $request)\n\t{\n\t\t$suppliersRequest = json_decode($request->input('suppliers'));\n\n\t\tforeach ($suppliersRequest as $key => $supplierRequest) {\n\t\t\ttry {\n\n\t\t\t\t$supplierObject = new Supplier();\n\n\t\t\t\t$supplierObject->company_name \t\t= $supplierRequest->company_name;\n\t\t\t\t$supplierObject->contact_name \t\t= $supplierRequest->contact_name;\n\t\t\t\t$supplierObject->contact_title \t\t= $supplierRequest->contact_title;\n\t\t\t\t$supplierObject->gender \t\t\t\t= \t$supplierRequest->gender;\n\t\t\t\t$supplierObject->supplier_type_id\t\t= $supplierRequest->supplier_type_id;\n\t\t\t\t$supplierObject->phone \t\t= $supplierRequest->phone;\n\t\t\t\t$supplierObject->email \t\t= $supplierRequest->email;\n\t\t\t\t$supplierObject->country_id \t\t= $supplierRequest->country_id;\n\t\t\t\t$supplierObject->city_id \t\t= $supplierRequest->city_id;\n\t\t\t\t$supplierObject->region \t\t= $supplierRequest->region;\n\t\t\t\t$supplierObject->postal_code \t\t= $supplierRequest->postal_code;\n\t\t\t\t$supplierObject->address \t\t= $supplierRequest->address;\n\t\t\t\t$supplierObject->detail \t\t= $supplierRequest->detail;\n\t\t\t\t$supplierObject->branch_id \t\t= $supplierRequest->branch_id;\n\t\t\t\t$supplierObject->status \t\t= $supplierRequest->status;\n\t\t\t\t$supplierObject->created_by \t\t= auth::id();\n\t\t\t\t$supplierObject->updated_by \t\t= auth::id();\n\n\t\t\t\t$supplierObject->save();\n\n\t\t\t\t$suppliersResponse[] = $supplierObject;\n\n\t\t\t} catch (Exception $e) {\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\treturn Response()->Json($suppliersResponse);\n\t}", "public function fpolist() {\n $fpo_list = $this->Fpo_Model->fpoList();\n $response = array(\"status\" => 1, \"fpo_list\" => $fpo_list);\n echo json_encode($response);\n\t}", "public function check_list_for_sale_post()\n {\n $response = new StdClass();\n $result = array();\n $datacat = $this->Deliveryboy->check_list_data();\n if(!empty($datacat))\n {\n foreach ($datacat as $row)\n {\n\n $data['id'] = $row['id'];\n $data['question'] = $row['question'];\n $data['status'] ='1';\n array_push($result,$data);\n } \n $response->data = $result;\n }\n else\n {\n $data['status'] ='0';\n array_push($result , $data);\n }\n $response->data = $result;\n echo json_output($response);\n }", "function index() {\n\t\tif(!$this->params->isEmpty() && ($d = $this->form->validate($this->params))){\n\t\t\tif (is_null($delivery_service = DeliveryService::GetInstanceById($d[\"delivery_service_id\"]))) {\n\t\t\t\t$this->form->set_error(\"delivery_service_id\",_(\"Object not found\"));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$this->api_data = array();\n\t\t\tforeach($delivery_service->findBranches($d[\"q\"], array(\"countries\" => $this->current_region->getDeliveryCountries())) as $_office) {\n\t\t\t\t$obj_dump = $_office->toArray();\n\t\t\t\t# label pro naseptavadlo, ktery chceme vzdy ve stejnem formatu a udaje chceme mit v urcitem poradi\n\t\t\t\t$ar = [\n\t\t\t\t\t\"value\" => $obj_dump[\"external_branch_id\"],\n\t\t\t\t\t\"label\" => sprintf(\"%s, %s - %s\", $obj_dump[\"zip\"], $obj_dump[\"full_address\"], $obj_dump[\"place\"]),\n\t\t\t\t\t\"opening_hours\" => $obj_dump[\"opening_hours\"],\n\t\t\t\t];\n\t\t\t\t$this->api_data[] = $ar;\n\t\t\t}\n\t\t}\n\t}", "public function index()\n {\n $this->hotel = (new Hotel)->getHotel();\n $recepies = optional($this->hotel)->recepies;\n\n return response()->json([\n 'data' => $recepies\n ]);\n }", "public function reloadFormList(){\r\n\t\t$this->load->model('gs_admission/ajax_base_model', 'AB');\r\n\t \t$user_id = $this->session->userdata(\"user_id\");\r\n\t\t$myttl = $this->AB->getUserUploadedForm($user_id);\r\n\t\t$ttl = $this->AB->getUserUploadedForm($user_id=NULL);\r\n\t\t$myttl = $myttl[\"mytotal\"];\r\n\t\t$ttl = $ttl[\"totalForm\"];\r\n\t\t$data = array(\"ml\"=>$myttl, \"gt\"=>$ttl );\r\n\t\techo json_encode($data);\r\n\t}", "function fatherly_fcr_handle_ajax()\n{\n include_once(__DIR__ . '/inc/classes/ContentRecirculation.php');\n $FCRInstance = FCR\\ContentRecirculation::init();\n switch ($_REQUEST['operation']) {\n case 'add':\n $results = $FCRInstance->addNewPostToRecirculation($_REQUEST['post_id']);\n break;\n case 'delete':\n $results = $FCRInstance->deletePostFromRecirculation($_REQUEST['post_id']);\n break;\n case 'reset':\n $results = $FCRInstance->resetPostProcessedStatus($_REQUEST['post_id']);\n break;\n }\n echo wp_json_encode($results);\n wp_die();\n}", "public function __invoke()\n {\n return new JsonResponse([\n 'data' => (new Contact)->getFillable(),\n ]);\n }", "public function update(Request $request)\n\t{\n\t\t$suppliersRequest = json_decode($request->input('suppliers'));\n\n\t\tforeach ($suppliersRequest as $key => $supplierRequest) {\n\t\t\ttry {\n\n\t\t\t\t$supplierObject = Supplier::findOrFail($supplierRequest->id);\n\n\t\t\t\t$supplierObject->company_name \t\t= $supplierRequest->company_name;\n\t\t\t\t$supplierObject->contact_name \t\t= $supplierRequest->contact_name;\n\t\t\t\t$supplierObject->contact_title \t\t= $supplierRequest->contact_title;\n\t\t\t\t$supplierObject->gender \t\t\t\t= \t$supplierRequest->gender;\n\t\t\t\t$supplierObject->supplier_type_id\t\t= $supplierRequest->supplier_type_id;\n\t\t\t\t$supplierObject->phone \t\t= $supplierRequest->phone;\n\t\t\t\t$supplierObject->email \t\t= $supplierRequest->email;\n\t\t\t\t$supplierObject->country_id \t\t= $supplierRequest->country_id;\n\t\t\t\t$supplierObject->city_id \t\t= $supplierRequest->city_id;\n\t\t\t\t$supplierObject->region \t\t= $supplierRequest->region;\n\t\t\t\t$supplierObject->postal_code \t\t= $supplierRequest->postal_code;\n\t\t\t\t$supplierObject->address \t\t= $supplierRequest->address;\n\t\t\t\t$supplierObject->detail \t\t= $supplierRequest->detail;\n\t\t\t\t$supplierObject->branch_id \t\t= $supplierRequest->branch_id;\n\t\t\t\t$supplierObject->status \t\t= $supplierRequest->status;\n\t\t\t\t$supplierObject->updated_by \t\t= auth::id();\n\n\t\t\t\t$supplierObject->save();\n\n\t\t\t\t$suppliersResponse[] = $supplierObject;\n\t\t\t\t\t\n\t\t\t} catch (Exception $e) {\n\t\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\treturn Response()->Json($suppliersResponse);\n\t}", "function ajax_for_maplist()\n {\n global $post;\n \n// Query Arguments\n $args = array (\n 'post_type' => HADES_CPT,\n 'nopaging' => true,\n 'order' => 'DESC',\n 'category_name' => implode( \",\", $_POST['category_name'] ),\n );\n echo hades_maplist_get_json_offres($args);\n die();\n }", "public function getAllCompany(Request $request)\n {\n $company = Auth::user()->company;\n //get all ppes of the available stocks\n $stocks = Stock::where('company_ID', $company['company_ID'])->get()->all();\n if (count($stocks) == 0) {\n return response()->json(\"\", 201);\n }\n $ppes = array();\n foreach($stocks as $stock){\n $ppesstock = Ppe::where('stock_ID', $stock['stock_ID'])->get()->all();\n foreach($ppesstock as $ppe){\n $ppes[] = $ppe;\n }\n }\n //get all ppes of the employees\n $employees = $company->employees->toArray();\n if (count($employees) != 0) {\n foreach($employees as $employee){\n $ppesemployee = Ppe::where('employee_ID', $employee['employee_ID'])->get()->all();\n foreach($ppesemployee as $ppe){\n $ppe['employee_ID'] = $employee['employee_ID'];\n $ppes[] = $ppe;\n }\n }\n }\n //return response()->json($ppes, 201);\n if (count($ppes) == 0) {\n return response()->json($ppes, 201);\n }\n usort($ppes, function ($a, $b) {\n return $a > $b;\n });\n \n foreach ($ppes as &$ppe) {\n $propertieKeys = property_ppe::where('sn', $ppe['sn'])->get()->values();\n $properties = array();\n if (count($propertieKeys) != 0) {\n foreach ($propertieKeys as $key) {\n $properties['properties'][] = Property::findOrFail($key['property_ID']);\n }\n } else {\n $properties['properties'] = array();\n }\n\n $sizerKeys = sizerange_ppe::where('sn', $ppe['sn'])->get()->values();\n $sizeranges = array();\n if (count($sizerKeys) != 0) {\n foreach ($sizerKeys as $key) {\n $range = array();\n $range = Size_Range::findOrFail($key['sizer_ID']);\n\n $range['sizes'] = Size::where('sizer_ID', $key['sizer_ID'])->get()->values();\n $sizeranges[] = $range;\n }\n }\n\n $ppe['properties'] = $properties['properties'];\n $ppe['size_ranges'] = $sizeranges;\n $ppe['template'] = $ppe->pe;\n }\n\n $ppeRes['ppes'] = $ppes;\n return response($ppeRes, 201);\n }", "public function remove_officer()\n {\n if ($this->mgovdb->deleteData('Dept_Officers', get_post('o'))) {\n $return_data = array(\n 'status' => true,\n 'message' => 'Officer has been removed.'\n );\n } else {\n $return_data = array(\n 'status' => false,\n 'message' => 'Removing officer failed.'\n );\n }\n\n response_json($return_data);\n }", "public function index(): JsonResponse\n {\n return ContactResource::collection(\n $this->phoneBookService->contactsList()\n )\n ->response();\n }", "public function json()\n\t{\n\t\t$order_data = array();\n\t\t/*\n\t\t\t\"rows\" => array(\n\t\t\t\t\"id\",\n\t\t\t\t\"item\" => array(\n\t\t\t\t\t\"id\", \"name\"\n\t\t\t\t),\n\t\t\t\t\"amount\", \"price\",\n\t\t\t),\n\t\t\t\"items\" => array(\"id\", \"name\", \"amount\", \"price\", \"total\"),\n\t\t\t\t\"purveyances\" => array(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t\"company\" => array(\"id\", \"name\", \"address\"),\n\t\t\t\t\t\t\"company_section\" => array(\"id\", \"name\", \"address\"),\n\t\t\t\t\t\t\"weekdays\", \"time_from\", \"time_to\", \"days\"\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t),\n\t\t\t\"purchaser\" => array(\n\t\t\t\t\"id\", \"name\",\n\t\t\t\t\"customers\" => array(\n\t\t\t\t\t\"id\", \"name\"\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\t\t*/\n\t\t\n\t\t$purchaser = obj($this->prop(\"purchaser\"));\n\t\tif (true || !$purchaser->is_saved())\n\t\t{\n\t\t\t// FIXME: Only temporarily!\n\t\t\t$__purchaser_id = users::is_logged_in() ? user::get_current_person() : null;\n\t\t\t$purchaser = obj($__purchaser_id, array(), crm_person_obj::CLID);\n\t\t}\n\t\t$order_data[\"purchaser\"] = array(\n\t\t\t\"id\" => $purchaser->id(),\n\t\t\t\"name\" => $purchaser->name(),\n\t\t\t\"customers\" => array(),\n\t\t);\n\t\tif ($purchaser->is_a(crm_person_obj::CLID) and $purchaser->is_saved())\n\t\t{\n\t\t\t$customers = $purchaser->company()->get_customers_by_customer_data_objs(array(crm_person_obj::CLID));\n\t\t\t$order_data[\"purchaser\"][\"company\"] = $purchaser->company()->id();\n\t\t\t\n\t\t}\n\t\telseif ($purchaser->is_a(crm_company_obj::CLID) and $purchaser->is_saved())\n\t\t{\n\t\t\t$customers = $purchaser->get_customers_by_customer_data_objs(array(crm_person_obj::CLID));\n\t\t}\n\t\t$customer_count = isset($customers) ? $customers->count() : 0;\n\t\tif ($customer_count > 0)\n\t\t{\n\t\t\tforeach ($customers->names() as $customer_id => $customer_name)\n\t\t\t{\n\t\t\t\t$order_data[\"purchaser\"][\"customers\"][$customer_id] = array(\n\t\t\t\t\t\"id\" => $customer_id,\n\t\t\t\t\t\"name\" => $customer_name,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t$order_data[\"rows\"] = array();\n\t\t$order_data[\"items\"] = array();\n\t\tforeach ($this->get_rows() as $row)\n\t\t{\n\t\t\t$item_data = array(\n\t\t\t\t\"id\" => $row->prop(\"prod\"),\n\t\t\t\t\"name\" => $row->prop(\"prod_name\"),\n\t\t\t);\n\t\t\t$order_data[\"rows\"][$row->id()] = array(\n\t\t\t\t\"id\" => $row->id(),\n\t\t\t\t\"item\" => $item_data,\n\t\t\t\t\"amount\" => $row->prop(\"items\"),\n\t\t\t\t\"price\" => $row->prop(\"price\"),\n\t\t\t\t\"buyer_rep\" => $row->prop(\"buyer_rep\"),\n\t\t\t\t\"purveyance_company_section\" => $row->prop(\"buyer_rep\"),\n\t\t\t\t\"planned_date\" => $row->prop(\"planned_date\"),\n\t\t\t\t\"planned_time\" => $row->prop(\"planned_time\"),\n\t\t\t);\n\n\t\t\tif (!isset($order_data[\"items\"][$item_data[\"id\"]]))\n\t\t\t{\n\t\t\t\t$item = obj($item_data[\"id\"]);\n\t\t\t\t$purveyance_data = array();\n\t\t\t\t$purveyances = $item->get_purveyances();\n\t\t\t\tif ($purveyances->count() > 0)\n\t\t\t\t{\n\t\t\t\t\t$purveyance = $purveyances->begin();\n\t\t\t\t\tdo\n\t\t\t\t\t{\n\t\t\t\t\t\t$purveyance_data[$purveyance->id()] = array(\"company\" => array());\n\t\t\t\t\t\tif (is_oid($company_id = $purveyance->prop(\"company\")))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$company = obj($company_id, array(), crm_company_obj::CLID);\n\t\t\t\t\t\t\t$purveyance_data[$purveyance->id()][\"company\"] = array(\n\t\t\t\t\t\t\t\t\"id\" => $company->id(),\n\t\t\t\t\t\t\t\t\"name\" => $company->get_title(),\n\t\t\t\t\t\t\t\t\"address\" => $company->get_address_string(),\n\t\t\t\t\t\t\t\t\"section\" => array(),\n\t\t\t\t\t\t\t\t\"sections\" => array(),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (is_oid($section_id = $purveyance->prop(\"company_section\")))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$section = obj($section_id, array(), crm_section_obj::CLID);\n\t\t\t\t\t\t\t\t$purveyance_data[$purveyance->id()][\"company\"][\"section\"] = array(\n\t\t\t\t\t\t\t\t\t\"id\" => $section->id(),\n\t\t\t\t\t\t\t\t\t\"name\" => $section->name(),\n//\t\t\t\t\t\t\t\t\t\"address\" => $section->get_address_string(),\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tforeach ($company->get_sections()->names() as $section_id => $section_name)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$purveyance_data[$purveyance->id()][\"company\"][\"sections\"][] = array(\n\t\t\t\t\t\t\t\t\t\"id\" => $section_id,\n\t\t\t\t\t\t\t\t\t\"name\" => $section_name,\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$purveyance_data[$purveyance->id()] += array(\n\t\t\t\t\t\t\t\"weekdays\" => $purveyance->prop(\"weekdays\"),\n\t\t\t\t\t\t\t\"time_from\" => $purveyance->prop(\"time_from\"),\n\t\t\t\t\t\t\t\"time_to\" => $purveyance->prop(\"time_to\"),\n\t\t\t\t\t\t\t\"days\" => $purveyance->prop(\"days\")\n\t\t\t\t\t\t);\n\t\t\t\t\t} while ($purveyance = $purveyances->next());\n\t\t\t\t}\n\t\t\t\t$order_data[\"items\"][$item_data[\"id\"]] = $item_data + array(\n\t\t\t\t\t\"price\" => $row->prop(\"price\"),\n\t\t\t\t\t\"amount\" => $row->prop(\"items\"),\n\t\t\t\t\t\"total\" => $row->prop(\"price\") * $row->prop(\"items\"),\n\t\t\t\t\t\"purveyances\" => $purveyance_data,\n\t\t\t\t);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$order_data[\"items\"][$item_data[\"id\"]][\"amount\"] += $row->prop(\"items\");\n\t\t\t\t$order_data[\"items\"][$item_data[\"id\"]][\"total\"] += $row->prop(\"price\") * $row->prop(\"items\");\n\t\t\t}\n\t\t}\n\n\t\t$json = new json();\n\t\treturn $json->encode($order_data, aw_global_get(\"charset\"));\n\t}", "public function index() \n {\n $supplier_products = SupplierProducts::all(['id', 'supply_id', 'product_id', 'created_at']); \n return response()->json($supplier_products);\n }", "public function process_bundle_rates() {\n if ( isset( $_POST['remove_configurations'] ) ) {\n if ( isset( $_POST['remove'] ) ) {\n $bundle_rates = self::get_bundle_rates();\n foreach ( $_POST['remove'] as $key ) {\n unset( $bundle_rates[$key] );\n }\n \n update_option('woocommerce_enda_bundle_rates', array_values( $bundle_rates ));\n } \n }\n elseif ( isset( $_POST['woocommerce_enda_bundle_rates'] ) ) {\n update_option('woocommerce_enda_bundle_rates', array_values( $_POST['woocommerce_enda_bundle_rates'] ) ); \n } \n\n $this->bundle_rates = self::get_bundle_rates();\n }", "public function index()\n {\n $Debtors_listings = Debtors_listings::all();\n return response()->json($Debtors_listings);\n }", "public function setData() \n {\n $serverNames = [];\n foreach($this->_jsonRequestedArr as $k=>$obj) {\n $serverNames[] = $obj->s_system;\n }\n $this->_jsonResponseArr[\"server_list\"] = $serverNames;\n }", "public function ingredients_used_ListJson() {\n $limit = $this->input->get('length');\n $start = $this->input->get('start');\n\n $queryCount = $this->Product_preparation_model->product_used_prepListCount();\n\n\n $query = $this->Product_preparation_model->product_used_prepList();\n\n $draw = $this->input->get('draw');\n\n $data = [];\n $data['draw'] = $draw;\n $data['recordsTotal'] = $queryCount;\n $data['recordsFiltered'] = $queryCount;\n\n if ($query->num_rows() > 0) {\n foreach ($query->result() as $r) {\n\n\n\n //Action Button\n $button = '';\n $button .= '<a class=\"btn btn-primary editBtn\" href=\"' . base_url('Product_preparation/view_used_ingredients/' . $r->product) . '\" data-toggle=\"tooltip\" title=\"View\">\n\t\t\t\t\t\t<i class=\"fa fa-eye\"></i> </a>';\n\n\t\t\t\t\t\t\n\t\t\t$get_prod_name = $this->db->get_where('product_preparation', ['id'=>$r->product]);\n\t\t\tforeach($get_prod_name->result() as $p);\n\t\t\t$product_name = $p->product_name;\n\t\t\t\n\t\t\t$get_category_name = $this->db->get_where('smb_category', ['id'=>$r->category]);\n\t\t\tforeach($get_category_name->result() as $c);\n\t\t\t$category = $c->category_name;\n \n $get_declared_name = $this->db->get_where('users', ['id'=>$r->created_by]);\n\t\t\tforeach($get_declared_name->result() as $p);\n\t\t\t$declared_name = $p->first_name.' '.$p->last_name;\t\t\t \n\n\t\t\t\n\t\t\n\t\t\n $data['data'][] = array(\n $button,\n \n \n $product_name,\n $category, \n $r->used_ingredeint,\n $r->used_weight,\n $r->total_output,\n $declared_name,\n date('d-m-Y', $r->created_at)\n \n );\n }\n } else {\n $data['data'][] = array(\n 'You have no Transaction list', '', '', '', ''\n );\n }\n echo json_encode($data);\n }", "public function getFrontDesk(){\n\t\tif($this->input->is_ajax_request()){\n\t\t\t$total = 0;\n\t\t\t$sql = $this->getFilters($_POST, 'r.fkStatusId');\n\t\t\t$units = $this->frontDesk_db->getAllUnits();\n\t\t\t$data = $this->frontDesk_db->getFrontDesk($sql);\n\t\t\t//echo json_encode($data);\n\t\t\t$calendary = $this->frontDesk_db->getCalendary($sql);\n\t\t\t//$color = array(\"cellOwners\", \"cellOwners\", \"cellRentals\", \"cellOwnersLoan\", \"cellNoChange\", \"cellOwners\", \"cellOwners\", \"cellOwners\",\"cellOwners\",\"cellOwners\",\"cellOwners\",\"cellOwners\",\"cellOwners\");\n\t\t\t//$color = array(\"cellOwners\", \"cellOwners\", \"cellRentals\", \"cellOwnersLoan\", \"cellNoChange\", \"cellOwners\", \"cellOwners\", \"cellOwners\",\"cellOwners\",\"cellOwners\",\"cellOwners\",\"cellOwners\",\"cellOwners\");\n\t\t\t$color = array(\"cellContractOwner\", \"cellContractOwner\", \"cellTransient\", \"cellExchanger\", \"cellComplimentary\", \"cellCompanyAgreements\", \"cellInternalExchange\", \"cellBonusWeek\", \"cellOwnerExpedia\");\n\t\t\t$res = array();\n\t\t\t$lastResId = 0;\n\t\t\t$p = 0;\n\t\t\t$p2 = 0;\n\t\t\tforeach($data as $item){\n\t\t\t\tif($lastResId != $item->fkResId){\n\t\t\t\t\t$p = count($res);\n\t\t\t\t\t$exist = false;\n\t\t\t\t\tforeach($res as $key => $item2){\n\t\t\t\t\t\tif($item2['unit'] == $item->UnitCode && $item2['type'] == $item->type){\n\t\t\t\t\t\t\t$p = $key;\n\t\t\t\t\t\t\t$exist = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(!$exist){\n\t\t\t\t\t\t$res[$p]['resId'] = $item->pkResId;\n\t\t\t\t\t\t$res[$p]['type'] = $item->type;\n\t\t\t\t\t\t$res[$p]['unit'] = $item->UnitCode;\n\t\t\t\t\t\t$res[$p]['status'] = $item->HKStatusDesc;\n\t\t\t\t\t\t$res[$p]['isUnit'] = $item->isUnit;\n\t\t\t\t\t\t//$res[$p]['view'] = $item->ViewCode;\n\t\t\t\t\t\t//$res[$p]['viewDesc'] = $item->ViewDesc;\n\t\t\t\t\t}\n\t\t\t\t\tif (isset($res[$p]['values'])){\n\t\t\t\t\t\t$p2 = count($res[$p]['values']);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$p2 = 0;\n\t\t\t\t\t}\n\t\t\t\t\t$color = array(\"cellContractOwner\", \"cellContractOwner\", \"cellTransient\", \"cellExchanger\", \"cellComplimentary\", \"cellCompanyAgreements\", \"cellInternalExchange\", \"cellBonusWeek\", \"cellOwnerExpedia\");\n\t\t\t\t\t$res[$p]['values'][$p2]['from'] = $item->pkCalendarId;\n\t\t\t\t\t$res[$p]['values'][$p2]['to'] = $item->pkCalendarId;\n\t\t\t\t\t$res[$p]['values'][$p2]['people'] = $item->Name . \" \" . $item->LName . \" \" . $item->LName2;\n\t\t\t\t\t$res[$p]['values'][$p2]['occType'] = $color[intval($item->fkOccTypeGroupId)];\n\t\t\t\t\t$res[$p]['values'][$p2]['ResConf'] = $item->ResConf;\n\t\t\t\t\t$res[$p]['values'][$p2]['dateFrom'] = $item->DateIni;\n\t\t\t\t\t$res[$p]['values'][$p2]['dateTo'] = $item->DateEnd;\n\t\t\t\t\t$res[$p]['values'][$p2]['ResId'] = $item->pkResId;\n\t\t\t\t\t//$res[$p]['values'][$p2]['isUnit'] = $item->isUnit;\n\t\t\t\t}\n\t\t\t\t$res[$p]['values'][$p2]['to'] = $item->pkCalendarId;\n\t\t\t\t\n\t\t\t\t$lastResId = $item->fkResId;\n\t\t\t}\n\t\t\techo json_encode(array('items' => $res, 'dates' => $calendary, 'units' => $units ));\n\t\t}\n\t}", "protected function afterFind()\n \t{\n \t\t$this->jsonArray_extra = json_decode($this->json_extra);\n \t\t$this->jsonArray_payload = json_decode($this->json_payload);\n\n \t\tparent::afterFind();\n \t}", "public function refreshCombo()\n {\n try\n {\n $entityManager = $this->getDoctrine()->getManager();\n $documentRepository = $entityManager->getRepository('AppBundle:Document');\n $docArray = $documentRepository->findAll();\n\n $docNameArray = [];\n\n foreach($docArray as $doc)\n {\n $docNameArray[] = $doc->getName();\n }\n\n return new JsonResponse($docNameArray);\n }\n catch(Exception $e)\n {\n return new JsonResponse($e->getMessage());\n }\n }", "protected function addCarrierFieldConfig()\n {\n // Carrier id form field (hidden for existing method or select for the new method)\n $method = $this->getMethod();\n if ($method->getData('entity_id')) {\n $carrierFieldConfig = [\n 'label' => __('Carrier'),\n 'componentType' => Field::NAME,\n 'formElement' => Hidden::NAME,\n 'dataScope' => static::FIELD_CARRIER_ID_NAME,\n 'dataType' => Number::NAME,\n 'sortOrder' => 0,\n ];\n } elseif ($this->request->getParam('carrier_id')) {\n $carrierFieldConfig = [\n 'label' => __('Carrier'),\n 'componentType' => Field::NAME,\n 'formElement' => Hidden::NAME,\n 'dataScope' => static::FIELD_CARRIER_ID_NAME,\n 'dataType' => Number::NAME,\n 'sortOrder' => 0,\n 'value' => $this->request->getParam('carrier_id')\n ];\n } else {\n $carrierFieldConfig = [\n 'label' => __('Carrier'),\n 'componentType' => Field::NAME,\n 'formElement' => Select::NAME,\n 'dataScope' => static::FIELD_CARRIER_ID_NAME,\n 'dataType' => Text::NAME,\n 'sortOrder' => 0,\n 'options' => $this->getCarriers(),\n 'disableLabel' => true,\n 'multiple' => false,\n 'validation' => [\n 'required-entry' => true,\n ],\n ];\n }\n\n $result[static::GENERAL_FIELDSET_NAME]['children'][static::FIELD_CARRIER_ID_NAME] = [\n 'arguments' => [\n 'data' => [\n 'config' => $carrierFieldConfig\n ],\n ],\n ];\n\n // The \"back_to\" hidden input, if need to redirect admin back to the carrier edit form\n if ($this->request->getParam(MethodController::BACK_TO_PARAM)) {\n $result[static::GENERAL_FIELDSET_NAME]['children'][MethodController::BACK_TO_PARAM] = [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'label' => '',\n 'componentType' => Field::NAME,\n 'formElement' => Hidden::NAME,\n 'dataScope' => MethodController::BACK_TO_PARAM,\n 'dataType' => Number::NAME,\n 'sortOrder' => 0,\n 'value' => $this->request->getParam(MethodController::BACK_TO_PARAM)\n ]\n ],\n ],\n ];\n }\n\n $this->meta = array_replace_recursive(\n $this->meta,\n $result\n );\n }", "public function product_application_post()\n {\n $final_array = [];\n $language_code = $this->language_code;\n\n $application_data = $this->Application->fetch();\n\n foreach ($application_data as $application) {\n $response = get_sg_data(\"{$application['language_code']}/applications/{$application['application_id']}/products\");\n $response = json_decode($response, true);\n $language = $application['language_code'];\n \n $response = array_map(\n function ($data) use ($application) {\n $product_data = $this->UtilModel->selectQuery(\n \"id\",\n \"products\",\n [\"single_row\" => true, \"where\" => ['product_id' => $data['id']]]\n );\n $data['application_id'] = $application['id'];\n $data['product_id'] = $product_data['id'];\n $data['primary_application_id'] = $application['application_id'];\n $data['primary_product_id'] = $data['id'];\n $data['created_at'] = $this->datetime;\n $data['updated_at'] = $this->datetime;\n unset($data['id']);\n unset($data['title']);\n unset($data['subTitle']);\n unset($data['image']);\n return $data;\n }, $response\n );\n\n $final_array = array_merge($final_array, $response);\n }\n\n foreach ($final_array as $data) {\n $this->ProductApplication->batch_data[] = $data;\n }\n\n $this->ProductApplication->batch_save();\n\n pd($final_array);\n\n }", "public function store()\n\t\t{\n\t\t\t// récuperation des selections dans le coupon.\n\t\t\t$selections_coupon = Coupon::where('session_id', Session::getId())->get();\n\n\t\t\t// nombre de selections dans le coupon.\n\t\t\t$count = $selections_coupon->count();\n\n\n\t\t\t// verification de présence d'une selection, au moins dans le coupon.\n\t\t\tif ($count <= 0) {\n\t\t\t\treturn Response::json(array(\n\t\t\t\t\t'etat' => 0,\n\t\t\t\t\t'msg' => 'Aucune selection.',\n\t\t\t\t));\n\t\t\t} else {\n\n\t\t\t\t// verifier que le bookmaker soit le meme pour toutes les selections.\n\t\t\t\t$bookmaker_temp = $selections_coupon->first()->bookmaker;\n\n\t\t\t\t$bookmaker = '';\n\t\t\t\t$bookmakers_differents = false;\n\n\t\t\t\tforeach ($selections_coupon as $selection_coupon) {\n\t\t\t\t\t$bookmaker = $selection_coupon->bookmaker;\n\n\t\t\t\t\tif ($bookmaker_temp != $bookmaker) {\n\t\t\t\t\t\t$bookmakers_differents = true; // booléen necessaire pour l'etape suivant.\n\t\t\t\t\t\treturn Response::json(array(\n\t\t\t\t\t\t\t'etat' => 0,\n\t\t\t\t\t\t\t'msg' => 'Le bookmaker doit etre le meme pour toutes les selections.',\n\t\t\t\t\t\t));\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$bookmakers_differents = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (!$bookmakers_differents && (Input::get('followtypeinputdashboard') == 'n')) {\n\n\t\t\t\t\t// vérification si il existe au moins un compte bookmaker correspondant au bookmaker des selections.\n\t\t\t\t\t$comptes = Auth::user()->comptes()->whereHas('bookmaker', function ($query) use ($bookmaker) {\n\t\t\t\t\t\t$query->where('nom', $bookmaker);\n\t\t\t\t\t})->where('deleted_at', NULL)->get();\n\n\t\t\t\t\t$bookmakers_count = $comptes->count();\n\t\t\t\t\tif ($bookmakers_count == 0) {\n\t\t\t\t\t\treturn Response::json(array(\n\t\t\t\t\t\t\t'etat' => 0,\n\t\t\t\t\t\t\t'msg' => 'Ce bookmaker n\\'a pas de compte associé, rendez vous dans la page configuration pour le créer.',\n\t\t\t\t\t\t));\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t//on va chercher le profil 'default' lorsque aucun tipster n'a été specifié dans le formulaire.\n\t\t\t\tif(Input::get('tipstersinputdashboard') == ''){\n\t\t\t\t\t$tipster = Auth::user()->tipsters()->where('name', 'default')->firstOrFail();\n\t\t\t\t}else{\n\t\t\t\t\t$tipster = Auth::user()->tipsters()->where('id', Input::get('tipstersinputdashboard'))->firstOrFail();\n\t\t\t\t}\n\n\t\t\t\t$regles = array(\n\t\t\t\t\t'followtypeinputdashboard' => 'required|in:n,b',\n\t\t\t\t\t'typestakeinputdashboard' => 'required|in:u,f',\n\t\t\t\t\t'accountsinputdashboard' => 'required_if:followtypeinputdashboard,n|exists:bookmaker_user,id,user_id,' . Auth::id(),\n\t\t\t\t\t'stakeunitinputdashboard' => 'required_if:typestakeinputdashboard,u|unites|mise_montant_en_unites<solde:' . Input::get('accountsinputdashboard') . ',' . Input::get('followtypeinputdashboard') . ',' . Input::get('amountperunit'),\n\t\t\t\t\t'amountinputdashboard' => 'required_if:typestakeinputdashboard,f|mise_montant_en_devise<solde:' . Input::get('accountsinputdashboard') . ',' . Input::get('followtypeinputdashboard'),\n\t\t\t\t\t'cote-tipster' => 'european_odd',\n\t\t\t\t\t'total-cote-combine' => 'cote_generale_if_combine:' . $count . '|european_odd',\n\t\t\t\t\t'ticketABCD' => 'required|in:0,1',\n\t\t\t\t\t'ticketLongTerme' => 'required|in:0,1',\n\t\t\t\t\t'serieinputdashboard' => 'required_if:ticketABCD,1',\n\t\t\t\t\t'letterinputdashboard' => 'required_if:ticketABCD,1|in:A,B,C,D',\n\t\t\t\t);\n\t\t\t\t$messages = array(\n\t\t\t\t\t'typestakeinputdashboard.in' => 'ce type de mise n\\'existe pas.',\n\t\t\t\t\t'stakeunitinputdashboard.required_if' => 'Vous devez mettre une mise (en unités).',\n\t\t\t\t\t'amountinputdashboard.required_if' => 'Vous devez mettre une mise (en devise).',\n\t\t\t\t\t'accountsinputdashboard.required_if' => 'Vous devez choisir un compte de bookmaker quand le suivi est de type normal. Si vous n\\'avez pas de compte de bookmaker, veuillez en créer un, dans la page configuration',\n\t\t\t\t\t'accountsinputdashboard.exists' => 'Ce compte bookmaker n\\'existe pas dans votre liste.',\n\t\t\t\t\t'serieinputdashboard.required_if' => 'Un n° ou nom de serie est nécéssaire',\n\t\t\t\t\t'letterinputdashboard.required_if' => 'Une lettre (ABCD) est nécéssaire',\n\t\t\t\t\t'letterinputdashboard.in' => 'la lettre pour l\\'option abcd ne correspond pas',\n\t\t\t\t);\n\n\t\t\t\t$validator = Validator::make(Input::all(), $regles, $messages);\n\t\t\t\t$validator->each('automatic-selection-cote', ['required', 'european_odd']);\n\n\t\t\t\tif ($validator->fails()) {\n\t\t\t\t\t$array = $validator->getMessageBag()->first();\n\t\t\t\t\treturn Response::json(array(\n\t\t\t\t\t\t'etat' => 0,\n\t\t\t\t\t\t'msg' => $array,\n\t\t\t\t\t));\n\t\t\t\t} else {\n\n\t\t\t\t\t$suivi = Input::get('followtypeinputdashboard');\n\t\t\t\t\t$tipster = Auth::user()->tipsters()->where('id', $tipster->id)->firstOrFail();\n\t\t\t\t\t$type_stake = Input::get('typestakeinputdashboard');\n\n\t\t\t\t\t// verification si ce numero de pari n'existe pas deja.\n\t\t\t\t\t$numero_pari = Auth::user()->compteur_pari += 1;\n\t\t\t\t\tAuth::user()->save();\n\n\t\t\t\t\t// mise\n\t\t\t\t\t$mise_unites = $mise_devise = 0;\n\t\t\t\t\tif ($type_stake == 'u') {\n\t\t\t\t\t\t$mise_unites = Input::get('stakeunitinputdashboard');\n\t\t\t\t\t\t$mise_devise = round($mise_unites * $tipster->montant_par_unite, 2);\n\t\t\t\t\t} elseif ($type_stake == 'f') {\n\t\t\t\t\t\t$mise_devise = Input::get('amountinputdashboard');\n\t\t\t\t\t\t$mise_unites = $mise_devise / $tipster->montant_par_unite;\n\t\t\t\t\t}\n\n\t\t\t\t\t$ticketlongterme = Input::get('ticketLongTerme');\n\t\t\t\t\tClockwork::info($ticketlongterme);\n\n\t\t\t\t\t// creation du pari dans le modele PARI.\n\t\t\t\t\t$pari_model = new Pari(array(\n\t\t\t\t\t\t'followtype' => $suivi,\n\t\t\t\t\t\t'type_profil' => $count > 1 ? 'c' : 's',\n\t\t\t\t\t\t'numero_pari' => $numero_pari,\n\t\t\t\t\t\t'mt_par_unite' => $tipster->montant_par_unite,\n\t\t\t\t\t\t'nombre_unites' => $mise_unites,\n\t\t\t\t\t\t'mise_totale' => $mise_devise,\n\t\t\t\t\t\t'pari_long_terme' => $ticketlongterme,\n\t\t\t\t\t\t'pari_abcd' => Input::get('ticketABCD'),\n\t\t\t\t\t\t'nom_abcd' => Input::get('serieinputdashboard'),\n\t\t\t\t\t\t'lettre_abcd' => Input::get('letterinputdashboard'),\n\t\t\t\t\t\t'result' => 0,\n\t\t\t\t\t\t'tipster_id' => $tipster->id,\n\t\t\t\t\t\t'user_id' => Auth::user()->id,\n\t\t\t\t\t\t'bookmaker_user_id' => $suivi == 'n' ? Input::get('accountsinputdashboard') : null\n\t\t\t\t\t));\n\n\t\t\t\t\t$pari_model->save();\n\n\t\t\t\t\t$cotes = 1;\n\t\t\t\t\t$odds_iterator = 0;\n\t\t\t\t\t$odds_array = Input::get('automatic-selection-cote');\n\t\t\t\t\t$count_live = $count_outright = 0;\n\n\t\t\t\t\tClockwork::info($odds_array);\n\n\t\t\t\t\tforeach ($selections_coupon as $selection_coupon) {\n\n\t\t\t\t\t\t// compteur, si superieur a 0 l'en cours pari est live.\n\t\t\t\t\t\t$count_live = $selection_coupon->isLive == null ? $count_live + 0 : $count_live + 1;\n\t\t\t\t\t\t$count_outright = $selection_coupon->isOutright == 0 ? $count_outright + 0 : $count_outright + 1;\n\n\t\t\t\t\t\t$selection = new Selection(array(\n\t\t\t\t\t\t\t'date_match' => new Carbon($selection_coupon->game_time),\n\t\t\t\t\t\t\t'cote' => $odds_array[$odds_iterator],\n\t\t\t\t\t\t\t'pick' => $selection_coupon->pick,\n\t\t\t\t\t\t\t'game_id' => $selection_coupon->game_id,\n\t\t\t\t\t\t\t'game_name' => $selection_coupon->game_name,\n\t\t\t\t\t\t\t'odd_doubleParam' => $selection_coupon->odd_doubleParam,\n\t\t\t\t\t\t\t'odd_doubleParam2' => $selection_coupon->odd_doubleParam2,\n\t\t\t\t\t\t\t'odd_doubleParam3' => $selection_coupon->odd_doubleParam3,\n\t\t\t\t\t\t\t'odd_participantParameterName' => $selection_coupon->odd_participantParameterName,\n\t\t\t\t\t\t\t'odd_participantParameterName2' => $selection_coupon->odd_participantParameterName2,\n\t\t\t\t\t\t\t'odd_participantParameterName3' => $selection_coupon->odd_participantParameterName3,\n\t\t\t\t\t\t\t'odd_groupParam' => $selection_coupon->odd_groupParam,\n\t\t\t\t\t\t\t'isLive' => $selection_coupon->isLive,\n\t\t\t\t\t\t\t'isMatch' => $selection_coupon->isMatch,\n\t\t\t\t\t\t\t'score' => $selection_coupon->score,\n\t\t\t\t\t\t\t'market_id' => $selection_coupon->market_id,\n\t\t\t\t\t\t\t'scope_id' => $selection_coupon->scope_id,\n\t\t\t\t\t\t\t'sport_id' => $selection_coupon->sport_id,\n\t\t\t\t\t\t\t'competition_id' => $selection_coupon->league_id,\n\t\t\t\t\t\t\t'equipe1_id' => is_null($selection_coupon->home_team) ? null : Equipe::where('name', $selection_coupon->home_team)->first()->id,\n\t\t\t\t\t\t\t'equipe2_id' => is_null($selection_coupon->away_team) ? null : Equipe::where('name', $selection_coupon->away_team)->first()->id,\n\t\t\t\t\t\t\t'pari_id' => $pari_model->id,\n\t\t\t\t\t\t));\n\n\t\t\t\t\t\t// si une des selections n'a pas été ajoutée correctement on supprime le pari + toutes ses selections.\n\t\t\t\t\t\tif (!$selection->save()) {\n\t\t\t\t\t\t\t$pari_model->forceDelete();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$cotes *= $odds_array[$odds_iterator];\n\t\t\t\t\t\t$odds_iterator += 1;\n\t\t\t\t\t}\n\n\t\t\t\t\t$pari_model->pari_live = $count_live > 0 ? 1 : 0;\n\n\t\t\t\t\t// mis a jour de la cote general.\n\t\t\t\t\tif ($pari_model->type_profil == 's') {\n\t\t\t\t\t\t$cote = $pari_model->cote = $cotes;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$cote = $pari_model->cote = Input::get('total-cote-combine');\n\t\t\t\t\t}\n\n\t\t\t\t\t//ajouter la cote tipster si elle a été specifiée.\n\t\t\t\t\t$pari_model->cote_tipster = Input::get('cote-tipster') != '' ? Input::get('cote-tipster') : $cote;\n\n\t\t\t\t\tif ( ! $pari_model->save()) {\n\t\t\t\t\t\t$pari_model->forceDelete();\n\t\t\t\t\t}\n\n\t\t\t\t\t// supression des selections dans le coupon apres creation du pari.\n\t\t\t\t\tforeach ($selections_coupon as $selection_coupon) {\n\t\t\t\t\t\t$selection_coupon->delete();\n\t\t\t\t\t}\n\n\n\t\t\t\t\t// deduction du montant dans le bookmaker correspondant uniquement si le suivi est de type normal.\n\t\t\t\t\tif ($suivi == 'n') {\n\n\t\t\t\t\t\t$compte_to_deduct = Auth::user()->comptes()->where('id', Input::get('accountsinputdashboard'))->firstOrFail();\n\t\t\t\t\t\t$compte_to_deduct->bankroll_actuelle -= $mise_devise;\n\n\t\t\t\t\t\tif (!$compte_to_deduct->save()) {\n\n\t\t\t\t\t\t\treturn Response::json(array(\n\t\t\t\t\t\t\t\t'etat' => 0,\n\t\t\t\t\t\t\t\t'msg' => 'La mise n\\'a pas été déduite correctement du solde du bookmaker.',\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\treturn Response::json(array(\n\t\t\t\t\t\t'etat' => 1,\n\t\t\t\t\t\t'msg' => 'Pari ajouté',\n\t\t\t\t\t));\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function postListar()\n {\n if ( Request::ajax() ) {\n $estado = Input::get('estado');\n $r = DB::table('tipo_grupos_personas')\n ->select(\n 'nombre','id'\n )\n ->where('estado', '=', 1)\n ->orderBy('nombre')\n ->get();\n \n return Response::json(array('rst'=>1,'datos'=>$r));\n }\n }", "public function list_rfp() {\n $final['recordsTotal'] = $this->Rfp_model->get_rfp_count();\n $final['redraw'] = 1;\n $final['recordsFiltered'] = $final['recordsTotal'];\n $final['data'] = $this->Rfp_model->get_all_rfp();\n echo json_encode($final);\n }", "public function listOfChoices(): JsonResponse\n {\n\n try {\n\n $data = $this->orderStatusService->listOfChoices();\n\n return $this->sendSimpleJson($data);\n\n } catch (Exception $exception) {\n\n return $this->sendError('Server Error.', $exception);\n }\n }", "public function populateEmployees(){\n $list = $this->employee->get_employees();\n $data = array();\n foreach ($list as $employee) {\n $row = array();\n $row[] = '<td class=\"min-width nowrap\"><input type=\"checkbox\" value=\"'.$employee->employeeID.'\"></td>';\n $row[] = \"#\".$employee->employeeID;\n $row[] = $employee->name;\n $row[] = '<a href=\"mailto:'.$employee->email.'\">'.$employee->email.'</a>';\n $row[] = $employee->mobile;\n $row[] = $employee->employeeCode;\n $row[] = $employee->managerName;\n $row[] = $employee->departmentName;\n $row[] = $employee->companyName;\n $row[] = $employee->designation;\n $row[] = $employee->address;\n $row[] = $employee->panCard;\n $row[] = $employee->aadharCard;\n\t\t\t$row[] ='<td class=\"nowrap\"><p>\n\t\t\t\t\t<span class=\"btn-xs btn fa fa-edit\" onclick=\"updateClick('.$employee->employeeID.');\"></span> \n\t\t\t\t\t<a class=\"btn-secondary btn-xs fa fa-eye\" href=\"/admin/employee/'.$this->encrypt->encode($employee->employeeID).'\"></a>\n\t\t\t\t\t</p></td>';\n\t\t\t\n array_push($data, $row);\n }\n \n $output = array(\n\t\t\t\"draw\" => $_POST['draw'],\n\t\t\t\"recordsTotal\" => $this->employee->count_all(),\n\t\t\t\"recordsFiltered\" => $this->employee->count_filtered(),\n\t\t\t\"data\" => $data,\n\t\t);\n echo json_encode($output);\n }", "public function index()\n {\n $isDeleted = Auth::check() && Auth::user()->isAnAdmin() ? true : false;\n\n $paymentProcessors = $this->paymentProcessorRepository->findItemsWhere([], ['*'], $isDeleted);\n $formattedData = new Collection();\n\n for ($i = 0; $i < count($paymentProcessors); $i++) {\n $paymentProcessorFaucets = $paymentProcessors[$i]->faucets()->where('deleted_at', '=', null);\n $data = [\n 'name' => [\n 'display' => route('payment-processors.show', ['slug' => $paymentProcessors[$i]->slug]),\n 'original' => $paymentProcessors[$i]->name,\n ],\n 'faucets' => [\n 'display' => route('payment-processors.faucets', ['slug' => $paymentProcessors[$i]->slug]),\n 'original' => $paymentProcessors[$i]->name . ' Faucets'\n ],\n 'rotator' => [\n 'display' => route('payment-processors.rotator', ['slug' => $paymentProcessors[$i]->slug]),\n 'original' => $paymentProcessors[$i]->name . ' Rotator'\n ],\n 'no_of_faucets' => count($paymentProcessorFaucets->get()),\n 'min_claimable' => [\n 'display' => number_format($paymentProcessorFaucets->sum('min_payout')) .\n ' Satoshis / ' . number_format($paymentProcessorFaucets->sum('interval_minutes')) . ' minutes',\n 'original' => intval($paymentProcessorFaucets->sum('min_payout'))\n ],\n 'max_claimable' => [\n 'display' => number_format($paymentProcessorFaucets->sum('max_payout')) .\n ' Satoshis / ' . number_format($paymentProcessorFaucets->sum('interval_minutes')) . ' minutes',\n 'original' => intval($paymentProcessorFaucets->sum('max_payout'))\n ]\n ];\n\n if (Auth::check() && Auth::user()->isAnAdmin()) {\n $data['id'] = intval($paymentProcessors[$i]->id);\n $data['actions'] = '';\n $data['actions'] .= PaymentProcessors::htmlEditButton($paymentProcessors[$i]);\n\n\n if ($paymentProcessors[$i]->isDeleted()) {\n $data['actions'] .= PaymentProcessors::deletePermanentlyForm($paymentProcessors[$i]);\n $data['actions'] .= PaymentProcessors::restoreForm($paymentProcessors[$i]);\n }\n\n $data['actions'] .= PaymentProcessors::softDeleteForm($paymentProcessors[$i]);\n }\n $formattedData->push($data);\n }\n\n return Datatables::of($formattedData)->rawColumns(['actions'])->make(true);\n }", "public function foodsaverrefresh()\n\t{\n\t\t$foodsaver = $this->model->listFoodsaver($_GET['bid']);\n\t\t$bezirk = $this->model->getBezirk($_GET['bid']);\n\t\t$html = jsSafe($this->view->foodsaverList($foodsaver,$bezirk),\"'\");\n\n\t\treturn array(\n\t\t\t'status' => 1,\n\t\t\t'script' => '$(\"#foodsaverlist\").replaceWith(\\''.$html.'\\');fsapp.init();'\n\t\t);\n\t}", "public function officeAction() {\n try {\n if ($this->getRequest()->isPost()) {\n\n $post = $this->getRequest()->getPost();\n $storeId = (int)$this->getRequest()->getParam('store_id', 0);\n if ($storeId <= 0) {\n throw new Exception('Store ID must be supplied');\n }\n $url = $this->getUrl('balticode_postoffice/adminhtml_postoffice/office', array('store_id' => $storeId, '_secure' => true));\n $addressId = $post['address_id'];\n $carrierCode = $post['carrier_code'];\n $carrierId = $post['carrier_id'];\n $divId = $post['div_id'];\n $groupId = isset($post['group_id']) ? ((int) $post['group_id']) : 0;\n $placeId = isset($post['place_id']) ? ((int) $post['place_id']) : 0;\n $shippingModel = Mage::getModel('shipping/shipping')->getCarrierByCode($carrierCode);\n \n //we are in admin section, so we need to set the store it manually\n $shippingModel->setStoreId($storeId);\n \n if (!$shippingModel->isAjaxInsertAllowed($addressId)) {\n throw new Exception('Invalid Shipping method');\n }\n if (!($shippingModel instanceof Balticode_Postoffice_Model_Carrier_Abstract)) {\n throw new Exception('Invalid Shipping model');\n }\n\n if ($placeId > 0) {\n $place = $shippingModel->getTerminal($placeId);\n if ($place) {\n $shippingModel->setOfficeToSession($addressId, $place);\n echo 'true';\n return;\n } else {\n echo 'false';\n return;\n }\n }\n\n $groups = $shippingModel->getGroups($addressId);\n $html = '';\n\n if ($groups) {\n $groupSelectWidth = (int)$shippingModel->getConfigData('group_width');\n $style = '';\n if ($groupSelectWidth > 0) {\n $style = ' style=\"width:'.$groupSelectWidth.'px\"';\n }\n $html .= '<select onclick=\"return false;\" ' . $style . ' name=\"' . $carrierCode . '_select_group\" onchange=\"new Ajax.Request(\\'' . $url . '\\',{method:\\'post\\',parameters:{carrier_id:\\'' . $carrierId . '\\',carrier_code:\\'' . $carrierCode . '\\',div_id:\\'' . $divId . '\\',address_id:\\'' . $addressId . '\\',group_id: $(this).getValue()},onSuccess:function(a){$(\\'' . $divId . '\\').update(a.responseText)}});\">';\n $html .= '<option value=\"\">';\n $html .= htmlspecialchars(Mage::helper('balticode_postoffice')->__('-- select --'));\n $html .= '</option>';\n\n foreach ($groups as $group) {\n $html .= '<option value=\"' . $group->getGroupId() . '\"';\n if ($groupId > 0 && $groupId == $group->getGroupId()) {\n $html .= ' selected=\"selected\"';\n }\n $html .= '>';\n $html .= $shippingModel->getGroupTitle($group);\n $html .= '</option>';\n }\n $html .= '</select>';\n }\n\n //get the group values\n if ($groupId > 0 || $groups === false) {\n $terminals = array();\n if ($groups !== false) {\n $terminals = $shippingModel->getTerminals($groupId, $addressId);\n } else {\n $terminals = $shippingModel->getTerminals(null, $addressId);\n }\n $officeSelectWidth = (int)$shippingModel->getConfigData('office_width');\n $style = '';\n if ($officeSelectWidth > 0) {\n $style = ' style=\"width:'.$officeSelectWidth.'px\"';\n }\n $html .= '<select onclick=\"return false;\" '.$style.' name=\"' . $carrierCode . '_select_office\" onchange=\"var sel = $(this); new Ajax.Request(\\'' . $url . '\\',{method:\\'post\\',parameters:{carrier_id:\\'' . $carrierId . '\\',carrier_code:\\'' . $carrierCode . '\\',div_id:\\'' . $divId . '\\',address_id:\\'' . $addressId . '\\',place_id: sel.getValue()},onSuccess:function(a){ if (a.responseText == \\'true\\') { $(\\'' . $carrierId . '\\').writeAttribute(\\'value\\', \\'' . $carrierCode . '_' . $carrierCode . '_\\' + sel.getValue()); $(\\'' . $carrierId . '\\').click(); }}});\">';\n $html .= '<option value=\"\">';\n $html .= htmlspecialchars(Mage::helper('balticode_postoffice')->__('-- select --'));\n $html .= '</option>';\n\n $optionsHtml = '';\n $previousGroup = false;\n $optGroupHtml = '';\n $groupCount = 0;\n\n foreach ($terminals as $terminal) {\n if ($shippingModel->getGroupTitle($terminal) != $previousGroup && !$shippingModel->getConfigData('disable_group_titles')) {\n if ($previousGroup != false) {\n $optionsHtml .= '</optgroup>';\n $optionsHtml .= '<optgroup label=\"'.$shippingModel->getGroupTitle($terminal).'\">';\n } else {\n $optGroupHtml .= '<optgroup label=\"'.$shippingModel->getGroupTitle($terminal).'\">';\n }\n $groupCount++;\n }\n $optionsHtml .= '<option value=\"' . $terminal->getRemotePlaceId() . '\"';\n if (false) {\n $optionsHtml .= ' selected=\"selected\"';\n }\n $optionsHtml .= '>';\n $optionsHtml .= $shippingModel->getTerminalTitle($terminal);\n $optionsHtml .= '</option>';\n \n $previousGroup = $shippingModel->getGroupTitle($terminal);\n }\n if ($groupCount > 1) {\n $html .= $optGroupHtml . $optionsHtml . '</optgroup>';\n } else {\n $html .= $optionsHtml;\n }\n\n $html .= '</select>';\n \n \n }\n\n\n echo $html;\n } else {\n throw new Exception('Invalid request method');\n }\n } catch (Exception $e) {\n $this->getResponse()->setHeader('HTTP/1.1', '500 Internal error');\n $this->getResponse()->setHeader('Status', '500 Internal error');\n throw $e;\n }\n return;\n }", "function polizeipresse_search_office_callback() {\r\n\r\n\t$result = array();\r\n\r\n\t$terms = trim($_POST['terms']);\r\n\r\n $api_key = polizeipresse_get_option(POLIZEIPRESSE_API_KEY);\r\n\tif (empty($api_key)) {\r\n\t\t// If api key is not in database, use api_key from request\r\n\t\t$api_key = trim($_POST['api_key']);\r\n\t};\r\n\r\n\tif (!empty ($terms) && !empty ($api_key)) {\r\n\t\trequire_once(dirname(__FILE__) . '/Presseportal.class.php');\r\n\t $pp = new Presseportal($api_key, 'de');\r\n\t $pp->format = 'xml';\r\n\t $pp->limit = '30';\r\n\r\n\t\t$response = $pp->search_office($terms);\r\n\r\n\t\tif((!$response->error) && ($response->offices)) {\r\n\t\t\tforeach($response->offices AS $office) {\r\n\t\t\t\t$result[] = array('name' => $office->name, 'id' => $office->id);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// Empty result\r\n\t\t}\r\n\t}\r\n\r\n\t// Return reponse\r\n\techo json_encode($result);\r\n\r\n\t// this is required to return a proper result\r\n\tdie();\r\n}", "public function receivables()\n {\n $receivables = Receivable::all();\n return response()->json(['receivables'=>$receivables]);\n }", "public function new() {\n\t\t// For example 420483159374869903504802205626 -> USPS & DHL ECommerce & YANWEN & 4PX\n\t\t// For example 1Z95548F1380393061 -> UPS\n\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->autoRender = false;\n\n\t\t\t$trackingNumber = $this->request->params['named']['number'];\n\n\t\t\t// Get user\n\t\t\t$user = $this->Auth->user();\n\t\t\tif (!$user) {\n\t\t\t\treturn json_encode([\n\t\t\t\t\t'success' => false,\n\t\t\t\t\t'message' => __('message.error.unauthorized')\n\t\t\t\t]);\n\t\t\t}\n\n\t\t\t$api = 'aftership';\n\t\t\t$key = Configure::read('aftership.key');\n\n\t\t\t// Get carrier\n\t\t\t$courier = new AfterShip\\Couriers($key);\n\t\t\t$carriers = $courier->detect($trackingNumber);\n\t\t\tif ($carriers['meta']['code'] != '200'){\n\t\t\t\treturn json_encode([\n\t\t\t\t\t'success' => false,\n\t\t\t\t\t'message' => __('message.error.carrier_not_found')\n\t\t\t\t]);\n\t\t\t}\n\n\t\t\t$carrier = [\n\t\t\t\t'carrier_code' => $carriers['data']['couriers'][0]['slug'],\n\t\t\t\t'carrier_name' => $carriers['data']['couriers'][0]['name'],\n\t\t\t];\n\n\t\t\t// Create tracking\n\t\t\t$trackings = new AfterShip\\Trackings($key);\n\t\t\ttry {\n\t\t\t\t$tracking = $trackings->get($carriers['data']['couriers'][0]['slug'], $trackingNumber);\n\t\t\t}\n\t\t\tcatch (AfterShip\\AfterShipException $e) {\n\t\t\t\t$tracking = $trackings->create($trackingNumber, ['slug' => $carriers['data']['couriers'][0]['slug']]);\n\t\t\t\tsleep(5);\n\t\t\t\t$tracking = $trackings->get($carriers['data']['couriers'][0]['slug'], $trackingNumber);\n\t\t\t}\n\n\t\t\tif ($tracking['data']['tracking']['tag'] == 'Pending') {\n\t\t $trackingmore = new Trackingmore;\n\t\t $carrier_ = $trackingmore->detectCarrier($trackingNumber);\n\t if ($carrier_['meta']['code'] == '200') {\n\t \t$carriers = $carrier_['data'];\n\t\t\t\t\t$tracking_ = $trackingmore->getRealtimeTrackingResults($carriers[0]['code'], $trackingNumber);\n\t\t\t\t\tif ($tracking_['meta']['code'] == '200' && $tracking_['data']['items'][0]['status'] != 'notfound') {\n\t\t\t\t\t\t$tracking = $tracking_;\n\t\t\t\t\t\t$api = 'trackingmore';\n\t\t\t\t\t\t$carrier = [\n\t\t\t\t\t\t\t'carrier_code' => $carriers[0]['code'],\n\t\t\t\t\t\t\t'carrier_name' => $carriers[0]['name']\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// Save user's parcel in DB\n\t\t\t$this->loadModel('TrackParcel');\n\t\t\t$trackparcel = $this->TrackParcel->save([\n\t\t\t\t'customer_id' => $user['id'],\n\t\t\t\t'num_parcel' => $trackingNumber,\n\t\t\t\t'carrier_code' => $carrier['carrier_code'],\n\t\t\t\t'carrier_name' => $carrier['carrier_name'],\n\t\t\t\t'api' => $api\n\t\t\t]);\n\n\t\t\t// Save in Session for next loading\n\t\t\t$this->Session->write($trackingNumber, [\n\t\t\t\t'trackparcel' => $trackparcel,\n\t\t\t\t'tracking' => $tracking\n\t\t\t]);\n\n\t\t\t// Return tracking HTML element\n\t\t\t$this->set('trackparcel', $trackparcel);\n\t\t\t$this->set('tracking', $tracking);\n\t\t\t$this->layout = 'ajax';\n\t\t\treturn $this->render('/Elements/tracking_'.$api);\n\t\t}\n\n\t\treturn $this->redirect(array('action' => 'dashboard', 'language' => $this->Session->read('Config.language')));\n\t}", "public function list(): JsonResponse\n {\n try {\n $this->atcQueue->validateBootStatusIsOn();\n return response()->json([\n 'data' => $this->atcQueue->listAircrafts(),\n 'msg' => 'The list of queues',\n ]);\n } catch (Exception $e) {\n return Handler::processException($e);\n }\n }", "public function cloudFlarePost(){\n #////////#///////////#////////#\n @$Site = $_POST['CloudSite'];\n @$is_All = $_POST['isAll'];\n $array=array();\n $c=1;\n $start_t = microtime(1);\n if($is_All == \"allDomian\" ){\n $All = Domain::All();\n \n foreach($All as $po){\n // all domain\n $data = $this->get_option(\"cloudflare_api\",$po->id,\"clean_cloudflare\");\n if($data != false){\n\n $arr = unserialize($data);\n // send cloudflare peticion\n\n $zoneId = $arr->setting->cloudflare_zone_id;\n $authEmail= $arr->setting->cloudflare_email;\n $authKey= $arr->setting->cloudflare_api_key;\n $domain = $po->url;\n\n $curl = curl_init();\n\n curl_setopt_array($curl, array(\n CURLOPT_URL => \"https://api.cloudflare.com/client/v4/zones/{$zoneId}/purge_cache\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 0,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"DELETE\",\n CURLOPT_POSTFIELDS =>\"{\\\"purge_everything\\\":true}\",\n CURLOPT_HTTPHEADER => array(\n \"Content-Type: application/json\",\n \"X-Auth-Key: {$authKey}\",\n \"X-Auth-Email: {$authEmail}\"\n ),\n ));\n\n $response = json_decode(curl_exec($curl),true);\n \n curl_close($curl);\n $urlView = \"https://www.\".$po->url;\n $result_purge = ($response['success'] == true) ? '<input type=\"checkbox\" checked> ' : \" ERROR -\";\n echo '<a href=\"'.$urlView .'\" target=\"blank_\">'.$result_purge.\"\".$po->url.'</a><br>';\n }\n }\n }\n if($Site != '' && $is_All == null){\n /// select domain\n $Faind = Domain::find($Site);\n\n foreach($Faind as $po){\n // single domain\n $data = $this->get_option(\"cloudflare_api\",$po->id,\"clean_cloudflare\");\n if($data != false){\n\n $arr = unserialize($data);\n // send cloudflare peticion\n\n $zoneId = $arr->setting->cloudflare_zone_id;\n $authEmail= $arr->setting->cloudflare_email;\n $authKey= $arr->setting->cloudflare_api_key;\n $domain = $po->url;\n\n $curl = curl_init();\n\n curl_setopt_array($curl, array(\n CURLOPT_URL => \"https://api.cloudflare.com/client/v4/zones/{$zoneId}/purge_cache\",\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_ENCODING => \"\",\n CURLOPT_MAXREDIRS => 10,\n CURLOPT_TIMEOUT => 0,\n CURLOPT_FOLLOWLOCATION => true,\n CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\n CURLOPT_CUSTOMREQUEST => \"DELETE\",\n CURLOPT_POSTFIELDS =>\"{\\\"purge_everything\\\":true}\",\n CURLOPT_HTTPHEADER => array(\n \"Content-Type: application/json\",\n \"X-Auth-Key: {$authKey}\",\n \"X-Auth-Email: {$authEmail}\"\n ),\n ));\n\n $response = json_decode(curl_exec($curl),true);\n \n curl_close($curl);\n $urlView = \"https://www.\".$po->url;\n $result_purge = ($response['success'] == true) ? '<input type=\"checkbox\" checked> ' : \" ERROR -\";\n echo '<a href=\"'.$urlView .'\" target=\"blank_\">'.$result_purge.\"\".$po->url.'</a><br>';\n }\n \n }\n }\n $end_t = microtime(1);\n $log = LogController::makeLog('Clean_Cache_All_site', \"https://api.cloudflare.com/client/v4/zones/\", $response, '223', ($end_t - $start_t));\n\n echo \"<p><a href='https://kb.kaufberater.io/public/admin/cloud-flare' style='background: #4b646f;\n padding: 10px;\n font-weight: bold;\n color: #FFF;\n text-decoration: none;\n margin-top: 30px; border-radius:10px;'>Return to previous page</a></p>\";\n }", "public function postFilterslist()\n {\n if (Request::ajax())\n {\n if (Input::get('getfilters') == '1')\n {\n $user = Auth::user();\n $firstobjjson = json_decode ($user->filters_patient);\n $filters = json_decode($firstobjjson->data, $firstobjjson->is_array);\n\t\t\t\t$doctors = $user->practice->referralSources;\n return View::make('site/patient/filters')->with('filters', $filters)->with('doctors', $doctors);\n } else\n {\n return false;\n }\n } else\n {\n return false;\n }\n }", "public function index()\n {\n return response()->json([\n 'enquiries' => EnquiryResource::collection(Enquiry::all()),\n 'filtered_enquiries' => EnquiryResource::collection(Enquiry::whereBetween('created_at',[date('Y').'-01-01',date('Y').'-12-31'])->get())\n ]);\n }", "public function index()\n {\n // get all the roomFeatures\n $roomTypes = RoomType::all();\n //$roomTypes = new RoomType();\n //$roomTypes = $roomTypes->paginate(Config::get('syntara::config.item-perge-page'));\n // ajax request : reload only content container\n if(Request::ajax())\n {\n $html = View::make('roomtypes.list-roomtypes')->with('roomtypes', $roomTypes)->render();\n\n return Response::json(array('html' => $html, 'redirectUrl' => URL::route('newRoomPrice')));\n }\n \n $this->layout = View::make('roomtypes.index-roomtype')->with('roomtypes', $roomTypes);\n $this->layout->title = trans('syntara::rooms.features.list');\n $this->layout->breadcrumb = Config::get('syntara::breadcrumbs.roomtypes');\n }", "protected function after()\n\t{\n\t\t$response = $this->app->response();\n\t\t$response['Content-Type'] = \"application/json\";\n\n\t\tif ($this->content !== null)\n\t\t{\n\t\t\t$response->body(\\json_encode($this->content));\n\t\t}\n\t}", "public function index()\n {\n $this->hotel = (new Hotel)->getHotel();\n $recepie_menus = optional($this->hotel)->recepie_menus;\n\n return response()->json([\n 'data' => $recepie_menus\n ]);\n }", "public function postListar()\n {\n if ( Request::ajax() ) {\n \t/*$listar = DB::table('mesas')\n \t\t\t->select('id','name as nombre')\n ->where('estado',1)\n ->get();*/\n $mesas = Mesa::where('estado',1)->get();\n\n return Response::json(\n array(\n 'rst' => 1,\n 'datos' => $mesas\n )\n );\n }\n }", "public function multiSelector($module, $name) {\nglobal $_LW;\nif (!isset($_LW->json['appointments'])) { // if there are no appointments set yet\n\t$_LW->json['appointments']=[]; // init arrays\n\t$_LW->dbo->query('select',\n\t\t'livewhale_appointments.id,\n\t\tlivewhale_appointments.title',\n\t'livewhale_appointments', false, 'livewhale_appointments.title ASC')\n\t->groupBy('livewhale_appointments.title');\n\t$res=$_LW->dbo->run(); // get appointments\n\tif ($res->hasResults()) {\n\t\twhile ($res2=$res->next()) { // loop through appointments\n\t\t\t$_LW->json['appointments'][]=['id'=>$res2['id'], 'title'=>$res2['title']]; // add appointment\n\t\t};\n\t};\n};\n\n// sort appointments as times\nfunction date_compare($a, $b) {\n $t1 = strtotime($a['title']);\n $t2 = strtotime($b['title']);\n return $t1 - $t2;\n} \nusort($_LW->json['appointments'], 'date_compare');\n\n$_LW->json['editor']['values'][$name]=[]; // init array of form values\nif (!empty($_LW->json['appointments'])) { // if there are appointments, loop through appointments, add value to field if there's a preselect value that exists as a appointment\n\tforeach($_LW->json['appointments'] as $val) {\n\t\tif (!empty($_LW->_POST[$name]) && is_array($_LW->_POST[$name]) && in_array($val['id'], $_LW->_POST[$name])) {\n\t\t\t$_LW->json['editor']['values'][$name][]=$val;\n\t\t};\n\t};\n};\nif (!empty($_LW->_POST['appointments_added'])) { // loop through added appointments and add values\n\tforeach($_LW->_POST['appointments_added'] as $val) {\n\t\t$_LW->json['editor']['values'][$name][]=['title'=>$val];\n\t};\n};\n}", "public function reprocessOrders()\n {\n if (\n !$this->configuration->getEnableDeclineReprocessing() ||\n CrmPayload::get('meta.isSplitOrder') === true ||\n Request::attributes()->get('action') === 'prospect'\n ) {\n return;\n }\n \n $response = CrmResponse::all();\n \n if(!empty($response['success'])) {\n return;\n }\n \n if(\n \tpreg_match(\"/Prepaid.+Not Accepted/i\", $response['errors']['crmError']) &&\n \t!empty($response['errors']['crmError'])\n \t) {\n \treturn;\n \t}\n\n $cbCampaignId = $this->configuration->getDeclineReprocessingCampaign();\n $campaignInfo = Campaign::find($cbCampaignId);\n $products = array();\n if(!empty($campaignInfo['product_array']))\n { \n foreach ($campaignInfo['product_array'] as $childProduct) {\n unset($campaignInfo['product_array']);\n array_push($products, array_merge($campaignInfo, $childProduct));\n }\n }\n CrmPayload::set('products', $products);\n CrmPayload::set('campaignId', $campaignInfo['campaignId']);\n \n $crmInfo = $this->configuration->getCrm();\n $crmType = $crmInfo['crm_type'];\n $crmClass = sprintf(\n '\\Application\\Model\\%s', $crmType\n );\n\n $crmInstance = new $crmClass($this->configuration->getCrmId());\n call_user_func_array(array($crmInstance, CrmPayload::get('meta.crmMethod')), array());\n \n }", "function archive() {\n if($this->request->isApiCall()) {\n $this->response->respondWithData(Companies::findArchived($this->logged_user), array(\n 'as' => 'companies',\n ));\n } else {\n $this->response->badRequest();\n } // if\n }", "public function load_existing_cfields() {\n\n\t\tforminator_validate_ajax( \"forminator_load_existing_cfields\" );\n\n\t\t$keys = array();\n\t\t$html = '';\n\n\t\tforeach ( $keys as $key ) {\n\t\t\t$html .= \"<option value='$key'>$key</option>\";\n\t\t}\n\n\t\twp_send_json_success( $html );\n\t}", "public function run()\n {\n $supplies = [\n ['id' => '2','order_id' => '1','listing_id' => '13','batch_no' => '155267','price' => '955','qty' => '1.00','expiry_date' => '2022-02-01','active' => '1','deleted_at' => NULL,'created_at' => '2021-02-05 17:31:45','updated_at' => '2021-02-05 17:31:45'],\n ['id' => '4','order_id' => '1','listing_id' => '16','batch_no' => '155831','price' => '508','qty' => '1.00','expiry_date' => '2023-02-01','active' => '1','deleted_at' => NULL,'created_at' => '2021-02-05 17:34:11','updated_at' => '2021-02-05 18:00:22'],\n ['id' => '5','order_id' => '1','listing_id' => '18','batch_no' => '154398','price' => '417','qty' => '2.00','expiry_date' => '2021-02-05','active' => '1','deleted_at' => NULL,'created_at' => '2021-02-05 17:35:14','updated_at' => '2021-02-05 18:00:51'],\n ['id' => '6','order_id' => '1','listing_id' => '12','batch_no' => '154988','price' => '337','qty' => '1.00','expiry_date' => '2021-02-05','active' => '1','deleted_at' => NULL,'created_at' => '2021-02-05 17:53:40','updated_at' => '2021-02-05 18:01:06'],\n ['id' => '7','order_id' => '1','listing_id' => '14','batch_no' => '155367','price' => '400','qty' => '5.00','expiry_date' => '2021-02-05','active' => '1','deleted_at' => NULL,'created_at' => '2021-02-05 17:56:25','updated_at' => '2021-02-05 17:56:33'],\n ['id' => '8','order_id' => '2','listing_id' => '5','batch_no' => NULL,'price' => '267','qty' => '6.00','expiry_date' => '2021-02-05','active' => '1','deleted_at' => NULL,'created_at' => '2021-02-05 18:11:03','updated_at' => '2021-02-05 18:11:09'],\n ['id' => '9','order_id' => '2','listing_id' => '6','batch_no' => NULL,'price' => '418','qty' => '4.00','expiry_date' => '2022-02-01','active' => '1','deleted_at' => NULL,'created_at' => '2021-02-05 19:44:01','updated_at' => '2021-02-05 19:45:18'],\n ['id' => '10','order_id' => '2','listing_id' => '7','batch_no' => NULL,'price' => '1648','qty' => '1.00','expiry_date' => '2022-02-01','active' => '1','deleted_at' => NULL,'created_at' => '2021-02-05 19:46:36','updated_at' => '2021-02-05 19:47:33'],\n ['id' => '11','order_id' => '2','listing_id' => '3','batch_no' => NULL,'price' => '695','qty' => '1.00','expiry_date' => '2022-02-01','active' => '1','deleted_at' => NULL,'created_at' => '2021-02-05 19:47:14','updated_at' => '2021-02-05 19:47:14'],\n ['id' => '12','order_id' => '2','listing_id' => '1','batch_no' => NULL,'price' => '338','qty' => '3.00','expiry_date' => '2022-02-01','active' => '1','deleted_at' => NULL,'created_at' => '2021-02-05 19:48:25','updated_at' => '2021-02-05 19:48:25'],\n ['id' => '13','order_id' => '2','listing_id' => '4','batch_no' => NULL,'price' => '463','qty' => '3.00','expiry_date' => '2022-02-01','active' => '1','deleted_at' => NULL,'created_at' => '2021-02-05 19:49:48','updated_at' => '2021-02-05 19:49:48'],\n ['id' => '14','order_id' => '2','listing_id' => '19','batch_no' => NULL,'price' => '312','qty' => '5.00','expiry_date' => '2022-02-01','active' => '1','deleted_at' => NULL,'created_at' => '2021-02-05 19:54:00','updated_at' => '2021-02-05 19:54:00']\n ];\n\n\n foreach ($supplies as $supply) {\n Supply::updateOrCreate( ['id' => $supply['id']], $supply);\n }\n }", "public function ajaxProducts()\n {\n $lineId = Input::get('lineId');\n $products = Product::where('line_id', $lineId)->lists('name', 'id');\n return Response::json($products);\n }", "public function index()\n {\n $fronthfs = Frontend::all();\n return response()->json(['fronthfsList'=>$fronthfs],200);\n }", "function supplier_getalljson($id = null) {\n if($this->RequestHandler->isAjax()) {\n $nextDelivery = $this->Delivery->findByNextDelivery(true);\n $this->Delivery->recursive = 0; \n $deliveryDates = $this->Delivery->find('all', array(\n 'conditions' => array(\n 'Delivery.date <=' => date('Y-m-d', strtotime($nextDelivery['Delivery']['date'])), \n 'Delivery.organization_id' => intval($id)), \n 'order' => 'Delivery.date DESC'\n )\n );\n Configure::write('debug', 0);\n $this->autoRender = false; \n $this->autoLayout = false;\n echo(json_encode($deliveryDates));\n exit(1); \n }\n }", "public function refresh()\n {\n $this->create(PhoneCombo::Make(new PhoneNumber($this->from), new PhoneNumber($this->to)));\n }", "public function index() {\n\t\tif (defined('IS_DEV_INSTANCE') && IS_DEV_INSTANCE === true) {\n\t\t\tCakeLog::write('api.offers', print_r($this->request->query, true));\n\t\t}\n\t\telse {\n\t\t\tCakeLog::write('api.offers', $this->request->query, true);\n\t\t}\n\t\tif (!$this->authedUser()) {\n\t\t\treturn new CakeResponse(array(\n\t\t\t\t'status' => 400,\n\t\t\t\t'type' => 'json',\n\t\t\t\t'body' => json_encode(array(\n\t\t\t\t\t'message' => 'Invalid token'\n\t\t\t\t))\n\t\t\t));\n\t\t}\n\n\t\t$this->request->data = $this->request->query;\n\t\tif (!isset($this->request->query['sort'])) {\n\t\t\t$this->request->data['sort'] = 'newest';\n\t\t}\n\t\tif (!isset($this->request->data['type'])) {\n\t\t\t$this->request->data['type'] = 'free';\n\t\t}\n\t\tif (!isset($this->request->data['location'])) {\n\t\t\t$this->request->data['location'] = 'usa';\n\t\t}\n\n\t\t$conditions = array(\n\t\t\t'Offer.active' => true,\n\t\t\t'Offer.paid' => $this->request->data['type'] == 'paid',\n\t\t\t'Offer.international' => $this->request->data['location'] == 'intl',\n\t\t\t'Offer.us' => $this->request->data['location'] == 'usa'\n\t\t);\n\t\t$order = $this->request->data['sort'] == 'newest' ? 'Offer.created DESC': 'Offer.award DESC';\n\n\t\t// todo: once we are logging all transactions with their full descriptions, let's get rid of the crazy joins here\n\t\t$this->Paginator->settings = array(\n\t\t\t'order' => $order,\n\t\t\t'limit' => 25,\n\t\t\t'conditions' => $conditions\n\t\t);\n\t\t$offers = $this->Paginator->paginate('Offer');\n\n\t\t$response = array();\n\t\tforeach ($offers as $offer) {\n\t\t\t$redeemed = false;\n\t\t\t$offer_redemption = $this->OfferRedemption->find('first', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'OfferRedemption.user_id' => $this->authed_user['User']['id'],\n\t\t\t\t\t'OfferRedemption.offer_id' => $offer['Offer']['id'],\n\t\t\t\t\t'OfferRedemption.status' => OFFER_REDEMPTION_ACCEPTED\n\t\t\t\t)\n\t\t\t));\n\t\t\tif ($offer_redemption) {\n\t\t\t\t$redeemed = true;\n\t\t\t}\n\t\t\t$response[] = array(\n\t\t\t\t'id' => intval($offer['Offer']['id']),\n\t\t\t\t'logo_filepath' => $offer['Offer']['logo_filepath'],\n\t\t\t\t'offer_title' => $offer['Offer']['offer_title'],\n\t\t\t\t'award' => intval($offer['Offer']['award']),\n\t\t\t\t'offer_desc' => $offer['Offer']['offer_desc'],\n\t\t\t\t'offer_instructions' => $offer['Offer']['offer_instructions'],\n\t\t\t\t'redeemed' => $redeemed\n\t\t\t);\n\t\t}\n\n\t\treturn new CakeResponse(array(\n\t\t\t'status' => 200,\n\t\t\t'type' => 'json',\n\t\t\t'body' => json_encode($response)\n\t\t));\n\t}", "public function all(): JsonResponse\n {\n\n try {\n\n $data = $this->orderTypeService->all();\n\n return $this->sendResource(OrderTypeResource::collection($data));\n\n } catch (Exception $exception) {\n\n return $this->sendError('Server Error.', $exception);\n }\n }", "public function autoCompleteList(){\n $this->layout='ajax';\n $this->autoRender =false;\n if($this->request->is('ajax')){\n $result = $this->Technology->find('list');\n echo json_encode($result);\n }\n }", "public function ajaxBoughtAction() { \n $request = $this->getRequest();\n $response = $this->getResponse();\n if ($request->isPost()) {\n $list = $request->getPost('list');\n if (is_array($list) && count($list) > 0) {\n foreach($list as $id_shopping_list) {\n $this->getShoppingListTable()->saveAsBought($id_shopping_list);\n }\n $t_return[\"result\"] = \"OK\";\n } else {\n $t_return[\"result\"] = \"KO_LIST\";\n }\n $response->setContent(\\Zend\\Json\\Json::encode($t_return));\n }\n return $response;\n }", "public function json()\n\t{\n\t\t//return \"prices json\";\n\t\treturn Response::json(Price::all());\n\t}", "function get_all_offers()\n\t{\n\n\t\t $data = $this->promocode_model->get_all_offers();\n\t\t\t\n\t\t echo json_encode( array(\"success\"=>1,\"message\"=>\"\",\"data\"=>$data) );\n\t}", "function bill_service_provider() {\n\t\t$biller_category = $_REQUEST['biller_category'];\n\t\tif (!empty($biller_category)) {\n\t\t\t$records = $this -> conn -> get_table_row_byidvalue('biller_details', 'biller_category_id', $biller_category);\n\n\t\t\tif ($records) {\n\t\t\t\tforeach ($records as $v) {\n\n\t\t\t\t\t$biller_id = $v['biller_id'];\n\t\t\t\t\t$biller_name = $v['biller_name'];\n\t\t\t\t\t$biller_contact_no = $v['biller_contact_no'];\n\t\t\t\t\t$biller_email = $v['biller_email'];\n\t\t\t\t\t$biller_company_name = $v['biller_company_name'];\n\t\t\t\t\t$biller_company_logo = biller_company_logo . $v['biller_company_logo'];\n\n\t\t\t\t\t$post1[] = array('biller_id' => $biller_id, \"biller_name\" => $biller_name, 'biller_contact_no' => $biller_contact_no, \"biller_email\" => $biller_email, 'biller_company_name' => $biller_company_name, 'company' => (string)$biller_company_name, \"biller_company_logo\" => $biller_company_logo, 'biller_category_id' => $biller_category);\n\t\t\t\t}\n\t\t\t\t$post = array('status' => \"true\", \"service_provider\" => $post1);\n\t\t\t} else {\n\t\t\t\t$post = array('status' => \"false\", \"message\" => \"No Service Provider Found\");\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"Missing Parameter\", 'biller_category_id' => $biller_category);\n\t\t}\n\t\techo $this -> json($post);\n\t}", "static public function fillFirms()\n {\n $params = [\n 'vehicle_model_types' => [0, 1, 2],\n 'avail_only' => false\n ];\n\n $res = json_decode(self::get('/v2/company', $params));\n Log::info('fillFirms res =' . print_r($res, 1));\n\n foreach ($res->companies as $firmInfo) {\n $firm = Firms::firstOrNew(['title' => $firmInfo->company_name]);\n\n $firm->title = mb_strtolower($firmInfo->company_name);\n $firm->id = $firmInfo->company_id;\n //dd($firm);\n $firm->save();\n }\n }", "public function getSubscriptionList()\n {\n $recruiterOffice = RecruiterOffice::getAllOffices();\n $subscription['data'] = [];\n $customerId = RecruiterProfile::where(['user_id' => Auth::user()->id])->pluck('customer_id');\n if ($customerId[0] == null) {\n $subscription['customer'] = [];\n } else {\n $customer = \\Stripe\\Customer::retrieve($customerId[0]);\n $subscription['customer'] = [$customer];\n }\n foreach ($recruiterOffice as $office) {\n if ($office['free_trial_period'] != config('constants.ZeroValue')) {\n $subscription['data'] = $office;\n break;\n }\n }\n return $subscription;\n }", "public function pullSaveTldsFromResellerClub()\n {\n $api = new ApiCall();\n /*$result = $api->addContact(\"ResellerClub\",\n [\n 'customer-id' => '18775943',\n 'name' => 'TEST NAME',\n 'company' => 'TEST COMP',\n 'email' => '[email protected]',\n 'address-line-1' => 'test address',\n 'city' => 'Lahore',\n 'country' => 'PK',\n 'zipcode' => '54000',\n 'phone-cc' => '92',\n 'phone' => '1231231321',\n 'type' => 'Contact'\n ]);\n dd($result);*/\n $result = $api->getTlds('ResellerClub');\n $tld_prices = $api->getCostPriceOfTld(\"ResellerClub\");\n $tlds_count = 0;\n $inserted_count = 0;\n $sequence_count = Tld::max('sequence');\n if ($result->resultData) {\n $tlds_count = count($result->resultData);\n foreach ($result->resultData as $tld_name => $tld_data) {\n $sequence_count++;\n $existing_tld = Tld::where(['name' => $tld_name])->first();\n if (!$existing_tld) {\n $data = [\n 'name' => $tld_name,\n 'sequence' => $sequence_count,\n 'feature' => 'Regular',\n 'is_active_for_sale' => 0,\n 'registrar' => 'ResellerClub',\n 'suggest_group' => 'none'\n ];\n if(isset($tld_prices[$tld_name])){\n if(isset($tld_prices[$tld_name]['addnewdomain'][1])){\n $data['cost_price'] = (double) $tld_prices[$tld_name]['addnewdomain'][1];\n }\n if(isset($tld_prices[$tld_name]['addtransferdomain'][1])){\n $data['transfer_price'] = (double) $tld_prices[$tld_name]['addtransferdomain'][1];\n }\n if(isset($tld_prices[$tld_name]['restoredomain'][1])){\n $data['restore_price'] = (double) $tld_prices[$tld_name]['restoredomain'][1];\n }\n }\n $new_tld = Tld::create($data);\n if ($new_tld){\n $inserted_count++;\n }\n }\n else{\n $data = [];\n if(isset($tld_prices[$tld_name])){\n if(isset($tld_prices[$tld_name]['addnewdomain'][1])){\n $data['cost_price'] = (double) $tld_prices[$tld_name]['addnewdomain'][1];\n }\n if(isset($tld_prices[$tld_name]['addtransferdomain'][1])){\n $data['transfer_price'] = (double) $tld_prices[$tld_name]['addtransferdomain'][1];\n }\n if(isset($tld_prices[$tld_name]['restoredomain'][1])){\n $data['restore_price'] = (double) $tld_prices[$tld_name]['restoredomain'][1];\n }\n }\n if($data) {\n Tld::where('name', $tld_name)->update($data);\n }\n }\n }\n }\n\n session()->put('success', $tlds_count.' Tlds have been pulled! '.$inserted_count.'Tlds have been inserted!');\n\n\n return redirect('domain/tld');\n }", "function ajax_lf_email_get_for_rest_post_campaigns_id() {\n\t\n\t// Set Campaign Ids\n\t$campaign_ids = $_REQUEST['campaign_ids'];\n\n\t// Set Posts By Campaign array\n\t$posts_by_campaign = array();\n\n\tif ( count( $campaign_ids ) > 0 ) {\n\t\tforeach ( $campaign_ids as $id ) {\n\n\t\t\t// Get Campaign Details\n\t\t\t$campaign_details = lf_email_util_get_campaign_details( $id );\n\n\t\t\t// Get Posts by Campaign Id\n\t\t\t$posts = lf_email_util_get_posts_by_campaign( $id );\n\t\t\t\n\t\t\t// Get Subscribers\n\t\t\t$subscribers = lf_email_util_get_subscribers_by_campaign( $id );\n\n\t\t\t// Format Results\n\t\t\t$posts_results = array();\n\t\t\tforeach ( $posts as $v ) {\n\t\t\t\t// $details = array(\n\t\t\t\t// \t'campaign_id' => $campaign_details['id'],\n\t\t\t\t// \t'campaign_name' => $campaign_details['name'],\n\t\t\t\t// \t'title' => esc_sql( $v->post_title ),\n\t\t\t\t// \t'html' => esc_sql( $v->post_content ),\n\t\t\t\t// \t'text_only' => esc_sql( $v->post_excerpt ),\n\t\t\t\t// \t'subscribers' => $subscribers\n\t\t\t\t// );\n\t\t\t\t$details = array(\n\t\t\t\t\t'subject' => esc_sql( $v->post_title ),\n\t\t\t\t\t'subscribers' => $subscribers,\n\t\t\t\t\t'body' => array(\n\t\t\t\t\t\t'html' => esc_sql( $v->post_content ),\n\t\t\t\t\t\t'text' => esc_sql( $v->post_excerpt )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t$posts_results[] = $details;\n\t\t\t}\n\n\t\t\t// Set Posts By Campaign\n\t\t\t$posts_by_campaign[] = array(\n\t\t\t\t'id' => $id,\n\t\t\t\t'posts' => $posts_results\n\t\t\t);\n\t\t}\n\t} // end if\n\t\n\t// Return Data\n\techo json_encode( $posts_by_campaign );\n\tdie();\n}", "public function getContacts(): JsonResponse\n {\n return response()->json(Contact::latest()->get());\n }", "public function autocomplete()\n {\n\n $hotel_name = Input::get('name');\n\n $hotels = Hotel::select(array('id', 'name'))\n ->where('name', 'like', \"%$hotel_name%\")\n ->where('status', '=', 1)\n ->get();\n\n $hotels_array = array();\n\n foreach($hotels as $hotel) {\n $hotels_array[] = $hotel->toArray();\n }\n\n return Response::json( $hotels_array );\n }", "function ajax_response() {\n\n\t\tcheck_ajax_referer( 'ajax-custom-list-nonce', '_ajax_custom_list_nonce' );\n\n\t\t$this->prepare_items();\n\n\t\textract( $this->_args );\n\t\textract( $this->_pagination_args, EXTR_SKIP );\n\n\t\tob_start();\n\t\tif ( ! empty( $_REQUEST['no_placeholder'] ) )\n\t\t\t$this->display_rows();\n\t\telse\n\t\t\t$this->display_rows_or_placeholder();\n\t\t$rows = ob_get_clean();\n\n\t\tob_start();\n\t\t$this->print_column_headers();\n\t\t$headers = ob_get_clean();\n\n\t\tob_start();\n\t\t$this->pagination('top');\n\t\t$pagination_top = ob_get_clean();\n\n\t\tob_start();\n\t\t$this->pagination('bottom');\n\t\t$pagination_bottom = ob_get_clean();\n\n\t\t$response = array( 'rows' => $rows );\n\t\t$response['pagination']['top'] = $pagination_top;\n\t\t$response['pagination']['bottom'] = $pagination_bottom;\n\t\t$response['column_headers'] = $headers;\n\n\t\tif ( isset( $total_items ) )\n\t\t\t$response['total_items_i18n'] = sprintf( _n( '1 item', '%s items', $total_items ), number_format_i18n( $total_items ) );\n\n\t\tif ( isset( $total_pages ) ) {\n\t\t\t$response['total_pages'] = $total_pages;\n\t\t\t$response['total_pages_i18n'] = number_format_i18n( $total_pages );\n\t\t}\n\n\t\tdie( json_encode( $response ) );\n\t}", "public function find_officer()\n { \n $query = get_post('q');\n $where = 'deletedAt IS NULL' .\n 'AND (MabuhayID LIKE \"' . $query . '%\" OR CONCAT(FirstName, \" \", LastName) LIKE \"' . $query . '%\")' .\n 'AND AccountTypeID IN(2,3)';\n $users = $this->mgovdb->getRecords('UserAccountInformation', $where);\n $items = array();\n foreach ($users as $user) {\n $items[] = array(\n 'id' => $user['id'],\n 'firstname' => $user['FirstName'],\n 'lastname' => $user['LastName'],\n 'fullname' => $user['FirstName'] . ' ' . $user['LastName'],\n 'mabuhayID' => $user['MabuhayID'],\n 'email' => $user['EmailAddress'],\n 'contact' => $user['ContactNumber'],\n 'gender' => lookup('gender', $user['GenderID']),\n 'address' => array_values(array_reverse(lookup_address($user))),\n 'photo' => photo_filename($user['Photo']),\n 'actype' => lookup('account_type', $user['AccountTypeID']),\n 'aclevel' => lookup_db('UserAccountLevel', 'LevelName', $user['AccountLevelID'])\n );\n }\n response_json($items);\n }", "public function store()\n {\n // firstOrNew sucht sich bestehenden Wert mit 'Name' oder Erstellt einen neuen\n // Log::info('Hersteller: '. Input::get('Hersteller'));\n $manufacturer = Manufacturer::firstOrNew(['Name' => Input::get('Hersteller')]);\n $manufacturer->created_at = new DateTime;\n $manufacturer->updated_at = new DateTime;\n $manufacturer->save();\n\n // gibt die ID des gerade erstellten Herstellers zurück\n return response()->json([\n 'success' => true,\n 'Manufacturer' => Manufacturer::orderBy('ID', 'desc')->first()\n ]);\n }", "public function list_for_select(){\n\n\n $categories = new OsServiceCategoryModel();\n $categories = $categories->get_results();\n $response_html = '<option value=\"0\">'.__('Uncategorized', 'latepoint').'</option>';\n foreach($categories as $category){\n $response_html.= '<option>'.$category->name.'</option>';\n }\n echo wp_send_json(array('status' => 'success', 'message' => $response_html));\n }", "public function storeItems()\n {\n return response()->json([\n 'status' => 200,\n 'data' => new ProductResourceCollection(Product::all())\n ]);\n }", "public function build(Request $request)\n {\n $response = $request->all();\n\n $round_way = NULL;\n $trip = [];\n //fetching roundway data\n if($response['two_way'] == 'true'){\n\n $round_way = $this->searchflight($response['arrival_from'],$response['deperture_from']);\n }\n $sort=$response['by_price'];\n //one way data fetching\n $one_ways = $this->searchflight($response['deperture_from'],$response['arrival_from']);\n $count =0;\n //merging based on the conditions date timezone, and providing a new data structure for trip.\n foreach ($one_ways as $one_way){\n if($response['two_way']== 'true'){\n // if the trip is round way but but there is no inbound flight it shows the inbound flights\n if($round_way==NULL){\n $trip[$count]['one']=$one_way;\n $trip[$count]['round']=$response['two_way'];\n $trip[$count]['two'] = NULL;\n $trip[$count]['total']=$one_way->price;\n $count++;\n }else{\n foreach ($round_way as $way){\n //for each round trip it matches the time zone. if it is possible on or not. and exicute in that way.\n if(new \\DateTime($response['start_date'])!=new \\DateTime($response['retun_date']) &&\n new \\DateTime($response['start_date']) < new \\DateTime($response['retun_date'])\n ){\n $trip[$count]['one']=$one_way;\n $trip[$count]['round']=$response['two_way'];\n $trip[$count]['two'] = $way;\n $trip[$count]['total']=$one_way->price + $way->price;\n $count++;\n }elseif(new \\DateTime($response['start_date']) > new \\DateTime($response['retun_date'])){\n // It will gives an error if the client choese arrival day before the departure day\n return response()->json([\"message\"=>\"Check the dates\"],404);\n }\n else{\n // it returns the all matching if hte day is different\n $timezone_to = DB::table('airports')->where('code', $response['arrival_from'])->value('timezone');\n $date = new \\DateTime($response['retun_date'].' '.$way->departure_time, new \\DateTimeZone($timezone_to));\n $date->setTimezone(new \\DateTimeZone('UTC'));\n $back_date = $date->format('Y-m-d H:i:sP');\n\n $timezone_from = DB::table('airports')->where('code', $response['deperture_from'])->value('timezone');\n $date_from = new \\DateTime($response['start_date'].' '.$one_way->arrival_time, new \\DateTimeZone($timezone_from));\n $date_from->setTimezone(new \\DateTimeZone('UTC'));\n $fromdate = $date_from->format('Y-m-d H:i:sP');\n $one_way->updated_at = $fromdate;\n $way->updated_at = $back_date;\n if($fromdate<$back_date){\n $trip[$count]['one']=$one_way;\n $trip[$count]['round']=$response['two_way'];\n $trip[$count]['two'] = $way;\n $trip[$count]['total']=$one_way->price + $way->price;\n $count++;\n }\n }\n }\n }\n }else{\n\n // one way trip option\n $trip[$count]['one']=$one_way;\n $trip[$count]['round']=$response['two_way'];\n $trip[$count]['two'] = NULL;\n $trip[$count]['total']=$one_way->price;\n $count++;\n }\n }\n //sorting by price\n if($sort== 'true'){\n usort($trip, function($a, $b) {\n return $a[\"total\"] <=> $b[\"total\"];\n });\n }\n $trip = $this->paginate($trip);\n\n return $trip;\n\n }", "public function get_food_type_post()\n {\n $response = new StdClass();\n $result = array();\n $food_type = $this->Supervisor->get_food_type();\n if(!empty($food_type))\n {\n foreach ($food_type as $row)\n {\n $data['food_type'] = $row['food_type'];\n $data['message'] = 'Success';\n $data['status'] ='1';\n\n array_push($result,$data);\n\n } \n \n $response->data = $result;\n }\n else\n {\n $data['message'] = 'failed';\n $data['status'] ='0';\n array_push($result , $data);\n }\n $response->data = $result;\n echo json_output($response);\n }", "function viewJSON($item_id = -1) {\n $this->check_action_permission('add_update');\n $suppliers = array('' => lang('items_none'));\n foreach($this->Supplier->get_all()->result_array() as $row)\n {\n $suppliers[$row['person_id']] = $row['company_name'] .' ('.$row['first_name'] .' '. $row['last_name'].')';\n }\n $data['suppliers']=$suppliers;\n $data['ticket_type_id'] = $this->ticket->get_ticket_type();\n $data['destination_id'] = $this->ticket->get_destinationID();\n $data['controller_name'] = strtolower(get_class());\n $data['ticket_info'] = $this->ticket->get_info($item_id);\n $this->load->view(\"tickets/_form\", $data);\n }", "private function _updateCheckoutFormJson() {\n if ($this->_request->isPost()) {\n $cart = $this->_cart_mapper->get();\n if (!count($cart->products) || $cart->products->hasRenewal() &&\n !$this->_users_svc->isAuthenticated()) {\n $this->_helper->json(array(\n 'empty' => true\n ));\n return;\n }\n $fields = Zend_Json::decode($this->_request->getParam('model'));\n $post = array();\n foreach ($fields as $field) {\n $post[$field['name']] = $field['value'];\n }\n $checkout_form = $this->_cart_svc->getCheckoutForm();\n $status = $checkout_form->isValid($post);\n $this->_cart_svc->saveCheckoutForm($checkout_form, $post);\n $this->_helper->json(array(\n 'messages' => $checkout_form->getMessages(),\n 'status' => $status\n ));\n }\n }", "public function index(){\n\n $geo_data = Configure::read('paths.geo_data');\n $reader = new Reader($geo_data);\n $cquery = $this->request->getQuery();\n\n //__ Authentication + Authorization __\n $user = $this->_ap_right_check();\n if(!$user){\n return;\n }\n $user_id = $user['id'];\n\n $query = $this->{$this->main_model}->find();\n\n $this->_build_common_query($query, $user);\n\n //===== PAGING (MUST BE LAST) ======\n $limit = 50; //Defaults\n $page = 1;\n $offset = 0;\n\n if(isset($cquery['limit'])){\n $limit = $cquery['limit'];\n $page = $cquery['page'];\n $offset = $cquery['start'];\n }\n\n $query->page($page);\n $query->limit($limit);\n $query->offset($offset);\n\n $total = $query->count();\n $q_r = $query->all();\n\n $items = [];\n\n foreach($q_r as $i){\n\n $country_code = '';\n $country_name = '';\n $city = '';\n $postal_code = '';\n $state_name = '';\n $state_code = '';\n\n if($i->last_contact_ip != ''){\n try {\n $location = $reader->city($i->last_contact_ip);\n } catch (\\Exception $e) {\n //Do Nothing\n }\n\n if(!empty($location)){\n $city = $location->city->name;\n $postal_code = $location->postal->code;\n $country_name = $location->country->name;\n $country_code = $location->country->isoCode;\n $state_name = $location->mostSpecificSubdivision->name;\n $state_code = $location->mostSpecificSubdivision->isoCode;\n }\n }\n\n $realms = [];\n //Realms\n foreach($i->dynamic_client_realms as $dcr){\n if(! $this->Aa->test_for_private_parent($dcr->realm, $user)){\n if(! isset($dcr->realm->id)){\n $r_id = \"undefined\";\n $r_n = \"undefined\";\n $r_s = false;\n }else{\n $r_id= $dcr->realm->id;\n $r_n = $dcr->realm->name;\n $r_s = $dcr->realm->available_to_siblings;\n }\n array_push($realms,\n [\n 'id' => $r_id,\n 'name' => $r_n,\n 'available_to_siblings' => $r_s\n ]);\n }\n }\n\n $owner_id = $i->user_id;\n\n $owner_tree = $this->{'Users'}->find_parents($owner_id);\n $action_flags = $this->_get_action_flags($owner_id,$user);\n\n\n $i->country_code = $country_code;\n $i->country_name = $country_name;\n $i->city = $city;\n $i->postal_code = $postal_code;\n if($i->last_contact != null){\n $i->last_contact_human = $this->TimeCalculations->time_elapsed_string($i->last_contact);\n }\n\n //Create notes flag\n $notes_flag = false;\n foreach($i->dynamic_client_notes as $dcn){\n if(! $this->Aa->test_for_private_parent($dcn->note,$user)){\n $notes_flag = true;\n break;\n }\n }\n \n /*\n if(isset($i->alive_current)){\n $i->alive_current->time_human = $this->TimeCalculations->time_elapsed_string($i->alive_current->time);\n $i->alive_current->sig = intval($i->alive_current->sig);\n $i->alive_current->pb = $i->alive_current->sig /31;\n //$i->alive_current->pb = bcdiv($i->alive_current->pb, 1, 2); \n }\n */\n\n $i->notes = $notes_flag;\n\n $i->owner = $owner_tree;\n $i->realms = $realms;\n $i->update = $action_flags['update'];\n $i->delete = $action_flags['delete'];\n \n //Check if there is data cap on unit\n if($i->data_limit_active){\n $d_limit_bytes = $this->_getBytesValue($i->data_limit_amount,$i->data_limit_unit);\n $i->data_cap = $d_limit_bytes;\n if($i->data_used >0){\n $i->perc_data_used = round($i->data_used /$d_limit_bytes,2) ;\n if($i->perc_data_used > 1){\n $i->perc_data_used = 1;\n }\n }else{\n $i->perc_data_used = 0;\n }\n }\n \n //Check if there is daily data cap on unit\n if($i->daily_data_limit_active){\n $daily_limit_bytes = $this->_getBytesValue($i->daily_data_limit_amount,$i->daily_data_limit_unit);\n $i->daily_data_cap = $daily_limit_bytes;\n if($i->daily_data_used >0){\n $i->daily_perc_data_used = round($i->daily_data_used /$daily_limit_bytes,2) ;\n if($i->daily_perc_data_used > 1){\n $i->daily_perc_data_used = 1;\n }\n }else{\n $i->daily_perc_data_used = 0;\n }\n } \n \n array_push($items,$i);\n }\n\n //___ FINAL PART ___\n $this->set([\n 'items' => $items,\n 'success' => true,\n 'totalCount' => $total,\n '_serialize' => ['items','success','totalCount']\n ]);\n }", "public function ars_for_cost_center() {\n\t\tif(is_array($_POST['cost_center_ids'])){\n\t\t\t$cc_ids = $_POST['cost_center_ids']; \n\t\t\t$this->load->model('cost_center');\n\t\t\t$names = $this->cost_center->existingARs_group($cc_ids);\n\t\t}\n\n\t\techo json_encode($names);\t\n\t\n\t}", "protected function json(){\n $this->before(function ($request) {\n if ($request->contentType == \"application/json; charset=utf-8\") {\n $request->data = json_decode($request->data);\n }\n });\n $this->after(function ($response) {\n $response->contentType = \"application/json; charset=utf-8\";\n if (isset($_GET['jsonp'])) {\n $response->body = $_GET['jsonp'].'('.json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES).');';\n } else {\n $response->body = json_encode($response->body, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);\n }\n });\n }" ]
[ "0.5621412", "0.51957786", "0.5155015", "0.50606275", "0.49819723", "0.49797288", "0.49644074", "0.48896152", "0.48875785", "0.4872311", "0.47950342", "0.47707167", "0.47681162", "0.474921", "0.47270802", "0.4712892", "0.47054565", "0.46923965", "0.4689417", "0.46781728", "0.46611032", "0.46477813", "0.46299946", "0.4627297", "0.46255365", "0.46105948", "0.46052065", "0.46021798", "0.4599442", "0.4593785", "0.45894969", "0.45871174", "0.45852768", "0.458085", "0.45808145", "0.4580766", "0.45719963", "0.45687705", "0.4568172", "0.45619223", "0.4551338", "0.45506194", "0.45421514", "0.45387685", "0.4534397", "0.4530989", "0.45223257", "0.45175636", "0.45160356", "0.45156044", "0.4514493", "0.45139956", "0.45112404", "0.45107204", "0.45093444", "0.45084545", "0.45074835", "0.45073977", "0.45056045", "0.4500334", "0.44954884", "0.44885242", "0.44871375", "0.4480989", "0.4480647", "0.44800484", "0.44799522", "0.447942", "0.4475333", "0.44734254", "0.44687837", "0.44678253", "0.4467024", "0.44425428", "0.4439399", "0.44325835", "0.4432212", "0.44222602", "0.44209194", "0.4419921", "0.4417031", "0.44164002", "0.4414277", "0.44121712", "0.4411674", "0.44059384", "0.4405776", "0.4405186", "0.44045952", "0.44044524", "0.4394889", "0.43945456", "0.4387103", "0.43850413", "0.43808877", "0.43800792", "0.4379975", "0.43743002", "0.43725878", "0.4363209", "0.4362617" ]
0.0
-1
Prints out packing slip pdf for the selected order as response or echoes that barcode is not available.
public function addresscardpdfAction() { Mage::log("addresscardpdfAction PostofficeController", null, 'dpdlog.log'); $orderId = (int)$this->getRequest()->getParam('order_id', 0); if ($orderId <= 0) { return; } $order = Mage::getModel('sales/order')->load($orderId); if (!$order || $order->getId() <= 0) { return; } $incrementId[] = $order->getIncrementId(); Mage::log("addresscardpdfAction incrementId:".print_r($incrementId, true), null, 'dpdlog.log'); $res = Mage::helper('balticode_dpdlt')->getBarcodePdf2($incrementId); if ($res !== false) { header('Content-Type: application/pdf'); header('Content-Disposition: attachment; filename="addresscard-' . $incrementId . '.pdf"'); echo $res->getBody(); } else { echo 'No barcode available'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function output($pgen,$brotherid) {\n\tglobal $qqs,$qqi,$qqu;\n\n\t$pm=new mod_prodmain;\n\t$pi=new mod_prodinfo;\n\t\n\t$idorder=False;\n\tif (($idorder=$pgen->getPageExtra()) == '') {\n\t\t$idorder=ec_prodorder::getUnshippedOrderId(False);\n\t}\n\tif ($idorder === False) {\n\t\techo '<p>No unfilled orders</p>';\n\t\treturn;\n\t}\n\tlist($cust,$order,$timestamp,$email,$via,$tracking,$name,$zip)=ec_prodorder::infoFromId($idorder);\n\t$shiptype=$cust->getPreferredShipping();\n\t$shipdesc=$order->getAllShippingOptions();\n\t$shipopts=$order->getShippingOptions($cust);\n\t\n\techo \"<div{$qqi->idcstr($this->longname)}>\";\n\n\t$form=$this->makeform();\n\n\n\techo \"<h2>\";\n\tif (False !== ($idnext=ec_prodorder::getUnshippedOrderId(True,$idorder)))\n\t\techo link::anchorHTML(\"orderdetail/$idnext\",'Previous unshipped order').\"[<<< prev]</a>&nbsp;&nbsp;&nbsp;\";\n\techo \"Order Number $idorder made on \".date('l jS \\of F Y h:i:s A',$timestamp);\n\tif (False !== ($idprev=ec_prodorder::getUnshippedOrderId(False,$idorder)))\n\t\techo '&nbsp;&nbsp;&nbsp;'.link::anchorHTML(\"orderdetail/$idprev\",'Next unshipped order').\"[next >>>]</a>\";\n\techo '</h2>';\n\t$instructions=nl2br(trim($order->getSpecialInstructions()));\n\tif (strlen($instructions)) {\n\t\techo \"<table><tr><th>Special Instructions</th></tr><tr><td>$instructions</td></tr></table><br />\";\n\t}\n\t\n\t$lines=$order->getOrderArray(False);\n\t$subtotal=0;\n\tforeach ($lines as $litem) {\n\t\t$subtotal += $litem[4];\n\t}\n\t$showsubtotal=sprintf('%1.2f',$subtotal/100);\n\n\t// patch for peach basket special\n\tif ($subtotal > 3500) {\n\t\t$newshipopts=array();\n\t\tforeach ($shipopts as $shiptype=>$cost)\n\t\t\t$newshipopts[$shiptype]=0;\n\t\t$shipopts=$newshipopts;\t\n\t}\n\t\t\n\t$tax=$order->calculateTax($cust);\n\t$showtax=sprintf('%1.2f',$tax/100);\n\t$showshipping=sprintf('%1.2f',$shipopts[$shiptype]/100);\n\t$showtotal=sprintf('%1.2f',($tax+$shipopts[$shiptype]+$subtotal)/100);\n\t\n\techo \"<table><tr><th>Email</th><th>Bill to</th><th>Payment</th><th style=\\\"text-align:right\\\">Totals</th></tr>\";\n\techo \"<tr><td>{$cust->getEmail()}</td><td>{$this->getShippingAddress($cust,0,$bGift)}</td><td>{$cust->getActiveCreditCard()->output3(False)}<br />CV: <span id=\\\"zcv\\\">{$order->getExtra('cv')}</span></td>\";\n\techo \"<td style=\\\"text-align:right\\\">Total Products: $showsubtotal<br />Tax: $showtax<br />Shipping: $showshipping<br />Total: $showtotal</td></tr>\";\n\techo \"</table><br />\";\n\n\techo '<table><tr><th>Qty</th><th>Item</th><th>Unit Price</th><th>Disc.</th><th>Amount</th></tr>';\n\tforeach ($lines as $litem) {\n\t\tlist($qty,$prodid,$baseprice,$discount,$subtotal)=$litem;\n\t\t$info=$pi->getProdInfo($prodid);\n\t\t$maininfo=$pm->getProductInfo($prodid);\n\t\t$title=$qqu->creolelite2html($info['title']);\n\t\t$upc=trim($maininfo['barcodes'][0]);\n\t\techo \"<tr><td>$qty</td><td>{$info['mfr']}: $title<br />UPC: <span id=\\\"za$prodid\\\">$upc</span> <input id=\\\"zb$prodid\\\" type=\\\"text\\\" size=\\\"20\\\" maxlength=\\\"20\\\" /> <span id=\\\"zc$prodid\\\">&nbsp;</span></td>\";\n\t\t$baseprice=sprintf('%1.2f',$baseprice/100);\n\t\t$discount=sprintf('%1.2f',$discount/100);\n\t\t$subtotal=sprintf('%1.2f',$subtotal/100);\n\t\techo \"<td style=\\\"text-align:right\\\">$baseprice</td><td style=\\\"text-align:right\\\">$discount</td><td style=\\\"text-align:right\\\">$subtotal</td></tr>\";\n\t}\n\techo '</table><br />';\n\n\techo '<table><tr><th>Shipping Address</th><th>Shipping Method</th><th>Shipping Status</th></tr>';\n\t$idaddr=$cust->useShippingAddress();\n\techo \"<tr><td>{$this->getShippingAddress($cust,$idaddr,$bGift)}\";\n\tif ($bGift && False !== ($giftmsg=$order->getExtra('giftnote'))) {\n\t\techo \"<br /><br /><h3>Gift Message:</h3>$giftmsg\";\n\t}\n\tif ($via == '(not shipped)')\n\t\t$via=ec_prodorder::getTrackingURL($shiptype);\n\techo \"</td><td>{$shipdesc[$shiptype]}</td><td>Shipped via:<br /><input type=\\\"text\\\" name=\\\"via\\\" value=\\\"$via\\\" size=\\\"60\\\" maxlength=\\\"60\\\" /><br />Tracking Number:<br /><input type=\\\"text\\\" name=\\\"tracking\\\" value=\\\"$tracking\\\" size=\\\"30\\\" maxlength=\\\"30\\\" /><br /><br /><input id='zsetship' name=\\\"ok\\\" type=\\\"button\\\" value=\\\"Set Shipping\\\" />\";\n\t\t\n\techo \"</div>\";\n\t\t\t\n\n}", "function receipt_page($order) {\n echo '<p>' . __('Gracias! - Tu orden ahora está pendiente de pago. Deberías ser redirigido automáticamente a la página de transbank.') . '</p>';\n\n echo $this->generate_webpayplus_form($order);\n }", "function receipt_page( $order ) {\n\t\terror_reporting(E_ERROR);\n\t\tini_set('display_errors', 1);\n\n\t\techo '<p>'.__( 'Спасибо за ваш заказ. Нажмите кнопку, для перехода к оплате через Твои Платежи.', 'woocommerce' ).'</p>';\n\t\techo $this->generate_payu_form( $order );\n\n\t}", "function receipt_page( $order ) {\n\n $result = $this->process_payment($order);\n echo $this->build_gateway_form( $result );\n }", "public function createPDF()\n {\n $soxId = $this->getEditObjectId();\n if ($soxId != \"-1\" && isset($soxId)) {\n // load object\n $oOrder = oxNew(\"oxorder\");\n if ($oOrder->load($soxId)) {\n $oUtils = oxRegistry::getUtils();\n $sTrimmedBillName = trim($oOrder->oxorder__oxbilllname->getRawValue());\n $sFilename = $oOrder->oxorder__oxordernr->value . \"_\" . $sTrimmedBillName . \".pdf\";\n $sFilename = $this->makeValidFileName($sFilename);\n ob_start();\n $oOrder->genPDF($sFilename, oxRegistry::getConfig()->getRequestParameter(\"pdflanguage\"));\n $sPDF = ob_get_contents();\n ob_end_clean();\n $oUtils->setHeader(\"Pragma: public\");\n $oUtils->setHeader(\"Cache-Control: must-revalidate, post-check=0, pre-check=0\");\n $oUtils->setHeader(\"Expires: 0\");\n $oUtils->setHeader(\"Content-type: application/pdf\");\n $oUtils->setHeader(\"Content-Disposition: attachment; filename=\" . $sFilename);\n oxRegistry::getUtils()->showMessageAndExit($sPDF);\n }\n }\n }", "private function __print_receipt()\n {\n\t//Assuming range\n\t$ret = $this->__view_receipt();\n\t$receipthead = $this->__receipt_head_html();\n\t$receiptfoot = $this->__receipt_foot_html();\n\t\n\t$receipts = $receipthead. sprintf(\"\n\t<div id=\\\"receiptrow1\\\" class = \\\"receiptcolumn1\\\">%s</div><div id=\\\"receiptrow1\\\" class = \\\"receiptcolumn2\\\">%s</div>\n\t<div id=\\\"receiptrow2\\\" class = \\\"receiptcolumn1\\\">%s</div><div id=\\\"receiptrow2\\\" class = \\\"receiptcolumn2\\\">%s</div>\n\t<div id=\\\"receiptrow3\\\" class = \\\"receiptcolumn1\\\">%s</div><div id=\\\"receiptrow3\\\" class = \\\"receiptcolumn2\\\">%s</div>\n\t\n\t\", $ret, $ret, $ret, $ret, $ret, $ret).$receiptfoot;\n\t\n\techo $receipts;\n }", "function receipt_page( $order ) {\n\t\techo '<p>'.__( 'Thank you for your order, please click the button below to pay with Veritrans.', 'woocommerce' ).'</p>';\n\t\techo $this->generate_veritrans_form( $order );\n\t}", "public function orderPrint()\n \t {\n\n\t\t$data['country']=$this->Inventory_stock_model->companyDetails();\n\t\t$data['orderdetails']=$this->Inventory_stock_model->getInventory();\n\t\t\n\t ob_start();\n\t $html=ob_get_clean();\n\t $html=utf8_encode($html);\n\t //$html=$this->load->view('report/list_vehicle','',TRUE);\n\t $html=$this->load->view('reports/inventory_print',$data,TRUE);\n\t require_once(APPPATH.'third_party/mpdf60/mpdf.php');\n\t \n\t $mpdf=new mPDF();\n\t $mpdf->allow_charset_conversion=true;\n\t $mpdf->charset_in='UTF-8';\n\t $mpdf->WriteHTML($html);\n\t $mpdf->output('meu-pdf','I');\n\t}", "public function send_order($order_info,$supplier_info) {\n\t\t$attachments = array();\n\t\t$attachments = apply_filters('wc_dropship_manager_send_order_attachments',$attachments,$order_info,$supplier_info); // create a pdf packing slip file\n\t\t$options = get_option( 'wc_dropship_manager' );\n\t\t$text = '';\n\n\t\t$hdrs = array();\n\t\t$hdrs['From'] = get_option( 'woocommerce_email_from_address' );\n\t\t$hdrs['To'] = $supplier_info['order_email_addresses'].','.get_option( 'woocommerce_email_from_address' );\n\t\t$hdrs['CC'] = get_option( 'woocommerce_email_from_address' );\n\t\t$hdrs['Subject'] = 'New Order #'.$order_info['id'].' From '.get_option( 'woocommerce_email_from_name' );\n\t\t$hdrs['Content-Type'] = 'multipart/mixed';\n\t\tif (strlen($supplier_info['account_number']) > 0)\n\t\t{\n\t\t\t$text .= get_option( 'woocommerce_email_from_name' ).' account number: '.$supplier_info['account_number'].'<br/>';\n\t\t}\n\t\t$text = $this->get_packingslip_html($order_info,$supplier_info);\n\t\t$text = $options['email_order_note'] . $text;\n\t\t$html = apply_filters('wc_dropship_manager_send_order_email_html',$text);\n\n\t\t // Filters for the email\n\t\tadd_filter( 'wp_mail_from', array( $this, 'get_from_address' ) );\n\t\tadd_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) );\n\t\tadd_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) );\n\t\twp_mail( $hdrs['To'], $hdrs['Subject'], $html, $hdrs, $attachments );\n\n\t\t// Unhook filters\n\t\tremove_filter( 'wp_mail_from', array( $this, 'get_from_address' ) );\n\t\tremove_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) );\n\t\tremove_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) );\n\t}", "public function print_purchase_order(Request $request, $slack){\n $data['menu_key'] = 'MM_ORDERS';\n $data['sub_menu_key'] = 'SM_PURCHASE_ORDERS';\n check_access([$data['sub_menu_key']]);\n\n $purchase_order = PurchaseOrderModel::where('slack', '=', $slack)->first();\n \n if (empty($purchase_order)) {\n abort(404);\n }\n\n $purchase_order_data = new PurchaseOrderResource($purchase_order);\n\n $print_logo_path = config(\"app.invoice_print_logo\");\n \n $print_data = view('purchase_order.invoice.po_print', ['data' => json_encode($purchase_order_data), 'logo_path' => $print_logo_path])->render();\n\n $mpdf_config = [\n 'mode' => 'utf-8',\n 'format' => 'A4',\n 'orientation' => 'P',\n 'margin_left' => 7,\n 'margin_right' => 7,\n 'margin_top' => 7,\n 'margin_bottom' => 7,\n 'tempDir' => storage_path().\"/pdf_temp\" \n ];\n\n $stylesheet = File::get(public_path('css/purchase_order_print_invoice.css'));\n $mpdf = new Mpdf($mpdf_config);\n $mpdf->SetDisplayMode('real');\n $mpdf->WriteHTML($stylesheet,\\Mpdf\\HTMLParserMode::HEADER_CSS);\n $mpdf->SetHTMLFooter('<div class=\"footer\">Page: {PAGENO}/{nb}</div>');\n $mpdf->WriteHTML($print_data);\n header('Content-Type: application/pdf');\n $mpdf->Output('purchase_order_'.$purchase_order_data['po_number'].'.pdf', \\Mpdf\\Output\\Destination::INLINE);\n //return view('purchase_order.invoice.po_print', ['data' => json_encode($purchase_order_data)]);\n }", "public static function wc_pos_woo_on_thankyou($order_id)\n {\n $register = get_post_meta($order_id,'wc_pos_id_register', true);\n if(!empty($register))\n $register = WC_Pos_Registers::instance()->get_data($register);\n\n if(!is_array($register)){\n self::instance()->wc_pos_print_web_order_summary($order_id);\n return;\n }\n\n $receipt = WC_Pos_Receipts::instance()->get_data(isset($register[0]['detail']['receipt_template']) ? $register[0]['detail']['receipt_template'] : \"\");\n $is_html = $receipt[0]['print_by_pos_printer'] == \"html\";\n\n $selectedPrinter = isset($register[0]['settings']['receipt_printer']) ? $register[0]['settings']['receipt_printer'] : \"\";\n if(empty($selectedPrinter)){\n $printerList = WC_POS_CPI()->star_cloudprnt_get_printer_list();\n if (!empty($printerList))\n {\n foreach ($printerList as $printer)\n {\n if (get_option('wc_pos_selected_printer') == $printer['printerMAC'])\n {\n $selectedPrinter = $printer['printerMAC'];\n break;\n }\n }\n if ($selectedPrinter === \"\" && count($printerList) === 1) $selectedPrinter = $printer['printerMAC'];\n }\n }\n\n if ($selectedPrinter !== \"\"){\n if($is_html){\n self::instance()->wc_pos_print_html_order_summary($selectedPrinter, $order_id, $register);\n }else{\n $file = STAR_CLOUDPRNT_PRINTER_PENDING_SAVE_PATH.WC_POS_CPI()->star_cloudprnt_get_os_path(\"/order_\".$order_id.\"_\".time().\".bin\");\n self::instance()->wc_pos_print_order_summary($selectedPrinter, $file, $order_id, $register);\n }\n };\n }", "function receipt_page( $order ) {\n\n\t\t\techo '<p>'. __( 'Thank you for your order, please click the button below to pay with eSewa.', 'esewa-payment-gateway-for-woocommerce' ) . '</p>';\n\t\t\techo $this->generate_esewa_form( $order );\n\n\t\t}", "public function printsPurchase(Request $request)\n\t{\n\t\t$photos = $request->photos;\n\t\t$albumID = $request->album_id;\n\t\t$album = ClientAlbum::find($albumID);\n\t\t$client = $album->client;\n\t\t$clientName = $client->first_name.\" \". $client->last_name;\n\t\t$orderID = $request->order_id\n\t\t;\n\t\tif($orderID != '')\n\t\t{\n\t\t\t$order = Order::find($orderID);\n\t\t\tDB::table('client_prints_selections')->where('print_order_id','=',$orderID)->delete();\n\t\t\tSession::flash('message', FlashMessage::DisplayAlert('Your prints purchase was saved!', 'success'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//create prints order in database\n\t\t\t$order = new Order();\n\t\t\t$order->client_album_id = $albumID;\n\t\t\t$order->client_id = $client->id;\n\t\t\t$order->status = \"In Progress\";\n\t\t\t$order->type = \"Prints Order\";\n\t\t\t$order->save();\n\t\t\tSession::flash('message', FlashMessage::DisplayAlert('Your prints purchase was successful!', 'success'));\n\n\t\t\tMail::send('emails.order_confirmation',[],function($message) use($client,$clientName)\n\t\t\t{\n\t\t\t\t$message->to($client->email,$clientName)->subject('Prints Order Received');\n\t\t\t});\n\n\t\t}\n\n\t\tforeach ($photos as $photo)\n\t\t{\n\t\t\t$selectedPhoto = new ClientPrintsSelection();\n\t\t\t$selectedPhoto->print_order_id = $order->id;\n\t\t\t$selectedPhoto->client_album_photo_id = $photo[\"photo_id\"];\n\t\t\t$selectedPhoto->format_id = $photo[\"format_id\"];\n\t\t\t$selectedPhoto->quantity = $photo[\"quantity\"];\n\t\t\t$selectedPhoto->save();\n\t\t}\n\n\t\tMail::send('emails.admin_order_notification',[],function($message)\n\t\t{\n\t\t\t$message->to(Config::get('constants.site.OWNEREMAIL'),Config::get('constants.site.OWNERNAME'))->subject('Prints Order Received');\n\t\t});\n\t}", "public function download() {\n if(empty($this->customer['id'])) {\n $this->response['error'][] = $this->locale['ERR_4002'];\n $this->response['logout'] = 1;\n return false;\n }\n\n if(empty($this->params['object']) || !$this->validator->isPositiveInteger($this->params['object'])) {\n $this->response['error'][] = $this->locale['ERR_1005'];\n return false;\n }\n\n $item = $this->orderModel->getOne($this->params['object'], $this->language['id']);\n \n if(!$item || empty($item['id'])) {\n $this->response['error'][] = $this->locale['ERR_1005'];\n return false;\n }\n\n $cars = $this->orderModel->getCars($item['id']);\n if(!$cars || count($cars) < 1) {\n $this->response['error'][] = $this->locale['ERR_1005'];\n return false;\n }\n \n $euro = $this->getCurrency($this->defaults['currencyEuroId']);\n\n $html = '';\n\n $this->template->set( $this->tplPath . 'pdf.html');\n $this->template->set( $this->tplPath . 'pdf-item.html', false);\n\n $count = count($cars);\n for($j = 0; $j < $count; $j++) {\n $car = $this->carModel->getOne($cars[$j]['car_id'], $this->language['id']);\n\n if($this->currency['id'] != $euro['id']) {\n $cars[$j]['final_price'] = $this->getFormatMoney($cars[$j]['final_price'] / $this->currency['in_euro']);\n $cars[$j]['price'] = $this->getFormatMoney($cars[$j]['price'] / $this->currency['in_euro']);\n $cars[$j]['one_time_fee'] = $this->getFormatMoney($cars[$j]['one_time_fee'] / $this->currency['in_euro']);\n $cars[$j]['renewal_fee'] = $this->getFormatMoney($cars[$j]['renewal_fee'] / $this->currency['in_euro']);\n $cars[$j]['holidays_fee'] = $this->getFormatMoney($cars[$j]['holidays_fee'] / $this->currency['in_euro']);\n $cars[$j]['discount_days_fee'] = $this->getFormatMoney($cars[$j]['discount_days_fee'] / $this->currency['in_euro']);\n $cars[$j]['termination_penalty_fee'] = $this->getFormatMoney($cars[$j]['termination_penalty_fee'] / $this->currency['in_euro']);\n }\n\n $details = '';\n if($cars[$j]['one_time_fee'] > 0) {\n $details .= $this->locale['STR_ONE_TIME_FEE'] . ': <strong>' . $cars[$j]['one_time_fee'] . $this->currency['sign'] . '</strong><br/>';\n }\n if($cars[$j]['renewal_fee'] > 0) {\n $details .= $this->locale['STR_RENEWAL_FEE'] . ': <strong>' . $cars[$j]['renewal_fee'] . $this->currency['sign'] . '</strong><br/>';\n }\n if($cars[$j]['holidays_fee'] > 0) {\n $details .= $this->locale['STR_HOLIDAYS_FEE'] . ': <strong>' . $cars[$j]['holidays_fee'] . $this->currency['sign'] . '</strong><br/>';\n }\n if($cars[$j]['discount_days_fee'] > 0) {\n $details .= $this->locale['STR_DISCOUNT_DAYS_FEE'] . ': <strong>' . $cars[$j]['discount_days_fee'] . $this->currency['sign'] . '</strong><br/>';\n }\n if($cars[$j]['termination_penalty_fee'] > 0) {\n $details .= $this->locale['STR_TERMINATION_FEE'] . ': <strong>' . $cars[$j]['termination_penalty_fee'] . $this->currency['sign'] . '</strong><br/>';\n }\n\n if(!empty($cars[$j]['termination_date'])) {\n $cars[$j]['end_date'] = $cars[$j]['termination_date'];\n }\n\n $tplVars = [\n 'TITLE' => $car['title'], \n 'CATEGORY' => $car['category'], \n 'DATE_FROM' => date($this->dayFormat, strtotime($cars[$j]['start_date'])), \n 'DATE_TILL' => date($this->dayFormat, strtotime($cars[$j]['end_date'])), \n 'BASE_PRICE' => $this->getFormatMoney($cars[$j]['price']), \n 'DETAILS' => $details, \n 'PRICE' => $this->getFormatMoney($cars[$j]['final_price']), \n 'CURRENCY_SIGN' => $this->currency['sign']\n ];\n\n $this->template->setVars( $tplVars );\n $html .= $this->template->parse(false);\n }\n\n if($this->currency['id'] != $euro['id']) {\n $item['final_price'] = $this->getFormatMoney($item['final_price'] / $this->currency['in_euro']);\n $item['price'] = $this->getFormatMoney($item['price'] / $this->currency['in_euro']);\n $item['one_time_fee'] = $this->getFormatMoney($item['one_time_fee'] / $this->currency['in_euro']);\n $item['renewal_fee'] = $this->getFormatMoney($item['renewal_fee'] / $this->currency['in_euro']);\n $item['holidays_fee'] = $this->getFormatMoney($item['holidays_fee'] / $this->currency['in_euro']);\n $item['discount_days_fee'] = $this->getFormatMoney($item['discount_days_fee'] / $this->currency['in_euro']);\n $item['termination_penalty_fee'] = $this->getFormatMoney($item['termination_penalty_fee'] / $this->currency['in_euro']);\n }\n\n $details = '';\n if($item['one_time_fee'] > 0) {\n $details .= $this->locale['STR_ONE_TIME_FEE'] . ': <strong>' . $item['one_time_fee'] . $this->currency['sign'] . '</strong><br/>';\n }\n if($item['renewal_fee'] > 0) {\n $details .= $this->locale['STR_RENEWAL_FEE'] . ': <strong>' . $item['renewal_fee'] . $this->currency['sign'] . '</strong><br/>';\n }\n if($item['holidays_fee'] > 0) {\n $details .= $this->locale['STR_HOLIDAYS_FEE'] . ': <strong>' . $item['holidays_fee'] . $this->currency['sign'] . '</strong><br/>';\n }\n if($item['discount_days_fee'] > 0) {\n $details .= $this->locale['STR_DISCOUNT_DAYS_FEE'] . ': <strong>' . $item['discount_days_fee'] . $this->currency['sign'] . '</strong><br/>';\n }\n if($item['termination_penalty_fee'] > 0) {\n $details .= $this->locale['STR_TERMINATION_FEE'] . ': <strong>' . $item['termination_penalty_fee'] . $this->currency['sign'] . '</strong><br/>';\n }\n\n if(!empty($item['termination_date'])) {\n $item['end_date'] = $item['termination_date'];\n }\n\n $tplVars = [\n 'STR_ORDER_DATE' => $this->locale['STR_ORDER_DATE'], \n 'STR_CAR' => $this->locale['STR_CAR'], \n 'STR_RENT_DATE' => $this->locale['STR_RENT_DATE'], \n 'STR_BASE_PRICE' => $this->locale['STR_BASE_PRICE'], \n 'STR_DETAILS' => $this->locale['STR_DETAILS'], \n 'STR_PRICE' => $this->locale['STR_PRICE'], \n 'STR_TOTAL' => $this->locale['STR_TOTAL'], \n 'INVOICE' => $item['invoice'], \n 'DATE_FROM' => date($this->dayFormat, strtotime($item['start_date'])), \n 'DATE_TILL' => date($this->dayFormat, strtotime($item['end_date'])), \n 'ITEMS' => $html, \n 'BASE_PRICE' => $this->getFormatMoney($item['price']), \n 'DETAILS' => $details, \n 'TOTAL_PRICE' => $this->getFormatMoney($item['final_price']), \n 'CURRENCY_SIGN' => $this->currency['sign']\n ];\n\n $this->template->setVars( $tplVars );\n $html = $this->template->parse();\n\n $mpdf = new \\Mpdf\\Mpdf();\n $mpdf->WriteHTML($html);\n $mpdf->Output($item['invoice'] . '.pdf','D');\n }", "function displayOrder($orderoid){\n $r = array();\n // le champ INFOCOMPL de WTSCATALOG (PRODUCT) est optionnel, si présent nécessaire dans certains documents\n $r['do'] = $this->dsorder->display(array('oid'=>$orderoid, \n\t\t\t\t\t 'selectedfields'=>'all', \n\t\t\t\t\t 'options'=>array('PICKUPPOINT'=>array('target_fields'=>array('title')))\n\t\t\t\t\t ));\n $r['bl'] = $this->dsline->browse(\n\t\t\t\t array('selectedfields'=>'all',\n\t\t\t\t\t 'options'=>array('PRODUCT'=>array('target_fields'=>array('INFOCOMPL', 'label'))),\n\t\t\t\t\t 'order'=>'WTPCARD, REFERENCE',\n\t\t\t\t\t 'pagesize'=>9999,\n\t\t\t\t\t 'first'=>0,\n\t\t\t\t\t 'select'=>$this->dsline->select_query(array('cond'=>array('LNKORDER'=>array('=', $orderoid))))));\n // mise en forme des lignes achats carte, utlisation bonus, assurance, port\n // recup du premier jour de ski (paiement chq)\n $r['bl']['lines__bonu'] = array();\n $r['bl']['lines__validfromhidden'] = array();\n $r['bl']['lines__cart'] = array();\n $r['bl']['lines__assu'] = array();\n $r['bl']['lines__validtill'] = array();\n $r['bl']['lines__annul'] = array_fill(0, count($r['bl']['lines_oid']), false);\n $r['_totassu'] = 0;\n $r['_totcart'] = 0;\n $r['_totport'] = 0;\n $r['_nbforf'] = 0;\n $r['_tot1'] = 0;\n $r['_tot2'] = 0;\n $r['_totassuAnnul'] = 0;\n $r['_totcartAnnul'] = 0;\n $r['_totportAnnul'] = 0;\n $r['_tot1Annul'] = 0;\n $r['_tot2Annul'] = 0;\n $r['_cartesseules'] = array();\n $cartesfaites = array();\n $firstday = NULL;\n $nodates = true;\n // rem : assur pointe sur son forfait\n // bonus pointe sur son forfait\n // les forfaits de nouvelles cartes pointent TOUS vers la ligne ...\n // a ne compter qu'ne fois donc\n //\n // ajout du calendrier pour les lignes forfaits\n //\n foreach($r['bl']['lines_oLINETYPE'] as $l=>$olinetype){\n if ($r['bl']['lines_oETATTA'][$l]->raw == XModEPassLibre::$WTSORDERLINE_ETATTA_ANNULATION){\n $r['bl']['lines__annul'][$l] = true;\n }\n $r['bl']['lines__validfromhidden'][$l] = 0;\n if($olinetype->raw == 'port'){\n\t$r['_totport']+=$r['bl']['lines_oTTC'][$l]->raw;\n }\n if($olinetype->raw == 'forf'){\n /* -- vente de cartes seules -- */\n $r['_nbforf'] += 1;\n /* -- vente de cartes seules -- */\n $r['_tot1']+=$r['bl']['lines_oTTC'][$l]->raw;\n if ($r['bl']['lines__annul'][$l] == true)\n\t $r['_tot1Annul']+= $r['bl']['lines_oTTC'][$l]->raw;\n if ($firstday == NULL || $r['bl']['lines_oVALIDFROM'][$l]->raw < $firstday)\n $firstday = $r['bl']['lines_oVALIDFROM'][$l]->raw;\n $rsc = selectQueryGetAll(\"select type from \".self::$tablePRDCALENDAR.\" c where c.koid=(select calendar from \".self::$tablePRDCONF.\" pc where pc.koid=(select prdconf from \".self::$tableCATALOG.\" p where p.koid='{$r['bl']['lines_oPRODUCT'][$l]->raw}'))\");\n if (count($rsc)>=1 && $rsc[0]['type'] == 'NO-DATE'){\n $r['bl']['lines__validfromhidden'][$l] = 1;\n } else {\n // calcul du validtill\n $dp = $this->modcatalog->displayProduct(NULL, NULL, NULL, NULL, $r['bl']['lines_oPRODUCT'][$l]->raw);\n $dpc = $this->modcatalog->getPrdConf($dp);\n $r['bl']['lines__validtill'][$l] = $this->getValidtill($r['bl']['lines_oVALIDFROM'][$l]->raw, $dp, $dpc);\n $nodates = false;\n }\n }\n $r['_tot2']+=$r['bl']['lines_oTTC'][$l]->raw;\n if ($r['bl']['lines__annul'][$l] == true)\n $r['_tot2Annul']+= $r['bl']['lines_oTTC'][$l]->raw;\n\n $ll = false;\n if (!empty($r['bl']['lines_oLNKLINE'][$l]->raw)){\n $ll = array_search($r['bl']['lines_oLNKLINE'][$l]->raw, $r['bl']['lines_oid']);\n }\n if ($ll === false)\n continue;\n\n if($r['bl']['lines_oLINETYPE'][$ll]->raw == 'cart'){\n if (!isset($cartesfaites['_'.$ll])){\n $r['_totcart']+= $r['bl']['lines_oTTC'][$ll]->raw;\n $cartesfaites['_'.$ll] = 1;\n if ($r['bl']['lines__annul'][$ll] == true)\n $r['_totcartAnnul']+= $r['bl']['lines_oTTC'][$ll]->raw;\n }\n $r['bl']['lines__cart'][$l] = $ll;\n }\n if($olinetype->raw == 'bonu' && $r['bl']['lines_oLINETYPE'][$ll]->raw == 'forf'){\n $r['bl']['lines__bonu'][$ll] = $l;\n }\n if($olinetype->raw == 'assu' && $r['bl']['lines_oLINETYPE'][$ll]->raw == 'forf'){\n $r['bl']['lines__assu'][$ll] = $l;\n $r['_totassu']+= $r['bl']['lines_oTTC'][$l]->raw;\n if ($r['bl']['lines__annul'][$l] == true)\n $r['_totassuAnnul']+= $r['bl']['lines_oTTC'][$l]->raw;\n }\n }\n // utilisation avoirs et coupons\n if ($r['_tot2'] <= 0){\n $r['_tot2'] = 0;\n }\n /* -- vente de cartes seules -- */\n foreach($r['bl']['lines_oLINETYPE'] as $l=>$olinetype){\n if($r['bl']['lines_oLINETYPE'][$l]->raw == 'cart'){\n if (!isset($cartesfaites['_'.$l])){\n $r['_totcart']+= $r['bl']['lines_oTTC'][$l]->raw;\n $cartesfaites['_'.$l] = 1;\n $r['_cartesseules'][] = $l;\n }\n }\n }\n // calcul des totaux - annulations (pro)\n foreach(array('_tot1', '_tot2', '_totassu') as $tn){\n $r[$tn.'C'] = $r[$tn] - $r[$tn.'Annul'];\n }\n if ($firstday == NULL){\n $firstday = $r['do']['oFIRSTDAYSKI']->raw;\n }\n /* -- vente de cartes seules -- */\n $r['firstday'] = $firstday;\n $r['nodates'] = $nodates;\n /* -- cas des commandes pro -- */\n if ($this->customerIsPro()){\n $this->summarizeOrder($r);\n }\n\n return $r;\n }", "protected function _printPdf(stdClass $response, Mage_Sales_Model_Order $order)\n {\n $localeDate = Mage::app()->getLocale()->date($response->issueDate);\n $filenameDate = Mage::getSingleton('core/date')->date('Y-m-d', $response->issueDate);\n\n $this->_prepareDownloadResponse(\n sprintf(\n \"%s_Return_%s_%s.pdf\",\n str_replace(\" \", \"_\", Mage::app()->getStore()->getName()),\n $order->getIncrementId(),\n $filenameDate\n ),\n base64_decode($response->label),\n 'application/pdf'\n );\n\n $comment = 'Return label with ident code (IDC) %s successfully created on %s.';\n $order\n ->addStatusHistoryComment($this->__($comment, $response->idc, $localeDate))\n ->setIsVisibleOnFront(true)\n ->save();\n\n Mage::helper(\"dhlonlineretoure/validate\")->logSuccess();\n return $this;\n }", "public function ajaxProcessPrintZprnLabel()\n {\n $id_order = (int)Tools::getValue('id_order');\n $order = new Order($id_order);\n\n if (!Validate::isLoadedObject($order)) {\n exit('Order not exists');\n }\n\n $label_format = SpringXbsHelper::get(Springxbs::LABEL_FORMAT);\n $shipment = \\Db::getInstance()->getRow(\"SELECT * FROM \" . _DB_PREFIX_ . \"springxbs_shipment \n WHERE id_order = '\" . (int)$order->id . \"' AND label_format='\" . pSQL($label_format) . \"'\");\n\n if (!$shipment['label']) {\n exit('Shipment not ordered yet');\n }\n\n $label = SpringXbsHelper::decodeData($shipment['label']);\n echo $label;\n exit();\n }", "public static function geoCart_process_orderDisplay()\n {\n //use to display some success/failure page, if that applies to this type of gateway.\n\n\n //build response for user\n $cart = geoCart::getInstance();\n $db = DataAccess::getInstance();\n $messages = $db->get_text(true, 180);\n\n $tpl = new geoTemplate('system', 'payment_gateways');\n $tpl->assign($cart->getCommonTemplateVars());\n $tpl->assign('page_title', $messages[3142]);\n $tpl->assign('page_desc', $messages[3143]);\n $tpl->assign('success_failure_message', $messages[3167]);\n $tpl->assign('my_account_url', $db->get_site_setting('classifieds_file_name') . '?a=4&amp;b=3');\n $tpl->assign('my_account_link', $messages[3169]);\n\n $invoice = $cart->order->getInvoice();\n if (is_object($invoice) && $invoice->getId()) {\n $tpl_vars['invoice_url'] = geoInvoice::getInvoiceLink($invoice->getId(), false, defined('IN_ADMIN'));\n }\n\n $html = $tpl->fetch('shared/transaction_approved.tpl');\n $cart->site->body .= $html;\n $cart->site->display_page();\n\n return $html;\n }", "function order($filename)\n {\n\t// Build a receipt for the chosen order\n\t$order = $this->order->getOrder($filename);\n $burgerno = 1;\n $btotal = 0;\n $total = 0;\n $burgers = array();\n \n\t// Present the list to choose from\n\t$this->data['pagebody'] = 'justone';\n \n // Order heading\n $this->data['order'] = (substr($filename, 0, strlen($filename) - 4));\n $this->data['name'] = $order['customer'];\n $this->data['type'] = $order['type'];\n \n foreach($order['burgers'] as $burger) {\n $cheeses = array();\n $toppings = array();\n $sauces = array();\n // Patty\n $btotal += $this->menu->getPatty($burger['patty'])->price;\n // Cheese\n if (!isset($burger['cheeses']['top'])) {\n $cheeses['top'] = (string)\"None\";\n } else {\n $temp = $this->menu->getCheese($burger['cheeses']['top']);\n $cheeses['top'] = $temp->name;\n $btotal += $this->menu->getCheese($burger['cheeses']['top'])->price;\n }\n if (!isset($burger['cheeses']['bottom'])) {\n $cheeses['bottom'] = (string)\"None\";\n } else {\n $temp = $this->menu->getCheese($burger['cheeses']['bottom']);\n $cheeses['bottom'] = $temp->name;\n $btotal += $this->menu->getCheese($burger['cheeses']['top'])->price;\n }\n \n // Toppings\n foreach ($burger['toppings'] as $topping) {\n $toppings[] = array('topping' => $this->menu->getTopping($topping)->name);\n $btotal += $this->menu->getTopping($topping)->price;\n }\n \n // Sauces\n foreach ($burger['sauces'] as $sauce) {\n $sauces[] = array('sauce' => $this->menu->getSauce($sauce)->name);\n $btotal += $this->menu->getSauce($sauce)->price;\n }\n // Burger total\n $total += $btotal;\n \n $burgers[] = array('burgerno' => $burgerno++, 'base' => $this->menu->getPatty($burger['patty'])->name, \n 'top' => $cheeses['top'], 'bottom' => $cheeses['bottom'], 'toppings' => $toppings, 'sauces' => $sauces, \n 'btotal' => $btotal);\n }\n $this->data['burgers'] = $burgers;\n // Order total\n $this->data['total'] = $total;\n\t$this->render();\n }", "public function print_receipt() {\n $userid = $this->input->post('userId');\n $data = $this->get_pdf_data($userid);\n //modified on 27/11/2014\n $data['meta_data'] = $this->meta_data;\n return generate_payment_receipt($data);\n }", "public static function print(){\r\n \t$printerName = env('PRINTER', 'HP_DeskJet_5820_series');\r\n\r\n \t//sample file\r\n \t$fileName = 'Voucher-4-1.pdf';\r\n \t$filePath = storage_path('app/public/print/' . $fileName);\r\n \t\r\n \t$response = self::runShellCommand('lpr -P ' . $printerName . ' ' . $filePath);\r\n\r\n \treturn $response;\r\n }", "public function invoiceDownloadAction(BaseOrder $order)\n {\n $fileName = str_replace(' ', '_', 'files/invoices/' . $order->getInvoiceReference()) . '.pdf';\n\n if (file_exists($fileName)) {\n unlink($fileName);\n }\n\n if (true) {\n $bill = $this->renderView(\n 'DyweeOrderBundle:Order:invoice.html.twig',\n [\n 'order' => $order\n ],\n true\n );\n\n $this->get('knp_snappy.pdf')->generateFromHtml(\n $bill,\n $fileName\n );\n //}\n\n //else{\n $response = new Response();\n\n // Set headers\n $response->headers->set('Cache-Control', 'private');\n $response->headers->set('Content-type', mime_content_type($fileName));\n $response->headers->set('Content-Disposition', 'attachment; filename=\"' . basename($fileName) . '\";');\n $response->headers->set('Content-length', filesize($fileName));\n\n // Send headers before outputting anything\n $response->sendHeaders();\n\n $response->setContent(readfile($fileName));\n /*return new Response(\n $this->get('knp_snappy.pdf')->getOutput($this->generateUrl('invoice_view', array('idOrder' => $idOrder), true)),\n 200,\n array(\n 'Content-Type' => 'application/pdf',\n 'Content-Disposition' => 'attachment; filename=\"LB1X '.$order->getInvoiceReference().'.pdf\"'\n )\n );\n }*/\n }\n }", "public function receipt()\n\t{\n\t\t\n\t\t$this->templateFileName = 'receipt.tpl';\n\t\t\n\t\tif (!isset($_REQUEST['orderID']))\n\t\t{\n\t\t\tthrow new \\Exception(\"Incorrect parameters\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\n\t\t\t// Get the order data\n\t\t\t$order = $this->dbConnection->prepareRecord(\"SELECT o.order_id, DATE_FORMAT(o.order_timestamp, '%W, %M %D, %Y') AS order_timestamp, r.description AS order_status, subtotal, tax, shipping, total, user_id, shipping_address_id, billing_address_id, payment_id FROM b_order o INNER JOIN b_reference r ON o.order_status = r.data_value AND r.data_member = 'ORDER_STATUS' WHERE order_id = ?\", $_REQUEST['orderID']);\n\t\t\t\n\t\t\t// Make sure the order is for the current user\n\t\t\tif ($order['user_id'] != $this->session->userID)\n\t\t\t{\n\t\t\t\tthrow new \\Exception(\"The order is for another user.\");\n\t\t\t}\n\n\t\t\t// Get the order lines\n\t\t\t$order_items = $this->dbConnection->prepareRecordSet(\"SELECT oi.order_id, oi.item_id, oi.item_sequence, oi.quantity, oi.price, oi.extended_price, oi.line_status, i.item_name, i.item_description, i.image_url, i.thumb_url, i.price, i.isbn, i.author, i.category_id FROM b_order_item oi INNER JOIN b_item i ON oi.item_id = i.item_id WHERE oi.order_id = ? ORDER BY oi.item_sequence\", $_REQUEST['orderID'] );\n\t\t\t\n\t\t\t// Get the addresses\n\t\t\t$shipping_address = $this->dbConnection->prepareRecord(\"SELECT * FROM b_user_address WHERE address_id = ?\", $order['shipping_address_id']);\n\t\t\t$billing_address = $this->dbConnection->prepareRecord(\"SELECT * FROM b_user_address WHERE address_id = ?\", $order['billing_address_id']);\n\t\t\t$payment_method = $this->dbConnection->prepareRecord(\"SELECT payment_id, payment_type, credit_card_type, payment_name, RIGHT(account_number, 4) AS account_number_last_4, LPAD(RIGHT(account_number, 4), LENGTH(account_number), 'X') AS account_number, card_expiration_month, card_expiration_year, rp.description AS payment_type_description, rc.description AS credit_card_type_description FROM b_payment INNER JOIN b_reference rp ON rp.data_member = 'PAYMENT_TYPE' AND rp.data_value = payment_type LEFT OUTER JOIN b_reference rc ON rc.data_member = 'CREDIT_CARD_TYPE' AND rc.data_value = credit_card_type WHERE payment_id = ?\", $order['payment_id']);\n\t\t\t\n\t\t\t$this->set('order', $order);\n\t\t\t$this->set('order_items', $order_items);\n\t\t\t$this->set('shipping_address', $shipping_address);\n\t\t\t$this->set('billing_address', $billing_address);\n\t\t\t$this->set('payment_method', $payment_method);\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "public function purchase_print($purchase_no = NULL)\n {\n $data['title'] = 'POS System';\n $data['master'] = $this->MPurchase_master->get_by_purchase_no($purchase_no);\n $data['details'] = $this->MPurchase_details->get_by_purchase_no($purchase_no);\n $data['company'] = $this->MCompanies->get_by_id($data['master'][0]['company_id']);\n $data['privileges'] = $this->privileges;\n $this->load->view('admin/inventory/purchase/print', $data);\n }", "public static function admin_order_display( $wc_order_id, $print_barcode = true, $admin_panel = true )\n {\n if ( is_object($wc_order_id) ) {\n $wc_order_id = $wc_order_id->get_id();\n }\n $configs = OmnivaLt_Core::get_configs();\n $order = OmnivaLt_Wc_Order::get_data($wc_order_id);\n $send_method = $order->omniva->method;\n $omnivalt_labels = new OmnivaLt_Labels();\n\n $is_omniva = false;\n foreach ( $configs['method_params'] as $ship_method => $ship_values ) {\n if ( ! $ship_values['is_shipping_method'] ) continue;\n if ( $send_method == $ship_values['key'] ) {\n $is_omniva = true;\n }\n }\n \n if ( $send_method !== false && ! $is_omniva ) {\n self::add_Omniva_manually();\n }\n if ( ! $is_omniva ) return;\n\n if ( self::is_admin_order_edit_page($order->id) ) {\n echo '<br class=\"clear\"/>';\n echo '<hr style=\"margin-top:20px;\">';\n echo '<h4>' . __('Omniva shipping', 'omnivalt') . '</h4>';\n }\n \n echo '<div class=\"address\">';\n foreach ( $configs['method_params'] as $ship_method => $ship_values ) {\n if ( ! $ship_values['is_shipping_method'] ) continue;\n if ( $send_method != $ship_values['key'] ) continue;\n\n $field_value = $order->shipment->formated_shipping_address;\n if ( $ship_values['key'] == 'pt' || $ship_values['key'] == 'ps' ) {\n $field_value = OmnivaLt_Terminals::get_terminal_address($order->omniva->terminal_id);\n }\n \n echo '<p><strong class=\"title\">' . $ship_values['title'] . ':</strong> ' . $field_value . '</p>';\n }\n\n if ( self::is_admin_order_edit_page($order->id) ) {\n echo self::build_shipment_size_text($order->shipment->size);\n }\n\n $services = OmnivaLt_Helper::get_order_services($order);\n\n if ( ! empty($services) ) {\n echo '<p><strong class=\"title\">' . __('Services', 'omnivalt') . ':</strong> ';\n $output = '';\n foreach ( $services as $service ) {\n if ( ! empty($output) ) $output .= ', ';\n foreach ( $configs['additional_services'] as $service_key => $service_values ) {\n if ( $service === $service_key ) $output .= $service_values['title'];\n }\n }\n echo $output . '</p>';\n }\n\n if ( $print_barcode ) {\n echo str_replace('<br/>', '', $omnivalt_labels->print_tracking_link($order, $admin_panel, false));\n }\n echo '</div>';\n \n if ( ! self::is_admin_order_edit_page($order->id) ) {\n return;\n }\n\n echo '<div class=\"edit_address\">';\n if ( $send_method == 'pt' || $send_method == 'ps' ) {\n $values = array(\n 'terminal_key' => OmnivaLt_Configs::get_method_terminals_type($send_method),\n 'change_title' => sprintf(__('Change %s', 'omnivalt'), strtolower(OmnivaLt_Configs::get_method_title($send_method))),\n );\n\n $all_terminals = OmnivaLt_Terminals::get_terminals_list('ALL', $values['terminal_key']);\n $selected_terminal = $order->omniva->terminal_id;\n \n echo '<p class=\"form-field-wide\">';\n echo '<label for=\"omnivalt_terminal\">' . $values['change_title'] . '</label>';\n echo '<input type=\"hidden\" id=\"omniva-order-country\" value=\"' . $order->shipping->country . '\">';\n echo '<select id=\"omnivalt_terminal\" class=\"select short\" name=\"omnivalt_terminal_id\">';\n echo '<option>-</option>';\n foreach ($all_terminals as $country => $country_terminals) {\n foreach ($country_terminals as $county => $terminals) {\n echo '<optgroup data-country=\"' . $country . '\" label=\"' . $county . '\">';\n foreach ($terminals as $terminal_id => $terminal_name) {\n $selected = ($terminal_id == $selected_terminal) ? 'selected' : '';\n echo '<option value=\"' . $terminal_id . '\" ' . $selected . '>' . $terminal_name . '</option>';\n }\n echo '</optgroup>';\n }\n }\n echo '</select>';\n echo '</p>';\n } else {\n echo __('The delivery address is changed in the fields above', 'omnivalt');\n }\n\n echo self::build_shipment_size_fields($order->shipment->size);\n \n foreach ( $configs['additional_services'] as $service_key => $service_values ) {\n if ( $service_values['add_always'] ) continue;\n if ( ! $service_values['in_order'] ) continue;\n \n echo '<p class=\"form-field-wide\">';\n $field_id = 'omnivalt_' . $service_key;\n echo '<label for=\"' . $field_id . '\">' . $service_values['title'] . '</label>';\n if ($service_values['in_order'] === 'checkbox') {\n echo '<select id=\"' . $field_id . '\" class=\"select short\" name=\"' . $field_id . '\">';\n echo '<option value=\"no\">' . __('No', 'omnivalt') . '</option>';\n $selected = (in_array($service_key, $services)) ? 'selected' : '';\n echo '<option value=\"yes\" ' . $selected . '>' . __('Yes', 'omnivalt') . '</option>';\n echo '</select>';\n }\n echo '</p>';\n }\n\n echo '</div>';\n echo '<hr style=\"margin-top:20px;\">';\n }", "public function preview(Request $request)\n {\n try {\n $products = $request->get('products');\n $print = $request->get('print');\n $barcode_setting = $request->get('barcode_setting');\n $business_id = $request->session()->get('user.business_id');\n\n $barcode_details = Barcode::find($barcode_setting);\n $barcode_details->stickers_in_one_sheet = $barcode_details->is_continuous ? $barcode_details->stickers_in_one_row : $barcode_details->stickers_in_one_sheet;\n $barcode_details->paper_height = $barcode_details->is_continuous ? $barcode_details->height : $barcode_details->paper_height;\n if($barcode_details->stickers_in_one_row == 1){\n $barcode_details->col_distance = 0;\n $barcode_details->row_distance = 0;\n }\n // if($barcode_details->is_continuous){\n // $barcode_details->row_distance = 0;\n // }\n\n $business_name = $request->session()->get('business.name');\n\n $product_details_page_wise = [];\n $total_qty = 0;\n foreach ($products as $value) {\n $details = $this->productUtil->getDetailsFromVariation($value['variation_id'], $business_id, null, false);\n\n for ($i=0; $i < $value['quantity']; $i++) {\n\n $page = intdiv($total_qty, $barcode_details->stickers_in_one_sheet);\n\n if($total_qty % $barcode_details->stickers_in_one_sheet == 0){\n $product_details_page_wise[$page] = [];\n }\n\n $product_details_page_wise[$page][] = $details;\n $total_qty++;\n }\n }\n\n $margin_top = $barcode_details->is_continuous ? 0: $barcode_details->top_margin*1;\n $margin_left = $barcode_details->is_continuous ? 0: $barcode_details->left_margin*1;\n $paper_width = $barcode_details->paper_width*1;\n $paper_height = $barcode_details->paper_height*1;\n\n // print_r($paper_height);\n // echo \"==\";\n // print_r($margin_left);exit;\n\n // $mpdf = new \\Mpdf\\Mpdf(['mode' => 'utf-8', \n // 'format' => [$paper_width, $paper_height],\n // 'margin_top' => $margin_top,\n // 'margin_bottom' => $margin_top,\n // 'margin_left' => $margin_left,\n // 'margin_right' => $margin_left,\n // 'autoScriptToLang' => true,\n // // 'disablePrintCSS' => true,\n // 'autoLangToFont' => true,\n // 'autoVietnamese' => true,\n // 'autoArabic' => true\n // ]\n // );\n //print_r($mpdf);exit;\n\n $i = 0;\n $len = count($product_details_page_wise);\n $is_first = false;\n $is_last = false;\n\n //$original_aspect_ratio = 4;//(w/h)\n $factor = (($barcode_details->width / $barcode_details->height)) / ($barcode_details->is_continuous ? 2 : 4);\n $html = '';\n foreach ($product_details_page_wise as $page => $page_products) {\n\n if($i == 0){\n $is_first = true;\n }\n\n if($i == $len-1){\n $is_last = true;\n }\n\n $output = view('labels.partials.preview_2')\n ->with(compact('print', 'page_products', 'business_name', 'barcode_details', 'margin_top', 'margin_left', 'paper_width', 'paper_height', 'is_first', 'is_last', 'factor'))->render();\n print_r($output);\n //$mpdf->WriteHTML($output);\n\n // if($i < $len - 1){\n // // '', '', '', '', '', '', $margin_left, $margin_left, $margin_top, $margin_top, '', '', '', '', '', '', 0, 0, 0, 0, '', [$barcode_details->paper_width*1, $barcode_details->paper_height*1]\n // $mpdf->AddPage();\n // }\n\n $i++;\n }\n\n print_r('<script>window.print()</script>');\n exit;\n //return $output;\n\n //$mpdf->Output();\n\n // $page_height = null;\n // if ($barcode_details->is_continuous) {\n // $rows = ceil($total_qty/$barcode_details->stickers_in_one_row) + 0.4;\n // $barcode_details->paper_height = $barcode_details->top_margin + ($rows*$barcode_details->height) + ($rows*$barcode_details->row_distance);\n // }\n\n // $output = view('labels.partials.preview')\n // ->with(compact('print', 'product_details', 'business_name', 'barcode_details', 'product_details_page_wise'))->render();\n\n // $output = ['html' => $html,\n // 'success' => true,\n // 'msg' => ''\n // ];\n } catch (\\Exception $e) {\n \\Log::emergency(\"File:\" . $e->getFile(). \"Line:\" . $e->getLine(). \"Message:\" . $e->getMessage());\n\n $output = __('lang_v1.barcode_label_error');\n }\n\n //return $output;\n }", "public function print_button() {\n\t\tglobal $product;\n\n\t\tswitch ( get_locale() ) {\n\t\t\tcase 'pt_BR':\n\t\t\t\t$messages = array(\n\t\t\t\t\t'instalments' => 'Número de parcelas',\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tcase 'es_ES':\n\t\t\tcase 'es_CO':\n\t\t\tcase 'es_CL':\n\t\t\tcase 'es_PE':\n\t\t\tcase 'es_MX':\n\t\t\t\t$messages = array(\n\t\t\t\t\t'instalments' => 'Meses sin intereses'\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$messages = array(\n\t\t\t\t\t'instalments' => 'Number of installments',\n\t\t\t\t);\n\t\t\t\tbreak;\n\t\t}\n\n\t\t$max_instalments = $this->gateway->fetch_acquirer_max_installments_for_price($product->price);\n\n\t\t$args = apply_filters( 'ebanx_template_args', array(\n\t\t\t\t'cards' => $this->cards,\n\t\t\t\t'cart_total' => $product->price,\n\t\t\t\t'max_installment' => min($this->gateway->configs->settings['credit_card_instalments'], $max_instalments),\n\t\t\t\t'installment_taxes' => $this->instalment_rates,\n\t\t\t\t'label' => __( 'Pay with one click', 'woocommerce-gateway-ebanx' ),\n\t\t\t\t'instalments' => $messages['instalments']\n\t\t\t) );\n\n\t\twc_get_template( 'one-click.php', $args, '', WC_EBANX::get_templates_path() . 'one-click/' );\n\t}", "public function pagePrint()\r\n\t{\r\n\t\t// Donnees\r\n\t\t$eventId = Bn::getValue('event_id');\r\n\t\t$oEvent = new Oevent($eventId);\r\n\t\t$oEventmeta = new Oeventmeta($eventId);\r\n\r\n\t\t// Controle de l'autorisation\r\n\t\tif ( $oEvent->getVal('ownerid') != Bn::getValue('user_id') && !Oaccount::isLoginAdmin() ) return false;\r\n\r\n\t\t// Preparer les champs de saisie\r\n\t\t$body = new Body();\r\n\r\n\t\t// Titres\r\n\t\t$t = $body->addP('', '', 'bn-title-2');\r\n\t\t$t->addBalise('span', '', LOC_ITEM_PRINT);\r\n\r\n\t\t// Infos generales\r\n\t\t$form = $body->addForm('frmPrint', BPREF_UPDATE_PRINT, 'divPreferences_content');\r\n\t\t//$form->getForm()->addMetadata('success', \"updated\");\r\n\t\t//$form->getForm()->addMetadata('dataType', \"'json'\");\r\n\r\n\t\t$div = $form->addDiv('', 'bn-div-left');\r\n\t\t// Liste des fonts\r\n\t\t$fonts=array(\r\n\t\t 'courier' => 'courier',\r\n\t\t 'helvetica' => 'helvetica',\r\n\t\t 'times' => 'times'\r\n\t\t );\r\n\r\n\t\t /*\r\n\t\t $handle=@opendir(\"fpdf/font\");\r\n\t\t if ($handle)\r\n\t\t {\r\n\t\t $masque = \"|(.*).z|\";\r\n\t\t while ($file = readdir($handle))\r\n\t\t {\r\n\t\t if (preg_match($masque, $file, $match)) $fonts[$match[1]] = $match[1];\r\n\t\t }\r\n\t\t closedir($handle);\r\n\t\t }\r\n\t\t */\r\n\t\t $d = $div->addDiv('', 'bn-div-line');\r\n\t\t $cbo = $d->addSelect('titlefont', LOC_LABEL_EVENT_FONT);\r\n\t\t $cbo->addOptions($fonts, $oEventmeta->getVal('titlefont'));\r\n\t\t $edt = $d->addEdit('titlesize', LOC_LABEL_EVENT_SIZE, $oEventmeta->getVal('titlesize'));\r\n\r\n\t\t $d = $div->addDiv('', 'bn-div-clear');\r\n\t\t $edt = $d->addP('', LOC_LABEL_EVENT_POSITION, 'bn-p-info');\r\n\r\n\t\t $dl = $div->addDiv('', 'bn-div-left');\r\n\t\t $edt = $dl->addEditFile('logo', LOC_LABEL_EVENT_LOGO, '');\r\n\t\t $edt->noMandatory();\r\n\t\t $logo = $oEventmeta->getVal('logo');\r\n\t\t if (!empty($logo) )\r\n\t\t {\r\n\t\t \t$logo = '../img/poster/'.$logo;\r\n\t\t \t$div->addImage('logo', $logo, 'logo', array('height'=>70, 'width'=>155));\r\n\t\t }\r\n\r\n\t\t $d = $div->addDiv('', 'bn-div-line bn-div-clear');\r\n\t\t $edt = $d->addEdit('top', LOC_LABEL_EVENT_TOP, $oEventmeta->getVal('top'));\r\n\t\t $edt = $d->addEdit('left', LOC_LABEL_EVENT_LEFT, $oEventmeta->getVal('left'));\r\n\t\t $d = $div->addDiv('', 'bn-div-line bn-div-clear');\r\n\t\t $edt = $d->addEdit('width', LOC_LABEL_EVENT_WIDTH, $oEventmeta->getVal('width'));\r\n\t\t $edt = $d->addEdit('height', LOC_LABEL_EVENT_HEIGHT, $oEventmeta->getVal('height'));\r\n\t\t $d->addBreak();\r\n\r\n\t\t $d = $form->addDiv('', 'bn-div-btn');\r\n\t\t if (!empty($logo) )\r\n\t\t {\r\n\t\t \t$d->addButton('btnDellogo', LOC_BTN_DELETE_LOGO, BPREF_DELETE_LOGO, 'trash', 'divPreferences_content');\r\n\t\t }\r\n\t\t $btn = $d->addButton('btnVisu', LOC_BTN_VISU, BPREF_VISU_PRINT, 'document');\r\n\t\t $btn->completeAttribute('class', 'bn-popup');\r\n\t\t $d->addButtonValid('btnValid', LOC_BTN_UPDATE);\r\n\r\n\t\t // Envoi au navigateur\r\n\t\t $body->addJqready('pagePrint();');\r\n\t\t $body->display();\r\n\t\t return false;\r\n\t}", "public function output($pgen,$brotherid) {\n\tglobal $qq,$qqs,$qqi,$qqu;\n\n\t$pm=new mod_prodmain;\n\t$pi=new mod_prodinfo;\n\t\n\techo \"<div{$qqi->idcstr($this->longname)}>\";\n\t$form=$this->makeselectform();\n\n\t$level=-1;\n\tif ($qqs->sessionDataExists($this->longname)) {\n\t\t$sdata=$qqs->getSessionData($this->longname);\n\t\t$aisle=$form->getControl('aisle');\n\t\t$form->getControl('aisle')->setValue((int)$sdata['aisle']);\n\t\t$form->getControl('auto')->setValue($sdata['autosubmit']);\n\t\t$sdata=$qqs->getSessionData($this->longname);\n\t\tif (False !== ($prodid=$pm->idFromBarcode($sdata['upc']))) {\n\t\t\t$info=$pi->getProdInfo($prodid);\n\t\t\t$main=$pm->getProductInfo($prodid);\n\t\t\tif ($main['prodhold']) {\n\t\t\t\t$level=2;\n\t\t\t} else {\n\t\t\t\t$locations=$pi->getOwningGroups($prodid,1);\n\t\t\t\tif (false === array_search($sdata['aisle'],$locations) || $info['shape'] == 'none' || $info['weight'] == 0) {\n\t\t\t\t\t$level=1;\n\t\t\t\t} else\n\t\t\t\t\t$level=0;\n\t\t\t}\t\t\n\t\t}\n\t} else {\n\t\t$autosubmit=$form->getControl('auto');\n\t\t$autosubmit->setValue(True);\n\t}\n\t\n\techo \"<table><tr>\";\n\techo \"<td>{$form->getOutputFormStart()}{$form->getDumpstyleFieldsetOutput('s')}{$form->getOutputFormEnd()}</td>\";\n\t\n\tif ($level > -1) {\n\t\t$color=($level == 0) ? '#8f8' : (($level == 1) ? '#ff8' : '#f88' );\n\t\techo \"<td style=\\\"background-color:$color; min-width:450px;\\\">\";\n\t\t$link=$qqi->hrefprep(\"prodedit/$prodid\");\n\t\techo \"<h2 style=\\\"font-size:15px; font-weight:bold;\\\">{$sdata['upc']} (<a href=\\\"{$link}\\\">{$prodid}</a>)</h2>\";\n\t\techo '<h3 style=\"font-size:17px; font-weight:bold; padding-top:6px\">'.addslashes($qqu->creolelite2html($info['title'])).'</h3>';\n\t\tif ($info['imageid'] != 0) {\n\t\t\t$image=new image($info['imageid']);\n\t\t\t$image->setMaximumSize(150,250);\n\t\t\techo '<p style=\"margin:6px; padding:8px; border:2px solid black; background-color:#fff;text-align:center\">'.$image->getOutput().'</p>';\n\t\t}\n\t\tif ($level == 1) {\n\t\t\t$iform=$this->makeform();\n\t\t\t\n\t\t\t$lbg=$iform->getControl('groups');\n\t\t\t$groups=$pi->getAllGroups();\n\t\t\t$lbg->addOptions($groups);\n\t\t\t$selgroups=$pi->getOwningGroups($prodid);\n\t\t\tif (is_array($sdata['last'])) {\n\t\t\t\t$sd=$sdata['last'];\n\t\t\t\tforeach ($sd['groups'] as $gid=>$true) {\n\t\t\t\t\tif (false === array_search($gid,$selgroups))\n\t\t\t\t\t\t$selgroups[]=$gid;\n\t\t\t\t}\n\t\t\t\tif (!isset($info['shape']) || $info['shape']=='') {\n\t\t\t\t\t$info['shape']=$sd['shape'];\n\t\t\t\t\t$info['dim1']=$sd['dim1'];\n\t\t\t\t\t$info['dim2']=$sd['dim2'];\n\t\t\t\t\t$info['dim3']=$sd['dim3'];\n\t\t\t\t}\n\t\t\t\tif (!isset($info['weight']) || $info['weight']=='' || $info['weight']==0) {\n\t\t\t\t\t$info['weight']=$sd['weight'];\n\t\t\t\t\tif ($sd['glass'])\n\t\t\t\t\t\t$info['flags'] |= mod_prodinfo::FLAG_FRAGILE; \n\t\t\t\t\tif ($sd['cold'])\n\t\t\t\t\t\t$info['flags'] |= mod_prodinfo::FLAG_COLD; \n\t\t\t\t}\t\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$lbg->setValue($selgroups);\n\t\t\tif ($info['shape'] == 'cylinder') {\n\t\t\t\t$iform->setValue('cylinder',True);\n\t\t\t\t$iform->setValue('cheight',$info['dim1']);\n\t\t\t\t$iform->setValue('circ',$info['dim2']);\n\t\t\t} else if ($info['shape'] == 'rect') {\n\t\t\t\t$iform->setValue('rect',True);\n\t\t\t\t$iform->setValue('height',$info['dim1']);\n\t\t\t\t$iform->setValue('width',$info['dim2']);\n\t\t\t\t$iform->setValue('depth',$info['dim3']);\n\t\t\t} else if ($info['shape'] == 'huge')\n\t\t\t\t$iform->setValue('huge',True);\n\t\t\t$iform->setValue('weight',$info['weight']);\n\t\t\t$iform->setValue('glass',($info['flags'] & mod_prodinfo::FLAG_FRAGILE) ? True : False);\t\n\t\t\t$iform->setValue('cold',($info['flags'] & mod_prodinfo::FLAG_COLD) ? True : False);\t\n\t\t\t\n\t\t\techo \"{$iform->getOutputFormStart()}\";\n\t\t\techo '</tr><tr><td colspan=\"2\" style=\"background-color:'.$color.'\"><table><tr>';\n\t\t\techo \"<td rowspan=\\\"2\\\" style=\\\"background-color:transparent\\\">{$iform->getDumpstyleFieldsetOutput('u')}</td><td colspan=\\\"4\\\">{$iform->getDumpstyleFieldsetOutput('x')}</td></tr><tr>\";\n\t\t\techo \"<td style=\\\"background-color:transparent\\\">{$iform->getDumpstyleFieldsetOutput('a')}</td>\";\n\t\t\techo \"<td style=\\\"background-color:transparent\\\">{$iform->getDumpstyleFieldsetOutput('b')}</td>\";\n\t\t\techo \"<td style=\\\"background-color:transparent\\\">{$iform->getDumpstyleFieldsetOutput('c')}</td>\";\n\t\t\techo \"<td style=\\\"background-color:transparent\\\">{$iform->getDumpstyleFieldsetOutput('d')}</td>\";\n\t\t\techo \"{$iform->getOutputFormEnd()}\";\n\t\t\techo \"</tr></table>\";\n\t\t} else if ($level == 2) {\n\t\t\techo \"<p><b>Product is on Hold</b><br>Note: {$main['notes']}</p>\";\n\t\t}\n\t\techo \"</td>\";\n\t} else\n\t\techo '<td>UPC Code Not found</td>';\n\t\n\techo \"</tr></table>\";\t\n\techo \"</div>\";\n}", "public function printPDF()\n {\n $abc = Product::all();\n $data = [\n 'title' => 'Generate PDF',\n 'heading' => 'Invoices from UNILUXX',\n 'content' => 'Product',\n 'abc' => $abc\n ];\n\n $pdf = PDF::loadView('pages.pdf_view', $data);\n return $pdf->download('uni-invoice.pdf');\n }", "public static function geoCart_process_orderDisplay()\n {\n $cart = geoCart::getInstance();\n\n self::_successFailurePage(true, $cart->order->getStatus(), true, $cart->order->getInvoice());\n\n //send email to admin if he wants it\n if ($cart->db->get_site_setting('user_set_hold_email')) {\n //echo $item_sell_class->db->get_site_setting('user_set_hold_email').\" is the setting for hold email<br />\";\n //echo \"email should be sent for ad on hold<br />\";\n $subject = \"An order has been placed!!\";\n $message = \"Admin,\\n\\n\";\n $message .= \"An order has been placed and is on hold because a \" . self::gateway_name . \" type was chosen. See the unapproved orders section of the admin.\\n\\n\";\n $message .= \"Additional orders may be in the unapproved ads section that you were not sent an email. These will be failed auto pay attempts or if you are approving all ads.\\n\\n\";\n geoEmail::sendMail($cart->db->get_site_setting('site_email'), $subject, $message);\n }\n\n //gateway is last thing to be called, so it needs to be the one that clears the session...\n $cart->removeSession();\n }", "public function box_shipping($package)\n {\n\n $this->items_temp = new \\DVDoug\\BoxPacker\\ItemList();\n\n //$bulkq = 1;\n\n $quantity = 1;\n\n $this->items_to_ship['no_drop'] = $this->get_items_to_ship($package);\n\n if (!(count($this->items_to_ship['no_drop']) > 0)) {\n\n return;\n }\n\n $items = new \\DVDoug\\BoxPacker\\ItemList();\n\n $boxes = $this->get_packing_boxes();\n\n foreach ($this->items_to_ship['no_drop'] as $post_id => $item_id) {\n\n $p = $package['contents'][$item_id];\n\n $quantity = $p['quantity'];\n\n $product_to_pack = wc_get_product($post_id);\n\n $dimensions = wc_get_product($post_id)->get_dimensions(false);\n\n $ld = $dimensions['length'] <= 0 ? WC_Shipping_Drop_Live::convert_to_mm(13) : WC_Shipping_Drop_Live::convert_to_mm($dimensions['length']);\n\n $wd = $dimensions['width'] <= 0 ? WC_Shipping_Drop_Live::convert_to_mm(13) : WC_Shipping_Drop_Live::convert_to_mm($dimensions['width']);\n\n $hd = $dimensions['height'] <= 0 ? WC_Shipping_Drop_Live::convert_to_mm(13) : WC_Shipping_Drop_Live::convert_to_mm($dimensions['height']);\n\n $wtd = WC_Shipping_Drop_Live::convert_to_grams(wc_get_product($post_id)->get_weight());\n\n $l = $product_to_pack->get_length() <= 0 ? WC_Shipping_Drop_Live::convert_to_mm(13) : WC_Shipping_Drop_Live::convert_to_mm($product_to_pack->get_length());\n\n $w = $product_to_pack->get_width() <= 0 ? WC_Shipping_Drop_Live::convert_to_mm(13) : WC_Shipping_Drop_Live::convert_to_mm($product_to_pack->get_width());\n\n $h = $product_to_pack->get_height() <= 0 ? WC_Shipping_Drop_Live::convert_to_mm(13) : WC_Shipping_Drop_Live::convert_to_mm($product_to_pack->get_height());\n\n $wt = WC_Shipping_Drop_Live::convert_to_grams($product_to_pack->get_weight());\n\n\n\n //loop through the quantity and for each on add it to the list\n\n for ($x = 1; $x < $quantity + 1; $x++) {\n\n $item_to_add = new packing_item($item_id . $x, $l, $w, $h, $wt, false);\n\n $items->insert($item_to_add);\n }\n }\n\n //pack all items into our shipping boxes and come back with an answer\n\n $packer = new \\Box_Packer();\n\n $packer->setBoxes($boxes);\n\n $packer->setItems($items);\n\n $packedBoxes = $packer->pack();\n\n return $packedBoxes;\n }", "private function generate()\n\t{\n\t\t$printer = require_once __DIR__ . '/Printer.php';\n\t\t$orders = $this->get_waiting_orders();\n\t\t\n\t\t$printer->setup($this);\n\n\t\t/*foreach ($orders as $order) {\n\t\t\t$printer->add($order);\n\t\t}*/\n\n\t\t$printer->output();\n\t}", "public function pdfPrint()\n {\n $input = Request::all();\n\n $validator = Validator::make($input, ['board_id' => 'required']);\n if ($validator->fails()) {\n return ApiResponse::validation($validator);\n }\n $board = $this->service->getById($input['board_id']);\n try {\n return $this->service->pdfPrint($board, $input);\n } catch (\\Exception $e) {\n return ApiResponse::errorInternal(trans('response.error.internal'), $e);\n }\n }", "public function generatePdf(){\n\n $order = $this->getOrder();\n if (!is_object($order)) {\n return null;\n }\n\n $service = $order->getService();\n $location = $order->getLocation();\n $customer = $order->getCustomer();\n\n if (!is_object($service) || !is_object($location) || !is_object($customer)) {\n return null;\n }\n\n //set pdf latex template\n $this->_latex->setTpl('storno');\n\n //append order\n $this->assign('order', $order);\n\n //compile template using smarty\n $pdf = $this->_latex->compile();\n\n //if file does not exists just return null\n if (!file_exists($pdf)) {\n return null;\n }\n\n return $pdf;\n }", "public function printloja($id)\n {\n $pedidoloja = Cart::where('empresa_id', Auth::user()->empresa_id)->with('user')->with('endereco')->with('orderitems')->with('complementositemcart')->find($id);\n // dd($pedidoloja);\n\n return view('pages.pedidos.pdf.order', compact('pedidoloja'));\n }", "function order($filename) {\n // Build a receipt for the chosen order\n $order = new Order($filename);\n\n $this->data['filename'] = $filename;\n $this->data['customer'] = $order->getCustomer();\n $this->data['ordertype'] = $order->getType();\n\n // handle the burgers in an order\n $count = 1;\n $this->bigbucks = 0.0;\n\n $details = '';\n foreach ($order->getBurgers() as $burger)\n $details .= $this->burp($burger, $count++);\n\n // Present this burger\n $this->data['details'] = $details;\n $delivery = $order->getDelivery();\n $this->data['delivery'] = (isset($delivery)) ? 'Delivery: ' . $delivery : '';\n $special = $order->getSpecial();\n $this->data['special'] = (isset($special)) ? 'Special instructions: ' . $special() : '';\n $this->data['bigbucks'] = '$' . number_format($this->bigbucks, 2);\n\n $this->data['pagebody'] = 'justone';\n $this->render();\n }", "public function generatepdf()\n\t\t {\n\t\t\t App::import('Vendor', 'linnwork/api/Auth');\n\t\t\t\tApp::import('Vendor', 'linnwork/api/Factory');\n\t\t\t\tApp::import('Vendor', 'linnwork/api/PrintService');\n\t\t\t\n\t\t\t\t$username = Configure::read('linnwork_api_username');\n\t\t\t\t$password = Configure::read('linnwork_api_password');\n\t\t\t\t\n\t\t\t\t$multi = AuthMethods::Multilogin($username, $password);\n\t\t\t\t\n\t\t\t\t$auth = AuthMethods::Authorize($username, $password, $multi[0]->Id);\t\n\n\t\t\t\t$token = $auth->Token;\t\n\t\t\t\t$server = $auth->Server;\n\t\t\t\t\n\t\t\t\t$orderIdArray[]\t=\t$this->request->data['pkorderid'];\n\t\t\t\t\n\t\t\t\t$IDs = $orderIdArray;\n\t\t\t\t$parameters = '[]';\n\t\t\t\n\t\t\t $result \t= \tPrintServiceMethods::CreatePDFfromJobForceTemplate('Invoice Template',$IDs,27,$parameters,'PDF',$token, $server);\n\t\t\t $results \t= \tPrintServiceMethods::CreatePDFfromJobForceTemplate('Invoice Template',$IDs,27,$parameters,'PDF',$token, $server);\n\t\t\t $pdf\t\t=\t$result->URL.\"#\".$results->URL;\n\t\t\t if($result->URL && $result->URL)\n\t\t\t {\n\t\t\t\t\t\techo $pdf; \n\t\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\techo \"2\"; \n\t\t\t\t\t\texit;\n\t\t\t\t}\n\t\t }", "public function display_billing_invoice()\n\t{\n\t\t$table_contact_select = '\n\t\t\t<tr>\n\t\t\t\t<td><b>Contact</b></td>\n\t\t\t\t<td>'.$this->ml_client_contact_select($this->account->client_id).'</td>\n\t\t\t</tr>\n\t\t';\n\n\t\t?>\n\t\t<h2>Invoice PDF</h2>\n\n\t\t<div id=\"invoice_data\">\n\t\t\t<?php $this->print_payment_form('none', $table_contact_select);?>\n\t\t</div>\n\n\t\t<div id=\"invoice_edit\">\n\t\t\t<div>\n\t\t\t\t<label>Client:</label><input type=\"text\" name=\"pdf_client\" value=\"<?= $this->account->name ?>\"><br/>\n\t\t\t\t<label>Contact Name:</label><input type=\"text\" name=\"pdf_contact\"><br/>\n\t\t\t\t<label>Inv Date:</label><input type=\"text\" name=\"pdf_date\" class=\"date_input\" value=\"<?php echo date(util::DATE);?>\"><br/>\n\t\t\t\t<label>Inv Number:</label><input type=\"text\" name=\"pdf_invoice_num\"><br/>\n\t\t\t</div>\n\t\t\t\n\t\t\t<div>\n\t\t\t\t<label>Address 1:</label><input type=\"text\" name=\"pdf_address_1\"><br/>\n\t\t\t\t<label>Address 2:</label><input type=\"text\" name=\"pdf_address_2\"><br/>\n\t\t\t\t<label>Address 3:</label><input type=\"text\" name=\"pdf_address_3\"><br/>\n\t\t\t</div>\n\t\t\t\n\t\t\t<?= $this->print_pdf_wpro_phone() ?>\n\n\t\t\t<div id=\"pdf_charges\" ejo>\n\t\t\t\t<label>Charges</label>\n\t\t\t\t<table>\n\t\t\t\t\t<tr><th>Amount</th><th>Description</th></tr>\n\t\t\t\t</table>\n\t\t\t\t<input type=\"button\" id=\"pdf_add_charge\" value=\"Add Charge\">\n\t\t\t</div>\n\n\t\t\t<div>\n\t\t\t\t<label>Notes</label><br/>\n\t\t\t\t<input type=\"text\" name=\"pdf_notes\">\n\t\t\t</div>\n\n\t\t\t<input type=\"hidden\" name=\"pdf_type\" value=\"invoice\">\n\t\t\t<input type=\"submit\" a0=\"action_gen_pdf\" value=\"Generate Invoice\">\n\t\t</div>\n\t\t\n\t\t<div class=\"clear\"></div>\n\t\t<?php\n\t}", "public function generatePDF() {\n $this->generateFirstPage();\n // check data barang, if there's more than 1, spawn additional page\n $this->generateNextPage([]);\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 visuPrint()\r\n\t{\r\n\t\t// Creation du document\r\n\t\tinclude_once 'Bn/Bnpdf.php';\r\n\t\t$pdf = new Bnpdf();\r\n\t\t$pdf->setAutoPageBreak(false);\r\n\t\t$pdf->setPrintHeader(true);\r\n\t\t$pdf->setPrintFooter(true);\r\n\t\t$pdf->start();\r\n\t\t//$pdf->eventHeader();\r\n\t\t$filename = '../Temp/Pdf/visu_' . '.pdf';\r\n\t\t$pdf->end($filename);\r\n\t\treturn false;\r\n\t}", "public function billPDFAction($orderid){\n \t$bill = $this->getDoctrine()->getManager()->getRepository('EcommerceBundle:UserOrder')->findOneBy( array(\n \t 'user' => $this->getUser(),\n\t\t 'valid' => 1,\n\t\t 'id' => $orderid\n\t ));\n \tif( !$bill ){\n \t\t$this->get('session')->getFlashBag()->add('danger', 'Critical error during the pdf rendering. Please retry');\n\t }\n\n\t $template = $this->renderView(\"UserBundle:Default:bill.html.twig\", array('bill' => $bill ) );\n\t\t$name = $bill->getId().'_'.$bill->getOrderfullref();\n\n\t $html2pdf = $this->get('ecommerce.order_html2pdf');\n \t$html2pdf->create( 'P','A4', 'fr', true, 'UTF-8', array(5, 5, 5, 8) );\n\n\t\treturn $html2pdf->generatePdf ($template, $name);\n }", "function _pdf($order_id, $html, $file_name, $head){\n $this->load->library('pdf');\n $od = $this->order_details_model->get_count($order_id);\n $size ='';// $od .\" ___ \" .PDF_PAGE_FORMAT;\n\n switch (true) {\n case $od>3 and $od <=5:\n $size = \"<h1>$od recipt A5</h1>\";\n $this->pdf->changePageFormat('A5');\n break;\n case $od>5 and $od<9: \n $size = \"<h1>$od recipt2</h1>\";\n $this->pdf->changePageFormat('RECIPT2');\n default:\n $size = \"<h1>$od recipt def</h1>\";\n \n break;\n }\n\n return $this->pdf->html($html, $file_name, $head);\n }", "function plgVmonShowOrderPrintPayment($order_number, $method_id) {\r\n\t\treturn $this->onShowOrderPrint($order_number, $method_id);\r\n\t}", "public function show(OrderProcessing $orderProcessing)\n {\n //\n }", "function pdf() {\n if($this->active_invoice->isLoaded()) {\n\n require_once INVOICING_MODULE_PATH . '/models/InvoicePDFGenerator.class.php';\n InvoicePDFGenerator::download($this->active_invoice, lang(':invoice_id.pdf', array('invoice_id' => $this->active_invoice->getName())));\n die();\n } else {\n $this->response->notFound();\n } // if\n }", "public function addGlsPdfButtonToOrder(Varien_Event_Observer $observer) {\n $block = $observer->getBlock();\n if ($block instanceof Mage_Adminhtml_Block_Sales_Order_View) {\n $orderId = $block->getOrderId();\n $glsShipmentCollection = Mage::getModel('synergeticagency_gls/shipment')\n ->getCollection()\n ->addFieldToFilter('order_id',$orderId)\n ->addFieldToFilter('printed','0')\n ->addFieldToFilter('job_id',array('null' => true))\n ->setOrder('gls_shipment_id');\n $hasUnprintedGlsShipments = $glsShipmentCollection->count();\n if($hasUnprintedGlsShipments) {\n $glsShipment = $glsShipmentCollection->getFirstItem();\n $block->addButton('printLastLabel',\n array(\n 'label' => Mage::helper('synergeticagency_gls')->__('Print GLS Label'),\n 'onclick' => \"setLocation('{$block->getUrl('adminhtml/gls_shipment/print', array('id' => $glsShipment->getId()))}');this.disabled=true;this.className += ' disabled';\",\n 'class' => 'save'\n ), 0, 1\n );\n }\n }\n }", "private function backCard($di){\n /*$di_list = $udi_list['di'];\n foreach($di_list as $did){\n $di = $did; \n }*/\n //$other_list = $udi_other;\n \n $url='https://accessgudid.nlm.nih.gov/api/v2/devices/lookup.json?';\n $json = file_get_contents($url.'di='.$di['di']);\n $obj = json_decode($json, true);\n \n $gmdn = $obj['gudid']['device']['gmdnTerms']['gmdn'];\n $gmdnPTName = $gmdn[0]['gmdnPTName'];\n $txt=$gmdnPTName;\n \n PDF::AddPage();\n PDF::Image(url('/card_bg/card_f.jpg'),60,60,85.6,54);\n // gmdnPTName\n PDF::SetXY(63, 64);\n PDF::SetFont('', '', 7, '', true);\n PDF::SetTextColor(0,112,192);\n //PDF::Write(10, $txt);\n PDF::MultiCell(83, 0, $txt, 0, 'L', 0, 0, '', '', true);\n \n // MD - device name\n PDF::Image(url('/card_bg/md.jpg'),63,83,8,4);\n PDF::SetXY(74, 83);\n PDF::SetFont('', 'B', 10, '', true);\n PDF::Write(0,$di['deviceName']);\n // udi-di\n PDF::Image(url('/card_bg/udi_di.jpg'),63,89,8,4);\n PDF::SetXY(74, 89);\n PDF::SetFont('', 'B', 10, '', true);\n PDF::Write(0,$di['di']);\n \n // udi image\n PDF::Image(url('/card_bg/udi.jpg'),120,90,5,3);\n \n // QR code\n //PDF::Image(url('/card_bg/barcode.jpg'),133,77,10,10);\n $qr_str = $di['udi'];\n $image = \\QrCode::format('png')\n ->size(200)->errorCorrection('H')\n ->generate($qr_str);\n $filename = time() . '.png';\n /*$output_file = 'public/img/qr-code/img-'.$filename;\n Storage::disk('local')->put($output_file, $image); //storage/app/public/img/qr-code/img-1557309130.png\n $path = storage_path('public/img/qr-code/'.$filename);*/\n Storage::disk('public')->put($filename, $image);\n PDF::Image(url('/qr-codes/'.$filename),128,89,12,12);\n \n //sn \n PDF::Image(url('/card_bg/sn.jpg'),63,95,5,4);\n PDF::SetXY(74, 95);\n PDF::SetFont('', 'B', 10, '', true);\n PDF::Write(0,$di['serialNumber']);\n // customer info\n PDF::Image(url('/card_bg/i_5.jpg'),63,101,8,8);\n PDF::SetXY(74, 101);\n PDF::SetFont('', 'B', 7, '', true);\n \n $contact = $obj['gudid']['device']['contacts']['customerContact'];\n if($contact[0]['email'] != null){\n $customer_email = $contact[0]['email']; \n }else{\n $customer_email = \"\";\n }\n if($contact[0]['phone'] != null){\n $customer_phone = $contact[0]['phone'];\n }else{\n $customer_phone = \"\";\n }\n if($contact[0]['phoneExtension'] != null){\n $customer_extension = $contact[0]['phoneExtension']; \n }else{\n $customer_extension = \"\";\n } \n \n // phone\n PDF::SetXY(74, 101);\n PDF::SetFont('', 'B', 7, '', true);\n PDF::Write(0,$customer_email);\n // phone phoneExtension\n PDF::SetXY(74, 105);\n PDF::SetFont('', 'B', 7, '', true);\n PDF::Write(0,$customer_phone);\n // email\n PDF::SetXY(74, 109);\n PDF::SetFont('', 'B', 7, '', true);\n PDF::Write(0,$customer_extension); \n }", "public function print_pdf($id, Request $request)\n {\n $order = PurchaseOrder::find($id);\n $pdf = new PurchaseOrderPdf($order);\n $pdf->AliasNbPages();\n return Response::make($pdf->Output('I', 'orden_'.$id.'.pdf'), 200, array('content-type' => 'application/pdf'));\n }", "public function pdf()\n {\n $data['order_users'] = DB::table('guest_details')->get();\n $data['total_amount'] = DB::table('guest_details')->sum('payment_amount');\n $pdf = PDF::loadView('admin.orders_by_promote_users.pdf', $data);\n return $pdf->download('order_list.pdf');\n }", "public function printout($doctype = 'invoice') {\n require_once (MODEL . \"master/cabang.php\");\n require_once (MODEL . \"ar/customer.php\");\n $ids = $this->GetPostValue(\"ids\", array());\n if (count($ids) == 0) {\n $this->persistence->SaveState(\"error\", \"Harap pilih data yang akan dicetak !\");\n redirect_url(\"ar.invoice\");\n return;\n }\n $jdt = 0;\n $errors = array();\n $report = array();\n foreach ($ids as $id) {\n $inv = new Invoice();\n $inv = $inv->LoadById($id);\n /** @var $inv Invoice */\n if ($inv != null) {\n if ($inv->InvoiceStatus == 2) {\n $jdt++;\n $inv->LoadDetails();\n $report[] = $inv;\n }\n }\n }\n if ($jdt == 0){\n //$errors[] = sprintf(\"Data Invoice yg dipilih tidak memenuhi syarat!\");\n $this->persistence->SaveState(\"error\", \"Data Invoice yg dipilih tidak memenuhi syarat!\");\n redirect_url(\"ar.invoice\");\n }\n $cabang = new Cabang($this->userCabangId);\n $this->Set(\"cabang\", $cabang);\n $this->Set(\"doctype\", $doctype);\n $this->Set(\"report\", $report);\n }", "public function viewOrderInvoiceAction()\n {\n $id = $this->request->query->get('id');\n $easyadmin = $this->request->attributes->get('easyadmin');\n $entity = $easyadmin['item'];\n\n $html = $this->renderView('easy_admin/Order/viewInvoice.html.twig', array(\n 'entity' => $entity\n ));\n\n return new Response(\n $this->get('knp_snappy.pdf')->getOutputFromHtml($html),\n 200,\n array(\n 'Content-Type' => 'application/pdf',\n 'Content-Disposition' => 'attachment; filename=\"' . $entity->getClient()->getFirstname() . '.pdf\"'\n )\n );\n }", "public function ajaxProcessPrintLabel()\n {\n $this->ajax = true;\n $id_order = (int)Tools::getValue('id_order');\n $order = new Order($id_order);\n\n if (!Validate::isLoadedObject($order)) {\n exit('Order not exists');\n }\n\n return $this->printLabel($id_order);\n }", "protected function processPayment() {\n\t\t$this->renderResponse( $this->adapter->doPayment() );\n\t}", "protected function processPayment() {\n\t\t$this->renderResponse( $this->adapter->doPayment() );\n\t}", "public function shippingDialogAction()\n {\n // Get input from POST or session\n $input = waRequest::post();\n if (empty($input)) {\n $session_checkout = wa()->getStorage()->get('shop/checkout');\n $input = (!empty($session_checkout['order']) && is_array($session_checkout['order'])) ? $session_checkout['order'] : [];\n }\n\n // Process checkout steps up to shipping\n $input['abort_after_step'] = 'shipping';\n $data = shopCheckoutStep::processAll('form', $this->makeOrderFromCart(), $input);\n\n // Make sure no step before shipping errs\n if (!empty($data['error_step_id']) && $data['error_step_id'] != 'shipping') {\n throw new waException('Bad input', 400);\n }\n\n $view = wa('shop')->getView();\n $view->assign($data['result'] + [\n 'config' => $this->getCheckoutConfig(),\n 'contact' => $data['contact'],\n ]);\n\n echo $view->fetch(wa()->getAppPath('templates/actions/frontend/order/form/dialog/map.html', 'shop'));\n exit;\n }", "public function display()\n {\n $dompdf = $this->getDomPdfObject();\n // Affichage, proposition de télécharger sous le nom donné.\n Zend_Layout::getMvcInstance()->disableLayout();\n Zend_Controller_Front::getInstance()->setParam('noViewRenderer', true);\n $dompdf->stream($this->fileName.'.pdf');\n }", "public function purchase_return_print($purchase_return_no = NULL)\n {\n $data['title'] = 'POS System';\n $data['master'] = $this->MPurchase_return_master->get_by_purchase_return_no($purchase_return_no);\n $data['details'] = $this->MPurchase_return_details->get_by_purchase_return_no($purchase_return_no);\n $data['company'] = $this->MCompanies->get_by_id($data['master'][0]['company_id']);\n $data['privileges'] = $this->privileges;\n $this->load->view('admin/inventory/purchase_return/print', $data);\n }", "public function print_distro_invoice($order_id, $distributor_id)\r\n {\r\n if($order_id != '')\r\n {\r\n\r\n $data['order_info'] = $this->order_model->get_dis_order_info($order_id);\r\n $data['distributor'] = $this->order_model->getDistributorInfo($distributor_id);\r\n $data['page_title'] = 'Print Invoice';\r\n\r\n $this->show_view('distributor_invoice_print', $data);\r\n }\r\n }", "public function actionExportToPdf()\n {\n if(TODOS == 0)\n {\n $cursoDisponibleServidorPublico = CursoDisponibleServidorPublico::model() -> findAll(array('condition'=>'activo = true'));\n }\n\n if(TODOS == 1)\n {\n $cursoDisponibleServidorPublico = CursoDisponibleServidorPublico::model() -> findAll();\n }\n\n if ($cursoDisponibleServidorPublico == null || count($cursoDisponibleServidorPublico) == 0)\n return;\n $this->renderPartial(\"exportPdf\", array('cursoDisponibleServidorPublico' => $cursoDisponibleServidorPublico));\n }", "function pdf() {\n if($this->active_invoice->isLoaded()) {\n if($this->active_invoice->canView($this->logged_user)) {\n InvoicePDFGenerator::download($this->active_invoice, Invoices::getInvoicePdfName($this->active_invoice));\n \tdie();\n } else {\n $this->response->forbidden();\n } // if\n } else {\n $this->response->notFound();\n } // if\n }", "public function actionArsip(){\n\t\tif($this->isSelectAllowed()){\n\t\t\tif(Yii::$app->request->get()){\n\t\t\t\t$mpdf = new mPDF('utf-8', 'A4', 12, 'Times New Roman', 0, 0, 0, 0, 0, 0, 'P');\n\t\t\t\t$mpdf->WriteHTML($this->renderPartial('satuarsip'));\n\t\t\t\t$mpdf->Output();\n//\t\t\t\treturn $this->render('satuarsip');\n\t\t\t}\n\t\t\treturn $this->render('arsip');\n\t\t}else{\n\t\t\techo \"You don't have access here\";die;\n\t\t}\n\t}", "public function display()\n {\n header(\"Content-Type: image/png; name=\\\"barcode.png\\\"\");\n imagepng($this->_image);\n }", "function buyPackage(){\n $unparsed_tickets = file_get_contents('http://127.0.0.1:5000/searchFlights');\n $unparsed_hotels = file_get_contents('http://127.0.0.1:5000/searchHotels');\n $json_tickets = json_decode($unparsed_tickets);\n $json_hotels = json_decode($unparsed_hotels);\n\n echo \"\\t\\t--FLIGHT TICKETS--\\n\";\n foreach ($json_tickets as $key => $value){\n echo \"\\t\\t--*--\\n\";\n // there are no rooms available\n if($key == 'Status'){\n echo \"$value\\n\";\n return;\n }\n else{\n foreach ($value as $k => $v){\n if($k != 'quantity')\n echo \"\\t\\t$k: $v\\n\";\n };\n echo \"\\t\\t--*--\\n\\n\";\n }\n };\n echo \"\\t\\t--HOTEL OPENINGS--\\n\";\n foreach ($json_hotels as $key => $value){\n echo \"\\t\\t--*--\\n\";\n // there are no rooms available\n if($key == 'Status'){\n echo \"$value\\n\";\n return;\n }\n else{\n foreach ($value as $k => $v){\n if($k != 'quantity')\n echo \"\\t\\t$k: $v\\n\";\n };\n echo \"\\t\\t--*--\\n\\n\";\n }\n };\n $ticket = readline(\"Enter the ID of flight ticket you wish to purchase: \");\n $hotel = readline(\"Enter the ID of hotel you wish to book: \");\n\n $request = 'http://127.0.0.1:5000/buyPackage'.'/'.$ticket.'/'.$hotel;\n $unparsed_json = file_get_contents($request);\n $json = json_decode($unparsed_json);\n\n // prints options on the screen\n foreach ($json as $key => $value){\n echo \"\\t\\t--*--\\n\";\n // there are no rooms available\n if($key == 'Status'){\n echo \"$value\\n\";\n return;\n }\n else{\n foreach ($value as $k => $v){\n if($k != 'quantity')\n echo \"\\t\\t$k: $v\\n\";\n };\n echo \"\\t\\t--*--\\n\\n\";\n }\n };\n}", "public function orderinvoice(Request $request)\n {\n dd($request);\n $order = $request->input('order');\n $orderdes = DB::select(\"select * from orders where id='\" . $order . \"' \");\n $details = DB::select(\"select * from cart where orderid='\" . $order . \"' \");\n\n\n //dd($Jobid);\n $pdf = PDF::loadView('partials.invoiceorder', array('Jobid' => $order, 'order' => $orderdes, 'details' => $details));\n //dd($pdf);\n return $pdf->download($order . '.pdf');\n\n }", "function imprimir_voucher_estacionamiento($numero,$chofer,$patente,$horainicio,$horatermino,$montototal,$comentario,$correlativopapel,$cliente,$fecha_termino,$fecha_inicio_2){\ntry {\n // Enter the share name for your USB printer here\n //$connector = null; \n //$connector = new WindowsPrintConnector(\"EPSON TM-T81 Receipt\");\n $connector = new WindowsPrintConnector(\"EPSON TM-T20 Receipt\");\n // $connector = new WindowsPrintConnector(\"doPDF 8\");\n /* Print a \"Hello world\" receipt\" */\n $printer = new Printer($connector);\n\n \n $date=new DateTime();\n $fecha = $date->format('d-m-Y');\n\n\n $Chofer = $chofer;\n $Patente = $patente;\n $serie = $numero;\n $img = EscposImage::load(\"logo1.png\");\n $printer -> graphics($img);\n \n \n $printer -> text(\"Numero : $serie\\n\");\n $printer -> text(\"Chofer : $Chofer\\n\");\n $printer -> text(\"Patente: $Patente\\n\");\n\n if ($cliente != 0) {\n include_once(\"conexion.php\");\n $con = new DB;\n $buscarpersona = $con->conectar();\n $strConsulta = \"select * from cliente where rut_cliente ='$cliente'\";\n $buscarpersona = mysql_query($strConsulta);\n $numfilas = mysql_num_rows($buscarpersona);\n $row = mysql_fetch_assoc($buscarpersona);\n $nombre_cliente = $row['nombre_cliente'];\n //var_dump($numfilas);\n if($numfilas >= 1){\n $printer -> text(\"Cliente: $nombre_cliente\\n\");\n }\n \n }\n \n if ($correlativopapel != 0) {\n $printer -> text(\"\\nCorrelativo : $correlativopapel\\n\");\n }\n $printer -> text(\"Fecha Inicio : $fecha_inicio_2\\n\");\n $printer -> text(\"Hora de inicio : $horainicio\\n\");\n\n\n\n if ($horatermino != 0) {\n $printer -> text(\"Fecha de Termino: $fecha_termino\\n\");\n $printer -> text(\"Hora de Termino : $horatermino\\n\"); \n }\n \n \n if ($montototal != 0) {\n $printer -> text('Monto total : $'.$montototal);\n }\n \n if ($horatermino != 0) {\n $printer -> text(\"\\n\");\n $printer -> text(\"\\n\\n\");\n $printer -> text(\"Firma: _________________\\n\");\n \n }\n $printer -> text(\"$comentario\\n\");\n $printer -> cut();\n /* Close printer */\n $printer -> close();\n\n echo \"<div class='alert alert-success'><strong>Impresion Correcta $comentario</strong></div>\";\n} catch (Exception $e) {\n echo \"No se pudo imprimir \" . $e -> getMessage() . \"\\n\";\n}\n}", "public function barCodePrint($barCode, $status){\n\t\t$this->load->library('pdf');\n\t\t// $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);\n\n\t\t// remove default header/footer\n\t\t$this->pdf->setPrintHeader(false);\n\t\t$this->pdf->setPrintFooter(false);\n\n\t\t// set margins\n\t\t$this->pdf->SetMargins(0, 0, 0, true);\n\n\t\t// set auto page breaks false\n\t\t$this->pdf->SetAutoPageBreak(false, 0);\n\n\t\t// add a page\n\t\t$this->pdf->AddPage('P', 'A4');\n\t\t$img_file = FCPATH . 'assets/images/blank.jpg';\n\t\t// Display image on full page\n\t\t$this->pdf->Image($img_file, 0, 0, 210, 297, 'JPG', '', '', true, 200, '', false, false, 0, false, false, true);\n\t\t$this->pdf->SetXY(200, 200);\n\t\t// $this->pdf->WriteHTMLCell(200, 0, \"12345\", 0, 0, 'C');\n\t\t$this->pdf->WriteHTMLCell(58, 20, 20, 201, '<h1 style=\"color:white;font-size:30px\">'.$barCode.'</h1>', 0, 0, false, true, 'C');\n\n\n\t\t$name = 'pdf_'. time() .'.pdf';\n\t\t\n\t\tif($status == \"Download\") {\n\t\t\t$this->pdf->Output($name, 'D');\n\t\t} else if($status == \"Store\") {\n\t\t\t$this->pdf->Output(FCPATH . 'assets/pdf/'.$name, 'F');\n\t\t} else {\n\t\t\t$this->pdf->Output($name, 'I');\n\t\t} \n\t\treturn $name;\n\t}", "function print_return_receipt($invoice_no='',$return_prod_id=0)\r\n\t{\r\n\t\t$this->erpm->auth(PNH_INVOICE_RETURNS);\r\n\t\t$this->load->plugin('barcode');\r\n\t\t$data['fran_det'] = $this->erpm->get_frandetbyinvno($invoice_no);\r\n\t\t$data['return_proddet'] = $this->erpm->get_returnproddetbyid($return_prod_id);\r\n\t\t\r\n\t\t// check if the product is ready to be shipped \r\n\t\tif(!$data['return_proddet']['readytoship'])\r\n\t\t{\r\n\t\t\tshow_error(\"Selection is not ready to ship\");\r\n\t\t}\r\n\t\t\r\n\t\t// check if the product is already shipped \r\n\t\tif($data['return_proddet']['is_shipped'])\r\n\t\t{\r\n\t\t\tshow_error(\"Print Cannot be processed, Product already shipped\");\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t$data['page'] = 'print_return_receipt';\r\n\t\t$this->load->view('admin/body/print_return_receipt',$data);\r\n\t}", "public function display_order_paid()\n\t{\n\t\tif ($this->checkLogin('A') == '') {\n\t\t\tredirect('admin');\n\t\t} else {\n\t\t\t$this->data['heading'] = 'Successful payment list';\n\t\t\t$rep_code = ltrim($this->session->userdata('fc_session_admin_rep_code'), '0');\n\t\t\tif ($rep_code != '') {\n\t\t\t\t$condition = ' and h.rep_code=\"' . $rep_code . '\"';\n\t\t\t} else {\n\t\t\t\t$condition = '';\n\t\t\t}\n\t\t\t$this->data['orderList'] = $this->order_model->view_order_details('Paid', $condition, $rep_code);\n\t\t\t$this->load->view('admin/order/display_orders', $this->data);\n\t\t}\n\t}", "public function print($id)\n {\n $order = $this->orderRepository->findWithoutFail($id);\n\n if (empty($order)) {\n Flash::error('Order not found');\n\n return redirect(route('orders.index'));\n }\n\n $pdf = PDF::loadView('admin.orders.print',['order'=>$order]);\n\n return $pdf->stream('order'.$id.'.pdf');\n\t //return view('admin.orders.print')->with('order', $order);\n\n }", "public function jdidealScreen(): void\n\t{\n\t\techo 'RO Payments';\n\t}", "public function displayContent()\n\t{\n\t\t$id_order = (int)Tools::getValue('id_order');\n\t\t$order = PayPalOrder::getOrderById($id_order);\n\t\t$price = Tools::displayPrice($order['total_paid'], $this->context->currency);\n\t\t\n\t\t$this->context->smarty->assign(array(\n\t\t\t'order' => $order,\n\t\t\t'price' => $price\n\t\t));\n\n\t\techo $this->context->smarty->fetch(_PS_MODULE_DIR_.'/paypal/views/templates/front/order-confirmation.tpl');\n\t}", "public function actionExportToPdf()\n {\n if(TODOS == 0)\n {\n $catPuesto = CatPuesto::model() -> findAll(array('condition'=>'activo = true'));\n }\n\n if(TODOS == 1)\n {\n $catPuesto = CatPuesto::model() -> findAll();\n }\n\n if ($catPuesto == null || count($catPuesto) == 0)\n return;\n $this->renderPartial(\"exportPdf\", array('catPuesto' => $catPuesto));\n }", "public function packageDetails(){\n \t$this->load->model('catalog/product');\n \t$this->load->model('tool/image');\n \t$this->load->language('checkout/cart');\n \t$this->load->language('product/package');\n \tif (isset($this->request->get['hotel_id'])) {\n $hotel_id = $this->request->get['hotel_id'];\n } else {\n $hotel_id = null;\n } \n $this->load->model('catalog/hotels');\n $data['breadcrumbs'] = array();\n $data['breadcrumbs'][] = array(\n 'text' => $this->language->get('text_home'),\n 'href' => $this->url->link('common/home')\n );\n $data['breadcrumbs'][] = array(\n 'text' => $this->language->get('standard_package'),\n 'href' => $this->url->link('product/standardpackage')\n );\n $data['breadcrumbs'][] = array(\n 'text' => $this->language->get('text_list'),\n 'href' => $this->url->link('product/standardpackage/hotels')\n );\n \n $hotel_info = $this->model_catalog_hotels->getProduct($hotel_id); \n if ($hotel_info) {\n \t\n \tif(isset($this->request->post['filter_nationality'])){\n $data['filter_nationality'] = $this->request->post['filter_nationality'];\n }\n $data['filter_sku'] = \"\";\n if(isset($this->request->post['filter_sku'])){\n $data['filter_sku'] = $this->request->post['filter_sku'];\n }\n $data['filter_checkin'] = \"\";\n if(isset($this->request->post['filter_checkin'])){\n $data['filter_checkin'] = $this->request->post['filter_checkin'];\n }\n $data['filter_checkout'] = \"\";\n if(isset($this->request->post['filter_checkout'])){\n $data['filter_checkout'] = $this->request->post['filter_checkout'];\n }\n $data['filter_rooms'] = \"\";\n if(isset($this->request->post['filter_rooms'])){\n $data['filter_rooms'] = $this->request->post['filter_rooms'];\n }\n $data['filter_adult'] = \"\";\n if(isset($this->request->get['filter_adult'])){\n $data['filter_adult'] = $this->request->get['filter_adult'];\n }\n $data['filter_child'] = \"\";\n if(isset($this->request->get['filter_child'])){\n $data['filter_child'] = $this->request->get['filter_child'];\n }\n if(isset($this->request->get['package_id'])){\n $data['package_id'] = $this->request->get['package_id'];\n }\n if(isset($this->request->get['star_rating'])){\n $data['star_rating'] = $this->request->get['star_rating'];\n }\n if (isset($this->request->get['total_people'])) {\n\t $data['total_people'] = $this->request->get['total_people'];\n\t } else {\n\t $data['total_people'] = 0;\n\t } \n if(isset($this->request->get['filter_room']) && $this->request->get['filter_room']!=0){\n $data['filter_rooms'] = $this->request->get['filter_room'];\n }else{\n \t$data['filter_rooms'] = 5;\n }\n if (isset($this->request->get['filter'])) {\n\t $filter_id = $this->request->get['filter'];\n\t } else {\n\t $filter_id = 0;\n\t } \n\t if (isset($this->request->get['visa_option'])) {\n\t $visa_option = $this->request->get['visa_option'];\n\t } else {\n\t $visa_option = 0;\n\t } \n\t if (isset($this->request->get['transfer_option'])) {\n\t $transfer_option = $this->request->get['transfer_option'];\n\t } else {\n\t $transfer_option = 0;\n\t } \n\t if (isset($this->request->get['checkin'])) {\n\t $checkin = $this->request->get['checkin'];\n\t } else {\n\t $checkin = '';\n\t }\n\t if (isset($this->request->get['checkout'])) {\n\t $checkout = $this->request->get['checkout'];\n\t } else {\n\t $checkout = '';\n\t } \n \t\t\t/* total person calculation*/\n \t\t\tif(isset($this->request->get['total_people'])){\n \t\t\t\t$star_rating = $this->request->get['star_rating'];\n \t\t\t\t$total_people = $this->request->get['total_people'];\n \t\t\t\tif($star_rating==3){\n \t\t\t\t\t$total_tour_price = (200 * $total_people);\n\t\t\t\t\t$data['total_tour_price'] = $this->currency->format($this->tax->calculate($total_tour_price, 0, $this->config->get('config_tax')), $this->session->data['currency']);\n \t\t\t\t}\n \t\t\t\tif($star_rating==4){\n \t\t\t\t\t$total_tour_price = (300 * $total_people);\n\t\t\t\t\t$data['total_tour_price'] = $this->currency->format($this->tax->calculate($total_tour_price, 0, $this->config->get('config_tax')), $this->session->data['currency']);\n \t\t\t\t}\n \t\t\t\tif($star_rating==5){\n \t\t\t\t\t$total_tour_price = (350 * $total_people);\n\t\t\t\t\t$data['total_tour_price'] = $this->currency->format($this->tax->calculate($total_tour_price, 0, $this->config->get('config_tax')), $this->session->data['currency']);\n \t\t\t\t} \t\t\t\t\n\n \t\t\t}\n \t\t\t$data['star_rating'] = $this->request->get['star_rating'];\n $this->document->setTitle($hotel_info['meta_title']);\n $this->document->setDescription($hotel_info['meta_description']);\n $this->document->setKeywords($hotel_info['meta_keyword']);\n $this->document->addLink($this->url->link('product/hotels', 'hotel_id=' . $this->request->get['hotel_id']), 'canonical');\n $data['heading_title'] = $hotel_info['name'];\n\n $data['button_cart'] = $this->language->get('button_cart');\n $data['button_wishlist'] = $this->language->get('button_wishlist');\n $data['button_compare'] = $this->language->get('button_compare');\n $data['button_upload'] = $this->language->get('button_upload');\n $data['button_continue'] = $this->language->get('button_continue');\n\n $data['name'] = $hotel_info['name'];\n $data['location'] = $hotel_info['location'];\n $dmaphtmlsrt = html_entity_decode($hotel_info['map'], ENT_QUOTES, 'UTF-8');\n $data['map'] = preg_replace('/(<[^>]*) style=(\"[^\"]+\"|\\'[^\\']+\\')([^>]*>)/i', '$1$3', $dmaphtmlsrt);\n $data['map'] = preg_replace('/(<[^>]*) class=(\"[^\"]+\"|\\'[^\\']+\\')([^>]*>)/i', '$1$3', $data['map']);\n $data['rating'] = $hotel_info['rating'];\n $data['reviews'] = $hotel_info['reviews'];\n $data['filter_id'] = $filter_id;\n $data['visa_option'] = $visa_option;\n $data['transfer_option']= $transfer_option;\n $data['product_id'] = '238';\n $data['model'] = $hotel_info['model'];\n $data['points'] = $hotel_info['points'];\n $data['star_rating'] = $hotel_info['quantity'];\n\n $textasas = preg_replace('/(<[^>]*) style=(\"[^\"]+\"|\\'[^\\']+\\')([^>]*>)/i', '$1$3', $hotel_info['description']);\n \n $descripotionhtmlsrt = html_entity_decode($hotel_info['description'], ENT_QUOTES, 'UTF-8');\n $data['description'] = preg_replace('/(<[^>]*) style=(\"[^\"]+\"|\\'[^\\']+\\')([^>]*>)/i', '$1$3', $descripotionhtmlsrt);\n $data['description'] = preg_replace('/(<[^>]*) class=(\"[^\"]+\"|\\'[^\\']+\\')([^>]*>)/i', '$1$3', $data['description']);\n\n $data['stock'] = $hotel_info['quantity'];\n\n $data['breadcrumbs'][] = array(\n\t 'text' => $hotel_info['name'],\n\t 'href' => '#'\n\t );\n\n $this->load->model('tool/image');\n\n if ($hotel_info['image']) {\n $data['popup'] = $this->model_tool_image->resize($hotel_info['image'], $this->config->get($this->config->get('config_theme') . '_image_popup_width'), $this->config->get($this->config->get('config_theme') . '_image_popup_height'));\n } else {\n $data['popup'] = '';\n }\n\n if ($hotel_info['image']) {\n $data['thumb'] = $this->model_tool_image->getoriganal($hotel_info['image'], $this->config->get($this->config->get('config_theme') . '_image_thumb_width'), $this->config->get($this->config->get('config_theme') . '_image_thumb_height'));\n } else {\n $data['thumb'] = '';\n }\n\n $data['images'] = array();\n $results = $this->model_catalog_hotels->getProductImages($this->request->get['hotel_id']);\n\n foreach ($results as $result) {\n $data['images'][] = array(\n 'popup' => $this->model_tool_image->resize($result['image'], $this->config->get($this->config->get('config_theme') . '_image_popup_width'), $this->config->get($this->config->get('config_theme') . '_image_popup_height')),\n 'thumb' => $this->model_tool_image->resize($result['image'], $this->config->get($this->config->get('config_theme') . '_image_additional_width'), $this->config->get($this->config->get('config_theme') . '_image_additional_height'))\n );\n }\n /*facility*/\n $facilities = $this->model_catalog_hotels->getCategories($this->request->get['hotel_id']);\n \n $data['facility']=array();\n $this->load->model('catalog/category');\n foreach($facilities as $facility){\n $category_info = $this->model_catalog_category->getCategory($facility['category_id']);\n \n if ($category_info['image']) {\n $facility_image = $this->model_tool_image->resize($category_info['image'], $this->config->get($this->config->get('config_theme') . '_image_category_width'), $this->config->get($this->config->get('config_theme') . '_image_category_height'));\n } else {\n $facility_image = '';\n }\n\n $data['facilities'][] = array(\n 'facility_name' => $category_info['name'],\n 'facility_image' => $facility_image \n );\n \n }\n if ($this->customer->isLogged() || !$this->config->get('config_customer_price')) {\n $data['price'] = $this->currency->format($this->tax->calculate($hotel_info['price'], $hotel_info['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);\n } else {\n $data['price'] = false;\n }\n $data['room_options'] = array();\n \n\n $roomOptions = $this->model_catalog_hotels->getHotelRoomOptions($this->request->get['hotel_id'],$checkin,$checkout);\n if(!empty($roomOptions)){\n $data['room_options'] = $roomOptions;\n }else{\n $data['room_options'] = null;\n }\n }\n\n\t\t/*\n\t\t217 - Desert Safari\n\t\t112 - Dubai City Tour\n\n\t\t104 - Dhow Cruise - dubai creek\n\t\t107 - Marina Cruise\n\t\t109 - Dhow Cruise in dubai canal\n\t\t*/\n\n\t\t$tourList = array('217','112');\n\t\tif($this->request->get['star_rating'] ==3){\n array_push($tourList, 104);\n }\n if($this->request->get['star_rating'] ==4){\n array_push($tourList, 107);\n }\n if($this->request->get['star_rating'] ==5){\n array_push($tourList, 109);\n }\n\t\t$data['tourlist'] =array();\n\t\t$data['tourids'] = $tourList;\n\t\tforeach($tourList as $tour){\n\t\t\t$product_info = $this->model_catalog_product->getProduct($tour);\n\t\t\tif($product_info){\n\t\t\t\tif ($this->customer->isLogged() || !$this->config->get('config_customer_price')) {\n\t\t\t\t\t$price = $this->currency->format($this->tax->calculate($product_info['price'], $product_info['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);\n\t\t\t\t} else {\n\t\t\t\t\t$price = false;\n\t\t\t\t}\n\t\t\t\tif ((float)$product_info['special']) {\n\t\t\t\t\t$special = $this->currency->format($this->tax->calculate($product_info['special'], $product_info['tax_class_id'], $this->config->get('config_tax')), $this->session->data['currency']);\n\t\t\t\t} else {\n\t\t\t\t\t$special = false;\n\t\t\t\t}\n\n\t\t\t\tif ($this->config->get('config_tax')) {\n\t\t\t\t\t$tax = $this->currency->format((float)$product_info['special'] ? $product_info['special'] : $product_info['price'], $this->session->data['currency']);\n\t\t\t\t} else {\n\t\t\t\t\t$tax = false;\n\t\t\t\t}\n\n\t\t\t\tif ($this->config->get('config_review_status')) {\n\t\t\t\t\t$rating = (int)$product_info['rating'];\n\t\t\t\t} else {\n\t\t\t\t\t$rating = false;\n\t\t\t\t}\t\t\t\t\n\n\t $textasas = preg_replace('/(<[^>]*) style=(\"[^\"]+\"|\\'[^\\']+\\')([^>]*>)/i', '$1$3', $product_info['description']);\n \n\t $tourdescrhtmlsrt = html_entity_decode($product_info['description'], ENT_QUOTES, 'UTF-8');\n\t $product_info['description'] = preg_replace('/(<[^>]*) style=(\"[^\"]+\"|\\'[^\\']+\\')([^>]*>)/i', '$1$3', $tourdescrhtmlsrt);\n\t $tourdescription = preg_replace('/(<[^>]*) class=(\"[^\"]+\"|\\'[^\\']+\\')([^>]*>)/i', '$1$3', $product_info['description']);\n\n\t\t\t\t$data['tourlist'][] =array(\n\t\t\t\t\t'product_id' => $product_info['product_id'],\n\t\t\t\t\t'name'\t\t => $product_info['name'],\n\t\t\t\t\t'description' => $tourdescription,\n\t\t\t\t\t'price' => $price,\n\t\t\t\t\t'special' => $special,\n\t\t\t\t\t'tax' => $tax,\n\t\t\t\t\t'minimum' => $product_info['minimum'] > 0 ? $product_info['minimum'] : 1,\n\t\t\t\t\t'rating' => $rating,\n\t\t\t\t\t'href' => $this->url->link('product/product', 'product_id=' . $product_info['product_id'])\n\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t\n\t\t/* visa options*/\n\t\t$product_options = $this->model_catalog_product->getProductOptions(238);\n\n\t\tforeach($product_options as $options){\n\t\t\t$data['visaoptions'][] = array(\n\t\t\t\t'option_id' => $options['option_id'],\n\t\t\t\t'option_name'=>$options['name'],\n\t\t\t\t'option_value'=>$this->currency->format($this->tax->calculate($options['value'], 0, $this->config->get('config_tax') ? 'P' : false), $this->session->data['currency'])\n\t\t\t);\n\t\t}\t\t\n \t/*Airport Transfer*/\n \t$category_info = $this->model_catalog_category->getCategory(70);\n if ($category_info) {\n \t$data['products'] = array();\n $filter_data = array(\n\t\t\t\t'filter_category_id' => 70,\n\t\t\t\t'filter_filter' => '',\n\t\t\t\t'sort' => 'p.sort_order',\n\t\t\t\t'order' => 'ASC',\n\t\t\t\t'start' => 0,\n\t\t\t\t'limit' => 25\n\t\t\t);\n\t\t\t$product_total = $this->model_catalog_product->getTotalProducts($filter_data);\n\t\t\t$transport_results = $this->model_catalog_product->getProducts($filter_data);\n\n\t\t\tforeach ($transport_results as $result) {\n\t\t\t\t/*cus add*/\n $cusoption = array();\n \t//getting product options\n $cusoption = $this->model_catalog_product->getProductOptions($result['product_id']);\n $data['transfer_products'][] = array( \n \t'product_id' => $result['product_id'],\n \t'name' => $result['name'],\n \t'options' =>$cusoption,\n ); \n \n\n\t\t\t}\n } \n\n /* echo \"<pre/>\";\n print_r($data);exit;*/\n ///set currency symbol\n $data['currencysymbol'] = $this->currency->getSymbolLeft($this->session->data['currency']);\n ///find the number of days between checkin and checkout date\n\n $date1 = new DateTime(\"$checkin\");\n $date2 = new DateTime(\"$checkout\");\n\n $diff = $date2->diff($date1)->format(\"%a\");\n if($diff==0){\n $data['no_of_days'] = 1;\n }else{\n $data['no_of_days'] = $diff;\n }\n\n \t$this->document->setTitle($this->language->get('text_list'));\n $this->document->setDescription($this->language->get('text_list'));\n $this->document->setKeywords($this->language->get('text_list'));\n\n\t\t$data['header'] = $this->load->controller('common/header');\n\n\t\t$data['column_left'] = $this->load->controller('common/column_left');\n\t\t$data['footer'] = $this->load->controller('common/footer');\n\n\t\t$this->response->setOutput($this->load->view('product/standarddetails', $data));\n \n\t\t\n }", "public function generatePDFOrders(){\n $orders=UserOrder::all();\n $data=['orders'=>$orders];\n $pdf = PDF::loadView('pdf.document',$data);\n return $pdf->stream('document.pdf');\n }", "public function printAction() {\n\t\t$request = Zend_Controller_Front::getInstance ()->getRequest ();\n\t\ttry {\n\t\t\tif (is_numeric ( $request->id )) {\n\t\t\t\t$file = Invoices::PrintPDF($request->id, true, false);\n\t\t\t}\n\t\t} catch ( Exception $e ) {\n\t\t\tdie ( $e->getMessage () );\n\t\t}\n\t\tdie ();\n\t}", "public function generarBC($codigoProducto,$tipo){\n \t $barra = new DNS1D();\n \t $usuario=Auth::user()->name;\n \t $producto=Producto::where('codigo',$codigoProducto)->first();\n \t $codigo=$codigoProducto;\n\n $view = \\View::make('codigoBarras.vistaBC', compact('barra','codigo','usuario','producto'))->render();\n $pdf = \\App::make('dompdf.wrapper');\n $pdf->loadHTML($view);//->setPaper('a4', 'landscape');\n if ($tipo==1) {\n \treturn $pdf->stream('Codigo de barras');\n }elseif ($tipo==2) {\n \treturn $pdf->download('Codigo de barras');\n }\n \t //dd($producto);\n \t //return view('codigoBarras.vistaBC')->with('barra',$barra)->with('codigo',$codigoProducto)->with('usuario',$usuario)->with('nombre',$nombre)->with('producto',$producto);\n\n \t //echo DNS1D::getBarcodeHTML(\"4445\", \"EAN13\");\n \t //y si lo vamos a imprimir, ya no seria con getBarcodeHTML sino con getBarcodeSVG\n }", "public function printCart()\n {\n if ( !(isEmpty() ) )\n {\n foreach( $this->cartItems as $item )\n {\n echo $item->getModelNumber();\n echo \"\\r\" ;\n }\n }\n else\n {\n echo \"Cart is empty in Cart.php\";\n }\n }", "public function run()\n {\n $htmlArray = [];\n $htmlArray[] = Html::tag('h1', $this->title, array_merge(['class'=>'contract'], $this->titleOptions));\n $marginTop = -33;\n if (!empty($this->subtitle)) {\n $htmlArray[] = Html::tag('h2', $this->subtitle, array_merge(['class'=>'contract'], $this->subTitleOptions));\n $marginTop = -60;\n }\n \n $barCodeId = \"{$this->_idPrefix}barcode_order_{$this->_autoId}\";\n \n $htmlArray[] = Html::beginTag('div', ['style'=>\"width:100%;height:66px;display:block;vertical-align:center;margin:{$marginTop}px 0px 0px 0px;float:left\"]);\n $htmlArray[] = Html::tag('div', Html::img($this->logoUrl, ['style'=>\"width:180px;vertical-align:center\"]), ['style'=>\"display:block;vertical-align:center;float:left;height:66px\"]);\n $htmlArray[] = Html::beginTag('div', ['style'=>\"display:block;align:center;float:center;text-align:center\"]);\n $htmlArray[] = Html::endTag('div');\n $htmlArray[] = Html::tag('div', '', ['id'=>$barCodeId, 'style'=>\"display:block;float:right;height:66px\"]);\n $htmlArray[] = Html::endTag('div');\n \n $htmlArray[] = \\common\\helpers\\BarcodeGenerator::widget([\n 'elementId' => $barCodeId,\n 'type' => 'code39',\n 'value' => $this->serial,\n ]);\n \n return implode(\"\\n\", $htmlArray);\n }", "public function show($id)\n {\n \n $customer = array();\n\n $data = PurchaseOrder::find($id);\n\n $SupplierDetail = DB::table('zenrolle_purcahse')->join('zenrolle_suppliers','zenrolle_purcahse.supplier','=','zenrolle_suppliers.id')\n ->select('zenrolle_suppliers.name','zenrolle_suppliers.address','zenrolle_suppliers.city','zenrolle_suppliers.country','zenrolle_suppliers.phone','zenrolle_suppliers.email','zenrolle_purcahse.invoice_no','zenrolle_purcahse.reference_no','zenrolle_purcahse.order_date','zenrolle_purcahse.due_date','zenrolle_purcahse.id','zenrolle_purcahse.subtotal','zenrolle_purcahse.total','zenrolle_purcahse.total_discount','zenrolle_purcahse.status','zenrolle_purcahse.total_tax','zenrolle_purcahse.shipping')\n ->where('zenrolle_purcahse.id',$id)->get();\n\n $invoice = PurchaseItem::where('pid',$id)->get();\n\n $customer['invoice'] = $invoice; \n $data->due_balance = $data->total - $data->payment_made;\n \n $pdf = PDF::loadView('purchasing.purchase_order.pdf', compact('data','SupplierDetail','invoice'));\n return $pdf->stream('zenroller.pdf'); \n }", "public function printPickList($sender, $param)\n {\n \t$html = '';\n \ttry\n \t{\n\t \tif(!isset($param->CallbackParameter->selectedIds) || count($selectedIds = ($param->CallbackParameter->selectedIds)) === 0)\n \t\t\tthrow new Exception(\"Please select a request first!\");\n\t \t$totalQty = 0;\n\n\t \t//get timestamp\n\t \t$timeZone = Factory::service(\"Warehouse\")->getDefaultWarehouseTimeZone(Core::getUser());\n\t \t$now = new HydraDate('now', $timeZone);\n\n\t \t$this->_ownerWarehouse = $this->getOwnerWarehouse();\n\t \t$stockWarehouse = FacilityRequestLogic::getWarehouseForPartCollection($this->_ownerWarehouse, Factory::service('Warehouse')->getDefaultWarehouse(Core::getUser()));\n\t \t$result = Factory::service(\"FacilityRequest\")->getPickList($selectedIds, $stockWarehouse);\n\t \t$deliveryInfo = FacilityRequestLogic::getShipToInformation($selectedIds);\n\n\t \t$html = \"<div>\";\n\t \t$html .= \"<img src='/themes/images/print.png' onclick='window.print();' title='Print' style='float:right;margin: 0 0 0 10px;'/>\";\n\t \t$html .= \"<b>The list of selected parts you are picking under <u>\" . $this->_ownerWarehouse->getBreadCrumbs(true) . \"</u> :</b>\";\n\t \t$html .= \"</div>\";\n\t \t$html .= ($printInfo = \"<div style='font-style:italic; font-size: 9px;'>Printed by \" . Core::getUser()->getPerson() . \" @ $now($timeZone) </div>\");\n\t \t$html .= \"<table style='width:100%;' border=1 cellspacing=0>\";\n\t \t$html .= \"<thead>\";\n\t \t$html .= \"<tr style='background: black; color: white; font-weight: bold;'>\";\n\t \t$html .= \"<td>Location</td><td>Avail Qty</td><td>Field task</td><td>Part Type</td><td>Req. Qty</td><td width='30px'>Request ID</td>\";\n\t \t$html .= \"</tr>\";\n\t \t$html .= \"</thead>\";\n\t \t$html .= \"<tbody>\";\n \t\t$totalQty = 0;\n \t\tforeach($result as $rowNo => $res)\n \t\t{\n\t\t\t\t$shipTo = '';\n\n \t\t\t$request = Factory::service(\"FacilityRequest\")->get($res['id']);\n \t\t\t$this->autoTake($request, $this->_ownerWarehouse);\n \t\t\t$location = 'No available parts!';\n \t\t\tif(is_array($locationArray = explode(\"-\", $res['maxNoLocation'])))\n \t\t\t{\n \t\t\t\t$warehouse = Factory::service(\"Warehouse\")->getWarehouse(isset($locationArray[1]) ? trim($locationArray[1]) : '');\n \t\t\t\t$availQty = isset($locationArray[2]) ? trim($locationArray[2]) : '';\n \t\t\t\tif($warehouse instanceof Warehouse)\n \t\t\t\t{\n \t\t\t\t\t$location = $warehouse->getBreadCrumbs() . \"<br /><img style='margin: 15px 15px 0 15px;' src='/ajax/?method=renderBarcode&text=\" . $warehouse->getAlias(WarehouseAliasType::$aliasTypeId_barcode) . \"' />\";\n\n \t\t\t\t\t$shipTo = (array_key_exists($res['id'], $deliveryInfo) ? $deliveryInfo[$res['id']] : '');\n \t\t\t\t\tif (is_array($shipTo))\n \t\t\t\t\t{\n \t\t\t\t\t\t$shipTo = $deliveryInfo[$res['id']]['wh'];\n \t\t\t\t\t}\n \t\t\t\t\t$shipTo = '<br /><br /><span style=\"font-style:bold;\">SHIP TO: <span style=\"font-style:italic;\">' . $shipTo . '</span></span>';\n \t\t\t\t}\n \t\t\t}\n \t\t\tif(!$request instanceof FacilityRequest)\n \t\t\t\tcontinue;\n\n \t\t\t$totalQty += ($qty = $request->getQuantity());\n \t\t\t$ftaskNumber = $request->getFieldTask();\n \t\t\t$partType = $request->getPartType();\n \t\t\t$html .= \"<tr valign='bottom' style='\" . ($rowNo++ % 2 ===0 ? '': 'background: #eeeeee;') . \"'>\";\n\t\t \t$html .= \"<td>\" . $location . $shipTo . \"</td>\";\n\t\t \t$html .= \"<td>$availQty <i style='font-size:9px;'>GOOD</i></td>\";\n\t\t \t$html .= \"<td>\" . $ftaskNumber->getId() .\"</td>\";\n\t\t \t$html .= \"<td>\" . $partType->getAlias() . \"<div style='font-style:italic; font-size: 9px;'>\" . $partType->getName() .\"</div>\";\n\t\t \tif(($bp = trim($partType->getAlias(PartTypeAliasType::ID_BP))) !== '')\n\t\t \t\t$html .= \"<img style='margin: 15px 15px 0 15px;' src='/ajax/?method=renderBarcode&text=$bp' />\";\n\n\t\t \t$html .= \"</td>\";\n\t\t \t$html .= \"<td>$qty</td>\";\n\t\t \t$html .= \"<td><img style='margin: 15px 15px 0 15px;' src='/ajax/?method=renderBarcode&text=\" . $request->getId() . \"' /></td>\";\n\t\t \t$html .= \"</tr>\";\n \t\t}\n\t \t$html .= \"<tr style='background: black; color: white; font-weight: bold;'>\";\n\t \t$html .= \"<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>Total:</td><td>$totalQty</td><td>&nbsp;</td>\";\n\t \t$html .= \"</tr>\";\n\t \t$html .= \"</tbody>\";\n\t \t$html .= \"<tfoot>\";\n\t \t$html .= \"<tr>\";\n\t\t\t$html .= \"<td colspan=6 style='text-align: right;'>$printInfo</td>\";\n\t\t\t$html .= \"</tr>\";\n\t\t \t$html .= \"</tfoot>\";\n\t \t$html .= \"</table>\";\n \t}\n\t catch(Exception $ex)\n\t {\n\t \t$html = $this->_getErrorMsg($ex->getMessage());\n\t }\n \t$this->responseLabel->Text = $html;\n }", "public function displayPaymentSelection()\n\t{\n\t\t$content = $this->renderTemplate('Project/1_Website/Design/Applications/Commerce/Controllers/paymentInfo/paymentInfo.phtml');\n\t\tresponse::getInstance()->addContentToTree(array('APPLICATION_CONTENT'=>$content));\n\t}", "static function output(LK_PDF $pdf){\n drupal_get_messages();\n ob_clean();\n $pdf->Output();\n drupal_exit(); \n }", "function selected_order(){\nglobal $db_connect;\nif (isset($_POST['check_order']))\n\n\t{ ////////////////check order is exist means button is clicked ////////////\n\n\n\n\t$pro_code = $_POST['check_order'];\n\n\t//echo \"***\".$pro_code;\n\n\n\n\t$query_one_order = \"SELECT pro_name,pro_img,pro_o_price,pro_m_price,pro_quantity,pro_amount,pro_pro_type FROM ord_product WHERE ord_uuid = '$pro_code'\";\n\t$query_one_order = mysqli_query($db_connect,$query_one_order);\n\n\t$order_basic_info = \"SELECT ord_address,ord_amount,ord_postcode,ord_user,ord_shipping_fee,ord_status,ord_shipping_method,ord_email FROM ord_record WHERE ord_uuid ='$pro_code' \";\n\t$order_basic_info = mysqli_query($db_connect,$order_basic_info);\n\t$order_basic_info = mysqli_fetch_assoc($order_basic_info);\n\n\t$current_user_email = $order_basic_info['ord_email'];\n\t$order_user_info = \"SELECT user_phone from user_extra_info where user_email = '$current_user_email' \";\n\t$order_user_info = mysqli_query($db_connect,$order_user_info);\n\t$order_user_info = mysqli_fetch_assoc($order_user_info);\n\t\n\n\n\n\techo \"<input name = 'ord_id' type='hidden' value = '$pro_code'>\";\n\n\techo \"<div class='text-danger text-center'><h4>订单编号: \".$pro_code.\"</h4></div>\";\n\techo \"<div class='col-lg-8'>\";\n\n\techo \"<div class='progress active' style='height:40px'>\n \t\t<div class='progress-bar progress-bar-success' style='width:25%;padding:10px'>\n \t\t<span class='glyphicon glyphicon-info-sign' style='font-size:15px'>订单提交</span> \n \t\t</div>\";\n\n\n ///////////////////////////////// here under are the order status volume bar suit /////////////////\t\n \tif (($order_basic_info['ord_status'] == 'paid') \n \t\tor ($order_basic_info['ord_status'] == 'shipping') \n \t\tor ($order_basic_info['ord_status'] == 'close'))\n \t{\n \t\techo \"<div class='progress-bar progress-bar-success' style='width:25%;padding:10px'>\";\n \t\t\techo \"<span class='glyphicon glyphicon-ok-sign' style='font-size:15px'>确认付款</span> \";\n \t\t\techo \"</div>\";\n \t}\n \telse{\n \t\techo \"\t<div class='progress-bar progress-bar-warning progress-bar-striped' role='progressbar' style='width: 25%;padding:10px'>\";\n \t\techo \"确认付款\";\n \t\techo \"</div>\";\n \t}\n\n\n \tif (($order_basic_info['ord_status'] == 'shipping') or ($order_basic_info['ord_status'] == 'close'))\n \t{\n \t\techo \"<div class='progress-bar progress-bar-success' style='width:25%;padding:10px'>\";\n \t\t\techo \"<span class='glyphicon glyphicon-gift' style='font-size:15px'>货物已发</span> \";\n \t\t\techo \"</div>\";\n\n \t}\n \telse{\n \t\techo \"<div class='progress-bar progress-bar-warning progress-bar-striped' role='progressbar' style='width: 25%;padding:10px'>\";\n \t\techo \"货物已发\";\n \t\t\techo \"</div>\";\n\n \t}\n \tif ($order_basic_info['ord_status'] == 'close'){\n \t\techo \"<div class='progress-bar progress-bar-success' style='width:25%;padding:10px'>\";\n \t\t\techo \"<span class='glyphicon glyphicon-off' style='font-size:15px'>订单关闭</span> \";\n \t\t\techo \"</div>\";\n\n \t}\n \telse{\n\t\t\techo \"<div class='progress-bar progress-bar-warning progress-bar-striped' role='progressbar' style='width: 25%;padding:10px'>\";\n \t\techo \"订单关闭\";\n \t\t\techo \"</div>\";\n\n \t}\n\n\n//////////////////////////////// order volume bar end ///////////////////////////////\n\n \t\n \t\n \t\t\n \t\t\n\n\techo \"</div>\";\n\techo \"</div>\";\n\techo \"<table class='table table-bordered table-hover table-condensed' >\";\n\n\techo \"<thead><tr style='width:30px;'><th>产品图片</th>\";\n\techo \"<th>产品名称</th>\";\n\techo \"<th>产品单价</th>\";\n\techo \"<th>产品数量</th>\";\n\techo \"<th>产品总价</th>\";\n\techo \"</tr></thead>\";\n\n\tforeach ($query_one_order as $single_product) {\n\t\t\n\t\techo \"<tr>\";\n\t\t\techo \"<td>\";//产品图片列\n\t\t\t\techo\" <img src='../$single_product[pro_img]' height=100 width=100/>\";\n\t\t\techo \"</td>\";\n\t\t\techo \"<td>\";//产品名称列\n\t\t\t\techo $single_product['pro_name'];\n\t\t\techo \"</td>\";\n\t\t\techo \"<td>\";//产品单价列\n\t\t\tif ($single_product['pro_pro_type'] == '1'){\n\t\t\t\t\n\t\t\t\techo \"<del>$\".$single_product['pro_o_price'].\"</del>\";\n\t\t\t\techo \"<br/>\";\n\t\t\t\techo \"$\".$single_product['pro_m_price'];\n\n\t\t\t}\n\t\t\telse{\n\t\t\t\techo \"$\".$single_product['pro_o_price'];\n\n\t\t\t}\n\t\t\techo \"</td>\";\n\t\t\techo \"<td>\";//购买数量列\n\t\t\t\t#echo $single_product['pro_code'];\n\t\t\t\techo $single_product['pro_quantity'];\n\t\t\techo \"</td>\";\n\t\t\techo \"<td>\";//产品总价\n\t\t\t\t\n\t\t\t\techo $single_product['pro_amount'];\n\t\t\techo \"</td>\";\n\n\t\t\t\n\t\t\t\n\n\t\techo \"</tr>\";\n\n\t\t# code...\n\t}\n\t////////////product list end //////\n\techo \"<tr><td>邮费:</td><td>$\".$order_basic_info['ord_shipping_fee'].\"</td>\";\n\techo \"<td>订单总价:</td><td colspan=2>$\".$order_basic_info['ord_amount'].\"</td></tr>\";\n\n\techo \"<tr><td>邮寄地址:</td><td colspan=3>\".$order_basic_info['ord_address'].\"</td>\";\n\techo \"<td>邮寄方式: \".$order_basic_info['ord_shipping_method'].\"</td></tr>\";\n\n\techo \"<tr><td>邮编:</td><td>\".$order_basic_info['ord_postcode'].\"</td>\";\n\techo \"<td>收件人:</td><td colspan=2>\".$order_basic_info['ord_user'].\"</td>\";\n\n\techo \"<tr><td>电子邮件:</td><td>\".$order_basic_info['ord_email'].\"</td>\";\n\n\techo \"<td>联系电话:</td><td colspan=2>\".$order_user_info['user_phone'].\"</td></tr>\";\n\n\techo \"</table>\";\n\techo \"<div class='text-center'>\";\n\t//////////////////////////////////////////// order status modification start /////////////////////\n\techo \"<div class='col-lg-2'>\";\n\t\n\tif ($order_basic_info['ord_status'] != 'close'){\n\t\techo \"选择要修改的订单状态:\";\n\t\techo \"<select name = 'ord_status_select' class='form-control'>\";\n\t\techo \"<option value = '$order_basic_info[ord_status]'>$order_basic_info[ord_status]</option>\";\n\t\techo \"<option value = 'new'>New</option>\";\n\t\techo \"<option value = 'paid'>paid</option>\";\n\t\techo \"<option value = 'shipping'>shipping</option>\";\n\t\techo \"<option value = 'close'>close</option>\";\n\t\techo \"</select>\";\n\t\techo \"<br/><input name = 'order_operate' type='submit' class='btn btn-success' value='提交修改'>&nbsp;&nbsp;\";\n\t\techo \"<a href='order_mgmt.php' role='button' class='btn btn-primary'>返回列表</a>\";\n\n\t}\n\telseif($order_basic_info['ord_status'] = 'close'){\n\t\techo \"<br/><input name = 'order_operate'type='submit' class='btn btn-success' value='删除订单'>&nbsp;&nbsp;\";\n\t\techo \"<a href='order_mgmt.php' role='button' class='btn btn-primary'>返回列表</a>\";\n\t}\n\techo \"</div><br/>\";\n\n\n\n\n\t\n\n\n\techo \"</div>\";\n\t}\nelse{\n\n\techo \"<div class='text-center'><h3>选择要查询订单状态标签或者输入关键字查询</h3></div>\";\n\n}\n/*\nelseif (isset($_POST['search_order'])){\n\t$search_condition = $_POST['search_condition'];\n\n\t$search_order = \"SELECT ord_uuid,ord_datetime,ord_amount,ord_status,ord_user FROM ord_record where CONCAT(ord_uuid,ord_user) like '%$search_condition%' order by id desc\";\n\t$search_order = mysqli_query($db_connect,$search_order);\n\tprint_r($search_order);\n}\n*/\n}", "public function show($pid)\n {\n $data = GeneralTransaction::find($pid);\n $Trans_Detail = DB::table('zenrolle__general_transaction')->join('zenrolle__general_transaction_detail','zenrolle__general_transaction_detail.pid','=','zenrolle__general_transaction.id')\n ->where('zenrolle__general_transaction.id',$pid)->get();\n $pdf = PDF::loadView('Accounts.GeneralTransaction.print_view', compact('data','Trans_Detail'));\n return $pdf->stream('ZenrolleVoucher.pdf');\n\n }", "public static function pdf_print() {\n\t\tglobal $post;\n\n\t\tif ( isset( $_GET['output'] ) && 'pdf' === $_GET['output'] ) {\n\t\t\tcheck_admin_referer( 'output-pdf-' . $post->ID );\n\t\t\t$template = \\get_template_directory() . '/single.php';\n\t\t\tif ( ! \\file_exists( $template ) ) {\n\t\t\t\t$template = \\get_template_directory() . '/index.php';\n\t\t\t}\n\t\t\t$template = apply_filters( 'simplepdf_pdf_print_template', $template );\n\t\t\tob_start();\n\t\t\trequire $template;\n\t\t\t$html = ob_get_clean();\n\t\t\tself::output_pdf( $html );\n\t\t\tdie();\n\t\t}\n\t}", "public function verDVDGrabEnPizarra( ) {\n $this->setComando(self::$PIZARRA_DIGITAL, \"DVDGRAB\");\n\n }", "public function displayOrderConfirmation()\n\t{\n\t\tif (Validate::isUnsignedId($this->id_order))\n\t\t{\n\t\t\t$params = array();\n\t\t\t$order = new Order($this->id_order);\n\t\t\t$currency = new Currency($order->id_currency);\n\n\t\t\tif (Validate::isLoadedObject($order))\n\t\t\t{\n\t\t\t\t$params['total_to_pay'] = $order->getOrdersTotalPaid();\n\t\t\t\t$params['currency'] = $currency->sign;\n\t\t\t\t$params['objOrder'] = $order;\n\t\t\t\t$params['currencyObj'] = $currency;\n\n\t\t\t\treturn Hook::exec('displayOrderConfirmation', $params);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public function print_ack() {\n $userid = $this->input->post('userId');\n $data = $this->get_pdf_data($userid);\n //modified on 27/11/2014\n $data['meta_data'] = $this->meta_data;\n return generate_acknowledgment($data);\n }", "public function getPdfShippingDescription(Order $order)\n {\n $description = $order->getShippingDescription();\n if ($order->getShippingMethod() !== Gfs::METHOD_CODE) {\n return $description;\n }\n\n $gfsShippingData = $this->getGfsShippingData($order);\n if (empty($gfsShippingData)) {\n return $description;\n }\n\n switch ($gfsShippingData['shippingMethodType']) {\n case 'standard':\n case 'calendar':\n $standard = $this->_getStandardDescription($order);\n if ($standard) {\n $description = $standard;\n }\n break;\n case 'droppoint':\n $dropPoint = $this->_getDropPointDescription($order);\n if ($dropPoint) {\n $description = $dropPoint;\n }\n break;\n }\n\n return $description;\n }", "public function output($pgen,$brotherid) {\n\tglobal $qqs,$qqi;\n\t\n\t$transaction=$this->transaction;\n\t\n\tswitch ($this->state) {\n\t\tcase 'collecting':\n\t\tcase '':\n\t\t\t$form=$this->makeForm();\n\t\t\tif ($transaction != 0) {\n\t\t\t\t$vals=$qqs->getTransactionData($transaction,\"vals\");\n\t\t\t\t$form->setValueArray($vals);\n\t\t\t\t$transactiondata=(string)$transaction;\n\t\t\t} else\n\t\t\t\t$transactiondata=0;\t\n\t\t\techo $form->getDumpStyleFormOutput('collecting',$transactiondata);\n\t\tbreak;\n\t\tcase 'confirming':\n\t\t\tif ($transaction == 0)\n\t\t\t\tthrow new exception(\"expected transaction not present\");\n\t\t\t// make certain that enough has been done that the email will make sense\n\t\t\t$vals=$qqs->getTransactionData($transaction,\"vals\");\n\t\t\textract($vals);\n\t\t\t// extremely rudimentary data filtering:\n\t\t\t$bForwardOK=(isset($name) && trim($name) != \"\" && ((isset($email) && trim($email) != \"\") || (isset($mail) && trim($mail) != \"\") || (isset($phone) && trim($phone) != \"\")));\n\t\t\t\n\t\t\t$message=$this->makemessage($vals);\n\t\t\t$form=$this->makeforwardbackform($bForwardOK);\n\t\t\t\n\t\t\techo $form->getOutputFormStart();\n\t\t\techo \"<h3{$qqi->cstr(\"proj_hcgemail\")}>Here is the message you will send:</h3>\";\n\t\t\techo \"<p{$qqi->cstr(\"proj_hcgemail\")}>\".nl2br($message).\"</p>\";\n\t\t\tif (!$bForwardOK)\n\t\t\t\techo \"<h4{$qqi->cstr(\"proj_hcgemail\")}>You must fill out your name and a way we can contact you before sending the message.</h4>\";\t\n\t\t\techo $form->getControl(\"back\")->output();\n\t\t\tif ($bForwardOK)\n\t\t\t\techo $form->getControl(\"send\")->output();\n\t\t\techo $form->getOutputFormEnd('confirming',$transaction);\n\t\tbreak;\n\t\tcase 'finished':\n\t\t\tif ($transaction == 0)\n\t\t\t\tthrow new exception(\"expected transaction not present\");\n\t\t\techo \"<div{$qqi->idcstr($this->longname.'_finished')}>\";\t\n\t\t\techo \"<h1>Thank you for your interest.</h1>\";\n\t\t\techo \"<p>We will be getting back to you shortly.</p>\";\n\t\t\techo \"<p>\".link::anchorHTML('Home',\"Back to home page\").'Continue Looking</a></p>';\n\t\t\techo \"</div>\";\t\n\t\tbreak;\n\t\tdefault:\n\t\t\tthrow new exception(\"illegal state value in formtest: $state\");\n\t\tbreak;\n\t}\n}", "function draw_body(){\r\n\t\r\n\tglobal $PPT;\r\n\t\r\n\t\t$out='';\r\n\r\n\t\tif($this->total_items>0){\r\n\t\t\t$arr_width=explode(',',$this->width);\r\n\t\t\t\r\n\t\t\tfor($i=0; $i<count($this->data);$i++){$c=0;\r\n\t\t\t\t$out.='<tr'.($this->odd_even ? ($i%2==0 ? ' class=\"odd\"' : ' class=\"even\"') : '').'>';\r\n\t\t\t\tforeach($this->data[$i] as $key => $value){\r\n\t\t\t\t\r\n\t\t\t\t$arr_header=explode(',',$this->header);\r\n\t\t\t\t\r\n\t\t\t\t\tif($arr_header[$c] == \"ORDER ID\"){\r\n\t\t\t\t\t\r\n\t\t\t\t\t$out.='<td'.(($i==0 and $this->width!='' and $arr_width[$key]>0) ? ' width=\"'.$arr_width[$key].'\"' : '').'>\r\n\t\t\t\t\t\r\n\t\t\t\t\t<a href=\"javascript:void(0);\" onClick=\"document.getElementById(\\'delo\\').value =\\''.str_replace('#ROW#',$i+1,$this->change_tag_col($this->change_tags($value),$this->data[$i])).'\\';document.DeleteOrder.submit();\" title=\"delete order\"><img src=\"../wp-content/themes/'.strtolower(constant('PREMIUMPRESS_SYSTEM')).'/images/premiumpress/led-ico/cross.png\" align=\"middle\"></a>\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t<a href=\"../wp-content/themes/'.strtolower(constant('PREMIUMPRESS_SYSTEM')).'/admin/_invoice.php?id='.str_replace('#ROW#',$i+1,$this->change_tag_col($this->change_tags($value),$this->data[$i])).'\" target=\"_blank\" title=\"view invoice\"><img src=\"../wp-content/themes/'.strtolower(constant('PREMIUMPRESS_SYSTEM')).'/images/premiumpress/led-ico/page.png\" align=\"middle\"></a>\r\n\t\t\t\t\t\r\n\t\t\t\t\t<a href=\"admin.php?page=orders&id='.str_replace('#ROW#',$i+1,$this->change_tag_col($this->change_tags($value),$this->data[$i])).'\" title=\"edit order\"><img src=\"../wp-content/themes/'.strtolower(constant('PREMIUMPRESS_SYSTEM')).'/images/admin/icon-edit.gif\" align=\"middle\"> '.str_replace('#ROW#',$i+1,$this->change_tag_col($this->change_tags($value),$this->data[$i])).'</a></td>';\r\n\t\t\t\r\n\t\t\t\t\t}elseif($arr_header[$c] == \"TOTAL\"){\r\n\t\t\t\t\t\r\n\t\t\t\t\t$out.='<td'.(($i==0 and $this->width!='' and $arr_width[$key]>0) ? ' width=\"'.$arr_width[$key].'\"' : '').'>'.number_format(str_replace('#ROW#',$i+1,$this->change_tag_col($this->change_tags($value),$this->data[$i])),2).'</td>';\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\t}elseif($arr_header[$c] == \"STATUS\"){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tswitch(str_replace('#ROW#',$i+1,$this->change_tag_col($this->change_tags($value),$this->data[$i]))){\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tcase \"0\": { \t$O1 = \"Awaiting Payment\";\t$O2 = \"#0c95ff\";\t\t} break;\r\n\t\t\t\t\t\t\tcase \"3\": { \t$O1 = \"Paid & Completed \";\t$O2 = \"green\";\t\t} break;\t\r\n\t\t\t\t\t\t\tcase \"5\": { \t$O1 = \"Payment Received\";\t$O2 = \"green\";\t\t} break;\t\r\n\t\t\t\t\t\t\tcase \"6\": { \t$O1 = \"Payment Failed\";\t\t$O2 = \"red\";\t\t} break;\r\n\t\t\t\t\t\t\tcase \"7\": { \t$O1 = \"Payment Pending\";\t$O2 = \"orange\";\t\t} break;\t\r\n\t\t\t\t\t\t\tcase \"8\": { \t$O1 = \"Payment Refunded\";\t$O2 = \"black\";\t\t} break;\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$out.='<td'.(($i==0 and $this->width!='' and $arr_width[$key]>0) ? ' width=\"'.$arr_width[$key].'\"' : '').' style=\"background-color:'.$O2.'\"><span style=\"color:white;\">'.$O1.'</span></td>';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\r\n\t\t\t\t\t \r\n\t\t\t\t\t\t$out.='<td'.(($i==0 and $this->width!='' and $arr_width[$key]>0) ? ' width=\"'.$arr_width[$key].'\"' : '').'>'.str_replace('#ROW#',$i+1,$this->change_tag_col($this->change_tags($value),$this->data[$i])).'</td>';\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$c++; \r\n\t\t\t\t}\r\n\t\t\t\t$out.='</tr>'; \r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t$arr_header=explode(',',$this->header);\r\n\r\n\t\t\tif($this->no_results!==false)\r\n\t\t\t\t$out.='<tr id=\"'.$this->id.'_no_results\"><td colspan=\"'.count($arr_header).'\">'.$this->no_results.'</td></tr>';\r\n\t\t}\r\n\r\n\t\treturn $out;\r\n\t}", "public function sales_print($sales_no = NULL)\n {\n $data['title'] = 'POS System';\n $data['master'] = $this->MSales_master->get_by_sales_no($sales_no);\n $data['details'] = $this->MSales_details->get_by_sales_no($sales_no);\n $data['company'] = $this->MCompanies->get_by_id($data['master'][0]['company_id']);\n $data['privileges'] = $this->privileges;\n $this->load->view('admin/inventory/sales/print', $data);\n }", "public function generateContentForBuyerPaymentConfirmation($order) {\n// \t\t$itineraryBrief = $megahelper->getItineraryBrief( $order ['itinerary'] );\n\t\t\n\t\t// $subject = \"BTCTrip - We are booking your ticket - \" . $itineraryBrief;\n\t\t$content = $this->get( 'templating' )->render( $this->purchaseConfirmationTemplate, array(\n\t\t\t\t'order' => $order\n\t\t) );\n\t\t\n\t\treturn $content;\n\t}", "function dsf_protx_release_order($order_number){\n\nglobal $ReleaseURL, $Verify, $ProtocolVersion;\n\n\n// validate a protx direct item.\n $protx_query = dsf_db_query(\"select orders_id, vendortxcode, vpstxid, securitykey, txauthno from \" . DS_DB_SHOP . \".protx_direct_responses where orders_id='\" . (int)$order_number . \"'\");\n \n if (dsf_db_num_rows($protx_query) == 0){\n \n \t$problem_text = 'Order number ' . $order_number . ' has been marked as released however its' . \"\\n\";\n\t$problem_text .= 'transaction details can not be found within the protx direct transaction logs' . \"\\n\\n\";\n\t$problem_text .= 'If this is a valid protx direct payment order, please release the item manually';\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'Protx Item not Found';\n\tbreak;\n\t\n \t// not a protx order\n }elseif (dsf_db_num_rows($protx_query) > 1){\n \t// more than one item is listed - this is an error.\n \t$problem_text = 'Order number ' . $order_number . ' has been marked as released however there are' . \"\\n\";\n\t$problem_text .= 'more than one transaction item found within the protx direct transaction logs' . \"\\n\\n\";\n\t$problem_text .= 'Please release the item manually and check the logs to see why there is more' . \"\\n\";\n\t$problem_text .= 'than one transaction item.' . \"\\n\";\n\t\n\t\n\tmail_protx_problem($problem_text);\n\treturn 'More than one protx item found';\n\tbreak;\n }\n \t\n\n\t$protx_user_account_number = MODULE_PAYMENT_PROTXCC_ID;\n\n// #########################\n\n\n\n\n\n // we must have a valid transaction item if we are here, get the array of items.\n \n $protx_items = dsf_db_fetch_array($protx_query);\n \n$TargetURL = $ReleaseURL;\n$VerifyServer = $Verify;\n\n// echo 'URL = ' . $TargetURL;\n$data = array (\n\t\t'VPSProtocol' => $ProtocolVersion, \t\t\t\t\t\t\t// Protocol version (specified in init-includes.php)\n\t\t'TxType' => 'RELEASE',\t\t\t\t\t\t\t\t\t\t\t\t\t// Transaction type \n\t\t'Vendor' => $protx_user_account_number,\t\t\t\t\t\t\t\t\t// Vendor name (specified in init-protx.php)\n\t\t'VendorTxCode' => $protx_items['vendortxcode'],\t\t\t\t\t// Unique refund transaction code (generated by vendor)\n\t\t'VPSTxId' => $protx_items['vpstxid'],\t\t\t\t\t\t\t\t\t\t// VPSTxId of order\n\t\t'SecurityKey' => $protx_items['securitykey'],\t\t\t\t\t\t// Security Key\n\t\t'TxAuthNo' => $protx_items['txauthno']\t\t\t\t\t\t\t\t\t// Transaction authorisation number\n\t);\n\n// Format values as url-encoded key=value pairs\n$data = formatData($data);\n\n$response ='';\n\n$response = requestPost($TargetURL, $data);\n\n$baseStatus = array_shift(split(\" \",$response[\"Status\"]));\n\nswitch($baseStatus) {\n\n\tcase 'OK':\n\t\n\t// payment has been released witin protx.\n\t\t\n\t\t// update the orders status\n\t\t\t\t\t\t\n\t\t$sql_data_array = array('orders_status' => '13');\n\t\tdsf_db_perform(DS_DB_SHOP . \".orders\",$sql_data_array,'update','orders_id=' . $order_number);\n\n\n\t// update status history.\n\t\t $sql_data_array = array('orders_id' => $order_number, \n\t\t\t\t\t\t\t\t 'orders_status_id' => '13', \n\t\t\t\t\t\t\t\t 'date_added' => 'now()');\n\t\t dsf_db_perform(DS_DB_SHOP . \".orders_status_history\", $sql_data_array);\n\n\t// log the reply.\n\t\t\n\t\t$write_notes = dsf_protx_shop_notes($order_number, \"RELEASE STATUS = OK\\n\");\n\n\t\treturn 'Complete';\n\t\tbreak;\n\t\n\t\n\t\n\t// all other cases\n\tcase 'MALFORMED':\n\tcase 'INVALID':\n\tcase 'ERROR':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as released however a problem' . \"\\n\";\n\t$problem_text .= 'has been returned from Protx, the error is:' . \"\\n\\n\";\n\t$problem_text .= $response['StatusDetail'] . \"\\n\";\n\t\n\tmail_protx_problem($problem_text);\n\n\t$write_notes = dsf_protx_shop_notes($order_number, \"RELEASE STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\n\n\n\tcase 'FAIL':\n\t\n\t$problem_text = 'Order number ' . $order_number . ' has been marked as ' . $TxType . ' however a problem' . \"\\n\";\n\t$problem_text .= 'with communication from Protx has occured, the error (if available) is:' . \"\\n\\n\";\n\t$problem_text .= $response['StatusDetail'] . \"\\n\";\n\t\n\tmail_protx_problem($problem_text);\n\n\t$write_notes = dsf_protx_shop_notes($order_number, $TxType . \" STATUS = FAILED\\n\");\n\n\treturn 'Failed';\n\tbreak;\n\n\n\t} // end of switch.\n\nreturn $response;\n}", "private function getPurchasePageData(){\n\t\t$this->template->imgurl = $this->getParam('imgurl');\n\t\tif ($this->isError()) {\n\t\t\treturn;\n\t\t}\n\t\t$this->getItem();\n\t\tif ($this->isError()) {\n\t\t\treturn;\n\t\t}\n\t\n\t\t// TODO Add 'name' to productdata\n\t\t$itemView = $this->template->item;\n\t\t$name = substr($itemView->description, 0, 35);\n\t\t$itemView->name = $name . '...';\n\n\t\t// Build shippng costs (including insurance)\n\t\t$shippingbase = shop_shipping_fee;\n\t\t$optionShipping = array();\n\t\t$options = $itemView->options;\n\t\tfor ($i = 0; $i < sizeof($options); $i++) {\n\t\t\t$option = $options[$i];\n\t\t\tif ($option->price < 100) {\n\t\t\t\t$ship = $shippingbase + 4;\n\t\t\t} else {\n\t\t\t\t$ship = $shippingbase + 8;\n\t\t\t}\n\t\t\t$optionShipping[$option->seq] = $ship;\n\t\t}\n\t\t$this->template->optionShipping = $optionShipping;\n\t\t\n\t\tLogger::info('Purchase page view ['.$this->template->item->id.']['.$this->template->item->code.']');\n\t}", "public function send_order($order_id)\n {\n // Return if barcode exists\n if (get_post_meta($order_id, 'barcode', true)) {\n return;\n }\n\n $order = wc_get_order($order_id);\n\n // Return if the city is out of area\n $billing_info = $order->get_data()['billing'];\n if (!in_array(ucwords(sanitize_text_field($billing_info['city'])), $this->business_area)) {\n return;\n }\n\n $billing_info = array_map(function ($v) {\n return sanitize_text_field($v);\n }, $billing_info);\n\n // The short description of order items\n $description = [];\n foreach ($order->get_items() as $k => $item) {\n $product = $item->get_product_id();\n $description[] = get_the_excerpt($product);\n }\n $description = sanitize_text_field(implode(\"\\n\", $description));\n\n $info = $this->format_fields([\n 'createdBy' => null,\n 'type' => 'package',\n 'status' => 'in_warehouse',\n 'collectType' => 'pickup',\n 'collectedBy' => null,\n 'description' => $description,\n 'note' => $order->get_customer_note(),\n 'from' => $this->get_store_info_value('blogname'),\n 'fromAddress1' => $this->get_store_info_value('woocommerce_store_address'),\n 'fromAddress2' => $this->get_store_info_value('woocommerce_store_address_2'),\n 'fromCity' => $this->get_store_info_value('woocommerce_store_city'),\n 'fromPostCode' => $this->get_store_info_value('woocommerce_store_postcode'),\n 'fromTel' => $this->get_store_info_value('phone'),\n 'fromEmail' => $this->get_store_info_value('email'),\n 'to' => $billing_info['first_name'] . ' ' . $billing_info['last_name'],\n 'toAddress1' => $billing_info['address_1'],\n 'toAddress2' => $billing_info['address_2'],\n 'toCity' => $billing_info['city'],\n 'toPostCode' => $billing_info['postcode'],\n 'toTel' => $billing_info['phone'],\n 'toEmail' => $billing_info['email'],\n 'verified' => true,\n 'tomatoProduceId' => $order_id,\n ]);\n\n $curl = curl_init(TOMATOGO_URL);\n curl_setopt_array($curl, [\n CURLOPT_HEADER => false,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_HTTPHEADER => ['Content-Type: application/json'],\n CURLOPT_POST => true,\n CURLOPT_POSTFIELDS => json_encode($info),\n ]);\n $res = json_decode(curl_exec($curl));\n\n curl_close($curl);\n\n $barcode = sanitize_text_field($res->barcode);\n if ($barcode) {\n update_post_meta($order_id, 'barcode', $barcode);\n }\n }", "public function stock_input($slip_id = 0)\n {\n $data[\"current_user\"] = Tbl_user::where(\"user_id\",$this->user_info->user_id)->first();\n $data[\"slip\"] = Warehouse::inventory_input_report($slip_id);\n $data[\"slip_item\"] = Warehouse::inventory_input_report_item($slip_id);\n if($data[\"slip\"])\n {\n if($data[\"slip\"]->inventory_reason == \"refill\" || $data[\"slip\"]->inventory_reason == \"insert_item\" || $data[\"slip\"]->inventory_reason == \"destination\")\n {\n $data[\"report_title\"] = \"STOCK INPUT\";\n }\n else\n {\n $data[\"report_title\"] = strtoupper($data[\"slip\"]->inventory_reason);\n }\n }\n $pdf = view(\"member.warehouse.stock_input_pdf\",$data);\n return Pdf_global::show_pdf($pdf);\n }", "public function index() {\n \n if( !empty($this->_inputs) && (isset($this->_inputs['print_product_id']) && $this->_inputs['print_product_id']) )\n {\n return PaperTypeModel::printProductId($this->_inputs['print_product_id'])\n ->get()\n ->load('finishingFile', 'pricingFile');\n }\n \n # return error if there are errors\n return $this->_setResponse([\n 'message' => 'Invalid Access Print Product Id not found.'\n ], 500);\n }" ]
[ "0.62267464", "0.61699325", "0.6025001", "0.5957745", "0.58243966", "0.580481", "0.5768627", "0.5763536", "0.57069975", "0.57049656", "0.57040656", "0.5675663", "0.56734794", "0.56494766", "0.5620578", "0.5612435", "0.5604581", "0.56027395", "0.55951554", "0.55791", "0.5566387", "0.5533612", "0.55319387", "0.54922247", "0.54847527", "0.54695255", "0.5467865", "0.54588413", "0.5451458", "0.54268277", "0.5422976", "0.54182917", "0.5416813", "0.53940845", "0.5389813", "0.53734845", "0.53724116", "0.53699654", "0.5367973", "0.53447294", "0.53369844", "0.53239745", "0.53232247", "0.53194886", "0.53180265", "0.53119516", "0.5304099", "0.5302909", "0.52812326", "0.52763635", "0.526569", "0.52608675", "0.5230623", "0.5227472", "0.5196188", "0.5196188", "0.5195273", "0.51817536", "0.51714844", "0.5170965", "0.51559114", "0.51553637", "0.51512045", "0.5147976", "0.5147767", "0.5143269", "0.5133594", "0.51242185", "0.51198936", "0.511808", "0.5115959", "0.51074237", "0.51055026", "0.5105114", "0.5095169", "0.50943106", "0.5092239", "0.50902754", "0.5080183", "0.5079834", "0.5075687", "0.5070363", "0.50656664", "0.5062896", "0.5059837", "0.5056087", "0.5054311", "0.5053575", "0.50449616", "0.5036179", "0.5035636", "0.50323963", "0.5006004", "0.5002447", "0.5000495", "0.4998359", "0.4998216", "0.49924734", "0.49849746", "0.49821702" ]
0.61197144
2
Attempts to automatically send the shipment data for the selected order to the third party carrier server and returns the result as json response.
public function autosendAction() { $result = $this->_autoSend(); echo json_encode($result); die(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function execute()\n {\n /** @var Json $resultJson */\n $resultJson = $this->jsonFactory->create();\n $error = false;\n $messages = [];\n\n $postItems = $this->getRequest()->getParam('items', []);\n if (!($this->getRequest()->getParam('isAjax') && count($postItems))) {\n return $resultJson->setData([\n 'messages' => [__('Please correct the data sent.')],\n 'error' => true,\n ]);\n }\n\n foreach (array_keys($postItems) as $orderId) {\n /** @var Order $order */\n $order = $this->orderRepository->get($orderId);\n\n try {\n foreach ($postItems[$orderId] as $attribute => $value) {\n if ($attribute === ShipmentInterface::SHIPMENT_STATUS) {\n $shipments = $order->getShipmentsCollection();\n /** @var Shipment $shipment */\n foreach ($shipments as $shipment) {\n $shipment->setShipmentStatus($value);\n $this->shipmentRepository->save($shipment);\n }\n }\n\n if ($attribute === OrderInterface::WEIGHT) {\n if (!$order->hasShipments()) {\n $order->setWeight($value);\n $this->orderRepository->save($order);\n }\n }\n\n if ($attribute === ShippingDataInterface::MONDIAL_RELAY_PACKAGING_WEIGHT) {\n if (!$order->hasShipments()) {\n $order->setData(ShippingDataInterface::MONDIAL_RELAY_PACKAGING_WEIGHT, $value);\n $this->orderRepository->save($order);\n }\n }\n }\n } catch (Exception $e) {\n $messages[] = $this->getErrorWithOrderId($order, $e->getMessage());\n $error = true;\n }\n }\n\n return $resultJson->setData([\n 'messages' => $messages,\n 'error' => $error\n ]);\n }", "public function execute()\n {\n $orderData = null;\n $request = $this->getRequest();\n $storeId = $request->getParam('store');\n $response = $this->orderHelper->validateRequestData($request);\n try {\n if (empty($response['errors'])) {\n try {\n $data = file_get_contents('php://input');\n $orderData = $this->orderHelper->validateJsonData($data, $request);\n if (!empty($orderData['errors'])) {\n $response = $orderData;\n }\n } catch (\\Exception $e) {\n $response = $this->orderHelper->jsonResponse($e->getMessage());\n }\n }\n if (empty($response['errors'])) {\n $lvb = ($orderData['order_status'] == 'shipped') ? true : false;\n $store = $this->storeManager->getStore($storeId);\n $this->validateItems->execute($orderData['products'], $store->getWebsiteId(), $lvb);\n $response = $this->orderModel->importOrder($orderData, $storeId);\n }\n } catch (\\Exception $e) {\n $response = $this->orderHelper->jsonResponse($e->getMessage());\n }\n\n $result = $this->resultJsonFactory->create();\n return $result->setData($response);\n }", "protected function _autoSend() {\n $orderId = (int)$this->getRequest()->getParam('order_id', 0);\n if ($orderId <= 0) {\n return array('error' => Mage::helper('balticode_postoffice')->__('Invalid Order ID'));\n }\n $order = Mage::getModel('sales/order')->load($orderId);\n if (!$order || $order->getId() <= 0) {\n return array('error' => Mage::helper('balticode_postoffice')->__('Invalid Order ID'));\n }\n \n //get the carrier\n $shippingMethod = $order->getShippingMethod();\n $paymentMethod = $order->getPayment();\n \n //get the shipping code from the order and call the module from it.\n $shippingCarrierCode = substr($shippingMethod, 0, strpos($shippingMethod, '_'));\n $shippingMethodModel = Mage::getModel('shipping/shipping')->getCarrierByCode($shippingCarrierCode);\n \n if (!($shippingMethodModel instanceof Balticode_Postoffice_Model_Carrier_Abstract)){\n return array('error' => Mage::helper('balticode_postoffice')->__('This carrier is not subclass of Balticode_Postoffice_Model_Carrier_Abstract'));\n }\n $shippingMethodModel->setStoreId($order->getStoreId());\n \n //determine if auto send is available\n if (!$shippingMethodModel->isAutoSendAvailable()) {\n return array('error' => Mage::helper('balticode_postoffice')->__('Automatic data sending is not available for the selected carrier'));\n }\n \n if (round($order->getTotalDue(), 2) > 0 && (!$shippingMethodModel->getConfigData('enable_cod') || \n ($shippingMethodModel->getConfigData('enable_cod') && $paymentMethod->getMethod() != 'balticodecodpayment'))) {\n return array('error' => Mage::helper('balticode_postoffice')->__('This order has not yet been fully paid'));\n }\n \n if (($order->isCanceled() || $order->getIsVirtual())) {\n return array('error' => Mage::helper('balticode_postoffice')->__('This order cannot be shipped'));\n }\n \n \n //send the data\n Mage::helper('balticode_postoffice')->sendManualOrderData($order->getIncrementId(), $shippingMethodModel->getConfigData('senddata_event'));\n \n \n //return the results\n return array('success' => true);\n \n }", "public function saveOrderShipment() {\n\t\t$this->layout = 'ajax';\n $order_id = $this->Shipment->saveOrderShipment($this->request->data);\n\t\tif($order_id) {\n $data = $this->Shipment->Order->find('first', array(\n 'conditions' => array(\n 'Order.id' => $order_id\n )\n ));\n } else {\n $this->set('json', FALSE);\n $this->render('/Common/echo_json');\n }\n $this->set('data', $data);\n $this->render('ship_cell');\n\t}", "public function shippingOrder()\n {\n $order = Order::where('id', request()->order_id)->firstOrFail();\n $order->update([\n 'status' => 3,\n 'tracking_number' => request()->tracking_number,\n ]);\n Mail::to($order->customer->email)->send(new OrderMail($order));\n\n return back()->withToastSuccess('Mail Sent');\n }", "public function notime_shipping_sales_order_complete(Varien_Event_Observer $observer) {\n\n $_order = $observer->getEvent()->getOrder();\n\n if(Mage_Sales_Model_Order::STATE_COMPLETE == $_order->getStatus()) {\n\n // check if order use Notime shipping\n if('notime_notime' == $_order->getShippingMethod()) {\n\n $resource = Mage::getSingleton('core/resource');\n $readConnection = $resource->getConnection('core_read');\n $writeConnection = $resource->getConnection('core_write');\n\n $query = 'SELECT shipment_id FROM notime_shipping WHERE `status` = 0 AND quote_id = '. $_order->getQuoteId() .' LIMIT 1';\n $shipment_id = $readConnection->fetchOne($query);\n if($shipment_id) {\n try {\n\n // send POST request to Notime\n $shipment_id = $shipment_id;\n if($shipment_id) {\n\n // get customer shipping address\n $_shippingAddress = $_order->getShippingAddress();\n if($_shippingAddress->getId()) {\n $params = array(\n 'ShipmentId' => $shipment_id,\n 'Dropoff' => array(\n 'Name' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'ContactName' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'Phone' => $_shippingAddress->getTelephone(),\n 'City' => $_shippingAddress->getCity(),\n 'CountryCode' => $_shippingAddress->getCountryId(),\n 'Postcode' => $_shippingAddress->getPostcode(),\n 'Streetaddress' => implode(' ',$_shippingAddress->getStreet()),\n 'ContactEmailAddress' => $_shippingAddress->getEmail()\n ),\n 'EndUser' => array(\n 'FullName' => $_shippingAddress->getFirstname() .' '. $_shippingAddress->getLastname(),\n 'Phone' => $_shippingAddress->getTelephone(),\n 'Email' => $_shippingAddress->getEmail()\n )\n );\n\n $client = new Varien_Http_Client();\n\n $client->setUri('https://v1.notimeapi.com/api/shipment/approve')\n ->setConfig(array('timeout' => 30, 'keepalive' => 1))\n ->setHeaders(array(\n 'Ocp-Apim-Subscription-Key' => '493dc25bf9674ccb9c5920a035c1f777',\n ))\n ->setRawData(json_encode($params), 'application/json')\n ->setMethod(Zend_Http_Client::POST);\n\n $client->setHeaders(array('Content-Type: application/json'));\n\n $response = $client->request();\n\n if($response->isSuccessful()){\n // update status\n $writeConnection->update(\n 'notime_shipping',\n array('status' => 1),\n 'quote_id='.$_order->getQuoteId()\n );\n $_order->addStatusHistoryComment('Notime->Success: Shipment was approved successfully!')->save();\n } else {\n Mage::log('ERROR:'.$response->getMessage(),false,'notime-shipping.log');\n }\n }\n }\n } catch (Exception $e) {\n Mage::log($e->getMessage(),false,'notime-shipping.log');\n }\n }\n }\n }\n }", "function fn_rus_payments_payanyway_send_order_info($params, $order_info)\n{\n $inventory_positions = fn_rus_payments_payanyway_get_inventory_positions($order_info);\n\n if (!empty($inventory_positions)) {\n $data = array(\n 'id' => $params['MNT_TRANSACTION_ID'],\n 'checkoutDateTime' => date(DATE_ATOM),\n 'docNum' => $params['MNT_TRANSACTION_ID'],\n 'docType' => 'SALE',\n 'email' => $order_info['email'],\n 'inventPositions' => $inventory_positions,\n 'moneyPositions' => array(array('paymentType' => 'CARD', 'sum' => $params['MNT_AMOUNT']))\n );\n\n $mnt_dataintegrity_code = $order_info['payment_method']['processor_params']['mnt_dataintegrity_code'];\n $data['signature'] = md5($data['id'] . $data['checkoutDateTime'] . $mnt_dataintegrity_code);\n $jsonData = json_encode($data);\n $operationUrl = PAYANYWAY_GATEWAY_URL . '/api/api.php?method=sale&accountid=' . $params['MNT_ID'];\n\n $extra = array(\n 'headers' => array(\n 'Content-Type: application/json',\n 'Content-Length: ' . strlen($jsonData)\n ),\n 'log_preprocessor' => '\\Tygh\\Http::unescapeJsonResponse'\n );\n\n Http::post($operationUrl, $jsonData, $extra);\n }\n}", "public function execute()\n {\n if ($this->getRequest()->isAjax()) {\n $params = $this->_request->getParams();\n $orderId = (isset($params['order_id']) && $params['order_id']) ? $params['order_id'] : '';\n if (isset($orderId) && $orderId) {\n\t\t\t\t$guestOrderjson = [];\n\t\t\t\t$guestOrderData = $this->_orderHelper->getGuestOrderData($orderId);\n\t\t\t\tif (empty($guestOrderData)) {\n\t\t\t\t\t$guestOrderjson['result'] = 'No Record Found';\n\t\t\t\t} else {\n\t\t\t\t\t$guestOrderjson['result'] = $guestOrderData;\n\t\t\t\t}\n\t\t\t\t$resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON);\n\t\t\t\treturn $resultJson->setData($guestOrderjson);\n }\n\t\t\t$guestOrderjson['result'] = 'No Record Found';\n\t\t\treturn;\n }\n }", "public function SellerOrderDone()\n {\n $data = SellerOrder::where(['seller_id' => Auth::id(), 'stutus_deliver' => 1])->with('deliver')->get();\n return response()->json(['stuts' => true, 'Data' => $data,\n ], 200);\n }", "public function serverresultAction()\n {\n $boError = false;\n $model = Mage::getModel('paymentsensegateway/direct');\n $checkout = Mage::getSingleton('checkout/type_onepage');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n $szMessage = $this->getRequest()->getPost('Message');\n $nVersion = Mage::getModel('paymentsensegateway/direct')->getVersion();\n \n try\n {\n // finish off the transaction: if StatusCode = 0 create an order otherwise do nothing\n $checkout->saveOrderAfterRedirectedPaymentAction(true,\n $this->getRequest()->getPost('StatusCode'),\n $szMessage,\n $this->getRequest()->getPost('PreviousStatusCode'),\n $this->getRequest()->getPost('PreviousMessage'),\n $this->getRequest()->getPost('OrderID'),\n $this->getRequest()->getPost('CrossReference'));\n }\n catch (Exception $exc)\n {\n $boError = true;\n $szErrorMessage = $exc->getMessage();\n $szNotificationMessage = Paymentsense_Paymentsensegateway_Model_Common_GlobalErrors::ERROR_183;\n Mage::logException($exc);\n }\n \n if($boError == true)\n {\n $this->getResponse()->setBody('StatusCode=30&Message='.$szErrorMessage);\n }\n else\n {\n $order = Mage::getModel('sales/order');\n $order->load(Mage::getSingleton('checkout/session')->getLastOrderId());\n // set the quote as inactive after back from paypal\n Mage::getSingleton('checkout/session')->getQuote()->setIsActive(false)->save();\n\n // send confirmation email to customer\n if($order->getId())\n {\n $order->sendNewOrderEmail();\n }\n \n // if the payment was successful clear the session so that if the customer navigates back to the Magento store\n // the shopping cart will be emptied rather than 'uncomplete'\n if($this->getRequest()->getPost('StatusCode') == '0')\n {\n Mage::getSingleton('checkout/session')->clear();\n \n if($nVersion >= 1410)\n {\n if($nVersion < 1600)\n {\n $model->subtractOrderedItemsFromStock($order);\n }\n $this->_updateInvoices($order, $szMessage);\n }\n }\n \n $this->getResponse()->setBody('StatusCode=0');\n }\n }", "public function send_order($order_id)\n {\n // Return if barcode exists\n if (get_post_meta($order_id, 'barcode', true)) {\n return;\n }\n\n $order = wc_get_order($order_id);\n\n // Return if the city is out of area\n $billing_info = $order->get_data()['billing'];\n if (!in_array(ucwords(sanitize_text_field($billing_info['city'])), $this->business_area)) {\n return;\n }\n\n $billing_info = array_map(function ($v) {\n return sanitize_text_field($v);\n }, $billing_info);\n\n // The short description of order items\n $description = [];\n foreach ($order->get_items() as $k => $item) {\n $product = $item->get_product_id();\n $description[] = get_the_excerpt($product);\n }\n $description = sanitize_text_field(implode(\"\\n\", $description));\n\n $info = $this->format_fields([\n 'createdBy' => null,\n 'type' => 'package',\n 'status' => 'in_warehouse',\n 'collectType' => 'pickup',\n 'collectedBy' => null,\n 'description' => $description,\n 'note' => $order->get_customer_note(),\n 'from' => $this->get_store_info_value('blogname'),\n 'fromAddress1' => $this->get_store_info_value('woocommerce_store_address'),\n 'fromAddress2' => $this->get_store_info_value('woocommerce_store_address_2'),\n 'fromCity' => $this->get_store_info_value('woocommerce_store_city'),\n 'fromPostCode' => $this->get_store_info_value('woocommerce_store_postcode'),\n 'fromTel' => $this->get_store_info_value('phone'),\n 'fromEmail' => $this->get_store_info_value('email'),\n 'to' => $billing_info['first_name'] . ' ' . $billing_info['last_name'],\n 'toAddress1' => $billing_info['address_1'],\n 'toAddress2' => $billing_info['address_2'],\n 'toCity' => $billing_info['city'],\n 'toPostCode' => $billing_info['postcode'],\n 'toTel' => $billing_info['phone'],\n 'toEmail' => $billing_info['email'],\n 'verified' => true,\n 'tomatoProduceId' => $order_id,\n ]);\n\n $curl = curl_init(TOMATOGO_URL);\n curl_setopt_array($curl, [\n CURLOPT_HEADER => false,\n CURLOPT_RETURNTRANSFER => true,\n CURLOPT_HTTPHEADER => ['Content-Type: application/json'],\n CURLOPT_POST => true,\n CURLOPT_POSTFIELDS => json_encode($info),\n ]);\n $res = json_decode(curl_exec($curl));\n\n curl_close($curl);\n\n $barcode = sanitize_text_field($res->barcode);\n if ($barcode) {\n update_post_meta($order_id, 'barcode', $barcode);\n }\n }", "public function saveDataAftersaveAction() {\n $result = array();\n $error = true;\n $userId = Mage::helper('webpos/permission')->getCurrentUser();\n $isInvoice = Mage::helper('webpos/permission')->canManageOrder($userId, $this->getRequest()->getParam('order_id'));\n $orderId = $this->getRequest()->getParam('order_id');\n $order = Mage::getModel('sales/order')->load($orderId);\n $create_shipment = $this->getRequest()->getParam('create_shipment');\n $create_invoice = $this->getRequest()->getParam('create_invoice');\n $invoice_error = '';\n $invoice_message = '';\n $shipment_error = '';\n $shipment_message = '';\n\n\n if ($isInvoice == false) {\n $result['message'] = $this->__(\"Access denied! You don't have the permission to process this action.\");\n $result['error'] = true;\n $this->getResponse()->setBody(Zend_Json::encode($result));\n return;\n }\n //end vietdq\n if ($orderId && $order && $order->getId()) {\n $result['error'] = false;\n if ($create_invoice) {\n try {\n $invoice = $this->_initInvoice($orderId);\n if ($invoice) {\n if (!empty($data['capture_case'])) {\n $invoice->setRequestedCaptureCase($data['capture_case']);\n }\n $invoice->register();\n $invoice->setEmailSent(true);\n $invoice->getOrder()->setCustomerNoteNotify(true);\n $invoice->getOrder()->setIsInProcess(true);\n $transactionSave = Mage::getModel('core/resource_transaction')\n ->addObject($invoice)\n ->addObject($invoice->getOrder());\n\n $shipment = false;\n if ((int) $invoice->getOrder()->getForcedDoShipmentWithInvoice()) {\n $shipment = $this->_prepareShipment($invoice);\n if ($shipment) {\n $shipment->setEmailSent($invoice->getEmailSent());\n $transactionSave->addObject($shipment);\n }\n }\n\n $transactionSave->save();\n if (Mage::helper('webpos/customer')->isEnableAutoSendEmail('invoice')) {\n $template_invoice = Mage::helper('webpos/customer')->getWebposEmailTemplate('invoice');\n if (isset($template_invoice['guest']) && $template_invoice['guest'] != '') {\n Mage::app()->getStore()->setConfig(Mage_Sales_Model_Order_Invoice::XML_PATH_EMAIL_GUEST_TEMPLATE, $template_invoice['guest']);\n }\n if (isset($template_invoice['customer']) && $template_invoice['customer'] != '') {\n Mage::app()->getStore()->setConfig(Mage_Sales_Model_Order_Invoice::XML_PATH_EMAIL_TEMPLATE, $template_invoice['customer']);\n }\n $invoice->sendEmail($order->getCustomerEmail(), '');\n }\n $invoice_error = false;\n $invoice_message = $this->__('The invoice has been created.');\n } else {\n $invoice_error = true;\n $invoice_message = $this->__('The invoice is not exist');\n }\n } catch (Mage_Core_Exception $e) {\n $invoice_error = true;\n $invoice_message = $e->getMessage();\n } catch (Exception $e) {\n Mage::logException($e);\n $invoice_error = true;\n $invoice_message = $this->__('Unable to save the invoice.');\n }\n }\n\n if ($create_shipment) {\n try {\n $shipment = $this->_initShipment($orderId);\n if ($shipment) {\n $shipment->register();\n $shipment->setEmailSent(true);\n $shipment->getOrder()->setCustomerNoteNotify(true);\n $this->_saveShipment($shipment);\n if (Mage::helper('webpos/customer')->isEnableAutoSendEmail('shipment')) {\n $shipment->sendEmail($order->getCustomerEmail());\n }\n $shipment_error = false;\n $shipment_message = $this->__('The shipment has been created.');\n } else {\n $shipment_error = true;\n $shipment_message = $this->__('An error occurred while creating shipment.');\n }\n } catch (Mage_Core_Exception $e) {\n $shipment_error = true;\n $shipment_message = $e->getMessage();\n } catch (Exception $e) {\n Mage::logException($e);\n $shipment_error = true;\n $shipment_message = $this->__('An error occurred while creating shipment.');\n }\n }\n } else {\n $result['error'] = true;\n $result['message'] = $this->__('The order does not exist');\n $this->getResponse()->setBody(Zend_Json::encode($result));\n return;\n }\n\n $result['create_invoice'] = $create_invoice;\n $result['create_shipment'] = $create_shipment;\n if ($create_shipment && $create_invoice && !$invoice_error && !$shipment_error) {\n $result['apply_message'] = $this->__('The invoice and shipment have been created.');\n } else {\n if ($create_invoice) {\n // $result['create_invoice'] = $create_invoice;\n $result['invoice_error'] = $invoice_error;\n $result['invoice_message'] = $invoice_message;\n }\n if ($create_shipment) {\n // $result['create_shipment'] = $create_shipment;\n $result['shipment_error'] = $shipment_error;\n $result['shipment_message'] = $shipment_message;\n }\n }\n $result['createCustomerForm'] = $this->getLayout()->createBlock('webpos/customer')\n ->setTemplate('webpos/webpos/createcustomer.phtml')\n ->toHtml();\n $result['totals'] = $this->getLayout()->createBlock('webpos/cart_totals')\n ->setTemplate('webpos/webpos/review/totals.phtml')\n ->toHtml();\n $this->getResponse()->setBody(Zend_Json::encode($result));\n }", "function wcfm_dokan_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n $tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n if( wcfm_is_vendor() ) {\r\n \t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n \t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n \t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n \t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n } else {\r\n \t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n }\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t\tdie;\r\n\t}", "protected function _doShipmentRequest(DataObject $request)\n {\n $result = new \\Magento\\Framework\\DataObject();\n $xml = $this->buildShipmentRequest($request);\n\n try {\n $response = $this->curlRequest($this->helper->getShippingEndpoint(), $xml);\n\n $this->log('create shipment api response' . $response);\n\n $response = preg_replace(\"/(<\\/?)(\\w+):([^>]*>)/\", \"$1$2$3\", $response);\n $this->helper->logger()->debug(__METHOD__ . \" APi response \". print_r($response,1));\n $xml = new \\SimpleXMLElement($response);\n $body = $xml->xpath('////ax25processShipmentResult');\n\n $servicesArray = json_decode(json_encode((array)$body), TRUE);\n $this->helper->logger()->debug(__METHOD__ . __LINE__ . ' -serviceresponse ' . print_r($servicesArray, true));\n\n } catch (\\Throwable $e) {\n\n }\n\n $loomisPackages = [];\n\n if (is_array($servicesArray) && count($servicesArray) > 0) {\n $loomisPackages = $this->_sendShipmentAcceptRequest($servicesArray[0][\"ax27shipment\"]);\n $servicesArray = $servicesArray[0]['ax27shipment'];\n } else {\n $result->setErrors($e->getMessage());\n }\n\n //$this->_debug($response);\n\n if ($result->hasErrors() || empty($response)) {\n return $result;\n } else {\n $result->setData('loomis_packages', $loomisPackages);\n return $result;\n }\n }", "public function placeAction()\n {\n $paymentParam = $this->getRequest()->getParam('payment');\n $controller = $this->getRequest()->getParam('controller');\n $this->getRequest()->setPost('collect_shipping_rates', 1);\n $this->_processActionData('save');\n\n //get confirmation by email flag\n $orderData = $this->getRequest()->getPost('order');\n $sendConfirmationFlag = 0;\n if ($orderData) {\n $sendConfirmationFlag = (!empty($orderData['send_confirmation'])) ? 1 : 0;\n } else {\n $orderData = array();\n }\n\n if (isset($paymentParam['method'])) {\n\n $result = array();\n\n //create order partially\n $this->_getOrderCreateModel()->setPaymentData($paymentParam);\n $this->_getOrderCreateModel()->getQuote()->getPayment()->addData($paymentParam);\n\n $orderData['send_confirmation'] = 0;\n $this->getRequest()->setPost('order', $orderData);\n\n try {\n //do not cancel old order.\n $oldOrder = $this->_getOrderCreateModel()->getSession()->getOrder();\n $oldOrder->setActionFlag(Mage_Sales_Model_Order::ACTION_FLAG_CANCEL, false);\n\n $order = $this->_getOrderCreateModel()\n ->setIsValidate(true)\n ->importPostData($this->getRequest()->getPost('order'))\n ->createOrder();\n\n $payment = $order->getPayment();\n if ($payment && $payment->getMethod() == Mage::getModel('authorizenet/directpost')->getCode()) {\n //return json with data.\n $session = $this->_getDirectPostSession();\n $session->addCheckoutOrderIncrementId($order->getIncrementId());\n $session->setLastOrderIncrementId($order->getIncrementId());\n\n $requestToPaygate = $payment->getMethodInstance()->generateRequestFromOrder($order);\n $requestToPaygate->setControllerActionName($controller);\n $requestToPaygate->setOrderSendConfirmation($sendConfirmationFlag);\n $requestToPaygate->setStoreId($this->_getOrderCreateModel()->getQuote()->getStoreId());\n\n $adminUrl = Mage::getSingleton('adminhtml/url');\n if ($adminUrl->useSecretKey()) {\n $requestToPaygate->setKey(\n $adminUrl->getSecretKey('authorizenet_directpost_payment','redirect')\n );\n }\n $result['directpost'] = array('fields' => $requestToPaygate->getData());\n }\n\n $result['success'] = 1;\n $isError = false;\n }\n catch (Mage_Core_Exception $e) {\n $message = $e->getMessage();\n if( !empty($message) ) {\n $this->_getSession()->addError($message);\n }\n $isError = true;\n }\n catch (Exception $e) {\n $this->_getSession()->addException($e, $this->__('Order saving error: %s', $e->getMessage()));\n $isError = true;\n }\n\n if ($isError) {\n $result['success'] = 0;\n $result['error'] = 1;\n $result['redirect'] = Mage::getSingleton('adminhtml/url')->getUrl('*/sales_order_create/');\n }\n\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));\n }\n else {\n $result = array(\n 'error_messages' => $this->__('Please, choose payment method')\n );\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));\n }\n }", "function wcfm_wcfmmarketplace_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = absint( $_POST['productid'] );\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n $tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n \r\n if( wcfm_is_vendor() ) {\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcfm_marketplace_orders SET commission_status = 'shipped', shipping_status = 'shipped' WHERE order_id = $order_id and vendor_id = $user_id and item_id = $order_item_id\");\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n \t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n \t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\tadd_comment_meta( $comment_id, '_vendor_id', $user_id );\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t\tdie;\r\n\t}", "function execute_shippify_order_action($order){\n $extra = '';\n if ($_GET['myaction'] == 'woocommerce_shippify_dispatch' && $order->id == $_GET['stablishedorder'] ){\n $res = $this->create_shippify_task($order->id);\n if ($res != false){\n $response = json_decode($res['body'], true);\n if (isset($response['id'])){\n update_post_meta($order->id, '_is_dispatched', 'yes');\n update_post_meta($order->id, '_shippify_id', $response['id']);\n $extra = 'none';\n }else{\n $extra = 'singleError';\n }\n }else{\n $extra = 'singleError';\n }\n $redirect = admin_url( 'edit.php?post_type=shop_order&order_dispatched='. $order->id .'&error=' . $extra );\n wp_safe_redirect($redirect);\n exit;\n }\n }", "public function placeOrder()\n {\n $callback = request()->input('callback');\n\n try {\n if ($order = request()->input('order_id')) {\n $this->aliExpressOrderRepository->update([\n 'is_placed' => 1\n ], request()->input('order_id'));\n\n $response = response($callback . '(' . json_encode([\n 'success' => true,\n 'message' => 'Order successfully updated.'\n ]) . ')');\n } else {\n $response = response($callback . '(' . json_encode([\n 'success' => false,\n 'message' => 'Order id not exist.'\n ]) . ')');\n }\n } catch(\\Exception $e) {\n $response = response($callback . '(' . json_encode([\n 'success' => false,\n 'message' => $e->getMessage(),\n ]) . ')');\n }\n\n $response->header('Content-Type', 'application/javascript');\n\n return $response;\n }", "public function webhookOrders(){\n $this->load->model('Projects_model');\n $projectId = $_REQUEST['q'] ;\n $projectId = explode('^^', base64_decode($projectId))[1];\n $headers = $this->input->request_headers();\n $data = json_decode(file_get_contents('php://input'),true);\n \n if(!$data){\n if(isset($_REQUEST['webhook_id']) && $_REQUEST['webhook_id']!='')\n $this->Projects_model->saveValue('webhookid_order_update',$_REQUEST['webhook_id'] , $projectId);\n } else{\n $shopify_enable = $this->Projects_model->getValue('enabled', $projectId)?$this->Projects_model->getValue('enabled', $projectId):'';\n \n if($shopify_enable=='1'){\n \n $projects = $this->db->get_where('projects', array('id' => $projectId ))->result_array();\n if($projects[0]['erp_system']=='exactonline'){\n $this->load->helper('ExactOnline/vendor/autoload');\n $this->load->model('Exactonline_model');\n $this->load->model('Shopify_exact_model');\n //--------------- make exact connection ----------------------------------//\n $this->Exactonline_model->setData(\n array(\n 'projectId' => $projectId,\n 'redirectUrl' => $this->Projects_model->getValue('exactonline_redirect_url', $projectId),\n 'clientId' => $this->Projects_model->getValue('exactonline_client_id', $projectId),\n 'clientSecret' => $this->Projects_model->getValue('exactonline_secret_key', $projectId),\n )\n );\n $connection = $this->Exactonline_model->makeConnection($projectId);\n $sendOrder = $this->Shopify_exact_model->sendOrder($connection, $projectId, $data);\n $totalOrderImportSuccess = $this->Projects_model->getValue('total_orders_import_success', $projectId)?$this->Projects_model->getValue('total_orders_import_success', $projectId):0;\n $totalOrderImportError = $this->Projects_model->getValue('total_orders_import_error', $projectId)?$this->Projects_model->getValue('total_orders_import_error', $projectId):0;\n if($sendOrder['status']==0){\n $totalOrderImportError++;\n } else{\n $totalOrderImportSuccess++;\n }\n $this->Projects_model->saveValue('total_orders_import_success', $totalOrderImportSuccess, $projectId);\n $this->Projects_model->saveValue('total_orders_import_error', $totalOrderImportError, $projectId);\n project_error_log($projectId, 'exportorders',$sendOrder['message']);\n } \n }\n }\n }", "private function storePurchaseOrder() {\n return $this->json('POST', 'api/pch_purchase_order', $this->tempJson);\n }", "public function getDeliveryProcess()\n\t {\n\t \t$restaurantId = $this->request->query[\"restaurantId\"];\n\t \tif (!empty(trim((string)$restaurantId)) && $this->Restaurant->read(null,$restaurantId)){\n\t $queryResult = $this->RestaurantInfo->getDelivery($restaurantId);\n\t if ($queryResult !=null){\n\t $result = array(\"error\"=>array('code'=>0,'message'=>'Connect successfully'),\"contents\"=>$queryResult);\n\t echo json_encode($result);\n\t }else{\n\t \t$result = array(\"error\"=>array('code'=>404,'message'=>'Connect failed'),\"contents\"=>null);\n\t \techo json_encode($result);\n\t }\n\t }else{\n\t $result = array(\"error\"=>array('code'=>404,'message'=>'Connect failed'), \"content\"=>null);\n\t echo json_encode($result); \n\t }\n\t die;\n\t }", "public function responseAction()\n\t{\n\t\t$validated = true;\n\t\t$orderId = $_POST['orderNo'];// Generally sent by gateway\n\t\t\n\t\tif($validated) {\n\t\t\t// Payment was successful, so update the order's state, send order email and move to the success page\n\t\t\t$order = Mage::getModel('sales/order');\n\t\t\t$order->loadByIncrementId($orderId);\n\t\t\t$order->addStatusToHistory($order->getStatus(), Mage::helper('payza')->__('Customer successfully returned from Gateway'));\n\t\t\t$order->sendNewOrderEmail();\n\t\t\t$order->setEmailSent(true);\n\t\t\t$order->save();\n\t\t\tMage::getSingleton('checkout/session')->unsQuoteId();\n\t\t\t$this->_redirect('checkout/onepage/success', array('_secure'=>true));\n\t\t}\n\t\telse {\n\t\t\t// There is a problem in the response we got\n\t\t\t$this->_redirect('checkout/onepage/failure');\n\t\t}\n\t}", "function wcfm_wcmarketplace_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid']; \r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t$product_id = absint( $_POST['productid'] );\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n $order_item_id = $_POST['orderitemid'];\r\n \r\n $tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n \r\n if( wcfm_is_vendor() ) {\r\n \t$vendor = get_wcmp_vendor($user_id);\r\n\t\t\t\t$user_id = apply_filters('wcmp_mark_as_shipped_vendor', $user_id);\r\n\t\t\t\t$shippers = (array) get_post_meta($order_id, 'dc_pv_shipped', true);\r\n\t\t\t\t\r\n\t\t\t\tif (!in_array($user_id, $shippers)) {\r\n\t\t\t\t\t$shippers[] = $user_id;\r\n\t\t\t\t\t//$mails = WC()->mailer()->emails['WC_Email_Notify_Shipped'];\r\n\t\t\t\t\t//if (!empty($mails)) {\r\n\t\t\t\t\t\t//$customer_email = get_post_meta($order_id, '_billing_email', true);\r\n\t\t\t\t\t\t//$mails->trigger($order_id, $customer_email, $vendor->term_id, array( 'tracking_code' => $tracking_code, 'tracking_url' => $tracking_url ) );\r\n\t\t\t\t\t//}\r\n\t\t\t\t\tdo_action('wcmp_vendors_vendor_ship', $order_id, $vendor->term_id);\r\n\t\t\t\t\tarray_push($shippers, $user_id);\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t$wpdb->query(\"UPDATE {$wpdb->prefix}wcmp_vendor_orders SET shipping_status = '1' WHERE order_id = $order_id and vendor_id = $user_id and order_item_id = $order_item_id\");\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n \t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n \t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\tadd_comment_meta( $comment_id, '_vendor_id', $user_id );\r\n\t\t\t\t\r\n\t\t\t\tupdate_post_meta($order_id, 'dc_pv_shipped', $shippers);\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t\tdie;\r\n\t}", "public function execute(\\Magento\\Framework\\Event\\Observer $observer)\n {\n if (\"0\" == $this->scopeConfig->getValue('pickrr_magento2/general/automatic_shipment_enable', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE))\n return NULL;\n\n $order = $observer->getEvent()->getOrder();\n $payment = $order->getPayment();\n\n if($payment->getMethod() == \"cashondelivery\")\n $cod_amount = $order->getGrandTotal();\n else\n $cod_amount = 0.0;\n\n if ($order->getState() != Order::STATE_NEW && $order->getState() != Order::STATE_PENDING_PAYMENT )\n return NULL;\n\n $auth_token = $this->scopeConfig->getValue('pickrr_magento2/general/auth_token', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n\n $pickup_time = $this->scopeConfig->getValue('pickrr_magento2/shipment_details/pickup_time', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $from_name = $this->scopeConfig->getValue('pickrr_magento2/shipment_details/from_name', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $from_phone_number = $this->scopeConfig->getValue('pickrr_magento2/shipment_details/from_phone_number', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $from_pincode = $this->scopeConfig->getValue('pickrr_magento2/shipment_details/from_pincode', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n $from_address = $this->scopeConfig->getValue('pickrr_magento2/shipment_details/from_address', \\Magento\\Store\\Model\\ScopeInterface::SCOPE_STORE);\n\n $this->helper->createOrderShipment($auth_token, $order, $from_name, $from_phone_number, $from_pincode, $from_address, $pickup_time, $cod_amount);\n }", "public function updateLocationProduct(Request $request) {\n $product = Product::where('code', $request->code)->get();\n $product[0]->location_new = $request->location_new;\n $description = $product[0]->description;\n //send mail.....\n $status = $product[0]->status;\n $user_email = $product[0]->user->email;\n $data = array('name'=>\"ABCD\");\n // Path or name to the blade template to be rendered\n $template_path = 'email_template';\n $content = $product[0]->name;\n if ($status == 1 && $description != \"shipping\") {\n Mail::send($template_path, $data, function($message) use ($user_email, $content) {\n $message->to($user_email, 'Receiver Name')->subject('Orders are being delivered');\n $message->from('[email protected]',\"{$content}\".' is comming!');\n });\n $product[0]->description = \"shipping\";\n return response()->json([\"product\" => $product,\n \"status\" => $product[0]->save(),\n \"number\" => 201]);\n }\n if ($status == 2 && $description != \"delivered\") {\n Mail::send($template_path, $data, function($message) use ($user_email, $content) {\n $message->to($user_email, 'Receiver Name')->subject('Orders has been shipped');\n $message->from('[email protected]',\"{$content}\".' has been shipped!');\n });\n $product[0]->description = \"delivered\";\n return response()->json([\"product\" => $product,\n \"status\" => $product[0]->save(),\n \"number\" => 201]);\n }\n return response()->json([\"product\" => $product,\n \"status\" => $product[0]->save(),\n \"number\" => 201]);\n }", "public function create_shipment(Request $request){\n \t// dd($request->all());\n \t$order_id = $request->input('order_id');\n \t$create_label_quantity = $request->input('create_label_quantity');\n \t$create_label_type = $request->input('create_label_type');\n\n \t// dd($order_id);\n\t\terror_reporting(E_ALL);\n\t\tini_set('display_errors', '1');\n\t\t\n\t\t$soapClient = new \\SoapClient(asset('assets/aramex/').'/shipping-services-api-wsdl.wsdl');\n\t\t// echo '<pre>';\n\t\t// print_r($soapClient->__getFunctions());\n\n\t\t$obj_get_order = $this->BaseModel->with('get_customer_details')\n\t\t\t\t\t\t\t\t\t\t ->with(['get_order_details'=>function($q){\n\t\t\t\t\t\t\t\t\t\t \t$q->with('get_combination_details');\n\t\t\t\t\t\t\t\t\t\t }])\n\t\t\t\t\t\t\t\t\t\t ->where('id',$order_id)->first();\n\t\t// dd($obj_get_order->toArray());\n\n\t\tif($obj_get_order){\n\t\t\t$arr_data = $obj_get_order->toArray();\n\n\t\t\t$total_weight = 1;\n\t\t\t$weight = 0;\n\t\t\tif($arr_data['get_order_details']){\n\n\t\t\t\tforeach ($arr_data['get_order_details'] as $key => $value) {\n\t\t\t\t\t# code...\n\t\t\t\t\t$total_weight = $weight + $value['get_combination_details']['weight'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$params = array(\n\t\t\t\t'Shipments' => array(\t \n\t\t\t\t\t'Shipment' => array(\n\t\t\t\t\t\t\t'Shipper'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t'Reference1' \t=> 'Ref 111111',\n\t\t\t\t\t\t\t\t\t\t\t// 'Reference2' \t=> 'Ref 222222',\n\t\t\t\t\t\t\t\t\t\t\t'AccountNumber' => '60500178',\n\t\t\t\t\t\t\t\t\t\t\t'PartyAddress'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t'Line1'\t\t\t\t\t=> 'Airport Road, King Khalid International Airport, ',\n\t\t\t\t\t\t\t\t\t\t\t\t'Line2' \t\t\t\t=> 'Riyadh, 13463,',\n\t\t\t\t\t\t\t\t\t\t\t\t'Line3' \t\t\t\t=> 'SAUDI ARABIA',\n\t\t\t\t\t\t\t\t\t\t\t\t// 'City'\t\t\t\t\t=> 'Amman',\n\t\t\t\t\t\t\t\t\t\t\t\t'City'\t\t\t\t\t=> 'RUH',\n\t\t\t\t\t\t\t\t\t\t\t\t'StateOrProvinceCode'\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'PostCode'\t\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t// 'CountryCode'\t\t\t=> 'Jo'\n\t\t\t\t\t\t\t\t\t\t\t\t'CountryCode'\t\t\t=> 'SA'\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t'Contact'\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t'Department'\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'PersonName'\t\t\t=> 'Printplus Team',\n\t\t\t\t\t\t\t\t\t\t\t\t'Title'\t\t\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'CompanyName'\t\t\t=> 'Printplus',\n\t\t\t\t\t\t\t\t\t\t\t\t'PhoneNumber1'\t\t\t=> '5555555',\n\t\t\t\t\t\t\t\t\t\t\t\t'PhoneNumber1Ext'\t\t=> '125',\n\t\t\t\t\t\t\t\t\t\t\t\t// 'PhoneNumber1'\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t// 'PhoneNumber1Ext'\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'PhoneNumber2'\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'PhoneNumber2Ext'\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'FaxNumber'\t\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'CellPhone'\t\t\t\t=> '07777777',\n\t\t\t\t\t\t\t\t\t\t\t\t'EmailAddress'\t\t\t=> '[email protected]',\n\t\t\t\t\t\t\t\t\t\t\t\t'Type'\t\t\t\t\t=> ''\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t'Consignee'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t'Reference1'\t=> 'Ref 333333',\n\t\t\t\t\t\t\t\t\t\t\t// 'Reference2'\t=> 'Ref 444444',\n\t\t\t\t\t\t\t\t\t\t\t'AccountNumber' => '',\n\t\t\t\t\t\t\t\t\t\t\t'PartyAddress'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t'Line1'\t\t\t\t\t=> $arr_data['get_customer_details']['address'],\n\t\t\t\t\t\t\t\t\t\t\t\t'Line2'\t\t\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'Line3'\t\t\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'City'\t\t\t\t\t=> 'Dubai',\n\t\t\t\t\t\t\t\t\t\t\t\t'StateOrProvinceCode'\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'PostCode'\t\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'CountryCode'\t\t\t=> 'AE'\n\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\t\t\t\t\t\t\t'Contact'\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t'Department'\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'PersonName'\t\t\t=> $arr_data['get_customer_details']['full_name'],\n\t\t\t\t\t\t\t\t\t\t\t\t'Title'\t\t\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'CompanyName'\t\t\t=> $arr_data['get_customer_details']['full_name'],\n\t\t\t\t\t\t\t\t\t\t\t\t// 'PhoneNumber1'\t\t\t=> '6666666',\n\t\t\t\t\t\t\t\t\t\t\t\t// 'PhoneNumber1Ext'\t\t=> '155',\n\t\t\t\t\t\t\t\t\t\t\t\t'PhoneNumber1'\t\t\t=> $arr_data['get_customer_details']['mobile_number'],\n\t\t\t\t\t\t\t\t\t\t\t\t'PhoneNumber1Ext'\t\t=> $arr_data['get_customer_details']['country_code_id'],\n\t\t\t\t\t\t\t\t\t\t\t\t'PhoneNumber2'\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'PhoneNumber2Ext'\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'FaxNumber'\t\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t\t'CellPhone'\t\t\t\t=> $arr_data['get_customer_details']['country_code_id'].'-'.$arr_data['get_customer_details']['mobile_number'],\n\t\t\t\t\t\t\t\t\t\t\t\t'EmailAddress'\t\t\t=> $arr_data['get_customer_details']['email'],\n\t\t\t\t\t\t\t\t\t\t\t\t'Type'\t\t\t\t\t=> ''\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// 'ThirdParty' => array(\n\t\t\t\t\t\t\t// \t\t\t\t'Reference1' \t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t'Reference2' \t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t'AccountNumber' => '',\n\t\t\t\t\t\t\t// \t\t\t\t'PartyAddress'\t=> array(\n\t\t\t\t\t\t\t// \t\t\t\t\t'Line1'\t\t\t\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'Line2'\t\t\t\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'Line3'\t\t\t\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'City'\t\t\t\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'StateOrProvinceCode'\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'PostCode'\t\t\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'CountryCode'\t\t\t=> ''\n\t\t\t\t\t\t\t// \t\t\t\t),\n\t\t\t\t\t\t\t// \t\t\t\t'Contact'\t\t=> array(\n\t\t\t\t\t\t\t// \t\t\t\t\t'Department'\t\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'PersonName'\t\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'Title'\t\t\t\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'CompanyName'\t\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'PhoneNumber1'\t\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'PhoneNumber1Ext'\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'PhoneNumber2'\t\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'PhoneNumber2Ext'\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'FaxNumber'\t\t\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'CellPhone'\t\t\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'EmailAddress'\t\t\t=> '',\n\t\t\t\t\t\t\t// \t\t\t\t\t'Type'\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\t\t\t// ),\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// 'Reference1' \t\t\t\t=> 'Shpt 0001',\n\t\t\t\t\t\t\t'Reference1' \t\t\t\t=> '',\n\t\t\t\t\t\t\t'Reference2' \t\t\t\t=> '',\n\t\t\t\t\t\t\t'Reference3' \t\t\t\t=> '',\n\t\t\t\t\t\t\t// 'ForeignHAWB'\t\t\t\t=> 'ORDERID '.$arr_data['order_id'],\n\t\t\t\t\t\t\t'ForeignHAWB'\t\t\t\t=> 'AWB12321132dd2',\n\t\t\t\t\t\t\t'TransportType'\t\t\t\t=> 0,\n\t\t\t\t\t\t\t'ShippingDateTime' \t\t\t=> time(),\n\t\t\t\t\t\t\t'DueDate'\t\t\t\t\t=> time(),\n\t\t\t\t\t\t\t'PickupLocation'\t\t\t=> 'Reception',\n\t\t\t\t\t\t\t'PickupGUID'\t\t\t\t=> '',\n\t\t\t\t\t\t\t// 'Comments'\t\t\t\t\t=> 'Shpt 0001',\n\t\t\t\t\t\t\t'Comments'\t\t\t\t\t=> 'Please handle the package with care',\n\t\t\t\t\t\t\t'AccountingInstrcutions' \t=> '',\n\t\t\t\t\t\t\t'OperationsInstructions'\t=> '',\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t'Details' => array(\n\t\t\t\t\t\t\t\t\t\t\t// 'Dimensions' => array(\n\t\t\t\t\t\t\t\t\t\t\t// \t'Length'\t\t\t\t=> 10,\n\t\t\t\t\t\t\t\t\t\t\t// \t'Width'\t\t\t\t\t=> 10,\n\t\t\t\t\t\t\t\t\t\t\t// \t'Height'\t\t\t\t=> 10,\n\t\t\t\t\t\t\t\t\t\t\t// \t'Unit'\t\t\t\t\t=> 'cm',\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\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t'ActualWeight' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t'Value'\t\t\t\t\t=> $total_weight,\n\t\t\t\t\t\t\t\t\t\t\t\t'Unit'\t\t\t\t\t=> 'Kg'\n\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\t\t\t\t\t\t\t'ProductGroup' \t\t\t=> 'EXP',\n\t\t\t\t\t\t\t\t\t\t\t'ProductType'\t\t\t=> 'PDX',\n\t\t\t\t\t\t\t\t\t\t\t'PaymentType'\t\t\t=> 'P',\n\t\t\t\t\t\t\t\t\t\t\t'PaymentOptions' \t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t'Services'\t\t\t\t=> '',\n\t\t\t\t\t\t\t\t\t\t\t// 'NumberOfPieces'\t\t=> sizeof($arr_data['get_order_details']),\n\t\t\t\t\t\t\t\t\t\t\t'NumberOfPieces'\t\t=> $create_label_quantity,\n\t\t\t\t\t\t\t\t\t\t\t'DescriptionOfGoods' \t=> 'Printlus Cards',\n\t\t\t\t\t\t\t\t\t\t\t'GoodsOriginCountry' \t=> 'SA',\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t'CashOnDeliveryAmount' \t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t'Value'\t\t\t\t\t=> 0,\n\t\t\t\t\t\t\t\t\t\t\t\t'CurrencyCode'\t\t\t=> 'SAR'\n\t\t\t\t\t\t\t\t\t\t\t\t// 'CurrencyCode'\t\t\t=> ''\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t'InsuranceAmount'\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t'Value'\t\t\t\t\t=> 0,\n\t\t\t\t\t\t\t\t\t\t\t\t'CurrencyCode'\t\t\t=> 'SAR'\n\t\t\t\t\t\t\t\t\t\t\t\t// 'CurrencyCode'\t\t\t=> ''\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t'CollectAmount'\t\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t'Value'\t\t\t\t\t=> 0,\n\t\t\t\t\t\t\t\t\t\t\t\t'CurrencyCode'\t\t\t=> 'SAR'\n\t\t\t\t\t\t\t\t\t\t\t\t// 'CurrencyCode'\t\t\t=> ''\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t'CashAdditionalAmount'\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t\t'Value'\t\t\t\t\t=> 0,\n\t\t\t\t\t\t\t\t\t\t\t\t'CurrencyCode'\t\t\t=> 'SAR'\n\t\t\t\t\t\t\t\t\t\t\t\t// 'CurrencyCode'\t\t\t=> ''\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t'CashAdditionalAmountDescription' => '',\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t'CustomsValueAmount' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t'Value'\t\t\t\t\t=> 0,\n\t\t\t\t\t\t\t\t\t\t\t\t'CurrencyCode'\t\t\t=> 'SAR'\n\t\t\t\t\t\t\t\t\t\t\t\t// 'CurrencyCode'\t\t\t=> ''\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t'Items' \t\t\t\t=> array(\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\t\t\t),\n\t\t\t\t\t),\n\t\t\t),\n\t\t\t\n\t\t\t\t'ClientInfo' \t\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t// 'AccountCountryCode'\t=> 'JO',\n\t\t\t\t\t\t\t\t\t\t\t// 'AccountEntity'\t\t \t=> 'AMM',\n\t\t\t\t\t\t\t\t\t\t\t// 'AccountNumber'\t\t \t=> '20016',\n\t\t\t\t\t\t\t\t\t\t\t// 'AccountPin'\t\t \t=> '221321',\n\t\t\t\t\t\t\t\t\t\t\t// 'UserName'\t\t\t \t=> '[email protected]',\n\t\t\t\t\t\t\t\t\t\t\t// 'Password'\t\t\t \t=> '123456789',\n\t\t\t\t\t\t\t\t\t\t\t// 'Version'\t\t\t \t=> '1.0'\n\t\t\t\t\t\t\t\t\t\t\t'AccountCountryCode' => 'SA',\n\t\t 'AccountEntity' => 'RUH',\n\t\t 'AccountNumber' => '60500178',\n\t\t 'AccountPin' => '165165',\n\t\t 'UserName' => '[email protected]',\n\t\t 'Password' => 'Pr1nt$@11$22$',\n\t\t 'Version' => 'v1'\n\t\t\t\t\t\t\t\t\t\t),\n\n\t\t\t\t// 'Transaction' \t\t\t=> array(\n\t\t\t\t// \t\t\t\t\t\t\t'Reference1'\t\t\t=> '001',\n\t\t\t\t// \t\t\t\t\t\t\t'Reference2'\t\t\t=> '', \n\t\t\t\t// \t\t\t\t\t\t\t'Reference3'\t\t\t=> '', \n\t\t\t\t// \t\t\t\t\t\t\t'Reference4'\t\t\t=> '', \n\t\t\t\t// \t\t\t\t\t\t\t'Reference5'\t\t\t=> '',\t\t\t\t\t\t\t\t\t\n\t\t\t\t//\t\t\t\t\t\t ),\n\t\t\t\t'LabelInfo'\t\t\t\t=> array(\n\t\t\t\t\t\t\t\t\t\t\t'ReportID' \t\t\t\t=> 9201,\n\t\t\t\t\t\t\t\t\t\t\t'ReportType'\t\t\t=> 'URL',\n\t\t\t\t),\n\t\t);\n\t\t\n\t\t// $params['Shipments']['Shipment']['Details']['Items'][] = array(\n\t\t// \t'PackageType' \t=> 'Box',\n\t\t// \t'Quantity'\t\t=> 12,\n\t\t// \t'Weight'\t\t=> array(\n\t\t// \t\t\t'Value'\t\t=> 0.75,\n\t\t// \t\t\t'Unit'\t\t=> 'Kg',\t\t\n\t\t// \t),\n\t\t// \t'Comments'\t\t=> 'Please handle the package with careasas',\n\t\t// \t'Reference'\t\t=> ''\n\t\t// );\n\t\t\n\t\t// print_r($params);\n\t\t\n\t\ttry {\n\t\t\t$auth_call = $soapClient->CreateShipments($params);\n\t\t\t// echo '<pre>';\n\t\t\t// print_r($auth_call);\n\t\t\t// dd($auth_call);\n\t\t\tif($auth_call->HasErrors==false){\n\t\t\t\t$arr_create_shipment = [];\n\n\t\t\t\t$arr_create_shipment['order_id'] = $order_id;\n\t\t\t\t$arr_create_shipment['shipment_id'] = $auth_call->Shipments->ProcessedShipment->ID;\n\t\t\t\t$arr_create_shipment['ForeignHAWB'] = $auth_call->Shipments->ProcessedShipment->ForeignHAWB;\n\t\t\t\t$arr_create_shipment['LabelURL'] \t\t = $auth_call->Shipments->ProcessedShipment->ShipmentLabel->LabelURL;\n\t\t\t\t$arr_create_shipment['LabelFileContents'] = $auth_call->Shipments->ProcessedShipment->ShipmentLabel->LabelFileContents;\n\n\t\t\t\t$obj_create = $this->OrdersShipmentAramexModel->create($arr_create_shipment);\n\n\t\t\t\tif($obj_create){\n\t\t\t\t\t$obj_update = $this->BaseModel->where('id',$order_id)->update(['create_shipment'=>'1']);\n\t\t\t\t}\n\t\t\t\tSession::flash('success', 'Shipment created successfully.');\n\t\t\t\treturn redirect($this->module_url_path.'/edit_printing_orders/'.base64_encode($order_id));\n\t\t\t}else{\n\t\t\t\tSession::flash('error', 'Something went wrong.');\n\t\t\t\treturn redirect($this->module_url_path.'/edit_printing_orders/'.base64_encode($order_id));\n\t\t\t}\n\t\t\tdie();\n\t\t} catch (\\SoapFault $fault) {\n\t\t\t// die('Error : ' . $fault->faultstring);\n\t\t\t// dd(2);\n\n\t\t\tSession::flash('error', 'Something went wrong.');\n\t\t\treturn redirect($this->module_url_path.'/edit_printing_orders/'.base64_encode($order_id));\n\t\t}\n }", "public function create_shippify_task($order_id){\n session_start();\n $task_endpoint = \"https://api.shippify.co/task/new\";\n\n $order = new WC_Order($order_id);\n\n $products = '[{\"id\":\"10234\",\"name\":\"TV\",\"qty\":\"2\",\"size\":\"3\",\"price\":\"0\"}]'; //coger de package\n\n $sender_mail = \"[email protected]\"; //poner y coger de settings\n\n $recipient_name = get_post_meta( $order_id, '_billing_first_name', true ) . get_post_meta( $order_id, '_billing_last_name', true ) ;\n $recipient_email = get_post_meta( $order_id, '_billing_email', true );\n $recipient_phone = get_post_meta( $order_id, '_billing_phone', true );\n\n $pickup_warehouse = get_post_meta( $order_id, 'pickup_id', true );\n $pickup_latitude = get_post_meta( $order_id, 'pickup_latitude', true );\n $pickup_longitude = get_post_meta( $order_id, 'pickup_longitude', true );\n $pickup_address = get_post_meta( $order_id, 'pickup_address', true );\n\n $deliver_lat = get_post_meta( $order_id, 'Latitude', true );\n $deliver_lon = get_post_meta( $order_id, 'Longitude', true );\n $deliver_address = get_post_meta( $order_id, '_billing_address_1', true ) . get_post_meta( $order_id, '_billing_address_2', true );\n\n $note = get_post_meta( $order_id, 'Instructions', true );\n\n $ref_id = $order_id;\n\n $api_id = get_option('shippify_id');\n $api_secret = get_option('shippify_secret');\n\n $items = \"[\";\n foreach ($order->get_items() as $item_id => $_preproduct ) { \n $_product = $_preproduct->get_product();\n $items = $items . '{\"id\":\"' . $_product->get_id() . '\", \n \"name\":\"' . $_product->get_name() . '\", \n \"qty\": \"' . $_preproduct['quantity'] . '\", \n \"size\": \"' . $this->calculate_product_shippify_size($_product) . '\"\n },';\n }\n $items = substr($items, 0, -1) . ']';\n\n $wh_args = array(\n 'headers' => array(\n 'Authorization' => 'Basic ' . base64_encode( $api_id . ':' . $api_secret )\n ),\n 'method' => 'GET'\n ); \n\n $pickup_id = '';\n if ($pickup_warehouse != \"\" || isset($pickup_warehouse)){\n $warehouse_response = wp_remote_get('https://api.shippify.co/warehouse/list', $wh_args);\n if (!is_wp_error($warehouse_response)){\n $warehouse_response = json_decode($warehouse_response['body'], true);\n $warehouse_info = $warehouse_response[\"warehouses\"];\n foreach ($warehouse_info as $warehouse){\n if ($warehouse[\"id\"] == $pickup_warehouse){\n $pickup_id = $pickup_warehouse;\n break; \n }\n }\n }\n } \n\n if ($pickup_id == ''){\n $warehouse_to_request = '';\n }else{\n $warehouse_to_request = ',\n \"warehouse\": \"'. $pickup_id .'\"';\n }\n\n $total_amount = '';\n $payment_method = get_post_meta( $order_id, '_payment_method', true );\n if ($payment_method == 'cod'){\n $order_total = $order->get_total(); \n $total_amount = '\"total_amount\": \"' . $order_total . '\",'; \n }\n\n $request_body = '\n {\n \"task\" : {\n \"products\": '. $items . ',\n \"sender\" : {\n \"email\": \"'. $sender_mail . '\"\n },\n \"recipient\": {\n \"name\": \"'. $recipient_name . '\",\n \"email\": \"'. $recipient_email . '\",\n \"phone\": \"'. $recipient_phone . '\"\n },\n \"pickup\": {\n \"lat\": '. $pickup_latitude . ',\n \"lng\": '. $pickup_longitude . ',\n \"address\": \"'. $pickup_address . '\"'. $warehouse_to_request . '\n }, \n '. $total_amount . '\n \"deliver\": {\n \"lat\": '. $deliver_lat . ',\n \"lng\": '. $deliver_lon . ',\n \"address\": \"'. $deliver_address . '\"\n },\n \"ref_id\": \"'. $ref_id .'\",\n \"extra\": {\n \"note\": \"'. $note . '\" \n }\n }\n }';\n\n //Basic Authorization\n\n $args = array(\n 'headers' => array(\n 'Authorization' => 'Basic ' . base64_encode( $api_id . ':' . $api_secret ),\n 'Content-Type' => 'application/json'\n ),\n 'method' => 'POST',\n 'body' => $request_body\n );\n\n $response = wp_remote_post( $task_endpoint, $args );\n\n if (is_wp_error($response)){\n return false;\n }\n\n\n return $response;\n\n }", "public function sSaveOrder()\n {\n $this->sComment = stripslashes($this->sComment);\n $this->sComment = stripcslashes($this->sComment);\n\n $this->sShippingData['AmountNumeric'] = $this->sShippingData['AmountNumeric'] ?: '0';\n\n if ($this->isTransactionExist($this->bookingId)) {\n return false;\n }\n\n // Insert basic-data of the order\n $orderNumber = $this->sGetOrderNumber();\n $this->sOrderNumber = $orderNumber;\n\n if (!$this->sShippingcostsNumeric) {\n $this->sShippingcostsNumeric = 0.;\n }\n\n if (!$this->sBasketData['AmountWithTaxNumeric']) {\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNumeric'];\n }\n\n if ($this->isTaxFree($this->sSYSTEM->sUSERGROUPDATA['tax'], $this->sSYSTEM->sUSERGROUPDATA['id'])) {\n $net = '1';\n } else {\n $net = '0';\n }\n\n if ($this->dispatchId) {\n $dispatchId = $this->dispatchId;\n } else {\n $dispatchId = '0';\n }\n\n $this->sBasketData['AmountNetNumeric'] = round($this->sBasketData['AmountNetNumeric'], 2);\n\n if (empty($this->sBasketData['sCurrencyName'])) {\n $this->sBasketData['sCurrencyName'] = 'EUR';\n }\n if (empty($this->sBasketData['sCurrencyFactor'])) {\n $this->sBasketData['sCurrencyFactor'] = '1';\n }\n\n $shop = Shopware()->Shop();\n $mainShop = $shop->getMain() !== null ? $shop->getMain() : $shop;\n\n $taxfree = '0';\n if (!empty($this->sNet)) {\n // Complete net delivery\n $net = '1';\n $this->sBasketData['AmountWithTaxNumeric'] = $this->sBasketData['AmountNetNumeric'];\n $this->sShippingcostsNumeric = $this->sShippingcostsNumericNet;\n $taxfree = '1';\n }\n\n $partner = $this->getPartnerCode(\n $this->sUserData['additional']['user']['affiliate']\n );\n\n $ip = Shopware()->Container()->get('shopware.components.privacy.ip_anonymizer')\n ->anonymize(\n (string) Shopware()->Container()->get('request_stack')->getCurrentRequest()->getClientIp()\n );\n\n $orderParams = [\n 'ordernumber' => $orderNumber,\n 'userID' => $this->sUserData['additional']['user']['id'],\n 'invoice_amount' => $this->sBasketData['AmountWithTaxNumeric'],\n 'invoice_amount_net' => $this->sBasketData['AmountNetNumeric'],\n 'invoice_shipping' => (float) $this->sShippingcostsNumeric,\n 'invoice_shipping_net' => (float) $this->sShippingcostsNumericNet,\n 'invoice_shipping_tax_rate' => isset($this->sBasketData['sShippingcostsTaxProportional']) ? 0 : $this->sBasketData['sShippingcostsTax'],\n 'ordertime' => new Zend_Db_Expr('NOW()'),\n 'changed' => new Zend_Db_Expr('NOW()'),\n 'status' => 0,\n 'cleared' => 17,\n 'paymentID' => $this->getPaymentId(),\n 'transactionID' => (string) $this->bookingId,\n 'customercomment' => $this->sComment,\n 'net' => $net,\n 'taxfree' => $taxfree,\n 'partnerID' => (string) $partner,\n 'temporaryID' => (string) $this->uniqueID,\n 'referer' => (string) $this->getSession()->offsetGet('sReferer'),\n 'language' => $shop->getId(),\n 'dispatchID' => $dispatchId,\n 'currency' => $this->sBasketData['sCurrencyName'],\n 'currencyFactor' => $this->sBasketData['sCurrencyFactor'],\n 'subshopID' => $mainShop->getId(),\n 'remote_addr' => $ip,\n 'deviceType' => $this->deviceType,\n 'is_proportional_calculation' => isset($this->sBasketData['sShippingcostsTaxProportional']) ? 1 : 0,\n ];\n\n $orderParams = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveOrder_FilterParams',\n $orderParams,\n ['subject' => $this]\n );\n\n try {\n $this->db->beginTransaction();\n $affectedRows = $this->db->insert('s_order', $orderParams);\n $orderID = $this->db->lastInsertId();\n $this->db->commit();\n } catch (Exception $e) {\n $this->db->rollBack();\n throw new Enlight_Exception(\n sprintf('Shopware Order Fatal-Error %s :%s', $_SERVER['HTTP_HOST'], $e->getMessage()),\n 0,\n $e\n );\n }\n\n if (!$affectedRows || !$orderID) {\n throw new Enlight_Exception(\n sprintf('Shopware Order Fatal-Error %s : No rows affected or no order id created.', $_SERVER['HTTP_HOST']),\n 0\n );\n }\n\n try {\n $paymentData = Shopware()->Modules()->Admin()\n ->sGetPaymentMeanById($this->getPaymentId(), Shopware()->Modules()->Admin()->sGetUserData());\n $paymentClass = Shopware()->Modules()->Admin()->sInitiatePaymentClass($paymentData);\n if ($paymentClass instanceof \\ShopwarePlugin\\PaymentMethods\\Components\\BasePaymentMethod) {\n $paymentClass->createPaymentInstance(\n $orderID,\n $this->sUserData['additional']['user']['id'],\n $this->getPaymentId()\n );\n }\n } catch (\\Exception $e) {\n //Payment method code failure\n }\n\n $attributeData = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveOrder_FilterAttributes',\n $this->orderAttributes,\n [\n 'subject' => $this,\n 'orderID' => $orderID,\n 'orderParams' => $orderParams,\n ]\n );\n\n $this->attributePersister->persist($attributeData, 's_order_attributes', $orderID);\n $attributes = $this->attributeLoader->load('s_order_attributes', $orderID);\n unset($attributes['id'], $attributes['orderID']);\n\n $esdOrder = null;\n foreach ($this->sBasketData['content'] as $key => $basketRow) {\n $basketRow = $this->formatBasketRow($basketRow);\n\n $preparedQuery = '\n INSERT INTO s_order_details\n (orderID,\n ordernumber,\n articleID,\n articleordernumber,\n price,\n quantity,\n name,\n status,\n releasedate,\n modus,\n esdarticle,\n taxID,\n tax_rate,\n ean,\n unit,\n pack_unit,\n articleDetailID\n )\n VALUES (%d, %s, %d, %s, %f, %d, %s, %d, %s, %d, %d, %d, %f, %s, %s, %s, %d)\n ';\n\n $sql = sprintf(\n $preparedQuery,\n $orderID,\n $this->db->quote((string) $orderNumber),\n $basketRow['articleID'],\n $this->db->quote((string) $basketRow['ordernumber']),\n $basketRow['priceNumeric'],\n $basketRow['quantity'],\n $this->db->quote((string) $basketRow['articlename']),\n 0,\n $this->db->quote((string) $basketRow['releasedate']),\n $basketRow['modus'],\n $basketRow['esdarticle'],\n $basketRow['taxID'],\n $basketRow['tax_rate'],\n $this->db->quote((string) $basketRow['ean']),\n $this->db->quote((string) $basketRow['itemUnit']),\n $this->db->quote((string) $basketRow['packunit']),\n $basketRow['additional_details']['articleDetailsID']\n );\n\n $sql = $this->eventManager->filter('Shopware_Modules_Order_SaveOrder_FilterDetailsSQL', $sql, [\n 'subject' => $this,\n 'row' => $basketRow,\n 'user' => $this->sUserData,\n 'order' => ['id' => $orderID, 'number' => $orderNumber],\n ]);\n\n // Check for individual voucher - code\n if ($basketRow['modus'] == 2) {\n //reserve the basket voucher for the current user.\n $this->reserveVoucher(\n $basketRow['ordernumber'],\n $this->sUserData['additional']['user']['id'],\n $basketRow['articleID']\n );\n }\n\n if ($basketRow['esdarticle']) {\n $esdOrder = true;\n }\n\n try {\n $this->db->executeUpdate($sql);\n $orderdetailsID = $this->db->lastInsertId();\n } catch (Exception $e) {\n throw new Enlight_Exception(sprintf(\n 'Shopware Order Fatal-Error %s :%s',\n $_SERVER['HTTP_HOST'],\n $e->getMessage()\n ), 0, $e);\n }\n\n $this->sBasketData['content'][$key]['orderDetailId'] = $orderdetailsID;\n\n // Save attributes\n $attributeData = $this->attributeLoader->load('s_order_basket_attributes', $basketRow['id']);\n\n $attributeData = $this->eventManager->filter(\n 'Shopware_Modules_Order_SaveOrder_FilterDetailAttributes',\n $attributeData,\n [\n 'subject' => $this,\n 'basketRow' => $basketRow,\n 'orderdetailsID' => $orderdetailsID,\n ]\n );\n\n $this->attributePersister->persist($attributeData, 's_order_details_attributes', $orderdetailsID);\n $detailAttributes = $this->attributeLoader->load('s_order_details_attributes', $orderdetailsID);\n unset($detailAttributes['id'], $detailAttributes['detailID']);\n $this->sBasketData['content'][$key]['attributes'] = $detailAttributes;\n\n // Update sales and stock\n if ($basketRow['priceNumeric'] >= 0) {\n $this->refreshOrderedVariant(\n $basketRow['ordernumber'],\n $basketRow['quantity']\n );\n }\n\n // For esd-products, assign serial number if needed\n // Check if this product is esd-only (check in variants, too -> later)\n if ($basketRow['esdarticle']) {\n $basketRow = $this->handleESDOrder($basketRow, $orderID, $orderdetailsID);\n\n // Add assignedSerials to basketcontent\n if (!empty($basketRow['assignedSerials'])) {\n $this->sBasketData['content'][$key]['serials'] = $basketRow['assignedSerials'];\n }\n }\n } // For every product in basket\n\n $this->eventManager->notify('Shopware_Modules_Order_SaveOrder_ProcessDetails', [\n 'subject' => $this,\n 'details' => $this->sBasketData['content'],\n 'orderId' => $orderID,\n ]);\n\n // Save Billing and Shipping-Address to retrace in future\n $this->sSaveBillingAddress($this->sUserData['billingaddress'], $orderID);\n $this->sSaveShippingAddress($this->sUserData['shippingaddress'], $orderID);\n\n $this->sUserData = $this->getUserDataForMail($this->sUserData);\n\n $details = $this->getOrderDetailsForMail(\n $this->sBasketData['content']\n );\n\n $variables = [\n 'sOrderDetails' => $details,\n 'billingaddress' => $this->sUserData['billingaddress'],\n 'shippingaddress' => $this->sUserData['shippingaddress'],\n 'additional' => $this->sUserData['additional'],\n 'sShippingCosts' => $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sShippingcosts) . ' ' . $this->sBasketData['sCurrencyName'],\n 'sAmount' => $this->sAmountWithTax ? $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sAmountWithTax) . ' ' . $this->sBasketData['sCurrencyName'] : $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sAmount) . ' ' . $this->sBasketData['sCurrencyName'],\n 'sAmountNumeric' => $this->sAmountWithTax ? $this->sAmountWithTax : $this->sAmount,\n 'sAmountNet' => $this->sSYSTEM->sMODULES['sArticles']->sFormatPrice($this->sBasketData['AmountNetNumeric']) . ' ' . $this->sBasketData['sCurrencyName'],\n 'sAmountNetNumeric' => $this->sBasketData['AmountNetNumeric'],\n 'sTaxRates' => $this->sBasketData['sTaxRates'],\n 'ordernumber' => $orderNumber,\n 'sOrderDay' => date('d.m.Y'),\n 'sOrderTime' => date('H:i'),\n 'sComment' => $this->sComment,\n 'attributes' => $attributes,\n 'sEsd' => $esdOrder,\n ];\n\n if ($dispatchId) {\n $variables['sDispatch'] = $this->sSYSTEM->sMODULES['sAdmin']->sGetPremiumDispatch($dispatchId);\n }\n if ($this->bookingId) {\n $variables['sBookingID'] = $this->bookingId;\n }\n\n // Completed - Garbage basket / temporary - order\n $this->sDeleteTemporaryOrder();\n\n $this->db->executeUpdate(\n 'DELETE FROM s_order_basket WHERE sessionID=?',\n [$this->getSession()->offsetGet('sessionId')]\n );\n\n $confirmMailDeliveryFailed = false;\n try {\n $this->sendMail($variables);\n } catch (\\Exception $e) {\n $confirmMailDeliveryFailed = true;\n $email = $this->sUserData['additional']['user']['email'];\n $this->logOrderMailException($e, $orderNumber, $email);\n }\n\n // Check if voucher is affected\n $this->sTellFriend();\n\n if ($this->getSession()->offsetExists('sOrderVariables')) {\n $variables = $this->getSession()->offsetGet('sOrderVariables');\n $variables['sOrderNumber'] = $orderNumber;\n $variables['confirmMailDeliveryFailed'] = $confirmMailDeliveryFailed;\n $this->getSession()->offsetSet('sOrderVariables', $variables);\n }\n\n $this->eventManager->notify('Shopware_Modules_Order_SaveOrder_OrderCreated', [\n 'subject' => $this,\n 'details' => $this->sBasketData['content'],\n 'orderId' => $orderID,\n 'orderNumber' => $orderNumber,\n ]);\n\n return $orderNumber;\n }", "public function execute()\n {\n /** @var \\Magento\\Framework\\Controller\\Result\\Json $result */\n $result = $this->resultJsonFactory->create();\n $success = false;\n $successMessage = '';\n\n // Initiate order\n $order = $this->_initOrder();\n if (!$this->affirmCheckout->isAffirmPaymentMethod($order)) {\n return $result->setData([\n 'success' => false,\n 'message' => \"Error\",\n 'checkout_status' => \"Error\",\n 'checkout_status_message' => \"Selected payment method is not Affirm\",\n 'checkout_action' => false\n ]);\n }\n\n // Check if the extension active\n if (!$this->affirmCheckout->isAffirmTelesalesActive()) {\n return $result->setData([\n 'success' => false,\n 'message' => \"Error\",\n 'checkout_status' => \"Error\",\n 'checkout_status_message' => \"Affirm Telesales is not currently active\",\n 'checkout_action' => false\n ]);\n }\n\n // Resend if checkout token exists\n $checkout_token = $this->getPaymentCheckoutToken($order);\n $currency_code = $order->getOrderCurrencyCode();\n if ($checkout_token) {\n try {\n $resendCheckoutResponse = $this->affirmCheckout->resendCheckout($checkout_token, $currency_code);\n $responseStatus = $resendCheckoutResponse->getStatusCode();\n $responseBody = json_decode($resendCheckoutResponse->getBody(), true);\n\n if ($responseStatus > 200) {\n $this->logger->debug('Affirm_Telesales__resendCheckout_status_code: ', [$responseStatus]);\n $this->logger->debug('Affirm_Telesales__resendCheckout_response_body: ', [$responseBody]);\n return $result->setData([\n 'success' => false,\n 'message' => $resendCheckoutResponse->getMessage(),\n 'checkout_status' => \"Error\",\n 'checkout_status_message' => $responseBody['message'] ?: \"API Error - Affirm checkout resend could not be processed\",\n 'checkout_action' => true\n ]);\n }\n // JSON result\n $success = true;\n $successMessage = 'Checkout link was re-sent successfully';\n } catch (\\Exception $e) {\n $this->logger->debug($e->getMessage());\n return $result->setData([\n 'success' => false,\n 'message' => \"Error\",\n 'checkout_status' => \"Error\",\n 'checkout_status_message' => \"API Error - Affirm checkout resend could not be processed\",\n 'checkout_action' => true\n ]);\n }\n }\n\n if (!$checkout_token && $order->getState() === \\Magento\\Sales\\Model\\Order::STATE_NEW) {\n // Generate checkout object\n $data = $this->affirmCheckout->getCheckoutObject($order);\n if (!$data) {\n return $result->setData([\n 'success' => false,\n 'message' => 'Checkout data unavailable',\n 'checkout_status' => \"Error\",\n 'checkout_status_message' => \"Checkout data unavailable\",\n 'checkout_action' => true\n ]);\n }\n try {\n $currency_code = $order->getOrderCurrencyCode();\n $sendCheckoutResponse = $this->affirmCheckout->sendCheckout($data, $currency_code);\n $responseStatus = $sendCheckoutResponse->getStatusCode();\n $responseBody = json_decode($sendCheckoutResponse->getBody(), true);\n if ($responseStatus > 200) {\n $this->logger->debug('Affirm_Telesales__sendCheckout_status_code: ', [$responseStatus]);\n $this->logger->debug('Affirm_Telesales__sendCheckout_response_body: ', [$responseBody]);\n $bodyMessage = $responseBody['message'] && $responseBody['field'] ? \"{$responseBody['message']} ({$responseBody['field']})\" : \"API Error - Affirm checkout could not be processed\";\n return $result->setData([\n 'success' => false,\n 'message' => $sendCheckoutResponse->getMessage(),\n 'checkout_status' => \"Error\",\n 'checkout_status_message' => $bodyMessage,\n 'checkout_action' => true\n ]);\n }\n\n // JSON result\n $success = true;\n $successMessage = 'Checkout link was sent successfully';\n\n $checkout_token = $responseBody['checkout_id'];\n } catch (\\Exception $e) {\n $this->logger->debug($e->getMessage());\n return $result->setData([\n 'success' => false,\n 'message' => 'API Error - Affirm checkout could not be processed',\n 'checkout_status' => \"Error\",\n 'checkout_status_message' => \"API Error - Affirm checkout could not be processed\",\n 'checkout_action' => true\n ]);\n }\n\n // Save checkout token\n $payment = $order->getPayment();\n try {\n $payment->setAdditionalInformation('checkout_token', $checkout_token);\n $payment->save();\n } catch (\\Exception $e) {\n $this->logger->debug($e->getMessage());\n }\n\n // Update order history comment\n $order->addCommentToStatusHistory('Affirm checkout has been sent to the customer. Checkout token: ' . $checkout_token, false, false);\n $this->logger->debug('Affirm Telesales checkout token sent to customer: ' . $checkout_token);\n try {\n $this->orderRepository->save($order);\n } catch (\\Exception $e) {\n $this->logger->debug($e->getMessage());\n }\n }\n // Return JSON result\n return $result->setData([\n 'success' => $success,\n 'message' => $successMessage,\n 'checkout_status' => \"Application sent\",\n 'checkout_status_message' => \"Waiting for customer to start the application\"\n ]);\n }", "public function execute()\n {\n $this->log->info(\"Received server to server notification.\");\n\n $oResponse = $this->resultFactory->create(\\Magento\\Framework\\Controller\\ResultFactory::TYPE_RAW);\n $response = $this->getRequest()->getParams();\n\n $result = null;\n if (array_key_exists('opensslResult', $response)) {\n try {\n $result = $this->helper->decryptResponse($response['opensslResult']);\n\n if ($result != null) {\n $result = json_decode($result);\n\n $this->log->debug(var_export($result, true));\n } else {\n $this->log->error(\"Decoded response is NULL\");\n }\n } catch (\\Exception $ex) {\n $this->log->error($ex->getMessage(), $ex);\n }\n }\n\n if ($result && isset($result->status) &&\n ($result->status == 'complete-ok' || $result->status == 'in-progress')) {\n try {\n $this->helper->processGatewayResponse($result);\n $oResponse->setContents('OK');\n } catch (PaymentException $e) {\n $this->log->error($e->getMessage(), $e);\n $oResponse->setContents('ERROR');\n }\n } else {\n $oResponse->setContents('ERROR');\n }\n\n return $oResponse;\n }", "public function saveAction()\n {\n $data = $this->getRequest()->getPost('shipment');\n if (!empty($data['comment_text'])) {\n Mage::getSingleton('adminhtml/session')->setCommentText($data['comment_text']);\n }\n\n try {\n $shipment = $this->_initShipment();\n\n if (!$shipment) {\n $this->_forward('noRoute');\n return;\n }\n\n $shipment->register();\n $comment = '';\n if (!empty($data['comment_text'])) {\n $shipment->addComment(\n $data['comment_text'],\n isset($data['comment_customer_notify']),\n isset($data['is_visible_on_front'])\n );\n if (isset($data['comment_customer_notify'])) {\n $comment = $data['comment_text'];\n }\n }\n\n if (!empty($data['send_email'])) {\n $shipment->setEmailSent(true);\n }\n\n $shipment->getOrder()->setCustomerNoteNotify(!empty($data['send_email']));\n $responseAjax = new Varien_Object();\n $isNeedCreateLabel = isset($data['create_shipping_label']) && $data['create_shipping_label'];\n\n if ($isNeedCreateLabel && $this->_createShippingLabel($shipment)) {\n $responseAjax->setOk(true);\n }\n\n $this->_saveNewPostWaybill($shipment);\n\n $this->_saveShipment($shipment);\n\n $shipment->sendEmail(!empty($data['send_email']), $comment);\n\n $shipmentCreatedMessage = $this->__('The shipment has been created.');\n $labelCreatedMessage = $this->__('The shipping label has been created.');\n\n $this->_getSession()->addSuccess($isNeedCreateLabel ? $shipmentCreatedMessage . ' ' . $labelCreatedMessage\n : $shipmentCreatedMessage);\n Mage::getSingleton('adminhtml/session')->getCommentText(true);\n\n } catch (Mage_Core_Exception $e) {\n if ($isNeedCreateLabel) {\n $responseAjax->setError(true);\n $responseAjax->setMessage($e->getMessage());\n } else {\n $this->_getSession()->addError($e->getMessage());\n $this->_redirect('*/*/new', array('order_id' => $this->getRequest()->getParam('order_id')));\n }\n } catch (Exception $e) {\n Mage::logException($e);\n if ($isNeedCreateLabel) {\n $responseAjax->setError(true);\n $responseAjax->setMessage(\n Mage::helper('sales')->__('An error occurred while creating shipping label.'));\n } else {\n $this->_getSession()->addError($this->__('Cannot save shipment.'));\n $this->_redirect('*/*/new', array('order_id' => $this->getRequest()->getParam('order_id')));\n }\n\n }\n if ($isNeedCreateLabel) {\n $this->getResponse()->setBody($responseAjax->toJson());\n } else {\n $this->_redirect('*/sales_order/view', array('order_id' => $shipment->getOrderId()));\n }\n }", "public function prepareOrder()\n {\n /** @var OxpsPaymorrowRequestControllerProxy $oPmGateWay */\n $oPmGateWay = oxNew( 'OxpsPaymorrowRequestControllerProxy' );\n\n $oUtils = oxRegistry::getUtils();\n\n $oUtils->setHeader( \"Content-Type: application/json\" );\n $oUtils->showMessageAndExit( $oPmGateWay->prepareOrder( $_POST ) );\n }", "function wcfm_wcvendors_order_mark_shipped() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid'];\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$order_item_id = $_POST['orderitemid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t\r\n\t\t\t$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n\t\t\tif( wcfm_is_vendor() ) {\r\n\t\t\t\t$vendors = WCV_Vendors::get_vendors_from_order( $order );\r\n\t\t\t\t$vendor_ids = array_keys( $vendors );\r\n\t\t\t\tif ( !in_array( $user_id, $vendor_ids ) ) {\r\n\t\t\t\t\t_e( 'You are not allowed to modify this order.', 'wc-frontend-manager-ultimate' );\r\n\t\t\t\t\tdie; \r\n\t\t\t\t}\r\n\t\t\t\t$shippers = (array) get_post_meta( $order_id, 'wc_pv_shipped', true );\r\n\t\r\n\t\t\t\t// If not in the shippers array mark as shipped otherwise do nothing. \r\n\t\t\t\tif( !in_array($user_id, $shippers)) {\r\n\t\t\t\t\t$shippers[] = $user_id;\r\n\t\t\t\t\t//$mails = $woocommerce->mailer()->get_emails();\r\n\t\t\t\t\t//if ( !empty( $mails ) ) {\r\n\t\t\t\t\t//\t$mails[ 'WC_Email_Notify_Shipped' ]->trigger( $order_id, $user_id );\r\n\t\t\t\t\t//}\r\n\t\t\t\t\t//do_action('wcvendors_vendor_ship', $order_id, $user_id);\r\n\t\t\t\t\t_e( 'Order marked shipped.', 'wc-frontend-manager-ultimate' );\r\n\t\t\t\t} elseif ( false != ( $key = array_search( $user_id, $shippers) ) ) {\r\n\t\t\t\t\tunset( $shippers[$key] ); // Remove user from the shippers array\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t$shop_name = $WCFM->wcfm_vendor_support->wcfm_get_vendor_store_by_vendor( absint($user_id) );\r\n\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n\t\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\t\r\n\t\t\t\tupdate_post_meta( $order_id, 'wc_pv_shipped', $shippers );\r\n\t\t\t} else {\r\n\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Update Shipping Tracking Info\r\n\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\r\n\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t}\r\n\t}", "public function execute()\n {\n try {\n $paymentResponse = $this->getRequest()->getPost();\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $messageMessenger = $objectManager->get('Magento\\Framework\\Message\\ManagerInterface');\n\n if ($paymentResponse) {\n $responseCode = (string)$paymentResponse['TURKPOS_RETVAL_Sonuc'];\n $orderId = (string)$paymentResponse['TURKPOS_RETVAL_Siparis_ID'];\n $order = $this->orderFactory->create()->load($orderId, 'increment_id');\n\n if ($this->config->isAllowDebug()) {\n $this->logger->info(__('Response from Param for order id %1', $order->getId()));\n $this->logger->info(__('Response code: %1', $responseCode));\n }\n\n if ($order->getId()) {\n if ($responseCode == self::SUCCESS_STATUS) {\n $transactionId = (string)$paymentResponse['TURKPOS_RETVAL_Islem_ID'];\n $order->getPayment()->addData([\n 'cc_trans_id' => $transactionId, \n 'tranRes' => $paymentResponse['TURKPOS_RETVAL_Sonuc_Str'],\n 'tranDate' => $paymentResponse['TURKPOS_RETVAL_Islem_Tarih'],\n 'tranAmount' => $paymentResponse['TURKPOS_RETVAL_Tahsilat_Tutari'],\n 'docId' => $paymentResponse['TURKPOS_RETVAL_Dekont_ID'],\n 'tranResponseCode' => $paymentResponse['TURKPOS_RETVAL_Banka_Sonuc_Kod'],\n ])->save();\n \n $order->getPayment()->getMethodInstance()->capture($order->getPayment(), $order->getGrandTotal());\n $redirectUrl = $this->frontendUrlBuilder->setScope($order->getStoreId())->getUrl('checkout/onepage/success');\n $messageMessenger->addSuccess($paymentResponse['TURKPOS_RETVAL_Sonuc_Str']);\n return $this->resultRedirectFactory->create()->setUrl($redirectUrl);\n } else {\n $order->getPayment()->addData([\n 'tranRes' => $paymentResponse['TURKPOS_RETVAL_Sonuc_Str'],\n 'tranDate' => $paymentResponse['TURKPOS_RETVAL_Islem_Tarih'],\n 'tranResponseCode' => $paymentResponse['TURKPOS_RETVAL_Banka_Sonuc_Kod'],\n ])->save();\n \n $order->getPayment()->setAdditionalInformation('tranRes', $order->getPayment()->getData('tranRes'));\n $order->getPayment()->setAdditionalInformation('tranDate', $order->getPayment()->getData('tranDate'));\n $order->getPayment()->setAdditionalInformation('tranResponseCode', $order->getPayment()->getData('tranResponseCode'));\n $this->paymentResource->save($order->getPayment());\n \n $redirectUrl = $this->frontendUrlBuilder->setScope($order->getStoreId())->getUrl('checkout/onepage/failure');\n $messageMessenger->addError($paymentResponse['TURKPOS_RETVAL_Sonuc_Str']);\n return $this->resultRedirectFactory->create()->setUrl($redirectUrl);\n }\n }\n }\n } catch (Exception $e) {\n $this->logger->critical($e->getMessage());\n }\n\n if ($checkoutFailPage = $this->config->getCheckoutFailurePage()) {\n $redirectUrl = $this->pageHelper->getPageUrl($checkoutFailPage);\n return $this->resultRedirectFactory->create()->setUrl($redirectUrl);\n }\n\n return $this->resultRedirectFactory->create()->setPath('checkout/onepage/failure');\n }", "public function successAfter($observer) {\r\n $sellerDefaultCountry = '';\r\n $nationalShippingPrice = $internationalShippingPrice = 0;\r\n $orderIds = $observer->getEvent()->getOrderIds();\r\n $order = Mage::getModel('sales/order')->load($orderIds [0]);\r\n $customer = Mage::getSingleton('customer/session')->getCustomer();\r\n $getCustomerId = $customer->getId();\r\n $grandTotal = $order->getGrandTotal();\r\n $status = $order->getStatus();\r\n $itemCount = 0;\r\n $shippingCountryId = '';\r\n $items = $order->getAllItems();\r\n $orderEmailData = array();\r\n foreach ($items as $item) {\r\n\r\n $getProductId = $item->getProductId();\r\n $createdAt = $item->getCreatedAt();\r\n $is_buyer_confirmation_date = '0000-00-00 00:00:00';\r\n $paymentMethodCode = $order->getPayment()->getMethodInstance()->getCode();\r\n $products = Mage::helper('marketplace/marketplace')->getProductInfo($getProductId);\r\n $products_new = Mage::getModel('catalog/product')->load($item->getProductId());\r\n if($products_new->getTypeId() == \"configurable\")\r\n {\r\n $options = $item->getProductOptions() ;\r\n\r\n $sku = $options['simple_sku'] ;\r\n $getProductId = Mage::getModel('catalog/product')->getIdBySku($sku);\r\n }\r\n else{\r\n $getProductId = $item->getProductId();\r\n }\r\n\r\n\r\n\r\n $sellerId = $products->getSellerId();\r\n $productType = $products->getTypeID();\r\n /**\r\n * Get the shipping active status of seller\r\n */\r\n $sellerShippingEnabled = Mage::getStoreConfig('carriers/apptha/active');\r\n if ($sellerShippingEnabled == 1 && $productType == 'simple') {\r\n /**\r\n * Get the product national shipping price\r\n * and international shipping price\r\n * and shipping country\r\n */\r\n $nationalShippingPrice = $products->getNationalShippingPrice();\r\n $internationalShippingPrice = $products->getInternationalShippingPrice();\r\n $sellerDefaultCountry = $products->getDefaultCountry();\r\n $shippingCountryId = $order->getShippingAddress()->getCountry();\r\n }\r\n /**\r\n * Check seller id has been set\r\n */\r\n if ($sellerId) {\r\n $orderPrice = $item->getBasePrice() * $item->getQtyOrdered();\r\n $productAmt = $item->getBasePrice();\r\n $productQty = $item->getQtyOrdered();\r\n if ($paymentMethodCode == 'paypaladaptive') {\r\n $credited = 1;\r\n } else {\r\n $credited = 0;\r\n }\r\n\r\n /* check for checking if payment method is credit card or cash on delivery and if method\r\n is cash on delivery then it will check if the order status of previous orders are complete or not\r\n no need to disable sending email from admin*/\r\n\r\n /*-----------------Adding Failed Delivery Value--------------------------*/\r\n Mage::helper('progos_ordersedit')->getFailedDeliveryStatus($order);\r\n /*----------------------------------------------------------------------*/\r\n\r\n if ($paymentMethodCode == 'ccsave' || $paymentMethodCode == 'telrpayments_cc' || $paymentMethodCode == 'telrtransparent' ) {\r\n $is_buyer_confirmation = 'No';\r\n $is_buyer_confirmation_date = $createdAt;\r\n $item_order_status = 'pending_seller';\r\n $data = 0;\r\n\r\n /*---------------------------Updating comment----------------------*/\r\n /*\r\n * Elabelz-2057\r\n */\r\n /*$product = Mage::getModel(\"catalog/product\")->load($getProductId);\r\n $comment = \"Order Item having SKU '{$product->getSku()}' is <strong>accepted</strong> by buyer\";\r\n $order->addStatusHistoryComment($comment, $order->getStatus())\r\n ->setIsVisibleOnFront(0)\r\n ->setIsCustomerNotified(0);\r\n $order->save();*/\r\n /*---------------------------Updating comment----------------------*/\r\n\r\n } elseif ($paymentMethodCode == 'cashondelivery' || $paymentMethodCode == 'msp_cashondelivery') {\r\n\r\n $counter = 0;\r\n $orders = Mage::getModel('sales/order')->getCollection();\r\n $orders->addFieldToSelect('*');\r\n $orders->addFieldToFilter('customer_id', Mage::getSingleton('customer/session')->getId());\r\n foreach ($orders as $ord) {\r\n if ($ord->getStatus() == \"complete\"):\r\n $counter = $counter + 1;\r\n endif;\r\n }\r\n if ($counter != 0) {\r\n $is_buyer_confirmation = 'Yes';\r\n $is_buyer_confirmation_yes = \"Accepted\";\r\n $item_order_status = 'pending_seller';\r\n $data = 0;\r\n\r\n /*---------------------------Updating comment----------------------*/\r\n $product = Mage::getModel(\"catalog/product\")->load($getProductId);\r\n $comment = \"Order Item having SKU '{$product->getSku()}' is <strong>accepted</strong> by buyer\";\r\n $order->addStatusHistoryComment($comment, $order->getStatus())\r\n ->setIsVisibleOnFront(0)\r\n ->setIsCustomerNotified(0);\r\n $order->save();\r\n /*---------------------------Updating comment----------------------*/\r\n\r\n } else {\r\n $is_buyer_confirmation = 'No';\r\n $item_order_status = 'pending';\r\n $tel = $order->getBillingAddress()->getTelephone();\r\n $nexmoActivated = Mage::getStoreConfig('marketplace/nexmo/nexmo_activated');\r\n $nexmoStores = Mage::getStoreConfig('marketplace/nexmo/nexmo_stores');\r\n $nexmoStores = explode(',', $nexmoStores);\r\n $currentStore = Mage::app()->getStore()->getCode();\r\n #check nexmo sms module is active or not and check on which store its enabled\r\n $reservedOrderId = $order->getIncrementId();\r\n $mdlEmapi = Mage::getModel('restmob/quote_index');\r\n $id = $mdlEmapi->getIdByReserveId($reservedOrderId);\r\n if ($nexmoActivated == 1 && in_array($currentStore, $nexmoStores) && !$id) {\r\n # code...\r\n $data = Mage::helper('marketplace/marketplace')->sendVerify($tel);\r\n $data = $data['request_id'];\r\n\r\n }\r\n //$data = 0;\r\n\r\n }\r\n }\r\n\r\n\r\n // $orderPriceToCalculateCommision = $products_new->getPrice() * $item->getQtyOrdered();\r\n $shippingPrice = Mage::helper('marketplace/market')->getShippingPrice($sellerDefaultCountry, $shippingCountryId, $orderPrice, $nationalShippingPrice, $internationalShippingPrice, $productQty);\r\n /**\r\n * Getting seller commission percent\r\n */\r\n $sellerCollection = Mage::helper('marketplace/marketplace')->getSellerCollection($sellerId);\r\n $percentperproduct = $sellerCollection ['commission'];\r\n $commissionFee = $orderPrice * ($percentperproduct / 100);\r\n\r\n // Product price after deducting\r\n // $productAmt = $products_new->getPrice() - $commissionFee;\r\n\r\n $sellerAmount = $shippingPrice - $commissionFee;\r\n\r\n if($item->getProductType() == 'simple')\r\n {\r\n $getProductId = $item->getProductId();\r\n }\r\n\r\n /**\r\n * Storing commission information in database table\r\n */\r\n\r\n if ($commissionFee > 0 || $sellerAmount > 0) {\r\n $parentIds = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($getProductId);\r\n $parent_product = Mage::getModel('catalog/product')->load($parentIds[0]);\r\n\r\n if ($parent_product->getSpecialPrice()) {\r\n $orderPrice_sp = $parent_product->getSpecialPrice() * $item->getQtyOrdered();\r\n $orderPrice_base = $parent_product->getPrice() * $item->getQtyOrdered();\r\n\r\n $commissionFee = $orderPrice_sp * ($percentperproduct / 100);\r\n $sellerAmount = $orderPrice_sp - $commissionFee;\r\n } else {\r\n $orderPrice_base = $item->getBasePrice() * $item->getQtyOrdered();\r\n $commissionFee = $orderPrice_base * ($percentperproduct / 100);\r\n $sellerAmount = $shippingPrice - $commissionFee;\r\n }\r\n\r\n $commissionDataArr = array(\r\n 'seller_id' => $sellerId,\r\n 'product_id' => $getProductId,\r\n 'product_qty' => $productQty,\r\n 'product_amt' => $productAmt,\r\n 'commission_fee' => $commissionFee,\r\n 'seller_amount' => $sellerAmount,\r\n 'order_id' => $order->getId(),\r\n 'increment_id' => $order->getIncrementId(),\r\n 'order_total' => $grandTotal,\r\n 'order_status' => $status,\r\n 'credited' => $credited,\r\n 'customer_id' => $getCustomerId,\r\n 'status' => 1,\r\n 'created_at' => $createdAt,\r\n 'payment_method' => $paymentMethodCode,\r\n 'item_order_status' => $item_order_status,\r\n 'is_buyer_confirmation' => $is_buyer_confirmation,\r\n 'sms_verify_code' => $data,\r\n 'is_buyer_confirmation_date'=> $is_buyer_confirmation_date,\r\n 'is_seller_confirmation_date'=> '0000-00-00 00:00:00',\r\n 'shipped_from_elabelz_date'=> '0000-00-00 00:00:00',\r\n 'successful_non_refundable_date'=> '0000-00-00 00:00:00',\r\n 'commission_percentage' => $sellerCollection ['commission']\r\n );\r\n\r\n $commissionId = $this->storeCommissionData($commissionDataArr);\r\n $orderEmailData [$itemCount] ['seller_id'] = $sellerId;\r\n $orderEmailData [$itemCount] ['product_qty'] = $productQty;\r\n $orderEmailData [$itemCount] ['product_id'] = $getProductId;\r\n $orderEmailData [$itemCount] ['product_amt'] = $productAmt;\r\n $orderEmailData [$itemCount] ['commission_fee'] = $commissionFee;\r\n $orderEmailData [$itemCount] ['seller_amount'] = $sellerAmount;\r\n $orderEmailData [$itemCount] ['increment_id'] = $order->getIncrementId();\r\n $orderEmailData [$itemCount] ['customer_firstname'] = $order->getCustomerFirstname();\r\n $orderEmailData [$itemCount] ['customer_email'] = $order->getCustomerEmail();\r\n $orderEmailData [$itemCount] ['product_id_simple'] = $getProductId;\r\n $orderEmailData [$itemCount] ['is_buyer_confirmation'] = $is_buyer_confirmation_yes;\r\n $orderEmailData [$itemCount] ['itemCount'] = $itemCount;\r\n $itemCount = $itemCount + 1;\r\n }\r\n }\r\n // if ($paymentMethodCode == 'paypaladaptive') {\r\n // $this->updateCommissionPA($commissionId);\r\n // }\r\n }\r\n\r\n if ($paymentMethodCode == 'ccsave' || $paymentMethodCode == 'telrpayments_cc' || $paymentMethodCode == 'telrtransparent' ) {\r\n /*if (Mage::getStoreConfig('marketplace/admin_approval_seller_registration/sales_notification') == 1) {\r\n $this->sendOrderEmail($orderEmailData);\r\n }*/\r\n } elseif ($paymentMethodCode == 'cashondelivery' || $paymentMethodCode == 'msp_cashondelivery') {\r\n $counter = 0;\r\n $orders = Mage::getModel('sales/order')->getCollection();\r\n $orders->addFieldToSelect('*');\r\n $orders->addFieldToFilter('customer_id', Mage::getSingleton('customer/session')->getId());\r\n foreach ($orders as $ord) {\r\n if ($ord->getStatus() == \"complete\"){\r\n $counter = $counter + 1;\r\n }\r\n }\r\n if ($counter != 0) {\r\n if (Mage::getStoreConfig('marketplace/admin_approval_seller_registration/sales_notification') == 1) {\r\n\r\n $this->sendOrderEmail($orderEmailData);\r\n }\r\n }\r\n }\r\n\r\n //$this->enqueueDataToFareye($observer);\r\n\r\n }", "public function execute()\n {\n $processId = uniqid();\n $processString = self::class;\n\n $this->_getSession()->setPayUProcessId($processId);\n $this->_getSession()->setPayUProcessString($processString);\n\n $this->logger->debug(['info' => \"($processId) START $processString\"]);\n\n $postData = file_get_contents(\"php://input\");\n $sxe = simplexml_load_string($postData);\n\n $resultJson = $this->resultFactory->create(ResultFactory::TYPE_JSON)->setJsonData('{}');\n\n if (empty($sxe)) {\n $this->respond('500', 'Instant Payment Notification data is empty');\n\n return $resultJson;\n }\n\n $ipnData = XMLHelper::parseXMLToArray($sxe);\n\n if (!$ipnData) {\n $this->respond('500', 'Failed to decode Instant Payment Notification data.');\n\n return $resultJson;\n }\n\n $incrementId = $ipnData['MerchantReference'];\n /** @var Order $order */\n $order = $incrementId ? $this->_orderFactory->create()->loadByIncrementId($incrementId) : false;\n\n if (!$order || ((int)$order->getId() <= 0)) {\n $this->respond('500', 'Failed to load order.');\n\n return $resultJson;\n }\n\n $this->respond();\n $this->response->processNotify($ipnData, $order);\n\n return $resultJson;\n }", "public function handle_result() {\n\t\t\t\tif ( ! isset( $_REQUEST['order-id'] ) || empty( $_REQUEST['order-id'] ) ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$response = file_get_contents( 'php://input' );\n\t\t\t\t$jsonResponse = json_decode( $response );\n\t\t\t\t$responseArray = json_decode($response,true);\n\t\t\t\t\n\t\t\t\t$order = wc_get_order( $_REQUEST['order-id'] );\n\t\t\t\t\n\t\t\t $order->add_order_note( $this->generateTable($responseArray),'success' );\n\t\t\t // Only Log when test mode is enabled\n\t\t\t if( 'yes' == $this->get_option( 'test_enabled' ) ) {\n\t\t\t \t$order->add_order_note( $response );\n\t\t\t }\n\t\t\t \n\n\t\t\t\tif ( isset( $jsonResponse->transactionStatus ) && 'APPROVED' == $jsonResponse->transactionStatus ) {\n\t\t\t\t\t\t// Complete this order, otherwise set it to another status as per configurations\n\t\t\t\t\t\t$order->payment_complete();\n\t\t\t\t\t\t$order->update_status( $this->get_option( 'success_payment_status' ), __( 'Havano Payment was Successful.', 'havanao' ) );\t\n\t\t\t\t} else {\n\t\t\t\t\t$order->update_status( $this->get_option( 'errored_payment_status' ), __( 'Havano Payment was Successful.', 'havanao' ) );\t\n\t\t\t\t}\n\t\t\t}", "public function send_order($order_info,$supplier_info) {\n\t\t$attachments = array();\n\t\t$attachments = apply_filters('wc_dropship_manager_send_order_attachments',$attachments,$order_info,$supplier_info); // create a pdf packing slip file\n\t\t$options = get_option( 'wc_dropship_manager' );\n\t\t$text = '';\n\n\t\t$hdrs = array();\n\t\t$hdrs['From'] = get_option( 'woocommerce_email_from_address' );\n\t\t$hdrs['To'] = $supplier_info['order_email_addresses'].','.get_option( 'woocommerce_email_from_address' );\n\t\t$hdrs['CC'] = get_option( 'woocommerce_email_from_address' );\n\t\t$hdrs['Subject'] = 'New Order #'.$order_info['id'].' From '.get_option( 'woocommerce_email_from_name' );\n\t\t$hdrs['Content-Type'] = 'multipart/mixed';\n\t\tif (strlen($supplier_info['account_number']) > 0)\n\t\t{\n\t\t\t$text .= get_option( 'woocommerce_email_from_name' ).' account number: '.$supplier_info['account_number'].'<br/>';\n\t\t}\n\t\t$text = $this->get_packingslip_html($order_info,$supplier_info);\n\t\t$text = $options['email_order_note'] . $text;\n\t\t$html = apply_filters('wc_dropship_manager_send_order_email_html',$text);\n\n\t\t // Filters for the email\n\t\tadd_filter( 'wp_mail_from', array( $this, 'get_from_address' ) );\n\t\tadd_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) );\n\t\tadd_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) );\n\t\twp_mail( $hdrs['To'], $hdrs['Subject'], $html, $hdrs, $attachments );\n\n\t\t// Unhook filters\n\t\tremove_filter( 'wp_mail_from', array( $this, 'get_from_address' ) );\n\t\tremove_filter( 'wp_mail_from_name', array( $this, 'get_from_name' ) );\n\t\tremove_filter( 'wp_mail_content_type', array( $this, 'get_content_type' ) );\n\t}", "public function place_order(){\n $customer_id = $_REQUEST['customer_id'];\n $razorpay_payment_id = $_REQUEST['razorpay_payment_id'];\n $online_payment_amt = $_REQUEST['online_payment_amt'];\n\n $current_date = date('d-m-Y');\n $current_time = date('h:i:s A');\n\n /********************* Save Order Data **************/\n $save_order_data['customer_id'] = $customer_id;\n $save_order_data['order_cust_fname'] = $_REQUEST['customer_fname'];\n $save_order_data['order_cust_lname'] = $_REQUEST['customer_lname'];\n\n // $save_order_data['order_cust_addr'] = $_REQUEST['customer_address'];\n // $save_order_data['city_id'] = $_REQUEST['city_id'];\n // $save_order_data['order_cust_pin'] = $_REQUEST['customer_pin'];\n\n $save_order_data['order_cust_mob'] = $_REQUEST['customer_mobile'];\n $save_order_data['order_cust_email'] = $_REQUEST['customer_email'];\n\n // $save_order_data['order_amount'] = $_REQUEST['order_amount']; //$cart_total-$gst_amt; // GST is Inclusive...\n // $save_order_data['order_gst'] = $_REQUEST['total_gst_amount']; // Calculate Inclusive GST...\n\n $save_order_data['order_shipping_amt'] = $_REQUEST['order_shipping_amt']; // Shipping Amount is 100Rs if cart_total < 799Rs.\n $save_order_data['order_total_amount'] = $_REQUEST['order_total_amount']; // $cart_total + $shipping_amt;\n\n $save_order_data['order_date'] = date('d-m-Y');\n $save_order_data['payment_status'] = $_REQUEST['payment_status'];\n $save_order_data['order_added_date'] = date('d-m-Y h:i:s A');\n $save_order_data['order_addedby'] = 0;\n $save_order_data['order_no'] = $this->User_Model->get_count_no('order_no', 'order_tbl');\n\n $save_order_data['order_timeslot_date'] = $_REQUEST['order_timeslot_date'];\n $save_order_data['order_timeslot_time'] = $_REQUEST['order_timeslot_time'];\n $address_id = $_REQUEST['address_id'];\n $address_data = $country_info = $this->User_Model->get_info_arr_fields('*','address_id', $address_id, 'delivery_address');\n $save_order_data['order_cust_addr'] = $address_data[0]['address'];\n $save_order_data['country_id'] = $address_data[0]['country_id'];\n $save_order_data['state_id'] = $address_data[0]['state_id'];\n $save_order_data['city_id'] = $address_data[0]['city_id'];\n $save_order_data['order_cust_pin'] = $address_data[0]['pincode'];\n\n $order_id = $this->User_Model->save_data('order_tbl', $save_order_data);\n\n if($order_id){\n // Add/Save Reward Points if Shop >= 999...\n $response[\"status\"] = TRUE;\n $response[\"msg\"] = 'Order Saved Successfully';\n\n $cart_total = $_REQUEST['order_total_amount'] - $_REQUEST['order_shipping_amt'];\n if($cart_total >= 999){\n $save_point_add['customer_id'] = $customer_id;\n $save_point_add['point_add_type'] = 3;\n $save_point_add['point_add_ref_id'] = $order_id;\n $save_point_add['point_add_cnt'] = 5;\n $save_point_add['point_add_date'] = $current_date;\n $save_point_add['point_add_time'] = $current_time;\n $this->User_Model->save_data('point_add', $save_point_add);\n $response[\"reward_point_msg\"] = '5 Reward Points Saved';\n }\n\n /****************** Save Order Product ****************/\n\n\n if($_POST['order_product']){\n $total_gst_amount = \"0\";\n $i = 0;\n foreach($_POST['order_product'] as $order_product_data){\n $product_id = $order_product_data['product_id'];\n $pro_attri_id = $order_product_data['pro_attri_id'];\n $order_pro_qty = $order_product_data['order_pro_qty'];\n $order_pro_weight = $order_product_data['order_pro_weight'];\n $order_pro_qty = $order_product_data['order_pro_qty'];\n $order_pro_price = $order_product_data['order_pro_price'];\n\n $product_details = $this->User_Model->get_info_arr_fields('product_id, product_name, tax_rate, min_ord_limit, max_ord_limit, product_unit, product_details, product_img','product_id', $product_id, 'product');\n $product_attribute_details = $this->User_Model->get_info_arr_fields('pro_attri_id, product_id, pro_attri_weight, pro_attri_mrp, pro_attri_price, pro_attri_dis_per, pro_attri_dis_amt', 'pro_attri_id', $pro_attri_id, 'product_attribute');\n\n $pro_attri_dis_amt = $product_attribute_details[0]['pro_attri_dis_amt'];\n $order_pro_gst_per = $product_details[0]['tax_rate'];\n\n $order_pro_dis_amt = $order_pro_gst_per * $order_pro_qty;\n $order_pro_amt = $order_pro_price * $order_pro_qty;\n $order_pro_gst_amt = $order_pro_amt - ($order_pro_amt * (100/(100 + $order_pro_gst_per)));\n $order_pro_basic_amt = $order_pro_amt - $order_pro_gst_amt;\n\n $order_product_data['order_pro_dis_amt'] = $order_pro_dis_amt;\n $order_product_data['order_pro_gst_per'] = $order_pro_gst_per;\n $order_product_data['order_pro_gst_amt'] = $order_pro_gst_amt;\n $order_product_data['order_pro_basic_amt'] = $order_pro_basic_amt;\n $order_product_data['order_pro_amt'] = $order_pro_amt;\n $order_product_data['order_id'] = $order_id;\n $order_product_data['order_pro_date'] = date('d-m-Y h:i:s A');\n $order_product_data['order_pro_tot_weight'] = $order_pro_weight * $order_pro_qty;\n $order_pro_id = $this->User_Model->save_data('order_pro', $order_product_data);\n\n $total_gst_amount = $total_gst_amount + $order_pro_gst_amt;\n $i++;\n if($order_pro_id){\n $response[\"order_product_msg_\".$i] = 'Order Product '.$i.' Saved Successfully';\n } else{\n $response[\"order_product_msg_\".$i] = 'Order Product '.$i.' Not Saved';\n }\n }\n $cart_total = $_REQUEST['order_total_amount'] - $_REQUEST['order_shipping_amt'];\n $order_amount = $cart_total - $total_gst_amount;\n // Update total_gst_amount & order_amount in order_tbl...\n $update_order_data['order_gst'] = $total_gst_amount;\n $update_order_data['order_amount'] = $order_amount;\n $this->User_Model->update_info('order_id', $order_id, 'order_tbl', $update_order_data);\n } else{\n $response[\"order_product_msg\"] = 'Order Product Not Saved';\n }\n\n /******** Save Online Payment Data *********/\n\n if($_REQUEST['coupon_used_dis_amt'] > 0 ){ $coupon_used_dis_amt = $_REQUEST['coupon_used_dis_amt']; }\n else{ $coupon_used_dis_amt = 0; }\n\n if($_REQUEST['wallet_used_points'] > 0 ){ $wallet_used_points = $_REQUEST['wallet_used_points']; }\n else{ $wallet_used_points = 0; }\n\n\n if($razorpay_payment_id && $_REQUEST['payment_status'] == 1){\n $save_online_pay['customer_id'] = $customer_id;\n $save_online_pay['order_id'] = $order_id;\n $save_online_pay['razorpay_payment_id'] = $razorpay_payment_id;\n // $save_online_pay['razorpay_order_id'] = $razorpay_order_id;\n $save_online_pay['online_payment_amt'] = $online_payment_amt;\n $save_online_pay['cart_amount'] = $_REQUEST['order_total_amount'] - $_REQUEST['order_shipping_amt'];\n $save_online_pay['shipping_amt'] = $_REQUEST['order_shipping_amt'];\n $save_online_pay['total_pay_amt'] = $_REQUEST['order_total_amount'];\n $save_online_pay['coupon_use_amt'] = $coupon_used_dis_amt;\n $save_online_pay['point_use_amt'] = $wallet_used_points;\n $save_online_pay['online_payment_date'] = $current_date;\n $save_online_pay['online_payment_time'] = $current_time;\n $online_payment_id = $this->User_Model->save_data('order_online_payment', $save_online_pay);\n if($online_payment_id){\n $response[\"online_payment_msg\"] = 'Payment Data Saved Successfully';\n } else{\n $response[\"online_payment_msg\"] = 'Payment Data Not Saved';\n }\n $update_payment_type['payment_type'] = \"1\"; // Online Payment.\n $update_payment_type['payment_status'] = \"1\"; // Paid.\n } else{\n $update_payment_type['payment_type'] = \"2\"; // Cash On Delivery.\n $update_payment_type['payment_status'] = \"0\"; // Cash On Delivery.\n $response[\"online_payment_msg\"] = 'Payment on Delivery';\n }\n $this->User_Model->update_info('order_id', $order_id, 'order_tbl', $update_payment_type); // Update Status.\n\n\n\n /***************** Save Used Coupon ************/\n $save_coupon_data['order_id'] = $order_id;\n $save_coupon_data['customer_id'] = $customer_id;\n $save_coupon_data['coupon_id'] = $_REQUEST['coupon_id'];\n $save_coupon_data['coupon_code'] = $_REQUEST['coupon_code'];\n $save_coupon_data['coupon_used_dis_amt'] = $_REQUEST['coupon_used_dis_amt'];\n $save_coupon_data['coupon_used_date'] = $current_date;\n $save_coupon_data['coupon_used_time'] = $current_time;\n if($_REQUEST['coupon_id'] && $_REQUEST['coupon_code'] && $_REQUEST['coupon_used_dis_amt']){\n $coupon_used_id = $this->User_Model->save_data('coupon_used', $save_coupon_data);\n if($coupon_used_id){\n $response[\"coupon_code_msg\"] = 'Coupon Applied Successfully';\n } else{\n $response[\"coupon_code_msg\"] = 'Coupon Not Saved';\n }\n } else{\n $response[\"coupon_code_msg\"] = 'Coupon Not Used';\n }\n\n /******************** Save Redeem Point **************/\n $save_redeem_point_data['customer_id'] = $customer_id;\n $save_redeem_point_data['order_id'] = $order_id;\n $save_redeem_point_data['point_use_cnt'] = $_REQUEST['wallet_used_points'];\n $save_redeem_point_data['point_use_date'] = $current_date;\n $save_redeem_point_data['point_use_time'] = $current_time;\n if($_REQUEST['wallet_used_points']){\n $point_use_id = $this->User_Model->save_data('point_use', $save_redeem_point_data);\n if($point_use_id){\n $response[\"redeem_point_msg\"] = 'Points Used Successfully';\n } else{\n $response[\"redeem_point_msg\"] = 'Points Not Saved';\n }\n } else{\n $response[\"redeem_point_msg\"] = 'Redeem Point Not Used';\n }\n } else{\n $response[\"status\"] = FALSE;\n $response[\"msg\"] = 'Order Not Saved';\n }\n\n $json_response = json_encode($response,JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT);\n echo str_replace('\\\\/','/',$json_response);\n }", "public function send()\n {\n if (!Mage::getStoreConfig(Epoint_SwissPostSales_Helper_Order::ENABLE_SEND_ORDER_CONFIG_PATH)) {\n return;\n }\n // Check if the date is configured.\n if(!Mage::getStoreConfig(\n Epoint_SwissPostSales_Helper_Order::XML_CONFIG_PATH_FROM_DATE \n )){\n \tMage::helper('swisspost_api')->log(\n Mage::helper('core')->__('Error on send order cron, from date filter is not configured!')\n );\n return ; \n }\n $status_filter = explode(',', \n \tMage::getStoreConfig(self::ENABLE_SEND_ORDER_STATUS_CONFIG_PATH)\n );\n if(is_array($status_filter)){\n \t$status_filter = array_map('trim', $status_filter);\n }\t\n $from_date = date('Y-m-d H:i:s', strtotime(Mage::getStoreConfig(\n Epoint_SwissPostSales_Helper_Order::XML_CONFIG_PATH_FROM_DATE)\n )\n );\n // All orders without odoo code id\n $order_collection = Mage::getModel('sales/order')\n ->getCollection()\n // Join invoices, send only \n ->join(array('invoice' => 'sales/invoice'), \n 'invoice.order_id=main_table.entity_id', \n array('invoice_entity_id'=>'entity_id'), null , 'left')\n ->addAttributeToFilter(\n 'main_table.created_at',\n array('gt' => $from_date)\n )\n ->addFieldToFilter(\n 'main_table.status',\n array(array('in'=>array($status_filter)))\n )\n ->addAttributeToFilter(\n 'main_table.'.Epoint_SwissPostSales_Helper_Data::ORDER_ATTRIBUTE_CODE_ODOO_ID,\n array(array('null' => true),\n array('eq' => 0)\n )\n );\n // Add group \n $order_collection->getSelect()->group('main_table.entity_id');\n // Add Limit \n $order_collection->getSelect()->limit((int)Mage::getStoreConfig(Epoint_SwissPostSales_Helper_Order::XML_CONFIG_PATH_CRON_LIMIT)); \n foreach ($order_collection as $order_item) {\n $order = Mage::getModel('sales/order')->load($order_item->getId());\n // check if can be sent again\n if(Mage::helper('swisspostsales/Order')->isConnected($order)){\n \t Mage::helper('swisspost_api')->log(\n Mage::helper('core')->__('Stop sending again order: %s, odoo id: %s', $order->getId(), \n $order->getData(Epoint_SwissPostSales_Helper_Data::ORDER_ATTRIBUTE_CODE_ODOO_ID)\n )\n );\n \tcontinue;\n }\n // The order was not invoiced ???\n if(!$order->getInvoiceCollection()){\n \tMage::helper('swisspost_api')->log(\n Mage::helper('core')->__('Stop sending again order, no invoice: %s', $order->getId()\n )\n );\n \tcontinue;\n }\n Mage::helper('swisspost_api/Order')->createSaleOrder($order);\n }\n }", "public function get_shipping_list_post()\n{\n $pdata = file_get_contents(\"php://input\");\n $postdata = json_decode($pdata,true);\n\n if (isset($postdata['company_id']))\n {\n \n $id = $postdata['company_id'];\n $data['shipping_rates'] = $this->model->getAllwhere('shipping_master',array('company_id'=>$id));\n }else{\n $data['shipping_rates'] = $this->model->getAllwhere('shipping_master');\n }\n\n \n $resp = array('rccode' => 200,'message' =>$data);\n $this->response($resp);\n}", "public function ajaxGetOrderInformationAction(Request $request)\n {\n\t\t// Get the services\n \t$basketService = $this->get('web_illumination_admin.basket_service');\n \t\n \t// Get the session\n\t\t$basket = $this->get('session')->get('basket');\n\t\t$order = $this->get('session')->get('order');\n \t\n\t\t// Get submitted data\n\t\t$countryCode = ($request->query->get('countryCode')?$request->query->get('countryCode'):$basket['delivery']['countryCode']);\n\t\t$postZipCode = ($request->query->get('postZipCode')?$request->query->get('postZipCode'):$basket['delivery']['postZipCode']);\n\t\t$deliveryOption = ($request->query->get('deliveryOption')?$request->query->get('deliveryOption'):$basket['delivery']['service']);\n if ($countryCode == 'IE')\n {\n $postZipCode = '000';\n } else {\n if ($postZipCode == '000')\n {\n $postZipCode = '';\n }\n }\n\t\t\n\t\t// Get the basket\n\t\t$basket = $this->get('session')->get('basket');\n\t \t\t\t\n\t\t// Update the delivery options\n\t\t$basket['delivery']['countryCode'] = $countryCode;\n\t\t$basket['delivery']['postZipCode'] = $postZipCode;\n\t\t$basket['delivery']['service'] = $deliveryOption;\n\t\t$order['deliveryType'] = $deliveryOption;\n\t\tif (($order['deliveryCountryCode'] != $countryCode) || ($order['deliveryPostZipCode'] != $postZipCode))\n\t\t{\n \t\t\t$order['deliveryFirstName'] = $order['firstName'];\n \t\t$order['deliveryLastName'] = $order['lastName'];\n \t\t$order['deliveryOrganisationName'] = $order['organisationName'];\n \t\t$order['deliveryAddressLine1'] = '';\n \t\t$order['deliveryAddressLine2'] = '';\n \t\t$order['deliveryTownCity'] = '';\n \t\t$order['deliveryCountyState'] = '';\n \t\t$order['deliveryPostZipCode'] = $postZipCode;\n \t\t$order['deliveryCountryCode'] = $countryCode;\n \t\tif ($order['sameDeliveryAddress'] > 0)\n \t\t{\n\t \t\t$order['billingFirstName'] = $order['firstName'];\n\t \t\t$order['billingLastName'] = $order['lastName'];\n\t \t\t$order['billingOrganisationName'] = $order['organisationName'];\n\t \t\t$order['billingAddressLine1'] = '';\n\t \t\t$order['billingAddressLine2'] = '';\n\t \t\t$order['billingTownCity'] = '';\n\t \t\t$order['billingCountyState'] = '';\n\t \t\t$order['billingPostZipCode'] = $postZipCode;\n\t \t\t$order['billingCountryCode'] = $countryCode;\n \t\t}\n\t\t}\n\t\t\t\n\t\t// Update the session\n \t$this->get('session')->set('basket', $basket);\n \t$this->get('session')->set('order', $order);\n \t\n \t// Update the basket totals\n \t$basketService->updateBasketTotals();\n \t\n \t// Get the basket\n\t\t$basket = $this->get('session')->get('basket');\n\t\t\t\n\t\t// Get the order\n\t\t$order = $this->get('session')->get('order');\n\n $response = $this->render('WebIlluminationShopBundle:Checkout:ajaxGetOrderInformation.html.twig', array('basket' => $basket, 'order' => $order));\n $response->headers->addCacheControlDirective('no-cache', true);\n $response->headers->addCacheControlDirective('max-age', 0);\n $response->headers->addCacheControlDirective('must-revalidate', true);\n $response->headers->addCacheControlDirective('no-store', true);\n\n return $response;\n }", "public function execute() {\n\n $id = trim((string)$this->getRequest()->getParam('transId', NULL));\n $refId = (int)trim((string)$this->getRequest()->getParam('refId', NULL));\n\n if (!$id || !$refId) {\n http_response_code(400);\n die('Invalid response');\n }\n\n $service = $this->config->getComGateService();\n try {\n $status = $service->getStatus($id);\n }\n catch(\\Exception $e) {\n $status = false;\n }\n\n if (!$status) {\n http_response_code(400);\n die('Malformed response');\n }\n\n $order_id = (int)@$status['refId'];\n $order = $this->getOrder($order_id);\n if (!$order->getId()) {\n http_response_code(400);\n\n //trigger_error('No Order [' . $order_id . ']');\n die('No Order');\n }\n\n $response = $this->createResponse();\n\n if (!in_array($order->getStatus() , array(\n \\Magento\\Sales\\Model\\Order::STATE_NEW,\n \\Magento\\Sales\\Model\\Order::STATE_HOLDED,\n \\Magento\\Sales\\Model\\Order::STATE_PENDING_PAYMENT,\n \\Magento\\Sales\\Model\\Order::STATE_PAYMENT_REVIEW\n ))) {\n\n $response->setHttpResponseCode(200);\n return $response;\n }\n\n if (!empty($status['code'])) {\n http_response_code(400);\n die('Payment error');\n }\n\n if (($status['price'] != round($order->getGrandTotal() * 100)) || ($status['curr'] != $order->getOrderCurrency()->getCurrencyCode())) {\n http_response_code(400);\n die('Payment sum or currency mismatch');\n }\n\n $invoice = $order->getInvoiceCollection()->getFirstItem();\n $payment = $order->getPayment();\n\n if (($status['status'] == 'CANCELLED') && ($order->getStatus() != \\Magento\\Sales\\Model\\Order::STATE_HOLDED)) {\n\n $payment->getMethodInstance()->cancel($payment);\n\n $order->addStatusHistoryComment('ComGate (notification): Payment failed');\n $order->save();\n }\n else if (($status['status'] == 'PAID') && ($order->getStatus() != \\Magento\\Sales\\Model\\Order::STATE_PROCESSING)) {\n \n \\ComGate\\ComGateGateway\\Api\\AgmoPaymentsHelper::updatePaymentTransaction($payment, array(\n 'id' => $id,\n 'state' => $status['status']\n ));\n\n $payment->capture();\n\n $order->addStatusHistoryComment('ComGate (notification): Payment success');\n $order->save();\n }\n else if (($status['status'] == 'AUTHORIZED') && ($order->getStatus() != \\Magento\\Sales\\Model\\Order::STATE_PAYMENT_REVIEW)) {\n\n \\ComGate\\ComGateGateway\\Api\\AgmoPaymentsHelper::updatePaymentTransaction($payment, array(\n 'id' => $id,\n 'state' => $status['status']\n ));\n\n $payment->getMethodInstance()->authorize($payment, $order->getGrandTotal());\n\n $order->addStatusHistoryComment('ComGate (notification): Payment authorized');\n $order->save();\n }\n\n $response->setHttpResponseCode(200);\n return $response;\n }", "public function oneAction(){\n $isAjax = Mage::app()->getRequest()->isAjax();\n if($isAjax){\n $response = array();\n $customerRfc = trim(Mage::app()->getRequest()->getPost('rfc'));\n $orderNum = trim(Mage::app()->getRequest()->getPost('order'));\n $email = trim(Mage::app()->getRequest()->getPost('email'));\n\n // helpers\n $facturahelper = Mage::helper('facturacom_facturacion/factura');\n $orderhelper = Mage::helper('facturacom_facturacion/order');\n\n //search order in Magento\n $order = $orderhelper->getOrderByNum($orderNum);\n //check if order exists\n if(!isset($order->id)){\n $response = array(\n 'error' => 400,\n 'message' => 'No existe un pedido con ese número. Por favor inténtelo con otro número.'\n );\n }else{\n //check for the order status \"complete\"\n if(in_array($order->status, array('complete','processing'), true )){\n\n if(!$this->validateDayOff($order->payment_day)) {\n\n $response = array(\n 'error' => 400,\n 'message' => 'La fecha para facturar tu pedido ya pasó!'\n );\n\n } else {\n\n if($order->customer_email == $email){\n\n $orderLocal = $facturahelper->getOrderFromLocal($orderNum);\n\n if(isset($orderLocal['id'])){\n $response = array(\n 'error' => 300,\n 'message' => 'Este pedido ya se encuentra facturado.',\n 'data' => array(\n 'order_local' => $orderLocal\n )\n );\n }else{\n\n //Get customer by RFC\n $customer = $facturahelper->getCustomerByRFC($customerRfc);\n //Get order lines\n $orderEntity = $orderhelper->getOrderEntity($orderNum);\n $lineItems = $orderhelper->getOrderLines($orderEntity);\n\n //Guardar información premilinarmente en cookies\n $facturahelper->setCookie('order', json_encode($order));\n $facturahelper->setCookie('customer', json_encode($customer));\n $facturahelper->setCookie('line_items', json_encode($lineItems));\n\n $response = array(\n 'error' => 200,\n 'message' => 'Pedido encontrado exitósamente',\n 'data' => array(\n 'order' => $order,\n 'customer' => $customer,\n 'line_items' => $lineItems\n )\n );\n }\n }else{\n $response = array(\n 'error' => 400,\n 'message' => 'El email ingresado no coincide con el correo registrado en el pedido. Por favor inténtelo con otro correo.',\n 'order' => $order,\n );\n }\n\n }//past date\n }else{\n $response = array(\n 'error' => 400,\n 'message' => 'El pedido aún no se encuentra listo para facturar. Por favor espere a que su pedido sea enviado.',\n 'order' => $order,\n );\n }\n }\n\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));\n }else{\n die('AJAX request only');\n }\n }", "function wcfm_wcpvendors_order_mark_fulfilled() {\r\n\t\tglobal $WCFM, $WCFMu, $woocommerce, $wpdb;\r\n\t\t\r\n\t\t$user_id = apply_filters( 'wcfm_current_vendor_id', get_current_user_id() );\r\n\t\t\r\n\t\tif ( !empty( $_POST['orderid'] ) ) {\r\n\t\t\t$order_id = $_POST['orderid'];\r\n\t\t\t$product_id = $_POST['productid'];\r\n\t\t\t$order_item_id = $_POST['orderitemid'];\r\n\t\t\t$tracking_url = $_POST['tracking_url'];\r\n\t\t\t$tracking_code = $_POST['tracking_code'];\r\n\t\t\t$order = wc_get_order( $order_id );\r\n\t\t\t\r\n\t\t\t$tracking_url = apply_filters( 'wcfm_tracking_url', $tracking_url, $tracking_code, $order_id );\r\n\t\t\t\r\n\t\t\tif( $order_item_id ) {\r\n\t\t\t\tif( wcfm_is_vendor() ) {\r\n\t\t\t\t\t$vendor_data = WC_Product_Vendors_Utils::get_vendor_data_from_user();\r\n\t\t\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::set_fulfillment_status( absint( $order_item_id ), 'fulfilled' );\r\n\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::send_fulfill_status_email( $vendor_data, 'fulfilled', $order_item_id );\r\n\t\t\t\t\t\r\n\t\t\t\t\tWC_Product_Vendors_Utils::clear_reports_transients();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$shop_name = ! empty( $vendor_data['shop_name'] ) ? $vendor_data['shop_name'] : '';\r\n\t\t\t\t\t$wcfm_messages = sprintf( __( 'Vendor <b>%s</b> has shipped <b>%s</b> to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a class=\"wcfm_dashboard_item_title\" target=\"_blank\" href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), $shop_name, get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url );\r\n\t\t\t\t\t$WCFM->wcfm_notification->wcfm_send_direct_message( $user_id, 0, 0, 1, $wcfm_messages, 'shipment_tracking' );\r\n\t\t\t\t\t$comment_id = $order->add_order_note( $wcfm_messages, '1');\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$comment_id = $order->add_order_note( sprintf( __( 'Product <b>%s</b> has been shipped to customer.<br/>Tracking Code : %s <br/>Tracking URL : <a href=\"%s\">%s</a>', 'wc-frontend-manager-ultimate' ), get_the_title( $product_id ), $tracking_code, $tracking_url, $tracking_url ), '1');\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Update Shipping Tracking Info\r\n\t\t\t\t$this->updateShippingTrackingInfo( $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t\t\r\n\t\t\t\tdo_action( 'wcfm_after_order_mark_shipped', $order_id, $order_item_id, $tracking_code, $tracking_url, $product_id );\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\techo \"complete\";\r\n\t\tdie;\r\n\t}", "public function ajax_swedbank_pay_update_order() {\n\t\tcheck_ajax_referer( 'swedbank_pay_checkout', 'nonce' );\n\n\t\t// Get Order\n\t\t$order_id = absint( WC()->session->get( 'order_awaiting_payment' ) );\n\t\tif ( ! $order_id ) {\n\t\t\twp_send_json(\n\t\t\t\tarray(\n\t\t\t\t\t'result' => 'failure',\n\t\t\t\t\t'messages' => 'Order is not exists',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn;\n\t\t}\n\n\t\t// Get Order\n\t\t$order = wc_get_order( $order_id );\n\t\tif ( ! $order ) {\n\t\t\twp_send_json(\n\t\t\t\tarray(\n\t\t\t\t\t'result' => 'failure',\n\t\t\t\t\t'messages' => 'Order is not exists',\n\t\t\t\t)\n\t\t\t);\n\n\t\t\treturn;\n\t\t}\n\n\t\t// Mark order failed instead of cancelled\n\t\tif ( $order->get_payment_method() === $this->gateway->id && $order->has_status( 'cancelled' ) ) {\n\t\t\t$order->update_status( 'failed' );\n\t\t}\n\n\t\t// Prepare $_POST data\n\t\t$data = array();\n\t\tparse_str( $_POST['data'], $data );\n\t\t$_POST = $data;\n\t\tunset( $_POST['terms-field'], $_POST['terms'] );\n\n\t\t$_POST['payment_method'] = $this->gateway->id;\n\t\t$_POST['is_update'] = '1';\n\n\t\t// Update Checkout\n\t\t// @see WC_AJAX::update_order_review()\n\t\tif ( ! empty( $_POST['shipping_method'] ) && ! is_array( $_POST['shipping_method'] ) ) {\n\t\t\t$shipping = $_POST['shipping_method'];\n\t\t\t$_POST['shipping_method'] = array( $shipping );\n\t\t}\n\n\t\t$chosen_shipping_methods = WC()->session->get( 'chosen_shipping_methods' );\n\t\tif ( isset( $_POST['shipping_method'] ) && is_array( $_POST['shipping_method'] ) ) {\n\t\t\tforeach ( $_POST['shipping_method'] as $i => $value ) {\n\t\t\t\t$chosen_shipping_methods[ $i ] = wc_clean( $value );\n\t\t\t}\n\t\t}\n\n\t\tWC()->session->set( 'chosen_shipping_methods', $chosen_shipping_methods );\n\t\tWC()->session->set( 'chosen_payment_method', $this->gateway->id );\n\n\t\t// Update address data\n\t\tforeach ( $_POST as $key => $value ) {\n\t\t\tif ( ( strpos( $key, 'billing_' ) !== false ) || ( strpos( $key, 'shipping_' ) !== false ) ) {\n\t\t\t\tif ( is_callable( array( $order, \"set_{$key}\" ) ) ) {\n\t\t\t\t\t$order->{\"set_{$key}\"}( $value );\n\t\t\t\t}\n\n\t\t\t\tWC()->customer->set_props( array( $key => $value ) );\n\t\t\t}\n\t\t}\n\n\t\t// Recalculate cart\n\t\tWC()->customer->set_calculated_shipping( true );\n\t\tWC()->customer->save();\n\t\tWC()->cart->calculate_totals();\n\n\t\t// Recalculate order\n\t\t$order->set_cart_hash( WC()->cart->get_cart_hash() );\n\t\t$order->calculate_totals( true );\n\t\t$order->save();\n\n\t\t// Process checkout\n\t\t$_REQUEST['woocommerce-process-checkout-nonce'] = wp_create_nonce( 'woocommerce-process_checkout' );\n\t\t$_POST['_wpnonce'] = wp_create_nonce( 'woocommerce-process_checkout' );\n\t\tWC()->checkout()->process_checkout();\n\t}", "public function orderReturnGarments_post(){\n\t$input = file_get_contents('php://input');\n\t$data = json_decode($input);\n\tif(is_object($data) && property_exists($data,'orderId') && $data->orderId){\n\t\t$orderId = $data->orderId;\n\t\ttry{\n\t\t\t$qb = $this->_em->createQueryBuilder();\n\t\t\t$processObj = $qb->select('po')->from('Entity\\ProcessOrder','po')->where('po.order_id =:orderId and po.itemStatus =:itemStatus')->setParameter('orderId',$orderId)->setParameter('itemStatus','returned')->getQuery()->getResult();\n\t\t\t$results = array();\n\t\t\tforeach ($processObj as $key => $obj) {\n\t\t\t\t$item = array();\n\t\t\t\t$item['id'] = $key+1;\n\t\t\t\t$item['name'] = $obj->getName();\n\t\t\t\t$item['message'] = $obj->getItemStatusMessage();\n\t\t\t\t$customerObj = $obj->getCustomerId();\n\t\t\t\t$results['garments'][] = $item;\n\t\t\t}\n\t\t\t\n\t\t\t$this->set_response($results,REST_Controller::HTTP_OK);\n\t\t}catch(Exception $e){\t\n\t\t\t$message = ['message'=>$e->getMessage()];\n\t\t\t$this->set_response($message,REST_Controller::HTTP_BAD_REQUEST);\n\t\t}\t\n\t}else{\n\t\t$message = ['message'=>'out bar code does not matched with in bar code, Please try again right.'];\n\t\t$this->set_response($message,REST_Controller::HTTP_NOT_ACCEPTABLE);\n\t}\n}", "public function confirmOrder()\n {\n $requestData = array();\n\t\tif (!is_null($this->eshopDataProvider)) {\n $requestData = $this->eshopDataProvider->collectConfirmData();\n }\n\n\t\t$orderTransactionName = 'pm_order_transaction_id' . $requestData['paymentMethod_name'];\n\n $this->pmClient->setEndPoint($this->endPointUrl . 'confirmOrder');\n $responseData = $this->pmClient->sendRequest($requestData);\n\n\t\tif ($this->isResponseDeclined($responseData)) {\n\t\t\tif (isset($_SESSION[$orderTransactionName])) {\n\t\t\t\tunset($_SESSION[$orderTransactionName]);\n\t\t\t}\n\t\t}\n\t\t\n if (!is_null($this->responseHandler)) {\n if ($this->isResponseOK($responseData)) {\n $this->responseHandler->handleConfirmOrderResponseOK($responseData);\n } else {\n $this->responseHandler->handleConfirmOrderResponseError($responseData);\n }\n }\n\n return $responseData;\n }", "public function savePostAction() {\n $isNeedCreateLabel = '';\n try {\n $updateOrderId = $this->getRequest ()->getParam ( 'order_id' );\n /**\n * Get marketplace commission details\n */\n $collection = Mage::getModel ( 'marketplace/commission' )->getCollection ()->addFieldToFilter ( 'seller_id', Mage::getSingleton ( 'customer/session' )->getId () )->addFieldToFilter ( 'order_id', $updateOrderId )->getFirstItem ();\n /**\n * Checking manage order enable for seller\n */\n $orderStatusFlag = Mage::getStoreConfig ( 'marketplace/admin_approval_seller_registration/order_manage' );\n /**\n * Checking for seller order management enable or not\n */\n if (count ( $collection ) <= 0 || $orderStatusFlag != 1) {\n $this->_getSession ()->addError ( $this->__ ( 'You do not have permission to access this page' ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $updateOrderId );\n return;\n }\n /**\n * Get shipment info\n */\n $data = $this->getRequest ()->getParam ( 'shipment' );\n $shipment = $this->_initShipment ();\n if (! $shipment) {\n $this->_forward ( 'noRoute' );\n return;\n }\n /**\n * Register shipment\n */\n $shipment->register ();\n $comment = '';\n if (! empty ( $data ['comment_text'] )) {\n $shipment->addComment ( $data ['comment_text'], isset ( $data ['comment_customer_notify'] ), isset ( $data ['is_visible_on_front'] ) );\n if (isset ( $data ['comment_customer_notify'] )) {\n $comment = $data ['comment_text'];\n }\n }\n $shipment->setEmailSent ( true );\n /**\n * Set customer notify.\n */\n $shipment->getOrder ()->setCustomerNoteNotify ( true );\n $responseAjax = new Varien_Object ();\n $isNeedCreateLabel = isset ( $data ['create_shipping_label'] ) && $data ['create_shipping_label'];\n if ($isNeedCreateLabel && $this->_createShippingLabel ( $shipment )) {\n $responseAjax->setOk ( true );\n }\n /**\n * Save shipment\n */\n $this->_saveShipment ( $shipment );\n\n /**\n * Send shipment email\n */\n $shipment->sendEmail ( true, $comment );\n /**\n * Initilize shipment label\n */\n $shipmentCreatedMessage = $this->__ ( 'The shipment has been created.' );\n $labelCreatedMessage = $this->__ ( 'The shipping label has been created.' );\n $savedQtys = $this->_getItemQtys ();\n Mage::getModel ( 'marketplace/order' )->updateSellerOrderItemsBasedOnSellerItems ( $savedQtys, $updateOrderId, 0 );\n $this->_getSession ()->addSuccess ( $isNeedCreateLabel ? $shipmentCreatedMessage . ' ' . $labelCreatedMessage : $shipmentCreatedMessage );\n } catch ( Mage_Core_Exception $e ) {\n /**\n * Thorugh the exception error message.\n */\n if ($isNeedCreateLabel) {\n $responseAjax->setError ( true );\n $responseAjax->setMessage ( $e->getMessage () );\n } else {\n /**\n * When error occured, redirect to the view order page.\n */\n $this->_getSession ()->addError ( $e->getMessage () );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $updateOrderId );\n }\n } catch ( Exception $e ) {\n Mage::logException ( $e );\n if ($isNeedCreateLabel) {\n $responseAjax->setError ( true );\n $responseAjax->setMessage ( /**\n * Through error when create shipping label.\n */\n Mage::helper ( 'sales' )->__ ( 'An error occurred while creating shipping label.' ) );\n } else {\n $this->_getSession ()->addError ( $this->__ ( 'Cannot save shipment.' ) );\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $updateOrderId );\n }\n }\n if ($isNeedCreateLabel) {\n $this->getResponse ()->setBody ( $responseAjax->toJson () );\n } else {\n /**\n * Redirect to the view order page.\n */\n $this->_redirect ( 'marketplace/order/vieworder/orderid/' . $updateOrderId );\n }\n }", "public function getShippingOptionsToDestinationAction()\n { \n \n $this->_helper->viewRenderer->setNoRender(true);\n $this->_helper->layout->disableLayout();\n \n $requestDataRaw = isset($_REQUEST['requestData']) && is_string($_REQUEST['requestData']) ? $_REQUEST['requestData'] : '{}';\n \n $outputData = array(\n 'code' => null, \n 'data' => null, \n 'debug' => null, \n 'data' => null, \n 'message' => null\n );\n \n try\n {\n $requestData = Zend_Json::decode($requestDataRaw, true); \n \n //process input\n $buyerLocation = isset($requestData['buyerLocation']) ? $requestData['buyerLocation'] : '';\n \n $shimentAllocator = new AgroLogistics_Component_Ship(); \n $shippingOptions = $shimentAllocator->getShippingOptionsToDestination($buyerLocation);\n \n $outputData['data'] = $shippingOptions;\n \n }\n catch(AgroLogistics_Component_Exception_InvalidInputException $ex)\n { \n// $this->_response->setHttpResponseCode(422); \n \n $outputData['code'] = $ex->getCode();\n $outputData['message'] = 'Error: ' . $ex->getMessage();\n }\n catch(Exception $ex)\n {\n// $this->_response->setHttpResponseCode(422); \n \n $outputData['code'] = $ex->getCode();\n $outputData['message'] = 'Error: ' . $ex->getMessage();\n \n }\n \n// $outputData['message'] .= $requestDataRaw;\n// \n// var_dump($outputData);die();\n \n //generat output\n echo $this->processOutput($outputData);\n }", "public function submit_order()\r\n\t{\r\n\t\t$orderdata = $this->input->post('order');\r\n\r\n\t\t$params = array();\r\n\t\t$notification = array();\r\n\t\t// print_r($orderdata); die();\r\n\r\n\t\t$updateUser['name'] = $orderdata['fname'];\r\n\t\t$updateUser['lname'] = $orderdata['lname'];\r\n\t\t$updateUser['email'] = $orderdata['email'];\r\n\t\t$updateUser['mobile'] = $orderdata['mobile'];\r\n\t\t$this->load->library('zyk/UserLib', 'userlib');\r\n\t\t$this->userlib->updateUser( $updateUser );\r\n\t\t\r\n\t\t$params['name'] = $orderdata['fname'].\" \".$orderdata['lname'];\r\n\t\t$params['email'] = $orderdata['email'];\r\n\t\t$params['mobile'] = $orderdata['mobile'];\r\n\t\t$params['address_id'] = $orderdata['address_id'];\r\n\t\t$params['slot'] = $orderdata['slottime'];\r\n\t\t$params['vehicle_id'] = $orderdata['vehicle_id'];\r\n\t\t$params['brand_id'] = $orderdata['brand_id'];\r\n\t\t$params['vehicle_model'] = $orderdata['model_id'];\r\n\t\t$params['vendor_id'] = $orderdata['vendor_id'];\r\n\t\t$params['userid'] = $orderdata['user_id'];\r\n\r\n\t\tif(!empty($orderdata['slotdate']))\r\n\t\t{\r\n\t\t\t$params['pickup_date'] = $orderdata['slotdate'];\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$params['pickup_date'] = date('Y-m-d');\r\n\t\t}\r\n\t\t\r\n\t\t$params['delivery_date'] = date('Y-m-d',strtotime('+72 hours',strtotime($params['pickup_date'])));\r\n\t\t$params['service_group_id'] = $orderdata['servicegroup_id'];\r\n\t\t$params['assign_vendor_id'] = $orderdata['vendor_id'];\r\n\t\t$params['status'] = 0;\r\n\t\t$params['ordered_on'] = date('Y-m-d H:i:s');\r\n\t\t$params['source'] = 2;\r\n\t\t$params['old_price'] = 0;\r\n\t\t$params['category_id'] = 9;\r\n\t\t$params['subcategory_id'] = $orderdata['st']; // its pick n'drop or breakdown id (st:service type)\r\n\t\t$params['applied_ride_charge'] = $_SESSION['stData']['price'];\r\n\t\t$params['ride_payment_mode'] = $orderdata['paymode'];\r\n\t\t$params['coupon_code'] = $orderdata['ccode'];\r\n\t\t$params['is_ride_paid'] = 0;\r\n\r\n\t\t$orderid = $this->orderlib->addOrder($params);\r\n\r\n $oupdate = array();\r\n\t\t$oupdate['orderid'] = $orderid;\r\n\t\t$oupdate['ordercode'] = strtoupper(base_convert(strtotime(date('Y-m-d H:i:s')), 10, 36)).strtoupper(base_convert($orderid, 10, 36));\r\n\t\t$_SESSION['order_code'] = $oupdate['ordercode'];\r\n \t\tif($orderid > 0) {\r\n\t\t\t$params['orderid'] = $orderid;\r\n\r\n\t\t\t$params['ordercode'] = $oupdate['ordercode'];\r\n $this->orderlib->updateOrder($oupdate);\r\n\r\n\t\t\t$this->orderlib->sendBookingEmail($params);\r\n\t\t\t$this->orderlib->sendBookingSMS($params);\r\n\t\t\t$this->load->library ( 'zyk/NotificationLib', 'notificationlib' );\r\n\t\t\t$this->notificationlib->sendBookingNotification($params['userid']);\r\n\t\t\t$response['orderid'] = $orderid;\r\n\t\t\t$response['ordercode'] = $oupdate['ordercode'];\r\n\t\t\t$response['status'] = 1;\r\n\t\t\t$response['msg'] = \"Order punched in system\";\r\n\t\t\t// $_SESSION['orderid']=$orderid ;\r\n\r\n\t\t\t$logs = array();\r\n\t\t\t$logs['orderid'] = $orderid;\r\n\t\t\t$logs['comment'] = 'Booking Request Sent';\r\n\t\t\t$logs['created_date'] = date('Y-m-d H:i:s');\r\n\t\t\t$logs['order_status'] = 0;\r\n\t\t\t$logs['created_by'] = 0;\r\n\r\n\t\t\t$this->orderlib->addOrderLogs($logs);\r\n\t\t\t$this->session->unset_userdata('vendor_id');\r\n\t\t\t$this->session->unset_userdata('slottime');\r\n\t\t\t$this->session->unset_userdata('slotdate');\r\n\t\t\t$this->session->unset_userdata('categories');\r\n\t\t\t$this->session->unset_userdata('back_url');\r\n\t\t\t$this->session->unset_userdata('referrer_url');\r\n\t\t\t$this->session->unset_userdata('stData');\r\n\t\t\t$this->session->unset_userdata('serviceType');\r\n\t\t\t$this->session->unset_userdata('filterbrand');\r\n\t\t\t$this->session->unset_userdata('filterstar');\r\n\t\t\t$this->session->unset_userdata('filtermodel');\r\n\r\n\t\t\tif ($orderdata['paymode'] == 1) {\r\n\t\t\t\t$response['url'] = \"order-details/\".$response['ordercode'];\r\n\t\t\t} else if ($orderdata['paymode'] == 2) {\r\n\t\t\t\t$response['url'] = \"ride_payment\";\r\n\t\t\t}\r\n\t\t\t$response['status'] = 1;\r\n\t\t\t$response['msg'] = \"Order punched in system\";\r\n\t\t} else {\r\n\t\t\t$response['status'] = 0;\r\n\t\t\t$response['msg'] = \"Failed to add order\";\r\n\t\t}\r\n\t\techo json_encode($response);\r\n\t}", "public function action_order() {\n $field = $this->field($_POST[\"fieldid\"]);\n // Load pre-set emailaddress\n $address = Wi3::inst()->model->factory(\"site_data\")->setref($field)->setname(\"emailaddress\")->load()->data;\n if (empty($address)) {\n echo json_encode(\n Array(\n \"scriptsbefore\" => Array(\n \"0\" => \"$(wi3.popup.getDOM()).fadeOut(100,function() { $(this).html('Bestelling kon <strong>niet</strong> geplaatst worden! Stel de eigenaar van de site hiervan op de hoogte.').fadeIn(); } );\"\n )\n )\n );\n } else {\n // Send an email to client and to the pre-set emailaddress\n $presetemailaddress = $address;\n // Set folder to $_POST to store\n $folderid = Wi3::inst()->model->factory(\"site_data\")->setref($field)->setname(\"folder\")->load()->data;\n $_POST[\"folderid\"] = $folderid;\n // Store order\n $orders = Wi3::inst()->model->factory(\"site_data\")->setref($field)->setname(\"orders\")->load();\n if (!$orders->loaded())\n {\n $orders->create();\n }\n $ordersdata = unserialize($orders->data);\n $ordersdata[] = $_POST;\n $orders->data = serialize($ordersdata);\n $orders->update();\n // Create mail\n $message = $this->view(\"mail\")->set(\"post\", $_POST)->render();\n $clientmessage = $this->view(\"clientmail\")->set(\"post\", $_POST)->render();\n $subject = \"Bestelling foto's\";\n // Send mail to 'us' and to client\n mail($presetemailaddress, $subject, $message);\n mail($_POST[\"emailaddress\"], $subject, $clientmessage);\n echo json_encode(\n Array(\n \"scriptsbefore\" => Array(\n \"0\" => \"$(wi3.popup.getDOM()).fadeOut(100,function() { $(this).html('Bestelling succesvol geplaatst!').fadeIn(); } );\"\n )\n )\n );\n }\n }", "public function execute()\n {\n $result = $this->resultJsonFactory->create();\n $session = $this->_getCheckout();\n if ($this->getRequest()->isAjax()) {\n $data = $this->getRequest()->getParams();\n\n if (isset($data['gateway_id'])) {\n $gatewayId = (int)$data['gateway_id'];\n } else {\n $gatewayId = 0;\n }\n\n try {\n $session->setBluepaymentGatewayId($gatewayId);\n $response = ['success' => true, 'session_gateway_id' => $session->getBluepaymentGatewayId()];\n } catch (\\Exception $e) {\n $this->_logger->info([__METHOD__ => __LINE__, 'error' => $e->getMessage()]);\n $response = ['success' => false, 'session_gateway_id' => 0];\n }\n\n return $result->setData($response);\n }\n\n try {\n $session->setBluepaymentGatewayId(0);\n $response = ['success' => true, 'session_gateway_id' => 0];\n } catch (\\Exception $e) {\n $this->_logger->info([__METHOD__ => __LINE__, 'error' => $e->getMessage()]);\n $response = ['success' => false, 'session_gateway_id' => 0];\n }\n\n return $result->setData($response);\n }", "public function sendOrder($order, $data)\n {\n //достаем url и ключ для подключения к crm\n $retail_api_key = env('RETAIL_CRM_API_KEY');\n $url = Setting::where('var', 'retailcrm_url')->first()->value;\n //достаем торговое предложение, нам нужен внешний id, по которому будем искать товар\n $retailOrderData = [\n 'externalId' => $data['order_prefix'].'-' . $order->id,\n 'firstName' => $order->name,\n 'phone' => $order->phone,\n 'email' => $order->email,\n 'createdAt' => $order->created_at->format('Y-m-d H:i:s'),\n 'orderMethod' => $data['method'],\n 'customFields' => [\n 'roistat' => isset($order->extra['roistat']) ? $order->extra['roistat'] : null,\n ],\n ];\n $client = new \\RetailCrm\\ApiClient(\n $url,\n $retail_api_key\n );\n //если включено логирование, то не отправляем в лог вместо crm\n if ($this->option('log')) {\n Log::info($retailOrderData);\n $this->info('order logging');\n return false;\n }\n\n //создаем заказ в crm\n try {\n $response = $client->request->ordersCreate($retailOrderData);\n } catch (\\RetailCrm\\Exception\\CurlException $e) {\n $err = 'RetailCRM ' . $e->getMessage();\n Log::error($err);\n $this->info($err);\n return false;\n }\n\n if ($response->isSuccessful() && 201 === $response->getStatusCode()) {\n if($data['method'] == 'callback') {\n $order->update([\n 'send' => 1,\n ]);\n }\n return $response->id;\n } else {\n if (isset($response['errors'])) {\n $err = 'RetailCRM ' . json_encode($response['errors']);\n Log::error($err);\n $this->info($err);\n } else {\n $err = $response->getErrorMsg();\n if ($err == 'Order already exists.') {\n if($data['method'] == 'callback') {\n $order->update([\n 'send' => 1,\n ]);\n }\n $err = 'RetailCRM ' . $err;\n $this->info($err);\n $this->info('Order is removed from the list, now');\n } else {\n $err = 'RetailCRM ' . $err;\n $this->info($err);\n }\n Log::error($err);\n }\n return false;\n }\n }", "public function processOrder(Request $request) {\n $id = $request->id;\n\n ItemOrder::where('id', $id)->update(['status' => config('constants.order_status.completed')]);\n\n session()->flash('success', 'Order processed successfully.'); \n\n return interpretJsonResponse(true, 200, null, null);\n }", "public function salesOrderShipmentSaveAfter($observer)\n {\n\n // Get the settings\n $settings = Mage::helper('smsnotifications/data')->getSettings();\n $arr = $settings['order_status'];\n $a = explode(',', $settings['order_status']);\n $b = explode(',', $settings['order_status']);\n $final_array = array_combine($a, $b);\n \n if (!$settings['shipment_notification_message']) {\n return;\n }\n $order = $observer->getEvent()->getShipment()->getOrder();\n \n $billingAdress = $order->getBillingAddress();\n $shippingAdress = $order->getShippingAddress();\n\n if ($order->getCustomerFirstname()) {\n $customer_name = $order->getCustomerFirstname();\n $customer_name .= ' '.$order->getCustomerLastname();\n } elseif ($billingAdress->getFirstname()) {\n $customer_name = $billingAdress->getFirstname();\n $customer_name .= ' '.$billingAdress->getLastname();\n } else {\n $customer_name = $shippingAdress->getFirstname();\n $customer_name .= ' '.$shippingAdress->getLastname();\n }\n\n $order_id = $order->getIncrementId();\n $order_amount = $order->getBaseCurrencyCode();\n $order_amount .= ' '.$order->getBaseGrandTotal();\n\n $telephoneNumber = trim($shippingAdress->getTelephone());\n\n $shipment = $order->getShipmentsCollection()->getFirstItem();\n $shipId = $shipment->getIncrementId();\n\n // Check if a telephone number has been specified\n if(in_array('shippment', $final_array)){\n if ($telephoneNumber) {\n // Send the shipment notification to the specified telephone number\n $text = $settings['shipment_notification_message'];\n $text = str_replace('{{name}}', $customer_name, $text);\n $text = str_replace('{{order}}', $order_id, $text);\n $text = str_replace('{{amount}}', $order_amount, $text);\n $text = str_replace('{{shipmentno}}', $shipId, $text);\n\n array_push($settings['order_noficication_recipients'], $telephoneNumber);\n\n $result = Mage::helper('smsnotifications/data')->sendSms($text, $settings['order_noficication_recipients']);\n // Display a success or error message\n if ($result) {\n $recipients_string = implode(',', $settings['order_noficication_recipients']);\n Mage::getSingleton('adminhtml/session')->addSuccess(sprintf('The shipment notification has been sent via SMS to: %s', $recipients_string));\n } else {\n Mage::getSingleton('adminhtml/session')->addError('There has been an error sending the shipment notification SMS.');\n }\n }\n } \n}", "public function execute()\n {\n $jsonResult = $this->_jsonFactory->create();\n if ($this->_cartHelper->isEnable()) {\n if (!$this->_cartHelper->getHeaders()) {\n $errorResult = array('status'=> false,'message' => $this->_cartHelper->getHeaderMessage());\n $jsonResult->setData($errorResult);\n return $jsonResult;\n }\n $sessionId = '';\n $postData = $this->_request->getParams();\n if (isset($postData['session_id']) && $postData['session_id'] != null) {\n $sessionId = $postData['session_id'];\n if (!$this->_customerSession->isLoggedIn()) {\n $customer_id = explode(\"_\", $sessionId);\n $this->_cartHelper->relogin($customer_id[0]);\n }\n }\n $storeId = $postData['storeid'];\n $countries = $this->_countryModel->getCollection()->loadByStore($storeId)->toOptionArray();\n $countriesJson = array('countries' => $countries);\n $jsonResult->setData($countriesJson);\n return $jsonResult;\n } else {\n $returnExtensionArray = array('enable' => false);\n $jsonResult->setData($returnExtensionArray);\n return $jsonResult;\n }\n }", "function _process($data)\n {\t\t\n\t\t$post = JFactory::getApplication()->input->get($_POST);\n \t\n \t$orderpayment_id = @$data['ssl_invoice_number'];\n \t\n \t$errors = array();\n \t$send_email = false;\n \t\n \t// load the orderpayment record and set some values\n JTable::addIncludePath( JPATH_ADMINISTRATOR.'/components/com_tienda/tables' );\n $orderpayment = JTable::getInstance('OrderPayments', 'TiendaTable');\n $orderpayment->load( $orderpayment_id );\n if (empty($orderpayment_id) || empty($orderpayment->orderpayment_id))\n {\n $errors[] = JText::_('VIRTUALMERCHANT MESSAGE INVALID ORDERPAYMENTID');\n return count($errors) ? implode(\"\\n\", $errors) : '';\n }\n $orderpayment->transaction_details = $data['ssl_result_message'];\n $orderpayment->transaction_id = $data['ssl_txn_id'];\n $orderpayment->transaction_status = $data['ssl_result'];\n \n // check the stored amount against the payment amount \n \tTienda::load( 'TiendaHelperBase', 'helpers._base' );\n $stored_amount = TiendaHelperBase::number( $orderpayment->get('orderpayment_amount'), array( 'thousands'=>'' ) );\n $respond_amount = TiendaHelperBase::number( $data['ssl_amount'], array( 'thousands'=>'' ) );\n if ($stored_amount != $respond_amount ) {\n \t$errors[] = JText::_('VIRTUALMERCHANT MESSAGE AMOUNT INVALID');\n \t$errors[] = $stored_amount . \" != \" . $respond_amount;\n }\n \n // set the order's new status and update quantities if necessary\n Tienda::load( 'TiendaHelperOrder', 'helpers.order' );\n Tienda::load( 'TiendaHelperCarts', 'helpers.carts' );\n $order = JTable::getInstance('Orders', 'TiendaTable');\n $order->load( $orderpayment->order_id );\n if (count($errors)) \n {\n // if an error occurred \n $order->order_state_id = $this->params->get('failed_order_state', '10'); // FAILED\n }\n\t\telse\n {\n $order->order_state_id = $this->params->get('payment_received_order_state', '17');; // PAYMENT RECEIVED\n\n // do post payment actions\n $setOrderPaymentReceived = true;\n \n // send email\n $send_email = true;\n }\n\n // save the order\n if (!$order->save())\n {\n \t$errors[] = $order->getError();\n }\n \n // save the orderpayment\n if (!$orderpayment->save())\n {\n \t$errors[] = $orderpayment->getError(); \n }\n \n if (!empty($setOrderPaymentReceived))\n {\n $this->setOrderPaymentReceived( $orderpayment->order_id );\n }\n \n if ($send_email)\n {\n // send notice of new order\n Tienda::load( \"TiendaHelperBase\", 'helpers._base' );\n $helper = TiendaHelperBase::getInstance('Email');\n $model = Tienda::getClass(\"TiendaModelOrders\", \"models.orders\");\n $model->setId( $orderpayment->order_id );\n $order = $model->getItem();\n $helper->sendEmailNotices($order, 'new_order');\n }\n\n return count($errors) ? implode(\"\\n\", $errors) : ''; \n\n \treturn true;\n }", "public function postSavestock(){\n $UserInfo = $this->UserInfo();\n Input::merge(Input::json()->all());\n $data = Input::all();\n $OrderId = (isset($data['order_id'])) ? $data['order_id'] : 0;\n if($OrderId > 0){\n $Update = OrderProblemModel::where('order_id',$OrderID)->update(array('time_store_stock' => time()));\n if($Update){\n return Response::json([\n 'error' => false,\n 'message' => 'SUCCESS',\n 'error_message' => 'Thành công'\n ]);\n }else{\n return Response::json([\n 'error' => true,\n 'message' => 'UPDATE_ERROR',\n 'error_message' => 'Cập nhật thất bại'\n ]);\n }\n }else{\n return Response::json([\n 'error' => true,\n 'message' => 'UPDATE_ERROR',\n 'error_message' => 'Không thể cập nhật'\n ]);\n }\n }", "function SBSC_SendOrder($token, \n\t\t\t\t\t\t\t$order_no,\n\t\t\t\t\t\t\t$order_date,\n\t\t\t\t\t\t\t$order_type_code,\n\t\t\t\t\t\t\t$order_type_name, \n\t\t\t\t\t\t\t$asc_code, \n\t\t\t\t\t\t\t$asc_name, \n\t\t\t\t\t\t\t$asc_address, \n\t\t\t\t\t\t\t$asc_postcode,\n\t\t\t\t\t\t\t$sender_name, \n\t\t\t\t\t\t\t$sender_phone, \n\t\t\t\t\t\t\t$sender_city_code,\n\t\t\t\t\t\t\t$sender_city_name, \n\t\t\t\t\t\t\t$receive_code, \n\t\t\t\t\t\t\t$receive_name,\n\t\t\t\t\t\t\t$receive_address,\n\t\t\t\t\t\t\t$receive_postcode,\n\t\t\t\t\t\t\t$receive_person,\n\t\t\t\t\t\t\t$receive_phone,\n\t\t\t\t\t\t\t$receive_city_code,\n\t\t\t\t\t\t\t$receive_city_name,\n\t\t\t\t\t\t\t$box_number,\n\t\t\t\t\t\t\t$box_no_list,\n\t\t\t\t\t\t\t$goods_price,\n\t\t\t\t\t\t\t$insurance_price,\n\t\t\t\t\t\t\t$model_no,\n\t\t\t\t\t\t\t$serial_no,\n\t\t\t\t\t\t\t$description )\n\t{\n\t\tglobal $JSON, $arrErrMsg, $link;\n\t\t$funcName = 'SBSC_SendOrder';\n\n\t\tif ( strlen( trim( $token ) ) <= 0 ) \n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', $arrErrMsg[ QLM_NO_TOKEN ] );\n\t\t\t$arrRet = array( 'err_code' => QLM_NO_TOKEN, 'err_msg' => $arrErrMsg[ QLM_NO_TOKEN ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\tif ( strlen( trim( $order_no ) ) <= 0 )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', 'Empty order no' );\n\t\t\t$arrRet = array( 'err_code' => QLM_NO_PARAM, 'err_msg' => $arrErrMsg[ QLM_NO_PARAM ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\tif ( strlen( trim( $order_date ) ) <= 0 )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', 'Empty order date' );\n\t\t\t$arrRet = array( 'err_code' => QLM_NO_PARAM, 'err_msg' => $arrErrMsg[ QLM_NO_PARAM ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\tif ( strlen( trim( $order_date ) ) <= 0 )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', 'Empty order date' );\n\t\t\t$arrRet = array( 'err_code' => QLM_NO_PARAM, 'err_msg' => $arrErrMsg[ QLM_NO_PARAM ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\tif ( strlen( trim( $order_type_code ) ) <= 0 )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', 'Empty order type code' );\n\t\t\t$arrRet = array( 'err_code' => QLM_NO_PARAM, 'err_msg' => $arrErrMsg[ QLM_NO_PARAM ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\tif ( strlen( trim( $order_type_name ) ) <= 0 )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', 'Empty order type name' );\n\t\t\t$arrRet = array( 'err_code' => QLM_NO_PARAM, 'err_msg' => $arrErrMsg[ QLM_NO_PARAM ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\tif ( strlen( trim( $asc_code ) ) <= 0 )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', 'Empty ASC code' );\n\t\t\t$arrRet = array( 'err_code' => QLM_NO_PARAM, 'err_msg' => $arrErrMsg[ QLM_NO_PARAM ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\tif ( strlen( trim( $asc_name ) ) <= 0 )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', 'Empty ASC name' );\n\t\t\t$arrRet = array( 'err_code' => QLM_NO_PARAM, 'err_msg' => $arrErrMsg[ QLM_NO_PARAM ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\tif ( strlen( trim( $asc_address ) ) <= 0 )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', 'Empty ASC address' );\n\t\t\t$arrRet = array( 'err_code' => QLM_NO_PARAM, 'err_msg' => $arrErrMsg[ QLM_NO_PARAM ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\tif ( strlen( trim( $asc_postcode ) ) <= 0 )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', 'Empty ASC code' );\n\t\t\t$arrRet = array( 'err_code' => QLM_NO_PARAM, 'err_msg' => $arrErrMsg[ QLM_NO_PARAM ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\tif ( strlen( trim( $sender_name ) ) <= 0 )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', 'Empty sender name' );\n\t\t\t$arrRet = array( 'err_code' => QLM_NO_PARAM, 'err_msg' => $arrErrMsg[ QLM_NO_PARAM ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\tif ( strlen( trim( $sender_phone ) ) <= 0 )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', 'Empty sender phone' );\n\t\t\t$arrRet = array( 'err_code' => QLM_NO_PARAM, 'err_msg' => $arrErrMsg[ QLM_NO_PARAM ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\tif ( strlen( trim( $sender_city_code ) ) <= 0 )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', 'Empty sender city code' );\n\t\t\t$arrRet = array( 'err_code' => QLM_NO_PARAM, 'err_msg' => $arrErrMsg[ QLM_NO_PARAM ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\tif ( strlen( trim( $sender_city_name ) ) <= 0 )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', 'Empty sender city name' );\n\t\t\t$arrRet = array( 'err_code' => QLM_NO_PARAM, 'err_msg' => $arrErrMsg[ QLM_NO_PARAM ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\tif ( strlen( trim( $receive_code ) ) <= 0 )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', 'Empty receive code' );\n\t\t\t$arrRet = array( 'err_code' => QLM_NO_PARAM, 'err_msg' => $arrErrMsg[ QLM_NO_PARAM ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\tif ( strlen( trim( $receive_name ) ) <= 0 )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', 'Empty receive name' );\n\t\t\t$arrRet = array( 'err_code' => QLM_NO_PARAM, 'err_msg' => $arrErrMsg[ QLM_NO_PARAM ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\tif ( strlen( trim( $receive_address ) ) <= 0 )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', 'Empty receive address' );\n\t\t\t$arrRet = array( 'err_code' => QLM_NO_PARAM, 'err_msg' => $arrErrMsg[ QLM_NO_PARAM ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\tif ( strlen( trim( $receive_postcode ) ) <= 0 )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', 'Empty receive post code' );\n\t\t\t$arrRet = array( 'err_code' => QLM_NO_PARAM, 'err_msg' => $arrErrMsg[ QLM_NO_PARAM ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\tif ( strlen( trim( $receive_person ) ) <= 0 )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', 'Empty receive person' );\n\t\t\t$arrRet = array( 'err_code' => QLM_NO_PARAM, 'err_msg' => $arrErrMsg[ QLM_NO_PARAM ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\t\t\t \n\t\tif ( strlen( trim( $receive_phone ) ) <= 0 )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', 'Empty receive phone' );\n\t\t\t$arrRet = array( 'err_code' => QLM_NO_PARAM, 'err_msg' => $arrErrMsg[ QLM_NO_PARAM ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\tif ( strlen( trim( $receive_city_code ) ) <= 0 )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', 'Empty receive city code' );\n\t\t\t$arrRet = array( 'err_code' => QLM_NO_PARAM, 'err_msg' => $arrErrMsg[ QLM_NO_PARAM ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\tif ( strlen( trim( $receive_city_name ) ) <= 0 )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', 'Empty receive city name' );\n\t\t\t$arrRet = array( 'err_code' => QLM_NO_PARAM, 'err_msg' => $arrErrMsg[ QLM_NO_PARAM ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\tif ( strlen( trim( $box_number ) ) <= 0 )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', 'Empty box number' );\n\t\t\t$arrRet = array( 'err_code' => QLM_NO_PARAM, 'err_msg' => $arrErrMsg[ QLM_NO_PARAM ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\tif ( strlen( trim( $box_no_list ) ) <= 0 )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', 'Empty box number list' );\n\t\t\t$arrRet = array( 'err_code' => QLM_NO_PARAM, 'err_msg' => $arrErrMsg[ QLM_NO_PARAM ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\n\t\t$arrClientInfo = getClientInfoFromToken( $token );\n\t\t$client_id = $arrClientInfo['company_id'];\n\n\t\t$bCheck = getFunctionPermission( $arrClientInfo['company_id'], $funcName );\n\n\t\tif ( $bCheck <= 0 )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', $arrErrMsg[ QLM_NO_PERMISSION_FUNCTION ] );\n\t\t\t$arrRet = array( 'err_code' => QLM_NO_PERMISSION_FUNCTION, 'err_msg' => $arrErrMsg[ QLM_NO_PERMISSION_FUNCTION ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\t//check if already exist same order no\n\t\t$bCheck = getDataByMySQLFunc( 'tblordermaster', ' where order_no = \\'' . db_sql( $order_no ) . '\\'', 'no', 'count' );\n\t\tif ( $bCheck > 0 )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', 'Already exist same order no' );\n\t\t\t$arrRet = array( 'err_code' => QLM_INVALID_PARAM, 'err_msg' => $arrErrMsg[ QLM_INVALID_PARAM ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\t//check order type - order type code must be 'HS', 'YF', 'TH'...\n\t\tif ( $order_type_code != 'HS' && $order_type_code != 'YF' && $order_type_code != 'TH' )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', 'Wrong order type code' );\n\t\t\t$arrRet = array( 'err_code' => QLM_INVALID_PARAM, 'err_msg' => $arrErrMsg[ QLM_INVALID_PARAM ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\t//check box number is int\n\t\tif ( (int)$box_number <= 0 )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', $arrErrMsg[ QLM_NO_BOX_NUMBER ] );\n\t\t\t$arrRet = array( 'err_code' => QLM_NO_BOX_NUMBER, 'err_msg' => $arrErrMsg[ QLM_NO_BOX_NUMBER ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\t//check box count and box number list\n\t\tif ( (int)$box_number != (int)count( jsonDecode( $box_no_list ) ) )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', $arrErrMsg[ QLM_NO_MATCH_BOX ] );\n\t\t\t$arrRet = array( 'err_code' => QLM_NO_MATCH_BOX, 'err_msg' => $arrErrMsg[ QLM_NO_MATCH_BOX ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\tif ( $order_type_code == 'HS' )\n\t\t{\n\t\t\tif ( strlen( trim( $goods_price ) ) <= 0 )\n\t\t\t{\n\t\t\t\tregisterFailedOrderList( $order_no, 'SBSC', $arrErrMsg[ QLM_NO_GOODS_PRICE ] );\n\t\t\t\t$arrRet = array( 'err_code' => QLM_NO_GOODS_PRICE, 'err_msg' => $arrErrMsg[ QLM_NO_GOODS_PRICE ] );\n\t\t\t\treturn $JSON->encode( $arrRet );\n\t\t\t}\n\n\t\t\tif ( strlen( trim( $insurance_price ) ) <= 0 )\n\t\t\t{\n\t\t\t\tregisterFailedOrderList( $order_no, 'SBSC', 'Empty insurance price' );\n\t\t\t\t$arrRet = array( 'err_code' => QLM_NO_PARAM, 'err_msg' => $arrErrMsg[ QLM_NO_PARAM ] );\n\t\t\t\treturn $JSON->encode( $arrRet );\n\t\t\t}\n\t\t}\n\t\telse if ( $order_type_code == 'YF' )\n\t\t{\n\t\t\tif ( strlen( trim( $goods_price ) ) <= 0 )\n\t\t\t{\n\t\t\t\tregisterFailedOrderList( $order_no, 'SBSC', $arrErrMsg[ QLM_NO_GOODS_PRICE ] );\n\t\t\t\t$arrRet = array( 'err_code' => QLM_NO_GOODS_PRICE, 'err_msg' => $arrErrMsg[ QLM_NO_GOODS_PRICE ] );\n\t\t\t\treturn $JSON->encode( $arrRet );\n\t\t\t}\n\t\t}\n\t\telse if ( $order_type_code == 'TH' )\n\t\t{\n\t\t\tif ( strlen( trim( $model_no ) ) <= 0 )\n\t\t\t{\n\t\t\t\tregisterFailedOrderList( $order_no, 'SBSC', $arrErrMsg[ QLM_NO_MODELNO ] );\n\t\t\t\t$arrRet = array( 'err_code' => QLM_NO_MODELNO, 'err_msg' => $arrErrMsg[ QLM_NO_MODELNO ] );\n\t\t\t\treturn $JSON->encode( $arrRet );\n\t\t\t}\n\t\t\t\n\t\t\tif ( strlen( trim( $serial_no ) ) <= 0 )\n\t\t\t{\n\t\t\t\tregisterFailedOrderList( $order_no, 'SBSC', $arrErrMsg[ QLM_NO_SERIALNO ] );\n\t\t\t\t$arrRet = array( 'err_code' => QLM_NO_SERIALNO, 'err_msg' => $arrErrMsg[ QLM_NO_SERIALNO ] );\n\t\t\t\treturn $JSON->encode( $arrRet );\n\t\t\t}\n\t\t}\n\n\t\t//check order_date validation\n\t\t$arrDate = explode( '-', $order_date );\n\t\tif ( count( $arrDate ) < 3 )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', $arrErrMsg[ QLM_NOT_MACH_DATE_FORMAT ] );\n\t\t\t$arrRet = array( 'err_code' => QLM_NOT_MACH_DATE_FORMAT, 'err_msg' => $arrErrMsg[ QLM_NOT_MACH_DATE_FORMAT ] );\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\t$order_timestamp = mktime( 0, 0, 0, $arrDate[1], $arrDate[2], $arrDate[0] );\n\t\t//now insert order info in table\n\t\t$sql = 'insert into tblsbscorderlist set ';\n\t\t$sql .= ' order_no\t\t\t\t= \\'' . db_sql( $order_no ) . '\\'';\n\t\t$sql .= ', order_date\t\t\t= \\'' . db_sql( $order_timestamp ) . '\\'';\n\t\t$sql .= ', order_type_code\t\t= \\'' . db_sql( $order_type_code ) . '\\'';\n\t\t$sql .= ', order_type_name\t\t= \\'' . db_sql( $order_type_name ) . '\\'';\n\t\t$sql .= ', asc_code\t\t\t\t= \\'' . db_sql( $asc_code ) . '\\'';\n\t\t$sql .= ', asc_name\t\t\t\t= \\'' . db_sql( $asc_name ) . '\\'';\n\t\t$sql .= ', asc_address\t\t\t= \\'' . db_sql( $asc_address ) . '\\'';\n\t\t$sql .= ', asc_postcode\t\t\t= \\'' . db_sql( $asc_postcode ) . '\\'';\n\t\t$sql .= ', sender_name\t\t\t= \\'' . db_sql( $sender_name ) . '\\'';\n\t\t$sql .= ', sender_phone\t\t\t= \\'' . db_sql( $sender_phone ) . '\\'';\n\t\t$sql .= ', sender_city_code\t\t= \\'' . db_sql( $sender_city_code ) . '\\'';\n\t\t$sql .= ', sender_city_name\t\t= \\'' . db_sql( $sender_city_name ) . '\\'';\n\t\t$sql .= ', receive_code\t\t\t= \\'' . db_sql( $receive_code ) . '\\'';\n\t\t$sql .= ', receive_name\t\t\t= \\'' . db_sql( $receive_name ) . '\\'';\n\t\t$sql .= ', receive_address\t\t= \\'' . db_sql( $receive_address ) . '\\'';\n\t\t$sql .= ', receive_postcode\t\t= \\'' . db_sql( $receive_postcode ) . '\\'';\n\t\t$sql .= ', receive_person\t\t= \\'' . db_sql( $receive_person ) . '\\'';\n\t\t$sql .= ', receive_phone\t\t= \\'' . db_sql( $receive_phone ) . '\\'';\n\t\t$sql .= ', receive_city_code\t= \\'' . db_sql( $receive_city_code ) . '\\'';\n\t\t$sql .= ', receive_city_name\t= \\'' . db_sql( $receive_city_name ) . '\\'';\n\t\t$sql .= ', box_number\t\t\t= \\'' . db_sql( $box_number ) . '\\'';\n\t\t$sql .= ', box_no_list\t\t\t= \\'' . db_sql( $box_no_list ) . '\\'';\n\t\t$sql .= ', goods_price\t\t\t= \\'' . db_sql( $goods_price ) . '\\'';\n\t\t$sql .= ', insurance_price\t\t= \\'' . db_sql( $insurance_price ) . '\\'';\n\t\t$sql .= ', model_no\t\t\t\t= \\'' . db_sql( $model_no ) . '\\'';\n\t\t$sql .= ', serial_no\t\t\t= \\'' . db_sql( $serial_no ) . '\\'';\n\t\t$sql .= ', description\t\t\t= \\'' . db_sql( $description ) . '\\'';\n\t\t$sql .= ', is_processed\t\t\t= \\'' . db_sql( '0' ) . '\\'';\n\n\t\t$query = db_query( $sql, $link );\n\t\t\n\t\tif ( !$query )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', $arrErrMsg[ QLM_SYSTEM_ERR ] );\n\t\t\t$arrRet = array( 'err_code' => QLM_SYSTEM_ERR, 'err_msg' => $arrErrMsg[ QLM_SYSTEM_ERR ], 'token' => '' );\t\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\t\n\t\t//get customer company's code\n\t\t$customerInfo = getData( 'tblcustomercompany', ' where company_id = \\'' . db_sql( $client_id ) . '\\'', 'company_code' );\n\n\t\t//and insert master table\n\t\t$sql = 'insert into tblordermaster set';\n\t\t$sql .= ' order_no\t\t\t= \\'' . db_sql( $order_no ) . '\\'';\n\t\t$sql .= ', order_date\t\t= \\'' . db_sql( $order_timestamp ) . '\\'';\n\t\t$sql .= ', order_type_code\t= \\'' . db_sql( $order_type_code ) . '\\'';\n\t\t$sql .= ', order_type_name\t= \\'' . db_sql( $order_type_name ) . '\\'';\n\t\t$sql .= ', company_code\t\t= \\'' . db_sql( $customerInfo['company_code'] ) . '\\'';\n\t\t$sql .= ', is_processed\t\t= \\'' . db_sql( '0' ) . '\\'';\n\n\t\t$query = db_query( $sql, $link );\n\t\t\n\t\tif ( !$query )\n\t\t{\n\t\t\tregisterFailedOrderList( $order_no, 'SBSC', $arrErrMsg[ QLM_SYSTEM_ERR ] );\n\t\t\t$arrRet = array( 'err_code' => QLM_SYSTEM_ERR, 'err_msg' => $arrErrMsg[ QLM_SYSTEM_ERR ], 'token' => '' );\t\n\t\t\treturn $JSON->encode( $arrRet );\n\t\t}\n\n\t\t//update current session time\n\t\t$sql = 'update tblsession set';\n\t\t$sql .= ' last_time = \\'' . time() . '\\'';\n\t\t$sql .= ' where token = \\'' . db_sql( $token ) . '\\'';\n\t\t\n\t\tdb_query( $sql, $link );\n\n\t\t$arrRet = array( 'err_code' => QLM_SUCCESS, 'err_msg' => $arrErrMsg[ QLM_SUCCESS ] );\n\n\t\treturn $JSON->encode( $arrRet );\n\t}", "function process_orders($orders)\n{\n $display = '';\n\n $order_instance = new Order();\n $item_instance = new Item();\n $fulfillment_instance = new Fulfillment();\n\n\n $order_count = 0;\n\n foreach ($orders as $o) {\n $order_count++;\n /** ------------\n * PARSE ORDERS\n * ------------ */\n $order_shopify_id = $o['id'];\n log_error('order_shopify_id: ' . $order_shopify_id);\n\n $customer_email = trim($o['email']);\n $customer_phone = (!empty($o['shipping_address']['phone'])) ? trim(strval($o['shipping_address']['phone'])) : trim(strval($o['billing_address']['phone']));\n $order_tcreate = date(\"Y-m-d H:i:s\", strtotime($o['created_at']));\n $order_tmodified = !empty($o['updated_at'])?date(\"Y-m-d H:i:s\", strtotime($o['updated_at'])):null;\n $order_tclose = !empty($o['closed_at'])?date(\"Y-m-d H:i:s\", strtotime($o['closed_at'])):null;\n $order_is_closed = empty($o['closed_at']) ? true : false;\n $order_total_cost = $o['total_price'];\n $order_receipt_id = $o['name'];\n $order_currency = $o['currency'];\n $order_vendor = '';\n $order_alert_status = NOTIFICATION_STATUS_NONE;\n\n\n\n\n\n\n if (!empty($o['gateway'])) {\n if (stripos($o['gateway'], 'stripe') > -1) $order_gateway = GATEWAY_PROVIDER_STRIPE;\n elseif (stripos($o['gateway'], 'paypal') > -1 ) $order_gateway = GATEWAY_PROVIDER_PAYPAL;\n elseif (stripos($o['gateway'], 'shopify_payments') > -1 ) $order_gateway = GATEWAY_PROVIDER_PAYPAL;\n else $order_gateway = GATEWAY_PROVIDER_UNKNOWN;\n }\n\n $order_fulfillment_status = $o['fulfillment_status'];\n $order_is_dropified = (!empty($o['note']) && stripos($o['note'], 'dropified') > -1 );\n \n /**\n * Check if note has 'Aliexpress' or 'Dropified'.\n * \n * If has then: \n * - get events related to order\n * - check if Dropified created fulfillments\n * - return array of ids of fulfillments created by Dropified\n * \n * If not then:\n * - return empty array\n * \n * Added by Rafal - 2018-03-13\n */\n \n $dropified_fulfillmets_ids = (stripos($o['note'], 'dropified') > -1 || stripos($o['note'], 'aliexpress') > -1)?getDropifiedEvents(getOrderEvents($order_shopify_id)):array();\n \n /** --------------\n * PARSE CUSTOMER\n * -------------- */\n $order_customer_fn = $o['shipping_address']['first_name'];\n $order_customer_ln = $o['shipping_address']['last_name'];\n $order_customer_address1 = $o['shipping_address']['address1'];\n $order_customer_address2 = $o['shipping_address']['address2'];\n $order_customer_city = $o['shipping_address']['city'];\n $order_customer_zip = $o['shipping_address']['zip'];\n $order_customer_province = $o['shipping_address']['province'];\n $order_customer_country_code = $o['shipping_address']['country_code'];\n $order_customer_province_code = $o['shipping_address']['province_code'];\n $order_customer_phone = $o['shipping_address']['phone'];\n $order_tags = strtolower($o['tags']);\n\n /** -----------------------------------\n * CUSTOMER BILLING - ADDED 02-06-2018\n * ----------------------------------- */\n $order_customer_billing_fn = $o['billing_address']['first_name'];\n $order_customer_billing_ln = $o['billing_address']['last_name'];\n $order_customer_billing_address1 = $o['billing_address']['address1'];\n $order_customer_billing_address2 = $o['billing_address']['address2'];\n $order_customer_billing_city = $o['billing_address']['city'];\n $order_customer_billing_zip = $o['billing_address']['zip'];\n $order_customer_billing_province = $o['billing_address']['province'];\n $order_customer_billing_country_code = $o['billing_address']['country_code'];\n $order_customer_billing_province_code = $o['billing_address']['province_code'];\n $order_customer_billing_phone = $o['billing_address']['phone'];\n\n \n /** -------------------------------------\n * CANCELLED - ADDED BY RAFAL 2018-03-20\n * ------------------------------------- */\n $order_tcancel = !empty($o['cancelled_at'])?date(\"Y-m-d H:i:s\", strtotime($o['cancelled_at'])):'0000-00-00 00:00:00';\n\n\n $order_is_ocu = (stripos($order_tags,'ocu') > -1)?1:0;\n\n $_refund_status = trim($o['financial_status']);\n\n //print 'REFUND STATUS: ' . $_refund_status . PHP_EOL;\n\n switch(strtolower($_refund_status))\n {\n case 'partially_refunded':\n $order_refund_status = 2;\n //print 'REFUND!!: ' . $order_refund_status;\n break;\n case 'refunded':\n $order_refund_status = 1;\n //print 'REFUND!!: ' . $order_refund_status;\n break;\n default: case 'paid':\n $order_refund_status = 0;\n //print 'REFUND!!: ' . $order_refund_status;\n break;\n }\n \n /** --------------------------------------------\n * FINANCIAL STATUS - ADDED BY RAFAL 2018-03-20\n * -------------------------------------------- */\n \n $_financial_status = trim($o['financial_status']);\n \n switch(strtolower($_financial_status))\n {\n case 'pending':\n $order_financial_status = 1;\n break;\n case 'authorized':\n $order_financial_status = 2;\n break;\n case 'partially_paid':\n $order_financial_status = 3;\n break;\n case 'paid':\n $order_financial_status = 4;\n break;\n case 'partially_refunded':\n $order_financial_status = 5;\n break;\n case 'refunded':\n $order_financial_status = 6;\n break;\n case 'voided':\n $order_financial_status = 7;\n break;\n default: case '':\n $order_financial_status = 0;\n break;\n }\n \n $order_is_fulfilled = false; //has the fulfillment process started or not\n $order_is_delivered = false; //has the order been completed and delivered\n $order_is_tracking = false; //whether we should track the order\n\n $order_array = Array(\n 'order_customer_email' => $customer_email,\n 'order_customer_fn' => $order_customer_fn,\n 'order_customer_ln' => $order_customer_ln,\n 'order_customer_address1' => $order_customer_address1,\n 'order_customer_address2' => $order_customer_address2,\n 'order_customer_city' => $order_customer_city,\n 'order_customer_country' => $order_customer_country_code,\n 'order_customer_province' => $order_customer_province,\n\n /** -----------------------------------\n * CUSTOMER BILLING - ADDED 02-06-2018\n * ----------------------------------- */\n 'order_customer_billing_fn'=> $order_customer_billing_fn,\n 'order_customer_billing_ln'=> $order_customer_billing_ln,\n 'order_customer_billing_address1'=> $order_customer_billing_address1,\n 'order_customer_billing_address2'=> $order_customer_billing_address2,\n 'order_customer_billing_city'=> $order_customer_billing_city,\n 'order_customer_billing_zip'=> $order_customer_billing_zip,\n 'order_customer_billing_province'=> $order_customer_billing_province,\n 'order_customer_billing_country'=> $order_customer_billing_country_code,\n 'order_customer_billing_phone'=> $order_customer_billing_phone,\n\n 'order_currency' => $order_currency,\n 'order_tags' => $order_tags,\n 'order_is_ocu'=>$order_is_ocu,\n 'order_customer_zip' => $order_customer_zip,\n 'order_customer_phone' => $customer_phone,//$order_customer_phone,\n 'order_fulfillment_status' => $order_fulfillment_status,\n 'order_is_refunded' => $order_refund_status,\n 'order_shopify_id' => $order_shopify_id,\n 'order_gateway' => $order_gateway,\n 'order_receipt_id'=>$order_receipt_id,\n 'order_total_cost' => $order_total_cost,\n 'order_topen' => $order_tcreate,\n 'order_tclose' => $order_tclose,\n\n \n /** --------------------------------------------\n * FINANCIAL STATUS - ADDED BY RAFAL 2018-03-20\n * -------------------------------------------- */\n 'order_financial_status' => $order_financial_status,\n \n /** -------------------------------------\n * CANCELLED - ADDED BY RAFAL 2018-03-20\n * ------------------------------------- */\n 'order_tcancel' => $order_tcancel,\n\n );\n \n /** ----------------------------------------\n * _ORDER_ARRAY - ADDED BY RAFAL 2018-03-20\n * \n * This is added to update only order if \n * is cancel order status\n * --------------------------------------- */\n \n\n /** -----------------------------------\n * LOOKUP ORDERS BY SHOPIFY'S ORDER ID\n * ----------------------------------- */\n if (isset($order_object)) unset($order_object);\n $order_object = $order_instance->fetch_order_by_order_shopify_id($order_shopify_id);\n \n /** ------------------------------\n * IF IT DOESN'T EXIST, CREATE IT\n * ------------------------------ */\n if (!$order_object) {\n $order_object = new Order($order_array);\n $order_id = $order_object->save();\n } else {\n $order_id = $order_object->id;\n }\n\n\n /** --------------------------\n * PARSE REFUNDED LINE ITEMS\n * ------------------------- */\n\n\n\n if(!empty($o['refunds']))\n {\n $refund_list = Array();\n $refund_check = Array();\n foreach($o['refunds'] as $refund)\n {\n $refund_date =date(\"Y-m-d H:i:s\", strtotime($refund['created_at']));\n foreach($refund['refund_line_items'] as $item)\n {\n $refund_list[$item['line_item_id']]=$refund_date;\n $refund_check[] = $item['line_item_id'];\n }\n }\n //print 'refund! ' . print_r($refund_list,true);\n //print 'refund! ' . print_r($refund_check,true);\n }\n\n\n\n\n /** ----------------\n * PARSE LINE ITEMS\n * ---------------- */\n\n foreach ($o['line_items'] as $p) {\n $_fulfillment_status = $p['fulfillment_status'];\n switch(strtolower($_fulfillment_status))\n {\n case 'fulfilled': $item_fulfillment_status = 1;break;\n case 'partial': $item_fulfillment_status = 2; break;\n default: case null: $item_fulfillment_status = 0;break;\n }\n $item_shopify_id = $p['id'];\n $item_shopify_product_id = $p['product_id'];\n $item_shopify_variant_id = $p['variant_id'];\n $item_name = $p['name'];\n $item_quantity = $p['quantity'];\n $item_sku = $p['sku'];\n $item_price = $p['price'];\n $item_is_refunded = 0;\n //$item_refund_tcreate = null;\n if(!empty($o['refunds'])) {\n if (in_array(trim($item_shopify_id), $refund_check)) {\n $item_is_refunded = 1;\n $item_refund_tcreate = $refund_list[$item_shopify_id];\n //print 'FOUND REFUND!';\n }\n }\n\n $item_array = Array(\n 'order_id' => $order_id,\n 'order_shopify_id' => $order_shopify_id,\n 'item_shopify_id' => $item_shopify_id,\n 'item_quantity' => $item_quantity,\n 'item_sku' => $item_sku,\n 'item_price'=>floatval($item_price),\n 'item_shopify_product_id' => $item_shopify_product_id,\n 'item_shopify_variant_id' => $item_shopify_variant_id,\n 'item_name' => $item_name,\n 'item_is_refunded' => $item_is_refunded,\n 'item_is_fulfilled'=>$item_fulfillment_status\n );\n\n if(isset($item_refund_tcreate)) $item_array['item_refund_tcreate']=$item_refund_tcreate;\n\n /** -------------------------\n * STORE / UPDATE LINE ITEMS\n * ------------------------- */\n if (isset($item_object)) unset($item_object);\n\n $item_object = $item_instance->fetch_item_by_shopify_item_id($item_shopify_id);\n if (!$item_object) {\n $item_object = new Item($item_array);\n $item_id = $item_object->save();\n } else {\n $item_id = $item_object->id;\n $item_object->save($item_array);\n }\n $order_object->order_items[] = $item_object;\n\n }\n\n\n /** ------------\n * FULFILLMENTS\n * ------------ */\n if (!empty($o['fulfillments'])) {\n foreach ($o['fulfillments'] as $fulfillment) {\n \n \n /**\n * Added by Rafal 2018-04-12\n * \n * Prevent added cancelled, error or failure\n * fulfillments\n */\n if($fulfillment['status'] == 'cancelled' || $fulfillment['status'] == 'error' || $fulfillment['status'] == 'failure'){\n continue;\n }\n \n \n $fulfillment_shopify_id = $fulfillment['id'];\n $fulfillment_shipment_status = strtolower(trim($fulfillment['shipment_status']));\n $fulfillment_topen = date(\"Y-m-d H:i:s\", strtotime($fulfillment['created_at']));\n //$fulfillment_tmodified = date(\"Y-m-d H:i:s\", strtotime($fulfillment['updated_at']));\n \n $fulfillment_tracking_company = strtolower($fulfillment['tracking_company']);\n \n $fulfillment_tracking_number = $fulfillment['tracking_number'];\n $fulfillment_tracking_url = $fulfillment['tracking_url'];\n\n $order_is_fulfilled = true;\n\n\n $fulfillment_array = Array(\n 'order_id' => $order_id,\n 'order_shopify_id' => $order_shopify_id,\n 'fulfillment_shipment_status' => trim(strtolower($fulfillment_shipment_status)),\n 'fulfillment_topen'=>$fulfillment_topen,\n 'fulfillment_shopify_id' => $fulfillment_shopify_id,\n 'fulfillment_tracking_number' => $fulfillment_tracking_number,\n 'fulfillment_tracking_company' => $fulfillment_tracking_company,\n 'fulfillment_tracking_url' => $fulfillment_tracking_url,\n 'order_is_fulfilled' => $order_is_fulfilled,\n );\n \n if ($fulfillment_tracking_company !== 'usps') $is_tracking = true;\n else $is_tracking = false;\n\n $order_delivery_status = false;\n\n //Normally USPS is the only courier that updates this appropriately. If its delivered set status\n switch ($fulfillment_shipment_status) {\n case 'delivered':\n $order_delivery_status = DELIVERY_STATUS_DELIVERED;\n $order_is_delivered = true;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n $order_array['order_delivery_status'] = $order_delivery_status;\n $fulfillment_array['fulfillment_status_delivered_tcreate'] = current_timestamp();\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 0;\n break;\n\n case 'confirmed':\n $order_delivery_status = DELIVERY_STATUS_CONFIRMED;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n $order_array['order_delivery_status'] = $order_delivery_status;\n $fulfillment_array['fulfillment_status_confirmed_tcreate'] = current_timestamp();\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 1;\n break;\n\n case 'in_transit':\n $order_delivery_status = DELIVERY_STATUS_IN_TRANSIT;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n $order_array['order_delivery_status'] = $order_delivery_status;\n $fulfillment_array['fulfillment_status_in_transit_tcreate'] = current_timestamp();\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 1;\n break;\n\n case 'out_for_delivery':\n $order_delivery_status = DELIVERY_STATUS_OUT_FOR_DELIVERY;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n $order_array['order_delivery_status'] = $order_delivery_status;\n $fulfillment_array['fulfillment_status_out_for_delivery_tcreate'] = current_timestamp();\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 1;\n break;\n\n case 'failure':\n $order_delivery_status = DELIVERY_STATUS_FAILURE;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n $order_array['order_delivery_status'] = $order_delivery_status;\n $fulfillment_array['fulfillment_status_failure_tcreate'] = current_timestamp();\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 0;\n $order_array['order_alert_status'] = DELIVERY_STATUS_FAILURE;\n $fulfillment_array['fulfillment_alert_status'] = DELIVERY_STATUS_FAILURE;\n break;\n\n default:\n $order_delivery_status = DELIVERY_STATUS_UNKNOWN;\n $fulfillment_array['fulfillment_delivery_status'] = $order_delivery_status;\n if($is_tracking) $fulfillment_array['fulfillment_is_tracking'] = 1;\n\n break;\n }\n/*\n if ($order_delivery_status)\n $order_array['delivery_status'] = $order_delivery_status;*/\n \n \n /**\n * 'status_delivered_tcreate'=>'',\n * 'status_confirmed_tcreate'=>'',\n * 'status_in_transit_tcreate'=>'',\n * 'status_out_for_delivery_tcreate'=>'',\n * 'status_failure_tcreate'=>'',\n * 'status_not_found_tcreate'=>'',\n * 'status_customer_pickup_tcreate'=>'',\n * 'status_alert_tcreate'=>'',\n * 'status_expired_tcreate'=>'',\n */\n /** -----------------------------------\n * CREATE AND STORE FULFILLMENT OBJECT\n * ----------------------------------- */\n \n //Lets see if the order exists\n if (isset($fulfillment_object)) unset($fulfillment_object);\n\n $fulfillment_object = $fulfillment_instance->fetch_fulfillment_by_shopify_fulfillment_id($fulfillment_shopify_id);\n\n\n if (!$fulfillment_object) {\n $fulfillment_array['fulfillment_tracking_number_tcreate'] = current_timestamp();\n $fulfillment_object = new Fulfillment($fulfillment_array);\n $fulfillment_object->save();\n\n } else {\n\n if($fulfillment_object->tracking_number == \"\" || $fulfillment_object->tracking_number == null)\n $fulfillment_array['fulfillment_tracking_number_tcreate'] = current_timestamp();\n\n $fulfillment_object->save($fulfillment_array);\n }\n \n $order_object->order_fulfillments[] = $fulfillment_object;\n \n \n /** Added by Rafal - 2018-03-13 */\n if(sizeof($dropified_fulfillmets_ids) > 0 && in_array($fulfillment_shopify_id,$dropified_fulfillmets_ids) === true){\n $dropified_array = Array(\n 'tracking_number' => $fulfillment_tracking_number,\n 'fulfillment_shopify_id' => $fulfillment_shopify_id,\n 'order_id' => $order_id,\n 'vendor_id' => VENDOR_DROPIFIED,\n 'order_receipt_id'=>$order_receipt_id,\n 'tracking_tcreate' => current_timestamp(),\n 'tracking_tmodified'=>current_timestamp()\n );\n set_dropified_tracking($dropified_array);\n }\n }\n\n /** -----------------------\n * UPDATE THE ORDER OBJECT\n * ----------------------- */\n $order_object->save($order_array);\n } else {\n /** -------------------------------------\n * ADDED BY RAFAL 2018-03-20\n * \n * This allow to update cancell date and\n * financial status if it is different\n * than in table\n * ------------------------------------- */\n $cancel_array = Array();\n \n if(isset($order_object -> financial_status) && $order_object -> financial_status != $order_financial_status){\n $cancel_array['order_financial_status'] = $order_financial_status;\n }\n \n if(isset($order_object -> tcancel) && $order_object -> tcancel != $order_financial_status){\n $cancel_array['order_tcancel'] = $order_tcancel;\n }\n \n if (sizeof($cancel_array) > 0) {\n \n $db_conditions = Array('order_id' => $order_id);\n \n if (isset($db_instance)) unset($db_instance); \n $db_instance = new Database;\n $db_instance -> db_update('orders',$cancel_array,$db_conditions,$isOr=false);\n }\n }\n\n if ($order_count >= ORDER_COUNT_LIMIT_MANUAL && ORDER_COUNT_LIMIT_MANUAL != 0) exit('ORIGINAL DATA: ' . PHP_EOL . print_r($order_count, true));\n\n }\n log_error('total orders: ' . $order_count);\n\n\n}", "public function successAction() {\n\t\t\n\t\t//echo \"in b2b\";die;\n\t\t$session = Mage::getSingleton('checkout/session');\n\t\t\n\t\t$logFileName = 'magentoorder.log';\n\t\t\n\t\tMage::log('----------------- START ------------------------------- ', null, $logFileName);\t\n\t\t\n\t\t$quote = $session->getQuote();\n\t\t$quoteId = $quote->getEntityId();\n\t\t$privateId = $session->getPrivateId();\n\t\t\n\t\t\n\t\t\n\t\tif($privateId){\n\t\t\t$orderData = Mage::getModel('collectorbank/api')->getOrderResponse();\t\n\t\t\t\n\t\t\tif(isset($orderData['error'])){\n\t\t\t\t$session->addError($orderData['error']['message']);\n\t\t\t\t$this->_redirect('checkout/cart');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$orderDetails = $orderData['data'];\t\t\n\t\t\n\t\t\n\t\tif($orderDetails){\t\t\n\t\t\t$email = $orderDetails['customer']['email'];\n\t\t\t$mobile = $orderDetails['customer']['mobilePhoneNumber'];\n\t\t\t$firstName = $orderDetails['customer']['deliveryAddress']['firstName'];\n\t\t\t$lastName = $orderDetails['customer']['deliveryAddress']['lastName'];\n\t\t\t\n\t\t\t\n\t\t\t$store = Mage::app()->getStore();\n\t\t\t$website = Mage::app()->getWebsite();\n\t\t\t$customer = Mage::getModel('customer/customer')->setWebsiteId($website->getId())->loadByEmail($email);\n\t\t\t\t// if the customer is not already registered\n\t\t\t\tif (!$customer->getId()) {\n\t\t\t\t\t$customer = Mage::getModel('customer/customer');\t\t\t\n\t\t\t\t\t$customer->setWebsiteId($website->getId())\n\t\t\t\t\t\t\t ->setStore($store)\n\t\t\t\t\t\t\t ->setFirstname($firstName)\n\t\t\t\t\t\t\t ->setLastname($lastName)\n\t\t\t\t\t\t\t ->setEmail($email); \n\t\t\t\t\ttry {\n\t\t\t\t\t \n\t\t\t\t\t\t$password = $customer->generatePassword(); \n\t\t\t\t\t\t$customer->setPassword($password); \n\t\t\t\t\t\t// set the customer as confirmed\n\t\t\t\t\t\t$customer->setForceConfirmed(true); \n\t\t\t\t\t\t// save customer\n\t\t\t\t\t\t$customer->save(); \n\t\t\t\t\t\t$customer->setConfirmation(null);\n\t\t\t\t\t\t$customer->save();\n\t\t\t\t\t\t\n\t\t\t\t\t\t// set customer address\n\t\t\t\t\t\t$customerId = $customer->getId(); \n\t\t\t\t\t\t$customAddress = Mage::getModel('customer/address'); \n\t\t\t\t\t\t$customAddress->setData($billingAddress)\n\t\t\t\t\t\t\t\t\t ->setCustomerId($customerId)\n\t\t\t\t\t\t\t\t\t ->setIsDefaultBilling('1')\n\t\t\t\t\t\t\t\t\t ->setIsDefaultShipping('1')\n\t\t\t\t\t\t\t\t\t ->setSaveInAddressBook('1');\n\t\t\t\t\t\t\n\t\t\t\t\t\t// save customer address\n\t\t\t\t\t\t$customAddress->save();\n\t\t\t\t\t\t// send new account email to customer \n\t\t\t\t\t\t\n\t\t\t\t\t\t$storeId = $customer->getSendemailStoreId();\n\t\t\t\t\t\t$customer->sendNewAccountEmail('registered', '', $storeId);\n\t\t\t\t\t\t\n\t\t\t\t\t\tMage::log('Customer with email '.$email.' is successfully created.', null, $logFileName);\n\t\t\t\t\t\t\n\t\t\t\t\t} catch (Mage_Core_Exception $e) {\t\t\t\t\t\t\n\t\t\t\t\t\tMage::log('Cannot add customer for '.$e->getMessage(), null, $logFileName);\n\t\t\t\t\t} catch (Exception $e) {\n\t\t\t\t\t\tMage::log('Cannot add customer for '.$email, null, $logFileName);\n\t\t\t\t\t} \n\t\t\t\t}\n\t\t\t\t\n\t\t\t// Assign Customer To Sales Order Quote\n\t\t\t$quote->assignCustomer($customer);\n\t\t\t\n\t\t\tif($orderDetails['customer']['deliveryAddress']['country'] == 'Sverige'){\t$scountry_id = \"SE\";\t}\n\t\t\tif($orderDetails['customer']['billingAddress']['country'] == 'Sverige'){ $bcountry_id = \"SE\";\t}\n\t\t\t\n\t\t\t$billingAddress = array(\n\t\t\t\t'customer_address_id' => '',\n\t\t\t\t'prefix' => '',\n\t\t\t\t'firstname' => $firstName,\n\t\t\t\t'middlename' => '',\n\t\t\t\t'lastname' => $lastName,\n\t\t\t\t'suffix' => '',\n\t\t\t\t'company' => $orderDetails['customer']['billingAddress']['coAddress'], \n\t\t\t\t'street' => array(\n\t\t\t\t\t '0' => $orderDetails['customer']['billingAddress']['address'], // compulsory\n\t\t\t\t\t '1' => $orderDetails['customer']['billingAddress']['address2'] // optional\n\t\t\t\t ),\n\t\t\t\t'city' => $orderDetails['customer']['billingAddress']['city'],\n\t\t\t\t'country_id' => $scountry_id, // two letters country code\n\t\t\t\t'region' => '', // can be empty '' if no region\n\t\t\t\t'region_id' => '', // can be empty '' if no region_id\n\t\t\t\t'postcode' => $orderDetails['customer']['billingAddress']['postalCode'],\n\t\t\t\t'telephone' => $mobile,\n\t\t\t\t'fax' => '',\n\t\t\t\t'save_in_address_book' => 1\n\t\t\t);\n\t\t\n\t\t\t$shippingAddress = array(\n\t\t\t\t'customer_address_id' => '',\n\t\t\t\t'prefix' => '',\n\t\t\t\t'firstname' => $firstName,\n\t\t\t\t'middlename' => '',\n\t\t\t\t'lastname' => $lastName,\n\t\t\t\t'suffix' => '',\n\t\t\t\t'company' => $orderDetails['customer']['deliveryAddress']['coAddress'], \n\t\t\t\t'street' => array(\n\t\t\t\t\t '0' => $orderDetails['customer']['deliveryAddress']['address'], // compulsory\n\t\t\t\t\t '1' => $orderDetails['customer']['deliveryAddress']['address2'] // optional\n\t\t\t\t ),\n\t\t\t\t'city' => $orderDetails['customer']['deliveryAddress']['city'],\n\t\t\t\t'country_id' => $scountry_id, // two letters country code\n\t\t\t\t'region' => '', // can be empty '' if no region\n\t\t\t\t'region_id' => '', // can be empty '' if no region_id\n\t\t\t\t'postcode' => $orderDetails['customer']['deliveryAddress']['postalCode'],\n\t\t\t\t'telephone' => $mobile,\n\t\t\t\t'fax' => '',\n\t\t\t\t'save_in_address_book' => 1\n\t\t\t);\n\t\t\n\t\t\n\t\t\t// Add billing address to quote\n\t\t\t$billingAddressData = $quote->getBillingAddress()->addData($billingAddress);\n\t\t \n\t\t\t// Add shipping address to quote\n\t\t\t$shippingAddressData = $quote->getShippingAddress()->addData($shippingAddress);\n\t\t\t\n\t\t\t//check for selected shipping method\n\t\t\t$shippingMethod = $session->getSelectedShippingmethod();\n\t\t\tif(empty($shippingMethod)){\n\t\t\t\t$allShippingData = Mage::getModel('collectorbank/config')->getActiveShppingMethods();\n\t\t\t\t$orderItems = $orderDetails['order']['items'];\n\t\t\t\tforeach($orderItems as $oitem){\n\t\t\t\t\t//echo \"<pre>\";print_r($oitem);\n\t\t\t\t\tif(in_array($oitem['id'], $allShippingData)) {\n\t\t\t\t\t\t$shippingMethod = $oitem['id'];\t\t\t\t\t\t\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Collect shipping rates on quote shipping address data\n\t\t\t$shippingAddressData->setCollectShippingRates(true)->collectShippingRates();\n\n\t\t\t// Set shipping and payment method on quote shipping address data\n\t\t\t$shippingAddressData->setShippingMethod($shippingMethod);\t\t\t\n\t\t\t\n\t\t\t//$paymentMethod = 'collectorpay';\n\t\t\t$paymentMethod = 'collectorbank_invoice';\n\t\t\t// Set shipping and payment method on quote shipping address data\n\t\t\t$shippingAddressData->setPaymentMethod($paymentMethod);\t\t\t\n\t\t\t\n\t\t\t$colpayment_method = $orderDetails['purchase']['paymentMethod'];\n\t\t\t$colpayment_details = json_encode($orderDetails['purchase']);\n\t\t\t\n\t\t\t// Set payment method for the quote\n\t\t\t$quote->getPayment()->importData(array('method' => $paymentMethod,'coll_payment_method' => $colpayment_method,'coll_payment_details' => $colpayment_details));\n\t\t\t\n\n\t\t\ttry{\n\t\t\t\t$orderReservedId = $session->getReference();\n\t\t\t\t$quote->setResponse($orderDetails);\n\t\t\t\t$quote->setCollCustomerType($orderDetails['customerType']);\n\t\t\t\t$quote->setCollBusinessCustomer($orderDetails['businessCustomer']);\n\t\t\t\t$quote->setCollStatus($orderDetails['status']);\n\t\t\t\t$quote->setCollPurchaseIdentifier($orderDetails['purchase']['purchaseIdentifier']);\n\t\t\t\t$quote->setCollTotalAmount($orderDetails['order']['totalAmount']);\n\t\t\t\tif($orderDetails['reference'] == $orderReservedId){\n\t\t\t\t\t$quote->setReservedOrderId($orderReservedId);\n\t\t\t\t} else {\n\t\t\t\t\t$quote->setReservedOrderId($orderDetails['reference']);\n\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t \t// Collect totals of the quote\n\t\t\t\t$quote->collectTotals();\n\t\t\t\t$quote->save();\n\t\t\t\t\n\t\t\t\t$service = Mage::getModel('sales/service_quote', $quote);\n\t\t\t\t$service->submitAll();\n\t\t\t\t$incrementId = $service->getOrder()->getRealOrderId();\n\t\t\t\t\n\t\t\t\tif($session->getIsSubscribed() == 1){\n\t\t\t\t\tMage::getModel('newsletter/subscriber')->subscribe($email);\n\t\t\t\t} \t\t\t\t\n\t\t\t\t\n\t\t\t\t$session->setLastQuoteId($quote->getId())\n\t\t\t\t\t->setLastSuccessQuoteId($quote->getId())\n\t\t\t\t\t->clearHelperData();\n\t\t\t\t\t\n\t\t\t\tMage::getSingleton('checkout/session')->clear();\n\t\t\t\tMage::getSingleton('checkout/cart')->truncate()->save();\n\t\t\t\t\n\t\t\t\t$session->unsPrivateId();\n\t\t\t\t$session->unsReference();\n\t\t\t\t\n\t\t\t\t // Log order created message\n\t\t\t\tMage::log('Order created with increment id: '.$incrementId, null, $logFileName);\t\t\t\t\t\t\n\t\t\t\t$result['success'] = true;\n\t\t\t\t$result['error'] = false;\n\t\t\t\t\n\t\t\t\t$order = Mage::getModel('sales/order')->loadByIncrementId($incrementId);\n\t\t\t\t\n\t\t\t\t$this->loadLayout();\n\t\t\t\t$block = Mage::app()->getLayout()->getBlock('collectorbank_success');\n\t\t\t\tif ($block){//check if block actually exists\t\t\t\t\t\n\t\t\t\t\t\tif ($order->getId()) {\n\t\t\t\t\t\t\t$orderId = $order->getId();\n\t\t\t\t\t\t\t$isVisible = !in_array($order->getState(),Mage::getSingleton('sales/order_config')->getInvisibleOnFrontStates());\n\t\t\t\t\t\t\t$block->setOrderId($incrementId);\n\t\t\t\t\t\t\t$block->setIsOrderVisible($isVisible);\n\t\t\t\t\t\t\t$block->setViewOrderId($block->getUrl('sales/order/view/', array('order_id' => $orderId)));\n\t\t\t\t\t\t\t$block->setViewOrderUrl($block->getUrl('sales/order/view/', array('order_id' => $orderId)));\n\t\t\t\t\t\t\t$block->setPrintUrl($block->getUrl('sales/order/print', array('order_id'=> $orderId)));\n\t\t\t\t\t\t\t$block->setCanPrintOrder($isVisible);\n\t\t\t\t\t\t\t$block->setCanViewOrder(Mage::getSingleton('customer/session')->isLoggedIn() && $isVisible);\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->renderLayout();\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t} catch (Mage_Core_Exception $e) {\n\t\t\t\t\t$result['success'] = false;\n\t\t\t\t\t$result['error'] = true;\n\t\t\t\t\t$result['error_messages'] = $e->getMessage(); \n\t\t\t\t\tMage::log('Order creation is failed for invoice no '.$orderDetails['purchase']['purchaseIdentifier'] .\"Error is --> \".Mage::helper('core')->jsonEncode($result), null, $logFileName);\t\t\n\t\t\t\t\t//Mage::app()->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));\n\t\t\t\t\t$this->loadLayout();\n\t\t\t\t\t$block = Mage::app()->getLayout()->getBlock('collectorbank_success');\n\t\t\t\t\tif ($block){\n\t\t\t\t\t\tif($orderDetails['purchase']['purchaseIdentifier']){\n\t\t\t\t\t\t\t$block->setInvoiceNo($orderDetails['purchase']['purchaseIdentifier']);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$block->setCode(222);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->renderLayout();\t\t\t\t\t\n\t\t\t} \t\t\t\n\t\t} \n\t\t\n\t\t} else {\n\t\t\tMage::log('Order is already generated.', null, $logFileName);\t\t\n\t\t\t$this->loadLayout(); \n\t\t\t$block = Mage::app()->getLayout()->getBlock('collectorbank_success');\n\t\t\tif ($block){\n\t\t\t\t$block->setCode(111);\n\t\t\t}\n\t\t\t$this->renderLayout();\n\t\t}\n\n\t\tMage::log('----------------- END ------------------------------- ', null, $logFileName);\t\t\n\t}", "protected function _initShipment() {\n $shipment = false;\n /**\n * Get params value.\n */\n $shipmentId = $this->getRequest ()->getParam ( 'shipment_id' );\n /**\n * Get order id\n * @var int\n */\n $orderId = $this->getRequest ()->getParam ( 'order_id' );\n if ($shipmentId) {\n /**\n * load shipment details using shipment id\n * @var unknown\n */\n $shipment = Mage::getModel ( 'sales/order_shipment' )->load ( $shipmentId );\n } elseif ($orderId) {\n $order = Mage::getModel ( 'sales/order' )->load ( $orderId );\n\n /**\n * Check order existing\n */\n if (! $order->getId ()) {\n $this->_getSession ()->addError ( $this->__ ( 'The order no longer exists.' ) );\n return false;\n }\n\n $savedQtys = $this->_getItemQtys ();\n\n $shipment = Mage::getModel ( 'sales/service_order', $order )->prepareShipment ( $savedQtys );\n\n $tracks = $this->getRequest ()->getPost ( 'tracking' );\n if ($tracks) {\n /**\n * Get tacking details.\n *\n * If track number is empty throw error message.\n */\n foreach ( $tracks as $data ) {\n /**\n * Check whether tracking number empty or not\n */\n if (empty ( $data ['number'] )) {\n Mage::throwException ( $this->__ ( 'Tracking number cannot be empty.' ) );\n }\n $track = Mage::getModel ( 'sales/order_shipment_track' )->addData ( $data );\n $shipment->addTrack ( $track );\n }\n }\n }\n Mage::register ( 'current_shipment', $shipment );\n return $shipment;\n }", "public function doRequest() {\n $this->request = $this->prepareRequest();\n \n $url = $this->conf->getEndPoint($this->orderType);\n $request = new WebServiceSoap\\SveaDoRequest($url);\n\n $svea_req = $request->GetAddresses($this->request);\n\n $response = new \\SveaResponse($svea_req,\"\");\n return $response->response;\n }", "public function sendOrder(Mage_Sales_Model_Order $order)\n {\n try{\n\t\t\t$this->_eventType = 'placeOrder';\n\t\t\t$amount\t\t= number_format($order->getGrandTotal(),2);\n\t\t\t$samount\t= number_format($order->getSubtotal(),2);\n\t\t\t$tax \t\t= number_format($order->getBaseTaxAmount(),2);\n\t\t\t$shipping \t= number_format($order->getBaseShippingAmount(),2);\n\t\t\t$discounts \t= number_format($order->getDiscountAmount(),2);\n\t\t\t$shippingAddressData \t= $order->getShippingAddress()->getData();\n\t\t\t$billingAddressData \t= $order->getBillingAddress()->getData();\n\t\t\t$shippingMethod \t \t= $order->_data[\"shipping_description\"];\n\t\t\t$paymentMethod \t \t \t= $order->getPayment()->getMethodInstance()->getTitle();\n\t\t\t$customerId \t\t\t= $order->getCustomerId();\n\t\t\t$websiteId \t\t\t\t= 1;\n\t\t\t$balanceModel \t\t\t= Mage::getModel('enterprise_customerbalance/balance')\n\t\t \t\t\t\t \t->setCustomerId($customerId)\n\t\t \t\t\t\t \t->setWebsiteId($websiteId)\n\t\t \t\t\t\t\t->loadByCustomer();\t\n\t\t $storeCredit\t\t\t= ($balanceModel->getId())? number_format($balanceModel->getAmount(),2) :'0' ; \t\t\t\t\t\t\n $data = array(\n 'email' => $order->getCustomerEmail(),\n 'items' => $this->_getItems($order->getAllVisibleItems()),\n 'adjustments' => $this->_getAdjustments($order),\n 'message_id' => $this->getMessageId(),\n 'send_template' => 'Purchase Receipt',\n 'tenders' => $this->_getTenders($order),\n 'vars'\t=> array ( 'order#'=> $order->getIncrementId(),\n\t\t\t\t\t\t\t\t\t'subtotal'=> $samount,\n\t\t\t\t\t\t\t\t\t'shipping_and_handling'=> $shipping,\n\t\t\t\t\t\t\t\t\t'sale_tax'=> $tax,\n\t\t\t\t\t\t\t\t\t'billing_address'=> $shippingAddressData,\n\t\t\t\t\t\t\t\t\t'shipping_address'=> $billingAddressData,\n\t\t\t\t\t\t\t\t\t'shipping_method'=> $shippingMethod,\n\t\t\t\t\t\t\t\t\t'payment_method'=> $paymentMethod,\n\t\t\t\t\t\t\t\t\t'store_credit' => $storeCredit\n\t\t\t ),\n \t);\n /**\n * Send order data to purchase API\n */\n $responsePurchase = $this->apiPost('purchase', $data);\n\t\t\t\n\t\t\t/****Update product sku in following items for price alert****/\n $productSku = array();\n\t\t\tforeach ($order->getAllVisibleItems() as $item) {\n\t\t\t\tif($item->getProductType() == 'configurable') {\n\t\t\t\t\t$productSku[] = $item->getProduct()->getData('sku');\n\t\t\t\t}\n\t\t\t}\n $sailthru_userdata = $this->apiGet('user', array('id' => $order->getCustomerEmail()));\n\t\t\tif(isset($sailthru_userdata['vars']['following_items']) && $productSku) {\n\t\t\t\t$sailthru_followingItems = $sailthru_userdata['vars']['following_items'];\n\t\t\t\t$sailthru_followingItems = array_values($sailthru_followingItems);\n\t\t\t\t$sailthru_followingItems = array_diff($sailthru_followingItems,$productSku);\n\t\t\t\t$sailthru_followingItems = array_unique($sailthru_followingItems);\n\t\t\t\t$data = array(\n\t\t\t\t\t\t\"id\" => $order->getCustomerEmail(),\n\t\t\t\t\t\t\"vars\" => array(\"following_items\" => $sailthru_followingItems)\n\t\t\t\t\t\t);\n\t\t\t\t$response = $this->apiPost('user', $data);\n\t\t\t}\n /*************************************************/\n\t\t\t\n /**\n * Send customer data to user API\n */\n //$responseUser = Mage::getModel('sailthruemail/client_user')->sendCustomerData($customer);\n }catch (Exception $e) {\n Mage::logException($e);\n return false;\n }\n }", "public function orderAjaxHandler(Request $request)\n {\n $inputData = $request->input();\n $method = $inputData['method'];\n $objCurl = CurlRequestHandler::getInstance();\n $url = Session::get(\"domainname\") . env(\"API_URL\") . '/' . \"order-ajax-handler\";\n $mytoken = env(\"API_TOKEN\");\n switch ($method) {\n\n case 'add-to-cart':\n $user_id = '';\n if (Session::has('fs_user')) {\n $user_id = Session::get('fs_user')['id'];\n } else if (Session::has('fs_buyer')) {//todo if this is done then user and buyer cannot operate in same browser window\n $user_id = Session::get('fs_buyer')['id'];\n }\n $productId = $request->input('prodId');\n $quantity = $request->input('quantity');\n $combinationId = isset($inputData['selected']) ? implode(\",\", $request->input('selected')) : 0;\n $cartBind['quantity'] = $quantity;\n $cartBind['product_id'] = $productId . '-' . $combinationId;\n $cartBind['for_user_id'] = $user_id;\n $data = array('api_token' => $mytoken, 'id' => $user_id, 'mainCartData' => json_encode([$cartBind]), 'method' => 'insert-order');\n $curlResponse = $objCurl->curlUsingPost($url, $data);\n if ($curlResponse->code == 200) {\n echo json_encode(['status' => 'success', 'msg' => $curlResponse->message]);\n } else {\n echo json_encode(['status' => 'error', 'msg' => 'Something went wrong, please reload the page and try again.']);\n }\n break;\n\n case 'cartDetails':\n// if (isset($_COOKIE['cart_cookie_name']) && !empty(json_decode($_COOKIE['cart_cookie_name']))) {\n// $cartCookie = json_decode($_COOKIE['cart_cookie_name']);\n// foreach ($cartCookie as $key => $value) {\n// $combinationId = implode(\"#\", array_filter(array_unique(explode(\"@\", $value->combination_id))));\n// $productId = $value->prodId;\n// $cartBind[$key]['quantity'] = $value->quantity;\n// $cartBind[$key]['product_id'] = $productId . '-' . $value->combination_id;\n//\n// }\n// $finalCartInfo = array_map(function ($values) {\n// $temp['quantity'] = $values['quantity'];\n// $temp['product_id'] = $values['product_id'];\n// return $temp;\n//\n// }, $cartBind);\n//\n// $dataForCart = array('api_token' => $mytoken, 'cookieCartData' => json_encode($finalCartInfo), 'method' => 'user-cookie-cart-details');\n// $curlResponseForCookie = $objCurl->curlUsingPost($url, $dataForCart);\n//// print_a($curlResponseForCookie);\n// if ($curlResponseForCookie->code == 200) {\n// echo json_encode($curlResponseForCookie->data);\n// }\n// } else {\n if (Session::has('fs_user')) {\n $user_id = Session::get('fs_user')['id'];\n } else if (Session::has('fs_buyer')) {//todo if this is done then user and buyer cannot operate in same browser window\n $user_id = Session::get('fs_buyer')['id'];\n }\n $data = array('api_token' => $mytoken, 'id' => $user_id, 'method' => 'user-cart-details');\n $curlResponse = $objCurl->curlUsingPost($url, $data);\n if ($curlResponse->code == 200) {\n echo json_encode($curlResponse->data);\n// }\n }\n break;\n case 'removerCartOrder':\n $user_id = '';\n if (Session::has('fs_user')) {\n $user_id = Session::get('fs_buyer')['id'];\n } else if (Session::has('fs_user')) {\n $user_id = Session::get('fs_buyer')['id'];\n }\n $order_id = $request->input('orderId');\n $data = array('api_token' => $mytoken, 'id' => $user_id, 'order_id' => $order_id, 'method' => 'remove-cart-detail');\n $curlResponse = $objCurl->curlUsingPost($url, $data);\n if ($curlResponse->code == 200) {\n echo json_encode(['status' => 'success', 'msg' => 'Removed From Cart']);\n } else {\n echo json_encode(['status' => 'error', 'msg' => 'Something went wrong, please reload the page and try again.']);\n }\n break;\n default:\n break;\n }\n\n }", "function _processSale() {\n\t\t$this->autoload();\t\t\n\t\tJbPaymentxxsourcexxLib::write_log('xxsourcexx.txt', 'IPN: '.json_encode($_REQUEST));\n\t\t\n\t\t$input = jfactory::getApplication()->input;\t\t\n\t\t$status = $input->getString('xxsourcexx_transactionStatus');\n\t\t\n\t\t$success_status = array('CO','PA');\n\t\t\n\t\tif(in_array($status, $success_status)){\n\t\t\t$order_number = $input->getString('_itemId');\n\t\t\t$order_jb = JbPaymentxxsourcexxLib::getOrder($order_number);\n\t\t\t$order_jb->pay_status = 'SUCCESS';\n\t\t\t$order_jb->order_status = 'CONFIRMED';\n\t\t\t$order_jb->tx_id = $tnxref;\n\t\t\t$order_jb->store ();\n\t\t\treturn $order_jb;\t\n\t\t}else{\n\t\t\texit;\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}", "public function sendOrder(Order $order)\r\n {\r\n $errors = [];\r\n $validOrder = true;\r\n $cpfCnpj = false;\r\n $shippingAddress = $order->getShippingAddress();\r\n if (!$shippingAddress) {\r\n $shippingAddress = $order->getBillingAddress();\r\n }\r\n\r\n if (!$order->getCustomerIsGuest()) {\r\n try {\r\n $customer = $this->customerRepository->getById($order->getCustomerId());\r\n $cpfCnpj = $customer->getData($this->configs->getCpfCnpjField());\r\n } catch (NoSuchEntityException $nse) {\r\n $errors[] = __('Customer with id \"' . $order->getCustomerId() . '\" doesn\\'t exists');\r\n $validOrder = false;\r\n } catch (LocalizedException $le) {\r\n $errors[] = __('Unable to retrieve customer from order ID: \"' . $order->getId(). '\"');\r\n $validOrder = false;\r\n }\r\n }\r\n\r\n if (!$cpfCnpj) {\r\n $cpfCnpj = $order->getCustomerTaxvat();\r\n }\r\n\r\n if ($validOrder) {\r\n $data = [\r\n 'customer' => [\r\n 'name' => $this->getCustomerFullName($order),\r\n 'telephone' => $order->getBillingAddress()->getTelephone()\r\n ],\r\n 'shipping_address' => [\r\n 'street' => implode(\" \", $shippingAddress->getStreet()),\r\n 'number' => null, // TODO: non-native field on magento, which one use?\r\n 'additional' => null, // TODO: non-native field on magento, which one use?\r\n 'neighborhood' => null, // TODO: non-native field on magento, which one use?\r\n 'city' => $shippingAddress->getCity(),\r\n 'city_ibge_code'=> null, // TODO: non-native field on magento, which one use?\r\n 'uf' => $shippingAddress->getRegionCode(),\r\n 'country' => $shippingAddress->getCountryId()\r\n ],\r\n 'items' => [],\r\n 'shipping_method' => $order->getShippingMethod(),\r\n 'payment_method' => $order->getPayment()->getMethod(),\r\n 'payment_installments' => $order->getPayment()->getInstallments(),\r\n 'subtotal' => (float) $order->getSubtotal(),\r\n 'shipping_amount' => (float) $order->getShippingAmount(),\r\n 'discount' => (float) $order->getDiscountAmount(),\r\n 'total' => (float) $order->getGrandTotal()\r\n ];\r\n\r\n foreach ($order->getAllVisibleItems() as $item) {\r\n $data['items'][] = [\r\n 'sku' => $item->getSku(),\r\n 'name' => $item->getName(),\r\n 'price' => $item->getPrice(),\r\n 'qty' => $item->getQtyOrdered()\r\n ];\r\n }\r\n\r\n if ($order->getCustomerId()) {\r\n $data['customer']['dob'] = $this->getFormmatedDob($order->getCustomer()->getDob());\r\n }\r\n\r\n if ($this->identifierValidator->isCPF($cpfCnpj)) {\r\n $data['customer']['cpf_cnpj'] = $cpfCnpj;\r\n } else if ($this->identifierValidator->isCNPJ($cpfCnpj)) {\r\n $data['customer']['cpf_cnpj'] = $cpfCnpj;\r\n $data['customer']['cnpj'] = $cpfCnpj;\r\n\r\n $razaoSocialFieldName = $this->configs->getRazaoSocialFieldName();\r\n $nomeFantasiaFieldName = $this->configs->getNomeFantasiaFieldName();\r\n $ieFieldName = $this->configs->getInscricaoEstadualFieldName();\r\n\r\n $data['customer']['razao_social'] = $razaoSocialFieldName ? $order->getData($razaoSocialFieldName) : null;\r\n $data['customer']['nome_fantasia'] = $nomeFantasiaFieldName ? $order->getData($nomeFantasiaFieldName) : null;\r\n $data['customer']['ie'] = $ieFieldName ? $order->getData($ieFieldName) : null;\r\n\r\n if (!$data['customer']['razao_social']) {\r\n $errors[] = __('\"Razao social\" is a required field for CNPJ customers. Order: ' . $order->getId());\r\n $validOrder = false;\r\n }\r\n\r\n if (!$data['customer']['nome_fantasia']) {\r\n $errors[] = __('\"Nome Fantasia\" is a required field for CNPJ customers. Order: ' . $order->getId());\r\n $validOrder = false;\r\n }\r\n } else {\r\n $validOrder = false;\r\n $errors[] = __('Invalid. Sending \"' . $cpfCnpj . '\" as CPF/CNPJ for order ' . $order->getId());\r\n }\r\n }\r\n\r\n if ($validOrder) {\r\n if ($this->_send($data)) {\r\n $this->logger->log(Logger::INFO, '[SUCCESS] Order withd id \"' . $order->getId() . '\" sent to the endpoint.');\r\n } else {\r\n $this->logger->log(Logger::INFO, '[ERROR] Faild to send Order withd id \"' . $order->getId() . '\".');\r\n }\r\n } else {\r\n $this->logger->logErrors($errors);\r\n }\r\n }", "public function shippingOrder(Request $request)\n {\n $order = Order::with(['user'])->find($request->order_id);\n //UPDATE DATA ORDER DENGAN MEMASUKKAN NOMOR RESI DAN MENGUBAH STATUS MENJADI DIKIRIM\n $order->update(['tracking_number' => $request->tracking_number, 'status' => 3]);\n //KIRIM EMAIL KE PELANGGAN TERKAIT\n Mail::to($order->user->email)->send(new OrderMail($order));\n //REDIRECT KEMBALI\n return redirect()->back();\n }", "public function ajaxgenerateamazonorderAction(){\r\n global $user;\r\n if(!$user->uid){\r\n \t\tgotoUrl('');\r\n \t}\r\n \t$amazon_orders = $this->_orderInstance->getAmazonOrders();\r\n \t$amazonStockInstance = Amazonstock_Model::getInstance();\r\n \t$siteInstance = Site_Model::getInstance();\r\n \t$areaInstance = Area_Model::getInstance();\r\n \t$orderRecords = array();\r\n \t$orderRecords[] = array('MerchantFulfillmentOrderID','DisplayableOrderID','DisplayableOrderDate','MerchantSKU','Quantity',\r\n \t\t\t\t\t\t\t'MerchantFulfillmentOrderItemID','GiftMessage','DisplayableComment','PerUnitDeclaredValue',\r\n \t\t\t\t\t\t\t'DisplayableOrderComment','DeliverySLA','AddressName','AddressFieldOne','AddressFieldTwo','AddressFieldThree',\r\n \t\t\t\t\t\t\t'AddressCity','AddressCountryCode','AddressStateOrRegion','AddressPostalCode','AddressPhoneNumber','NotificationEmail');\r\n \tforeach ($amazon_orders as $oid=>$amazon_order){\r\n \t\tforeach($amazon_order->items as $orderItem){\r\n\t \t\t$orderRecord = array();\r\n\t \t\t$orderRecord[] = $amazon_order->number;\r\n\t \t\t$orderRecord[] = $amazon_order->number;\r\n\t \t\t$orderRecord[] = date('Y-m-d\\Th:i:s', TIMESTAMP);\r\n\t \t\t$amazon_sku = $amazonStockInstance->composeSKU($orderItem->p_sn, $orderItem->data);\r\n\t \t\t$orderRecord[] = $amazon_sku;\r\n\t \t\t$orderRecord[] = $orderItem->qty;\r\n\t \t\t$orderRecord[] = $amazon_sku . '-'.strval($orderItem->oiid);\r\n\t \t\t$orderRecord[] = '';\r\n\t \t\t$orderRecord[] = '';\r\n\t \t\t$orderRecord[] = '';\r\n\t \t\t$siteInfo = $siteInstance->getSite($orderItem->sid);\r\n\t \t\tif($siteInfo == false){\r\n\t \t\t\t$siteInfo = new stdClass();\r\n\t \t\t\t$siteInfo->name = 'Lingeriemore.com';\r\n\t \t\t}\r\n\t \t\t$orderRecord[] = 'Thank you for ordering from '.$siteInfo->name .'!';\r\n\t \t\t$orderRecord[] = 'Standard';\r\n\t \t\t$orderRecord[] = $amazon_order->delivery_first_name . ' '.$amazon_order->delivery_last_name;\r\n\t \t\t$orderRecord[] = $amazon_order->delivery_address;\r\n\t \t\t$orderRecord[] = '';\r\n\t \t\t$orderRecord[] = '';\r\n\t \t\t$orderRecord[] = $amazon_order->delivery_city;\r\n\t \t\t$orderRecord[] = $areaInstance->getAreaCode($amazon_order->delivery_country);\r\n\t \t\t$orderRecord[] = $areaInstance->getAreaCode($amazon_order->delivery_province);\r\n\t \t\t$orderRecord[] = $amazon_order->delivery_postcode;\r\n\t \t\t$orderRecord[] = $amazon_order->delivery_mobile;\r\n\t \t\t$orderRecord[] = '[email protected]';\r\n\t \t\t\r\n\t \t\t$orderRecords[] = $orderRecord;\r\n \t\t}\r\n \t}\r\n \t//generate csv file.\r\n $filename = 'amazon_order-'.strval(TIMESTAMP).'.txt';\r\n download_send_headers($filename);\r\n $outputBuffer = fopen(\"php://output\", 'w');\r\n foreach($orderRecords as $orderRecord) {\r\n \tfwrite($outputBuffer, implode(\"\\t\", $orderRecord) .\"\\r\\n\");\r\n }\r\n fclose($outputBuffer);\r\n }", "public function sendToAll2($orderId, $trype, $suppliers, $delivery, $orderdata = null, $cart_id = null, $user_id = null) {\n $id_of_the_order = $orderId;\n $products_model = $this->loadModel('Products');\n $suppliers_model = $this->loadModel('Suppliers');\n $delivery_model = $this->loadModel('Delivery');\n $order_products_model = $this->loadModel('OrderProducts');\n $order_model = $this->loadModel('Orders');\n $order_products = $order_products_model->find('all', ['conditions' => ['order_id' => $orderId]])->toArray(); //for web, mobile\n $orderdata['product_name'] = array_map(create_function('$o', 'return $o->product_id;'), $order_products); //not name, ids\n $orderdata['product_supplier'] = array_map(create_function('$o', 'return $o->supplier_id;'), $order_products);\n $orderdata['product_quantity'] = array_map(create_function('$o', 'return $o->product_quantity;'), $order_products);\n\n /* print '<pre>';\n print_r($orderdata);\n echo '<br>';\n print_r($orderdata);\n echo '<br>';\n\n echo '<br>';\n die(); */\n\n\n //$countedval = $this->processdata ( $orderdata );//for erp\n $countedval = $this->processdata($orderdata); //web and mobile\n\n $sub_total = $countedval ['subTotal'];\n $total = $countedval ['total'];\n $tax = $countedval ['tax'];\n $discount = $countedval ['discount'];\n\n\n $total_string = \"<br><table border='1'><tr>\" . \"<th>Sub Total</th>\" . \"<td>\" . $sub_total . \"</td></tr>\" . \"<tr><th>Tax</th>\" . \"<td>\" . $tax . \"</td></tr>\" . \"<tr><th>Discount</th>\" . \"<td>\" . $discount . \"</td></tr>\" . \"<tr><th>Total</th>\" . \"<td>\" . $total . \"</td></tr>\" . \"</tr></table><br><hr>\";\n\n $orderId = \"<h4>Order ID: \" . $orderId . \"</h4>\";\n $sup_string = \"<hr><br><table border='1'>\" . \"<tr>\" .\n /* \"<th>#</th>\". */\n \"<th>Supplier Id</th>\" . \"<th>Supplier name</th>\" . \"<th>Address</th>\" . \"<th>City</th>\" .\n /* \"<th>Email</th>\". */\n \"<th>Contact No.</th>\" . \"<th>Mobile No.</th>\" . \"<th>Product Id</th>\" . \"<th>Product name</th>\" . \"<th>Product price</th>\" . \"<th>Package</th>\" . \"<th>Quantity</th>\" . \"<th>Ammount</th>\" . \"</tr>\";\n $sup_string_end = \"</table>\";\n $row = \"\";\n $supliers_email = [];\n $delivery_mail = [];\n $delivery_mail_string = $orderId . $sup_string;\n\n foreach ($suppliers as $suplier) {\n $count = 1;\n $sup_email = \"\";\n for ($i = 0; $i < sizeof($orderdata ['product_name']); $i ++) {\n if ($suplier == $orderdata ['product_supplier'] [$i]) {\n $product_details = $products_model->get($orderdata ['product_name'] [$i], [\n 'contain' => [\n 'packageType'\n ]\n ]);\n $quntity = $orderdata ['product_quantity'] [$i];\n $supplier_details = $suppliers_model->get($orderdata ['product_supplier'] [$i], [\n 'contain' => 'city'\n ]);\n\n $row .= \"<tr style='min-height:35px'>\";\n $colspan = 1;\n if ($count == 1) {\n\n /* $row.=\"<td rowspan='2'>\".($i+1).\"</td>\"; */\n\n $row .= \"<td rowspan='\" . $colspan . \"'>\" . $supplier_details->id . \"</td>\"; // price for the orderd quantity\n $row .= \"<td rowspan='\" . $colspan . \"'>\" . $supplier_details->firstName . \" \" . $supplier_details->lastName . \"</td>\"; // name\n $row .= \"<td rowspan='\" . $colspan . \"'>\" . $supplier_details->address . \"</td>\"; // address\n $row .= \"<td rowspan='\" . $colspan . \"'>\" . $supplier_details->cid->cname . \"</td>\"; // city\n /* $row.=\"<td>\".$supplier_details->email.\"</td>\";//email */\n $row .= \"<td rowspan='\" . $colspan . \"'>\" . $supplier_details->contactNo . \"</td>\"; // contact\n $row .= \"<td rowspan='\" . $colspan . \"'>\" . $supplier_details->mobileNo . \"</td>\"; // mobile\n $sup_email = $supplier_details->email;\n } else {\n $row .= \"<td></td><td></td><td></td><td></td><td></td><td></td>\";\n }\n\n $row .= \"<td>\" . $product_details->id . \"</td>\"; // product id\n $row .= \"<td>\" . $product_details->name . \"</td>\"; // name\n $row .= \"<td>\" . $product_details->price . \"</td>\"; // price of a unit\n $row .= \"<td>\" . $product_details->package_type->type . \"</td>\"; // unit\n $row .= \"<td>\" . $quntity . \"</td>\"; // number of unit ordered\n $row .= \"<td>\" . $product_details->price * $quntity . \"</td>\"; // price for the orderd quantity\n\n $row .= \"</tr>\";\n\n $count ++;\n }\n }\n $colspan = $count;\n $delivery_mail_string .= $row;\n $supliers_email [$sup_email] = $orderId . $sup_string . $row . $sup_string_end;\n $row = \"\";\n }\n $delivery_mail_string .= $sup_string_end . $total_string;\n $delivery_mail_addrrss = $delivery_model->get($delivery, [\n 'fields' => [\n 'email'\n ]\n ]);\n // echo $delivery_mail_addrrss['email'];\n // \n $admin_mail_address = Configure::read('admin_email');\n //$customer=$order_model->find('all',['conditions'=>['Orders.id'=>$orderId],'contain'=>['Customers']])->first();\t\t\n //$customer_mail_address=$customer->customers['email'];//\"[email protected]\"\n //$customer_mail_address=\"[email protected]\";\n $order_data = (new OrdersController ())->__getOrderMailData($id_of_the_order);\n\n $user = $this->Cart->Users->get($user_id);\n $customer_mail [$user->username] = $order_data;\n //$customer_mail [$this->Auth->user('username')] = $order_data;\n $admin_mail [$admin_mail_address] = $order_data;\n $delivery_mail [$delivery_mail_addrrss ['email']] = $delivery_mail_string;\n\n\n /*\n * print_r($emails[4]);\n * print_r($emails[3]);\n * echo $delivery_mail_string;\n * die();\n */\n /*\n * print '<pre>';\n *\n * print_r(['del'=>$delivery_mail,'sup'=>$supliers_email]);\n * die();\n */\n\n // return ['del'=>$delivery_mail,'sup'=>$supliers_email];\n /*\n * print_r($supliers_email);\n * print_r($delivery_mail);\n */\n /* \tprint '<pre>';\n print_r($supliers_email);\n echo \"<br>\";\n print_r($delivery_mail);\n echo \"<br>\";\n print_r($admin_mail);echo \"<br>\";\n print_r($customer_mail);\n die(); */\n\n //$this->sendemail('new', $supliers_email, 'sup'); // suppliers email\n $this->sendemail('new', $delivery_mail, 'del'); // delivery email\n $this->sendemail2('new', $admin_mail, 'admin'); // delivery email\n $this->sendemail2('new', $customer_mail, 'cus'); // delivery email\n // die();\n }", "public function sendMail($order, $auth_call, $shipments_type) {\r\n $storeId = $order->getStore()->getId();\r\n $copyTo = Mage::helper('aramex_core')->getEmails(self:: XML_PATH_SHIPMENT_EMAIL_COPY_TO, $storeId);\r\n $copyMethod = Mage::getStoreConfig(self::XML_PATH_SHIPMENT_EMAIL_COPY_METHOD, $storeId);\r\n $templateId = Mage::getStoreConfig(self::XML_PATH_SHIPMENT_EMAIL_TEMPLATE, $storeId);\r\n\r\n if ($order->getCustomerIsGuest()) {\r\n $customerName = $order->getBillingAddress()->getName();\r\n } else {\r\n $customerName = $order->getCustomerName();\r\n }\r\n $shipments_id = $auth_call->Shipments->ProcessedShipment->ID;\r\n $mailer = Mage::getModel('core/email_template_mailer');\r\n\r\n $emailInfo = Mage::getModel('core/email_info');\r\n $emailInfo->addTo($order->getCustomerEmail(), $customerName);\r\n\r\n if ($copyTo && $copyMethod == 'bcc') {\r\n /* Add bcc to customer email */\r\n foreach ($copyTo as $email) {\r\n $emailInfo->addBcc($email);\r\n }\r\n }\r\n $mailer->addEmailInfo($emailInfo);\r\n /* Email copies are sent as separated emails if their copy method is 'copy' */\r\n if ($copyTo && $copyMethod == 'copy') {\r\n foreach ($copyTo as $email) {\r\n $emailInfo = Mage::getModel('core/email_info');\r\n $emailInfo->addTo($email);\r\n $mailer->addEmailInfo($emailInfo);\r\n }\r\n }\r\n $senderName = Mage::getStoreConfig(self::XML_PATH_TRANS_IDENTITY_NAME, $storeId);\r\n $senderEmail = Mage::getStoreConfig(self::XML_PATH_TRANS_IDENTITY_EMAIL, $storeId);\r\n\r\n /* Set all required params and send emails */\r\n $mailer->setSender(array('name' => $senderName, 'email' => $senderEmail));\r\n $mailer->setStoreId($storeId);\r\n $mailer->setTemplateId($templateId);\r\n $mailer->setTemplateParams(array(\r\n 'order' => $order,\r\n 'shipments_id' => $shipments_id,\r\n 'shipments_type' => $shipments_type\r\n )\r\n );\r\n try {\r\n $mailer->send();\r\n } catch (Exception $ex) {\r\n Mage::getSingleton('core/session')\r\n ->addError('Unable to send email.');\r\n }\r\n }", "public function actionCreateshipment()\n\t{\n\t\tif($_POST && isset($_POST['id']))\n\t\t{\n\t\t\t$shop=isset($_POST['shopName'])?$_POST['shopName']:\"NA\";\n\t\t\t$path='shipment/'.$shop.'/'.Data::getKey($_POST['id']).'.log';\n\t\t\ttry\n\t\t\t{\t\n\t\t\t\t//create shipment data\n\t\t\t Data::createLog(\"order shipment in walmart\".PHP_EOL.json_encode($_POST),$path);\n\t\t\t\t$objController=Yii::$app->createController('walmart/walmartorderdetail');\n\t\t\t\t$objController[0]->actionCurlprocessfororder();\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\tData::createLog(\"order shipment error \".json_decode($_POST),$path,'a',true);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tData::createLog(\"order shipment error wrong post\");\n\t\t}\n\t}", "public function email($order, $type) {\r\n\r\n switch ($type) {\r\n case 'shipping_confirmation':\r\n if ($order['status'] == 'shipped' && !empty($order['shipping_tracking_number'])) {\r\n // Send Shipping Confirmation email to customer\r\n $templateId = config('custom.emails.templates.shipping_confirmation');\r\n\r\n if (!empty($order['user_id'])) {\r\n $user = $order->user;\r\n }\r\n\r\n $sub = [\r\n 'customer_name' => !empty($order['user_id']) ? $user['first_name'] : $order['billing_name'],\r\n 'order_number' => $order['order_number'],\r\n 'shipping_carrier' => !empty($order['shipping_carrier']) ? config('custom.checkout.shipping.carriers.' . $order['shipping_carrier'] . '.name') : '',\r\n 'shipping_plan' => !empty($order['shipping_plan']) ? config('custom.checkout.shipping.carriers.' . $order['shipping_carrier'] . '.plans.' . $order['shipping_plan'] . '.plan') : '',\r\n 'tracking_url' => 'https://tools.usps.com/go/TrackConfirmAction?tLabels=' . $order['shipping_tracking_number'],\r\n 'tracking_number' => $order['shipping_tracking_number'],\r\n 'delivery_address' => [\r\n 'name' => $order['delivery_name'],\r\n 'phone' => $order['delivery_phone'],\r\n 'address_1' => $order['delivery_address_1'],\r\n 'address_2' => $order['delivery_address_2'],\r\n 'city' => $order['delivery_city'],\r\n 'state' => $order['delivery_state'],\r\n 'zipcode' => $order['delivery_zipcode']\r\n ]\r\n ];\r\n\r\n foreach ($order->inventoryItems as $item) {\r\n $tmp = [\r\n 'name' => $item->product['name'],\r\n 'url' => route('shop.product', [$item->product['uri'], $item->product['id']]),\r\n 'unit_price' => number_format($item->pivot['price'], 2),\r\n 'quantity' => $item->pivot['quantity'],\r\n 'price' => number_format($item->pivot['price'] * $item->pivot['quantity'], 2)\r\n ];\r\n\r\n if ($item->options()->count() > 0) {\r\n $tmp['options'] = [];\r\n\r\n foreach ($item->options()->get() as $option) {\r\n $tmp['options'][] = [\r\n 'attribute' => $option->attribute['name'],\r\n 'value' => $option['name']\r\n ];\r\n }\r\n }\r\n\r\n if ($item->product->defaultPhoto()->count() > 0) {\r\n $tmp['image'] = CustomHelper::image($item->product->defaultPhoto['name'], true);\r\n }\r\n\r\n $sub['items'][] = $tmp;\r\n }\r\n\r\n $recipients = [\r\n [\r\n 'address' => !empty($order['contact_email']) ? $order['contact_email'] : $user['email'],\r\n 'name' => $sub['customer_name'],\r\n 'substitution_data' => $sub\r\n ]\r\n ];\r\n\r\n SparkPostHelper::sendTemplate($templateId, $recipients);\r\n\r\n return back()->with('alert-success', 'You have successfully sent a Shipping Confirmation email to the customer.');\r\n } else {\r\n return back()->with('alert-danger', 'You need to change the status to Shipped and add a Tracking Number first in order to send this Shipping Confirmation email to the customer.');\r\n }\r\n\r\n break;\r\n }\r\n }", "public function fetchShipment()\n {\n if (! array_key_exists('ShipmentId', $this->options)) {\n $this->log('Shipment ID must be set in order to fetch it!', 'Warning');\n\n return false;\n }\n\n $this->options['Action'] = 'GetShipment';\n\n $url = $this->urlbase.$this->urlbranch;\n\n $query = $this->genQuery();\n\n $path = $this->options['Action'].'Result';\n if ($this->mockMode) {\n $xml = $this->fetchMockFile();\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']);\n }\n\n $this->parseXML($xml->$path);\n }", "public function orderDetails()\n {\n $callback = request()->input('callback');\n\n try {\n if ($orderId = request()->input('order_id')) {\n $aliExpressOrder = $this->aliExpressOrderRepository->findOneByField('order_id', $orderId);\n\n if ($aliExpressOrder) {\n $address = $aliExpressOrder->order->shipping_address ?? $aliExpressOrder->order->billing_address;\n\n $state = app('Webkul\\Core\\Repositories\\CountryStateRepository')->findOneByField('code', $address->state);\n $result = [\n 'contact_name' => $address->name,\n 'contact_email' => $address->email,\n 'shipping_address_1' => $address->address1,\n 'shipping_address_2' => $address->address2,\n 'shipping_city' => $address->city,\n 'telephone' => $address->phone,\n 'iso_code_2' => $address->country,\n 'zipcode' => $address->postcode,\n 'state' => $state->default_name,\n 'success' => true\n ];\n } else {\n $result = [\n 'success' => false,\n 'message' => 'Order not exist.'\n ];\n }\n } else {\n $result = [\n 'success' => false,\n 'message' => 'Order id not exist.'\n ];\n }\n } catch(\\Exception $e) {\n $result = [\n 'success' => false,\n 'message' => $e->getMessage()\n ];\n }\n\n\n $response = response($callback . '(' . json_encode($result) . ')');\n $response->header('Content-Type', 'application/javascript');\n\n return $response;\n }", "public function editOrderShipment($order_id = null) {\n\t\t$this->Order = ClassRegistry::init('Order');\n\t\t$this->layout = 'ajax';\n if ($this->request->is('post') || $this->request->is('put')) {\n if ($this->Shipment->save($this->request->data)) {\n $this->Session->setFlash(__('The shipment has been saved'));\n $this->redirect(array('action' => 'index'));\n } else {\n $this->Session->setFlash(__('The shipment could not be saved. Please, try again.'));\n }\n } else {\n $options = array('conditions' => array('Shipment.order_id' => $order_id));\n\t\t\t$this->request->data = $this->Shipment->find('first', $options);\n\t\t\tif($this->request->data == array()){\n\t\t\t\tthrow new NotFoundException('no shipment found');\n\t\t\t}\n $this->request->data = $this->Shipment->find('first', $options);\n\t\t\t$myAddresses = ($this->User->getSecureList($this->Auth->user('id'), 'myAddresses'));\n\t\t\t$connectedAddresses = ($this->User->getSecureList($this->Auth->user('id'), 'connectedAddresses'));\n\t\t\t$thirdParty = ($this->User->getSecureList($this->Auth->user('id'), 'thirdParty'));\n\t\t\t$pageHeading = $title_for_layout = 'Shipping Address Edit';\n\t\t\t$carrier = $this->Order->carrier;\n\t\t\t$UPS = $this->Order->method['UPS'];\n\t\t\t$FedEx = $this->Order->method['FedEx'];\n\t\t\t$Other = $this->Order->method['Other'];\n\t\t\t$method = array($this->Order->method[$this->request->data['Shipment']['carrier']]);\n\t\t\t$shipmentBillingOptions = $this->getShipmentBillingOptions();\n\n\t\t\t$this->setBasicAddressSelects();\n\t\t\t$this->set(compact(\n\t\t\t\t\t'myAddresses', \n\t\t\t\t\t'connectedAddresses', \n\t\t\t\t\t'pageHeading', \n\t\t\t\t\t'title_for_layout', \n\t\t\t\t\t'carrier', \n\t\t\t\t\t'method',\n\t\t\t\t\t'UPS',\n\t\t\t\t\t'FedEx',\n\t\t\t\t\t'Other',\n\t\t\t\t\t'shipmentBillingOptions',\n\t\t\t\t\t'thirdParty'));\n }\n }", "public function deliveredToCustomer($order_id)\n {\n $order = Order::findOrFail($order_id);\n\n if($order->drop_driver_id!=Auth::id()){\n return response()->json([\n 'status' => '403',\n 'message' => 'You are not assigned to delivery this order',\n ], 403);\n }\n elseif($order->status==6){\n $order->status = 7;\n $order->save();\n\n $orderDetails = OrderDetail::updateOrCreate(\n ['order_id' => $order_id],\n ['DTC' => date(config('settings.dateTime'))]\n );\n\n if(!$order){\n return response()->json([\n 'status' => '400',\n 'message' => 'Sorry the Order status could not be updated',\n ], 400);\n }\n User::notifyDroppedAtCustomer($order_id);\n\n //If this order is first order of customer then generate a coupon code for the referral user of this user\n $checkIfFirstOrder = Order::where('customer_id', $order->customer_id)->where('status', 7)->get()->count();\n if($checkIfFirstOrder==1){\n $customerDetails = UserDetail::where('user_id',$order->customer_id)->first();\n if($customerDetails && $customerDetails->referred_by){\n $referredBy = $customerDetails->referred_by;\n $referredByCustomerDetails = UserDetail::where('referral_id',$referredBy)->first();\n if($referredByCustomerDetails){\n $referredByID = $referredByCustomerDetails->user_id;\n $couponCode = $this->generateCoupon();\n\n $dateNow = \\Carbon\\Carbon::now();\n $dateAfterMonth = \\Carbon\\Carbon::now()->addMonths(1);\n $coupon = new Coupon();\n $coupon->code = $couponCode;\n $coupon->status = 1;\n $coupon->type = 2;\n $coupon->coupon_type = 3;\n $coupon->user_id = $referredByID;\n $coupon->discount = AppDefault::firstOrFail()->referral_grant;\n $coupon->description = 'User First Order Discount Coupon to Refferal';\n $coupon->valid_from = $dateNow;\n $coupon->valid_to = $dateAfterMonth;\n $coupon->save();\n\n if($coupon){\n User::notifyReferralBonus($coupon);\n }\n } \n }\n\n \n }\n\n return response()->json([\n 'status' => '200',\n 'message' => 'Order Dropped at Customer',\n ], 200);\n }\n return response()->json([\n 'status' => '400',\n 'message' => 'Something is wrong with the request',\n ], 400);\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 orderAjaxHandler(Request $request)\n {\n $method = $request->input('method');\n $response = new stdClass();\n $objProductModel = Products::getInstance();\n $objOptionVariant = ProductOptionVariants::getInstance();\n $objOrderModel = Orders::getInstance();\n $objModelOrders = Orders::getInstance();\n $objModelUsers = Orders::getInstance();\n if ($method != \"\") {\n switch ($method) {\n\n case 'insert-order':\n $postData = $request->all();\n $response = new stdClass();\n $objUserModel = new User();\n if ($postData) {\n $userId = '';\n $mainCartData = '';\n if (isset($postData['id'])) {\n $userId = $postData['id'];\n }\n\n if (isset($postData['mainCartData'])) {\n $mainCartData = $postData['mainCartData'];\n\n }\n $mytoken = '';\n $authflag = false;\n if (isset($postData['api_token'])) {\n $mytoken = $postData['api_token'];\n\n if ($mytoken == env(\"API_TOKEN\")) {\n $authflag = true;\n\n } else {\n if ($userId != '') {\n $whereForloginToken = $whereForUpdate = [\n 'rawQuery' => 'id =?',\n 'bindParams' => [$userId]\n ];\n $Userscredentials = $objUserModel->getUsercredsWhere($whereForloginToken);\n\n if ($mytoken == $Userscredentials->login_token) {\n $authflag = true;\n }\n }\n }\n }\n if ($authflag) {//LOGIN TOKEN\n $objOrderModel = Orders::getInstance();\n if (json_decode($mainCartData, true)) {\n foreach (json_decode($mainCartData, true) as $key => $val) {\n if (sizeof($val) > 0) {\n $product_id[$key] = $val['product_id'];\n } else {\n $quantity[$key] = $val['quantity'];\n $product_id[$key] = $val['product_id'];\n }\n }\n $like = implode(' OR ', array_map(function ($v) {\n return 'product_id LIKE \"%' . $v . '%\"';\n }, $product_id));\n $where = ['rawQuery' => 'for_user_id = ? AND (' . $like . ') AND order_status = \"P\"', 'bindParams' => [$userId]];\n $selectOrder = $objOrderModel->getcartOrder($where);\n if ($selectOrder) {\n $updatedData = [];\n $newData = [];\n $productIDs = [];\n foreach ($selectOrder as $orderKey => $orderVal) {\n\n $productIDs[] = $orderVal->product_id;\n $updatedData[] = current(array_values(array_filter(array_map(function ($v) use ($orderVal) {\n if (in_array($orderVal->product_id, $v) && in_array($orderVal->for_user_id, $v)) {\n $orderVal->quantity = $v['quantity'] + $orderVal->quantity;\n return $orderVal;\n }\n }, json_decode($mainCartData, true)))));\n\n }\n if (!empty($updatedData)) {\n $in = implode(',', array_values(array_filter(array_map(function ($v) {\n return $v->order_id;\n }, $updatedData))));\n $case = implode(' ', array_map(function ($v) {\n return ' WHEN ' . $v->order_id . ' THEN ' . $v->quantity;\n }, $updatedData));\n\n $whereUpdated = ['rawQuery' => 'order_id IN (' . $in . ')'];\n $updatedResult = $objOrderModel->updateToOrder(['quantity' => DB::raw(\"(CASE order_id $case END)\")], $whereUpdated);\n\n }\n $productIDs = array_unique($productIDs);\n $newData = array_values(array_filter(array_map(function ($cv) use ($productIDs) {\n if (!in_array($cv['product_id'], $productIDs))\n return $cv;\n }, json_decode($mainCartData, true))));\n if (!empty($newData)) {\n $insertOrder = $objOrderModel->insertToOrder($newData);\n }\n if ((isset($insertOrder) && $insertOrder != '') || (isset($updatedResult) && $updatedResult != '')) {\n $response->code = 200;\n $response->message = isset($insertOrder) ? 'Added to cart' : 'Updated to cart';\n $response->data = null;\n\n } else {\n $response->code = 400;\n $response->message = \"Nothing Cart details.\";\n $response->data = null;\n }\n } else if (empty($selectOrder)) {\n $insertOrder = $objOrderModel->insertToOrder(json_decode($mainCartData, true));\n if ($insertOrder) {\n $response->code = 200;\n $response->message = \"Success\";\n $response->data = $insertOrder;\n } else {\n $response->code = 400;\n $response->message = \"No user Details found.\";\n $response->data = null;\n }\n }\n }\n } else {\n $response->code = 401;\n $response->message = \"Access Denied\";\n $response->data = null;\n }\n } else {\n $response->code = 401;\n $response->message = \"Invalid request\";\n $response->data = null;\n }\n echo json_encode($response, true);\n break;\n case 'getCartCount': // TODO : This method is not to be used //\n $postData = $request->all();\n $response = new stdClass();\n $objUserModel = new User();\n if ($postData) {\n $userId = '';\n $mainCartData = '';\n if (isset($postData['id'])) {\n $userId = $postData['id'];\n }\n\n if (isset($postData['mainCartData'])) {\n $mainCartData = $postData['mainCartData'];\n\n }\n $mytoken = '';\n $authflag = false;\n if (isset($postData['api_token'])) {\n $mytoken = $postData['api_token'];\n\n if ($mytoken == env(\"API_TOKEN\")) {\n $authflag = true;\n\n } else {\n if ($userId != '') {\n $whereForloginToken = $whereForUpdate = [\n 'rawQuery' => 'id =?',\n 'bindParams' => [$userId]\n ];\n $Userscredentials = $objUserModel->getUsercredsWhere($whereForloginToken);\n\n if ($mytoken == $Userscredentials->login_token) {\n $authflag = true;\n }\n }\n }\n }\n if ($authflag) {//LOGIN TOKEN\n $objOrderModel = Orders::getInstance();\n $where = ['rawQuery' => 'for_user_id = ?', 'bindParams' => [$userId]];\n $cartCount = $objOrderModel->getcartOrder($where);\n if (isset($cartCount)) {\n $response->code = 200;\n $response->message = \"Success\";\n $response->data = count($cartCount);\n } else {\n $response->code = 400;\n $response->message = \"No Details found.\";\n $response->data = null;\n\n }\n } else {\n $response->code = 401;\n $response->message = \"Access Denied\";\n $response->data = null;\n }\n } else {\n $response->code = 401;\n $response->message = \"Invalid request\";\n $response->data = null;\n }\n echo json_encode($response, true);\n break;\n case 'user-cart-details':\n $postData = $request->all();\n $response = new stdClass();\n $objUserModel = new User();\n if ($postData) {\n $userId = '';\n if (isset($postData['id'])) {\n $userId = $postData['id'];\n }\n $mytoken = '';\n $authflag = false;\n if (isset($postData['api_token'])) {\n $mytoken = $postData['api_token'];\n\n if ($mytoken == env(\"API_TOKEN\")) {\n $authflag = true;\n\n } else {\n if ($userId != '') {\n $whereForloginToken = $whereForUpdate = [\n 'rawQuery' => 'id =?',\n 'bindParams' => [$userId]\n ];\n $Userscredentials = $objUserModel->getUsercredsWhere($whereForloginToken);\n\n if ($mytoken == $Userscredentials->login_token) {\n $authflag = true;\n }\n }\n }\n }\n if ($authflag) {//LOGIN TOKEN\n $objOrderModel = Orders::getInstance();\n $whereUserId = ['rawQuery' => 'orders.for_user_id = ? AND orders.order_status = \"P\" AND\n (product_option_variants_combination.variant_ids LIKE CONCAT(\"%\",REPLACE(SUBSTRING_INDEX(orders.product_id,\"-\",-1),\",\",\"_\"),\"%\")\n or product_option_variants_combination.variant_ids LIKE CONCAT(\"%\",REVERSE(REPLACE(SUBSTRING_INDEX(orders.product_id,\"-\",-1),\",\",\"_\")),\"%\"))',\n 'bindParams' => [$userId]];\n $selectColumn = [\n DB::raw(\"SUBSTRING_INDEX(orders.product_id,'-',1) as pid ,REPLACE(SUBSTRING_INDEX(orders.product_id,'-',-1),',','_') cid \"),\n// 'product_images.*',//todo remove comment and check functionality again\n 'products.product_name',\n 'products.price_total',\n 'products.in_stock',\n 'orders.quantity',\n 'orders.order_id',\n 'product_option_variant_relation.*',\n 'productmeta.quantity_discount',\n 'users.email', 'users.name', 'users.last_name', 'users.username', 'users.role',\n DB::raw('GROUP_CONCAT(product_option_variant_relation.variant_data SEPARATOR \"____\") AS variant_datas')\n\n ];\n $cartProductDetails = json_decode($objOrderModel->getCartProductDetails($whereUserId, $selectColumn), true);\n// dd($cartProductDetails);\n $combineVarian = [];\n $finalCartProductDetails = [];\n $subTotal = '';\n if ($cartProductDetails['code'] == 200) {\n foreach (json_decode(json_encode($cartProductDetails['data']), false) as $cartkey => $cartVal) {\n if ($cartVal->in_stock >= $cartVal->quantity) {\n $variantData = explode(\"____\", $cartVal->variant_datas);\n $varian = array_flatten(array_map(function ($v) {\n return json_decode($v);\n }, $variantData));\n\n $finalPrice = $cartVal->price_total;\n $combineVarian[] = array_values(array_filter(array_map(function ($v) use ($varian, &$finalPrice) {\n return current(array_filter(array_map(function ($value) use ($v, &$finalPrice) {\n if ($v == $value->VID) {\n $finalPrice = $finalPrice + $value->PM;\n return [$v => $value->PM];\n }\n }, $varian)));\n }, explode(\"_\", $cartVal->cid))));\n $cartVal->finalPrice = $finalPrice * $cartVal->quantity;\n\n $discountedValue = 0;\n $qtyValue = null;\n if ($cartVal->quantity_discount != '') {\n $quantityDiscount = object_to_array(json_decode($cartVal->quantity_discount));\n $quantities = array_column($quantityDiscount, 'quantity');\n\n $quantity = $cartVal->quantity;\n $tmpQTY = array_filter(array_map(function ($v) use ($quantity) {\n if ($quantity >= $v) return $v;\n }, $quantities));\n sort($tmpQTY);\n $finalQTY = end($tmpQTY);\n\n $qtyValue = current(array_values(array_filter(array_map(function ($v) use ($finalQTY) {\n if ($v['quantity'] == $finalQTY) return $v;\n }, $quantityDiscount))));\n\n $discountedValue = ($qtyValue['type'] == 1) ? $qtyValue['value'] : ($cartVal->finalPrice * $qtyValue['value'] / 100);\n $discountedPrice = $cartVal->finalPrice - $discountedValue;\n\n\n if ($discountedPrice <= 0) {\n $error[] = 'Discount not allowed';\n }\n $cartVal->discountedPrice = $discountedPrice;\n }\n\n $cartVal->shipingPrice = 9; // TODO : NEED TO GET CONFIRMATION FOR SHIPPING DETAILS//\n\n $finalCartProductDetails[] = $cartVal;\n $subTotal = $subTotal + (isset($cartVal->discountedPrice) ? $cartVal->discountedPrice : $cartVal->finalPrice);\n\n } else {\n $error[] = 'Selected quantity should be greater than In-Stock';\n }\n }\n if ($subTotal != '' && !empty($finalCartProductDetails)) {\n $finalCartProductDetails[0]->subtotal = $subTotal;\n }\n $finalCartProductDetails[0]->cartcount = count($finalCartProductDetails);\n }\n if (isset($finalCartProductDetails)) {\n $response->code = 200;\n $response->message = \"Success\";\n $response->data = $finalCartProductDetails;\n } else {\n $response->code = 400;\n $response->message = \"No Details found.\";\n $response->data = null;\n\n }\n } else {\n $response->code = 401;\n $response->message = \"Access Denied\";\n $response->data = null;\n }\n } else {\n $response->code = 401;\n $response->message = \"Invalid request\";\n $response->data = null;\n }\n echo json_encode($response, true);\n break;\n case 'remove-cart-detail':\n $postData = $request->all();\n $response = new stdClass();\n $objUserModel = new User();\n if ($postData) {\n $userId = '';\n $mainCartData = '';\n if (isset($postData['id'])) {\n $userId = $postData['id'];\n }\n\n $mytoken = '';\n $authflag = false;\n if (isset($postData['api_token'])) {\n $mytoken = $postData['api_token'];\n\n if ($mytoken == env(\"API_TOKEN\")) {\n $authflag = true;\n\n } else {\n if ($userId != '') {\n $whereForloginToken = $whereForUpdate = [\n 'rawQuery' => 'id =?',\n 'bindParams' => [$userId]\n ];\n $Userscredentials = $objUserModel->getUsercredsWhere($whereForloginToken);\n\n if ($mytoken == $Userscredentials->login_token) {\n $authflag = true;\n }\n }\n }\n }\n if ($authflag) {//LOGIN TOKEN\n $objOrderModel = Orders::getInstance();\n $whereCart = ['rawQuery' => 'order_id = ? AND for_user_id = ?', 'bindParams' => [$postData['order_id'], $userId]];\n $cartData = $objOrderModel->deleteCartOrder($whereCart);\n if (isset($cartData)) {\n $response->code = 200;\n $response->message = \"Success\";\n $response->data = $cartData;\n } else {\n $response->code = 400;\n $response->message = \"No Details found.\";\n $response->data = null;\n\n }\n } else {\n $response->code = 401;\n $response->message = \"Access Denied\";\n $response->data = null;\n }\n } else {\n $response->code = 401;\n $response->message = \"Invalid request\";\n $response->data = null;\n }\n echo json_encode($response, true);\n break;\n case 'payment-product-detail':\n $postData = $request->all();\n $response = new stdClass();\n $objUserModel = new User();\n $error = [];\n if ($postData) {\n $userId = '';\n $mainCartData = '';\n if (isset($postData['id'])) {\n $userId = $postData['id'];\n }\n if (isset($postData['productId'])) {\n $productId = $postData['productId'];\n }\n if (isset($postData['selectedVariantId'])) {\n $selectedVariantId = $postData['selectedVariantId'];\n }\n if (isset($postData['quantityId'])) {\n $quantityId = $postData['quantityId'];\n }\n\n\n $mytoken = '';\n $authflag = false;\n if (isset($postData['api_token'])) {\n $mytoken = $postData['api_token'];\n\n if ($mytoken == env(\"API_TOKEN\")) {\n $authflag = true;\n\n } else {\n if ($userId != '') {\n $whereForloginToken = $whereForUpdate = [\n 'rawQuery' => 'id =?',\n 'bindParams' => [$userId]\n ];\n $Userscredentials = $objUserModel->getUsercredsWhere($whereForloginToken);\n\n if ($mytoken == $Userscredentials->login_token) {\n $authflag = true;\n }\n }\n }\n }\n if ($authflag) {//LOGIN TOKEN\n $and = (count(explode('_', $selectedVariantId)) > 1 ?\n 'product_option_variants_combination.variant_ids IN(\"' . $selectedVariantId . '\",\"' . strrev($selectedVariantId) . '\")' :\n \"product_option_variants.variant_id =\" . $selectedVariantId);\n\n// $where = ['rawQuery' => 'product_option_variants_combination.product_id = ? AND product_option_variants_combination.variant_ids IN(\"' . $selectedCombination . '\",\"' . strrev($selectedCombination) . '\")', 'bindParams' => [$productId]];\n $where = ['rawQuery' => 'product_option_variants_combination.product_id = ? AND ' . $and, 'bindParams' => [$productId]];\n\n $selectedColumn = ['products.*',\n 'productmeta.quantity_discount',\n 'users.email', 'users.name', 'users.last_name', 'users.username', 'users.role',\n// 'usermeta.addressline1','usermeta.addressline2','usermeta.zipcode',\n 'product_option_variants.*',\n 'product_images.*',\n 'product_option_variants_combination.*',\n 'product_option_variant_relation.*',\n DB::raw('GROUP_CONCAT(\n CASE\n WHEN ((SELECT COUNT(pi_id) FROM product_images WHERE product_images.for_combination_id !=\"0\")!=0)\n THEN\n CASE\n WHEN (product_images.image_type =1 AND (product_images.for_combination_id!=0 OR product_images.for_combination_id!=\"\"))\n THEN product_images.image_type\n END\n ELSE product_images.image_type\n END) AS image_types'),\n DB::raw('GROUP_CONCAT(DISTINCT\n CASE\n WHEN ((SELECT COUNT(pi_id) FROM product_images WHERE product_images.for_combination_id !=\"0\")!=0)\n THEN\n CASE\n WHEN (product_images.image_type =1 AND (product_images.for_combination_id!=0 OR product_images.for_combination_id!=\"\"))\n THEN product_images.image_url\n END\n ELSE product_images.image_url\n END) AS image_urls'),\n\n DB::raw('GROUP_CONCAT(DISTINCT product_option_variants_combination.variant_ids) AS variant_ids_combination'),\n DB::raw('GROUP_CONCAT(DISTINCT product_option_variant_relation.variant_ids) AS variant_id'),\n DB::raw('GROUP_CONCAT(DISTINCT product_option_variant_relation.variant_data SEPARATOR \"____\") AS variant_datas')\n\n ];\n $optionVariantDetailsForPopUp = $objOptionVariant->getOptionVariantDetailsForPopup($where, $selectedColumn);\n if ($optionVariantDetailsForPopUp->in_stock >= $quantityId) {\n if (isset($optionVariantDetailsForPopUp->variant_ids_combination) && $optionVariantDetailsForPopUp->variant_ids_combination != '') {\n $variantData = explode(\"____\", $optionVariantDetailsForPopUp->variant_datas);\n $varian = array_flatten(array_map(function ($v) {\n return json_decode($v);\n }, $variantData));\n\n }\n $finalPrice = $optionVariantDetailsForPopUp->price_total;\n $combineVarian = array_values(array_filter(array_map(function ($v) use ($varian, &$finalPrice) {\n return current(array_filter(array_map(function ($value) use ($v, &$finalPrice) {\n if ($v == $value->VID) {\n $finalPrice = $finalPrice + $value->PM;\n return [$v => $value->PM];\n }\n }, $varian)));\n }, explode(\"_\", $optionVariantDetailsForPopUp->variant_ids_combination))));\n $optionVariantDetailsForPopUp->finalPrice = $finalPrice * $quantityId;\n\n $discountedValue = 0;\n $qtyValue = null;\n if ($optionVariantDetailsForPopUp->quantity_discount != '') {\n// $quantityId = 8;\n $quantityDiscount = object_to_array(json_decode($optionVariantDetailsForPopUp->quantity_discount));\n $quantities = array_column($quantityDiscount, 'quantity');\n\n// $quantities = [3, 2, 8, 10, 6, 25];\n $tmpQTY = array_filter(array_map(function ($v) use ($quantityId) {\n if ($quantityId >= $v) return $v;\n }, $quantities));\n sort($tmpQTY);\n $finalQTY = end($tmpQTY);\n\n $qtyValue = current(array_values(array_filter(array_map(function ($v) use ($finalQTY) {\n if ($v['quantity'] == $finalQTY) return $v;\n }, $quantityDiscount))));\n\n $discountedValue = ($qtyValue['type'] == 1) ? $qtyValue['value'] : ($optionVariantDetailsForPopUp->finalPrice * $qtyValue['value'] / 100);\n $discountedPrice = $optionVariantDetailsForPopUp->finalPrice - $discountedValue;\n\n\n if ($discountedPrice <= 0) {\n $error[] = 'Discount not allowed';\n }\n $optionVariantDetailsForPopUp->discountedPrice = $discountedPrice;\n\n// echo $optionVariantDetailsForPopUp->finalPrice . '<br>';\n// echo $discountedPrice . '<br>';\n// echo '<pre>';\n// print_r($qtyValue);\n// print_a($tmpQTY);\n// print_a(array_column(object_to_array($quantityDiscount), 'quantity'));\n }\n $role = ['0' => 0, '1' => 5, '2' => 3];\n $data = array(\n 'for_user_id' => $userId,\n 'order_type' => 'P',\n 'product_id' => $productId,\n 'product_details' => json_encode(['product_name' => $optionVariantDetailsForPopUp->product_name, 'image_url' => $optionVariantDetailsForPopUp->image_url]),\n 'unit_price' => $optionVariantDetailsForPopUp->price_total,\n 'quantity' => $quantityId,\n 'discount_by' => array_search($optionVariantDetailsForPopUp->role, $role),\n 'discount_type' => (isset($qtyValue['type']) && $qtyValue['type'] == 1) ? 'A' : 'P',\n 'discount_value' => $discountedValue,\n 'final_price' => (isset($optionVariantDetailsForPopUp->discountedPrice) && $optionVariantDetailsForPopUp->discountedPrice != 0) ? $optionVariantDetailsForPopUp->discountedPrice : $optionVariantDetailsForPopUp->finalPrice,\n 'order_status' => 'P',\n 'created_at' => date(\"Y-m-d H:i:s\", time())\n );\n\n// print_a($data);\n } else {\n $error[] = 'Selected quantity should be greater than In-Stock';\n }\n\n if (empty($error) && !empty($data)) {\n $orderVal = $objOrderModel->insertToOrder($data);\n if ($orderVal) {\n $response->code = 200;\n $response->message = \"SUCCESS\";\n $response->data = $orderVal;\n }\n } else {\n $response->code = 198;\n $response->message = \"ERROR\";\n $response->data = $error;\n }\n } else {\n $response->code = 401;\n $response->message = \"Access Denied\";\n $response->data = null;\n }\n } else {\n $response->code = 401;\n $response->message = \"Invalid request\";\n $response->data = null;\n }\n echo json_encode($response, true);\n break;\n\n //Akash M. Pai\n case \"orderHistory\"://TODO order history with pagination here\n $postData = $request->all();\n $userId = '';\n if (isset($postData['id'])) {\n $userId = $postData['id'];\n }\n $mytoken = '';\n $authflag = false;\n if (isset($postData['api_token'])) {\n $mytoken = $postData['api_token'];\n if ($userId != '') {\n if ($mytoken == env(\"API_TOKEN\")) {\n $authflag = true;\n } else {\n $whereForloginToken = $whereForUpdate = [\n 'rawQuery' => 'id =?',\n 'bindParams' => [$userId]\n ];\n $Userscredentials = $objModelUsers->getUsercredsWhere($whereForloginToken);\n if ($mytoken == $Userscredentials->login_token) {\n $authflag = true;\n }\n }\n }\n }\n if ($authflag) {//LOGIN TOKEN\n // NORMAL DATATABLE STARTS HERE//\n $whereForOrders = ['rawQuery' => 'order_status != ? and for_user_id = ?', 'bindParams' => ['P', $userId]];\n// $selectedColumn = ['transactions.*'];//, 'orders.order_status', 'orders.order_id'\n $allOrdersData = json_decode($objModelOrders->getAllOrdersWhere($whereForOrders), true);\n //NORMAL DATATABLE ENDS//\n\n // FILTERING STARTS FROM HERE//\n $filteringQuery = '';\n $filteringBindParams = array();\n if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'filter' && $_REQUEST['action'][0] != 'filter_cancel') {//TODO filtering in orders not done on UI\n if ($_REQUEST['order_id'] != '') {\n $filteringQuery[] = \"(`orders`.`order_id` = ?)\";\n array_push($filteringBindParams, $_REQUEST['order_id']);\n }\n if ($_REQUEST['date_from'] != '' && $_REQUEST['date_to'] != '') {\n $filteringQuery[] = \"(`order`.`added_date` BETWEEN ? AND ?)\";\n array_push($filteringBindParams, strtotime(str_replace('-', ' ', $_REQUEST['date_from'])));\n array_push($filteringBindParams, strtotime(str_replace('-', ' ', $_REQUEST['date_to'])));\n } else if ($_REQUEST['date_from'] != '' && $_REQUEST['date_to'] == '') {\n $filteringQuery[] = \"(`order`.`added_date` BETWEEN ? AND ?)\";\n array_push($filteringBindParams, strtotime(str_replace('-', ' ', $_REQUEST['date_from'])));//TODO check date fromat from view and in db\n array_push($filteringBindParams, strtotime(time()));\n } else if ($_REQUEST['date_from'] == '' && $_REQUEST['date_to'] != '') {\n $filteringQuery[] = \"(`order`.`added_date` BETWEEN ? AND ?)\";\n array_push($filteringBindParams, strtotime(1000000000));\n array_push($filteringBindParams, strtotime(str_replace('-', ' ', $_REQUEST['date_to'])));\n }\n if ($_REQUEST['price_from'] != '' && $_REQUEST['price_to'] != '') {\n $filteringQuery[] = \"(`order`.`final_price` BETWEEN ? AND ?)\";\n array_push($filteringBindParams, intval($_REQUEST['price_from']));\n array_push($filteringBindParams, intval($_REQUEST['price_to']));\n } else if ($_REQUEST['price_from'] != '' && $_REQUEST['price_to'] == '') {\n $filteringQuery[] = \"(`order`.`final_price` BETWEEN ? AND ?)\";\n array_push($filteringBindParams, intval($_REQUEST['price_from']));\n array_push($filteringBindParams, intval(100000000));\n } else if ($_REQUEST['price_from'] == '' && $_REQUEST['price_to'] != '') {\n $filteringQuery[] = \"(`order`.`final_price` BETWEEN ? AND ?)\";\n array_push($filteringBindParams, intval(100000000));\n array_push($filteringBindParams, intval($_REQUEST['price_to']));\n }\n // Filter Implode //\n $implodedWhere = ['whereRaw' => 1];\n if (!empty($filteringQuery)) {\n $implodedWhere['whereRaw'] = implode(' AND ', array_map(function ($filterValues) {\n return $filterValues;\n }, $filteringQuery));\n $implodedWhere['bindParams'] = $filteringBindParams;\n }\n $iTotalRecords = $iDisplayLength = intval($_REQUEST['length']);\n $iDisplayLength = $iDisplayLength < 0 ? $iTotalRecords : $iDisplayLength;\n $iDisplayStart = intval($_REQUEST['start']);\n $sEcho = intval($_REQUEST['draw']);\n $columns = array('orders.order_id');//, 'orders.added_date', 'orders.order_type', 'orders.final_price', 'orders.order_status'\n $sortingOrder = \"\";\n if (isset($_REQUEST['order'])) {\n $sortingOrder = $columns[$_REQUEST['order'][0]['column']];\n }\n if ($implodedWhere['whereRaw'] != 1) {\n// $whereForOrders = ['rawQuery' => 'order_status != ?', 'bindParams' => ['OP']];\n $selectedColumn = ['*'];\n $allOrdersData = json_decode($objModelOrders->getAllOrdersWhereWithLimit($whereForOrders, $implodedWhere, $sortingOrder, $iDisplayLength, $iDisplayStart, $selectedColumn), true);\n }\n }\n // FILTERING ENDS//\n\n $returnObj = [\n 'data' => $allOrdersData['data'],\n 'message' => \"My orders\",\n 'code' => $allOrdersData['code']\n ];\n $returnCode = 200;\n } else {\n $returnObj = [\n 'data' => null,\n 'message' => \"Access Denied\",\n 'code' => 401\n ];\n $returnCode = 401;\n }\n\n echo json_encode($returnObj, true);\n break;\n\n default:\n break;\n\n }\n }\n }", "public static function geoCart_process_orderDisplay()\n {\n //use to display some success/failure page, if that applies to this type of gateway.\n\n\n //build response for user\n $cart = geoCart::getInstance();\n $db = DataAccess::getInstance();\n $messages = $db->get_text(true, 180);\n\n $tpl = new geoTemplate('system', 'payment_gateways');\n $tpl->assign($cart->getCommonTemplateVars());\n $tpl->assign('page_title', $messages[3142]);\n $tpl->assign('page_desc', $messages[3143]);\n $tpl->assign('success_failure_message', $messages[3167]);\n $tpl->assign('my_account_url', $db->get_site_setting('classifieds_file_name') . '?a=4&amp;b=3');\n $tpl->assign('my_account_link', $messages[3169]);\n\n $invoice = $cart->order->getInvoice();\n if (is_object($invoice) && $invoice->getId()) {\n $tpl_vars['invoice_url'] = geoInvoice::getInvoiceLink($invoice->getId(), false, defined('IN_ADMIN'));\n }\n\n $html = $tpl->fetch('shared/transaction_approved.tpl');\n $cart->site->body .= $html;\n $cart->site->display_page();\n\n return $html;\n }", "public function markOrderReceived() {\r\n global $wpdb;\r\n \r\n $client = new Client(\r\n str_replace('/public', '', get_site_url()),\r\n // get_site_url(),\r\n $this->consumer_key,\r\n $this->consumer_secret,\r\n [\r\n 'wp_api' => true,\r\n 'version' => 'wc/v3',\r\n 'query_string_auth' => true,\r\n 'timeout' => PADBSYNC_CURL_TIMEOUT\r\n ]\r\n );\r\n \r\n $postData = $_POST['data'];\r\n \r\n $decoded = json_decode($postData, true);\r\n \r\n if (isset($postData) && $postData) {\r\n $strRep = str_replace(array(\"\\r\\n\", \"\\r\", \"\\n\"), \"\", stripslashes($postData));\r\n $data = json_decode($strRep, true);\r\n }\r\n \r\n //check if item exists\r\n try {\r\n $order = $client->get('orders/'.$data['order_id']);\r\n } catch (HttpClientException $e) {\r\n return new WP_REST_Response(['message' => \"Something went wrong!\"]);\r\n }\r\n \r\n if (!$order) {\r\n return new WP_REST_Response(['message' => \"No order found for such query!\"]);\r\n }\r\n \r\n $result = $wpdb->update(\r\n $wpdb->prefix . \"posts\", \r\n [ 'profaktura_status' => $data['profaktura_status'] ],\r\n [ 'ID' => $data['order_id'] ]\r\n );\r\n \r\n if (!$result) {\r\n return new WP_REST_Response(['message' => \"Something went wrong!\"]);\r\n }\r\n \r\n return new WP_REST_Response(['message' => \"Status succesfully updated!\"]);\r\n }", "public function postOrderMake() {\n\n /*\n Array\n (\n [12_97d170e1550eee4afc0af065b78cda302a97674c] => 5\n [metrics] => Порода:\n Пол:\n Обхват шеи:\n Обхват груди:\n Длина спины:\n Обхват передней лапы:\n От шеи до передней лапы:\n Между передними лапами:\n\n [name] => фывчфы\n [email] => [email protected]\n [address] => фывфы\n [tel] => фывфы\n [pay_type] => 1\n )\n */\n\n #Helper::ta(Input::all());\n\n /**\n * Получаем корзину\n */\n CatalogCart::getInstance();\n $goods = CatalogCart::get_full();\n #Helper::ta($goods);\n\n /**\n * Формируем массив с продуктами\n */\n $products = [];\n if (count($goods)) {\n foreach ($goods as $good_hash => $good) {\n $products[$good_hash] = [\n 'id' => $good->id,\n 'count' => $good->_amount,\n 'price' => $good->price,\n 'attributes' => (array)$good->_attributes,\n ];\n }\n }\n #Helper::ta($products);\n\n $pay_type = @$this->pay_types[Input::get('pay_type')] ?: NULL;\n\n /**\n * Формируем окончательный массив для создания заказа\n */\n $order_array = [\n 'client_name' => Input::get('name'),\n 'delivery_info' => Input::get('address') . ' ' . Input::get('email') . ' ' . Input::get('tel'),\n 'comment' => $pay_type . \"\\n\\n\" . Input::get('metrics'),\n 'status' => 1, ## Статус заказа, нужно подставлять ID статуса наподобие \"Новый заказ\"\n 'products' => $products,\n ];\n #Helper::tad($order_array);\n\n $order = Catalog::create_order($order_array);\n\n /*\n $json_request = [];\n $json_request['responseText'] = '';\n $json_request['status'] = FALSE;\n\n if (is_object($order) && $order->id)\n $json_request['status'] = TRUE;\n\n\n return Response::json($json_request, 200);\n */\n\n if (is_object($order) && $order->id) {\n\n CatalogCart::clear();\n return Redirect::route('mainpage');\n #return Redirect::route('catalog-order-success');\n\n } else {\n\n return URL::previous();\n }\n }", "public function ajax_call(): void\n {\n $order_number = filter_input(INPUT_POST, 'orderNumber');\n $email = filter_input(INPUT_POST, 'email');\n $widget_id = filter_input(INPUT_POST, 'widgetId');\n $options = get_option($this->option_name);\n\n [\n 'wordpress_url' => $wordpress_url,\n 'woocommerce_ck' => $woocommerce_ck,\n 'woocommerce_cs' => $woocommerce_cs\n ] = $options[$widget_id];\n\n $response = wp_remote_get(\"{$wordpress_url}/wp-json/wc/v2/orders/{$order_number}\", [\n 'headers' => [\n 'Authorization' => 'Basic ' . base64_encode(\n sprintf('%s:%s', $woocommerce_ck, $woocommerce_cs)\n )\n ]\n ]);\n\n $response_body = json_decode(wp_remote_retrieve_body($response), true);\n\n if (\n (isset($response_body['billing']['email']) && $response_body['billing']['email'] !== $email) ||\n wp_remote_retrieve_response_code($response) !== 200\n ) {\n echo esc_html__('Given order could not be found. ', self::NAMESPACE);\n exit;\n }\n\n echo sprintf(\n '%s: <b>%s</b>',\n esc_html__('Your order status is', self::NAMESPACE),\n mb_strtoupper($response_body['status'])\n );\n\n exit;\n }", "function _postPayment($data)\n {\n $vars = new JObject();\n //\n $order_id = $data['order_id'];\n JTable::addIncludePath(JPATH_ADMINISTRATOR . '/components/com_k2store/tables');\n $orderpayment = JTable::getInstance('Orders', 'Table');\n @$orderpayment->load(array('order_id' => $order_id));\n //\n try {\n if (!$orderpayment)\n throw new Exception('order_not_found');\n\n if ($data['Status'] != 'OK')\n throw new Exception('cancel_return', 1); // 1 == payment failed exception\n\n $MerchantID = $this->params->get('merchant_id');\n $Amount = $this->zarinpalAmount($orderpayment->get('orderpayment_amount'));\n $Authority = $data['Authority'];\n\n $verifyContext = compact('MerchantID', 'Amount', 'Authority');\n $verify = $this->zarinpalRequest('verification', $verifyContext);\n\n if (!$verify)\n throw new Exception('connection_error');\n\n $status = $verify->Status;\n if ($status != 100)\n throw new Exception('status_' . $status);\n\n // status == 100\n $RefID = $verify->RefID;\n\n $orderpayment->transaction_id = $RefID;\n $orderpayment->order_state = JText::_('K2STORE_CONFIRMED'); // CONFIRMED\n $orderpayment->order_state_id = 1; // CONFIRMED\n $orderpayment->transaction_status = 'Completed';\n\n $vars->RefID = $RefID;\n $vars->orderID = $order_id;\n $vars->id = $orderpayment->id;\n if ($orderpayment->save()) {\n JLoader::register('K2StoreHelperCart', JPATH_SITE . '/components/com_k2store/helpers/cart.php');\n // remove items from cart\n K2StoreHelperCart::removeOrderItems($order_id);\n\n // let us inform the user that the payment is successful\n require_once(JPATH_SITE . '/components/com_k2store/helpers/orders.php');\n try{\n @K2StoreOrdersHelper::sendUserEmail(\n $orderpayment->user_id,\n $orderpayment->order_id,\n $orderpayment->transaction_status,\n $orderpayment->order_state,\n $orderpayment->order_state_id\n );\n } catch (Exception $e) {\n // do nothing\n // prevent phpMailer exception\n }\n }\n } catch (Exception $e) {\n $orderpayment->order_state = JText::_('K2STORE_PENDING'); // PENDING\n $orderpayment->order_state_id = 4; // PENDING\n if ($e->getCode() == 1) { // 1 => trnsaction canceled\n $orderpayment->order_state = JText::_('K2STORE_FAILED'); // FAILED\n $orderpayment->order_state_id = 3; //FAILED\n }\n $orderpayment->transaction_status = 'Denied';\n $orderpayment->save();\n $vars->error = $this->zarinpalTranslate($e->getMessage());\n }\n\n $html = $this->_getLayout('postpayment', $vars);\n return $html;\n }", "private function updateOrderData()\n {\n $sign = $this->connector->signRequestKid(\n null,\n $this->connector->accountURL,\n $this->orderURL\n );\n\n $post = $this->connector->post($this->orderURL, $sign);\n if (strpos($post['header'], \"200 OK\") !== false) {\n $this->status = $post['body']['status'];\n $this->expires = $post['body']['expires'];\n $this->identifiers = $post['body']['identifiers'];\n $this->authorizationURLs = $post['body']['authorizations'];\n $this->finalizeURL = $post['body']['finalize'];\n if (array_key_exists('certificate', $post['body'])) {\n $this->certificateURL = $post['body']['certificate'];\n }\n $this->updateAuthorizations();\n } else {\n //@codeCoverageIgnoreStart\n $this->log->error(\"Failed to fetch order for {$this->basename}\");\n //@codeCoverageIgnoreEnd\n }\n }", "public function ship(Order $oOrder, Buyer $oBuyer): string;", "public function receive(){\n $eslId = $this->uri->segment(3); //Get the flower shop ID\n\n $formData = $this->input->post(NULL, TRUE);\n\n $domain = $formData['_domain'];\n $name = $formData['_name'];\n\n if($name === \"bid_available\"){\n //Get data to store\n $data = array(\n 'guildPhoneNumber' => $formData['guildPhoneNumber'],\n 'deliveryRequestId' => $formData['deliveryRequestId'],\n 'driverPhoneNumber' => $formData['driverPhoneNumber'],\n 'driverName' => $formData['driverName'],\n 'estimatedDeliveryTime' => $formData['estimatedDeliveryTime']\n );\n\n //Store bid in DB and exit\n $this->save_bid($data);\n }\n else if($name === \"complete\"){\n $driverPhoneNumber = $formData['driverPhoneNumber'];\n\n $this->load->model('bids_model');\n $this->bids_model->set_delivered($driverPhoneNumber);\n }\n }", "function success()\r\n\t{\r\n $paypalInfo = $this->input->get(); \r\n\t\t $tx = $paypalInfo[\"tx\"];\t\r\n\t\t if(isset($tx))\r\n\t\t {\t\r\n\t\t $paypalURL = $this->paypal_lib->paypal_url; \r\n\t $result = $this->paypal_lib->PDT($paypalURL,$tx);\r\n\t if(!empty($result))\r\n\t {\t \r\n\t\t $data['txn_id'] = $result[\"txn_id\"];\r\n\t\t $data['payment_amt'] = $result[\"payment_gross\"];\r\n\t\t $data['currency_code'] = $result[\"mc_currency\"];\r\n\t\t $data['status'] = $result[\"payment_status\"]; \r\n\t\t $order_id=$result['custom']; \r\n\t\t \r\n\t\t //sending order details on email\r\n\t\t\t\t$order=$this->Order_model->get_order_details($order_id);\t\t\r\n\t\t\t\t$subtotal=0;\r\n\t\t\t\tforeach ($order as $order)\r\n\t\t\t\t{\r\n\t\t\t\t\t$Emaildata =array(\r\n\t\t\t\t\t\t\t 'logo' => base_url().'upload/site/original/'.get_logo(),\r\n\t\t\t\t\t 'name'=>ucfirst($order->FName).' '.ucfirst($order->LName),\r\n\t\t\t\t\t\t\t 'order_id'=>$order->Order_number,\r\n\t\t\t\t\t 'bill_add'=> $order->Address,\r\n\t\t\t\t\t 'bill_city' => $order->City,\r\n\t\t\t\t\t\t\t 'bill_state' =>$order->State,\r\n\t\t\t\t\t\t\t 'bill_zip'=> $order->Zip_code,\r\n\t\t\t\t\t\t\t 'bill_country'=>$order->Country,\r\n\t\t\t\t\t\t\t 'email' => $order->EmailId,\r\n\t\t\t\t\t\t\t 'bill_phone' => $order->Phone\r\n\t\t\t\t\t );\r\n\t\t\t\t\t \r\n\t\t\t\t\t if(!empty($order->Shipping_FName))\r\n\t\t\t\t\t {\r\n\t\t\t\t\t \t$Emaildata['ship_name']=ucfirst($order->Shipping_FName).' '.ucfirst($order->Shipping_LName);\r\n\t\t\t\t\t\t\t $Emaildata['ship_add'] = $order->Shipping_Address;\r\n\t\t\t\t\t $Emaildata['ship_city'] = $order->Shipping_City;\r\n\t\t\t\t\t\t\t $Emaildata['ship_state'] =$order->Shipping_State;\r\n\t\t\t\t\t\t\t $Emaildata['ship_zip']= $order->Shipping_ZipCode;\r\n\t\t\t\t\t\t\t $Emaildata['ship_country'] =$order->Shipping_Country;\r\n\t\t\t\t\t }\r\n\t\t\t\t\t else \r\n\t\t\t\t\t {\r\n\t\t\t\t\t \t$Emaildata['ship_name']=ucfirst($order->FName).' '.ucfirst($order->LName);\r\n\t\t\t\t\t\t\t $Emaildata['ship_add'] =$order->Address;\r\n\t\t\t\t\t $Emaildata['ship_city'] =$order->City;\r\n\t\t\t\t\t\t\t $Emaildata['ship_state'] =$order->State;\r\n\t\t\t\t\t\t\t $Emaildata['ship_zip']= $order->Zip_code;\r\n\t\t\t\t\t\t\t $Emaildata['ship_country'] =$order->Country;\r\n\t\t\t\t\t }\r\n\t\t\t\t\t foreach ($order->products as $product)\r\n\t\t\t\t\t {\r\n\t\t\t\t\t \t$options=unserialize($product->Option);\r\n\t\t\t\t\t $option='';\t\t\t\t\t \r\n\t\t\t\t\t $i=1;\r\n\t\t\t\t\t if(!empty($options))\r\n\t\t\t\t\t {\r\n\t\t\t\t\t \t$count=count($options);\r\n\t\t\t\t\t\t\t\t foreach ($options as $key=>$value)\r\n\t\t\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\t\t \tif($i == $count)\r\n\t\t\t\t\t\t\t\t \t\t$option .= $value;\r\n\t\t\t\t\t\t\t\t \telse\r\n\t\t\t\t\t\t\t\t \t\t$option .= $value.\",\";\r\n\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t \r\n\t\t\t\t\t }\r\n\t\t\t\t\t $sku='';\r\n\t\t\t\t\t if(!empty($product->SKU))\r\n\t\t\t\t\t $sku=$product->SKU;\r\n\t\t\t\t\t else\r\n\t\t\t\t\t $sku='-';\r\n\t\t\t\t\t \r\n\t\t\t\t\t \t$Emaildata['products'][]=array('sku'=>$sku,'pname'=>$product->Product_name,'option'=>$option,'price'=>price($product->Price),'quantity'=>$product->Quantity,'total'=>price($product->Total));\r\n\t\t\t\t\t \t$subtotal +=$product->Total;\r\n\t\t\t\t\t }\t\t\t \t\t\t \t\r\n\t\t\t\t}\r\n\t\t\t\t$Emaildata['subtotal']=price($subtotal);\r\n\t\t\t\t$Emaildata['ship_charg']=0;\r\n\t\t\t\t$Emaildata['total_price']=price($Emaildata['ship_charg']+$subtotal);\r\n\t\t\t\t$Emaildata['base_url']=base_url();\r\n\t\t\t\t\r\n\t\t\t\t$content = $this->Email_template_model->get_temp_by_id(6);\r\n\t\t\t\t$this->load->library('parser');\t\t\r\n\t\t\t\t$subject = $content[0]->template_title;\r\n\t\t\t\t$content = $content[0]->content;\r\n\t\t\t\t$from = '[email protected]';\r\n\t\t\t\t$site_settings=$this->Member_model->get_site_settings();\t\t\r\n\t\t\t\t$EmailId=array($Emaildata['email'],$site_settings[0]->super_admin_email_id);\t\t\r\n\t\t\t\t\r\n\t\t\t\t$this->Email_template_model->sendmail_template($from,$EmailId,$subject,$content,$subject,$Emaildata);\r\n\t\t\t\tredirect('paypal/received_order/'.$order_id);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\techo \"transcation id \".$tx.\" does not exists,Please contact to admin\";\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\techo \"something went wrong.Please contact to admin\";\t\r\n\t\t\t}\t\r\n \r\n }", "function wcfm_order_tracking_response( $item_id, $item, $order ) {\r\n\t\tglobal $WCFM, $WCFMu;\r\n\t\t\r\n\t\t// See if product needs shipping \r\n\t\t$product = $item->get_product(); \r\n\t\t$needs_shipping = $WCFM->frontend->is_wcfm_needs_shipping( $product ); \r\n\t\t\r\n\t\tif( $WCFMu->is_marketplace ) {\r\n\t\t\tif( $WCFMu->is_marketplace == 'wcvendors' ) {\r\n\t\t\t\tif( version_compare( WCV_VERSION, '2.0.0', '<' ) ) {\r\n\t\t\t\t\tif( !WC_Vendors::$pv_options->get_option( 'give_shipping' ) ) $needs_shipping = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif( !get_option('wcvendors_vendor_give_shipping') ) $needs_shipping = false;\r\n\t\t\t\t}\r\n\t\t\t} elseif( $WCFMu->is_marketplace == 'wcmarketplace' ) {\r\n\t\t\t\tglobal $WCMp;\r\n\t\t\t\tif( !$WCMp->vendor_caps->vendor_payment_settings('give_shipping') ) $needs_shipping = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif( $needs_shipping ) {\r\n\t\t\t$traking_added = false;\r\n\t\t\t$package_received = false;\r\n\t\t\tforeach ( $item->get_formatted_meta_data() as $meta_id => $meta ) {\r\n\t\t\t\tif( $meta->key == 'wcfm_tracking_url' ) {\r\n\t\t\t\t\t$traking_added = true;\r\n\t\t\t\t}\r\n\t\t\t\tif( $meta->key == 'wcfm_mark_as_recived' ) {\r\n\t\t\t\t\t$package_received = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\techo \"<p>\";\r\n\t\t\tprintf( __( 'Shipment Tracking: ', 'wc-frontend-manager-ultimate' ) );\r\n\t\t\tif( $package_received ) {\r\n\t\t\t\tprintf( __( 'Item(s) already received.', 'wc-frontend-manager-ultimate' ) );\r\n\t\t\t} elseif( $traking_added ) {\r\n\t\t\t\t?>\r\n\t\t\t\t<a href=\"#\" class=\"wcfm_mark_as_recived\" data-orderitemid=\"<?php echo $item_id; ?>\" data-orderid=\"<?php echo $order->get_id(); ?>\" data-productid=\"<?php echo $item->get_product_id(); ?>\"><?php printf( __( 'Mark as Received', 'wc-frontend-manager-ultimate' ) ); ?></a>\r\n\t\t\t\t<?php\r\n\t\t\t} else {\r\n\t\t\t\tprintf( __( 'Item(s) will be shipped soon.', 'wc-frontend-manager-ultimate' ) );\r\n\t\t\t}\r\n\t\t\techo \"</p>\";\r\n\t\t}\r\n\t}", "public function saveOrder()\n {\n $this->validate();\n $isNewCustomer = false;\n switch ($this->getCheckoutMethod()) {\n case self::METHOD_GUEST:\n $this->_prepareGuestQuote();\n break;\n case self::METHOD_REGISTER:\n $this->_prepareNewCustomerQuote();\n $isNewCustomer = true;\n break;\n default:\n $this->_prepareCustomerQuote();\n break;\n }\n\n /**\n * @var TM_FireCheckout_Model_Service_Quote\n */\n $service = Mage::getModel('firecheckout/service_quote', $this->getQuote());\n $service->submitAll();\n\n if ($isNewCustomer) {\n try {\n $this->_involveNewCustomer();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n $this->_checkoutSession->setLastQuoteId($this->getQuote()->getId())\n ->setLastSuccessQuoteId($this->getQuote()->getId())\n ->clearHelperData();\n\n $order = $service->getOrder();\n if ($order) {\n Mage::dispatchEvent('checkout_type_onepage_save_order_after',\n array('order'=>$order, 'quote'=>$this->getQuote()));\n\n /**\n * a flag to set that there will be redirect to third party after confirmation\n * eg: paypal standard ipn\n */\n $redirectUrl = $this->getQuote()->getPayment()->getOrderPlaceRedirectUrl();\n /**\n * we only want to send to customer about new order when there is no redirect to third party\n */\n $canSendNewEmailFlag = true;\n if (version_compare(Mage::helper('firecheckout')->getMagentoVersion(), '1.5.0.0', '>=')) {\n $canSendNewEmailFlag = $order->getCanSendNewEmailFlag();\n }\n if (!$redirectUrl && $canSendNewEmailFlag) {\n try {\n $order->sendNewOrderEmail();\n } catch (Exception $e) {\n Mage::logException($e);\n }\n }\n\n // add order information to the session\n $this->_checkoutSession->setLastOrderId($order->getId())\n ->setRedirectUrl($redirectUrl)\n ->setLastRealOrderId($order->getIncrementId());\n\n // as well a billing agreement can be created\n $agreement = $order->getPayment()->getBillingAgreement();\n if ($agreement) {\n $this->_checkoutSession->setLastBillingAgreementId($agreement->getId());\n }\n }\n\n // add recurring profiles information to the session\n $profiles = $service->getRecurringPaymentProfiles();\n if ($profiles) {\n $ids = array();\n foreach ($profiles as $profile) {\n $ids[] = $profile->getId();\n }\n $this->_checkoutSession->setLastRecurringProfileIds($ids);\n // TODO: send recurring profile emails\n }\n\n Mage::dispatchEvent(\n 'checkout_submit_all_after',\n array('order' => $order, 'quote' => $this->getQuote(), 'recurring_profiles' => $profiles)\n );\n\n return $this;\n }", "public function orderDeliver(Request $request, $orderID){\n $order = Order::select(['user_id', 'user_type', 'order_id', 'store_id', 'delivery_type'])\n ->where('customer_order_id', $orderID)\n ->first();\n\n if($order)\n {\n $isDelivered = 0;\n\n // Get the payment if exist and not captured\n $payment = Payment::select(['transaction_id', 'status'])\n ->where(['order_id' => $order->order_id])->first();\n\n if($payment)\n {\n if($payment->status != '0')\n {\n // Get the Stripe Account\n $companySubscriptionDetail = CompanySubscriptionDetail::from('company_subscription_detail AS CSD')\n ->select('CSD.stripe_user_id')\n ->join('company AS C', 'C.company_id', '=', 'CSD.company_id')\n ->join('store AS S', 'S.u_id', '=', 'C.u_id')\n ->where('S.store_id', $order->store_id)->first();\n\n if($companySubscriptionDetail)\n {\n $stripeAccount = $companySubscriptionDetail->stripe_user_id;\n\n // Initilize Stripe\n \\Stripe\\Stripe::setApiKey(env('STRIPE_SECRET_KEY'));\n\n try {\n // capture-later\n $payment_intent = \\Stripe\\PaymentIntent::retrieve($payment->transaction_id, ['stripe_account' => $stripeAccount]);\n\n if($payment_intent->status == 'requires_capture')\n {\n $payment_intent->capture();\n }\n\n if($payment_intent->status == 'succeeded')\n {\n $isDelivered = 1;\n\n // Update payment as captured\n Payment::where(['order_id' => $order->order_id])\n ->update(['status' => '1']);\n }\n } catch (\\Stripe\\Error\\Base $e) {\n # Display error on client\n $response = array('error' => $e->getMessage());\n\n return \\Redirect::back()->with($response);\n }\n }\n }\n }\n else\n {\n $isDelivered = 1;\n }\n\n // Check if order can get delivered\n if($isDelivered)\n {\n // Update order as delivered\n DB::table('orders')->where('customer_order_id', $orderID)->update([\n 'paid' => 1,\n ]);\n\n // \n if($order->delivery_type == '3')\n {\n $helper = new Helper();\n try {\n $message = 'orderDeliver';\n \n if($order->user_id != 0){ \n $recipients = [];\n if($order->user_type == 'customer'){\n $adminDetail = User::where('id' , $order->user_id)->first();\n\n if(isset($adminDetail->phone_number_prifix) && isset($adminDetail->phone_number)){\n $recipients = ['+'.$adminDetail->phone_number_prifix.$adminDetail->phone_number]; \n }\n }else{\n $adminDetail = Admin::where('id' , $order->user_id)->first();\n $recipients = ['+'.$adminDetail->mobile_phone];\n }\n\n if(isset($adminDetail->browser)){\n $pieces = explode(\" \", $adminDetail->browser);\n }else{\n $pieces[0] = ''; \n }\n\n if($pieces[0] == 'Safari'){\n //dd($recipients);\n $url = \"https://gatewayapi.com/rest/mtsms\";\n $api_token = \"BP4nmP86TGS102YYUxMrD_h8bL1Q2KilCzw0frq8TsOx4IsyxKmHuTY9zZaU17dL\";\n\n $message = \"Your order deliver please click on link \\n\".env('APP_URL').'deliver-notification/'.$orderID;\n\n $json = [\n 'sender' => 'Dastjar',\n 'message' => ''.$message.'',\n 'recipients' => [],\n ];\n foreach ($recipients as $msisdn) {\n $json['recipients'][] = ['msisdn' => $msisdn];}\n\n $ch = curl_init();\n curl_setopt($ch,CURLOPT_URL, $url);\n curl_setopt($ch,CURLOPT_HTTPHEADER, array(\"Content-Type: application/json\"));\n curl_setopt($ch,CURLOPT_USERPWD, $api_token.\":\");\n curl_setopt($ch,CURLOPT_POSTFIELDS, json_encode($json));\n curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);\n $result = curl_exec($ch);\n curl_close($ch);\n }else{\n $result = $this->sendNotifaction($orderID , $message);\n }\n }\n } catch (Exception $e) {}\n }\n }\n }\n \n // \n return redirect()->action('AdminController@index');\n }", "public function reprocessOrders()\n {\n if (\n !$this->configuration->getEnableDeclineReprocessing() ||\n CrmPayload::get('meta.isSplitOrder') === true ||\n Request::attributes()->get('action') === 'prospect'\n ) {\n return;\n }\n \n $response = CrmResponse::all();\n \n if(!empty($response['success'])) {\n return;\n }\n \n if(\n \tpreg_match(\"/Prepaid.+Not Accepted/i\", $response['errors']['crmError']) &&\n \t!empty($response['errors']['crmError'])\n \t) {\n \treturn;\n \t}\n\n $cbCampaignId = $this->configuration->getDeclineReprocessingCampaign();\n $campaignInfo = Campaign::find($cbCampaignId);\n $products = array();\n if(!empty($campaignInfo['product_array']))\n { \n foreach ($campaignInfo['product_array'] as $childProduct) {\n unset($campaignInfo['product_array']);\n array_push($products, array_merge($campaignInfo, $childProduct));\n }\n }\n CrmPayload::set('products', $products);\n CrmPayload::set('campaignId', $campaignInfo['campaignId']);\n \n $crmInfo = $this->configuration->getCrm();\n $crmType = $crmInfo['crm_type'];\n $crmClass = sprintf(\n '\\Application\\Model\\%s', $crmType\n );\n\n $crmInstance = new $crmClass($this->configuration->getCrmId());\n call_user_func_array(array($crmInstance, CrmPayload::get('meta.crmMethod')), array());\n \n }", "public function shipping(){\n\t\t\t\n\t\t\tif(!$this->session->userdata('admin_logged_in')){\n\t\t\t\t\t\t\t\t\n\t\t\t\t$url = 'admin/login?redirectURL='.urlencode(current_url());\n\t\t\t\tredirect($url);\t\t\t\t\t\t\t\n\t\t\t\t//redirect('admin/login/','refresh');\n\t\t\t\t\n\t\t\t}else{\t\t\t\n\n\t\t\t\t$username = $this->session->userdata('admin_username');\n\t\t\t\t\n\t\t\t\t$data['user_array'] = $this->Admin->get_user($username);\n\t\t\t\t\t\n\t\t\t\t$fullname = '';\n\t\t\t\tif($data['user_array']){\n\t\t\t\t\tforeach($data['user_array'] as $user){\n\t\t\t\t\t\t$fullname = $user->admin_name;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$data['fullname'] = $fullname;\n\t\t\t\t\t\n\t\t\t\t$data['unread_contact_us'] = $this->Contact_us->count_unread_messages();\n\t\t\t\t\t\n\t\t\t\t$messages_unread = $this->Messages->count_unread_messages($username);\n\t\t\t\tif($messages_unread == '' || $messages_unread == null){\n\t\t\t\t\t$data['messages_unread'] = 0;\n\t\t\t\t}else{\n\t\t\t\t\t$data['messages_unread'] = $messages_unread;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$data['header_messages_array'] = $this->Messages->get_header_messages($username);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$enquiries_unread = $this->Sale_enquiries->count_unread_enquiries();\n\t\t\t\tif($enquiries_unread == '' || $enquiries_unread == null){\n\t\t\t\t\t$data['enquiries_unread'] = 0;\n\t\t\t\t}else{\n\t\t\t\t\t$data['enquiries_unread'] = $enquiries_unread;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//*********SELECT ORDER DROPDOWN**********//\n\t\t\t\t//$existing_orders = '<div class=\"form-group\">';\n\t\t\t\t//$existing_orders .= '<select name=\"existing_orders\" id=\"existing_orders\" class=\"form-control\">';\n\t\t\t\t\t\n\t\t\t\t$existing_orders = '<option value=\"0\" >Select Existing Order</option>';\n\t\t\t\t\t\t\t\n\t\t\t\t$this->db->from('orders');\n\t\t\t\t$this->db->order_by('id');\n\t\t\t\t$result = $this->db->get();\n\t\t\t\tif($result->num_rows() > 0) {\n\t\t\t\t\tforeach($result->result_array() as $row){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t$users_array = $this->Users->get_user($row['customer_email']);\n\t\t\t\t\t\t$fullname = '';\n\t\t\t\t\t\tif($users_array){\n\t\t\t\t\t\t\tforeach($users_array as $user){\n\t\t\t\t\t\t\t\t$fullname = $user->first_name.' '.$user->last_name;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$existing_orders .= '<option value=\"'.$row['reference'].'-'.$row['customer_email'].'\" >'.$row['reference'].' - '.$fullname.' ('.$row['customer_email'].')</option>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t//$existing_orders .= '</select>';\n\t\t\t\t//$existing_orders .= '</div>';\t\n\t\t\t\t$data['existing_orders'] = $existing_orders;\n\t\t\t\t//*********END SELECT ORDER DROPDOWN**********//\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t//SELECT SHIPPING METHODS DROPDOWN\n\t\t\t\t//$shipping_methods = '<div class=\"form-group\">';\n\t\t\t\t//$shipping_methods .= '<select name=\"shipping_method\" id=\"shipping_method\" class=\"form-control\">';\n\t\t\t\t\t\n\t\t\t\t$shipping_methods = '<option value=\"\" >Select Shipping Method</option>';\n\t\t\t\t\t\t\t\n\t\t\t\t$this->db->from('shipping_methods');\n\t\t\t\t$this->db->order_by('id');\n\t\t\t\t$result = $this->db->get();\n\t\t\t\tif($result->num_rows() > 0) {\n\t\t\t\t\tforeach($result->result_array() as $row){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$shipping_methods .= '<option value=\"'.ucwords($row['id']).'\" >'.ucwords($row['shipping_company']).'</option>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t//$shipping_methods .= '</select>';\n\t\t\t\t//$shipping_methods .= '</div>';\t\n\t\t\t\t$data['shipping_method_options'] = $shipping_methods;\n\t\t\t\t//*********END SELECT SHIPPING METHODS DROPDOWN**********//\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t//assign page title name\n\t\t\t\t$data['pageTitle'] = 'Shipping';\n\t\t\t\t\t\t\t\t\n\t\t\t\t//assign page title name\n\t\t\t\t$data['pageID'] = 'shipping';\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t//load header and page title\n\t\t\t\t$this->load->view('admin_pages/header', $data);\n\t\t\t\t\t\t\t\n\t\t\t\t//load main body\n\t\t\t\t$this->load->view('admin_pages/shipping_page', $data);\t\n\t\t\t\t\t\n\t\t\t\t//load footer\n\t\t\t\t$this->load->view('admin_pages/footer');\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\t\n\t\t}", "public function confirm_order_by_waiter_post()\n { \n $response = new StdClass();\n $result2 = new StdClass();\n $waiter_mobile_no=$this->input->post('waiter_mobile_no');\n $order_status=$this->input->post('order_status');\n $admin_id=$this->input->post('admin_id');\n $order_id=$this->input->post('order_id');\n\n $data->waiter_mobile_no=$waiter_mobile_no;\n $data->order_status=$order_status;\n $data->admin_id=$admin_id;\n $data->order_id=$order_id;\n $result = $this->Supervisor->confirm_order_by_waiter($data);\n\n \n if(!empty($order_status))\n { \n $data2->status ='1';\n $data2->message = 'Success';\n array_push($result2,$data2);\n $response->data = $data2;\n }\n else\n {\n $data2->status ='0';\n $data2->message = 'failed';\n array_push($result2,$data2);\n $response->data = $data2;\n }\n \n \n echo json_output($response);\n }", "public function callbackhostedpaymentAction()\n {\n $boError = false;\n $formVariables = array();\n $model = Mage::getModel('paymentsensegateway/direct');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n $checkout = Mage::getSingleton('checkout/type_onepage');\n $session = Mage::getSingleton('checkout/session');\n $szPaymentProcessorResponse = '';\n $order = Mage::getModel('sales/order');\n $order->load(Mage::getSingleton('checkout/session')->getLastOrderId());\n $nVersion = Mage::getModel('paymentsensegateway/direct')->getVersion();\n $boCartIsEmpty = false;\n \n try\n {\n $hmHashMethod = $model->getConfigData('hashmethod');\n $szPassword = $model->getConfigData('password');\n $szPreSharedKey = $model->getConfigData('presharedkey');\n \n $formVariables['HashDigest'] = $this->getRequest()->getPost('HashDigest');\n $formVariables['MerchantID'] = $this->getRequest()->getPost('MerchantID');\n $formVariables['StatusCode'] = $this->getRequest()->getPost('StatusCode');\n $formVariables['Message'] = $this->getRequest()->getPost('Message');\n $formVariables['PreviousStatusCode'] = $this->getRequest()->getPost('PreviousStatusCode');\n $formVariables['PreviousMessage'] = $this->getRequest()->getPost('PreviousMessage');\n $formVariables['CrossReference'] = $this->getRequest()->getPost('CrossReference');\n $formVariables['Amount'] = $this->getRequest()->getPost('Amount');\n $formVariables['CurrencyCode'] = $this->getRequest()->getPost('CurrencyCode');\n $formVariables['OrderID'] = $this->getRequest()->getPost('OrderID');\n $formVariables['TransactionType'] = $this->getRequest()->getPost('TransactionType');\n $formVariables['TransactionDateTime'] = $this->getRequest()->getPost('TransactionDateTime');\n $formVariables['OrderDescription'] = $this->getRequest()->getPost('OrderDescription');\n $formVariables['CustomerName'] = $this->getRequest()->getPost('CustomerName');\n $formVariables['Address1'] = $this->getRequest()->getPost('Address1');\n $formVariables['Address2'] = $this->getRequest()->getPost('Address2');\n $formVariables['Address3'] = $this->getRequest()->getPost('Address3');\n $formVariables['Address4'] = $this->getRequest()->getPost('Address4');\n $formVariables['City'] = $this->getRequest()->getPost('City');\n $formVariables['State'] = $this->getRequest()->getPost('State');\n $formVariables['PostCode'] = $this->getRequest()->getPost('PostCode');\n $formVariables['CountryCode'] = $this->getRequest()->getPost('CountryCode');\n \n if(!PYS_PaymentFormHelper::compareHostedPaymentFormHashDigest($formVariables, $szPassword, $hmHashMethod, $szPreSharedKey))\n {\n $boError = true;\n $szNotificationMessage = \"The payment was rejected for a SECURITY reason: the incoming payment data was tampered with.\";\n Mage::log(\"The Hosted Payment Form transaction couldn't be completed for the following reason: [\".$szNotificationMessage. \"]. Form variables: \".print_r($formVariables, 1));\n }\n else\n {\n $paymentsenseOrderId = Mage::getSingleton('checkout/session')->getPaymentsensegatewayOrderId();\n $szOrderStatus = $order->getStatus();\n $szStatusCode = $this->getRequest()->getPost('StatusCode');\n $szMessage = $this->getRequest()->getPost('Message');\n $szPreviousStatusCode = $this->getRequest()->getPost('PreviousStatusCode');\n $szPreviousMessage = $this->getRequest()->getPost('PreviousMessage');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n \n if($szOrderStatus != 'pys_paid' &&\n $szOrderStatus != 'pys_preauth')\n {\n $checkout->saveOrderAfterRedirectedPaymentAction(true,\n $this->getRequest()->getPost('StatusCode'),\n $this->getRequest()->getPost('Message'),\n $this->getRequest()->getPost('PreviousStatusCode'),\n $this->getRequest()->getPost('PreviousMessage'),\n $this->getRequest()->getPost('OrderID'),\n $this->getRequest()->getPost('CrossReference'));\n }\n else \n {\n // cart is empty\n $boCartIsEmpty = true;\n $szPaymentProcessorResponse = null;\n \n // chek the StatusCode as the customer might have just clicked the BACK button and re-submitted the card details\n // which can cause a charge back to the merchant\n $this->_fixBackButtonBug($szOrderID, $szStatusCode, $szMessage, $szPreviousStatusCode, $szPreviousMessage);\n }\n }\n }\n catch (Exception $exc)\n {\n $boError = true;\n $szNotificationMessage = Paymentsense_Paymentsensegateway_Model_Common_GlobalErrors::ERROR_183;\n Mage::logException($exc);\n }\n \n $szPaymentProcessorResponse = $session->getPaymentprocessorresponse();\n if($boError)\n {\n if($szPaymentProcessorResponse != null &&\n $szPaymentProcessorResponse != '')\n {\n $szNotificationMessage = $szNotificationMessage.'<br/>'.$szPaymentProcessorResponse;\n }\n \n $model->setPaymentAdditionalInformation($order->getPayment(), $this->getRequest()->getPost('CrossReference'));\n //$order->getPayment()->setTransactionId($this->getRequest()->getPost('CrossReference'));\n \n if($nVersion >= 1410)\n {\n if($order)\n {\n $orderState = 'pending_payment';\n $orderStatus = 'pys_failed_hosted_payment';\n $order->setCustomerNote(Mage::helper('paymentsensegateway')->__('Hosted Payment Failed'));\n $order->setState($orderState, $orderStatus, $szPaymentProcessorResponse, false);\n $order->save();\n }\n }\n if($nVersion == 1324 || $nVersion == 1330)\n {\n Mage::getSingleton('checkout/session')->addError($szNotificationMessage);\n }\n else \n {\n Mage::getSingleton('core/session')->addError($szNotificationMessage);\n }\n $order->save();\n \n $this->_clearSessionVariables();\n $this->_redirect('checkout/onepage/failure');\n }\n else\n {\n // set the quote as inactive after back from paypal\n Mage::getSingleton('checkout/session')->getQuote()->setIsActive(false)->save();\n\n if($boCartIsEmpty == false)\n {\n // send confirmation email to customer\n if($order->getId())\n {\n $order->sendNewOrderEmail();\n }\n \n if($nVersion >= 1410)\n {\n // TODO : no need to remove stock item as the system will do it in 1.6 version\n if($nVersion < 1600)\n {\n $model->subtractOrderedItemsFromStock($order);\n }\n $this->_updateInvoices($order, $szPaymentProcessorResponse);\n }\n \n if($nVersion != 1324 && $nVersion != 1330)\n {\n if($szPaymentProcessorResponse != '')\n {\n Mage::getSingleton('core/session')->addSuccess($szPaymentProcessorResponse);\n }\n }\n }\n \n $this->_redirect('checkout/onepage/success', array('_secure' => true));\n }\n }", "function order_success()\n{\n\n}", "public function getOrder()\n {\n echo json_encode($this->Inventory_model->getProductById($_POST['idJson']));\n }", "public function saveShipmentData()\n {\n\n if(Mage::registry('gls_shipment_error') === true) {\n return null;\n }\n\n $shipment = Mage::registry('current_shipment');\n // Return if current shipment is null.\n if (is_null($shipment)):\n return null;\n endif;\n\n $helper = Mage::helper('synergeticagency_gls');\n\n $store = $shipment->getStore();\n // Return if global gls config is disabled.\n if (!Mage::getStoreConfig('gls/general/active' , $store)) {\n return null;\n }\n\n // get post data\n $data = Mage::app()->getRequest()->getPost();\n if(!isset($data['ship_with_gls']) || $data['ship_with_gls'] !== '1') {\n // shipment with gls is not selected\n return null;\n }\n\n // Return if validation fails.\n if ( false === $this->_validateGlsShipmentData($data,$shipment) ){\n return null;\n }\n\n $glsModel = Mage::getModel('synergeticagency_gls/gls');\n $glsModel->saveGlsShipment($data, $shipment);\n // set order status\n $helper->setOrderStatus($shipment->getOrder(),$helper->__('GLS shipment successfully saved'));\n\n }", "public function getPaymentRequestData( $order_id ) {\n $order = new WC_Order( $order_id );\n $params = array(\n 'transaction_details' => array(\n 'order_id' => $order_id,\n 'gross_amount' => 0,\n ));\n\n $customer_details = array();\n $customer_details['first_name'] = WC_Midtrans_Utils::getOrderProperty($order,'billing_first_name');\n $customer_details['first_name'] = WC_Midtrans_Utils::getOrderProperty($order,'billing_first_name');\n $customer_details['last_name'] = WC_Midtrans_Utils::getOrderProperty($order,'billing_last_name');\n $customer_details['email'] = WC_Midtrans_Utils::getOrderProperty($order,'billing_email');\n $customer_details['phone'] = WC_Midtrans_Utils::getOrderProperty($order,'billing_phone');\n\n $billing_address = array();\n $billing_address['first_name'] = WC_Midtrans_Utils::getOrderProperty($order,'billing_first_name');\n $billing_address['last_name'] = WC_Midtrans_Utils::getOrderProperty($order,'billing_last_name');\n $billing_address['address'] = WC_Midtrans_Utils::getOrderProperty($order,'billing_address_1');\n $billing_address['city'] = WC_Midtrans_Utils::getOrderProperty($order,'billing_city');\n $billing_address['postal_code'] = WC_Midtrans_Utils::getOrderProperty($order,'billing_postcode');\n $billing_address['phone'] = WC_Midtrans_Utils::getOrderProperty($order,'billing_phone');\n $converted_country_code = WC_Midtrans_Utils::convert_country_code(WC_Midtrans_Utils::getOrderProperty($order,'billing_country'));\n $billing_address['country_code'] = (strlen($converted_country_code) != 3 ) ? 'IDN' : $converted_country_code ;\n\n $customer_details['billing_address'] = $billing_address;\n $customer_details['shipping_address'] = $billing_address;\n\n if ( isset ( $_POST['ship_to_different_address'] ) ) {\n $shipping_address = array();\n $shipping_address['first_name'] = WC_Midtrans_Utils::getOrderProperty($order,'shipping_first_name');\n $shipping_address['last_name'] = WC_Midtrans_Utils::getOrderProperty($order,'shipping_last_name');\n $shipping_address['address'] = WC_Midtrans_Utils::getOrderProperty($order,'shipping_address_1');\n $shipping_address['city'] = WC_Midtrans_Utils::getOrderProperty($order,'shipping_city');\n $shipping_address['postal_code'] = WC_Midtrans_Utils::getOrderProperty($order,'shipping_postcode');\n $shipping_address['phone'] = WC_Midtrans_Utils::getOrderProperty($order,'billing_phone');\n $converted_country_code = WC_Midtrans_Utils::convert_country_code(WC_Midtrans_Utils::getOrderProperty($order,'shipping_country'));\n $shipping_address['country_code'] = (strlen($converted_country_code) != 3 ) ? 'IDN' : $converted_country_code;\n $customer_details['shipping_address'] = $shipping_address;\n }\n \n $params['customer_details'] = $customer_details;\n $items = array();\n // Build item_details API params from $Order items\n if( sizeof( $order->get_items() ) > 0 ) {\n foreach( $order->get_items() as $item ) {\n if ( $item['qty'] ) {\n // $product = $order->get_product_from_item( $item );\n $midtrans_item = array();\n $midtrans_item['id'] = $item['product_id'];\n $midtrans_item['price'] = ceil($order->get_item_subtotal( $item, false ));\n $midtrans_item['quantity'] = $item['qty'];\n $midtrans_item['name'] = $item['name'];\n $items[] = $midtrans_item;\n }\n }\n }\n\n // Shipping fee as item_details\n if( $order->get_total_shipping() > 0 ) {\n $items[] = array(\n 'id' => 'shippingfee',\n 'price' => ceil($order->get_total_shipping()),\n 'quantity' => 1,\n 'name' => 'Shipping Fee',\n );\n }\n\n // Tax as item_details\n if( $order->get_total_tax() > 0 ) {\n $items[] = array(\n 'id' => 'taxfee',\n 'price' => ceil($order->get_total_tax()),\n 'quantity' => 1,\n 'name' => 'Tax',\n );\n }\n\n // Discount as item_details\n if ( $order->get_total_discount() > 0) {\n $items[] = array(\n 'id' => 'totaldiscount',\n 'price' => ceil($order->get_total_discount()) * -1,\n 'quantity' => 1,\n 'name' => 'Total Discount'\n );\n }\n\n // Fees as item_details\n if ( sizeof( $order->get_fees() ) > 0 ) {\n $fees = $order->get_fees();\n $i = 0;\n foreach( $fees as $item ) {\n $items[] = array(\n 'id' => 'itemfee' . $i,\n 'price' => ceil($item['line_total']),\n 'quantity' => 1,\n 'name' => $item['name'],\n );\n $i++;\n }\n }\n\n // Iterate through the entire item to ensure that currency conversion is applied\n if (get_woocommerce_currency() != 'IDR'){\n foreach ($items as &$item) {\n $item['price'] = $item['price'] * $this->to_idr_rate;\n $item['price'] = intval($item['price']);\n }\n unset($item);\n $params['transaction_details']['gross_amount'] *= $this->to_idr_rate;\n }\n\n $total_amount=0;\n // error_log('print r items[]' . print_r($items,true)); //debugan\n // Sum item details prices as gross_amount\n foreach ($items as $item) {\n $total_amount+=($item['price']*$item['quantity']);\n }\n $params['transaction_details']['gross_amount'] = $total_amount;\n $params['item_details'] = $items;\n $params['credit_card']['secure'] = ($this->enable_3d_secure == 'yes') ? true : false;\n\n // add custom `expiry` API params\n $custom_expiry_params = explode(\" \",$this->custom_expiry);\n if ( !empty($custom_expiry_params[1]) && !empty($custom_expiry_params[0]) ){\n $time = time();\n $time += 30; // add 30 seconds to allow margin of error\n $params['expiry'] = array(\n 'start_time' => date(\"Y-m-d H:i:s O\",$time), \n 'unit' => $custom_expiry_params[1], \n 'duration' => (int)$custom_expiry_params[0],\n );\n }\n // add custom_fields API params\n $custom_fields_params = explode(\",\",$this->custom_fields);\n if ( !empty($custom_fields_params[0]) ){\n $params['custom_field1'] = $custom_fields_params[0];\n $params['custom_field2'] = !empty($custom_fields_params[1]) ? $custom_fields_params[1] : null;\n $params['custom_field3'] = !empty($custom_fields_params[2]) ? $custom_fields_params[2] : null;\n }\n // add savecard API params\n if ($this->enable_savecard =='yes' && is_user_logged_in()){\n $params['user_id'] = crypt( $customer_details['email'].$customer_details['phone'] , $this->server_key );\n $params['credit_card']['save_card'] = true;\n }\n // add Snap API metadata, identifier for request coming via this plugin\n try {\n $params['metadata'] = array(\n 'x_midtrans_wc_plu' => array(\n 'version' => MIDTRANS_PLUGIN_VERSION,\n 'wc' => WC_VERSION,\n 'php' => phpversion()\n )\n );\n } catch (Exception $e) { }\n\n return $params;\n }", "public function createOrderAction()\n {\n $data = $this->Request()->getParams();\n $data = $data['data'];\n\n $orderNumber = $this->getOrderNumber();\n\n /** @var \\Shopware_Components_CreateBackendOrder $createBackendOrder */\n $createBackendOrder = Shopware()->CreateBackendOrder();\n $hasMailError = false;\n\n try {\n /** @var Shopware\\Models\\Order\\Order $orderModel */\n $orderModel = $createBackendOrder->createOrder($data, $orderNumber);\n\n if (!$orderModel instanceof \\Shopware\\Models\\Order\\Order) {\n $this->view->assign($orderModel);\n\n return false;\n }\n } catch (\\Exception $e) {\n $this->view->assign(\n [\n 'success' => false,\n 'message' => $e->getMessage()\n ]\n );\n\n return;\n }\n\n try {\n //sends and prepares the order confirmation mail\n $this->sendOrderConfirmationMail($orderModel);\n } catch (\\Exception $e) {\n $hasMailError = $e->getMessage();\n }\n\n if ($hasMailError) {\n $this->view->assign(\n [\n 'success' => true,\n 'orderId' => $orderModel->getId(),\n 'mail' => $hasMailError,\n 'ordernumber' => $orderModel->getNumber()\n ]\n );\n\n return;\n }\n\n $this->view->assign(\n [\n 'success' => true,\n 'orderId' => $orderModel->getId(),\n 'ordernumber' => $orderModel->getNumber()\n ]\n );\n }" ]
[ "0.67499727", "0.6721056", "0.6708365", "0.66481376", "0.65921366", "0.65846515", "0.64126587", "0.6347414", "0.6284921", "0.62376744", "0.62105083", "0.6203196", "0.62004423", "0.6147816", "0.6147157", "0.6146171", "0.61191857", "0.61067617", "0.61063516", "0.60908", "0.60494995", "0.60345167", "0.6031935", "0.60254306", "0.6014078", "0.6013682", "0.6005829", "0.6005301", "0.60015583", "0.59976745", "0.5995704", "0.59813225", "0.59634626", "0.5959036", "0.593488", "0.5922257", "0.59038204", "0.58894736", "0.58878064", "0.5884715", "0.58798915", "0.5876121", "0.5865099", "0.5856302", "0.58458596", "0.58392924", "0.58362275", "0.5835887", "0.58347905", "0.5829334", "0.5823493", "0.58188677", "0.5802466", "0.5800648", "0.57976264", "0.5792123", "0.57724214", "0.57232964", "0.5712832", "0.57087326", "0.5683923", "0.5683731", "0.5679789", "0.5670817", "0.566742", "0.5665092", "0.56537324", "0.5643716", "0.5640645", "0.5639261", "0.56371015", "0.56371", "0.56329864", "0.56268805", "0.5619584", "0.5619059", "0.5616171", "0.5611889", "0.5611533", "0.5610805", "0.5610195", "0.5609805", "0.5608691", "0.5601198", "0.55799913", "0.55786955", "0.55719525", "0.55715406", "0.55612224", "0.5560449", "0.5552017", "0.5551831", "0.554574", "0.5545686", "0.5544635", "0.5540779", "0.5538962", "0.55302167", "0.55263484", "0.5524333", "0.5524144" ]
0.0
-1
get the order id
protected function _autoSend() { $orderId = (int)$this->getRequest()->getParam('order_id', 0); if ($orderId <= 0) { return array('error' => Mage::helper('balticode_postoffice')->__('Invalid Order ID')); } $order = Mage::getModel('sales/order')->load($orderId); if (!$order || $order->getId() <= 0) { return array('error' => Mage::helper('balticode_postoffice')->__('Invalid Order ID')); } //get the carrier $shippingMethod = $order->getShippingMethod(); $paymentMethod = $order->getPayment(); //get the shipping code from the order and call the module from it. $shippingCarrierCode = substr($shippingMethod, 0, strpos($shippingMethod, '_')); $shippingMethodModel = Mage::getModel('shipping/shipping')->getCarrierByCode($shippingCarrierCode); if (!($shippingMethodModel instanceof Balticode_Postoffice_Model_Carrier_Abstract)){ return array('error' => Mage::helper('balticode_postoffice')->__('This carrier is not subclass of Balticode_Postoffice_Model_Carrier_Abstract')); } $shippingMethodModel->setStoreId($order->getStoreId()); //determine if auto send is available if (!$shippingMethodModel->isAutoSendAvailable()) { return array('error' => Mage::helper('balticode_postoffice')->__('Automatic data sending is not available for the selected carrier')); } if (round($order->getTotalDue(), 2) > 0 && (!$shippingMethodModel->getConfigData('enable_cod') || ($shippingMethodModel->getConfigData('enable_cod') && $paymentMethod->getMethod() != 'balticodecodpayment'))) { return array('error' => Mage::helper('balticode_postoffice')->__('This order has not yet been fully paid')); } if (($order->isCanceled() || $order->getIsVirtual())) { return array('error' => Mage::helper('balticode_postoffice')->__('This order cannot be shipped')); } //send the data Mage::helper('balticode_postoffice')->sendManualOrderData($order->getIncrementId(), $shippingMethodModel->getConfigData('senddata_event')); //return the results return array('success' => true); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function get_order_id() {\n $order_id = $this->order_id;\n return !!$order_id ? $order_id : 0;\n }", "public function orderId(): int\n {\n return $this->order->id();\n }", "protected function GetOrderID() {\n\treturn $this->Value('ID_Order');\n }", "public function getOrderid() {\n\t\treturn $this->orderid;\n\t}", "public function getID() {\r\n\r\n\t\tself::errorReset();\r\n\t\t$this->reload();\r\n\t\treturn $this->orderId;\r\n\t}", "protected function OrderID() {\n\treturn $this->Value('ID_Order');\n }", "public function getOrderID()\n {\n return $this->orderID;\n }", "public function getOrderID()\n {\n return $this->orderID;\n }", "public function getOrderID()\n {\n return $this->orderID;\n }", "public function getOrderID()\n {\n return $this->orderID;\n }", "private function _getOrderId(): int\n {\n $orderId = 123456;\n\n return $orderId;\n }", "public static function get_order_id() {\n\t\tglobal $order;\n\n\t\tif ( is_a( $order, 'WC_Order' ) ) {\n\t\t\treturn $order->get_id();\n\t\t}\n\n\t\t$order_id = absint( filter_input( INPUT_GET, 'order_id', FILTER_SANITIZE_NUMBER_INT ) );\n\n\t\tif ( $order_id ) {\n\t\t\treturn $order_id;\n\t\t}\n\n\t\treturn null;\n\t}", "public function getOrderIncrementId(){\n return $this->_getData(self::ORDER_INCREMENT_ID);\n }", "public function getOrderId()\n {\n $identifier = $this->_order->identifier();\n return $identifier['id'];\n }", "public function get_order_id( $context = 'view' ) {\n\t\treturn $this->get_prop( 'order_id', $context ) ;\n\t}", "public function getOrderId()\n {\n return $this->order_id;\n }", "public function getOrderId()\n {\n return $this->order_id;\n }", "public function getOrderId()\n {\n return $this->order_id;\n }", "public function getOrderId()\n {\n return $this->order_id;\n }", "public function getId()\n {\n return $this->source['order_item_id'];\n }", "public function getOrderId()\n {\n return $this->getParam('order-id', 'order');\n }", "public function getOrderId()\n {\n return $this->source['order_id'];\n }", "public function getOrderId(){\n return $this->_getData(self::ORDER_ID);\n }", "public function getOrderId()\n {\n $value = $this->get(self::order_id);\n return $value === null ? (integer)$value : $value;\n }", "public static function getOrderIncrementId()\n {\n return self::$orderIncrementId;\n }", "public function getOrderId();", "public function getOrderId(): string\n {\n return $this->orderId;\n }", "public function getOrderId(): string\n {\n return $this->getData(self::ORDER_ID);\n }", "public function getOrderId() {\n\t\treturn $this->orderId;\n\t}", "public function getOrderId()\n {\n return $this->orderId;\n }", "public function getOrderId()\n {\n return $this->orderId;\n }", "public function getOrderId()\n {\n return $this->orderId;\n }", "public function getOrderId()\n {\n return $this->orderId;\n }", "public function getOrderNumber();", "public function getOrderNumber();", "public function generateOrderID() { global $db;\n // Generate Order ID\n $db->query(\"INSERT INTO `order_ids` (foo) VALUES(:foo)\", array('foo' => true));\n return $db->lastInsertId();\n }", "public function getOrderId()\n {\n return $this->getOrder()->getId();\n }", "protected function getOrderId()\n {\n return $this->checkoutSession->getLastRealOrder()->getEntityId();\n }", "public function getOrderId()\n {\n return array_key_exists('OrderId', $this->data) ? $this->data['OrderId'] : null;\n }", "public function getCustomerOrderId();", "public function getOrderDetailId()\n {\n return $this->order_detail_id;\n }", "public function getOrderNumber()\n {\n if (null === $this->_orderNumber) {\n $this->_orderNumber = uniqid();\n }\n return $this->_orderNumber;\n }", "public function getOrderId() {\n return $this->item->getOrderId();\n }", "public function getOrderReference()\n {\n if (!isset($this->data['error']) ) {\n return $this->data['transactionResponse']['orderId'];\n }\n\n return null;\n }", "private function getInvoiceOrderId() {\n $config = Svea\\SveaConfig::getDefaultConfig();\n $request = WebPay::createOrder($config)\n ->addOrderRow(TestUtil::createOrderRow())\n ->addCustomerDetails(WebPayItem::individualCustomer()->setNationalIdNumber(194605092222))\n ->setCountryCode(\"SE\")\n ->setCustomerReference(\"33\")\n ->setOrderDate(\"2012-12-12\")\n ->setCurrency(\"SEK\")\n ->useInvoicePayment()// returnerar InvoiceOrder object\n //->setPasswordBasedAuthorization(\"sverigetest\", \"sverigetest\", 79021)\n ->doRequest();\n\n return $request->sveaOrderId;\n }", "public function getOrderno()\n {\n return $this->orderno;\n }", "public function getOrderId(): ?int\n {\n return $this->getParam(self::ORDER_ID);\n }", "function getOrderId($orderName) \n {\n return (int)preg_replace(\"/[^0-9]/\", \"\", $orderName);\n }", "function getorderid(){\n\t\n\t$comment = trim($_POST['comment']);\n\t\t\n\t\t$sql= \"SELECT design_order_id\n\t\tFROM `design_order`\n\t\tWHERE comment = '$comment'\n\t\tAND customer_id =\".$_SESSION['user_id'].\"\";\n\t\t\n\t\t$Q = $this-> db-> query($sql);\n\tif ($Q-> num_rows() > 0){\n\tforeach ($Q->result_array() as $row){\n\t$d = $row['design_order_id'];\n\t}\n\treturn $d;\n\t\n\t}\n\t}", "public function getExtOrderId();", "public function getOrderId()\r\n {\r\n return $this->object;\r\n }", "public function getOrderNo()\n {\n return $this->order_no;\n }", "public function getQuoteId();", "public static function getOrderID($_cID) {\n global $lC_Database;\n\n $Qorder = $lC_Database->query('select orders_id from :table_orders where customers_id = :customers_id order by date_purchased desc limit 1');\n $Qorder->bindTable(':table_orders', TABLE_ORDERS);\n $Qorder->bindInt(':customers_id', $_cID);\n $Qorder->execute();\n \n $oID = $Qorder->valueInt('orders_id');\n\n $Qorder->freeResult();\n \n return $oID;\n }", "function ticket_item_id(){\r\n\t\t$product_id = ( !empty($this->order_item['variation_id'])? $this->order_item['variation_id']: $this->order_item['product_id']);\r\n\r\n\t\t// get ticket IDS saved in order\r\n\t\t\t$ticket_ids = get_post_meta($this->order_id, '_tixids', true);\r\n\t\t\t$_code_mid = $this->order_id.'-'.$product_id;\r\n\r\n\t\t\t$ticket_item_id='';\r\n\t\t\t\r\n\t\t\tif(!is_array($ticket_ids)) return $ticket_item_id;\r\n\r\n\t\t\t//find ticket item id from saved ticket item ids in order meta\r\n\t\t\tforeach($ticket_ids as $__tid){\r\n\t\t\t\t$__tid_1 = explode(',', $__tid);\r\n\t\t\t\t\r\n\t\t\t\tif(strpos($__tid_1[0], $_code_mid)){\r\n\t\t\t\t\t$tt = explode('-', $__tid_1[0]);\t\t\t\t\t\r\n\t\t\t\t\t$ticket_item_id = $tt[0];\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\treturn $ticket_item_id;\r\n\t}", "public function getOrderId(): ?string\n {\n if (count($this->orderId) == 0) {\n return null;\n }\n return $this->orderId['value'];\n }", "public function getOrderNumber()\n {\n return $this->orderNumber;\n }", "public function getOrderNumber()\n {\n return $this->orderNumber;\n }", "public function getOrderNumber()\n {\n return $this->orderNumber;\n }", "public function getOrderId($order_id, $direction = 'DESC')\n {\n\n if ($direction == 'ASC') {\n $arrow = '>';\n } else {\n $arrow = '<';\n }\n\n $db = JFactory::getDBO();\n $q = 'SELECT `virtuemart_order_id` FROM `#__virtuemart_orders` WHERE `virtuemart_order_id`' . $arrow . (int)$order_id;\n $q .= ' ORDER BY `virtuemart_order_id` ' . $direction;\n $db->setQuery($q);\n\n if ($oderId = $db->loadResult()) {\n return $oderId;\n }\n return 0;\n }", "public function get_order_id_by_order_key( $order_key ) {\n\t\tglobal $wpdb;\n\n\t\treturn $wpdb->get_var( $wpdb->prepare(\n\t\t\t\"SELECT order_id FROM {$wpdb->prefix}woocommerce_orders WHERE order_key = %s\",\n\t\t\t$order_key\n\t\t) );\n\t}", "public function getOrderNumber()\n {\n return $this->OrderNumber;\n }", "public function getOrderId($customer_id);", "public function getOrderNumber()\n {\n return array_key_exists('OrderNumber', $this->data) ? $this->data['OrderNumber'] : null;\n }", "function get_fresh_orderId(){\n \t$conn=new_db_connect();\n \t$query=\"select top 1 orderId from orderinfo ORDER BY orderId DESC\";\n \t$result=$conn->query($query);\n \tif($result){\n \t\t$result=$result->fetch_assoc();\n \t\t$conn->close();\n \t\treturn $result['orderId'];\n \t} else{\n \t\t$conn->close();\n \t\treturn 0;\n \t}\n }", "function getOrderID($user_id, $order_date){\n\t\t$conn \t= connectDB();\n\t\t$sth \t= $conn \t-> prepare('SELECT `id`\n\t\t\t\t\t\t\t\t\t\tFROM `order`\n\t\t\t\t\t\t\t\t\t\tWHERE `user_id` = ? AND `order_date` = ?');\n\t\t$sth \t-> execute(array($user_id, $order_date));\n\t\treturn \t$sth;\n\t}", "public function getPurchaseOrderNumber();", "public function getIdOrders()\n {\n return $this->idOrders;\n }", "public function getCheckoutPurchaseOrderNo();", "function get_id() {\n\t\treturn $this->get_data( 'id' );\n\t}", "public function get_id();", "public function get_id();", "protected function _get_transaction_id( $order_id ) {\n\t\t\treturn get_post_meta( $order_id, '_transaction_id', true );\n\t\t}", "public function getOrdersId($key, $type) {\r\n\t\tif ($type == 'single') {\r\n\t\t\treturn $this->ordersId;\r\n\t\t} else if ($type == 'array') {\r\n\t\t\treturn $this->ordersId [$key];\r\n\t\t} else {\r\n\t\t\techo json_encode(array(\"success\" => false, \"message\" => \"Cannot Identifiy Type String Or Array:getOrdersId ?\"));\r\n\t\t\texit();\r\n\t\t}\r\n\t}", "public function getTransactionID();", "public function getExtOrderItemId() {\n return $this->item->getExtOrderItemId();\n }", "public function get_id() {\r\n\t\treturn ($this->id);\r\n\t}", "public function get_id() {\r\n\t\treturn ($this->id);\r\n\t}", "protected function generateUniqueId()\n\t{\n\t\t// generate unique numbers for order id\n\t\t$orderID = hexdec(bin2hex(openssl_random_pseudo_bytes(5)));\n\t\t$orderIdExist = Order::find($orderID);\n\t\t// if exist append the id of d existed copy to new one to make it unique\n\t\tif ($orderIdExist) {\n\t\t\t$orderID = $orderID . '' . $orderIdExist->id;\n\t\t}\n\t\treturn $orderID;\n\t}", "public function getID()\n {\n return $this->billingId;\n }", "static public function getOrderById($id) {\n $rq = \"SELECT * FROM \" . PREFIX . \"sales.`order` \n WHERE `id` =\" . $id . \" LIMIT 1;\";\n\n $aItem = Sql::Get($rq, 1);\n \n return $aItem[0];\n }", "public function getIncrementId(){\n return $this->_getData(self::INCREMENT_ID);\n }", "public function get_id () {\r\n\t\treturn $this->id;\r\n\t}", "function getCustomerIDfromOrder($orderID)\n {\n $customerID = null;\n try\n {\n $stmt = $this->db->prepare(\"SELECT CustomerID\n FROM OrderTable\n WHERE OrderID=:orderID\");\n $stmt->bindParam(':orderID', $orderID);\n $stmt->execute();\n $id = $stmt->fetch(PDO::FETCH_ASSOC);\n if ($stmt->rowCount() > 0)\n {\n $customerID = $id['CustomerID'];\n return $customerID;\n }\n else\n {\n return false;\n }\n }\n\n catch(PDOException $e)\n {\n echo $e->getMessage();\n }\n }", "function get_id() {\n\t\treturn $this->id;\n\t}", "public function getId(){\n if(!$this->id){\n return $this->getShippingOptionId().'_'.md5($this->getShippingServiceName());\n }\n return $this->id;\n }", "protected function _getLastOrderId()\n {\n /** @var Mage_Checkout_Model_Session $session */\n $session = Mage::getSingleton('checkout/session');\n return $session->getLastOrderId();\n }", "public function getAmazonOrderId()\n {\n return $this->_fields['AmazonOrderId']['FieldValue'];\n }", "public function getTdsOrderId()\n {\n return $this->_fields['TdsOrderId']['FieldValue'];\n }", "public function get_id() {\n\t\treturn $this->id;\n\t}", "public function get_id() {\n\t\treturn $this->id;\n\t}", "public function get_id() {\n\t\treturn $this->id;\n\t}", "public function get_id() {\n\t\treturn $this->id;\n\t}", "function get_id() {\n\t\treturn $this->id;\n\n\t}", "public function get_orderWrapperUid() {\n return $this->orderWrapperUid;\n }", "public function getId()\n {\n return $this->transaction->getTransactionResponse()->getTransId();\n }", "private function get_id()\n\t{\n\t\treturn $this->m_id;\n\t}", "private function get_id()\n\t{\n\t\treturn $this->m_id;\n\t}", "private function get_id()\n\t{\n\t\treturn $this->m_id;\n\t}", "public function get_transaction_id_from_order_id ($order_id)\n\t{\n\t\t$query = tep_db_query(\"SELECT payment_id FROM \" . self::DB_PAYMENTS_TABLE . \" WHERE osc_order_id = '\".tep_db_input($order_id).\"'\");\n\t\t$row = tep_db_fetch_array($query);\n\n\t\treturn $row ? $row['payment_id'] : 0;\n\t}", "public function getid()\n {\n return $this->id;\n }" ]
[ "0.8636604", "0.853183", "0.8436691", "0.84222543", "0.8332642", "0.8286197", "0.823292", "0.823292", "0.823292", "0.823292", "0.8141408", "0.80336916", "0.8002011", "0.7983421", "0.7959215", "0.788852", "0.788852", "0.788852", "0.788852", "0.7887499", "0.78660715", "0.78588307", "0.78043836", "0.7702607", "0.7647763", "0.7642404", "0.75876576", "0.7575354", "0.7507664", "0.7488536", "0.7488536", "0.7488536", "0.7488536", "0.7458246", "0.7458246", "0.7435164", "0.73837715", "0.73080707", "0.7297652", "0.72201794", "0.7132408", "0.711473", "0.71114635", "0.6990535", "0.6974834", "0.69652593", "0.69631535", "0.6943599", "0.6942275", "0.69263923", "0.691964", "0.6911888", "0.6900103", "0.68831915", "0.6864846", "0.68621325", "0.6823072", "0.6823072", "0.6823072", "0.6811512", "0.67805487", "0.67792547", "0.67422986", "0.6740865", "0.6732245", "0.6731333", "0.671898", "0.67046297", "0.66745406", "0.66460884", "0.66362697", "0.66362697", "0.6633848", "0.65456694", "0.65363365", "0.6518572", "0.6517159", "0.6517159", "0.6512524", "0.6502704", "0.64838034", "0.64809585", "0.6470937", "0.6467631", "0.64642245", "0.64635646", "0.64567834", "0.64561296", "0.64524966", "0.64488775", "0.64488775", "0.64488775", "0.64488775", "0.64453316", "0.6443697", "0.6438885", "0.643768", "0.643768", "0.643768", "0.6430326", "0.6426375" ]
0.0
-1
Returns the contents for the selected carriers. Mainly it returns two select menus, where first select menu contains all the groups and second select menu contains actual offices, which belong to the selected group
public function officeAction() { try { if ($this->getRequest()->isPost()) { $post = $this->getRequest()->getPost(); $storeId = (int)$this->getRequest()->getParam('store_id', 0); if ($storeId <= 0) { throw new Exception('Store ID must be supplied'); } $url = $this->getUrl('balticode_postoffice/adminhtml_postoffice/office', array('store_id' => $storeId, '_secure' => true)); $addressId = $post['address_id']; $carrierCode = $post['carrier_code']; $carrierId = $post['carrier_id']; $divId = $post['div_id']; $groupId = isset($post['group_id']) ? ((int) $post['group_id']) : 0; $placeId = isset($post['place_id']) ? ((int) $post['place_id']) : 0; $shippingModel = Mage::getModel('shipping/shipping')->getCarrierByCode($carrierCode); //we are in admin section, so we need to set the store it manually $shippingModel->setStoreId($storeId); if (!$shippingModel->isAjaxInsertAllowed($addressId)) { throw new Exception('Invalid Shipping method'); } if (!($shippingModel instanceof Balticode_Postoffice_Model_Carrier_Abstract)) { throw new Exception('Invalid Shipping model'); } if ($placeId > 0) { $place = $shippingModel->getTerminal($placeId); if ($place) { $shippingModel->setOfficeToSession($addressId, $place); echo 'true'; return; } else { echo 'false'; return; } } $groups = $shippingModel->getGroups($addressId); $html = ''; if ($groups) { $groupSelectWidth = (int)$shippingModel->getConfigData('group_width'); $style = ''; if ($groupSelectWidth > 0) { $style = ' style="width:'.$groupSelectWidth.'px"'; } $html .= '<select onclick="return false;" ' . $style . ' name="' . $carrierCode . '_select_group" onchange="new Ajax.Request(\'' . $url . '\',{method:\'post\',parameters:{carrier_id:\'' . $carrierId . '\',carrier_code:\'' . $carrierCode . '\',div_id:\'' . $divId . '\',address_id:\'' . $addressId . '\',group_id: $(this).getValue()},onSuccess:function(a){$(\'' . $divId . '\').update(a.responseText)}});">'; $html .= '<option value="">'; $html .= htmlspecialchars(Mage::helper('balticode_postoffice')->__('-- select --')); $html .= '</option>'; foreach ($groups as $group) { $html .= '<option value="' . $group->getGroupId() . '"'; if ($groupId > 0 && $groupId == $group->getGroupId()) { $html .= ' selected="selected"'; } $html .= '>'; $html .= $shippingModel->getGroupTitle($group); $html .= '</option>'; } $html .= '</select>'; } //get the group values if ($groupId > 0 || $groups === false) { $terminals = array(); if ($groups !== false) { $terminals = $shippingModel->getTerminals($groupId, $addressId); } else { $terminals = $shippingModel->getTerminals(null, $addressId); } $officeSelectWidth = (int)$shippingModel->getConfigData('office_width'); $style = ''; if ($officeSelectWidth > 0) { $style = ' style="width:'.$officeSelectWidth.'px"'; } $html .= '<select onclick="return false;" '.$style.' name="' . $carrierCode . '_select_office" onchange="var sel = $(this); new Ajax.Request(\'' . $url . '\',{method:\'post\',parameters:{carrier_id:\'' . $carrierId . '\',carrier_code:\'' . $carrierCode . '\',div_id:\'' . $divId . '\',address_id:\'' . $addressId . '\',place_id: sel.getValue()},onSuccess:function(a){ if (a.responseText == \'true\') { $(\'' . $carrierId . '\').writeAttribute(\'value\', \'' . $carrierCode . '_' . $carrierCode . '_\' + sel.getValue()); $(\'' . $carrierId . '\').click(); }}});">'; $html .= '<option value="">'; $html .= htmlspecialchars(Mage::helper('balticode_postoffice')->__('-- select --')); $html .= '</option>'; $optionsHtml = ''; $previousGroup = false; $optGroupHtml = ''; $groupCount = 0; foreach ($terminals as $terminal) { if ($shippingModel->getGroupTitle($terminal) != $previousGroup && !$shippingModel->getConfigData('disable_group_titles')) { if ($previousGroup != false) { $optionsHtml .= '</optgroup>'; $optionsHtml .= '<optgroup label="'.$shippingModel->getGroupTitle($terminal).'">'; } else { $optGroupHtml .= '<optgroup label="'.$shippingModel->getGroupTitle($terminal).'">'; } $groupCount++; } $optionsHtml .= '<option value="' . $terminal->getRemotePlaceId() . '"'; if (false) { $optionsHtml .= ' selected="selected"'; } $optionsHtml .= '>'; $optionsHtml .= $shippingModel->getTerminalTitle($terminal); $optionsHtml .= '</option>'; $previousGroup = $shippingModel->getGroupTitle($terminal); } if ($groupCount > 1) { $html .= $optGroupHtml . $optionsHtml . '</optgroup>'; } else { $html .= $optionsHtml; } $html .= '</select>'; } echo $html; } else { throw new Exception('Invalid request method'); } } catch (Exception $e) { $this->getResponse()->setHeader('HTTP/1.1', '500 Internal error'); $this->getResponse()->setHeader('Status', '500 Internal error'); throw $e; } return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function vcn_get_career_names_select_list () {\r\n\t$data = vcn_rest_wrapper('vcnoccupationsvc', 'vcncareer', 'listcareers', array('industry' => vcn_get_industry()), 'json');\r\n\t$select_list_array = array('' => 'Select a Career');\r\n\r\n\tif (count($data) > 0) {\r\n\t\tforeach ($data as $value) {\r\n\t\t\t$select_list_array[$value->onetcode] = $value->title;\r\n\t\t}\r\n\t}\r\n\treturn $select_list_array;\r\n}", "public function getCarriers(){\n\n\t\t\t$this->db->select('*')->from('carriers');\n\n\t\t\t$query = $this->db->get();\n\n\t\t\treturn $query->result_array();\n\t}", "public function ctlBuscaClientes(){\n\n\t\t$respuesta = Datos::mdlClientes(\"clientes\");\n\n\t\tforeach ($respuesta as $row => $item){\n\t\t\techo '<option value=\"'.$item[\"nombre\"].'\">'.$item[\"nombre\"].'</option>';\n\t\t}\n\t}", "public function getcboinspector() {\n \n\t\t$resultado = $this->mregctrolprov->getcboinspector();\n\t\techo json_encode($resultado);\n\t}", "function getSectors(){\n // Database connection \n $conn = database_connection();\n \n $sql = \"SELECT SECTOR FROM CMS_GEM_MUON_COND.GEM_VFAT_CHANNELS GROUP BY SECTOR ORDER BY SECTOR ASC\" ;\n $query = oci_parse($conn, $sql);\n //Oci_bind_by_name($query,':bind_name',$bind_para); //if needed\n $arr = oci_execute($query);\n\n $result_arr = array();\n\n while ($row = oci_fetch_array($query, OCI_ASSOC + OCI_RETURN_NULLS)) {\n\n echo '<option>' . $row['SECTOR'] . '</option>';\n \n \n }\n return ;\n}", "public function selectiongroupAction(){\n\t\t$societe=$this->societe;\n\t\tif ($societe instanceof Object_Societe ) {\n\t\t\t$this->view->locations = $societe->getLocations();\n\t\t}\n\t\t$this->view->selectedlocationid=$this->getParam('locationid');\n\t\t$this->view->resadate=$this->getParam('resadate');\n\t\t$this->view->partysize=$this->getParam('partysize');\n\t\t$this->view->slot=$this->getParam('slot');\n\t\t$this->disableLayout();\n\n\t}", "public function getOptions($please_select = false)\n {\n if ($please_select) {\n $options = array(null => '--Please Select--');\n }\n\n $carriers = Mage::getModel('temando/carrier')->getCollection();\n foreach ($carriers as $carrier) {\n\t if(!$carrier->getCarrierId())\n\t\tcontinue;\n\t \n $options[$carrier->getCarrierId()] = $carrier->getCompanyName();\n }\n\n return $options;\n }", "function SelectValuesServicios_MReferenciado($db_conx, $table, $multiple = NULL) {\r\n $sql = \"\";\r\n $script = \"\";\r\n\r\n if ($table == \"servicios\") {\r\n $sql = \"SELECT * FROM tservicios ORDER BY ser_descrip ASC\";\r\n $script = 'onchange=\"getMedicoxServicios(\\'medicos\\');\"';\r\n } else {\r\n $sql = \"SELECT * FROM tmedicoreferenciado WHERE mer_estado = 'activo' ORDER BY mer_sape ASC\";\r\n $script = 'onchange=\"getMedicoxServicios(\\'servicios\\');\"';\r\n }\r\n\r\n if ($multiple == NULL) {\r\n if ($table == \"servicios\") {\r\n $data = '<select ' . $script . ' size=\"30\" style=\"width: 90%;\" class=\"cmb' . $table . 'x\" id=\"cmb' . $table . 'x\">\r\n <option value=\"\">Ninguno</option>';\r\n } else {\r\n $data = '<select ' . $script . ' size=\"30\" style=\"width: 90%;\" class=\"cmb' . $table . '\" id=\"cmb' . $table . '\">\r\n <option value=\"\">Ninguno</option>';\r\n }\r\n } else {\r\n if ($table == \"servicios\") {\r\n $data = '<select size=\"30\" style=\"width: 90%; float:right;\" multiple=\"multiple\" class=\"cmb' . $table . '\" id=\"cmb' . $table . '\">\r\n <option value=\"\">Ninguno</option>';\r\n } else {\r\n $data = '<select size=\"30\" style=\"width: 90%; float:right;\" multiple=\"multiple\" class=\"cmb' . $table . 'x\" id=\"cmb' . $table . 'x\">\r\n <option value=\"\">Ninguno</option>';\r\n }\r\n }\r\n $c = 0;\r\n $query = mysqli_query($db_conx, $sql);\r\n $n_filas = $query->num_rows;\r\n while ($c < $n_filas) {\r\n $row = mysqli_fetch_array($query);\r\n if ($table == \"servicios\") {\r\n $data .= '<option value=\"' . $row[0] . '\">' . $row[1] . '</option>';\r\n } else {\r\n $data .= '<option value=\"' . $row[0] . '\">' . $row[7] . \" \" . $row[8] . \" \" . $row[5] . \" \" . $row[6] . '</option>';\r\n }\r\n $c++;\r\n }\r\n $data .= '</select>';\r\n echo $data;\r\n}", "protected function getCarriers()\n {\n /** @var \\MageWorx\\ShippingRules\\Model\\ResourceModel\\Carrier\\Collection $carrierCollection */\n $carrierCollection = $this->carrierCollectionFactory->create();\n $result = $carrierCollection->toOptionArray();\n\n return $result;\n }", "public function ctlBuscaCompras(){\n\n\t\t$respuesta = Datos::mdlCompras(\"entradas\");\n\n\t\tforeach ($respuesta as $row => $item){\n\t\t\techo '<option value=\"'.$item[\"codProducto\"].'\">'.$item[\"noOperacion\"].' - '.$item[\"proveedor\"].' - '.$item[\"kg\"].' - '.$item[\"precio\"].'</option>';\n\t\t}\n\t}", "public function getMedicinesToSelectBox() {\n\t\t$data = $this->database->table(self::TABLE_NAME)->fetchAll();\n\t\t$result = [];\n\n\t\tforeach ($data as $key => $value)\n\t\t\t$result[$value->ID_leku] = $value->nazev_leku;\n\n\t\treturn $result;\n\t}", "public function getOptions(){\n //$this->xpath = new DOMXPath($this->document);\n $cssname = \"options-list\";\n $tag = \"ul\";\n $consulta = \"//\".$tag.\"[@class='\".$cssname.\"']\";\n $elements = $this->xpath->query($consulta);\n if ($elements->length > 0){\n foreach($elements as $element){\n $consultaSpan = \"li/span[@class='label']\";\n $spans = $this->xpath->query($consultaSpan, $element);\n if ($spans->length > 0){\n foreach($spans as $span){\n //echo \"La caracteristica es: \".$span->nodeValue.\"<br>\";\n }\n }\n }\n }\n echo \"<br><br>\";\n }", "public function optionList(){\n $this->layout = null;\n\n\t $this->set('chamados',\n $this->Chamado->find('list', array(\n 'fields' => array('Chamado.id', 'Chamado.numero'),\n 'conditions' => array('Chamado.servico_id' => $this->params['url']['servico']))));\n }", "public function getRegistros()\n {\n if($this->input->post('id_cliente'))\n {\n $id_cliente = $this->input->post('id_cliente'); \n $contratos = $this->m_contratos->getRegistros($id_cliente, 'id_cliente');\n \n echo '<option value=\"\" disabled selected style=\"display:none;\">Seleccione una opcion...</option>';\n foreach ($contratos as $row) \n {\n echo '<option value=\"'.$row->id_vehiculo.'\">'.$row->vehiculo.'</option>';\n }\n }\n }", "function allDivisiontoCombo2() {\n $this->load->model('territory/territory_model');\n $fetchAllTerritory = $this->territory_model->fetchFromAnyTable(\"tbl_division\", null, null, null, 10000, 0, \"RESULTSET\", array('division_status' => 1), null);\n $pushdata = array('territory' => $fetchAllTerritory);\n $this->template->draw('territory/allParentDivisionCombo', false, $pushdata);\n }", "function build_rr_list_html($selected,$selected_name,$cid)\n\t{\n\t\tglobal $userdata, $template, $db, $SID, $lang, $phpEx, $phpbb_root_path, $garage_config, $board_config;\n\t\n\t\t$rr_list = \"<select name='rr_id' class='forminput'>\";\n\t\n\t\tif (!empty($selected) )\n\t\t{\n\t\t\t$rr_list .= \"<option value='$selected' selected='selected'>$selected_name</option>\";\n\t\t\t$rr_list .= \"<option value=''>------</option>\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$rr_list .= \"<option value=''>\".$lang['Select_A_Option'].\"</option>\";\n\t\t}\n\t\n\t\t$sql = \"SELECT id, bhp, bhp_unit FROM \" . GARAGE_ROLLINGROAD_TABLE . \" WHERE garage_id = $cid\";\n\t\n\t\tif( !($result = $db->sql_query($sql)) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could not query rollingroad', '', __LINE__, __FILE__, $sql);\n\t\t}\n\t\n\t\twhile ( $rollingroad = $db->sql_fetchrow($result) )\n\t\t{\n\t\t\t$rr_list .= \"<option value='\".$rollingroad['id'].\"'>\".$rollingroad['bhp'].\" BHP @ \".$rollingroad['bhp_unit'].\"</option>\";\n\t\t}\n\t\t$db->sql_freeresult($result);\n\t\t\n\t\t$rr_list .= \"</select>\";\n\t\n\t\t$template->assign_vars(array(\n\t\t\t'RR_LIST' => $rr_list)\n\t\t);\n\t\n\t\treturn;\n\t}", "public function combos()\n {\n $this->view->ambito = array('F' => 'Federal','E'=> 'Estadual','M'=>'Municipal','J'=>'Judicial');\n $this->view->estado = $this->getService('Estado')->comboEstado();\n $this->view->tipoPessoa = $this->getService('TipoPessoa')->getComboDefault(array());\n $this->view->temaVinculado = array('Cavernas', 'Espécies', 'Empreendimentos', 'Unidades de Conservação');\n $this->view->tipoDocumento = $this->getService('TipoDocumento')->getComboDefault(array());\n $this->view->tipoArtefato = $this->getService('TipoArtefato')->listItems(array());\n $this->view->assunto = $this->getService('Assunto')->comboAssunto(array());\n $this->view->prioridade = $this->getService('Prioridade')->listItems();\n $this->view->tipoPrioridade = $this->getService('TipoPrioridade')->listItems();\n $this->view->municipio = $this->getService('VwEndereco')->comboMunicipio(NULL,TRUE);\n }", "public function region_selector() {\n $output = html_writer::tag('legend', get_string('addto', 'format_flexpage'), array('class' => 'format_flexpage_addactivity_heading'));\n $output .= html_writer::tag('div', '', array('id' => 'format_flexpage_region_radios'));\n\n return html_writer::tag('fieldset', $output, array('class' => 'format_flexpage_region_selector'));\n }", "protected function getOptions()\n\t{\n\t\t$db = JFactory::getDbo();\n\t\t$query = $db->getQuery(true);\n\t\t$client = JFactory::getApplication()->input->get('client', '', 'STRING');\n\t\t$options = array();\n\n\t\t// Select the required fields from the table.\n\t\t$query->select('r.id, r.region, r.region_jtext');\n\t\t$query->from('`#__tj_region` AS r');\n\n\t\tif ($client)\n\t\t{\n\t\t\t$query->where('r.' . $client . ' = 1');\n\t\t}\n\n\t\t// @TODO - dirty thing starts\n\t\t// @TODO - @manoj this might need change before World War - III. ;) LOL\n\t\trequire_once JPATH_ADMINISTRATOR . '/components/com_tjfields/models/cities.php';\n\t\t$TjfieldsModelCities = new TjfieldsModelCities;\n\t\t$country = $TjfieldsModelCities->getState('filter.country');\n\n\t\t// @TODO - dirty thing ends\n\n\t\tif ($country)\n\t\t{\n\t\t\t$query->where('r.country_id = ' . $country);\n\t\t\t$query->order($db->escape('r.ordering, r.region ASC'));\n\n\t\t\t$db->setQuery($query);\n\n\t\t\t// Get all regions.\n\t\t\t$regions = $db->loadObjectList();\n\n\t\t\t// Load lang file for regions\n\t\t\t$lang = JFactory::getLanguage();\n\t\t\t$lang->load('tjgeo.regions', JPATH_SITE, null, false, true);\n\n\t\t\tforeach ($regions as $c)\n\t\t\t{\n\t\t\t\tif ($lang->hasKey(strtoupper($c->region_jtext)))\n\t\t\t\t{\n\t\t\t\t\t$c->region = JText::_($c->region_jtext);\n\t\t\t\t}\n\n\t\t\t\t$options[] = JHtml::_('select.option', $c->id, $c->region);\n\t\t\t}\n\t\t}\n\n\t\tif (!$this->loadExternally)\n\t\t{\n\t\t\t// Merge any additional options in the XML definition.\n\t\t\t$options = array_merge(parent::getOptions(), $options);\n\t\t}\n\n\t\treturn $options;\n\t}", "public static function renderSelect();", "function mfcs_get_request_room_list_options($location = NULL, $option = NULL, $hidden = FALSE, $disabled = FALSE) {\n $options = array();\n\n if ($option == 'select') {\n $options[''] = '- Select -';\n }\n\n if ($hidden) {\n $options[0] = 'None';\n }\n\n $rooms = mfcs_load_rooms($location, NULL, NULL, $disabled);\n\n if ($option == 'special') {\n global $base_path;\n $module_path = drupal_get_path('module', 'mfcs');\n\n foreach ($rooms as $room) {\n // to simplify the design and to avoid having to alter the code later on, use the building and room ids as the name of the file.\n $image_file_name = $room->building_id;\n $image_file_path = NULL;\n $image_alt_text = NULL;\n\n // first look for generic building-specific images.\n if (file_exists(DRUPAL_ROOT . '/sites/all/modules/mcneese/mfcs/images/buildings/' . $image_file_name . '.png')) {\n $image_file_path = $base_path . $module_path . '/images/buildings/' . $image_file_name . '.png';\n $image_alt_text = FALSE;\n }\n elseif (file_exists(DRUPAL_ROOT . '/sites/all/modules/mcneese/mfcs/images/buildings/' . $image_file_name . '.jpg')) {\n $image_file_path = $base_path . $module_path . '/images/buildings/' . $image_file_name . '.jpg';\n $image_alt_text = FALSE;\n }\n\n // then look for room-specific images.\n $image_file_name .= '-' . $room->room_id;\n if (file_exists(DRUPAL_ROOT . '/sites/all/modules/mcneese/mfcs/images/rooms/' . $image_file_name . '.png')) {\n $image_file_path = $base_path . $module_path . '/images/rooms/' . $image_file_name . '.png';\n $image_alt_text = TRUE;\n }\n elseif (file_exists(DRUPAL_ROOT . '/sites/all/modules/mcneese/mfcs/images/rooms/' . $image_file_name . '.jpg')) {\n $image_file_path = $base_path . $module_path . '/images/rooms/' . $image_file_name . '.jpg';\n $image_alt_text = TRUE;\n }\n unset($image_file_name);\n\n $room_name = NULL;\n if (!empty($room->room_name)) {\n $room_name = check_plain($room->room_name);\n }\n\n $building_name = NULL;\n if (!empty($room->building_name)) {\n $building_name = check_plain($room->building_name);\n }\n\n $room_number = NULL;\n if (!empty($room->room_number)) {\n $room_number = mcneese_fcs_text_capitalization($room->room_number);\n $room_number = check_plain($room_number);\n }\n\n $text = '';\n\n if (!is_null($image_file_path)) {\n if ($image_alt_text) {\n $image_alt_text = trim($building_name . ' ' . $room_name);\n }\n elseif ($image_alt_text === FALSE) {\n $image_alt_text = trim($building_name);\n }\n\n $text .= '<img src=\"' . $image_file_path . '\" alt=\"' . $image_alt_text . '\" width=\"65\" class=\"room_image\">';\n }\n unset($image_alt_text);\n\n $text .= '<div class=\"room_notes\">';\n $text .= '<div class=\"room_number\"><span class=\"room_number-label\">Room:</span> <span class=\"room_number-data\">' . $room_number . '</span></div>';\n\n if (!empty($room->capacity_normal)) {\n $text .= '<div class=\"room_capacity\"><span class=\"capacity-label\">Capacity:</span> <span class=\"capacity-data\">' . check_plain($room->capacity_normal) . '</span></div>';\n }\n $text .= '</div>';\n\n $text .= '<div class=\"building_name\">' . $building_name . '</div>';\n\n if (is_null($room_name)) {\n $room_name = 'No information available.';\n }\n\n $text .= '<div class=\"room_description\"><span class=\"room_description-label\"></span> <span class=\"room_description-data\">' . $room_name . '</span></div>';\n\n $options[$room->room_id] = $text;\n }\n\n // return now to avoid custom sorting.\n return $options;\n }\n elseif ($option == 'room_with_building') {\n foreach ($rooms as $room) {\n $text = '(' . $room->building_code . ') ';\n if (empty($room->room_name) || is_numeric($room->room_number)) {\n $room_number = mcneese_fcs_text_capitalization($room->room_number);\n\n $text .= $room_number;\n unset($room_number);\n }\n else {\n $text .= mcneese_fcs_text_capitalization($room->room_name);\n }\n\n $options[$room->room_id] = $text;\n }\n }\n else {\n foreach ($rooms as $room) {\n if (empty($room->room_name) || is_numeric($room->room_number)) {\n $room_number = mcneese_fcs_text_capitalization($room->room_number);\n\n $options[$room->room_id] = $room_number;\n unset($room_number);\n }\n else {\n $options[$room->room_id] = $room->room_name;\n }\n }\n }\n\n asort($options);\n\n return $options;\n}", "public function carriers()\n {\n return $this->hasMany('App\\SelectedCarrier');\n }", "function rdisplay()\r\n\t{\r\n\t\t$select = $this->open_select().\"\\n\";\r\n\t\tforeach ($this->m_array_options as $options )\r\n\t\t{\r\n\t\t\t\t$selected = ($options['selected'] == true ) ? \"selected\" : \"\";\r\n\t\t\t\t\r\n\t\t\t\t$select .= \"<option value=\\\"\".$options['value'].\"\\\" $selected >\".$options['text'].\"</option> \\n\";\r\n\t\t}\r\n\t\t$select .= $this->close_select().\"\\n\";\r\n\t\treturn $select;\r\n\t}", "public function ctlBuscaProveedores(){\n\n\t\t$respuesta = Datos::mdlProveedores();\n\n\t\tforeach ($respuesta as $row => $item){\n\t\t\techo '<option value=\"'.$item[\"nombre\"].'\">'.$item[\"nombre\"].'</option>';\n\t\t}\n\t}", "public function getBranches($organization_username)\n {\n //Query To Get All The Services Of Specific Branch To Fill Into The Selection Box\n $sqlGetServices=\"SELECT * FROM service s INNER JOIN service_branch sb ON s.service_id=sb.service_id WHERE branch_id=?\";\n \n $sql = \"SELECT branch_id,branch_name FROM branch WHERE org_username=?\";\n \n $values=array($organization_username);\n \n $branches=$this->getInfo($sql,$values);\n \n //Paste The Card's Code Of Every Branch With Its Own Service List\n foreach($branches as $branch)\n {\n $values=array($branch['branch_id']);\n $services=$this->getInfo($sqlGetServices,$values);\n ?>\n <div class=\"col-xs-12 col-sm-6 col-md-3 branches\">\n <div class=\"mainflip\">\n <div class=\"frontside\">\n <div class=\"card\">\n <div class=\"card-body text-center\">\n <p><img class=\" img-fluid\" src=\"pictures/orgIcon.jpg\" alt=\"card image\"></p>\n <h4 class=\"card-title\">\n <?php echo $branch['branch_name']; ?>\n </h4>\n <!-- Select TypeOfService -->\n <div class=\"form-group \">\n <label class=\" control-label \" for=\"selectbasic \">סוג שירות</label>\n <div class=\"\">\n\n <select id=\"<?php echo $branch['branch_id']; ?>\" name=\"services\" class=\"servlist form-control\">\n <?php\n ?>\n <option value=\"---\">---</option>\n <?php\n for($i=0;$i<count($services);$i++)\n {\n ?> \n <option value=\"<?php echo $services[$i]['service_id']; ?>\"><?php echo $services[$i]['service_name']; ?></option>\n <?php\n }\n ?>\n </select>\n </div>\n </div>\n <!-- endSelect -->\n <center>\n <button class=\"queSys btn btn-sm btn-primary btn-block\" value='<?php echo $branch['branch_id']; ?>' name='<?php echo $branch['branch_name']; ?>'>בצע</button>\n </center>\n </div>\n </div>\n </div>\n </div>\n </div>\n <?php\n }\n }", "public function client_option()\n {\n $this->load->model('m_contacts');\n $resultat = $this->m_contacts->liste_option();\n $results = json_decode(json_encode($resultat), true);\n\n echo \"<option value='' selected='selected'>(choisissez)</option>\";\n foreach ($results as $row) {\n echo \"<option value='\" . $row['id'] . \"'>\" . $row['value'] . \"</option>\";\n }\n }", "function selection() {\n global $order;\n\n for ($i=1; $i<13; $i++) {\n $expires_month[] = array('id' => sprintf('%02d', $i), 'text' => strftime('%B',mktime(0,0,0,$i,1,2000)));\n }\n\n $today = getdate();\n for ($i = $today['year']; $i < $today['year'] + 10; $i++) {\n $expires_year[] = array('id' => strftime('%y',mktime(0,0,0,1,1,$i)), 'text' => strftime('%Y',mktime(0,0,0,1,1,$i)));\n }\n $selection = array('id' => $this->code,\n\t 'module' => MODULE_PAYMENT_PAYMENTECH_TEXT_CATALOG_TITLE,\n\t 'fields' => array(array('title' => MODULE_PAYMENT_PAYMENTECH_TEXT_CREDIT_CARD_OWNER,\n\t\t\t\t\t\t\t\t 'field' => html_input_field('paymentech_field_0', $order->paymentech_field_0)),\n\t\t\t\t\t\t array('title' => MODULE_PAYMENT_PAYMENTECH_TEXT_CREDIT_CARD_NUMBER,\n\t\t\t\t\t\t\t\t 'field' => html_input_field('paymentech_field_1', $order->paymentech_field_1)),\n\t\t\t\t\t\t array('title' => MODULE_PAYMENT_PAYMENTECH_TEXT_CREDIT_CARD_EXPIRES,\n\t\t\t\t\t\t\t\t 'field' => html_pull_down_menu('paymentech_field_2', $expires_month, $order->paymentech_field_2) . '&nbsp;' . html_pull_down_menu('paymentech_field_3', $expires_year, $order->paymentech_field_3)),\n\t\t));\n if (MODULE_PAYMENT_PAYMENTECH_USE_CVV == 'True') {\n $selection['fields'][] = array('title' => MODULE_PAYMENT_PAYMENTECH_TEXT_CVV,\n\t\t\t\t\t\t\t\t 'field' => html_input_field('paymentech_field_4', $order->paymentech_field_4, 'size=\"4\", maxlength=\"4\"'));\n }\n return $selection;\n }", "static public function ctrCargarSelectOrientacion(){\r\n\r\n $tabla = \"tbl_orientacion\";\r\n\r\n $respuesta = ModeloModalidades::mdlCargarSelect($tabla);\r\n\r\n return $respuesta;\r\n\r\n }", "public static function getSelectGroups() {\n foreach(self::$MESSAGES['GROUP'] as $group_id => $group_name) {\n $data[] = \"<option value=\\\"$group_id\\\">$group_name</option>\";\n }\n return $data;\n }", "public function getFilters()\n {\n javascript('jquery');\n javascript('modules/hms/page_refresh');\n\n // Get the list of communities\n $communities = RlcFactory::getRlcList($this->term);\n\n $communityList = array('0'=>'All');\n\n foreach($communities as $key=>$val){\n $communityList[$key] = $val;\n }\n\n // Initialize form and submit command\n $submitCmd = CommandFactory::getCommand('ShowAssignRlcApplicants');\n $form = new PHPWS_Form('dropdown_selector');\n $submitCmd->initForm($form);\n $form->setMethod('get');\n \n \n // Community drop down\n $form->addSelect('rlc', $communityList);\n if (isset($this->rlc) && !is_null($this->rlc)) {\n $form->setMatch('rlc', $this->rlc->getId());\n }\n $form->setExtra('rlc', 'onChange=\"refresh_page(\\'dropdown_selector\\')\"');\n\n \n // Student Type drop down\n $form->addSelect('student_type', array(0 => 'All', TYPE_CONTINUING => 'Continuing', TYPE_FRESHMEN => 'Freshmen'));\n if (isset($this->studentType)) {\n $form->setMatch('student_type', $this->studentType);\n }\n $form->setExtra('student_type', 'onChange=\"refresh_page(\\'dropdown_selector\\')\"');\n\n return PHPWS_Template::process($form->getTemplate(), 'hms', 'admin/rlcApplicationListFilters.tpl');\n }", "public function selectAll()\n {\n return $this->contractor->all(['name', 'id']);\n }", "public function getSubdivisionList();", "public function getSelectForm(){\n \treturn View::make('Checklist.SelectForm',array(\n \t\t'MainMenu' => View::make('Menu.MainMenu',array(\n \t\t\t'MoreMenu' => Util::getMenu()\n \t\t)),\n \t\t'Areas' => Util::getSelectAreas(),\n \t\t'Tiendas' => Util::getSelectTiendas()\n \t));\n }", "function getClientDropdown2()\n\t {\n\t\t $data = array();\n\t\t $this->db->from('companies');\n\t\t $this->db->join('synonym','companies.compid=synonym.s_id');\n\t\t $this->db->where('is_client','334');\n\t\t $this->db->order_by('parentname','ASC');\n\t\t $q = $this->db->get();\n\t\t foreach($q->result() as $row)\n\t\t {\n\t\t $data[$row->parentname]=$row->parentname;\n\t\t }\n\t\t return $data;\n\t\t}", "public function ctlBuscaMisBodegas(){\n\n\t\t$respuesta = Datos::mdlBodegas(\"entradas\");\n\n\t\tforeach ($respuesta as $row => $item){\n\t\t\techo '<option value=\"'.$item[\"destino\"].'\">'.$item[\"destino\"].'</option>';\n\t\t}\n\t}", "function getListDiagrammer() {\n\n global $idAnalyst;\n $idProject = $_SESSION[\"permisosDeMenu\"];\n global $diagramerASMController;\n\n //obtenemos con el controlador del diagramador los elementos del select\n //id array para los valores de las opciones\n //array los valores a mostrar\n //action funcion que se desea ejercer en dicho elemento select\n $diagramerASMController = new asmsController;\n $ASMs = $diagramerASMController->getASMstexto($idProject);\n $id = array();\n $array = array();\n for ($i = 0; $i < count($ASMs); $i++) {\n $asm = $ASMs[$i];\n $idASM = $asm->getIdASM();\n $name = $asm->getName();\n $id[] = $idASM;\n $array[] = $name;\n }\n $action = \"lookDiagram(value)\";\n $select = select($id, $array, $action, \"...\");\n return $select;\n}", "public function getSectionAccordingG_R()\n\t{\n\t\t$this->layout = '';\n\t\t$this->autoRender = false;\n\t\t\n\t\t//Load Model\n\t\t$this->loadModel( 'Rack' );\n\t\t\n\t\t//Get Floor Id\n\t\t$groundName = explode(',',$this->request->data['groundText']);\n\t\t$rackText = explode(',',$this->request->data['rackText']);\n\t\t$levelText = explode(',',$this->request->data['levelSelected']);\n\t\t\n\t\t$rack = $rackNameAccordingToFloorText = $this->Rack->find( 'list' , \n\t\t\t\tarray( \n\t\t\t\t\t'fields' => array( 'Rack.id' , 'Rack.rack_level_section' ) , \n\t\t\t\t\t'conditions' => array( 'Rack.floor_name' => $groundName , 'Rack.rack_floorName' => $rackText , 'Rack.level_association' => $levelText ) , 'order' => array( 'Rack.id ASC' ) \n\t\t\t\t\t) \n\t\t\t\t);\t\n\t\t$str = '<select id=\"sectionNumber\" class=\"form-control\" name=\"data[sectionNumber]\" multiple>';\n\t\t$str .= '<option value=\"\">Choose Section Number</option>';\n\t\tforeach( $rack as $rackIndex => $rackValue ):\n\t\t\t$str .= '<option value=\"'.$rackIndex.'\" >' .$rackValue. '</option>';\n\t\tendforeach;\n\t\t$str .= '</select>';\n\t\t\n\t\techo $str; exit;\n\t\t\n\t\t/*$this->set( compact($rackNameAccordingToFloorText) );\n\t\t$this>render( 'rack_number_file' );*/\n\t}", "function getClientsDropdown(){\n\t\t $data = array();\n\t\t $this->db->from('company');\n\t\t $this->db->where('client',1);\n\t\t $this->db->order_by('comp','ASC');\n\t\t $q = $this->db->get();\n\t\t foreach($q->result() as $row)\n\t\t {\n\t\t $data[$row->comp]=$row->comp;\n\t\t }\n\t\t return $data;\n\t }", "public function getSelect();", "public function getSelect();", "function getClientDropdown()\n\t {\n\t\t $data = array();\n\t\t $this->db->from('companies');\n\t\t $this->db->join('synonym','companies.compid=synonym.s_id');\n\t\t $this->db->where('is_client','334');\n\t\t $this->db->order_by('parentname','ASC');\n\t\t $q = $this->db->get();\n\t\t foreach($q->result() as $row)\n\t\t {\n\t\t $data[$row->compid]=$row->parentname;\n\t\t }\n\t\t return $data;\n\t\t}", "function listarCalificacion(){\n $db = new Conexion();\n $optionC = \"\";\n $sql2 = $db->consulta(\"SELECT cod_calificacion, dsc_calificacion FROM vtama_calificacion_prospecto\");\n\n while($key2 = $db->recorrer($sql2)){\n $optionC .= '<option value=\"'.$key2['cod_calificacion'].'\">'.$key2['dsc_calificacion'].'</option>';\n }\n return $optionC;\n}", "public function carregaMarcas(Request $request) {\n\n \t# Define URL baseando no tipo do veiculo para carregamento da marca\n \t$dom = file_get_html($this->getUrl($request->get('tipoVeiculo')));\n\n\t\t$resultado = $dom->find('#marca', 0);\n\t\t$resultado->innertext = str_replace('</option>', '/', $resultado->innertext);\t\t\t \n\t\t$marcas = explode('/', strip_tags($resultado->innertext));\n\t\tunset($marcas[0]);\n\t\treturn response()->json(['erro' => 'false', 'codigo' => '200', 'dados' => $marcas]);\n }", "public function Carrera()\n {\n include('conexion.php');\n $Consulta_Carrera = \"SELECT * FROM p_carrera ORDER BY car_nombre\";\n $Resultado_Consulta_Carrera = $conexion->prepare($Consulta_Carrera);\n $Resultado_Consulta_Carrera->execute();\n while ($a = $Resultado_Consulta_Carrera->fetch())\n {\n echo '<option value=\"'.$a[car_codigo].'\">'.$a[car_nombre].'</option>';\n }\n\n }", "function getAccompagnatore() {\n if ($this->session->userdata('role') == 550 || $this->session->userdata('role') == 551) {\n $txtCollaboratore = $this->input->post('txtCollaboratore');\n $accompagnatoreList = '';\n if ($txtCollaboratore != '')\n $accompagnatoreList = $this->webservicemodel->getAccompagnatoreFromCollaboratore($txtCollaboratore);\n\n if ($accompagnatoreList != '') {\n ?>\n <select id=\"txtAccompagnatore\" name=\"txtAccompagnatore\">\n <option value=\"\">Select Accompagnatore</option>\n <option value=\"All\">All</option>\n <?php\n if ($accompagnatoreList) {\n foreach ($accompagnatoreList as $accompagnatore) {\n ?>\n <option value=\"<?php echo $accompagnatore; ?>\"><?php echo $accompagnatore; ?></option>\n <?php\n }\n }\n ?>\n </select>\n <?php\n } else {\n ?>\n <select id=\"txtAccompagnatore\" name=\"txtAccompagnatore\">\n <option value=\"\">Select Accompagnatore</option>\n </select>\n <?php\n }\n } else {\n redirect('backoffice', 'refresh');\n }\n }", "public function consumablesDropdown()\n {\n $sql = \"SELECT `materials`.`material_id`,`materials`.`material_name`,`materials`.`material_grade`\n FROM `materials`\n\t\t\t\tWHERE `injection` = 1 AND `consumables` = 1\n ORDER BY `materials`.`material_name`;\";\n if($stmt = $this->_db->prepare($sql))\n {\n $stmt->execute();\n while($row = $stmt->fetch())\n {\n $ID = $row['material_id'];\n $NAME = $row['material_name'];\n $GRADE = $row['material_grade'];\n echo '<li><a id=\"'. $NAME .'\" onclick=\"selectConsumable(\\''. $ID .'\\',\\''. $NAME .'\\')\">'. $NAME .'</a></li>'; \n }\n $stmt->closeCursor();\n }\n else\n {\n echo '<li>Something went wrong.'. $db->errorInfo .'</li>'; \n }\n }", "public function getAgents()\n {\n if ($this->request->ajax()) {\n $agents = $this->agent->getAgents();\n $options = '';\n foreach ($agents as $key => $agent) {\n $options .= \"<option value =\" . $key . \">\" . $agent . \"</option>\";\n }\n return $this->success(['options' => $options]);\n } else {\n return $this->fail(['error' => 'The method is not authorized.']);\n }\n }", "private function getSpec() {\n\t\t$html = '<div id=\"tal_ecoles\">';\n\t\t$html .= '<select id=\"tal_listEcoles\" onchange=\"tal_display(this)\">';\n\t\t$html .= '<option value=\"0\" selected=\"\" disabled=\"\">Choose...</option>';\n\t\tforeach ($this->_xml->ecole as $branch) {\n\t\t\t$html .= '<option value=\"'.$branch['id'].'\">'.$branch['name'].'</option>';\n\t\t}\n\t\t$html .= '</select>';\n\t\t$html .= '</div>';\n\n\t\treturn $html;\n\t}", "public function getNewChildSelectOptions()\n {\n $prefix = 'enterprise_customersegment/segment_condition_customer_address_';\n $result = array_merge_recursive(parent::getNewChildSelectOptions(), array(\n array(\n 'value' => $this->getType(),\n 'label' => Mage::helper('enterprise_customersegment')->__('Conditions Combination')\n ),\n Mage::getModel($prefix.'default')->getNewChildSelectOptions(),\n Mage::getModel($prefix.'attributes')->getNewChildSelectOptions(),\n ));\n return $result;\n }", "function select() {\n // Start by using paginate to pull the set of group members.\n \n if(!$this->gid) {\n throw new InvalidArgumentException(_txt('er.notprov.id', array(_txt('ct.co_groups.1'))));\n }\n \n $this->Paginator->settings = $this->paginate;\n $this->Paginator->settings['joins'][0] = array(\n 'table' => 'co_groups',\n 'alias' => 'CoGroup',\n 'type' => 'INNER',\n 'conditions' => array('CoPerson.co_id=CoGroup.co_id')\n );\n $this->Paginator->settings['conditions'] = array('CoGroup.id' => $this->gid);\n $this->Paginator->settings['contain'] = array(\n // Make sure to contain only the CoGroupMembership we're interested in\n// This doesn't appear to actually work, so we'll pull the group membership separately\n// 'CoGroupMember' => array('conditions' => array('CoGroupMember.id' => $this->gid)),\n 'PrimaryName'\n );\n \n $coPeople = $this->Paginator->paginate('CoPerson');\n\n $this->set('co_people', $coPeople);\n \n // Pull the CoGroupMemberships for the retrieved CoPeople\n $coPids = Hash::extract($coPeople, '{n}.CoPerson.id');\n \n $args = array();\n $args['conditions']['CoGroupMember.co_person_id'] = $coPids;\n $args['conditions']['CoGroupMember.co_group_id'] = $this->gid;\n $args['contain'] = false;\n \n $coGroupMembers = $this->CoGroupMember->find('all', $args);\n $coGroupRoles = array();\n \n // Make one pass through to facilitate rendering\n foreach($coGroupMembers as $m) {\n if(isset($m['CoGroupMember']['member']) && $m['CoGroupMember']['member']) {\n $coGroupRoles['members'][ $m['CoGroupMember']['co_person_id'] ] = $m['CoGroupMember']['id'];\n }\n \n if(isset($m['CoGroupMember']['owner']) && $m['CoGroupMember']['owner']) {\n $coGroupRoles['owners'][ $m['CoGroupMember']['co_person_id'] ] = $m['CoGroupMember']['id'];\n }\n }\n \n $this->set('co_group_roles', $coGroupRoles);\n \n // Also find the Group so that its details like name can be rendered\n \n $args = array();\n $args['conditions']['CoGroup.id'] = $this->gid;\n $args['contain'] = array('Co');\n \n $coGroup = $this->CoGroupMember->CoGroup->find('first', $args);\n \n $this->set('co_group', $coGroup);\n }", "function SelectValuesReferenciado($db_conx) {\r\n $sql = \"SELECT * FROM treferenciado ORDER BY ref_descrip ASC\";\r\n $query = mysqli_query($db_conx, $sql);\r\n\r\n $n_filas = $query->num_rows;\r\n $data = '<select size=\"7\" class=\"cmbreferenciado\" id=\"cmbreferenciado\">';\r\n $c = 0;\r\n while ($c < $n_filas) {\r\n $row = mysqli_fetch_array($query);\r\n $data .= '<option value=\"' . $row[0] . '\">' . $row[1] . '</option>';\r\n $c++;\r\n }\r\n $data .= '</select>';\r\n echo $data;\r\n}", "public function allClients()\n\t{\n\t\t$data['clients'] = $this->MainModel->selectAll('client_details', 'client_name');\n\t\t$this->load->view('layout/header');\n\t\t$this->load->view('layout/sidebar');\n\t\t$this->load->view('template/all-clients', $data);\n\t\t$this->load->view('layout/footer');\n\t}", "function getSectorRP($fSector, $opt){\r\nconnect();\r\n switch($opt){\r\n case 0: \r\n $sql = \"select * from pv_sector order by cod_sector\";\r\n\t\t $qry = mysql_query($sql) or die ($sql.mysql_error());\r\n\t\t $row = mysql_num_rows($qry); \r\n\t\t if($row!=0){\r\n\t\t for($i=0; $i<$row; $i++){\r\n\t\t\t $field = mysql_fetch_array($qry);\r\n\t\t\t if($fSector == $field['cod_sector'])echo\"<option value='\".$field['cod_sector'].\"' selected>\".$field['descripcion'].\"</option>\"; \r\n\t\t\t else echo\"<option value='\".$field['cod_sector'].\"'>\".$field['descripcion'].\"</option>\"; \r\n\t\t\t}\r\n\t\t }\r\n }\r\n}", "private function renderSelection() {\n\t\t$selection = $this->getSelection();\n\t\tif ($selection === false) {\n\t\t\treturn '';\n\t\t}\n\t\t$itemList = '';\n\t\tforeach ($selection as $item) {\n\t\t\t$itemList .= '\n\t\t\t\t<div class=\"catelem\" id=\"y_'.$item['SKU'].'\">\n\t\t\t\t\t<span class=\"toggle leaf\" id=\"y_toggle_'.$item['SKU'].'\">&nbsp;</span>\n\t\t\t\t\t<div class=\"catname\" id=\"y_select_'.$item['SKU'].'\">\n\t\t\t\t\t\t<span class=\"catname\">'.fixHTMLUTF8Entities($item['products_name'].' ('.$item['SKU'].')').'</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>';\n\t\t}\n\t\treturn $itemList;\n\n\t}", "private function prepareMenuContentSelectBox() {\r\n\t\t$query = $this->closureModel->getStructureAsBreadcrumbsPath()->fetchPairs(\"id\", \"path\");\r\n\t\treturn $query;\r\n\t}", "function printOptionSections(){\n\t$sql = \"select distinct substring_index(section, '/', -1) sec from package order by sec\";\n\t\n\t$section = isset($_GET['section']) ? $_GET['section'] : '';\n\t\n\t$res = mysql_query($sql);\n\twhile($row = mysql_fetch_array($res)){\n\t\t$selected = '';\n\t\tif($section == $row['sec'])\n\t\t\t$selected = 'selected=\"true\"';\n\t\techo '<option value=\"' . $row['sec'] . '\" ' . $selected . '>' . $row['sec'] . '</option>' . \"\\n\";\n\t}\n}", "public function getNewChildSelectOptions()\n {\n $addressCondition = Mage::getModel(\n 'giftpromo/promo_rule_condition_address'\n );\n $addressAttributes = $addressCondition->loadAttributeOptions()\n ->getAttributeOption();\n $attributes = array();\n $attributes[]\n = array('value' => 'giftpromo/promo_rule_condition_subtotal',\n 'label' => Mage::helper('giftpromo')->__('Sub Total'));\n $attributes[]\n = array('value' => 'giftpromo/promo_rule_condition_grandtotal',\n 'label' => Mage::helper('giftpromo')->__('Grand Total'));\n $attributes[]\n = array('value' => 'giftpromo/promo_rule_condition_discounttotal',\n 'label' => Mage::helper('giftpromo')->__(\n 'Sub Total After Discounts'\n ));\n\n foreach ($addressAttributes as $code => $label) {\n $attributes[] = array('value' =>\n 'giftpromo/promo_rule_condition_address|'\n . $code, 'label' => $label);\n }\n\n\n $checkoutCondition = Mage::getModel(\n 'giftpromo/promo_rule_condition_checkout'\n );\n $checkoutAttributes = $checkoutCondition->loadAttributeOptions()\n ->getAttributeOption();\n $chAttributes = array();\n\n foreach ($checkoutAttributes as $code => $label) {\n $chAttributes[] = array('value' =>\n 'giftpromo/promo_rule_condition_checkout|'\n . $code, 'label' => $label);\n }\n\n $customerRules = array(\n array(\n 'value' => 'giftpromo/promo_rule_condition_customer_conditions',\n 'label' => Mage::helper('giftpromo')->__(\n 'Customer conditions combination'\n ))\n );\n $productRules = array(\n array(\n 'value' => 'giftpromo/promo_rule_condition_product_found',\n 'label' => Mage::helper('giftpromo')->__(\n 'Product attribute combination'\n )\n ),\n array(\n 'value' => 'giftpromo/promo_rule_condition_product_subselect',\n 'label' => Mage::helper('giftpromo')->__(\n 'Products Sub Selection'\n )\n ),\n array(\n 'value' => 'giftpromo/promo_rule_condition_product_subselect_free',\n 'label' => Mage::helper('giftpromo')->__('Cheapest Free')\n ),\n array(\n 'value' => 'giftpromo/promo_rule_condition_product_upgrade',\n 'label' => Mage::helper('giftpromo')->__('Product Upgrades')\n )\n );\n\n $conditions = parent::getNewChildSelectOptions();\n $conditions = array_merge_recursive(\n $conditions,\n array(\n array('label' => Mage::helper('giftpromo')->__(\n 'Cart Attributes'\n ), 'value' => $attributes),\n array('label' => Mage::helper('giftpromo')->__(\n 'Checkout Attributes'\n ), 'value' => $chAttributes),\n array('label' => Mage::helper('giftpromo')->__(\n 'Customer Related Rules'\n ), 'value' => $customerRules),\n array('label' => Mage::helper('giftpromo')->__(\n 'Product Related Rules'\n ), 'value' => $productRules),\n // array('value' => 'giftpromo/promo_rule_condition_twitter_conditions', 'label' => Mage::helper('giftpromo')->__('Twitter conditions combination')),\n )\n );\n\n return $conditions;\n }", "public function getSelectedRegionsCollection()\n\t{\n\t\t$collection = $this->getRegionInstance()->getRegionCollection($this);\n\t\treturn $collection;\n\t}", "public function carriers()\n\t{\n\t\t$carriers = Carrier::all();\n\t\treturn StudentResource::collection($carriers);\n\t}", "function listadoregiones() {\n $query8 = \"SELECT * FROM intranet_roadmap_regiones\";\n $result8 = (array) json_decode(miBusquedaSQL($query8), true) ;\n foreach ($result8 as $pr8) {\n $proyectos .= '<option value=\"'.$pr8['id_region'].'\">'.$pr8['nombre_region'].'</option> \n';\n }\n return $proyectos;\n\n}", "public static function getOptionList() {\n $cotizaciones = Cotizacion::find()->where([\"estado_cotizacion\" => self::ESTADO_ACEPTADA])->orWhere([\"estado_cotizacion\" => self::ESTADO_ACEPTADA_PARTIAL])->all();\n return ArrayHelper::map($cotizaciones, '_id', 'textCotizacion');\n }", "public function get_group($client, $mode)\n {\n if ($mode == 'valides') {\n $criteria = array('client' => $client, 'valid' => true);\n $res = $this->m_feuille_controle->list_option_group($criteria);\n } else {\n $criteria = array('client' => $client, 'valid' => false);\n $res = $this->m_feuille_controle->list_option_group($criteria);\n }\n\n $option = '<option value=\"\">(choisissez)</option>';\n\n if (is_array($res)) {\n foreach ($res as $row) {\n if ($row != '') {\n $option .= '<option value=\"' . site_url('feuille_controle') . '/group/' . $row->name . '\">' . $row->name . '</option>';\n }\n\n };\n }\n\n echo $option;\n }", "public function dropdown()\n {\n $building_id = \\Request::get('building_id');\n return \\App\\Floor::where('building_id', $building_id)->lists('name','id');\n }", "public function showSections() {\n\t\t$sql = $this->conn->query(\"SELECT * FROM section\");\n\t\t$result = $sql->fetchAll();\n\t\t$option = '';\n\t\tforeach ($result as $row) {\n\t\t\t$option .= '<option value=\"'.$row['sec_id'].'\">Grade '.$row['grade_lvl'].' - '.$row['sec_name'].'</option>';\n\t\t}\n\t\techo $option;\n\t}", "function get_flat_modification_select_box($model_id, $current_modification_id)\n {\n $modification_structure = $this->load_modification_structure();\n $rs = '';\n $rs .= '<div id=\"modification_id_div\">';\n $rs .= '<select name=\"modification_id\" id=\"modification_id\">';\n $rs .= '<option value=\"0\">' . Multilanguage::_('L_CHOOSE_MODIFICATION') . '</option>';\n if (is_array($modification_structure['childs'][$model_id])) {\n foreach ($modification_structure['childs'][$model_id] as $modification_id) {\n if ($current_modification_id == $modification_id) {\n $selected = \" selected \";\n } else {\n $selected = \"\";\n }\n $rs .= '<option value=\"' . $modification_id . '\" ' . $selected . '>' . $modification_structure['modification'][$modification_id]['name'] . '</option>';\n //$rs .= '<option value=\"'.$model_id.'\" '.$selected.'>'.str_repeat(' _ ', $level+1).$model_id.'</option>';\n //$rs .= $this->get_model_option_items( $model_structure, $current_model_id );\n }\n }\n $rs .= '</select>';\n $rs .= '</div>';\n return $rs;\n }", "function getFenzuCombo_html($viewid='',$is_relate=false)\n\t{\n\t\tglobal $adb;\n\t\tglobal $app_strings;\n\t\tglobal $current_user;\n\t\t\n\t\t$public_condition = \" 1 \";\n\n\t\t$tabid = getTabid($this->Fenzumodule);\n\t\t$ssql = \"select ec_fenzu.cvid,ec_fenzu.viewname from ec_fenzu inner join ec_tab on ec_tab.name = ec_fenzu.entitytype\";\n\t\t$ssql .= \" where ec_tab.tabid=\".$tabid.\" and \".$public_condition;\n\t\t$result = $adb->getList($ssql);\n\t\t$shtml = array();\n\t\tforeach($result as $cvrow)\n\t\t{\n\t\t\t//all should be gotten via app_strings by dingjianting on 2007-04-24 for Fenzu problem\n\n\t\t\tif($cvrow['viewname'] == $app_strings['All'])\n\t\t\t{\n\t\t\t\t$cvrow['viewname'] = $app_strings['COMBO_ALL'];\n\t\t\t}\n\n\n\t\t\tif(!$is_relate) {\n\t\t\t\tif($cvrow['setdefault'] == 1 && $viewid =='')\n\t\t\t\t{\n\t\t\t\t\t\t\t $shtml .= \"<option selected value=\\\"\".$cvrow['cvid'].\"\\\">\".$cvrow['viewname'].\"</option>\";\n\t\t\t\t\t\t\t $this->setdefaultviewid = $cvrow['cvid'];\n\t\t\t\t}\n\t\t\t\telseif($cvrow['cvid'] == $viewid)\n\t\t\t\t{\n\t\t\t\t\t$shtml .= \"<option selected value=\\\"\".$cvrow['cvid'].\"\\\">\".$cvrow['viewname'].\"</option>\";\n\t\t\t\t\t$this->setdefaultviewid = $cvrow['cvid'];\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$shtml .= \"<option value=\\\"\".$cvrow['cvid'].\"\\\">\".$cvrow['viewname'].\"</option>\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$shtml .= \"<option value=\\\"\".$cvrow['cvid'].\"\\\">\".$cvrow['viewname'].\"</option>\";\n\t\t\t}\n\t\t\t//$shtml[$cvrow['cvid']] = $cvrow['viewname'];\n\t\t}\n\t\treturn $shtml;\n\t}", "private function renderMultiples() {\n\n $tpl = \"\";\n foreach ($this->_selectoresOpcion as $id => $selector) {\n $input = $selector->render(TRUE);\n\n $data = [\n 'input' => $input,\n 'label' => $selector->labelOpcion,\n 'type' => $selector->type,\n\n ];\n if ($this->inline) {\n $tpl .= $this->_obtTemplate($this->estructura('MultiplesInline'), $data);\n } else {\n $data['class'] = Estructura::$cssMultiples;\n $tpl .= $this->_obtTemplate($this->estructura('controlMultiple'), $data);\n }\n\n\n }\n\n return $tpl;\n }", "public function getRubroList()\n {\n $option = '';\n $query = $this->db->query(\"SELECT * FROM rubro\");\n while ($rdata = mysqli_fetch_assoc($query)) {\n $option .= '<option value=\"' . $rdata['idRubro'] . '\" data-inicial=\"' . $rdata['nombreRubro'][0] . '\">' . mb_strtoupper(\n $rdata['nombreRubro']\n ) . '</option>';\n }\n\n return $option;\n }", "function selection() {\r\n global $order;\r\n $onFocus = ' onfocus=\"methodSelect(\\'pmt-' . $this->code . '\\')\"';\r\n $bank_acct_types = array();\r\n $echeck_customer_types = array();\r\n\r\n $bank_acct_types[] = array('id' => 'CHECKING', 'text' => 'Checking');\r\n $bank_acct_types[] = array('id' => 'BUSINESSCHECKING', 'text' => 'Business Checking');\r\n $bank_acct_types[] = array('id' => 'SAVINGS', 'text' => 'Savings');\r\n\r\n $selection = array('id' => $this->code,\r\n 'module' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_CATALOG_TITLE,\r\n 'fields' => array(\r\n array('title' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_BANK_ROUTING_CODE,\r\n 'field' => zen_draw_input_field('authorizenet_echeck_bank_aba_code', '', 'maxlength=\"9\" id=\"'.$this->code.'-echeck-routing-code\"' . $onFocus),\r\n 'tag' => $this->code.'-echeck-routing-code'),\r\n array('title' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_BANK_ACCOUNT_NUM,\r\n 'field' => zen_draw_input_field('authorizenet_echeck_bank_acct_num', '', 'maxlength=\"20\" id=\"'.$this->code.'-echeck-bank-acct-num\"'. $onFocus),\r\n 'tag' => $this->code.'-echeck-bank-acct-num'),\r\n array('title' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_BANK_NAME,\r\n 'field' => zen_draw_input_field('authorizenet_echeck_bank_name', '', 'maxlength=\"50\" id=\"'.$this->code.'-echeck-bank-name\"' . $onFocus),\r\n 'tag' => $this->code.'-echeck-bank-name'),\r\n array('title' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_BANK_ACCOUNT_TYPE,\r\n 'field' => zen_draw_pull_down_menu('authorizenet_echeck_bank_acct_type', $bank_acct_types, '', 'id=\"'.$this->code.'-echeck-bank-acct-type\"' . $onFocus),\r\n 'tag' => $this->code.'-echeck-bank-acct-type'),\r\n array('title' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_BANK_ACCOUNTHOLDER,\r\n 'field' => zen_draw_input_field('authorizenet_echeck_bank_accountholder', $order->billing['firstname'] . ' ' . $order->billing['lastname'], 'maxlength=\"100\" id=\"'.$this->code.'-echeck-bank-acctholder\"' . $onFocus),\r\n 'tag' => $this->code.'-echeck-bank-acctholder') ));\r\n\r\n if (MODULE_PAYMENT_AUTHORIZENET_ECHECK_WFSS_ENABLED == 'True') {\r\n $echeck_customer_types[] = array('id' => 'I', 'text' => 'Individual');\r\n $echeck_customer_types[] = array('id' => 'B', 'text' => 'Business');\r\n $dl_states = array();\r\n global $db;\r\n $sql = \"select zone_code, zone_name\r\n from \" . TABLE_ZONES . \"\r\n where zone_country_id = 223\";\r\n $result = $db->Execute($sql);\r\n while (!$result->EOF) {\r\n $dl_states[] = array('id' => $result->fields['zone_code'], 'text' => $result->fields['zone_name']);\r\n $result->MoveNext();\r\n }\r\n $selection['fields'] = array_merge($selection['fields'], array(\r\n array('title' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_CUST_TYPE,\r\n 'field' => zen_draw_pull_down_menu('echeck_customer_type', $echeck_customer_types, '', 'id=\"'.$this->code.'-echeck-cust-type\"' . $onFocus),\r\n 'tag' => $this->code.'-echeck-cust-type'),\r\n array('title' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_CUST_TAX_ID,\r\n 'field' => zen_draw_input_field('echeck_customer_tax_id', '', 'maxlength=\"9\" id=\"'.$this->code.'-echeck-tax-id\"' . $onFocus),\r\n 'tag' => $this->code.'-echeck-tax-id'),\r\n array('title' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_DL_NUMBER,\r\n 'field' => zen_draw_input_field('echeck_dl_num', '', 'maxlength=\"50\" id=\"'.$this->code.'-echeck-dl-num\"' . $onFocus),\r\n 'tag' => $this->code.'-echeck-dl-num'),\r\n array('title' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_DL_STATE,\r\n 'field' => zen_draw_pull_down_menu('echeck_dl_state', $dl_states, '', 'id=\"'.$this->code.'-echeck-dl-state\"' . $onFocus),\r\n 'tag' => $this->code.'-echeck-dl-state'),\r\n array('title' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_DL_DOB_TEXT,\r\n 'field' => zen_draw_input_field('echeck_dl_dob', '', 'maxlength=\"11\" id=\"'.$this->code.'-echeck-dl-dob\"' . $onFocus) . ' ' . MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_DL_DOB_FORMAT,\r\n 'tag' => $this->code.'-echeck-dl-dob') ));\r\n }\r\n return $selection;\r\n }", "function CCgetCityList($key){\n\t $strCity;\n $strCity = \"\";\n\t $strCity = $strCity.AmISelected(\"Please Select\", $key, \"Please Select\");\n\t $strCity = $strCity.AmISelected(\"Ahmedabad\", $key, \"Ahmedabad\");\n\t $strCity = $strCity.AmISelected(\"Ambala\", $key, \"Ambala\");\n\t $strCity = $strCity.AmISelected(\"Aurangabad\", $key, \"Aurangabad\");\n\t $strCity = $strCity.AmISelected(\"Bangalore\", $key, \"Bangalore\");\n \t $strCity = $strCity.AmISelected(\"Baroda\", $key, \"Baroda\");\n \t $strCity = $strCity.AmISelected(\"Bhiwadi\", $key, \"Bhiwadi\");\n \t $strCity = $strCity.AmISelected(\"Bhopal\", $key, \"Bhopal\");\n\t $strCity = $strCity.AmISelected(\"Bhubneshwar\", $key, \"Bhubneshwar\");\n \t $strCity = $strCity.AmISelected(\"Chandigarh\", $key, \"Chandigarh\");\n\t $strCity = $strCity.AmISelected(\"Chennai\", $key, \"Chennai\");\n \t $strCity = $strCity.AmISelected(\"Cochin\", $key, \"Cochin\");\n\t $strCity = $strCity.AmISelected(\"Coimbatore\", $key, \"Coimbatore\");\n \t $strCity = $strCity.AmISelected(\"Cuttack\", $key, \"Cuttack\");\n\t $strCity = $strCity.AmISelected(\"Dehradun\", $key, \"Dehradun\");\n \t $strCity = $strCity.AmISelected(\"Delhi\", $key, \"Delhi\");\n\t $strCity = $strCity.AmISelected(\"Ernakulam\", $key, \"Ernakulam\");\n\t $strCity = $strCity.AmISelected(\"Faridabad\", $key, \"Faridabad\");\n\t $strCity = $strCity.AmISelected(\"Gaziabad\", $key, \"Gaziabad\");\n \t $strCity = $strCity.AmISelected(\"Gurgaon\", $key, \"Gurgaon\");\n \t $strCity = $strCity.AmISelected(\"Guwahati\", $key, \"Guwahati\");\n\t $strCity = $strCity.AmISelected(\"Hosur\", $key, \"Hosur\");\n \t $strCity = $strCity.AmISelected(\"Hyderabad\", $key, \"Hyderabad\");\n\t $strCity = $strCity.AmISelected(\"Indore\", $key, \"Indore\");\n \t $strCity = $strCity.AmISelected(\"Jabalpur\", $key, \"Jabalpur\");\n \t $strCity = $strCity.AmISelected(\"Jaipur\", $key, \"Jaipur\");\n\t $strCity = $strCity.AmISelected(\"Jalandhar\", $key, \"Jalandhar\");\n\t $strCity = $strCity.AmISelected(\"Jamshedpur\", $key, \"Jamshedpur\");\n \t $strCity = $strCity.AmISelected(\"Kanpur\", $key, \"Kanpur\");\n\t $strCity = $strCity.AmISelected(\"Kharar\", $key, \"Kharar\");\n\t $strCity = $strCity.AmISelected(\"Kochi\", $key, \"Kochi\");\n\t $strCity = $strCity.AmISelected(\"Kolkata\", $key, \"Kolkata\");\n \t $strCity = $strCity.AmISelected(\"Lucknow\", $key, \"Lucknow\");\n\t $strCity = $strCity.AmISelected(\"Ludhiana\", $key, \"Ludhiana\");\n \t $strCity = $strCity.AmISelected(\"Madurai\", $key, \"Madurai\");\n\t $strCity = $strCity.AmISelected(\"Mangalore\", $key, \"Mangalore\");\n\t $strCity = $strCity.AmISelected(\"Mohali\", $key, \"Mohali\");\n \t $strCity = $strCity.AmISelected(\"Mysore\", $key, \"Mysore\");\n\t $strCity = $strCity.AmISelected(\"Mumbai\", $key, \"Mumbai\");\n \t $strCity = $strCity.AmISelected(\"Nagpur\", $key, \"Nagpur\");\n\t $strCity = $strCity.AmISelected(\"Nasik\", $key, \"Nasik\");\n \t $strCity = $strCity.AmISelected(\"Navi Mumbai\", $key, \"Navi Mumbai\");\n\t $strCity = $strCity.AmISelected(\"Noida\", $key, \"Noida\");\n\t $strCity = $strCity.AmISelected(\"Panchkula\", $key, \"Panchkula\");\n\t $strCity = $strCity.AmISelected(\"Patiala\", $key, \"Patiala\");\n\t $strCity = $strCity.AmISelected(\"Patna\", $key, \"Patna\");\n \t $strCity = $strCity.AmISelected(\"Pune\", $key, \"Pune\");\n\t $strCity = $strCity.AmISelected(\"Rajkot\", $key, \"Rajkot\");\n\t $strCity = $strCity.AmISelected(\"Ranchi\", $key, \"Ranchi\");\n\t $strCity = $strCity.AmISelected(\"Raipur\", $key, \"Raipur\");\n\t $strCity = $strCity.AmISelected(\"Rewari\", $key, \"Rewari\");\n\t $strCity = $strCity.AmISelected(\"Sahibabad\", $key, \"Sahibabad\");\n \t $strCity = $strCity.AmISelected(\"Surat\", $key, \"Surat\");\n\t $strCity = $strCity.AmISelected(\"Thane\", $key, \"Thane\");\n\t $strCity = $strCity.AmISelected(\"Thiruvananthapuram\", $key, \"Thiruvananthapuram\");\n \t $strCity = $strCity.AmISelected(\"Trivandrum\", $key, \"Trivandrum\");\n\t $strCity = $strCity.AmISelected(\"Trichy\", $key, \"Trichy\");\n\t $strCity = $strCity.AmISelected(\"Vadodara\", $key, \"Vadodara\");\n \t $strCity = $strCity.AmISelected(\"Vishakapatanam\", $key, \"Vishakapatanam\");\n\t $strCity = $strCity.AmISelected(\"Vizag\", $key, \"Vizag\");\n\t $strCity = $strCity.AmISelected(\"Ziragpur\", $key, \"Ziragpur\");\n\t $strCity = $strCity.AmISelected(\"Others\", $key, \"Others\");\n\t return $strCity;\n\t}", "function SelectValuesLocalizacion($db_conx) {\r\n $sql = \"SELECT loc_codigo, loc_descrip FROM tlocalizacion ORDER BY loc_descrip ASC\";\r\n $query = mysqli_query($db_conx, $sql);\r\n\r\n $data = '<select class=\"localizacion\" id=\"cmblocalizacion\">\r\n <option value=\"\">Seleccione...</option>';\r\n while ($row = mysqli_fetch_array($query)) {\r\n $data .= '<option value=\"' . $row[0] . '\">' . $row[1] . '</option>'; \r\n }\r\n $data .= '</select\">';\r\n echo $data;\r\n}", "function SelectedContact() {\n\t\t\n\t\t$data['display_block2'] = \"\";\n\t\t\t\n\t\t//Get the master id of the selected contact from the Post variable\n $master_id = $this->input->post('master_id');\n\n\t\t//Get the contact details for this master_id from all tables\n $data['display_block2'] .= $this->AddressBook->getSelectedContactDetails($master_id);\n\n //Fill the select box again - better to save this off but do like this for the moment\n $data['display_block'] = $this->AddressBook->selectContacts();\n\n //View the selected contacts dropdown and the details for the selected contact \n $this->load->view('SelectEntry', $data);\n }", "function make_regions_dropdown($search_name='',$cat_id=0){\n\t\t$locations\t\t\t\t=$this->get_locations();\n\t\t$home_location\t\t\t=$_SESSION['home_location'];\n\t\t$available_locations\t=array($home_location->location_id=>\"All \".$home_location->name);\n\t\t//---------------------------------------------------\n\t\tswitch($search_name){\n\t\t\tcase 'businesses':\n\t\t\tcase 'categories':\n\t\t\t\t$business=$this->cls('admin/class/business','external');\n\t\t\t\t$s=query(\"SELECT * FROM business_tbl WHERE failte <> -1\");\n\t\t\t\twhile($one=fetch_object($s)){\n\t\t\t\t\t$continue=true;\n\t\t\t\t\t$one->categories\t=$business->load_business_categories($one->business_id);\n\t\t\t\t\t$one->locations\t\t=$business->load_business_locations($one->business_id);\n\t\t\t\t\tif($cat_id){ //if category specified, then filter\n\t\t\t\t\t\tif(isset($one->categories[$cat_id])){\n\t\t\t\t\t\t\t$continue=true;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t$continue=false;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif($continue){\n\t\t\t\t\t\tforeach($one->locations as $location_id=>$loc){\n\t\t\t\t\t\t\t$available_locations[$location_id]=$locations[$location_id];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\t//$this->debug($search_name.\" = \".$cat_id);\n\t\t//$this->writelog();\n\t\t//---------------------------------------------------\n\t\t$form=$this->mod(\"form\")->form_style('block');\n\t\t$form->element(\"location_id\",array(\"db\"=>1,\"type\"=>\"SELECT\",\"label\"=>\"Location\",\"style\"=>\"width:230px;\",\"data\"=>$available_locations));\n\t\t$form->draw();\n\t\t$html=$form->elements[\"location_id\"]->elem;\n\t\t$html=str_replace(\"<br/>\",\"\",$html);\n\t\t//---------------------------------------------------\n\t\treturn $html;\n\t}", "public function getForSelect()\n {\n return $this->all()->lists('full_name', 'id')->all();\n }", "private function getSelectOptions() {\n $result = \"\";\n if($this->pleaseSelectEnabled) {\n $result .= '<option value=\"null\"> -- Please Select --</option>';\n }\n foreach($this->itemList as $key => $val) {\n $selectedText = \"\";\n if(in_array($key, $this->selectedItems)) {\n $selectedText = 'selected=\"selected\"';\n }\n $result .= '<option value=\"'.$key.'\" '.$selectedText.'>'.$val.'</option>'.\"\\n \\t\";\n }\n return $result;\n }", "protected function getRecursiveSelectOptions() {}", "public function Listar(){\n\t\t\t$view_agendamento = new ViewAgendamentoPacienteFuncionarioClass();\n\n\t\t\t//Chama o método para selecionar os registros\n \n \n \n\t\t\treturn $view_agendamento::Select();\n\t\t}", "static public function ctrCargarSelectModalidad(){\r\n\r\n $tabla = \"tbl_modalidades\";\r\n\r\n $respuesta = ModeloModalidades::mdlCargarSelect($tabla);\r\n\r\n return $respuesta;\r\n\r\n }", "function generateHTMLcboCompanies($selected=\"\", $class=\"\"){\n\t\t\t\treturn arraySelect($this->Companies(), \"idcompany_todo\", \"class=\\\"$class\\\" tabindex=\\\"8\\\" onchange=\\\"javascript:changeProject_todo();\\\" \", $selected, true, false);\n\t\t\t\t\n\t\t\t}", "public function getcboregcondi() {\n \n $sql = \"select ctipo as 'ccondi', dregistro as 'dcondi' from ttabla where ctabla = 37 and ncorrelativo <> 0 order by dregistro;\";\n\t\t$query = $this->db->query($sql);\n \n if ($query->num_rows() > 0) {\n\n $listas = '<option value=\"0\" selected=\"selected\">::Elegir</option>';\n \n foreach ($query->result() as $row)\n {\n $listas .= '<option value=\"'.$row->ccondi.'\">'.$row->dcondi.'</option>'; \n }\n return $listas;\n }{\n return false;\n }\t\n }", "public function get_select_box() {\n $data['sideMenuData'] = fetch_non_main_page_content();\n ini_set('memory_limit','256M');// added by shubhranshu since 500 error due to huge data\n $type = $this->input->post('type');\n $tenant_id = $this->tenant_id;\n $data = array();\n $role_array = array(\"COMPACT\");\n if ($type == \"change\") {\n \n $query = $this->input->post('q');\n $change_individual = $this->classtraineemodel->get_individual_enrol_trainees($tenant_id,$query);\n \n \n $data['change_individual'] = $this->formate_change_individual($change_individual);\n } \n else if($type==\"remvind\")\n {\n \n $query = $this->input->post('q');\n $change_individual = $this->classtraineemodel->get_remv_individual_enrol_trainees($tenant_id,$query);\n $data['change_individual'] = $this->formate_change_individual($change_individual);\n }\n \n else if ($type == \"remove_invoice\" || $type == \"add_invoice\") {\n $query = $this->input->post('q');\n $company_not_paid_invoice = $this->classtraineemodel->get_company_not_paid_invoice($tenant_id,$query);\n $data['company_not_paid_invoice'] = $this->formate_company_not_paid($company_not_paid_invoice);\n } \n else if ($type == \"move_invoice\")\n {\n $query = $this->input->post('q');\n $company_not_paid_invoice = $this->classtraineemodel->get_company_not_paid_invoice($tenant_id,$query);\n $data['company_not_paid_invoice'] = $this->formate_company_not_paid($company_not_paid_invoice);\n }\n else if ($type == \"to_move_invoice\")\n {\n $query = $this->input->post('q');\n $company_id = $this->input->post('company_id');\n $course_id = $this->input->post('course_id');\n $class_id = $this->input->post('class_id');\n $company_not_paid_invoice = $this->classtraineemodel->get_company_not_paid_invoice1($tenant_id,$query,$company_id,$course_id,$class_id);\n $data['company_not_paid_invoice'] = $this->formate_company_not_paid($company_not_paid_invoice);\n }\n else if ($type == \"new\") {\n $data['courses'] = $this->get_active_classcourse_list_by_tenant($tenant_id);\n $data['companies'] = $this->company->get_activeuser_companies_for_tenant($tenant_id);\n $tenant_company = fetch_tenant_details($this->session->userdata('userDetails')->tenant_id);\n $tenant_obj = new stdClass;\n if(!in_array($this->session->userdata('userDetails')->role_id,$role_array)) {\n $tenant_obj->company_id = $tenant_company->tenant_id;\n $tenant_obj->company_name = $tenant_company->tenant_name;\n $data['companies'][]=$tenant_obj;\n } \n }\n echo json_encode($data);\n exit();\n }", "public function getcboregLocalclie($ccliente) {\n \n $sql = \"select cestablecimiento as 'clocal', ((if isnull(dcortaestablecimiento,'') = '' then '' else dcortaestablecimiento+ ' - ' end if) + destablecimiento + ' - ' + ddireccion ) as 'dlocal'\n from mestablecimientocliente \n where ccliente = '\".$ccliente.\"' \n and sregistro = 'A' \n order by destablecimiento asc;\";\n\t\t$query = $this->db->query($sql);\n \n if ($query->num_rows() > 0) {\n\n $listas = '<option value=\"0\" selected=\"selected\">::Elegir</option>';\n \n foreach ($query->result() as $row)\n {\n $listas .= '<option value=\"'.$row->clocal.'\">'.$row->dlocal.'</option>'; \n }\n return $listas;\n }{\n return false;\n }\t\n }", "function select() {\r\n $ing_item = $this->ing_item;\r\n $ing_estado_ingreso = $this->ing_estado_ingreso;\r\n $ing_item = $this->ing_item;\r\n $prov_id = $this->prov_id;\r\n $ing_numerodoc = $this->ing_numerodoc;\r\n $ing_tipodoc = $this->ing_tipodoc;\r\n $bod_codigo = $this->bod_codigo;\r\n\r\n $sql = \"SELECT * FROM ing_ingreso_det h INNER JOIN ingreso_compra p ON p.ing_numerodoc = h.ing_numerodoc WHERE p.ing_estado_doc > '0' \";\r\n if ($ing_estado_ingreso != null) {\r\n $sql = $sql . \"AND h.ing_estado_ingreso = '\" . $ing_estado_ingreso . \"' \";\r\n } else {\r\n $sql = $sql . \"AND h.ing_estado_ingreso > '0' \";\r\n }\r\n if ($ing_item != null) {\r\n $sql = $sql . \"AND h.ing_item = '\" . $ing_item . \"' \";\r\n }\r\n if ($prov_id != null) {\r\n $sql = $sql . \"AND h.prov_id = '\" . $prov_id . \"' \";\r\n }\r\n if ($ing_numerodoc != null) {\r\n $sql = $sql . \"AND h.ing_numerodoc = '\" . $ing_numerodoc . \"' \";\r\n }\r\n if ($ing_tipodoc != null) {\r\n $sql = $sql . \"AND h.ing_tipodoc = '\" . $ing_tipodoc . \"' \";\r\n }\r\n if ($bod_codigo != null) {\r\n $sql = $sql . \"AND h.bod_codigo = '\" . $bod_codigo . \"' \";\r\n }\r\n\r\n\r\n $result = $this->database->query($sql);\r\n\r\n $i = 0;\r\n while ($datos = $this->database->fetch_array($result)) {\r\n $this->arringdet[$i]['ing_item'] = $datos['ing_item'];\r\n $this->arringdet[$i]['prov_id'] = $datos['prov_id'];\r\n $this->arringdet[$i]['ing_numerodoc'] = $datos['ing_numerodoc'];\r\n $this->arringdet[$i]['ing_tipodoc'] = $datos['ing_tipodoc'];\r\n $this->arringdet[$i]['prod_equiv_id'] = $datos['prod_equiv_id'];\r\n $this->arringdet[$i]['bod_codigo'] = $datos['bod_codigo'];\r\n $this->arringdet[$i]['prod_codigo'] = $datos['prod_codigo'];\r\n $this->arringdet[$i]['ing_bodega'] = $datos['ing_bodega'];\r\n $this->arringdet[$i]['ing_zeta'] = $datos['ing_zeta'];\r\n $this->arringdet[$i]['ing_cantidad1'] = $datos['ing_cantidad1'];\r\n $this->arringdet[$i]['ing_cantidad_bulto'] = $datos['ing_cantidad_bulto'];\r\n $this->arringdet[$i]['ing_unid_bulto'] = $datos['ing_unid_bulto'];\r\n $this->arringdet[$i]['ing_valor1'] = $datos['ing_valor1'];\r\n $this->arringdet[$i]['ing_valor2'] = $datos['ing_valor2'];\r\n $this->arringdet[$i]['ing_estado_ingreso'] = $datos['ing_estado_ingreso'];\r\n $this->arringdet[$i]['ing_peso'] = $datos['ing_peso'];\r\n $this->arringdet[$i]['ing_umed_peso'] = $datos['ing_umed_peso'];\r\n $this->arringdet[$i]['ing_valor_total'] = $datos['ing_valor_total'];\r\n\r\n $this->arringdet[$i]['ing_correlativo'] = $datos['ing_correlativo'];\r\n $this->arringdet[$i]['ing_fechadoc'] = $datos['ing_fechadoc'];\r\n $this->arringdet[$i]['ing_fechavisacion'] = $datos['ing_fechavisacion'];\r\n $this->arringdet[$i]['ing_numerovisacion'] = $datos['ing_numerovisacion'];\r\n $this->arringdet[$i]['ing_moneda'] = $datos['ing_moneda'];\r\n $this->arringdet[$i]['ing_tipodecambio'] = $datos['ing_tipodecambio'];\r\n $this->arringdet[$i]['ing_iva'] = $datos['ing_iva'];\r\n $this->arringdet[$i]['ing_ciftotal'] = $datos['ing_ciftotal'];\r\n $this->arringdet[$i]['ing_costototal'] = $datos['ing_costototal'];\r\n $this->arringdet[$i]['ing_viutotal'] = $datos['ing_viutotal'];\r\n $this->arringdet[$i]['ing_estado_pago'] = $datos['ing_estado_pago'];\r\n $this->arringdet[$i]['ing_estado_doc'] = $datos['ing_estado_doc'];\r\n $this->arringdet[$i]['ing_neto'] = $datos['ing_neto'];\r\n $this->arringdet[$i]['ing_total'] = $datos['ing_total'];\r\n $this->arringdet[$i]['ing_tipodocsve'] = $datos['ing_tipodocsve'];\r\n $this->arringdet[$i]['ing_bodega_rec'] = $datos['ing_bodega_rec'];\r\n }\r\n }", "public function selecionarAction() { \r\n // Recupera os parametros da requisição\r\n $params = $this->_request->getParams();\r\n \r\n // Instancia a classes de dados\r\n $menus = new WebMenuSistemaModel();\r\n \r\n // Retorna para a view os menus cadastrados\r\n $this->view->menus = $menus->getMenus();\r\n \r\n // Define os filtros para a cosulta\r\n $where = $menus->addWhere(array(\"CD_MENU = ?\" => $params['cd_menu']))->getWhere();\r\n \r\n // Recupera o sistema selecionado\r\n $menu = $menus->fetchRow($where);\r\n \r\n // Reenvia os valores para o formulário\r\n $this->_helper->RePopulaFormulario->repopular($menu->toArray(), \"lower\");\r\n }", "public function getcboestado() {\n \n\t\t$resultado = $this->mregctrolprov->getcboestado();\n\t\techo json_encode($resultado);\n\t}", "function select() {\r\n\r\n $oc_id = $this->oc_id;\r\n $prov_id = $this->prov_id;\r\n $oc_tipo = $this->oc_tipo;\r\n $oc_estado = $this->oc_estado;\r\n $oc_fecha_entrega = $this->oc_fecha_entrega;\r\n $oc_fecha_entrega_fin = $this->oc_fecha_entrega_fin;\r\n\r\n $sql = \"SELECT * FROM ing_oc p LEFT JOIN efectua_compra h ON p.oc_id=h.oc_id WHERE \";\r\n\r\n if ($oc_estado != null) {\r\n $sql = $sql . \"p.oc_estado = '\" . $oc_estado . \"' \";\r\n } else {\r\n $sql = $sql . \"p.oc_estado > '0' \";\r\n }\r\n if ($oc_id != null) {\r\n $sql = $sql . \"AND p.oc_id = '\" . $oc_id . \"' \";\r\n }\r\n if ($prov_id != null) {\r\n $sql = $sql . \"AND p.prov_id = '\" . $prov_id . \"' \";\r\n }\r\n if ($oc_tipo != null) {\r\n $sql = $sql . \"AND p.oc_tipo = '\" . $oc_tipo . \"' \";\r\n }\r\n if ($oc_fecha_entrega != null) {\r\n if ($oc_fecha_entrega_fin != null) {\r\n $sql = $sql . \"AND P.oc_fecha_entrega BETWEEN '\" . $oc_fecha_entrega . \"' AND '\" . $oc_fecha_entrega_fin . \"' \";\r\n }\r\n $sql = $sql . \"AND P.oc_fecha_entrega = '\" . $oc_fecha_entrega . \"' \";\r\n }\r\n\r\n $result = $this->database->query($sql);\r\n// $result = $this->database->result;\r\n// $row = mysql_fetch_object($result);\r\n\r\n $i = 0;\r\n while ($datos = $this->database->fetch_array($result)) {\r\n $this->arringoc[$i]['prov_id'] = $datos['prov_id'];\r\n $this->arringoc[$i]['oc_id'] = $datos['oc_id'];\r\n $this->arringoc[$i]['oc_codigo'] = $datos['oc_codigo'];\r\n $this->arringoc[$i]['oc_tipo'] = $datos['oc_tipo'];\r\n $this->arringoc[$i]['oc_empresa'] = $datos['oc_empresa'];\r\n $this->arringoc[$i]['oc_log'] = $datos['oc_log'];\r\n $this->arringoc[$i]['oc_estado'] = $datos['oc_estado'];\r\n $this->arringoc[$i]['oc_fecha_entrega'] = $datos['oc_fecha_entrega'];\r\n $this->arringoc[$i]['oc_solicitante'] = $datos['oc_solicitante'];\r\n $this->arringoc[$i]['oc_observacion'] = $datos['oc_observacion'];\r\n $this->arringoc[$i]['oc_neto'] = $datos['oc_neto'];\r\n $this->arringoc[$i]['oc_iva'] = $datos['oc_iva'];\r\n $this->arringoc[$i]['oc_total'] = $datos['oc_total'];\r\n $this->arringoc[$i]['oc_forma_pago'] = $datos['oc_forma_pago'];\r\n $this->arringoc[$i]['oc_condiciones'] = $datos['oc_condiciones'];\r\n $this->arringoc[$i]['oc_tipo_descuento'] = $datos['oc_tipo_descuento'];\r\n $this->arringoc[$i]['oc_impuesto'] = $datos['oc_impuesto'];\r\n $this->arringoc[$i]['oc_gasto_envio'] = $datos['oc_gasto_envio'];\r\n $this->arringoc[$i]['solc_id'] = $datos['solc_id'];\r\n $i++;\r\n }\r\n\r\n// $this->prov_id = $row->prov_id;\r\n//\r\n// $this->oc_id = $row->oc_id;\r\n//\r\n// $this->oc_codigo = $row->oc_codigo;\r\n//\r\n// $this->oc_tipo = $row->oc_tipo;\r\n//\r\n// $this->oc_empresa = $row->oc_empresa;\r\n//\r\n// $this->oc_log = $row->oc_log;\r\n//\r\n// $this->oc_estado = $row->oc_estado;\r\n//\r\n// $this->oc_fecha_entrega = $row->oc_fecha_entrega;\r\n//\r\n// $this->oc_solicitante = $row->oc_solicitante;\r\n//\r\n// $this->oc_observacion = $row->oc_observacion;\r\n//\r\n// $this->oc_neto = $row->oc_neto;\r\n//\r\n// $this->oc_iva = $row->oc_iva;\r\n//\r\n// $this->oc_total = $row->oc_total;\r\n//\r\n// $this->oc_forma_pago = $row->oc_forma_pago;\r\n//\r\n// $this->oc_condiciones = $row->oc_condiciones;\r\n//\r\n// $this->oc_rut_emision = $row->oc_rut_emision;\r\n//\r\n// $this->oc_rut_aprobacion = $row->oc_rut_aprobacion;\r\n//\r\n// $this->oc_cheque_adjunto = $row->oc_cheque_adjunto;\r\n//\r\n// $this->oc_descuento = $row->oc_descuento;\r\n//\r\n// $this->oc_tipo_descuento = $row->oc_tipo_descuento;\r\n//\r\n// $this->oc_impuesto = $row->oc_impuesto;\r\n//\r\n// $this->oc_gasto_envio = $row->oc_gasto_envio;\r\n//\r\n// $this->oc_estado_pago = $row->oc_estado_pago;\r\n }", "public function getValuesHtml()\n {\n $product = $this->getProduct();\n\n\n $selectHtml = '<div class=\"options-list nested\" id=\"options-shipment-' . $product->getId() . '-list\">';\n\n $options = explode(',', $product->getMdlShipments());\n $i = 0;\n foreach ($options as $option) {\n $optionInfo = $optionLabel = $this->shipmentRepository\n ->getByCode($option, $this->_storeManager->getStore()->getId());\n $optionLabel = $optionInfo->getName();\n $selectHtml .= '<div class=\"field choice admin__field admin__field-option required\">' .\n '<input type=\"radio\" id=\"shipment_' .\n $product->getId() . '_' . $i .\n '\" class=\"'\n\n . 'radio admin__control-radio required product-custom-option\" name=\"shipment_' .\n $product->getId()\n .\n '\" data-selector=\"shipment_' . $product->getId() . '\"' .\n ' value=\"' \n . $optionLabel \n . '--'\n . $option \n . '--'\n . $optionInfo->getBillingAddressTopLabel()\n . '--'\n . $optionInfo->getShippingAddressTopLabel()\n . '--'\n . $optionInfo->getIsSameAsBilling()\n . '\" /><label class=\"label admin__field-label\" for=\"shipment_' .\n $product->getId() . '_' . $i .\n '\">\n '\n . $optionLabel . '</span></label></div>';\n\n $i++;\n }\n $selectHtml .= '</div>';\n return $selectHtml;\n\n }", "function clientes( $cliente = null )\n{\n\tglobal $con;\n\t$sql = \"Select Id,Nombre from clientes\n\twhere `Estado_de_cliente` like '-1'\n\tor `Estado_de_cliente` like 'on' order by Nombre\";\n\t$consulta = mysql_query($sql,$con);\n\twhile(true == ($resultado = mysql_fetch_array($consulta))) {\n\t\t$seleccionado = ( $cliente == $resultado[0]) ? \"selected\" : \"\";\n\t\t$texto .= \"<option \".$seleccionado.\" value='\".$resultado[0].\"'>\"\n\t\t. $resultado[1] . \"</option>\";\n\t}\n\treturn $texto;\n}", "function getModelSelectBox($current_mark_id)\n {\n //echo '$current_category_id = '.$current_category_id;\n $category_structure = $this->loadCategoryStructure();\n $mark_structure = $this->load_mark_structure();\n $model_structure = $this->load_model_structure();\n //echo '<pre>';\n //print_r($model_structure);\n $level = 1;\n $rs = '';\n $rs .= '<div id=\"model_id_div\">';\n $rs .= '<select name=\"model_id\">';\n $rs .= '<option value=\"0\">..</option>';\n foreach ($category_structure['childs'][0] as $item_id => $categoryID) {\n //echo $categoryID.'<br>';\n //echo 'items = '.$items.'<br>';\n if ($current_category_id == $categoryID) {\n $selected = \" selected \";\n } else {\n $selected = \"\";\n }\n\n $rs .= '<option disabled>' . str_repeat(' . ', $level) . $category_structure['catalog'][$categoryID]['name'] . '</option>';\n $rs .= $this->get_mark_and_model_option_items($categoryID, $mark_structure, $level, $current_mark_id, $model_structure);\n $rs .= $this->getChildNodes($categoryID, $category_structure, $level + 1, $current_category_id);\n }\n $rs .= '</select>';\n $rs .= '</div>';\n return $rs;\n }", "function build_insurance_list_html($selected,$selected_name)\n\t{\n\t\tglobal $userdata, $template, $db, $SID, $lang, $phpEx, $phpbb_root_path, $garage_config, $board_config;\n\t\n\t\t$insurance_list = '<select name=\"business_id\" class=\"forminput\">';\n\t\n\t\tif (!empty($selected) )\n\t\t{\n\t\t\t$insurance_list .= '<option value=\"'.$selected.'\" selected=\"selected\">'.$selected_name.'</option>';\n\t\t\t$insurance_list .= '<option value=\"\">------</option>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$insurance_list .= '<option value=\"\">'.$lang['Select_A_Business'].'</option>';\n\t\t\t$insurance_list .= '<option value=\"\">------</option>';\n\t\t}\n\t\n\t\t$sql = \"SELECT id, title FROM \" . GARAGE_BUSINESS_TABLE . \" WHERE insurance = 1 ORDER BY title ASC\";\n\t\n\t\tif( !($result = $db->sql_query($sql)) )\n\t\t{\n\t\t\tmessage_die(GENERAL_ERROR, 'Could not query businesses', '', __LINE__, __FILE__, $sql);\n\t\t}\n\t\n\t\twhile ( $insurance = $db->sql_fetchrow($result) )\n\t\t{\n\t\t\t$insurance_list .= '<option value=\"'.$insurance['id'].'\">'.$insurance['title'].'</option>';\n\t\t}\n\t\t$db->sql_freeresult($result);\n\t\t\n\t\t$insurance_list .= \"</select>\";\n\t\n\t\t$template->assign_vars(array(\n\t\t\t'INSURANCE_LIST' => $insurance_list)\n\t\t);\n\t\n\t\treturn ;\n\t}", "function select_vehicle_data($cid)\n\t{\n\t\tglobal $db;\n\t\t//Select All Vehicle Information\n\t \t$sql = \"SELECT g.*, images.*, makes.make, models.model, CONCAT_WS(' ', g.made_year, makes.make, models.model) AS vehicle, count(mods.id) AS total_mods, ( SUM(mods.price) + SUM(mods.install_price) ) AS total_spent, user.username, user.user_avatar_type, user.user_allowavatar, user.user_avatar, user.user_id\n \tFROM \" . GARAGE_TABLE . \" AS g \n\t\t\t\tLEFT JOIN \" . USERS_TABLE .\" AS user ON g.member_id = user.user_id\n\t \tLEFT JOIN \" . GARAGE_MAKES_TABLE . \" AS makes ON g.make_id = makes.id\n \t LEFT JOIN \" . GARAGE_MODELS_TABLE . \" AS models ON g.model_id = models.id\n\t\t\t\tLEFT JOIN \" . GARAGE_MODS_TABLE . \" AS mods ON g.id = mods.garage_id\n\t\t\t\tLEFT JOIN \" . GARAGE_IMAGES_TABLE . \" AS images ON images.attach_id = g.image_id\n \tWHERE g.id = $cid\n\t GROUP BY g.id\";\n\n \t\tif ( !($result = $db->sql_query($sql)) )\n \t\t{\n \t\tmessage_die(GENERAL_ERROR, 'Could Not Get Vehicle Data', '', __LINE__, __FILE__, $sql);\n \t\t}\n\n\t\t$row = $db->sql_fetchrow($result);\n\t\t$db->sql_freeresult($result);\n\n\t\treturn $row;\n\t}", "function get_name_select_list()\n\t{\n\t\treturn $this->get_name_select_edit();\n\t}", "function build_category_html($selected)\n\t{\n\t\tglobal $template, $db;\n\n\t $html = '<select name=\"category_id\" class=\"forminput\">';\n\t\n\t $sql = \"SELECT * FROM \" . GARAGE_CATEGORIES_TABLE . \" ORDER BY title ASC\";\n\t\n\t \tif ( !($result = $db->sql_query($sql)) )\n\t \t{\n\t \tmessage_die(GENERAL_ERROR, 'Could not category of mods for vehicle', '', __LINE__, __FILE__, $sql);\n\t \t}\n\t\n\t while ( $row = $db->sql_fetchrow($result) ) \n\t\t{\n\t\t\t$select = ( $selected == $row['id'] ) ? ' selected=\"selected\"' : '';\n\t\t\t$html .= '<option value=\"' . $row['id'] . '\"' . $select . '>' . $row['title'] . '</option>';\n\t }\n\t\n\t $html .= '</select>';\n\t\n\t\t$template->assign_vars(array(\n\t\t\t'CATEGORY_LIST' => $html)\n\t\t);\n\t\n\t\treturn ;\n\t}", "public function getCartera() {\n\n $result = Array(\n \"opc\" => $this->miempresa->getCartera()\n );\n\n $this->output->set_content_type('application/json')->set_output(json_encode($result));\n }", "function listeRubrique_article($rub_selected)\n{\n\techo \"<select name='rubrique'>\";\n\t$req = mysql_query(\"SELECT * FROM RUBRIQUE WHERE `id_mere` is null;\");\n\twhile($rubrique=mysql_fetch_array($req))\n\t{\n\t\t$selected = \"\";\n\t\tif($rub_selected == $rubrique['id_rubrique'])\n\t\t\t$selected = \"selected='selected'\";\n\t\techo \"<option value='\".$rubrique['id_rubrique'].\"'\".$selected.\">\".$rubrique['titreFR_rubrique'].\"</option>\";\n\t\tgetChildRubrique_article($rubrique['id_rubrique'],0,$rub_selected);\n\t}\n\techo \"</select>\";\n}", "public function getItems()\n\t\t{\n\t\t\t$items = parent::getItems();\n\t\t\tforeach ($items as $item)\n\t\t\t{\n\t\t\t\t$item->subdivision = JText::_('COM_POLYUS_USERS_USERS_SUBDIVISION_OPTION_' . strtoupper($item->subdivision));\n\t\t\t}\n\t\t\treturn $items;\n\t\t}", "public function ajax_show_package_select(){\n\t\t$ml = self::print_package_select_options($_POST['service']);\n\t\techo $ml;\n\t}", "function comboRecompensas($id_recompensa = 0, $filter = \"\", $name_control = \"id_recompensa\"){\n\t$elements = recompensasController::getListAction(9999, $filter); ?>\n\t<select name=\"<?php echo $name_control;?>\" id=\"<?php echo $name_control;?>\" class=\"form-control\">\n\t\t<option value=\"0\"> ---- Selecciona una recompensa ---- </option>\n\t\t<?php foreach($elements['items'] as $element):?>\n\t\t<option value=\"<?php echo $element['id_recompensa'];?>\" <?php if ($id_recompensa == $element['id_recompensa']) echo ' selected=\"selected\" ';?>><?php echo $element['recompensa_name'];?></option>\n\t\t<?php endforeach;?>\n\t</select>\n<?php }", "public function getSelectDataFields();", "public function render_content() {\n\t\t\n\t\t$multiple = '';\n\t\tif ( $this->multi == 1 ) {\n\t\t\t$multiple = 'multiple';\n\t\t}\n\t\t\n\t\tif( $this->choices ) {\n\t\t\t?>\n\t\t\t<div class=\"<?php echo $this->relation; ?>\">\n\t\t\t\t<label>\n\t\t\t\t <span class=\"customize-control-title\"><?php echo esc_html($this->label); ?><span class=\"cody-help\" data-title=\"<?php echo wp_kses_post($this->description); ?>\"></span></span>\n\t\t\t\t <select <?php $this->link(); echo $multiple; ?>>\n\t\t\t\t\t <?php\n\t\t\t\t\t\t\tforeach ( $this->choices as $key=>$val ) {\n\t\t\t\t\t\t\t\tprintf( '<option value=\"%s\" %s>%s</option>', $key, selected( $this->value(), $val, false ), $val );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t ?>\n\t\t\t\t </select>\n\t\t\t\t</label>\n\t\t\t</div>\n\t\t\t<?php\n\t\t} else { ?>\n\t\t\t<div class=\"<?php echo $this->relation; ?>\">\n\t\t\t\t<label>\n\t\t\t\t <span class=\"customize-control-title\">\n\t\t\t\t\t<?php echo esc_html($this->label); ?>\n\t\t\t\t\t<span class=\"cody-help\" data-title=\"<?php echo wp_kses_post($this->description); ?>\"></span>\n\t\t\t\t</span>\n\t\t\t\t <?php echo esc_html( 'Items not found' ); ?>\n\t\t\t\t</label>\n\t\t\t</div>\n\t\t<?php }\n }", "public function obtenerGruposController()\n\t\t{\n\t\t\t$respuesta = Datos::vistaGruposModel(\"grupo\");\n\n\t\t\t#El constructor foreach proporciona un modo sencillo de iterar sobre arrays. foreach funciona sólo sobre arrays y objetos, y emitirá un error al intentar usarlo con una variable de un tipo diferente de datos o una variable no inicializada.\n\n\t\t\tforeach($respuesta as $row => $item)\n\t\t\t{\n\t\t\t\techo'<option value='.$item[\"id_grupo\"].'>'.$item[\"nombre_grupo\"].'</option>';\n\t\t\t}\n\n\t\t}" ]
[ "0.60214794", "0.5506108", "0.54740375", "0.5467219", "0.54433006", "0.5419678", "0.5397817", "0.53754103", "0.5360182", "0.53580415", "0.5314923", "0.53133094", "0.5287259", "0.52863526", "0.52852774", "0.5262639", "0.5234754", "0.5220047", "0.52144784", "0.52144367", "0.52078557", "0.5193508", "0.5189281", "0.51879853", "0.51869303", "0.51640415", "0.51537097", "0.515246", "0.51442343", "0.5143404", "0.51345843", "0.5132345", "0.5121527", "0.5112449", "0.51095396", "0.51046854", "0.51010627", "0.50983346", "0.50944674", "0.50944674", "0.5079836", "0.5056274", "0.5056125", "0.50468886", "0.50329477", "0.5027307", "0.5012552", "0.50064963", "0.50063473", "0.5003959", "0.499905", "0.49989653", "0.49938777", "0.49816775", "0.49775803", "0.49702087", "0.49639353", "0.49539173", "0.49528092", "0.4952422", "0.49521232", "0.4951654", "0.49466774", "0.4939584", "0.49322006", "0.49278232", "0.49276555", "0.49239007", "0.49216217", "0.491865", "0.49108562", "0.490734", "0.49064216", "0.4906079", "0.4902965", "0.48989493", "0.48966148", "0.4895906", "0.48941654", "0.48930055", "0.4886028", "0.48834473", "0.48824888", "0.48785433", "0.4878422", "0.48710832", "0.4866749", "0.48657152", "0.48557788", "0.4852895", "0.48528072", "0.4848238", "0.48454612", "0.4844154", "0.48421475", "0.4840294", "0.48401645", "0.48351645", "0.4829991", "0.48291174", "0.4824" ]
0.0
-1
If older instance of Balticode_Postoffice exists, then this function attempts to remove it
public function removeAction() { $result = array('status' => 'failed'); if ($this->getRequest()->isPost() && $this->getRequest()->getPost('remove') == 'true') { $dirName = Mage::getBaseDir('code').'/local/Balticode/Postoffice'; if (is_dir($dirName) && file_exists($dirName.'/etc/config.xml')) { $directory = new Varien_Io_File(); $deleteResult = $directory->rmdir($dirName, true); if ($deleteResult) { $result['status'] = 'success'; } } } $this->getResponse()->setRawHeader('Content-type: application/json'); $this->getResponse()->setBody(json_encode($result)); return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function removeOldInstanceIfExists() {}", "function onlyoffice_delete_instance(int $id): bool {\n global $DB;\n\n // Delete the record from the database if it exists.\n if (!$rec = $DB->get_record('onlyoffice', ['id' => $id])) {\n return false; // Record doesn't exist.\n }\n\n // Update completion.\n $cm = get_coursemodule_from_instance('onlyoffice', $id);\n api::update_completion_date_event($cm->id, 'onlyoffice', $id, null);\n\n // Delete related records.\n $DB->delete_records('onlyoffice_document', ['onlyoffice' => $rec->id]);\n $DB->delete_records('onlyoffice', ['id' => $rec->id]);\n\n return true;\n}", "public static function uninstall() {\r\n // $pop_ups = get_pages( array('post_type'=>DGDSCROLLBOXTYPE));\r\n // foreach($pop_ups as $pop_up) {\r\n // wp_delete_post($pop_up->ID, true);\r\n // }\r\n }", "protected function removeOldInstanceIfExists() {\n\n\t\t$dir = scandir($this->instancePath);\n\n\t\tforeach ($dir AS $entry) {\n\t\t\tif (is_dir($this->instancePath . '/' . $entry) && $entry != '..' && $entry != '.') {\n\t\t\t\tGeneralUtility::rmdir($this->instancePath . '/' . $entry, TRUE);\n\t\t\t} else if (is_file($this->instancePath . '/' . $entry)) {\n\t\t\t\tunlink($this->instancePath . '/' . $entry);\n\t\t\t}\n\t\t}\n\n\t}", "protected function removeInstance() {}", "public function remove()\n\t{\n\t\t$photosTable = PTA_DB_Table::get('Catalog_Product_Photo');\n\t\t$photos = (array)$photosTable->getPhotos($this->_id);\n\n\t\tif (parent::remove()) {\n\t\t\t$photoFileField = $photosTable->getFieldByAlias('photo');\n\t\t\tforeach ($photos as $photo) {\n\t\t\t\tPTA_Util::unlink(PTA_CONTENT_PATH . '/' . $photo[$photoFileField]);\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "protected function afterRemoving()\n {\n }", "public function destroy(Office $office)\n {\n //\n }", "public function destroy(Office $office)\n {\n //\n }", "function expunge() {\n\t\t$ret = FALSE;\n\t\t// let's force a full load to make sure everything is loaded.\n\t\t// lets not -wjames5\n\t\t//$this->load();\n\t\tif( $this->isValid() ) {\n\t\t\t$this->StartTrans();\n\n\t\t\t// remove all references in blogs_posts_map where post_content_id = content_id\n\t\t\t$query_map = \"DELETE FROM `\".BIT_DB_PREFIX.\"blogs_posts_map` WHERE `post_content_id` = ?\";\n\t\t\t$result = $this->mDb->query( $query_map, array( $this->mContentId ) );\n\n\t\t\t$query = \"DELETE FROM `\".BIT_DB_PREFIX.\"blog_posts` WHERE `content_id` = ?\";\n\t\t\t$result = $this->mDb->query( $query, array( $this->mContentId ) );\n\n\t\t\t// Do this last so foreign keys won't complain (not the we have them... yet ;-)\n\t\t\tif( LibertyMime::expunge() ) {\n\t\t\t\t$ret = TRUE;\n\t\t\t\t$this->CompleteTrans();\n\t\t\t} else {\n\t\t\t\t$this->RollbackTrans();\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}", "function remove() {\n\t\t$db = & JFactory::getDBO();\n\t\t$query = \"delete from #__xmap_sitemap where `id`=\".$this->id;\n\t\t$db->setQuery( $query );\n\t\tif( $db->query() === FALSE ) {\n\t\t\techo _XMAP_ERR_NO_DROP_DB . \"<br />\\n\";\n\t\t\techo mosStripslashes($db->getErrorMsg());\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function removeTag()\n\t{\n\t\tif(isset($this->primarySearchData[$this->ref_tag]))\n\t\t{\n\t\t\tunset($this->primarySearchData[$this->ref_tag]);\n\t\t}\n\t}", "public function unloadDocument() {\n\t\tphpQuery::unloadDocuments($this->getDocumentID());\n\t}", "public function unloadDocument() {\n\t\tphpQuery::unloadDocuments($this->getDocumentID());\n\t}", "public function __destroy()\n\t{\n\t\t$this->Obj_Doc->disconnectWorksheets();\n\t\tunset($this->Obj_Doc);\n\t\t$this->Obj_Doc = false;\n\t}", "public function remove()\n \t{\n \t\tforeach( $this->pages as $page ) {\n\n \t\t\t$page->update( ['menu_id' => null] );\n\n \t\t}\n\n \t\treturn $this->delete();\n \t}", "public function onAfterUnpublish() {\n $this->doDeleteDocumentIfInSearch();\n }", "private function removeOldParts()\n {\n $filename = $this->substream->getFilename();\n for ($i = $this->index + 1; true; ++$i) {\n $indexed_filename = $this->getIndexPartFilename($filename, $i);\n $target = dirname($this->filename).'/'.$indexed_filename;\n if (file_exists($target)) {\n unlink($target);\n } else {\n break;\n }\n }\n }", "public function Delete ()\n {\n try {\n \n $office = new Office($this->parameters);\n \n if (OfficeRepository::getInstance()->find($office->getId()) == null) {\n throw new Exception(\"Office with id ( \" . $office->getId() . \" ) does not exist\");\n }\n \n OfficeRepository::getInstance()->remove($office);\n \n $this->container->setMsg(\"Office successfully removed\")\n ->setSuccess(true)\n ->getData(array(\n \"office\" => $office\n ));\n ;\n } catch (Exception $e) {\n $this->container->setMsg($e->getMessage())\n ->setSuccess(false);\n }\n \n return $this->container;\n }", "function bookking_delete_instance($id) {\n global $DB;\n\n if (! $DB->record_exists('bookking', array('id' => $id))) {\n return false;\n }\n\n $bookking = bookking_instance::load_by_id($id);\n $bookking->delete();\n\n // Clean up any possibly remaining event records.\n $params = array('modulename' => 'bookking', 'instance' => $id);\n $DB->delete_records('event', $params);\n\n return true;\n}", "public function Remove()\n {\n $file = __DIR__ . \\Extensions\\PHPImageWorkshop\\ImageWorkshop::UPLOAD_PATH . \"/banners/\" . $this->getSrc();\n if (file_exists($file)) {\n unlink($file);\n }\n parent::Remove();\n }", "public function removeImage() {\n //check if we have an old image\n if ($this->image) {\n //store the old name to delete the image on the upadate\n $this->temp = $this->image;\n //delete the current image\n $this->setImage(NULL);\n }\n }", "function standardslideshow_delete_instance($id) {\n global $CFG, $DB;\n\n if (! $slideshow = $DB->get_record(\"standardslideshow\", array(\"id\"=>$id))) {\n return false;\n }\n\n $result = true;\n\n if (! $DB->delete_records(\"standardslideshow\", array(\"id\"=>$slideshow->id))) {\n $result = false;\n }\n\n if (! unlink($CFG->dataroot.'/s5/'.$slideshow->id.'.html')) {\n $result = false;\n }\n\n return $result;\n}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "public function afterRemove()\n\t{}", "public function delete() {\n // Find document ID.\n if (!$this->find()) {\n debugging('Failed to find ousearch document');\n return false;\n }\n self::wipe_document($this->id);\n }", "public function remove() {\n\t\t$this->setRemoved(TRUE);\n\t}", "public function remove() {\n\t\tif ($this->_isCreated) {\n\t\t\t// close handle to file and remove it\n\t\t\tfclose($this->_fp);\n\t\t\tif ($result = unlink($this->_pidFile)) {\n\t\t\t\treturn $this->_isRemoved = TRUE;\n\t\t\t} else {\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\t}", "function remove_existing(){\n $db = DB::connect(DB_CONNECTION_STRING);\n \n $sql = \"delete from user \n where postcode = \" . $db->quote($this->postcode) . \"\n and email = \" . $db->quote($this->email) .\"\n and user_id <> \" . $db->quote($this->user_id);\n $db->query($sql); \n }", "public function delete_instance() {\r\n global $DB;\r\n// Will throw exception on failure. \r\n if (!$assignmentid = $this->assignment->get_instance()->id) {\r\n return false;\r\n }\r\n // moodle does not allow cascading of db deletes os have to delete in parts\r\n $DB->delete_records('codehandin_submission', array('assignmentid' => $assignmentid)); // delete the submission\r\n\r\n $checkpoint_select = \"SELECT name FROM {codehandin_checkpoint} WHERE assignmentid = ?\";\r\n $DB->delete_records_select('codehandin_test', \"id IN ($checkpoint_select)\", array($assignmentid));\r\n //$DB->delete_records('codehandin_test', array('checkpointid' => $this->assignment->get_instance()->id));\r\n $DB->delete_records('codehandin_checkpoint', array('assignmentid' => $assignmentid)); // delete the checkpoints\r\n $DB->delete_records('codehandin', array('id' => $assignmentid)); // delete the codehandin\r\n // $DB->delete_records('assignsubmission_file', array('assignment' => $assignmentid));\r\n return true;\r\n }", "public function remove() {}", "function wp_idolondemand_delete_post()\n{\n}", "public function remove() {}", "Function unload(){\n\t\t$this->removeBackup();\n\t\tif($this->info && isset($this->info['im'])){\n\t\t\t@imagedestroy($this->info['im']);\n\t\t}\n\t\t$this->info = false;\n\t}", "function remove() {\n\n\t\t$this->readychk();\n\n\t\t// Remove slide from its queue.\n\t\t$queue = $this->get_queue();\n\t\t$queue->remove_slide($this);\n\t\t$queue->write();\n\n\t\t// Remove slide data files.\n\t\tif (!empty($this->dir_path)) {\n\t\t\trmdir_recursive($this->dir_path);\n\t\t}\n\t}", "function unstick_post($post_id)\n {\n }", "public function undoRestore ()\n {\n if (file_exists ( $this->_previewFilename ))\n {\n unlink($this->_previewFilename);\n }\n }", "function newsslider_delete_instance($id) {\n global $DB;\n\n if (! $newsslider = $DB->get_record(\"newsslider\", array(\"id\"=>$id))) {\n return false;\n }\n\n $result = true;\n\n $cm = get_coursemodule_from_instance('newsslider', $id);\n \\core_completion\\api::update_completion_date_event($cm->id, 'newsslider', $newsslider->id, null);\n\n if (! $DB->delete_records(\"newsslider\", array(\"id\"=>$newsslider->id))) {\n $result = false;\n }\n\n return $result;\n}", "public function DeleteDocumentosFase() {\n\t\t\t$this->objDocumentosFase->Delete();\n\t\t}", "function removeReference($doc_id) {\r\n\t\tApp::import('Model', 'LilBlogs.NbReference'); $this->NbReference = new NbReference();\r\n\t\treturn $this->NbReference->deleteAll(array('id'=>$doc_id));\r\n\t}", "function delete(){\r\n\t\tglobal $wpdb;\r\n\t\t$sql = $wpdb->prepare(\"DELETE FROM \". $wpdb->prefix.EM_BOOKINGS_TABLE . \" WHERE booking_id=%d\", $this->id);\r\n\t\treturn ( $wpdb->query( $sql ) !== false );\r\n\t}", "function delete_book($piecemakerId) \n\t{\n global $wpdb;\n @unlink($this->plugin_path.$this->books_dir.\"/\".$piecemakerId.\".xml\");\n\n $sql = \"delete from `\".$this->table_name.\"` where `id` = '\".$piecemakerId.\"'\";\n $wpdb->query($sql);\n\n unset($_POST['do']);\n $this->manage_books();\n\t}", "public function afterDelete()\n {\n if ($this->image) $this->image->delete();\n if ($this->reindex) Slide::reindex();\n }", "protected function _checkForDupe()\n\t{\n\t\t$this->_oldPre = $this->_pdo->queryOneRow(sprintf('SELECT category, size FROM predb WHERE title = %s', $this->_pdo->escapeString($this->_curPre['title'])));\n\t\tif ($this->_oldPre === false) {\n\t\t\t$this->_insertNewPre();\n\t\t} else {\n\t\t\t$this->_updatePre();\n\t\t}\n\t\t$this->_resetPreVariables();\n\t}", "public function onRemove();", "function instance_delete() {\n global $COURSE, $DB;\n\n // we seek the DB to find if the block's instance exists\n $result = $DB->get_record('block_group_choice', array('course_id' => $COURSE->id, 'instance_id' => $this->instance->id));\n if($result) { // if the block's instance has been found ...\n // ... the block's instance row is deleted from the DB table \n $DB->delete_records_list('block_group_choice','id', array($result->id));\n }\n return true;\n }", "function wyz_delete_business_post() {\n\t$nonce = filter_input( INPUT_POST, 'nonce' );\n\n\tif ( ! wp_verify_nonce( $nonce, 'wyz_ajax_custom_nonce' ) ) {\n\t\twp_die( 'busted' );\n\t}\n\n\tglobal $current_user;\n\twp_get_current_user();\n\n\t$_post_id = intval( $_POST['post-id'] );\n\t$_bus_id = intval( $_POST['bus-id'] );\n\t$_user_id = $current_user->ID;\n\t$post = get_post($_post_id);\n\tif ( $_user_id != $post->post_author && ! user_can( $_user_id, 'manage_options' ) ) {\n\t\twp_die( false );\n\t}\n\n\t$bus_posts = get_post_meta( $_bus_id, 'wyz_business_posts', true );\n\tif ( is_array( $bus_posts ) && ! empty( $bus_posts ) ) {\n\t\tforeach ( $bus_posts as $key => $value ) {\n\t\t\tif ( $value == $_post_id ) {\n\t\t\t\tunset( $bus_posts[ $key ] );\n\t\t\t\t$bus_posts = array_values( $bus_posts );\n\t\t\t\tupdate_post_meta( $_bus_id, 'wyz_business_posts', $bus_posts );\n\t\t\t\twp_trash_post( $_post_id );\n\t\t\t\twp_die( true );\n\t\t\t}\n\t\t}\n\t}\n\twp_die( false );\n}", "function expunge()\n\t{\n\t\t$ret = FALSE;\n\t\tif ($this->isValid() ) {\n\t\t\t$this->mDb->StartTrans();\n\t\t\t$query = \"DELETE FROM `\".BIT_DB_PREFIX.\"irlist` WHERE `content_id` = ?\";\n\t\t\t$result = $this->mDb->query($query, array($this->mContentId ) );\n\t\t\tif (LibertyAttachable::expunge() ) {\n\t\t\t$ret = TRUE;\n\t\t\t\t$this->mDb->CompleteTrans();\n\t\t\t} else {\n\t\t\t\t$this->mDb->RollbackTrans();\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}", "public function removeLastPostFromBlog() {}", "public function removeUnfinishedGalleys() {\n\t\tif (!$this->galleysToUpdate or !count($this->galleysToUpdate)) {\n\t\t\treturn;\n\t\t}\n\t\t$galleyDao =& \\DAORegistry::getDAO('ArticleGalleyDAO');\n\t\tforeach ($this->galleysToUpdate as $galleyItem) {\n\t\t\tif (isset($galleyItem->dirty) and ($galleyItem->dirty === true)) {\n\t\t\t\t$id = $galleyItem->newGalley->getId();\n\t\t\t\t$galleyDao->deleteGalley($galleyItem->newGalley);\n\t\t\t\t$galleyItem->dirty = false;\n\t\t\t\t$this->log->warning('file could not be finished, temporary galley is removed: ' . $id);\n\t\t\t}\n\t\t}\n\t}", "public function removeObjectReallyRemovesTheObjectFromStorage() {\n\t\t$originalObject = new \\F3\\FLOW3\\Fixture\\DummyClass();\n\t\t$this->objectRegistry->putObject('DummyObject', $originalObject);\n\t\t$this->objectRegistry->removeObject('DummyObject');\n\t\t$this->assertFalse($this->objectRegistry->objectExists('DummyObject'), 'removeObject() did not really remove the object.');\n\t}", "public function instance_deleted() {\n $this->purge_all_definitions();\n @rmdir($this->filestorepath);\n }", "public function delete_instance() {\n global $DB;\n // Will throw exception on failure.\n $DB->delete_records('assignfeedback_helixfeedback', array('assignment' => $this->assignment->get_instance()->id));\n return true;\n }", "function undo()\n {\n $this->document->eraseLast();\n }", "public function Remove()\r\n {\r\n $appId = JVar::GetPost(\"appId\");\r\n \r\n AppHelper::Remove($this->Core, $appId);\r\n }", "public static function uninstall() {\n // tenemos que borrar el custom post type\n // Es conveniente borrar todos los datos que ha generado el plugin en la BBDD\n }", "public static function upgradeToNew()\n {\n // Migrate data\n try {\n Db::getInstance()->execute(\n 'INSERT INTO `'._DB_PREFIX_.'mpbpost_order` (`id_order`, `id_shipment`, `retour`, `tracktrace`, `postcode`, `mpbpost_status`, `date_upd`, `mpbpost_final`, `shipment`, `type`)\n SELECT `order_id`, `consignment_id`, `retour`, `tracktrace`, `postcode`, `tnt_status`, `tnt_updated_on`, `tnt_final`, \\'\\', \\'1\\' FROM `'._DB_PREFIX_.'myparcel`'\n );\n } catch (PrestaShopException $e) {\n Logger::addLog(\"MyParcel BE module error: {$e->getMessage()}\");\n }\n\n try {\n /** @var MyParcel $myparcel */\n $myparcel = Module::getInstanceByName('myparcel');\n $myparcel->uninstall();\n Tools::deleteDirectory(_PS_MODULE_DIR_.'myparcel');\n } catch (PrestaShopException $e) {\n Logger::addLog(\"MyParcel BE module error: {$e->getMessage()}\");\n }\n\n // Remove the old template files\n foreach (array(\n _PS_OVERRIDE_DIR_.'controllers/admin/templates/orders/helpers/list/list_content.tpl',\n _PS_OVERRIDE_DIR_.'controllers/admin/templates/orders/helpers/list/list_header.tpl',\n ) as $file) {\n if (file_exists($file)) {\n if (!@unlink($file)) {\n Context::getContext()->controller->warnings[] =\n \"Unable to remove file {$file} due to a permission error. Please remove this file manually!\";\n }\n }\n }\n\n // Clear the smarty cache hereafter\n Tools::clearCache();\n }", "function colormag_delete_post_import() {\n\t$page = get_page_by_title( 'Hello world!', OBJECT, 'post' );\n\n\tif ( is_object( $page ) && $page->ID ) {\n\t\twp_delete_post( $page->ID, true );\n\t}\n}", "protected function delete_old() {\n // this will delete anything odler than 30 days\n $search = 'BEFORE \"' . date(\"j F Y\", strtotime(\"-30 days\")) . '\"';\n $emails = imap_search($this->mbox, $search, SE_UID);\n if(!empty($emails)){\n foreach($emails as $email){\n try {\n imap_delete($this->mbox, $email, FT_UID);\n }\n catch (\\Exception $e) {\n print \"Error processing email (UID $email): \" . $e->getMessage() . \"\\n\";\n }\n }\n }\n\n imap_expunge($this->mbox);\n }", "function roshine_delete_instance($id) {\n global $DB;\n $roshine = $DB->get_record('roshine', array('id' => $id), '*', MUST_EXIST);\n roshine_delete_all_grades($roshine);\n if (! $roshine = $DB->get_record('roshine', array('id' => $id))) {\n return false;\n }\n roshine_delete_all_checks($id);\n $DB->delete_records('roshine_attempts', array('roshineid' => $id));\n $DB->delete_records('roshine', array('id' => $roshine->id));\n return true;\n}", "static function dropInstance($name){\n\t\tif( $name instanceof cacheItem )\n\t\t\t$name = $name->name;\n\t\tif( isset( self::$_instances[$name]))\n\t\t\tunset(self::$_instances[$name]);\n\t\treturn null;\n\t}", "public function uninstall()\r\n {\r\n // Remove\r\n ee()->dbforge->drop_table('tagger');\r\n ee()->dbforge->drop_table('tagger_links');\r\n ee()->dbforge->drop_table('tagger_groups');\r\n ee()->dbforge->drop_table('tagger_groups_entries');\r\n\r\n ee('Model')->get('Action')->filter('class', ucfirst($this->module_name))->all()->delete();\r\n ee('Model')->get('Module')->filter('module_name', ucfirst($this->module_name))->all()->delete();\r\n\r\n return true;\r\n }", "public function destroy() {\n\t\tif($this->delete()) {\n\t\t\t// then remove the file\n\t\t // Note that even though the database entry is gone, this object \n\t\t\t// is still around (which lets us use $this->image_path()).\n\t\t\t$target_path = SITE_ROOT.DS.'public'.DS.$this->image_path();\n\t\t\treturn unlink($target_path) ? true : false;\n\t\t} else {\n\t\t\t// database delete failed\n\t\t\treturn false;\n\t\t}\n\t}", "function delete_book( $id ) {\r\n\treturn wp_delete_post($id);\r\n}", "public function removeExternalPI() {\r\n if(isset($this->externalPI)) {\r\n $this->externalPI->remove();\r\n }\r\n $this->externalPI = null;\r\n }", "function beforeDelete(){\r\n\t\t$photo = $this->findById($this->id);\r\n\t\tunlink($this->dir . $photo['Photo']['small']);\r\n\t\tunlink($this->dir . $photo['Photo']['large']);\r\n\t\treturn true;\r\n\t}", "public function delete_instance() {\n global $DB;\n // Will throw exception on failure.\n $DB->delete_records(constants::M_TABLE,\n array('assignment' => $this->assignment->get_instance()->id));\n return true;\n }", "function deleteDocument($document)\r\n\t{\r\n\t\t$fullPath = $this->library->getLibraryDirectory() . DIRECTORY_SEPARATOR . $document->file;\r\n\t\tif (file_exists($fullPath))\r\n\t\t{\r\n\t\t\tunlink($fullPath);\r\n\t\t}\r\n\t\t\r\n\t\t$document->delete();\r\n\t\treturn true;\r\n\t}", "public function remove()\n {\n return false;\n }", "abstract public function remove();", "abstract public function remove();", "abstract public function remove();", "public function fix_after_deactivation() {\n\t\t$exs = new Util_Environment_Exceptions();\n\n\t\ttry {\n\t\t\t$this->delete_addin();\n\t\t} catch ( Util_WpFile_FilesystemOperationException $ex ) {\n\t\t\t$exs->push( $ex );\n\t\t}\n\n\t\t$this->unschedule();\n\n\t\tif ( count( $exs->exceptions() ) > 0 )\n\t\t\tthrow $exs;\n\t}", "public function upgrade1000402Step1() {\n\t\t$this->db()->query(\"\n DELETE\n FROM xf_thread_banner\n WHERE NOT EXISTS (SELECT thread_id FROM xf_thread)\n \");\n\t}", "public function unpost()\n\t{\n\t\tif ($this->posted)\n\t\t{\n\t\t\t$document_id = Shop_Controller::getDocumentId($this->id, $this->getEntityType());\n\n\t\t\tChartaccount_Entry_Controller::deleteEntriesByDocumentId($document_id);\n\n\t\t\t$this->posted = 0;\n\t\t\t$this->save();\n\t\t}\n\n\t\treturn $this;\n\t}", "function _wp_delete_orphaned_draft_menu_items()\n {\n }", "public function remove_image() {\n\t\t$this->join_name = \"images\";\n\t\t$this->use_layout=false;\n\t\t$this->page = new $this->model_class(Request::get('id'));\n\t\t$image = new WildfireFile($this->param(\"image\"));\n\t\t$this->page->images->unlink($image);\n\t}", "public function delete_business_package($post_data) {\n//echo \"<pre>\";print_r($data);exit();\n $this->db->where('id', $post_data['package_id']);\n $this->db->delete('business_programs');\n\n return true;\n }", "function MaintainRemoveOldPosts()\n{\n\t// Actually do what we're told!\n\tloadSource('RemoveTopic');\n\tRemoveOldTopics2();\n}", "function delete(){\r\n\t\tglobal $wpdb;\r\n\t\t$sql = $wpdb->prepare(\"DELETE FROM \". EM_TICKETS_BOOKINGS_TABLE . \" WHERE ticket_booking_id=%d\", $this->id);\r\n\t\t$result = $wpdb->query( $sql );\r\n\t\treturn apply_filters('em_ticket_booking_delete', ($result !== false ), $this);\r\n\t}", "public function uninstall()\n\t\t{\n\t\t\t$this->_Parent->Database->delete('tbl_pages_types', \"`page_id` = 4294967295\");\n\t\t}", "public function remove_page_editor() {\n\t\tremove_post_type_support('page', 'editor');\n\t}", "function braincert_delete_instance($id) {\n\n global $DB, $CFG;\n\n if (!$braincert = $DB->get_record(\"braincert\", array(\"id\" => $id))) {\n return false;\n }\n $result = true;\n\n if (isset($braincert->class_id)) {\n $removedata['task'] = BRAINCERT_TASK_REMOVE_CLASS;\n $removedata['cid'] = $braincert->class_id;\n\n $getremovestatus = braincert_get_curl_info($removedata);\n if ($getremovestatus['status'] == BRAINCERT_STATUS_OK) {\n echo get_string('braincert_class_removed', 'braincert');\n }\n }\n\n if ($CFG->version >= 2017051500) {\n $cm = get_coursemodule_from_instance('braincert', $id);\n \\core_completion\\api::update_completion_date_event($cm->id, 'braincert', $braincert->id, null);\n }\n if (!$DB->delete_records(\"braincert\", array(\"id\" => $braincert->id))) {\n $result = false;\n }\n\n return $result;\n}", "public function remove() {\n }", "protected function removeOldOptions() {\n $storage_handler = \\Drupal::entityTypeManager()->getStorage('paragraph');\n // Get ids of paragraphs.\n $ids = array_map(function ($item) {\n return $item['target_id'];\n }, $this->entity->get('field_checkbox_answers')->getValue());\n\n $entities = $storage_handler->loadMultiple($ids);\n if ($entities) {\n $storage_handler->delete($entities);\n }\n }", "function restore_current_blog()\n {\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 }", "function remove_from_parent()\n {\n /* Cancel if there's nothing to do here */\n if (!$this->initially_was_account){\n return;\n }\n \n /* include global link_info */\n $ldap= $this->config->get_ldap_link();\n\n /* Remove and write to LDAP */\n plugin::remove_from_parent();\n\n /* Zero arrays */\n $this->attrs['scalixEmailAddress']= array();\n\n /* Unset fake boolean attributes from entry */\n foreach ($this->fakeBooleanAttributes as $val){\n $this->attrs[\"$val\"]= array();\n }\n\n /*unset scalixScalixObject*/\n $this->attrs['scalixScalixObject']=array();\n\n @DEBUG (DEBUG_LDAP, __LINE__, __FUNCTION__, __FILE__,$this->attributes, \"Save\");\n $ldap->cd($this->dn);\n $ldap->modify($this->attrs);\n if (!$ldap->success()){\n msg_dialog::display(_(\"LDAP error\"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, get_class()));\n }\n\n /* Optionally execute a command after we're done */\n $this->handle_post_events(\"remove\");\n }", "function remove_postcustom() {\n\tremove_meta_box( 'postcustom', null, 'normal' );\n}", "public function drop ()\n {\n //delete the records of the lookup value\n $records = LookupValue::where('lookup_type_id', 1)->get();\n foreach ( $records as $record )\n $record->forceDelete();\n\n //delete the lookup definition itself\n $record = LookupType::find(1);\n $record->forceDelete();\n }", "public function delete_instance() {\n global $DB;\n // Will throw exception on failure.\n $DB->delete_records('assignsubmission_circleci',\n array('assignment'=>$this->assignment->get_instance()->id));\n\n return true;\n }", "public function removePage()\n\t{\n\t\tif(isset($this->searchFilters[$this->ref_page]))\n\t\t{\n\t\t\tunset($this->searchFilters[$this->ref_page]);\n\t\t}\n\t}", "public function deleteDocument() {\n $file = $this->getDocumentFile().$this->getAttribute('evidencias')[2];\n\n// check if file exists on server\n if (empty($file) || !file_exists($file)) {\n return false;\n }\n\n// check if uploaded file can be deleted on server\n if (!unlink($file)) {\n return false;\n }\n\n// if deletion successful, reset your file attributes\n $this->evidencias = null;\n\n return true;\n }", "function dllc_delete_instance($id) {\n global $DB;\n\n if (! $dllc = $DB->get_record('dllc', array('id' => $id))) {\n return false;\n }\n\n // Delete any dependent records here.\n\n $DB->delete_records('dllc', array('id' => $dllc->id));\n\n dllc_grade_item_delete($dllc);\n if($dllc->dateheurefin>time())\n {\n dllc_sendmail_ondelete($dllc);\n }\n\n\n\n return true;\n}", "function remove_single_post() {\n remove_action('thematic_singlepost', 'thematic_single_post');\n}", "function iadlearning_delete_instance($id) {\n global $DB;\n\n // Ensure the iad exists.\n if (!$DB->get_record('iadlearning', array('id' => $id))) {\n return false;\n }\n\n // Prepare file record object.\n if (!get_coursemodule_from_instance('iadlearning', $id)) {\n return false;\n }\n\n $result = true;\n if (!$DB->delete_records('iadlearning', array('id' => $id))) {\n $result = false;\n }\n\n return $result;\n}", "function __safeDeleteDocument() {\n\t\ttry {\n\t\t\t$this->solr->deleteById($this->__createDocId());\n\t\t\t$this->solr->commit();\n\t\t\t$this->solr->optimize();\t\n\t\t} catch (Exception $e) {\n\t\t\t$this->log($e, 'solr');\n\t\t}\n\t}", "public static function purgeCollection()\n {\n /** @var string $class */\n $class = self::class;\n\n /** @var FacialRecognition $entity */\n $entity = new $class();\n\n return FaceCollection::deleteCollection($entity->getCollection());\n }" ]
[ "0.66072017", "0.5727663", "0.571674", "0.5569891", "0.54429066", "0.52963406", "0.52603775", "0.5252128", "0.5252128", "0.5216739", "0.519796", "0.51944345", "0.51885086", "0.51885086", "0.5147916", "0.5145917", "0.51420665", "0.51086783", "0.509863", "0.5087804", "0.50802475", "0.5079997", "0.5072425", "0.5041356", "0.5041356", "0.5041356", "0.5041356", "0.5009587", "0.500556", "0.49949774", "0.49935982", "0.49735758", "0.4970384", "0.49408093", "0.4940406", "0.4939931", "0.4931671", "0.4913956", "0.49011216", "0.4880071", "0.48554194", "0.48551482", "0.48462078", "0.48416734", "0.48385924", "0.4834127", "0.48310688", "0.48274454", "0.4824487", "0.48142162", "0.48074442", "0.48009154", "0.47984698", "0.47980893", "0.4791412", "0.4791348", "0.47861466", "0.47830242", "0.4776788", "0.47758052", "0.47656584", "0.47645038", "0.47599554", "0.47535643", "0.47518393", "0.47443783", "0.47418883", "0.47332016", "0.47294095", "0.47291866", "0.47155324", "0.47134438", "0.47049713", "0.47049713", "0.47049713", "0.47036496", "0.46955794", "0.4693349", "0.46892706", "0.4684355", "0.46771166", "0.46678853", "0.465406", "0.4650556", "0.4647256", "0.46383423", "0.4632805", "0.46321177", "0.46306932", "0.46281457", "0.46274975", "0.4627393", "0.46268415", "0.46265966", "0.4625357", "0.46244556", "0.46228182", "0.4621208", "0.46207744", "0.46173", "0.46166033" ]
0.0
-1
function to show errors if action over object is not succeed
public function showError($stmt){ echo "<pre>"; print_r($stmt->errorInfo()); echo "</pre>"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function errorAction() {}", "public function errorAction()\n\t{\n\t}", "public function actionError() {\n \n }", "function error(){}", "public function showFailed();", "protected function executeActionWithErrorHandling() {\n \n }", "public function errorOccured();", "protected function errorAction()\n\t{\n\t\t$this->handleTargetNotFoundError();\n\n\t\treturn $this->getFlattenedValidationErrorMessage();\n\t}", "public function showError();", "private function checkError() : void\n {\n $this->isNotPost();\n $this->notExist();\n $this->notAdmin();\n }", "function actions_init($event, $object_type, $object) {\n \tregister_action(\"error\");\n \treturn true;\n }", "public function error();", "abstract public function error();", "public function failed();", "public function errorMode(){}", "protected function errorAction() {\n\t\t$errorFlashMessage = $this->getErrorFlashMessage();\n\t\tif ($errorFlashMessage !== FALSE) {\n\t\t\t$this->flashMessageContainer->addMessage($errorFlashMessage);\n\t\t}\n\t\t$postNode = $this->arguments['postNode']->getValue();\n\t\tif ($postNode !== NULL) {\n\t\t\t$this->redirect('show', 'Frontend\\Node', 'TYPO3.Neos', array('node' => $postNode));\n\t\t}\n\n\t\t$message = 'An error occurred while trying to call ' . get_class($this) . '->' . $this->actionMethodName . '().' . PHP_EOL;\n\t\tforeach ($this->arguments->getValidationResults()->getFlattenedErrors() as $propertyPath => $errors) {\n\t\t\tforeach ($errors as $error) {\n\t\t\t\t$message .= 'Error for ' . $propertyPath . ': ' . $error->render() . PHP_EOL;\n\t\t\t}\n\t\t}\n\n\t\treturn $message;\n\t}", "public function error(){\n\t}", "public function failure(){\n\t}", "public function verifyUploadFailureAction(){\n\t}", "public abstract function onFail();", "public function callbackFail()\r\n {\r\n //$this->AddOutput(\"<p><i>Form was submitted and the Check() method returned false.</i></p>\");\r\n $this->redirectTo();\r\n }", "public function actionError()\n {\n if($error=Yii::app()->errorHandler->error)\n {\n if($error['code'] != 404 || !isset($aErrorMsg[$error['errorCode']])){\n Yii::log(' error : ' . $error['file'] .\":\". $error['line'] .\":\". $error['message'], 'error', 'system');\n }\n $ret = new ReturnInfo(FAIL_RET, Yii::t('exceptions', $error['message']), intval($error['errorCode']));\n if(Yii::app()->request->getIsAjaxRequest()){\n echo json_encode($ret);\n \n }else{\n if( empty($error['errorCode']) ){\n if(isset($this->aErrorMsg[$error['code']])){\n if(empty($this->aErrorMsg[$error['code']]['message'])) {\n $this->aErrorMsg[$error['code']]['message'] = $error['message'];\n }\n $this->render('error', $this->aErrorMsg[$error['code']]);\n }else{\n $this->render('error', $this->aErrorMsg['1000']);\n }\n }else{\n $this->render('error', $this->aErrorMsg[ $error['errorCode'] ]);\n \n }\n }\n \n } \n }", "public function is_error()\n {\n }", "public function error()\n\t{\n\t}", "public function errorAction() {\n\t\t\n\t\t$errors = $this->_getParam('error_handler');\n\t\t\n\t\tswitch ($errors->type) {\n\t\t\t \n\t\t\tcase Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:\n\t\t\tcase Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:\n\t\t\t\t\n\t\t\t\t// stranka nebyla nalezena - HTTP chybova hlaska 404\n\t\t\t\t$this->getResponse()->setHttpResponseCode(404);\n\t\t\t\t$this->view->message = 'Stránka nenalezena';\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\tdefault:\n\t\t\t\t\n\t\t\t\t// chyba v aplikaci - HTTP chybova hlaska 500\n\t\t\t\t$this->getResponse()->setHttpResponseCode(500);\n\t\t\t\t$this->view->message = 'Chyba v aplikaci';\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t}\n\t\t\n $this->view->env = APPLICATION_ENV;\n\t\t$this->view->exception = $errors->exception;\n\t\t$this->view->request = $errors->request;\n\t\t$this->view->title = 'Objevila se chyba';\r\n\t\t$this->view->showDetails = ini_get('display_errors');\r\n\t\t\n\t\t$this->_helper->layout->setLayout('error');\n\t\t\n\t}", "protected function validate_return_data($data_obj)\r\n {\r\n // Transfer the error message when previous object execution fail\r\n if($data_obj->is_error === true)\r\n {\r\n $status_data = $data_obj->get_return_data_set();\r\n $this->set_error(\r\n $status_data[\"status\"], \r\n $status_data[\"status_information\"],\r\n $status_data[\"status_information\"]\r\n );\r\n } \r\n }", "public function actionError() {\n if ($error = Yii::app()->errorHandler->error) {\n\t\t\t$this->sendRestResponse(500,array(\n\t\t\t\t'status' => false,\n\t\t\t\t'message' => $error['message'],\n\t\t\t\t'data' => $error,\n\t\t\t));\t\t\t\n }\n\t}", "abstract public function isSuccessful();", "public function failed()\n {\n // Do nothing\n }", "public function fails();", "public function fails();", "function output_error() {\r\n return false;\r\n }", "public function triggerError() {\n $this->_errors = true;\n }", "public function has_errors()\n {\n }", "public function callbackFail()\n {\n $this->AddOutput(\"<p><i>Form was submitted and the Check() method returned false.</i></p>\");\n $this->redirectTo();\n }", "public function IsErrorDispatched ();", "public function errors();", "public function errors();", "public function isError();", "public function errorAction() {\n\t\tZend_Layout::getMvcInstance ()->setLayout ( \"light\" );\n\t\t$errors = $this->_getParam ( 'error_handler' );\n\t\tif ($errors->exception->getCode () == 404 || in_array ( $errors->type, array (\n\t\t\t\tZend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ROUTE,\n\t\t\t\tZend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER,\n\t\t\t\tZend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION \n\t\t) )) {\n\t\t\t$this->getResponse ()->setHttpResponseCode ( 404 );\n\t\t\t$this->_helper->viewRenderer ( '404' );\n\t\t}\n\t\t\n\t\t\n\t\t$this->view->content = $errors->exception->getMessage ();\n\t}", "protected function setErrorsExist() {}", "private function _error() {\n\t\trequire $this->_controllerPath . $this->_errorFile;\n\t\t$this->_controller = new ErrorsController();\n\t\t$this->_controller->index();\n\t\treturn false;\n\t}", "public function callbackFail()\n {\n $this->AddOutput(\"<p><i>Form was submitted and the Check() method returned false.</i></p>\");\n }", "public function autherrorAction()\n {\n }", "function showerror() {\r\n if (count($this->error_msgs)>0) {\r\n echo '<p><img src=\"images/eri.gif\"><b>'.lang('Error in form').'</b>:<ul>';\r\n foreach ($this->error_msgs as $errormsg) {\r\n echo '<li>'.$errormsg;\r\n }\r\n echo '</ul></p>';\r\n return True;\r\n }\r\n return False;\r\n }", "private function error()\n {\n $json = array_merge($this->data, ['message' => $this->error, 'class' => 'error']);\n wp_send_json($json);\n }", "public function actionError()\n\t{\n\t\tif($error=Yii::app()->errorHandler->error)\n\t\t{\n//\t\t\tdump($error=Yii::app()->errorHandler->error);exit;\n\t\t\tif(Yii::app()->request->isAjaxRequest){\n\t\t\t\techo $error['message'];\n\t\t\t}else{\n\t\t\t\t$this->render('error', $error);\n\t\t\t}\n\t\t}\n\t}", "public function isError() {}", "public function updateFailed();", "public function hasErrors();", "public function info()\n {\n $this->actionStatus = parent::ACTION_STATUS_FAIL;\n $this->dataExplained['' . parent::KEY_RESPONSE_STATUS . ''] = null;\n return false;\n }", "private function failure() : void\n {\n (new Repository())->disconnect();\n (new Session())->set('user','success', 'Une erreur est survenue nous vous prions de réessayer ultèrieurement');\n header('Location:' . self::REDIRECT_HOME);\n die();\n }", "protected function renderAsError() {}", "public function actionError()\n\t{\n\t\t$error=Yii::app()->errorHandler->error;\n\t\tif($error)\n\t\t{\n\t\t\t$this->setAutoRender(false);\n\t\t\tif(Yii::app()->request->isAjaxRequest)\n\t\t\t\techo $error['message'];\n\t\t\telse\n\t\t\t\t$this->render('error', $error);\n\t\t}\n\t}", "public function succeeded();", "private function checkObjectsErrorsOrConfirmations()\n\t{\n\t\tif (!empty(self::$obj_ts_common->errors))\n\t\t\t$this->errors = array_merge($this->errors, self::$obj_ts_common->errors);\n\n\t\tif (!empty(self::$obj_ts_common->confirmations))\n\t\t\t$this->confirmations = array_merge($this->confirmations, self::$obj_ts_common->confirmations);\n\t}", "public function showToastForValidationError()\n {\n $errorBag = $this->getErrorBag()->all();\n\n if (count($errorBag) > 0) $this->toast($errorBag[0], 'error');\n }", "public function actionError()\r\n\t{\r\n\t if($error=Yii::app()->errorHandler->error)\r\n\t {\r\n\t \tif(Yii::app()->request->isAjaxRequest)\r\n\t \t\techo $error['message'];\r\n\t \telse\r\n\t \t$this->render('error', $error);\r\n\t }\r\n\t}", "public function actionError()\n\t{\t\t\n\t\tif($error=Yii::app()->errorHandler->error)\n\t\t{\n\t\t\tif(Yii::app()->request->isAjaxRequest)\n\t\t\t\techo $error['message'];\n\t\t\telse\n\t\t\t\t$this->render('error', $error);\n\t\t}\n\t}", "public function hasFailed();", "public function markAsFailed();", "public function actionError()\r\n\t{\r\n\t\t$error = Yii::app()->errorHandler->error;\r\n\r\n\t if ($error)\r\n\t {\r\n\t \tif (Yii::app()->request->isAjaxRequest)\r\n\t\t\t{\r\n\t \t\techo $error['message'];\r\n\t\t\t}\r\n\r\n\t \telse\r\n\t\t\t{\r\n\t \t$this->render('error', $error);\r\n\t\t\t}\r\n\t }\r\n\t}", "public function actionError()\r\n {\r\n if($error=Yii::app()->errorHandler->error)\r\n {\r\n if(Yii::app()->request->isAjaxRequest)\r\n echo $error['message'];\r\n else $this->render('error', $error);\r\n }\r\n }", "public function test_if_failed_update()\n {\n }", "public function isOk();", "public function actionError()\r\r\n\t{\r\r\n\t\tif($error = Yii::app()->errorHandler->error)\r\r\n\t\t{\r\r\n\t\t\tif(Yii::app()->request->isAjaxRequest)\r\r\n\t\t\t\techo $error['message'];\r\r\n\t\t\telse\r\r\n\t\t\t\t$this->render('error', $error);\r\r\n\t\t}\r\r\n\t}", "public function actionError()\n\t{\n\t\tif($error=Yii::app()->errorHandler->error)\n\t\t{\n\t\t\tif(Yii::app()->request->isAjaxRequest) {\n\t\t\t\techo $error['message'];\n\t\t\t} else {\n $this->render('error', $error);\n\t\t\t}\t\t\t\t\n\t\t}\n\t}", "public function actionError()\r\n {\r\n if($error=Yii::app()->errorHandler->error)\r\n {\r\n if(Yii::app()->request->isAjaxRequest)\r\n echo $error['message'];\r\n else\r\n $this->render('error', $error);\r\n }\r\n }", "public function actionError() {\n\t if($error=app()->errorHandler->error) {\t\t\n\t \tif(app()->request->isAjaxRequest)\n\t \t\techo $error['message'];\n\t \telse {\n\t\t\t\t$row = Pagecontent::model()->getPageContent('pagenotfound'); // get the page content for the page\n\t\t\t\tif ($row) { // row is found (page has contents) so we are rending the default view\n\t\t\t\t\t$row['html_title'] .= (!empty($row['html_title']) ? ' ' : '') . ' (' . $error['code'] . ')';\n\t\t\t\t\t$this->setPageAttributes($row);\t\t\n\t\t\t\t\t$this->render('default',array ('row'=>$row));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$this->render('error', $error); // execute the error view file \t \t\n\t\t\t}\n\t }\n\t}", "public function actionError()\n\t{\n\t\tif($error=Yii::app()->errorHandler->error)\n\t\t{\n\t\t\tif(Yii::app()->request->isAjaxRequest){\n\t\t\t\techo $error['message'];\n }else{\n\t\t\t\t$this->render('error', $error);\n }\n\t\t}\n\t}", "public function actionError()\n {\n if($error=Yii::app()->errorHandler->error)\n {\n if(Yii::app()->request->isAjaxRequest)\n echo $error['message'];\n else\n $this->render('error', $error);\n }\n }", "public function actionError()\n {\n if($error=Yii::app()->errorHandler->error)\n {\n if(Yii::app()->request->isAjaxRequest)\n echo $error['message'];\n else\n $this->render('error', $error);\n }\n }", "protected function error($action = __MISSING_ACTION__) {\n\t\theader(\"Location: /error.php?Action=\".$action);\t\n\t}", "abstract public function display( $error );", "public function actionError()\n\t{\n\t if($error=Yii::app()->errorHandler->error)\n\t {\n\t \tif(Yii::app()->request->isAjaxRequest)\n\t \t\techo $error['message'];\n\t \telse\n\t \t$this->render('error', $error);\n\t }\n\t}", "public function actionError()\n\t{\n\t if($error=Yii::app()->errorHandler->error)\n\t {\n\t \tif(Yii::app()->request->isAjaxRequest)\n\t \t\techo $error['message'];\n\t \telse\n\t \t$this->render('error', $error);\n\t }\n\t}", "public function actionError()\n\t{\n\t if($error=Yii::app()->errorHandler->error)\n\t {\n\t \tif(Yii::app()->request->isAjaxRequest)\n\t \t\techo $error['message'];\n\t \telse\n\t \t$this->render('error', $error);\n\t }\n\t}", "public function actionError()\n\t{\n\t if($error=Yii::app()->errorHandler->error)\n\t {\n\t \tif(Yii::app()->request->isAjaxRequest)\n\t \t\techo $error['message'];\n\t \telse\n\t \t$this->render('error', $error);\n\t }\n\t}", "public function actionError()\n\t{\n\t if($error=Yii::app()->errorHandler->error)\n\t {\n\t \tif(Yii::app()->request->isAjaxRequest)\n\t \t\techo $error['message'];\n\t \telse\n\t \t$this->render('error', $error);\n\t }\n\t}", "public function actionError()\n\t{\n\t if($error=Yii::app()->errorHandler->error)\n\t {\n\t \tif(Yii::app()->request->isAjaxRequest)\n\t \t\techo $error['message'];\n\t \telse\n\t \t$this->render('error', $error);\n\t }\n\t}", "public function actionError()\n\t{\n\t if($error=Yii::app()->errorHandler->error)\n\t {\n\t \tif(Yii::app()->request->isAjaxRequest)\n\t \t\techo $error['message'];\n\t \telse\n\t \t$this->render('error', $error);\n\t }\n\t}", "public function actionError()\n\t{\n\t if($error=Yii::app()->errorHandler->error)\n\t {\n\t \tif(Yii::app()->request->isAjaxRequest)\n\t \t\techo $error['message'];\n\t \telse\n\t \t$this->render('error', $error);\n\t }\n\t}", "public function actionError()\n\t{\n\t if($error=Yii::app()->errorHandler->error)\n\t {\n\t \tif(Yii::app()->request->isAjaxRequest)\n\t \t\techo $error['message'];\n\t \telse\n\t \t$this->render('error', $error);\n\t }\n\t}", "public function actionError()\n\t{\n\t if($error=Yii::app()->errorHandler->error)\n\t {\n\t \tif(Yii::app()->request->isAjaxRequest)\n\t \t\techo $error['message'];\n\t \telse\n\t \t$this->render('error', $error);\n\t }\n\t}", "public function actionError()\n\t{\n\t if($error=Yii::app()->errorHandler->error)\n\t {\n\t \tif(Yii::app()->request->isAjaxRequest)\n\t \t\techo $error['message'];\n\t \telse\n\t \t$this->render('error', $error);\n\t }\n\t}", "public function actionError()\n {\n $error=Yii::app()->errorHandler->error;\n if($error)\n {\n if(Yii::app()->request->isAjaxRequest)\n echo $error['message'];\n else\n $this->render('error', $error);\n }\n }", "public function displayModelErrors($object)\n {\n if (is_object($object) && method_exists($object, 'getMessages')) {\n foreach ($object->getMessages() as $message) {\n $this->flashSession->error($message);\n }\n } else {\n $this->flashSession->error(t('No object found. No errors.'));\n }\n }", "public function actionError()\n\t{\n\t\tif($error=Yii::app()->errorHandler->error)\n\t\t{\n\t\t\tif(Yii::app()->request->isAjaxRequest)\n\t\t\techo $error['message'];\n\t\t\telse\n\t\t\t$this->render('error', $error);\n\t\t}\n\t}", "public function actionError()\n\t{\n\t\tif($error=Yii::app()->errorHandler->error)\n\t\t{\n\t\t\tif(Yii::app()->request->isAjaxRequest)\n\t\t\techo $error['message'];\n\t\t\telse\n\t\t\t$this->render('error', $error);\n\t\t}\n\t}", "public function actionError()\r\n\t{\r\n\t\tif($error=Yii::app()->errorHandler->error)\r\n\t\t{\r\n\t\t\tif(Yii::app()->request->isAjaxRequest)\r\n\t\t\t\techo $error['message'];\r\n\t\t\telse\r\n\t\t\t\t$this->render('error', $error);\r\n\t\t}\r\n\t}", "public function runError() {\n\t\t\t$this->setSession('sError', $this->getError());\n\n\t\t\t// Set the router\n\t\t\tredirect(\n\t\t\t\t$this->getUrl(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'sRouter' => 'error', \n\t\t\t\t\t\t'sController' => 'index'\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}", "public function runFailed();", "function show_errors()\n\t\t{\n\t\t\t$this->show_errors = true;\n\t\t}", "function show_errors()\n\t\t{\n\t\t\t$this->show_errors = true;\n\t\t}", "public function actionError()\n {\n if ($error = Yii::app()->errorHandler->error)\n {\n if (Yii::app()->request->isAjaxRequest)\n echo $error['message'];\n else\n $this->render('error', $error);\n }\n }", "public function actionError()\n\t{\n\t\treturn $this->render('error');\n\t}", "public function actionError()\n {\n if ($error=Yii::app()->errorHandler->error) {\n if(Yii::app()->request->isAjaxRequest)\n echo $error['message'];\n else\n $this->render('error', $error);\n }\n }", "public function actionError()\n\t{\n\n\t\tif($error=Yii::app()->errorHandler->error)\n\t\t{\n\t\t\tif(Yii::app()->request->isAjaxRequest)\n\t\t\t\techo $error['message'];\n\t\t\telse\n\t\t\t\t$this->render('error', $error);\n\t\t}\n\t}", "public function actionError()\n {\n if ($error = Yii::app()->errorHandler->error) {\n if (Yii::app()->request->isAjaxRequest) echo $error['message'];\n else $this->render('error', $error);\n }\n }", "public function errorAction()\n {\n $this->_logger->debug(__('Calling errorAction'));\n try {\n $this->loadLayout()\n ->_initLayoutMessages('checkout/session')\n ->_initLayoutMessages('catalog/session')\n ->_initLayoutMessages('customer/session');\n $this->renderLayout();\n $this->_logger->info(__('Successful to redirect to error page.'));\n } catch (\\Exception $e) {\n $this->_logger->error(json_encode($this->getRequest()->getParams()));\n $this->_getCheckoutSession()->addError(__('An error occurred during redirecting to error page.'));\n }\n }", "public function forbiddenError() {\n sfContext::getInstance()->getController()->redirect('errores/forbidden');\n\t}" ]
[ "0.7219197", "0.69259965", "0.67331594", "0.66242135", "0.65660596", "0.64370537", "0.6423453", "0.6361327", "0.6356557", "0.6320975", "0.6319154", "0.6235651", "0.62010765", "0.61936754", "0.61688584", "0.61371034", "0.6115529", "0.6103866", "0.6069155", "0.6038038", "0.5989819", "0.59793997", "0.5977488", "0.5961553", "0.59217304", "0.591782", "0.591208", "0.59104663", "0.5899904", "0.5868625", "0.5868625", "0.586474", "0.58618516", "0.5823408", "0.57928264", "0.5792425", "0.5790357", "0.5790357", "0.5776029", "0.5770933", "0.5765316", "0.5752345", "0.5752056", "0.57448334", "0.57405406", "0.57279754", "0.56966805", "0.5690172", "0.56858593", "0.5678118", "0.56722164", "0.5671043", "0.5670874", "0.56501", "0.5643129", "0.5640575", "0.56363666", "0.56266594", "0.56261927", "0.5625781", "0.56209093", "0.5617814", "0.5615431", "0.5615054", "0.56120497", "0.56099606", "0.5608334", "0.5601715", "0.5592968", "0.55901206", "0.55846477", "0.5584368", "0.55839026", "0.5582418", "0.5582104", "0.5582104", "0.5582104", "0.5582104", "0.5582104", "0.5582104", "0.5582104", "0.5582104", "0.5582104", "0.5582104", "0.5582104", "0.5578294", "0.55675507", "0.55653656", "0.55653656", "0.555828", "0.555764", "0.55574214", "0.5557401", "0.5557401", "0.5556086", "0.55552024", "0.55529964", "0.5552214", "0.55522", "0.5546938", "0.55391985" ]
0.0
-1
query to read all fag records
public function readAll($from_record_num, $records_per_page) { $query = "SELECT fag_uid, fag_title, startdato, enddato FROM " . $this->table_name . " ORDER BY startdato DESC LIMIT ?, ?"; // prepare the query $stmt = $this->conn->prepare($query); // bind the values $stmt->bindParam(1, $from_record_num, PDO::PARAM_INT); $stmt->bindParam(2, $records_per_page, PDO::PARAM_INT); // execute query $stmt->execute(); // return values return $stmt; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function readAll();", "public function getAllRecords();", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM recibo';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function ReadAllFfami() {\n $query = \"SELECT * from (select distinct(e.desf ),e.CFAM,DENSE_RANK () OVER (order by e.desf) AS rowNumber\n from fstock16.partsof b \n left outer join fregle00.ffami e on e.cfam=b.cfam \n left outer join fregle00.fSfami f on f.cfam=b.cfam and f.csfam=b.csfam\n left outer join fregle00.FFAMI3 g on g.cfam=b.cfam and g.csfam=b.csfam and g.cfam31=b.cfam3 \n left outer join fregle00.FSERIE H on H.cfam=b.cfam and H.csfam=b.csfam and H.cfam31=b.cfam3 and H.CSER=b.CSERI\n left outer join fregle00.FFOURN i on i.CFOUR= b.CFOUR \nwhere (cdphot<>' ' and cdfich<>' ') and e.desf is not null and b.cfam < 90 and ajt<>'S' \nand stk in (select distinct stk from fstock16.fqtdpa where cdep not in ('CS' , 'E1' , 'E2' , 'E3' , 'V1' , 'V2' , 'ST') and qtef<>0)) as tr\";\n $stmt = $this->conn->prepare($query);\n $stmt->execute();\n return $stmt->fetchAll();\n }", "function readAll()\n {\n }", "protected function _readRecords() {}", "public function readAll(){\r\n $query = \"SELECT * FROM docente;\";\r\n $statement = $this->cdb->prepare($query);\r\n $statement->execute();\r\n $rows = $statement->fetchAll(\\PDO::FETCH_OBJ);\r\n return $rows; \r\n }", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM cst_hit';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "protected function fetchStorageRecords() {}", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function queryAll();", "public function ReadOneFfami(){\n $query = \"SELECT * from fregle00.ffami where cfam=?\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->bindParam(1, $this->cfam);\n $stmt->execute();\n \n return $stmt->fetchAll();\n }", "function get_all_records(){\n\t\tglobal $db;\n\t\t$sql=\"SELECT * FROM $this->table order by id asc\";\n\t\t$db->query($sql);\n\t\t$row=$db->fetch_assoc_all();\n\t\treturn $row;\n\t}", "function readAll(){\n\n\t\t$query = \"SELECT * FROM \" . $this->table_name .\"\";\n\t\t$stmt = $this->conn->prepare($query);\n\t\t$stmt->execute();\n\t\treturn $stmt;\n\t}", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM tbl_coverage';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function get_all ();", "public function readAll(){\n $rq = \"SELECT * FROM Objets\";\n $stmt = $this->pdo->prepare($rq);\n $data = array();\n if(!$stmt->execute($data)){\n throw new Exception($pdo->errorInfo());\n }\n return $result = $stmt->fetchAll();\n }", "public function readAll(){\n\t\t\t$req = \"SELECT recette.idRec, recette.nom AS lib, descriptif, difficulte, prix, nbPersonnes, \n\t\t\t\t\tdureePreparation, dureeCuisson, dureeTotale, qteCalories, qteProteines, qteGlucides, qteLipides, \n\t\t\t\t\tutilisateur.nom AS utilNom, utilisateur.prenom AS utilprenom, illustration.adresse\n\t\t\t\t\tFROM recette \n\t\t\t\t\tINNER JOIN utilisateur\n\t\t\t\t\tON recette.idUtil = utilisateur.idUtil\n\t\t\t\t\tINNER JOIN illustration\n\t\t\t\t\tON recette.idRec = illustration.idRec\n\t\t\t\t\tORDER BY recette.nom ASC\";\n\t\t\t$curseur=$this->cx->query($req);\n\t\t\treturn $curseur;\n\t\t}", "public function readAll(){\n //select all data\n $query = \"SELECT\n id, num_compte, cle_rib, num_agence, duree_epargne, frais, solde, created\n FROM\n \" . $this->table_name . \"\n ORDER BY\n num_compte\";\n \n $stmt = $this->conn->prepare( $query );\n $stmt->execute();\n \n return $stmt;\n }", "public final function get_all()\n {\n }", "public function get_all()\n {\n $stm = $this->prepare(\"select * from readings where system_id = 1\");\n $stm->execute();\n $res = $stm->fetchAll(PDO::FETCH_CLASS); // returns array of objects\n log($res);\n if (count($res) > 0)\n return $res;\n else\n return FALSE;\n }", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM patient_info';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function fetchAll(){\n $adapter = $this->adapter;\n $sql = new Sql($this->adapter);\n $select = $sql->select();\n $select->from('flota');\n $selectString = $sql->getSqlStringForSqlObject($select);\n $data = $adapter->query($selectString, $adapter::QUERY_MODE_EXECUTE);\n \n return $data;\n }", "function get_all(){\n\t\t$sql = \"SELECT * \n\t\t\t\tFROM evs_database.evs_set_form_attitude\";\n $query = $this->db->query($sql);\n\t\treturn $query;\n\n\t}", "function readQuery() {\n\t\t$this->FiscaalGroepID = $this->queryHelper(\"FiscaalGroepID\", 0);\n\t\t$this->FiscaalGroupType = $this->queryHelper(\"FiscaalGroupType\", 0);\n\t\t$this->GewijzigdDoor = $this->queryHelper(\"GewijzigdDoor\", 0);\n\t\t$this->GewijzigdOp = $this->queryHelper(\"GewijzigdOp\", \"\");\n\t}", "public function readAll()\n {\n $sql = 'SELECT id_producto, nombre_producto, descripcion_producto, precio_producto, imagen_producto, stock, nombre_marca, estado_producto \n FROM productos INNER JOIN marca USING(id_marca) \n ORDER BY nombre_producto';\n $params = null;\n return Database::getRows($sql, $params);\n }", "public function fetchAllForBase3();", "public function fetchRecords() {\n return self::all();\n }", "function QueryAll()\n\t{\n\t\t$dalSQL = \"select * from \".$this->_connection->addTableWrappers( $this->m_TableName );\n\t\treturn $this->_connection->query( $dalSQL );\n\t}", "public function getAll()\n {\n //SELECT * FROM festival;\n \n //foeach TUDOQUEVIER e COLOCAR NUM ARRAY\n \n //return ARRAY;\n }", "public function ReadAllFfamiLimit() {\n $query = \"SELECT * from (select distinct(e.desf ),e.CFAM,DENSE_RANK () OVER (order by e.desf) AS rowNumber\n from fstock16.partsof b \n left outer join fregle00.ffami e on e.cfam=b.cfam \n left outer join fregle00.fSfami f on f.cfam=b.cfam and f.csfam=b.csfam\n left outer join fregle00.FFAMI3 g on g.cfam=b.cfam and g.csfam=b.csfam and g.cfam31=b.cfam3 \n left outer join fregle00.FSERIE H on H.cfam=b.cfam and H.csfam=b.csfam and H.cfam31=b.cfam3 and H.CSER=b.CSERI\n left outer join fregle00.FFOURN i on i.CFOUR= b.CFOUR \nwhere (cdphot<>' ' and cdfich<>' ') and e.desf is not null and b.cfam < 90 and ajt<>'S' \nand stk in (select distinct stk from fstock16.fqtdpa where cdep not in ('CS' , 'E1' , 'E2' , 'E3' , 'V1' , 'V2' , 'ST') and qtef<>0)) as tr where tr.rowNumber between ? and ?\";\n $stmt = $this->conn->prepare($query);\n $stmt->bindParam(1, $this->limit1);\n $stmt->bindParam(2, $this->limit2);\n \n $stmt->execute();\n return $stmt->fetchAll();\n }", "function fetch_all() {\n $query = \"SELECT * FROM ReadingList\";\n $statement = $this->connect->prepare($query);\n if($statement->execute()) {\n while($row = $statement->fetch(PDO::FETCH_ASSOC))\n {\n $data[] = $row;\n }\n return $data;\n } else {\n return \"error\";\n }\n }", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM telefonos';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function fetchAll()\n\t{\n\t\t$aReturn = Array();\n\t\twhile( $oRecord = $this->next() )\n\t\t\tarray_push( $aReturn, $oRecord );\n\t\t$this->rewind();\n\t\treturn $aReturn;\n\t}", "abstract protected function doFetchAll();", "public function queryAll(){\r\n\t\t$sql = 'SELECT * FROM printer';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\treturn $this->getList($sqlQuery);\r\n\t}", "public function fetchAll();", "public function fetchAll();", "public function fetchAll();", "public function fetchAll();", "public function fetchAll()\n {\n // LEFT JOIN patient ON patient.patientId = doc_calendar.patientId\n $select = new \\Zend\\Db\\Sql\\Select ;\n $select->from('doc_calendar');\n $user_session = new Container('user');\n\n $select->where(\" doc_calendar.doctorId = '{$user_session['user']->getId()}'\");\n $select->join(array(\"p\" => \"patient\"), \"doc_calendar.patientId = p.patientId\");\n\n $dbAdapter = $this->tableGateway->getAdapter();\n $statement = $dbAdapter->createStatement();\n\n $select->prepareStatement($dbAdapter, $statement);\n $driverResult = $statement->execute(); // execute statement to get result\n\n $resultSet = new ResultSet();\n $resultSet->initialize($driverResult);\n $rows = array();\n foreach($resultSet as $row) {\n $rows[] = $row->getArrayCopy();\n }\n\n return $rows;\n }", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM cbt_jadwal_ujian';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public abstract function fetchAll();", "public function get_records(){\n\t\t$records = array();\n\t\t$this->do_db();\n\t\t$tmps\t = $this->last_result;\n\t\t$db\t\t = $this->db;\n\t\twhile($record\t = $db->fetch_array($tmps)){\n\t\t\t$records[] = $record;\n\t\t}\n\t\treturn $records;\n\t}", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM cst_tech_req';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM tbl_journal_lines';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "function readAll($from_record_num, $records_per_page){\n\t // query to read all forum records, with limit clause for pagination\n\t $query = \"SELECT * FROM \" . $this->table_name . \" LIMIT ?, ?\";\n\t // prepare query statement\n\t $stmt = $this->conn->prepare( $query );\n\t // bind limit clause variables\n\t $stmt->bindParam(1, $from_record_num, PDO::PARAM_INT);\n\t $stmt->bindParam(2, $records_per_page, PDO::PARAM_INT);\n\t // execute query\n\t $stmt->execute();\n\t // return values\n\t return $stmt;\n\t}", "public function readAll() {\n $this->query = \"\n SELECT *\n FROM chistes\n \";\n\n $this->get_results_from_query();\n\n if (count($this->rows) > 1) {\n $this->mensaje = \"Chistes encontrados\";\n }\n else {\n $this->mensaje = \"Chistes no encontrados\";\n }\n\n return $this->rows;\n }", "public function getAll()\n {\n $sql = \"SELECT * FROM `%s`\";\n $this->_sql[] = sprintf($sql, $this->_table);\n $this->_parameters[] = array();\n return $this->run();\n }", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM office';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM turma_disciplina';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "function getAll();", "function getAll();", "public function queryAll(){\r\n\t\t$sql = 'SELECT * FROM material';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\treturn $this->getList($sqlQuery);\r\n\t}", "function getFilesArray(){\n $result = db_select('fossee_banner_details','n')\n ->fields('n',array('id','file_name','status'))\n ->range(0,20)\n //->condition('n.status_bool',1,'=')\n ->execute();\n\n return $result;\n}", "public static function getAll() {}", "function read(){\n \n // select all query\n $query = \"SELECT * from \" . $this->table_name . \"\";\n \n // prepare query statement\n $stmt = $this->conn->prepare($query);\n \n // execute query\n $stmt->execute();\n \n return $stmt;\n }", "public function fetch_fields() {}", "public function fetchAll()\n {\n }", "static public function readFeGroupsRecords ()\n {\n $result = false;\n $feGroups = static::fetchFeGroups();\n\n if (!empty($feGroups)) {\n $feGroupList = implode(',', $feGroups);\n $where_clause = 'uid IN (' . $feGroupList . ')';\n $result = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(\n '*',\n 'fe_groups',\n $where_clause\n );\n }\n return $result;\n }", "function read_all_items() {\n $db = GetGlobal('db');\n\t $lan = GetReq('lan')>=0?GetReq('lan'):getlocal();\t//in case of post sitemap set lan param uri \n\t $itmname = $lan?'itmname':'itmfname';\n\t $itmdescr = $lan?'itmdescr':'itmfdescr';\t \n\t $start = GetReq('start');\n\t //$headcat = GetReq('headcat')?GetReq('headcat'):\"\";\t \n\t //$meter = $start?$start-1:0; \t \n\t \n\t \t\n $sSQL = \"select id,itmname,itmfname,cat0,cat1,cat2,cat3,cat4,itmdescr,itmfdescr,itmremark,\".$this->getmapf('code').\" from products \";\n\t $sSQL .= \" WHERE \";\n\t $sSQL .= \"itmactive>0 and active>0 \";\t\n\t //$sSQL .= \" GROUP BY cat0,$itmname\";\n\t $sSQL .= \" ORDER BY cat0,cat1,cat2,cat3,cat4,$itmname asc \";\n\t $sSQL .= $start ? \" LIMIT $start,10000\" : \" LIMIT 10000\";\t\t\t\n\t //echo $sSQL;\n\t\t\n\t $resultset = $db->Execute($sSQL,2);\t\n\t // $result = $resultset;\n\t $this->result = $resultset; \n \t $this->max_items = $db->Affected_Rows();//count($this->result);\t \n return (null);//$this->max_items);\t\t \n\t}", "public function fALL()\n {\n $fetch_all_data = $this->query->fetchAll(PDO::FETCH_OBJ);\n if($fetch_all_data)\n {\n return $fetch_all_data;\n }else{\n return false;\n }\n \n }", "public function readAll()\n {\n $read = $this->find()->fetch(true);\n\n if ($read) {\n $this->Result = $read;\n $this->Error = \"Sucesso!\";\n } else {\n $this->Result = false;\n $this->Error = \"Não foi possível consultar!\";\n }\n }", "public function read () {\n $pdo = $this->_backend->getPDO();\n\n /* TODO: selection criteria.\n // New FileMaker find command.\n if (count($this->_findCriteria) > 0) {\n // This search query will contain criterion.\n $findCommand = $FM->newFindCommand($this->_layout);\n foreach ($this->_findCriteria as $fieldName => $testValue) {\n $findCommand->addFindCriterion($fieldName, $testValue);\n }\n } else {\n // No criteria, so 'find all'.\n $findCommand = $FM->newFindAllCommand($this->_layout);\n }\n\n // Script calling.\n if ($this->_postOpScript !== NULL) {\n $findCommand->setScript($this->_postOpScript, $this->_postOpScriptParameter);\n }\n if ($this->_preOpScript != NULL) {\n $findCommand->setPreCommandScript($this->_preOpScript, $this->_preOpScriptParameter);\n }\n */\n\n $findSkip = $this->_readOffset;\n $findMax = $this->_readCount;\n\n // Find the number of records in this table.\n // This may not be a cheap operation, may be ok in some databases.\n $statement = $pdo->prepare('SELECT COUNT(*) FROM `'. $this->_validatedTable);\n try {\n $statement->execute();\n } catch (\\PDOException $e) {\n throw new PdoResponseException($e);\n }\n $result = $statement->fetch(\\PDO::FETCH_NUM);\n $tableRecordCount = $result[0];\n $statement->closeCursor();\n\n if ($findSkip == -1) {\n // If we are to skip to the end ...\n $findSkip = $tableRecordCount - $findMax;\n $findSkip = max(0, $findSkip); // Ensure not less than zero.\n }\n\n // Query.\n $statement = $pdo->prepare('SELECT * FROM `'. $this->_validatedTable . '` LIMIT ? OFFSET ?');\n $statement->bindParam(1, intval($findMax), \\PDO::PARAM_INT);\n $statement->bindParam(2, intval($findSkip), \\PDO::PARAM_INT);\n try {\n $statement->execute();\n } catch (\\PDOException $e) {\n throw new PdoResponseException($e);\n }\n\n $restfmMessage = new \\RESTfm\\Message\\Message();\n\n $this->_parseMetaField($restfmMessage, $statement);\n\n $fetchCount = 0;\n foreach ($statement->fetchAll() as $record) {\n if ($this->_uniqueKey === NULL) {\n $recordID = NULL;\n } else {\n $recordID = $this->_uniqueKey . '===' . $record[$this->_uniqueKey];\n }\n\n $restfmMessage->addRecord(new \\RESTfm\\Message\\Record(\n $recordID,\n NULL,\n $record\n ));\n $fetchCount++;\n }\n\n $statement->closeCursor();\n\n // Info.\n $restfmMessage->setInfo('tableRecordCount', $tableRecordCount);\n $restfmMessage->setInfo('foundSetCount', $tableRecordCount);\n $restfmMessage->setInfo('fetchCount', $fetchCount);\n\n return $restfmMessage;\n }", "function AutomatFetchAll() {\r\n $query = \"select * from usrautomat\";\r\n // debug\r\n $this->err_level = 16;\r\n $this->err = \"AutomatFetchAll. query: \" . (string)$query;\r\n $this->err_no = 0;\r\n $this->DbgAddSqlLog();\r\n $this->AutomatData = mysqli_query($this->linkid,$query);\r\n // query failed\r\n if (!$this->AutomatData) {\r\n $this->err_level = -1;\r\n $this->err=mysqli_error($this->linkid);\r\n $this->err_no=209;\r\n $this->DbgAddSqlLog();\r\n $this->AutomatState = -1;\r\n return;\r\n }\r\n $this->AutomatDataRows = mysqli_num_rows($this->AutomatData);\r\n $this->AutomatDataFields = mysqli_num_fields($this->AutomatData);\r\n if (!$this->AutomatDataRows) {\r\n // no data for this automat state\r\n $this->err_level = -1;\r\n $this->err=mysqli_error($this->linkid);\r\n $this->err_no=210;\r\n $this->DbgAddSqlLog();\r\n $this->AutomatState = -1;\r\n return;\r\n }\r\n return;\r\n }", "function getListOfRecords(){\n // the orders will be display and the receipts from there \n \n $element = new Order();\n \n $receipts_filter_orders = cisess(\"receipts_filter_orders\");\n \n if ($receipts_filter_orders===FALSE){\n $receipts_filter_orders = \"Abierta\"; // default to abiertas\n }\n \n if (!empty($receipts_filter_orders))\n {\n $element->where(\"status\",$receipts_filter_orders);\n }\n \n \n $element->order_by(\"id\",\"desc\");\n \n $all = $element->get()->all;\n //echo $element->check_last_query();\n ///die();\n $table = $this->entable($all);\n \n return $table;\n \n \n }", "function readAll() {\n $query = \"SELECT \n id, name, description\n FROM\n \" . $this->table_name . \" \n ORDER BY\n name\";\n\n $stmt = $this->conn->prepare($query);\n\n //execute query\n $stmt->execute();\n\n return $stmt;\n }", "abstract public function getAll();", "abstract public function getAll();", "abstract public function getAll();", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM cbt_nomor_peserta';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function queryAll(){\r\n\t\t$sql = 'SELECT * FROM alojamientos';\r\n\t\t$sqlQuery = new SqlQuery($sql);\r\n\t\treturn $this->getList($sqlQuery);\r\n\t}", "private function readAll(){\r\n $results = array();\r\n \r\n if ( null !== $this->getDB() ) {\r\n $dbs = $this->getDB()->prepare('select * from about_page');\r\n \r\n if ( $dbs->execute() && $dbs->rowCount() > 0 ) {\r\n $results = $dbs->fetchAll(PDO::FETCH_ASSOC);\r\n }\r\n \r\n } \r\n return $results;\r\n }", "public function readTable()\n {\n $sql = \"SELECT Cubans.Id, FirstName, LastName, Gender, YearOfBirth, \n `Name`, IsInGroup FROM Cubans\n JOIN Genre ON Cubans.IdGenre=Genre.id\";\n $statement = $this->connect->prepare($sql);\n $statement->execute();\n return $statement->fetchAll();\n }", "public function fetchAll()\n {\n return Accessory::paginate(25);\n }", "function getAll()\r\n {\r\n\r\n }", "public function fetchFields();", "public function readAllVoto(){\n\n return self::read('voto','voto'); \n }" ]
[ "0.66927147", "0.66769606", "0.6616063", "0.6600987", "0.65330476", "0.6409498", "0.64057976", "0.63321275", "0.63238513", "0.62859774", "0.62859774", "0.62859774", "0.62859774", "0.62859774", "0.62859774", "0.62859774", "0.62859774", "0.62859774", "0.62859774", "0.62859774", "0.62859774", "0.62859774", "0.62859774", "0.62859774", "0.62859774", "0.62859774", "0.62859774", "0.62859774", "0.62859774", "0.62859774", "0.62859774", "0.62859774", "0.62859774", "0.62859774", "0.6271184", "0.6221498", "0.61989486", "0.617053", "0.61525244", "0.6149191", "0.6115081", "0.6111469", "0.6087676", "0.60630673", "0.6061615", "0.6059367", "0.6023037", "0.6013373", "0.5946036", "0.5944513", "0.5940927", "0.5917888", "0.59099424", "0.59031636", "0.58911955", "0.5879991", "0.5871814", "0.5865821", "0.58571005", "0.58391005", "0.58391005", "0.58391005", "0.58391005", "0.5817096", "0.58122885", "0.5811891", "0.58047634", "0.5801705", "0.57888734", "0.57879966", "0.5784893", "0.57800907", "0.5774541", "0.5769008", "0.57662755", "0.57662755", "0.57614547", "0.57501054", "0.5750048", "0.57445335", "0.5743974", "0.5743014", "0.5741721", "0.57402736", "0.57359", "0.5735604", "0.5735194", "0.57331437", "0.5732741", "0.57318884", "0.57308084", "0.57308084", "0.57308084", "0.5729812", "0.5729197", "0.5715921", "0.5715868", "0.5714503", "0.5704907", "0.57047665", "0.5694305" ]
0.0
-1
used for paging users
public function countAll(){ // query to select all user records $query = "SELECT fag_uid FROM " . $this->table_name . ""; // prepare query statement $stmt = $this->conn->prepare($query); // execute query $stmt->execute(); // get number of rows $num = $stmt->rowCount(); // return row count return $num; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function userlist()\n {\n $filter = Param::get('filter');\n\n $current_page = max(Param::get('page'), SimplePagination::MIN_PAGE_NUM);\n $pagination = new SimplePagination($current_page, MAX_ITEM_DISPLAY);\n $users = User::filter($filter);\n $other_users = array_slice($users, $pagination->start_index + SimplePagination::MIN_PAGE_NUM);\n $pagination->checkLastPage($other_users);\n $page_links = createPageLinks(count($users), $current_page, $pagination->count, 'filter=' . $filter);\n $users = array_slice($users, $pagination->start_index -1, $pagination->count);\n \n $this->set(get_defined_vars());\n }", "public function PaginatedListOfUsers ()\n {\n $url = \"https://reqres.in/api/users\";\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_URL,$url);\n $result=curl_exec($ch);\n curl_close($ch);\n return $result;\n }", "public function do_paging()\n {\n }", "function pagination(){}", "function d4os_io_db_070_os_users_online_users_list_paged($page = 0, $limit = 5, $headers) {\n if (!isset($_GET['page'])) {\n $_GET['page'] = $page;\n }\n if (!isset($_GET['order'])) {\n $_GET['order'] = 'loginTime';\n }\n if (!isset($_GET['sort'])) {\n $_GET['sort'] = 'DESC';\n }\n /*\n * uuid\n * agentIP\n * agentPort\n * loginTime\n * logoutTime\n * currentRegion\n * currentRegionName\n * currentHandle\n * currentPos\n * currentLookAt\n */\n d4os_io_db_070_set_active('os_robust');\n $result = pager_query(\"SELECT * FROM {Presence} AS p\"\n . \" LEFT JOIN {UserAccounts} AS ua ON ua.PrincipalID=p.UserID\"\n . \" LEFT JOIN {Regions} AS r ON r.uuid=p.RegionID\"\n . \" LEFT JOIN {GridUser} AS gu ON gu.UserID=p.UserID\"\n . \" WHERE gu.Online = 'true'\"\n . \" AND gu.Login < (UNIX_TIMESTAMP(FROM_UNIXTIME(UNIX_TIMESTAMP(now()))))\"\n . \" AND gu.Logout < (UNIX_TIMESTAMP(FROM_UNIXTIME(UNIX_TIMESTAMP(now()))))\"\n . \" %s\", $limit, 0, NULL, array(tablesort_sql($headers)));\n while ($user = db_fetch_object($result)) {\n $items[] = $user;\n }\n d4os_io_db_070_set_active('default');\n return $items;\n}", "public function index()\n { \n return User::latest()->paginate(12);\n }", "public function supportsUsersPagination()\n {\n return false;\n }", "function userListing()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n else\n { \n $searchText = $this->security->xss_clean($this->input->post('searchText'));\n $data['searchText'] = $searchText;\n \n $this->load->library('pagination');\n \n $count = $this->user_model->userListingCount($searchText);\n\n\t\t\t$returns = $this->paginationCompress ( \"userListing/\", $count, 5 );\n \n $data['userRecords'] = $this->user_model->userListing($searchText, $returns[\"page\"], $returns[\"segment\"]);\n \n $this->global['pageTitle'] = 'Garuda Informatics : User Listing';\n \n $this->loadViews($this->view.\"users\", $this->global, $data, NULL);\n }\n }", "function listuser(){\n\t\t\tif(!empty($_GET['paginado'])){\n\t\t\t\t$pag = $_GET['paginado'];\n\t\t\t\t$list = $this -> model -> selectuser($pag);\n\t\t\t}else{\n\t\t\t\t$list = $this -> model -> selectuser();\n\t\t\t}\n\t\t\t$this -> ajax_set($list);\n\t\t}", "public function paginatedListAction() {\n $logger = $this->get('logger');\n if (!$this->get('request')->isXmlHttpRequest()) { // Is the request an ajax one?\n return new Response(\"<b>Not an ajax call!!!\" . \"</b>\");\n }\n try {\n //Get parameters\n $request = $this->get('request');\n $limit = $request->get('limit');\n $offset = $request->get('offset');\n $order = $request->get('order');\n $search = $request->get('search');\n $sort = $request->get('sort');\n $em = $this->getDoctrine()->getManager();\n $usr= $this->get('security.context')->getToken()->getUser();\n $paginator = $em->getRepository('TecnotekAsiloBundle:User')\n ->getListWithFilter($offset, $limit, $search, $sort, $order, $usr->getId());\n\n $results = array();\n foreach($paginator as $user){\n array_push($results, array('id' => $user->getId(),\n 'name' => $user->getName(),\n 'lastname' => $user->getLastname(),\n 'username' => $user->getUsername(),\n 'email' => $user->getEmail(),\n 'cellPhone' => $user->getCellPhone(),\n 'isActive' => $user->isActive(),\n 'username' => $user->getUsername()));\n }\n return new Response(json_encode(array('total' => count($paginator),\n 'rows' => $results)));\n } catch (Exception $e) {\n $info = toString($e);\n $logger->err('User::paginatedListAction [' . $info . \"]\");\n return new Response(json_encode(array('error' => true, 'message' => $info)));\n }\n }", "public function index()\n {\n return User::latest()->paginate(10) ;\n }", "public function fetch_users() : void\n {\n // $this->no_more_users();\n if($this->no_user == 2) {\n $this->page ++;\n $this->cache = 'infinite-users.' . $this->page;\n $skip = ($this->fetch * $this->page) - $this->fetch;\n $users = Cache::remember($this->cache, $this->cache_time, function () use($skip) {\n return DB::table('users')->select('id', 'name', 'phone', 'email', 'gender')\n ->skip($skip)\n ->take($this->fetch)\n ->get();\n });\n \n $page = $this->page + 1;\n $cache = 'infinite-users.' . $page;\n \n infiniteScrollCacheNextPage::dispatchIf(!Cache::has($cache), $cache, $page, $this->fetch, $this->cache_time);\n $this->emit('appendUsers', ['users' => $users]);\n } else {\n $this->no_more_users();\n }\n }", "function index()\r\n{\r\n\tif(!isset($_GET['search']))\r\n\t\t$_GET['search']=\"NULL\";\r\n\tif(!isset($_GET['paging']))\r\n\t\theader(\"location: /gadmin/user/?paging=1&search=\".$_GET['search']);\r\n\t//preparing to query\r\n\t$max_results=10;\r\n\t$arr_get=array(\r\n\t\t\t\"status_not\" => \"delete\"\r\n\t);\r\n\t$order=array(\r\n\t\t\t\"by\" => \"date_created\",\r\n\t\t\t\"sort\" => \"DESC\"\r\n\t);\r\n\t$limit=array(\r\n\t\t\t\"start\" => (($_GET['paging']*$max_results)-$max_results),\r\n\t\t\t\"end\" => $max_results\r\n\t);\r\n\t//setting search\r\n\tif($_GET['search']!=\"NULL\")\r\n\t\t$arr_get['search']=\"%\".$_GET['search'].\"%\";\r\n\t//assigning variables\r\n\t$users=User::get($arr_get, true, $order, $limit);\r\n\tforeach($users as $user)\r\n\t{\r\n\t\t$par1=MetaUser::get(\r\n\t\t\t\tarray(\"id_user\" => $user->id, \"name\" => \"param_\".key($GLOBALS['GCMS_USER_PARAM'])));\r\n\t\tnext($GLOBALS['GCMS_USER_PARAM']);\r\n\t\t$par2=MetaUser::get(\r\n\t\t\t\tarray(\"id_user\" => $user->id, \"name\" => \"param_\".key($GLOBALS['GCMS_USER_PARAM'])));\r\n\t\tprev($GLOBALS['GCMS_USER_PARAM']);\r\n\t\t$user->params=\"\";\r\n\t\tif(isset($par1))\r\n\t\t\t$user->params=$user->params.$par1->value;\r\n\t\tif(isset($par2))\r\n\t\t\t$user->params=$user->params.\" \".$par2->value;\r\n\t\t$credit=MetaUser::get(array(\"id_user\" => $user->id, \"name\" => \"credit\"));\r\n\t\tif(isset($credit))\r\n\t\t\t$user->credit=$credit->value;\r\n\t\telse\r\n\t\t\t$user->credit=0;\r\n\t}\r\n\t$GLOBALS['GCMS']->assign('users', $users);\r\n\t$GLOBALS['GCMS']->assign('paging', ceil(User::get_count($arr_get)/$max_results));\r\n}", "function results_are_paged()\n {\n }", "public function paginate()\n {\n }", "function eve_api_user_list_user_private_page($corporation_id) {\n $header = array(\n 'characterName' => array(\n 'data' => t('Name'),\n 'field' => 'c.characterName',\n ),\n 'main' => array(\n 'data' => t('Main Character'),\n 'field' => 'u.name',\n ),\n 'api' => array(\n 'data' => t('API Data'),\n ),\n 'joined' => array(\n 'data' => t('Joined'),\n 'field' => 'u.created',\n ),\n 'access' => array(\n 'data' => t('Last Login'),\n 'field' => 'u.access',\n ),\n );\n\n $options = $output = array();\n\n $query = db_select('users', 'u')\n ->extend('PagerDefault')\n ->extend('TableSort');\n $query_join = $query->join('eve_api_characters', 'c', 'u.uid = c.uid');\n $query->join('eve_api_keys', 'ak', 'c.apiID = ak.apiID');\n $query->addField($query_join, 'characterID', 'cID');\n $result = $query->fields('u', array(\n 'name',\n 'created',\n 'access',\n 'uid',\n 'characterID',\n ))\n ->fields('c', array(\n 'characterName',\n 'corporationID',\n 'corporationName',\n 'corporationTicker',\n 'allianceID',\n 'allianceName',\n 'allianceTicker',\n ))\n ->fields('ak', array(\n 'keyID',\n 'vCode',\n ))\n ->condition('c.corporationID', $corporation_id, '=')\n ->condition('c.deleted', 0, '=')\n ->condition('u.status', 1, '=')\n ->condition('u.characterID', 0, '!=')\n ->limit(20)\n ->orderByHeader($header)\n ->execute();\n\n if ($result->rowCount()) {\n foreach ($result->fetchAll() as $row) {\n $options[] = array(\n 'characterName' => l($row->characterName, 'eve_api/user_list/' . $row->cID),\n 'main' => l($row->name, 'user/' . $row->uid),\n 'api' => t('Key ID: @keyID<br />Verification Code: @vCode', array('@keyID' => $row->keyID, '@vCode' => $row->vCode)),\n 'joined' => ($row->characterID == $row->cID) ? check_plain(date('Y-m-d H:i:s', $row->created)) : '',\n 'access' => ($row->characterID == $row->cID) ? ($row->access == 0) ? '' : check_plain(date('Y-m-d H:i:s', $row->access)) : '',\n );\n }\n }\n\n $output['corporation_user_list_description'] = array(\n '#type' => 'item',\n '#title' => t('List of Corporation Users and private information.'),\n '#weight' => 0,\n );\n\n $output['corporation_user_list'] = array(\n '#type' => 'markup',\n '#markup' => theme('table', array(\n 'header' => $header,\n 'rows' => $options,\n )),\n '#weight' => 10,\n );\n\n $output['page'] = array(\n '#theme' => 'pager',\n '#weight' => 20,\n );\n\n return $output;\n}", "function get_users(){\n global $database;\n $posts_per_page = 10;\n if(isset($_GET['posts_per_page'])){\n $posts_per_page = $_GET['posts_per_page'];\n }\n $page = 1;\n if(isset($_GET['page'])){\n $page = $_GET['page'];\n }\n\n if(!isset($_GET['filterby'])){\n $query = \"SELECT * FROM \".TABLE_PREFIX.\"users ORDER BY ID DESC\";\n }else{\n $query = \"SELECT * FROM \".TABLE_PREFIX.\"users ORDER BY ID DESC LIMIT \" . $posts_per_page;\n }\n return $database->query( $query );\n\n}", "public function indexAction(){\n $page = isset($_GET['page']) ? $_GET['page'] : 1;\n $perpage = 2;\n $count = \\R::count('user');\n $pagination = new Pagination($page, $perpage, $count);\n $start = $pagination->getStart();\n $users = \\R::findAll('user', \"LIMIT $start, $perpage\");\n\n $this->setMeta('All users');\n $this->setData(compact('users', 'pagination', 'count'));\n }", "function getAllPaginated($page=1,$perPage=-1) { \r\n if ($perPage == -1)\r\n $perPage = \tNewsletterUserPeer::getRowsPerPage();\r\n if (empty($page))\r\n $page = 1;\r\n //require_once(\"propel/util/PropelPager.php\");\r\n $cond = new Criteria(); \r\n $pager = new PropelPager($cond,\"NewsletterUserPeer\", \"doSelect\",$page,$perPage);\r\n return $pager;\r\n }", "public function getUserPages()\n\t{\n\t\t$users_pages = array();\n\t\tif (!$this->fb) {\n\t\t\treturn array();\n\t\t}\n\t\t$accounts = (new FacebookRequest(\n\t\t\t$this->fb, 'GET', '/me/accounts'\n\t\t))->execute()->getGraphObject(GraphUser::className());\n\t\tif ($accounts = $accounts->asArray()) {\n\t\t\tforeach ($accounts['data'] as $account) {\n\t\t\t\tif ($account->category != 'Application') {\n\t\t\t\t\tif (!empty($account->id) && !empty($account->name)) {\n\t\t\t\t\t\t$account->twitterid = '';\n\t\t\t\t\t\t$users_pages[$account->id] = $account;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->log('invalid account: ' . print_r($account, true), 'badaccounts');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$rs = $this->db->query(\"SELECT * from selective_status_users where fbuid IN ('\" . implode(\"', '\", array_keys($users_pages)) . \"')\");\n\t\t\twhile ($rs && $row = $rs->fetch()) {\n\t\t\t\t$users_pages[$row['fbuid']]->twitterid = $row['twitterid'];\n\t\t\t}\n\t\t}\n\t\treturn $users_pages;\n\t}", "abstract public function preparePagination();", "public function admin_user_list() {\n $this->paginate = array(\n 'limit' => 10,\n 'order' => array('User.created' => 'desc' ),\n 'conditions' => array('User.status' => 1),\n );\n $data = $this->paginate('User');\n $this->set('user', $data);\n $this->render('/Users/user_list');\n }", "public function testThatGetAllUsersWithPageIsFormattedProperly()\n {\n $api = new MockManagementApi( [\n new Response( 200, self::$headers ),\n new Response( 200, self::$headers ),\n ] );\n\n $api->call()->users()->getAll( [], [], null, 10 );\n\n $query = $api->getHistoryQuery();\n $this->assertContains( 'page=10', $query );\n\n $api->call()->users()->getAll( [], [], null, -10 );\n\n $query = $api->getHistoryQuery();\n $this->assertContains( 'page=10', $query );\n }", "private function list_query_users () {\n // Retrieves order by query argument, validates it, sets current query orderby variable. Otherwise uses default value.\n $orderby = $this->postget( 'orderby' );\n if ( ! in_array( $orderby, $this->available_order_columns ) ) {\n $orderby = $this->orderby;\n }\n $this->orderby = $orderby;\n\n // Retrieves order direction query argument, validates it, sets current query order variable. Otherwise uses default value.\n $order = $this->postget( 'order' );\n if ( ! in_array( $order, [ 'asc', 'desc' ] ) ) {\n $order = $this->order;\n }\n $this->order = $order;\n\n // Retrieves role query argument, validates it, sets current query role variable.\n $role = $this->postget( 'role' );\n if ( ! $role ) {\n $role__in = array();\n } else {\n $role__in = (array)$role;\n }\n $this->role = $role;\n\n // Retrieves page number query argument, validates it, sets current query paged variable.\n $current_page = $this->postget( 'paged' );\n if ( ! (int)$current_page ) {\n $current_page = 1;\n }\n $this->page = (int)$current_page;\n\n // Calculates offset value depending on page number.\n $offset = $this->per_page * $current_page - $this->per_page;\n\n $args = array(\n 'count_total' => true,\n 'offset' => $offset,\n 'number' => $this->per_page,\n 'role__in' => $role__in,\n 'orderby' => $orderby,\n 'order' => $order\n );\n\n // The Query\n $query = new WP_User_Query( $args );\n\n // Sets additional info from query results.\n $this->found_items = $query->get_results();\n $this->total_found = $query->get_total();\n $this->total_pages = ceil( $this->total_found / $this->per_page );\n }", "public function getUserPaginatedFeed($userId, $perPage);", "public function index(){\n $this->paginate = array(\n 'conditions' => array('User.status'=>1),\n 'limit' => 10\n );\n $this->set('users',$this->paginate());\n }", "function pagination()\n {\n $qgroups = $this->db->query(\"SELECT COUNT(id) AS total FROM groups WHERE id_user='\".$this->general->id_user().\"'\");\n return $qgroups->row()->total;\n }", "protected function buildPagination() {}", "protected function buildPagination() {}", "function userListing()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $searchText = $this->input->post('searchText');\n $searchStatus = $this->input->post('searchStatus');\n\n $this->load->library('pagination');\n\n $count = $this->user_model->userListingCount($this->global['level'], $searchText);\n\n $returns = $this->paginationCompress(\"userListing/\", $count, 5);\n\n $data['userRecords'] = $this->user_model\n ->userListing($this->global['level'], $searchText, $searchStatus, $returns[\"page\"], $returns[\"segment\"]);\n\n $this->global['pageTitle'] = '人员管理';\n $data['searchText'] = $searchText;\n $data['searchStatus'] = $searchStatus;\n\n $this->loadViews(\"systemusermanage\", $this->global, $data, NULL);\n }\n }", "public function getPaging($from_user_num, $users_per_page){\n //select query\n $query = \"SELECT u.id, u.username, u.password, u.estado, (CASE u.estado WHEN '1' THEN 'ACTIVO' WHEN '0' THEN 'INACTIVO' END)\n AS valor_estado, u.fecha_creacion, p.id AS id_perfil, p.nombre AS nombre_perfil FROM \". $this->table_name .\" u\n INNER JOIN perfil p ON u.id_perfil = p.id ORDER BY u.fecha_creacion DESC LIMIT ?, ?\";\n\n //prepare query statement\n $stmt = $this->conn->prepare($query);\n\n //bind variable values\n $stmt->bindParam(1, $from_user_num, PDO::PARAM_INT);\n $stmt->bindParam(2, $users_per_page, PDO::PARAM_INT);\n\n //execute query\n $stmt->execute();\n\n //return value from database\n return $stmt;\n }", "public function userList($username = '', $page = 1) {\n\t\tif ($page < 1 || !is_numeric($page)) {\n\t\t\t$page = 1;\n\t\t}\n\t\t$this -> User -> recursive = 0;\n\t\tif($this->request->is('post')) {\n\t\t\t$username = $this->request->data['User']['username'];\n\t\t\t$list = $this -> User -> find('all', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'username like'\t => '%' . $username . '%'\n\t\t\t\t)\n\t\t\t));\n\t\t} else {\n\t\t\t$list = $this -> User -> find('all', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'username like'\t => '%' . $username . '%'\n\t\t\t\t)\n\t\t\t));\n\t\t}\n\t\t\n\t\tforeach ($list as $key => $value) {\n\t\t\t$users[$key]['username'] = $list[$key]['User']['username'];\n\t\t\t$users[$key]['public_key'] = $list[$key]['User']['public_key'];\n\t\t\t$users[$key]['image'] = $list[$key]['User']['image'];\n\t\t}\n\t\t\n\t\t$user_count = count($users);\n\t\tif (($user_count - ($page * 100)) > 0) {\n\t\t\t$this -> set('next', $page + 1);\n\t\t}\n\t\tif ($page >= 2) {\n\t\t\t$this -> set('previous', $page - 1);\n\t\t}\n\t\tif (($user_count % 100) == 0) {\n\t\t\t$end_page = $user_count / 100;\n\t\t} else {\n\t\t\t$end_page = floor($user_count / 100) + 1;\n\t\t}\n\t\t$loop_fuel = (($page * 100) - 100) - 1;\n\t\t$this -> set('end_page', $end_page);\n\t\t$this -> set('current', $page);\n\t\t$this -> set('users', $users);\n\t\t$this -> set('username', $username);\n\t\t$this -> set('loop_fuel', $loop_fuel);\n\t}", "public function getUsersList($page) {\n $NumberUserOf1Page = 10;\n $pos = ($page - 1) * $NumberUserOf1Page;\n\n //connect to db \n $db = CTSQLite::connect();\n\n // Count total number Products\n $SelectQuerry = 'SELECT * FROM ic_user';\n $res = $db->query($SelectQuerry);\n $totalRecord = 0;\n while ($rows = $res->fetchArray()) {\n $totalRecord++;\n }\n $totalPages = ceil($totalRecord / $NumberUserOf1Page);\n\n //getting users datas from db\n $getUsersQuery = \"SELECT * FROM ic_user limit \" . $pos . \",\" . $NumberUserOf1Page;\n $result = $db->query($getUsersQuery);\n\n //an array to store each user's datas\n $row_results = array();\n\n //to count how many row in users db\n $count = 0;\n\n //pushing datas to $row_results\n\n while ($row = $result->fetchArray()) {\n array_push($row_results, $row);\n $count++;\n }\n\n //pushing out users datas\n for ($i = 0; $i <= $count - 1; $i++) {\n $row_results[$i]['currentPage'] = $page;\n //print_r($row_results[$i]);\n if (empty($row_results[$i]['id'])) {\n return $row_results;\n } else {\n // getting avatar's url\n $getAvaQuery = 'SELECT * FROM ic_pictures WHERE type = 9 AND user_id=' . $row_results[$i]['id'];\n $avatars = $db->query($getAvaQuery);\n $avatar = $avatars->fetchArray();\n $avatarUrl = $avatar['url'];\n $row_results[$i]['avatarUrl'] = $avatarUrl;\n \n // Count total number Users\n $SelectQuerry = 'SELECT * FROM ic_user';\n $res = $db->query($SelectQuerry);\n $counts = 0;\n while ($rows = $res->fetchArray()) {\n $counts++;\n }\n $row_results[$i]['totalRecord'] = $counts;\n }\n }\n\n return $row_results;\n $db->close();\n unset($db);\n }", "abstract public function getLoggedUsers($limit = null, $offset = 0);", "public function GetByPaginated($offset, $limit, $userId);", "public function getPerPage();", "public function userAccount()\n\t{\n $per_page = 4;\n $total_rows = (new Task())->countRows()->execute();\n $total_pages = ceil($total_rows / $per_page);\n $data = (new Task())->all('0','4')->execute();\n $pages = ['total_pages' => $total_pages, 'current_page' => 1];\n $data = [$data, $pages];\n View::render('userprofile', $data);\n\t}", "function get_memberlist($order = ID, $pagenum = 1, $usercount = 10) {\r\n\tglobal $bbdb, $bb;\r\n\tif ( isset($_GET['page']) )\r\n\t\t$page = ($_GET['page'] - 1) * $usercount;\r\n\telse\r\n\t\t$page = ($pagenum - 1) * $usercount;\r\n\tif ( $bb->wp_table_prefix ) {\r\n\t\tif( $order == 'postcount' )\r\n\t\t\t$result = $bbdb->get_results(\"SELECT * , COUNT(*) AS posts FROM \".$bb->wp_table_prefix.\"posts RIGHT JOIN \".$bb->wp_table_prefix.\"users ON poster_id = ID WHERE user_status = 0 GROUP BY user_login ORDER BY posts DESC, post_text DESC LIMIT $page, $usercount\");\r\n\t\telse\r\n\t\t\t$result = $bbdb->get_results(\"SELECT * FROM \".$bb->wp_table_prefix.\"users WHERE user_status = 0 ORDER BY $order LIMIT $page, $usercount\");\r\n\t} else {\r\n\t\tif( $order == 'postcount' )\r\n\t\t\t$result = $bbdb->get_results(\"SELECT * , COUNT(*) AS posts FROM $bbdb->posts RIGHT JOIN $bbdb->users ON poster_id = ID WHERE user_status = 0 GROUP BY user_login ORDER BY posts DESC, post_text DESC LIMIT $page, $usercount\");\r\n\t\telse\r\n\t\t\t$result = $bbdb->get_results(\"SELECT * FROM $bbdb->users WHERE user_status = 0 ORDER BY $order LIMIT $page, $usercount\");\r\n\t}\r\n\treturn $result;\r\n}", "public function testThatGetAllUsersWithPerPageIsFormattedProperly()\n {\n $api = new MockManagementApi( [\n new Response( 200, self::$headers ),\n new Response( 200, self::$headers ),\n ] );\n\n $api->call()->users()->getAll( [], [], null, null, 10 );\n\n $query = $api->getHistoryQuery();\n $this->assertContains( 'per_page=10', $query );\n\n $api->call()->users()->getAll( [], [], null, null, -10 );\n\n $query = $api->getHistoryQuery();\n $this->assertContains( 'per_page=10', $query );\n }", "public function index()\n {\n return UserResource::collection(User::paginate(20));\n }", "public function onUsers($startpoint, $limit){\n\t\t\t$sql = \"SELECT *,`users`.`id`, `users`.`username`, `users`.`email`, `users`.`status`, `users`.`postby_id` AS `postby_id`, `usergroup`.`title` FROM `users` INNER JOIN `usergroup` ON `users`.`usergroup_id` = `usergroup`.`id` WHERE `users`.`status` = 'ON' ORDER BY `users`.`id` DESC LIMIT {$startpoint} , {$limit}\";\n\t\t\t// echo '<br><br>'.$sql;\n\t\t\t// die();\n\t\t\t$result = $this->execute($sql);\n\n\t\t\t// while($rows = mysqli_fetch_assoc($result)){\n\t\t\t// \techo '<br><br>Info: '.$rows['fullname'];\n\t\t\t// }\n \t// die();\n\t\t\tif($result){\n\t return $result;\n\t }\n\t\t}", "public function getBookmarkedUsers()\n {\n return Auth::user()->bookmarkedUsers()->simplePaginate(10);\n }", "private function getUserBatch() {\n\t\t// Include also hidden (disabled) users to the export\n\t\t$hidden_status = access_get_show_hidden_status();\n\t\taccess_show_hidden_entities(true);\n\n\t\t// Ignore access settings to get all users\n\t\telgg_set_ignore_access(true);\n\n\t\t$users = elgg_get_entities(array(\n\t\t\t'type' => 'user',\n\t\t\t'limit' => $this->limit,\n\t\t\t'offset' => $this->offset,\n\t\t));\n\n\t\t// Set access level to normal\n\t\telgg_set_ignore_access(false);\n\n\t\t// Set hidden status to normal\n\t\taccess_show_hidden_entities($hidden_status);\n\n\t\treturn $users;\n\t}", "public function findUserPage($baseGroup, $userLogin, $usersPerPage, $offset = 0){\n return -1;\n }", "function more_data(){\t \t \n\t\t$page = $this->input->post('page');\n\t\tif(empty($page)){ $page=0; }\n\t\t$offset = 10*$page;\n\t\t$limit = 10;\n\t\t$user__list = $this->InteractModal->all__active_users_limit('client',$limit, $offset);\n\t\t$count_record = $this->InteractModal->count_users('client');\n\t\t$page_data['user__list']= $user__list;\n\t\t$page_data['page']= $page;\n\t\t$this->load->view('common/client_load_more', $page_data);\t\n\t\t\t\t\n\t\t\t\n\t}", "public function testThatGetAllUsersDoesNotOverwritePageValue()\n {\n $api = new MockManagementApi( [ new Response( 200, self::$headers ) ] );\n\n $api->call()->users()->getAll( [ 'page' => 11 ], [], null, 22 );\n\n $query = $api->getHistoryQuery();\n $this->assertContains( 'page=11', $query );\n }", "function perPage($user_id){ \t\t\n\t\t$controllerInfo=$this->uri->segment(1).\"/\".$this->uri->segment(2);\n\t\t$this->db->where(\"action\",$controllerInfo);\n\t\t$this->db->where(\"user_id\",$user_id);\n $query =$this->db->get($this->per_page);\t\t\n\t\tif($query->num_rows >0){\n\t\t\treturn $query->row()->records;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n }", "public function index()\n {\n return $this->response->paginator(User::paginate(10), new UserTransformer());\n }", "public static function paginado_usuario(){\n\t\t $page = 1; //inicializamos la variable $page a 1 por default\n\t\t if(array_key_exists('pg', $_GET)){\n\t\t $page = $_GET['pg']; //si el valor pg existe en nuestra url, significa que estamos en una pagina en especifico.\n\t\t }\n\t\t //ahora que tenemos en que pagina estamos obtengamos los resultados:\n\t\t // a) el numero de registros en la tabla\n\t\t $mysqli = new mysqli(\"localhost\",\"root\",\"slam2018\",\"corgran\");\n\t\t if ($mysqli->connect_errno) {\n\t\t\t\tprintf(\"Connect failed: %s\\n\", $mysqli->connect_error);\n\t\t\t\texit();\n\t\t\t}\n\n\n\t\t $conteo_query = $mysqli->query(\"SELECT COUNT(*) as conteo FROM usuarios\");\n\t\t $conteo = \"\";\n\t\t if($conteo_query){\n\t\t \twhile($obj = $conteo_query->fetch_object()){ \n\t\t \t \t$conteo =$obj->conteo; \n\t\t \t}\n\t\t }\n\t\t $conteo_query->close(); \n\t\t unset($obj); \n \t\t\n\t\t //ahora dividimos el conteo por el numero de registros que queremos por pagina.\n\t\t $max_num_paginas = intval($conteo/10); //en esto caso 10\n\t\t\t\n\t\t // ahora obtenemos el segmento paginado que corresponde a esta pagina\n\t\t $segmento = $mysqli->query(\"SELECT * FROM usuarios LIMIT \".(($page-1)*10).\", 10 \");\n $resultado=[];\n\t\t //ya tenemos el segmento, ahora le damos output.\n\t\t if($segmento){\n\t\t\t // echo '<table>';\n\t\t\t while($obj2 = $segmento->fetch_object())\n\t\t\t {\n\t\t\t \t$obj_usu = new usuario($obj2->id_usuario,$obj2->tipo_usu,$obj2->nombre,$obj2->clave);\n $resultado[]=$obj_usu;\n\t\t\t /* echo '<tr>\n\t\t\t <td>'.$obj2->id_usuario.'</td>\n\t\t\t <td>'.$obj2->tipo_usu.'</td>\n\t\t\t <td>'.$obj2->nombre.'</td>\n\t\t\t </tr>'; \n\t\t\t */ }\n\t\t\t // echo '</table><br/><br/>';\n\t\t\t}\n\t\n\t\t //ahora viene la parte importante, que es el paginado\n\t\t //recordemos que $max_num_paginas fue previamente calculado.\n\t\t for($i=0; $i<$max_num_paginas;$i++){\n\n\t\t echo '<a href=\"index.php?pg='.($i+1).'\">'.($i+1).'</a> | ';\n\t\t \n\t\t } \n\t\t echo '<div>-------------------------- PAginacion------------------------------------------------</div>'; \n return $resultado; \n \n }", "public function userlist()\n {\n $users = array('users' => UserModel::getPublicProfilesOfAllUsers(),'dynatable'=>'userlist');\n $this->View->render('user/userlist',$users);\n }", "public function index() {\n event(new \\Camp\\Handlers\\Events\\UserUpdatedEventHandler(User::all()));\n return User::where('bloqued', false)->paginate(4);\n }", "public function userListTemplate(): void\n {\n $page = get_query_var(self::CUSTOMPAGEVAR);\n if ($page === $this->customEndpoint()) {\n $data = self::FetchUsersData();\n $userListingTemplate = plugin_dir_path(dirname(__FILE__)) . \"views/listing-view/template-users-list.php\";\n $this->themeRedirect($userListingTemplate, true, $data);\n exit();\n }\n }", "public function index()\n {\n return User::latest()\n ->simplePaginate(30);\n }", "public function manage(){\n if($this->request->data!=null){\n $search = '%'.$this->request->data['User']['searchstring'].'%';\n } else {\n $search ='%%';\n }\n\n $this->paginate = array (\n 'conditions' => array(\n 'User.status' => 1,\n 'User.role' =>'author',\n 'User.username LIKE' => $search\n ),\n 'limit' => 10,\n 'order' => array('User.created'=>'DESC')\n );\n\n $this->set('users',$this->paginate());\n }", "public function testThatGetAllUsersDoesNotOverwritePerPageValue()\n {\n $api = new MockManagementApi( [ new Response( 200, self::$headers ) ] );\n\n $api->call()->users()->getAll( [ 'per_page' => 8 ], [], null, null, 9 );\n\n $query = $api->getHistoryQuery();\n $this->assertContains( 'per_page=8', $query );\n }", "public function getPaginated();", "public function list_page_content () {\n // Check permissions\n if ( ! current_user_can( 'list_users' ) ) {\n return;\n }\n\n // Main listing query\n $this->list_query_users();\n\n // Set urls for column sorting links.\n $sort_link_username = $this->sort_link( 'user_name', $this->orderby, $this->order );\n $sort_link_displayname = $this->sort_link( 'display_name', $this->orderby, $this->order );\n\n // Include template\n include CTAL_PATH.'/admin/templates/users-page.php';\n }", "public function getUsersList()\n {\n }", "public function index()\n {\n $users = User::orderBy('created_at','DESC')->paginate(env('PAGES'));\n\n $flag = User::count() > env('PAGES') ? true : false;\n\n return view('users.list-user',[\n 'users' => $users,\n 'flag' => $flag,\n ]);\n }", "public function index()\n {\n // $this->authorize('isAdmin');\n if (\\Gate::allows('isAdmin') || \\Gate::allows('isAuthor')) {\n return User::latest()->paginate(3);\n }\n\n }", "function user_list()\n {\n if ($this->isAdmin() == TRUE) {\n $this->loadThis();\n } else {\n $this->global['pageTitle'] = '运营人员列表';\n $this->global['pageName'] = 'userlist';\n\n $data['searchType'] = '0';\n $data['searchName'] = '';\n\n $this->loadViews(\"user_manage/users\", $this->global, $data, NULL);\n }\n }", "public function GetUsersByLIMIT($pageid)\n {\n $db = new DB();\n $start = 10*($pageid-1);\n $row = 10;\n $query = \"SELECT * FROM `users` LIMIT $start,$row\";\n $stm = $db->prepare($query);\n $stm->execute();\n $result = $stm->fetchAll();\n $db = NULL;\n return $result;\n }", "public function executeIndex(sfWebRequest $request)\n {\n $this->amigos_usuario = sfGuardUserProfileTable::getAmigos($this->getUser()->getGuardUser()->getId());\n \n $this->pager = new sfDoctrinePager( 'sfGuardUserProfile', 3 ); // Table, items per page\n\t$this->pager->setQuery( $this->amigos_usuario ); // items query \n\t$this->pager->setPage($this->getRequestParameter('page', 1)); // actual page\n\t$this->pager->init();\n \n }", "function eve_api_user_list_user_general_page($id, $type) {\n $header = array(\n 'characterName' => array(\n 'data' => t('Name'),\n 'field' => 'c.characterName',\n ),\n 'corporationName' => array(\n 'data' => t('Corporation'),\n 'field' => 'c.corporationName',\n ),\n 'allianceName' => array(\n 'data' => t('Alliance'),\n 'field' => 'c.allianceName',\n ),\n 'joined' => array(\n 'data' => t('Joined'),\n ),\n 'access' => array(\n 'data' => t('Last Login'),\n ),\n );\n\n $options = $output = array();\n\n $query = db_select('users', 'u')\n ->extend('PagerDefault')\n ->extend('TableSort');\n $query_join = $query->join('eve_api_characters', 'c', 'u.uid = c.uid');\n $query->addField($query_join, 'characterID', 'cID');\n $query->fields('u', array(\n 'created',\n 'access',\n 'uid',\n 'characterID',\n ))\n ->fields('c', array(\n 'characterName',\n 'corporationID',\n 'corporationName',\n 'corporationTicker',\n 'allianceID',\n 'allianceName',\n 'allianceTicker',\n ));\n\n if (isset($id)) {\n $or = db_or();\n $or->condition('c.allianceID', $id, '=');\n $or->condition('c.corporationID', $id, '=');\n $query->condition($or);\n }\n\n $query->condition('c.deleted', 0, '=')\n ->condition('u.status', 1, '=')\n ->condition('u.characterID', 0, '!=')\n ->limit(20)\n ->orderByHeader($header);\n $result = $query->execute();\n\n if ($result->rowCount()) {\n foreach ($result->fetchAll() as $row) {\n $options[] = array(\n 'characterName' => l($row->characterName, 'eve_api/user_list/' . $row->cID),\n 'corporationName' => l($row->corporationName, 'eve_api/user_list/' . $row->corporationID) . check_plain(' [' . $row->corporationTicker . ']'),\n 'allianceName' => ($row->allianceID == 0) ? l(t('None'), 'eve_api/user_list/0') : l($row->allianceName, 'eve_api/user_list/' . $row->allianceID) . check_plain(' [' . $row->allianceTicker . ']'),\n 'joined' => ($row->characterID == $row->cID) ? check_plain(date('Y-m-d H:i:s', $row->created)) : '',\n 'access' => ($row->characterID == $row->cID) ? ($row->access == 0) ? '' : check_plain(date('Y-m-d H:i:s', $row->access)) : '',\n );\n }\n }\n\n switch ($type) {\n default:\n case 0:\n $title = t('List of All Characters and some basic information.');\n break;\n\n case 1:\n $title = t('List of Corporation Characters and some basic information.');\n break;\n\n case 2:\n $title = t('List of Alliance Characters and some basic information.');\n break;\n }\n\n $output['user_list_description'] = array(\n '#type' => 'item',\n '#title' => $title,\n '#weight' => 0,\n );\n\n $output['user_list'] = array(\n '#type' => 'markup',\n '#markup' => theme('table', array(\n 'header' => $header,\n 'rows' => $options,\n )),\n '#weight' => 10,\n );\n\n $output['page'] = array(\n '#theme' => 'pager',\n '#weight' => 20,\n );\n\n return $output;\n}", "public function actionIndex(){\n if(Yii::app()->user->isAdmin()){\n $userModel = User::model()->findAll();\n $countUser = count($userModel);\n $defaultRecordsPerPage = Yii::app()->params['defaultPerPageTable'][0];\n $pages = ($countUser%$defaultRecordsPerPage == 0) ?\n $countUser/$defaultRecordsPerPage :\n floor($countUser/$defaultRecordsPerPage) + 1;\n $this->render('index', array(\n 'pages' => $pages,\n\n ));\n }else\n $this->redirect(array('//checklist/checklistmanagement'));\n }", "function getGroupMembers(){\n $data['group_id'] = $this->input->get('group_id');\n $where = array('group_id'=> $data['group_id'],'group_members.status'=>1);\n $result['page'] = $this->input->get('page');\n $searchArray = !empty($this->input->get('searchName'))?$this->input->get('searchName'):'';\n $limit = 8;\n //$start = $result['page']*$limit;\n $start = $result['page'];\n $data['user_id'] = $_SESSION[USER_SESS_KEY]['userId'];\n $table= GROUP_MEMBERS;\n $result['data'] = $this->group_model->groupMembers($data,$table,$searchArray,$start,$limit);\n $count = $this->group_model->groupMembers($data,$table,$searchArray);\n //lq();\n /* is_next: var to check we have records available in next set or not\n * 0: NO, 1: YES\n */\n $is_next = 0;\n $new_offset = $result['page'] + $limit;\n if($new_offset < $count['count']){\n $is_next = 1;\n }\n $result['userDetail'] = $result['data']['data'];\n if((!empty($searchArray) OR !empty($filter)) AND $result['page'] < 8){\n $result['isFilter'] = 1;\n $result['record_count'] = !empty($result['userDetail'])?count($result['userDetail']):strval(0);\n }\n $result['group_id'] = $data['group_id'];\n $userView = $this->load->view('groupUserList',$result, true);\n\n echo json_encode( array('status'=>1, 'html'=>$userView, 'isNext'=>$is_next, 'newOffset'=>$new_offset,'count'=>$count['count'])); exit;\n }", "public function userlist()\n\t{\n\t\t$data['page']='Userlist';\n\t\t$data['users_list']=$this->users->get_many_by('userlevel_id',2);\n\t\t$view = 'admin/userlist/admin_userlist_view';\n\t\techo Modules::run('template/admin_template', $view, $data);\t\n\t}", "function mentor_list($limit='',$start=0,$condition='')\n{\n\tglobal $DB;\n\t$sql =\"SELECT u.id,u.firstname,u.lastname,u.email,u.city,u.picture,u.department FROM {user} u left join {user_info_data} ud on ud.userid=u.id \";\n\t$sql.=\"WHERE ud.data='mentor data' and ud.acceptterms=1 and u.deleted=0 $condition order by u.timemodified desc limit $start,$limit\";\n\t//echo $sql;die;\n\t$result = $DB->get_records_sql($sql);\n\tif(count($result)>0){\n\t\tforeach($result as $mentordata)\n\t\t{\n\t\t\t$user = new stdClass();\n\t\t\t$user->id = $mentordata->id;\n\t\t\t//$picture = get_userprofilepic($user);\n\t\t\t$userurl = getuser_profilelink($user->id);\n\t\t\t$usrimg = get_userprofilepic($user);\n\t\t\t$picture ='<div class=\"left picture\"><a href=\"'.$userurl.'\" >'.$usrimg.'</a></div>'; \n\t\t\t$mentordata->picture = $picture;\n\t\t}\n\t}\n\treturn $result;\n}", "public function paginateUserGifs( $per_page, $user_id );", "public function getItemsPerPage();", "public function getItemsPerPage();", "public function getUsers()\n {\n $title = \"Users\";\n $view = $this->di->get(\"view\");\n $pageRender = $this->di->get(\"pageRender\");\n\n // Get all the users from db\n $users = $this->di->get(\"user\")->getAllUsers();\n\n $data = [\n //\"items\" => $book->findAll(),\n \"users\" => $users,\n ];\n\n $view->add(\"pages/users\", $data);\n //$view->add(\"blocks/footer\", $data);\n\n $pageRender->renderPage([\"title\" => $title]);\n }", "public function userlist()\n {\n $config = array();\n $config['base_url'] = 'http://localhost/task1/ci/Index.php/index/userlist';\n $config['total_rows'] = $this->ModelOfUser->total_number_of_records_in_user_table();\n $config['per_page'] = 5;\n $config['uri_segment'] = 3;\n $config['next_link'] = 'Next';\n $config['prev_link'] = 'Previous';\n \n // initializing the library\n $this->pagination->initialize($config);\n \n $page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 0;\n $data[\"results\"] = $this->ModelOfUser->get_all_user_data_from_user_table($config[\"per_page\"], $page);\n // echo $data[\"results\"];die();\n $data[\"links\"] = $this->pagination->create_links();\n \n $this->load->view(\"userlist\", $data);\n // echo $this->uri->segment(4);\n }", "private function paginate()\n\t{\n\t\tif ($this->_listModel) {\n\t\t\t$this->_listModel->loadNextPage();\n\t\t}\n\t}", "function getUserPosts(){\n $sessionCheck=session::isUserLoggedIn();\n\n if(!$sessionCheck)\n return;\n\n //get the page details\n $pageNumber=$_REQUEST['page_number'];\n\n //set default page number it start with 0\n if(!isset($pageNumber) || empty($pageNumber))\n $pageNumber=0;\n\n\n //get user id d details\n $userId = $_SESSION['user_id'];\n\n //get the total no of posts for a user\n $totalNumberOfPosts=(int)posts::getPostsCountOfUserId($userId);\n\n //if there is no posts\n if($totalNumberOfPosts<=0){\n echo json_encode(array('posts'=>array(),'loadNextPage'=>0));\n exit;\n }\n\n //last page number\n $lastPage=ceil($totalNumberOfPosts/(int)perPagePosts)-1;\n\n //if page number is greater then last page\n if($pageNumber>$lastPage){\n echo json_encode(array('posts'=>array(),'loadNextPage'=>0));\n exit;\n }\n\n //create offset according to page number\n $offset=((int)$pageNumber)*(int)perPagePosts;\n $posts= posts::getPostOfUserId($userId,$offset,perPagePosts);\n\n //check to show next page\n $loadNextPage=(int)($pageNumber+1)<=$lastPage?1:0;\n\n $return= array('posts'=>$posts,'loadNextPage'=>$loadNextPage);\n echo json_encode($return);\n\n }", "function getPagingParameters()\n {\n }", "function getAllUsers($max = null, $offset = null) {\n $argv = func_get_args();\n if (count($argv) == 0) {\n $objUtil = new Util($this->apiKey, $this->secretKey);\n try {\n\t\t\t $params = null;\n $headerParams = array();\n $queryParams = array();\n $signParams = $this->populateSignParams();\n $metaHeaders = $this->populateMetaHeaderParams();\n $headerParams = array_merge($signParams, $metaHeaders);\n $signature = urlencode($objUtil->sign($signParams)); //die();\n $headerParams['signature'] = $signature;\n $contentType = $this->content_type;\n $accept = $this->accept;\n $baseURL = $this->url;\n $baseURL = $baseURL;\n $response = RestClient::get($baseURL, $params, null, null, $contentType, $accept, $headerParams);\n $userResponseObj = new UserResponseBuilder();\n $userObj = $userResponseObj->buildArrayResponse($response->getResponse());\n } catch (App42Exception $e) {\n throw $e;\n } catch (Exception $e) {\n throw new App42Exception($e);\n }\n return $userObj;\n } else {\n /**\n * Gets all users by Paging\n *\n * @param max\n * - Maximum number of records to be fetched\n * @param offset\n * - From where the records are to be fetched\n *\n * @return the List that contains all User Object\n */\n Util::validateMax($max);\n Util::throwExceptionIfNullOrBlank($max, \"Max\");\n Util::throwExceptionIfNullOrBlank($offset, \"Offset\");\n $encodedMax = Util::encodeParams($max);\n $encodedOffset = Util::encodeParams($offset);\n $objUtil = new Util($this->apiKey, $this->secretKey);\n try {\n\t\t\t $params = null;\n $headerParams = array();\n $queryParams = array();\n $signParams = $this->populateSignParams();\n $metaHeaders = $this->populateMetaHeaderParams();\n $headerParams = array_merge($signParams, $metaHeaders);\n $signParams['max'] = $max;\n $signParams['offset'] = $offset;\n $signature = urlencode($objUtil->sign($signParams)); //die();\n $headerParams['signature'] = $signature;\n $contentType = $this->content_type;\n $accept = $this->accept;\n $baseURL = $this->url;\n $baseURL = $baseURL . \"/paging/\" . $encodedMax . \"/\" . $encodedOffset;\n $response = RestClient::get($baseURL, $params, null, null, $contentType, $accept, $headerParams);\n $userResponseObj = new UserResponseBuilder();\n $userObj = $userResponseObj->buildArrayResponse($response->getResponse());\n } catch (App42Exception $e) {\n throw $e;\n } catch (Exception $e) {\n throw new App42Exception($e);\n }\n return $userObj;\n }\n }", "public function testListPagination()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs(User::find(1))\n ->visit('admin/users')\n ->assertSee('Users Gestion')\n ->clickLink('3')\n ->assertSee('GreatRedactor');\n });\n }", "function printUsers() {\r\n global $users;\r\n $index = 0;\r\n foreach($users as $user) {\r\n echo $index . \" \" . $user . \"<br>\";\r\n $index++;\r\n }\r\n }", "public function admin_index() {\n $this->paginate = array(\n 'limit' => 10,\n 'order' => array(\n 'User.username' => 'asc',\n ) ,\n 'conditions' => array(\n 'User.status' => 1,\n ),\n );\n $users = $this->paginate('User');\n $this->set(compact('users'));\n }", "public function graphql_wp_user_query_cursor_pagination_support($where, \\WP_User_Query $query)\n {\n }", "public function getPerPage(): int;", "function getUsers($per_page){\n // this function for get all users from database to users.php\n global $con;\n if(isset($_GET['page']))\n $page = $_GET['page'];\n else\n $page = 1;\n \n $start = ($page - 1) * $per_page;\n try{\n $query = $con->prepare(\"SELECT * FROM users ORDER BY 1 DESC LIMIT $start,$per_page\");\n $query->execute();\n if($query->rowCount() > 0){\n while($result = $query->fetch(PDO::FETCH_ASSOC)){\n $user_id = $result['user_id'];\n $user_name = $result['username'];\n $user_image = $result['user_image'];\n $user_location = $result['user_location'];\n if($user_location == ''){\n $user_location = 'غير معروف';\n }\n $last_login = $result['last_login'];\n $class = 'offline';\n $status = 'غير متصل';\n // for check if user is connect now\n if($last_login > time()){\n $class = 'online';\n $status = 'متصل';\n }\n \n echo \"\n <div class='col-md-6 col-lg-4'>\n <div class='item'>\n <div class='user-img img-box'\"; if($user_image != \"\") echo 'style=background-color:transparent'; echo \">\"; \n if($user_image != \"\"){\n echo \"<img src='Profile/Layout/Images/users-images/$user_image' class='img-responsive' alt='$user_image'>\";\n }\n else{\n preg_match(\"/./u\",$user_name,$first_char);\n $first_char = strtoupper($first_char[0]);\n echo \"<span>$first_char</span>\";\n }\n //<img src='profile/Layout/Images/users-images/$user_image' class='img-responsive' alt='$user_image'>\n echo\" </div>\n <div class='username'>\n <h5>$user_name</h5>\n <div>\n <span><i class='fa fa-map-marker'></i> $user_location</span>\n <span><i class='fa fa-circle user-connection $class'></i> $status</span>\n </div>\n </div>\n <div class='user-profile'>\n <a class='btn btn-primary btn-block' href='Profile/user-profile.php?user_id=$user_id&page=1'>الملف الشخصي</a>\n </div>\n </div>\n </div>\n \";\n }\n }\n }\n catch(PDOException $e){\n echo $e->getMessage();\n }\n\n}", "public function userLists()\n {\n\n try {\n if (isset($_REQUEST['AuthToken'])) {\n $AuthToken = $_REQUEST['AuthToken'];\n } else {\n $AuthToken = '';\n }\n if (!Master::check_master_token($AuthToken)) {\n return response([\n 'message' => \"Token Expired\",\n 'status' => 'TokenExpired'\n ], 400);\n }\n\n $offset = ($_GET['page'] - 1) * $_GET['per_page'];\n $sort_field = (isset($_GET['sort_field'])) ? $_GET['sort_field'] : \"id\";\n $sort_order = (isset($_GET['sort_order'])) ? $_GET['sort_order'] : \"desc\";\n\n $data = array();\n $data_count = 0;\n\n if (Schema::hasTable('admin_users')) {\n $sql = DB::table('admin_users');\n //search conditions\n if (isset($_GET['search']) && ($_GET['search'] != \"\")) {\n $q = $_GET['search'];\n $sql->where(function ($query) use ($q) {\n $query->where('name', 'LIKE', '%' . $q . '%')\n ->orWhere('email', 'LIKE', '%' . $q . '%')\n ->orWhere('phone', 'LIKE', '%' . $q . '%');\n });\n }\n $data = $sql->offset($offset)->limit($_GET['per_page'])->orderBy($sort_field, $sort_order)->get();\n\n //count of total tasks\n $csql = DB::table('admin_users');\n //search conditions for count\n if (isset($_GET['search']) && ($_GET['search'] != \"\")) {\n $q = $_GET['search'];\n $csql->where(function ($query) use ($q) {\n $query->where('name', 'LIKE', '%' . $q . '%')\n ->orWhere('email', 'LIKE', '%' . $q . '%')\n ->orWhere('phone', 'LIKE', '%' . $q . '%');\n });\n }\n $data_count = $csql->count();\n }\n\n //response\n return response([\n 'message' => \"\",\n 'pgData' => $data,\n 'totalRows' => $data_count,\n ], 200);\n } catch (Exception $e) {\n return response([\n 'message' => $e->getMessage()\n ], 400);\n }\n }", "public function indexAction() {\n $page = intval($this->getInput('page'));\n $perpage = $this->perpage;\n\n list($total, $users) = Admin_Service_User::getList($page, $perpage);\n list(, $groups) = Admin_Service_Group::getAllGroup();\n $groups = Common::resetKey($groups, 'groupid');\n\n\n \n $this->assign('users', $users);\n $this->assign('groups', $groups);\n $this->assign('status', $this->status);\n $this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'] . '/?'));\n $this->assign(\"meunOn\", \"sys_user\");\n }", "public function getRecentAllusers(Request $request)\n {\n\t\t\t$item_per_page\t=\t 20;\n\t\t\t\n\t\t\tif(isset($_POST[\"page\"])){\n\t\t\t\t$page_number = filter_var($_POST[\"page\"], FILTER_SANITIZE_NUMBER_INT, FILTER_FLAG_STRIP_HIGH); //filter number\n\t\t\t\tif(!is_numeric($page_number)){die('Invalid page number!');} //incase of invalid page number\n\t\t\t}else{\n\t\t\t\t$page_number = 1; //if there's no page number, set it to 1\n\t\t\t}\n\t\t\t\n\t\t\t//$user \t= Sentinel::getUser();\n\t\t $query = DB::table('users');\n\t\t\t$query->Where(\"users.id\",\">\",1);\n\t\t\t$query->leftJoin('user_payments', 'user_payments.user_id', '=', 'users.id');\n\t\t\t$query->orderBy('users.id', 'DESC');\n\t\t\t$query->get(['users.*']);\n\t\t\t$users = $query->get(['users.*','user_payments.status']);\n\n\t\t\t$get_total_rows\t\t\t=\t count($users);\n\t\t\t\n\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t$total_pages = ceil($get_total_rows/$item_per_page);\n\t\t\t$page_position = (($page_number-1) * $item_per_page);\n\t\t\t\n\t\t\t$query = \tDB::table('users');\n\t\t\t\t\t\t\t$query->Where(\"users.id\",\">\",1);\n\t\t\t\t\t\t\t$query->leftJoin('user_payments', 'user_payments.user_id', '=', 'users.id');\n\t\t\t\t\t\t\t$query->orderBy('users.id', 'DESC');\n\t\t\t\t\t\t\t$query->skip($page_position);\n\t\t\t\t\t\t\t$query->take($item_per_page);\n\t\t\t$users \t\t=\t$query->get(['users.*','user_payments.status']);\n\t\t\t\n\t\t\t\t\t\t\t\n\t\t $url \t\t\t=\t url();\n\t\t\t$pagination=$this->paginate_function($item_per_page, $page_number, $get_total_rows, $total_pages);\n\t\t\treturn View('admin.users.list_manage_users_ajax',compact('users','pagination','total_pages','url'));\n\t\t\texit;\n }", "function getUsers($Field = '', $Where = array(), $multiRecords = FALSE, $PageNo = 1, $PageSize = 15) {\n /* Additional fields to select */\n $Params = array();\n if (!empty($Field)) {\n $Params = array_map('trim', explode(',', $Field));\n $Field = '';\n $FieldArray = array(\n 'RegisteredOn' => 'DATE_FORMAT(E.EntryDate, \"' . DATE_FORMAT . ' %h:%i %p\") RegisteredOn',\n 'LastLoginDate' => 'DATE_FORMAT(UL.LastLoginDate, \"' . DATE_FORMAT . ' %h:%i %p\") LastLoginDate',\n 'Rating' => 'E.Rating',\n 'UserTypeName' => 'UT.UserTypeName',\n 'SocialSecurityNumber' => 'U.SocialSecurityNumber',\n 'IsAdmin' => 'UT.IsAdmin',\n 'UserID' => 'U.UserID',\n 'UserTypeID' => 'U.UserTypeID',\n 'FirstName' => 'U.FirstName',\n 'MiddleName' => 'U.MiddleName',\n 'LastName' => 'U.LastName',\n 'CitizenStatus' => 'U.CitizenStatus',\n 'AllowPrivateContestFree' => 'U.AllowPrivateContestFree',\n 'ProfilePic' => 'IF(U.ProfilePic IS NULL,CONCAT(\"' . BASE_URL . '\",\"uploads/profile/picture/\",\"default.jpg\"),CONCAT(\"' . BASE_URL . '\",\"uploads/profile/picture/\",U.ProfilePic)) AS ProfilePic',\n 'ProfileCoverPic' => 'IF(U.ProfilePic IS NULL,CONCAT(\"' . BASE_URL . '\",\"uploads/profile/cover/\",\"default.jpg\"),CONCAT(\"' . BASE_URL . '\",\"uploads/profile/picture/\",U.ProfileCoverPic)) AS ProfileCoverPic',\n 'About' => 'U.About',\n 'About1' => 'U.About1',\n 'About2' => 'U.About2',\n 'Email' => 'U.Email',\n 'EmailForChange' => 'U.EmailForChange',\n 'Username' => 'U.Username',\n 'UserTeamCode' => 'U.UserTeamCode',\n 'Gender' => 'U.Gender',\n 'BirthDate' => 'U.BirthDate',\n 'Address' => 'U.Address',\n 'Address1' => 'U.Address1',\n 'Postal' => 'U.Postal',\n 'CountryCode' => 'U.CountryCode',\n 'CountryName' => 'CO.CountryName',\n 'CityName' => 'U.CityName',\n 'StateName' => 'U.StateName',\n 'PhoneNumber' => 'U.PhoneNumber',\n 'Email' => 'U.Email',\n 'PhoneNumberForChange' => 'U.PhoneNumberForChange',\n 'Website' => 'U.Website',\n 'FacebookURL' => 'U.FacebookURL',\n 'TwitterURL' => 'U.TwitterURL',\n 'GoogleURL' => 'U.GoogleURL',\n 'InstagramURL' => 'U.InstagramURL',\n 'LinkedInURL' => 'U.LinkedInURL',\n 'WhatsApp' => 'U.WhatsApp',\n 'WalletAmount' => 'U.WalletAmount',\n 'WinningAmount' => 'U.WinningAmount',\n 'CashBonus' => 'U.CashBonus',\n 'TotalCash' => '(U.WalletAmount + U.WinningAmount + U.CashBonus) AS TotalCash',\n 'ReferralCode' => '(SELECT ReferralCode FROM tbl_referral_codes WHERE tbl_referral_codes.UserID=U.UserID LIMIT 1) AS ReferralCode',\n 'ReferredByUserID' => 'U.ReferredByUserID',\n 'Status' => 'CASE E.StatusID\n\t\t\t\t\t\t\t\t\t\t\t\twhen \"1\" then \"Pending\"\n\t\t\t\t\t\t\t\t\t\t\t\twhen \"2\" then \"Verified\"\n when \"5\" then \"Verified\"\n\t\t\t\t\t\t\t\t\t\t\t\twhen \"3\" then \"Deleted\"\n\t\t\t\t\t\t\t\t\t\t\t\twhen \"4\" then \"Blocked\"\n\t\t\t\t\t\t\t\t\t\t\t\twhen \"8\" then \"Hidden\"\t\t\n\t\t\t\t\t\t\t\t\t\t\tEND as Status',\n 'PanStatus' => 'CASE U.PanStatus\n\t\t\t\t\t\t\t\t\t\t\t\twhen \"1\" then \"Pending\"\n\t\t\t\t\t\t\t\t\t\t\t\twhen \"2\" then \"Verified\"\n when \"3\" then \"Rejected\" \n\t\t\t\t\t\t\t\t\t\t\t\twhen \"9\" then \"Not Submitted\" \n\t\t\t\t\t\t\t\t\t\t\tEND as PanStatus',\n 'BankStatus' => 'CASE U.BankStatus\n\t\t\t\t\t\t\t\t\t\t\t\twhen \"1\" then \"Pending\"\n\t\t\t\t\t\t\t\t\t\t\t\twhen \"2\" then \"Verified\"\n\t\t\t\t\t\t\t\t\t\t\t\twhen \"3\" then \"Rejected\"\t\n when \"9\" then \"Not Submitted\" \n\t\t\t\t\t\t\t\t\t\t\tEND as BankStatus',\n 'ReferredCount' => '(SELECT COUNT(*) FROM `tbl_users` WHERE `ReferredByUserID` = U.UserID) AS ReferredCount',\n 'TotalWithdrawals' => '(SELECT SUM(W.Amount) TotalWithdrawals FROM tbl_users_withdrawal W WHERE W.UserID = U.UserID AND W.StatusID=5) AS TotalWithdrawals',\n 'SourceID' => 'CASE UL.SourceID\n when \"1\" then \"Direct\"\n when \"2\" then \"Facebook\"\n when \"3\" then \"Twitter\"\n when \"4\" then \"Google\"\n when \"5\" then \"LinkedIn\" \n END as Source',\n 'StatusID' => 'E.StatusID',\n 'PanStatusID' => 'U.PanStatus',\n 'BankStatusID' => 'U.BankStatus',\n 'PushNotification' => 'US.PushNotification',\n 'PhoneStatus' => 'if(U.PhoneNumber is null, \"Pending\", \"Verified\") as PhoneStatus',\n 'EmailStatus' => 'if(U.Email is null, \"Pending\", \"Verified\") as EmailStatus'\n );\n foreach ($Params as $Param) {\n $Field .= (!empty($FieldArray[$Param]) ? ',' . $FieldArray[$Param] : '');\n }\n }\n $this->db->select('U.UserGUID, U.UserID, CONCAT_WS(\" \",U.FirstName,U.LastName) FullName');\n if (!empty($Field))\n $this->db->select($Field, FALSE);\n\n\n /* distance calculation - starts */\n /* this is called Haversine formula and the constant 6371 is used to get distance in KM, while 3959 is used to get distance in miles. */\n if (!empty($Where['Latitude']) && !empty($Where['Longitude'])) {\n $this->db->select(\"(3959*acos(cos(radians(\" . $Where['Latitude'] . \"))*cos(radians(E.Latitude))*cos(radians(E.Longitude)-radians(\" . $Where['Longitude'] . \"))+sin(radians(\" . $Where['Latitude'] . \"))*sin(radians(E.Latitude)))) AS Distance\", false);\n $this->db->order_by('Distance', 'ASC');\n\n if (!empty($Where['Radius'])) {\n $this->db->having(\"Distance <= \" . $Where['Radius'], null, false);\n }\n }\n /* distance calculation - ends */\n\n $this->db->from('tbl_entity E');\n $this->db->from('tbl_users U');\n $this->db->where(\"U.UserID\", \"E.EntityID\", FALSE);\n\n if (array_keys_exist($Params, array('UserTypeName', 'IsAdmin')) || !empty($Where['IsAdmin'])) {\n $this->db->from('tbl_users_type UT');\n $this->db->where(\"UT.UserTypeID\", \"U.UserTypeID\", FALSE);\n }\n $this->db->join('tbl_users_login UL', 'U.UserID = UL.UserID', 'left');\n $this->db->join('tbl_users_settings US', 'U.UserID = US.UserID', 'left');\n\n if (array_keys_exist($Params, array('CountryName'))) {\n $this->db->join('set_location_country CO', 'U.CountryCode = CO.CountryCode', 'left');\n }\n\n if (!empty($Where['Keyword'])) {\n $Where['Keyword'] = trim($Where['Keyword']);\n if (validateEmail($Where['Keyword'])) {\n $Where['Email'] = $Where['Keyword'];\n } elseif (is_numeric($Where['Keyword'])) {\n $Where['PhoneNumber'] = $Where['Keyword'];\n } else {\n $this->db->group_start();\n $this->db->like(\"U.FirstName\", $Where['Keyword']);\n $this->db->or_like(\"U.LastName\", $Where['Keyword']);\n $this->db->or_like(\"U.Email\", $Where['Keyword']);\n $this->db->or_like(\"U.PhoneNumber\", $Where['Keyword']);\n $this->db->or_like(\"U.SocialSecurityNumber\", $Where['Keyword']);\n $this->db->or_like(\"U.StateName\", $Where['Keyword']);\n $this->db->or_like(\"U.CitizenStatus\", $Where['Keyword']);\n $this->db->or_like(\"CONCAT_WS('',U.FirstName,U.Middlename,U.LastName)\", preg_replace('/\\s+/', '', $Where['Keyword']), FALSE);\n $this->db->group_end();\n }\n }\n\n if (!empty($Where['SourceID'])) {\n $this->db->where(\"UL.SourceID\", $Where['SourceID']);\n }\n\n if (!empty($Where['Withdrawal'])) {\n $this->db->having(\"TotalWithdrawals >= \" . $Where['Withdrawal'], null, false);\n }\n\n if (!empty($Where['UserTypeID'])) {\n $this->db->where_in(\"U.UserTypeID\", $Where['UserTypeID']);\n }\n\n if (!empty($Where['UserTypeIDNot']) && $Where['UserTypeIDNot'] == 'Yes') {\n $this->db->where(\"U.UserTypeID!=\", $Where['UserTypeIDNot']);\n }\n\n if (!empty($Where['ListType'])) {\n $this->db->where(\"DATE(E.EntryDate) =\", date(\"Y-m-d\"));\n }\n\n if (!empty($Where['UserID'])) {\n $this->db->where(\"U.UserID\", $Where['UserID']);\n }\n if (!empty($Where['UserIDNot'])) {\n $this->db->where(\"U.UserID!=\", $Where['UserIDNot']);\n }\n if (!empty($Where['UserArray'])) {\n $this->db->where_in(\"U.UserGUID\", $Where['UserArray']);\n }\n if (!empty($Where['UserGUID'])) {\n $this->db->where(\"U.UserGUID\", $Where['UserGUID']);\n }\n \n if (!empty($Where['ReferredByUserID'])) {\n $this->db->where(\"U.ReferredByUserID\", $Where['ReferredByUserID']);\n }\n\n if (!empty($Where['Username'])) {\n $this->db->where(\"U.Username\", $Where['Username']);\n }\n\n if (!empty($Where['UserTeamCode'])) {\n $this->db->where(\"U.UserTeamCode\", $Where['UserTeamCode']);\n }\n\n if (!empty($Where['Email'])) {\n $this->db->where(\"U.Email\", $Where['Email']);\n }\n if (!empty($Where['PhoneNumber'])) {\n $this->db->where(\"U.PhoneNumber\", $Where['PhoneNumber']);\n }\n\n if (!empty($Where['LoginKeyword'])) {\n $this->db->group_start();\n $this->db->where(\"U.Email\", $Where['LoginKeyword']);\n $this->db->or_where(\"U.Username\", $Where['LoginKeyword']);\n $this->db->or_where(\"U.PhoneNumber\", $Where['LoginKeyword']);\n $this->db->group_end();\n }\n if (!empty($Where['Password'])) {\n $this->db->where(\"UL.Password\", md5($Where['Password']));\n }\n\n if (!empty($Where['IsAdmin'])) {\n $this->db->where(\"UT.IsAdmin\", $Where['IsAdmin']);\n }\n if (!empty($Where['StatusID'])) {\n if ($Where['StatusID']==2 || $Where['StatusID']==5) {\n $this->db->where_in(\"E.StatusID\", array(2,5));\n }else{\n $this->db->where(\"E.StatusID\", $Where['StatusID']);\n }\n }\n if (!empty($Where['PanStatus'])) {\n $this->db->where(\"U.PanStatus\", $Where['PanStatus']);\n }\n if (!empty($Where['BankStatus'])) {\n $this->db->where(\"U.BankStatus\", $Where['BankStatus']);\n }\n\n if (!empty($Where['OrderBy']) && !empty($Where['Sequence']) && in_array($Where['Sequence'], array('ASC', 'DESC'))) {\n $this->db->order_by($Where['OrderBy'], $Where['Sequence']);\n } else {\n $this->db->order_by('U.UserID', 'DESC');\n }\n\n\n /* Total records count only if want to get multiple records */\n if ($multiRecords) {\n $TempOBJ = clone $this->db;\n $TempQ = $TempOBJ->get();\n $Return['Data']['TotalRecords'] = $TempQ->num_rows();\n $this->db->limit($PageSize, paginationOffset($PageNo, $PageSize)); /* for pagination */\n } else {\n $this->db->limit(1);\n }\n\n $Query = $this->db->get();\n // echo $this->db->last_query();\n if ($Query->num_rows() > 0) {\n foreach ($Query->result_array() as $Record) {\n\n /* get attached media */\n if (in_array('MediaPAN', $Params)) {\n $MediaData = $this->Media_model->getMedia('E.EntityGUID MediaGUID, CONCAT(\"' . BASE_URL . '\",MS.SectionFolderPath,\"110_\",M.MediaName) AS MediaThumbURL, CONCAT(\"' . BASE_URL . '\",MS.SectionFolderPath,M.MediaName) AS MediaURL,\tM.MediaCaption', array(\"SectionID\" => 'PAN', \"EntityID\" => $Record['UserID']), FALSE);\n $Record['MediaPAN'] = ($MediaData ? $MediaData : new stdClass());\n }\n\n if (in_array('MediaBANK', $Params)) {\n $MediaData = $this->Media_model->getMedia('E.EntityGUID MediaGUID, CONCAT(\"' . BASE_URL . '\",MS.SectionFolderPath,\"110_\",M.MediaName) AS MediaThumbURL, CONCAT(\"' . BASE_URL . '\",MS.SectionFolderPath,M.MediaName) AS MediaURL,\tM.MediaCaption', array(\"SectionID\" => 'BankDetail', \"EntityID\" => $Record['UserID']), FALSE);\n $Record['MediaBANK'] = ($MediaData ? $MediaData : new stdClass());\n }\n\n /* Get Wallet Data */\n if (in_array('Wallet', $Params)) {\n $WalletData = $this->getWallet('Amount,Currency,PaymentGateway,TransactionType,TransactionID,EntryDate,Narration,Status,OpeningBalance,ClosingBalance', array('UserID' => $Where['UserID'], 'TransactionMode' => 'WalletAmount'), TRUE);\n $Record['Wallet'] = ($WalletData) ? $WalletData['Data']['Records'] : array();\n }\n\n /* Get Wallet Data */\n if (in_array('PrivateContestFee', $Params)) {\n $PrivateContestFee = $this->db->query('SELECT ConfigTypeValue FROM set_site_config WHERE ConfigTypeGUID = \"PrivateContestFee\" LIMIT 1');\n $Record['PrivateContestFee'] = $PrivateContestFee->row()->ConfigTypeValue;\n }\n\n /* Get Wallet Data */\n if (in_array('LeaveContestCharge', $Params)) {\n $PrivateContestFee = $this->db->query('SELECT ConfigTypeValue FROM set_site_config WHERE ConfigTypeGUID = \"LeaveContestCharge\" LIMIT 1');\n $Record['LeaveContestCharge'] = $PrivateContestFee->row()->ConfigTypeValue;\n }\n\n /* Get Wallet Data */\n if (in_array('MinimumWithdrawalLimitBank', $Params)) {\n $PrivateContestFee = $this->db->query('SELECT ConfigTypeValue FROM set_site_config WHERE ConfigTypeGUID = \"MinimumWithdrawalLimitBank\" LIMIT 1');\n $Record['MinimumWithdrawalLimitBank'] = $PrivateContestFee->row()->ConfigTypeValue;\n }\n\n /* Get Wallet Data */\n if (in_array('MinimumDepositLimit', $Params)) {\n $PrivateContestFee = $this->db->query('SELECT ConfigTypeValue FROM set_site_config WHERE ConfigTypeGUID = \"MinimumDepositLimit\" LIMIT 1');\n $Record['MinimumDepositLimit'] = $PrivateContestFee->row()->ConfigTypeValue;\n }\n\n /* Get Wallet Data */\n if (in_array('MaximumDepositLimit', $Params)) {\n $PrivateContestFee = $this->db->query('SELECT ConfigTypeValue FROM set_site_config WHERE ConfigTypeGUID = \"MaximumDepositLimit\" LIMIT 1');\n $Record['MaximumDepositLimit'] = $PrivateContestFee->row()->ConfigTypeValue;\n }\n\n\n /* Get Playing History Data */\n if (in_array('PlayingHistory', $Params)) {\n\n $PlayingHistory = $this->db->query(\"SELECT TotalJoinedContest,TotalJoinedContestWinning FROM \n (select COUNT(JC.ContestID) as TotalJoinedContest from sports_contest_join JC,sports_contest C where JC.UserID = '\".$Record['UserID'].\"' AND JC.ContestID=C.ContestID AND C.Privacy='No' ) TotalJoinedContest,\n (select COUNT(JC.ContestID) as TotalJoinedContestWinning from sports_contest_join JC,sports_contest C where JC.UserID = '\".$Record['UserID'].\"' AND JC.ContestID=C.ContestID AND JC.UserWinningAmount > 0 ) TotalJoinedContestWinning\")->row();\n $Record['PlayingHistory'] = ($PlayingHistory) ? $PlayingHistory : array();\n }\n\n if (!$multiRecords) {\n return $Record;\n }\n $Records[] = $Record;\n }\n\n $Return['Data']['Records'] = $Records;\n return $Return;\n }\n return FALSE;\n }", "function Members_List_user_viewlast10($args)\n{\n // User functions of this type can be called by other modules. If this\n // happens then the calling module will be able to pass in arguments to\n // this function through the $args parameter. Hence we extract these\n // arguments *after* we have obtained any form-based input through\n // pnVarCleanFromInput().\n extract($args);\n\t\n // Create output object - this object will store all of our output so that\n // we can return it easily when required\n\t$pnRender =& new pnRender('Members_List');\n\n\t// set the cache id\n\t$pnRender->cache_id = pnUserLoggedIn();\n\n\t// check out if the contents are cached.\n\t// If this is the case, we do not need to make DB queries.\n\t// Note that we print out \"cached:\" in front of a chached output --\n\t// of course, this is here to illustrate caching and needs to be removed!\n\tif ($pnRender->is_cached('memberslist_user_viewlast10.htm')) {\n\t\treturn $pnRender->fetch('memberslist_user_viewlast10.htm');\n\t}\n\n // get last 10 user id's\n $users = pnModAPIFunc('Members_List',\n 'user',\n 'getall',\n array('sortby' => 'user_regdate',\n 'numitems' => 10,\n 'sortorder' => 'DESC'));\n\t\t\t\t\t\t\t\t \n // Is current user online\n\t$pnRender->assign('loggedin', pnUserLoggedIn());\n\n $pagedusers = array();\n foreach($users as $userid) {\n\n $user = pnUserGetVars($userid['uid']);\n $isonline = pnModAPIFunc('Members_List',\n 'user',\n 'isonline',\n array('userid' => $userid['uid']));\n\n // display online status\n if ($isonline){\n\t\t $user['onlinestatus'] = 1;\n } else {\n\t\t $user['onlinestatus'] = 0;\n }\n\n // display registration date\n $user['pn_user_regdate'] = ml_ftime(_DATEBRIEF, $user['pn_user_regdate']);\n\t\t\n $pagedusers[] = $user;\n }\n $pnRender->assign('users', $pagedusers);\n\n // Return the output that has been generated by this function\n return $pnRender->fetch('memberslist_user_viewlast10.htm');\n\n}", "public function getPageItems()\n {\n }", "function wfSpecialListusers( $par = null ) {\n\tglobal $wgRequest;\n\n\tlist( $limit, $offset ) = wfCheckLimits();\n\n\n\t$slu = new ListUsersPage();\n\t\n\t/**\n\t * Get some parameters\n\t */\n\t$groupTarget = isset($par) ? $par : $wgRequest->getVal( 'group' );\n\t$slu->requestedGroup = $groupTarget;\n\t$slu->requestedUser = $wgRequest->getVal('username');\n\n\treturn $slu->doQuery( $offset, $limit );\n}", "public function getAllUsers($currentPage = 1, $limit = 5)\n {\n $query = $this->createQueryBuilder('u')\n ->orderBy('u.username', 'ASC')\n ->getQuery();\n\n $paginator = $this->paginate($query, $currentPage, $limit);\n\n return $paginator;\n }", "function GetAllUsersForUsersPage($strWhere,$fieldaArray = \"\"){\r\n\t\tglobal $link;\r\n\t\treset($fieldaArray);\r\n\t\tforeach ($fieldaArray as $field){\r\n\t\t\t$strFields .= \"\".$field . \" ,\";\r\n\t\t} \r\n\t\t$strFields = substr($strFields, 0, strlen($strFields) - 1);\t\r\n\t\tif(!in_array(2, (array)$_SESSION['user_in_groups'])){\r\n\t\t\t$sql = \"SELECT $strFields FROM \". USERS .\" join `Company` on \".USERS.\".CompanyID = `Company`.ID LEFT JOIN \".ZONES.\" ON \".ZONES.\".ID = \".USERS.\".ZoneID WHERE $strWhere \" or die(\"Error in the consult..\" . mysqli_error($link));\r\n\t\t\t\r\n\t\t}elseif(in_array(2, (array)$_SESSION['user_in_groups'])){\r\n\t\t\t$sql = \"SELECT $strFields FROM \". USERS .\" LEFT JOIN \".ZONES.\" ON \".ZONES.\".ID = \".USERS.\".ZoneID WHERE $strWhere \" or die(\"Error in the consult..\" . mysqli_error($link));\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\t$result = mysqli_query($link,$sql) ;\r\n\t\tif($result){\r\n\t\t\twhile($row = mysqli_fetch_array($result)){\r\n\t\t\t\t$arr[] = $row;\r\n\t\t\t}\r\n\t\t}\t\r\n\t\treturn $arr; \r\n\t}", "public function index()\n {\n\n //$users = User::paginate(10, ['*'], 'page', 15);\n return view('admin.pages.user_manage.list');\n }", "public function admin_get_users(){\n $limit = $this->input->get('length');\n $offset = $this->input->get('start');\n $search = $this->input->get('search')['value'];\n echo $this->usm->get_users($limit, $offset, $search);\n }", "public function get_list() {\r\n try {\r\n $limit = $this->getSafe('limit', $this->app->appConf->page_size);\r\n $page_number = $this->getSafe('page_number', 1);\r\n $where = $this->getSafe('where', '');\r\n $order_by = $this->getSafe('order_by', '');\r\n $keywords = $this->getSafe('keywords', '');\r\n \r\n $page_number = empty($page_number) ? 1 : $page_number;\r\n \r\n $start_index = ($page_number -1) * $limit;\r\n \r\n $db = $this->app->getDbo();\r\n \r\n $search = '';\r\n \r\n if (!empty($keywords)) {\r\n $keywords = $db->quote('%' . $keywords . '%');\r\n // search theo email\r\n $search .= $db->quoteName('email') . ' LIKE ' . $keywords;\r\n // search theo mobile\r\n $search .= ' OR ' . $db->quoteName('mobile') . ' LIKE ' . $keywords;\r\n // search theo display_name\r\n $search .= ' OR ' . $db->quoteName('display_name') . ' COLLATE utf8_general_ci LIKE ' . $keywords;\r\n }\r\n \r\n if (!empty ($where)) {\r\n if (!empty ($search)) {\r\n $where = ' AND (' . $search . ')';\r\n }\r\n } else {\r\n $where = $search;\r\n }\r\n \r\n $data = array (\r\n 'limit' => $limit,\r\n 'start_index' => $start_index,\r\n 'order_by' => $order_by,\r\n 'where' => $where\r\n );\r\n \r\n $user_list = $this->user_model->get_list($data);\r\n \r\n $total_user_list = $this->user_model->get_list_total($where);\r\n \r\n $ret = array (\r\n 'users' => $user_list,\r\n 'total' => $total_user_list\r\n );\r\n \r\n $this->renderJson($ret);\r\n \r\n } catch (Exception $ex) {\r\n $this->app->write_log('user_get_list_exception - ' . $ex->getMessage());\r\n \r\n $ret = $this->message(1, 'user_get_list_exception', EXCEPTION_ERROR_MESSAGE);\r\n $this->renderJson($ret);\r\n }\r\n }", "public function getPageSize();", "function getPaging() {\n\t\t//if the total number of rows great than page size\n\t\tif($this->totalRows > $this->pageSize) {\n\t\t\tprint '<div class=\"paging\">';\n\t\t\tprint '<ul>';\n\t\t\tprint $this->first() . $this->prev() . $this->pageList() . $this->next() . $this->end();\n\t\t\tprint '</ul>';\n\t\t\tprint '</div>';\n\t\t}\n }", "function getUsers(){\n }", "function getUsers(){\n }", "public function getPaginate(){ }", "public function index()\n {\n return new UserCollection(User::paginate(10));\n }" ]
[ "0.72818124", "0.7099971", "0.7076388", "0.69827867", "0.6890734", "0.68459904", "0.6782392", "0.6773319", "0.6738266", "0.6718587", "0.6695753", "0.66815007", "0.66724116", "0.66008097", "0.6594927", "0.6580319", "0.6561544", "0.65568876", "0.65458035", "0.6532086", "0.6529673", "0.646898", "0.6468232", "0.646112", "0.64600384", "0.64594173", "0.64504886", "0.644627", "0.644627", "0.6412762", "0.63964534", "0.6368522", "0.6343887", "0.6327318", "0.63261324", "0.63150537", "0.6313445", "0.6311195", "0.6308587", "0.6285564", "0.62848824", "0.62810856", "0.6275737", "0.62533027", "0.625264", "0.6249368", "0.62457484", "0.6244214", "0.624239", "0.6238063", "0.62139076", "0.62087035", "0.6207848", "0.618992", "0.6187834", "0.6183342", "0.61595136", "0.6155467", "0.61539495", "0.61533225", "0.61438704", "0.6140973", "0.61383146", "0.6138229", "0.61317503", "0.61291313", "0.6123968", "0.6121006", "0.6118315", "0.6113478", "0.6113478", "0.61128324", "0.6111702", "0.6104979", "0.6103213", "0.610032", "0.6097959", "0.60945916", "0.6089897", "0.60857946", "0.60822237", "0.6069684", "0.60679495", "0.6061069", "0.60603774", "0.6057774", "0.605632", "0.6043769", "0.6041756", "0.60389966", "0.6038312", "0.60330385", "0.60268176", "0.6019038", "0.60158795", "0.5996915", "0.5994076", "0.5988651", "0.5988651", "0.5981328", "0.5979287" ]
0.0
-1
Determine whether the user can view any product groups.
public function viewAny(User $user) { return $user->hasPermissions(['group_read']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function userHasAccess()\n {\n $required_perm = $this->route['perm'];\n $user_group = $_SESSION['user_group'];\n if ($required_perm == 'all') {\n return true;\n } elseif ($user_group == $required_perm) {\n return true;\n }\n return false;\n }", "public function allowed_group()\n\t{\n\t\t$which = func_get_args();\n\n\t\tif ( ! count($which))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Super Admins always have access\n\t\tif (ee()->session->userdata('group_id') == 1)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tforeach ($which as $w)\n\t\t{\n\t\t\t$k = ee()->session->userdata($w);\n\n\t\t\tif ( ! $k OR $k !== 'y')\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}", "public function authorize()\n {\n return auth()->user()->can('create-product-packages');\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webkul_Marketplace::product');\n }", "public function allowed_group_any()\n\t{\n\t\t$which = func_get_args();\n\n\t\tif ( ! count($which))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Super Admins always have access\n\t\tif (ee()->session->userdata('group_id') == 1)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\t$result = FALSE;\n\n\t\tforeach ($which as $w)\n\t\t{\n\t\t\t$k = ee()->session->userdata($w);\n\n\t\t\tif ($k === TRUE OR $k == 'y')\n\t\t\t{\n\t\t\t\t$result = TRUE;\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "private function canDisplay()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }", "public function isAvailable()\n\t{\n\t\tif ($this->isLocked())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tif (BE_USER_LOGGED_IN !== true && !$this->isPublished())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Show to guests only\n\t\tif ($this->arrData['guests'] && FE_USER_LOGGED_IN === true && BE_USER_LOGGED_IN !== true && !$this->arrData['protected'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Protected product\n\t\tif (BE_USER_LOGGED_IN !== true && $this->arrData['protected'])\n\t\t{\n\t\t\tif (FE_USER_LOGGED_IN !== true)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$groups = deserialize($this->arrData['groups']);\n\n\t\t\tif (!is_array($groups) || empty($groups) || !count(array_intersect($groups, $this->User->groups)))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Check if \"advanced price\" is available\n\t\tif ($this->arrData['price'] === null && (in_array('price', $this->arrAttributes) || in_array('price', $this->arrVariantAttributes)))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function isAuthorized($user){\n /*\n * \n 1 \tAdmin\n 2 \tOfficer / Manager\n 3 \tRead Only\n 4 \tStaff\n 5 \tUser / Operator\n 6 \tStudent\n 7 \tLimited\n */\n \n //managers can add / edit\n if (in_array($this->request->action, ['delete','add','edit','reorder'])) {\n if ($user['group_id'] <= 4) {\n return true;\n }\n }\n \n \n //Admins have all\n return parent::isAuthorized($user);\n }", "public function canCreateSitegroups() {\n $viewer = Engine_Api::_()->user()->getViewer();\n if (!$viewer || !$viewer->getIdentity()) {\n return false;\n }\n\n // Must be able to view Sitegroups\n if (!Engine_Api::_()->authorization()->isAllowed('sitegroup_group', $viewer, 'view')) {\n return false;\n }\n\n // Must be able to create Sitegroups\n if (!Engine_Api::_()->authorization()->isAllowed('sitegroup_group', $viewer, 'create')) {\n return false;\n }\n return true;\n }", "public function isAccessible() {\n\t\treturn UserGroup::isAccessibleGroup(array($this->groupID));\n\t}", "public function authorize()\n {\n return $this->groupHasUser() || $this->hasSeller();\n }", "public function showing_restricted_products() {\n\t\treturn ! $this->hiding_restricted_products();\n\t}", "protected function _isAllowed()\n\t{\n\t\treturn (Mage::getSingleton('admin/session')->isAllowed('dropship360/suppliers') || Mage::getSingleton('admin/session')->isAllowed('dropship360/vendor_ranking'));\n\t}", "public function hasGroups(){\n return $this->_has(3);\n }", "public function authorize()\n {\n $company_id = auth()->user()->cmpny_id;\n $group_id = request()->post('id');\n $group = Group::find($group_id);\n if ($group_id && (!isset($group->id) || empty($group->id)))\n {\n return false;\n }\n if (!empty($group->id) && ($company_id != $group->cmpny_id))\n {\n return false;\n }\n\n return true;\n }", "public function hasGroups(){\n return $this->_has(4);\n }", "public function hasGroups(){\n return $this->_has(4);\n }", "public function isAdmin()\n {\n return $this->group_id === 1;\n }", "public function batch_items_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "function checkActionPermissionGroup($permittedGroups) {\n if (is_array($permittedGroups) && count($permittedGroups) > 0) {\n foreach ($permittedGroups as $groupId => $allowed) {\n if ($allowed && $groupId == -2) {\n return TRUE;\n } elseif ($allowed && $this->authUser->inGroup($groupId)) {\n return TRUE;\n }\n }\n }\n return FALSE;\n }", "public function hasGroups(){\n return $this->_has(1);\n }", "public function is_group(){\n return is_array($this->controls) && count($this->controls) > 1;\n }", "public function isAdmin()\n {\n $p = User::getUser();\n if($p)\n {\n if($p->canAccess('Edit products') === TRUE)\n {\n return TRUE;\n }\n }\n return FALSE;\n }", "public function userCanSubmit() {\n\t\tglobal $content_isAdmin;\n\t\tif (!is_object(icms::$user)) return false;\n\t\tif ($content_isAdmin) return true;\n\t\t$user_groups = icms::$user->getGroups();\n\t\t$module = icms::handler(\"icms_module\")->getByDirname(basename(dirname(dirname(__FILE__))), TRUE);\n\t\treturn count(array_intersect($module->config['poster_groups'], $user_groups)) > 0;\n\t}", "public function isAuthorized() {\n\t\t$UserDN = $this->getDistinguishedName($this->Username);\n\t\t$GroupMemberships = $this->getGroups($UserDN);\n\t\tforeach($this->Groups as $Group) {\n\t\t\tif(in_array($this->getDistinguishedName($Group), $GroupMemberships)) {\n\t\t\t/*\n\t\t\t* If any Group the User is a Member of matches the Allowed groups -> Authorization success.\n\t\t\t*/\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t/*\n\t\t* This only happens when no Groupmembership matches the Allowed groups -> Authorization failed.\n\t\t*/\n\t\treturn false;\n\t}", "public function isUserOrGroupSet() {}", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_logistics/equipment');\n }", "public function isAllowed()\n {\n $result = new \\Magento\\FrameWork\\DataObject(['is_allowed' => true]);\n $this->_eventManager->dispatch(\n 'ves_vendor_menu_check_acl',\n [\n 'resource' => $this->_resource,\n 'result' => $result\n ]\n );\n $permission = new \\Vnecoms\\Vendors\\Model\\AclResult();\n $this->_eventManager->dispatch(\n 'ves_vendor_check_acl',\n [\n 'resource' => $this->_resource,\n 'permission' => $permission\n ]\n );\n return $result->getIsAllowed() && $permission->isAllowed();\n }", "public function hasGroup()\n {\n return $this->_has('_group');\n }", "public function hasAssignedServerGroup() {\n\t\t$q = mysql_safequery('SELECT servergroup FROM tblproducts WHERE id = ?', array($this->id));\n\t\t$row = mysql_fetch_assoc($q);\n\t\treturn isset($row['servergroup']) ? (int) $row['servergroup'] : false;\n\t}", "public function isMenu() {\n\t\t$groupId = $this->Session->read('UserAuth.User.user_group_id');\n\t\t\n\t\tApp::import(\"Model\", \"Usermgmt.UserGroupPermission\"); \n\t\t$model = new UserGroupPermission(); \n\t\t$dados = $model->find(\"all\", array(\n\t\t\t'conditions'=>array('UserGroupPermission.user_group_id'=>$groupId,'UserGroupPermission.allowed'=>1),\n\t\t\t'fields' => array('UserGroupPermission.controller', 'UserGroupPermission.action')\n\t\t)); \n\t\t\n\t\treturn $dados;\n\t}", "public static function canDisplayUsersMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_USER);\n\t}", "public function authorize()\n {\n return access()->hasPermissions(['view-backend', 'view-inventory', 'manage-inventory'], true);\n }", "public function checkAllowed() {\r\n\t\t// if option is not active return true!\r\n\t\tif (Mage::getStoreConfig('b2bprofessional/generalsettings/activecustomers')) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t$iUserStoreId\t\t= Mage::getSingleton('customer/session')->getCustomer()->getStore()->getGroupID();\r\n\t\t$iCurrentStoreId\t= Mage::app()->getStore()->getGroupID();\r\n\r\n\t\tif ($iUserStoreId == $iCurrentStoreId) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public function isAuthorized($user)\n {\n if (isset($user['group_id']) && $user['group_id'] === '4') {\n return true;\n } else { \n return false;\n }\n }", "public function canUserManageUsage()\n {\n return $this->getUser()->hasAccess('manage', 'newsUsage');\n }", "public function hasAccess()\n\t{\n\t\t/* Check Permissions */\n\t\treturn \\IPS\\Member::loggedIn()->hasAcpRestriction( \"core\",\"members\" );\n\t}", "public function canUserManageAreaOfApplication()\n {\n return $this->getUser()->hasAccess('manage', 'newsAreaOfApplication');\n }", "function isAuthorized() {\n $roles = $this->Role->calculateCMRoles();\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Determine what operations this user can perform\n \n // Accept an OAuth callback?\n $p['callback'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Delete an existing SalesforceSource?\n $p['delete'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Edit an existing SalesforceSource?\n $p['edit'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View all existing SalesforceSources?\n $p['index'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View API limits?\n $p['limits'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing SalesforceSource?\n $p['view'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n $this->set('permissions', $p);\n return($p[$this->action]);\n }", "public function 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 static function canDisplayPermissionsMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_PERMISSION);\n\t}", "public function isGroup(){\n\t\t\n\t\t$this->validateInited();\n\t\t\n\t\t$arrChildren = UniteFunctionsWPUC::getPostChildren($this->post);\n\t\t\t\t\n\t\tif(!empty($arrChildren))\n\t\t\treturn(true);\n\t\t\n\t\treturn(false);\n\t}", "public function allowedToViewStore($usergroup)\n {\n $app = \\XF::app();\n\n $excludedUsergroups = $app->options()->rexshop_excluded_usergroups;\n if (!empty($excludedUsergroups)) {\n $usergroups = explode(',', ltrim(rtrim(trim($excludedUsergroups, ' '), ','), ','));\n\n return !in_array((int) $usergroup, $usergroups);\n }\n\n return true;\n }", "public function isAuthorized($user, $request) {\n\t\tController::loadModel('Member');\n\n\t\tif ($this->Member->GroupsMember->isMemberInGroup( $this->Member->getIdForMember($user), Group::FULL_ACCESS )) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function can_view_report() {\n //make sure context libraries are loaded\n $this->require_dependencies();\n\n //make sure the current user can view reports in at least one course context\n $contexts = get_contexts_by_capability_for_user('cluster', $this->access_capability, $this->userid);\n return !$contexts->is_empty();\n }", "public function canUpload()\n {\n return $this->checkFrontendUserPermissionsGeneric('userGroupAllowUpload');\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('catalog/categories');\n }", "public function authorize()\n {\n return auth()->user()->can('store', [Product::class]);\n }", "protected function _isAllowed()\n\t{\n\t\treturn Mage::getSingleton('admin/session')->isAllowed('dropship360/inventory');\n\t}", "private function groups_check(){\n\t\t\n\t\t$production_formats = new \\gcalc\\db\\production\\formats();\n\t\t$needed_groups = $production_formats->get_product_groups( $this->slug );\n\t\t$needed_groups_ = array_flip( $needed_groups );\n\t\t$todo_groups = $this->get_todo_groups();\n\t\tforeach ($todo_groups as $key => $value) {\t\t\n\t\t\tif ( array_key_exists( $key, $needed_groups_)) {\n\t\t\t\t$index = $needed_groups_[ $key ];\n\t\t\t\tunset($needed_groups[ $index ]);\n\t\t\t}\t\t\t\n\t\t}\n\t\tif ( count( $needed_groups) > 0) {\n\t\t\t\t\t\n\t\t}\n\t}", "private function checkUserAdministrator():bool\n {\n $user = JFactory::getUser();\n if (in_array(8, $user->groups)) {\n return true;\n }\n return false;\n }", "public function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('shopgate_menu/manage');\n }", "protected function checkUsage(){\n $modId = $this->getModId();\n $oDeclarator = AMI_ModDeclarator::getInstance();\n $parentModId = $oDeclarator->getParent($modId);\n return\n AMI::issetAndTrueOption($parentModId, 'use_categories');\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 viewAny(User $user)\n {\n if ($user->hasPermissionTo('view crm product categories')) {\n return true;\n }\n }", "public function authorize() : bool\n {\n return auth()->user()->can('create', GroupSetting::class);\n }", "public function authorize()\n {\n if (Auth::user() && Auth::user()->hasPermissionTo('manage categories')) {\n return true;\n } else {\n return false;\n }\n }", "public function customerGroupCheck()\r\n {\r\n if (Mage::app()->getStore()->isAdmin())\r\n $customer = Mage::getSingleton('adminhtml/session_quote')->getCustomer();\r\n else\r\n $customer = Mage::getSingleton('customer/session')->getCustomer();\r\n $customer_group = $customer->getGroupId();\r\n $group = Mage::getStoreConfig('customercredit/general/assign_credit');\r\n $group = explode(',', $group);\r\n if (in_array($customer_group, $group)) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public function hasAuthorised ()\n\t{\n\n\t\tglobal $availableSMModules;\n\n\t\t$return = false;\n\n\t\tforeach ( $availableSMModules as $smModule )\n\t\t{\n\t\t\tif ( count( $this->userInfo[ 'authorisation' ][ $smModule ] ) )\n\t\t\t{\n\t\t\t\t$return = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "function AdminSecurityCheck(){\n\t\t$User = new User();\n\t\t$user = $this->session->userdata('Group');\n\t\tif ($user){\n\t\t\tif($user == 1){\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\treturn false;\n\t\t}\n\t}", "private function authorize()\n {\n $authorized = FALSE;\n\n if ( in_array(ee()->session->userdata['group_id'], ee()->publisher_setting->can_admin_publisher()))\n {\n $authorized = TRUE;\n }\n\n if (ee()->session->userdata['group_id'] == 1)\n {\n $authorized = TRUE;\n }\n\n if ( !$authorized)\n {\n ee()->publisher_helper_url->redirect(ee()->publisher_helper_cp->mod_link('view_unauthorized'));\n }\n }", "public function isAdmin() {\n\t\tif ($this->getLevelId() == 2 || $this->isSupervisor())\n\t\t\treturn true;\n\n\t\t$groups = $this->getGroups();\n\t\tforeach ($groups as $group) {\n\t\t\tif ($group->getGroupId() == 2)\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "protected function _isAllowed()\r\n {\r\n return Mage::getSingleton('admin/session')->isAllowed('system/thetailor_workgroup_workflow');\r\n }", "public static function canDisplayAreasMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_AREA);\n\t}", "function can_access($group_id = FALSE, $page = FALSE)\n {\n $count = $this->db\n ->from('group_permission')\n ->where('group_id', $group_id)\n ->where('module_id', '0')\n ->count_all_results();\n if ($count) {\n return TRUE;\n }\n\n // if not allowed to access everything\n // check if allowed to access requested page\n return $this->db\n ->from('module')\n ->join('group_permission', 'group_permission.module_id = module.module_id')\n ->where('group_permission.group_id', $group_id)\n ->where('module.url', $page)\n ->count_all_results();\n }", "public static function canDisplayGreaterAreasMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_GREATER_AREA);\n\t}", "public static function currentUserHasAccess() {\n return current_user_can('admin_access');\n }", "public static function canDisplayProfitAndLossMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_PROFIT_AND_LOSS_REPORT);\n\t}", "function rordb_can_user_view_items(){\n return current_user_can('rordb_view_items');\n}", "protected function passesAuthorization(): bool\n {\n return $this->hasNestedMenu();\n }", "function is_viewable($group, $uid = NULL) {\n if (!$uid)\n $uid = userid();\n $privacy = $group['group_privacy'];\n $isMember = $this->is_member($uid, $group['group_id']);\n\n if ($privacy == 1 && !$isMember) {\n e(lang(\"you_need_owners_approval_to_view_group\"), \"w\");\n return true;\n } elseif ($privacy == 1 && !$this->is_active_member($uid, $group['group_id'])) {\n e(lang(\"grp_inactive_account\"), \"w\");\n return true;\n } elseif ($privacy == 2 && !$isMember && !$this->is_invited($uid, $group['group_id'], $group['userid'])) {\n e(lang(\"grp_prvt_err1\"));\n return false;\n } else {\n return true;\n }\n\n /* \t\t$group_id = $group['group_id'];\n $is_Member = $this->is_member($uid,$group['group_id'],true);\n\n if($group['group_privacy'] == 2 && !$is_Member)\n return array(\"privacy\"=>$group['group_privacy'],\"isMember\"=>$is_Member);\n elseif($group['group_privacy'] == 1 && !$is_Member)\n return array(\"privacy\"=>$group['group_privacy'],\"isMember\"=>$is_Member);\n else\n return true; */\n }", "public function isAuthorized($user) {\n if (isset($user['group_id']) && $user['group_id'] === '1') {\n return true;\n }\n\n // Default deny\n return false;\n }", "static function getIsAdmin() {\n\t\t$user = ctrl_users::GetUserDetail();\n\t\tif($user['usergroupid'] == 1) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function isAuthorized() {\n $roles = $this->Role->calculateCMRoles(); // What was authenticated\n \n // Store the group ID in the controller object since performRedirect may need it\n \n if(($this->action == 'add' || $this->action == 'updateGroup')\n && isset($this->request->data['CoGroupMember']['co_group_id']))\n $this->gid = filter_var($this->request->data['CoGroupMember']['co_group_id'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_BACKTICK);\n elseif(($this->action == 'delete' || $this->action == 'edit' || $this->action == 'view')\n && isset($this->request->params['pass'][0]))\n $this->gid = $this->CoGroupMember->field('co_group_id', array('CoGroupMember.id' => $this->request->params['pass'][0]));\n elseif($this->action == 'select' && isset($this->request->params['named']['cogroup']))\n $this->gid = filter_var($this->request->params['named']['cogroup'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_BACKTICK);\n \n $managed = false;\n $owner = false;\n $member = false;\n \n if(!empty($roles['copersonid']) && isset($this->gid)) {\n $managed = $this->Role->isGroupManager($roles['copersonid'], $this->gid);\n \n $gm = $this->CoGroupMember->find('all', array('conditions' =>\n array('CoGroupMember.co_group_id' => $this->gid,\n 'CoGroupMember.co_person_id' => $roles['copersonid'])));\n \n if(isset($gm[0]['CoGroupMember']['owner']) && $gm[0]['CoGroupMember']['owner'])\n $owner = true;\n \n if(isset($gm[0]['CoGroupMember']['member']) && $gm[0]['CoGroupMember']['member'])\n $member = true;\n }\n \n // Is this specified group read only?\n $readOnly = ($this->gid ? $this->CoGroupMember->CoGroup->readOnly($this->gid) : false);\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Add a new member to a group?\n // XXX probably need to check if group is open here and in delete\n $p['add'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // Delete a member from a group?\n $p['delete'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // Edit members of a group?\n $p['edit'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // View a list of members of a group?\n // This is for REST\n $p['index'] = ($this->request->is('restful') && ($roles['cmadmin'] || $roles['coadmin']));\n \n // Select from a list of potential members to add?\n $p['select'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // Update accepts a CO Person's worth of potential group memberships and performs the appropriate updates\n $p['update'] = !$readOnly && ($roles['cmadmin'] || $roles['comember']);\n \n // Select from a list of potential members to add?\n $p['updateGroup'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // View members of a group?\n $p['view'] = ($roles['cmadmin'] || $managed || $member);\n \n $this->set('permissions', $p);\n return $p[$this->action];\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 static function has_admin_access() {\n\t\treturn current_user_can( 'manage_options' );\n\t}", "public static function canDisplayRolesMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_ROLE);\n\t}", "public function hasPermissions()\n {\n return $this->roles()->count() > 1;\n }", "public function hasGroup()\n {\n return isset($this->arrConfig['group']);\n }", "public function isAdmin() {\n return (json_decode($this->group->permissions))->admin;\n }", "private function hasRequestedScopeAccess()\n {\n // allow specific store view scope\n $storeCode = $this->_request->getParam('store');\n if ($storeCode) {\n $store = $this->_storeManager->getStore($storeCode);\n if ($store) {\n if ($this->_role->hasStoreAccess($store->getId())) {\n return true;\n }\n }\n } elseif ($websiteCode = $this->_request->getParam('website')) {\n try {\n $website = $this->_storeManager->getWebsite($websiteCode);\n if ($website) {\n if ($this->_role->hasWebsiteAccess($website->getId(), true)) {\n return true;\n }\n }\n // phpcs:ignore Magento2.CodeAnalysis.EmptyBlock\n } catch (\\Magento\\Framework\\Exception\\LocalizedException $e) {\n // redirect later from non-existing website\n }\n }\n return false;\n }", "public function hasAccess($groupList) {\n return tx_pttools_div::hasGroupAccess($groupList, $this->access);\n }", "static public function canCreateGallery($context, $user)\r\n {\r\n if ( $user->getId() === null ) return false;\r\n\r\n self::_checkContext($context);\r\n self::_checkUser($user);\r\n\r\n /**\r\n * if context - user profile\r\n */\r\n if ( $context instanceof Warecorp_User ) {\r\n /**\r\n * user views own galleries\r\n */\r\n if ( $context->getId() == $user->getId() ) {\r\n return true;\r\n }\r\n /**\r\n * user views galleries of other user\r\n */\r\n else {\r\n return false;\r\n }\r\n }\r\n /**\r\n * if context - group\r\n */\r\n elseif ( $context instanceof Warecorp_Group_Base ) {\r\n /**\r\n * user is host of this group\r\n */\r\n if ($context->getMembers()->isHost($user->getId())) {\r\n return true;\r\n }\r\n /**\r\n * user is cohost of this group\r\n */\r\n elseif ($context->getMembers()->isCohost($user->getId())) {\r\n return true;\r\n }\r\n /**\r\n * user is member of this group\r\n */\r\n elseif ($context->getMembers()->isMemberExistsAndApproved($user->getId())) {\r\n \tif (Warecorp_Group_AccessManager::canUseVideos($context, $user)) return true;\r\n \t\telse return false;\r\n }\r\n /**\r\n * user isn't member of this group\r\n */\r\n else {\r\n\r\n }\r\n }\r\n return false;\r\n }", "public function isAdmin() {\n\t\t$groupId = $this->Session->read('UserAuth.User.user_group_id');\n\t\tif($groupId==ADMIN_GROUP_ID) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function hasAllowedRole()\n {\n if ($this->isCurrentUser() || (! $this->isStaff())) {\n // Always allow editing of non-staff user\n // for the time being\n return true;\n }\n $dbLookup = $this->util->getDbLookup();\n $groups = $dbLookup->getActiveStaffGroups();\n $group = $this->getGroup();\n\n if (! isset($groups[$group])) {\n // Allow editing when the group does not exist or is no longer active.\n return true;\n }\n\n $allowedGroups = $this->userLoader->getCurrentUser()->getAllowedStaffGroups();\n if ($allowedGroups) {\n return (boolean) isset($allowedGroups[$this->getGroup()]);\n } else {\n return false;\n }\n }", "public function HasGroupFilters(): bool\n {\n return $this->GroupFilterLinks()->count() > 1;\n }", "public static function isAuthorized()\n {\n // Initialize system variables\n $user = JFactory::getUser();\n\n // Check the ACLs for Joomla! 1.6 and later\n if($user->authorise('core.manage', 'com_simplelists') == false) {\n return false;\n }\n\n return true;\n }", "function isAuthorized() {\n $roles = $this->Role->calculateCMRoles();\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Add a new Data Scrubber Filter Attribute?\n $p['add'] = $roles['cmadmin'] || $roles['coadmin'];\n \n // Delete an existing Data Scrubber Filter Attribute?\n $p['delete'] = $roles['cmadmin'] || $roles['coadmin'];\n \n // Edit an existing Data Scrubber Filter Attribute?\n $p['edit'] = $roles['cmadmin'] || $roles['coadmin'];\n \n // View all existing Data Scrubber Filter Attribute?\n $p['index'] = $roles['cmadmin'] || $roles['coadmin'];\n \n // Edit an existing Data Scrubber Filter Attribute?\n $p['order'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Modify ordering for display via AJAX \n $p['reorder'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing Data Scrubber Filter Attribute?\n $p['view'] = $roles['cmadmin'] || $roles['coadmin'];\n \n $this->set('permissions', $p);\n return($p[$this->action]);\n }", "public function hasAdminRights() {\n return in_array($this['user_type_id'], [3, 7]);\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 }", "function isAuthorized_menu($strUsers, $strGroups, $UserName, $UserGroup) { \n // For security, start by assuming the visitor is NOT authorized. \n $isValid = False; \n\n // When a visitor has logged into this site, the Session variable MM_Username set equal to their username. \n // Therefore, we know that a user is NOT logged in if that Session variable is blank. \n if (!empty($UserName)) { \n // Besides being logged in, you may restrict access to only certain users based on an ID established when they login. \n // Parse the strings into arrays. \n $arrUsers = Explode(\",\", $strUsers); \n $arrGroups = Explode(\",\", $strGroups); \n if (in_array($UserName, $arrUsers)) { \n $isValid = true; \n } \n // Or, you may restrict access to only certain users based on their username. \n if (in_array($UserGroup, $arrGroups)) { \n $isValid = true; \n } \n if (($strUsers == \"\") && true) { \n $isValid = true; \n } \n } \n return $isValid; \n}", "function tp_is_group_page() {\n\n\tif ($group = page_owner_entity()) {\n\t\tif ($group instanceof ElggGroup)\n\t\t\treturn true;\n\t}\n\n\treturn false;\n}", "public function checkAccess() {\n\t\t$conf = $GLOBALS['BE_USER']->getTSConfig('backendToolbarItem.tx_newsspaper_role.disabled');\n\t\treturn ($conf['value'] == 1 ? false : true);\n\t}", "public function user_front_nav_menu_allowed_membership($user_id = null, $module_key, $package_id = null)\r\n\t{\t\t\t\t\t\r\n\t\tglobal $xoouserultra;\r\n\t\t\r\n\t\r\n\t\t$modules = $this->uultra_get_user_navigator_for_membership($package_id);\r\n\t\t\r\n\t\tforeach($modules as $key => $module)\r\n\t\t{\r\n\t\t\tif($key==$module_key)\r\n\t\t\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t}\t\r\n\t\t\r\n\t\t\r\n\t}", "public function checkIfAllPermissionsSelected()\n {\n $modulePermissions = $this->model->permissions;\n $isAllPermissionsSelected = true;\n $moduleIds = array_keys($modulePermissions);\n foreach($moduleIds as $moduleId)\n {\n $count = $this->identityModuleAssignmentMap[$moduleId];\n \n $permissionCount = $this->modulesPermissionCountMap[$moduleId];\n if($count == 0 || $count != $permissionCount)\n {\n $isAllPermissionsSelected = false;\n break;\n }\n }\n if($isAllPermissionsSelected)\n {\n return true;\n }\n return false;\n }", "public function get_item_permissions_check( $request ) {\n\t\treturn current_user_can( 'manage_options' );\n\t}", "function canView($user) {\n if($this->isOwner()) {\n return true;\n } // if\n \n return in_array($this->getId(), $user->visibleCompanyIds());\n }", "function visible () {\n\t\treturn isadmin();\n\t}", "public function canUserAssignUsage()\n {\n $user = $this->getUser();\n\n return $user->isAdmin || \\in_array('tl_news::usage', $user->alexf, true);\n }", "function isAuthorized() {\n $roles = $this->Role->calculateCMRoles();\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Determine what operations this user can perform\n \n // Add a new Vetting Step?\n $p['add'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Delete an existing Vetting Step?\n $p['delete'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Edit an existing Vetting Step?\n $p['edit'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View all existing Vetting Steps?\n $p['index'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Edit an existing Vetting Step's order?\n $p['order'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Modify ordering for display via AJAX\n $p['reorder'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing Vetting Step?\n $p['view'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n $this->set('permissions', $p);\n return $p[$this->action];\n }" ]
[ "0.6994144", "0.6830324", "0.6577749", "0.65705884", "0.65610296", "0.65592074", "0.65456", "0.65440494", "0.6505985", "0.65016776", "0.6493295", "0.64592695", "0.64406073", "0.64292973", "0.6399531", "0.63974535", "0.63974535", "0.63573515", "0.632618", "0.6303834", "0.62915844", "0.6285394", "0.6276614", "0.6275075", "0.62355906", "0.62267286", "0.6210314", "0.61689293", "0.6159895", "0.61564994", "0.6154426", "0.6153749", "0.61533266", "0.61399484", "0.61175096", "0.6110585", "0.6102459", "0.61022824", "0.60926914", "0.6091572", "0.60782534", "0.60713285", "0.60611117", "0.6055431", "0.6053944", "0.60523844", "0.6040658", "0.60375524", "0.60332644", "0.6020177", "0.60049045", "0.60009027", "0.600057", "0.59826916", "0.5980689", "0.5980375", "0.59760463", "0.5975697", "0.5974708", "0.597281", "0.5970644", "0.59596807", "0.5955026", "0.5948165", "0.5940152", "0.5916595", "0.5912242", "0.5904513", "0.5895092", "0.5893145", "0.5888367", "0.58817774", "0.5879025", "0.58788455", "0.5877939", "0.5867979", "0.5866042", "0.58579147", "0.58503604", "0.5848586", "0.5847086", "0.5846724", "0.58442825", "0.5843763", "0.5842043", "0.58406013", "0.58391047", "0.5837409", "0.583299", "0.5825668", "0.5822269", "0.5819515", "0.58105296", "0.5806831", "0.5806454", "0.5805251", "0.580329", "0.5796942", "0.5792303", "0.578807" ]
0.6162433
28
Determine whether the user can view the product group.
public function view(User $user, ProductGroup $productGroup) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function userHasAccess()\n {\n $required_perm = $this->route['perm'];\n $user_group = $_SESSION['user_group'];\n if ($required_perm == 'all') {\n return true;\n } elseif ($user_group == $required_perm) {\n return true;\n }\n return false;\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webkul_Marketplace::product');\n }", "public function authorize()\n {\n return auth()->user()->can('create-product-packages');\n }", "public function authorize()\n {\n return $this->groupHasUser() || $this->hasSeller();\n }", "public function authorize()\n {\n $company_id = auth()->user()->cmpny_id;\n $group_id = request()->post('id');\n $group = Group::find($group_id);\n if ($group_id && (!isset($group->id) || empty($group->id)))\n {\n return false;\n }\n if (!empty($group->id) && ($company_id != $group->cmpny_id))\n {\n return false;\n }\n\n return true;\n }", "public function isAdmin()\n {\n $p = User::getUser();\n if($p)\n {\n if($p->canAccess('Edit products') === TRUE)\n {\n return TRUE;\n }\n }\n return FALSE;\n }", "public function isAuthorized($user){\n /*\n * \n 1 \tAdmin\n 2 \tOfficer / Manager\n 3 \tRead Only\n 4 \tStaff\n 5 \tUser / Operator\n 6 \tStudent\n 7 \tLimited\n */\n \n //managers can add / edit\n if (in_array($this->request->action, ['delete','add','edit','reorder'])) {\n if ($user['group_id'] <= 4) {\n return true;\n }\n }\n \n \n //Admins have all\n return parent::isAuthorized($user);\n }", "public function isAccessible() {\n\t\treturn UserGroup::isAccessibleGroup(array($this->groupID));\n\t}", "public function isAvailable()\n\t{\n\t\tif ($this->isLocked())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tif (BE_USER_LOGGED_IN !== true && !$this->isPublished())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Show to guests only\n\t\tif ($this->arrData['guests'] && FE_USER_LOGGED_IN === true && BE_USER_LOGGED_IN !== true && !$this->arrData['protected'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Protected product\n\t\tif (BE_USER_LOGGED_IN !== true && $this->arrData['protected'])\n\t\t{\n\t\t\tif (FE_USER_LOGGED_IN !== true)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$groups = deserialize($this->arrData['groups']);\n\n\t\t\tif (!is_array($groups) || empty($groups) || !count(array_intersect($groups, $this->User->groups)))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Check if \"advanced price\" is available\n\t\tif ($this->arrData['price'] === null && (in_array('price', $this->arrAttributes) || in_array('price', $this->arrVariantAttributes)))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "private function canDisplay()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }", "public function isAllowed()\n {\n $result = new \\Magento\\FrameWork\\DataObject(['is_allowed' => true]);\n $this->_eventManager->dispatch(\n 'ves_vendor_menu_check_acl',\n [\n 'resource' => $this->_resource,\n 'result' => $result\n ]\n );\n $permission = new \\Vnecoms\\Vendors\\Model\\AclResult();\n $this->_eventManager->dispatch(\n 'ves_vendor_check_acl',\n [\n 'resource' => $this->_resource,\n 'permission' => $permission\n ]\n );\n return $result->getIsAllowed() && $permission->isAllowed();\n }", "public function allowed_group()\n\t{\n\t\t$which = func_get_args();\n\n\t\tif ( ! count($which))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Super Admins always have access\n\t\tif (ee()->session->userdata('group_id') == 1)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tforeach ($which as $w)\n\t\t{\n\t\t\t$k = ee()->session->userdata($w);\n\n\t\t\tif ( ! $k OR $k !== 'y')\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}", "protected function _isAllowed()\n\t{\n\t\treturn (Mage::getSingleton('admin/session')->isAllowed('dropship360/suppliers') || Mage::getSingleton('admin/session')->isAllowed('dropship360/vendor_ranking'));\n\t}", "public function authorize()\n {\n $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 return auth()->user()->can('store', [Product::class]);\n }", "public function isAdmin()\n {\n return $this->group_id === 1;\n }", "public function isAuthorized($user)\n {\n if (isset($user['group_id']) && $user['group_id'] === '4') {\n return true;\n } else { \n return false;\n }\n }", "function is_viewable($group, $uid = NULL) {\n if (!$uid)\n $uid = userid();\n $privacy = $group['group_privacy'];\n $isMember = $this->is_member($uid, $group['group_id']);\n\n if ($privacy == 1 && !$isMember) {\n e(lang(\"you_need_owners_approval_to_view_group\"), \"w\");\n return true;\n } elseif ($privacy == 1 && !$this->is_active_member($uid, $group['group_id'])) {\n e(lang(\"grp_inactive_account\"), \"w\");\n return true;\n } elseif ($privacy == 2 && !$isMember && !$this->is_invited($uid, $group['group_id'], $group['userid'])) {\n e(lang(\"grp_prvt_err1\"));\n return false;\n } else {\n return true;\n }\n\n /* \t\t$group_id = $group['group_id'];\n $is_Member = $this->is_member($uid,$group['group_id'],true);\n\n if($group['group_privacy'] == 2 && !$is_Member)\n return array(\"privacy\"=>$group['group_privacy'],\"isMember\"=>$is_Member);\n elseif($group['group_privacy'] == 1 && !$is_Member)\n return array(\"privacy\"=>$group['group_privacy'],\"isMember\"=>$is_Member);\n else\n return true; */\n }", "public function showing_restricted_products() {\n\t\treturn ! $this->hiding_restricted_products();\n\t}", "public function authorize()\n {\n return access()->hasPermissions(['view-backend', 'view-inventory', 'manage-inventory'], true);\n }", "function isAuthorized() {\n $roles = $this->Role->calculateCMRoles();\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Determine what operations this user can perform\n \n // Accept an OAuth callback?\n $p['callback'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Delete an existing SalesforceSource?\n $p['delete'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Edit an existing SalesforceSource?\n $p['edit'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View all existing SalesforceSources?\n $p['index'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View API limits?\n $p['limits'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing SalesforceSource?\n $p['view'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n $this->set('permissions', $p);\n return($p[$this->action]);\n }", "public function 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 authorize()\n {\n $member = auth()->user()->member;\n return auth()->user()->can('pdg', $member) || auth()->user()->can('manager', $member);\n }", "function canView($user) {\n if($this->isOwner()) {\n return true;\n } // if\n \n return in_array($this->getId(), $user->visibleCompanyIds());\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_logistics/equipment');\n }", "public function userCanSubmit() {\n\t\tglobal $content_isAdmin;\n\t\tif (!is_object(icms::$user)) return false;\n\t\tif ($content_isAdmin) return true;\n\t\t$user_groups = icms::$user->getGroups();\n\t\t$module = icms::handler(\"icms_module\")->getByDirname(basename(dirname(dirname(__FILE__))), TRUE);\n\t\treturn count(array_intersect($module->config['poster_groups'], $user_groups)) > 0;\n\t}", "private function authorize()\n {\n $authorized = FALSE;\n\n if ( in_array(ee()->session->userdata['group_id'], ee()->publisher_setting->can_admin_publisher()))\n {\n $authorized = TRUE;\n }\n\n if (ee()->session->userdata['group_id'] == 1)\n {\n $authorized = TRUE;\n }\n\n if ( !$authorized)\n {\n ee()->publisher_helper_url->redirect(ee()->publisher_helper_cp->mod_link('view_unauthorized'));\n }\n }", "function rordb_can_user_view_items(){\n return current_user_can('rordb_view_items');\n}", "function can_access($group_id = FALSE, $page = FALSE)\n {\n $count = $this->db\n ->from('group_permission')\n ->where('group_id', $group_id)\n ->where('module_id', '0')\n ->count_all_results();\n if ($count) {\n return TRUE;\n }\n\n // if not allowed to access everything\n // check if allowed to access requested page\n return $this->db\n ->from('module')\n ->join('group_permission', 'group_permission.module_id = module.module_id')\n ->where('group_permission.group_id', $group_id)\n ->where('module.url', $page)\n ->count_all_results();\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 isAuthorized($user, $request) {\n\t\tController::loadModel('Member');\n\n\t\tif ($this->Member->GroupsMember->isMemberInGroup( $this->Member->getIdForMember($user), Group::FULL_ACCESS )) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function checkAllowed() {\r\n\t\t// if option is not active return true!\r\n\t\tif (Mage::getStoreConfig('b2bprofessional/generalsettings/activecustomers')) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t$iUserStoreId\t\t= Mage::getSingleton('customer/session')->getCustomer()->getStore()->getGroupID();\r\n\t\t$iCurrentStoreId\t= Mage::app()->getStore()->getGroupID();\r\n\r\n\t\tif ($iUserStoreId == $iCurrentStoreId) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }", "public function canUserManageUsage()\n {\n return $this->getUser()->hasAccess('manage', 'newsUsage');\n }", "protected function _isAllowed()\r\n {\r\n return Mage::getSingleton('admin/session')->isAllowed('system/thetailor_workgroup_workflow');\r\n }", "public function canView($module_slug)\n {\n $module_id = $this->getModuleId($module_slug);\n $where_array = array('role_id'=>$this->role_id,'module_id'=>$module_id);\n $permissions = Permission::select('can_view')->where($where_array)->first();\n\n if(isset($permissions->can_view) && $permissions->can_view==1) {\n return true;\n }else {\n return false;\n }\n }", "function isAuthorized() {\n $roles = $this->Role->calculateCMRoles(); // What was authenticated\n \n // Store the group ID in the controller object since performRedirect may need it\n \n if(($this->action == 'add' || $this->action == 'updateGroup')\n && isset($this->request->data['CoGroupMember']['co_group_id']))\n $this->gid = filter_var($this->request->data['CoGroupMember']['co_group_id'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_BACKTICK);\n elseif(($this->action == 'delete' || $this->action == 'edit' || $this->action == 'view')\n && isset($this->request->params['pass'][0]))\n $this->gid = $this->CoGroupMember->field('co_group_id', array('CoGroupMember.id' => $this->request->params['pass'][0]));\n elseif($this->action == 'select' && isset($this->request->params['named']['cogroup']))\n $this->gid = filter_var($this->request->params['named']['cogroup'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_BACKTICK);\n \n $managed = false;\n $owner = false;\n $member = false;\n \n if(!empty($roles['copersonid']) && isset($this->gid)) {\n $managed = $this->Role->isGroupManager($roles['copersonid'], $this->gid);\n \n $gm = $this->CoGroupMember->find('all', array('conditions' =>\n array('CoGroupMember.co_group_id' => $this->gid,\n 'CoGroupMember.co_person_id' => $roles['copersonid'])));\n \n if(isset($gm[0]['CoGroupMember']['owner']) && $gm[0]['CoGroupMember']['owner'])\n $owner = true;\n \n if(isset($gm[0]['CoGroupMember']['member']) && $gm[0]['CoGroupMember']['member'])\n $member = true;\n }\n \n // Is this specified group read only?\n $readOnly = ($this->gid ? $this->CoGroupMember->CoGroup->readOnly($this->gid) : false);\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Add a new member to a group?\n // XXX probably need to check if group is open here and in delete\n $p['add'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // Delete a member from a group?\n $p['delete'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // Edit members of a group?\n $p['edit'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // View a list of members of a group?\n // This is for REST\n $p['index'] = ($this->request->is('restful') && ($roles['cmadmin'] || $roles['coadmin']));\n \n // Select from a list of potential members to add?\n $p['select'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // Update accepts a CO Person's worth of potential group memberships and performs the appropriate updates\n $p['update'] = !$readOnly && ($roles['cmadmin'] || $roles['comember']);\n \n // Select from a list of potential members to add?\n $p['updateGroup'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // View members of a group?\n $p['view'] = ($roles['cmadmin'] || $managed || $member);\n \n $this->set('permissions', $p);\n return $p[$this->action];\n }", "public function canPersonalize($product)\n {\n //var_dump($product->getData());\n \n return (bool)$product->getData('personalization_allowed');\n }", "public function authorize()\n {\n if (Auth::user() && Auth::user()->hasPermissionTo('manage categories')) {\n return true;\n } else {\n return false;\n }\n }", "public function isAuthorized($user) {\n if (isset($user['group_id']) && $user['group_id'] === '1') {\n return true;\n }\n\n // Default deny\n return false;\n }", "public function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('shopgate_menu/manage');\n }", "public function canUpload()\n {\n return $this->checkFrontendUserPermissionsGeneric('userGroupAllowUpload');\n }", "public function authorize() : bool\n {\n return auth()->user()->can('create', GroupSetting::class);\n }", "function isAuthorized() {\n $roles = $this->Role->calculateCMRoles();\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Determine what operations this user can perform\n \n // Add a new Vetting Step?\n $p['add'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Delete an existing Vetting Step?\n $p['delete'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Edit an existing Vetting Step?\n $p['edit'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View all existing Vetting Steps?\n $p['index'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Edit an existing Vetting Step's order?\n $p['order'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Modify ordering for display via AJAX\n $p['reorder'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing Vetting Step?\n $p['view'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n $this->set('permissions', $p);\n return $p[$this->action];\n }", "public function view(User $user, ProductCategory $productCategory)\n {\n if ($user->hasPermissionTo('view crm product categories')) {\n return true;\n }\n }", "public function authorize()\n {\n return $this->user()->can('view', Assignment::class);\n }", "protected function _isAllowed()\n\t{\n\t\treturn Mage::getSingleton('admin/session')->isAllowed('dropship360/inventory');\n\t}", "public static function canDisplayPermissionsMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_PERMISSION);\n\t}", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed(\\Eadesigndev\\Pdfgenerator\\Controller\\Adminhtml\\Templates::ADMIN_RESOURCE_VIEW);\n }", "public function batch_items_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "public function canView()\n\t{\n\t\treturn \\IPS\\Member::loggedIn()->hasAcpRestriction( 'nexus' , 'transactions', 'transactions_manage' );\n\t}", "function AdminSecurityCheck(){\n\t\t$User = new User();\n\t\t$user = $this->session->userdata('Group');\n\t\tif ($user){\n\t\t\tif($user == 1){\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\treturn false;\n\t\t}\n\t}", "public function isViewAllowed()\n {\n return $this->isAllowedAction('view');\n }", "function ShowOptionLink() {\n\t\tglobal $Security, $scholarship_package;\n\t\tif ($Security->IsLoggedIn()) {\n\t\t\tif (!$Security->IsAdmin()) {\n\t\t\t\treturn $Security->IsValidUserID($scholarship_package->group_id->CurrentValue);\n\t\t\t}\n\t\t}\n\t\treturn TRUE;\n\t}", "function ShowOptionLink() {\n\t\tglobal $Security, $scholarship_package;\n\t\tif ($Security->IsLoggedIn()) {\n\t\t\tif (!$Security->IsAdmin()) {\n\t\t\t\treturn $Security->IsValidUserID($scholarship_package->group_id->CurrentValue);\n\t\t\t}\n\t\t}\n\t\treturn TRUE;\n\t}", "function checkActionPermissionGroup($permittedGroups) {\n if (is_array($permittedGroups) && count($permittedGroups) > 0) {\n foreach ($permittedGroups as $groupId => $allowed) {\n if ($allowed && $groupId == -2) {\n return TRUE;\n } elseif ($allowed && $this->authUser->inGroup($groupId)) {\n return TRUE;\n }\n }\n }\n return FALSE;\n }", "public function checkAccess() {\n\t\t$conf = $GLOBALS['BE_USER']->getTSConfig('backendToolbarItem.tx_newsspaper_role.disabled');\n\t\treturn ($conf['value'] == 1 ? false : true);\n\t}", "public function canUserManageAreaOfApplication()\n {\n return $this->getUser()->hasAccess('manage', 'newsAreaOfApplication');\n }", "private function product() {\n if ($this->is_logged_in()){\n return true; //check if user had been logged in!!!\n }else{\n exit;\n }\n }", "public function allowed_group_any()\n\t{\n\t\t$which = func_get_args();\n\n\t\tif ( ! count($which))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Super Admins always have access\n\t\tif (ee()->session->userdata('group_id') == 1)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\t$result = FALSE;\n\n\t\tforeach ($which as $w)\n\t\t{\n\t\t\t$k = ee()->session->userdata($w);\n\n\t\t\tif ($k === TRUE OR $k == 'y')\n\t\t\t{\n\t\t\t\t$result = TRUE;\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "protected function _isAllowed()\r\n {\r\n return Mage::getSingleton('admin/session')->isAllowed('catalog/productsupdater');\r\n }", "public function allowedToViewStore($usergroup)\n {\n $app = \\XF::app();\n\n $excludedUsergroups = $app->options()->rexshop_excluded_usergroups;\n if (!empty($excludedUsergroups)) {\n $usergroups = explode(',', ltrim(rtrim(trim($excludedUsergroups, ' '), ','), ','));\n\n return !in_array((int) $usergroup, $usergroups);\n }\n\n return true;\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 }", "function isAuthorized() {\n $roles = $this->Role->calculateCMRoles();\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Determine what operations this user can perform\n \n // Add a new Match Server Attribute?\n $p['add'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Delete an existing Match Server Attribute?\n $p['delete'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Edit an existing Match Server Attribute?\n $p['edit'] = ($roles['cmadmin'] || $roles['coadmin']);\n\n // View all existing Match Server Attributes?\n $p['index'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing Match Server Attribute?\n $p['view'] = ($roles['cmadmin'] || $roles['coadmin']);\n\n $this->set('permissions', $p);\n return $p[$this->action];\n }", "public function authorize()\n {\n $tag = $this->route()->parameter('tag');\n return Auth::user()->can('view', [Tag::class, $tag]);\n }", "public function isMemberOf($group_name){\n return $this->permission()->isMemberOf($this,$group_name);\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_material/curriculumdoc');\n }", "public function viewAny(User $user)\n {\n if ($user->hasPermissionTo('view crm product categories')) {\n return true;\n }\n }", "public function authorize()\n {\n if ( ! $this->getRelease()->belongsToYou()) {\n return false;\n }\n return true;\n }", "public function canView()\n {\n return !$this->is_private ||\n ( Auth::user() && ( $this->sender_id === Auth::id() || $this->recipient_id === Auth::id() ) );\n }", "public function viewAny(User $user)\n {\n return $user->hasPermissions(['group_read']);\n }", "public function authorize()\n {\n if (Gate::allows('isVendor') or Gate::allows('isAdmin')){\n return true;\n }\n return false;\n }", "function isAuthorized() {\n $roles = $this->Role->calculateCMRoles();\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Add a new Data Scrubber Filter Attribute?\n $p['add'] = $roles['cmadmin'] || $roles['coadmin'];\n \n // Delete an existing Data Scrubber Filter Attribute?\n $p['delete'] = $roles['cmadmin'] || $roles['coadmin'];\n \n // Edit an existing Data Scrubber Filter Attribute?\n $p['edit'] = $roles['cmadmin'] || $roles['coadmin'];\n \n // View all existing Data Scrubber Filter Attribute?\n $p['index'] = $roles['cmadmin'] || $roles['coadmin'];\n \n // Edit an existing Data Scrubber Filter Attribute?\n $p['order'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // Modify ordering for display via AJAX \n $p['reorder'] = ($roles['cmadmin'] || $roles['coadmin']);\n \n // View an existing Data Scrubber Filter Attribute?\n $p['view'] = $roles['cmadmin'] || $roles['coadmin'];\n \n $this->set('permissions', $p);\n return($p[$this->action]);\n }", "public function authorize()\n {\n return $this->user()->can('Crear Departamentos');\n\n }", "public function performPermission()\n {\n // User Role flags\n // Admin = 20\n // Editor = 40\n // Author = 60 (deprecated)\n // Webuser = 100 (deprecated)\n //\n // Webuser dont have access to edit node data\n //\n if($this->controllerVar['loggedUserRole'] > 40)\n {\n return false;\n }\n\n return true;\n }", "public function canCreateSitegroups() {\n $viewer = Engine_Api::_()->user()->getViewer();\n if (!$viewer || !$viewer->getIdentity()) {\n return false;\n }\n\n // Must be able to view Sitegroups\n if (!Engine_Api::_()->authorization()->isAllowed('sitegroup_group', $viewer, 'view')) {\n return false;\n }\n\n // Must be able to create Sitegroups\n if (!Engine_Api::_()->authorization()->isAllowed('sitegroup_group', $viewer, 'create')) {\n return false;\n }\n return true;\n }", "public function view(User $user)\n {\n return $user->hasPermission('view-organization-composition');\n }", "private function hasRequestedScopeAccess()\n {\n // allow specific store view scope\n $storeCode = $this->_request->getParam('store');\n if ($storeCode) {\n $store = $this->_storeManager->getStore($storeCode);\n if ($store) {\n if ($this->_role->hasStoreAccess($store->getId())) {\n return true;\n }\n }\n } elseif ($websiteCode = $this->_request->getParam('website')) {\n try {\n $website = $this->_storeManager->getWebsite($websiteCode);\n if ($website) {\n if ($this->_role->hasWebsiteAccess($website->getId(), true)) {\n return true;\n }\n }\n // phpcs:ignore Magento2.CodeAnalysis.EmptyBlock\n } catch (\\Magento\\Framework\\Exception\\LocalizedException $e) {\n // redirect later from non-existing website\n }\n }\n return false;\n }", "public function isAuthorized() {\n\t\t$UserDN = $this->getDistinguishedName($this->Username);\n\t\t$GroupMemberships = $this->getGroups($UserDN);\n\t\tforeach($this->Groups as $Group) {\n\t\t\tif(in_array($this->getDistinguishedName($Group), $GroupMemberships)) {\n\t\t\t/*\n\t\t\t* If any Group the User is a Member of matches the Allowed groups -> Authorization success.\n\t\t\t*/\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t/*\n\t\t* This only happens when no Groupmembership matches the Allowed groups -> Authorization failed.\n\t\t*/\n\t\treturn false;\n\t}", "public function accessPanel()\n {\n return $this->role->section === 'panel';\n }", "public static function canDisplayProfitAndLossMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_PROFIT_AND_LOSS_REPORT);\n\t}", "public function isAdmin() {\n return (json_decode($this->group->permissions))->admin;\n }", "public static function canDisplayUsersMenu()\n\t{\n\t\treturn PermissionValidator::hasPermission(PermissionConstants::VIEW_USER);\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 }", "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 authorize()\n {\n return (Auth::user()->allowSuperAdminAccess || Auth::user()->allowAdminAccess);\n }", "public function user_front_nav_menu_allowed_membership($user_id = null, $module_key, $package_id = null)\r\n\t{\t\t\t\t\t\r\n\t\tglobal $xoouserultra;\r\n\t\t\r\n\t\r\n\t\t$modules = $this->uultra_get_user_navigator_for_membership($package_id);\r\n\t\t\r\n\t\tforeach($modules as $key => $module)\r\n\t\t{\r\n\t\t\tif($key==$module_key)\r\n\t\t\r\n\t\t\t{\r\n\t\t\t\treturn true;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t}\t\r\n\t\t\r\n\t\t\r\n\t}", "protected function _isAllowed()\n {\n switch ($this->getRequest()->getActionName()) {\n case 'new':\n case 'save':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserSaveVersion();\n break;\n case 'delete':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserDeleteVersion();\n break;\n case 'massDeleteRevisions':\n return Mage::getSingleton('gri_cms/config')->canCurrentUserDeleteRevision();\n break;\n default:\n return Mage::getSingleton('admin/session')->isAllowed('cms/page');\n break;\n }\n }", "protected function isPowerUser()\n {\n return $this->user->can('sys_properties_edit', $this->app->modules[$this->area]);\n }", "public function canUserAssignUsage()\n {\n $user = $this->getUser();\n\n return $user->isAdmin || \\in_array('tl_news::usage', $user->alexf, true);\n }", "public static function currentUserHasAccess() {\n return current_user_can('admin_access');\n }", "static function getIsAdmin() {\n\t\t$user = ctrl_users::GetUserDetail();\n\t\tif($user['usergroupid'] == 1) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function isViewer($wpUser){\n for($i = 0; $i < count($wpUser->roles); $i++){\n if(strpos($wpUser->roles[$i], SARON_ROLE_PREFIX . SARON_ROLE_VIEWER) !== FALSE){ // CHECK IF THE USER IS A MEMBER OF THE GROUP (test)saron_edit\n return true;\n }\n } \n return false; \n }", "public function hasAccess($groupList) {\n return tx_pttools_div::hasGroupAccess($groupList, $this->access);\n }", "public function view(User $user)\n {\n $user_role = Role::find($user->role_id);\n $role_permissions = $user_role->permissions;\n foreach ($role_permissions as $permission) {\n if ($permission->id ==4) {\n return true;\n }\n\n }\n return false;\n }", "public function authorize()\n {\n return $this->user()->can('manage-drafts');\n }", "public function user_has_access( WP_User $user ): bool {\n\t\t\t$has_access = false;\n\n\t\t\tif ( $user->ID > 0 ) {\n\t\t\t\tif ( learndash_is_course_post( $this->post ) ) {\n\t\t\t\t\t$has_access = sfwd_lms_has_access( $this->post->ID, $user->ID );\n\t\t\t\t} elseif ( learndash_is_group_post( $this->post ) ) {\n\t\t\t\t\t$has_access = learndash_is_user_in_group( $user->ID, $this->post->ID );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Filters whether a user has access to a product.\n\t\t\t *\n\t\t\t * @since 4.5.0\n\t\t\t *\n\t\t\t * @param bool $has_access True if a user has access, false otherwise.\n\t\t\t * @param Learndash_Product_Model $product Product model.\n\t\t\t * @param WP_User $user User.\n\t\t\t *\n\t\t\t * @return bool True if a user has access, false otherwise.\n\t\t\t */\n\t\t\treturn apply_filters( 'learndash_model_product_user_has_access', $has_access, $this, $user );\n\t\t}", "public function authorize()\n {\n return $this->user()->hasPermission('subscription-service-create-plan');\n }", "public function canShowTab()\n {\n $customer = Mage::registry('current_customer');\n return $customer->getId()&& Mage::helper('storecreditpro')->moduleEnabled();\n }", "protected function _isAllowed()\n {\n return parent::_isAllowed() && $this->_authorization->isAllowed('Vnecoms_Vendors::vendors_sellers');\n }", "public function view(User $user, OrderProduct $orderProduct)\n {\n return $user->isAdmin() || $user->is($orderProduct->coupon->user);\n }" ]
[ "0.719304", "0.7000344", "0.694279", "0.6835598", "0.678156", "0.6735227", "0.67114407", "0.6697895", "0.6666405", "0.6655565", "0.661409", "0.6583238", "0.6546854", "0.65209866", "0.6467867", "0.64657223", "0.64367586", "0.6428673", "0.64202857", "0.64146686", "0.64009565", "0.6400874", "0.639504", "0.63769203", "0.6375574", "0.6315873", "0.6308789", "0.6307692", "0.6291489", "0.6282633", "0.62626487", "0.62604886", "0.6254085", "0.6249666", "0.6248161", "0.6242103", "0.623412", "0.6231387", "0.6228213", "0.62275124", "0.62245333", "0.6211595", "0.6211193", "0.62017936", "0.6194226", "0.61917394", "0.61713535", "0.61688465", "0.6162323", "0.61581624", "0.6152935", "0.61525553", "0.6147426", "0.61447394", "0.61447394", "0.61393255", "0.61341226", "0.613258", "0.6126574", "0.61224794", "0.6120467", "0.6115682", "0.6113693", "0.61092633", "0.6109249", "0.61033326", "0.61002606", "0.60990614", "0.6096681", "0.6095035", "0.60893667", "0.60889065", "0.6084138", "0.60774577", "0.60745895", "0.6073003", "0.607268", "0.6070992", "0.60671186", "0.6066719", "0.60630095", "0.60555243", "0.6048322", "0.6044831", "0.6038517", "0.60244256", "0.60234785", "0.601972", "0.60189754", "0.6017656", "0.6010067", "0.6006729", "0.59947467", "0.59882843", "0.5982532", "0.5980391", "0.5978838", "0.5977846", "0.59755516", "0.5974782", "0.597239" ]
0.0
-1
Determine whether the user can create product groups.
public function create(User $user) { return $user->hasPermissions(['group_create']); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function canCreateSitegroups() {\n $viewer = Engine_Api::_()->user()->getViewer();\n if (!$viewer || !$viewer->getIdentity()) {\n return false;\n }\n\n // Must be able to view Sitegroups\n if (!Engine_Api::_()->authorization()->isAllowed('sitegroup_group', $viewer, 'view')) {\n return false;\n }\n\n // Must be able to create Sitegroups\n if (!Engine_Api::_()->authorization()->isAllowed('sitegroup_group', $viewer, 'create')) {\n return false;\n }\n return true;\n }", "public function authorize() : bool\n {\n return auth()->user()->can('create', GroupSetting::class);\n }", "public function authorize()\n {\n return auth()->user()->can('create-product-packages');\n }", "private function canCreate()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }", "public function allowed_group()\n\t{\n\t\t$which = func_get_args();\n\n\t\tif ( ! count($which))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Super Admins always have access\n\t\tif (ee()->session->userdata('group_id') == 1)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tforeach ($which as $w)\n\t\t{\n\t\t\t$k = ee()->session->userdata($w);\n\n\t\t\tif ( ! $k OR $k !== 'y')\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}", "static public function canCreateGallery($context, $user)\r\n {\r\n if ( $user->getId() === null ) return false;\r\n\r\n self::_checkContext($context);\r\n self::_checkUser($user);\r\n\r\n /**\r\n * if context - user profile\r\n */\r\n if ( $context instanceof Warecorp_User ) {\r\n /**\r\n * user views own galleries\r\n */\r\n if ( $context->getId() == $user->getId() ) {\r\n return true;\r\n }\r\n /**\r\n * user views galleries of other user\r\n */\r\n else {\r\n return false;\r\n }\r\n }\r\n /**\r\n * if context - group\r\n */\r\n elseif ( $context instanceof Warecorp_Group_Base ) {\r\n /**\r\n * user is host of this group\r\n */\r\n if ($context->getMembers()->isHost($user->getId())) {\r\n return true;\r\n }\r\n /**\r\n * user is cohost of this group\r\n */\r\n elseif ($context->getMembers()->isCohost($user->getId())) {\r\n return true;\r\n }\r\n /**\r\n * user is member of this group\r\n */\r\n elseif ($context->getMembers()->isMemberExistsAndApproved($user->getId())) {\r\n \tif (Warecorp_Group_AccessManager::canUseVideos($context, $user)) return true;\r\n \t\telse return false;\r\n }\r\n /**\r\n * user isn't member of this group\r\n */\r\n else {\r\n\r\n }\r\n }\r\n return false;\r\n }", "public function create(User $user)\n {\n return $user->canDo('filter.filter_group.create');\n }", "public function userCanSubmit() {\n\t\tglobal $content_isAdmin;\n\t\tif (!is_object(icms::$user)) return false;\n\t\tif ($content_isAdmin) return true;\n\t\t$user_groups = icms::$user->getGroups();\n\t\t$module = icms::handler(\"icms_module\")->getByDirname(basename(dirname(dirname(__FILE__))), TRUE);\n\t\treturn count(array_intersect($module->config['poster_groups'], $user_groups)) > 0;\n\t}", "public function isUserOrGroupSet() {}", "public function create(User $user)\n {\n if ($user->hasPermissionTo('create crm product categories')) {\n return true;\n }\n }", "public function canUpload()\n {\n return $this->checkFrontendUserPermissionsGeneric('userGroupAllowUpload');\n }", "function create()\r\n {\r\n $wdm = WeblcmsDataManager :: get_instance();\r\n $success = $wdm->create_course_group_user_relation($this);\r\n\r\n if (! $success)\r\n {\r\n return false;\r\n }\r\n return true;\r\n }", "function CheckGroupCreation($data) {\n $name = $data['name'];\n \n $correct = array(\n 'name' => 0,\n );\n \n if(strlen($name)>0) {\n $correct['name'] = 1;\n }\n\n $c = count(array_unique($correct));\n if ($c == 1) {\n if ($correct['name'] == 1) {\n //TODO check if session.user_id was not manipulated\n $id = createGroup($name,$_SESSION['user_id']);\n return array(true,$id);\n }\n return array(false,-1);\n }\n \n return array(false,-1);\n}", "public function authorize()\n {\n $company_id = auth()->user()->cmpny_id;\n $group_id = request()->post('id');\n $group = Group::find($group_id);\n if ($group_id && (!isset($group->id) || empty($group->id)))\n {\n return false;\n }\n if (!empty($group->id) && ($company_id != $group->cmpny_id))\n {\n return false;\n }\n\n return true;\n }", "public function batch_items_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "public function canCreate();", "public function canCreate();", "public function create_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webkul_Marketplace::product');\n }", "public function createGroup(GroupInterface $group): bool;", "public function isGroup(){\n\t\t\n\t\t$this->validateInited();\n\t\t\n\t\t$arrChildren = UniteFunctionsWPUC::getPostChildren($this->post);\n\t\t\t\t\n\t\tif(!empty($arrChildren))\n\t\t\treturn(true);\n\t\t\n\t\treturn(false);\n\t}", "private function groups_check(){\n\t\t\n\t\t$production_formats = new \\gcalc\\db\\production\\formats();\n\t\t$needed_groups = $production_formats->get_product_groups( $this->slug );\n\t\t$needed_groups_ = array_flip( $needed_groups );\n\t\t$todo_groups = $this->get_todo_groups();\n\t\tforeach ($todo_groups as $key => $value) {\t\t\n\t\t\tif ( array_key_exists( $key, $needed_groups_)) {\n\t\t\t\t$index = $needed_groups_[ $key ];\n\t\t\t\tunset($needed_groups[ $index ]);\n\t\t\t}\t\t\t\n\t\t}\n\t\tif ( count( $needed_groups) > 0) {\n\t\t\t\t\t\n\t\t}\n\t}", "function checkActionPermissionGroup($permittedGroups) {\n if (is_array($permittedGroups) && count($permittedGroups) > 0) {\n foreach ($permittedGroups as $groupId => $allowed) {\n if ($allowed && $groupId == -2) {\n return TRUE;\n } elseif ($allowed && $this->authUser->inGroup($groupId)) {\n return TRUE;\n }\n }\n }\n return FALSE;\n }", "public function customerGroupCheck()\r\n {\r\n if (Mage::app()->getStore()->isAdmin())\r\n $customer = Mage::getSingleton('adminhtml/session_quote')->getCustomer();\r\n else\r\n $customer = Mage::getSingleton('customer/session')->getCustomer();\r\n $customer_group = $customer->getGroupId();\r\n $group = Mage::getStoreConfig('customercredit/general/assign_credit');\r\n $group = explode(',', $group);\r\n if (in_array($customer_group, $group)) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public function authorize()\n {\n return $this->user()->can(\"Crear Nómina\");\n }", "public function restrict_group_creation( $can_create, $restricted ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return $can_create;\n\n\t\t\t// Check if user has enough to create a group\n\t\t\t$cost = abs( $this->prefs['create']['creds'] );\n\t\t\t$balance = $this->core->get_users_balance( $bp->loggedin_user->id, $this->mycred_type );\n\t\t\tif ( $cost > $balance ) return false;\n\n\t\t\treturn $can_create;\n\n\t\t}", "public function authorize()\n {\n return auth()->user()->can('store', [Product::class]);\n }", "public function authorize()\n {\n\t\treturn $this->user()->can('create', Collection::class);\n }", "public function create(User $user)\n {\n return $user->hasPermission('create-organization-composition');\n }", "public function isAdmin()\n {\n return $this->group_id === 1;\n }", "public function isAvailable()\n\t{\n\t\tif ($this->isLocked())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tif (BE_USER_LOGGED_IN !== true && !$this->isPublished())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Show to guests only\n\t\tif ($this->arrData['guests'] && FE_USER_LOGGED_IN === true && BE_USER_LOGGED_IN !== true && !$this->arrData['protected'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Protected product\n\t\tif (BE_USER_LOGGED_IN !== true && $this->arrData['protected'])\n\t\t{\n\t\t\tif (FE_USER_LOGGED_IN !== true)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$groups = deserialize($this->arrData['groups']);\n\n\t\t\tif (!is_array($groups) || empty($groups) || !count(array_intersect($groups, $this->User->groups)))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Check if \"advanced price\" is available\n\t\tif ($this->arrData['price'] === null && (in_array('price', $this->arrAttributes) || in_array('price', $this->arrVariantAttributes)))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function create(User $user)\n {\n return $user->hasPermissionTo('create organisations');\n }", "public function hasGroup()\n {\n return $this->_has('_group');\n }", "protected function canCreate() {}", "public function userHasCreatePermission(){\n//\t\tif(\\GO\\Base\\Model\\Acl::hasPermission($this->getPermissionLevel(),\\GO\\Base\\Model\\Acl::CREATE_PERMISSION)){\n//\t\t\treturn true;\n//\t\t}else \n\t\tif(\\GO::modules()->isInstalled('freebusypermissions')){\n\t\t\treturn \\GO\\Freebusypermissions\\FreebusypermissionsModule::hasFreebusyAccess(\\GO::user()->id, $this->user_id);\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "protected function CanCreate()\n {\n return self::Guard()->Allow(BackendAction::Create(), new Container())\n && self::Guard()->Allow(BackendAction::UseIt(), new ContainerForm());\n }", "public function allowed_group_any()\n\t{\n\t\t$which = func_get_args();\n\n\t\tif ( ! count($which))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Super Admins always have access\n\t\tif (ee()->session->userdata('group_id') == 1)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\t$result = FALSE;\n\n\t\tforeach ($which as $w)\n\t\t{\n\t\t\t$k = ee()->session->userdata($w);\n\n\t\t\tif ($k === TRUE OR $k == 'y')\n\t\t\t{\n\t\t\t\t$result = TRUE;\n\t\t\t}\n\t\t}\n\n\t\treturn $result;\n\t}", "public function hasAssignedServerGroup() {\n\t\t$q = mysql_safequery('SELECT servergroup FROM tblproducts WHERE id = ?', array($this->id));\n\t\t$row = mysql_fetch_assoc($q);\n\t\treturn isset($row['servergroup']) ? (int) $row['servergroup'] : false;\n\t}", "private function validateGroup(){\n\n\t global $db;\n\t \n\t #see if this is a guest, if so, do some hard-coded checks.\n\t\tif($this->user == \"guest\"){\n\t\t if(($this->user == \"guest\") and ($this->gid == 0)){\n\t\t return(true);\n\t\t }else{\n\t\t return(false);\n\t\t }\n\t\t}else{\n\t\t\t$db->SQL = \"SELECT id FROM ebb_groups WHERE id='\".$this->gid.\"' LIMIT 1\";\n\t\t\t$validateGroup = $db->affectedRows();\n\n\t\t\tif($validateGroup == 1){\n\t\t\t return (true);\n\t\t\t}else{\n\t\t\t return(false);\n\t\t\t}\n\t\t}\n\t}", "public function authorize()\n {\n return $this->user()->can('Crear Departamentos');\n\n }", "public function isAuthorized($user){\n /*\n * \n 1 \tAdmin\n 2 \tOfficer / Manager\n 3 \tRead Only\n 4 \tStaff\n 5 \tUser / Operator\n 6 \tStudent\n 7 \tLimited\n */\n \n //managers can add / edit\n if (in_array($this->request->action, ['delete','add','edit','reorder'])) {\n if ($user['group_id'] <= 4) {\n return true;\n }\n }\n \n \n //Admins have all\n return parent::isAuthorized($user);\n }", "public function authorize()\n {\n return auth()->user()->can('create-buildings');\n }", "public function authorize()\n {\n return $this->groupHasUser() || $this->hasSeller();\n }", "public function create(): bool\n {\n return $this->isAllowed(self::CREATE);\n }", "public function create()\n {\n $usertechgroupscount = Auth::user()->techgroups()->get()->count();\n // $usertechgroupscount = Auth::user()->techgroups()->count();\n\n if($usertechgroupscount < 5 || Auth::user()->type=='admin'){\n // User can only create / be admin of a max of 5 tech groups\n return view('techgroups.create');\n }\n return back()->with('error', 'You cannot be admin of more than 5 tech groups. Either edit your existing\n tech groups, or delete an existing tech group you are admin of.');\n }", "private function setGroup() {\n if (Request::has(\"include-group-read\") && Request::input(\"include-group-read\") === \"true\") { $permissionRead = 4; } else { $permissionRead = 0; }\n if (Request::has(\"include-group-write\") && Request::input(\"include-group-write\") === \"true\") { $permissionWrite = 2; } else { $permissionWrite = 0; }\n if (Request::has(\"include-group-execute\") && Request::input(\"include-group-execute\") === \"true\") { $permissionExecute = 1; } else { $permissionExecute = 0; }\n return $permissionRead + $permissionWrite + $permissionExecute;\n }", "public function isGroup()\n {\n return true;\n }", "public function hasGroups(){\n return $this->_has(3);\n }", "function userCanCreateUser( $sessionID ) {\r\n\t\treturn $this->getAccessLevel() > 9;\r\n\t}", "public function hasGroups(){\n return $this->_has(4);\n }", "public function hasGroups(){\n return $this->_has(4);\n }", "public function authorize()\n {\n return $this->user()->can('user.create');\n }", "public function create(User $user)\n {\n $user_array = UserGroup::where('group_id','1')\n ->pluck('user_id')->toArray();\n return in_array($user->id,$user_array);\n }", "public function create(User $user)\n {\n if ($user->can('create_permission') || $user->can('manage_permissions')) {\n return true;\n }\n\n return false;\n }", "public function create(User $user)\n {\n return Auth()->user()->hasRole('Admin') || Auth()->user()->hasPermissionTo('Create roles');\n }", "public function create()\n {\n return isAdmin();\n }", "private function is_group_plan_defined(){\n foreach( pms_get_subscription_plans( true ) as $plan ) {\n if( $plan->type == 'group' )\n return true;\n }\n\n return false;\n }", "public function hasGroup()\n {\n return isset($this->arrConfig['group']);\n }", "public function hasGroups(){\n return $this->_has(1);\n }", "function bp_group_email_get_capabilities() {\r\n if ( bp_group_is_admin() || bp_group_is_mod() ) { \r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "private function userHasAccess()\n {\n $required_perm = $this->route['perm'];\n $user_group = $_SESSION['user_group'];\n if ($required_perm == 'all') {\n return true;\n } elseif ($user_group == $required_perm) {\n return true;\n }\n return false;\n }", "public function create(User $user)\n {\n return $user->hasRole('Admin') || $user->hasPermissionTo('create_sectors');\n }", "public function is_group(){\n return is_array($this->controls) && count($this->controls) > 1;\n }", "function canCreatePage() {\n return ($this->isAdmin() || ($this->userType == 'author'));\n }", "protected function _isAllowed()\r\n {\r\n return Mage::getSingleton('admin/session')->isAllowed('system/thetailor_workgroup_workflow');\r\n }", "public static function userCreationAllowed(): bool\n {\n return self::isConfigured(self::ACTION_ADD_USER);\n }", "public function authorize()\n {\n return auth()->user()->can('create', Pizza::class);\n }", "public function inGroup($name) {\r\n // Check if the user belongs to the group\r\n if (in_array($name, $this->groups)) {\r\n // If then do, return true\r\n return true;\r\n }\r\n // User doesn't belong to group, return false\r\n return false;\r\n }", "public function canSetCreatable();", "public function isGroupProviderForUser()\n {\n return false;\n }", "public function create(User $user)\n {\n if($user->can('carts-create') || $user->can('cart-create')) {\n return true;\n }\n return false;\n }", "function AdminSecurityCheck(){\n\t\t$User = new User();\n\t\t$user = $this->session->userdata('Group');\n\t\tif ($user){\n\t\t\tif($user == 1){\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\treturn false;\n\t\t}\n\t}", "public function isAllowed()\n {\n $result = new \\Magento\\FrameWork\\DataObject(['is_allowed' => true]);\n $this->_eventManager->dispatch(\n 'ves_vendor_menu_check_acl',\n [\n 'resource' => $this->_resource,\n 'result' => $result\n ]\n );\n $permission = new \\Vnecoms\\Vendors\\Model\\AclResult();\n $this->_eventManager->dispatch(\n 'ves_vendor_check_acl',\n [\n 'resource' => $this->_resource,\n 'permission' => $permission\n ]\n );\n return $result->getIsAllowed() && $permission->isAllowed();\n }", "function canCreateAccounts() {\r\n\t\treturn true;\r\n\t}", "public function isAdmin()\n {\n $p = User::getUser();\n if($p)\n {\n if($p->canAccess('Edit products') === TRUE)\n {\n return TRUE;\n }\n }\n return FALSE;\n }", "function canAdd() {\r\n\t\t$user\t=& JFactory::getUser();\r\n\t\t$permission = FlexicontentHelperPerm::getPerm();\r\n\t\tif(!$permission->CanAdd) return false;\r\n\t\treturn true;\r\n\t}", "public function isAuthorized() {\n\t\t$UserDN = $this->getDistinguishedName($this->Username);\n\t\t$GroupMemberships = $this->getGroups($UserDN);\n\t\tforeach($this->Groups as $Group) {\n\t\t\tif(in_array($this->getDistinguishedName($Group), $GroupMemberships)) {\n\t\t\t/*\n\t\t\t* If any Group the User is a Member of matches the Allowed groups -> Authorization success.\n\t\t\t*/\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t/*\n\t\t* This only happens when no Groupmembership matches the Allowed groups -> Authorization failed.\n\t\t*/\n\t\treturn false;\n\t}", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Formax_FormCrud::formcrud_create') ||\n $this->_authorization->isAllowed('Formax_FormCrud::formcrud_update');\n }", "private function checkUserAdministrator():bool\n {\n $user = JFactory::getUser();\n if (in_array(8, $user->groups)) {\n return true;\n }\n return false;\n }", "public function canCreate(string $name) : bool;", "public function create()\n {\n $special_users=Company::find(Auth::User()->company_id)->hasUserGroups()->get();\n $id[]='';\n for($i=0; $i<count($special_users); $i++){\n $id[]=$special_users[$i]->administrator;\n }\n\n \n\t\t\t\n\t\t\treturn Redirect::to('special/usergroup')->with('success','Special user does not have the ability to create a group. Below are the existing groups that you administer');\n }", "function db_user_is_member_of_group($username, $groupname, $snuuid)\n{\n\t$sql = \"SELECT creation FROM group_members\n\t\tWHERE username=$1\n\t\tAND groupname=$2\n\t\tAND snuuid=$3\";\n\t$res = pg_query_params($sql, array($username, $groupname, $snuuid));\n\treturn pg_num_rows($res) != 0;\n}", "public function isGrouped()\n {\n return $this->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_GROUPED;\n }", "protected function _canAddTab($product)\n {\n if ($product->getId()) {\n return true;\n }\n if (!$product->getAttributeSetId()) {\n return false;\n }\n $request = Mage::app()->getRequest();\n if ($request->getParam('type') == 'configurable') {\n if ($request->getParam('attributes')) {\n return true;\n }\n }\n return false;\n }", "public function authorize()\n {\n return $this->user()->hasPermission('subscription-service-create-plan');\n }", "function canCreate(){\n\t\t\tif(!isset($_POST['action'])) return false;\n\t\t\tif($_POST['action'] !== 'create_profile') return false;\n\t\t\tif($_POST['profile_folder'] === '') return false;\n\t\t\tif($_POST['profile_name'] === '') return false;\n\t\t\treturn true;\n\t\t}", "public function create(User $user)\n {\n return $user->can('create user');\n }", "public function authorize(): bool\n {\n return auth()->user()->can('create academic year unit levels');\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 create(User $user) : bool\n {\n return $user->isAdmin() || $user->hasPermission('create_user') || $user->hasPermission('create_all');\n }", "private function isProductCreatable(ProductDto $product)\n {\n return !empty($product->name)\n && !empty($product->categories);\n }", "function isAuthorized() {\n $roles = $this->Role->calculateCMRoles(); // What was authenticated\n \n // Store the group ID in the controller object since performRedirect may need it\n \n if(($this->action == 'add' || $this->action == 'updateGroup')\n && isset($this->request->data['CoGroupMember']['co_group_id']))\n $this->gid = filter_var($this->request->data['CoGroupMember']['co_group_id'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_BACKTICK);\n elseif(($this->action == 'delete' || $this->action == 'edit' || $this->action == 'view')\n && isset($this->request->params['pass'][0]))\n $this->gid = $this->CoGroupMember->field('co_group_id', array('CoGroupMember.id' => $this->request->params['pass'][0]));\n elseif($this->action == 'select' && isset($this->request->params['named']['cogroup']))\n $this->gid = filter_var($this->request->params['named']['cogroup'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_BACKTICK);\n \n $managed = false;\n $owner = false;\n $member = false;\n \n if(!empty($roles['copersonid']) && isset($this->gid)) {\n $managed = $this->Role->isGroupManager($roles['copersonid'], $this->gid);\n \n $gm = $this->CoGroupMember->find('all', array('conditions' =>\n array('CoGroupMember.co_group_id' => $this->gid,\n 'CoGroupMember.co_person_id' => $roles['copersonid'])));\n \n if(isset($gm[0]['CoGroupMember']['owner']) && $gm[0]['CoGroupMember']['owner'])\n $owner = true;\n \n if(isset($gm[0]['CoGroupMember']['member']) && $gm[0]['CoGroupMember']['member'])\n $member = true;\n }\n \n // Is this specified group read only?\n $readOnly = ($this->gid ? $this->CoGroupMember->CoGroup->readOnly($this->gid) : false);\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Add a new member to a group?\n // XXX probably need to check if group is open here and in delete\n $p['add'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // Delete a member from a group?\n $p['delete'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // Edit members of a group?\n $p['edit'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // View a list of members of a group?\n // This is for REST\n $p['index'] = ($this->request->is('restful') && ($roles['cmadmin'] || $roles['coadmin']));\n \n // Select from a list of potential members to add?\n $p['select'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // Update accepts a CO Person's worth of potential group memberships and performs the appropriate updates\n $p['update'] = !$readOnly && ($roles['cmadmin'] || $roles['comember']);\n \n // Select from a list of potential members to add?\n $p['updateGroup'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // View members of a group?\n $p['view'] = ($roles['cmadmin'] || $managed || $member);\n \n $this->set('permissions', $p);\n return $p[$this->action];\n }", "public function isMemberOf($group_name){\n return $this->permission()->isMemberOf($this,$group_name);\n }", "public function create(User $user)\n {\n return $user->isManager() || $user->isAdmin();\n }", "public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }", "public function create(User $user)\n {\n return $user->hasPermission('create-moui-module');\n }", "public function authorize()\n {\n return Auth::user() && Auth::user()->hasPermissionTo('create-users');\n }", "public function userInGroup()\n\t{\n\t\tself::authenticate();\n\n\t\t$uname = FormUtil::getPassedValue('user', null);\n\t\t$group = FormUtil::getPassedValue('group', null);\n\n\t\tif($uname == null) {\n\t\t\treturn self::retError('ERROR: No user name passed!');\n\t\t}\n\t\tif($group == null) {\n\t\t\treturn self::retError('ERROR: No group passed!');\n\t\t}\n\n\t\t$uid = UserUtil::getIdFromName($uname);\n\t\tif($uid == false) {\n\t\t\treturn self::ret(false);\n\t\t}\n\n\t\tif($group == 'admin') {\n\t\t\tif(SecurityUtil::checkPermission('Owncloud::Admin', '::', ACCESS_MODERATE, $uid)) {\n\t\t\t\t$return = true;\n\t\t\t} else {\n\t\t\t\t$return = false;\n\t\t\t}\n\t\t} else {\n\t\t\t$groups = UserUtil::getGroupsForUser($uid);\n\t\t\t$return = false;\n\t\t\tforeach($groups as $item) {\n\t\t\t\t$itemgroup = UserUtil::getGroup($item);\n\t\t\t\tif($itemgroup['name'] == $group) {\n\t\t\t\t\t$return = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn self::ret($return);\n\t}", "public function create(User $user)\n {\n return $user->hasPermission('create-organization-formation');\n }", "public function hasCustomerGroupId(): bool\n {\n return isset($this->options['group_id']);\n }" ]
[ "0.75314003", "0.6667685", "0.66596156", "0.6656765", "0.6503588", "0.64534134", "0.6400284", "0.6348728", "0.63329154", "0.6325974", "0.63027555", "0.6299878", "0.6211796", "0.6189139", "0.61464685", "0.61305034", "0.61305034", "0.6079144", "0.6077826", "0.60727835", "0.60704345", "0.6051933", "0.6050826", "0.60290647", "0.6027306", "0.59810054", "0.5946752", "0.5904996", "0.59032416", "0.5889043", "0.58825475", "0.5880496", "0.58792317", "0.5869636", "0.5862384", "0.58442867", "0.5840113", "0.58311886", "0.58293694", "0.58013284", "0.579559", "0.5781411", "0.578016", "0.5776574", "0.57685417", "0.5765795", "0.576274", "0.57460177", "0.5742545", "0.5742296", "0.5742296", "0.57420534", "0.5739768", "0.57280827", "0.5727197", "0.5725946", "0.5723522", "0.57208693", "0.57180953", "0.57135576", "0.570274", "0.569126", "0.56834364", "0.56826293", "0.5681817", "0.5676785", "0.5662897", "0.5655189", "0.565343", "0.56507987", "0.5647245", "0.5639923", "0.5637736", "0.5631735", "0.563125", "0.56284153", "0.5623732", "0.56182", "0.56124413", "0.55994207", "0.5598056", "0.55829704", "0.5580245", "0.55665815", "0.5565912", "0.5559279", "0.55577296", "0.55574757", "0.5557459", "0.55545294", "0.55528075", "0.55524194", "0.5550708", "0.55498314", "0.55472475", "0.5541399", "0.5537614", "0.553345", "0.55309594", "0.5528582" ]
0.6866294
1
Determine whether the user can update the product group.
public function update(User $user, ProductGroup $productGroup) { if( $user->hasPermissions(['group_update'])) { return true; } else { return $user->hasPermissions(['group_self'], $productGroup); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function authorize(): bool\n {\n return Gate::allows('update', $this->product);\n }", "public function authorize()\n {\n $user = \\Auth::user();\n \n if($user->can('update', \\App\\Product::class)){\n return true;\n }\n \n return false;\n }", "protected function _isAllowed()\r\n {\r\n return $this->_authorization->isAllowed('AAllen_PriceUpdate::update');\r\n }", "public function authorize()\n {\n return $this->user()->can('update_users');\n }", "static function canUpdate() {\n // as users can update their onw items\n return Session::haveRightsOr(self::$rightname, [\n CREATE,\n UPDATE,\n self::MANAGE_BG_EVENTS\n ]);\n }", "protected function _isAllowed()\r\n {\r\n return Mage::getSingleton('admin/session')->isAllowed('catalog/productsupdater');\r\n }", "public function update(): bool\n {\n return $this->isAllowed(self::UPDATE);\n }", "public function authorize()\n {\n return $this->user()->canUpdateSecurity();\n }", "public function authorize()\n {\n return $this->user()->can('update', $this->user());\n }", "public function authorizePatch()\n {\n return $this->user()->can('acme.update');\n }", "public function update(User $user, Product $product)\n {\n return $user->isManager() || $user->isAdmin();\n }", "public function authorize()\n {\n if (auth()->user()->can('update')) {\n return true;\n }\n\t\t\n\t\treturn false;\n }", "public function isAdmin()\n {\n $p = User::getUser();\n if($p)\n {\n if($p->canAccess('Edit products') === TRUE)\n {\n return TRUE;\n }\n }\n return FALSE;\n }", "public function canEdit()\n {\n if ($this->isOptionsUpdated()) {\n return true;\n }\n if (!$this->getRequisitionListProduct()) {\n return false;\n }\n\n try {\n $product = $this->requisitionListItemProduct->getProduct($this->getItem());\n return $this->productChangesAvailabilityChecker->isProductEditable($product);\n } catch (\\Magento\\Framework\\Exception\\NoSuchEntityException $e) {\n return false;\n }\n }", "private function validate()\r\n {\r\n if (!$this->user->hasPermission('modify', 'module/promotion')) {\r\n $this->error['warning'] = $this->language->get('error_permission');\r\n }\r\n\r\n if (!$this->error) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\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}", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webkul_Marketplace::product');\n }", "public function isAdmin()\n {\n return $this->group_id === 1;\n }", "public function userCanSubmit() {\n\t\tglobal $content_isAdmin;\n\t\tif (!is_object(icms::$user)) return false;\n\t\tif ($content_isAdmin) return true;\n\t\t$user_groups = icms::$user->getGroups();\n\t\t$module = icms::handler(\"icms_module\")->getByDirname(basename(dirname(dirname(__FILE__))), TRUE);\n\t\treturn count(array_intersect($module->config['poster_groups'], $user_groups)) > 0;\n\t}", "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 authorize()\n {\n return $this->user()->can('update', $this->route('user'));\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 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 $user = Auth::user();\n\n if(!$user->can('update-role')) {\n return false;\n }\n\n return true;\n }", "public function authorize()\n {\n $user = $this->findFromUrl('user');\n return $this->user()->can('update', $user);\n }", "public function batch_items_permissions_check() {\n return current_user_can( 'manage_options' );\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}", "function check_user() {\n\treturn false; // update allowed\n\treturn true; //no update allowed\n}", "public function authorize()\n {\n return auth()->user()->can('update', [Category::class, request('category')]);\n }", "public function canUpload()\n {\n return $this->checkFrontendUserPermissionsGeneric('userGroupAllowUpload');\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 isUpdateSecurityRelevant() {}", "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 update(User $user)\n {\n if ($user->can('update_permission') || $user->can('manage_permissions')) {\n return true;\n }\n\n return false;\n }", "function updatesAllowed() {\n\t\treturn $this->getupdatable() == 1 ? true : false;\n\t}", "private function canModify()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }", "function can_do_updatemultiple() {\n $id = $this->required_param('id');\n return cmclasspage::_has_capability('block/curr_admin:track:enrol', $id);\n }", "public function isAdmin() {\n return (json_decode($this->group->permissions))->admin;\n }", "public function authorize()\n {\n return $this->user()->can('update', \\App\\Models\\Member::withTrashed()->find($this->id));\n }", "protected function _isAllowed()\r\n {\r\n return Mage::getSingleton('admin/session')->isAllowed('system/thetailor_workgroup_workflow');\r\n }", "private function validateUpdate() {\n\t\t$this->context->checkPermission(\\Scrivo\\AccessController::WRITE_ACCESS);\n\t}", "public function update(User $user, ProductCategory $productCategory)\n {\n if ($user->hasPermissionTo('edit crm product categories')) {\n return true;\n }\n }", "public function isAllowed()\n {\n $result = new \\Magento\\FrameWork\\DataObject(['is_allowed' => true]);\n $this->_eventManager->dispatch(\n 'ves_vendor_menu_check_acl',\n [\n 'resource' => $this->_resource,\n 'result' => $result\n ]\n );\n $permission = new \\Vnecoms\\Vendors\\Model\\AclResult();\n $this->_eventManager->dispatch(\n 'ves_vendor_check_acl',\n [\n 'resource' => $this->_resource,\n 'permission' => $permission\n ]\n );\n return $result->getIsAllowed() && $permission->isAllowed();\n }", "public function authorize()\n {\n $company_id = auth()->user()->cmpny_id;\n $group_id = request()->post('id');\n $group = Group::find($group_id);\n if ($group_id && (!isset($group->id) || empty($group->id)))\n {\n return false;\n }\n if (!empty($group->id) && ($company_id != $group->cmpny_id))\n {\n return false;\n }\n\n return true;\n }", "public function isAvailable()\n\t{\n\t\tif ($this->isLocked())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tif (BE_USER_LOGGED_IN !== true && !$this->isPublished())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Show to guests only\n\t\tif ($this->arrData['guests'] && FE_USER_LOGGED_IN === true && BE_USER_LOGGED_IN !== true && !$this->arrData['protected'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Protected product\n\t\tif (BE_USER_LOGGED_IN !== true && $this->arrData['protected'])\n\t\t{\n\t\t\tif (FE_USER_LOGGED_IN !== true)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$groups = deserialize($this->arrData['groups']);\n\n\t\t\tif (!is_array($groups) || empty($groups) || !count(array_intersect($groups, $this->User->groups)))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Check if \"advanced price\" is available\n\t\tif ($this->arrData['price'] === null && (in_array('price', $this->arrAttributes) || in_array('price', $this->arrVariantAttributes)))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function authorize(): bool\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "private function checkUserAdministrator():bool\n {\n $user = JFactory::getUser();\n if (in_array(8, $user->groups)) {\n return true;\n }\n return false;\n }", "public function authorize(): bool\n {\n return $this->user()->can('update_contact');\n }", "function checkActionPermissionGroup($permittedGroups) {\n if (is_array($permittedGroups) && count($permittedGroups) > 0) {\n foreach ($permittedGroups as $groupId => $allowed) {\n if ($allowed && $groupId == -2) {\n return TRUE;\n } elseif ($allowed && $this->authUser->inGroup($groupId)) {\n return TRUE;\n }\n }\n }\n return FALSE;\n }", "public function update(User $user, Group $group)\n {\n return $user->id == $group->user_id;\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 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}", "private function userHasAccess()\n {\n $required_perm = $this->route['perm'];\n $user_group = $_SESSION['user_group'];\n if ($required_perm == 'all') {\n return true;\n } elseif ($user_group == $required_perm) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n return $this->user()->hasPermission('update-title');\n }", "public function authorize()\n {\n $person = $this->findFromUrl('person');\n\n return $this->user()->can('update', $person);\n }", "public function can_update_a_product()\n {\n $product = $this->create('Product');\n\n $response = $this->actingAs($this->create('User', [], false), 'api')->json('PUT', \"api/products/$product->id\", [\n 'name' => $product->name.'_updated',\n 'slug' => str_slug($product->slug.'_updated'),\n 'price' => $product->price+10\n ]);\n\n $response->assertStatus(200)\n ->assertExactJson([\n 'id' => $product->id,\n 'name' => $product->name.'_updated',\n 'slug' => str_slug($product->slug.'_updated'),\n 'price' => $product->price+10,\n 'created_at' => (string)$product->created_at\n ]);\n\n $this->assertDatabaseHas('products', [\n 'id' => $product->id,\n 'name' => $product->name.'_updated',\n 'slug' => str_slug($product->slug.'_updated'),\n 'price' => $product->price+10,\n 'created_at' => (string)$product->created_at,\n 'updated_at' => (string)$product->updated_at,\n ]);\n }", "public function authorize()\n {\n return auth()->user()->can('create-product-packages');\n }", "protected function canUpdate(){\n $emptyComment = $this->getEmptyComment();\n\n return $this->canUserModify() &&\n ($this->isActive() || $this->isPending() ||\n ($this->isSuspended() && parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS, $emptyComment))) &&\n !$this->isDeleted() &&\n $this->isQuestionActive() &&\n $this->socialQuestion->SocialPermissions->isUnlockedOrUserCanChangeLockStatus() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE, $emptyComment);\n }", "function isAuthorized() {\n $roles = $this->Role->calculateCMRoles(); // What was authenticated\n \n // Store the group ID in the controller object since performRedirect may need it\n \n if(($this->action == 'add' || $this->action == 'updateGroup')\n && isset($this->request->data['CoGroupMember']['co_group_id']))\n $this->gid = filter_var($this->request->data['CoGroupMember']['co_group_id'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_BACKTICK);\n elseif(($this->action == 'delete' || $this->action == 'edit' || $this->action == 'view')\n && isset($this->request->params['pass'][0]))\n $this->gid = $this->CoGroupMember->field('co_group_id', array('CoGroupMember.id' => $this->request->params['pass'][0]));\n elseif($this->action == 'select' && isset($this->request->params['named']['cogroup']))\n $this->gid = filter_var($this->request->params['named']['cogroup'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_BACKTICK);\n \n $managed = false;\n $owner = false;\n $member = false;\n \n if(!empty($roles['copersonid']) && isset($this->gid)) {\n $managed = $this->Role->isGroupManager($roles['copersonid'], $this->gid);\n \n $gm = $this->CoGroupMember->find('all', array('conditions' =>\n array('CoGroupMember.co_group_id' => $this->gid,\n 'CoGroupMember.co_person_id' => $roles['copersonid'])));\n \n if(isset($gm[0]['CoGroupMember']['owner']) && $gm[0]['CoGroupMember']['owner'])\n $owner = true;\n \n if(isset($gm[0]['CoGroupMember']['member']) && $gm[0]['CoGroupMember']['member'])\n $member = true;\n }\n \n // Is this specified group read only?\n $readOnly = ($this->gid ? $this->CoGroupMember->CoGroup->readOnly($this->gid) : false);\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Add a new member to a group?\n // XXX probably need to check if group is open here and in delete\n $p['add'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // Delete a member from a group?\n $p['delete'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // Edit members of a group?\n $p['edit'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // View a list of members of a group?\n // This is for REST\n $p['index'] = ($this->request->is('restful') && ($roles['cmadmin'] || $roles['coadmin']));\n \n // Select from a list of potential members to add?\n $p['select'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // Update accepts a CO Person's worth of potential group memberships and performs the appropriate updates\n $p['update'] = !$readOnly && ($roles['cmadmin'] || $roles['comember']);\n \n // Select from a list of potential members to add?\n $p['updateGroup'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // View members of a group?\n $p['view'] = ($roles['cmadmin'] || $managed || $member);\n \n $this->set('permissions', $p);\n return $p[$this->action];\n }", "public function canEdit() {\n\t\treturn $this->_perms->checkModuleItem ( $this->_tbl_module, 'edit' );\n\t}", "public function authorize()\n {\n return $this->groupHasUser() || $this->hasSeller();\n }", "protected function canUpdate()\n {\n return $this->hasStrategy(self::STRATEGY_UPDATE);\n }", "public function update(User $user, Product $checkoutProduct)\n {\n if ($user->is_admin) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $article = Article::find($this->route('article'));\n return $article && $this->user()->can('update', $article);\n }", "protected function check_update_permission($post)\n {\n }", "protected function check_update_permission($post)\n {\n }", "public function allowed_group()\n\t{\n\t\t$which = func_get_args();\n\n\t\tif ( ! count($which))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Super Admins always have access\n\t\tif (ee()->session->userdata('group_id') == 1)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tforeach ($which as $w)\n\t\t{\n\t\t\t$k = ee()->session->userdata($w);\n\n\t\t\tif ( ! $k OR $k !== 'y')\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function authorize()\n {\n // only allow updates if the user is logged in\n return backpack_auth()->check();\n }", "public function update(User $user)\n {\n if($user->can('carts-update') || $user->can('cart-update')) {\n return true;\n }\n return false;\n }", "private function validate() {\n\t\tif (!$this->user->hasPermission('modify', 'module/bottomlistcategory')) {\n\t\t\t$this->error['warning'] = $this->language->get('error_permission');\n\t\t}\n\t\t\n\t\tif (!$this->error) {\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\t\n\t}", "protected function _isAllowed()\n {\n return parent::_isAllowed() && $this->_authorization->isAllowed('Vnecoms_VendorsProfileNotification::manage_process');\n }", "public function update(User $user): bool\n {\n return $user->can('Update Role');\n }", "public function isAdmin() {\n\t\t$groupId = $this->Session->read('UserAuth.User.user_group_id');\n\t\tif($groupId==ADMIN_GROUP_ID) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed(\n Templates::ADMIN_RESOURCE_SAVE\n );\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_logistics/equipment');\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Formax_FormCrud::formcrud_create') ||\n $this->_authorization->isAllowed('Formax_FormCrud::formcrud_update');\n }", "protected function isPowerUser()\n {\n return $this->user->can('sys_properties_edit', $this->app->modules[$this->area]);\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Pronko_TaskManagement::TaskManagement_save');\n }", "public function canBeUpdated()\n {\n return $this->isNotYetSubmitted();\n }", "public function authorize()\n { \n $this->shop = Auth::user()->shop;\n\n if($this->method() == 'PUT' || $this->method() == 'PATCH') {\n $product = Product::findorFail($this->route('product'));\n\n return $product->shop_id == $this->shop->id;\n }\n\n return true;\n }", "public function authorize()\n {\n return auth()->user()->can('store', [Product::class]);\n }", "public function isAuthorized($user){\n /*\n * \n 1 \tAdmin\n 2 \tOfficer / Manager\n 3 \tRead Only\n 4 \tStaff\n 5 \tUser / Operator\n 6 \tStudent\n 7 \tLimited\n */\n \n //managers can add / edit\n if (in_array($this->request->action, ['delete','add','edit','reorder'])) {\n if ($user['group_id'] <= 4) {\n return true;\n }\n }\n \n \n //Admins have all\n return parent::isAuthorized($user);\n }", "public function update(User $user, OrderProduct $orderProduct)\n {\n return $user->isAdmin() || $user->is($orderProduct->coupon->user);\n }", "public function authorize()\n {\n return auth()->user()->can('updatePermissions', [Role::class, request('role')]);\n }", "protected function _isAllowed()\n\t{\n\t\treturn (Mage::getSingleton('admin/session')->isAllowed('dropship360/suppliers') || Mage::getSingleton('admin/session')->isAllowed('dropship360/vendor_ranking'));\n\t}", "public function update(User $user)\n {\n\t\treturn in_array('update', $user->permissibles('vip'));\n }", "public function update(User $user, FilterGroup $filter_group)\n {\n if ($user->canDo('filter.filter_group.update') && $user->is('admin')) {\n return true;\n }\n\n if ($user->canDo('blocks.block.update') \n && $user->is('manager')\n && $block->user->parent_id == $user->id) {\n return true;\n }\n\n return $user->id === $filter_group->user_id;\n }", "public function isUserOrGroupSet() {}", "protected function _isAllowed()\r\n\t{\r\n\t\treturn Mage::getSingleton('admin/session')->isAllowed('system/tools/modulesmanager');\r\n\t}", "public function authorize()\n {\n return auth()->user()->can('update online assessment');\n }", "function updateMemberGroup()\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 $edit = (bool) Request::has('group_id');\n\n $group_id = Request::input('group_id');\n $clone_id = Request::input('clone_id');\n\n unset($_POST['group_id']);\n unset($_POST['clone_id']);\n\n // No group name\n if ( ! Request::input('group_name')) {\n return Cp::errorMessage(__('members.missing_group_name'));\n }\n\n $return = (Request::has('return'));\n\n $site_ids = [];\n $plugin_ids = [];\n $weblog_ids = [];\n $template_ids = [];\n\n // ------------------------------------\n // Remove and Store Weblog and Template Permissions\n // ------------------------------------\n\n $data = [\n 'group_name' => Request::input('group_name'),\n 'group_description' => Request::input('group_description'),\n ];\n\n $duplicate = DB::table('member_groups')\n ->where('group_name', $data['group_name']);\n\n if (!empty($group_id)) {\n $duplicate->where('group_id', '!=', $group_id);\n }\n\n if($duplicate->count() > 0) {\n return Cp::errorMessage(__('members.duplicate_group_name'));\n }\n\n // ------------------------------------\n // Preferences\n // ------------------------------------\n\n $preferences['group_id'] = $group_id;\n $preferences['is_locked'] = Request::input('is_locked');\n\n foreach(static::$group_preferences as $group => $prefs) {\n foreach((array) $prefs as $key => $default) {\n if (Request::has($key)) {\n $preferences[$key] = Request::get($key);\n }\n }\n }\n\n foreach (Request::all() as $key => $val)\n {\n if (substr($key, 0, strlen('weblog_id_')) == 'weblog_id_') {\n $preferences[$key] = ($val == 'y') ? 'y' : 'n';\n } elseif (substr($key, 0, strlen('plugin_name_')) == 'plugin_name_') {\n $preferences[$key] = ($val == 'y') ? 'y' : 'n';\n } elseif (substr($key, 0, strlen('can_access_offline_site_id_')) == 'can_access_offline_site_id_') {\n $preferences[$key] = ($val == 'y') ? 'y' : 'n';\n } elseif (substr($key, 0, strlen('can_access_cp_site_id_')) == 'can_access_cp_site_id_') {\n $preferences[$key] = ($val == 'y') ? 'y' : 'n';\n } else {\n continue;\n }\n }\n\n if ($edit === false)\n {\n $group_id = DB::table('member_groups')->insertGetId($data);\n\n foreach($preferences as $handle => $value) {\n $prefs =\n [\n 'group_id' => $data['group_id'],\n 'handle' => $handle,\n 'value' => $value\n ];\n\n DB::table('member_group_preferences')->insert($prefs);\n }\n\n $uploads = DB::table('upload_prefs')\n ->select('id')\n ->get();\n\n foreach($uploads as $yeeha)\n {\n DB::table('upload_no_access')\n ->insert(\n [\n 'upload_id' => $yeeha->id,\n 'upload_loc' => 'cp',\n 'member_group' => $group_id\n ]);\n }\n\n $message = __('members.member_group_created').'&nbsp;'.$_POST['group_name'];\n }\n else\n {\n DB::table('member_groups')\n ->where('group_id', $data['group_id'])\n ->update($data);\n\n DB::table('member_group_preferences')\n ->where('group_id', $data['group_id'])\n ->delete();\n\n foreach($preferences as $handle => $value) {\n $prefs =\n [\n 'group_id' => $data['group_id'],\n 'handle' => $handle,\n 'value' => $value\n ];\n\n DB::table('member_group_preferences')->insert($prefs);\n }\n\n $message = __('members.member_group_updated').'&nbsp;'.$_POST['group_name'];\n }\n\n // Update CP log\n Cp::log($message);\n\n $this->clearMemberGroupCache($data['group_id']);\n\n if ($return == true) {\n return $this->member_group_manager($message);\n }\n\n return $this->editMemberGroup($message, $group_id);\n }" ]
[ "0.7324108", "0.7253346", "0.69384354", "0.6761679", "0.67539275", "0.67376304", "0.66965413", "0.6695225", "0.66925734", "0.6678436", "0.6663989", "0.66046226", "0.6589469", "0.6546452", "0.6497894", "0.6490996", "0.64484113", "0.64183354", "0.6415692", "0.63796216", "0.6363141", "0.636127", "0.6358958", "0.6358", "0.63559276", "0.6352293", "0.6343564", "0.63355094", "0.631757", "0.6262124", "0.62606907", "0.6258212", "0.6233202", "0.6233202", "0.62310445", "0.62138945", "0.6202714", "0.61810833", "0.61401963", "0.6127132", "0.6120469", "0.6108532", "0.610396", "0.60999626", "0.6093365", "0.60697013", "0.6054654", "0.6045254", "0.6042744", "0.6042654", "0.60384625", "0.60256654", "0.60243684", "0.6023538", "0.60174125", "0.6012016", "0.6011665", "0.6003212", "0.5999393", "0.5981882", "0.59807026", "0.5978285", "0.5970901", "0.59622145", "0.5958213", "0.5953669", "0.5953669", "0.59518296", "0.59516186", "0.59516186", "0.59516186", "0.59516186", "0.59516186", "0.59516186", "0.59516186", "0.59516186", "0.59516186", "0.5951048", "0.59440386", "0.59294", "0.59126616", "0.5908269", "0.5900382", "0.5896017", "0.5893169", "0.58889145", "0.5881917", "0.5879874", "0.5872619", "0.58693385", "0.58674884", "0.5862186", "0.58588594", "0.58577484", "0.58476454", "0.58470595", "0.5845096", "0.5844804", "0.584409", "0.58341384" ]
0.7592381
0
Determine whether the user can delete the product group.
public function delete(User $user, ProductGroup $productGroup) { if( $user->hasPermissions(['group_remove'])) { return true; } else { return $user->hasPermissions(['group_remove_self'], $productGroup); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function can_delete () {\r\n\r\n return $this->permissions[\"D\"] ? true : false;\r\n\r\n }", "private function canDelete()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }", "function delete()\r\n {\r\n $wdm = WeblcmsDataManager :: get_instance();\r\n $success = $wdm->delete_course_user_group_relation($this);\r\n if (! $success)\r\n {\r\n return false;\r\n }\r\n\r\n return true;\r\n }", "public function canDelete()\n {\n $exist = $this->getModelObj('permission')->where(['resource_code' => $this->code, 'app' => $this->app])->first();\n if ($exist) {\n return false;\n }\n return true;\n }", "public function canDelete()\n {\n $user = $this->getUser();\n\n if ($user->getData('role') == 'Admin' && $this->getData('status') != Service\\BalanceWithdrawals::STATUS_PENDING) {\n return true;\n }\n\n return false;\n }", "function canDelete() {\n return true;\n }", "public function canDelete()\n\t{\n\t\tif ( $this->deleteOrMoveQueued() === TRUE )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\tif( static::restrictionCheck( 'delete' ) )\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tif( static::$ownerTypes['member'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['member'];\n\n\t\t\tif( $this->$column == \\IPS\\Member::loggedIn()->member_id )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( static::$ownerTypes['group'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['group']['ids'];\n\n\t\t\t$value = $this->$column;\n\t\t\tif( count( array_intersect( explode( \",\", $value ), \\IPS\\Member::loggedIn()->groups ) ) )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\t}", "function CanDelete()\n\t{\treturn !count($this->subpages) && $this->CanAdminUserDelete();\n\t}", "public function delete(): bool\n {\n return $this->isAllowed(self::DELETE);\n }", "public function authorize(): bool\n {\n return Gate::allows('admin.genero.delete', $this->genero);\n }", "public function canDelete()\n {\n return Auth::user() && ( $this->sender_id === Auth::id() || $this->recipient_id === Auth::id() );\n }", "function canDelete($user) {\n if($this->getId() == $user->getId()) {\n return false; // user cannot delete himself\n } // if\n\n if($this->isAdministrator() && !$user->isAdministrator()) {\n return false; // only administrators can delete administrators\n } // if\n\n return $user->isPeopleManager();\n }", "public function delete()\n {\n // Check P_DELETE\n if (!wcmSession::getInstance()->isAllowed($this, wcmPermission::P_DELETE))\n {\n $this->lastErrorMsg = _INSUFFICIENT_PRIVILEGES;\n return false;\n }\n\n if (!parent::delete())\n return false;\n \n // Erase permissions\n $project = wcmProject::getInstance();\n $sql = 'DELETE FROM #__permission WHERE target=?';\n $params = array($this->getPermissionTarget());\n $project->database->executeStatement($sql, $params);\n \n return true;\n\n }", "protected function validateDelete() {\r\n\t\t// check permissions\r\n\t\tif (!WCF::getSession()->getPermission('admin.user.canDeleteUser')) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\treturn $this->__validateAccessibleGroups(array_keys($this->objects));\r\n\t}", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webiators_DeleteOrdersFromAdmin::delete_order');\n }", "public function canDelete()\n {\n return 1;\n }", "public function canDelete()\n {\n if ( !SimpleForumTools::checkAccess($this->forumNode(), 'topic', 'remove') )\n {\n \treturn false;\n }\n \t\n return true;\n }", "public function isDeleteGranted($entity): bool;", "public function authorize()\n {\n return $this->can('delete');\n }", "public function canDelete()\n {\n return $this->canGet();\n }", "public function checkIsValidForDelete() {\n $errors = false;\n if(strlen(trim($this->idGroup)) == 0){\n $errors = \"Group identifier is mandatory\";\n }else if(!preg_match('/^\\d+$/', $this->idGroup)){\n $errors = \"Group identifier format is invalid\";\n }else if($this->existsGroup() !== true) {\n $errors = \"Group doesn't exist\";\n }\n return $errors;\n }", "public function canDelete()\n {\n return in_array('delete', $this->actions);\n }", "function delete($group_id)\n {\n $success = false;\n\n //Run these queries as a transaction, we want to make sure we do all or nothing\n $this->db->trans_start();\n\n //Delete permissions\n if ($this->db->delete('permissions', array('group_id' => $group_id)) && $this->db->delete('permissions_actions', array('group_id' => $group_id))) {\n $this->db->where('group_id', $group_id);\n $success = $this->db->update('groups', array('deleted' => 1));\n }\n $this->db->trans_complete();\n return $success;\n }", "function canDelete($user) {\n if($this->isOwner() || $user->getCompanyId() == $this->getId()) {\n return false; // Owner company cannot be deleted. Also, user cannot delete company he belongs to\n } // if\n return $user->isPeopleManager();\n }", "function permissions_delete()\n{\n // Deletion not allowed\n return false;\n}", "public function isDeletable() {\n\t\t$sql = \"SELECT COUNT(*) AS members FROM wcf\".WCF_N.\"_user_to_group_premium WHERE premiumGroupID = ?\"; \n\t\t$statement = WCF::getDB()->prepareStatement($sql);\n\t\t$statement->execute(array($this->premiumGroupID));\n\t\t$row = $statement->fetchArray();\n\t\t\n\t\treturn ($row['members'] > 0) ? false : true; \n\t}", "public function canDelete($member = null) {\n\t\treturn ($this->Code == 'DEFAULT') ? false : Permission::check('Product_CANCRUD');\n\t}", "public function allowDeletion()\n {\n return $this->allowDeletion;\n }", "public function canDeleteAssociate()\n {\n return $this->settings->MODULES['REW_ISA_MODULE']\n && $this->auth->isSuperAdmin();\n }", "public function delete()\n\t{\n\t\t// make sure a user id is set\n\t\tif (empty($this->group['id']))\n\t\t{\n\t\t\tthrow new SentryGroupException(__('sentry::sentry.no_group_selected'));\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\tDB::connection(static::$db_instance)->pdo->beginTransaction();\n\n\t\t\t// delete users groups\n\t\t\t$delete_user_groups = DB::connection(static::$db_instance)\n\t\t\t\t->table(static::$join_table)\n\t\t\t\t->where(static::$group_identifier, '=', $this->group['id'])\n\t\t\t\t->delete();\n\n\t\t\t// delete GROUP\n\t\t\t$delete_user = DB::connection(static::$db_instance)\n\t\t\t\t->table(static::$table)\n\t\t\t\t->where('id', '=', $this->group['id'])\n\t\t\t\t->delete();\n\n\t\t\tDB::connection(static::$db_instance)->pdo->commit();\n\t\t}\n\t\tcatch(\\Database_Exception $e) {\n\n\t\t\tDB::connection(static::$db_instance)->pdo->rollBack();\n\t\t\treturn false;\n\t\t}\n\n\t\t// update user to null\n\t\t$this->group = array();\n\t\treturn true;\n\n\t}", "private function can_remove() {\n return isset( $_POST[ self::NAME ] ) &&\n $_POST[ self::NAME ] === 'remove' &&\n $this->backupFileExists() &&\n current_user_can( 'manage_options' );\n\n }", "public function delete(User $user, Product $product)\n {\n return $user->isManager() || $user->isAdmin();\n }", "public function deleteGroup() {\n $errors = $this->checkIsValidForDelete();\n if($errors === false){\n $sql = \"DELETE FROM `SM_GROUP` WHERE sm_idGroup ='$this->idGroup'\";\n if (!($resultado = $this->mysqli->query($sql))) {\n return 'Error in the query on the database';\n } else {\n return true;\n }\n }else{\n return $errors;\n }\n }", "public function delete()\n {\n // Do not delete children, because they are fake objects\n if (false === $this->parent_target_group && $this->target_group_id > 0) {\n $result = rex_sql::factory();\n\n $query = 'DELETE FROM '. rex::getTablePrefix() .'d2u_courses_target_groups '\n .'WHERE target_group_id = '. $this->target_group_id;\n $result->setQuery($query);\n\n $return = ($result->hasError() ? false : true);\n\n $query = 'DELETE FROM '. rex::getTablePrefix() .'d2u_courses_2_target_groups '\n .'WHERE target_group_id = '. $this->target_group_id;\n $result->setQuery($query);\n\n // reset priorities\n $this->setPriority(true);\n\n // Don't forget to regenerate URL cache\n d2u_addon_backend_helper::generateUrlCache('target_group_id');\n d2u_addon_backend_helper::generateUrlCache('target_group_child_id');\n\n return $return;\n }\n\n return false;\n\n }", "function canDelete(User $user) {\n return $user->canManageTrash();\n }", "function canDelete(User $user) {\n return $user->isFinancialManager();\n }", "function CanDelete()\n\t{\t\n\t\t\n\t\tif ($this->id && !$this->GetLocations() && $this->CanAdminUserDelete())\n\t\t{\n\t\t\t// courses\n\t\t\t$sql = \"SELECT cid FROM courses WHERE city=\" . (int)$this->id;\n\t\t\tif ($result = $this->db->Query($sql))\n\t\t\t{\tif ($this->db->NumRows($result))\n\t\t\t\t{\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t\t\n\t}", "public function delete(User $user, Product $product)\n {\n return $user->isAbleTo('product.delete');\n }", "protected function hasActiveUserDeletePermissionForThisUser()\n {\n if (true === $this->bAllowEditByAll) {\n return true;\n }\n if (true === $this->IsOwner()) {\n return false;\n }\n /** @var SecurityHelperAccess $securityHelper */\n $securityHelper = ServiceLocator::get(SecurityHelperAccess::class);\n\n if (false === $securityHelper->isGranted(CmsPermissionAttributeConstants::TABLE_EDITOR_DELETE, $this->oTableConf->fieldName)) {\n return false;\n }\n\n if (true === $securityHelper->isGranted(CmsUserRoleConstants::CMS_ADMIN)) {\n return true;\n }\n\n if ($this->sId === $securityHelper->getUser()?->getId()) {\n // you cannot delete yourself.\n return false;\n }\n\n $oTargetUser = TdbCmsUser::GetNewInstance($this->sId);\n\n // Also, the user may only delete users that have at least one portal in common.\n $userPortals = $securityHelper->getUser()?->getPortals();\n if (null === $userPortals) {\n $userPortals = [];\n }\n $allowedPortals = array_keys($userPortals);\n $portalsOfTargetUser = $oTargetUser->GetFieldCmsPortalIdList();\n\n return 0 === \\count($portalsOfTargetUser) ||\n \\count(array_intersect($allowedPortals, $portalsOfTargetUser)) > 0;\n }", "public function delete(User $user)\n {\n if ($user->can('delete_permission') || $user->can('manage_permissions')) {\n return true;\n }\n\n return false;\n }", "public function authorize()\n {\n $this->reusablePayment = FetchReusablePayment::run([\n 'encoded_id' => $this->encoded_id,\n ]);\n\n return $this->user()->can('delete', $this->reusablePayment);\n }", "public function onDelete(ResourceEvent $event)\n {\n $groupId = $event->getRouteParam('group_id');\n $userId = $event->getRouteParam('user_id');\n \n $this->getService()->removeAdmin($groupId, $userId);\n \n return true;\n }", "public function testAccessDeleteNoPermission()\n {\n $user = \\App\\User::where('permission', 0)->first();\n $response = $this->actingAs($user)->post('/group-setting/delete', [\n 'group_id' => 2,\n ]);\n $response->assertStatus(403);\n }", "public function canDELETE($collection = null) {\r\n $rights = $this->getRights($collection, 'delete');\r\n return is_bool($rights) ? $rights : true;\r\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Training_Vendor::main_index_delete');\n }", "function canDelete(&$msg, $oid = NULL) {\n\t\t//$tables[] = array( 'label' => 'Users', 'name' => 'users', 'idfield' => 'user_id', 'joinfield' => 'user_company' );\n\t\t//return CDpObject::canDelete( $msg, $oid, $tables );\n\t\treturn true;\n\t}", "public function delete(&$group) {\n\t\t/* As of PHP5.3.0, is_a() is no longer deprecated and there is no need to replace it */\n\t\tif (!is_a($group, 'icms_member_group_Object')) {\n\t\t\treturn false;\n\t\t}\n\t\t$sql = sprintf(\n\t\t\t\"DELETE FROM %s WHERE groupid = '%u'\",\n\t\t\ticms::$xoopsDB->prefix('groups'),\n\t\t\t(int) $group->getVar('groupid')\n\t\t);\n\t\tif (!$result = icms::$xoopsDB->query($sql)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function delete()\n {\n // Delete the group\n $result = parent::delete();\n\n return $result;\n }", "protected function canDelete($record)\n\t{\n\t\tif (!empty($record->id))\n\t\t{\n\t\t\tif ($record->state != -2)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t$user = JFactory::getUser();\n\t\t\t\n\t\t\treturn $user->authorise('core.delete', 'com_cooltouraman.course.' . (int) $record->id);\n\t\t}\n\n\t\treturn false;\n\t}", "public function canUpload()\n {\n return $this->checkFrontendUserPermissionsGeneric('userGroupAllowUpload');\n }", "protected function canDelete($record)\n\t{\n\t\t$user = JFactory::getUser();\n\n\t\tif (JFactory::getApplication()->isAdmin())\n\t\t{\n\t\t\treturn $user->authorise('core.delete', 'com_solidres.reservationasset.'.(int) $record->id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn SRUtilities::isAssetPartner($user->get('id'), $record->id);\n\t\t}\n\t}", "public function can_delete_a_product()\n {\n $product = $this->create('Product');\n\n $response = $this->actingAs($this->create('User', [], false), 'api')->json('DELETE', \"api/products/$product->id\");\n\n $response->assertStatus(204)\n ->assertSee(null);\n\n $this->assertDatabaseMissing('products', ['id' => $product->id]);\n }", "public function delete(User $user)\n {\n if($user->can('carts-delete') || $user->can('cart-delete')) {\n return true;\n }\n return false;\n }", "public function authorize()\n {\n $company_id = auth()->user()->cmpny_id;\n $group_id = request()->post('id');\n $group = Group::find($group_id);\n if ($group_id && (!isset($group->id) || empty($group->id)))\n {\n return false;\n }\n if (!empty($group->id) && ($company_id != $group->cmpny_id))\n {\n return false;\n }\n\n return true;\n }", "public function delete(User $user, Group $group)\n {\n return $user->id == $group->user_id;\n }", "public function authorize()\n {\n $this->translation = Translation::findByUuidOrFail($this->route('id'));\n\n return $this->user()->can('delete', [Translation::class, $this->translation->node->project]);\n }", "public function testAllowDelete()\n {\n $this->logOut();\n $deleteFalse = LogEntry::create()->canDelete(null);\n $this->assertFalse($deleteFalse);\n\n $this->logInWithPermission('ADMIN');\n $deleteTrue = LogEntry::create()->canDelete();\n $this->assertTrue($deleteTrue);\n }", "public function sure_delete_block(){\r\n\t\tif($this->has_admin_panel()) return $this->module_sure_delete_block();\r\n return $this->module_no_permission();\r\n\t}", "public function authorize()\n {\n if (env('APP_ENV') == 'testing') {\n return true;\n }\n\n return tenant(auth()->user()->id)->hasPermissionTo('delete fixed asset');\n }", "public function isAdmin()\n {\n return $this->group_id === 1;\n }", "public function confirm()\n {\n // Only super admins can delete member groups\n if (! ee('Permission')->can('delete_roles')) {\n show_error(lang('unauthorized_access'), 403);\n }\n\n $roles = ee()->input->post('selection');\n\n $roleModels = ee('Model')->get('Role', $roles)->all();\n $vars['members_count_primary'] = 0;\n $vars['members_count_secondary'] = 0;\n foreach ($roleModels as $role) {\n $vars['members_count_primary'] += $role->getMembersCount('primary');\n $vars['members_count_secondary'] += $role->getMembersCount('secondary');\n }\n\n $vars['new_roles'] = [];\n if (ee('Permission')->can('delete_members')) {\n $vars['new_roles']['delete'] = lang('member_assignment_none');\n }\n $allowed_roles = ee('Model')->get('Role')\n ->fields('role_id', 'name')\n ->filter('role_id', 'NOT IN', array_merge($roles, [1, 2, 3, 4]))\n ->order('name');\n if (! ee('Permission')->isSuperAdmin()) {\n $allowed_roles->filter('is_locked', 'n');\n }\n $vars['new_roles'] += $allowed_roles->all()\n ->getDictionary('role_id', 'name');\n\n ee()->cp->render('members/delete_member_group_conf', $vars);\n }", "public function authorize()\n {\n return auth()->user()->can('create-product-packages');\n }", "protected function check_delete_permission($post)\n {\n }", "public function allowed_group()\n\t{\n\t\t$which = func_get_args();\n\n\t\tif ( ! count($which))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Super Admins always have access\n\t\tif (ee()->session->userdata('group_id') == 1)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tforeach ($which as $w)\n\t\t{\n\t\t\t$k = ee()->session->userdata($w);\n\n\t\t\tif ( ! $k OR $k !== 'y')\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}", "public function canDelete($userId = \"\")\n {\n\n if ($userId == \"\")\n $userId = Yii::$app->user->id;\n\n if ($this->user_id == $userId)\n return true;\n\n if (Yii::$app->user->isAdmin()) {\n return true;\n }\n\n if ($this->container instanceof Space && $this->container->isAdmin($userId)) {\n return true;\n }\n\n return false;\n }", "public function canDelete($curMenuset)\n {\n $canDelete = true;\n if ($curMenuset == self::getDefaultMenuset()) {\n $canDelete = false;\n }\n \n return $canDelete;\n }", "protected function canDelete($record)\n\t{\n\t\tif(!empty($record->id))\n\t\t{\n\t\t\treturn Factory::getUser()->authorise(\"core.delete\", \"com_bookingmanager.customer.\" . $record->id);\n\t\t}\n\t}", "protected function canDelete() {\n return $this->canUpdate() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS_DELETE, $this->getEmptyComment());\n }", "public function delete()\n {\n return parent::delete()\n && ProductComment::deleteGrades($this->id)\n && ProductComment::deleteReports($this->id)\n && ProductComment::deleteUsefulness($this->id);\n }", "public function canDelete()\n {\n $translate = $this->getTranslate();\n\n if ($this->_usedInSales()) {\n return $translate->_('This store location cannot be removed because it is used in an invoice.');\n }\n\n return true;\n }", "public function isAdmin()\n {\n $p = User::getUser();\n if($p)\n {\n if($p->canAccess('Edit products') === TRUE)\n {\n return TRUE;\n }\n }\n return FALSE;\n }", "public function authorize()\n {\n $represent = $this->getRepresent();\n\n return $represent->can('delete')\n && $represent->exists($this->route('id'));\n }", "protected function canDelete($record)\n\t{\n\t\tif(!empty($record->id))\n\t\t{\n\t\t return Factory::getUser()->authorise(\n\t\t\t\t\"core.delete\",\n\t\t\t\t\"com_dinning_philosophers.dinning_philosophers.\".$record->id\n\t\t\t);\n\t\t}\n\t}", "protected function canDelete($record) { return false; }", "public function deleteGroup(GroupInterface $group, bool $soft = true): bool;", "public function delete(User $user): bool\n {\n return $user->can('Delete Role');\n }", "public function canDelete($record = null)\n\t{\n\t\t$record = $record ?: $this->_record;\n\t\t$user = JFactory::getUser();\n\n\t\treturn $record->id < 7\n\t\t\t?\tfalse\n\t\t\t: $user->authorise('flexicontent.deletefield', 'com_flexicontent.field.' . $record->id);\n\t}", "public function canDelete(File $file)\n {\n return $this->checkFrontendUserPermissionsFile('userGroupAllowDeleteFiles', $file);\n }", "protected function canDelete()\n {\n if (!Validate::isLoadedObject($this)) {\n return true;\n }\n\n /** @var Gamifications $module */\n $module = Module::getInstanceByName('gamifications');\n $em = $module->getEntityManager();\n\n /** @var GamificationsRewardRepository $rewardRepository */\n $rewardRepository = $em->getRepository(__CLASS__);\n $isInUse = $rewardRepository->isRewardInUse($this->id);\n\n return !$isInUse;\n }", "function delete_member_group_conf()\n {\n // ------------------------------------\n // Only super admins can delete member groups\n // ------------------------------------\n\n if (Session::userdata('group_id') != 1)\n {\n return Cp::unauthorizedAccess(__('members.only_superadmins_can_admin_groups'));\n }\n\n\n if ( ! $group_id = Request::input('group_id'))\n {\n return false;\n }\n\n // You can't delete these groups\n\n if (in_array($group_id, $this->no_delete))\n {\n return Cp::unauthorizedAccess();\n }\n\n // Are there any members that are assigned to this group?\n $count = DB::table('members')\n ->where('group_id', $group_id)\n ->count();\n\n $members_exist = (!empty($count)) ? true : false;\n\n $group_name = DB::table('member_groups')\n ->where('group_id', $group_id)\n ->value('group_name');\n\n Cp::$title = __('members.delete_member_group');\n\n Cp::$crumb = Cp::anchor(BASE.'?C=Administration'.AMP.'area=members_and_groups', __('admin.members_and_groups')).\n Cp::breadcrumbItem(Cp::anchor(BASE.'?C=Administration'.AMP.'M=members'.AMP.'P=group_manager', __('admin.member_groups'))).\n Cp::breadcrumbItem(__('members.delete_member_group'));\n\n\n Cp::$body = Cp::formOpen(array('action' => 'C=Administration'.AMP.'M=members'.AMP.'P=delete_mbr_group'.AMP.'group_id='.$group_id))\n .Cp::input_hidden('group_id', $group_id);\n\n Cp::$body .= ($members_exist === TRUE) ? Cp::input_hidden('reassign', 'y') : Cp::input_hidden('reassign', 'n');\n\n\n Cp::$body .= Cp::heading(Cp::quickSpan('alert', __('members.delete_member_group')))\n .Cp::div('box')\n .Cp::quickDiv('littlePadding', '<b>'.__('members.delete_member_group_confirm').'</b>')\n .Cp::quickDiv('littlePadding', '<i>'.$group_name.'</i>')\n .Cp::quickDiv('alert', BR.__('members.cp.action_can_not_be_undone').BR.BR);\n\n if ($members_exist === TRUE)\n {\n Cp::$body .= Cp::quickDiv('defaultBold', str_replace('%x', $count, __('members.member_assignment_warning')));\n\n Cp::$body .= Cp::div('littlePadding');\n Cp::$body .= Cp::input_select_header('new_group_id');\n\n $query = DB::table('member_groups')\n ->select('group_name', 'group_id')\n ->orderBy('group_name')\n ->get();\n\n foreach ($query as $row)\n {\n Cp::$body .= Cp::input_select_option($row->group_id, $row->group_name, '');\n }\n\n Cp::$body .= Cp::input_select_footer();\n Cp::$body .= '</div>'.PHP_EOL;\n }\n\n Cp::$body .= Cp::quickDiv('littlePadding', Cp::input_submit(__('cp.delete')))\n .'</div>'.PHP_EOL\n .'</form>'.PHP_EOL;\n }", "function checkActionPermissionGroup($permittedGroups) {\n if (is_array($permittedGroups) && count($permittedGroups) > 0) {\n foreach ($permittedGroups as $groupId => $allowed) {\n if ($allowed && $groupId == -2) {\n return TRUE;\n } elseif ($allowed && $this->authUser->inGroup($groupId)) {\n return TRUE;\n }\n }\n }\n return FALSE;\n }", "public function deleteResourceGroup(string $groupName): bool;", "public function canDelete()\n {\n if ( null === $this->_canDelete )\n {\n $model = new Application_Model_AudioJobMapper();\n $results = $model->fetchAll( 'service_id = ' . $this->id );\n $this->_canDelete = !(bool) count( $results );\n }\n return $this->_canDelete;\n }", "public function is_allowed_to_delete_feedback($feedback);", "public function batch_items_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "public function userCanSubmit() {\n\t\tglobal $content_isAdmin;\n\t\tif (!is_object(icms::$user)) return false;\n\t\tif ($content_isAdmin) return true;\n\t\t$user_groups = icms::$user->getGroups();\n\t\t$module = icms::handler(\"icms_module\")->getByDirname(basename(dirname(dirname(__FILE__))), TRUE);\n\t\treturn count(array_intersect($module->config['poster_groups'], $user_groups)) > 0;\n\t}", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webkul_Marketplace::product');\n }", "public function isAllowed()\n {\n $result = new \\Magento\\FrameWork\\DataObject(['is_allowed' => true]);\n $this->_eventManager->dispatch(\n 'ves_vendor_menu_check_acl',\n [\n 'resource' => $this->_resource,\n 'result' => $result\n ]\n );\n $permission = new \\Vnecoms\\Vendors\\Model\\AclResult();\n $this->_eventManager->dispatch(\n 'ves_vendor_check_acl',\n [\n 'resource' => $this->_resource,\n 'permission' => $permission\n ]\n );\n return $result->getIsAllowed() && $permission->isAllowed();\n }", "protected function canDelete($record)\n\t{\n\t\t$user = JFactory::getUser();\n\n\t\tif (JFactory::getApplication()->isAdmin())\n\t\t{\n\t\t\treturn $user->authorise('core.delete', 'com_solidres.tariff.'.(int) $record->id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$tableRoomType = $this->getTable('RoomType');\n\t\t\t$tableRoomType->load($record->room_type_id);\n\t\t\treturn SRUtilities::isAssetPartner($user->get('id'), $tableRoomType->reservation_asset_id);\n\t\t}\n\t}", "public function delete(User $user)\n {\n return $user->role->can_delete_post == 1;\n }", "function userCanDeleteContact( $sessionID, $contactID ) {\r\n\t\treturn $this->getAccessLevel() > 9;\r\n\t}", "public function beforeDelete()\n {\n if($this->group_id == 0)\n return true;\n\n $total = RoleManager::for($this->group->code)->countRoles();\n $myOrder = $this->sort_order;\n\n if($myOrder === $total)\n return true;\n\n $roles = RoleManager::for($this->group->code)->getSortedGroupRoles();\n\n $difference = $total - $myOrder;\n\n for($i = 0; $i < $difference; $i++)\n {\n $role = $roles[$total - $i];\n $role->sort_order = $total - $i - 1;\n $role->save();\n }\n\n }", "public function delete(User $user)\n {\n return $user->can('delete_customer');\n }", "public function delete(User $user, Formation $formation)\n {\n return $user->hasPermission('delete-organization-formation');\n }", "public function testDeleteExistGroup()\n {\n $user = $this->getAdmin();\n $response = $this->actingAs($user)->post('/group-setting/delete', [\n 'group_id' => 3,\n ]);\n $response->assertSessionHasNoErrors();\n }", "function delete($group_id) {\n\t\tglobal $fmdb, $__FM_CONFIG;\n\t\t\n\t\t/** Does the group_id exist for this account? */\n\t\tbasicGet('fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'groups', $group_id, 'group_', 'group_id');\n\t\tif ($fmdb->num_rows) {\n\t\t\t/** Is the group_id present in a policy? */\n\t\t\tif (isItemInPolicy($group_id, 'group')) return _('This group could not be deleted because it is associated with one or more policies.');\n\t\t\t\n\t\t\t/** Delete group */\n\t\t\t$tmp_name = getNameFromID($group_id, 'fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'groups', 'group_', 'group_id', 'group_name');\n\t\t\tif (updateStatus('fm_' . $__FM_CONFIG[$_SESSION['module']]['prefix'] . 'groups', $group_id, 'group_', 'deleted', 'group_id')) {\n\t\t\t\taddLogEntry(\"Deleted group '$tmp_name'.\");\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn formatError(_('This group could not be deleted.'), 'sql');\n\t}", "function isAuthorized() {\n $roles = $this->Role->calculateCMRoles(); // What was authenticated\n \n // Store the group ID in the controller object since performRedirect may need it\n \n if(($this->action == 'add' || $this->action == 'updateGroup')\n && isset($this->request->data['CoGroupMember']['co_group_id']))\n $this->gid = filter_var($this->request->data['CoGroupMember']['co_group_id'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_BACKTICK);\n elseif(($this->action == 'delete' || $this->action == 'edit' || $this->action == 'view')\n && isset($this->request->params['pass'][0]))\n $this->gid = $this->CoGroupMember->field('co_group_id', array('CoGroupMember.id' => $this->request->params['pass'][0]));\n elseif($this->action == 'select' && isset($this->request->params['named']['cogroup']))\n $this->gid = filter_var($this->request->params['named']['cogroup'], FILTER_SANITIZE_STRING, FILTER_FLAG_STRIP_HIGH | FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_BACKTICK);\n \n $managed = false;\n $owner = false;\n $member = false;\n \n if(!empty($roles['copersonid']) && isset($this->gid)) {\n $managed = $this->Role->isGroupManager($roles['copersonid'], $this->gid);\n \n $gm = $this->CoGroupMember->find('all', array('conditions' =>\n array('CoGroupMember.co_group_id' => $this->gid,\n 'CoGroupMember.co_person_id' => $roles['copersonid'])));\n \n if(isset($gm[0]['CoGroupMember']['owner']) && $gm[0]['CoGroupMember']['owner'])\n $owner = true;\n \n if(isset($gm[0]['CoGroupMember']['member']) && $gm[0]['CoGroupMember']['member'])\n $member = true;\n }\n \n // Is this specified group read only?\n $readOnly = ($this->gid ? $this->CoGroupMember->CoGroup->readOnly($this->gid) : false);\n \n // Construct the permission set for this user, which will also be passed to the view.\n $p = array();\n \n // Add a new member to a group?\n // XXX probably need to check if group is open here and in delete\n $p['add'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // Delete a member from a group?\n $p['delete'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // Edit members of a group?\n $p['edit'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // View a list of members of a group?\n // This is for REST\n $p['index'] = ($this->request->is('restful') && ($roles['cmadmin'] || $roles['coadmin']));\n \n // Select from a list of potential members to add?\n $p['select'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // Update accepts a CO Person's worth of potential group memberships and performs the appropriate updates\n $p['update'] = !$readOnly && ($roles['cmadmin'] || $roles['comember']);\n \n // Select from a list of potential members to add?\n $p['updateGroup'] = !$readOnly && ($roles['cmadmin'] || $managed);\n \n // View members of a group?\n $p['view'] = ($roles['cmadmin'] || $managed || $member);\n \n $this->set('permissions', $p);\n return $p[$this->action];\n }", "public function delete(User $user, OrderProduct $orderProduct)\n {\n return $user->isAdmin() || $user->is($orderProduct->coupon->user);\n }", "public function canDelete($member = null) {\n\t\treturn Permission::check('CMS_ACCESS_CMSMain');\n\t}", "public function delete(User $user, ProductCategory $productCategory)\n {\n if ($user->hasPermissionTo('delete crm product categories')) {\n return true;\n }\n }" ]
[ "0.71113217", "0.704864", "0.69743294", "0.6826736", "0.6806197", "0.67630637", "0.6749133", "0.6731334", "0.67216104", "0.6687712", "0.66781664", "0.6665586", "0.66583085", "0.6583698", "0.6568247", "0.6564295", "0.65443325", "0.6534243", "0.65043753", "0.64999604", "0.6455782", "0.64407307", "0.6419092", "0.64125246", "0.6409952", "0.63910437", "0.6346342", "0.63213384", "0.6313794", "0.63059354", "0.6299184", "0.6296972", "0.62901616", "0.627686", "0.6274294", "0.62733537", "0.6257821", "0.6214308", "0.62108177", "0.6201488", "0.6168691", "0.6165472", "0.6150666", "0.61506283", "0.6149628", "0.61487734", "0.61470175", "0.61210406", "0.612053", "0.61046314", "0.6082808", "0.60758036", "0.6074947", "0.60638183", "0.60636616", "0.6056739", "0.6050737", "0.6038639", "0.6037025", "0.603647", "0.6031304", "0.6020164", "0.60157907", "0.60136956", "0.6013086", "0.60093653", "0.6004258", "0.5992214", "0.599031", "0.5985662", "0.5983806", "0.5980893", "0.59804475", "0.59791857", "0.59779114", "0.5970154", "0.59552276", "0.59438884", "0.59435403", "0.5943144", "0.5937244", "0.59230924", "0.5920241", "0.59140563", "0.59023595", "0.58993894", "0.5891706", "0.5888341", "0.5882451", "0.58768356", "0.5874063", "0.58708596", "0.586679", "0.58638966", "0.58632433", "0.58527285", "0.58524054", "0.5851737", "0.58452183", "0.58348614" ]
0.7219402
0
Determine whether the user can restore the product group.
public function restore(User $user, ProductGroup $productGroup) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function can_restore() {\n return isset( $_POST[ self::NAME ] ) &&\n $_POST[ self::NAME ] === 'restore' &&\n $this->backupFileExists() &&\n current_user_can( 'manage_options' );\n\n }", "public function restore(User $user, Product $product)\n {\n return $user->isManager() || $user->isAdmin();\n }", "public function restore(User $user): bool\n {\n return $user->can('Restore Role');\n }", "public function restore(User $user, Product $checkoutProduct)\n {\n if ($user->is_admin) {\n return true;\n }\n\n return false;\n }", "public function restore_announcement_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "public function restore(User $user, Module $module)\n {\n return $user->hasPermission('restore-moui-module');\n }", "public function restore(User $user, ProductCategory $productCategory)\n {\n if ($user->hasPermissionTo('delete crm product categories')) {\n return true;\n }\n }", "public function restore(User $user, Product $product)\n {\n return $user->client_id === $product->client_id;\n }", "protected function _isAllowed()\r\n {\r\n return Mage::getSingleton('admin/session')->isAllowed('catalog/productsupdater');\r\n }", "public function restore(User $user, Formation $formation)\n {\n return $user->hasPermission('restore-organization-formation');\n }", "protected function _isAllowed()\r\n {\r\n return Mage::getSingleton('admin/session')->isAllowed('system/thetailor_workgroup_workflow');\r\n }", "public function checkAllowed() {\r\n\t\t// if option is not active return true!\r\n\t\tif (Mage::getStoreConfig('b2bprofessional/generalsettings/activecustomers')) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t$iUserStoreId\t\t= Mage::getSingleton('customer/session')->getCustomer()->getStore()->getGroupID();\r\n\t\t$iCurrentStoreId\t= Mage::app()->getStore()->getGroupID();\r\n\r\n\t\tif ($iUserStoreId == $iCurrentStoreId) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public function restore($user, $model)\n {\n\n if( $user->hasPermissionTo('restore ' . static::$key) ) {\n return true;\n }\n\n return false;\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webkul_Marketplace::product');\n }", "public function restore(User $user, Composition $composition)\n {\n return $user->hasPermission('restore-organization-composition');\n }", "public function checkAccess() {\n\t\t$conf = $GLOBALS['BE_USER']->getTSConfig('backendToolbarItem.tx_newsspaper_role.disabled');\n\t\treturn ($conf['value'] == 1 ? false : true);\n\t}", "public function restore(User $user, User $model): bool\n {\n return $user->isRole('admin') || (\n $user->is($model) &&\n $user->tokenCan('users:restore')\n );\n }", "public function RoleCheck($Product){\n if(!Gdn::Session()->IsValid())\n return FALSE;\n $User = Gdn::Session()->User;\n $Meta = Gdn_Format::Unserialize($Product->Meta);\n $Role = $Meta['Role'];\n $RoleModel = new RoleModel();\n $AllRoles =$RoleModel ->GetArray();\n $RoleID=array_search($Role,$AllRoles);\n $UserModel = new UserModel();\n $Roles=array();\n $UserRoles = $UserModel->GetRoles($User->UserID)->Result();\n foreach ($UserRoles As $RoleI)\n $Roles[]=$RoleI['RoleID'];\n $PremiumRoles = UserModel::GetMeta($User->UserID,'PremiumRoles.%','PremiumRoles.');\n if(GetValue('PremiumRole',$User))\n $PremiumRoles[$User->PremiumRole]=$User->PremiumExpire;\n $ActiveRoles=array();\n \n foreach($PremiumRoles As $RoleExpireID=>$RoleExpire){ \n if($RoleExpire==-1) continue;\n $Roles[]=$RoleExpireID;\n }\n \n if(in_array($RoleID,$Roles))\n return TRUE;\n else\n return FALSE;\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('sales/order');\n }", "protected function _isAllowed() {\r\n return Mage::getSingleton('admin/session')->isAllowed('sales/bookme/reseauchx_reservationreseau/siege');\r\n }", "public function restore(User $user, Role $role)\n {\n return $user->hasPermission('restore-moui-role');\n }", "public function restore(User $user, Order $order)\n {\n return $user->hasPermission('order.restore');\n }", "protected function _isAllowed()\r\n\t{\r\n\t\treturn Mage::getSingleton('admin/session')->isAllowed('system/tools/modulesmanager');\r\n\t}", "protected function _isAllowed()\n\t{\n\t\treturn Mage::getSingleton('admin/session')->isAllowed('dropship360/inventory');\n\t}", "public function restore(User $user, Appoientment $appoientment)\n {\n return $user->type == User::ADMIN_TYPE;\n }", "public function isCaptureAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/capture');\n }", "public function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('shopgate_menu/manage');\n }", "public function beforeSave()\n {\n //Cannot edit role id == 1 because Supper Administrator access all permission\n $auth = Users::getCurrentUser();\n if ($this->is_super_admin == 1 && $auth['is_super_admin'] != 1) {\n return false;\n }\n return true;\n }", "protected function validate() {\n\t\tif (!$this->user->hasPermission('modify', 'module/basket_capture')) {\n\t\t\t$this->error['warning'] = $this->language->get('error_permission');\n\t\t}\n\t\t\n\t\tif (!$this->error) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\t\n\t}", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Magestore_InventorySuccess::adjuststock');\n }", "public function customerGroupCheck()\r\n {\r\n if (Mage::app()->getStore()->isAdmin())\r\n $customer = Mage::getSingleton('adminhtml/session_quote')->getCustomer();\r\n else\r\n $customer = Mage::getSingleton('customer/session')->getCustomer();\r\n $customer_group = $customer->getGroupId();\r\n $group = Mage::getStoreConfig('customercredit/general/assign_credit');\r\n $group = explode(',', $group);\r\n if (in_array($customer_group, $group)) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "protected function isRestoring()\n {\n return $this->option('restore') == 'true';\n }", "public function restore(User $user, Show $show): bool\n {\n return $user->isAdmin();\n }", "public function hasAssignedServerGroup() {\n\t\t$q = mysql_safequery('SELECT servergroup FROM tblproducts WHERE id = ?', array($this->id));\n\t\t$row = mysql_fetch_assoc($q);\n\t\treturn isset($row['servergroup']) ? (int) $row['servergroup'] : false;\n\t}", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('sales/order/actions/emag_upload_invoice');\n }", "public function beforeRestore() : bool\n\t{\n\t\treturn true;\n\t}", "public function allowed_group()\n\t{\n\t\t$which = func_get_args();\n\n\t\tif ( ! count($which))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Super Admins always have access\n\t\tif (ee()->session->userdata('group_id') == 1)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tforeach ($which as $w)\n\t\t{\n\t\t\t$k = ee()->session->userdata($w);\n\n\t\t\tif ( ! $k OR $k !== 'y')\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}", "public function restore(User $user, Businesstype $businesstype)\n {\n return $user->role == 'admin';\n }", "public function validateCatalogProductReview()\n {\n $reviewStores = $this->_objectManager->create(\n \\Magento\\Review\\Model\\Review::class\n )->load(\n $this->_request->getParam('id')\n )->getStores();\n\n $storeIds = $this->_role->getStoreIds();\n\n $allowedIds = array_intersect($reviewStores, $storeIds);\n if (empty($allowedIds)) {\n $this->_redirect();\n }\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_kst/ifeedback');\n }", "public function restore(User $user, Echelonmap $echelonmap)\n {\n return $user->hasPermission('restore-reference-echelonmap');\n }", "public function restore(Admin $admin, User $model)\n {\n return $admin->hasAccess(['users.restore']);\n\n }", "public function isAllowed()\n {\n $result = new \\Magento\\FrameWork\\DataObject(['is_allowed' => true]);\n $this->_eventManager->dispatch(\n 'ves_vendor_menu_check_acl',\n [\n 'resource' => $this->_resource,\n 'result' => $result\n ]\n );\n $permission = new \\Vnecoms\\Vendors\\Model\\AclResult();\n $this->_eventManager->dispatch(\n 'ves_vendor_check_acl',\n [\n 'resource' => $this->_resource,\n 'permission' => $permission\n ]\n );\n return $result->getIsAllowed() && $permission->isAllowed();\n }", "public function restore(User $user, User $model)\n {\n return $user->hasPermissionTo('benutzer-bearbeiten');\n }", "public function restore(User $user, User $targetUser)\n {\n return ! $user->hasRole('Banned') &&\n $user->hasPermission('restore', User::class);\n }", "protected function _isAllowed()\n\t{\n\t\treturn (Mage::getSingleton('admin/session')->isAllowed('dropship360/suppliers') || Mage::getSingleton('admin/session')->isAllowed('dropship360/vendor_ranking'));\n\t}", "public function authorize()\n {\n return auth()->user()->can('create-product-packages');\n }", "public function restore(User $user, Itms $itms)\n {\n return $user->isAdmin;\n }", "public function useItemgroupAsPricegroup() {\n\t\treturn $this->default_pricegroup_itemgroup == self::VALUE_TRUE;\n\t}", "public function restore(User $user)\n {\n return config('mailcare.auth') && config('mailcare.automations');\n }", "public function restore(User $user, Operation $operation)\n {\n return Auth::id()->isAdmin();\n }", "public function restore(User $user, Interview $interview)\n {\n return $user->hasPermissionTo('restore interview');\n }", "protected function isPowerUser()\n {\n return $this->user->can('sys_properties_edit', $this->app->modules[$this->area]);\n }", "public function restore(Provider $provider)\n {\n\t if (Auth::guard('provider-web')->user()->id == $provider->id) return true;\n\t return false;\n }", "public function restore(User $user, Experience $experience)\n {\n return true;\n }", "private function userHasAccess()\n {\n $required_perm = $this->route['perm'];\n $user_group = $_SESSION['user_group'];\n if ($required_perm == 'all') {\n return true;\n } elseif ($user_group == $required_perm) {\n return true;\n }\n return false;\n }", "function AdminSecurityCheck(){\n\t\t$User = new User();\n\t\t$user = $this->session->userdata('Group');\n\t\tif ($user){\n\t\t\tif($user == 1){\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\treturn false;\n\t\t}\n\t}", "public function authorize()\n {\n return $this->groupHasUser() || $this->hasSeller();\n }", "public function usePricegroup() {\n\t\treturn $this->use_pricegroup == self::VALUE_TRUE;\n\t}", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_material/bs_handover/handovertwo');\n }", "public function beforeDelete()\n {\n if($this->group_id == 0)\n return true;\n\n $total = RoleManager::for($this->group->code)->countRoles();\n $myOrder = $this->sort_order;\n\n if($myOrder === $total)\n return true;\n\n $roles = RoleManager::for($this->group->code)->getSortedGroupRoles();\n\n $difference = $total - $myOrder;\n\n for($i = 0; $i < $difference; $i++)\n {\n $role = $roles[$total - $i];\n $role->sort_order = $total - $i - 1;\n $role->save();\n }\n\n }", "public function restore(User $user, Approval $resource)\n {\n return false;\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_traininglist/traineecert');\n }", "public function getCheckStockLevels(): bool\n\t{\n\t\t$parentId = \\Api\\Portal\\Privilege::USER_PERMISSIONS !== $this->getPermissionType() ? $this->getParentCrmId() : 0;\n\t\treturn empty($parentId) || (bool) \\Vtiger_Record_Model::getInstanceById($parentId)->get('check_stock_levels');\n\t}", "public function restore(User $user)\n {\n return $user->idquyenhan == 2;\n }", "public function allowedToViewStore($usergroup)\n {\n $app = \\XF::app();\n\n $excludedUsergroups = $app->options()->rexshop_excluded_usergroups;\n if (!empty($excludedUsergroups)) {\n $usergroups = explode(',', ltrim(rtrim(trim($excludedUsergroups, ' '), ','), ','));\n\n return !in_array((int) $usergroup, $usergroups);\n }\n\n return true;\n }", "public function batch_items_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('drugento_countryorder/country');\n }", "public function canCreateSitegroups() {\n $viewer = Engine_Api::_()->user()->getViewer();\n if (!$viewer || !$viewer->getIdentity()) {\n return false;\n }\n\n // Must be able to view Sitegroups\n if (!Engine_Api::_()->authorization()->isAllowed('sitegroup_group', $viewer, 'view')) {\n return false;\n }\n\n // Must be able to create Sitegroups\n if (!Engine_Api::_()->authorization()->isAllowed('sitegroup_group', $viewer, 'create')) {\n return false;\n }\n return true;\n }", "public function isAvailable()\n\t{\n\t\tif ($this->isLocked())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\tif (BE_USER_LOGGED_IN !== true && !$this->isPublished())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Show to guests only\n\t\tif ($this->arrData['guests'] && FE_USER_LOGGED_IN === true && BE_USER_LOGGED_IN !== true && !$this->arrData['protected'])\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t// Protected product\n\t\tif (BE_USER_LOGGED_IN !== true && $this->arrData['protected'])\n\t\t{\n\t\t\tif (FE_USER_LOGGED_IN !== true)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$groups = deserialize($this->arrData['groups']);\n\n\t\t\tif (!is_array($groups) || empty($groups) || !count(array_intersect($groups, $this->User->groups)))\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\t// Check if \"advanced price\" is available\n\t\tif ($this->arrData['price'] === null && (in_array('price', $this->arrAttributes) || in_array('price', $this->arrVariantAttributes)))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function restore(User $user, Store $store)\n {\n $admin_role = Roles::where('role_name', 'admin')->firstOrFail();\n return $user->role_id === $admin_role->id;\n }", "public function restore(User $user, Document $document)\n {\n if ($user->isStaff()) {\n return true;\n }else {\n return $user->id === $document->user_id;\n }\n }", "public function restore(User $user, Employee $employee)\n {\n return $user->role == 'admin';\n }", "public function isUserOrGroupSet() {}", "public function authorize()\n {\n return auth()->user()->can('store', [Product::class]);\n }", "public function canUpload()\n {\n return $this->checkFrontendUserPermissionsGeneric('userGroupAllowUpload');\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_logistics/equipment');\n }", "public function restore(User $user, Sale $model)\n {\n return false;\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_kst/kstitem');\n }", "public function getCanUpgradeEdition(): bool\n {\n /** @var WebApplication|ConsoleApplication $this */\n // Only admin accounts can upgrade Craft\n if (\n $this->getUser()->getIsAdmin() &&\n Craft::$app->getConfig()->getGeneral()->allowAdminChanges\n ) {\n // Are they either *using* or *licensed to use* something < Craft Pro?\n $activeEdition = $this->getEdition();\n $licensedEdition = $this->getLicensedEdition();\n\n return (\n ($activeEdition < Craft::Pro) ||\n ($licensedEdition !== null && $licensedEdition < Craft::Pro)\n );\n }\n\n return false;\n }", "public function isSellerReviewEnabled() {\n return $this->scopeConfig->getValue ( static::XML_SELLER_REVIEW, ScopeInterface::SCOPE_STORE );\n }", "public function canManageBackup();", "public function restore(User $user, File $file)\n {\n return Permission::anyoneCanAccess($file->id)\n || Permission::userCanAccess($user->id, $file->id, \"write\");\n }", "public function restore(User $user, Group $group)\n {\n //\n }", "public function authorize()\n {\n $company_id = auth()->user()->cmpny_id;\n $group_id = request()->post('id');\n $group = Group::find($group_id);\n if ($group_id && (!isset($group->id) || empty($group->id)))\n {\n return false;\n }\n if (!empty($group->id) && ($company_id != $group->cmpny_id))\n {\n return false;\n }\n\n return true;\n }", "function checkActionPermissionGroup($permittedGroups) {\n if (is_array($permittedGroups) && count($permittedGroups) > 0) {\n foreach ($permittedGroups as $groupId => $allowed) {\n if ($allowed && $groupId == -2) {\n return TRUE;\n } elseif ($allowed && $this->authUser->inGroup($groupId)) {\n return TRUE;\n }\n }\n }\n return FALSE;\n }", "private function validateGroup(){\n\n\t global $db;\n\t \n\t #see if this is a guest, if so, do some hard-coded checks.\n\t\tif($this->user == \"guest\"){\n\t\t if(($this->user == \"guest\") and ($this->gid == 0)){\n\t\t return(true);\n\t\t }else{\n\t\t return(false);\n\t\t }\n\t\t}else{\n\t\t\t$db->SQL = \"SELECT id FROM ebb_groups WHERE id='\".$this->gid.\"' LIMIT 1\";\n\t\t\t$validateGroup = $db->affectedRows();\n\n\t\t\tif($validateGroup == 1){\n\t\t\t return (true);\n\t\t\t}else{\n\t\t\t return(false);\n\t\t\t}\n\t\t}\n\t}", "private function validate()\r\n {\r\n if (!$this->user->hasPermission('modify', 'module/promotion')) {\r\n $this->error['warning'] = $this->language->get('error_permission');\r\n }\r\n\r\n if (!$this->error) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "public function isRole(){\n $r=Cache::get('role');\n if ((int)$r ==2)\n {\n return true;\n }\n else\n return false;\n }", "public function setProductGroup(?string $productGroup): bool\n {\n try {\n $this->productGroup = $productGroup === null ?\n null : static::valTextMandMaxCar($productGroup, 50, __METHOD__);\n $return = true;\n } catch (AuditFileException $e) {\n $this->productGroup = $productGroup;\n \\Logger::getLogger(\\get_class($this))\n ->error(\\sprintf(__METHOD__.\" '%s'\", $e->getMessage()));\n $this->getErrorRegistor()->addOnSetValue(\"ProductGroup_not_valid\");\n $return = false;\n }\n \\Logger::getLogger(\\get_class($this))\n ->debug(\n \\sprintf(\n __METHOD__.\" set to '%s'\",\n $this->productGroup === null ? \"null\" : $this->productGroup\n )\n );\n return $return;\n }", "protected function onRestored()\n {\n return true;\n }", "public function isGroup(){\n\t\t\n\t\t$this->validateInited();\n\t\t\n\t\t$arrChildren = UniteFunctionsWPUC::getPostChildren($this->post);\n\t\t\t\t\n\t\tif(!empty($arrChildren))\n\t\t\treturn(true);\n\t\t\n\t\treturn(false);\n\t}", "public function canPersonalize($product)\n {\n //var_dump($product->getData());\n \n return (bool)$product->getData('personalization_allowed');\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('bs_material/curriculumdoc');\n }", "protected function _isAllowed()\n {\n return Mage::getSingleton('admin/session')->isAllowed('sales/enterprise_rma_rma_statistics');\n }", "public function isSellerSubscriptionEnabled() {\n return $this->scopeConfig->getValue ( static::XML_SUBSCRIPTION_REVIEW, ScopeInterface::SCOPE_STORE );\n }", "public function hasValidResetKey()\n {\n return (boolean) $this->isActive() && $this->_getVar('user_resetkey_valid');\n }", "public function testRestoreDenyNotAdmin() {\n\t\t$this->setExpectedException('MissingActionException');\n\t\t$userRoles = [\n\t\t\tUSER_ROLE_USER => '',\n\t\t\tUSER_ROLE_USER | USER_ROLE_SECRETARY => 'secret',\n\t\t\tUSER_ROLE_USER | USER_ROLE_HUMAN_RESOURCES => 'hr',\n\t\t];\n\t\t$opt = [\n\t\t\t'method' => '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' => 'logs',\n\t\t\t\t'action' => 'restore',\n\t\t\t\t'1',\n\t\t\t];\n\t\t\tif (!empty($userPrefix)) {\n\t\t\t\t$url['prefix'] = $userPrefix;\n\t\t\t\t$url[$userPrefix] = true;\n\t\t\t}\n\t\t\t$this->testAction($url, $opt);\n\t\t\t$this->checkIsNotAuthorized();\n\t\t\t$this->checkRedirect(true);\n\t\t}\n\t}", "public function restoreById(int $UserId): bool;", "function storage_can_set($sv_user) {\n $allowed = ((api_is_platform_admin()) || ($sv_user == api_get_user_id()));\n if (!$allowed) {\n print \"ERROR : Not allowed\";\n }\n return $allowed;\n}" ]
[ "0.7147868", "0.6492184", "0.6388986", "0.61313254", "0.6069312", "0.5972378", "0.58514506", "0.58511513", "0.5844963", "0.582242", "0.57678354", "0.576732", "0.5765604", "0.56041294", "0.55874795", "0.5586868", "0.55495775", "0.55468374", "0.55321556", "0.5520661", "0.5509116", "0.5485986", "0.5452539", "0.5451447", "0.5427965", "0.541524", "0.5409927", "0.54030097", "0.54024035", "0.538526", "0.5363216", "0.53437823", "0.53382087", "0.53323334", "0.5331135", "0.5327962", "0.53250283", "0.53214467", "0.531624", "0.5301397", "0.5295648", "0.5294114", "0.5293931", "0.52839136", "0.52729535", "0.52684075", "0.52637106", "0.5258667", "0.5255439", "0.52464527", "0.52447444", "0.5242528", "0.5240453", "0.5233156", "0.5227787", "0.5224493", "0.52054906", "0.5196971", "0.5194849", "0.519282", "0.5189554", "0.51790047", "0.5172089", "0.5168022", "0.5162365", "0.5156569", "0.5150903", "0.5149866", "0.5146129", "0.5144749", "0.5141163", "0.5138136", "0.51373667", "0.5135949", "0.5132429", "0.51307464", "0.51063883", "0.509838", "0.50976855", "0.50888056", "0.50848615", "0.5083728", "0.5081807", "0.5072909", "0.50712854", "0.5066895", "0.5066283", "0.5055605", "0.5049763", "0.50452775", "0.50451976", "0.5044882", "0.50350636", "0.5034737", "0.5031157", "0.50289285", "0.50255924", "0.5023235", "0.5022855", "0.5021598" ]
0.58917135
6
Determine whether the user can permanently delete the product group.
public function forceDelete(User $user, ProductGroup $productGroup) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete(User $user, ProductGroup $productGroup)\n {\n if( $user->hasPermissions(['group_remove'])) {\n return true;\n } else {\n return $user->hasPermissions(['group_remove_self'], $productGroup);\n }\n }", "public function can_delete () {\r\n\r\n return $this->permissions[\"D\"] ? true : false;\r\n\r\n }", "public function canDelete()\n {\n $user = $this->getUser();\n\n if ($user->getData('role') == 'Admin' && $this->getData('status') != Service\\BalanceWithdrawals::STATUS_PENDING) {\n return true;\n }\n\n return false;\n }", "public function canDelete()\n {\n $exist = $this->getModelObj('permission')->where(['resource_code' => $this->code, 'app' => $this->app])->first();\n if ($exist) {\n return false;\n }\n return true;\n }", "function delete()\r\n {\r\n $wdm = WeblcmsDataManager :: get_instance();\r\n $success = $wdm->delete_course_user_group_relation($this);\r\n if (! $success)\r\n {\r\n return false;\r\n }\r\n\r\n return true;\r\n }", "private function canDelete()\n {\n //Checks roles allowed\n $roles = array(\n 'ROLE_MANAGER',\n 'ROLE_ADMIN',\n );\n\n foreach ($roles as $role) {\n if ($this->security->isGranted($role)) {\n return true;\n }\n }\n\n return false;\n }", "function canDelete() {\n return true;\n }", "public function delete()\n {\n // Check P_DELETE\n if (!wcmSession::getInstance()->isAllowed($this, wcmPermission::P_DELETE))\n {\n $this->lastErrorMsg = _INSUFFICIENT_PRIVILEGES;\n return false;\n }\n\n if (!parent::delete())\n return false;\n \n // Erase permissions\n $project = wcmProject::getInstance();\n $sql = 'DELETE FROM #__permission WHERE target=?';\n $params = array($this->getPermissionTarget());\n $project->database->executeStatement($sql, $params);\n \n return true;\n\n }", "public function delete(): bool\n {\n return $this->isAllowed(self::DELETE);\n }", "function permissions_delete()\n{\n // Deletion not allowed\n return false;\n}", "function CanDelete()\n\t{\treturn !count($this->subpages) && $this->CanAdminUserDelete();\n\t}", "function canDelete($user) {\n if($this->getId() == $user->getId()) {\n return false; // user cannot delete himself\n } // if\n\n if($this->isAdministrator() && !$user->isAdministrator()) {\n return false; // only administrators can delete administrators\n } // if\n\n return $user->isPeopleManager();\n }", "public function isDeletable() {\n\t\t$sql = \"SELECT COUNT(*) AS members FROM wcf\".WCF_N.\"_user_to_group_premium WHERE premiumGroupID = ?\"; \n\t\t$statement = WCF::getDB()->prepareStatement($sql);\n\t\t$statement->execute(array($this->premiumGroupID));\n\t\t$row = $statement->fetchArray();\n\t\t\n\t\treturn ($row['members'] > 0) ? false : true; \n\t}", "private function can_remove() {\n return isset( $_POST[ self::NAME ] ) &&\n $_POST[ self::NAME ] === 'remove' &&\n $this->backupFileExists() &&\n current_user_can( 'manage_options' );\n\n }", "public function canDelete()\n {\n return 1;\n }", "public function canDelete()\n\t{\n\t\tif ( $this->deleteOrMoveQueued() === TRUE )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\tif( static::restrictionCheck( 'delete' ) )\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tif( static::$ownerTypes['member'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['member'];\n\n\t\t\tif( $this->$column == \\IPS\\Member::loggedIn()->member_id )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( static::$ownerTypes['group'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['group']['ids'];\n\n\t\t\t$value = $this->$column;\n\t\t\tif( count( array_intersect( explode( \",\", $value ), \\IPS\\Member::loggedIn()->groups ) ) )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\t}", "public function allowDeletion()\n {\n return $this->allowDeletion;\n }", "public function canDeleteAssociate()\n {\n return $this->settings->MODULES['REW_ISA_MODULE']\n && $this->auth->isSuperAdmin();\n }", "function canDelete(User $user) {\n return $user->isFinancialManager();\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webiators_DeleteOrdersFromAdmin::delete_order');\n }", "public function authorize(): bool\n {\n return Gate::allows('admin.genero.delete', $this->genero);\n }", "function delete($group_id)\n {\n $success = false;\n\n //Run these queries as a transaction, we want to make sure we do all or nothing\n $this->db->trans_start();\n\n //Delete permissions\n if ($this->db->delete('permissions', array('group_id' => $group_id)) && $this->db->delete('permissions_actions', array('group_id' => $group_id))) {\n $this->db->where('group_id', $group_id);\n $success = $this->db->update('groups', array('deleted' => 1));\n }\n $this->db->trans_complete();\n return $success;\n }", "public function canDelete()\n {\n return Auth::user() && ( $this->sender_id === Auth::id() || $this->recipient_id === Auth::id() );\n }", "public function canDelete()\n {\n if ( !SimpleForumTools::checkAccess($this->forumNode(), 'topic', 'remove') )\n {\n \treturn false;\n }\n \t\n return true;\n }", "public function canDelete()\n {\n return $this->canGet();\n }", "public function isDeleteGranted($entity): bool;", "function canDelete(User $user) {\n return $user->canManageTrash();\n }", "public function sure_delete_block(){\r\n\t\tif($this->has_admin_panel()) return $this->module_sure_delete_block();\r\n return $this->module_no_permission();\r\n\t}", "function canDelete($user) {\n if($this->isOwner() || $user->getCompanyId() == $this->getId()) {\n return false; // Owner company cannot be deleted. Also, user cannot delete company he belongs to\n } // if\n return $user->isPeopleManager();\n }", "public function canDelete()\n {\n return in_array('delete', $this->actions);\n }", "protected function hasActiveUserDeletePermissionForThisUser()\n {\n if (true === $this->bAllowEditByAll) {\n return true;\n }\n if (true === $this->IsOwner()) {\n return false;\n }\n /** @var SecurityHelperAccess $securityHelper */\n $securityHelper = ServiceLocator::get(SecurityHelperAccess::class);\n\n if (false === $securityHelper->isGranted(CmsPermissionAttributeConstants::TABLE_EDITOR_DELETE, $this->oTableConf->fieldName)) {\n return false;\n }\n\n if (true === $securityHelper->isGranted(CmsUserRoleConstants::CMS_ADMIN)) {\n return true;\n }\n\n if ($this->sId === $securityHelper->getUser()?->getId()) {\n // you cannot delete yourself.\n return false;\n }\n\n $oTargetUser = TdbCmsUser::GetNewInstance($this->sId);\n\n // Also, the user may only delete users that have at least one portal in common.\n $userPortals = $securityHelper->getUser()?->getPortals();\n if (null === $userPortals) {\n $userPortals = [];\n }\n $allowedPortals = array_keys($userPortals);\n $portalsOfTargetUser = $oTargetUser->GetFieldCmsPortalIdList();\n\n return 0 === \\count($portalsOfTargetUser) ||\n \\count(array_intersect($allowedPortals, $portalsOfTargetUser)) > 0;\n }", "protected function validateDelete() {\r\n\t\t// check permissions\r\n\t\tif (!WCF::getSession()->getPermission('admin.user.canDeleteUser')) {\r\n\t\t\treturn [];\r\n\t\t}\r\n\r\n\t\treturn $this->__validateAccessibleGroups(array_keys($this->objects));\r\n\t}", "public function authorize()\n {\n return $this->can('delete');\n }", "public function delete(User $user, Product $product)\n {\n return $user->isManager() || $user->isAdmin();\n }", "public function isAdmin()\n {\n return $this->group_id === 1;\n }", "public function testAccessDeleteNoPermission()\n {\n $user = \\App\\User::where('permission', 0)->first();\n $response = $this->actingAs($user)->post('/group-setting/delete', [\n 'group_id' => 2,\n ]);\n $response->assertStatus(403);\n }", "public function delete()\n\t{\n\t\t// make sure a user id is set\n\t\tif (empty($this->group['id']))\n\t\t{\n\t\t\tthrow new SentryGroupException(__('sentry::sentry.no_group_selected'));\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\tDB::connection(static::$db_instance)->pdo->beginTransaction();\n\n\t\t\t// delete users groups\n\t\t\t$delete_user_groups = DB::connection(static::$db_instance)\n\t\t\t\t->table(static::$join_table)\n\t\t\t\t->where(static::$group_identifier, '=', $this->group['id'])\n\t\t\t\t->delete();\n\n\t\t\t// delete GROUP\n\t\t\t$delete_user = DB::connection(static::$db_instance)\n\t\t\t\t->table(static::$table)\n\t\t\t\t->where('id', '=', $this->group['id'])\n\t\t\t\t->delete();\n\n\t\t\tDB::connection(static::$db_instance)->pdo->commit();\n\t\t}\n\t\tcatch(\\Database_Exception $e) {\n\n\t\t\tDB::connection(static::$db_instance)->pdo->rollBack();\n\t\t\treturn false;\n\t\t}\n\n\t\t// update user to null\n\t\t$this->group = array();\n\t\treturn true;\n\n\t}", "public function delete(User $user)\n {\n if ($user->can('delete_permission') || $user->can('manage_permissions')) {\n return true;\n }\n\n return false;\n }", "function CanDelete()\n\t{\t\n\t\t\n\t\tif ($this->id && !$this->GetLocations() && $this->CanAdminUserDelete())\n\t\t{\n\t\t\t// courses\n\t\t\t$sql = \"SELECT cid FROM courses WHERE city=\" . (int)$this->id;\n\t\t\tif ($result = $this->db->Query($sql))\n\t\t\t{\tif ($this->db->NumRows($result))\n\t\t\t\t{\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t\t\n\t}", "public function sure_delete_local(){\r\n\t\tif($this->has_admin_panel()) return $this->module_sure_delete_local();\r\n return $this->module_no_permission();\r\n\t}", "public function authorize()\n {\n $this->reusablePayment = FetchReusablePayment::run([\n 'encoded_id' => $this->encoded_id,\n ]);\n\n return $this->user()->can('delete', $this->reusablePayment);\n }", "public function isAdmin()\n {\n $p = User::getUser();\n if($p)\n {\n if($p->canAccess('Edit products') === TRUE)\n {\n return TRUE;\n }\n }\n return FALSE;\n }", "public function canDelete($member = null) {\n\t\treturn ($this->Code == 'DEFAULT') ? false : Permission::check('Product_CANCRUD');\n\t}", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Training_Vendor::main_index_delete');\n }", "public function canDelete()\n {\n $translate = $this->getTranslate();\n\n if ($this->_usedInSales()) {\n return $translate->_('This store location cannot be removed because it is used in an invoice.');\n }\n\n return true;\n }", "public function batch_items_permissions_check() {\n return current_user_can( 'manage_options' );\n }", "public function checkIsValidForDelete() {\n $errors = false;\n if(strlen(trim($this->idGroup)) == 0){\n $errors = \"Group identifier is mandatory\";\n }else if(!preg_match('/^\\d+$/', $this->idGroup)){\n $errors = \"Group identifier format is invalid\";\n }else if($this->existsGroup() !== true) {\n $errors = \"Group doesn't exist\";\n }\n return $errors;\n }", "public function authorize()\n {\n if (env('APP_ENV') == 'testing') {\n return true;\n }\n\n return tenant(auth()->user()->id)->hasPermissionTo('delete fixed asset');\n }", "function checkActionPermissionGroup($permittedGroups) {\n if (is_array($permittedGroups) && count($permittedGroups) > 0) {\n foreach ($permittedGroups as $groupId => $allowed) {\n if ($allowed && $groupId == -2) {\n return TRUE;\n } elseif ($allowed && $this->authUser->inGroup($groupId)) {\n return TRUE;\n }\n }\n }\n return FALSE;\n }", "public function delete()\n {\n // Do not delete children, because they are fake objects\n if (false === $this->parent_target_group && $this->target_group_id > 0) {\n $result = rex_sql::factory();\n\n $query = 'DELETE FROM '. rex::getTablePrefix() .'d2u_courses_target_groups '\n .'WHERE target_group_id = '. $this->target_group_id;\n $result->setQuery($query);\n\n $return = ($result->hasError() ? false : true);\n\n $query = 'DELETE FROM '. rex::getTablePrefix() .'d2u_courses_2_target_groups '\n .'WHERE target_group_id = '. $this->target_group_id;\n $result->setQuery($query);\n\n // reset priorities\n $this->setPriority(true);\n\n // Don't forget to regenerate URL cache\n d2u_addon_backend_helper::generateUrlCache('target_group_id');\n d2u_addon_backend_helper::generateUrlCache('target_group_child_id');\n\n return $return;\n }\n\n return false;\n\n }", "public function canUpload()\n {\n return $this->checkFrontendUserPermissionsGeneric('userGroupAllowUpload');\n }", "public function confirm()\n {\n // Only super admins can delete member groups\n if (! ee('Permission')->can('delete_roles')) {\n show_error(lang('unauthorized_access'), 403);\n }\n\n $roles = ee()->input->post('selection');\n\n $roleModels = ee('Model')->get('Role', $roles)->all();\n $vars['members_count_primary'] = 0;\n $vars['members_count_secondary'] = 0;\n foreach ($roleModels as $role) {\n $vars['members_count_primary'] += $role->getMembersCount('primary');\n $vars['members_count_secondary'] += $role->getMembersCount('secondary');\n }\n\n $vars['new_roles'] = [];\n if (ee('Permission')->can('delete_members')) {\n $vars['new_roles']['delete'] = lang('member_assignment_none');\n }\n $allowed_roles = ee('Model')->get('Role')\n ->fields('role_id', 'name')\n ->filter('role_id', 'NOT IN', array_merge($roles, [1, 2, 3, 4]))\n ->order('name');\n if (! ee('Permission')->isSuperAdmin()) {\n $allowed_roles->filter('is_locked', 'n');\n }\n $vars['new_roles'] += $allowed_roles->all()\n ->getDictionary('role_id', 'name');\n\n ee()->cp->render('members/delete_member_group_conf', $vars);\n }", "public function delete(User $user)\n {\n if($user->can('carts-delete') || $user->can('cart-delete')) {\n return true;\n }\n return false;\n }", "public function deleteGroup() {\n $errors = $this->checkIsValidForDelete();\n if($errors === false){\n $sql = \"DELETE FROM `SM_GROUP` WHERE sm_idGroup ='$this->idGroup'\";\n if (!($resultado = $this->mysqli->query($sql))) {\n return 'Error in the query on the database';\n } else {\n return true;\n }\n }else{\n return $errors;\n }\n }", "function delete_member_group_conf()\n {\n // ------------------------------------\n // Only super admins can delete member groups\n // ------------------------------------\n\n if (Session::userdata('group_id') != 1)\n {\n return Cp::unauthorizedAccess(__('members.only_superadmins_can_admin_groups'));\n }\n\n\n if ( ! $group_id = Request::input('group_id'))\n {\n return false;\n }\n\n // You can't delete these groups\n\n if (in_array($group_id, $this->no_delete))\n {\n return Cp::unauthorizedAccess();\n }\n\n // Are there any members that are assigned to this group?\n $count = DB::table('members')\n ->where('group_id', $group_id)\n ->count();\n\n $members_exist = (!empty($count)) ? true : false;\n\n $group_name = DB::table('member_groups')\n ->where('group_id', $group_id)\n ->value('group_name');\n\n Cp::$title = __('members.delete_member_group');\n\n Cp::$crumb = Cp::anchor(BASE.'?C=Administration'.AMP.'area=members_and_groups', __('admin.members_and_groups')).\n Cp::breadcrumbItem(Cp::anchor(BASE.'?C=Administration'.AMP.'M=members'.AMP.'P=group_manager', __('admin.member_groups'))).\n Cp::breadcrumbItem(__('members.delete_member_group'));\n\n\n Cp::$body = Cp::formOpen(array('action' => 'C=Administration'.AMP.'M=members'.AMP.'P=delete_mbr_group'.AMP.'group_id='.$group_id))\n .Cp::input_hidden('group_id', $group_id);\n\n Cp::$body .= ($members_exist === TRUE) ? Cp::input_hidden('reassign', 'y') : Cp::input_hidden('reassign', 'n');\n\n\n Cp::$body .= Cp::heading(Cp::quickSpan('alert', __('members.delete_member_group')))\n .Cp::div('box')\n .Cp::quickDiv('littlePadding', '<b>'.__('members.delete_member_group_confirm').'</b>')\n .Cp::quickDiv('littlePadding', '<i>'.$group_name.'</i>')\n .Cp::quickDiv('alert', BR.__('members.cp.action_can_not_be_undone').BR.BR);\n\n if ($members_exist === TRUE)\n {\n Cp::$body .= Cp::quickDiv('defaultBold', str_replace('%x', $count, __('members.member_assignment_warning')));\n\n Cp::$body .= Cp::div('littlePadding');\n Cp::$body .= Cp::input_select_header('new_group_id');\n\n $query = DB::table('member_groups')\n ->select('group_name', 'group_id')\n ->orderBy('group_name')\n ->get();\n\n foreach ($query as $row)\n {\n Cp::$body .= Cp::input_select_option($row->group_id, $row->group_name, '');\n }\n\n Cp::$body .= Cp::input_select_footer();\n Cp::$body .= '</div>'.PHP_EOL;\n }\n\n Cp::$body .= Cp::quickDiv('littlePadding', Cp::input_submit(__('cp.delete')))\n .'</div>'.PHP_EOL\n .'</form>'.PHP_EOL;\n }", "public function delete(User $user, Product $product)\n {\n return $user->isAbleTo('product.delete');\n }", "public function delete()\n {\n // Delete the group\n $result = parent::delete();\n\n return $result;\n }", "public function userCanSubmit() {\n\t\tglobal $content_isAdmin;\n\t\tif (!is_object(icms::$user)) return false;\n\t\tif ($content_isAdmin) return true;\n\t\t$user_groups = icms::$user->getGroups();\n\t\t$module = icms::handler(\"icms_module\")->getByDirname(basename(dirname(dirname(__FILE__))), TRUE);\n\t\treturn count(array_intersect($module->config['poster_groups'], $user_groups)) > 0;\n\t}", "public function beforeDelete() {\n // Console doesn't have Yii::$app->user, so we skip it for console\n if (php_sapi_name() != 'cli') {\n // Don't let delete yourself\n if (Yii::$app->user->id == $this->id) {\n return false;\n }\n\n // Don't let non-superadmin delete superadmin\n if (!Yii::$app->user->isSuperadmin AND $this->superadmin == 1) {\n return false;\n }\n }\n\n return parent::beforeDelete();\n }", "public function is_allowed_to_delete_feedback($feedback);", "public function allowed_group()\n\t{\n\t\t$which = func_get_args();\n\n\t\tif ( ! count($which))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Super Admins always have access\n\t\tif (ee()->session->userdata('group_id') == 1)\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tforeach ($which as $w)\n\t\t{\n\t\t\t$k = ee()->session->userdata($w);\n\n\t\t\tif ( ! $k OR $k !== 'y')\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}", "public function canDelete($curMenuset)\n {\n $canDelete = true;\n if ($curMenuset == self::getDefaultMenuset()) {\n $canDelete = false;\n }\n \n return $canDelete;\n }", "public function isAdmin() {\n return (json_decode($this->group->permissions))->admin;\n }", "public function checkAllowed() {\r\n\t\t// if option is not active return true!\r\n\t\tif (Mage::getStoreConfig('b2bprofessional/generalsettings/activecustomers')) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\t$iUserStoreId\t\t= Mage::getSingleton('customer/session')->getCustomer()->getStore()->getGroupID();\r\n\t\t$iCurrentStoreId\t= Mage::app()->getStore()->getGroupID();\r\n\r\n\t\tif ($iUserStoreId == $iCurrentStoreId) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public function deleteGroup(GroupInterface $group, bool $soft = true): bool;", "public function deleteAdmin() {\n\t\t$numRows = $this->db->delete();\n\t\tif($numRows===1) {\n\t\t\treturn TRUE;\n\t\t}\n\t\telse {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "private function userHasAccess()\n {\n $required_perm = $this->route['perm'];\n $user_group = $_SESSION['user_group'];\n if ($required_perm == 'all') {\n return true;\n } elseif ($user_group == $required_perm) {\n return true;\n }\n return false;\n }", "public function testAllowDelete()\n {\n $this->logOut();\n $deleteFalse = LogEntry::create()->canDelete(null);\n $this->assertFalse($deleteFalse);\n\n $this->logInWithPermission('ADMIN');\n $deleteTrue = LogEntry::create()->canDelete();\n $this->assertTrue($deleteTrue);\n }", "protected function canDelete() {\n return $this->canUpdate() &&\n parent::can(PERM_SOCIALQUESTIONCOMMENT_UPDATE_STATUS_DELETE, $this->getEmptyComment());\n }", "public function delete(&$group) {\n\t\t/* As of PHP5.3.0, is_a() is no longer deprecated and there is no need to replace it */\n\t\tif (!is_a($group, 'icms_member_group_Object')) {\n\t\t\treturn false;\n\t\t}\n\t\t$sql = sprintf(\n\t\t\t\"DELETE FROM %s WHERE groupid = '%u'\",\n\t\t\ticms::$xoopsDB->prefix('groups'),\n\t\t\t(int) $group->getVar('groupid')\n\t\t);\n\t\tif (!$result = icms::$xoopsDB->query($sql)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "protected function canDelete($record)\n\t{\n\t\tif (!empty($record->id))\n\t\t{\n\t\t\tif ($record->state != -2)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t$user = JFactory::getUser();\n\t\t\t\n\t\t\treturn $user->authorise('core.delete', 'com_cooltouraman.course.' . (int) $record->id);\n\t\t}\n\n\t\treturn false;\n\t}", "public function delete(User $user, Group $group)\n {\n return $user->id == $group->user_id;\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webkul_Marketplace::product');\n }", "protected function canDelete()\n {\n if (!Validate::isLoadedObject($this)) {\n return true;\n }\n\n /** @var Gamifications $module */\n $module = Module::getInstanceByName('gamifications');\n $em = $module->getEntityManager();\n\n /** @var GamificationsRewardRepository $rewardRepository */\n $rewardRepository = $em->getRepository(__CLASS__);\n $isInUse = $rewardRepository->isRewardInUse($this->id);\n\n return !$isInUse;\n }", "public function isAdmin() {\n\t\t$groupId = $this->Session->read('UserAuth.User.user_group_id');\n\t\tif($groupId==ADMIN_GROUP_ID) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function AdminSecurityCheck(){\n\t\t$User = new User();\n\t\t$user = $this->session->userdata('Group');\n\t\tif ($user){\n\t\t\tif($user == 1){\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\treturn false;\n\t\t}\n\t}", "public function beforeDelete()\n {\n if($this->group_id == 0)\n return true;\n\n $total = RoleManager::for($this->group->code)->countRoles();\n $myOrder = $this->sort_order;\n\n if($myOrder === $total)\n return true;\n\n $roles = RoleManager::for($this->group->code)->getSortedGroupRoles();\n\n $difference = $total - $myOrder;\n\n for($i = 0; $i < $difference; $i++)\n {\n $role = $roles[$total - $i];\n $role->sort_order = $total - $i - 1;\n $role->save();\n }\n\n }", "public function authorize()\n {\n return auth()->user()->can('create-product-packages');\n }", "function userCanDeleteInterim( $sessionID ) {\r\n\t\treturn $this->getAccessLevel() > 8;\r\n\t}", "public function canDELETE($collection = null) {\r\n $rights = $this->getRights($collection, 'delete');\r\n return is_bool($rights) ? $rights : true;\r\n }", "public function authorize()\n {\n $company_id = auth()->user()->cmpny_id;\n $group_id = request()->post('id');\n $group = Group::find($group_id);\n if ($group_id && (!isset($group->id) || empty($group->id)))\n {\n return false;\n }\n if (!empty($group->id) && ($company_id != $group->cmpny_id))\n {\n return false;\n }\n\n return true;\n }", "public function delete()\n {\n return parent::delete()\n && ProductComment::deleteGrades($this->id)\n && ProductComment::deleteReports($this->id)\n && ProductComment::deleteUsefulness($this->id);\n }", "public function authorize()\n {\n $this->translation = Translation::findByUuidOrFail($this->route('id'));\n\n return $this->user()->can('delete', [Translation::class, $this->translation->node->project]);\n }", "protected function canDelete($record) { return false; }", "public function canDelete($userId = \"\")\n {\n\n if ($userId == \"\")\n $userId = Yii::$app->user->id;\n\n if ($this->user_id == $userId)\n return true;\n\n if (Yii::$app->user->isAdmin()) {\n return true;\n }\n\n if ($this->container instanceof Space && $this->container->isAdmin($userId)) {\n return true;\n }\n\n return false;\n }", "public function canDelete()\n {\n if ( null === $this->_canDelete )\n {\n $model = new Application_Model_AudioJobMapper();\n $results = $model->fetchAll( 'service_id = ' . $this->id );\n $this->_canDelete = !(bool) count( $results );\n }\n return $this->_canDelete;\n }", "protected function _isAllowed()\n {\n return $this->_authorization->isAllowed('Webkul_MpAuction::auc_auto_bid_delete');\n }", "function canDelete(&$msg, $oid = NULL) {\n\t\t//$tables[] = array( 'label' => 'Users', 'name' => 'users', 'idfield' => 'user_id', 'joinfield' => 'user_company' );\n\t\t//return CDpObject::canDelete( $msg, $oid, $tables );\n\t\treturn true;\n\t}", "public function isAllowed()\n {\n $result = new \\Magento\\FrameWork\\DataObject(['is_allowed' => true]);\n $this->_eventManager->dispatch(\n 'ves_vendor_menu_check_acl',\n [\n 'resource' => $this->_resource,\n 'result' => $result\n ]\n );\n $permission = new \\Vnecoms\\Vendors\\Model\\AclResult();\n $this->_eventManager->dispatch(\n 'ves_vendor_check_acl',\n [\n 'resource' => $this->_resource,\n 'permission' => $permission\n ]\n );\n return $result->getIsAllowed() && $permission->isAllowed();\n }", "protected function canDelete($record)\n\t{\n\t\t$user = JFactory::getUser();\n\n\t\tif (JFactory::getApplication()->isAdmin())\n\t\t{\n\t\t\treturn $user->authorise('core.delete', 'com_solidres.reservationasset.'.(int) $record->id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn SRUtilities::isAssetPartner($user->get('id'), $record->id);\n\t\t}\n\t}", "public function isAuthorized($user){\n /*\n * \n 1 \tAdmin\n 2 \tOfficer / Manager\n 3 \tRead Only\n 4 \tStaff\n 5 \tUser / Operator\n 6 \tStudent\n 7 \tLimited\n */\n \n //managers can add / edit\n if (in_array($this->request->action, ['delete','add','edit','reorder'])) {\n if ($user['group_id'] <= 4) {\n return true;\n }\n }\n \n \n //Admins have all\n return parent::isAuthorized($user);\n }", "public function onDelete(ResourceEvent $event)\n {\n $groupId = $event->getRouteParam('group_id');\n $userId = $event->getRouteParam('user_id');\n \n $this->getService()->removeAdmin($groupId, $userId);\n \n return true;\n }", "function delete(){\n if($this->session->userdata['brands_per']['delete']==1){ // check permission of current user for delete purchase decomposition\n if($this->input->post('guid')){ \n $this->load->model('items');\n $guid=$this->input->post('guid');\n $status=$this->items->check_approve($guid);// check if the purchase decomposition was already apparoved or what\n if($status!=FALSE){\n $this->posnic->posnic_delete($guid,'decomposition'); // delete the purchase decomposition\n echo 'TRUE';\n }else{\n echo 'Approved';\n }\n \n }\n }else{\n echo 'FALSE';\n }\n \n}", "protected function _isAllowed()\r\n {\r\n return Mage::getSingleton('admin/session')->isAllowed('system/thetailor_workgroup_workflow');\r\n }", "public function authorize() : bool\n {\n return auth()->user()->can('create', GroupSetting::class);\n }", "public function delete(User $user)\n {\n $test = DB::table('permissions')->get()->first();\n if ($test->delete_commande and $test->id_user == $user->id){\n return true;\n }else{\n return false;\n }\n }", "public function getCanDeleteProperty()\n {\n return $this->deleteConfirm === $this->staff->email;\n }", "public function forceDelete(User $user, Product $product)\n {\n return $user->isAdmin();\n }", "public function delete(User $user, Product $checkoutProduct)\n {\n if ($user->is_admin) {\n return true;\n }\n\n return false;\n }", "protected function check_delete_permission($post)\n {\n }", "public function delete(User $user)\n {\n return $user->role->can_delete_post == 1;\n }" ]
[ "0.70508564", "0.69619745", "0.6786658", "0.6781911", "0.67518157", "0.66523457", "0.66341066", "0.66200644", "0.6601603", "0.6574322", "0.656434", "0.6516448", "0.6495592", "0.64787084", "0.64469486", "0.64425135", "0.6405183", "0.6395858", "0.6372891", "0.6371689", "0.6369796", "0.63691187", "0.6366371", "0.6364767", "0.63469696", "0.6299887", "0.6283861", "0.62482363", "0.62282664", "0.6222596", "0.62210464", "0.622029", "0.6216551", "0.6207104", "0.61852413", "0.6153517", "0.61442345", "0.61441565", "0.6133075", "0.6122669", "0.6109824", "0.61087906", "0.6105217", "0.60656357", "0.6057921", "0.60544956", "0.6051241", "0.6039784", "0.6036358", "0.6030912", "0.60294616", "0.6014806", "0.60073614", "0.60064363", "0.5995423", "0.59859425", "0.598026", "0.597319", "0.5948812", "0.5946768", "0.5946276", "0.59460974", "0.59415984", "0.5936979", "0.5936228", "0.5933282", "0.59325826", "0.5898453", "0.58944696", "0.5889048", "0.5884039", "0.58813894", "0.5880267", "0.5879513", "0.58773106", "0.58708495", "0.5870063", "0.5869333", "0.5853239", "0.58344436", "0.5833066", "0.5826544", "0.58265173", "0.5825461", "0.58237904", "0.5823261", "0.5821514", "0.58199346", "0.5815005", "0.5813746", "0.58011353", "0.58001083", "0.5794906", "0.57892984", "0.5785122", "0.5784851", "0.5784065", "0.57798475", "0.57732105", "0.57711273", "0.5769123" ]
0.0
-1
Constructor to initialize the object with data
public function __construct($data) { $this->_name = $data->name; $this->_option = ($data->optional == '1') ? true : false; $data = (array) $data; $this->_description = $data['$t']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function __construct( $data ){\n\t\t\t\n\t\t\t$this->init( $data );\n\t\t}", "public function __construct($data = array()){\r\n\r\n\t\t$this->data = $data;\r\n\r\n\t}", "public function __construct()\n {\n $args = func_get_args ();\n if (empty ( $args [0] )) {\n $args [0] = array ();\n }\n $this->_data = $args [0];\n }", "public function __construct($data)\n {\n }", "public function __construct($data)\n {\n }", "public function __construct($data)\n {\n }", "public function __construct($data)\n {\n }", "function __construct($data){\n\t $this->data=$data;\n }", "public function __construct($data) {\n $this->setValues($data);\n }", "public function __construct( array $data = array() )\n {\n\n $this->initFromArray( $data );\n\n }", "public function __construct($data) {\n $this->data = $data;\n }", "public function __construct($data)\n {\n //\n $this->data = $data;\n }", "public function __construct($data = null)\n {\n $this->init($data);\n }", "public function __construct($data)\n {\n $this->_data = $data;\n }", "public function __construct($data)\n {\n $this->_data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function initialize()\n\t{\n\t\t$this->data = new stdClass();\n\t}", "public function __construct($data)\n {\n $this->data = $data;\n\n }", "public function __construct($data)\n {\n $this->data = $data;\n\n }", "public function __construct($data)\n {\n $this->all_data = $data;\n }", "public function __construct($data){\r\n $this->data = $data;\r\n }", "public function __construct($data = array())\n {\n $this->setData($data);\n }", "public function __construct ($data)\n {\n $this->_data = $data;\n }", "function __construct($data) {\n\t\t$this->data = json_decode($data, true);\n\t}", "public function __construct($data)\n {\n $this->data=$data;\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct( $data )\n {\n $this->data = $data;\n }", "public function initialize()\n {\n $this->data = new stdClass();\n }", "function __construct(array $data=null)\n\t\t{\n\t\t\t$this->data = $data;\n\t\t}", "public function __construct($data)\n {\n // notice it's not included in the \"toArray\" method.\n $this->instance = $data['instance'];\n $this->id = $data['id'];\n $this->dom = $data['dom'];\n $this->data = $data['data'];\n $this->name = $data['name'];\n $this->checksum = $data['checksum'];\n $this->children = $data['children'];\n $this->events = $data['events'];\n }", "function __construct($data) {\r\n\t\t$this->annee = (isset($data['annee'])) ? $data['annee'] : \"\";\r\n\t\t$this->tDate = (isset($data['tDate'])) ? $data['tDate'] : \"\";\r\n\t}", "public function __construct($data = array()) {\n if (empty($data)) {\n $data = array();\n }\n $this->data = $data;\n }", "function __construct(array $data)\n\t{\n if (isset($data)) {\n $this->id = $data['id'];\n $this->name = $data['name'];\n $this->description = $data['description'];\n }\n\t}", "public function __construct(array $data) {\n // no id if we're creating as it comes from the database\n if(isset($data['id'])) {\n $this->id = $data['id'];\n }\n $this->jsonData = $data['jsonData'];\n $this->electionTitle = $data['electionTitle'];\n $this->beginDate = $data['beginDate'];\n $this->endDate = $data['endDate'];\n $this->coefficients = $data['coefficients'];\n $this->appVersion = $data['appVersion'];\n }", "public function __construct($data)\n {\n //\n $this->name = $data['name'];\n $this->phone = $data['phone']; \n $this->place = $data['place']; \n $this->date = $data['date'];\n $this->time = $data['time'];\n $this->people = $data['people']; \n $this->seating = $data['seating']; \n $this->content = $data['message'];\n }", "public function __construct($data)\n {\n $this->data = $data;\n }", "public function __construct(array $data){\t\n\t\t$this->data=$data;\n\t}", "protected function __construct($data=null)\n {\n $this->data = $data;\n }", "public function __construct($data)\n {\n $this->data=$data;\n }", "public function __construct($data = null) {\n parent::__construct();\n if ($data !== null) { // If data is given to us, test that data\n $this->data = $data;\n }\n else { // Otherwise test the sample data here\n $this->data = \"Jan,2,3\\nFeb,,8\\nMar,6,13\";\n }\n $this->results = array();\n }", "function __construct($data) {\n assert(isset($data['id']));\n $this->data = $data;\n $this->connection = new Database();\n }", "public function __construct() {\r\n\t\t$this->_data = array(\r\n\t\t\t'Steve' => array(\r\n\t\t\t\t'id' => 1,\r\n\t\t\t\t'userid' => 'Steve',\r\n\t\t\t\t'passwd' => 'lollypop',\r\n\t\t\t\t'inactive' => 'N',\r\n\t\t\t\t'dept_field' => 'North',\r\n\t\t),\r\n\t\t\t'Sally' => array(\r\n\t\t\t\t'id' => 2,\r\n\t\t\t\t'userid' => 'Sally',\r\n\t\t\t\t'passwd' => 'sallybop',\r\n\t\t\t\t'inactive' => 'N',\r\n\t\t\t\t'dept_field' => 'East',\r\n\t\t),\r\n\t\t\t'Sam' => array(\r\n\t\t\t\t'id' => 3,\r\n\t\t\t\t'userid' => 'Sam',\r\n\t\t\t\t'passwd' => 'sammydop',\r\n\t\t\t\t'inactive' => 'Y',\r\n\t\t\t\t'dept_field' => 'West',\r\n\t\t),\r\n\t\t\t);\r\n\r\n\t}", "public function __construct( $data )\n\t{\n\t\t$this->habbo = $data;\n\n\t\t/**\n\t\t * Analizar\n\t\t */\n\t\t$this->parse();\n\t}", "public function __construct($data)\n {\n $this->data = $data;\n $this->createdTime = time();\n }", "public function __construct(array $data){\n\t\t$this->data=$data;\n\t}", "function __construct($data = null) {\n if ($data !== null) {\n $this->id = (isset($data[0]['id'])) ? $data[0]['id'] : \"\";\n $this->technology_id = (isset($data[0]['technology_id'])) ? $data[0]['technology_id'] : \"\";\n $this->student_id = (isset($data[0]['student_id'])) ? $data[0]['student_id'] : \"\";\n $this->count = (isset($data[0]['count'])) ? $data[0]['count'] : \"\";\n }\n }", "public function __construct($data = null)\n {\n $this->data = $data;\n }", "public function __construct(public array $data)\n {\n }", "public function __construct($data = [])\n {\n $this->data = $data;\n }", "public function __construct($data = [])\n {\n $this->data = $data;\n }", "public function __construct($data = [])\n {\n $this->data = $data;\n }", "public function __construct($data = [])\n {\n $this->data = $data;\n }", "public function __construct($data)\n\t{\n\t\t$this->data = (array) $data;\n\t}", "public function __construct()\n {\n \t$this->schema();\n\t\t$this->data();\n }", "public function __construct($data) {\n\t\t$this->data = $data;\n\n\t\t$this->env = $_ENV;\n\t\t$this->setUrls();\n\t\t$this->formatData();\n\t\t$this->execute();\n\t}", "public function __construct(array $data = array())\n {\n $this->setFromArray($data);\n }", "function __construct()\n {\n $this->_data = array();\n }", "public function __construct(array $data = array()) {\n $this->setData($data);\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->events = Events::getInstance();\n\n // Setup the Data Entries.\n $this->data = array(\n 'headerMetaData' => array(),\n 'headerCSSheets' => array(),\n 'headerJScripts' => array(),\n 'footerJScripts' => array(),\n );\n }", "function __construct($data)\n {\n $this->Id = @$data['id'];\n $this->navegador = @$data['navegador'];\n $this->pregunta = @$data['pregunta'];\n $this->respuesta = @$data['respuesta'];\n }", "function __construct(array $data)\n {\n if (isset($data)) {\n $this->id = $data['id'];\n $this->title = $data['title'];\n $this->shortDescription = $data['short_description'];\n $this->content = $data['content'];\n $this->imagePath = $data['image_path'];\n $this->visible = $data['visible'];\n }\n }", "public function __construct(array $data)\n {\n //\n $this->data = $data;\n }", "public function __construct( $data = []){\n parent::__construct($data);\n }", "public function __construct($data)\n {\n //\n $this->name = $data->get('name');\n $this->email_from = $data->get('email_from');\n $this->email = $data->get('email');\n $this->email_cc = $data->get('email_cc');\n $this->email_bcc = $data->get('email_bcc');\n $this->subject_name = $data->get('subject_name');\n $this->hero_name = $data->get('hero_name');\n $this->department = $data->get('department');\n $this->total_channel_cycle = $data->get('total_channel_cycle');\n $this->total_no_channel_cycle = $data->get('total_no_channel_cycle');\n $this->no_enter_cycle_percent = $data->get('no_enter_cycle_percent');\n }", "public function __construct($data)\n\t{\n\t\t$data = (array)$data;\n\t\tforeach($data as $key => $value)\n\t\t{\n\t\t\t$this->$key = $value;\n\t\t}\n\t}", "public function __construct()\n {\n // Setup internal data arrays\n self::internals();\n }", "public function __construct(array $data = array())\n {\n $this->_data = $data;\n }", "public function __construct($data = array()){\n parent::__construct($data);\n }", "public function __construct($data = array()) {\n \n if(!is_array($data)){\n return;\n }\n \n foreach ($data as $key => $value) {\n $key = $this->_getKey($key);\n if(!$key) {\n continue;\n }\n \n $this->$key = $value;\n }\n }", "public function __construct($data = null)\n\t{\n\t\t$this->merge($data);\n\t}", "public function __construct($data = null)\n {\n if ($data) {\n $this->validate($data);\n }\n $this->data = $data;\n }", "function __construct($data = [])\n {\n if(is_array($data) || is_object($data)){\n foreach ($data as $key => $value) {\n // duyệt qua mảng hoặc object để gán key, value ở level 0 cho biến data\n $this->__data__[$key] = $value;\n }\n }\n }", "public function __construct($data)\n {\n $this->name = $data['name'];\n $this->email = $data['email'];\n $this->phone = $data['phone'];\n $this->message = $data['message'];\n }", "public function __construct($data)\n {\n //\n $this->franchisee = $data['franchiseename'];\n $this->notes = $data['notes'];\n //print_r($this);die;\n }", "public function __construct(array $data) {\n $this->data = $data;\n }", "function __construct(array $data)\n\t{\n if (isset($data)) {\n $this->id = $data['id'];\n $this->productid = $data['product_id'];\n $this->pattern = $data['pattern'];\n }\n\t}", "public function __construct(array $data)\n\t{\n\t\t$this->name = $data['name'];\n $this->title = $data['title'];\n $this->phone = $data['phone'];\n $this->email = $data['email'];\n\t}", "public function __construct(array $data)\n {\n $this->generate($data);\n }", "public function __construct(array $data) {\n // no id if we're creating\n if(isset($data['id'])) {\n $this->id = $data['id'];\n }\n\n $this->rua = $data['rua'];\n $this->numero = $data['numero'];\n $this->bairro = $data['bairro'];\n $this->cidade = $data['cidade'];\n $this->estado = $data['estado'];\n $this->cep = $data['cep'];\n }", "public function __construct(array $data = [])\n {\n }", "public function __construct($data)\n {\n $this->setLogger($data['logger']);\n $this->setModelFactory($data['model_factory']);\n }", "public function __construct( array $data = [] )\n {\n\n $this->reinitFromArray( $data );\n\n }" ]
[ "0.8442607", "0.83434355", "0.82620907", "0.82589483", "0.82589483", "0.8257881", "0.8257881", "0.8198751", "0.8111984", "0.8092249", "0.8059452", "0.8043899", "0.8041433", "0.79993933", "0.79993933", "0.7995962", "0.7995962", "0.7995962", "0.7995962", "0.7995962", "0.7995962", "0.7995962", "0.7995962", "0.7995962", "0.7995962", "0.7995962", "0.7995962", "0.7995962", "0.7995962", "0.7995962", "0.7995962", "0.7995962", "0.7995962", "0.7995962", "0.7995962", "0.79957896", "0.7983689", "0.7983689", "0.7982831", "0.7967647", "0.796747", "0.7960795", "0.79557675", "0.7950475", "0.794814", "0.7935782", "0.7934988", "0.7922718", "0.78943795", "0.7890284", "0.7885478", "0.7876837", "0.7874241", "0.7863731", "0.7862581", "0.78522605", "0.7826166", "0.77876955", "0.7784223", "0.7773362", "0.77733094", "0.7758687", "0.7755418", "0.775223", "0.7734331", "0.7730971", "0.7723787", "0.7713204", "0.7713204", "0.7713204", "0.7713204", "0.7712247", "0.7707898", "0.76944864", "0.76860124", "0.76810664", "0.7675388", "0.7665479", "0.76540124", "0.76510835", "0.76489633", "0.7647087", "0.7642968", "0.7617368", "0.7614675", "0.7614065", "0.7612846", "0.7609919", "0.7608399", "0.7600004", "0.7594939", "0.75912696", "0.758771", "0.75833267", "0.75757617", "0.75747806", "0.7552553", "0.75424993", "0.75356007", "0.7513396", "0.75098556" ]
0.0
-1